/* Tickpaper — shared styles */

:root {
  --paper:     #F6F1E6;
  --card:      #FFFFFF;
  --ink:       #221F19;
  --muted:     #7C7466;
  --faint:     #A69C8B;
  --rule:      #EAE1CF;
  --teal:      #15685D;
  --teal-ink:  #0D4A42;
  --teal-soft: #E0EEEB;
  --on-teal:   #FFFFFF;
  --grad-a:    #0E4842;
  --grad-b:    #43BCA3;
  --shadow-sm: 0 1px 2px rgba(34, 31, 25, .05);
  --shadow-md: 0 2px 4px rgba(34, 31, 25, .05), 0 12px 28px -16px rgba(34, 31, 25, .22);
  --radius:    14px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:     #15140F;
    --card:      #1F1D17;
    --ink:       #EFE9DB;
    --muted:     #9A9182;
    --faint:     #6B6455;
    --rule:      #2F2B22;
    --teal:      #58C0AE;
    --teal-ink:  #8AD7C9;
    --teal-soft: #152D2A;
    --on-teal:   #F2FBF7;
    --grad-a:    #0E403A;
    --grad-b:    #359E8D;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, .35), 0 12px 28px -16px rgba(0, 0, 0, .7);
  }
}

:root[data-theme="dark"] {
  --paper:     #15140F;
  --card:      #1F1D17;
  --ink:       #EFE9DB;
  --muted:     #9A9182;
  --faint:     #6B6455;
  --rule:      #2F2B22;
  --teal:      #58C0AE;
  --teal-ink:  #8AD7C9;
  --teal-soft: #152D2A;
  --on-teal:   #F2FBF7;
  --grad-a:    #0E403A;
  --grad-b:    #359E8D;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, .35), 0 12px 28px -16px rgba(0, 0, 0, .7);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Figtree, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }
[hidden] { display: none !important; }

a { color: inherit; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 6px; }

.wrap {
  max-width: 42rem;
  margin: 0 auto;
  padding-inline: 18px;
}

/* ---------- masthead ---------- */
.masthead {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1.1rem 18px 0.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  font-family: "Schibsted Grotesk", Figtree, system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.015em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.brand .mark {
  width: 20px; height: 20px;
  border-radius: 6px;
  background: linear-gradient(74deg, var(--grad-a), var(--grad-b));
  display: grid; place-content: center;
  flex: 0 0 auto;
}
.brand .mark svg { width: 12px; height: 12px; display: block; }

.quicknav { display: flex; gap: 0.9rem; flex-wrap: wrap; }
.quicknav a {
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
  padding-block: 0.2rem;
}
.quicknav a:hover { color: var(--teal); }
.quicknav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* ---------- title ---------- */
#listTitle {
  font-family: "Schibsted Grotesk", Figtree, system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(1.7rem, 6.4vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.021em;
  color: var(--ink);
  background: transparent;
  border: 0;
  width: 100%;
  padding: 0.15rem 0.3rem;
  margin: 1.2rem 0 0 -0.3rem;
  border-radius: 8px;
}
#listTitle.mid  { font-size: clamp(1.45rem, 5.2vw, 2rem); }
#listTitle.long { font-size: clamp(1.2rem, 4.3vw, 1.6rem); }
#listTitle:hover { background: rgba(21, 104, 93, .07); }
#listTitle:focus { background: var(--card); outline: 2px solid var(--teal); }

.sub {
  margin: 0.35rem 0 0;
  font-size: 0.86rem;
  color: var(--muted);
}

/* ---------- status card ---------- */
.status {
  margin-top: 1.15rem;
  background-color: var(--grad-a);
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,.055) 0 1px, transparent 1px 10px),
    linear-gradient(70deg, rgba(4, 32, 28, .34) 0%, rgba(4, 32, 28, .17) 46%, rgba(4, 32, 28, 0) 76%),
    linear-gradient(74deg, var(--grad-a) 0%, var(--grad-b) 100%);
  color: var(--on-teal);
  border-radius: var(--radius);
  padding: 1.05rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1.15rem;
  box-shadow: var(--shadow-md);
}

