/* Roomroll · © 2026 SoeSan Holdings LLC */
/* The look is a household contents inventory form: navy ink on ruled paper, typewriter entries, a red claim-ready stamp.
   Archivo (variable, width axis) and Courier Prime are under the SIL Open Font License 1.1 (fonts/LICENSE-*.txt),
   latin subsets from @fontsource-variable/archivo 5.3.0 and @fontsource/courier-prime 5.3.0. */
@font-face { font-family: "Archivo"; src: url(/roomroll/fonts/archivo-latin-wdth-normal.woff2) format("woff2-variations"), url(/roomroll/fonts/archivo-latin-wdth-normal.woff2) format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url(/roomroll/fonts/courier-prime-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url(/roomroll/fonts/courier-prime-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
:root {
  --paper: #FBFAF6;
  --card: #FFFFFF;
  --ink: #1B2A4A; /* navy ink */
  --ink-2: #4A5772;
  --ink-3: #5E6780; /* 5.4:1 on paper, 5.6:1 on white */
  --rule: #CFDCE8; /* ledger lines */
  --line: #C9D2DE;
  --margin: #E3A39A; /* the red margin line */
  --stamp: #C23B22; /* 5.1:1 on paper */
  --stamp-soft: rgba(194, 59, 34, .08);
  --tint: #EEF2F7;
  --brand: var(--ink);
  --brand-ink: var(--paper);
  --danger: #B02A1A;
  --danger-ink: #FFFFFF;
  --focus: #C23B22;
  --shadow: 0 1px 0 var(--line), 0 10px 30px rgba(27, 42, 74, .12);
  --font: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "Courier Prime", ui-monospace, "Courier New", Courier, monospace;
  color-scheme: light;
}
/* Dark: the same form as a blueprint. */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0F2A4F; /* blueprint blue */
    --card: #163762;
    --ink: #E6F0FF;
    --ink-2: #BCCBE6;
    --ink-3: #A9BCDB; /* 7.4:1 on paper, 6.2:1 on card */
    --rule: #2A4A7A;
    --line: #36588A;
    --margin: #8A4B5A;
    --stamp: #FF9A82; /* 7.0:1 on paper */
    --stamp-soft: rgba(255, 154, 130, .12);
    --tint: #1B3D6B;
    --danger: #FF9A82;
    --danger-ink: #0F2A4F;
    --focus: #FFC0AA;
    --shadow: 0 1px 0 var(--line), 0 10px 30px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
  /* the faint grid of blueprint paper */
  body { background-image: linear-gradient(rgba(150, 200, 255, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(150, 200, 255, .07) 1px, transparent 1px); background-size: 24px 24px; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: var(--ink); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.1; margin: 0 0 .5em; }
h1, h2 { font-stretch: 70%; font-weight: 800; letter-spacing: .005em; }
.landing h1, .landing h2 { text-transform: uppercase; } /* in the app, headings stay as typed: they're read and copied */
p { margin: 0 0 1em; }
small { font-size: .82rem; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }

/* Buttons: square, typed in Courier, like the boxes on a form */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 44px; padding: .55em 1.1em; border-radius: 0; border: 2px solid var(--ink); background: var(--card); color: var(--ink); font: 700 .95rem/1.2 var(--mono); letter-spacing: .02em; cursor: pointer; text-decoration: none; transition: transform .08s, background .15s; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); text-transform: uppercase; letter-spacing: .05em; }
.btn.ghost { background: transparent; border-color: transparent; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.btn.text { background: transparent; border-color: transparent; padding-left: .2em; padding-right: .2em; text-transform: uppercase; letter-spacing: .05em; text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.btn.small { min-height: 38px; padding: .35em .8em; font-size: .88rem; }
.btn.wide { width: 100%; flex-direction: column; align-items: flex-start; text-align: left; margin-bottom: .6rem; border-width: 1.5px; border-color: var(--line); }
.btn.primary.wide { align-items: center; text-align: center; border-color: var(--ink); }
.btn.wide b { font-size: .98rem; }
.btn.wide small { font: 400 .86rem/1.4 var(--font); color: var(--ink-3); }
.btn.danger { color: var(--danger); }
.btn.danger:not(.ghost) { background: var(--danger); border-color: var(--danger); color: var(--danger-ink); }
.btn[disabled], .btn[aria-busy="true"] { opacity: .55; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--tint); }
.icon-btn svg { width: 24px; height: 24px; }

/* Header: the top of the form */
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); max-width: 1180px; margin: 0 auto; }
.formhead { border-bottom: 2px solid var(--ink); }
.form-no { font: 400 .8rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); text-align: right; }
#device-btn { font-weight: 700; }
.brand { display: inline-flex; align-items: center; gap: .5rem; font-weight: 800; font-stretch: 75%; font-size: 1.3rem; text-transform: uppercase; letter-spacing: .02em; color: var(--ink); text-decoration: none; }
.logo { width: 28px; height: 28px; color: var(--ink); }
.top-actions { display: flex; align-items: center; gap: .25rem; }
.app-top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); max-width: none; border-bottom: 2px solid var(--ink); }
/* On wide screens the header lines up with the 760px list column below it. */
@media (min-width: 820px) { .app-top { padding-left: calc(50% - 380px + 16px); padding-right: calc(50% - 380px + 6px); } }

