:root {
  color-scheme: light;
  --page: #eef2ee;
  --paper: #fff;
  --ink: #1c2a25;
  --muted: #68746e;
  --line: #dce4de;
  --green: #1d7557;
  --green-dark: #14563f;
  --lime: #d8ee78;
  --blue: #286c86;
  --coral: #c6593e;
  --shadow: 0 12px 34px rgba(27, 54, 40, 0.06);
}
* { box-sizing: border-box; }
body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background-color: var(--page);
  font: 14px/1.5 "Avenir Next", "Trebuchet MS", sans-serif;
}
button, input { font: inherit; }
button {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--paper);
  font-weight: 700;
  cursor: pointer;
}
button:hover:not(:disabled) { border-color: #a9beb0; background: #f7faf7; }
button:disabled { cursor: not-allowed; opacity: .55; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid rgba(40, 108, 134, .35); outline-offset: 2px; }
input:not([type="checkbox"]) {
  min-height: 39px;
  padding: 8px 10px;
  border: 1px solid #cdd8d0;
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
}
[hidden] { display: none !important; }
.shell { width: min(1000px, calc(100% - 48px)); margin: 0 auto; padding: 18px 0 40px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 16px; border-bottom: 1px solid rgba(28, 42, 37, .12); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; letter-spacing: .04em; text-decoration: none; }
.brand-mark { display: grid; width: 34px; aspect-ratio: 1; place-items: center; border-radius: 8px 8px 8px 2px; background: var(--lime); font: 700 18px Georgia, serif; }
.top-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 12px; }
.user-name { color: var(--muted); }
main { padding-top: 28px; }
h1 { margin: 0 0 6px; font: 500 30px/1.15 Georgia, "Times New Roman", serif; }
h2 { margin: 0 0 6px; font-size: 18px; }
.eyebrow { margin: 0 0 4px; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.panel { padding: 26px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); box-shadow: var(--shadow); }
.panel.narrow { max-width: 440px; margin: 6vh auto 0; }
.panel-copy { margin: 0 0 16px; color: var(--muted); }
.page-heading { margin-bottom: 18px; }
.stack { display: grid; gap: 8px; }
.stack label { font-weight: 700; }
.primary-button { border-color: var(--green-dark); color: #fff; background: var(--green); }
.primary-button:hover:not(:disabled) { border-color: var(--green-dark); background: var(--green-dark); }
.quiet-button { background: transparent; }
.link-button { min-height: 0; padding: 2px 0; border: 0; color: var(--blue); background: none; font-weight: 600; }
.link-button:hover:not(:disabled) { border: 0; background: none; text-decoration: underline; }
.link-row { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 16px; }
.form-status { min-height: 20px; margin: 8px 0 0; color: var(--muted); }
.form-status[data-kind="error"] { color: var(--coral); }
.form-status[data-kind="success"] { color: var(--green); }
.code-box { padding: 14px; border: 1px dashed #a9beb0; border-radius: 6px; background: #f7faf7; font: 600 16px/1.4 Consolas, monospace; overflow-wrap: anywhere; user-select: all; }
.check-row { display: flex; align-items: center; gap: 8px; margin: 14px 0; font-weight: 600; }
.app-grid, .plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; gap: 8px; padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); box-shadow: var(--shadow); }
.card h2 { margin: 0; }
.card p { margin: 0; color: var(--muted); }
.card .button-row { margin-top: auto; padding-top: 8px; }
.card[data-current="true"] { border-color: var(--green); }
.badge { align-self: start; padding: 2px 9px; border-radius: 99px; color: var(--muted); background: #e8eee9; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.badge[data-state="unlocked"] { color: var(--green-dark); background: #d6efe2; }
.badge[data-state="expired"] { color: #8a3b27; background: #f6ddd5; }
.badge[data-state="coming-soon"] { color: #6b5a14; background: #f4ebbd; }
.card[data-access="coming-soon"] { opacity: .75; border-style: dashed; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.inline-form { display: grid; gap: 8px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 16px; }
.facts dt { color: var(--muted); font-weight: 700; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.account-list { display: grid; gap: 8px; margin: 0 0 14px; padding: 0; list-style: none; }
.account-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; }
.account-list .muted { color: var(--muted); }
.account-list li > span:first-child { display: grid; gap: 2px; min-width: 0; }
.account-list small { overflow-wrap: anywhere; }
.account-list li { flex-wrap: wrap; }
.panel + .panel { margin-top: 16px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { display: flex; flex-direction: column; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); box-shadow: var(--shadow); }
.stat-value { font: 500 28px/1.2 Georgia, "Times New Roman", serif; }
.stat-label { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.sync-row { align-items: center; margin-top: 16px; }
.sync-row .panel-copy { margin: 0; }
progress { display: block; width: 100%; height: 10px; margin-top: 14px; accent-color: var(--green); }
.subheading { margin: 18px 0 6px; font-size: 14px; }
.history-list, .error-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; color: var(--muted); }
.error-list { margin-top: 8px; color: var(--coral); max-height: 160px; overflow: auto; }
.notice { margin: 16px 0 0; padding: 12px 14px; border-left: 3px solid var(--blue); border-radius: 4px; background: #e8f1f5; }
.table-scroll { overflow-x: auto; margin-top: 12px; }
.items-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.items-table th, .items-table td { padding: 8px; border-bottom: 1px solid #d9e1e6; text-align: left; vertical-align: middle; }
.item-preview { width: 56px; height: 56px; object-fit: cover; border-radius: 4px; }
dialog { max-width: 420px; padding: 24px; border: 1px solid #d9e1e6; border-radius: 8px; }
dialog::backdrop { background: rgba(0, 0, 0, 0.4); }
.lottery-controls { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 8px; }
.lottery-field { display: grid; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 700; }
.lottery-field select { min-height: 39px; padding: 8px 10px; border: 1px solid #cdd8d0; border-radius: 6px; color: var(--ink); background: #fff; font: inherit; }
.lottery-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 16px; }
.lottery-columns h3, .panel h3 { margin: 0 0 8px; font-size: 16px; }
.lottery-list { display: flex; flex-wrap: wrap; gap: 12px; }
.lottery-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.lottery-ranking { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.lottery-ranking li { display: flex; align-items: center; gap: 10px; }
.lottery-count { color: var(--muted); font-size: 12px; }
.ball { display: inline-grid; min-width: 34px; height: 34px; padding: 0 6px; place-items: center; border-radius: 99px; color: var(--ink); background: var(--lime); font-weight: 800; }
.ball-bonus { color: #fff; background: var(--coral); }
.lottery-table { width: 100%; border-collapse: collapse; }
.lottery-table th, .lottery-table td { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.lottery-balls { display: flex; flex-wrap: wrap; gap: 6px; }
