:root {
  --paper: #E4E7E2;
  --panel: #F7F8F5;
  --ink: #1D2124;
  --muted: #646D6B;
  --line: #C9CEC7;
  --mark: #F2C230;
  --danger: #C2402F;
  color-scheme: light;
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
button:disabled { opacity: .45; cursor: not-allowed; }
html, body { margin: 0; height: 100%; }
body { background: var(--paper); font-size: 14px; line-height: 1.4; display: flex; flex-direction: column; height: 100vh; }
button, input, select { font: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Top bar */
.topbar { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--ink); color: #F7F8F5; flex: none; }
.brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.brand svg { flex: none; }
.brand input { background: transparent; border: 0; border-bottom: 1px solid transparent; color: inherit; font-weight: 600; font-size: 17px; letter-spacing: -0.01em; width: 100%; max-width: 340px; min-width: 0; padding: 4px 0; }
.brand input:focus { outline: none; border-bottom-color: var(--mark); }
.seg { display: inline-flex; border: 1px solid #4A5055; border-radius: 6px; overflow: hidden; flex: none; }
.seg button { background: transparent; color: #C9CFCB; border: 0; padding: 6px 13px; cursor: pointer; }
.seg button + button { border-left: 1px solid #4A5055; }
.seg button[aria-pressed="true"] { background: var(--mark); color: var(--ink); font-weight: 600; }
.seg button:focus-visible { outline-color: var(--mark); outline-offset: -3px; }
.actions { display: flex; gap: 8px; flex: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--ink); border-radius: 6px; background: var(--ink); color: #fff; cursor: pointer; font-weight: 500; font-size: 13px; }
.btn.light { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.light:hover { border-color: var(--ink); }
.btn.ghost { background: transparent; color: #F7F8F5; border-color: #4A5055; }
.btn.ghost:hover { border-color: #F7F8F5; }
.btn.danger { background: #fff; color: var(--danger); border-color: #E3B8B1; }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; }

/* Layout */
.layout { flex: 1; display: grid; grid-template-columns: 290px minmax(0, 1fr) 310px; min-height: 0; }
.panel { background: var(--panel); overflow-y: auto; padding: 16px; border-right: 1px solid var(--line); }
.panel.right { border-right: 0; border-left: 1px solid var(--line); }
section + section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
h2 { font-size: 15px; font-weight: 650; margin: 0 0 10px; letter-spacing: -0.01em; }
h3 { font-size: 13px; font-weight: 600; margin: 18px 0 8px; color: var(--muted); }
.note, .empty { color: var(--muted); font-size: 12.5px; margin: 8px 0 0; }

/* Rooms list */
.rooms { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 4px; }
.rooms button { width: 100%; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; text-align: left; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 4px; padding: 8px 10px; cursor: pointer; color: var(--ink); }
.rooms button small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.rooms button[aria-current="true"] { border-left-color: var(--mark); font-weight: 600; border-color: var(--ink); border-left-color: var(--mark); }

/* Fields */
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.field input, .field select { color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; width: 100%; font-size: 14px; min-width: 0; }
.field input:focus, .field select:focus { border-color: var(--ink); outline: none; }
.row2, .row3 { display: grid; gap: 8px; margin-top: 8px; }
.row2 { grid-template-columns: repeat(2, 1fr); }
.row3 { grid-template-columns: repeat(3, 1fr); }
input[type="color"] { width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 4px; background: none; cursor: pointer; flex: none; }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 3px; }
input[type="color"]::-moz-color-swatch { border: 0; border-radius: 3px; }

.wallrow { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 4px; border-radius: 6px; border: 1px solid transparent; cursor: pointer; }
.wallrow small { color: var(--muted); }
.wallrow code { font-family: inherit; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.wallrow.on { border-color: var(--mark); background: #FFF8DF; }
.target { display: flex; align-items: center; gap: 8px; margin: 10px 0 8px; font-size: 12.5px; color: var(--muted); }
.target select { flex: 1; border: 1px solid var(--line); border-radius: 4px; padding: 5px 6px; background: #fff; color: var(--ink); }

.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.sw { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 3px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 12px; cursor: pointer; color: var(--ink); }
.sw i { width: 18px; height: 18px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); }
.sw:hover { border-color: var(--ink); }

.openings { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 4px; }
.openings button { width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 7px 10px; cursor: pointer; color: var(--ink); }
.openings button.on { border-color: var(--mark); background: #FFF8DF; }

/* Library */
.lib-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.lib-grid button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 7px 9px; cursor: pointer; color: var(--ink); font-size: 13px; }
.lib-grid button small { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.lib-grid button:hover { border-color: var(--ink); }

/* Stage */
.stage { display: grid; grid-template-columns: 1fr 1fr; min-height: 0; gap: 1px; background: var(--line); }
.stage[data-view="plan"], .stage[data-view="3d"] { grid-template-columns: 1fr; }
.stage[data-view="plan"] .three, .stage[data-view="3d"] .plan { display: none; }
.pane { position: relative; background: var(--paper); min-height: 0; overflow: hidden; }
#plan { width: 100%; height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; }
#three { position: absolute; inset: 0; }
#three canvas { display: block; }
#three .empty { padding: 24px; }
.pane-hint { position: absolute; left: 12px; bottom: 8px; right: 12px; margin: 0; font-size: 12px; color: var(--muted); pointer-events: none; }

/* Plan drawing */
#plan text { font-family: inherit; pointer-events: none; }
#plan .wall { stroke: var(--ink); stroke-width: 1; vector-effect: non-scaling-stroke; cursor: pointer; }
#plan .wall.target { stroke: var(--mark); stroke-width: 4; }
#plan .item { cursor: grab; }
#plan .item.dragging { cursor: grabbing; }
#plan .body, #plan .detail { stroke: var(--ink); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
#plan .detail { fill: rgba(255,255,255,.35); }
#plan .item.clash .body { stroke: var(--danger); stroke-width: 2.2; stroke-dasharray: 5 3; }
#plan .sel-outline { fill: none; stroke: var(--mark); stroke-width: 3.5; vector-effect: non-scaling-stroke; }
#plan .dim { stroke: var(--muted); stroke-width: 1; vector-effect: non-scaling-stroke; }
#plan .opening { cursor: pointer; }
#plan .opening .line { fill: none; stroke: var(--ink); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
#plan .opening .glass { fill: #D6E7F0; stroke: var(--ink); stroke-width: 1.2; vector-effect: non-scaling-stroke; }

.status { flex: none; display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 6px 16px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); background: var(--panel); }
.status .warn { color: var(--danger); font-weight: 500; }

/* Bookshelf builder */
.bookshelf-builder { flex: 1; overflow-y: auto; min-height: 0; padding: 22px; }
.bs-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.bs-heading h1 { font-size: 28px; margin: 3px 0; letter-spacing: -.04em; }
.bs-eyebrow { margin: 0; font-size: 10px; letter-spacing: .14em; color: var(--muted); font-weight: 600; }
.bs-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; border-bottom: 1px solid var(--line); }
.bs-tabs [role="tab"] { padding: 10px 16px; border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0; background: var(--panel); color: var(--ink); cursor: pointer; font: inherit; }
.bs-tabs [aria-selected="true"] { background: #FFF3C8; box-shadow: inset 0 -3px var(--mark); font-weight: 700; }
.bs-tabs [role="tab"]:focus-visible { outline: 3px solid #80610b; outline-offset: 2px; }
.bs-reference { line-height: 1.5; }
.bs-layout { display: grid; grid-template-columns: 300px minmax(320px, 1fr) 270px; gap: 18px; align-items: start; }
.bs-controls, .bs-output { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.bs-controls h2:not(:first-child), .bs-output h3 { margin-top: 24px; }
.bs-controls > .field + .field { margin-top: 10px; }
.bs-presets, .bs-save-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.bs-save-actions .btn { flex: 1 1 100%; }
.bs-preview { min-width: 0; position: sticky; top: 0; }
.bs-preview-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.bs-preview-head h2 { margin: 0; }
#bs3d { height: 350px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #E8E9E4; }
#bs3d canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.bs-drawing { margin-top: 15px; padding: 10px; background: #FAF8F3; border: 1px solid var(--line); border-radius: 10px; }
.bs-drawing svg { display: block; width: 100%; max-height: 320px; touch-action: none; }
.bs-drawing [data-bs-board] { cursor: pointer; }
.bs-drawing [data-bs-board^="D"] { cursor: ew-resize; }
.bs-level { display: flex; width: 100%; gap: 8px; justify-content: space-between; padding: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; font-size: 12px; }
.bs-level + .bs-level { border-top: 0; }
.bs-level.active { background: #FFF3C8; box-shadow: inset 3px 0 var(--mark); }
.bs-divider { display: flex; align-items: end; gap: 8px; margin: 8px 0; }
.bs-divider .field { flex: 1; }
#bsRowEditor > .btn { margin-top: 10px; }
.bs-table-wrap { overflow-x: auto; max-height: 360px; overflow-y: auto; margin: 12px 0; }
.bs-cut { border-collapse: collapse; width: 100%; font-size: 12px; font-variant-numeric: tabular-nums; }
.bs-cut td, .bs-cut th { padding: 7px 4px; border-bottom: 1px solid var(--line); text-align: left; }
.bs-cut th { position: sticky; top: 0; background: var(--panel); }
.bs-error, .bs-warning { border-radius: 6px; padding: 12px; margin-top: 12px; font-size: 12px; }
.bs-error { color: #8D2C20; background: #FCEBE5; }
.bs-warning { color: #68521D; background: #FFF3CF; }
.bs-error ul, .bs-warning ul { padding-left: 18px; margin: 6px 0 0; }
.bs-ok { font-size: 12px; color: #365D42; margin: 12px 0; }
.bs-edit-feedback { color: var(--danger); }
@media (max-width: 1200px) { .bs-layout { grid-template-columns: 280px minmax(300px, 1fr); } .bs-output { grid-column: 1 / -1; } .bs-save-actions .btn { flex: 1 1 180px; } .bs-preview { position: static; } }
@media (max-width: 700px) { .bookshelf-builder { padding: 14px; overflow: visible; } .bs-layout { grid-template-columns: minmax(0, 1fr); } .bs-preview { grid-row: 1; } .bs-output { grid-column: auto; } #bs3d { height: 300px; } .bs-heading h1 { font-size: 23px; } }

@media (max-width: 900px) {
  body { height: auto; min-height: 100vh; }
  .topbar { flex-wrap: wrap; gap: 10px; }
  .brand { flex-basis: 100%; }
  .layout { grid-template-columns: 1fr; }
  .stage { order: 1; height: 62vh; }
  .stage[data-view="both"] { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; height: 92vh; }
  .panel.right { order: 2; border-left: 0; border-top: 1px solid var(--line); }
  .panel.left { order: 3; border-right: 0; border-top: 1px solid var(--line); }
  .panel { overflow: visible; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- v2 additions ---------- */
.btn.small { padding: 5px 10px; font-size: 12.5px; }
.btn.mark { background: var(--mark); color: var(--ink); border-color: var(--mark); font-weight: 600; flex: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btnrow.end { justify-content: flex-end; }
.room-switch { background: #2B3034; color: #F7F8F5; border: 1px solid #4A5055; border-radius: 6px; padding: 6px 8px; max-width: 220px; flex: none; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.sec-head h2 { margin: 0; }
.level { font-size: 12px; font-weight: 600; color: var(--muted); margin: 12px 0 6px; }
.level:first-child { margin-top: 0; }
.rooms button span:first-child { display: flex; flex-direction: column; }
.rooms .meta { font-weight: 400; color: var(--muted); font-size: 11.5px; }
textarea { font: inherit; font-size: 14px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 7px 8px; width: 100%; resize: vertical; min-height: 70px; }
textarea:focus { border-color: var(--ink); outline: none; }

.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin: 0 0 12px; }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 6px 10px 7px; cursor: pointer; color: var(--muted); font-size: 13px; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--mark); font-weight: 600; }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.thumb { aspect-ratio: 1; border: 1px solid var(--line); border-radius: 4px; background: #fff; padding: 0; overflow: hidden; cursor: pointer; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.add { border-style: dashed; color: var(--muted); font-size: 12px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 4px; }
.thumb.add:hover { border-color: var(--ink); color: var(--ink); }
.thumb.missing { background: repeating-linear-gradient(45deg, #eee, #eee 4px, #f7f7f7 4px, #f7f7f7 8px); }

.pieces { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.piece { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 6px; }
.piece .pic { width: 44px; height: 44px; border-radius: 3px; overflow: hidden; background: var(--c, #ddd); box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.piece .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.piece .txt { min-width: 0; }
.piece .txt b { display: block; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.piece .txt small { color: var(--muted); font-size: 11.5px; }
.piece .acts { display: flex; gap: 4px; }
.badge { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); margin-left: 4px; }
.badge.want { border-color: #E5C765; color: #7A5B00; background: #FFF6D6; }

.versions { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 4px; }
.versions li { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; font-size: 13px; }
.versions li span { flex: 1; min-width: 0; }
.versions small { display: block; color: var(--muted); font-size: 11.5px; }
.version-add { display: flex; gap: 6px; }
.version-add input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; font-size: 14px; }

.pane-tools { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; }
.pane-tools .btn[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

dialog { border: 0; border-radius: 10px; padding: 0; width: min(560px, calc(100% - 24px)); color: var(--ink); background: var(--panel); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(29,33,36,.55); }
.modal-inner { padding: 20px; max-height: 88vh; overflow-y: auto; }
.modal-inner h2 { font-size: 18px; margin-bottom: 4px; }
.modal-inner > .field, .modal-inner > .row2, .modal-inner > .row3 { margin-top: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.modal-actions .spacer { flex: 1; }
.lightbox { width: min(900px, calc(100% - 24px)); }
.lightbox img { display: block; max-width: 100%; max-height: 72vh; margin: 0 auto 12px; border-radius: 4px; }
.toast { position: fixed; left: 50%; bottom: 44px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 6px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 10; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; }
#plan .light-body { stroke: #9C7200; stroke-width: 1.5; vector-effect: non-scaling-stroke; fill-opacity: .9; }
#plan .light-x { stroke: #9C7200; stroke-width: 1.2; vector-effect: non-scaling-stroke; fill: none; }
.linked { display: flex; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 6px; margin-bottom: 10px; font-size: 12.5px; color: var(--muted); }
.linked img { width: 40px; height: 40px; object-fit: cover; border-radius: 3px; }

@media (max-width: 900px) {
  .room-switch { flex: 1; max-width: none; }
  .topbar .btn.mark { order: 3; }
}

/* Wall finish picker inside each wall row */
.wallrow span code { display: block; }
.wallrow select { max-width: 124px; border: 1px solid var(--line); border-radius: 4px; padding: 4px 5px; background: #fff; color: var(--ink); font: inherit; font-size: 12px; }
.check { display: flex; align-items: center; gap: 8px; margin: 10px 0 4px; font-size: 13px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--ink); }

/* Artwork picture picker in the inspector */
.art-pick { display: grid; gap: 8px; margin: 4px 0 10px; }
.art-pick img { width: 100%; max-height: 180px; object-fit: contain; background: var(--line, #e5e5e0); border-radius: 6px; }
.art-empty { display: block; padding: 18px 10px; text-align: center; font-size: 12.5px; color: var(--muted); border: 1px dashed var(--line); border-radius: 6px; }

/* 3D thumbnails of pieces */
.piece { grid-template-columns: 64px 1fr auto; }
.piece .pic { width: 64px; height: 48px; background: #F3F2EE; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.piece .pic .thumb3d { width: 100%; height: 100%; object-fit: contain; display: block; }
.thumb3d:not([src]) { visibility: hidden; }
.lib-grid button .thumb3d { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #F3F2EE; border-radius: 3px; margin-bottom: 4px; display: block; }
.ins-thumb { margin: -2px 0 10px; }
.ins-thumb .thumb3d.big { width: 100%; max-height: 150px; aspect-ratio: 4 / 3; object-fit: contain; background: #F3F2EE; border-radius: 6px; display: block; }

/* Photo labels */
.thumb { position: relative; }
.thumb .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 4px; font-size: 10px; line-height: 1.25; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.72)); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photos { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.lb-cap { width: 100%; margin: 10px 0 4px; border: 1px solid var(--line); border-radius: 4px; padding: 7px 9px; font: inherit; font-size: 14px; }

/* Door swing areas and window niches on the plan */
#plan .swing { stroke: rgba(190,60,40,.45); stroke-width: 1; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; pointer-events: none; }
#plan .niche { stroke: rgba(0,0,0,.35); stroke-width: 1; vector-effect: non-scaling-stroke; }

/* Saving in the top bar */
.save-state { font-size: 12.5px; color: #B9C2B8; display: inline-flex; align-items: center; gap: 6px; flex: none; }
.save-state::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #6FBF73; }
.save-state.busy::before { background: var(--mark); }
.save-state.bad { color: #F2A38F; } .save-state.bad::before { background: #E0604A; }
.btn.top { background: transparent; color: #F7F8F5; border: 1px solid #5A6066; flex: none; }
.btn.top:hover { border-color: #F7F8F5; }
.save-dlg { border: 0; border-radius: 10px; padding: 18px; width: min(460px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.save-dlg::backdrop { background: rgba(20,24,28,.45); }
.facts { margin: 4px 0 8px; padding-left: 18px; font-size: 13.5px; line-height: 1.6; }

/* Paint palette */
.paintchip { display: inline-flex; align-items: center; }
.paintchip .sw { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.paintx { border: 1px solid var(--line); border-left: 0; background: #fff; border-radius: 0 999px 999px 0; padding: 3px 8px; font-size: 13px; line-height: 18px; color: var(--muted, #777); cursor: pointer; }
.paintx:hover { color: var(--ink); border-color: var(--ink); }
.paintadd { display: grid; grid-template-columns: 40px 1fr; gap: 6px; margin-top: 10px; }
.paintadd input[type=color] { width: 40px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.paintadd #paintName, .paintadd #paintAdd { grid-column: 1 / -1; }
.paintadd input:not([type=color]) { min-width: 0; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 13px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; cursor: pointer; font: inherit; }

/* Favourites */
.fav { border: 0; background: none; cursor: pointer; font-size: 18px; line-height: 1; padding: 4px 5px; color: #B9B5AC; border-radius: 4px; }
.fav:hover { color: #C99D4A; background: rgba(0,0,0,.04); }
.fav.on { color: #D9A21E; }
.libcard { position: relative; display: flex; }
.libcard > button[data-lib] { flex: 1; min-width: 0; }
.libcard .fav { position: absolute; top: 4px; right: 4px; background: rgba(255,255,255,.85); }
.favs { background: #FBF7EC; border: 1px solid #EFE3C2; border-radius: 6px; padding: 2px 8px 8px; margin-bottom: 8px; }
.favs h3 { color: #8A6A1E; }
.picwrap { position: relative; }
.picwrap .fav { position: absolute; top: -6px; left: -6px; font-size: 15px; padding: 2px 3px; background: rgba(255,255,255,.9); box-shadow: 0 0 0 1px rgba(0,0,0,.08); }

/* Private design dialog */
.cloud-list { list-style: none; margin: 12px 0; padding: 0; }
.cloud-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid #d6dad5; }
#cloudStatus { min-height: 1.4em; }

.proposal-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.proposal-comparison figure { margin: 0; min-width: 0; }
.proposal-comparison svg { display: block; width: 100%; max-height: 180px; color: #76513d; border: 1px solid #d6dad5; }
.admin-shell { max-width: 680px; margin: 40px auto; padding: 0 20px; }
.admin-shell form { display: grid; gap: 12px; }