/* Landing */
.landing { max-width: 1180px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left)); }
.landing > section { margin-bottom: 56px; }
.landing > .hero { margin-bottom: 40px; }
.blanks { display: flex; gap: 28px; margin: 0; padding-top: 12px; font: 400 .82rem var(--mono); color: var(--ink-3); }
.blanks span { flex: 1; border-bottom: 1px solid var(--ink-3); padding-bottom: 2px; white-space: nowrap; }
.hero { padding-top: 0; }
.hero h1 { font-size: clamp(2.5rem, 8.2vw, 7rem); line-height: .92; font-stretch: 66%; max-width: none; margin: 36px 0 26px; text-wrap: balance; }
.hero-row { display: grid; gap: 4px 48px; align-items: start; }
.hero-row .lede { margin: 0 0 4px; }
.lede { font-size: 1.18rem; color: var(--ink-2); max-width: 46ch; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin: 1.6rem 0 .9rem; }
.cta .btn.primary { min-height: 52px; padding: .7em 1.4em; font-size: 1rem; }
.fine { font: 400 .86rem/1.45 var(--mono); color: var(--ink-3); }
.keep { max-width: 72ch; margin: 22px 0 0; padding: 4px 0 4px 16px; font-size: .92rem; color: var(--ink-2); border-left: 2px solid var(--stamp); }
.keep b { color: var(--ink); }

/* The sample house: a floor plan you tap, and the ledger for that room */
.cap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 14px; font: 700 .78rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); margin: 0 0 10px; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.sample-grid { display: grid; gap: 28px; align-items: start; }
.plan { display: block; width: 100%; height: auto; max-width: 560px; }
.plan text { font: 400 12px var(--mono); fill: var(--ink); text-transform: uppercase; pointer-events: none; }
.plan text.v { fill: var(--ink-3); font-size: 11px; text-transform: none; }
.plan .room { cursor: pointer; }
.plan .room rect { fill: transparent; transition: fill .15s; }
.plan .room:hover rect { fill: var(--tint); }
.plan .room.on rect { fill: var(--stamp-soft); }
.plan .room circle { fill: var(--stamp); pointer-events: none; }
.plan .room circle.no { fill: var(--paper); stroke: var(--stamp); stroke-width: 2; }
.plan .walls rect { fill: none; stroke: var(--ink); stroke-width: 3; }
.plan .inner path { fill: none; stroke: var(--ink); stroke-width: 2; }
.plan .doors path { fill: none; stroke: var(--paper); stroke-width: 5; }
.plan .swing path { fill: none; stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 3; }
.plan .walls, .plan .inner, .plan .doors, .plan .swing, .plan .bath { pointer-events: none; }
.room-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.room-tabs button { border: 1.5px solid var(--line); background: transparent; padding: 6px 10px; min-height: 44px; font: 400 .8rem var(--mono); text-transform: uppercase; letter-spacing: .03em; color: var(--ink-2); cursor: pointer; }
.room-tabs button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); font-weight: 700; }
.ledger { position: relative; border-top: 2px solid var(--ink); }
.ledger tr { border-bottom: 1px solid var(--rule); } /* the ruled lines, which grow with a wrapped row on phones */
.ledger::before { content: ""; position: absolute; left: 26px; top: 0; bottom: 0; width: 1px; background: var(--margin); }
.ledger table { width: 100%; border-collapse: collapse; font: 400 15px/38px var(--mono); }
.ledger th { font: 700 11px/38px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); text-align: left; border-bottom: 1px solid var(--ink); }
.ledger td, .ledger th { padding: 0 8px; white-space: nowrap; height: 38px; }
.ledger td:first-child, .ledger th:first-child { padding-left: 36px; }
.ledger .n { text-align: right; font-variant-numeric: tabular-nums; }
.ledger .bm { color: var(--ink-3); }
.ledger tbody th { font: 700 15px/38px var(--mono); text-transform: none; letter-spacing: 0; color: var(--ink); border-bottom: 0; }
.ledger .tot > * { font-weight: 700; border-top: 1px solid var(--ink); }
.ledger .tot td:last-child { font-weight: 400; color: var(--ink-3); }
.ledger .tot td.n { border-bottom: 4px double var(--ink); }
.st, .stamp { display: inline-block; font: 800 11px/1 var(--font); font-stretch: 80%; letter-spacing: .12em; text-transform: uppercase; color: var(--stamp); border: 2px solid var(--stamp); padding: 3px 6px 2px; transform: rotate(-6deg); white-space: nowrap; }
.miss { font: italic 400 13px/1.2 var(--mono); color: var(--stamp); white-space: normal; display: inline-block; vertical-align: middle; }

