/* OSM Design Library. Neutral surfaces and role-based controls. */
:root {
  --osm-bg-primary:#fff;
  --osm-bg-secondary:#f5f5f5;
  --osm-bg-inverse:#171717;
  --osm-surface-primary:#fff;
  --osm-surface-secondary:#fafafa;
  --osm-surface-selected:#ededed;
  --osm-surface-hover:#eee;
  --osm-text-primary:#171717;
  --osm-text-muted:#575b5c;
  --osm-text-inverse:#fff;
  --osm-border-subtle:#e6e6e6;
  --osm-border-strong:#888;
  --osm-action-primary:#171717;
  --osm-action-primary-text:#fff;
  --osm-action-hover:#262626;
  --osm-focus:#171717;
  --osm-radius-action:6px;
  --osm-radius-control:10px;
  --osm-radius-surface:16px;
  --osm-radius-dialog:24px;
  --osm-container-mobile:16px;
  --osm-container-desktop:48px;
}
:root{font-family:Inter,system-ui,sans-serif;color:var(--osm-text-primary);background:var(--osm-bg-secondary);--muted:var(--osm-text-muted);--line:var(--osm-border-subtle);--accent:var(--osm-action-primary);--soft:var(--osm-surface-selected);--panel:var(--osm-surface-primary)}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button{cursor:pointer;color:inherit;background:var(--osm-bg-primary);border:1px solid var(--osm-border-strong);border-radius:var(--osm-radius-action);padding:9px 13px;display:inline-flex;align-items:center;justify-content:center;gap:8px;font-weight:650;font-size:13px;white-space:nowrap}button:hover{background:var(--osm-surface-hover);border-color:var(--osm-border-strong)}button:disabled{opacity:.42;cursor:default}button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--accent);outline-offset:2px}button svg,.icon{width:17px;height:17px;flex:none;vertical-align:middle} [hidden]{display:none!important}.primary{background:var(--accent);color:white;border-color:var(--accent)}.primary:hover{background:var(--osm-action-hover);color:var(--osm-action-primary-text)}.top{height:68px;background:var(--osm-bg-primary);border-bottom:1px solid var(--line);padding:0 max(24px,calc((100vw - 1320px)/2));display:flex;align-items:center;justify-content:space-between;gap:12px}.brand{display:flex;align-items:center;gap:16px;flex:none}
.osm-logo{display:block;flex:none}
.osm-logo img{display:block;width:auto;height:28px}
.brand-name{border-left:1px solid var(--osm-border-subtle);padding-left:16px;font-weight:700;font-size:16px;letter-spacing:-.02em}.top-actions,.project-info,.timeline-tools,.transport-buttons{display:flex;align-items:center;gap:8px}main{max-width:1368px;padding:25px 24px 12px;margin:auto}.project-head{display:flex;justify-content:space-between;align-items:end;margin-bottom:19px;gap:12px}.eyebrow,.section-tag,.ruler-label{font-size:10px;font-weight:760;letter-spacing:1.25px;color:var(--osm-text-muted);margin:0 0 6px}.eyebrow span{display:inline-block;width:7px;height:7px;border-radius:100%;background:var(--osm-focus);margin-right:5px}.project-head h1{margin:0;font-size:32px;line-height:1.18;letter-spacing:-1.1px;overflow-wrap:anywhere}.project-info{color:var(--muted);font-size:11px;flex:none;gap:12px;padding-bottom:4px}.project-info svg{width:13px;height:13px;margin-right:4px}#demo-badge,.chip{color:var(--osm-text-primary);background:var(--soft);padding:4px 8px;border-radius:5px;font-weight:700}.workspace{display:grid;grid-template-columns:minmax(0,2.45fr) minmax(295px,1fr);gap:16px}.panel{border:1px solid var(--line);background:var(--panel);border-radius:var(--osm-radius-surface);overflow:hidden;box-shadow:none}.panel-title{height:50px;padding:0 16px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:8px}.panel-title h2{font-size:14px;display:flex;align-items:center;gap:8px;margin:0}.panel-title h2 svg{color:var(--osm-text-muted)}.toggle{display:flex;align-items:center;gap:8px;font-size:11px;color:var(--muted);cursor:pointer}.toggle input{appearance:none;width:30px;height:17px;border:0;border-radius:20px;background:#686b6c;margin:0;position:relative;cursor:pointer}.toggle input:before{content:'';position:absolute;left:3px;top:3px;width:11px;height:11px;background:white;border-radius:50%;transition:transform .15s}.toggle input:checked{background:var(--accent)}.toggle input:checked:before{transform:translateX(13px)}.toggle span{display:none}.stage{height:clamp(240px,calc(48vh - 35px),420px);position:relative;display:grid;place-items:center;background:var(--osm-bg-inverse);overflow:hidden}.stage canvas{display:block;width:100%;height:100%;min-height:0;min-width:0;object-fit:contain}.stage:fullscreen{height:100%;width:100%}#drop-cover{position:absolute;inset:0;background:#171717e8;border:2px dashed #fff;color:var(--osm-action-primary-text);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;font-weight:750;pointer-events:none}.transport{height:49px;padding:0 13px;display:flex;align-items:center;gap:13px}.transport button,.timeline-tools>button:not(.split){padding:6px;border-color:transparent}.transport .play{background:var(--soft);color:var(--accent);width:33px;height:32px}.transport #fullscreen{margin-left:auto}.time{font-family:ui-monospace,monospace;font-size:12px;font-variant-numeric:tabular-nums}.time i{font-style:normal;color:var(--osm-text-muted);padding:0 2px}.chip{font-size:11px;font-variant-numeric:tabular-nums}.inspect-body{padding:19px 17px 17px}.inspect-body h3{margin:3px 0 6px;font-size:25px;letter-spacing:-.65px}.slot-time{color:var(--muted)}.divider{height:1px;background:var(--line);margin:16px 0 13px}.small-label{font-size:12px;font-weight:750;margin:0 0 8px}.drop{display:flex;width:100%;flex-direction:column;gap:7px;padding:16px 6px;border-style:dashed;border-color:var(--osm-border-strong);color:var(--osm-text-primary);background:var(--osm-surface-secondary);white-space:normal}.drop.drag,.drop:hover{background:var(--osm-surface-hover);border-color:var(--accent)}.drop-icon{width:32px;height:32px;border-radius:var(--osm-radius-action);display:grid;place-items:center;background:var(--osm-surface-selected)}.drop small{color:var(--muted);font-size:10px;font-weight:500}.audio-note{display:flex;gap:8px;align-items:flex-start;line-height:1.55;margin-top:13px;border-radius:var(--osm-radius-action);background:#f3f6f4;padding:9px 10px;color:#52665b;font-size:11px}.audio-note svg{width:14px;height:14px;margin-top:2px}#asset-name{font-size:11px;overflow-wrap:anywhere;color:var(--muted);margin:8px 0}.fit-label{display:flex;align-items:center;justify-content:space-between;font-size:11px;gap:5px}.fit-label select{border:1px solid var(--line);padding:4px;border-radius:5px;background:white;color:inherit}.plain{border:0;padding:5px 0;color:var(--osm-text-primary);background:transparent;font-size:11px}.timeline{margin-top:16px}.timeline-bar{height:52px}.timeline-tools{gap:5px}.vline{height:19px;border-left:1px solid var(--line);margin:0 4px}.split{background:var(--osm-surface-secondary);color:var(--osm-text-primary);border-color:var(--osm-border-strong);padding:6px 8px}.zoom{display:flex;align-items:center;gap:5px;color:var(--muted)}.zoom input{width:66px;accent-color:var(--accent)}.zoom svg{height:13px;width:13px}kbd{font:10px ui-monospace,monospace;padding:2px 4px;border:1px solid var(--osm-border-strong);border-radius:4px;background:var(--osm-bg-primary);color:var(--osm-text-muted)}.tracks{display:grid;grid-template-columns:124px minmax(0,1fr);padding-right:13px}.track-labels{color:var(--osm-text-muted);font-size:11px;font-weight:700}.track-labels>div{display:flex;gap:6px;align-items:center;padding-left:13px;border-right:1px solid var(--line);margin:0}.track-labels svg{width:15px;height:15px}.audio-label span:last-child svg{width:11px;color:#748779}.ruler-label,.ruler{height:31px;border-bottom:1px solid var(--line)}.video-label{height:66px;border-bottom:1px solid var(--line)}.audio-label{height:47px}.scroll{overflow-x:auto;overscroll-behavior-x:contain}#track{position:relative;min-width:100%;height:144px;background:var(--osm-surface-secondary)}.ruler{position:relative;cursor:crosshair;overflow:hidden;background:white;touch-action:none}.tick{position:absolute;bottom:0;height:6px;border-left:1px solid var(--osm-border-strong)}.tick span{position:absolute;bottom:7px;left:5px;font:10px ui-monospace,monospace;color:var(--osm-text-muted);white-space:nowrap}.slots{height:66px;position:relative;border-bottom:1px solid var(--line)}.slot{position:absolute;top:6px;height:54px;border-radius:6px;display:block;overflow:hidden;text-align:left;min-width:0;padding:0;color:var(--osm-text-primary);background:var(--osm-surface-selected);border:1px solid var(--osm-border-strong)}.slot.selected{outline:2px solid var(--osm-focus);outline-offset:-2px}.slot.drag{background:var(--osm-surface-hover)}.slot-media{position:absolute;inset:0 0 18px;background-size:auto 100%;opacity:.73;background-color:var(--osm-surface-hover)}.slot-title{position:absolute;bottom:1px;left:6px;max-width:calc(100% - 10px);overflow:hidden;text-overflow:ellipsis;font-size:10px}.wave{touch-action:none;height:47px;padding-top:3px;background:#f4f8f5;cursor:crosshair}.wave canvas{display:block;width:100%;height:38px;pointer-events:none}.marker{position:absolute;top:29px;width:16px;height:66px;transform:translateX(-50%);padding:0;background:transparent;border:0;border-radius:0;z-index:3;touch-action:none;cursor:ew-resize}.marker:before{content:'';width:2px;height:61px;background:var(--osm-focus);border-radius:2px}.marker:after{content:'';position:absolute;top:4px;width:8px;height:12px;border-radius:2px;background:var(--osm-focus);border:1px solid white}.marker:hover{background:#17171718}.needle{position:absolute;pointer-events:none;top:2px;bottom:0;width:1px;background:var(--osm-focus);z-index:4}.needle:before{content:'';position:absolute;top:0;left:-4px;width:9px;height:9px;background:var(--osm-focus);clip-path:polygon(0 0,100% 0,100% 58%,50% 100%,0 58%)}.timeline-foot{border-top:1px solid var(--line);padding:9px 13px;display:flex;justify-content:space-between;gap:12px;color:var(--muted);font-size:11px}.timeline-foot kbd{margin-left:5px}footer{display:flex;justify-content:space-between;align-items:center;margin-top:7px;color:var(--muted);font-size:11px}dialog{width:min(94vw,480px);border:1px solid var(--line);border-radius:var(--osm-radius-dialog);padding:22px;color:inherit;box-shadow:0 16px 60px #17171745}dialog::backdrop{background:#17171780}dialog h2{margin:0 0 13px;letter-spacing:-.5px}dialog p,dialog label{font-size:13px;color:var(--muted);line-height:1.5}dialog input{display:block;margin-top:7px;padding:8px;border:1px solid var(--line);border-radius:6px;width:100%}.dialog-actions{display:flex;justify-content:flex-end;gap:7px;margin-top:17px}progress{width:100%;accent-color:var(--accent)}@media(max-width:800px){.workspace{grid-template-columns:minmax(0,1fr) minmax(235px,.7fr)}.stage{height:300px}.project-info{display:none}.timeline-foot span:nth-child(2){display:none}}@media(max-width:620px){main{padding:18px 10px}.top{padding:0 10px}.brand{font-size:15px}.top-actions button{font-size:11px;padding:7px}.top-actions svg{display:none}.workspace{grid-template-columns:1fr}.stage{height:55vw;min-height:180px}.tracks{grid-template-columns:90px minmax(0,1fr)}.track-labels>div{padding-left:6px;gap:3px}.track-labels .audio-label span:last-child{display:none}.timeline-tools .zoom input{width:37px}.split kbd,.timeline-tools .vline,.zoom span{display:none}.panel-title{padding:0 9px}.timeline-tools{gap:2px}.project-head h1{font-size:25px}}

