/* OJAS 4D workspace prototype. Colours, type and shape come from tokens.css,
   which is the only file to replace when the design system changes. */

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--dg-bg); color: var(--dg-text); font: 13px/1.45 var(--dg-font-sans); letter-spacing: -0.011em; overflow: hidden; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--dg-accent); outline-offset: 1px; }
/* A link inside text reads as part of it: ink, with a soft underline that firms up on hover. */
:where(a) { color: var(--dg-text); text-decoration-color: var(--dg-line-strong); text-underline-offset: 2px; transition: color var(--dg-dur-fast) var(--dg-ease), text-decoration-color var(--dg-dur-fast) var(--dg-ease); }
:where(a:hover) { color: var(--dg-accent-hover); text-decoration-color: currentColor; }
h2, h3 { margin: 0; font-weight: 600; }
.ico { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico.fill { fill: currentColor; stroke: none; }
.mono, .num { font-family: var(--dg-font-mono); font-feature-settings: "tnum" 1, "zero" 1; letter-spacing: 0; }

.app { height: 100vh; display: grid; grid-template-columns: 272px minmax(0, 1fr) 312px; grid-template-rows: 48px 68px minmax(0, 1fr) 28px;
  grid-template-areas: "top top top" "time time time" "layers stage props" "status status status"; }

/* top bar */
.topbar { grid-area: top; display: flex; align-items: center; gap: 18px; padding: 0 14px; background: var(--dg-surface); border-bottom: 1px solid var(--dg-line); }
.brand { display: flex; align-items: center; gap: 9px; }
.mark { width: 24px; height: 24px; }
.wordmark { font-weight: 700; font-size: 15px; letter-spacing: -0.02em; }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--dg-text-muted); padding-left: 18px; border-left: 1px solid var(--dg-line); height: 22px; }
.crumbs a { color: inherit; text-decoration: none; } .crumbs a:hover { color: var(--dg-text); }
.crumbs .sep { color: var(--dg-line-strong); } .crumbs .here { color: var(--dg-text); font-weight: 500; }
.proto-chip { font: 500 11px var(--dg-font-mono); color: var(--dg-warn); background: var(--dg-warn-wash); border-radius: 999px; padding: 3px 9px; }
.proto-chip.live { color: var(--dg-ok); background: var(--dg-ok-wash); }
.top-actions { margin-left: auto; display: flex; gap: 6px; }
/* Buttons are the landing page's: a pill, and on hover a fill that wipes in from the left. */
.btn { position: relative; isolation: isolate; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: var(--dg-radius-pill); border: 1px solid transparent; background: none; font-weight: 500; white-space: nowrap; transition: color .35s var(--dg-ease), border-color .35s var(--dg-ease), transform .3s var(--dg-ease); }
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--wipe, transparent); transform: scaleX(0); transform-origin: 0 50%; transition: transform .55s var(--dg-ease); }
.btn:hover:not(:disabled)::before, .btn:focus-visible::before { transform: scaleX(1); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:focus-visible { outline-offset: 2px; }
.topbar a.btn { text-decoration: none; }
.btn.ghost { color: var(--dg-text-soft); --wipe: var(--dg-surface-3); } .btn.ghost:hover:not(:disabled) { color: var(--dg-text); }
.btn.outline { border-color: var(--dg-line-strong); color: var(--dg-text); --wipe: var(--dg-primary-bg); } .btn.outline:hover:not(:disabled), .btn.outline:focus-visible { color: var(--dg-primary-ink); border-color: var(--dg-primary-bg); }
.btn.primary { background: var(--dg-primary-bg); color: var(--dg-primary-ink); font-weight: 600; --wipe: var(--dg-primary-wipe); }
.btn:disabled { opacity: .45; }
.btn.small { height: 28px; padding: 0 10px; font-size: 12px; }
.iconbtn { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: var(--dg-radius-pill); background: none; color: var(--dg-text-muted); transition: background var(--dg-dur-fast) var(--dg-ease), color var(--dg-dur-fast) var(--dg-ease); }
.iconbtn:hover { background: var(--dg-surface-3); color: var(--dg-text); }

/* timeline */
.timeline { grid-area: time; display: flex; background: var(--dg-surface); border-bottom: 1px solid var(--dg-line); }
.tl-track { position: relative; flex: 1; min-width: 0; overflow: hidden; }
.tl-axis { position: absolute; left: 0; right: 0; bottom: 0; height: 20px; border-top: 1px solid var(--dg-line); display: flex; }
.tl-month { flex: 1; border-left: 1px solid var(--dg-line); padding: 3px 0 0 7px; font: 10.5px var(--dg-font-mono); color: var(--dg-text-faint); white-space: nowrap; overflow: hidden; }
.tl-flight { position: absolute; top: 6px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; border: 0; background: none; padding: 0; }
.tl-flight img { width: 46px; height: 32px; object-fit: cover; border-radius: var(--dg-radius-sm) var(--dg-radius-sm) 0 0; display: block; }
.tl-flight span { width: 46px; font: 500 10px var(--dg-font-mono); text-align: center; padding: 1px 0 2px; background: var(--dg-accent); color: var(--dg-accent-ink); border-radius: 0 0 var(--dg-radius-sm) var(--dg-radius-sm); }
.tl-flight::after { content: ""; width: 1px; height: 9px; background: var(--dg-accent); }
.tl-side { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; padding: 0 14px; border-left: 1px solid var(--dg-line); width: 312px; }
.tl-note { font-size: 11px; color: var(--dg-text-faint); }

/* side panels */
.layers, .props { background: var(--dg-surface); overflow: auto; min-height: 0; }
.layers { grid-area: layers; border-right: 1px solid var(--dg-line); padding: 12px 0; }
.props { grid-area: props; border-left: 1px solid var(--dg-line); }
.panel-head { display: flex; align-items: center; gap: 9px; padding: 0 14px 10px; } .panel-head h2 { font-size: 13px; }
.filter { display: block; width: calc(100% - 28px); margin: 0 14px 10px; height: 30px; padding: 0 12px; background: var(--dg-bg); border: 1px solid var(--dg-line); border-radius: var(--dg-radius-pill); }
.filter:focus, .field input:focus, .field textarea:focus, .field select:focus { border-color: var(--dg-accent); box-shadow: 0 0 0 3px var(--dg-accent-wash); outline: none; }
.filter::placeholder { color: var(--dg-text-faint); }
.grp { border-top: 1px solid var(--dg-line-faint); }
.grp > summary { list-style: none; display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; cursor: pointer; font-weight: 600; font-size: 12px; color: var(--dg-text-soft); }
.grp > summary::-webkit-details-marker { display: none; }
.grp > summary .ico { width: 12px; height: 12px; transition: transform var(--dg-dur-fast) var(--dg-ease); color: var(--dg-text-faint); }
.grp[open] > summary .ico { transform: rotate(90deg); }
.grp > summary .count { margin-left: auto; font: 11px var(--dg-font-mono); color: var(--dg-text-faint); }
.row { display: flex; align-items: center; gap: 9px; height: 32px; padding: 0 10px 0 14px; border-left: 2px solid transparent; }
.row:hover { background: var(--dg-surface-2); }
.row.sel { background: var(--dg-surface-3); }
.row input[type=checkbox] { accent-color: var(--dg-accent); width: 14px; height: 14px; margin: 0; flex: none; }
.row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: none; border: 0; text-align: left; padding: 0; }
.row button.name { height: 100%; }
.row .val { font: 11px var(--dg-font-mono); color: var(--dg-text-muted); }
.row .ico { color: var(--dg-text-muted); width: 14px; height: 14px; }
.row.off .name { color: var(--dg-text-faint); }
.tag { font: 500 10.5px var(--dg-font-mono); padding: 2px 6px; border-radius: var(--dg-radius-pill); white-space: nowrap; }
.unsaved { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--dg-warn); flex: none; }
.unsaved.bad { border-color: var(--dg-danger); background: var(--dg-danger); }
.tag.bad { color: var(--dg-danger); background: var(--dg-danger-wash); }
.tag.warn { color: var(--dg-warn); background: var(--dg-warn-wash); }
.tag.mute { color: var(--dg-text-faint); background: var(--dg-surface-3); }
.tag.ok { color: var(--dg-ok); background: var(--dg-ok-wash); }
.empty-row { padding: 6px 14px 12px; color: var(--dg-text-faint); font-size: 12px; }
.slider { padding: 0 14px 10px 37px; display: flex; align-items: center; gap: 8px; color: var(--dg-text-faint); font-size: 11px; }
.slider input { flex: 1; accent-color: var(--dg-accent); }

