/* ============================================================================
   LISTPAD — "Market Pad" design system
   A warm paper receipt on a dark walnut desk. Fraunces for voice,
   Spline Sans Mono for the ledger, Hanken Grotesk for plain talk.
   ========================================================================== */

:root {
  --paper:       #f5f0e8;   /* warm cream — light pages */
  --paper-deep:  #ece3d4;
  --paper-edge:  #e1d7c2;
  --ink:         #2d1b0e;   /* coffee — text on cream */
  --ink-soft:    #5a4632;
  --muted:       #9c8a72;
  --hair:        #e6dbc8;
  --rule:        #cfc1a2;
  --stamp:       #e8961a;   /* amber — primary pop / CTAs */
  --stamp-deep:  #c47c2b;   /* caramel — depth / hover */
  --brand:       #c47c2b;   /* caramel — the horse's colour, the brand */
  --edge:        #7a4a1a;   /* warm brown — borders & icons */
  --olive:       #2fa44f;   /* green kept on purpose: universal "done" */
  --olive-deep:  #1d7d3a;
  --gold:        #e8961a;   /* folded into amber */
  --berry:       #c47c2b;   /* folded into caramel */
  --blue:        #1f93b3;   /* teal — minor accent */
  --desk-top:    #3a3347;   /* graphite — raised dark surfaces / cards */
  --desk:        #1e1e2e;   /* dark base — header / hero */
  --desk-deep:   #15151f;
  --font-hand:   "Caveat", "Comic Sans MS", cursive;

  /* Pontinhos (the scoreboard app): a squared-paper leaf and the pens that
     land on the table with it. Kept here because the studio home shows them. */
  --pt-sheet:     #e9e7db;
  --pt-sheet-2:   #f3f1e8;
  --pt-grid:      rgba(60,84,104,.14);
  --pt-ink:       #232c37;
  --pt-ink-soft:  #58636f;
  --pt-faint:     #949ea8;
  --pt-rule:      #b6bfc7;
  --pt-blue:      #2f6fa8;
  --pt-blue-lite: #6aa9dd;
  --pen-grafite:  #2b3440;
  --pen-vermelha: #c0392b;
  --pen-azul:     #2f6fa8;
  --pen-verde:    #3f8552;
  --pen-roxa:     #7a4f9e;
  --pen-laranja:  #c97a1c;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-mono:    "Spline Sans Mono", ui-monospace, "SFMono-Regular", monospace;

  --r: 3px;
  --lift: 0 28px 55px -26px rgba(0,0,0,.7), 0 10px 22px -16px rgba(0,0,0,.55);
  --lift-sm: 0 12px 26px -18px rgba(0,0,0,.6);

  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
button, a, .tick, .del, .resp, .sec-chip, .who-chip, .qty, .price { touch-action: manipulation; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(135% 90% at 50% -15%, var(--desk-top) 0%, var(--desk) 46%, var(--desk-deep) 100%) fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Film grain over the whole desk */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: .04;
  background-image: var(--noise);
  mix-blend-mode: overlay;
}

::selection { background: var(--stamp); color: #fff5e9; }

a { color: var(--stamp-deep); text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* ---- Typography ---------------------------------------------------------- */
.display {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -.015em;
}
.mono { font-family: var(--font-mono); }
.tnum { font-variant-numeric: tabular-nums; }

.kicker {
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--brand);
}

/* ---- Paper surface ------------------------------------------------------- */
.paper {
  position: relative;
  background-color: var(--paper);
  color: var(--ink);
  border-radius: var(--r);
  box-shadow: var(--lift);
  isolation: isolate;
}
.paper::before { /* fibers */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background-image: var(--noise);
  background-size: 160px;
  opacity: .05;
  mix-blend-mode: multiply;
}
.paper::after { /* a soft warm vignette + top sheen */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255,255,255,.5), rgba(255,255,255,0) 14%),
    radial-gradient(120% 60% at 50% 120%, rgba(120,90,40,.10), transparent 70%);
  pointer-events: none;
}

