/* BrainDump — Riso Pop. Tokens from the design handoff. */

:root {
  --stock:      #FFF4DE;
  --stock-sunk: #FFE9C0;
  --surface:    #FFFFFF;
  --ink:        #1A1206;
  --ink-2:      #3A2E18;
  --ink-3:      #5C5136;
  --muted:      #8A7A5E;
  --muted-2:    #A5936F;
  --muted-3:    #9C8B6E;
  --rule:       #E6D9BC;
  --dashed:     #C0AC85;
  --orange:     #FF6B2C;
  --cyan:       #1FA9C7;
  --grape:      #5B3FD6;
  --yellow:     #FFD166;
  --tint-cyan:  #EAF7FA;
  --tint-grape: #F1ECFF;
  --on-cyan:    #3F5A61;
  --on-cyan-2:  #23383D;
  --link:       #B8541A;
  --grape-dim:  #C9BEFF;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "DM Sans", -apple-system, system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --stock:      #1A1206;
    --stock-sunk: #241A0B;
    --surface:    #241A0B;
    --ink:        #FFF4DE;
    --ink-2:      #E3D6B8;
    --ink-3:      #E3D6B8;
    --muted:      #8A7A5E;
    --muted-2:    #6B5C3F;
    --muted-3:    #6B5C3F;
    --rule:       #2E2411;
    --dashed:     #4A3A1E;
    --tint-cyan:  transparent;
    --tint-grape: transparent;
    --on-cyan:    #E3D6B8;
    --on-cyan-2:  #E3D6B8;
    --grape-dim:  #C9BEFF;
  }
}

* { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  background: var(--stock);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 86px; /* room for the tab bar */
}

.wrap { max-width: 620px; margin: 0 auto; padding: 0 20px; }
@media (min-width: 1024px) { .wrap { padding: 0 36px; } }

/* ── header ── */
.top { display: flex; align-items: baseline; justify-content: space-between;
       padding-top: 18px; margin-bottom: 14px; }
.wordmark { font-family: var(--serif); font-weight: 400; font-size: 32px;
            color: var(--ink); margin: 0; }
.status-pill {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: #1A1206;
  background: var(--yellow); border: 1.5px solid var(--ink);
  border-radius: 999px; padding: 5px 11px;
}

