/* ============================================================================
   B-LAYOUT (shell copied from BLANK CORE · CR Desk) — The Blank Company
   Brand: Lemon #FFFF00 · Black · White · Endless Mist · Outfit (same tokens as KEYCARD / B-PEOPLE).
   Look (Calvin 2026-09-18): soft, rounded, label-first. Sidebar, big number cards, short labels, chips and icons;
   anything longer than a label lives in a hover tip ([data-tip]).
   Shape rule, followed everywhere: cards 20px · tiles, cells and inputs 12-14px · chips, buttons, nav items = pill.
   One accent (lemon). Room colours are data, not accents: they are the leasing sheet's own legend.
   ============================================================================ */


@font-face { font-family: 'Outfit'; src: url('assets/fonts/outfit-variable-latin.woff2') format('woff2'); font-weight: 300 800; font-display: swap; }

:root {
  --accent: #FFFF00; --on-accent: #0B0B0C; --accent-edge: rgba(11, 11, 12, .16);
  --ink: #0B0B0C;

  /* semantic layer: pages use only these; dark mode swaps only these */
  --bg: #ECF0F1; --card: #FFFFFF; --sunken: #F3F6F6; --track: #E1E7E8; --line: #E3E9EA;
  --text-1: #0B0B0C; --text-2: #465053; --text-3: #667275;
  --inverse: #0B0B0C; --on-inverse: #FFFFFF; --on-inverse-2: #A9B3B5; --inverse-line: #2A2D2F;
  --bad: #C62828; --bad-bg: #FDECEC; --good: #1E7A3C; --good-bg: #E7F5EC; --info-bg: #E6F0FA;
  --shadow: 0 1px 2px rgba(18, 38, 43, .04), 0 14px 32px -22px rgba(18, 38, 43, .22);
  --shadow-pop: 0 2px 6px rgba(18, 38, 43, .08), 0 24px 48px -16px rgba(18, 38, 43, .28);

  /* room status = the leasing sheet's legend, so the board reads like the sheet the team knows */
  --st-vacant: #D9EAD3; --st-occupied: #F4CCCC; --st-booking: #FFF2CC; --st-hold: #D9D9D9; --st-reserved: #CFE2F3; --st-unknown: #F3F6F6;
  --st-vacant-k: #9CCB8B; --st-occupied-k: #E79C9C; --st-booking-k: #EFD36B; --st-hold-k: #B5B5B5; --st-unknown-k: #D5DDDF;

  --r-card: 20px; --r-tile: 14px; --r-ctl: 12px; --r-pill: 999px;
  --font-sans: 'Outfit', 'Noto Sans SC', 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --caps: 0.08em;
  --side-w: 268px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
:root[data-theme='dark'] {
  --accent-edge: transparent;
  --bg: #0A0A0B; --card: #151617; --sunken: #1D1F20; --track: #2A2D2F; --line: #26292B;
  --text-1: #F3F5F5; --text-2: #B4BDBF; --text-3: #8E999C;
  --inverse: #232627; --inverse-line: #35393B;
  --bad: #FF8A80; --bad-bg: #3A1616; --good: #7BD69A; --good-bg: #12301D; --info-bg: #14283A;
  --shadow: none; --shadow-pop: 0 24px 48px -12px rgba(0, 0, 0, .7);
  --st-unknown: #1D1F20; --st-unknown-k: #3A3F41;
}

/* ---- base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: light; }
body { margin: 0; font: 15px/1.45 var(--font-sans); color: var(--text-1); background: var(--bg); min-height: 100dvh; overflow-wrap: anywhere; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--text-1); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 30px; font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; }
h2 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: var(--caps); color: var(--text-3); }
svg.ic { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; flex: none; }
.muted { color: var(--text-3); }
.mono { font-family: var(--mono); font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.clip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* ---- app shell: sidebar + main ------------------------------------------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100dvh; padding: 12px 0 12px 12px; z-index: 30; }
.side-in { height: 100%; display: flex; flex-direction: column; gap: 14px; padding: 18px 14px 14px; background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow); }
.brand-link { display: flex; align-items: center; gap: 10px; padding: 0 4px; }
.bmark { width: 36px; height: 36px; border-radius: var(--r-ctl); background: #0B0B0C; display: grid; place-items: center; flex: none; }
.brand { display: grid; line-height: 1.1; }
.brand b { font-size: 14px; font-weight: 800; letter-spacing: var(--caps); }
.brand small { font-size: 12px; color: var(--text-3); }
.side-profile { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r-tile); background: var(--sunken); min-height: 60px; }
.side-profile .who { display: grid; min-width: 0; line-height: 1.2; }
.side-profile .who b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-profile .who span { font-size: 12px; color: var(--text-3); }
.side-profile .tag { margin-left: auto; }
.side-scroll { flex: 1; min-height: 0; overflow: auto; margin: 0 -6px; padding: 0 6px; }
#nav { display: grid; gap: 2px; }
#nav h3 { padding: 14px 12px 6px; }
#nav a, #nav button { display: flex; align-items: center; gap: 12px; width: 100%; height: 44px; padding: 0 12px; border: 0; background: transparent; border-radius: var(--r-pill); font-size: 14px; font-weight: 600; color: var(--text-2); text-align: left; transition: background 140ms var(--ease), color 140ms var(--ease); }
#nav a:hover, #nav button:hover { background: var(--sunken); color: var(--text-1); }
#nav a:active, #nav button:active { transform: scale(.985); }
#nav a.active { background: var(--accent); color: var(--on-accent); box-shadow: inset 0 0 0 1px var(--accent-edge); }
#nav .nl { flex: 1; }
.badge { min-width: 24px; height: 22px; padding: 0 7px; border-radius: var(--r-pill); display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--sunken); color: var(--text-2); }
#nav a.active .badge { background: rgba(11, 11, 12, .12); color: var(--on-accent); }
.badge.hot { background: var(--bad-bg); color: var(--bad); }
.side-mini { display: none; gap: 6px; }

/* search (sidebar on desktop, top bar on phones) */
.search { position: relative; }
.search-ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; display: grid; }
.search-ic svg.ic { width: 16px; height: 16px; }
.search input { width: 100%; height: 42px; padding: 0 40px 0 38px; border: 1px solid transparent; border-radius: var(--r-pill); background: var(--sunken); color: var(--text-1); font-size: 14px; }
.search input::placeholder { color: var(--text-3); }
.search input:focus { outline: 0; border-color: var(--text-1); background: var(--card); }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 7px; border: 1px solid var(--line); display: grid; place-items: center; font: 600 12px var(--font-sans); color: var(--text-3); background: var(--card); pointer-events: none; }
.search input:focus + kbd { display: none; }
.search-results { position: absolute; top: 50px; left: 0; width: min(440px, calc(100vw - 24px)); max-height: 66vh; overflow: auto; padding: 6px; background: var(--card); border-radius: 16px; box-shadow: var(--shadow-pop); border: 1px solid var(--line); z-index: 50; }
.search-results a { display: flex; gap: 12px; align-items: center; padding: 9px 10px; border-radius: var(--r-ctl); }
.search-results a:hover, .search-results a.on { background: var(--sunken); }
.search-results .sr-t { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-results .sr-empty { padding: 14px; color: var(--text-3); font-size: 14px; }

.main { width: 100%; max-width: 1380px; margin: 0 auto; padding: 28px 32px 56px; display: grid; gap: 20px; align-content: start; min-width: 0; }
@media (prefers-reduced-motion: no-preference) {
  .main.enter > * { animation: rise 320ms var(--ease) both; }
  .main.enter > *:nth-child(2) { animation-delay: 40ms; } .main.enter > *:nth-child(3) { animation-delay: 80ms; } .main.enter > *:nth-child(n+4) { animation-delay: 120ms; }
  .main.enter .meter > i, .main.enter .hbar .track > i { animation: grow 600ms var(--ease) both; transform-origin: left; }
  .main.enter .vbar .col { animation: growUp 600ms var(--ease) both; transform-origin: bottom; }
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes growUp { from { transform: scaleY(0); } }

/* ---- page head ----------------------------------------------------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head .sub { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; color: var(--text-2); font-size: 14px; }
.ph-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumbs { font-size: 13px; color: var(--text-2); display: flex; gap: 4px; align-items: center; flex-wrap: wrap; margin-bottom: -8px; }
.crumbs a { padding: 2px 8px; border-radius: var(--r-pill); }
.crumbs a:hover { background: var(--card); color: var(--text-1); }
.crumbs svg.ic { width: 14px; height: 14px; color: var(--text-3); }
.crumbs span { padding: 2px 8px; color: var(--text-1); font-weight: 600; }

/* ---- layout helpers ------------------------------------------------------ */
.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.side { grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); align-items: start; }
.stack { display: grid; gap: 20px; align-content: start; min-width: 0; }
.stack.tight { gap: 10px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
@media (max-width: 1180px) { .grid.side { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) { .grid.two { grid-template-columns: minmax(0, 1fr); } }

/* ---- cards --------------------------------------------------------------- */
.card { background: var(--card); border-radius: var(--r-card); padding: 20px; display: grid; gap: 16px; align-content: start; min-width: 0; box-shadow: var(--shadow); }
.card.dark { background: var(--inverse); color: var(--on-inverse); box-shadow: none; }
.card.dark .muted, .card.dark h3, .card.dark .card-sub, .card.dark .fact .k { color: var(--on-inverse-2); }
.card.dark .chip.outline { border-color: var(--inverse-line); color: var(--on-inverse); }
.card.flat { box-shadow: none; background: transparent; padding: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.card-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.more { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--text-2); padding: 4px 10px; border-radius: var(--r-pill); }
.more:hover { background: var(--sunken); color: var(--text-1); }
.more svg.ic { width: 14px; height: 14px; }
.note-box { background: var(--sunken); border-radius: var(--r-tile); padding: 12px 14px; font-size: 14px; white-space: pre-wrap; }
.card.dark .note-box { background: rgba(255, 255, 255, .07); }
.empty { display: grid; justify-items: center; gap: 8px; padding: 28px 16px; text-align: center; color: var(--text-3); font-size: 14px; border: 1px dashed var(--line); border-radius: var(--r-tile); }
.empty .eic { width: 40px; height: 40px; border-radius: var(--r-ctl); background: var(--sunken); display: grid; place-items: center; color: var(--text-2); }
.info { display: inline-grid; place-items: center; width: 18px; height: 18px; color: var(--text-3); cursor: help; vertical-align: -3px; border: 0; background: transparent; padding: 0; }
.info svg.ic { width: 15px; height: 15px; }

/* ---- KPI cards: small label, very big number, a bar --------------------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { display: grid; grid-template-rows: auto 1fr auto auto; gap: 8px; min-height: 164px; padding: 20px; border-radius: var(--r-card); background: var(--card); box-shadow: var(--shadow); min-width: 0; transition: transform 160ms var(--ease); }
a.kpi:hover, button.kpi:hover { transform: translateY(-2px); }
a.kpi:active, button.kpi:active { transform: scale(.985); }
button.kpi { border: 0; text-align: left; font: inherit; color: inherit; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.kpi-ic { width: 34px; height: 34px; border-radius: 50%; background: var(--sunken); display: grid; place-items: center; color: var(--text-1); flex: none; }
.kpi-ic svg.ic { width: 16px; height: 16px; }
.kpi-val { font-size: 46px; font-weight: 800; line-height: 1; letter-spacing: -0.04em; align-self: end; }
.kpi-val small { font-size: 24px; font-weight: 700; margin-left: 2px; }
.kpi-val .of { font-size: 20px; font-weight: 600; color: var(--text-3); letter-spacing: -0.01em; margin-left: 2px; }
.kpi-cap { font-size: 12px; color: var(--text-3); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; min-height: 18px; }
.kpi.accent { background: var(--accent); color: var(--on-accent); box-shadow: inset 0 0 0 1px var(--accent-edge), var(--shadow); }
.kpi.accent .kpi-label, .kpi.accent .kpi-cap, .kpi.accent .kpi-val .of { color: rgba(11, 11, 12, .72); }
.kpi.accent .kpi-ic { background: rgba(11, 11, 12, .1); color: var(--on-accent); }
.kpi.accent .meter { background: rgba(11, 11, 12, .14); } .kpi.accent .meter > i { background: var(--on-accent); }
.kpi.on { box-shadow: inset 0 0 0 2px var(--text-1), var(--shadow); }
.kpi.sm { min-height: 112px; padding: 16px; } .kpi.sm .kpi-val { font-size: 32px; } .kpi.sm .kpi-val small { font-size: 18px; } .kpi.sm .kpi-ic { width: 30px; height: 30px; }
.meter { display: block; height: 6px; border-radius: var(--r-pill); background: var(--track); overflow: hidden; }
.meter > i { display: block; height: 100%; width: var(--w, 0%); border-radius: var(--r-pill); background: var(--text-1); }
.meter.bad > i { background: var(--bad); }
@media (max-width: 1180px) { .kpis, .kpis.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.tabbar { display: none; }
@media (max-width: 1024px) {
  .app { display: block; }
  .side { position: sticky; height: auto; padding: 8px 10px 0; }
  .side-in { flex-direction: row; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 18px; }
  .brand, .side-profile, .side-scroll, .search kbd { display: none; }
  .search { flex: 1; min-width: 0; }
  .search-results { width: auto; right: 0; }
  .side-mini { display: flex; }
  .main { padding: 18px 14px calc(96px + env(safe-area-inset-bottom, 0px)); gap: 16px; }
  /* one equal column per tab, however many there are (4 today): a fixed repeat(5) left an empty fifth column and pushed the tabs left */
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); padding: 6px; border-radius: 22px; background: #0B0B0C; color: #A9B3B5; z-index: 30; box-shadow: var(--shadow-pop); }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 7px 2px 5px; border-radius: 16px; font-size: 10px; font-weight: 600; }
  .tabbar a.active { background: var(--accent); color: var(--on-accent); }
  .tabbar .tic svg.ic { width: 20px; height: 20px; }
  .kpis, .kpis.three, .grid, .stack { gap: 14px; }
  .props { gap: 14px; }
  h1 { font-size: 25px; }
  .sheet { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 88dvh; }
}
@media (max-width: 560px) {
  .kpi { min-height: 138px; padding: 16px; } .kpi-val { font-size: 36px; } .kpi-val small { font-size: 18px; } .kpi-val .of { font-size: 15px; }
  .card { padding: 16px; }
  .hbar { grid-template-columns: minmax(80px, 120px) minmax(0, 1fr) 40px; } .hbar .x { display: none; }
  .vbars { gap: 4px; height: 170px; } .vbar .lbl { font-size: 10px; letter-spacing: 0; }
  .rowi { grid-template-columns: auto minmax(0, 1fr); } .rowi .end { grid-column: 2; justify-content: flex-start; }
  .tl { grid-template-columns: 46px 32px minmax(0, 1fr); } .tl::before { left: 71px; }
}

/* ============================================================================
   B-Layout additions (everything above this line is BLANK CORE's shell, copied verbatim)
   ============================================================================ */

/* ---- buttons, chips, tags -------------------------------------------------- */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: var(--inverse); color: var(--on-inverse); font-size: 14px; font-weight: 600; transition: transform 140ms var(--ease), background 140ms var(--ease); white-space: nowrap; }
.btn:hover { background: #232627; } .btn:active { transform: scale(.985); }
.btn.accent { background: var(--accent); color: var(--on-accent); box-shadow: inset 0 0 0 1px var(--accent-edge); } .btn.accent:hover { background: #F2F200; }
.btn.ghost { background: var(--sunken); color: var(--text-1); } .btn.ghost:hover { background: var(--track); }
.btn.small { height: 34px; padding: 0 12px; font-size: 13px; } .btn.icon { width: 40px; padding: 0; justify-content: center; } .btn.small.icon { width: 34px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--r-pill); background: var(--sunken); color: var(--text-2); font-size: 12px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.chip.room { background: var(--accent); color: var(--on-accent); box-shadow: inset 0 0 0 1px var(--accent-edge); }
.chip.outline { background: transparent; border: 1px solid var(--line); }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--r-pill); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: var(--caps); background: var(--sunken); color: var(--text-2); }
.tag.legacy { background: #EEE9DD; color: #6B5B2E; } .tag.draft { background: var(--info-bg); color: #1F4E79; } .tag.live { background: var(--good-bg); color: var(--good); }

/* ---- Library tiles ---------------------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.tile { display: grid; gap: 10px; padding: 12px; border-radius: var(--r-card); background: var(--card); box-shadow: var(--shadow); min-width: 0; transition: transform 160ms var(--ease); }
a.tile:hover { transform: translateY(-2px); }
.tile .thumb { aspect-ratio: 9 / 16; border-radius: var(--r-tile); background: var(--sunken); overflow: hidden; display: grid; place-items: center; color: var(--text-3); }
.tile .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .tt { display: grid; gap: 4px; min-width: 0; }
.tile .tt b { font-size: 15px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .tt small { color: var(--text-3); font-size: 12px; }
.tile .row { gap: 6px; }
.tile .chip { height: 22px; padding: 0 8px; font-size: 11px; }

/* ---- type page -------------------------------------------------------------- */
.card-frame { display: grid; place-items: center; padding: 20px; border-radius: var(--r-card); background: var(--sunken); }
.card-frame canvas, .card-frame img { width: min(100%, 450px); aspect-ratio: 1125 / 2000; height: auto; border-radius: 12px; box-shadow: var(--shadow-pop); background: #fff; display: block; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.fact { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--r-tile); background: var(--sunken); } .fact .k { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: var(--caps); color: var(--text-3); } .fact .v { font-size: 18px; font-weight: 700; }
.versions { display: grid; gap: 6px; } .versions .vrow { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-tile); background: var(--sunken); font-size: 13px; flex-wrap: wrap; } .versions .vrow b { font-weight: 700; } .versions .vrow .muted { margin-left: auto; }

/* ---- editor ----------------------------------------------------------------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.stepper { display: flex; gap: 6px; flex-wrap: wrap; }
.stepper button { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 6px; border: 0; border-radius: var(--r-pill); background: var(--card); color: var(--text-2); font-weight: 600; font-size: 14px; box-shadow: var(--shadow); }
.stepper button i { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--sunken); font-style: normal; font-size: 13px; font-weight: 700; }
.stepper button.on { background: var(--inverse); color: var(--on-inverse); } .stepper button.on i { background: var(--accent); color: var(--on-accent); }
.stepper button.done i { background: var(--good-bg); color: var(--good); } .stepper button.done i svg.ic { width: 14px; height: 14px; }
.stage { display: grid; place-items: center; min-height: 560px; padding: 20px; border-radius: var(--r-card); background: var(--card); box-shadow: var(--shadow); position: relative; }
.stage .drop { display: grid; justify-items: center; gap: 10px; padding: 40px; border: 2px dashed var(--track); border-radius: var(--r-card); color: var(--text-3); text-align: center; width: min(100%, 520px); }
.stage .drop b { color: var(--text-1); font-size: 16px; }
.stage .drop .eic { width: 48px; height: 48px; border-radius: var(--r-ctl); background: var(--sunken); display: grid; place-items: center; color: var(--text-2); }
.stage img.plan { max-width: 100%; max-height: 640px; border-radius: 12px; box-shadow: var(--shadow); display: block; }
.stage .plan-wrap { position: relative; display: inline-block; }
.stage .pchip { position: absolute; transform: translate(-50%, -50%); height: 34px; padding: 0 13px; border-radius: 10px; background: var(--accent); color: #000; font-weight: 700; font-size: 20px; display: inline-grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.18); cursor: grab; }
.stage .pchip.sm { height: 28px; font-size: 16px; padding: 0 11px; border-radius: 8px; }
.panel { display: grid; gap: 14px; padding: 20px; border-radius: var(--r-card); background: var(--card); box-shadow: var(--shadow); }
.panel h2 { display: flex; align-items: center; gap: 8px; }
.field { display: grid; gap: 6px; } .field label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: var(--caps); color: var(--text-3); }
.field input, .field select { height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--sunken); color: var(--text-1); font-size: 15px; width: 100%; }
.field input:focus, .field select:focus { outline: 0; border-color: var(--text-1); background: var(--card); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.room-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-tile); background: var(--sunken); }
.room-row select { height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); padding: 0 8px; font-weight: 700; }
.room-row small { color: var(--text-3); font-size: 12px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: var(--r-tile); background: var(--sunken); font-size: 14px; font-weight: 600; }
.switch input { width: 40px; height: 22px; margin: 0; appearance: none; border-radius: 999px; background: var(--track); position: relative; cursor: pointer; flex: none; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 140ms var(--ease); }
.switch input:checked { background: var(--accent); } .switch input:checked::after { transform: translateX(18px); }
.notice { display: grid; gap: 10px; justify-items: start; padding: 20px; border-radius: var(--r-card); background: var(--card); box-shadow: var(--shadow); }
.notice svg.ic { width: 28px; height: 28px; }
.preview-banner { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--r-pill); background: var(--inverse); color: var(--on-inverse); font-size: 13px; font-weight: 600; width: fit-content; max-width: 100%; flex-wrap: wrap; }
.preview-banner a { color: var(--accent); }
.preview-banner b { font-weight: 700; }

/* ---- phone tweaks ----------------------------------------------------------- */
@media (max-width: 1180px) { .editor { grid-template-columns: minmax(0, 1fr); } .kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .tile { padding: 8px; } .tile .tt b { font-size: 14px; }
  .kpis.three { gap: 8px; } .kpis.three .kpi { min-height: 96px; padding: 12px; gap: 4px; } .kpis.three .kpi-val { font-size: 28px; } .kpis.three .kpi-ic { display: none; } .kpis.three .kpi-label { font-size: 12px; }
  .card-frame { padding: 10px; }
  .page-head .ph-actions { width: 100%; } .ph-actions .btn { flex: 1 1 auto; justify-content: center; }
  .preview-banner { font-size: 12px; padding: 8px 12px; }
}
/* phone top bar: every tappable thing is at least 40px (the brand mark alone is 36, the role switch was 34) */
@media (max-width: 1024px) {
  .brand-link { min-height: 40px; }
  .side-mini .btn.small.icon { width: 40px; height: 40px; }
}

/* ---- sign-in gate (live mode) ------------------------------------------------- */
.gate .bmark { width: 44px; height: 44px; } .gate .bmark img { width: 26px; height: 26px; }
.gate h1 { font-size: 34px; }
.side-profile .btn.icon { margin-left: auto; flex: none; }

/* ---- legacy import ------------------------------------------------------------ */
.imp-table-wrap { max-height: 50vh; overflow: auto; border-radius: var(--r-tile); border: 1px solid var(--line); }
.imp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.imp-table th { position: sticky; top: 0; background: var(--sunken); text-align: left; padding: 8px 10px; font-size: 11px; text-transform: uppercase; letter-spacing: var(--caps); color: var(--text-3); z-index: 1; }
.imp-table td { padding: 6px 10px; border-top: 1px solid var(--line); vertical-align: middle; max-width: 280px; }
.imp-table tr.dup-skip td, .imp-table tr.not-card td, .imp-table tr.exists td { color: var(--text-3); }
.imp-table input.imp-name { width: 100%; min-width: 160px; height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); font-size: 13px; color: var(--text-1); }
.imp-table input[type=checkbox] { width: 18px; height: 18px; margin: 0; }
.progress { height: 8px; border-radius: var(--r-pill); background: var(--track); overflow: hidden; } .progress > i { display: block; height: 100%; background: var(--accent); transition: width 200ms var(--ease); }
.imp-log { max-height: 220px; overflow: auto; background: var(--sunken); border-radius: var(--r-tile); padding: 10px 12px; font-size: 12px; white-space: pre-wrap; margin: 0; }
label.btn input[type=file] { display: none; }