/* Perforated tear edges, top + bottom */
.torn {
  --notch: 7px;
  --gap: 20px;
  -webkit-mask:
    radial-gradient(var(--notch) at 50% 0, #0000 97%, #000) repeat-x 50% 0 / var(--gap) calc(var(--notch) + 1px),
    radial-gradient(var(--notch) at 50% 100%, #0000 97%, #000) repeat-x 50% 100% / var(--gap) calc(var(--notch) + 1px),
    linear-gradient(#000 0 0) no-repeat 50% 50% / 100% calc(100% - 2 * var(--notch) - 2px);
          mask:
    radial-gradient(var(--notch) at 50% 0, #0000 97%, #000) repeat-x 50% 0 / var(--gap) calc(var(--notch) + 1px),
    radial-gradient(var(--notch) at 50% 100%, #0000 97%, #000) repeat-x 50% 100% / var(--gap) calc(var(--notch) + 1px),
    linear-gradient(#000 0 0) no-repeat 50% 50% / 100% calc(100% - 2 * var(--notch) - 2px);
}

/* A dotted/dashed tear line used inside receipts */
.tearline {
  height: 0;
  border: 0;
  border-top: 2px dashed var(--rule);
  margin: 1.1rem 0;
  opacity: .85;
}

/* A risco: one hand-wobbled tally mark from Pontinhos. Four sides and a
   diagonal make five points, the way scores get counted on a napkin here.
   Lives in the shared sheet because the studio home draws them too. */
.risco {
  display: block;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- Buttons ------------------------------------------------------------- */
.btn {
  --bg: var(--ink);
  --fg: var(--paper);
  display: inline-flex;
  align-items: center;
  gap: .55em;
  font-family: var(--font-mono);
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--fg);
  background: var(--bg);
  border: none;
  border-radius: 2px;
  padding: .72em 1.15em;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .15s ease;
  box-shadow: 0 2px 0 rgba(0,0,0,.25);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 0 rgba(0,0,0,.22); }
.btn:active { transform: translateY(1px); box-shadow: 0 1px 0 rgba(0,0,0,.25); }
.btn--stamp { --bg: var(--stamp); --fg: #2a1a0d; }
.btn--stamp:hover { --bg: var(--stamp-deep); }
.btn--ghost {
  --bg: transparent; --fg: var(--ink);
  box-shadow: inset 0 0 0 1.5px rgba(36,31,23,.35);
}
.btn--ghost:hover { --bg: rgba(36,31,23,.05); box-shadow: inset 0 0 0 1.5px rgba(36,31,23,.55); }
.btn--lg { font-size: .95rem; padding: .95em 1.6em; }
.btn--block { display: flex; width: 100%; justify-content: center; }

/* ---- Inputs -------------------------------------------------------------- */
.field {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--ink);
  background: transparent;
  border: none;
  outline: none;
  width: 100%;
}
.field::placeholder { color: var(--muted); }

/* ---- Layout -------------------------------------------------------------- */
.stage {
  width: min(1080px, 100% - 2.5rem);
  margin-inline: auto;
}
.stage--narrow { width: min(640px, 100% - 2rem); }

/* ===========================================================================
   LANDING
   ========================================================================= */
.landing { background: var(--paper-deep); color: var(--ink); padding: 0; }

.topbar {
  width: min(1080px, 100% - 2.5rem);
  margin: 0 auto clamp(1.5rem, 4vw, 2.8rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #f0e6cf;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .42em;
  font-size: 1.4rem;
  line-height: 1;
  text-decoration: none;
}
.brand-mark {
  height: 2.05em; width: auto; flex: none;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1);
}
.brand:hover .brand-mark { transform: rotate(-7deg) scale(1.07); }
.brand-word { display: flex; flex-direction: column; line-height: 1; }
.brand-name {
  font-family: var(--font-display); font-weight: 900;
  font-size: 1em; letter-spacing: -.005em; color: #fbeecb;
  text-transform: uppercase;
}
.brand-accent { color: var(--brand); }
.brand-by {
  font-family: var(--font-mono); font-size: .33em; letter-spacing: .13em; text-transform: uppercase;
  color: #b89a6e; margin-top: .55em;
}
.topbar .brand { font-size: 2.45rem; }
.topbar .brand-mark { height: 2.6em; } /* extra presence for the horse on the home */
.topbar .kicker { color: #b3a78a; }
.topbar-links { display: flex; gap: 1.4rem; align-items: center; }
.topbar-links a { color: #cdbf9c; text-decoration: none; font-family: var(--font-mono); font-size: .8rem; letter-spacing: .04em; }
.topbar-links a:hover { color: #f4ead2; }

/* the "3 bars" mobile menu button (hidden on wide screens) */
.topbar-burger {
  display: none;
  flex-direction: column; justify-content: center; gap: 5px;
  width: 2.6rem; height: 2.6rem; padding: .55rem;
  background: none; border: none; cursor: pointer; flex: none;
}
.topbar-burger span { display: block; height: 2px; width: 100%; border-radius: 2px; background: #e7d6b6; transition: transform .25s ease, opacity .2s ease; }
.topbar.is-open .topbar-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.topbar.is-open .topbar-burger span:nth-child(2) { opacity: 0; }
.topbar.is-open .topbar-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.hero {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero-copy h1 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(2.6rem, 6.4vw, 4.5rem);
  line-height: .98;
  letter-spacing: -.022em;
  color: #f6edd6;
  margin: .4rem 0 0;
}
.hero-copy h1 em {
  font-style: italic;
  font-weight: 500;
  color: var(--stamp);
}
.hero-copy .lede {
  color: #d3c7a8;
  font-size: 1.18rem;
  line-height: 1.55;
  max-width: 34ch;
  margin: 1.3rem 0 2rem;
}
.hero-cta { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.hero-cta .note { font-family: var(--font-mono); font-size: .76rem; color: #a99c7e; letter-spacing: .03em; }
.hero-ai {
  margin: 1.3rem 0 1.8rem;
  padding: .85rem 1.1rem;
  border-left: 3px solid var(--stamp);
  background: rgba(232,150,26,.15);
  border-radius: 0 10px 10px 0;
  color: #efe5cf;
  font-size: 1.02rem;
  line-height: 1.5;
  max-width: 42ch;
  text-align: left;
}
.hero-ai b { color: #f6b35e; font-weight: 700; }

/* The hero receipt prop */
.prop { display: flex; justify-content: center; perspective: 1400px; }
.receipt {
  width: min(360px, 86vw);
  padding: 1.6rem 1.5rem 1.3rem;
  transform: rotate(-2.2deg);
  transition: transform .5s cubic-bezier(.2,.7,.2,1);
}
.receipt:hover { transform: rotate(-1deg) translateY(-4px); }
.receipt .r-head { text-align: center; }
.receipt .r-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: .02em;
  margin: .2rem 0 .1rem;
}
.receipt .r-sub { font-family: var(--font-mono); font-size: .66rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.r-lines { margin: 1rem 0 .4rem; }

/* ---- Concept cards ------------------------------------------------------- */
.section { padding: clamp(2.4rem, 6vw, 4.4rem) 0; }
.section-head { text-align: center; margin-bottom: 2.4rem; }
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--ink);
  margin: .5rem 0 0;
  letter-spacing: -.01em;
}
.section-head p { color: var(--ink-soft); max-width: 52ch; margin: .8rem auto 0; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.step { padding: 1.7rem 1.5rem 1.6rem; }
.step .num {
  font-family: var(--font-mono);
  font-size: .76rem;
  letter-spacing: .2em;
  color: var(--brand);
  display: inline-flex; align-items: center; gap: .6ch;
}
.step h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; margin: .7rem 0 .4rem; letter-spacing: -.01em; }
.step p { color: var(--ink-soft); font-size: .96rem; margin: 0; }
.step code { font-family: var(--font-mono); font-size: .85em; background: rgba(36,31,23,.07); padding: .12em .4em; border-radius: 3px; }

/* ---- AI band ------------------------------------------------------------- */
.ai-band { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; align-items: stretch; }
.ai-card { padding: 2rem 1.9rem; }
.ai-card h3 {
  font-family: var(--font-display); font-weight: 600; font-size: 1.6rem;
  margin: .4rem 0 .6rem; letter-spacing: -.01em;
}
.ai-card p { color: var(--ink-soft); margin: 0 0 1.1rem; }
.ai-card-tag {
  display: inline-block;
  font-family: var(--font-mono); font-size: .66rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--stamp); margin-bottom: .7rem;
}
.ai-card--agent .ai-card-tag { color: var(--blue); }
.ai-code {
  background: #1c1611; color: #e9dcc0;
  font-size: .82rem; line-height: 1.7; border-radius: 8px;
  padding: 1rem 1.1rem; margin: .2rem 0 0; white-space: pre-wrap; word-break: break-word;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.ai-code .c  { color: #b3a78a; }
.ai-code .ok { color: #6fcf8e; }
.ai-band-cta { text-align: center; margin-top: 1.9rem; }
.terminal {
  background: #1c1611;
  color: #e9dcc0;
  border-radius: 4px;
  padding: 1.1rem 1.2rem;
  font-family: var(--font-mono);
  font-size: .82rem;
  line-height: 1.65;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
  overflow-x: auto;
  white-space: pre-line;
}
.terminal .c-dim { color: #9b8e6f; }
.terminal .c-key { color: #e9b36a; }
.terminal .c-str { color: #b7c98f; }
.terminal .c-cmt { color: #7d7158; }
.terminal .prompt { color: var(--stamp); }

.quote {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.15rem;
  color: var(--ink);
  line-height: 1.5;
}

/* ---- Footer -------------------------------------------------------------- */
.foot {
  width: min(1080px, 100% - 2.5rem);
  margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between;
  color: #a99c7e; font-family: var(--font-mono); font-size: .76rem; letter-spacing: .03em;
}
.foot a { color: #cdbf9c; text-decoration: none; }
.foot a:hover { color: #f4ead2; }

/* First screen is a dark panel (topbar + hero); the rest is light; footer a dark band */
.band { background: var(--desk); }
.band--foot { padding-block: clamp(1.3rem, 3.5vw, 2.2rem); margin-top: clamp(3rem, 6vw, 5rem); }
.panel--dark {
  background: radial-gradient(120% 95% at 50% -8%, var(--desk-top) 0%, var(--desk) 52%, var(--desk-deep) 100%);
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding-top: clamp(.9rem, 2.5vw, 1.5rem);
  padding-bottom: clamp(2.2rem, 5vw, 4rem);
  color: #f0e6cf;
}
.panel--dark > .stage { flex: 1; display: flex; align-items: center; } /* center hero, fill the screen */

/* condensed sticky header, revealed after you scroll past the hero */
.stickybar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .5rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(30, 30, 46, .9);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  transform: translateY(-105%);
  transition: transform .32s cubic-bezier(.2, .7, .2, 1);
}
.stickybar.is-on { transform: translateY(0); }
.stickybar-brand {
  display: inline-flex; align-items: center; gap: .5rem; text-decoration: none;
  color: #f6edd6; font-family: var(--font-display); font-weight: 900;
  text-transform: uppercase; font-size: 1.15rem; letter-spacing: -.01em;
}
.stickybar-brand img { height: 2em; width: auto; }
.stickybar-links { display: flex; align-items: center; gap: 1.3rem; }
.stickybar-links a {
  color: #cdbf9c; text-decoration: none; font-family: var(--font-mono);
  font-size: .78rem; letter-spacing: .04em;
}
.stickybar-links a:hover { color: #f4ead2; }
.stickybar .btn { padding: .5em 1.05em; font-size: .82rem; }
#como, #ia { scroll-margin-top: 72px; }
@media (max-width: 520px) {
  .stickybar { padding: .45rem .9rem; }
  .stickybar-links a { display: none; }
}

/* ===========================================================================
   THE PAD (list app)
   ========================================================================= */
.deskwrap { padding: clamp(1.2rem, 4vw, 2.6rem) 0 3.5rem; }

/* One responsive header at every width: brand on the left, a row of *compact*
   controls on the right (a quiet save link, the who-am-I chip, and icon buttons
   for share/print). It fits on one line on a wide pad and wraps to brand-then-
   controls on a phone — no separate layouts, no staircase. */
.pad-actions {
  width: min(560px, 100% - 2rem);
  margin: 0 auto .9rem;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .5rem .6rem;
  color: #e7d6b6;
}
.pad-actions .brand { font-size: 1.4rem; flex: none; }
.pad-actions .right { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
.pad-actions .who { display: flex; align-items: center; gap: .5rem; }

/* ghost buttons sit on the dark desk here, so they need a light treatment */
.pad-actions .btn--ghost { --fg: #f4e6c8; box-shadow: inset 0 0 0 1.5px rgba(248,240,221,.32); }
.pad-actions .btn--ghost:hover { --bg: rgba(248,240,221,.08); box-shadow: inset 0 0 0 1.5px rgba(248,240,221,.6); }

/* the save nudge is a quiet underlined link, never a slab (overrides the ghost btn) */
.pad-actions .pad-acct, .pad-actions .pad-acct .btn {
  background: none; border: none; box-shadow: none; min-height: 0;
  width: auto; padding: .15em 0; justify-content: flex-start;
  font-family: var(--font-mono); font-size: .74rem; letter-spacing: .03em; text-transform: none;
  color: #c2b491; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap;
}
.pad-actions .pad-acct:hover, .pad-actions .pad-acct .btn:hover { color: #f4ead2; }
.pad-actions .pad-acct.acct-saved { color: var(--olive); text-decoration: none; }

/* share + print are bare icon buttons — no box, just the glyph (the word stays
   for screen readers via aria-label) */
.pad-actions .pad-share, .pad-actions .pad-print {
  padding: .4em; min-height: 40px; min-width: 36px; line-height: 0;
  background: none; box-shadow: none; color: #ddcdab;
  transition: color .15s ease, transform .1s ease;
}
.pad-actions .pad-share:hover, .pad-actions .pad-print:hover {
  background: none; box-shadow: none; color: #f6edd6; transform: none;
}
.pad-actions .pad-share:active, .pad-actions .pad-print:active { transform: scale(.92); box-shadow: none; }
.pad-share-txt, .pad-print-txt { display: none; }
.ico-share, .ico-print { display: inline-block; }

.pad {
  width: min(560px, 100% - 2rem);
  margin-inline: auto;
  padding: clamp(1.6rem, 4vw, 2.4rem) clamp(1.3rem, 4vw, 2.2rem) clamp(1.4rem, 4vw, 2rem);
}

.pad-head { text-align: center; position: relative; }
.pad-stamp {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .64rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--stamp);
  border: 1.5px solid var(--stamp);
  border-radius: 3px;
  padding: .25em .6em;
  transform: rotate(-3deg);
  opacity: .9;
}
.pad-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.7rem, 5vw, 2.3rem);
  letter-spacing: -.01em;
  text-align: center;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--ink);
  margin: .5rem 0 .2rem;
  padding: .05em .2em;
  border-radius: 3px;
  outline: none;
}
.pad-title:hover { background: rgba(36,31,23,.045); }
.pad-title:focus { background: rgba(245,64,43,.08); box-shadow: 0 0 0 1.5px rgba(245,64,43,.32); }
.pad-meta {
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex; align-items: center; justify-content: center; gap: .8ch;
}
.pad-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--rule); }

/* Add row */
.add {
  display: flex; align-items: center; gap: .7rem;
  margin: 1.2rem 0 .4rem;
  padding: .55rem .2rem .7rem;
  border-bottom: 2px solid var(--ink);
}
.add .pencil { color: var(--stamp); flex: none; }
.add .field { font-size: 1.06rem; }
.add button {
  flex: none;
  font-family: var(--font-mono); font-size: 1.3rem; line-height: 1;
  width: 2rem; height: 2rem; border-radius: 50%;
  border: none; background: var(--ink); color: var(--paper);
  cursor: pointer; transition: transform .12s ease, background .15s ease;
}
.add button:hover { background: var(--stamp); transform: rotate(90deg); }

/* Items list */
.lines { list-style: none; margin: .4rem 0 0; padding: 0; }
.line {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  padding: .5rem 0;
  position: relative;
  animation: print-in .45s both;
}
.line + .line { border-top: 1px dotted var(--hair); }
.lines .section {
  list-style: none;
  display: flex; align-items: center; gap: .6ch;
  font-family: var(--font-mono);
  font-size: .66rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink-soft);
  padding: .9rem .1rem .3rem;
  animation: print-in .45s both;
}
.lines .section:first-child { padding-top: .15rem; }
.lines .line + .section { margin-top: .15rem; border-top: 1px dotted var(--hair); padding-top: .85rem; }
.section-dot { width: .5rem; height: .5rem; border-radius: 2px; flex: none; }

/* section tag on each item + the picker popover (works on any list kind) */
.sec-chip {
  flex: none;
  display: inline-flex; align-items: center; gap: .35em;
  font-family: var(--font-mono);
  font-size: .62rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--rule); border-radius: 999px;
  padding: .14em .55em; margin-left: .4ch;
  cursor: pointer;
  max-width: 8.5rem; white-space: nowrap; overflow: hidden;
  transition: color .15s ease, border-color .15s ease;
}
.sec-chip:hover { color: var(--ink); border-color: var(--stamp); }
.sec-chip--set { color: var(--ink-soft); border-color: var(--hair); }
.sec-chip-dot { width: .5em; height: .5em; border-radius: 50%; flex: none; }
.line.is-checked .sec-chip { opacity: .55; }

.section-menu {
  position: absolute; z-index: 70;
  width: 220px; max-width: calc(100vw - 16px);
  padding: .5rem; border-radius: 12px; text-align: left;
}
.section-new {
  width: 100%; box-sizing: border-box;
  font-family: var(--font-body); font-size: .92rem;
  padding: .5em .7em; margin-bottom: .4rem;
  border: 1.5px solid var(--rule); border-radius: 8px;
  background: var(--paper); color: var(--ink);
}
.section-new:focus { outline: none; border-color: var(--stamp); }
.section-list { display: flex; flex-direction: column; max-height: 220px; overflow-y: auto; margin-bottom: .15rem; }
.section-menu-item {
  display: flex; align-items: center; gap: .55em;
  width: 100%; text-align: left;
  padding: .5em .6em; border-radius: 7px;
  border: none; background: transparent; cursor: pointer;
  font-family: var(--font-body); font-size: .92rem; color: var(--ink);
}
.section-menu-item:hover { background: rgba(0, 0, 0, .06); }
.section-menu-item.is-current { font-weight: 600; }
.section-menu-item.danger { color: var(--stamp); }

/* ===========================================================================
   ACCOUNTS — auth pages, my-lists, flash
   ========================================================================= */
.auth-wrap { min-height: 100svh; display: grid; place-items: center; padding: 2rem 1.2rem; }
.auth-card { width: min(420px, 100%); padding: clamp(1.8rem, 5vw, 2.6rem); text-align: center; }
.auth-card .brand { justify-content: center; font-size: 1.5rem; margin-bottom: 1.3rem; }
.auth-card .brand-name { color: var(--ink); }
.auth-card .brand-by { color: var(--muted); }
.auth-title { font-size: clamp(1.6rem, 5vw, 2.1rem); color: var(--ink); margin: 0 0 .3rem; }
.auth-sub { color: var(--ink-soft); margin: 0 0 1.6rem; font-size: .98rem; }
.auth-form { display: flex; flex-direction: column; gap: .9rem; text-align: left; }
.auth-label { display: flex; flex-direction: column; gap: .35rem; font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.auth-label input {
  font-family: var(--font-body); font-size: 1rem; text-transform: none; letter-spacing: 0;
  padding: .7em .8em; border: 1.5px solid var(--rule); border-radius: 9px;
  background: var(--paper); color: var(--ink);
}
.auth-label input:focus { outline: none; border-color: var(--stamp); }
.auth-form .btn { margin-top: .5rem; justify-content: center; }
.auth-errors { display: flex; flex-direction: column; gap: .3rem; background: rgba(232,150,26,.14); border-left: 3px solid var(--stamp); border-radius: 0 8px 8px 0; padding: .7rem .9rem; color: var(--ink-soft); font-size: .88rem; }
.auth-alt { margin: 1.4rem 0 0; color: var(--ink-soft); font-size: .92rem; }
.auth-alt a { color: var(--brand); font-weight: 600; text-decoration: none; }
.auth-alt a:hover { text-decoration: underline; }

.mine { width: min(680px, 100% - 2.5rem); margin: 0 auto; padding: clamp(1.6rem, 5vw, 2.4rem); }
.mine-title { font-size: clamp(1.8rem, 5vw, 2.4rem); color: var(--ink); margin: 0; }
.mine-sub { color: var(--ink-soft); margin: .3rem 0 1.6rem; }
.mine-list { list-style: none; margin: 0 0 1.6rem; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.mine-item {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: .3rem .8rem;
  padding: .9rem 1rem; border: 1px solid var(--hair); border-radius: 12px;
  text-decoration: none; color: var(--ink); background: rgba(0,0,0,.02);
  transition: border-color .15s ease, transform .15s ease;
}
.mine-item:hover { border-color: var(--stamp); transform: translateY(-1px); }
.mine-kind { flex: none; font-family: var(--font-mono); font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; color: #fff8ee; background: var(--brand); padding: .28em .6em; border-radius: 999px; }
.mine-name { font-family: var(--font-display); font-weight: 600; font-size: 1.12rem; flex: 1 1 auto; }
.mine-meta { font-size: .76rem; color: var(--muted); white-space: nowrap; }
.mine-empty { color: var(--ink-soft); padding: 1.4rem 0; }
.acct-email { font-size: .74rem; color: #cdbf9c; align-self: center; }
.acct-saved { color: var(--olive); font-size: .78rem; font-weight: 600; align-self: center; white-space: nowrap; }

.flash {
  position: fixed; top: 0; left: 0; right: 0; z-index: 300;
  padding: .7rem 1rem; text-align: center;
  font-family: var(--font-body); font-size: .92rem; font-weight: 600;
  animation: flash-in .3s ease, flash-out .5s ease 3.6s forwards;
}
.flash--ok { background: var(--olive); color: #fff; }
.flash--warn { background: var(--stamp); color: #2a1a0d; }
@keyframes flash-in { from { transform: translateY(-100%); } to { transform: translateY(0); } }
@keyframes flash-out { to { transform: translateY(-100%); } }
.tick {
  flex: none;
  width: 1.25rem; height: 1.25rem;
  margin-right: .15rem;
  border: 1.6px solid var(--ink-soft);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  position: relative;
  align-self: center;
  transition: border-color .15s ease, background .15s ease;
}
.tick:hover { border-color: var(--stamp); }
.line-text {
  font-family: var(--font-mono);
  font-size: 1.02rem;
  color: var(--ink);
  cursor: text;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  /* strikethrough drawn as a gradient bar so it can sweep in (text-decoration can't animate) */
  background-image: linear-gradient(var(--stamp), var(--stamp));
  background-repeat: no-repeat;
  background-position: 0 58%;
  background-size: 0% 2px;
}
.line-cat {
  font-family: var(--font-mono);
  font-size: .58rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--hair); border-radius: 999px;
  padding: .1em .55em; margin-left: .5ch;
  vertical-align: middle;
}
.leader { flex: 1 1 auto; border-bottom: 2px dotted var(--rule); transform: translateY(-.22em); min-width: 1.5rem; }
.qty {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}
.qty .x { color: var(--muted); }
.price {
  flex: none;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  margin-left: .15rem;
}
.price--add { color: var(--rule); font-weight: 400; }
.price--add:hover { color: var(--stamp); }
.line.is-checked .price { color: var(--muted); }
.del {
  flex: none;
  border: none; background: transparent; cursor: pointer;
  color: var(--muted); font-family: var(--font-mono); font-size: 1rem;
  padding: 0 .2rem; margin-left: .2rem;
  opacity: 0; transition: opacity .15s ease, color .15s ease;
}
.line:hover .del, .line:focus-within .del { opacity: 1; }
.del:hover { color: var(--stamp); }

/* ---- The market line as one nota-fiscal ledger row, at EVERY width -----------
   who · ☐ · name ……leader dots…… ×qty · price · ✎. The name wraps when long, the
   leader fills the gap, the prices stack on the right. Built by buildMarketLine
   for touch and mouse alike, so there's no jump across breakpoints. */
.line--m { display: block; padding: .55rem 0; }
.line--m .line-row { display: flex; align-items: baseline; flex-wrap: nowrap; gap: .4rem; }
.line--m .resp { align-self: center; flex: none; }
.line--m .tick { align-self: center; flex: none; }
/* the "raise your hand to grab it" affordance, shown until someone volunteers */
.resp.volunteer {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.5rem; height: 1.5rem; padding: 0;
  border: none; background: none; cursor: pointer;
  color: var(--rule);
  transition: color .15s ease, transform .1s ease;
}
.resp.volunteer svg { width: 1.05rem; height: 1.05rem; }
.resp.volunteer:hover { color: var(--stamp); }
.resp.volunteer:active { transform: scale(.88); }
/* The name keeps its room and wraps (never truncates); the leader is pure filler
   that shrinks away first on a tight row, so the name never gets squeezed. */
.line--m .line-text {
  flex: 0 1 auto; min-width: 0; white-space: normal; line-height: 1.3; cursor: pointer;
  overflow: visible; text-overflow: clip; overflow-wrap: break-word;
}
.line--m .leader { flex: 1 100 0; min-width: 0; }
.line--m .qty { flex: none; color: var(--ink); cursor: default; }
.line--m .price { flex: none; cursor: pointer; }
.line--m .price--add { color: var(--muted); }
.line--m .edit {
  flex: none; align-self: center; position: relative;
  border: none; background: none; cursor: pointer;
  color: var(--muted); font-size: 1.1rem; line-height: 1; padding: 0 .1rem; margin-left: .05rem;
  transition: color .15s ease;
}
.line--m .edit:hover { color: var(--stamp); }
.line--m .edit::before { content: ""; position: absolute; inset: -10px; }
.line--m > .added-note { display: block; padding-left: 2.7rem; margin: .15rem 0 0; }

/* checked state — voided receipt line + rubber stamp */
.line.is-checked .line-text { color: var(--muted); background-size: 100% 2px; }
.line.just-checked .line-text { animation: strike-sweep .4s cubic-bezier(.5,.15,.3,1) both; }
@keyframes strike-sweep { from { background-size: 0% 2px; } to { background-size: 100% 2px; } }
.line.is-checked .qty { color: var(--muted); }
.line.is-checked .tick {
  background: var(--olive);
  border-color: var(--olive-deep);
}
.line.is-checked .tick::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%; width: 5px; height: 10px;
  border: solid #f4ecd6; border-width: 0 2.4px 2.4px 0;
  transform: translate(-50%, -60%) rotate(45deg);
}
/* satisfying pop when you complete an item */
.line.just-checked .tick { animation: tick-pop .34s cubic-bezier(.34,1.56,.64,1); }
@keyframes tick-pop { 0% { transform: scale(.55); } 55% { transform: scale(1.14); } 100% { transform: scale(1); } }
.line.just-checked .tick::after { animation: check-draw .26s .05s cubic-bezier(.34,1.7,.6,1) backwards; }
@keyframes check-draw {
  0%   { transform: translate(-50%, -60%) rotate(45deg) scale(.2); opacity: 0; }
  100% { transform: translate(-50%, -60%) rotate(45deg) scale(1);  opacity: 1; }
}
.line .stamp {
  position: absolute;
  right: 2.2rem; top: 50%;
  font-family: var(--font-mono);
  font-weight: 600; font-size: .82rem; letter-spacing: .12em;
  color: var(--stamp);
  border: 2px solid var(--stamp);
  border-radius: 4px;
  padding: .1em .45em;
  transform: translateY(-50%) rotate(-11deg) scale(.6);
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: multiply;
}
.line.is-checked .stamp { animation: stamp-thunk .42s cubic-bezier(.2,1.3,.4,1) forwards; }

/* Totals + footer */
.totals {
  display: flex; align-items: baseline; justify-content: space-between;
  font-family: var(--font-mono);
  font-size: .82rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink);
  margin-top: .2rem;
}
.totals .big { font-size: 1.05rem; font-weight: 600; }
.totals .muted { color: var(--muted); }

/* the market bill total — a receipt-style line that sums every priced item */
.bill { display: flex; align-items: baseline; gap: .7rem; margin-top: .9rem; }
.bill-label {
  flex: none;
  font-family: var(--font-mono);
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
}
.bill-dots { flex: 1 1 auto; border-bottom: 2px dotted var(--rule); transform: translateY(-.18em); }
.bill-total {
  flex: none;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600; font-size: 1.5rem; letter-spacing: -.01em;
  color: var(--ink);
}

.pad-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 1.1rem; gap: 1rem;
}
.linkish {
  background: none; border: none; cursor: pointer;
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); padding: .3em 0;
}
.linkish:hover { color: var(--stamp); }
.sync-badge {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .03em;
  color: var(--muted); white-space: nowrap;
}
.sync-badge.offline { color: var(--stamp); font-weight: 600; }

/* Empty state */
.empty {
  text-align: center; color: var(--muted);
  font-family: var(--font-mono); font-size: .86rem;
  padding: 1.8rem 0 1.2rem;
}
.empty b { display: block; font-family: var(--font-display); font-style: italic; font-weight: 500; font-size: 1.2rem; color: var(--ink-soft); margin-bottom: .3rem; }

/* Barcode (token) */
.barcode-wrap { text-align: center; margin-top: .4rem; }
.barcode {
  display: inline-flex; align-items: flex-end; gap: 1px; height: 38px;
  cursor: pointer;
}
.barcode i { display: block; width: 2px; height: 100%; background: var(--ink); }
.barcode i.s { opacity: .0; }
.barcode-num {
  font-family: var(--font-mono); font-size: .64rem; letter-spacing: .34em;
  color: var(--ink-soft); margin-top: .3rem;
  display: block; text-transform: uppercase;
}
.copyhint { font-family: var(--font-mono); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 1.6rem; transform: translateX(-50%) translateY(140%);
  background: var(--ink); color: var(--paper);
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: .06em;
  padding: .7em 1.1em; border-radius: 3px; box-shadow: var(--lift-sm);
  z-index: 10000;
  /* hidden for real — translateY alone leaves an empty toast peeking up when the
     bar sits higher (it does on phones), so toggle visibility too */
  opacity: 0; visibility: hidden;
  transition: transform .35s cubic-bezier(.2,.9,.2,1), opacity .3s ease, visibility .35s;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; }

/* sync pulse */
.synced { animation: pulse .6s ease; }

/* ---- The "+" FAB and the add-item sheet (phones) -------------------------- */
.add-fab { display: none; }   /* desktop uses the inline compose row instead */

.additem-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(16,13,9,.58);
  display: flex; align-items: center; justify-content: center; padding: 1.2rem;
}
.additem-overlay[hidden] { display: none; }
.additem-modal { width: min(440px, 100%); padding: 1.5rem 1.6rem 1.6rem; border-radius: 16px; text-align: left; }
.additem-modal .identity-title { margin-bottom: 1.1rem; }
.add-field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .85rem; }
.add-field[hidden] { display: none; }
.add-label { font-family: var(--font-mono); font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.add-input {
  font-family: var(--font-body); font-size: 16px;
  padding: .62em .75em; border: 1.5px solid var(--hair); border-radius: 9px;
  background: #fff; color: var(--ink); outline: none; width: 100%;
}
.add-input:focus { border-color: var(--stamp); }
.add-row { display: flex; gap: .8rem; }
.add-row .add-field { flex: 1; min-width: 0; }
.add-resp {
  display: flex; align-items: center; gap: .6rem; margin: .1rem 0 1.2rem;
  font-family: var(--font-body); font-size: .95rem; color: var(--ink-soft); cursor: pointer;
}
.add-resp input { width: 1.15rem; height: 1.15rem; accent-color: var(--stamp); flex: none; }

/* "Send to an AI" panel under the pad */
.ai-share {
  width: min(560px, 100% - 2rem);
  margin: 1.1rem auto 0;
  padding: 1.3rem 1.5rem 1.4rem;
}
.ai-share h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -.01em;
  margin: 0 0 .3rem;
}
.ai-share > p {
  color: var(--ink-soft);
  font-size: .9rem;
  margin: 0 0 .95rem;
}
.ai-prompt {
  background: #1c1611;
  color: #e9dcc0;
  font-size: .8rem;
  line-height: 1.65;
  border-radius: 4px;
  padding: .9rem 1rem;
  margin-bottom: .95rem;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
  user-select: all;
}
.ai-prompt::selection, .ai-prompt ::selection { background: var(--stamp); color: #fff5e9; }
.ai-share-spec {
  display: inline-block;
  margin-left: 1rem;
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .04em;
  color: var(--muted);
  text-decoration: none;
}
.ai-share-spec:hover { color: var(--stamp); }
.ai-steps {
  margin: 0 0 1rem; padding-left: 1.4rem;
  color: var(--ink-soft); font-size: .9rem; line-height: 1.5; list-style: decimal;
}
.ai-steps li { margin-bottom: .2rem; }
.ai-tabs {
  display: inline-flex; gap: .2rem; margin-bottom: 1.05rem;
  background: rgba(0,0,0,.055); border-radius: 999px; padding: .25rem;
}
.ai-tab {
  border: none; background: none; cursor: pointer;
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted); padding: .5em 1.05em; border-radius: 999px;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.ai-tab.is-on { background: var(--stamp); color: #fff5e9; box-shadow: 0 1px 4px rgba(245,64,43,.35); }
.ai-tab:not(.is-on):hover { color: var(--ink); }
.ai-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.ai-actions + .ai-share-spec { display: block; margin: 1rem 0 0; }

/* import — paste a whole list (the AI copy-paste flow) */
.import-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(16,13,9,.58);
  display: flex; align-items: center; justify-content: center; padding: 1.2rem;
}
.import-overlay[hidden] { display: none; }
.import-modal { width: min(440px, 100%); padding: 1.5rem 1.6rem 1.6rem; border-radius: 16px; text-align: left; }
.import-text {
  width: 100%; min-height: 11rem; resize: vertical;
  font-family: var(--font-mono); font-size: .95rem; line-height: 1.5;
  padding: .75em .85em; border: 1.5px solid var(--hair); border-radius: 10px;
  background: #fff; color: var(--ink); outline: none; margin-bottom: 1rem;
}
.import-text:focus { border-color: var(--stamp); }

/* colourful category chips (market) — JS tints each by category */
.line-cat { background: color-mix(in srgb, currentColor 10%, transparent); }

/* ===========================================================================
   NOTEBOOK (kind = notes) — a ruled sheet, red margin, spiral binding
   ========================================================================= */
.notebook {
  --nb-line: #cdddef;
  --nb-margin: #ef9aa2;
  --nb-pad-left: 3.3rem;
  width: min(560px, 100% - 2rem);
  margin-inline: auto;
  position: relative;
  isolation: isolate;
  background-color: #fdfcf4;
  border-radius: 3px 10px 10px 3px;
  box-shadow: var(--lift);
  padding: clamp(1.4rem,4vw,2rem) clamp(1.2rem,4vw,1.8rem) clamp(1.5rem,4vw,1.9rem) var(--nb-pad-left);
  overflow: hidden;
}
/* spiral holes down the left binding */
.notebook::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0; width: 1.7rem;
  background: radial-gradient(circle 4.5px at 50% 0,
    #0000 3.4px, rgba(40,50,63,.16) 3.4px 4.5px, #0000 4.7px) 50% 1rem / 100% 1.6rem repeat-y;
  pointer-events: none; z-index: 2;
}
/* red margin line */
.notebook::after {
  content: "";
  position: absolute;
  left: calc(var(--nb-pad-left) - .9rem); top: 0; bottom: 0; width: 1.5px;
  background: var(--nb-margin); opacity: .85;
  pointer-events: none; z-index: 0;
}

.nb-head { margin-bottom: .5rem; }
.nb-title {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: clamp(2rem, 6vw, 2.7rem);
  line-height: 1.05;
  color: #2a3543;
  width: 100%;
  border: none; background: transparent; outline: none;
  padding: 0 .08em; margin: 0;
  border-radius: 3px;
}
.nb-title:hover { background: rgba(42,53,67,.05); }
.nb-title:focus { background: rgba(245,64,43,.08); }
.nb-meta { font-family: var(--font-body); font-size: .8rem; color: #93a8bf; margin-top: .1rem; }

.notebook .add { border-bottom: 2px solid #aac4e0; margin-top: .9rem; }
.notebook .add .pencil { color: var(--stamp); }
.notebook .add .field { font-family: var(--font-hand); font-size: 1.5rem; color: #2a3543; }
.notebook .add .field::placeholder { font-family: var(--font-body); font-size: .98rem; color: #9fb2c6; }
.notebook .add button { background: #2f7fd1; }
.notebook .add button:hover { background: var(--stamp); }

.notebook .line {
  align-items: center;
  min-height: 2.45rem;
  padding: .2rem 0;
  border-bottom: 1.6px solid var(--nb-line);
  gap: .65rem;
}
.notebook .line + .line { border-top: none; }
.notebook .line-text {
  font-family: var(--font-hand);
  font-size: 1.45rem; line-height: 1.1;
  color: #2a3543; white-space: normal; overflow: visible;
}
.notebook .tick { border-color: #8198b0; border-radius: 4px; align-self: center; }
.notebook .tick:hover { border-color: var(--stamp); }
.notebook .line.is-checked .tick { background: var(--olive); border-color: var(--olive-deep); }
.notebook .line.is-checked .line-text { color: #a3b3c4; }

.notebook .empty { color: #7a8da1; }
.notebook .empty b { font-family: var(--font-hand); font-style: normal; font-size: 1.7rem; color: #5d6e80; }

.notebook .totals {
  font-family: var(--font-body); text-transform: none; letter-spacing: 0;
  font-size: .92rem; color: var(--ink-soft);
  border-top: 1.6px solid var(--nb-line); padding-top: .7rem; margin-top: .5rem;
}
.notebook .totals .big { font-family: var(--font-hand); font-size: 1.3rem; color: #2a3543; }
.notebook .pad-foot { margin-top: .8rem; }
.notebook .linkish { color: #93a8bf; }
.notebook .linkish:hover { color: var(--stamp); }

/* ---- hero props: a notebook peeking out behind the receipt ---- */
.props { position: relative; display: flex; justify-content: center; align-items: center; perspective: 1400px; min-height: 400px; }
.props .receipt { position: relative; z-index: 2; }
.nb-prop {
  position: absolute; left: -0.5rem; top: 1%;
  width: 210px;
  transform: rotate(-8deg);
  background: #fdfcf4; border-radius: 3px 8px 8px 3px;
  box-shadow: var(--lift-sm);
  padding: .9rem .9rem 1.1rem 1.55rem;
  z-index: 1;
}
.nb-prop::after { content: ""; position: absolute; left: 1rem; top: 0; bottom: 0; width: 1.5px; background: #ef9aa2; opacity: .85; }
.nb-prop-title { font-family: var(--font-hand); font-weight: 700; font-size: 1.4rem; color: #2a3543; margin-bottom: .25rem; }
.nb-prop-line { font-family: var(--font-hand); font-size: 1.12rem; color: #2a3543; border-bottom: 1.5px solid #cdddef; padding: .12rem 0; }
.nb-prop-line.done { color: #aebccb; text-decoration: line-through; text-decoration-color: var(--stamp); }

/* ---- AI chat example on the landing ---- */
.chat { display: flex; flex-direction: column; gap: .75rem; }
.bubble { font-size: 1rem; line-height: 1.45; padding: .8rem 1rem; border-radius: 16px; max-width: 92%; }
.bubble.you { align-self: flex-start; background: #fffdf6; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--hair); border-bottom-left-radius: 4px; font-style: italic; }
.bubble.bot { align-self: flex-end; background: var(--olive); color: #fff; border-bottom-right-radius: 4px; font-weight: 500; }

/* ===========================================================================
   POTLUCK (kind = potluck) — "quem leva o quê"
   ========================================================================= */
.potluck {
  width: min(560px, 100% - 2rem);
  margin-inline: auto;
  position: relative;
  background-color: var(--paper);
  color: var(--ink);
  border-radius: 10px;
  box-shadow: var(--lift);
  padding: clamp(1.7rem,4vw,2.3rem) clamp(1.3rem,4vw,2rem) clamp(1.4rem,4vw,1.9rem);
  overflow: hidden;
  isolation: isolate;
}
.potluck::before { /* festive multicolour strip on top */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px;
  background: linear-gradient(90deg, var(--stamp), var(--brand), var(--olive));
}
.pad-stamp--potluck { color: var(--olive); border-color: var(--olive); }

.potluck .line { align-items: center; padding: .6rem 0; gap: .55rem; }
.potluck .line-text { white-space: normal; overflow: visible; }

.who-chip {
  flex: none;
  font-family: var(--font-mono);
  font-size: .72rem; font-weight: 500; letter-spacing: .02em;
  padding: .25em .7em;
  border-radius: 999px;
  border: 1.5px solid;
  cursor: pointer;
  white-space: nowrap;
}
.who-chip.claimed { background: color-mix(in srgb, currentColor 13%, transparent); }
.who-chip.free { color: var(--muted); border-style: dashed; border-color: var(--rule); }
.who-chip.free:hover { color: var(--stamp); border-color: var(--stamp); }

.potluck .line.is-checked .line-text { color: var(--muted); }
.potluck .line.is-checked .tick { background: var(--olive); border-color: var(--olive-deep); }

.potluck .totals {
  font-family: var(--font-body); text-transform: none; letter-spacing: 0; font-size: .92rem;
  border-top: 1px dashed var(--rule); padding-top: .8rem; margin-top: .6rem;
}
.potluck .totals .big { font-family: var(--font-mono); font-weight: 600; }
.potluck .pad-foot { margin-top: .7rem; }

/* ===========================================================================
   IDENTITY — nickname + animal avatar (no login)
   ========================================================================= */
.identity { position: relative; }
.identity-chip {
  display: inline-flex; align-items: center; gap: .45em;
  background: transparent; border: none; cursor: pointer;
  color: #e7d6b6;
  font-family: var(--font-mono); font-size: .8rem; letter-spacing: .03em;
  padding: .38em .7em .38em .45em; border-radius: 999px;
  box-shadow: inset 0 0 0 1.5px rgba(248,240,221,.24);
}
.identity-chip:hover { box-shadow: inset 0 0 0 1.5px rgba(248,240,221,.55); color: #fbeecb; }

.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.7em; height: 1.7em; border-radius: 50%;
  font-size: .95em; line-height: 1; flex: none;
  color: #fff; background: #8a8a8a;
}
.avatar[hidden] { display: none; }   /* the class's display: inline-flex was overriding [hidden] */
.avatar--sm {
  width: 1.5rem; height: 1.5rem; font-size: .92rem; flex: none;
  align-self: center; margin-left: .2rem;
  box-shadow: 0 0 0 1.5px rgba(255,255,255,.65);
}

.identity-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(16,13,9,.58);
  display: flex; align-items: center; justify-content: center;
  padding: 1.2rem;
}
.identity-overlay[hidden] { display: none; }
.identity-modal {
  width: min(360px, 100%);
  padding: 1.6rem 1.7rem 1.7rem;
  border-radius: 16px;
  text-align: left;
}
.identity-title { font-family: var(--font-display); font-weight: 600; font-size: 1.4rem; letter-spacing: -.01em; margin: 0 0 1.1rem; color: var(--ink); }
.modal-label { display: block; font-family: var(--font-mono); font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin: 0 0 .55rem; }
.animal-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin: 0 0 1.1rem; }
.animal {
  width: 2.15rem; height: 2.15rem; flex: none;
  border: none; border-radius: 50%; cursor: pointer;
  color: #fff; font-size: 1.18rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: transform .1s ease;
}
.animal:hover { transform: scale(1.14); }
.animal.sel { box-shadow: 0 0 0 2.5px var(--paper), 0 0 0 4.5px var(--ink); }
.identity-name {
  width: 100%; font-family: var(--font-mono); font-size: 1rem;
  padding: .6em .7em; border: 1.5px solid var(--hair); border-radius: 8px;
  background: #fff; color: var(--ink); margin-bottom: .55rem; outline: none;
}
.identity-name:focus { border-color: var(--stamp); }
.identity-note { font-family: var(--font-body); font-size: .76rem; color: var(--muted); margin: 0 0 1.1rem; }
.identity-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.identity-actions .btn--stamp { flex: 1; justify-content: center; }

/* ===========================================================================
   RESPONSÁVEL — avatar on the left of each line + "adicionado por" subline
   ========================================================================= */
.line { flex-wrap: wrap; }
/* keep line-text content-width (so the strike fits the words) and push delete right */
.notebook .line-text, .potluck .line-text { flex: 0 1 auto; min-width: 0; }
.notebook .del, .potluck .del { margin-left: auto; }
.resp {
  flex: none; width: 1.55rem; height: 1.55rem; padding: 0;
  border: none; background: none; cursor: pointer; align-self: center;
  display: inline-flex; align-items: center; justify-content: center;
}
.resp.empty::before {
  content: ""; width: 1.15rem; height: 1.15rem; border-radius: 50%;
  border: 1.5px dashed var(--hair); opacity: .7;
  transition: border-color .15s ease, opacity .15s ease;
}
.resp.empty:hover::before { border-color: var(--stamp); opacity: 1; }
.resp.filled .avatar--sm { margin: 0; box-shadow: 0 0 0 1.5px rgba(255,255,255,.7); }

.added-note {
  flex: 0 0 100%; order: 99;
  padding-left: 3.95rem; margin-top: -.05rem;
  font-family: var(--font-body); font-size: .72rem; color: var(--muted); letter-spacing: .01em;
}
.line.is-checked .added-note { text-decoration: none; }

.resp-menu, .edit-menu {
  position: absolute; z-index: 9500; min-width: 190px;
  padding: .4rem; border-radius: 12px;
  display: flex; flex-direction: column; gap: .1rem;
}
.resp-menu-item, .edit-menu-item {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  font-family: var(--font-body); font-size: .9rem; color: var(--ink);
  padding: .5rem .6rem; border-radius: 7px; transition: background .12s ease;
}
.resp-menu-item:hover, .edit-menu-item:hover { background: rgba(0,0,0,.06); }
.resp-menu-item.danger, .edit-menu-item.danger { color: var(--stamp); }

/* ===========================================================================
   PRESENCE — who's viewing the list right now
   ========================================================================= */
.presence { position: relative; display: inline-flex; align-items: center; }
.presence-btn {
  display: inline-flex; align-items: center; cursor: pointer;
  background: none; border: none; padding: .2rem .1rem;
}
.presence-stack { display: inline-flex; align-items: center; }
.presence-stack .avatar--sm { margin: 0 0 0 -.5rem; box-shadow: 0 0 0 2px var(--desk); }
.presence-stack .avatar--sm:first-child { margin-left: 0; }
.presence-more {
  margin-left: -.45rem; flex: none;
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: #4a5059; color: #e7d6b6;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: .6rem; font-weight: 600;
  box-shadow: 0 0 0 2px var(--desk);
}
.presence-pop {
  position: absolute; right: 0; top: calc(100% + .55rem); z-index: 60;
  min-width: 190px; padding: .8rem .9rem; border-radius: 12px; text-align: left;
}
.presence-head {
  font-family: var(--font-mono); font-size: .6rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: .6rem;
}
.presence-row {
  display: flex; align-items: center; gap: .6rem; padding: .28rem 0;
  font-family: var(--font-body); font-size: .92rem; color: var(--ink);
}
.presence-row .avatar--sm { box-shadow: 0 0 0 1.5px rgba(0,0,0,.08); }

/* ===========================================================================
   SPEC PAGE
   ========================================================================= */
.spec { width: min(760px, 100% - 2rem); margin: clamp(1.4rem,4vw,2.6rem) auto 4rem; padding: clamp(1.8rem,4vw,2.6rem); }
.spec h1 { font-family: var(--font-display); font-weight: 900; font-size: 2rem; margin: .3rem 0 .2rem; }
.spec .lede { color: var(--ink-soft); margin: 0 0 1.4rem; }
.spec h2 { font-family: var(--font-mono); font-size: .76rem; letter-spacing: .2em; text-transform: uppercase; color: var(--stamp); margin: 2rem 0 .8rem; }
.kv { font-family: var(--font-mono); font-size: .86rem; }
.kv div { display: flex; gap: 1ch; padding: .2rem 0; border-bottom: 1px dotted var(--hair); }
.kv b { color: var(--muted); font-weight: 500; min-width: 12ch; }
.ep { border-top: 2px dashed var(--rule); padding: 1rem 0; }
.ep .sig { display: flex; align-items: center; gap: .7ch; font-family: var(--font-mono); font-size: .92rem; }
.verb { font-weight: 600; color: #fff3e7; background: var(--ink); border-radius: 3px; padding: .12em .5em; font-size: .74rem; letter-spacing: .06em; }
.verb.get { background: var(--olive); }
.verb.post { background: var(--stamp); }
.verb.patch { background: var(--gold); }
.verb.delete { background: var(--stamp-deep); }
.ep .sum { color: var(--ink-soft); font-size: .92rem; margin: .5rem 0 .6rem; }
.code {
  display: block; background: #1c1611; color: #e9dcc0;
  font-family: var(--font-mono); font-size: .8rem; line-height: 1.6;
  padding: .8rem 1rem; border-radius: 4px; overflow-x: auto; white-space: pre-wrap; word-break: break-all;
}
.spec .ai-list { font-family: var(--font-mono); font-size: .84rem; color: var(--ink-soft); line-height: 1.8; padding-left: 1.2rem; }

/* ===========================================================================
   MISSING (404)
   ========================================================================= */
.missing { width: min(440px, 100% - 2rem); margin: clamp(3rem,10vw,7rem) auto; padding: 2.4rem 2rem; text-align: center; }
.missing .pad-stamp { margin-bottom: .8rem; }
.missing h1 { font-family: var(--font-display); font-weight: 900; font-size: 1.8rem; margin: .4rem 0; }
.missing p { color: var(--ink-soft); margin: 0 0 1.4rem; }

/* ===========================================================================
   ANIMATIONS
   ========================================================================= */
@keyframes print-in {
  from { opacity: 0; transform: translateY(-6px); clip-path: inset(0 0 100% 0); }
  to   { opacity: 1; transform: translateY(0);   clip-path: inset(0 0 0 0); }
}
@keyframes stamp-thunk {
  0%   { opacity: 0; transform: translateY(-50%) rotate(-11deg) scale(1.6); }
  60%  { opacity: .95; transform: translateY(-50%) rotate(-11deg) scale(.92); }
  100% { opacity: .9; transform: translateY(-50%) rotate(-11deg) scale(1); }
}
@keyframes pulse {
  0%, 100% { background-color: var(--paper); }
  40% { background-color: #fbf4e2; }
}
.reveal { opacity: 0; transform: translateY(14px); animation: rise .7s cubic-bezier(.2,.7,.2,1) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }

.receipt.tearing { animation: tear-off .62s cubic-bezier(.5,.1,.7,.35) forwards; }
@keyframes tear-off {
  0%   { transform: rotate(-2.2deg) translateY(0); }
  22%  { transform: rotate(-2.2deg) translateY(-10px); }
  100% { transform: rotate(7deg) translateY(115vh); opacity: .15; }
}

.barcode-static {
  height: 40px; width: 190px; margin: .7rem auto .2rem;
  background: repeating-linear-gradient(90deg,
    var(--ink) 0 2px, transparent 2px 4px,
    var(--ink) 4px 7px, transparent 7px 9px,
    var(--ink) 9px 10px, transparent 10px 13px,
    var(--ink) 13px 16px, transparent 16px 17px);
}

/* ===========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; gap: 2.4rem; }
  .hero-copy { order: 1; text-align: center; }   /* headline + CTA first, receipt below */
  .hero-copy .lede { margin-inline: auto; }
  .hero-copy .hero-ai { margin-inline: auto; }
  .hero-cta { justify-content: center; }
  .props { order: 2; min-height: 0; }
  .nb-prop { display: none; }   /* avoid overflow on small screens */
  .steps { grid-template-columns: 1fr; }
  .ai-band { grid-template-columns: 1fr; }
  .topbar .brand { font-size: 2rem; }
  .topbar-links { gap: 1rem; }
}
/* ---- Landing topbar: a 3-bar menu on phones/small tablets ----------------- */
@media (max-width: 640px) {
  .topbar { position: relative; }
  .topbar-burger { display: flex; }
  .topbar-links {
    position: absolute; top: calc(100% + .5rem); right: 0; z-index: 60;
    flex-direction: column; align-items: stretch; gap: .15rem;
    min-width: 12.5rem; padding: .5rem;
    background: var(--desk-top); border: 1px solid rgba(255,255,255,.1); border-radius: 14px;
    box-shadow: 0 18px 40px -14px rgba(0,0,0,.65);
    opacity: 0; transform: translateY(-6px); pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
  }
  .topbar.is-open .topbar-links { opacity: 1; transform: none; pointer-events: auto; }
  .topbar-links a { padding: .7rem .8rem; border-radius: 9px; font-size: .9rem; }
  .topbar-links a:hover { background: rgba(255,255,255,.06); }
  .topbar-links .inline-create { margin-top: .15rem; }
  .topbar-links .inline-create .btn { width: 100%; justify-content: center; }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .topbar .brand { font-size: 1.55rem; }
  .hero-cta .btn { width: 100%; justify-content: center; }
}
@media (max-width: 380px) {
  .topbar .brand { font-size: 1.3rem; }
}

/* ===========================================================================
   MOBILE USABILITY
   Same pad, same paper — but reachable by thumbs. We fix the things that only
   work with a mouse: hover-only buttons, hair-thin tap targets, lines that
   truncate, and an add field stranded at the top of a long list.
   ========================================================================= */

/* Touch devices have no :hover, so any control that only appears on hover is
   invisible to a finger. Reveal them, and drop the grey tap flash. */
@media (hover: none) {
  .del { opacity: .5; color: var(--muted); }
  .line:active .del, .line:focus-within .del { opacity: 1; }
  .price--add { color: var(--muted); }          /* the "R$ —" price slot is a real target */
  .add button:hover, .add button:active { transform: none; }   /* no stuck 90° rotate on tap */
}

@media (max-width: 560px) {
  /* ---- Tap targets: ~44px hit areas without nudging the visual design ------- */
  .tick { position: relative; }
  .tick::before { content: ""; position: absolute; inset: -12px; }   /* invisible hit slug */
  .del { position: relative; padding: .25rem .3rem; }
  .del::before { content: ""; position: absolute; inset: -7px -2px; }
  .linkish { padding: .55em .2em; }
  .ai-tab { padding: .65em 1.1em; }

  /* Header is the same unified flex row; on a phone it just wraps to brand-then-
     controls, and the printer drops off (no one prints a list from a phone). */
  .pad-actions .brand { font-size: 1.25rem; }
  .pad-actions .pad-print { display: none; }
  .identity-chip { padding: .45em .7em .45em .45em; min-height: 38px; white-space: nowrap; }

  /* The per-line section tag (notes/potluck) is just noise on a phone — the
     section header already names the aisle. Drop it; sections still group. */
  .sec-chip { display: none; }

  /* On a phone the ✎ and the hand get fatter tap areas (the hand's stays off the
     checkbox to its right). */
  .line--m .edit::before { inset: -12px; }
  .line--m .resp.volunteer { position: relative; }
  .line--m .resp.volunteer::after { content: ""; position: absolute; inset: -11px -2px -11px -11px; }

  /* Notebook + potluck keep the simple flex line; just let a long task share its
     row with the checkbox, and tidy the owner circle. */
  .notebook .line-text, .potluck .line-text { flex: 1 1 0; }
  .notebook .resp.empty { display: none; }
  .potluck .resp { width: 1.9rem; height: 1.9rem; }
  .potluck .resp.empty::before { width: 1.4rem; height: 1.4rem; }

  /* roomier popover rows for touch (section / responsible / ✎ menus) */
  .resp-menu-item, .section-menu-item, .edit-menu-item { padding: .72rem .7rem; }

  /* ---- A "+" FAB replaces the inline compose row; it opens the add sheet ----- */
  .deskwrap .compose { display: none; }
  .add-fab {
    display: inline-flex; align-items: center; justify-content: center;
    position: fixed; z-index: 250;
    right: 1.1rem; bottom: calc(1.2rem + env(safe-area-inset-bottom));
    width: 3.5rem; height: 3.5rem; border-radius: 50%;
    border: none; cursor: pointer;
    background: var(--ink); color: var(--paper);
    box-shadow: 0 10px 24px -8px rgba(0,0,0,.55), 0 3px 8px rgba(0,0,0,.3);
    transition: transform .12s ease, background .15s ease;
  }
  .add-fab:hover, .add-fab:active { background: var(--stamp); color: #2a1a0d; transform: scale(1.06); }
  /* room so the last rows clear the floating button; list starts clean under head */
  .deskwrap { padding-bottom: calc(4.8rem + env(safe-area-inset-bottom)); }
  .pad .lines, .notebook .lines, .potluck .lines { margin-top: .6rem; }
  .toast { bottom: calc(5rem + env(safe-area-inset-bottom)); }

  /* ---- Modals slide up as bottom sheets — reachable, native-feeling --------- */
  .identity-overlay, .import-overlay, .additem-overlay { align-items: flex-end; padding: 0; }
  .identity-modal, .import-modal, .additem-modal {
    width: 100%; max-width: none;
    border-radius: 18px 18px 0 0;
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
    animation: sheet-up .28s cubic-bezier(.2,.8,.2,1);
  }
  .additem-modal { max-height: 88vh; overflow-y: auto; }
  .animal { width: 2.5rem; height: 2.5rem; font-size: 1.3rem; }
  /* ≥16px keeps iOS from zooming the page when these focus */
  .section-new, .import-text { font-size: 16px; }

  /* Popovers (section / responsável / ✎) become bottom sheets — an anchored
     popover near the screen edge used to overflow and drag the page sideways. */
  .menu-sheet {
    position: fixed; inset: auto 0 0 0; top: auto;
    width: 100%; min-width: 0; max-width: none;
    border-radius: 18px 18px 0 0; z-index: 9600;
    padding: 1rem 1.1rem calc(1.2rem + env(safe-area-inset-bottom));
    box-shadow: 0 -16px 40px -22px rgba(0,0,0,.6);
    max-height: 72vh; overflow-y: auto;
    animation: sheet-up .28s cubic-bezier(.2,.8,.2,1);
  }
  .menu-sheet .section-list { max-height: 40vh; }
  .menu-sheet .section-new { font-size: 16px; margin-bottom: .6rem; }

  /* ---- Receipt footer: stop the summary label colliding with its tally, and
     keep the share token from overflowing the paper ------------------------- */
  .pad .totals { flex-direction: column; align-items: flex-start; gap: .15rem; }
  .pad .totals .big { letter-spacing: .03em; }
  .bill { gap: .5rem; }
  .barcode-num { letter-spacing: .14em; font-size: .58rem; word-break: break-all; max-width: 100%; }
  .copyhint { letter-spacing: .06em; }
}

@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }

/* ===========================================================================
   PRINT — make it an actual receipt
   ========================================================================= */
@media print {
  body { background: #fff; }
  .grain, .pad-actions, .add, .del, .pad-foot .linkish, .toast, .ai-share { display: none !important; }
  .pad, .notebook { box-shadow: none; width: 100%; }
}

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