/* Paper House Studio components in the launch theme (Snow Village Night). Colours, fonts, radii and shadows come
   from theme.css tokens; this file only uses tokens. Spacing rhythm: 4 / 8 / 12 / 16 / 24 / 32 / 48 px.
   Controls are at least 44 px high (36 px for small ones in dense lists). Patterns shared with PartyForge. */

:root { --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --radius: var(--r-lg); }
h1, h2, h3, .logo { font-family: var(--font-display); }
.icon { flex: none; vertical-align: middle; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn { gap: 6px; min-height: 44px; }
.btn.small { min-height: 36px; }
.btn.icon-only { width: 36px; padding: 0; }
.btn.ghost.danger { color: var(--danger); }

/* ---------- forms and dialogs ---------- */
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.field-error { color: var(--err-ink); min-height: 1.5em; margin: 0; font-size: 14px; }
.dialog-form { width: min(720px, calc(100vw - 32px)); max-width: 720px; max-height: calc(100vh - 32px); overflow: auto; position: relative; }
.dialog-title { font: 700 26px var(--font-display); margin: 0 0 var(--s5); }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--s2); }
.type-tile { display: flex; gap: var(--s3); align-items: center; padding: var(--s2) var(--s3); min-height: 52px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); cursor: pointer;
  margin: 0; font-size: 15px; font-weight: 400; color: var(--ink); text-transform: none; letter-spacing: 0; } /* a tile is a <label>: undo the form-label style */
.type-tile b { font-weight: 700; }
.type-tile:has(.look-pic) { flex-direction: column; align-items: stretch; gap: 0; padding: 0; overflow: hidden; }
.type-tile:has(.look-pic) .tile-text { padding: var(--s2) var(--s3); }
.look-pic { display: block; aspect-ratio: 16 / 7; background: var(--surface-2) center 30% / cover; }
.type-tile:hover { border-color: var(--muted); }
.type-tile:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.type-tile:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.tile-text { display: flex; flex-direction: column; min-width: 0; }
.tile-text small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.tile-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); color: var(--accent); }
.type-tile .tile-icon { width: 36px; height: 36px; }

/* ---------- projects ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s5); flex-wrap: wrap; margin-bottom: var(--s5); }
.page-head h1 { font: 700 clamp(28px, 4vw, 40px)/1.1 var(--font-display); margin: 0 0 var(--s2); }
.page-head .lead { margin: 0; max-width: 62ch; }
.eyebrow { font: 700 12px var(--font-ui); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin: 0 0 var(--s2); }
.head-actions { display: flex; gap: var(--s3); flex-wrap: wrap; }
.data-note { display: flex; gap: var(--s2); align-items: flex-start; margin: 0 0 var(--s5); }
.project-card { min-height: 0; gap: var(--s4); }
.project-card .actions { flex-wrap: wrap; align-items: center; }
.project-card .actions .icon-only { margin-left: auto; }
.card-main { display: flex; gap: var(--s4); color: inherit; text-decoration: none; align-items: flex-start; }
.card-main:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
/* UI option A (Đại Vương 2026-11-26): the product is the decoration — a painted header and every card shows its own
   colored village (or dollhouse) on its season backdrop (render/thumb.js) */
.hero-head { padding: var(--s6) var(--s6) var(--s5); border-radius: 22px; box-shadow: 0 6px 24px rgba(24, 37, 68, .12);
  background: linear-gradient(90deg, rgba(255, 255, 255, .95) 0%, rgba(255, 255, 255, .86) 50%, rgba(255, 255, 255, .15) 80%), url('../assets/art/bg-winter.jpg') center 62% / cover, var(--surface); }
.project-grid { gap: var(--s5); }
.project-card { padding: 0; gap: var(--s3); overflow: hidden; border: 0; border-radius: 18px; box-shadow: 0 6px 22px rgba(24, 37, 68, .12); }
.project-card .card-main, .project-card .actions { padding: 0 var(--s5); }
.project-card .actions { padding-bottom: var(--s5); }
.project-card h3 { font-size: 21px; }
.card-picture { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--surface-2) center 70% / cover; }
.card-picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.look-chip { position: absolute; z-index: 1; left: 12px; top: 10px; padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .94); color: var(--ink); font: 700 13px var(--font-ui); box-shadow: 0 1px 4px rgba(24, 37, 68, .15); }
@media (max-width: 700px) { .hero-head { padding: var(--s5); background: linear-gradient(rgba(255, 255, 255, .9), rgba(255, 255, 255, .9)), url('../assets/art/bg-winter.jpg') center / cover; } }
.card-text { display: flex; flex-direction: column; gap: var(--s1); min-width: 0; }
.card-text h3 { overflow-wrap: anywhere; font-size: 20px; }
.empty-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--surface-2); color: var(--accent); margin-bottom: var(--s4); }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-weight: 600; margin-bottom: var(--s4); }
.back-link:hover { color: var(--ink); }

