:root {
  --bg: #f4f2ee;
  --card: #ffffff;
  --ink: #16181d;
  --muted: #5d6270;
  --line: #d9d5cc;
  --accent: #e2531a;
  --accent-ink: #ffffff;
  --ok: #15803d;
  --err: #b42318;
  --radius: 12px;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14161a; --card: #1d2026; --ink: #eef0f3; --muted: #a0a6b2; --line: #343944; }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--sans); background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.45; }
a { color: inherit; }
.wrap { max-width: 960px; margin: 0 auto; padding: 16px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 2px solid var(--ink); background: var(--card); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 800; letter-spacing: .02em; text-transform: uppercase; font-size: 15px; display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand .ver { font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted); margin-left: -4px; }
.brand .mark { width: 22px; height: 22px; border: 3px solid var(--ink); border-radius: 4px; position: relative; }
.brand .mark::after { content: ''; position: absolute; left: 3px; right: 3px; top: 5px; height: 3px; background: var(--accent); }
.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 12px 16px 0; max-width: 960px; margin: 0 auto; }
.tab { border: 0; background: none; font: inherit; font-weight: 700; padding: 10px 14px; border-radius: 8px 8px 0 0; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tab[aria-selected='true'] { color: var(--ink); background: var(--card); box-shadow: inset 0 -3px 0 var(--accent); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.panel + .panel { margin-top: 16px; }
h1, h2, h3 { margin: 0 0 10px; line-height: 1.2; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
label { display: block; font-weight: 700; font-size: 14px; margin: 14px 0 6px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1.5px solid var(--line); border-radius: 8px; padding: 10px 12px; }
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); border-color: var(--accent); }
textarea { min-height: 110px; resize: vertical; }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700; border: 2px solid var(--ink); background: var(--card); color: var(--ink); padding: 11px 16px; border-radius: 10px; cursor: pointer; text-decoration: none; min-height: 46px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.big { width: 100%; font-size: 18px; min-height: 60px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.msg { margin-top: 12px; padding: 10px 12px; border-radius: 8px; font-size: 14px; display: none; }
.msg.show { display: block; }
.msg.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.msg.err { background: color-mix(in srgb, var(--err) 14%, transparent); color: var(--err); }
.msg.info { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 13px; padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(0,0,0,.15); white-space: nowrap; }
.chip .n { font-variant-numeric: tabular-nums; }
.tid { font-family: var(--mono); font-weight: 700; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.table-scroll { overflow-x: auto; }
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-top: 14px; }
.card { display: flex; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; text-decoration: none; }
.card img, .card .noimg { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; background: var(--bg); flex: none; }
.card .noimg { display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.card .body { min-width: 0; }
.card .items { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.slot-list { display: grid; gap: 8px; }
.slot { display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: center; }
.swatch { height: 46px; border-radius: 8px; display: grid; place-items: center; font-weight: 900; font-size: 20px; border: 1px solid rgba(0,0,0,.15); }
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.room-btn { font: inherit; text-align: left; border: 3px solid transparent; border-radius: 10px; padding: 10px; cursor: pointer; font-weight: 800; min-height: 56px; }
.room-btn[aria-pressed='true'] { border-color: var(--ink); box-shadow: 0 0 0 3px var(--card) inset; }
.room-btn .n { font-size: 20px; margin-right: 6px; }
.photo { width: 100%; max-height: 420px; object-fit: contain; border-radius: var(--radius); background: var(--bg); display: block; }
.photo-empty { border: 2px dashed var(--line); border-radius: var(--radius); padding: 36px 16px; text-align: center; color: var(--muted); }
.banner { border-radius: var(--radius); padding: 14px 16px; font-weight: 900; font-size: 20px; display: flex; align-items: center; gap: 12px; }
.banner .n { font-size: 34px; line-height: 1; }
.spinner { width: 18px; height: 18px; border: 3px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-box { width: 100%; max-width: 380px; }

/* Mover view: the whole screen is the room. */
.mover { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; gap: 6px; }
.mover .num { font-size: clamp(120px, 42vw, 260px); font-weight: 900; line-height: .9; font-variant-numeric: tabular-nums; }
.mover .room { font-size: clamp(34px, 10vw, 64px); font-weight: 900; line-height: 1.05; }
.mover .meta { margin-top: 18px; font-family: var(--mono); font-size: 16px; opacity: .85; }
.mover .owner-link { position: fixed; bottom: 14px; right: 14px; font-size: 13px; opacity: .7; }

/* Labels */
.label-preview { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.label-preview img { background: #fff; border: 1px solid #bbb; border-radius: 4px; max-width: 100%; height: auto !important; image-rendering: pixelated; }
#print-sheet { display: none; }
@media print {
  body { background: #fff; }
  body > *:not(#print-sheet) { display: none !important; }
  #print-sheet { display: block; }
  #print-sheet img { display: block; break-after: page; page-break-after: always; border: 0; margin: 0; }
  #print-sheet img:last-child { break-after: auto; page-break-after: auto; }
}

/* Segmented choice (Labels: what to print) */
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.seg label { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 999px; font-size: 14px; cursor: pointer; }
.seg input { width: auto; margin: 0; }
.seg label:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.notice { border-radius: var(--radius); padding: 12px 14px; background: color-mix(in srgb, var(--accent) 12%, transparent); font-weight: 600; margin-top: 16px; }