/* Instructions: the back of the form. Numbered fine print and the questions, run in, three narrow columns on wide screens. */
.instructions { font-size: .94rem; }
.ins-cols { columns: 1; column-gap: 40px; column-rule: 1px solid var(--rule); }
.instructions .steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.instructions .steps li { counter-increment: s; position: relative; padding-left: 2rem; margin: 0 0 14px; break-inside: avoid; }
.instructions .steps li::before { content: counter(s); position: absolute; left: 0; top: .15em; width: 1.4rem; text-align: center; font: 700 .8rem/1.35 var(--mono); color: var(--stamp); border: 1.5px solid var(--stamp); }
.instructions h3 { display: inline; font-size: 1rem; font-weight: 750; font-stretch: 90%; margin: 0; }
.instructions .steps h3::after { content: ". "; }
.instructions .steps p { display: inline; margin: 0; color: var(--ink-2); }
.instructions .q-h { display: block; break-after: avoid; font: 700 .78rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); margin: 22px 0 10px; padding-top: 10px; border-top: 1px solid var(--ink); }
.faq { margin: 0; }
.faq > div { margin: 0 0 12px; break-inside: avoid; }
.faq dt { display: inline; font-weight: 750; font-stretch: 90%; }
.faq dt::after { content: " "; }
.faq dd { display: inline; margin: 0; color: var(--ink-2); }
.foot { max-width: 1180px; margin: 0 auto; padding: 18px 16px 40px; color: var(--ink-3); font: 400 .84rem/1.5 var(--mono); border-top: 2px solid var(--ink); }
.foot a { color: var(--ink-2); }
.foot p { margin: .3em 0; }
@media (min-width: 820px) {
  .hero h1 { margin-top: 44px; }
  .hero-row { grid-template-columns: minmax(0, 46ch) auto; justify-content: space-between; }
  .hero-row .cta { margin-top: 0; justify-content: flex-end; }
  .hero-row .fine { text-align: right; max-width: 48ch; margin-left: auto; text-wrap: balance; }
  .sample-grid { grid-template-columns: 1fr 1.2fr; gap: 44px; }
}
@media (min-width: 900px) { .ins-cols { columns: 3; } }
@media (max-width: 600px) {
  .form-no .fn { display: none; }
  .form-no { font-size: .72rem; max-width: 15ch; }
  .plan text { font-size: 14px; }
  .plan text.v { font-size: 13px; }
  .blanks { gap: 14px; }
  .ledger table { font-size: 13px; }
  .ledger td, .ledger th { padding: 0 5px; white-space: normal; line-height: 1.25; }
  .ledger tbody th { font-size: 13px; line-height: 1.25; }
  .ledger td:first-child, .ledger th:first-child { padding-left: 26px; }
  .ledger::before { left: 18px; }
  .ledger .bm { display: none; }
  .ledger .n { white-space: nowrap; }
  .st { font-size: 9.5px; padding: 2px 4px 1px; border-width: 1.5px; }
  .miss { font-size: 12px; max-width: 10ch; }
}