/* ── pills (labels + buttons) ── */
.pill {
  display: inline-block; border: 1.5px solid var(--ink); border-radius: 999px;
  padding: 4px 12px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .14em; margin-bottom: 10px;
}
.pill.orange { background: var(--orange); color: #1A1206; }
.pill.cyan   { background: var(--cyan);   color: #FFF4DE; }
.pill.grape  { background: var(--grape);  color: #FFF4DE; }
.pill.yellow { background: var(--yellow); color: #1A1206; }
.pill.plain  { background: transparent;   color: var(--ink); }

/* ── capture card ── */
.capture {
  background: var(--surface); border: 2px solid var(--ink); border-radius: 18px;
  padding: 16px; display: flex; flex-direction: column; gap: 16px;
  box-shadow: 4px 4px 0 var(--ink); margin-bottom: 24px;
}
@media (prefers-color-scheme: dark) { .capture { box-shadow: 4px 4px 0 #C0AC85; } }
.capture textarea {
  border: none; outline: none; resize: none; background: transparent;
  width: 100%; min-height: 74px;
  font-family: var(--serif); font-size: 25px; line-height: 1.2;
  color: var(--ink);
}
.capture textarea::placeholder { color: var(--muted-3); }
.capture .actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 11px;
  border: 1.5px solid var(--ink); background: var(--stock);
  font-size: 17px; cursor: pointer; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn.voice { background: var(--cyan); color: #FFF4DE; }
.btn-dump {
  margin-left: auto;
  background: var(--orange); color: #1A1206;
  border: 1.5px solid var(--ink); border-radius: 999px;
  padding: 13px 21px; font-family: var(--sans);
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
}
.btn-dump:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

/* ── section labels ── */
.sec-label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .16em; color: var(--muted); margin: 22px 0 4px;
}
.sec-label .count { font-size: 11px; letter-spacing: 0; color: var(--muted-2); }

/* ── dump rows (Today) ── */
.dump-row {
  display: grid; grid-template-columns: 46px 1fr; gap: 10px;
  padding: 12px 0; border-bottom: 1.5px solid var(--rule);
}
.dump-row .t { font-size: 11px; font-weight: 700; color: var(--muted-2); padding-top: 2px; }
.dump-row .x { font-size: 16px; line-height: 1.4; color: var(--ink); text-wrap: pretty; }
.dump-row a { color: inherit; text-decoration: none; }

/* ── to-do rows ── */
.todo-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 11px 0; border-bottom: 1.5px solid var(--rule);
}
.todo-row .x { font-size: 16px; line-height: 1.4; color: var(--ink-2); flex: 1; }
.todo-row a { color: inherit; text-decoration: none; }
.also {
  display: block; margin-top: 3px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
}
.also.question { color: var(--cyan); }
.also.watch    { color: #B8912E; }
.also.idea     { color: var(--grape); }
.also.reference{ color: var(--muted); }

.check {
  appearance: none; -webkit-appearance: none; flex-shrink: 0;
  width: 20px; height: 20px; margin: 1px 0 0;
  border: 2px solid var(--ink); border-radius: 5px; background: var(--surface);
  cursor: pointer; position: relative;
}
@media (prefers-color-scheme: dark) { .check { border-color: var(--orange); } }
.check:checked { background: var(--orange); }
.check:checked::after {
  content: ""; position: absolute; left: 5px; top: 1px;
  width: 4px; height: 9px; border: solid #1A1206;
  border-width: 0 2.2px 2.2px 0; transform: rotate(43deg);
}
label.tap { display: flex; padding: 12px; margin: -12px; cursor: pointer; }

.declutter {
  font-family: var(--sans); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--cyan); background: none; border: 1.5px solid var(--cyan);
  border-radius: 999px; padding: 4px 11px; margin-left: 10px; cursor: pointer;
}
.declutter:disabled { opacity: .5; cursor: default; }
.declutter .busy { display: none; }
.declutter.htmx-request .idle { display: none; }
.declutter.htmx-request .busy { display: inline; }

.tucked { font-size: 12px; color: var(--muted); padding: 10px 0; }
.tucked button {
  font: inherit; font-weight: 700; color: var(--link);
  background: none; border: none; padding: 0;
  text-decoration: underline; cursor: pointer;
}

/* ── Sorted ── */
.sorted-head {
  background: var(--grape); border-bottom: 2px solid var(--ink);
  padding: 20px 0 18px; margin-bottom: 4px;
}
.sorted-toggle {
  display: inline-flex; border: 1.5px solid #FFF4DE; border-radius: 999px;
  overflow: hidden; margin-bottom: 14px;
}
.sorted-toggle a {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em;
  color: #FFF4DE; text-decoration: none; padding: 6px 14px;
}
.sorted-toggle a.on { background: #FFF4DE; color: #1A1206; }

.sorted-head .eyebrow {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .16em; color: var(--grape-dim); margin: 0 0 6px;
}
.sorted-head h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: 31px; line-height: 1.12; color: #FFF4DE; margin: 0;
}
.sorted-head .older {
  margin-top: 12px; display: inline-block;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: #FFF4DE; text-decoration: none;
  border: 1.5px solid #FFF4DE; border-radius: 999px; padding: 4px 12px;
}

.band { border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink);
        padding: 18px 0 14px; }
.band.cyan  { background: var(--tint-cyan); }
.band.grape { background: var(--tint-grape); }
.plain-sec  { padding-top: 18px; padding-bottom: 14px; }

.q-item { padding: 8px 0 14px; }
.q-item .q { font-size: 16px; font-weight: 500; color: var(--ink); margin: 0 0 5px; }
.q-item .a { font-size: 15px; line-height: 1.5; color: var(--on-cyan); margin: 0; }
.q-item a { color: inherit; text-decoration: none; }

.watch-item { padding: 9px 0; border-bottom: 1.5px solid var(--rule); }
.watch-item .wt { font-size: 16px; color: var(--ink); text-decoration: none; display: block; }
.watch-item .wm { font-size: 12px; font-weight: 700; color: var(--link); margin-top: 2px; }

.idea-item { font-size: 16px; line-height: 1.4; color: var(--ink); padding: 5px 0; }
.idea-item a { color: inherit; text-decoration: none; }

.drawer {
  border: 2px dashed var(--dashed); border-radius: 14px;
  padding: 14px 16px; margin: 22px 0;
}
.drawer summary {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  cursor: pointer; list-style: none;
}
.drawer summary::-webkit-details-marker { display: none; }
.drawer .dl { font-size: 10px; font-weight: 700; text-transform: uppercase;
              letter-spacing: .14em; color: var(--muted); }
.drawer .dr { font-size: 14px; color: var(--muted); }
.drawer[open] .dr { visibility: hidden; }
.drawer ul { margin: 10px 0 0; padding: 0; }
.drawer li { font-size: 15px; color: var(--ink-3); padding: 5px 0; list-style: none; }
.drawer li a { color: inherit; text-decoration: none; }

.also.buy   { color: #B8541A; }
.also.quote { color: #B8912E; }

/* ── quote card: one component, size by context, ink seeded on id ── */
.qcard {
  display: flex; flex-direction: column;
  border: 2px solid #1A1206; text-decoration: none;
  box-shadow: 4px 4px 0 #1A1206;
  text-wrap: pretty;
}
.qcard .qmark { font-family: var(--serif); font-size: 42px; line-height: 1;
                height: 24px; opacity: .4; }
.qcard .qbody { font-family: var(--serif); line-height: 1.15; flex: 1; }
.qcard .qfoot { display: flex; justify-content: space-between; gap: 10px;
                padding-top: 18px; align-items: baseline; }
.qcard .qattr { font-size: 11px; font-weight: 700; text-transform: uppercase;
                letter-spacing: .12em; }
.qcard .qprov { font-size: 11px; font-weight: 700; white-space: nowrap; }

/* size variants */
.qcard--shelf { width: 172px; flex-shrink: 0; border-radius: 16px;
                padding: 16px 14px 12px; scroll-snap-align: start; }
.qcard--shelf .qbody { font-size: 19px; }
.qcard--shelf.q--md .qbody { font-size: 16px; }
.qcard--shelf.q--sm .qbody { font-size: 14px; line-height: 1.3; }
.qcard--full { border-radius: 20px; padding: 26px 22px 20px; }
.qcard--full.q--lg .qbody { font-size: 30px; line-height: 1.1; }
.qcard--full.q--md .qbody { font-size: 26px; line-height: 1.15; }
.qcard--full.q--sm .qbody { font-size: 22px; line-height: 1.25; }

/* inks: light mode fills the card */
.ink-grape  { background: #5B3FD6; }
.ink-grape  .qbody, .ink-grape .qmark { color: #FFF4DE; }
.ink-grape  .qattr, .ink-grape .qprov { color: #C9BEFF; }
.ink-cyan   { background: #1FA9C7; }
.ink-cyan   .qbody, .ink-cyan .qmark { color: #FFF4DE; }
.ink-cyan   .qattr, .ink-cyan .qprov { color: #D6F2F8; }
.ink-yellow { background: #FFD166; }
.ink-yellow .qbody, .ink-yellow .qmark { color: #1A1206; }
.ink-yellow .qattr, .ink-yellow .qprov { color: #7A5E12; }
.ink-orange { background: #FF6B2C; }
.ink-orange .qbody, .ink-orange .qmark { color: #1A1206; }
.ink-orange .qattr, .ink-orange .qprov { color: #5C2408; }
.ink-cream  { background: #FFF4DE; }
.ink-cream  .qbody, .ink-cream .qmark { color: #1A1206; }
.ink-cream  .qattr, .ink-cream .qprov { color: #8A7A5E; }

/* dark: ink moves to the border, type is the brightest thing */
@media (prefers-color-scheme: dark) {
  .qcard { background: #241A0B; box-shadow: 4px 4px 0 #C0AC85; }
  .qcard .qbody, .qcard .qmark { color: #FFF4DE; }
  .qcard .qprov { color: #8A7A5E; }
  .qcard.ink-grape  { border-color: #8E79E6; } .qcard.ink-grape .qattr  { color: #8E79E6; }
  .qcard.ink-cyan   { border-color: #1FA9C7; } .qcard.ink-cyan .qattr   { color: #1FA9C7; }
  .qcard.ink-yellow { border-color: #FFD166; } .qcard.ink-yellow .qattr { color: #FFD166; }
  .qcard.ink-orange { border-color: #FF6B2C; } .qcard.ink-orange .qattr { color: #FF6B2C; }
  .qcard.ink-cream  { border-color: #C0AC85; } .qcard.ink-cream .qattr  { color: #C0AC85; }
}

/* the shelf in Sorted: the app's only horizontal scroller */
.quote-shelf {
  display: flex; gap: 12px; overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 20px 10px 0;
  scrollbar-width: thin;
}
.quote-shelf::-webkit-scrollbar { display: none; }
@media (min-width: 1024px) { .quote-shelf::-webkit-scrollbar { display: block; height: 6px; } }

/* Quotes screen (Q1) */
.quotes-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  padding-top: 18px; padding-bottom: 14px;
  border-bottom: 2px solid var(--ink); margin-bottom: 18px;
}
.eyebrow-label { font-size: 10px; font-weight: 700; text-transform: uppercase;
                 letter-spacing: .16em; color: var(--muted); margin: 0 0 2px; }
.pill-outline {
  font-family: var(--sans); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .12em; color: var(--ink);
  background: none; border: 1.5px solid var(--ink); border-radius: 999px;
  padding: 6px 14px; cursor: pointer;
}
.quote-stack { display: flex; flex-direction: column; gap: 18px; padding-bottom: 26px; }
.quotes-empty { color: var(--muted); font-size: 15px; }

/* one quote full screen (Q2) */
.qscreen { min-height: 62vh; display: flex; flex-direction: column;
           border-bottom: 2px solid #1A1206; }
.qscreen .qscreen-top { display: flex; justify-content: space-between;
                        padding-top: 18px; width: 100%; }
.qscreen-back { font-size: 11px; font-weight: 700; text-transform: uppercase;
                letter-spacing: .1em; text-decoration: none; }
.qscreen-when { font-size: 11px; font-weight: 700; }
.qscreen-center { flex: 1; display: flex; flex-direction: column;
                  justify-content: center; padding-top: 30px; padding-bottom: 40px; }
.qmark-big { font-family: var(--serif); font-size: 86px; line-height: .6;
             opacity: .35; display: block; }
.qscreen-body { font-family: var(--serif); font-size: 42px; line-height: 1.08;
                margin: 10px 0 0; text-wrap: pretty; }
.qscreen-rule { display: block; width: 64px; height: 2px; margin: 26px 0 14px;
                opacity: .5; }
.qscreen-attr { font-size: 13px; font-weight: 700; text-transform: uppercase;
                letter-spacing: .12em; margin: 0 0 6px; }
.qscreen-context { font-size: 14px; margin: 0; }
.qscreen.ink-grape  { background: #5B3FD6; }
.qscreen.ink-grape  *      { color: #FFF4DE; }
.qscreen.ink-grape  .qscreen-when, .qscreen.ink-grape .qscreen-context { color: #C9BEFF; }
.qscreen.ink-grape  .qscreen-rule { background: #C9BEFF; }
.qscreen.ink-cyan   { background: #1FA9C7; }
.qscreen.ink-cyan   *      { color: #FFF4DE; }
.qscreen.ink-cyan   .qscreen-when, .qscreen.ink-cyan .qscreen-context { color: #D6F2F8; }
.qscreen.ink-cyan   .qscreen-rule { background: #D6F2F8; }
.qscreen.ink-yellow { background: #FFD166; }
.qscreen.ink-yellow *      { color: #1A1206; }
.qscreen.ink-yellow .qscreen-when, .qscreen.ink-yellow .qscreen-context { color: #7A5E12; }
.qscreen.ink-yellow .qscreen-rule { background: #7A5E12; }
.qscreen.ink-orange { background: #FF6B2C; }
.qscreen.ink-orange *      { color: #1A1206; }
.qscreen.ink-orange .qscreen-when, .qscreen.ink-orange .qscreen-context { color: #5C2408; }
.qscreen.ink-orange .qscreen-rule { background: #5C2408; }
.qscreen.ink-cream  { background: #FFF4DE; }
.qscreen.ink-cream  *      { color: #1A1206; }
.qscreen.ink-cream  .qscreen-when, .qscreen.ink-cream .qscreen-context { color: #8A7A5E; }
.qscreen.ink-cream  .qscreen-rule { background: #8A7A5E; }
.qfloor { border-bottom: 1.5px solid var(--rule); padding: 16px 0; }
.qfloor .ci { padding: 8px 0; }
.qfloor .ci a { font-size: 15px; color: var(--ink); text-decoration: none; }
.qfloor .cm { font-size: 11px; font-weight: 700; color: var(--muted); }
.qactions { background: var(--stock-sunk); }

/* per-section ink underline on the active tab */
.tabbar a.on { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
.tabbar a.tab-today.on   { box-shadow: inset 0 -2px 0 var(--orange); }
.tabbar a.tab-sorted.on  { box-shadow: inset 0 -2px 0 var(--cyan); }
.tabbar a.tab-quotes.on  { box-shadow: inset 0 -2px 0 var(--grape); }
.tabbar a.tab-archive.on { box-shadow: inset 0 -2px 0 var(--yellow); }

/* ── item detail ── */
.crumb-row { display: flex; justify-content: space-between; align-items: baseline;
             padding-top: 18px; margin-bottom: 16px; }
.crumb { font-size: 11px; font-weight: 700; text-transform: uppercase;
         letter-spacing: .1em; color: var(--ink); text-decoration: none; }
.crumb-meta { font-size: 11px; font-weight: 700; color: var(--muted); }

.verbatim {
  background: var(--surface); border: 2px solid var(--ink); border-radius: 18px;
  box-shadow: 4px 4px 0 var(--ink); padding: 18px; margin-bottom: 18px;
}
@media (prefers-color-scheme: dark) { .verbatim { box-shadow: 4px 4px 0 #C0AC85; } }
.verbatim .eyebrow { font-size: 10px; font-weight: 700; text-transform: uppercase;
                     letter-spacing: .14em; color: var(--muted-2); margin: 0 0 8px; }
.verbatim .raw { font-family: var(--serif); font-size: 27px; line-height: 1.2;
                 color: var(--ink); margin: 0 0 14px; overflow-wrap: break-word; }
.pills { display: flex; flex-wrap: wrap; gap: 7px; }
.pills .pill { margin-bottom: 0; }
.pill.outline { border-color: var(--dashed); color: var(--muted); }

.answer-panel {
  background: var(--tint-cyan); border: 1.5px solid var(--ink); border-radius: 16px;
  padding: 16px 18px; margin-bottom: 18px;
}
.answer-panel .eyebrow { font-size: 10px; font-weight: 700; text-transform: uppercase;
                         letter-spacing: .14em; color: var(--cyan); margin: 0 0 7px; }
.answer-panel .body { font-size: 16px; line-height: 1.55; color: var(--on-cyan-2); margin: 0; }
.answer-panel .foot { font-size: 11px; font-weight: 700; color: #6E8B92; margin: 10px 0 0; }

.connected .eyebrow { font-size: 10px; font-weight: 700; text-transform: uppercase;
                      letter-spacing: .14em; color: var(--muted); margin: 18px 0 8px; }
.connected .ci { padding: 8px 0; border-bottom: 1.5px solid var(--rule); }
.connected .ci a { font-size: 16px; color: var(--ink); text-decoration: none; }
.connected .cm { font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 2px; }

.detail-actions { display: flex; gap: 10px; margin-top: 28px; }
.detail-actions form { display: contents; }
.btn-secondary, .btn-primary {
  font-family: var(--sans); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  border-radius: 999px; padding: 12px 20px; cursor: pointer;
}
.btn-secondary { background: var(--stock); color: var(--ink); border: 2px solid var(--ink); }
.btn-primary   { background: var(--orange); color: #1A1206; border: 2px solid var(--ink);
                 box-shadow: 3px 3px 0 var(--ink); }

/* ── archive ── */
.archive-sub { font-size: 15px; color: var(--muted); margin: -8px 0 14px; }
.search {
  width: 100%; background: var(--surface); border: 1.5px solid var(--ink);
  border-radius: 999px; padding: 11px 16px; font-family: var(--sans);
  font-size: 16px; color: var(--ink); outline: none; margin-bottom: 16px;
  appearance: none; -webkit-appearance: none;
}
.search::placeholder { font-size: 13px; color: var(--muted-2); }
.archive-rule { border: none; border-top: 2px solid var(--ink); margin: 0 0 6px; }
.group-label {
  display: flex; justify-content: space-between;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .14em; color: var(--ink); margin: 18px 0 4px;
}
.group-label .count { color: var(--muted-2); letter-spacing: 0; font-size: 11px; }
.arch-row {
  display: grid; grid-template-columns: 1fr auto; gap: 12px;
  padding: 9px 0; border-top: 1.5px solid var(--rule); align-items: baseline;
}
.arch-row a { font-size: 15px; color: var(--ink-3); text-decoration: none; }
.arch-row .m { font-size: 10px; font-weight: 700; text-transform: uppercase;
               color: var(--muted-2); white-space: nowrap; }

/* ── quiet day ── */
.quiet { text-align: center; padding: 48px 0 30px; }
.quiet .dot {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--yellow); border: 2px solid var(--ink);
  margin: 0 auto 20px;
}
.quiet .line { font-family: var(--serif); font-size: 27px; line-height: 1.2;
               color: var(--ink); margin: 0 0 12px; }
.quiet .sub { font-size: 10px; font-weight: 700; text-transform: uppercase;
              letter-spacing: .16em; color: var(--muted-2); }

/* ── tab bar ── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: var(--stock-sunk); border-top: 2px solid var(--ink);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar .row { max-width: 620px; margin: 0 auto; display: flex; }
.tabbar a {
  flex: 1; text-align: center; padding: 15px 0 13px;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .14em; color: var(--muted); text-decoration: none;
}
.tabbar a.on { color: var(--ink); }

/* ── welcome ── */
.welcome { min-height: 70vh; display: flex; flex-direction: column;
           justify-content: center; text-align: center; }
.welcome h1 { font-family: var(--serif); font-weight: 400; font-size: 34px; margin: 0 0 10px; }
.welcome p { color: var(--muted); font-size: 15px; }

/* motion: restrained */
.htmx-swapping { opacity: 0; transition: opacity 140ms ease-out; }

/* ── iPhone / iOS standalone polish ── */
html { -webkit-text-size-adjust: 100%; }          /* no surprise text scaling in landscape */
a, button, summary, label { -webkit-tap-highlight-color: transparent; }

/* Standalone PWA: the page runs under the status bar. Paint an opaque strip
   in the stock colour so scrolling content passes beneath the clock cleanly,
   the way native apps do, instead of colliding with it. */
body { padding-top: env(safe-area-inset-top); }
body::before {
  content: ""; position: fixed; top: 0; left: 0; right: 0;
  height: env(safe-area-inset-top); background: var(--stock); z-index: 30;
}

/* Home indicator: the tab bar already pads for it; give the content the same. */
body { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }

/* Horizontal shelf: momentum scroll, no rubber-band leaking to the page. */
.quote-shelf { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }

/* Full-screen quote: use the dynamic viewport so the iOS toolbar does not
   push the floor off screen. */
.qscreen { min-height: 62dvh; }

/* Capture card textarea: iOS adds inner shadow + rounded corners by default. */
.capture textarea { -webkit-appearance: none; appearance: none; border-radius: 0; }

.dump-err { margin: 0; font-size: 12px; font-weight: 700; color: var(--link); min-height: 0; }
.dump-err:empty { display: none; }

/* ── demo banner ── */
.demo-banner {
  position: fixed; left: 0; right: 0;
  bottom: calc(52px + env(safe-area-inset-bottom)); z-index: 9;
  display: flex; gap: 16px; align-items: center; justify-content: center;
  background: var(--grape); color: #FFF4DE;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  padding: 8px 12px; padding-bottom: calc(8px + env(safe-area-inset-bottom));
}
.demo-banner a { color: #FFF4DE; text-decoration: underline; }
