:root {
  --ink: #2a211c; --muted: #7b6d63; --line: #e4dacf; --paper: #f6f1ea; --card: #fffdf9;
  --accent: #b4532a; --accent-tint: #f6e3d8; --ok: #2f7d4f; --bad: #b3261e;
  --coffee: #efe2d3; --gear: #dfe7ea; --sweet: #f3dfe0;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f3ece4; --muted: #a89b90; --line: #3a302a; --paper: #171310; --card: #211b17;
    --accent: #e08a5f; --accent-tint: #3a261c; --ok: #6fcf97; --bad: #f2877f;
    --coffee: #33281f; --gear: #232c30; --sweet: #33242a;
  }
}
* { box-sizing: border-box; }
body { font: 16px/1.5 system-ui, sans-serif; color: var(--ink); background: var(--paper); margin: 0 auto; padding: 1.5rem 1rem; max-width: 72rem; }
h1 { font: 400 2rem/1.2 ui-serif, Georgia, serif; margin: 0; }
h1 small { font: 500 .75rem/1 system-ui, sans-serif; color: var(--accent); background: var(--accent-tint); border-radius: 99px; padding: .25rem .625rem; vertical-align: middle; }
h2 { font-size: 1rem; margin: 0; display: flex; align-items: center; gap: .375rem; }
header p { color: var(--muted); margin: .25rem 0 0; max-width: 44rem; }
.note { color: var(--muted); font-size: .8125rem; margin: 0; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .75rem; }
.head .note { display: flex; align-items: center; gap: .25rem; }
[hidden] { display: none !important; }

.icon { width: 1.125rem; height: 1.125rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.icon .solid { fill: currentColor; stroke: none; }

main { display: grid; grid-template-columns: minmax(0, 1fr) 24rem; gap: 1rem; margin: 1.25rem 0; align-items: start; }
aside { display: grid; gap: 1rem; position: sticky; top: 1rem; }
@media (max-width: 56rem) {
  main { grid-template-columns: minmax(0, 1fr); }
  aside { position: static; order: -1; }
}
section, footer, #gate { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1rem; }
#gate { display: flex; gap: .5rem; align-items: center; margin-top: 1rem; }

/* Catalog: cards to look at. No button, no pointer, no hover state: there is nothing to press. */
#catalog { list-style: none; margin: 0 0 .75rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .75rem; }
#catalog li { position: relative; display: grid; gap: .125rem; padding: .625rem; border: 1px solid var(--line); border-radius: 12px; cursor: default; }
.tile { display: grid; place-items: center; height: 5rem; border-radius: 8px; margin-bottom: .375rem; background: var(--coffee); }
.tile.gear { background: var(--gear); }
.tile.sweet { background: var(--sweet); }
.tile .icon { width: 2.25rem; height: 2.25rem; stroke-width: 1.25; }
.name { font-size: .875rem; font-weight: 500; line-height: 1.3; }
.price, .amount, #total { font-variant-numeric: tabular-nums; white-space: nowrap; }
.price { font-size: .8125rem; color: var(--muted); }
.badge { position: absolute; top: .375rem; right: .375rem; display: flex; align-items: center; gap: .125rem; font-size: .75rem; font-weight: 600; color: var(--card); background: var(--accent); border-radius: 99px; padding: .125rem .5rem .125rem .375rem; }
.badge .icon { width: .875rem; height: .875rem; }
#catalog li.picked { border-color: var(--accent); background: var(--accent-tint); animation: picked .6s ease-out; }
@keyframes picked { from { transform: scale(.94); } 60% { transform: scale(1.03); } }
@media (prefers-reduced-motion: reduce) { #catalog li.picked { animation: none; } }

#chat { list-style: none; margin: 0 0 .75rem; padding: 0; display: grid; gap: .5rem; max-height: 17rem; overflow-y: auto; }
#chat:empty { display: none; }
#chat li { padding: .5rem .75rem; border-radius: 12px; background: var(--paper); white-space: pre-wrap; overflow-wrap: anywhere; max-width: 92%; font-size: .9375rem; }
#chat li.user { justify-self: end; background: var(--ink); color: var(--card); }
#chat li.wait { color: var(--muted); font-style: italic; }
#chat li.error { color: var(--bad); }
#ideas { display: grid; gap: .375rem; margin-bottom: .75rem; }
#ideas button { text-align: left; font-size: .8125rem; padding: .375rem .625rem; border: 1px dashed var(--line); background: none; color: var(--muted); }
#ideas button:hover { color: var(--ink); border-color: var(--muted); }
#form { display: flex; gap: .5rem; align-items: end; }
textarea, input { flex: 1; min-width: 0; font: inherit; color: inherit; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: .5rem .625rem; resize: none; }
textarea:focus, input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
button, #approve { font: inherit; font-weight: 500; padding: .5rem 1rem; border: 0; border-radius: 10px; background: var(--ink); color: var(--card); cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }

#lines { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; font-size: .875rem; }
#lines li { display: grid; grid-template-columns: auto 1fr auto; gap: .5rem; align-items: center; }
#lines .tile { width: 2rem; height: 2rem; margin: 0; border-radius: 6px; }
#lines .tile .icon { width: 1.125rem; height: 1.125rem; }
.total { display: flex; justify-content: space-between; font-size: 1.25rem; margin: .75rem 0 .25rem; padding-top: .75rem; border-top: 1px solid var(--line); }
#status { font-size: .875rem; font-weight: 600; margin: 0 0 .75rem; }
#status.paid { color: var(--ok); }
#status.dead { color: var(--bad); }
#approve { display: block; text-align: center; text-decoration: none; padding: .75rem; margin-bottom: .5rem; background: var(--accent); color: var(--card); }

footer { font-size: .8125rem; color: var(--muted); }
footer h2 { font-size: .8125rem; margin-bottom: .375rem; }
footer dl { display: grid; grid-template-columns: auto 1fr; gap: .125rem 1rem; margin: 0; }
footer dd { margin: 0; }
code { font-size: .9375em; color: var(--ink); }
