:root {
  color-scheme: dark;
  --bg: #0e100e;
  --surface: #141713;
  --surface-raised: #191c18;
  --border: #343831;
  --border-strong: #4a5046;
  --text: #e7e9e1;
  --muted: #92988c;
  --faint: #666c62;
  --red: #ef5b3f;
  --red-soft: #2b1915;
  --green: #b9df41;
  --green-soft: #1b2312;
  --danger: #ff806c;
  --max-width: 1120px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); line-height: 1.55; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.skip-link { position: fixed; z-index: 10; top: 8px; left: 8px; padding: 8px 12px; background: var(--red); color: #160b08; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

.site-header { border-bottom: 1px solid var(--border); background: rgba(14, 16, 14, .96); }
.nav-shell { width: min(var(--max-width), calc(100% - 40px)); min-height: 62px; margin: 0 auto; display: flex; align-items: center; gap: 34px; }
.wordmark { color: var(--text); font-weight: 800; font-size: 1.1rem; letter-spacing: -.06em; white-space: nowrap; }
.wordmark span { color: var(--red); }
.nav-links { align-self: stretch; display: flex; align-items: stretch; gap: 28px; }
.nav-links a { position: relative; display: flex; align-items: center; color: var(--muted); font-size: .8rem; }
.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current="page"] { color: var(--text); }
.nav-links a[aria-current="page"]::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--red); }
.nav-user { margin-left: auto; color: var(--faint); font-size: .75rem; overflow: hidden; text-overflow: ellipsis; }