/* App */
.app { max-width: 760px; margin: 0 auto; padding: 8px max(16px, env(safe-area-inset-right)) 120px max(16px, env(safe-area-inset-left)); outline: none; }
.demo-bar { background: var(--tint); color: var(--ink); text-align: center; font: 400 .88rem var(--mono); padding: 8px 16px; border-bottom: 1px solid var(--line); }
/* The totals box at the top of the form */
.summary { border: 2px solid var(--ink); background: var(--card); padding: 14px 16px 14px; margin: 10px 0 18px; }
.summary .label { font: 700 .76rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
.summary .total { font-weight: 800; font-stretch: 70%; font-size: clamp(2.4rem, 10vw, 3.2rem); line-height: 1; margin: 4px 0 12px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; padding-bottom: 6px; border-bottom: 4px double var(--ink); display: inline-block; }
.summary .meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font: 400 .86rem var(--mono); color: var(--ink-2); margin-top: 8px; }
.bar { height: 10px; border: 1.5px solid var(--ink); background: transparent; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ink); transition: width .4s cubic-bezier(.2, .8, .2, 1); }
.todo { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.todo button { border: 1.5px solid var(--stamp); background: transparent; color: var(--stamp); padding: 5px 10px; font: 400 .82rem var(--mono); cursor: pointer; min-height: 34px; }
.todo button[aria-pressed="true"] { background: var(--stamp); color: var(--paper); font-weight: 700; }
.todo button[disabled] { border-color: var(--ink-3); color: var(--ink-2); cursor: default; }
/* Rooms as file tabs */
.rooms { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; padding: 2px 20px 2px 2px; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent); }
@media (min-width: 820px) { .chips { flex-wrap: wrap; overflow: visible; padding-right: 2px; -webkit-mask-image: none; mask-image: none; } .rooms { align-items: flex-start; } }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1.5px solid var(--line); background: transparent; padding: 6px 11px; font: 400 .82rem var(--mono); text-transform: uppercase; letter-spacing: .03em; cursor: pointer; min-height: 38px; color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); font-weight: 700; }
.chip small { opacity: .75; margin-left: 5px; font-size: .78rem; }
.search input { width: 100%; min-height: 46px; border: 0; border-bottom: 1.5px solid var(--ink-3); background: transparent; border-radius: 0; padding: 10px 2px; margin-bottom: 8px; font-family: var(--mono); }
/* Items: lines on a ledger with a red margin */
.items { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); position: relative; }
.items:empty { border-top: 0; }
/* A long list only lays out the rows on screen; 85px is a row's height (64px picture + padding + rule). */
.items li { content-visibility: auto; contain-intrinsic-size: auto 85px; border-bottom: 1px solid var(--rule); }
.item:focus-visible { outline-offset: -3px; } /* inside the row: content-visibility clips anything drawn outside it */
.item { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; background: transparent; border: 0; border-left: 1px solid var(--margin); margin-left: 6px; padding: 10px 6px 10px 12px; cursor: pointer; text-align: left; width: calc(100% - 6px); }
.item:hover { background: var(--tint); }
.thumb { width: 64px; height: 64px; object-fit: cover; background: var(--tint); display: grid; place-items: center; color: var(--ink-3); border: 1px solid var(--line); }
.thumb svg { width: 26px; height: 26px; }
.item .name { font-weight: 650; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; line-height: 1.3; }
.item .sub { color: var(--ink-3); font: 400 .82rem var(--mono); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.item .main { min-width: 0; }
.item .right { text-align: right; }
.item .val { font: 700 1rem var(--mono); font-variant-numeric: tabular-nums; display: block; }
.flags { display: flex; gap: 2px 8px; justify-content: flex-end; margin-top: 4px; position: relative; }
/* On phones the to-do notes stack under the value instead of squeezing the item's name. */
@media (max-width: 600px) { .item .right { max-width: 7.5rem; } .item .val { overflow-wrap: anywhere; } .flags { flex-wrap: wrap; } .item .sub { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; } }
.flag { font: italic 400 .78rem var(--mono); color: var(--stamp); white-space: nowrap; }
/* Claim-ready: the red rubber stamp. When an item just got there, its notes fold away and the stamp lands. */
.stamp { font-size: .66rem; padding: 2px 5px 1px; border-width: 1.5px; margin-top: 2px; }
@media (prefers-color-scheme: light) { .stamp, .st { mix-blend-mode: multiply; } }
.stamp.in { animation: stamp-in .22s cubic-bezier(.3, 1.6, .5, 1) .12s both; }
.flags .was { position: absolute; right: 0; top: 0; display: flex; gap: 8px; animation: pills-out .16s ease-in both; pointer-events: none; }
@keyframes stamp-in { from { opacity: 0; transform: scale(1.5) rotate(-6deg); } to { opacity: 1; transform: scale(1) rotate(-6deg); } }
@keyframes pills-out { to { opacity: 0; transform: scaleX(.3); } }
.empty { color: var(--ink-2); padding: 28px 4px; border-top: 2px solid var(--ink); }
.empty h2 { font-size: 1.8rem; color: var(--ink); }
.empty .first-run { max-width: 44ch; margin: 1.2rem 0 0; }
.device-note { margin: 28px 0 0; padding: 4px 0 4px 16px; border-left: 2px solid var(--stamp); color: var(--ink-2); font-size: .92rem; }
.device-note p { margin: 0 0 .8em; }
.device-note b { color: var(--ink); }
.device-note .when { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 0; color: var(--ink-3); font-family: var(--mono); font-size: .86rem; }
.fab { position: fixed; right: max(18px, env(safe-area-inset-right), calc(50% - 380px)); bottom: max(18px, env(safe-area-inset-bottom)); z-index: 6; display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--ink); padding: 0 20px 0 16px; height: 54px; background: var(--ink); color: var(--paper); font: 700 .95rem var(--mono); text-transform: uppercase; letter-spacing: .05em; box-shadow: 0 0 0 4px var(--paper); cursor: pointer; }
.fab svg { width: 20px; height: 20px; }

