/* Plan job (street side, floors, scale, walls, openings, stack), under the .cb root.
   Tokens come from composer_benchmark_tokens.css and shared classes from composer_benchmark.css; .cb-preview below
   stands in for the shared classes in Lookbook only. */

.cb-plan [hidden], .cb-plan-minimap[hidden] { display: none !important; }

/* Stage: the plan on a dark lightbox. It fills the canvas, whatever the panel says, so the view never jumps */
.cb-plan-stage { position: relative; flex: 1; min-height: 0; background: var(--lightbox); overflow: hidden; }
.cb-plan-svg { position: absolute; inset: 12px; width: calc(100% - 24px); height: calc(100% - 24px); display: block; background: #ffffff; border-radius: 4px; cursor: crosshair; touch-action: none; user-select: none; -webkit-user-select: none; }
.cb-plan-minimap { position: absolute; right: 24px; bottom: 24px; width: 150px; height: auto; background: #ffffff; border-radius: 6px; border: 2px solid #ffffff; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35); pointer-events: none; }
.cb-plan-toolbar { flex: none; min-height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border-bottom: 1px solid var(--line); background: var(--page); white-space: nowrap; overflow-x: auto; }
.cb-plan-info { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; font-size: 0.72rem; color: var(--muted); cursor: help; }
.cb-plan-zoom { display: inline-flex; gap: 4px; }
.cb-plan-panel-body { display: flex; flex-direction: column; gap: 14px; }
.cb-plan-error { color: var(--warn); }
.cb-plan-face { display: block; margin-top: 6px; max-width: 300px; }
.cb-plan-prompt { display: flex; flex-direction: column; gap: 8px; }
.cb-plan-prompt p { margin: 0; }
.cb-plan-stack svg { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; border-radius: 4px; }

.cb-plan .stepper { display: flex; gap: 4px; flex-wrap: wrap; }
.cb-plan .stepper button { border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 99px; padding: 3px 10px; font-size: 0.76rem; cursor: pointer; }
.cb-plan .stepper button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.cb-plan .stepper button.ok::before, .cb-plan .stepper button.is-done::before { content: "✓ "; color: var(--good); }
.cb-plan .stepper button[aria-pressed="true"].ok::before, .cb-plan .stepper button[aria-pressed="true"].is-done::before { color: var(--paper); }
.cb-plan .stepper button.is-muted { opacity: 0.5; }
.cb-plan .field { display: flex; flex-direction: column; gap: 5px; font-size: 0.82rem; font-weight: 500; }
.cb-plan .field input, .cb-plan .field select { font: inherit; font-weight: 400; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--paper); color: var(--ink); }
.cb-plan .kinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.cb-plan .kinds:has(.cb-plan-tag-hint) { grid-template-columns: minmax(0, 1fr); }
.cb-plan .olist { display: flex; flex-direction: column; font-size: 0.82rem; max-height: 200px; overflow: auto; }
.cb-plan .olist div { display: grid; grid-template-columns: 14px 1fr auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.cb-plan .cb-gable-row { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.cb-plan .cb-gable-owner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cb-plan .cb-gable-owner .chipbtn { padding: 4px 10px; font-size: 0.78rem; }
.cb-plan .olist .x { border: 0; background: none; color: var(--muted); cursor: pointer; }
.cb-plan .readout { font-family: var(--mono); font-size: 0.8rem; background: var(--sunk); border-radius: 8px; padding: 8px 12px; }
.cb-plan .sw { width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.2); display: inline-block; }
.cb-plan .selrow { background: var(--accent-soft); border-radius: 6px; }
.cb-plan .linkrow { border: 0; background: none; text-align: left; cursor: pointer; padding: 0; font: inherit; color: inherit; }
.cb-plan .linkrow:hover { text-decoration: underline; }
.cb-plan .boxed { margin-left: auto; font-size: 0.72rem; color: var(--good); font-weight: 600; }
.cb-plan-sw-window { background: #2c5f8d; }
.cb-plan-sw-door { background: #b5482d; }
.cb-plan-sw-french { background: #2f7a5a; }
.cb-plan-sw-bay { background: #a87508; }
.cb-plan-sw-garage { background: #5f6b7a; }
.cb-plan-sw-gable { background: #7a3fa0; }
.cb-plan .cb-plan-front { margin: 0; }
.cb-plan .cb-plan-front img { display: block; width: 100%; max-height: 220px; object-fit: contain; border-radius: 10px; background: var(--sunk); }
@media (max-width: 760px) { .cb-plan .kinds { grid-template-columns: minmax(0, 1fr); } }

/* Projections */
.cb-plan-question { margin: 0; font-weight: 600; }
.cb-plan-tag-hint { display: block; font-size: 0.72rem; font-weight: 400; color: var(--muted); }
.cb-plan-sw-projection { background: var(--gold); }
.cb-plan .olist .cb-plan-outside { color: var(--warn); font-weight: 600; }

/* Plan job host: step list and save state */
.cb-plan-job { display: flex; flex-direction: column; gap: 14px; }
.cb-plan-job-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.cb-plan-job-bar .stepper { margin-right: auto; }
.cb-plan-job .saved { display: inline-flex; align-items: center; gap: 6px; font-size: 0.74rem; color: var(--muted); }
.cb-plan-job .dotsave { width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.cb-plan-job .saved.saving .dotsave { background: var(--gold); }
.cb-plan-job .saved.failed { color: var(--warn); font-weight: 600; }
.cb-plan-job .saved.failed .dotsave { background: var(--warn); }

/* Lookbook only: the shared classes, until composer_benchmark.css is on the page */
.cb-preview { background: var(--page); color: var(--ink); font-family: var(--body); font-size: 14px; line-height: 1.5; padding: 16px; }
.cb-preview *, .cb-preview *::before, .cb-preview *::after { box-sizing: border-box; }
.cb-preview button { font: inherit; color: inherit; }
.cb-preview kbd { font-family: var(--mono); font-size: 0.68rem; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: var(--paper); color: var(--muted); }
.cb-preview .work { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.cb-preview .canvas { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 14px; min-width: 0; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.cb-preview .panel { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; box-shadow: var(--shadow); }
.cb-preview .panel h2 { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.015em; margin: 0; line-height: 1.15; }
.cb-preview .sub { color: var(--muted); font-size: 0.88rem; margin: 0; }
.cb-preview .small { font-size: 0.75rem; color: var(--muted); margin: 0; }
.cb-preview .hint { font-size: 0.82rem; color: var(--muted); background: var(--sunk); border-radius: 10px; padding: 9px 12px; margin: 0; }
.cb-preview .hint b { color: var(--ink); font-weight: 600; }
.cb-preview .keys { font-size: 0.74rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.cb-preview .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cb-preview .opts { display: flex; flex-direction: column; gap: 6px; }
.cb-preview .btn { border: 1px solid var(--line-strong); background: var(--paper); padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 0.85rem; }
.cb-preview .btn:hover { background: var(--sunk); }
.cb-preview .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.cb-preview .btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.cb-preview .btn:disabled { opacity: 0.4; cursor: not-allowed; }
.cb-preview .small-btn { padding: 4px 10px; font-size: 0.8rem; }
.cb-preview .opt { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 10px 12px; cursor: pointer; font-size: 0.9rem; }
.cb-preview .opt:hover { border-color: var(--line-strong); background: var(--sunk); }
.cb-preview .opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; box-shadow: inset 0 0 0 1px var(--accent); }
.cb-preview .opt .k { font-family: var(--mono); font-size: 0.68rem; color: var(--muted); min-width: 16px; text-align: center; border: 1px solid var(--line); border-radius: 4px; }
.cb-preview .banner { padding: 10px 14px; border-radius: 10px; font-size: 0.86rem; }
.cb-preview .banner.warn { background: var(--warn-soft); }
.cb-preview .linkbtn { border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; font-size: 0.85rem; }
.cb-preview .toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--muted); cursor: pointer; }
@media (max-width: 1100px) { .cb-preview .work { grid-template-columns: minmax(0, 1fr); } }
.cb-plan-firstfloor-key { display: inline-block; width: 1.4em; border-top: 2px dashed #2c7be5; vertical-align: middle; }
