/* Tokens live in tokens.css — the single design-token source for every layer. */

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #dfe4e0; color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
svg { display: block; }

.app-shell { height: 100dvh; min-height: 560px; display: grid; grid-template-rows: var(--topbar-h) 1fr; }
.topbar {
  display: grid;
  grid-template-columns: minmax(220px, auto) minmax(180px, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 0 14px 0 16px;
  background: var(--brand);
  color: white;
  box-shadow: 0 1px 0 rgba(255,255,255,.08), 0 5px 18px rgba(0,0,0,.15);
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 39px; height: 39px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--brand); }
.brand-mark svg { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.brand strong { display: block; font-size: calc(15px * var(--bs-font-scale, 1)); letter-spacing: .01em; }
.brand span { display: block; font-size: calc(10.5px * var(--bs-font-scale, 1)); color: rgba(255,255,255,.63); margin-top: 1px; }
.project-heading { min-width: 0; justify-self: center; text-align: center; }
.project-name-button { border: 0; color: white; background: transparent; padding: 3px 8px; border-radius: 7px; font-weight: 650; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-name-button:hover { background: rgba(255,255,255,.09); }
.chevron { opacity: .6; margin-left: 4px; }
.save-state { font-size: calc(10px * var(--bs-font-scale, 1)); color: rgba(255,255,255,.58); margin-top: 1px; }
.top-actions { display: flex; align-items: center; gap: 7px; min-width: 0; }

.button, .mini-button, .icon-button, .chip-toggle, .zoom-label {
  border: 1px solid var(--line);
  background: white;
  border-radius: 7px;
  min-height: 34px;
  transition: background .12s ease, border-color .12s ease, transform .06s ease;
}
.button:active, .mini-button:active, .icon-button:active, .chip-toggle:active { transform: translateY(1px); }
.button { padding: 0 13px; font-weight: 650; font-size: calc(12px * var(--bs-font-scale, 1)); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.button.primary:hover { filter: brightness(.96); }
.button.secondary { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.18); color: white; }
.button.secondary:hover { background: rgba(255,255,255,.15); }
.button.danger { background: #fff5f4; border-color: #e6bbb8; color: var(--danger); }
.button.full { width: 100%; }
.mini-button { min-height: 30px; padding: 0 9px; font-size: calc(11px * var(--bs-font-scale, 1)); font-weight: 650; }
.mini-button:hover, .icon-button:hover, .zoom-label:hover { background: #f1f3f1; }
.icon-button { width: 34px; height: 34px; min-height: 34px; padding: 0; display: grid; place-items: center; background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.18); color: white; font-weight: 800; }
.icon-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-button:hover { background: rgba(255,255,255,.16); }
.icon-button.compact { width: 28px; height: 28px; min-height: 28px; color: var(--ink); background: white; border-color: var(--line); font-size: calc(17px * var(--bs-font-scale, 1)); }
.scenario-control { display: flex; align-items: center; gap: 5px; padding: 3px; border-radius: 8px; background: rgba(255,255,255,.07); }
.scenario-control label { font-size: calc(10px * var(--bs-font-scale, 1)); color: rgba(255,255,255,.58); margin-left: 3px; }
.scenario-control select { height: 28px; max-width: 128px; border-radius: 5px; border: 0; background: #fff; font-size: calc(11px * var(--bs-font-scale, 1)); padding: 0 24px 0 7px; }
.scenario-control .mini-button { color: white; border-color: rgba(255,255,255,.17); background: rgba(255,255,255,.07); }
.scenario-control .mini-button:hover { background: rgba(255,255,255,.14); }

.workspace { min-height: 0; display: grid; grid-template-columns: var(--toolrail-w) var(--left-w) minmax(420px, 1fr) var(--right-w); overflow: hidden; }
.toolrail {
  background: #eef1ee;
  border-right: 1px solid var(--line);
  padding: 8px 6px 22px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.tool-button {
  width: 100%; min-height: 51px; border: 0; background: transparent; border-radius: 8px; color: #49534f;
  display: grid; place-items: center; gap: 2px; padding: 5px 2px; margin-bottom: 2px;
}
.tool-button:hover { background: #dfe5e1; color: var(--brand); }
.tool-button.active { background: var(--brand); color: white; box-shadow: 0 5px 10px rgba(24,55,47,.2); }
.tool-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.tool-button span { font-size: calc(9px * var(--bs-font-scale, 1)); font-weight: 650; line-height: 1; }
.tool-separator { height: 1px; background: #d6dbd7; margin: 7px 5px; }

.panel { background: var(--panel); min-width: 0; overflow: hidden; display: grid; grid-template-rows: 42px 1fr; }
.left-panel { border-right: 1px solid var(--line); }
.right-panel { border-left: 1px solid var(--line); }
.panel-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); background: #f3f5f3; padding: 0 7px; }
.panel-tab { flex: 1; border: 0; background: transparent; padding: 0 4px; font-size: calc(11px * var(--bs-font-scale, 1)); font-weight: 700; color: #747e79; position: relative; }
.panel-tab:hover { color: var(--ink); }
.panel-tab.active { color: var(--brand); }
.panel-tab.active::after { content: ""; position: absolute; left: 12%; right: 12%; bottom: -1px; height: 2px; background: var(--brand); border-radius: 2px 2px 0 0; }
.panel-content { min-height: 0; overflow: auto; padding: 13px; scrollbar-width: thin; }
.panel-section { margin-bottom: 18px; }
.panel-section:last-child { margin-bottom: 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.section-heading h2, .section-heading h3 { margin: 0; font-size: calc(12px * var(--bs-font-scale, 1)); letter-spacing: .02em; }
.section-heading .subtle { font-size: calc(10px * var(--bs-font-scale, 1)); }
.subtle { color: var(--muted); }
.eyebrow { font-size: calc(9px * var(--bs-font-scale, 1)); letter-spacing: .11em; text-transform: uppercase; font-weight: 800; color: #7b847f; }

.stage-wrap { min-width: 0; min-height: 0; display: grid; grid-template-rows: 42px 1fr var(--status-h); background: #ccd2ce; }
.stage-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 10px 0 14px; background: #f8f9f7; border-bottom: 1px solid var(--line); }
.tool-context { min-width: 0; display: flex; align-items: baseline; gap: 9px; }
.tool-context strong { font-size: calc(12px * var(--bs-font-scale, 1)); flex: none; }
.tool-context span { color: var(--muted); font-size: calc(10.5px * var(--bs-font-scale, 1)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view-controls { display: flex; align-items: center; gap: 5px; }
.chip-toggle { min-height: 26px; padding: 0 8px; font-size: calc(10px * var(--bs-font-scale, 1)); color: #5d6762; background: white; }
.chip-toggle.active { background: #e1eee8; border-color: #b9d3c7; color: var(--brand); }
.zoom-label { width: 52px; min-height: 28px; font-size: calc(10px * var(--bs-font-scale, 1)); font-weight: 650; }
.stage { min-width: 0; min-height: 0; position: relative; overflow: hidden; background: #ccd2ce; }
#designCanvas { width: 100%; height: 100%; background: #ccd2ce; touch-action: none; user-select: none; outline: none; cursor: default; }
#designCanvas.tool-pan { cursor: grab; }
#designCanvas.tool-pan.dragging { cursor: grabbing; }
#designCanvas.tool-crosshair { cursor: crosshair; }
#designCanvas.tool-place { cursor: copy; }
.canvas-empty { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); display: grid; gap: 5px; text-align: center; background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 24px 30px; pointer-events: none; }
.canvas-empty strong { font-size: calc(15px * var(--bs-font-scale, 1)); }
.canvas-empty span { font-size: calc(11px * var(--bs-font-scale, 1)); color: var(--muted); }
.coordinate-readout { position: absolute; right: 9px; bottom: 8px; background: rgba(24,34,31,.78); color: white; border-radius: 5px; font-size: calc(9px * var(--bs-font-scale, 1)); padding: 4px 7px; pointer-events: none; font-variant-numeric: tabular-nums; }
.draft-help { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); background: rgba(24,55,47,.94); color: white; border-radius: 7px; padding: 7px 10px; font-size: calc(10px * var(--bs-font-scale, 1)); box-shadow: var(--shadow); pointer-events: none; }
.statusbar { display: flex; align-items: center; gap: 18px; padding: 0 10px; background: #f7f8f6; border-top: 1px solid var(--line); font-size: calc(9.5px * var(--bs-font-scale, 1)); color: #59635e; overflow: hidden; }
.statusbar > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.statusbar .estimate-disclaimer { margin-left: auto; color: #85610f; }

.search-row { display: flex; gap: 6px; margin-bottom: 9px; }
.search-input, .field-input, .field-select, .field-textarea {
  width: 100%; border: 1px solid var(--line); background: white; border-radius: 7px; min-height: 34px; padding: 7px 9px; font-size: calc(11px * var(--bs-font-scale, 1)); outline: none;
}
.search-input:focus, .field-input:focus, .field-select:focus, .field-textarea:focus { border-color: #79a28f; box-shadow: 0 0 0 3px rgba(40,90,78,.1); }
.search-input { padding-left: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23727d77' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E"); background-size: 14px; background-repeat: no-repeat; background-position: 9px center; }
.segmented { display: flex; padding: 3px; gap: 3px; background: #e9ece9; border-radius: 8px; margin-bottom: 10px; }
.segmented button { flex: 1; border: 0; border-radius: 6px; padding: 6px 3px; font-size: calc(9.5px * var(--bs-font-scale, 1)); color: #69736e; background: transparent; }
.segmented button.active { background: white; color: var(--brand); font-weight: 750; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.catalog-grid { display: grid; grid-template-columns: 1fr; gap: 7px; }
.catalog-card { border: 1px solid var(--line); background: white; border-radius: 9px; padding: 8px; display: grid; grid-template-columns: 45px minmax(0,1fr) auto; gap: 8px; align-items: center; text-align: left; }
.catalog-card:hover { border-color: #a9beb4; box-shadow: 0 3px 9px rgba(24,55,47,.08); }
.catalog-card.selected { border-color: var(--brand-2); box-shadow: 0 0 0 2px rgba(40,90,78,.13); }
.asset-preview { width: 45px; height: 45px; border-radius: 8px; display: grid; place-items: center; overflow: hidden; background: #eef3ed; }
.asset-preview svg { width: 39px; height: 39px; }
.catalog-copy { min-width: 0; }
.catalog-copy strong { display: block; font-size: calc(11px * var(--bs-font-scale, 1)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.catalog-copy em { display: block; font-family: Georgia, serif; font-size: calc(9.5px * var(--bs-font-scale, 1)); color: #758079; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.catalog-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.tag { border-radius: 4px; padding: 2px 4px; font-size: calc(8px * var(--bs-font-scale, 1)); font-weight: 700; background: #edf1ee; color: #66706b; }
.catalog-price { font-size: calc(9px * var(--bs-font-scale, 1)); color: var(--muted); white-space: nowrap; text-align: right; }
.catalog-price strong { display: block; color: var(--ink); font-size: calc(10px * var(--bs-font-scale, 1)); }
.catalog-actions { grid-column: 2 / -1; display: flex; gap: 5px; margin-top: 2px; }
.catalog-actions button { flex: 1; }
.library-empty { padding: 22px 10px; text-align: center; color: var(--muted); font-size: calc(11px * var(--bs-font-scale, 1)); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.field { display: grid; gap: 4px; margin-bottom: 9px; }
.field.compact { margin-bottom: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: calc(9.5px * var(--bs-font-scale, 1)); font-weight: 700; color: #66706b; }
.field small { font-size: calc(8.5px * var(--bs-font-scale, 1)); color: var(--muted); }
.field-textarea { min-height: 65px; resize: vertical; }
.input-with-unit { display: grid; grid-template-columns: 1fr auto; }
.input-with-unit .field-input { border-radius: 7px 0 0 7px; }
.input-unit { display: grid; place-items: center; min-width: 34px; padding: 0 7px; border: 1px solid var(--line); border-left: 0; background: #edf0ed; border-radius: 0 7px 7px 0; font-size: calc(9px * var(--bs-font-scale, 1)); color: var(--muted); }
.checkbox-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid #e4e7e4; font-size: calc(10.5px * var(--bs-font-scale, 1)); }
.checkbox-row:last-child { border-bottom: 0; }
.switch { position: relative; width: 32px; height: 18px; flex: none; }
.switch input { opacity: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 18px; background: #b9c0bc; transition: .15s; }
.switch span::after { content: ""; position: absolute; width: 14px; height: 14px; left: 2px; top: 2px; background: white; border-radius: 50%; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: .15s; }
.switch input:checked + span { background: var(--brand-2); }
.switch input:checked + span::after { transform: translateX(14px); }
.button-row { display: flex; gap: 7px; }
.button-row > * { flex: 1; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }

.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; }
.metric-card { border: 1px solid var(--line); background: white; border-radius: 9px; padding: 9px; min-width: 0; }
.metric-card.featured { grid-column: 1 / -1; background: var(--brand); border-color: var(--brand); color: white; }
.metric-label { display: block; font-size: calc(8.5px * var(--bs-font-scale, 1)); text-transform: uppercase; letter-spacing: .07em; color: #7d8782; font-weight: 800; }
.metric-card.featured .metric-label { color: rgba(255,255,255,.64); }
.metric-value { display: block; margin-top: 3px; font-size: calc(16px * var(--bs-font-scale, 1)); font-weight: 780; line-height: 1.15; font-variant-numeric: tabular-nums; }
.metric-card.featured .metric-value { font-size: calc(22px * var(--bs-font-scale, 1)); }
.metric-detail { display: block; margin-top: 3px; font-size: calc(8.5px * var(--bs-font-scale, 1)); color: var(--muted); }
.metric-card.featured .metric-detail { color: rgba(255,255,255,.68); }
.progress { height: 7px; border-radius: 8px; overflow: hidden; background: #e5e8e5; margin-top: 8px; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--brand-2); width: 0; }
.progress.over > span { background: var(--danger); }
.breakdown-list { display: grid; gap: 6px; }
.breakdown-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; align-items: center; font-size: calc(10px * var(--bs-font-scale, 1)); }
.breakdown-bar { grid-column: 1 / -1; height: 4px; background: #e7eae7; border-radius: 4px; overflow: hidden; }
.breakdown-bar span { display: block; height: 100%; background: #6c9180; }
.data-table { width: 100%; border-collapse: collapse; font-size: calc(9px * var(--bs-font-scale, 1)); }
.data-table th { text-align: left; color: #747f79; font-weight: 800; border-bottom: 1px solid var(--line); padding: 6px 4px; }
.data-table td { border-bottom: 1px solid #e7eae7; padding: 6px 4px; vertical-align: top; }
.data-table td:last-child, .data-table th:last-child { text-align: right; }
.data-table tr:last-child td { border-bottom: 0; }
.empty-state { border: 1px dashed #c9cfcb; border-radius: 10px; padding: 18px 12px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; color: var(--ink); font-size: calc(12px * var(--bs-font-scale, 1)); margin-bottom: 4px; }
.empty-state span { font-size: calc(10px * var(--bs-font-scale, 1)); }

.selection-header { display: grid; grid-template-columns: 42px minmax(0,1fr); gap: 9px; align-items: center; margin-bottom: 13px; }
.selection-icon { width: 42px; height: 42px; border-radius: 9px; display: grid; place-items: center; background: #edf2ee; }
.selection-icon svg { width: 34px; height: 34px; }
.selection-header h2 { font-size: calc(13px * var(--bs-font-scale, 1)); margin: 0; }
.selection-header p { margin: 3px 0 0; font-size: calc(9px * var(--bs-font-scale, 1)); color: var(--muted); }
.inspector-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.inline-notice { padding: 8px 9px; border-radius: 7px; background: #fff8e6; color: #77580b; border: 1px solid #ead89d; font-size: calc(9px * var(--bs-font-scale, 1)); line-height: 1.4; }
.inline-notice.success { background: #edf8f1; border-color: #b8ddc5; color: #245e39; }
.inline-notice.info { background: #edf5f7; border-color: #c6dce1; color: #285b66; }

.idea-hero { background: linear-gradient(135deg, #18372f, #2e6556); color: white; border-radius: 11px; padding: 14px; margin-bottom: 12px; }
.idea-hero .eyebrow { color: rgba(255,255,255,.58); }
.idea-hero h2 { margin: 5px 0 5px; font-size: calc(15px * var(--bs-font-scale, 1)); }
.idea-hero p { margin: 0; font-size: calc(9.5px * var(--bs-font-scale, 1)); line-height: 1.5; color: rgba(255,255,255,.73); }
.idea-card { border: 1px solid var(--line); background: white; border-radius: 10px; padding: 10px; margin-bottom: 8px; }
.idea-card h3 { margin: 0; font-size: calc(11px * var(--bs-font-scale, 1)); }
.idea-card p { margin: 5px 0 8px; font-size: calc(9px * var(--bs-font-scale, 1)); color: var(--muted); line-height: 1.45; }
.idea-stats { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.idea-stat { padding: 3px 5px; border-radius: 5px; background: #edf1ee; font-size: calc(8px * var(--bs-font-scale, 1)); font-weight: 700; color: #5d6862; }
.goal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.goal-chip { position: relative; }
.goal-chip input { position: absolute; opacity: 0; }
.goal-chip span { min-height: 38px; border: 1px solid var(--line); border-radius: 8px; background: white; display: grid; place-items: center; padding: 5px; text-align: center; font-size: calc(9px * var(--bs-font-scale, 1)); font-weight: 650; }
.goal-chip input:checked + span { border-color: var(--brand-2); background: #e7f1ec; color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand-2); }

.layer-row { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; padding: 8px 3px; border-bottom: 1px solid #e5e8e5; }
.layer-row:last-child { border-bottom: 0; }
.layer-dot { width: 10px; height: 10px; border-radius: 3px; }
.layer-row strong { display: block; font-size: calc(10px * var(--bs-font-scale, 1)); }
.layer-row span { display: block; font-size: calc(8.5px * var(--bs-font-scale, 1)); color: var(--muted); margin-top: 1px; }
.layer-visibility { border: 0; background: transparent; width: 24px; height: 24px; display: grid; place-items: center; color: #5e6963; }
.layer-visibility svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.month-grid { display: grid; grid-template-columns: 1fr; gap: 6px; }
.month-card { border: 1px solid var(--line); border-radius: 8px; background: white; overflow: hidden; }
.month-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 8px; background: #f0f3f0; font-size: calc(9px * var(--bs-font-scale, 1)); font-weight: 800; }
.month-head span { color: var(--muted); font-weight: 600; }
.task-list { margin: 0; padding: 0; list-style: none; }
.task-item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; padding: 7px 8px; border-top: 1px solid #edf0ed; font-size: calc(9px * var(--bs-font-scale, 1)); }
.task-item small { color: var(--muted); display: block; margin-top: 2px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(9,20,16,.56); backdrop-filter: blur(3px); }
.modal { width: min(720px, 96vw); max-height: min(780px, 92vh); display: grid; grid-template-rows: auto 1fr auto; background: white; border-radius: 14px; box-shadow: 0 24px 80px rgba(0,0,0,.28); overflow: hidden; }
.modal.narrow { width: min(480px, 96vw); }
.modal.wide { width: min(960px, 96vw); }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; font-size: calc(16px * var(--bs-font-scale, 1)); }
.modal-header p { margin: 3px 0 0; font-size: calc(10px * var(--bs-font-scale, 1)); color: var(--muted); }
.modal-close { width: 30px; height: 30px; border: 0; border-radius: 7px; background: #edf0ed; font-size: calc(17px * var(--bs-font-scale, 1)); }
.modal-body { padding: 17px 18px; overflow: auto; }
.modal-footer { padding: 12px 18px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); background: #f8f9f7; }
.modal .button.secondary { color: var(--ink); background: white; border-color: var(--line); }
.modal .button.primary { color: var(--accent-ink); }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.scenario-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 10px; }
.scenario-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: white; }
.scenario-card.active { border-color: var(--brand-2); box-shadow: 0 0 0 2px rgba(40,90,78,.11); }
.scenario-card h3 { margin: 0 0 8px; font-size: calc(12px * var(--bs-font-scale, 1)); }
.scenario-card .metric-value { font-size: calc(18px * var(--bs-font-scale, 1)); }
.compare-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: calc(10px * var(--bs-font-scale, 1)); }
.compare-table th, .compare-table td { border: 1px solid var(--line); padding: 8px; text-align: right; }
.compare-table th:first-child, .compare-table td:first-child { text-align: left; }
.compare-table th { background: #f0f3f0; }
.export-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.export-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; text-align: left; background: white; }
.export-card:hover { border-color: #9eb7ab; box-shadow: 0 4px 12px rgba(24,55,47,.08); }
.export-card strong { display: block; font-size: calc(12px * var(--bs-font-scale, 1)); }
.export-card span { display: block; font-size: calc(9px * var(--bs-font-scale, 1)); line-height: 1.45; color: var(--muted); margin-top: 4px; }
.shortcut-list { display: grid; grid-template-columns: 1fr auto; gap: 7px 14px; font-size: calc(10px * var(--bs-font-scale, 1)); }
kbd { border: 1px solid #cdd2ce; border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px; background: #f5f6f4; font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; }

.toast-root { position: fixed; z-index: 200; right: 16px; bottom: 16px; display: grid; gap: 8px; pointer-events: none; }
.toast { min-width: 260px; max-width: 380px; padding: 10px 12px; border-radius: 9px; background: #17231f; color: white; box-shadow: var(--shadow); font-size: calc(10px * var(--bs-font-scale, 1)); line-height: 1.4; animation: toast-in .18s ease; }
.toast.success { background: #1f6945; }
.toast.warning { background: #8a5d10; }
.toast.error { background: #982f2b; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* SVG canvas object styling */
#designCanvas .sheet-shadow { fill: rgba(0,0,0,.12); }
#designCanvas .sheet { fill: #fff; stroke: #a8b0ab; stroke-width: .08; }
#designCanvas .grid-minor { stroke: #e5e9e6; stroke-width: .045; }
#designCanvas .grid-major { stroke: #ced6d1; stroke-width: .075; }
#designCanvas .ls-object { vector-effect: non-scaling-stroke; }
#designCanvas .ls-object:hover > .hit-highlight { opacity: .12; }
#designCanvas .selection-box { fill: none; stroke: #1269a8; stroke-width: 1.3px; vector-effect: non-scaling-stroke; stroke-dasharray: 5 3; pointer-events: none; }
#designCanvas .selection-handle { fill: white; stroke: #1269a8; stroke-width: 1.5px; vector-effect: non-scaling-stroke; cursor: nwse-resize; }
#designCanvas .selection-handle[data-handle="ne"], #designCanvas .selection-handle[data-handle="sw"] { cursor: nesw-resize; }
#designCanvas .selection-handle[data-handle="n"], #designCanvas .selection-handle[data-handle="s"] { cursor: ns-resize; }
#designCanvas .selection-handle[data-handle="e"], #designCanvas .selection-handle[data-handle="w"] { cursor: ew-resize; }
#designCanvas .selection-outline { stroke: #1269a8; stroke-width: 1.2px; vector-effect: non-scaling-stroke; stroke-dasharray: 4 3; pointer-events: none; opacity: .8; }
#designCanvas .vertex-handle { fill: white; stroke: #1269a8; stroke-width: 1.5px; vector-effect: non-scaling-stroke; cursor: grab; }
#designCanvas .vertex-handle:hover { fill: #d3ff82; stroke: #285a4e; }
#designCanvas .draft-shape { fill: none; stroke: #285a4e; stroke-width: 1.5px; vector-effect: non-scaling-stroke; stroke-dasharray: 5 4; pointer-events: none; }
#designCanvas polygon.draft-shape { fill: rgba(40,90,78,.12); }
#designCanvas .vertex { fill: white; stroke: #285a4e; stroke-width: 1.2px; vector-effect: non-scaling-stroke; pointer-events: none; }
#designCanvas .object-label { font-family: Inter, Arial, sans-serif; fill: #26322d; paint-order: stroke; stroke: rgba(255,255,255,.92); stroke-width: .45; stroke-linejoin: round; pointer-events: none; }
#designCanvas .annotation { vector-effect: non-scaling-stroke; }
#designCanvas .layer-hidden { display: none; }

@media (max-width: 1180px) {
  :root { --left-w: 260px; --right-w: 290px; }
  .brand span, .scenario-control label, #duplicateScenarioButton { display: none; }
  .topbar { gap: 8px; }
}
@media (max-width: 960px) {
  :root { --left-w: 245px; --right-w: 0px; }
  .right-panel { display: none; }
  .workspace { grid-template-columns: var(--toolrail-w) var(--left-w) minmax(380px,1fr); }
  .project-heading { display: none; }
  .topbar { grid-template-columns: auto 1fr; }
  .top-actions { justify-self: end; }
  #compareScenarioButton, #newProjectButton { display: none; }
}
@media print {
  html, body { overflow: visible; background: white; }
  .app-shell, .modal-backdrop, .toast-root { display: none !important; }
}

.canvas-empty[hidden], .draft-help[hidden] { display: none !important; }
.scenario-control select { color: var(--ink); }
