/* Oikos: a drafting table. Cool stone paper, graphite ink, one patina-green accent for what
   is active; the four mode tabs are the one thing that stands out. */
:root {
  --bg: #eceeec;
  --panel: #fbfcfb;
  --ink: #1d2a2f;
  --mute: #5d6b71;
  --faint: #93a0a4;
  --line: #d7dddb;
  --soft: #e3e8e6;
  --acc: #2b6a65;
  --acc-ink: #1f514d;
  --acc-soft: #dbe9e6;
  --ok: #2b6a65;
  --err: #a5402f;
  --sky: #dfe6ea;
  --font: "Avenir Next", "Segoe UI Variable Text", "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  /* aegis's host theme reads these; they are this page's palette, renamed. */
  --surface: var(--panel);
  --raised: #ffffff;
  --chrome: var(--soft);
  --side: var(--soft);
  --strong: var(--ink);
  --muted: var(--mute);
  --rule: var(--line);
  --accent: var(--acc);
  --accent-soft: var(--acc-soft);
  --on-accent: #fff;
  --err-bg: #f8ebe7;
  --warn: #a8742c;
  --comms: #3f6585;
  --add-bg: #e8f1ea;
  --del-bg: #f8ebe7;
  --h-kw: #7c5a2e;
  --h-str: #2b6a65;
  --h-num: #a8742c;
  --h-com: #93a0a4;
  --h-fn: #1d2a2f;
  --h-type: #3f6585;
  --h-var: #5d6b71;
  --h-meta: #93a0a4;
  --font-ui: var(--font);
  --font-prose: var(--font);
  --font-mono: var(--mono);
  --font-chrome: var(--font);
  --font-head: var(--font);
  --prose-size: 14px;
  --r: 8px;
  --r-lg: 12px;
  --time: none;
  --thread: block;
  --row-cols: 22px 1fr;
  --fill: var(--acc);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

/* icons: the vendored Lucide sprite, at the size of the text beside them */
.i { width: 16px; height: 16px; flex: none; stroke-width: 1.9; vertical-align: -3px; }

/* the top bar: the name, then the four modes */
.top { display: flex; align-items: center; gap: 20px; padding: 0 18px; height: 54px; background: var(--panel); border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 8px; font: 600 16px var(--font); letter-spacing: .01em; color: var(--ink); }
.logo svg { width: 20px; height: 20px; color: var(--acc); }
.modes { display: flex; gap: 2px; padding: 3px; background: var(--soft); border-radius: 11px; }
.modes button { display: flex; align-items: center; gap: 7px; border: 0; background: transparent; padding: 6px 13px; border-radius: 8px; font: 550 13px var(--font); color: var(--mute); cursor: pointer; transition: background .15s, color .15s; }
.modes button:hover { color: var(--ink); }
.modes button .i { color: var(--faint); transition: color .15s; }
.modes button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(29, 42, 47, .12), inset 0 -2px 0 var(--acc); }
.modes button.on .i { color: var(--acc); }
.who { margin-left: auto; font-size: 12px; color: var(--mute); }

