/* ishList: two voices.
   The firm sans (Atkinson Hyperlegible Next) speaks for ishList: buttons,
   labels, status, dates. The slanted serif (Libertinus Serif, its upright
   slanted like the wordmark's "ish") speaks for people: list titles and
   free-text items. Everything else stays plain, craigslist-style.
   Design decisions live in DESIGN.md. */

/* Fonts: SIL Open Font License, self-hosted (CSP font-src 'self'). */
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/assets/atkinson-hyperlegible-next-latin-264aa1e2.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/assets/atkinson-hyperlegible-next-latin-ext-a1e1b854.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Libertinus Serif";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/libertinus-serif-600-latin-d4172d49.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Libertinus Serif";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/libertinus-serif-600-latin-ext-d535aeb7.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Libertinus Serif";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/libertinus-serif-700-latin-4d7b1407.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Libertinus Serif";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/libertinus-serif-700-latin-ext-f2b99ca5.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  /* Ink and its tints. Every text pairing passes WCAG AA. */
  --ink: #1b1a2e;          /* 17:1 on white */
  --ink-muted: #5b5970;    /* 6.8:1 on white, 6.1:1 on --tint */
  --line: #e2e0e8;
  --tint: #f4f3f6;
  --paper: #ffffff;
  /* The one accent. 5.1:1 on white, and white on it, so text and fills share it. */
  --accent: #c2412a;
  --accent-tint: #fbece8;
  --error: #a8261b;        /* 7:1 on white */
  --ok: #1d6b3f;           /* 6.6:1 on white */

  --sans: "Atkinson Hyperlegible Next", system-ui, sans-serif;
  --serif: "Libertinus Serif", Georgia, serif;
  --slant: -11deg;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2.25rem;
  --radius: 6px;
  --measure: 36rem;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.5 var(--sans);
  caret-color: var(--accent);
  font-synthesis: none;
}
/* The app's own asides ("hasn't joined yet", system messages) stay upright. */
em { font-style: normal; color: var(--ink-muted); }
::selection { background: var(--accent-tint); color: var(--ink); }

h1, h2, h3 { line-height: 1.15; text-wrap: balance; margin: 0; }
h1 { font-size: 2rem; font-weight: 800; letter-spacing: -0.015em; margin-bottom: var(--space-2); }
h2 {
  font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; color: var(--ink);
  margin: var(--space-6) 0 var(--space-3);
}
p { margin: 0 0 var(--space-3); text-wrap: pretty; }

a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--accent); text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

.page { max-width: var(--measure); margin: 0 auto; padding: var(--space-5) var(--space-4); }
main.page { padding-bottom: var(--space-6); }

/* The "ish" voice: words people wrote, slanted from the upright
   Libertinus (no italic face is loaded), so the "h" keeps its serif foot.
   Nothing else in the app slants. */
.voice {
  font-family: var(--serif);
  font-weight: 600;
  font-style: italic;
  font-synthesis: style;
  letter-spacing: 0;
}
h1.voice { font-size: 2.25rem; font-weight: 700; line-height: 1.1; }
.item-text.voice { font-size: 1.1875rem; line-height: 1.3; }

/* Wordmark: playful "ish", firm "List". */
.wordmark { white-space: nowrap; letter-spacing: -0.01em; }
.wordmark-ish {
  display: inline-block;
  font-family: var(--serif); font-weight: 700;
  color: var(--accent);
  transform: skewX(var(--slant));
  margin-right: 0.04em;
}
.wordmark-list { font-family: var(--sans); font-weight: 800; color: var(--ink); }
h1 .wordmark { font-size: 3rem; }
#claim-heading { font-size: 1.5rem; font-weight: 800; color: var(--ink); margin-top: var(--space-4); overflow-wrap: anywhere; }

.masthead {
  border-bottom: 1px solid var(--line);
  padding: var(--space-3) var(--space-4);
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-4);
}
.masthead nav { font-size: 1rem; font-weight: 700; }
.masthead-home { font-size: 1.375rem; text-decoration: none; display: inline-block; }
.masthead-home:hover .wordmark-list { color: var(--accent); }
@media (min-width: 40rem) {
  .masthead { padding-inline: max(var(--space-4), calc((100% - var(--measure)) / 2 + var(--space-4))); }
}

.staging-banner {
  margin: 0; padding: 0.375rem var(--space-4);
  text-align: center; font-size: 0.875rem; font-weight: 700;
  background: #f5c518; color: #1a1a1a;
}