.ring { flex: 0 0 auto; width: 62px; height: 62px; position: relative; }
.ring svg { width: 62px; height: 62px; display: block; transform: rotate(-90deg); }
.ring .track { fill: none; stroke: rgba(255,255,255,.26); stroke-width: 7; }
.ring .fill  { fill: none; stroke: #FFFFFF; stroke-width: 7; stroke-linecap: round; transition: stroke-dasharray .35s ease; }
.ring .tick {
  position: absolute; inset: 0;
  display: grid; place-content: center;
  opacity: 0; transition: opacity .2s;
}
.ring .tick svg { width: 26px; height: 26px; transform: none; }
.status.complete .ring .tick { opacity: 1; }
.status.complete .ring svg.dial { opacity: .35; }

.status-copy { min-width: 0; flex: 1 1 auto; }

.status-line {
  font-family: "Schibsted Grotesk", Figtree, system-ui, sans-serif;
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  margin: 0 0 0.55rem;
  color: var(--on-teal);
}

.stats { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.stats div { display: flex; flex-direction: column; line-height: 1.15; }
.stats b {
  font-family: "Schibsted Grotesk", Figtree, sans-serif;
  font-size: 1.12rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.stats span {
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  opacity: .78;
  margin-top: 0.1rem;
}

/* ---------- sheet ---------- */
.sheet-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.45rem 0 0.5rem;
}
.sheet-head h2 {
  font-family: "Schibsted Grotesk", Figtree, sans-serif;
  font-size: 0.97rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}
.toggle {
  background: none;
  border: 0;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--teal);
  cursor: pointer;
  padding: 0.2rem 0.1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.toggle svg { width: 15px; height: 15px; }

.sheet { display: flex; flex-direction: column; gap: 5px; }

.group-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--teal);
  padding: 0.7rem 0.2rem 0.1rem;
}
.sheet > .group-label:first-child { padding-top: 0.1rem; }

.row {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 11px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0 0.5rem 0 0.75rem;
  transition: border-color .12s, opacity .12s;
}
.row:hover { border-color: var(--teal); }
.row:hover .grip { opacity: 1; }
.row.done { background: transparent; box-shadow: none; border-color: transparent; }
.row.done:hover { border-color: var(--rule); }

.box {
  appearance: none;
  flex: 0 0 auto;
  width: 1.18rem; height: 1.18rem;
  border: 1.5px solid var(--faint);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: grid; place-content: center;
  transition: background .14s, border-color .14s;
}
.box::after {
  content: "";
  width: .62rem; height: .32rem;
  border-left: 2px solid var(--card);
  border-bottom: 2px solid var(--card);
  transform: rotate(-45deg) translateY(-1px) scale(0);
  transition: transform .16s cubic-bezier(.2,1.5,.5,1);
}
.box:hover { border-color: var(--teal); }
.box:checked { background: var(--teal); border-color: var(--teal); }
.box:checked::after { transform: rotate(-45deg) translateY(-1px) scale(1); }

.text {
  flex: 1 1 auto;
  min-width: 0;
  font: inherit;
  font-size: 0.97rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  padding: 0.52rem 0.1rem;
}
.text::placeholder { color: var(--faint); }
.row.done .text { color: var(--faint); text-decoration: line-through; text-decoration-thickness: 1px; }

.grip {
  opacity: 0;
  background: none; border: 0;
  color: var(--faint);
  cursor: pointer;
  font-size: 1.05rem; line-height: 1;
  padding: 0.4rem 0.3rem;
  transition: opacity .12s, color .12s;
}
.grip:hover { color: #B3502A; }
.grip:focus-visible { opacity: 1; }

/* empty state */
.empty {
  background: var(--card);
  border: 1px dashed var(--rule);
  border-radius: 11px;
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}
.empty strong { display: block; color: var(--ink); font-weight: 600; margin-bottom: 0.25rem; }

/* ---------- tools ---------- */
.tools { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.35rem; }

/* the secondary buttons sit in the same row on a laptop, and fold away on a phone */
.tools-more { display: contents; }
.more-toggle { display: none; }

@media (max-width: 34rem) {
  .tools-more { display: none; }
  body.more-open .tools-more { display: contents; }
  .more-toggle { display: inline-flex; }
  body.more-open .more-toggle { order: 99; }
}

.btn {
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 9px;
  padding: 0.58rem 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  box-shadow: var(--shadow-sm);
}
.btn:hover { border-color: var(--teal); color: var(--teal); }
.btn svg { width: 15px; height: 15px; }
.btn.primary {
  background: linear-gradient(74deg, var(--grad-a), var(--grad-b));
  border-color: transparent;
  color: var(--on-teal);
}
.btn.primary:hover { filter: brightness(1.09); color: var(--on-teal); }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn[disabled]:hover { border-color: var(--rule); color: var(--ink); }

.hint {
  margin-top: 1.1rem;
  font-size: 0.84rem;
  color: var(--muted);
  max-width: 54ch;
}
kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78em;
  background: var(--teal-soft);
  color: var(--teal-ink);
  border-radius: 4px;
  padding: 0.12em 0.36em;
}