main { height: calc(100% - 54px); }
.screen { height: 100%; overflow: auto; padding: 36px 26px 60px; }
.screen h1 { display: flex; align-items: center; gap: 10px; font: 600 24px var(--font); margin: 0; }
.screen h1 .i { width: 22px; height: 22px; color: var(--acc); }
.head { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 960px; margin: 0 auto 22px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.narrow { max-width: 420px; margin: 8vh auto 0; display: grid; gap: 12px; }
#start .narrow { margin: 0 auto 22px; }
.card h1 { margin: 0; }
.card label { font: 600 12px var(--font); color: var(--mute); }
input, textarea { font: 14px var(--font); color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%; }
input:focus, textarea:focus { outline: 3px solid var(--acc-soft); border-color: var(--acc); }

/* buttons: an icon and a label; primary is the accent, btn is quiet */
button.primary, button.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; border-radius: 9px; font: 600 13px var(--font); transition: background .15s, border-color .15s, color .15s; }
button.primary { color: #fff; background: var(--acc); border: 1px solid var(--acc); padding: 8px 16px; }
button.primary:hover { background: var(--acc-ink); }
button.primary:disabled { opacity: .6; cursor: progress; }
button.btn { color: var(--ink); background: var(--panel); border: 1px solid var(--line); padding: 7px 12px; font-size: 12.5px; }
button.btn:hover { border-color: var(--faint); }
button.btn .i { color: var(--mute); }
button.icon-btn { padding: 7px; }
button.icon-btn .lbl { display: inline; }
button.wide { width: 100%; padding: 11px 16px; font-size: 13.5px; }
.row { display: flex; align-items: center; gap: 10px; }
.muted { color: var(--mute); font-size: 12.5px; }
.error { color: var(--err); font-size: 13px; margin: 0; }

.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; max-width: 960px; margin: 0 auto; }
.project-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; display: grid; overflow: hidden; transition: border-color .15s; }
.project-card:hover { border-color: var(--acc); }
.project-card .open { all: unset; text-align: left; padding: 18px 18px 14px; cursor: pointer; display: grid; gap: 6px; }
.project-card .open:focus-visible { outline: 2px solid var(--acc); outline-offset: -2px; }
.project-card .nm { font: 600 15.5px var(--font); }
.project-card .meta { font-size: 12px; color: var(--mute); }
.project-card .copy { margin: 0 18px 16px; justify-self: start; }
.chip { display: inline-block; justify-self: start; font-size: 11px; color: var(--acc-ink); background: var(--acc-soft); border-radius: 999px; padding: 1px 9px; }

/* the project view: 3D left, panel right */
.project { display: grid; grid-template-columns: minmax(0, 1fr) 380px; height: 100%; }
.view { position: relative; overflow: hidden; background: var(--sky); min-height: 0; }
#canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#canvas:active { cursor: grabbing; }
/* The tracer's canvas stays transparent until a drawn image with real samples is on it, then
   fades in over the raster; a moving camera drops it at once. */
.trace-canvas { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; display: block; opacity: 0; pointer-events: none; }
.trace-canvas.on { opacity: 1; transition: opacity .45s ease; }
.viewbar { position: absolute; z-index: 3; top: 12px; left: 12px; right: 12px; display: flex; align-items: center; gap: 12px; padding: 6px 12px 6px 6px; background: rgba(251, 252, 251, .9); border: 1px solid var(--line); border-radius: 12px; backdrop-filter: blur(6px); font-size: 12.5px; }
.viewbar strong { font: 600 13.5px var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewbar .hint { margin-left: auto; font-size: 12px; color: var(--mute); }
.viewbar .btn { border-color: transparent; background: transparent; }
.viewbar .btn:hover { background: var(--soft); }
.cam { display: flex; gap: 2px; padding: 2px; border-radius: 9px; background: var(--soft); }
.cam button { display: flex; align-items: center; gap: 5px; border: 0; border-radius: 7px; padding: 4px 9px; background: transparent; font: 550 11.5px var(--font); color: var(--mute); cursor: pointer; }
.cam button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(29, 42, 47, .12); }
.cam button .i { width: 14px; height: 14px; }
.stick { position: absolute; z-index: 6; left: 20px; bottom: 84px; width: 112px; height: 112px; border-radius: 50%; background: rgba(251, 252, 251, .55); border: 1px solid rgba(29, 42, 47, .18); touch-action: none; backdrop-filter: blur(2px); }
.stick-knob { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: 0; transform: translate(-50%, -50%); border-radius: 50%; background: var(--acc); opacity: .85; box-shadow: 0 2px 8px rgba(29, 42, 47, .3); pointer-events: none; }


.viewbar a.btn { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }

/* the status line: what the scene and the tracer are doing, bottom left of the view */
.statusbar { position: absolute; z-index: 4; left: 12px; bottom: 12px; right: 12px; display: flex; align-items: flex-end; gap: 8px; pointer-events: none; }
.statusbar > * { pointer-events: auto; }
.view-status { margin: 0; display: flex; align-items: center; gap: 9px; max-width: min(560px, 100%); padding: 7px 13px; border-radius: 10px; background: rgba(29, 42, 47, .82); color: #fff; font-size: 12.5px; line-height: 1.35; backdrop-filter: blur(6px); }
.view-status .dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #8fc7bf; }
.view-status[data-kind="busy"] .dot { background: transparent; border: 2px solid rgba(255, 255, 255, .3); border-top-color: #8fc7bf; width: 12px; height: 12px; animation: spin .8s linear infinite; }
.view-status[data-kind="error"] { background: rgba(120, 38, 25, .92); }
.view-status[data-kind="error"] .dot { background: #f2b3a6; }
.diag-toggle { background: rgba(251, 252, 251, .92) !important; }
.diag { position: absolute; left: 0; bottom: calc(100% + 8px); width: min(360px, calc(100vw - 24px)); padding: 12px 14px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(29, 42, 47, .18); }
.diag-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.diag-head .btn { border-color: transparent; }
.diag dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 5px 12px; margin: 0; font-size: 12px; }
.diag dt { color: var(--mute); }
.diag dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

.panel { background: var(--panel); border-left: 1px solid var(--line); display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; }
.panel-head { display: flex; align-items: center; gap: 9px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.panel-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--acc-soft); color: var(--acc); }
.panel-head h2 { margin: 0; font: 600 14.5px var(--font); }
.panel-head .muted { margin-left: auto; font-size: 12px; }
.sheet-handle { display: none; color: var(--faint); }
.pane { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; }
.agent-main { display: flex; flex-direction: column; min-height: 0; }
.agent-main > .conversation { flex: 1; }
/* The mount fills the pane; its own transcript scrolls and its composer sits
   at the bottom, above the page's "Pegar un plan" link. */
.chat { flex: 1; min-height: 0; }
.chat > .aegis { border-radius: 0; }
/* The turn navigator floats over the last reply in a panel this narrow. */
#chat .aegis .nav { display: none; }
/* the change just applied, under the chat */
.applied { margin: 0 12px 10px; padding: 10px; border-radius: 12px; background: var(--acc-soft); display: grid; gap: 8px; }
.applied-head { display: flex; align-items: center; justify-content: space-between; }
.applied-tag { display: inline-flex; align-items: center; gap: 6px; font: 600 12.5px var(--font); color: var(--acc-ink); }
.applied-tag .i { color: var(--acc); }
.applied .btn { border-color: transparent; background: transparent; }
.applied .change-card { border-color: transparent; }
.conversation { overflow: auto; padding: 16px 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.history-list { max-height: 220px; overflow: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 0 2px; }
.step { margin: 0; font-size: 13px; color: var(--mute); }
.change-card { border: 1px solid var(--line); border-radius: 11px; padding: 12px; background: #fff; display: grid; gap: 7px; }
.change-card .hd { display: flex; align-items: baseline; gap: 8px; }
.change-card .msg { font: 600 13px var(--font); }
.change-card .when { margin-left: auto; font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.change-card .counts { display: flex; gap: 6px; flex-wrap: wrap; font-size: 11px; }
.counts span { background: var(--soft); border-radius: 999px; padding: 0 8px; color: var(--mute); }
.counts .add { color: var(--ok); background: var(--acc-soft); }
.counts .rem { color: var(--err); background: var(--err-bg); }
.change-card .names { font-size: 12px; color: var(--mute); }
.change-card .undo { justify-self: start; }
.composer { border-top: 1px solid var(--line); padding: 10px 16px 14px; display: grid; gap: 4px; }
.composer summary { display: flex; align-items: center; gap: 7px; font: 600 12.5px var(--font); color: var(--acc-ink); cursor: pointer; padding: 4px 0; list-style: none; }
.composer summary::-webkit-details-marker { display: none; }
.composer summary .i { color: var(--acc); }
.composer details[open] summary { margin-bottom: 8px; }
.composer textarea { min-height: 130px; font: 11.5px var(--mono); resize: vertical; }
.composer .row { margin-top: 8px; }
.problems { margin: 8px 0 0; padding: 9px 10px; background: var(--err-bg); color: var(--err); border: 1px solid #edd2ca; border-radius: 8px; font: 11px var(--mono); white-space: pre-wrap; max-height: 180px; overflow: auto; }

/* the Informe panel: cover and view tiles, sections, the cover's data */
.report-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.report-tiles .empty { grid-column: 1 / -1; margin: 0; padding: 12px; font-size: 12.5px; color: var(--mute); border: 1px dashed var(--line); border-radius: 10px; }
.report-tile { all: unset; position: relative; aspect-ratio: 3 / 2; border: 2px solid transparent; border-radius: 9px; overflow: hidden; background: var(--soft); cursor: pointer; box-sizing: border-box; }
.report-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.report-tile.plan { background: repeating-linear-gradient(0deg, transparent 0 11px, var(--line) 11px 12px), repeating-linear-gradient(90deg, #fff 0 11px, var(--line) 11px 12px); }
.report-tile.on { border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc-soft); }
.report-tile:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.report-tile .lab { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 6px 3px; font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(20, 30, 33, .75)); }
.report-tile.plan .lab { color: var(--ink); background: none; }
.report-tile .order { position: absolute; top: 5px; right: 5px; min-width: 18px; height: 18px; border-radius: 5px; background: #fff; border: 1px solid var(--line); font: 600 11px var(--font); color: var(--acc); display: grid; place-items: center; }
.report-tools .row { display: flex; gap: 8px; flex-wrap: wrap; }
.report-sections { display: grid; }
.report-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--soft); font-size: 13px; cursor: pointer; }
.report-row small { display: block; color: var(--mute); font-size: 11.5px; }
.report-row input { width: 18px; height: 18px; accent-color: var(--acc); }
.report-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.report-fields label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--mute); }
.report-fields label.full { grid-column: 1 / -1; }
.report-fields select { font: inherit; font-size: 13.5px; color: var(--ink); border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; background: #fff; }
.photo-status.ok { color: var(--ok); white-space: pre-line; }
.photo-status { white-space: pre-line; }

/* the Render and Foto panels: what the button does, the button, the gallery */
.photo-pane { grid-template-rows: minmax(0, 1fr); }
.photo-tools { overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.lead { margin: 0; font-size: 13px; color: var(--mute); line-height: 1.5; max-width: 60ch; }
.photo-status { margin: 0; font-size: 12.5px; color: var(--err); }
.gallery-title { display: flex; align-items: center; gap: 7px; margin: 8px 0 0; font: 600 12.5px var(--font); color: var(--mute); }
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.gallery .thumb { all: unset; display: grid; gap: 4px; cursor: pointer; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; transition: border-color .15s; }
.gallery .thumb:hover { border-color: var(--acc); }
.gallery .thumb:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.gallery .thumb img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--sky); }
.gallery .thumb .when { padding: 3px 8px 0; font-size: 11px; color: var(--mute); font-variant-numeric: tabular-nums; }
.gallery .thumb .stale { padding: 0 8px 7px; font-size: 11px; color: var(--warn); }
.gallery .empty { grid-column: 1 / -1; margin: 0; padding: 14px; font-size: 12.5px; color: var(--mute); border: 1px dashed var(--line); border-radius: 10px; }

.photo-wait { position: absolute; inset: 0; z-index: 12; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px; text-align: center; background: rgba(29, 42, 47, .62); color: #fff; font: 13.5px var(--font); }
.photo-wait .spin, .spin { width: 38px; height: 38px; border: 4px solid rgba(255, 255, 255, .24); border-top-color: #8fc7bf; border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* the comparison: one image under the other, clipped at the bar */
.compare { position: absolute; inset: 0; z-index: 14; overflow: hidden; background: #1d2a2f; touch-action: none; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; user-select: none; }
.compare #cmp-after { clip-path: inset(0 0 0 50%); will-change: clip-path; }
.cmp-frame { position: absolute; inset: 0; cursor: ew-resize; touch-action: none; }
.cmp-bar { position: absolute; top: 0; bottom: 0; left: 50%; width: 0; border-left: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .18); pointer-events: none; }
.cmp-bar:focus { outline: none; }
.cmp-bar:focus-visible .cmp-knob { outline: 2px solid var(--acc); outline-offset: 2px; }
.cmp-knob { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.cmp-knob .i { width: 18px; height: 18px; }
.cmp-tag { position: absolute; top: 12px; z-index: 2; padding: 3px 10px; border-radius: 999px; background: rgba(29, 42, 47, .7); color: #fff; font-size: 12px; }
.cmp-tag.l { left: 12px; }
.cmp-tag.r { right: 12px; }
.cmp-actions { position: absolute; left: 50%; bottom: 18px; z-index: 2; transform: translateX(-50%); display: flex; gap: 8px; padding: 6px; border-radius: 999px; background: rgba(29, 42, 47, .7); }
.cmp-actions .btn { border-color: transparent; border-radius: 999px; }
@media (pointer: coarse) {
  .cmp-knob { width: 46px; height: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: 2s !important; }
}

/* Planta: the server's drawing on the studio's paper, with the tools over it */
.plan-pane { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; background: var(--bg); }
.plan-head { position: absolute; z-index: 3; top: 64px; left: 12px; right: 12px; display: flex; align-items: center; gap: 12px; pointer-events: none; }
.plan-level { display: flex; align-items: center; gap: 7px; padding: 5px 8px 5px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(251, 252, 251, .92); font: 12px var(--font); color: var(--mute); pointer-events: auto; }
.plan-level b { font: 600 13px var(--font); color: var(--ink); }
.plan-level select { border: 0; background: transparent; font: 600 13px var(--font); color: var(--ink); padding: 2px 4px; }
.plan-host { flex: 1; min-height: 0; padding: 12px; cursor: grab; touch-action: none; }
.plan-host:active { cursor: grabbing; }
.plan-host svg { width: 100%; height: 100%; display: block; }
.plan-tools { position: absolute; z-index: 3; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; gap: 4px; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: rgba(251, 252, 251, .94); box-shadow: 0 6px 20px rgba(29, 42, 47, .1); }
.plan-tools button { display: flex; align-items: center; gap: 6px; border: 0; border-radius: 8px; padding: 7px 11px; background: transparent; font: 550 12.5px var(--font); color: var(--mute); cursor: pointer; }
.plan-tools button:hover { background: var(--soft); color: var(--ink); }
.plan-tools button.on { background: var(--acc-soft); color: var(--acc-ink); }
.plan-tools kbd { font: 10.5px var(--mono); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; color: var(--faint); }
.plan-cat { position: absolute; z-index: 4; left: 12px; top: 108px; bottom: 70px; width: min(320px, calc(100vw - 24px)); display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(251, 252, 251, .97); box-shadow: 0 10px 28px rgba(29, 42, 47, .14); }
.plan-cat input { border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; font: 12.5px var(--font); background: var(--panel); color: var(--ink); }
.plan-assets { overflow: auto; display: grid; gap: 4px; }
.plan-assets button { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; text-align: left; border: 1px solid transparent; border-radius: 8px; padding: 6px 8px; background: transparent; font: 12.5px var(--font); color: var(--ink); cursor: pointer; }
.plan-assets button:hover { background: var(--soft); }
.plan-assets button.on { border-color: var(--acc); background: var(--acc-soft); }
.plan-assets button small { grid-column: 2; color: var(--mute); font: 11px var(--mono); }
.plan-assets h4 { margin: 8px 2px 2px; font: 600 11px var(--font); letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }
.plan-handle { position: absolute; z-index: 5; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; border: 2px solid var(--acc); background: var(--panel); cursor: grab; box-shadow: 0 2px 6px rgba(29, 42, 47, .2); }
.plan-handle:active { cursor: grabbing; }
.plan-handle::after { content: "\21BB"; position: absolute; inset: 0; display: grid; place-items: center; font: 13px var(--font); color: var(--acc); }
.plan-insp { position: absolute; z-index: 4; right: 12px; bottom: 70px; width: 210px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(251, 252, 251, .97); box-shadow: 0 10px 28px rgba(29, 42, 47, .14); font: 12.5px var(--font); }
.insp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.insp-head b { flex: 1; font: 600 13px var(--font); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.insp-close { border: 0; background: none; font-size: 16px; line-height: 1; color: var(--mute); cursor: pointer; }
.insp-rows { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0 0 8px; font: 11.5px var(--mono); }
.insp-rows dt { color: var(--faint); }
.insp-rows dd { margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.insp-acts { display: flex; gap: 6px; }
.insp-acts button { flex: 1; border: 1px solid var(--line); border-radius: 7px; padding: 5px 6px; background: var(--panel); font: 11.5px var(--font); color: var(--ink); cursor: pointer; }
.insp-acts button:hover { border-color: var(--faint); }
.insp-acts button.danger { color: var(--err); }
.insp-acts kbd { font: 10px var(--mono); color: var(--faint); border: 0; }
.plan-sel { fill: none; stroke: var(--acc); stroke-width: 1.5; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.plan-ghost { fill: var(--acc); fill-opacity: .18; stroke: var(--acc); stroke-width: 1.5; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.plan-problems { position: absolute; z-index: 5; top: 108px; left: 12px; right: 12px; max-height: 30vh; overflow: auto; padding: 10px 12px; border: 1px solid var(--err); border-radius: 10px; background: var(--err-bg); color: var(--err); }
.prob-head { display: flex; align-items: flex-start; gap: 8px; }
.prob-head p { flex: 1; margin: 0; font: 600 12.5px var(--font); color: var(--err); }
.prob-head .insp-close { color: var(--err); }
.plan-problems ul { margin: 6px 0 0; padding-left: 18px; font: 11.5px var(--mono); }
.plan-problems li { margin: 2px 0; overflow-wrap: anywhere; }
.prob-more { margin-top: 6px; border: 1px solid var(--err); border-radius: 6px; background: transparent; color: var(--err); font: 11.5px var(--font); padding: 3px 8px; cursor: pointer; }

/* a phone: the modes fill the top bar, the panel is a sheet that slides up */
@media (max-width: 820px) {
  .top { gap: 8px; padding: 0 8px; height: 58px; }
  .logo span { display: none; }
  .modes { flex: 1; justify-content: space-between; }
  .modes button { flex: 1; flex-direction: column; gap: 2px; padding: 5px 2px; font-size: 11px; min-width: 0; }
  .modes button .i { width: 18px; height: 18px; }
  .modes button span { white-space: nowrap; }
  .who { display: none; }
  main { height: calc(100% - 58px); }
  .screen { padding: 24px 16px 60px; }
  .project { grid-template-columns: 1fr; }
  .view { min-height: 0; }
  .viewbar { top: 8px; left: 8px; right: 8px; }
  .cam button span { display: none; }
  .stick { left: 14px; bottom: 76px; width: 120px; height: 120px; }
  .stick-knob { width: 52px; height: 52px; }
  .plan-head { top: 58px; left: 8px; right: 8px; }
  .plan-host { padding: 6px; }
  .plan-cat { left: 8px; right: 8px; width: auto; top: 96px; bottom: 118px; }
  .plan-insp { left: 8px; right: 8px; width: auto; bottom: 118px; }
  .plan-handle { width: 44px; height: 44px; margin: -22px 0 0 -22px; }
  /* clear the collapsed panel sheet, which keeps 50 px at the bottom */
  .plan-tools { bottom: 62px; gap: 2px; }
  .plan-tools button { padding: 10px 12px; }
  .plan-tools kbd { display: none; }
  .viewbar .hint, button.icon-btn .lbl { display: none; }
  .statusbar { left: 8px; right: 8px; bottom: 58px; }
  .panel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: 62vh; border-left: 0; border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; box-shadow: 0 -8px 30px rgba(29, 42, 47, .14); transform: translateY(calc(100% - 50px)); transition: transform .22s ease; }
  .project.panel-open .panel { transform: translateY(0); }
  .project.comparing .panel { display: none; }
  .panel-head { cursor: pointer; padding: 10px 14px; }
  .panel-icon { width: 26px; height: 26px; }
  .sheet-handle { display: inline-flex; margin-left: 4px; transition: transform .2s; }
  .project.panel-open .sheet-handle { transform: rotate(180deg); }
}