/* ---- editor: upload, crop frame, chips, nudge pad, toast -------------------- */
.stage.over .drop { border-color: var(--text-1); background: var(--sunken); }
.stage .ref { position: absolute; right: 16px; top: 16px; width: 110px; border-radius: 10px; box-shadow: var(--shadow-pop); background: #fff; }
.stage .ref img { width: 100%; display: block; border-radius: 10px; }
.stage .ref small { display: block; text-align: center; font-size: 10px; color: var(--text-3); padding: 2px 0 4px; }
.crop-stage { position: relative; display: inline-block; user-select: none; touch-action: none; }
.crop-stage canvas { display: block; max-width: 100%; max-height: 640px; border-radius: 12px; box-shadow: var(--shadow); }
.crop-shade { position: absolute; inset: 0; pointer-events: none; }
.crop-box { position: absolute; border: 2px solid var(--accent); box-shadow: 0 0 0 9999px rgba(11, 11, 12, .45); cursor: move; box-sizing: border-box; }
.crop-box .h { position: absolute; width: 14px; height: 14px; background: var(--accent); border: 2px solid #0B0B0C; border-radius: 4px; }
.crop-box .h.nw { left: -8px; top: -8px; cursor: nwse-resize; } .crop-box .h.ne { right: -8px; top: -8px; cursor: nesw-resize; }
.crop-box .h.sw { left: -8px; bottom: -8px; cursor: nesw-resize; } .crop-box .h.se { right: -8px; bottom: -8px; cursor: nwse-resize; }
.crop-box .h.n { left: calc(50% - 7px); top: -8px; cursor: ns-resize; } .crop-box .h.s { left: calc(50% - 7px); bottom: -8px; cursor: ns-resize; }
.crop-box .h.w { top: calc(50% - 7px); left: -8px; cursor: ew-resize; } .crop-box .h.e { top: calc(50% - 7px); right: -8px; cursor: ew-resize; }
.crop-size { position: absolute; left: 0; bottom: -26px; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.pdf-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; width: 100%; }
.pdf-page { display: grid; gap: 6px; justify-items: center; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-tile); background: var(--card); cursor: pointer; }
.pdf-page:hover { border-color: var(--text-1); } .pdf-page canvas { max-width: 100%; height: auto; box-shadow: var(--shadow); } .pdf-page span { font-size: 12px; font-weight: 600; }
.stage .plan-wrap { touch-action: none; user-select: none; cursor: crosshair; }
.stage .pchip.on { outline: 3px solid #0B0B0C; }
.stage .pchip.dragging { cursor: grabbing; box-shadow: 0 6px 16px rgba(0,0,0,.25); }
.room-row .size-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.room-row .size-toggle button { border: 0; background: var(--card); padding: 0 8px; height: 30px; font-size: 12px; font-weight: 700; cursor: pointer; color: var(--text-2); }
.room-row .size-toggle button.on { background: var(--inverse); color: var(--on-inverse); }
.room-row input.lbl { height: 30px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font-size: 12px; width: 100%; background: var(--card); }
.room-row .tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.nudge { display: grid; grid-template-columns: repeat(3, 40px); gap: 4px; justify-content: start; }
.nudge button { width: 40px; height: 40px; border: 0; border-radius: 10px; background: var(--sunken); font-weight: 700; cursor: pointer; display: grid; place-items: center; }
.nudge button:hover { background: var(--track); } .nudge button svg.ic { width: 16px; height: 16px; }
.btn.busy { pointer-events: none; opacity: .7; }
.stage canvas.plan { max-width: 100%; max-height: 640px; border-radius: 12px; box-shadow: var(--shadow); display: block; }
.samples { display: grid; gap: 8px; justify-items: center; margin-top: 6px; padding-top: 12px; border-top: 1px dashed var(--line); width: 100%; }
.look-stage { position: relative; display: inline-block; }
.look-busy { position: absolute; right: 10px; top: 10px; padding: 4px 10px; border-radius: var(--r-pill); background: var(--inverse); color: var(--on-inverse); font-size: 12px; font-weight: 600; }
.looks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.look { display: grid; gap: 6px; justify-items: center; padding: 6px 6px 8px; border: 1px solid var(--line); border-radius: var(--r-tile); background: var(--card); cursor: pointer; min-height: 40px; }
.look canvas { width: 100%; height: 86px; object-fit: contain; border-radius: 8px; background: #fff; }
.look span { font-size: 12px; font-weight: 700; color: var(--text-2); }
.look:hover { border-color: var(--text-3); }
.look.on { border-color: var(--text-1); box-shadow: inset 0 0 0 2px var(--accent); background: var(--sunken); } .look.on span { color: var(--text-1); }
.seg { display: inline-flex; padding: 3px; border-radius: var(--r-pill); background: var(--sunken); gap: 2px; }
.seg button { border: 0; background: transparent; height: 34px; padding: 0 14px; border-radius: var(--r-pill); font-weight: 600; font-size: 13px; color: var(--text-2); cursor: pointer; }
.seg button.on { background: var(--card); color: var(--text-1); box-shadow: var(--shadow); }
.bg-note { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.bg-note .sw { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line); flex: none; }
.bg-note input[type=color] { width: 44px; height: 32px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.field input[type=range] { height: auto; padding: 0; accent-color: #0B0B0C; background: transparent; border: 0; }
/* ---- tester fixes (2026-10-02) ------------------------------------------------- */
body.gated .search, body.gated #nav, body.gated .side-profile:empty, body.gated .tabbar { display: none; }
body.gated .main { padding-bottom: 28px; }
/* the crop shade stays inside the picture instead of greying out the whole page */
.crop-stage { overflow: hidden; border-radius: 12px; }
.crop-stage canvas, .look-stage canvas, .stage canvas.plan { max-height: max(360px, calc(100vh - 320px)); }
.crop-size { left: 6px; bottom: 6px; padding: 2px 8px; border-radius: var(--r-pill); background: rgba(11, 11, 12, .72); color: #fff; font-size: 12px; }
/* bigger invisible grab area around each handle (the square stays 14 px) */
.crop-box .h::before { content: ''; position: absolute; inset: -10px; }
.crop-box .h { z-index: 2; }
.card-preview { display: block; width: auto; height: auto; max-width: min(100%, 420px); max-height: max(420px, calc(100vh - 300px)); border-radius: 12px; box-shadow: var(--shadow-pop); background: #fff; }
.field input.invalid { border-color: var(--bad); background: var(--bad-bg); }
.ref-panel { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: var(--r-tile); background: var(--sunken); font-size: 12px; color: var(--text-2); }
.ref-panel img { width: 64px; border-radius: 6px; box-shadow: var(--shadow); }
.crop-warn { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: var(--r-tile); background: var(--bad-bg); color: var(--bad); font-size: 13px; font-weight: 600; }
.draft-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--r-tile); background: #FFFDE0; border: 1px solid #EDE58A; font-size: 14px; }
.draft-bar .row { margin-left: auto; }
.plain-list { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 13px; display: grid; gap: 4px; }
.search-results a.on { background: var(--sunken); }
/* room types (Settings) */
.type-row { flex-wrap: nowrap; min-height: 46px; }
.type-row .type-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.type-row .type-use { margin-left: 0 !important; white-space: nowrap; font-size: 12px; }
.type-row .btn.small.icon { width: 34px; height: 34px; flex: none; }
.type-row.off { opacity: .6; } .type-row.off .chip.room { background: var(--track); box-shadow: none; }
.type-rename { width: 100%; height: 32px; padding: 0 8px; border: 1px solid var(--text-1); border-radius: 8px; background: var(--card); font-size: 14px; color: var(--text-1); }
.type-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px; border-radius: var(--r-tile); background: #FFFDE0; border: 1px solid #EDE58A; }
.type-form[hidden] { display: none; }
.type-form input { height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--card); font-size: 16px; color: var(--text-1); min-width: 0; }
.type-form #type-code { width: 132px; text-transform: uppercase; font-weight: 700; letter-spacing: .04em; }
.type-form #type-name { flex: 1 1 180px; }
.type-form #type-code::placeholder { text-transform: none; font-weight: 400; letter-spacing: 0; }
.type-form .type-err { flex-basis: 100%; color: var(--bad); font-size: 12px; font-weight: 600; }
.type-form .type-err:empty { display: none; }
.types-off { margin-top: 4px; }
@media (max-width: 560px) { .type-row .type-use { display: none; } }
/* phones: every tap target at least 40 px (Calvin's mobile rule) */
@media (max-width: 1024px) { .type-row .btn.small.icon { width: 40px; height: 40px; } .type-row .btn.small, #type-add, .type-form .btn.small { height: 40px; } .type-form .btn.small.icon { width: 40px; } }
.hint { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-tile); background: #FFFDE0; border: 1px solid #EDE58A; font-size: 13px; color: var(--text-1); }
.hint svg.ic { flex: none; margin-top: 2px; }
.look-line { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-tile); background: var(--sunken); font-size: 13px; } .look-line .btn { margin-left: auto; }
#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(20px); padding: 10px 16px; border-radius: var(--r-pill); background: var(--inverse); color: var(--on-inverse); font-size: 14px; font-weight: 600; box-shadow: var(--shadow-pop); opacity: 0; transition: opacity 160ms var(--ease), transform 160ms var(--ease); z-index: 60; pointer-events: none; max-width: calc(100vw - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 1024px) { #toast { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); } }
/* ---- makers & permissions (Settings, 2026-10-02): tokens only ------------------------------------------ */
.settings-narrow { max-width: 760px; }
.tag svg.ic { width: 12px; height: 12px; margin-right: 4px; vertical-align: 0; }
.tag.lose { background: var(--bad-bg); color: var(--bad); }
.chip.dark { background: var(--inverse); color: var(--on-inverse); }
.mk-bar { position: sticky; top: 12px; z-index: 6; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 50px; padding: 6px 8px 6px 14px; border-radius: var(--r-tile); background: var(--sunken); font-size: 13px; color: var(--text-2); }
.mk-bar.dirty { background: var(--inverse); color: var(--on-inverse); box-shadow: var(--shadow-pop); }
.mk-bar .mk-state { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.mk-bar .mk-state > svg.ic { width: 16px; height: 16px; color: var(--good); }
.mk-bar .row { margin-left: auto; }
.mk-bar.dirty .btn.ghost { background: transparent; color: var(--on-inverse); box-shadow: inset 0 0 0 1px var(--inverse-line); }
.mk-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.15fr); gap: 20px; align-items: start; }
.mk-sec { display: grid; gap: 8px; align-content: start; min-width: 0; }
.mk-sec h3 { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-1); }
.mk-label { font-size: 11px; font-weight: 600; color: var(--text-3); margin-top: 4px; }
.mk-list { display: grid; gap: 6px; }
.mk-list:empty { display: none; }
.mk-group { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 12px; border-radius: var(--r-tile); background: var(--sunken); cursor: pointer; }
.mk-group:hover { box-shadow: inset 0 0 0 1px var(--track); }
.mk-group.changed { box-shadow: inset 0 0 0 2px var(--text-1); }
.mk-gt, .mk-pt { display: grid; flex: 1; min-width: 0; }
.mk-gt b, .mk-pt b { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-gt small, .mk-pt small { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 44px; height: 26px; margin: 0; border-radius: var(--r-pill); background: var(--track); background: color-mix(in srgb, var(--text-3) 42%, transparent); cursor: pointer; transition: background 140ms var(--ease); }
.sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform 160ms var(--ease); }
.sw:checked { background: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-edge); }
.sw:checked::after { transform: translateX(18px); background: var(--ink); }
.sw:focus-visible { outline: 2px solid var(--text-1); outline-offset: 2px; }
.mk-person, .mk-hit { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 10px; border-radius: var(--r-tile); background: var(--sunken); font-size: 13px; }
.mk-person.new { background: var(--good-bg); }
.mk-person.lose { background: var(--bad-bg); } .mk-person.lose b { text-decoration: line-through; }
.mk-hit { width: 100%; border: 1px dashed var(--line); background: var(--card); text-align: left; cursor: pointer; color: var(--text-1); font: inherit; }
.mk-hit:hover { background: var(--sunken); }
.mk-av { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--track); color: var(--text-2); font-size: 12px; font-weight: 700; }
.mk-av svg.ic { width: 16px; height: 16px; }
.mk-why { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; max-width: 60%; }
.mk-why .chip, .mk-why .tag { height: 22px; padding: 0 8px; font-size: 11px; }
.mk-who { max-height: 560px; overflow: auto; }
.mk-find { position: relative; }
.mk-find > svg.ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.mk-find input { width: 100%; height: 42px; padding: 0 12px 0 36px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--card); color: var(--text-1); font-size: 16px; }
.mk-empty { padding: 10px 12px; border: 1px dashed var(--line); border-radius: var(--r-tile); font-size: 13px; color: var(--text-3); }
.mk-you { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-tile); background: var(--sunken); font-size: 14px; }
.mk-foot { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; }
.mk-foot svg.ic { width: 15px; height: 15px; margin-top: 1px; }
@media (max-width: 1180px) { .mk-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .mk-cols .mk-sec:last-child { grid-column: 1 / -1; } }
@media (max-width: 900px) { .mk-cols { grid-template-columns: minmax(0, 1fr); } .mk-who { max-height: none; overflow: visible; } }
@media (max-width: 1024px) { .mk-bar { top: 76px; } .mk-person .btn.small.icon { width: 40px; height: 40px; } .mk-bar .btn.small { height: 40px; } }
@media (max-width: 560px) { .mk-person { flex-wrap: wrap; } .mk-why { max-width: none; flex-basis: 100%; justify-content: flex-start; padding-left: 42px; } .mk-person .btn.small.icon { margin-left: auto; } }
.mk .card-head { flex-wrap: wrap; } .mk .card-tools .tag { white-space: nowrap; }
/* ---- Library search / show / sort / view (2026-10-02): tokens only ------------------------------------- */
.lib-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.lib-search { position: relative; flex: 1 1 280px; min-width: 0; }
.lib-search > svg.ic { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.lib-search input { width: 100%; height: 44px; padding: 0 14px 0 40px; border: 1px solid transparent; border-radius: var(--r-pill); background: var(--card); box-shadow: var(--shadow); color: var(--text-1); font: inherit; font-size: 16px; }
.lib-search input:focus { outline: none; border-color: var(--text-1); }
.lib-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-pill); background: var(--card); box-shadow: var(--shadow); }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 12px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.seg button:hover { color: var(--text-1); background: var(--sunken); }
.seg button.on { background: var(--inverse); color: var(--on-inverse); }
.seg button .n { min-width: 20px; padding: 1px 6px; border-radius: var(--r-pill); background: var(--sunken); color: var(--text-2); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.seg button.on .n { background: var(--accent); color: var(--on-accent); }
.seg.icons button { width: 40px; padding: 0; }
.lib-sort { position: relative; display: inline-flex; align-items: center; }
.lib-sort > svg.ic { position: absolute; left: 13px; width: 16px; height: 16px; color: var(--text-2); pointer-events: none; }
.lib-sort::after { content: ''; position: absolute; right: 16px; top: 50%; width: 7px; height: 7px; margin-top: -6px; border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2); transform: rotate(45deg); pointer-events: none; }
.lib-sort select { height: 44px; padding: 0 38px 0 37px; border: 0; border-radius: var(--r-pill); background: var(--card); box-shadow: var(--shadow); color: var(--text-1); font: inherit; font-size: 13px; font-weight: 600; appearance: none; -webkit-appearance: none; cursor: pointer; }
.lib-count { display: flex; align-items: center; gap: 8px; min-height: 28px; margin-top: -6px; font-size: 13px; color: var(--text-3); }
.lrows { display: grid; gap: 8px; }
.lrow { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 8px 14px 8px 8px; border-radius: var(--r-tile); background: var(--card); box-shadow: var(--shadow); min-width: 0; }
.lrow:hover { box-shadow: var(--shadow-pop); }
.lthumb { flex: none; width: 40px; height: 72px; border-radius: 8px; overflow: hidden; background: var(--sunken); display: grid; place-items: center; color: var(--text-3); }
.lthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lthumb svg.ic { width: 16px; height: 16px; }
.lt { display: grid; gap: 2px; flex: 0 1 280px; min-width: 0; }
.lt b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt small { font-size: 12px; color: var(--text-3); }
.lchips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 0; }
.lchips .chip { height: 22px; padding: 0 8px; font-size: 11px; }
.lrow > svg.ic { margin-left: auto; color: var(--text-3); }
@media (max-width: 1024px) { .lib-tools { width: 100%; } .lib-sort { flex: 1; } .lib-sort select { width: 100%; } }
@media (max-width: 560px) {
  .lchips { display: none; } .lt { flex: 1; }
  #lib-show { order: -1; width: 100%; } #lib-show button { flex: 1; padding: 0 6px; }
}
.seg { flex: none; } .lib-sort { min-width: 0; }
@media (max-width: 1024px) { .seg button { height: 40px; } .seg.icons button { width: 42px; } }
/* ---- 2026-10-30: Tower box, chip resize handle, room-type drag order: tokens only -------------------------- */
.field label .opt { margin-left: 6px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--text-3); }
.type-preview { display: block; margin: -4px 0 2px; font-size: 12px; }
.type-preview:empty { display: none; }
.stage .pchip { line-height: 1; white-space: nowrap; box-sizing: border-box; }
.stage .pchip .rz { position: absolute; right: -7px; bottom: -7px; width: 14px; height: 14px; border-radius: 50%; background: var(--card); border: 2px solid var(--ink); cursor: nwse-resize; }
.stage .pchip .rz::before { content: ''; position: absolute; inset: -9px; }
.room-row .scale-pct { font-size: 12px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }
.room-row .scale-pct:empty { display: none; }
.type-row .grip { flex: none; display: grid; place-items: center; width: 28px; height: 34px; margin-left: -4px; border: 0; border-radius: 8px; background: transparent; color: var(--text-3); cursor: grab; touch-action: none; }
.type-row .grip:hover, .type-row .grip:focus-visible { background: var(--track); color: var(--text-1); }
.type-row .grip svg.ic { width: 16px; height: 16px; }
.type-row.dragging { position: relative; z-index: 2; background: var(--card); box-shadow: var(--shadow-pop); }
.type-row.dragging .grip { cursor: grabbing; }
@media (max-width: 1024px) { .type-row .grip { width: 40px; height: 40px; } }
/* ---- Mark step: Lines tool (2026-10-30): tokens only ------------------------------------------------------- */
.stage .plan-wrap .lines-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.stage .plan-wrap .lines-layer .hit { stroke: transparent; fill: none; }
.stage .plan-wrap .lines-layer .halo { stroke: var(--info-bg); stroke-opacity: .9; stroke-linecap: round; filter: drop-shadow(0 0 1px var(--ink)); }
.stage .plan-wrap .lines-layer .end { fill: var(--card); stroke: var(--ink); }
.stage .plan-wrap.tool-lines .lines-layer { pointer-events: auto; }
.stage .plan-wrap.tool-lines .lines-layer .hit { pointer-events: stroke; cursor: move; }
.stage .plan-wrap.tool-lines .lines-layer .end { cursor: grab; }
.stage .plan-wrap.tool-lines .pchip { pointer-events: none; opacity: .6; }
.tool-seg { display: flex; width: 100%; } .tool-seg button { flex: 1; }
.tool-seg button svg.ic { width: 16px; height: 16px; }
.lcolors { gap: 10px; }
.lsw { width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; flex: none; }
.lsw.on { outline: 3px solid var(--text-1); outline-offset: 2px; }
.lsw.small { width: 18px; height: 18px; cursor: default; }
.lcolors input[type=color] { width: 40px; height: 32px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); cursor: pointer; }
.line-row { cursor: pointer; } .line-row.on { box-shadow: inset 0 0 0 2px var(--text-1); }

