/* Attic Finds · Direction C "Catalog Card": every find gets its card.
   Graphite on a drawer-grey ground, white cards with a verdict-colored top rule,
   Archivo (condensed for names and numbers) + Courier Prime for labels. */
:root {
  --drawer: #ECEDEA;
  --card: #FFFFFF;
  --ink: #222326;
  --ink-2: #45474D;
  --muted: #6A6C72;
  --rule: #C9D6E6;
  --line: #D6D8D3;
  --red: #C9402C;
  --blue: #2E4F8C;
  --violet: #7E4F92;
  --v-collector: #C9402C;
  --v-closer_look: #2E4F8C;
  --v-bottom_line: #6A6C72;
  --v-sentimental: #7E4F92;
  --sans: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --type: "Courier Prime", ui-monospace, "Courier New", monospace;
  --on-ink: #FFFFFF;   /* text on ink-colored buttons and bars */
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23222326' stroke-width='2'/%3E%3C/svg%3E");
  color-scheme: light;
}
/* Dark mode: only when someone picks it (Me > Settings). "Match my device" sets data-theme from the device. Light is the default. */
:root[data-theme="dark"] {
  --drawer: #18191C; --card: #232428; --ink: #ECEDEA; --ink-2: #C7C9C4; --muted: #9A9CA1; --rule: #34465F; --line: #3A3B40;
  --red: #E2654F; --blue: #8AA6DE; --violet: #BC93CF;
  --v-collector: #E2654F; --v-closer_look: #8AA6DE; --v-bottom_line: #9A9CA1; --v-sentimental: #BC93CF;
  --on-ink: #18191C;
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23ECEDEA' stroke-width='2'/%3E%3C/svg%3E");
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--drawer); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
a { color: var(--blue); }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }

.app { max-width: 640px; margin: 0 auto; padding: calc(env(safe-area-inset-top, 0px) + 20px) 20px 120px; display: flex; flex-direction: column; gap: 20px; }
.label { font-family: var(--type); font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.02em; }
.cond { font-weight: 800; font-stretch: 70%; text-transform: uppercase; line-height: 0.95; }
.num { font-variant-numeric: tabular-nums; }

/* Top bar */
.top { display: flex; justify-content: space-between; align-items: center; }
.wordmark { font-weight: 800; font-stretch: 70%; font-size: 26px; text-transform: uppercase; line-height: 1; }
.textbtn { font-family: var(--type); font-size: 13px; color: var(--muted); background: none; border: 0; padding: 8px 0; text-transform: uppercase; }
.textbtn[aria-pressed="true"] { color: var(--ink); text-decoration: underline; }

/* Summary */
.summary { border-top: 2px solid var(--ink); padding-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.summary .big { font-size: clamp(44px, 12vw, 64px); }
.summary .sub { font-family: var(--type); font-size: 14px; color: var(--ink-2); }
.reveal-total { font-family: var(--type); font-size: 14px; background: none; border: 0; padding: 0; color: var(--blue); text-decoration: underline; text-align: left; }

.filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 0 20px; }
.filters::-webkit-scrollbar { display: none; }
.chip { flex: none; font-size: 14px; padding: 8px 12px; border: 1.5px solid var(--ink); background: transparent; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); font-weight: 700; }
.chip .n { font-family: var(--type); margin-left: 4px; }