@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; }
}

/* ---------- upgrades entry: one solid colour, no gradient (Đại Vương 2026-11-20 "Buttons: one solid, high-contrast colour") ---------- */
.upgrade-btn { background: var(--btn-bg); color: var(--btn-ink); box-shadow: var(--sh-sm); }
.upgrade-btn:hover { background: color-mix(in srgb, var(--btn-bg) 88%, #000); box-shadow: var(--sh-md); }
.upgrade-count { background: var(--btn-ink); color: var(--btn-bg); }
.upgrade-strip { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); }

/* ---------- editor: fills the window on a computer; each panel scrolls on its own ---------- */
#app.app-fill { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
#app.app-fill > .topbar { flex: none; }
.editor { flex: 1; min-height: 0; display: grid; grid-template-columns: 300px minmax(0, 1fr) 320px; grid-template-rows: minmax(0, 1fr); }
.editor > * { position: relative; min-height: 0; overflow: auto; } /* position: relative keeps .sr-only helpers inside (no empty band) */
.house-list { border-right: 1px solid var(--line); background: var(--surface); padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3); }
.panel-head { display: flex; align-items: baseline; gap: var(--s2); }
.panel-head h2 { font-size: 20px; margin: 0; }
.panel-head .count { color: var(--muted); font-weight: 700; }
.house-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.house-row { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.house-row.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.row-main { display: flex; gap: var(--s3); align-items: center; width: 100%; padding: var(--s2); border: 0; background: none; text-align: left; cursor: pointer; border-radius: var(--r-md) var(--r-md) 0 0; }
.row-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.row-text b { overflow-wrap: anywhere; }
.row-text small { color: var(--muted); }
.row-flag { color: var(--danger); }
.row-tools { display: flex; gap: 2px; padding: 0 var(--s2) var(--s2); justify-content: flex-end; }
.row-tools .btn { min-height: 32px; width: 32px; }
.house-thumb { flex: none; display: block; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 3px; box-sizing: border-box; }
.add-house { width: 100%; margin-top: var(--s1); }
.list-empty { margin: 0; }
.icon.rot90 { transform: rotate(90deg); }
.stage { background: var(--bg2, var(--bg)); padding: var(--s5); display: flex; flex-direction: column; gap: var(--s4); align-items: center; }
.preview-head { width: 100%; max-width: 1100px; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.view-tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); padding: 3px; }
.view-tab { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--muted); }
.view-tab.on { background: var(--btn-bg); color: var(--btn-ink); }
.sheet-frame { margin: 0; width: 100%; max-width: 1100px; background: #fff; box-shadow: var(--sh-md); border: 1px solid var(--line); }
.sheet-frame svg { display: block; width: 100%; height: auto; }
.sheet-frame figcaption { padding: 6px 12px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); background: var(--surface); }
.preview-empty { margin: auto; max-width: 460px; }
.side-panel { border-left: 1px solid var(--line); background: var(--surface); padding: var(--s4) var(--s4) var(--s5); display: flex; flex-direction: column; gap: var(--s5); }
.side-block h2 { font-size: 22px; margin: 0 0 var(--s3); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px var(--s4); margin: 0 0 var(--s4); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.alert.warn { background: color-mix(in srgb, #e0a21f 16%, var(--surface)); color: #6a4a00; }
.side-panel .alert { display: block; margin: 0 0 var(--s2); }
.house-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.house-tile .house-thumb { width: 52px; height: 52px; }
.topbar .save-state { margin-left: var(--s2); }
/* the logo (2026-11-26): full logo in the top bar, the icon alone on a phone */
.logo { display: flex; align-items: center; }
.logo .logo-full { display: block; height: 40px; width: auto; }
.logo .mark { display: none; width: 34px; height: 34px; }
@media (max-width: 760px) { .logo .logo-full { display: none; } .logo .mark { display: block; } }
.signin-logo { border-radius: 0; box-shadow: none; }
.topbar.season-top { background: linear-gradient(90deg, var(--surface) 0%, rgba(255, 255, 255, .93) 40%, rgba(255, 255, 255, .78) 100%), var(--season-bg) center 38% / cover, var(--surface); }

@media (max-width: 1100px) { .editor { grid-template-columns: 260px minmax(0, 1fr); } .side-panel { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); } #app.app-fill { height: auto; overflow: visible; } .editor > * { overflow: visible; } }
@media (max-width: 760px) { .editor { grid-template-columns: 1fr; } .house-list { border-right: 0; border-bottom: 1px solid var(--line); } }

/* print pages drawn in the app use "DM Sans" for small labels (the exporter maps it to Nunito too) */
@font-face { font-family: 'DM Sans'; font-weight: 400; src: url(../fonts/nunito-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'DM Sans'; font-weight: 700; src: url(../fonts/nunito-latin-700-normal.woff2) format('woff2'); }

/* ---------- T19: 3D view and house controls ---------- */
button.view-tab { border: 0; background: transparent; cursor: pointer; font: inherit; font-weight: 700; font-size: 14px; }
button.view-tab:hover:not(.on) { color: var(--ink); }
.view3d-frame { margin: 0; width: 100%; max-width: 1100px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-sm); }
.view3d { cursor: grab; touch-action: none; user-select: none; border-radius: var(--r-lg) var(--r-lg) 0 0; background: radial-gradient(ellipse at 50% 85%, color-mix(in srgb, var(--accent) 6%, var(--surface)) 0, var(--surface) 70%); }
.view3d.dragging { cursor: grabbing; }
.view3d-frame.has-backdrop { background-position: center 72%; background-size: cover; border: 0; overflow: hidden; }
.view3d-frame.has-backdrop .view3d { background: transparent; }
.view3d-frame.has-backdrop .view3d-tools { background: rgba(255, 255, 255, .92); border-top: 0; }
.view3d svg { display: block; }
.view3d-tools { display: flex; justify-content: center; gap: var(--s2); padding: var(--s2); border-top: 1px solid var(--line); }
.house-controls { display: flex; flex-direction: column; gap: var(--s4); margin-top: var(--s4); }
.inline-tools { display: flex; gap: var(--s2); flex-wrap: wrap; }
.size-head { display: flex; justify-content: space-between; align-items: baseline; }
.size-head label { margin: 0 0 6px; }
.size-out { font-weight: 700; }
.parts-box { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s2) var(--s3) var(--s3); }
.parts-box summary { cursor: pointer; font-weight: 700; padding: var(--s1) 0; }
.part-field { margin: var(--s2) 0 0; }
.part-field label { margin-bottom: 4px; }

/* ---------- T20: looks and levels ---------- */
.seg-wrap { display: flex; flex-wrap: wrap; width: 100%; }
.seg-wrap button { flex: 1 1 auto; min-height: 36px; padding: 6px 10px; font-size: 13px; border-bottom: 1px solid var(--line); margin-bottom: -1px; }
.look-level { margin: 0 0 var(--s3); gap: var(--s3); grid-template-columns: 1fr; } /* stacked: "Like the village (Spring / Easter)" needs the full width */
.field.compact { margin: 0; }
.field.compact label { margin-bottom: 4px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; }

/* ---------- T21: project tabs and the Extras screen ---------- */
.project-tabs { display: inline-flex; gap: 2px; margin-left: var(--s3); padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.project-tab { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; color: var(--muted); font-weight: 700; font-size: 14px; text-decoration: none; }
.project-tab:hover { color: var(--ink); }
.project-tab[aria-current=page] { background: var(--btn-bg); color: var(--btn-ink); }
.extra-group { display: flex; flex-direction: column; gap: var(--s2); }
.extra-group .eyebrow { margin: var(--s2) 0 0; }
.extra-row .row-main { cursor: pointer; }
.extra-row .row-main input { width: 18px; height: 18px; accent-color: var(--btn-bg); flex: none; }
.extra-tools { align-items: center; justify-content: flex-start; gap: var(--s1); }
.count-out { min-width: 24px; text-align: center; font-weight: 700; }
.input-sm { min-height: 32px; padding: 4px 8px; font-size: 13px; width: auto; flex: 1; min-width: 0; margin-left: var(--s2); }
.char-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); margin-top: var(--s3); }
.char-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: var(--s2) var(--s1); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); cursor: pointer; margin: 0; text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--ink); font-weight: 600; text-align: center; position: relative; }
.char-tile.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.char-tile input { position: absolute; top: 6px; left: 6px; accent-color: var(--btn-bg); }
.char-tile img { width: 100%; height: 64px; object-fit: contain; }
.char-tile:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.extra-row .row-main { margin: 0; font-size: 15px; font-weight: 400; color: var(--ink); text-transform: none; letter-spacing: 0; } /* a row is a <label>: undo the form-label style */