.format-bar{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:6px 12px;padding:7px 14px;border-bottom:1px solid var(--line)}
#source-format{color:var(--muted);font-size:11px;font-variant-numeric:tabular-nums}
.format-controls{display:flex;flex-wrap:wrap;align-items:center;gap:5px 10px}
.format-controls label{display:flex;align-items:center;gap:5px;color:var(--muted);font-size:11px}
.format-controls select{color:inherit;background:var(--osm-bg-primary);border:1px solid var(--line);border-radius:6px;padding:5px 6px}
.export-format-controls label{font-size:13px}

.entry {
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  align-items:center;
  gap:clamp(24px,5vw,76px);
  max-width:1200px;
  padding:clamp(24px,5vw,72px);
  margin:clamp(20px,7vh,76px) auto;
  border:1px solid var(--osm-border-subtle);
  border-radius:var(--osm-radius-surface);
  background:var(--osm-surface-primary);
}
.entry-copy {min-width:0}
.entry h1 {font-size:clamp(36px,5vw,70px);font-weight:650;line-height:1.02;letter-spacing:-.055em;margin:0 0 18px;max-width:12ch}
.entry p {color:var(--osm-text-muted);line-height:1.55;max-width:37ch;margin:0 0 16px}
.entry .entry-note,#entry-status {font-size:13px;margin-top:16px}
#entry-status:empty {display:none}
.entry-actions {display:flex;align-items:center;flex-wrap:wrap;gap:8px 16px;margin-top:24px}
.entry-actions .primary {min-height:48px;padding-inline:16px}
.entry-actions .plain {font-size:13px;text-decoration:underline;text-underline-offset:3px}
.entry-example {margin:0;min-width:0}
.entry-example img {width:100%;height:auto;display:block;border-radius:var(--osm-radius-control)}
.entry-example figcaption {padding-top:8px;color:var(--osm-text-muted);font-size:12px}
.workspace {grid-template-areas:"preview inspector" "timeline timeline"}
.preview {grid-area:preview;min-width:0}
.inspector {grid-area:inspector;min-width:0}
.timeline {grid-area:timeline;margin-top:0;min-width:0}
.top {height:auto;min-height:68px;padding-top:max(6px,env(safe-area-inset-top));padding-left:max(16px,env(safe-area-inset-left));padding-right:max(16px,env(safe-area-inset-right))}
main {padding-bottom:max(12px,env(safe-area-inset-bottom))}
button:not(.slot,.marker),.download-link {min-height:44px;min-width:44px}
.format-controls select,.fit-label select,dialog input {min-height:44px;border-radius:var(--osm-radius-control)}
.toggle {min-height:44px}
.toggle input {outline-offset:3px}
.toggle input:checked {background:var(--osm-action-primary)}
.toggle input:focus-visible, .ruler:focus-visible,.download-link:focus-visible,.marker:focus-visible {outline:2px solid var(--osm-focus);outline-offset:-2px}
.timeline-tools .primary,.drop.primary {background:var(--osm-action-primary);color:var(--osm-action-primary-text);border-color:var(--osm-action-primary)}
.drop.primary .drop-icon {background:#444;color:var(--osm-action-primary-text)}
.drop.primary small {color:#eee}
.drop small,.format-controls label,#source-format,.timeline-foot,.slot-title,.audio-note,.toggle,.fit-label,footer {font-size:12px}
.slot.selected {border:2px solid var(--osm-focus);outline:none}
.slot.selected .slot-title {font-weight:800;text-decoration:underline;text-underline-offset:2px}
.needle {width:2px}
.download-link {display:inline-flex;align-items:center;padding:8px 14px;border-radius:var(--osm-radius-action);font-weight:650;text-decoration:none}
.dialog-actions {flex-wrap:wrap}
dialog {max-height:calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 20px);overflow:auto}
.zoom input {min-height:44px}
.timeline-bar {height:auto;min-height:52px;flex-wrap:wrap;padding-block:3px}
.transport {gap:5px}
.transport-buttons {gap:2px}
.transport #fullscreen {flex:none}
@media(max-width:620px) {
  .workspace {grid-template-areas:"preview" "timeline" "inspector"}
  .top {flex-wrap:wrap;gap:4px;padding-block-end:6px}
  .top-actions {flex-wrap:wrap}
  .project-head h1 {font-size:22px}
  .panel-title {height:auto;min-height:50px}
  .timeline-bar {align-items:flex-start}
  .timeline-bar h2 {min-height:32px}
  .timeline-tools {flex-wrap:wrap}
  .timeline-tools .zoom input {width:55px}
  .timeline .ruler,.timeline .ruler-label {height:44px}
  .timeline #track {height:157px}
  .timeline .marker {top:42px}
  .transport button {padding:4px}
  .transport .time {font-size:11px;white-space:nowrap}
}

.top {
  padding-inline:max(var(--osm-container-mobile),calc((100vw - 1272px)/2));
}
main {
  padding-inline:clamp(var(--osm-container-mobile),4vw,var(--osm-container-desktop));
}
.project-head {margin-block:8px 20px}
.project-head h1 {font-weight:660;letter-spacing:-.04em}
.panel-title h2 svg {color:var(--osm-text-primary)}
.project-info {font-size:12px}
.panel-title {padding-inline:16px}
.slot.selected {background:var(--osm-bg-primary)}
#export-dialog select {border-color:var(--osm-border-strong)}
@media(max-width:740px) {
  .entry {grid-template-columns:1fr;max-width:540px}
  .entry h1 {font-size:clamp(35px,7vw,52px)}
}
@media(max-width:480px) {
  .top {padding-inline:max(var(--osm-container-mobile),env(safe-area-inset-left),env(safe-area-inset-right))}
  .top-actions {display:flex;gap:6px}
  .top-actions button {font-size:12px}
  .brand {gap:9px}
  .brand-name {padding-inline-start:9px;font-size:14px}
  .osm-logo img {width:25px;height:24px}
  .entry {padding:22px;gap:20px;margin-block:18px}
  .panel-title {padding-inline:10px}
}

.audio-tools {display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;padding:6px 13px;border-top:1px solid var(--osm-border-subtle)}
#audio-lock,#audio-add,#audio-ranges button {font-size:12px}
#audio-ranges {display:flex;flex-wrap:wrap;gap:6px}
.audio-fields {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
#card-form label {display:block;margin-top:10px}
#card-mode {display:block;width:100%;margin-top:7px;padding:8px;min-height:44px;border:1px solid var(--osm-border-strong);border-radius:var(--osm-radius-control);background:var(--osm-bg-primary);color:inherit}
#card-error,#audio-error {color:#8b231e}
#cards {position:absolute;top:31px;left:0;width:100%;height:66px;pointer-events:none}
.timeline-card {position:absolute;top:6px;min-width:0;height:54px;padding:3px;display:block;overflow:hidden;text-overflow:ellipsis;background:var(--osm-action-primary);color:var(--osm-text-inverse);border:1px solid var(--osm-border-strong);border-radius:4px;pointer-events:auto;font-size:11px;z-index:2}
.timeline-card:hover,.timeline-card:focus-visible {background:var(--osm-action-hover);color:var(--osm-text-inverse)}
.timeline-card.overlay {top:7px;height:22px;border-style:dashed;background:var(--osm-bg-primary);color:var(--osm-text-primary)}
.timeline-card:focus-visible {outline-offset:1px}
@media(max-width:620px) {
  #cards {top:44px}
  .audio-tools {padding-inline:8px}
  #card-form .dialog-actions,#audio-form .dialog-actions {justify-content:flex-start}
}
#cards .timeline-card {min-width:0;min-height:0}

#trim-add,#trim-ranges button {font-size:12px}
#trim-ranges {display:flex;flex-wrap:wrap;gap:6px}
#trim-ranges:empty {display:none}
.trim-seam {position:absolute;top:30px;bottom:0;border-left:2px dashed var(--osm-text-muted);pointer-events:none;z-index:2}
@media(max-width:620px) {.trim-seam {top:43px}}

#edge-guide {position:absolute;top:30px;bottom:0;pointer-events:none;border-left:2px dashed var(--osm-text-muted);z-index:2}
#edge-open {
  position:absolute;top:-6px;transform:translateX(-50%);z-index:5;
  width:44px;height:44px;padding:0;border:0;background:transparent;
}
#edge-open svg {
  width:23px;height:23px;padding:3px;color:var(--osm-text-inverse);
  border-radius:50%;background:var(--osm-action-primary);box-shadow:0 0 0 2px var(--osm-bg-primary);
}
#edge-open:hover svg,#edge-open[aria-expanded="true"] svg {background:var(--osm-action-hover)}
#edge-actions {
  position:fixed;margin:0;padding:6px;max-width:calc(100vw - 16px);width:245px;
  max-height:calc(100dvh - 16px);overflow:auto;
  background:var(--osm-surface-primary);color:var(--osm-text-primary);
  border:1px solid var(--osm-border-strong);border-radius:var(--osm-radius-control);
  box-shadow:0 3px 12px #17171724;
}
#edge-actions p {margin:6px 8px;font-size:12px;color:var(--osm-text-muted)}
#edge-actions button {width:100%;justify-content:flex-start;text-align:left;white-space:normal;border-color:transparent}
@media(max-width:620px) {
  #edge-guide {top:43px}
  #edge-open {top:0}
}