/* 2026-10-30 — "Original photo" cards (no BLANK template, chips straight on the picture) + a save you can see */
.card-seg { display: flex; width: 100%; } .card-seg button { flex: 1; justify-content: center; }
.card-seg button, .chipc-seg button { display: inline-flex; align-items: center; gap: 6px; }
.card-seg button svg.ic { width: 15px; height: 15px; }
.csw { width: 14px; height: 14px; flex: none; border-radius: 4px; display: inline-block; box-shadow: inset 0 0 0 1px var(--line), 0 1px 2px rgba(0, 0, 0, .12); }
.csw.white { background: #FFFFFF; } .csw.yellow { background: var(--accent); }
.stage .pchip.white { background: #FFFFFF; color: #2B2B2B; }
.saving { cursor: progress; }
.saving .stepper, .saving .editor { pointer-events: none; }
.saving .editor .stage { opacity: .6; transition: opacity 200ms var(--ease); }
.btn .spin { width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn .spin { animation-duration: 1.6s; } }
.btn.busy[disabled] { opacity: 1; cursor: progress; }
.save-progress { display: grid; gap: 6px; }
.save-progress .bar { height: 6px; border-radius: var(--r-pill); background: var(--track); overflow: hidden; }
.save-progress .bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--text-1); transition: width 240ms var(--ease); }
.save-progress .txt { font-size: 13px; font-weight: 600; color: var(--text-2); }
.card-frame canvas, .card-frame img { aspect-ratio: auto 1125 / 2000; }
.card-frame.wide canvas { width: min(100%, 760px); }
.chip.room.white { background: #FFFFFF; color: #2B2B2B; box-shadow: inset 0 0 0 1px var(--line), 0 1px 3px rgba(0, 0, 0, .14); }