/* ---------- dollhouse editor (T22) ---------- */
.room-row .row-main { border-radius: var(--r-md); }
.room-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: var(--r-sm); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--ink); }
.stand-row { display: flex; flex-wrap: wrap; gap: var(--s3); width: 100%; max-width: 760px; }
.stand-frame { width: 150px; }
.stand-frame figcaption { font-size: 12px; }
.furn-list { list-style: none; margin: 0 0 var(--s3); padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.furn-row { display: flex; align-items: center; gap: var(--s2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 6px var(--s2); background: var(--surface); }
.furn-row input { width: 18px; height: 18px; accent-color: var(--btn-bg); flex: none; }
.furn-row label { display: flex; align-items: center; gap: var(--s2); flex: 1; margin: 0; cursor: pointer; font-size: 14px; font-weight: 400; color: var(--ink); text-transform: none; letter-spacing: 0; }
.furn-row img { width: 40px; height: 40px; object-fit: contain; flex: none; }
.furn-row:has(input:not(:checked)) img { opacity: .4; }
.room-frame { width: auto; max-width: 100%; }
.room-frame svg { width: auto; height: calc(100dvh - 300px); min-height: 280px; max-width: 100%; }

/* ---------- check panel (T23) ---------- */
.check-page { max-width: 900px; }
.check-summary { display: flex; flex-direction: column; gap: var(--s2); margin-bottom: var(--s4); }
.check-summary .alert { margin: 0; font-weight: 600; }
.check-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); }
.check-actions .hint { margin: 0; }
.check-filter { display: inline-flex; align-items: center; gap: var(--s2); margin: 0 0 var(--s3); font-size: 14px; font-weight: 400; color: var(--ink); text-transform: none; letter-spacing: 0; cursor: pointer; }
.check-filter input { width: 18px; height: 18px; accent-color: var(--btn-bg); }
.check-list { list-style: none; margin: 0 0 var(--s4); padding: 0; display: flex; flex-direction: column; gap: var(--s3); }
.check-group.has-err { border-left: 4px solid var(--err-ink); }
.check-group.has-warn { border-left: 4px solid #c8890a; }
.check-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s3); }
.check-head h2 { margin: 0; font-size: 18px; }
.check-head .meta { margin: 2px 0 0; }
.check-chip { display: inline-flex; align-items: center; gap: 4px; flex: none; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.check-chip.ok { background: var(--ok-bg); color: var(--ok-ink); }
.check-chip.err { background: var(--err-bg); color: var(--err-ink); }
.check-chip.warn { background: color-mix(in srgb, #e0a21f 16%, var(--surface)); color: #6a4a00; }
.check-issues { list-style: none; margin: var(--s3) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.check-issues li { display: flex; gap: var(--s2); align-items: flex-start; font-size: 14px; }
.check-issues li svg { flex: none; margin-top: 2px; }
.check-issues li.err { color: var(--err-ink); }
.check-issues li.warn { color: #6a4a00; }
.check-fix { margin-top: var(--s3); }
.check-group, .check-summary { min-height: 0; }

/* ---------- export screen (T24) ---------- */
.export-choices, .export-results { min-height: 0; margin-bottom: var(--s4); gap: var(--s3); }
.export-opts, .export-houses, .export-files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.export-opt { display: flex; gap: var(--s2); align-items: flex-start; border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s2) var(--s3); }
.export-opt input, .export-houses input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--btn-bg); flex: none; }
.export-opt label { display: flex; flex-direction: column; margin: 0; cursor: pointer; font-size: 15px; font-weight: 400; color: var(--ink); text-transform: none; letter-spacing: 0; }
.export-opt small { color: var(--muted); }
.export-opt:has(.opt-pic) { align-items: center; }
.opt-pic { flex: none; margin-left: auto; width: 128px; height: 84px; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.opt-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 560px) { .opt-pic { width: 84px; height: 60px; } }
.export-gifs summary { cursor: pointer; font-weight: 700; }
.export-houses { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin-top: var(--s2); }
.export-houses li { display: flex; gap: var(--s2); align-items: center; }
.export-houses label { margin: 0; font-size: 14px; font-weight: 400; color: var(--ink); text-transform: none; letter-spacing: 0; cursor: pointer; }
.export-results h2 { margin: 0; font-size: 20px; }
.export-group .eyebrow { margin: 0 0 var(--s2); }
.export-file { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 6px var(--s2); }
.export-file-name { display: flex; align-items: center; gap: var(--s2); min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.export-file-name small { color: var(--muted); white-space: nowrap; }
.progress[hidden], .alert[hidden] { display: none; }

/* ---------- help, bonuses, upgrades (T25) ---------- */
.help-page, .bonuses-page { max-width: 900px; }
.help-toc { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin: 0 0 var(--s4); }
.help-block { min-height: 0; margin-bottom: var(--s3); }
.help-block h2 { display: flex; align-items: center; gap: var(--s2); margin: 0; font-size: 20px; }
.help-block ol, .help-block ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.help-block p { margin: 0; }
.help-block .btn { align-self: flex-start; }
.upgrade-icon svg { display: block; }
.bonus-card { min-height: 0; }

/* ---------- OTO1 Pro: colours, Shuffle ×50 (T27) ---------- */
.color-toggle[aria-pressed=true] { background: var(--btn-bg); color: var(--btn-ink); }
.swatches { display: flex; gap: 4px; margin-top: var(--s2); }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); }
.color-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); margin-top: var(--s2); }
.color-field { display: flex; align-items: center; gap: var(--s2); margin: 0; font-size: 13px; font-weight: 400; color: var(--ink); text-transform: none; letter-spacing: 0; cursor: pointer; }
.color-field input { width: 34px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: var(--r-sm); background: none; flex: none; }
.locked-link { color: var(--muted); }
.locked-opt { align-items: center; color: var(--muted); }
.locked-opt span { display: flex; flex-direction: column; }
.colors-block .locked-box { margin: 0; }