/* Small print and messages */
.hint { font-size: 0.9375rem; color: var(--ink-muted); }
p.hint { margin: 0 0 var(--space-3); }
.alert { color: var(--error); font-weight: 700; }
.notice { color: var(--ok); font-weight: 700; }
div.alert { border: 1px solid currentColor; border-radius: var(--radius); padding: var(--space-3); }
div.alert ul { margin: var(--space-1) 0 0; padding-left: 1.25rem; font-weight: 400; }
div.alert p { margin: 0; }
#flash p { margin: var(--space-3) 0; }

.list-meta { color: var(--ink-muted); }
.countdown {
  font-variant-numeric: tabular-nums; font-weight: 700;
  margin: 0 0 var(--space-3);
}
.discussed, .talk { color: var(--accent); font-weight: 700; }

/* Forms: big, plain, obvious. */
form { display: grid; gap: var(--space-2); margin: var(--space-3) 0; }
label { font-weight: 700; }
fieldset {
  display: grid; gap: var(--space-2);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--space-3) var(--space-4) var(--space-4); margin: 0;
}
legend { font-weight: 700; padding: 0 var(--space-1); }
fieldset label { font-weight: 400; }
input[type="text"], input[type="tel"], input[type="url"], input[type="date"], input[type="number"], select, textarea {
  font: inherit; color: var(--ink);
  min-height: 2.875rem; padding: var(--space-2) var(--space-3);
  border: 1.5px solid var(--ink-muted); border-radius: var(--radius);
  background: var(--paper); width: 100%;
}
input[type="tel"] { font-size: 1.25rem; letter-spacing: 0.02em; }
/* People type list titles and gift ideas in the same hand they'll read them in. */
input[name="list[title]"], textarea[name="item[body]"] {
  font-family: var(--serif); font-weight: 600; font-style: italic; font-synthesis: style; font-size: 1.1875rem;
}
input[type="number"] { max-width: 9rem; }
textarea { resize: vertical; line-height: 1.4; }
input::placeholder, textarea::placeholder { color: var(--ink-muted); opacity: 1; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--accent); outline-offset: 0; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--accent); width: 1.25rem; height: 1.25rem; margin: 0; }
.choices { display: flex; align-items: center; gap: var(--space-2) var(--space-3); flex-wrap: wrap; }
.choices label { font-weight: 400; margin-right: var(--space-3); }
fieldset > label:has(input[type="radio"]) { display: flex; gap: var(--space-2); align-items: baseline; }
fieldset > label:has(input[type="radio"]) input { flex: none; transform: translateY(0.2em); }

/* Buttons: navy, square-ish, at least 44px tall. */
button, input[type="submit"] {
  font: inherit; font-weight: 700; font-size: 1rem;
  min-height: 2.75rem; padding: 0 var(--space-4);
  border: 1.5px solid var(--ink); border-radius: var(--radius);
  background: var(--ink); color: var(--paper);
  cursor: pointer; justify-self: start;
  transition: background-color 120ms ease-out, border-color 120ms ease-out;
}
button:hover, input[type="submit"]:hover { background: var(--accent); border-color: var(--accent); }
button:active, input[type="submit"]:active { transform: translateY(1px); }
button:disabled, input[type="submit"]:disabled { opacity: 0.5; cursor: not-allowed; }
/* Secondary actions (remove, release, dismiss, log out) are outlined. */
.button_to button, .button_to input[type="submit"] { background: var(--paper); color: var(--ink); }
.button_to button:hover, .button_to input[type="submit"]:hover { background: var(--paper); color: var(--accent); border-color: var(--accent); }
/* A primary row action: button_to ..., form: { class: "button_to primary" }. */
.button_to.primary button { background: var(--ink); color: var(--paper); }
.button_to.primary button:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); }
/* An outlined button inside a form: "Suggest products", "Skip". */
button.secondary, input[type="submit"].secondary { background: var(--paper); color: var(--ink); }
button.secondary:hover, input[type="submit"].secondary:hover { background: var(--paper); color: var(--accent); border-color: var(--accent); }

/* A form's first, unseen submit button, so Enter presses it rather than a
   secondary button earlier in the form than the real submit. */
.default-submit { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Product suggestions: the button under the item's text, and the
   question page's Next / Skip pair. */
.suggest { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-top: var(--space-2); }
.suggest .hint { margin: 0; }
.suggest-actions { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); }

details > summary {
  cursor: pointer; font-weight: 700; color: var(--ink);
  min-height: 2.75rem; display: inline-flex; align-items: center;
  text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px;
}
details > summary:hover { color: var(--accent); }
details[open] > summary { margin-bottom: var(--space-1); }

/* Item rows: ruled, full width. The name, then a muted line under it
   (status, Chat, Item page), and the row's one action on the right. */
