:root {
  color-scheme: dark;
  --paper: #0f1412;
  --paper-deep: #252e29;
  --ink: #edf3e8;
  --muted: #95a49a;
  --line: #354239;
  --moss: #b8df48;
  --moss-dark: #8eae2f;
  --coral: #ff795f;
  --cream: #f7faef;
  --panel: #171e1a;
  --shadow: 0 24px 70px rgba(0, 0, 0, .34);
  --radius-lg: 20px;
  --radius-md: 12px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-synthesis: none;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { min-width: 320px; background: var(--paper); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app-background { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.app-background::before {
  position: absolute; inset: 0; content: ""; opacity: .22;
  background-image: linear-gradient(rgba(184,223,72,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(184,223,72,.05) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}
.background-orb { position: absolute; border-radius: 999px; filter: blur(2px); opacity: .6; }
.background-orb-one { width: 320px; height: 320px; top: -190px; right: -130px; background: #394d1d; opacity: .35; }
.background-orb-two { width: 260px; height: 260px; bottom: -150px; left: -130px; background: #19362c; opacity: .55; }

.page-shell { position: relative; width: min(100%, 920px); min-height: 100vh; margin: 0 auto; padding: 16px; }
.setup-view { width: min(100%, 580px); margin: 7vh auto 0; padding: clamp(25px, 6vw, 52px); border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(23,30,26,.9); box-shadow: var(--shadow); backdrop-filter: blur(12px); animation: rise-in .65s ease both; }
.setup-mark { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 0 20px; border: 1px solid var(--moss); border-radius: 7px; color: var(--moss); background: rgba(184,223,72,.08); font-size: 13px; font-weight: 900; letter-spacing: .08em; transform: skew(-8deg); }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 17px; font-family: inherit; font-size: clamp(36px, 8vw, 64px); font-weight: 800; letter-spacing: -.09em; line-height: .98; }
h1 em { color: var(--moss); font-weight: 400; }
.intro-copy { max-width: 440px; margin-bottom: 27px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.setup-form label { display: block; margin: 0 0 9px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.input-wrap { position: relative; }
.input-prefix { position: absolute; top: 50%; left: 16px; color: var(--coral); font-size: 20px; transform: translateY(-54%); }
.input-wrap input { width: 100%; min-height: 50px; padding: 0 14px 0 42px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #101612; outline: none; font-size: 16px; transition: border-color .2s ease, box-shadow .2s ease; }
.input-wrap input:focus { border-color: var(--moss); box-shadow: 0 0 0 3px rgba(184,223,72,.16); }
.button { display: inline-flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 42px; padding: 9px 13px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 800; transition: transform .2s ease, background .2s ease, border-color .2s ease, opacity .2s ease; }
.button:hover:not(:disabled) { transform: translateY(-2px); }
.button:active:not(:disabled) { transform: translateY(0); }
.button:disabled { cursor: wait; opacity: .55; }
.button-primary { width: 100%; margin-top: 12px; color: #10150e; background: var(--moss); }
.button-primary:hover:not(:disabled) { background: var(--moss-dark); }
.button-secondary { color: var(--coral); background: transparent; border-color: rgba(255,121,95,.45); }
.button-secondary:hover:not(:disabled) { border-color: var(--coral); background: rgba(255,121,95,.08); }
.form-error { margin: 10px 0 0; padding: 10px 12px; border-left: 3px solid var(--coral); color: #ffb0a0; background: rgba(255,121,95,.11); font-size: 12px; line-height: 1.4; }
.privacy-note { display: flex; align-items: center; gap: 8px; margin: 18px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.privacy-note span { color: var(--coral); font-size: 18px; }
.text-button { padding: 0; border: 0; color: var(--moss); background: transparent; cursor: pointer; font-size: 12px; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
#cancel-change { display: block; margin: 16px auto 0; padding: 9px 0 3px; }
.reset-everything { display: block; margin: 12px auto 0; padding: 6px 0; color: var(--coral); font-size: 10px; text-decoration: none; }
.reset-everything:hover { color: #ffad9b; text-decoration: underline; }

.checklist-view { width: min(100%, 700px); margin: 1vh auto 0; padding-bottom: 25px; animation: rise-in .5s ease both; }
.app-header { display: flex; align-items: center; justify-content: space-between; padding: 4px 0 13px; }
.app-chip { display: inline-flex; padding: 4px 6px; border-left: 3px solid var(--moss); color: var(--moss); background: rgba(184,223,72,.08); font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.icon-button { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 9px; color: var(--moss); background: var(--panel); cursor: pointer; transition: border-color .2s ease, transform .2s ease, background .2s ease; }
.icon-button:hover { border-color: var(--moss); background: rgba(184,223,72,.1); transform: rotate(12deg); }
.icon-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.progress-card { padding: 12px 14px 11px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(23,30,26,.92); box-shadow: 0 10px 35px rgba(0,0,0,.18); }
.progress-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 15px; }
.progress-card strong { color: var(--moss); font-size: 14px; font-weight: 800; }
.progress-reset { padding: 3px 0; border: 0; color: var(--muted); background: transparent; cursor: pointer; font-size: 10px; font-weight: 700; text-decoration: none; }
.progress-reset:hover:not(:disabled) { color: var(--ink); text-decoration: none; }
.progress-reset:disabled { cursor: wait; opacity: .55; }
.progress-track { height: 5px; margin: 9px 0 0; overflow: hidden; border-radius: 99px; background: var(--paper-deep); }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--moss); transition: width .35s cubic-bezier(.2,.8,.2,1); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 7px; padding: 10px 0 14px; }
.toolbar .button { min-height: 36px; padding: 7px 11px; font-size: 11px; }
.toolbar .button-secondary { width: 100%; justify-content: center; }
.loading-state { display: flex; align-items: center; gap: 12px; padding: 35px 0; color: var(--muted); font-size: 13px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--paper-deep); border-top-color: var(--coral); border-radius: 50%; animation: spin .75s linear infinite; }
.error-panel { display: flex; gap: 13px; padding: 17px; border: 1px solid rgba(255,121,95,.5); border-radius: var(--radius-md); background: rgba(255,121,95,.09); margin-top: 20px; }
.error-icon { display: grid; flex: 0 0 27px; place-items: center; width: 27px; height: 27px; border-radius: 50%; color: #1a100d; background: var(--coral); font-weight: 900; }
.error-panel h2 { margin: 2px 0 7px; font-size: 16px; font-weight: 800; }
.error-panel p { margin-bottom: 14px; color: #ffb0a0; font-size: 12px; line-height: 1.5; }
.error-actions { display: flex; align-items: center; gap: 18px; flex-wrap: nowrap; }
.error-actions .button { min-height: 38px; }
.error-actions .button-primary { width: auto; min-width: 150px; margin-top: 0; justify-content: center; }
.error-actions .text-button { flex: 0 0 auto; white-space: nowrap; }
.checklist-content { margin-top: 12px; }
.checklist-list { display: grid; gap: 9px; }
.checklist-group { border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(23,30,26,.86); box-shadow: 0 8px 25px rgba(0,0,0,.16); animation: rise-in .5s ease both; animation-delay: var(--group-delay); }
.checklist-group summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 11px; color: var(--ink); cursor: pointer; list-style: none; user-select: none; }
.checklist-group summary::-webkit-details-marker { display: none; }
.group-summary-main { display: flex; min-width: 0; align-items: center; gap: 8px; }
.group-heading { font-size: 14px; font-weight: 800; }
.group-summary-meta { display: flex; align-items: center; gap: 9px; }
.group-count { min-width: 34px; padding: 4px 6px; border: 1px solid rgba(184,223,72,.35); border-radius: 5px; color: var(--moss); background: rgba(184,223,72,.08); font-size: 10px; font-weight: 900; text-align: center; }
.group-toggle { width: 18px; height: 18px; color: var(--moss); fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; transition: transform .2s ease; }
.checklist-group:not([open]) .group-toggle { transform: rotate(180deg); }
.group-items { padding: 0 8px 8px; }
.checklist-item { border-top: 1px solid rgba(53,66,57,.8); animation: fade-in .4s ease both; }
.item-label { display: flex; align-items: flex-start; gap: 10px; min-height: 52px; padding: 11px 7px; cursor: pointer; }
.item-label input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.checkbox-visual { position: relative; flex: 0 0 22px; width: 22px; height: 22px; margin-top: 1px; border: 1.5px solid #647268; border-radius: 5px; background: #101612; transition: background .2s ease, border-color .2s ease, transform .2s ease; }
.checkbox-visual::after { position: absolute; top: 3px; left: 7px; width: 6px; height: 11px; border: solid transparent; border-width: 0 2px 2px 0; content: ""; transform: rotate(45deg) scale(0); transition: transform .2s ease; }
.item-label input:checked + .checkbox-visual { border-color: var(--moss); background: var(--moss); }
.item-label input:checked + .checkbox-visual::after { border-color: white; transform: rotate(45deg) scale(1); }
.item-label input:focus-visible + .checkbox-visual { outline: 3px solid rgba(61,96,76,.28); outline-offset: 3px; }
.item-label:active .checkbox-visual { transform: scale(.92); }
.item-copy { display: grid; gap: 3px; min-width: 0; }
.item-title { color: var(--ink); font-size: 13px; line-height: 1.4; transition: color .2s ease; }
.item-description { color: var(--muted); font-size: 10px; line-height: 1.45; }
.is-checked .item-title { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }

@keyframes rise-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 560px) {
  .page-shell { padding: 10px; }
  .setup-view { margin-top: 1vh; padding: 24px 17px 20px; border-radius: 16px; }
  .setup-mark { width: 46px; height: 46px; margin-bottom: 17px; }
  .intro-copy { margin-bottom: 23px; font-size: 12px; }
  #cancel-change { margin-top: 19px; padding: 10px 0 4px; }
  .checklist-view { margin-top: 0; }
  .app-header { padding-bottom: 10px; }
  .progress-card { padding: 10px 12px 9px; }
  .progress-card-top { align-items: baseline; flex-direction: row; gap: 7px; }
  .progress-card strong { font-size: 12px; }
  .toolbar { padding: 8px 0 11px; }
  .error-panel { padding: 14px; }
  .error-actions { align-items: center; flex-direction: row; gap: 12px; }
  .error-actions .button-primary { min-width: 0; flex: 1 1 auto; }
}

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