/* ---------- OTO3 client folders (T30) ---------- */
.clients-bar { display: flex; flex-direction: column; gap: var(--s2); margin: 0 0 var(--s4); padding: var(--s3); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.clients-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); }
.clients-head .eyebrow { margin: 0; display: inline-flex; align-items: center; gap: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 14px; cursor: pointer; }
.chip[aria-pressed=true] { background: var(--btn-bg); color: var(--btn-ink); border-color: var(--btn-bg); }
.chip-n { font-size: 12px; opacity: .8; }
.client-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); color: var(--muted); font-size: 14px; }
.client-logo { height: 32px; max-width: 120px; object-fit: contain; }
.client-badge { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 13px; font-weight: 700; color: var(--accent); }
.logo-preview { display: flex; align-items: center; min-height: 48px; color: var(--muted); font-size: 14px; }
.logo-preview img { max-height: 64px; max-width: 200px; object-fit: contain; }
.agency-licence { border-left: 3px solid var(--accent); padding-left: var(--s3); display: flex; flex-direction: column; gap: 6px; }

/* ---------- OTO4 KDP book (T31) ---------- */
.kdp-block { display: flex; flex-direction: column; gap: var(--s2); }
.kdp-opts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); padding-left: var(--s4); }
.kdp-opts select.input { flex: none; width: auto; max-width: 100%; margin-left: 0; }
.kdp-opts label { margin: 0; font-size: 13px; text-transform: none; letter-spacing: 0; }
.kdp-pair { display: inline-flex; align-items: center; gap: var(--s2); max-width: 100%; }
.kdp-info { padding-left: var(--s4); margin: 0; }