/* locked */
body.locked .grip { display: none; }
body.locked .text { cursor: default; }
body.locked #listTitle:hover { background: transparent; }
.lockflag {
  display: inline-flex; align-items: center; gap: 0.3rem;
  color: var(--teal); font-weight: 600;
}
.lockflag svg { width: 12px; height: 12px; }

/* ---------- qr ---------- */
.qr {
  margin-top: 1.1rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.2rem;
  display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}
.qr-code { background: #FFF; padding: 9px; border-radius: 8px; line-height: 0; flex: 0 0 auto; }
.qr-code img, .qr-code canvas { display: block; width: 188px; height: 188px; image-rendering: pixelated; }
.qr-copy { flex: 1 1 14rem; min-width: 0; }
.qr-copy h2 {
  font-family: "Schibsted Grotesk", Figtree, sans-serif;
  font-size: 1.05rem; font-weight: 600; margin: 0 0 0.3rem;
}
.qr-copy p { margin: 0; font-size: 0.87rem; color: var(--muted); }
.warn { color: #B3502A; font-size: 0.84rem; margin-top: 0.5rem !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .warn { color: #E0975F; }
}
:root[data-theme="dark"] .warn { color: #E0975F; }

/* ---------- about + other lists ---------- */
.about {
  margin-top: 3rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--rule);
}
.about h2 {
  font-family: "Schibsted Grotesk", Figtree, sans-serif;
  font-size: 1.12rem; font-weight: 600; margin: 0 0 0.6rem;
  letter-spacing: -0.015em;
}
.about p { margin: 0 0 0.7rem; font-size: 0.93rem; color: var(--muted); max-width: 60ch; }
.about p:last-child { margin-bottom: 0; }

.more { margin-top: 2.2rem; }
.more h2 {
  font-family: "Schibsted Grotesk", Figtree, sans-serif;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
  margin: 0 0 0.8rem;
}
.more-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 9px; }
.more-grid a {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 11px;
  padding: 0.85rem 1rem;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  display: block;
}
.more-grid a:hover { border-color: var(--teal); }
.more-grid b {
  font-family: "Schibsted Grotesk", Figtree, sans-serif;
  display: block; font-weight: 600; font-size: 0.96rem; letter-spacing: -0.01em;
}
.more-grid span { display: block; font-size: 0.82rem; color: var(--muted); margin-top: 0.12rem; }

footer.site {
  margin-top: 2.6rem;
  padding: 1.3rem 0 3rem;
  border-top: 1px solid var(--rule);
  font-size: 0.82rem;
  color: var(--faint);
}

/* ---------- print ---------- */
@media print {
  :root {
    --paper:#fff; --card:#fff; --ink:#000; --muted:#333;
    --faint:#666; --rule:#bbb; --teal:#000; --teal-soft:#fff;
    --shadow-sm:none; --shadow-md:none;
  }
  body { background: #fff; color: #000; font-size: 12pt; }
  .masthead, .tools, .hint, .qr, .grip, .sub, .more, footer.site,
  .toggle, .about, .status .stats, .empty { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .status {
    background: none !important; color: #000; padding: 0; box-shadow: none;
    border-bottom: 1pt solid #000; padding-bottom: 6pt; margin-top: 4pt;
  }
  .ring { display: none; }
  .status-line { font-size: 11pt; margin: 0; color: #000; }
  .sheet { gap: 0; }
  .sheet-head { margin: 10pt 0 4pt; }
  .row {
    border: 0; box-shadow: none; background: none;
    padding: 1.5pt 0; break-inside: avoid;
  }
  .row.done .text { color: #000; text-decoration: none; }
  .box { width: 12pt; height: 12pt; border: 1pt solid #000; border-radius: 2pt; }
  .box:checked { background: #fff; }
  .box::after { width: 6.5pt; height: 3.2pt; border-color: #000; }
  .box:checked::after { transform: rotate(-45deg) translateY(-1px) scale(1); }
  .group-label { color: #000; border-bottom: .5pt solid #999; padding: 8pt 0 2pt; }
  .text { padding: 2pt 0; }
  #listTitle { font-size: 19pt; margin: 0; padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::after { transition: none !important; }
}

@media (max-width: 30rem) {
  .status { padding: 1rem; gap: 0.95rem; }
  .stats { gap: 1.1rem; }
}