/* stage */
.stage { grid-area: stage; position: relative; min-width: 0; min-height: 0; background: var(--dg-stage); overflow: hidden; }
#map, #view3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#map:focus-visible { outline: 1px solid var(--dg-accent-line); outline-offset: -1px; }
#view3d canvas { display: block; }
.stage.tool-draw #map { cursor: crosshair; } .stage.tool-select #map { cursor: grab; } .stage.dragging #map { cursor: grabbing; } .stage.over-handle #map { cursor: pointer; }
.hint { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); background: var(--dg-glass); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); border: 1px solid var(--dg-line); border-radius: 999px; padding: 6px 14px; font-size: 12px; color: var(--dg-text-soft); box-shadow: var(--float); pointer-events: none; white-space: nowrap; }
.hint kbd { font: 500 11px var(--dg-font-mono); color: var(--dg-text); background: var(--dg-surface-3); border-radius: 3px; padding: 1px 5px; margin: 0 1px; }
.rail { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 2px; padding: 4px; background: var(--dg-glass); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); border: 1px solid var(--dg-line); border-radius: var(--dg-radius-pill); box-shadow: var(--float); }
.rail button { position: relative; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--dg-text-soft); transition: background var(--dg-dur-fast) var(--dg-ease), color var(--dg-dur-fast) var(--dg-ease); }
.rail button:hover:not(:disabled) { background: var(--dg-surface-3); color: var(--dg-text); }
.rail button[aria-pressed=true] { background: var(--dg-selected-bg); color: var(--dg-selected-ink); }
.rail button:disabled { opacity: .35; }
.rail button .tip { position: absolute; right: 42px; top: 50%; transform: translateY(-50%); background: var(--dg-tip-bg); border: 1px solid var(--dg-tip-bg); color: var(--dg-tip-ink); padding: 4px 8px; border-radius: var(--dg-radius-sm); box-shadow: var(--float); font-size: 12px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity var(--dg-dur-fast); }
.rail button:hover .tip, .rail button:focus-visible .tip { opacity: 1; }
.tip kbd { font: 500 10.5px var(--dg-font-mono); color: inherit; opacity: .62; margin-left: 6px; }
.rail hr { width: 22px; border: 0; border-top: 1px solid var(--dg-line); margin: 3px auto; }
.viewbar { position: absolute; left: 12px; bottom: 12px; display: flex; align-items: center; gap: 6px; }
.seg { display: flex; padding: 3px; gap: 2px; background: var(--dg-glass); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); border: 1px solid var(--dg-line); border-radius: var(--dg-radius-pill); box-shadow: var(--float); }
.seg button { height: 28px; padding: 0 12px; border: 0; border-radius: var(--dg-radius-pill); background: none; color: var(--dg-text-soft); font: 600 12px var(--dg-font-mono); transition: background var(--dg-dur-fast) var(--dg-ease), color var(--dg-dur-fast) var(--dg-ease); }
.seg button:hover:not([aria-pressed=true]) { color: var(--dg-text); }
.seg button[aria-pressed=true] { background: var(--dg-selected-bg); color: var(--dg-selected-ink); }
.vb { width: 36px; height: 36px; display: grid; place-items: center; background: var(--dg-glass); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); border: 1px solid var(--dg-line); border-radius: 50%; color: var(--dg-text-soft); box-shadow: var(--float); transition: background var(--dg-dur-fast) var(--dg-ease), color var(--dg-dur-fast) var(--dg-ease); }
.vb:hover { color: var(--dg-text); background: var(--dg-surface); }
.scale { margin-left: 8px; display: flex; flex-direction: column; gap: 3px; font: 500 11px var(--dg-font-mono); color: var(--dg-text); background: var(--dg-glass); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); border: 1px solid var(--dg-line); border-radius: var(--dg-radius); padding: 5px 9px 7px; box-shadow: var(--float); }
.scale i { display: block; height: 5px; border: 1.5px solid var(--dg-text); border-top: 0; }
.stage.with-profile .viewbar { bottom: 232px; }