/* ---------- OTO4 Max block (T32) ---------- */
.max-block { display: flex; flex-direction: column; gap: var(--s3); border-top: 1px dashed var(--line); padding-top: var(--s3); }
.max-block > .eyebrow { margin: 0; }
.kdp-opts.max-col { flex-direction: column; align-items: stretch; }
.max-ticks { width: 100%; margin-top: 0 !important; }
.max-ticks li { display: flex; align-items: center; gap: 6px; }

/* ---------- OTO5 Traffic Kit: Sell (T33) ---------- */
.sell-nav { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s3); }
.sell-nav .chip[aria-current="page"] { background: var(--btn-bg); color: var(--btn-ink); border-color: var(--btn-bg); }
.sell-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.sell-item { display: flex; gap: var(--s3); align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s2) var(--s3); }
.sell-text { margin: 2px 0 0; }
.sell-desc { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s2) var(--s3); margin-bottom: var(--s2); }
.sell-desc summary { cursor: pointer; font-weight: 700; }
.sell-pre { white-space: pre-wrap; font-family: inherit; font-size: 14px; background: var(--surface); padding: var(--s3); border-radius: var(--r-sm); }
.tag-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s3); margin: var(--s3) 0; }
.tag-group { display: flex; flex-direction: column; gap: 4px; }
.tag-group .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag-list { display: flex; flex-direction: column; gap: 6px; padding-left: 1.6em; }
.tag-list li { display: flex; align-items: center; gap: var(--s2); }
.tag-list .input { flex: 1; margin: 0; max-width: 360px; }
.tag-list .count { min-width: 2.5em; color: var(--muted); }
.tag-list .count.over { color: var(--err-ink); font-weight: 700; }
.pin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s3); margin: var(--s3) 0; }
.pin-card { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s2); }
.pin-card img { width: 100%; height: auto; aspect-ratio: 2 / 3; background: var(--surface); border-radius: var(--r-sm); }
.pin-card .input { margin: 0; width: 100%; }
.cal-wrap { max-height: none; }
table.calendar td { white-space: normal; }
table.calendar tr.now th, table.calendar tr.now td { background: var(--surface); font-weight: 600; }
.check-group { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s3); margin-bottom: var(--s3); }
.check-item { display: flex; gap: var(--s2); align-items: flex-start; margin: 6px 0; text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 15px; color: var(--ink); }
.md ul.tasks { list-style: none; padding-left: 0; }
.md table { border-collapse: collapse; width: 100%; font-size: 14px; }
.md th, .md td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }

/* ---------- Bonuses (T38) ---------- */
.read-wide { max-width: 980px; }
.bonus-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.bonus-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); }
.bonus-card:hover { border-color: var(--btn-bg); }
.bonus-card h3 { margin: 0; }
.bonus-formats { margin-top: auto; color: var(--muted); font-size: 13px; }
.bonus-body { margin-top: var(--s4); }
.bonus-body .md h2 { margin-top: var(--s5); }
.bonus-body .table-wrap { max-height: none; }
.bonus-body table.data td { white-space: normal; vertical-align: top; }
.bonus-body table.data td:empty::after { content: "\00a0"; } /* fill-in rows keep their height on screen */
.swatch { display: inline-block; width: 26px; height: 18px; border: 1px solid var(--ink); border-radius: 3px; vertical-align: middle; margin-right: 4px; }
.hex { font-size: 12px; color: var(--muted); }
.copy-block { border: 1px solid var(--line); border-left: 4px solid var(--btn-bg); border-radius: var(--r-md); padding: var(--s3); margin: var(--s3) 0; background: var(--surface); }
.copy-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); margin-bottom: 6px; }
.copy-head .eyebrow { margin: 0; }
.copy-text { margin: 0; white-space: pre-wrap; }
.bonus-licence { margin-top: var(--s5); }

/* usertest 2026-11-25: on a phone the 5 project tabs no longer widen the page: they take their own row in the top bar
   and scroll sideways inside it */
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; }
  .topbar .project-tabs { order: 10; flex: 1 0 100%; margin-left: 0; max-width: 100%; overflow-x: auto; scrollbar-width: none; border-radius: 14px; }
  .topbar .project-tab { flex: none; padding: 6px 12px; }
}
/* dollhouse library ×2 (2026-11-28): wallpaper / floor swatches and the furniture library */
.pat-swatch-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.pat-swatch { padding: 0; border: 2px solid var(--line); border-radius: var(--r-sm); background: #fff; height: 40px; min-height: 40px; width: 100%; overflow: hidden; cursor: pointer; }
.pat-swatch svg { display: block; width: 100%; height: 100%; }
.pat-swatch[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.lib-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.lib-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); cursor: pointer; font: inherit; color: var(--ink); }
.lib-item:hover { border-color: var(--accent); }
.lib-item img { width: 100%; height: 44px; object-fit: contain; }
.lib-item small { font-size: 11px; line-height: 1.2; text-align: center; }