/* Dialogs: a sheet of the same form */
dialog { border: 0; padding: 0; background: transparent; color: var(--ink); max-width: 100vw; max-height: 100dvh; }
dialog::backdrop { background: rgba(14, 24, 48, .5); }
/* Sheets rise and fade in; the dim area fades. (prefers-reduced-motion turns all animation off below.) */
dialog[open] > .sheet { animation: sheet-in .22s cubic-bezier(.2, .8, .2, 1); }
dialog[open]::backdrop { animation: fade-in .22s ease-out; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(24px); } }
@keyframes fade-in { from { opacity: 0; } }
.confirm-btns { justify-content: flex-end; border-top: 0 !important; }
#d-confirm .sheet { padding-bottom: 0; }
#confirm-body { color: var(--ink-2); margin-top: 8px; }
.sheet { background: var(--paper); width: min(560px, 100vw); max-height: min(92dvh, 900px); overflow: auto; border: 2px solid var(--ink); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.sheet.narrow { width: min(440px, 100vw); padding-bottom: 18px; }
.sheet > header { display: flex; align-items: center; justify-content: space-between; padding: 12px 8px 8px 20px; margin-bottom: 10px; position: sticky; top: 0; background: var(--paper); z-index: 1; border-bottom: 2px solid var(--ink); }
.sheet > header h2 { margin: 0; font-size: 1.5rem; font-stretch: 70%; }
.sheet > :not(header):not(footer):not(.body), .sheet .body { padding-left: 20px; padding-right: 20px; }
.sheet .body { padding-top: 2px; padding-bottom: 8px; }
.sheet > footer { display: flex; gap: 8px; align-items: center; padding: 12px 16px max(14px, env(safe-area-inset-bottom)); border-top: 2px solid var(--ink); position: sticky; bottom: 0; background: var(--paper); }
.grow { flex: 1; }
@media (max-width: 600px) {
  dialog:not(.viewer) { margin: auto 0 0; width: 100vw; }
  .sheet, .sheet.narrow { width: 100vw; max-height: 94dvh; border-width: 2px 0 0; }
}
/* Fields: a label over a fill-in line */
label { display: block; font: 700 .76rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 14px; color: var(--ink-2); }
input:not([type="checkbox"]):not([type="file"]), select, textarea { display: block; width: 100%; margin-top: 4px; min-height: 44px; border: 0; border-bottom: 1.5px solid var(--ink-3); background: var(--card); border-radius: 0; padding: 8px 10px; font: 400 1rem/1.4 var(--mono); text-transform: none; letter-spacing: 0; color: var(--ink); }
textarea { resize: vertical; min-height: 64px; border: 1.5px solid var(--line); border-bottom-color: var(--ink-3); }
input:focus, select:focus, textarea:focus { border-bottom-color: var(--ink); outline: none; box-shadow: inset 0 -2px 0 var(--ink), 0 0 0 2px var(--focus); }
::placeholder { color: var(--ink-3); opacity: 1; }
input[aria-invalid="true"] { border-bottom-color: var(--danger); box-shadow: inset 0 -2px 0 var(--danger); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.money { position: relative; display: block; }
.money > span { position: absolute; left: 10px; top: 50%; transform: translateY(-38%); color: var(--ink-3); font: 400 1rem var(--mono); pointer-events: none; }
.money input { padding-left: 24px !important; font-variant-numeric: tabular-nums; }
.check { display: flex; gap: 10px; align-items: flex-start; font: 400 .92rem/1.4 var(--font); text-transform: none; letter-spacing: 0; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--ink); }
.hint { display: block; font: 400 .82rem/1.4 var(--font); text-transform: none; letter-spacing: 0; color: var(--ink-3); margin-top: 4px; }
.error { color: var(--danger); font-weight: 700; font-size: .92rem; }
.swap { text-align: center; color: var(--ink-2); margin: 12px 0 0; }
fieldset.photos { border: 1.5px dashed var(--ink-3); padding: 10px 12px 12px; margin: 4px 0 14px; }
fieldset.photos legend { font: 700 .76rem var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); padding: 0 6px; }
fieldset.photos[disabled] .photo-btns { opacity: .5; }
.gallery { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.gallery:empty { display: none; }
.gallery li { position: relative; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--tint); border: 1px solid var(--line); }
.gallery .view { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.gallery .waiting img { opacity: .75; outline: 2px dashed var(--stamp); outline-offset: -2px; }
.field-error { margin: 0 0 6px; }
.gallery .kind { position: absolute; left: 4px; bottom: 4px; font: 700 .7rem var(--mono); background: rgba(14, 24, 48, .78); color: #fff; padding: 1px 5px; }
.gallery .del { position: absolute; right: 3px; top: 3px; width: 28px; height: 28px; border: 0; background: rgba(14, 24, 48, .78); color: #fff; display: grid; place-items: center; cursor: pointer; }
.gallery .del svg { width: 14px; height: 14px; }
.gallery .busy img { opacity: .4; }
.photo-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-btns .btn { cursor: pointer; position: relative; font-size: .84rem; text-transform: none; letter-spacing: .02em; }
.photo-btns .btn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.room-list { list-style: none; padding: 0; margin: 4px 0 12px; }
.room-list li { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.room-list input { margin: 0 !important; }
.add-room { display: flex; gap: 8px; align-items: center; }
.add-room input { margin: 0 !important; }
.sheet-h { font: 700 .9rem var(--mono); color: var(--ink-2); margin: 16px 0 8px; }
.sheet .backup-when { margin: 0 0 4px; }
.danger-zone { margin: 14px 0 8px; }
.danger-zone summary { color: var(--danger); font-weight: 700; cursor: pointer; margin-bottom: 8px; }
.viewer { background: #000; width: 100vw; height: 100dvh; max-height: none; margin: 0; }
.viewer img { width: 100%; height: 100%; object-fit: contain; }
.viewer form { position: absolute; top: max(8px, env(safe-area-inset-top)); right: 8px; }
.viewer .icon-btn { color: #fff; background: rgba(255, 255, 255, .15); }

.loading { position: fixed; inset: 0; display: grid; place-items: center; background: var(--paper); z-index: 40; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--ink); color: var(--paper); padding: 10px 16px; font: 700 .9rem var(--mono); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* Claim report (print) */
.report { display: none; }
@media print {
  @page {
    margin: 14mm 14mm 16mm;
    @bottom-left { content: "Made with Roomroll · minsoesantun.com/roomroll"; font: 9pt/1.2 ui-sans-serif, system-ui, sans-serif; color: #555; }
    @bottom-right { content: "Page " counter(page) " of " counter(pages); font: 9pt/1.2 ui-sans-serif, system-ui, sans-serif; color: #555; }
  }
  body { background: #fff; color: #000; }
  /* Printing the app itself (Ctrl+P with no report built): just the list, without buttons and notes. */
  .skip, .fab, .toast, .loading, .top-actions, .search, #rooms-btn, .device-note, .demo-bar button, dialog, .empty .btn { display: none !important; }
  .app-top { position: static; backdrop-filter: none; }
  .summary, .item { box-shadow: none; break-inside: avoid; }
  .chips { flex-wrap: wrap; -webkit-mask-image: none; mask-image: none; }
  .items li { content-visibility: visible; }
  /* Printing the claim report: only the report. */
  .print-report body > :not(.report) { display: none !important; }
  .print-report .report { display: block; font: 10pt/1.35 var(--font); color: #000; }
  .report h1 { font-size: 20pt; margin-bottom: 2pt; }
  .report .sample-note { font-weight: 700; margin: 0 0 2pt; }
  .report .rmeta { color: #444; margin-bottom: 10pt; }
  .report .fill { display: grid; grid-template-columns: 1fr 1.6fr 1fr; gap: 0 14pt; margin: 0 0 6pt; }
  .report .fill p { display: flex; align-items: flex-end; gap: 5pt; margin: 0; padding-top: 10pt; font-size: 9pt; color: #333; }
  .report .fill i { flex: 1; border-bottom: .75pt solid #555; height: 12pt; }
  .report table { width: 100%; border-collapse: collapse; table-layout: fixed; }
  .report table { font-size: 9pt; }
  .report col.c-item { width: 25%; } .report col.c-brand { width: 18%; } .report col.c-serial { width: 15%; } .report col.c-date { width: 14%; }
  .report col.c-paid { width: 11%; } .report col.c-qty { width: 6%; } .report col.c-value { width: 11%; }
  .report.with-photos col.c-item { width: 21%; } .report.with-photos col.c-brand { width: 13%; } .report.with-photos col.c-serial { width: 15%; }
  .report.with-photos col.c-paid { width: 9%; } .report.with-photos col.c-qty { width: 5%; } .report.with-photos col.c-value { width: 12%; } .report.with-photos col.c-photos { width: 11%; }
  .report th, .report td { border-bottom: .5pt solid #bbb; padding: 4pt; vertical-align: top; text-align: left; overflow-wrap: anywhere; }
  .report th { font-size: 7.5pt; text-transform: uppercase; letter-spacing: .04em; color: #333; overflow-wrap: normal; }
  .report th.c-paid, .report th.c-qty, .report th.c-value { text-align: right; }
  .report th.c-photos, .report td.ph { padding-left: 8pt; }
  .report td.n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-family: var(--mono); }
  .report td.nowrap { white-space: nowrap; overflow-wrap: normal; }
  .report td.serial { font-size: 8pt; font-family: var(--mono); letter-spacing: -.02em; } /* a typical serial fits on one line; a long one wraps inside its cell */
  .report .note { color: #333; font-size: 8.5pt; margin-top: 2pt; }
  .report tfoot td { border-bottom: 0; border-top: .75pt solid #555; font-weight: 700; text-align: right; }
  .report tfoot td.n { font-variant-numeric: tabular-nums; }
  .report .room { margin-top: 12pt; }
  .report h2 { font-size: 13pt; margin: 0 0 3pt; break-after: avoid; }
  .report tr { break-inside: avoid; }
  .report .stamp { display: block; width: max-content; margin: 3pt 0 2pt 2pt; font-size: 6.5pt; color: #B02A1A; border-color: #B02A1A; border-width: 1pt; padding: 1pt 3pt 0; vertical-align: 1pt; mix-blend-mode: normal; }
  .report img { width: 40pt; height: 40pt; object-fit: cover; margin: 0 3pt 3pt 0; }
  .report .total { font-size: 13pt; font-weight: 700; margin-top: 12pt; text-align: right; break-before: avoid; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: .01ms !important; animation-delay: 0s !important; }
}

/* shown until launch day */
.sheet > .btn.wide { width: auto; margin-left: 20px; margin-right: 20px; }
/* Very narrow phones: the header fits without scrolling sideways. */
@media (max-width: 359px) { .brand { font-size: 1.1rem; } .top { gap: .5rem; } }
@media (max-width: 400px) { html[data-mode="cloud"] .form-no { display: none; } }