.items, .gifters, .ledger, .own-claims {
  list-style: none; margin: 0 0 var(--space-3); padding: 0;
  border-top: 1px solid var(--line);
}
.items > li, .gifters > li, .ledger > li, .own-claims > li {
  border-bottom: 1px solid var(--line);
  padding: var(--space-3) 0;
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2) var(--space-3); align-items: start;
}
/* "You're getting" rows are one line of text, not a grid. */
.own-claims > li { display: block; }
.row-main { grid-column: 1; min-width: 0; }
.row-title { display: flex; align-items: center; gap: var(--space-1) var(--space-3); }
.row-title > :not(.item-image) { min-width: 0; }
.row-meta { font-size: 1rem; color: var(--ink-muted); margin-top: var(--space-1); }
.row-meta .hint { font-size: inherit; }
.row-meta a { display: inline-block; min-height: 1.5rem; color: var(--ink-muted); }
.row-meta a:hover { color: var(--accent); }
.items > li > .button_to, .gifters > li > .button_to { grid-column: 2; grid-row: 1; margin: 0; }
.items > li > details { grid-column: 1 / -1; }
.item-link { font-weight: 700; overflow-wrap: break-word; }
.item-text { overflow-wrap: break-word; }
.item-host { margin-left: var(--space-1); }
.item-image {
  width: 3.5rem; height: 3.5rem; object-fit: contain; flex: none;
  border: 1px solid var(--line); border-radius: 4px; background: var(--paper);
}
.status { font-weight: 700; }
.status-bought { color: var(--ink); }
.status-available { color: var(--ink-muted); }
/* The viewer's own claim: a tint inside the rules, Release as an outlined button. */
.items > li.own-claim { background: var(--tint); padding-inline: var(--space-3); }
.items > li.own-claim > details { grid-column: 2; grid-row: 1; justify-self: end; }
.items > li.own-claim > details[open] { grid-column: 1 / -1; grid-row: auto; justify-self: stretch; }
.items > li.own-claim > details > summary {
  justify-content: center; min-height: 2.75rem; padding: 0 var(--space-4);
  border: 1.5px solid var(--ink); border-radius: var(--radius); background: var(--paper);
  text-decoration: none; list-style: none;
}
.items > li.own-claim > details > summary::-webkit-details-marker { display: none; }
.items > li.own-claim > details > summary:hover { color: var(--accent); border-color: var(--accent); }
.items details > form { margin-top: var(--space-2); }
/* On a phone, item rows give the name the full width and put the action
   underneath, so a long address never has to break mid-word. */
@media (max-width: 30rem) {
  .items > li { grid-template-columns: minmax(0, 1fr); }
  .items > li > .button_to,
  .items > li.own-claim > details { grid-column: 1; grid-row: auto; justify-self: start; }
}

.deletion-alert {
  border: 1px solid var(--accent); border-radius: var(--radius); background: var(--accent-tint);
  padding: var(--space-3) var(--space-4); margin: var(--space-4) 0;
  display: grid; gap: var(--space-2);
}
.deletion-alert p { margin: 0; }
.deletion-alert form { margin: 0; }

/* Chat */
.messages {
  list-style: none; padding: 0; margin: 0 0 var(--space-3);
  display: grid; gap: var(--space-3);
  max-height: 60vh; overflow-y: auto; overscroll-behavior: contain;
}
.message p { margin: 0; overflow-wrap: anywhere; }
.message-meta time { margin-left: var(--space-1); }
.message-body { white-space: pre-wrap; }
.message-system .message-body { color: var(--ink-muted); }
.messages:has(li) + .empty-chat { display: none; }

/* Credits */
.ledger > li > :first-child { grid-column: 1; }
.ledger-amount { grid-column: 2; grid-row: 1; font-variant-numeric: tabular-nums; font-weight: 700; }
.ledger > li > time { grid-column: 1; }

/* Legal */
.legal h2 { font-size: 1.125rem; color: var(--ink); margin-top: var(--space-5); }
.draft-note {
  border: 1px solid var(--accent); border-radius: var(--radius); background: var(--accent-tint);
  padding: var(--space-3) var(--space-4);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding-top: var(--space-4);
  display: grid; gap: var(--space-2);
  font-size: 0.9375rem;
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--ink-muted); }
.sent-with { color: var(--ink-muted); }
.sent-with .wordmark { font-size: 1.125rem; }

@media (prefers-reduced-motion: reduce) {
  button, input[type="submit"] { transition: none; }
}
.home-alert { color: var(--accent, #b00020); }
.home-start-field { display: flex; align-items: center; gap: 0.25rem; }
.home-start-field input { flex: 1; min-width: 0; }
.home-account { margin-top: 2rem; display: grid; gap: 0.5rem; }
.home-account p { margin: 0; }
