:root {
  --ground: #ECEFEA; --surface: #FFFFFF; --ink: #14251F; --soft: #3C4C45; --muted: #4F5F58;
  --line: #CBD3CC; --hair: #E1E6E1; --edge: #6F8078; --green: #1F4D3F;
  --brass: #6B4F0F; --brass-tint: #F6F0DD; --brass-line: #CBB872; --alert: #8A2C16;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.45; }
.page { max-width: 480px; min-height: 100vh; min-height: 100dvh; margin: 0 auto; padding: 20px 20px 28px; display: flex; flex-direction: column; gap: 16px; }
#app { flex: 1; display: flex; flex-direction: column; gap: 16px; }
[hidden] { display: none !important; }
h1 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 28px; line-height: 1.18; }
h1.big { font-size: 33px; line-height: 1.15; }
h2 { margin: 0; font-size: 14px; font-weight: 600; }
p { margin: 0; }
a { color: var(--green); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.tight { gap: 6px; }
.push { margin-top: auto; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lede { font-size: 17px; color: var(--soft); }
.sub { font-size: 15px; color: var(--muted); }
.small { font-size: 13px; color: var(--muted); }
.center { text-align: center; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brass); }
.mono { font-family: var(--mono); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.brand svg { flex: none; }
.points { display: flex; flex-direction: column; gap: 12px; padding: 0; margin: 0; list-style: none; }
.points li { display: flex; gap: 12px; align-items: flex-start; }
.points svg { flex: none; margin-top: 2px; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 54px; padding: 10px 16px; border: 1.5px solid var(--green); border-radius: 10px; background: var(--green); color: #fff; font: 600 17px var(--sans); text-decoration: none; cursor: pointer; text-align: center; }
.btn.line { background: transparent; color: var(--green); min-height: 48px; font-size: 16px; }
.btn.small-btn { width: auto; min-height: 44px; padding: 6px 14px; font-size: 15px; border-radius: 8px; }
.btn.danger { background: transparent; color: var(--alert); border-color: var(--alert); min-height: 48px; font-size: 16px; }
.btn.dash { background: transparent; color: var(--green); border: 1.5px dashed var(--edge); min-height: 52px; font-size: 16px; font-weight: 500; }
.btn[disabled], .btn[aria-disabled="true"] { background: transparent; color: var(--soft); border-color: var(--edge); cursor: default; }
.link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0; border: 0; background: none; color: var(--green); font: 500 15px var(--sans); text-decoration: underline; cursor: pointer; }
.back { text-decoration: none; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, label.chip:focus-within { outline: 3px solid #2B7A63; outline-offset: 2px; }

.card { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 14px; }
.brass { border: 1px solid var(--brass-line); border-radius: 10px; background: var(--brass-tint); padding: 14px 16px; }
.dashed { border: 1.5px dashed var(--edge); border-radius: 10px; padding: 14px; }
.notice { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; }
.notice svg { flex: none; margin-top: 1px; }
.banner { border-radius: 8px; background: #DDE5DF; color: var(--ink); padding: 8px 12px; font-size: 13px; }
.error { border: 1.5px solid var(--alert); border-radius: 10px; background: #FBEDE8; color: #5E1C0C; padding: 12px 14px; font-size: 15px; font-weight: 500; }
.busy { border-radius: 10px; background: var(--brass-tint); border: 1px solid var(--brass-line); padding: 12px 14px; font-size: 15px; font-weight: 500; }

.shelf { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 56px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: 500 16px var(--sans); text-align: left; cursor: pointer; }
.shelf.own { border-color: var(--brass-line); background: var(--brass-tint); }
.shelf .count { font: 400 14px var(--mono); color: var(--muted); }
.shelf .tag { display: block; font-size: 12px; font-weight: 400; color: var(--brass); }
.list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 2px 14px; }
.list > * { padding: 11px 0; border-bottom: 1px solid var(--hair); }
.list > *:last-child { border-bottom: 0; }
.entry { display: flex; flex-direction: column; gap: 3px; }
.entry .when { font: 400 12px var(--mono); color: var(--muted); }
.entry.note .when { color: var(--brass); }
.entry .said { padding: 10px 12px; border-radius: 8px; background: var(--brass-tint); font-family: var(--serif); font-size: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.itemrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 52px; border: 0; border-bottom: 1px solid var(--hair); background: none; color: var(--ink); font: 500 16px var(--sans); text-align: left; cursor: pointer; }
.person { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.person .who { display: flex; flex-direction: column; gap: 1px; font-weight: 500; }
.person .who span { font-size: 13px; font-weight: 400; color: var(--muted); }
.good { font-size: 13px; font-weight: 600; color: var(--green); }

.meter { display: flex; flex-direction: column; gap: 6px; }
.meter .bar { height: 10px; border-radius: 5px; background: #D5DCD6; overflow: hidden; }
.meter .fill { height: 100%; width: 0; min-width: 4px; background: var(--green); border-radius: 5px; }

label.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
input[type="text"], input[type="password"], textarea { width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid var(--edge); border-radius: 10px; background: var(--surface); color: var(--ink); font: 400 16px var(--sans); }
textarea { resize: vertical; line-height: 1.4; }
textarea.code { font-family: var(--mono); font-size: 15px; }
input[type="file"] { width: 100%; font: 400 15px var(--sans); color: var(--ink); padding: 10px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
label.chip { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--edge); border-radius: 22px; background: var(--surface); font-size: 15px; cursor: pointer; }
label.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
label.chip:has(input:checked) { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
label.check { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; font-size: 15px; cursor: pointer; }
label.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--green); flex: none; }
.pair { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 8px; }

.codebox { border: 1.5px solid var(--ink); border-radius: 10px; background: var(--surface); padding: 16px; font: 500 17px/1.9 var(--mono); letter-spacing: 0.04em; word-spacing: 0.35em; overflow-wrap: anywhere; user-select: all; }
.preview { max-width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.struck { text-decoration: line-through; color: var(--soft); }
.holds { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.holds li { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 10px 12px; font-size: 14px; color: var(--soft); }
.holds b { display: block; font: 600 20px var(--serif); color: var(--ink); }
.price { font: 600 40px var(--serif); }
.prose { display: flex; flex-direction: column; gap: 12px; }
.prose h2 { font-size: 17px; font-family: var(--serif); margin-top: 6px; }

@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  .page { max-width: none; min-height: 0; padding: 0; }
  .codebox { font-size: 15pt; }
}

.logbox { margin: 0; font: 400 13px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 60vh; overflow: auto; }
table.records { width: 100%; border-collapse: collapse; font-size: 13px; }
table.records th, table.records td { text-align: left; padding: 6px 8px 6px 0; border-bottom: 1px solid var(--hair); vertical-align: top; }
table.records td.mono { font-family: var(--mono); overflow-wrap: anywhere; }
