/* Away mode — one screen, read in a supermarket aisle, one-handed, possibly on a bad
   connection. Big tap targets, high contrast, no decoration that costs bytes. Palette echoes
   casazion (paper/ink/brass) so it reads as the same household, not a different product. */

:root {
  --paper: #FAF7F1;
  --card:  #FFFFFF;
  --ink:   #3A342B;
  --muted: #7A7263;
  --line:  #E4DDD0;
  --brass: #9A7B3F;
  --warn:  #7E6029;
  --done:  #B4AB9A;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1C1A17;
    --card:  #24211D;
    --ink:   #EFEADF;
    --muted: #9A9284;
    --line:  #35312B;
    --brass: #C9A968;
    --warn:  #D8B872;
    --done:  #6A6357;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper); color: var(--ink);
  font-family: var(--font-ui); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding: max(16px, env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  max-width: 640px; margin: 0 auto;
}

h1 { font-family: var(--font-display); font-size: 26px; font-weight: 600; margin: 2px 0 0; }
h2 { font-family: var(--font-display); font-size: 15px; font-weight: 600; margin: 0; }
.muted { color: var(--muted); }
.pad { padding: 24px 0; }

.screen[hidden] { display: none; }
.head { margin-bottom: 14px; }
.head.row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.kicker {
  margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--brass);
}

/* Probe screen — deliberately plain; it is on screen for ~1.5s at most. */
#probing { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 22vh 0; }
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--brass);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

/* Unlock */
.field { display: block; margin: 18px 0 12px; }
.field .label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
input[type=password] {
  width: 100%; padding: 14px; font-size: 17px; font-family: inherit;
  color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 10px;
}
input[type=password]:focus { outline: 2px solid var(--brass); outline-offset: 1px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 16px; }
.check input { width: 18px; height: 18px; accent-color: var(--brass); }

.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  padding: 13px 18px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
}
.btn.primary { width: 100%; background: var(--brass); border-color: var(--brass); color: #fff; font-size: 17px; }
.btn.primary:disabled { opacity: .6; cursor: default; }
.btn.ghost { padding: 8px 12px; font-size: 13px; }
.linkbtn {
  font: inherit; font-size: inherit; color: var(--brass); background: none; border: none;
  padding: 0; text-decoration: underline; cursor: pointer;
}
.error { color: #A85436; font-size: 14px; margin: 12px 0 0; }
.fineprint { font-size: 12.5px; margin-top: 22px; }

/* List */
.stale { font-size: 12.5px; margin: 0 0 14px; }
.stale.warn { color: var(--warn); font-weight: 600; }
.group {
  margin: 20px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line);
  color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: 11.5px;
}
.items { list-style: none; margin: 0; padding: 0; }
.item + .item { border-top: 1px solid var(--line); }

/* The whole row is the tap target — one-handed use in a shop, gloves-on tolerant. */
.tick {
  display: grid; grid-template-columns: 26px 1fr; grid-auto-rows: min-content;
  gap: 2px 12px; align-items: center;
  width: 100%; padding: 15px 2px; text-align: left;
  font: inherit; color: inherit; background: none; border: none; cursor: pointer;
}
.box {
  grid-row: 1 / span 2; width: 24px; height: 24px; border-radius: 6px;
  border: 2px solid var(--line); background: var(--card);
}
.text { font-size: 16.5px; }
.meta { font-size: 12.5px; color: var(--muted); }
.item.done .text { text-decoration: line-through; color: var(--done); }
.item.done .meta { color: var(--done); }
.item.done .box {
  background: var(--brass); border-color: var(--brass);
  /* checkmark drawn in CSS — no image request, works offline */
  background-image: linear-gradient(45deg, transparent 46%, #fff 46%, #fff 56%, transparent 56%),
                    linear-gradient(-45deg, transparent 60%, #fff 60%, #fff 70%, transparent 70%);
  background-size: 60% 60%, 60% 60%;
  background-position: 42% 62%, 46% 58%;
  background-repeat: no-repeat;
}