/* Cards */
.cards { display: flex; flex-direction: column; gap: 10px; }
.card { background: var(--card); border-top: 4px solid var(--vline, var(--ink)); box-shadow: 0 1px 2px rgba(34, 35, 38, 0.15); }
.card[data-verdict="collector"] { --vline: var(--v-collector); --vtext: var(--v-collector); }
.card[data-verdict="closer_look"] { --vline: var(--v-closer_look); --vtext: var(--v-closer_look); }
.card[data-verdict="bottom_line"] { --vline: var(--v-bottom_line); --vtext: var(--ink-2); }
.card[data-verdict="sentimental"] { --vline: var(--v-sentimental); --vtext: var(--v-sentimental); }
.row { display: flex; gap: 12px; align-items: center; padding: 12px 14px; width: 100%; background: none; border: 0; text-align: left; }
.icon { width: 40px; height: 40px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--drawer); color: var(--ink-2); overflow: hidden; }
.icon img { width: 100%; height: 100%; object-fit: cover; }
.icon svg { width: 22px; height: 22px; }
.row .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row .line1, .row .line2 { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.row .name { font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .price { font-weight: 700; font-size: 15px; white-space: nowrap; }
.row .meta { font-family: var(--type); font-size: 12px; color: var(--muted); text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.verdict { font-family: var(--type); font-size: 12px; font-weight: 700; color: var(--vtext); text-transform: uppercase; white-space: nowrap; }
.hidden-val { color: var(--muted); letter-spacing: 0.15em; }
.empty { background: var(--card); padding: 24px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.footer { font-size: 13px; color: var(--muted); padding-top: 8px; }

/* Buttons */
.btn { border: 0; padding: 12px 18px; font-weight: 700; background: var(--ink); color: var(--on-ink); min-height: 44px; }
.btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--ink); padding: 10px 16px; }
.btn.link { background: none; color: var(--muted); padding: 12px 6px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Find */
.intro h1 { font-size: 46px; }
.intro p { color: var(--ink-2); margin-top: 6px; }
.panel { background: var(--card); padding: 18px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 1px 2px rgba(34, 35, 38, 0.15); }
.seg { display: inline-flex; border: 2px solid var(--ink); align-self: flex-start; }
.seg button { border: 0; background: transparent; padding: 8px 14px; font-weight: 700; font-size: 14px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 28px 16px; text-align: center; border: 2px dashed var(--line); }
label.btn { display: inline-flex; align-items: center; cursor: pointer; }
.drop.over { border-color: var(--blue); }
.drop b { font-size: 17px; }
.drop span { font-family: var(--type); font-size: 13px; color: var(--muted); }
.picked { display: flex; gap: 8px; flex-wrap: wrap; }
.picked img { width: 64px; height: 64px; object-fit: cover; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-family: var(--type); font-size: 13px; color: var(--muted); text-transform: uppercase; }
input[type="text"], input[type="email"], input[type="number"], textarea, select { width: 100%; background: var(--card); border: 1.5px solid var(--line); padding: 10px 12px; border-radius: 0; }
textarea { resize: vertical; min-height: 84px; font-family: var(--type); }
.status { font-family: var(--type); font-size: 14px; color: var(--ink-2); min-height: 1.4em; }
.status.err { color: var(--red); }

/* Result / item detail */
.detail { padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.detail .head { display: flex; gap: 12px; align-items: flex-start; }
.detail .head .icon { width: 56px; height: 56px; }
.detail h2 { font-size: 22px; line-height: 1.2; }
.alts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-family: var(--type); font-size: 13px; color: var(--muted); }
.alts button { border: 1.5px solid var(--line); background: var(--card); padding: 4px 10px; font-family: var(--sans); font-size: 13px; }
.value { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 0; display: flex; flex-direction: column; gap: 6px; }
.value .amount { font-size: 52px; }
.value .why { font-size: 15px; color: var(--ink-2); }
.value .knew { font-weight: 700; color: var(--ink); }
.signals { display: flex; gap: 4px 14px; flex-wrap: wrap; font-family: var(--type); font-size: 13px; color: var(--muted); }
.guess { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.guess .field { flex: 1 1 160px; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 480px) { .split { grid-template-columns: minmax(0, 1fr); } }

.decide { display: flex; gap: 8px; flex-wrap: wrap; }
.decide button { border: 2px solid var(--ink); background: transparent; padding: 10px 14px; font-weight: 700; font-size: 14px; min-height: 44px; }
.decide button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.ctas { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.cta { border: 1.5px solid var(--line); padding: 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cta b { font-size: 15px; }
.cta p { font-size: 13px; color: var(--muted); }
.cta .links { display: flex; flex-direction: column; gap: 6px; }
/* Text-link buttons look the same everywhere, not just inside cards. */
.l { font: inherit; font-size: 14px; color: var(--blue); font-weight: 600; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.l:hover { text-decoration: underline; }
.btn.small { min-height: 0; padding: 6px 12px; font-size: 13px; }
.btn.ghost.small { padding: 5px 11px; border-width: 1.5px; }
.cta a, .cta .l { font-size: 14px; color: var(--blue); font-weight: 600; background: none; border: 0; padding: 0; text-align: left; text-decoration: none; }
.cta a:hover, .cta .l:hover { text-decoration: underline; }
.copyrow { border-top: 1px dashed var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.copyrow .k { font-family: var(--type); font-size: 12px; color: var(--muted); text-transform: uppercase; display: flex; justify-content: space-between; }
.copyrow .v { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.copyrow button { font-family: var(--type); font-size: 12px; background: none; border: 0; color: var(--blue); padding: 0; }
.bulk { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; font-family: var(--type); font-size: 14px; }

/* Sheet */
.scrim { position: fixed; inset: 0; background: rgba(34, 35, 38, 0.5); display: flex; align-items: flex-end; justify-content: center; z-index: 20; padding: 12px; }
@media (min-width: 700px) { .scrim { align-items: center; } }
.sheet { width: 100%; max-width: 600px; max-height: 92vh; overflow: auto; padding-bottom: env(safe-area-inset-bottom, 0px); }
.sheet .close { float: right; }

/* Bottom nav */
.nav { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 2px solid var(--ink); display: flex; justify-content: space-around; align-items: center; padding: 8px 20px calc(env(safe-area-inset-bottom, 0px) + 14px); z-index: 10; }
.nav button { background: none; border: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); min-width: 72px; padding: 4px; }
.nav button[aria-current="page"] { color: var(--ink); }
.nav svg { width: 22px; height: 22px; }
.nav .find { width: 64px; height: 64px; background: var(--ink); color: var(--on-ink); justify-content: center; margin-top: -30px; min-width: 64px; }
.nav .find svg { width: 28px; height: 28px; }
.nav .find[aria-current="page"] { background: var(--red); color: var(--on-ink); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: no-preference) {
  .sheet { animation: up 0.18s ease-out; }
  @keyframes up { from { transform: translateY(14px); } to { transform: none; } }
}

/* Groups and sets */
.group .members { border-top: 1px dashed var(--line); background: var(--drawer); padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.group .members .card { box-shadow: none; }
.setstrip { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 0 20px 4px; }
.setstrip::-webkit-scrollbar { display: none; }
.setchip { flex: none; min-width: 180px; max-width: 240px; background: var(--card); border: 0; border-top: 4px solid var(--red); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; text-align: left; box-shadow: 0 1px 2px rgba(34, 35, 38, 0.15); }
.setchip .name { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.setchip .bar { height: 4px; background: var(--drawer); display: block; }
.setchip .bar span { display: block; height: 100%; background: var(--red); }
.setline { font-family: var(--type); font-size: 13px; color: var(--blue); background: none; border: 0; padding: 0; text-align: left; text-decoration: underline; }
.missing { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; border-top: 1px solid var(--line); padding-top: 8px; }
.missing .num { font-family: var(--type); color: var(--muted); }
.missing .mname { font-weight: 600; overflow-wrap: anywhere; }
.missing a { font-size: 14px; color: var(--blue); white-space: nowrap; }

/* Profiles */
.avatars { display: grid; grid-template-columns: repeat(4, minmax(0, 64px)); gap: 12px; }
@media (min-width: 520px) { .avatars { grid-template-columns: repeat(8, minmax(0, 56px)); } }
.av { aspect-ratio: 1; display: block; background: none; border: 0; border-radius: 50%; padding: 0; outline-offset: 3px; }
.av .avsvg, .pic .avsvg { display: block; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; }
.avsvg svg { display: block; width: 100%; height: 100%; }
.av[aria-checked="true"] { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink); }
.picture { display: flex; flex-direction: column; gap: 10px; }
.pic-row { display: flex; gap: 14px; align-items: center; }
.pic { width: 72px; height: 72px; flex: none; border-radius: 50%; overflow: hidden; background: var(--drawer); }
.pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pic-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ink); flex: none; }
.handle { display: flex; align-items: center; border: 1.5px solid var(--line); background: var(--card); }
.handle span { padding: 0 2px 0 12px; color: var(--muted); font-weight: 700; }
.handle input { border: 0; padding-left: 2px; }
details > summary { cursor: pointer; font-weight: 700; padding: 8px 0; }

/* Index-card header: one blue rule under the card's heading, like a real index card. */
.cardhead { border-bottom: 2px solid var(--rule); padding-bottom: 12px; display: flex; flex-direction: column; gap: 8px; }

.earn { display: flex; gap: 10px; align-items: baseline; font-size: 14px; }
.earn .tick { font-family: var(--type); font-weight: 700; color: var(--red); min-width: 28px; }
.earn.done { color: var(--muted); }
.earn.done .tick { color: var(--ink); }

/* Set chasing */
.missing .rowlinks { display: flex; gap: 12px; white-space: nowrap; }
.missing .rowlinks .l, .missing .rowlinks a { font-size: 14px; color: var(--blue); background: none; border: 0; padding: 0; font-weight: 600; text-decoration: none; }
.missing .rowlinks .l[aria-pressed="true"] { color: var(--red); }
.missing .neighbors { font-family: var(--type); font-size: 12px; color: var(--muted); font-weight: 400; }
.missing .neighbors a { color: var(--blue); }
.looking { width: 100%; text-align: left; background: var(--card); border: 0; border-top: 4px solid var(--blue); padding: 12px 14px; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; box-shadow: 0 1px 2px rgba(34, 35, 38, 0.15); }

.winline { font-family: var(--type); font-size: 13px; color: var(--ink-2); min-height: 1.2em; }
.winline b { color: var(--red); }

.missing .wantcond { grid-column: 2 / -1; font-family: var(--type); font-size: 12px; color: var(--muted); }

.nudge { background: var(--card); border-top: 4px solid var(--red); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 1px 2px rgba(34, 35, 38, 0.15); }

/* Stats & badges */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--drawer); padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.stat .n { font-size: 30px; }
.badges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.badge { border: 1.5px dashed var(--line); padding: 10px; display: flex; flex-direction: row; align-items: flex-start; gap: 10px; color: var(--muted); font-size: 13px; position: relative; }
.badge b { font-size: 14px; display: block; }
.badge .btext { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.badge .trophy { flex: none; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--drawer); color: var(--line); }
.badge .trophy svg { width: 20px; height: 20px; }
.badge.earned { border: 1.5px solid var(--line); background: var(--card); color: var(--ink-2); box-shadow: 0 1px 2px rgba(34, 35, 38, 0.15); }
.badge.earned b { color: var(--ink); }
.badge.earned .trophy { background: #F1E5C4; color: #8A6516; }
.newpill { position: absolute; top: -8px; right: -6px; background: var(--red); color: #fff; font-family: var(--type); font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 1px 7px; }
.titles { display: flex; flex-wrap: wrap; gap: 8px; }
.titlechip { background: var(--card); border: 1.5px solid var(--line); padding: 7px 12px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.titlechip[aria-checked="true"] { border: 2px solid var(--red); color: var(--red); }
.locked { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; font-size: 14px; }
.goal { display: flex; flex-direction: column; gap: 4px; }
.goal .bar { height: 6px; background: var(--drawer); display: block; }
.goal .bar span { display: block; height: 100%; background: var(--red); }
.titlechip.quiet { color: var(--muted); }
.ptitle.newbie { color: var(--muted); border-color: var(--line); }
.ptitle { display: inline-block; font-family: var(--type); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--red); border: 2px solid var(--red); padding: 1px 8px; }
.about { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 6px; }
.pcats { display: flex; flex-wrap: wrap; gap: 6px; }
.pcat { display: inline-flex; gap: 5px; align-items: center; background: var(--drawer); padding: 3px 8px; font-size: 13px; font-weight: 600; }
.pcat svg { width: 15px; height: 15px; }

/* Dropdowns: our own look instead of the OS default, with a drawn chevron. */
select { -webkit-appearance: none; appearance: none; background-color: var(--card); background-image: var(--chev); background-repeat: no-repeat; background-position: right 12px center; background-size: 12px 8px; padding-right: 34px !important; border: 1.5px solid var(--line); border-radius: 0; font-family: var(--sans, inherit); font-size: 15px; font-weight: 600; color: var(--ink); cursor: pointer; }
select:hover { border-color: var(--ink); }
select:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