/* profile drawer */
.profile { position: absolute; left: 0; right: 0; bottom: 0; height: 220px; background: var(--dg-surface); border-top: 1px solid var(--dg-line-strong); display: flex; flex-direction: column; }
.profile[hidden] { display: none; }
.profile header { display: flex; align-items: center; gap: 12px; height: 36px; padding: 0 8px 0 14px; }
.profile h3 { font-size: 12px; } .profile .unit { color: var(--dg-text-faint); font-weight: 400; margin-left: 4px; }
.pf-read { margin-left: auto; font: 11.5px var(--dg-font-mono); color: var(--dg-text-soft); }
#pfCanvas { flex: 1; min-height: 0; width: 100%; display: block; }

/* properties */
.props-empty { min-height: 46%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; color: var(--dg-text-muted); }
.props-empty .ico { width: 28px; height: 28px; color: var(--dg-text-faint); }
.props-empty p { margin: 0; max-width: 22ch; }
.p-head { display: flex; align-items: center; gap: 9px; height: 44px; padding: 0 8px 0 14px; border-bottom: 1px solid var(--dg-line); position: sticky; top: 0; background: var(--dg-surface); z-index: 1; }
.p-head .kind { font-weight: 600; flex: 1; }
.p-sec { padding: 14px; border-bottom: 1px solid var(--dg-line-faint); display: flex; flex-direction: column; gap: 10px; }
.p-sec h3 { font: 600 10.5px var(--dg-font-mono); letter-spacing: var(--dg-eyebrow-track); text-transform: var(--dg-eyebrow-case); color: var(--dg-text-faint); }
.field { display: flex; flex-direction: column; gap: 4px; } .field label { font-size: 11px; color: var(--dg-text-muted); }
.field input, .field textarea, .field select { background: var(--dg-bg); border: 1px solid var(--dg-line); border-radius: var(--dg-radius); padding: 6px 9px; resize: vertical; }
.field select { height: 32px; }
.swatches { display: flex; gap: 8px; }
.swatches button { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--dg-surface); outline: 1px solid var(--dg-line-strong); padding: 0; }
.swatches button[aria-pressed=true] { outline: 2px solid var(--dg-text); }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; align-items: baseline; margin: 0; }
.kv dt { color: var(--dg-text-muted); } .kv dd { margin: 0; font: 500 12.5px var(--dg-font-mono); color: var(--dg-text); text-align: right; }
.kv dd small { color: var(--dg-text-faint); font-weight: 400; font-size: 11px; }
.kv dd.cut { color: var(--dg-danger); } .kv dd.fill { color: var(--dg-fill); }
.headline { display: flex; align-items: baseline; gap: 8px; }
.headline .big { font: 600 24px var(--dg-font-mono); letter-spacing: -0.02em; }
.headline .pm { font: 12px var(--dg-font-mono); color: var(--dg-text-muted); }
.note { font-size: 11.5px; color: var(--dg-text-muted); line-height: 1.5; }
.refusal { border: 1px solid var(--dg-danger-line); background: var(--dg-danger-wash); border-radius: var(--dg-radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.refusal b { color: var(--dg-danger); font: 600 12px var(--dg-font-mono); }
.caution { border: 1px solid var(--dg-warn-line); background: var(--dg-warn-wash); border-radius: var(--dg-radius); padding: 10px 12px; font-size: 11.5px; color: var(--dg-text-soft); line-height: 1.5; }
.caution b { color: var(--dg-warn); }
.thumbs { display: flex; gap: 5px; } .thumbs img, .thumbs span { width: 50px; height: 40px; object-fit: cover; border-radius: var(--dg-radius-sm); }
.thumbs span { display: grid; place-items: center; background: var(--dg-surface-3); font: 500 11px var(--dg-font-mono); color: var(--dg-text-soft); }

/* status */
.status { grid-area: status; display: flex; align-items: center; gap: 18px; padding: 0 14px; background: var(--dg-surface); border-top: 1px solid var(--dg-line); font: 11px var(--dg-font-mono); color: var(--dg-text-soft); white-space: nowrap; overflow: hidden; }
.status b { color: var(--dg-text-faint); font-weight: 500; margin-right: 4px; }
.status .right { margin-left: auto; } .status .warn { color: var(--dg-warn); }

/* sheet */
.sheet { position: fixed; inset: 0; background: var(--dg-scrim); display: grid; place-items: center; z-index: 10; }
.sheet[hidden] { display: none; }
.sheet-card { width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 64px); overflow: auto; background: var(--dg-surface); border: 1px solid var(--dg-line); border-radius: var(--dg-radius-lg); box-shadow: var(--dg-shadow-card); }
.sheet-card header { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 14px 18px; border-bottom: 1px solid var(--dg-line); }
.sheet-card h2 { font-size: 15px; }
.files { width: 100%; border-collapse: collapse; }
.files th { text-align: left; font: 600 10.5px var(--dg-font-mono); letter-spacing: var(--dg-eyebrow-track); text-transform: var(--dg-eyebrow-case); color: var(--dg-text-faint); padding: 14px 18px 6px; }
.files td { padding: 9px 18px; border-top: 1px solid var(--dg-line-faint); } .files td.num { text-align: right; color: var(--dg-text-muted); }

@media (max-width: 1100px) {
  .app { grid-template-columns: 220px minmax(0, 1fr) 280px; }
  .tl-side { width: 280px; }
  .btn.ghost { font-size: 0; gap: 0; padding: 0 9px; }
  .proto-chip { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Figures line up in columns whichever typeface carries them. */
.kv dd, .row .val, .status, .headline .big, .pf-read { font-variant-numeric: tabular-nums; }

/* Design preview switcher. A designer's tool, never part of the demo build. */
.themer { position: fixed; right: 14px; bottom: 38px; z-index: 20; display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; background: #14181D; border: 1px solid #3A424D; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .6); font: 500 12px/1 ui-sans-serif, system-ui, sans-serif; }
.themer span { color: #9AA4B1; padding: 0 8px 0 10px; }
.themer button { height: 26px; padding: 0 11px; border: 0; border-radius: 999px; background: none; color: #D5DAE1; font: inherit; }
.themer button[aria-pressed=true] { background: #FFFFFF; color: #14181D; }