.page-shell { width: min(var(--max-width), calc(100% - 40px)); margin: 0 auto; padding: 58px 0 80px; }
.narrow-page { max-width: 760px; }
.page-heading { min-height: 108px; padding-bottom: 22px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.page-heading h1, .auth-panel h1 { margin: 4px 0 0; font-size: clamp(1.8rem, 4vw, 2.45rem); line-height: 1.1; font-weight: 550; letter-spacing: -.055em; }
.page-heading h1, .auth-panel h1, .guide-step h2 { text-wrap: balance; }
.section-label, .page-count { margin: 0; color: var(--muted); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; }
.page-count { padding-bottom: 5px; }

.button { min-height: 40px; padding: 9px 14px; border: 1px solid var(--border-strong); border-radius: 3px; background: var(--surface-raised); color: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-size: .78rem; font-weight: 650; }
.button:hover { border-color: var(--muted); background: #20241f; }
.button-primary { border-color: var(--red); background: var(--red); color: #160b08; }
.button-primary:hover { border-color: #ff775e; background: #ff775e; }
.button-danger { border-color: #8b4438; color: var(--danger); background: var(--red-soft); }
.back-link { display: inline-block; margin-bottom: 22px; color: var(--muted); font-size: .78rem; }
.back-link:hover { color: var(--red); }

.guide { margin: 0; padding: 0; list-style: none; }
.guide-step { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 18px; padding: 28px 0; border-bottom: 1px solid var(--border); }
.step-number, .row-index { color: var(--faint); font-size: .72rem; }
.guide-step h2, .action-panel h2, .account-section h2 { margin: -3px 0 6px; font-size: .96rem; font-weight: 650; }
.guide-step p, .account-section p { margin: 0; color: var(--muted); font-size: .84rem; }
.command { max-width: 740px; margin-top: 15px; border: 1px solid var(--border); background: #090b09; display: flex; align-items: stretch; }
.command code { min-width: 0; flex: 1; padding: 12px 14px; overflow-x: auto; color: #cdd1c7; font-size: .78rem; white-space: nowrap; }
.copy-button { width: 72px; border: 0; border-left: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; font-size: .7rem; }
.copy-button:hover { color: var(--red); }
.copy-status { min-height: 24px; color: var(--muted); font-size: .72rem; }

.data-list { margin-top: 0; }
.data-head, .data-row { display: grid; align-items: center; column-gap: 20px; }
.data-head { grid-template-columns: 42px minmax(190px, 1fr) 100px 130px 24px; min-height: 42px; border-bottom: 1px solid var(--border); color: var(--faint); font-size: .65rem; letter-spacing: .1em; text-transform: uppercase; }
.data-row { grid-template-columns: 42px minmax(190px, 1fr) 100px 130px 24px; min-height: 70px; border-bottom: 1px solid var(--border); font-size: .8rem; transition: background-color 120ms ease; }
.data-row:hover { background: var(--surface); }
.data-row strong { font-size: .9rem; font-weight: 550; }
.progress { color: var(--green); }
.row-arrow { color: var(--red); text-align: right; font-size: 1rem; }
.mobile-label { display: none; }

.task-heading { min-height: 128px; }
.progress-summary { min-width: 140px; padding-left: 18px; border-left: 1px solid var(--border); }
.progress-summary span { display: block; color: var(--muted); font-size: .67rem; text-transform: uppercase; letter-spacing: .08em; }
.progress-summary strong { display: block; margin-top: 4px; color: var(--green); font-size: 1.45rem; font-weight: 550; }
.action-panel { margin-top: 28px; padding: 24px; border: 1px solid var(--border); background: var(--surface); }
.action-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .8rem; }
td, .progress, .progress-summary strong, .page-count { font-variant-numeric: tabular-nums; }
th, td { height: 60px; padding: 0 16px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
thead th { height: 42px; color: var(--faint); font-size: .65rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }
tbody th { font-weight: 550; }
tbody tr.current-user { background: var(--surface); box-shadow: inset 2px 0 var(--red); }
.you-label { margin-left: 10px; color: var(--red); font-size: .62rem; font-weight: 500; text-transform: uppercase; }
.empty-state { margin: 28px 0; color: var(--muted); font-size: .84rem; }

.account-section { padding: 28px 0; border-bottom: 1px solid var(--border); }
.account-section p { max-width: 650px; margin-bottom: 18px; }
.message { margin: 24px 0 0; padding: 14px 16px; border: 1px solid var(--border); font-size: .78rem; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.message strong { font-weight: 650; }
.message a { margin-left: auto; text-decoration: underline; text-underline-offset: 3px; }
.message-error { border-color: #78473f; background: var(--red-soft); color: #ffb2a4; }
.message-success { border-color: #53652c; background: var(--green-soft); color: #d4ee83; }

.auth-page { display: grid; place-items: center; padding: 32px 20px; }
.auth-shell { width: min(100%, 430px); }
.auth-wordmark { display: inline-block; margin-bottom: 24px; font-size: 1.25rem; }
.auth-panel { padding: 28px; border: 1px solid var(--border); background: var(--surface); }
.form-stack { display: flex; flex-direction: column; gap: 17px; margin-top: 26px; }
.form-stack label { display: flex; flex-direction: column; gap: 7px; color: var(--muted); font-size: .74rem; }
input { width: 100%; min-height: 43px; padding: 9px 11px; border: 1px solid var(--border-strong); border-radius: 2px; background: #0a0c0a; color: var(--text); }
input:hover { border-color: var(--muted); }
.auth-switch { margin: 20px 0 0; color: var(--muted); font-size: .74rem; }
.auth-switch a { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 720px) {
  .nav-shell { width: 100%; padding: 0 18px; min-height: auto; flex-wrap: wrap; gap: 0 20px; }
  .wordmark { min-height: 56px; display: flex; align-items: center; }
  .nav-user { max-width: 42%; }
  .nav-links { order: 3; width: 100%; min-height: 44px; gap: 22px; overflow-x: auto; }
  .nav-links a { flex: 0 0 auto; }
  .page-shell { width: min(100% - 28px, var(--max-width)); padding: 36px 0 56px; }
  .page-heading { min-height: 92px; align-items: flex-end; }
  .page-heading .button { max-width: 160px; text-align: center; }
  .guide-step { grid-template-columns: 38px minmax(0, 1fr); gap: 8px; }
  .data-head { display: none; }
  .data-row { position: relative; grid-template-columns: 34px 1fr 28px; grid-template-areas: "index title arrow" ". stores arrow" ". progress arrow"; gap: 5px 8px; padding: 17px 0; }
  .data-row .row-index { grid-area: index; }
  .data-row strong { grid-area: title; }
  .data-row > :nth-child(3) { grid-area: stores; color: var(--muted); }
  .data-row .progress { grid-area: progress; }
  .data-row .row-arrow { grid-area: arrow; align-self: center; }
  .mobile-label { display: inline; margin-right: 8px; color: var(--faint); font-size: .62rem; text-transform: uppercase; }
  .task-heading { min-height: 112px; }
  .progress-summary { min-width: 112px; }
  .action-list { flex-direction: column; }
  .action-list .button { width: 100%; }
  .message a { width: 100%; margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