.endpoint-tools {display:flex;justify-content:space-between;gap:6px;padding:3px 13px;border-top:1px solid var(--osm-border-subtle)}
.endpoint-tools button {border-color:transparent;background:transparent;padding-inline:8px;font-size:12px}
.endpoint-tools button:hover {background:var(--osm-surface-hover)}
#card-sound {display:block;width:100%;min-height:44px;margin-top:7px;padding:8px;border:1px solid var(--osm-border-strong);border-radius:var(--osm-radius-control);background:var(--osm-bg-primary);color:inherit}
#cut-pause {margin-bottom:8px}

#audio-track-title {display:inline}

#range-controls {display:flex;align-items:center;gap:6px;flex-wrap:wrap}
#select-range,#range-controls button {font-size:12px}
#select-range[aria-pressed="true"] {background:var(--osm-surface-selected)}
#range-readout {font-variant-numeric:tabular-nums;font-size:12px}
#range-layer {position:absolute;top:31px;bottom:0;inset-inline:0;pointer-events:none;z-index:6}
#range-shade {position:absolute;top:0;bottom:0;left:var(--range-start);right:calc(100% - var(--range-end));background:#42668922;border-inline:2px solid #345a77}
.range-handle {position:absolute;top:calc(100% - 44px);display:grid;place-items:center;width:44px;height:44px;transform:translateX(-50%);pointer-events:auto;touch-action:none;cursor:ew-resize}
.range-handle::before {content:'';width:10px;height:25px;background:#345a77;border:2px solid white;border-radius:4px}
.range-handle:focus-visible {outline:2px solid var(--osm-focus);outline-offset:-3px}
#range-handle-start {left:clamp(22px,var(--range-start),calc(100% - 22px))}
#range-handle-end {left:clamp(22px,var(--range-end),calc(100% - 22px))}
#range-handle-start {top:calc(100% - 58px)}
#range-handle-end {top:calc(100% - 43px)}
.range-handle:focus,.range-handle:hover {z-index:1}
@media(max-width:620px) {#range-layer {top:44px}}

#scene-tools {display:flex;align-items:center;gap:8px 12px;flex-wrap:wrap;padding:4px 13px;border-bottom:1px solid var(--osm-border-subtle)}
#scene-action {font-size:12px;min-height:44px}
#scene-status {font-size:12px;color:var(--osm-text-muted)}
#scene-progress {width:100px;height:6px;accent-color:var(--osm-action-primary)}
#scene-comparison {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-block:12px}
#scene-comparison figure {margin:0;min-width:0}
#scene-comparison img {display:block;width:100%;border-radius:4px}
#scene-comparison figcaption {margin-top:4px;font-size:12px;color:var(--osm-text-muted)}
.marker-detected::after {background:var(--osm-bg-primary);box-shadow:0 0 0 1px var(--osm-focus)}

#projects-dialog {width:min(94vw,580px)}
#project-actions {display:flex;flex-wrap:wrap;gap:6px}
#projects-list {display:grid;gap:7px;margin-top:12px;max-height:54vh;overflow:auto}
#projects-list button {display:flex;justify-content:flex-start;align-items:center;gap:12px;text-align:left;white-space:normal;overflow-wrap:anywhere}
#projects-list img {width:74px;aspect-ratio:16/9;object-fit:contain;border-radius:4px;background:#191919}
#projects-list small {display:block;margin-top:3px;color:var(--osm-text-muted);font-size:11px}
#projects-status:empty {display:none}

.project-notice { margin:0 0 12px; padding:10px 14px; border:1px solid var(--line); border-left:3px solid var(--osm-text-primary); border-radius:var(--osm-radius-action); background:var(--panel); font-size:.875rem; }
#save-conflict, #save-failure { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px 16px; margin:12px 0 0; }
#save-conflict p, #save-failure p { margin:0; }
#asset-warning { color:var(--osm-text-primary); font-size:.875rem; line-height:1.5; margin:9px 0 0; }

.footer-links,.brief-actions,.brief-head,.brief-block-head {display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.footer-links {gap:4px 16px}
.entry-actions {flex-wrap:wrap}
#brief-dialog {width:min(94vw,640px);max-height:90dvh;overflow:auto}
.brief-head,.brief-block-head {justify-content:space-between}
.brief-head h2 {margin:0}
#brief-form,#brief-result,#brief-blocks {display:grid;gap:12px}
#brief-form,#brief-result {margin-top:18px}
#brief-dialog input,#brief-dialog textarea,#brief-dialog select {width:100%;margin:0;padding:9px 11px;font:inherit;color:inherit;background:var(--panel);border:1px solid var(--osm-border-strong);border-radius:var(--osm-radius-action)}
#brief-dialog textarea {resize:vertical;line-height:1.5}
#brief-dialog label,#brief-dialog summary {font-size:.94rem;color:var(--osm-text-primary);font-weight:650}
#brief-dialog label small {font-weight:400;color:var(--muted)}
#brief-dialog summary {cursor:pointer;padding:8px 0}
#brief-dialog details label {display:block;margin:12px 0 5px}
#brief-dialog details {border-top:1px solid var(--line)}
#brief-dialog h3,#brief-dialog p {margin:0;overflow-wrap:anywhere}
#brief-dialog #brief-status:not(:empty) {margin-top:10px}
#brief-result-heading {font-size:1.15rem}
#brief-provenance {white-space:pre-line}
#brief-form>button {justify-self:start}
#brief-blocks section {min-width:0}
.brief-block-head {margin-bottom:6px}
#brief-blocks textarea {font-size:.875rem}

#brief-custom-fields,#brief-slide-fields {display:grid;gap:7px}
#brief-slot {font-variant-numeric:tabular-nums}
#brief-history-list {margin-top:8px}
#slot-brief {min-height:36px;text-align:left;white-space:normal}

.entry-start {margin-top:24px;padding-top:20px;border-top:1px solid var(--line)}
.entry-start h2 {font-size:1.2rem;margin:0 0 6px}
.entry-start p {max-width:46ch}
#brief-outcome,#brief-service-note,#brief-return-note,#brief-source-details p,#brief-osm-note {color:var(--muted);line-height:1.5}
#brief-dialog details p {margin-block:6px}
.brief-handoff,#brief-return {display:grid;justify-items:start;gap:9px}
#brief-service {border:1px solid var(--osm-border-strong);font-size:.94rem;color:inherit}
#brief-service.primary {color:white}
#brief-return {border-block:1px solid var(--line);padding-block:16px}
#brief-return h4 {margin:0;font-size:1.05rem}
#brief-review {margin-block:12px}
#brief-review p {margin:0 0 6px}
#brief-dialog button,#brief-dialog a {white-space:normal}

@media (max-width:740px), (pointer:coarse) {
  html:has(dialog[open]) {overflow:hidden}
  dialog[open],#brief-dialog[open] {
    --dialog-gap-top:max(8px,env(safe-area-inset-top));
    --dialog-gap-bottom:max(8px,env(safe-area-inset-bottom));
    position:fixed;
    inset:calc(var(--dialog-view-top,0px) + var(--dialog-gap-top)) 0 auto;
    margin:0 auto;
    max-width:calc(100% - 2 * max(8px,env(safe-area-inset-left),env(safe-area-inset-right)));
    max-height:calc(var(--dialog-view-height,100vh) - var(--dialog-gap-top) - var(--dialog-gap-bottom));
    max-height:calc(var(--dialog-view-height,100dvh) - var(--dialog-gap-top) - var(--dialog-gap-bottom));
    padding:12px 14px;
    border-radius:var(--osm-radius-surface);
    overscroll-behavior:contain;
    scroll-padding-block:8px;
    overflow:auto;
  }
  dialog h2 {font-size:1.18rem;line-height:1.25}
  #brief-form,#brief-result,#brief-blocks {gap:7px;min-width:0}
  #brief-form,#brief-result {margin-top:8px}
  #brief-dialog .brief-head {flex-wrap:nowrap;gap:8px}
  #brief-dialog .brief-head button {padding:6px 10px}
  #brief-dialog textarea {resize:vertical;max-height:clamp(44px,calc(var(--dialog-view-height,100dvh) * .3),8rem)}
  #brief-dialog input,#brief-dialog select,#brief-dialog textarea,
  dialog input,dialog select,.format-controls select,.fit-label select {
    font-size:max(16px,1rem);
    line-height:1.3;
    min-height:44px;
    min-width:0;
    max-width:100%;
  }
  #brief-dialog input,#brief-dialog select,#brief-dialog textarea {padding:7px 9px}
  #brief-dialog summary {padding-block:6px}
  #brief-dialog details label {margin-top:8px}
  #brief-dialog #brief-outcome {line-height:1.35}
}

.endpoint-tools,.end-actions {display:flex;align-items:center;flex-wrap:wrap;gap:6px}
.end-actions {margin-inline-start:auto;justify-content:flex-end}
#append-open {border:1px solid var(--osm-border-strong);background:var(--panel);font-size:.875rem}
#parts-dialog {width:min(94vw,560px)}
#parts-list {padding-inline-start:1.75rem}
#parts-list li {overflow-wrap:anywhere;border-block-end:1px solid var(--line);padding:8px 0;font-size:.95rem}
#parts-list li::marker {font-variant-numeric:tabular-nums}
#parts-list li div {display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}
#parts-list button {padding:4px 8px}
#part-title {overflow-wrap:anywhere}
#cards .appended-part {background:var(--osm-surface-selected);color:var(--osm-text-primary);text-overflow:ellipsis}

#entry-drop-cover {position:fixed;inset:0;z-index:20;display:flex;align-items:center;justify-content:center;gap:12px;pointer-events:none;background:#171717e8;color:var(--osm-action-primary-text);border:3px dashed currentColor;font-size:clamp(1.2rem,4vw,2rem);font-weight:700}

#project-edit-actions {display:flex;flex-wrap:wrap;gap:6px;border-top:1px solid var(--line);margin-top:12px;padding-top:12px}
button.danger {color:#98271d;border-color:#98271d}
button.primary.danger {background:#98271d;border-color:#98271d;color:#fff}

.visually-hidden {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
#parts-list button {min-height:44px;min-width:44px}

#cards .appended-part[aria-pressed="true"] {outline:2px solid var(--osm-focus);outline-offset:-2px}
#cards .appended-part:focus-visible {outline:2px solid var(--osm-focus);outline-offset:1px}
.part-actions {display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.part-actions button {min-height:44px}
.part-key-hint {font-size:.8rem;color:var(--osm-text-muted)}
@media (pointer:coarse) {.part-key-hint{display:none}}
