/* ── Workspace grid ─────────────────────────────────────── */
.ws {
  position: relative; min-height: 0; min-width: 0;
  display: grid; gap: 4px; padding: 4px;
  background: var(--gutter);
  --x: 34%; --y: 58%;
}
.pg { display: none; }

/* Trailers (client work) and Experiments (personal projects) share the edit layout.
   Each column has its own horizontal split (--yl left, --yr right): three rows where the
   middle one is the difference between the two, and panels span into it as needed. */
.app:is([data-workspace="editing"], [data-workspace="other"]) .ws {
  --yl: 50%; --yr: 64%;
  grid-template-columns: var(--x) 34px minmax(0, 1fr) 40px;
  grid-template-rows: min(var(--yl), var(--yr)) max(0px, calc(max(var(--yl), var(--yr)) - min(var(--yl), var(--yr)) - 4px)) minmax(0, 1fr);
  grid-template-areas: "source program program program" "project program program program" "project tools timeline meters";
}
.app:is([data-workspace="editing"], [data-workspace="other"]) .ws[data-order="b"] {
  grid-template-areas: "source program program program" "source tools timeline meters" "project tools timeline meters";
}
.app:is([data-workspace="editing"], [data-workspace="other"]) :is(#pg-source, #pg-program, #pg-project, #pg-tools, #pg-timeline, #pg-meters) { display: flex; }

.app[data-workspace="photography"] .ws {
  grid-template-columns: var(--x) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas: "photos viewer";
  --x: 40%;
}
.app[data-workspace="photography"] :is(#pg-photos, #pg-viewer) { display: flex; }

.app[data-workspace="learning"] .ws {
  grid-template-columns: var(--x) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas: "learn reader";
  --x: 32%;
}
.app[data-workspace="learning"] :is(#pg-learn, #pg-reader) { display: flex; }

.app[data-workspace="color"] .ws {
  grid-template-columns: var(--x) minmax(0, 1fr) 320px;
  grid-template-rows: var(--y) minmax(0, 1fr);
  grid-template-areas: "egfx program lumetri" "scopes timeline lumetri";
  --x: 30%; --y: 60%;
}
.app[data-workspace="color"] :is(#pg-program, #pg-egfx, #pg-scopes, #pg-lumetri, #pg-timeline) { display: flex; }

.app[data-workspace="export"] .ws { grid-template: "export" minmax(0, 1fr) / minmax(0, 1fr); }
.app[data-workspace="export"] #pg-export { display: flex; }

#pg-source { grid-area: source; } #pg-program { grid-area: program; } #pg-project { grid-area: project; }
#pg-tools { grid-area: tools; } #pg-timeline { grid-area: timeline; } #pg-meters { grid-area: meters; }
#pg-lumetri { grid-area: lumetri; } #pg-scopes { grid-area: scopes; }
#pg-export { grid-area: export; } #pg-learn { grid-area: learn; } #pg-egfx { grid-area: egfx; }
#pg-reader { grid-area: reader; } #pg-photos { grid-area: photos; } #pg-viewer { grid-area: viewer; }

/* maximized panel (` key / expand button) */
.ws.has-max { grid-template: "max" minmax(0, 1fr) / minmax(0, 1fr) !important; }
.ws.has-max .pg { display: none !important; }
.ws.has-max .pg.max { display: flex !important; grid-area: max !important; }
.ws.has-max .splitter { display: none; }

/* splitters */
.splitter { position: absolute; z-index: 5; display: none; }
.app:is([data-workspace="editing"], [data-workspace="other"], [data-workspace="color"], [data-workspace="learning"], [data-workspace="photography"]) .splitter { display: block; }
.splitter-x { width: 8px; cursor: col-resize; }
.splitter-y { height: 8px; cursor: row-resize; }
.splitter::after { content: ''; position: absolute; inset: 3px; border-radius: 2px; background: transparent; transition: background .15s; }
.splitter:hover::after, .splitter.drag::after { background: var(--accent); }
body.resizing-x, body.resizing-x * { cursor: col-resize !important; }
body.resizing-y, body.resizing-y * { cursor: row-resize !important; }

/* ── Panel group ───────────────────────────────────────── */
.pg {
  flex-direction: column; min-width: 0; min-height: 0;
  background: var(--panel); border-radius: var(--radius);
  overflow: hidden; position: relative;
  box-shadow: 0 0 0 1px transparent;
  transition: box-shadow .12s;
}
.pg.focused { box-shadow: 0 0 0 1px var(--focus-ring); }
.pg-tabs {
  height: var(--tab-h); flex: none; display: flex; align-items: center; gap: 2px;
  padding: 0 4px 0 6px; background: var(--panel-head);
  border-bottom: 1px solid #141414;
  overflow-x: auto; scrollbar-width: none;
}
.pg-tabs::-webkit-scrollbar { display: none; }
.pg-tab {
  height: 100%; padding: 0 8px; display: flex; align-items: center; gap: 4px;
  color: var(--text-2); font-size: var(--fs-l); white-space: nowrap; position: relative; flex: none;
}
.pg-tab:hover { color: var(--text-hi); }
.pg-tab.active { color: var(--text-hi); font-weight: 600; }
.pg.focused .pg-tab.active::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: 0; height: 2px; background: var(--accent); border-radius: 1px; }
.pg-tab .pm { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 3px; color: var(--text-3); margin-left: 2px; }
.pg-tab .pm:hover { background: var(--panel-3); color: var(--text-hi); }
.pg-tab .pm .i { width: 12px; height: 12px; }
.pg-tabs .grow { flex: 1; }
.pg-body { flex: 1; position: relative; min-height: 0; }
.panel { position: absolute; inset: 0; display: none; flex-direction: column; min-height: 0; }
.panel.active { display: flex; }

.panel-bar {
  flex: none; display: flex; align-items: center; gap: 4px; padding: 3px 6px; min-height: 28px;
  border-top: 1px solid #161616; background: var(--panel); color: var(--text-2);
}
.panel-bar .sep { width: 1px; height: 16px; background: var(--line); margin: 0 3px; }
.panel-bar .grow { flex: 1; }

/* fields */
.field {
  height: 22px; background: var(--field); border: 1px solid #333; border-radius: 3px; padding: 0 6px;
  color: var(--text-hi); font-size: var(--fs); min-width: 0;
}
.field:focus { border-color: var(--accent); outline: none; }
.search { position: relative; display: flex; align-items: center; }
.search .i { position: absolute; left: 6px; width: 12px; height: 12px; color: var(--text-3); pointer-events: none; }
.search .field { padding-left: 22px; width: 100%; }
.dd {
  display: inline-flex; align-items: center; gap: 2px; height: 20px; padding: 0 4px 0 6px; border-radius: 3px;
  color: var(--text-2); font-size: var(--fs-s);
}
.dd:hover { background: var(--panel-3); color: var(--text-hi); }
.dd .i { width: 10px; height: 10px; }
.tbtn { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 3px; color: var(--text-2); flex: none; }
.tbtn:hover { background: var(--panel-3); color: var(--text-hi); }
.tbtn.on { color: var(--accent-2); }
.tbtn.on-bg { background: #2f3b4c; color: var(--accent-2); }
.tbtn:disabled { opacity: .35; }
.tbtn .i { width: 15px; height: 15px; }
.range { -webkit-appearance: none; appearance: none; height: 14px; background: transparent; width: 70px; }
.range::-webkit-slider-runnable-track { height: 3px; background: #444; border-radius: 2px; }
.range::-moz-range-track { height: 3px; background: #444; border-radius: 2px; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 10px; height: 10px; border-radius: 50%; background: #cfcfcf; margin-top: -3.5px; }
.range::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: #cfcfcf; border: 0; }

/* ── Monitors ──────────────────────────────────────────── */
.monitor { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.mon-view { flex: 1; min-height: 0; position: relative; container-type: size; display: grid; place-items: center; padding: 6px 8px 0; }
.mon-frame {
  position: relative; background: #000; overflow: hidden;
  width: 100%; max-height: 100%; /* fallback for browsers without container units */
  width: min(100cqw - 16px, (100cqh - 6px) * 16 / 9);
  aspect-ratio: 16 / 9;
  box-shadow: 0 0 0 1px #000;
}
.mon-frame > * { position: absolute; inset: 0; }
.mon-poster { width: 100%; height: 100%; object-fit: cover; opacity: 1; transition: opacity .2s; }
.mon-poster.hidden { opacity: 0; }
.player-host { pointer-events: none; }
.player-host .player-slot, .player-host iframe, .player-host video, .player-host .player-slot > div { position: absolute; inset: 0; width: 100% !important; height: 100% !important; border: 0; }
.player-host video { object-fit: contain; background: #000; }
.player-host.hidden { visibility: hidden; }
.mon-shield { cursor: default; background: transparent; }
.mon-black { background: #000; opacity: 0; pointer-events: none; transition: opacity .15s; }
.mon-black.on { opacity: 1; }
.mon-safe { pointer-events: none; display: none; }
.mon-safe.on { display: block; }
.mon-safe::before, .mon-safe::after { content: ''; position: absolute; border: 1px solid rgba(255,255,255,.55); }
.mon-safe::before { inset: 5% 5%; }
.mon-safe::after { inset: 10% 10%; }
.mon-safe i { position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px; }
.mon-safe i::before, .mon-safe i::after { content: ''; position: absolute; background: rgba(255,255,255,.55); }
.mon-safe i::before { left: 7.5px; top: 0; width: 1px; height: 16px; }
.mon-safe i::after { top: 7.5px; left: 0; height: 1px; width: 16px; }
.mon-overlay-title {
  inset: auto 0 0 0; padding: 30px 14px 10px; pointer-events: none;
  background: linear-gradient(transparent, rgba(0,0,0,.75));
  opacity: 0; transition: opacity .25s;
  font-size: clamp(11px, 2.2cqw, 18px);
}
.mon-overlay-title.on { opacity: 1; }
.mon-overlay-title b { color: #fff; font-weight: 700; display: block; font-size: 1.25em; }
.mon-overlay-title span { color: rgba(255,255,255,.75); }
.mon-bigplay {
  inset: auto; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(20,20,20,.65); border: 1.5px solid rgba(255,255,255,.7);
  color: #fff; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); transition: transform .15s, opacity .2s, background .15s; cursor: pointer;
}
.mon-bigplay:hover { transform: scale(1.06); background: var(--accent); border-color: var(--accent); }
.mon-bigplay .i { width: 24px; height: 24px; margin-left: 3px; }
.mon-bigplay.hidden { opacity: 0; pointer-events: none; }
.mon-loading { inset: auto; left: 50%; top: 50%; width: 36px; height: 36px; margin: -18px; border-radius: 50%; border: 3px solid rgba(255,255,255,.2); border-top-color: #fff; animation: spin .8s linear infinite; display: none; }
.mon-loading.on { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.mon-info { flex: none; display: flex; align-items: center; gap: 6px; padding: 4px 8px 0; height: 26px; }
.tc { font: 500 15px/1 var(--font); color: var(--timecode); font-variant-numeric: tabular-nums; letter-spacing: .02em; white-space: nowrap; }
.tc.dim { color: var(--text-2); }
.tc-edit { background: none; border: 0; padding: 0 2px; width: 7.4em; cursor: text; border-radius: 2px; }
.tc-edit:focus { outline: 1px solid var(--accent); background: var(--field); }
.mon-info .grow { flex: 1; }
.mon-ruler { flex: none; position: relative; height: 22px; margin: 2px 8px 0; cursor: pointer; }
.mon-ruler canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.mon-ruler .ph { position: absolute; top: 0; bottom: 0; width: 0; pointer-events: none; }
.mon-ruler .ph::before { content: ''; position: absolute; left: -6px; top: 0; border: 6px solid transparent; border-top: 8px solid var(--playhead); border-bottom: 0; }
.mon-ruler .ph::after { content: ''; position: absolute; left: -.5px; top: 6px; bottom: 0; width: 1px; background: var(--playhead); }
.mon-zoombar { flex: none; height: 6px; margin: 2px 8px; border-radius: 3px; background: #2a2a2a; position: relative; }
.mon-zoombar i { position: absolute; left: 0; right: 0; top: 0; bottom: 0; border-radius: 3px; background: #4a4a4a; }
.mon-transport { flex: none; display: flex; align-items: center; justify-content: center; gap: 2px; padding: 4px 8px 6px; flex-wrap: nowrap; overflow: hidden; }
.mon-transport .tbtn { width: 28px; height: 26px; color: var(--text-2); }
.mon-transport .tbtn:hover { color: var(--text-hi); }
.mon-transport .tbtn.play { width: 32px; color: var(--text-hi); }
.mon-transport .tbtn.play .i { width: 17px; height: 17px; }
.mon-transport .gap { width: 10px; flex: none; }

/* source monitor extras */
.src-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--text-3); font-size: var(--fs-l); padding: 20px; }
.src-meta {
  inset: auto 0 0 0; padding: 22px 10px 8px; background: linear-gradient(transparent, rgba(0,0,0,.8));
  font-size: 11px; color: rgba(255,255,255,.8); pointer-events: none;
}
.src-meta b { color: #fff; font-size: 13px; display: block; }
.scrub-line { inset: 0 auto 0 0; width: 1px; background: #ff4d4d; display: none; pointer-events: none; }

/* ── Effect controls / metadata ───────────────────────── */
.ec { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); height: 100%; min-height: 0; font-size: var(--fs); }
.ec-left { overflow: auto; min-height: 0; border-right: 1px solid #161616; user-select: text; -webkit-user-select: text; }
.ec-right { position: relative; overflow: hidden; background: #191919; }
.ec-head { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-bottom: 1px solid #161616; color: var(--text-2); white-space: nowrap; overflow: hidden; }
.ec-head b { color: var(--text-hi); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.ec-sec { padding: 4px 8px 2px; color: var(--text-3); font-size: var(--fs-s); text-transform: uppercase; letter-spacing: .06em; }
.fx { border-bottom: 1px solid #191919; }
.fx-head { display: flex; align-items: center; gap: 4px; padding: 3px 6px; height: 24px; color: var(--text-hi); cursor: pointer; }
.fx-head .tw { color: var(--text-3); transition: transform .12s; }
.fx-head .tw .i { width: 10px; height: 10px; }
.fx.open .fx-head .tw { transform: rotate(90deg); }
.fx-head .fxb { font-size: 9px; font-weight: 700; color: #1a1a1a; background: #c9c9c9; border-radius: 2px; padding: 0 2px; line-height: 12px; font-style: italic; }
.fx-head .rst { margin-left: auto; color: var(--text-3); }
.fx-body { display: none; padding: 0 0 4px; }
.fx.open .fx-body { display: block; }
.prop { display: grid; grid-template-columns: 18px minmax(70px, 110px) minmax(0, 1fr); align-items: center; gap: 4px; padding: 0 6px 0 16px; min-height: 22px; }
.prop .sw { color: var(--text-3); }
.prop .sw .i { width: 12px; height: 12px; }
.prop .sw.on { color: var(--accent-2); }
.prop .k { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prop .v { color: var(--text-hi); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prop .v.num { color: var(--timecode); cursor: ew-resize; text-decoration: underline dotted rgba(74,163,255,.5); text-underline-offset: 2px; font-variant-numeric: tabular-nums; }
.prop .v.link { color: var(--accent-2); cursor: pointer; }
.prop.wrap .v { white-space: normal; line-height: 1.45; padding: 3px 0; }
.ec-bar { position: absolute; top: 34px; height: 14px; border-radius: 2px; background: var(--c-violet); opacity: .85; font-size: 10px; color: #120d1d; padding: 0 4px; line-height: 14px; overflow: hidden; white-space: nowrap; }
.ec-ruler { position: absolute; left: 0; right: 0; top: 0; height: 28px; border-bottom: 1px solid #222; }
.ec-ph { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--playhead); }
.ec-kf { position: absolute; width: 8px; height: 8px; margin: -4px; transform: rotate(45deg); background: #cfcfcf; }
.ec-empty { padding: 16px; color: var(--text-3); }

.meta-list { padding: 8px 10px; overflow: auto; height: 100%; user-select: text; -webkit-user-select: text; }
.meta-list dl { margin: 0; display: grid; grid-template-columns: 110px 1fr; gap: 4px 10px; }
.meta-list dt { color: var(--text-3); }
.meta-list dd { margin: 0; color: var(--text-hi); }

/* ── Project panel ─────────────────────────────────────── */
.proj { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.proj-top { flex: none; display: flex; align-items: center; gap: 6px; padding: 5px 8px; }
.proj-top .crumbs { display: flex; align-items: center; gap: 2px; color: var(--text-2); white-space: nowrap; overflow: hidden; min-width: 0; flex: 1; font-size: var(--fs); }
.proj-top .crumbs button { color: var(--text-2); padding: 1px 3px; border-radius: 3px; }
.proj-top .crumbs button:hover { background: var(--panel-3); color: var(--text-hi); }
.proj-top .crumbs .cur { color: var(--text-hi); font-weight: 600; }
.proj-top .count { color: var(--text-3); white-space: nowrap; font-size: var(--fs-s); }
.proj-top .search { width: 42%; max-width: 220px; min-width: 110px; }
.proj-scroll { flex: 1; min-height: 0; overflow: auto; position: relative; }
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tile, 168px), 1fr)); gap: 10px 8px; padding: 6px 8px 12px; }
.tile { display: flex; flex-direction: column; gap: 4px; border-radius: 4px; padding: 3px; outline: 1.5px solid transparent; min-width: 0; }
.tile:hover { background: #262626; }
.tile[data-item] { cursor: pointer; }
/* a play badge on hover says "this plays" without words */
.proj-grid .tile[data-item] .thumb::after { content: ''; position: absolute; left: 50%; top: 50%; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%;
  background: rgba(0,0,0,.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5.5 3.5 12 8l-6.5 4.5z' fill='white'/%3E%3C/svg%3E") 55% 50% / 18px no-repeat;
  box-shadow: 0 0 0 1px rgba(255,255,255,.35); opacity: 0; transform: scale(.85); transition: opacity .15s, transform .15s; pointer-events: none; }
.proj-grid .tile[data-item]:hover .thumb::after { opacity: 1; transform: none; }
.photo-grid .tile[data-item] .thumb::after { display: none; }
.tile.sel { outline-color: var(--accent); background: #24303d; }
.tile .thumb { position: relative; aspect-ratio: 16/9; background: #0b0b0b; border-radius: 2px; overflow: hidden; }
.tile .thumb img, .tile .thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile .thumb .dur { position: absolute; right: 4px; bottom: 4px; background: rgba(0,0,0,.75); color: #eee; font-size: 10px; padding: 0 4px; border-radius: 2px; font-variant-numeric: tabular-nums; }
.tile .thumb .badge { position: absolute; left: 4px; top: 4px; background: rgba(0,0,0,.7); color: #eee; font-size: 9.5px; padding: 1px 5px; border-radius: 2px; text-transform: uppercase; letter-spacing: .05em; }
.tile .thumb .scrub { position: absolute; top: 0; bottom: 0; width: 1px; background: #ff4d4d; display: none; }
.tile .thumb .scrub-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.15); display: none; }
.tile .thumb .scrub-bar i { display: block; height: 100%; background: var(--accent); width: 0; }
.tile:hover .thumb .scrub, .tile:hover .thumb .scrub-bar { display: block; }
.tile .name { display: flex; align-items: center; gap: 5px; font-size: var(--fs); color: var(--text); min-width: 0; padding: 0 1px; }
.tile .name .i { width: 13px; height: 13px; color: var(--text-3); }
.tile .name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .sub { font-size: var(--fs-s); color: var(--text-3); padding: 0 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: -3px; }
.proj-bins { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px; padding: 6px 8px 2px; }
.bin-chip { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 4px; background: #232323; border: 1px solid #2a2a2a; min-width: 0; outline: 1.5px solid transparent; }
.bin-chip:hover { background: #2a2a2a; }
.bin-chip.sel { outline-color: var(--accent); }
.bin-chip .i { width: 18px; height: 18px; color: var(--c-mango); flex: none; }
.bin-chip b { display: block; font-weight: 500; color: var(--text-hi); font-size: var(--fs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bin-chip small { display: block; color: var(--text-3); font-size: var(--fs-s); }
.bin-chip > span:last-child { min-width: 0; }
.chip { display: inline-block; width: 10px; height: 10px; border-radius: 2px; flex: none; }

.proj-list { width: 100%; border-collapse: collapse; font-size: var(--fs); table-layout: fixed; }
.proj-list th { position: sticky; top: 0; z-index: 1; background: var(--panel); text-align: left; font-weight: 400; color: var(--text-2); padding: 4px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-list th.sorted { color: var(--text-hi); }
.proj-list th:hover { color: var(--text-hi); }
.proj-list td { padding: 3px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); height: 24px; }
.proj-list tr:nth-child(even) td { background: #212121; }
.proj-list tr:hover td { background: #292929; }
.proj-list tr.sel td { background: #2b4058 !important; color: #fff; }
.proj-list .nm { display: flex; align-items: center; gap: 6px; overflow: hidden; }
.proj-list .nm span { overflow: hidden; text-overflow: ellipsis; }
.proj-list .nm .i { width: 13px; height: 13px; color: var(--text-3); }
.proj-list .num { font-variant-numeric: tabular-nums; color: var(--text-2); }

/* ── Tools panel ───────────────────────────────────────── */
.pg-tools { padding: 4px 0; align-items: center; gap: 2px; }
.pg-tools .tbtn { width: 26px; height: 26px; position: relative; }
.pg-tools .tbtn.active { background: #2f3b4c; color: var(--accent-2); }
.pg-tools .tbtn .tri { position: absolute; right: 1px; bottom: 1px; border: 2.5px solid transparent; border-right-color: var(--text-3); border-bottom-color: var(--text-3); }
.pg-tools .sep { width: 18px; height: 1px; background: var(--line); margin: 3px 0; }

/* ── Audio meters ──────────────────────────────────────── */
.pg-meters { padding: 6px 4px 4px; align-items: stretch; }
.meters { flex: 1; display: grid; grid-template-columns: 1fr 1fr 12px; gap: 2px; min-height: 0; }
.meter { position: relative; background: #0d0d0d; border-radius: 1px; overflow: hidden; }
.meter i {
  position: absolute; left: 0; right: 0; bottom: 0; height: 0;
  background: linear-gradient(to top, #2fbf4a 0%, #2fbf4a 62%, #d8d23c 78%, #e6922f 88%, #e5484d 96%);
  background-size: 100% var(--mh, 300px); background-position: bottom; transition: height .06s linear;
}
.meter b { position: absolute; left: 0; right: 0; height: 2px; background: #e8e8e8; bottom: 0; opacity: .8; }
.meter-scale { position: relative; font-size: 8px; color: var(--text-3); }
.meter-scale span { position: absolute; right: 0; transform: translateY(50%); font-variant-numeric: tabular-nums; }
.meters-foot { display: flex; justify-content: center; gap: 3px; padding-top: 4px; }
.meters-foot button { width: 14px; height: 14px; border-radius: 50%; border: 1px solid #555; font-size: 8px; color: var(--text-3); display: grid; place-items: center; }

/* ── Lumetri ─────────────────────────────────────────── */
.lum { overflow: auto; height: 100%; font-size: var(--fs); }
.lum-sec { border-bottom: 1px solid #161616; }
.lum-sec > .fx-head { padding-left: 10px; height: 28px; font-weight: 600; }
.lum-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 42px; gap: 8px; align-items: center; padding: 3px 12px; }
.lum-row label { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lum-row .val { text-align: right; color: var(--timecode); font-variant-numeric: tabular-nums; }
.lum-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 14px; background: transparent; }
.lum-slider::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--track, #4a4a4a); }
.lum-slider::-moz-range-track { height: 4px; border-radius: 2px; background: var(--track, #4a4a4a); }
.lum-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 11px; height: 11px; border-radius: 50%; background: #e6e6e6; margin-top: -3.5px; box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
.lum-slider::-moz-range-thumb { width: 11px; height: 11px; border-radius: 50%; background: #e6e6e6; border: 0; }
.lum-sub { padding: 6px 12px 2px; color: var(--text-3); font-size: var(--fs-s); text-transform: uppercase; letter-spacing: .07em; }
.lum-skill { display: grid; grid-template-columns: 110px minmax(0, 1fr) 30px; gap: 8px; align-items: center; padding: 4px 12px; }
.lum-skill label { color: var(--text); }
.lum-skill .bar { height: 6px; border-radius: 3px; background: #2c2c2c; overflow: hidden; }
.lum-skill .bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--brand)); width: 0; transition: width .8s cubic-bezier(.2,.7,.2,1); }
.lum-skill span { text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }
.lum-wheels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 8px 12px 12px; }
.wheel { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text-2); font-size: var(--fs-s); }
.wheel .disc { width: 100%; max-width: 86px; aspect-ratio: 1; border-radius: 50%; position: relative; cursor: crosshair;
  background: radial-gradient(circle, #8a8a8a 0%, transparent 70%), conic-gradient(from 90deg, #e04f4f, #e0c64f, #59d05a, #4fd0d0, #4f6be0, #c64fe0, #e04f4f);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.6), 0 0 0 3px #2a2a2a;
}
.wheel .disc i { position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px; border-radius: 50%; border: 1.5px solid #fff; box-shadow: 0 0 0 1px #000; }

/* scopes */
.scopes { height: 100%; display: flex; flex-direction: column; background: #0b0b0b; }
.scopes canvas { flex: 1; width: 100%; min-height: 0; display: block; }
.scopes .scope-bar { flex: none; display: flex; gap: 8px; padding: 4px 8px; background: var(--panel); color: var(--text-3); font-size: var(--fs-s); }

/* ── Panel-group placeholders ─────────────────────────── */
.empty-state { display: grid; place-items: center; height: 100%; color: var(--text-3); text-align: center; padding: 20px; }
.prop.wrap { grid-template-columns: 18px minmax(0, 1fr); padding-bottom: 6px; }
.prop.wrap .sw { grid-row: 1; }
.prop.wrap .k { grid-column: 2; }
.prop.wrap .v { grid-column: 2; color: var(--text); }

/* touch devices: let people use the embedded player's own controls */
.touch .mon-frame.live .player-host { pointer-events: auto; }
.touch .mon-frame.live .mon-shield { display: none; }

.mon-ruler, .tl-ruler, .zoombar, .splitter, .wheel .disc { touch-action: none; }

/* ── Metadata panel (details + deep dive) ─────────────────── */
.md-scroll { height: 100%; overflow-y: auto; user-select: text; -webkit-user-select: text; }
.md-head { padding: 14px 16px 12px; border-bottom: 1px solid #161616; background: linear-gradient(180deg, #212121, var(--panel)); }
.md-kicker { display: flex; align-items: center; gap: 6px; font-size: var(--fs-s); text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); font-weight: 600; }
.md-title { margin: 6px 0 4px; font-size: 22px; line-height: 1.15; color: var(--text-hi); font-weight: 800; letter-spacing: -.01em; }
.md-sub { color: var(--text-2); font-size: var(--fs-l); }
.md-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.md-fx .fx-head { height: 28px; padding: 4px 10px; position: sticky; top: 0; background: var(--panel); z-index: 1; border-bottom: 1px solid #191919; }
.md-fx .fx-body { padding: 4px 0 10px; }
.md-desc { margin: 8px 16px 4px 34px; color: var(--text); font-size: var(--fs-l); line-height: 1.55; }
.md-credits { list-style: none; margin: 0; padding: 2px 16px 2px 34px; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 3px 12px; font-size: var(--fs-l); }
.md-credits li { display: flex; align-items: center; gap: 6px; color: var(--text); }
.md-credits li span { display: grid; place-items: center; }
.md-credits li.on span { color: var(--ok); }
.md-credits li.off { color: var(--text-3); text-decoration: line-through; text-decoration-color: rgba(255,255,255,.2); }
.md-credits li.off span { color: var(--text-3); }
.md-impact { padding: 4px 16px 8px 34px; display: flex; flex-direction: column; gap: 10px; }
.md-results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.md-results li { display: flex; align-items: flex-start; gap: 6px; font-size: 14px; font-weight: 600; color: var(--text-hi); }
.md-results li span { color: var(--ok); display: grid; place-items: center; padding-top: 3px; }
.md-quote { margin: 0; padding: 10px 14px; border-left: 3px solid var(--brand); background: #202020; border-radius: 0 6px 6px 0; }
.md-quote blockquote { margin: 0 0 6px; font-size: 14px; line-height: 1.5; color: var(--text); font-style: italic; }
.md-quote figcaption { font-size: 12px; color: var(--text-3); }
.md-quote figcaption b { color: var(--text-2); }
.md-software { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 16px 8px 34px; }
.md-sw { display: inline-flex; align-items: center; gap: 8px; padding: 4px 13px 4px 5px; border-radius: 18px; background: #24282e; border: 1px solid #353c47; color: var(--text-hi); font-size: 14px; font-weight: 600; line-height: 1; }
.md-sw-logo { width: 26px; height: 26px; flex: none; object-fit: contain; border-radius: 6px; }
.md-sw-logo.mono { display: grid; place-items: center; font-size: 11px; font-weight: 800; letter-spacing: .02em; color: #fff;
  background: hsl(var(--hue) 45% 32%); box-shadow: inset 0 0 0 1px hsl(var(--hue) 55% 55% / .55); }
.md-deep { padding: 4px 22px 24px 34px; font: 400 15px/1.7 'Source Serif 4', Georgia, serif; color: var(--text); max-width: 760px; }
.md-deep h3, .md-deep h4, .md-deep h5 { font-family: var(--font); color: var(--text-hi); margin: 1.4em 0 .4em; line-height: 1.25; }
.md-deep h3 { font-size: 18px; } .md-deep h4 { font-size: 16px; }
.md-deep p { margin: 0 0 1em; }
.md-deep strong { color: var(--text-hi); }
.md-deep ul { padding-left: 1.2em; margin: 0 0 1em; }
.md-deep figure { margin: 1.2em 0; }
.md-deep img { max-width: 100%; border-radius: 4px; display: block; }
.md-deep figcaption { font: 400 12px/1.4 var(--font); color: var(--text-3); margin-top: 6px; }
.md-deep blockquote { margin: 1em 0; padding-left: 12px; border-left: 3px solid var(--brand); color: var(--text-hi); font-style: italic; }

/* Program monitor: expand button + sound badge */
.mon-sound {
  inset: auto auto 12px 12px; display: none; align-items: center; gap: 6px; padding: 6px 12px 6px 10px; border-radius: 16px;
  background: rgba(10,10,10,.72); border: 1px solid rgba(255,255,255,.35); color: #fff; font-weight: 600; font-size: 12.5px;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); cursor: pointer; z-index: 3; animation: soundPulse 2.4s ease-in-out infinite;
}
.mon-sound.on { display: inline-flex; }
.mon-sound:hover { background: var(--accent); border-color: var(--accent); animation: none; }
.mon-sound .i { width: 16px; height: 16px; }
@keyframes soundPulse { 50% { box-shadow: 0 0 0 6px rgba(45,140,235,.18); } }
.pg.max#pg-program .mon-view { padding: 4px 4px 0; }

/* Project panel (simplified) */
.proj-title { font-weight: 700; color: var(--text-hi); font-size: var(--fs-l); white-space: nowrap; }
.proj-top .count { flex: 1; }
.proj-hint { color: var(--text-3); font-size: var(--fs-s); }
.tile.playing .thumb { box-shadow: 0 0 0 2px var(--playhead); }
.tile.playing .name span:last-child { color: var(--accent-2); }

/* Photography */
.photo-grid { --tile: 200px; }
.photo-grid.stills { --tile: 150px; gap: 6px; }
.photo-grid.stills .tile { padding: 2px; }
.pv-backrow { padding: 6px 8px 0; }
.pv { background: #0b0b0b; }
.pv-stage { flex: 1; min-height: 0; position: relative; display: grid; place-items: center; padding: 12px; }
.pv-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 2px; box-shadow: 0 10px 40px rgba(0,0,0,.6); transition: opacity .2s; user-select: none; }
.pv-img.loading { opacity: .35; }
.pv-nav { position: absolute; top: 50%; width: 44px; height: 44px; margin-top: -22px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(20,20,20,.65); border: 1px solid rgba(255,255,255,.25); color: #fff; opacity: .65; transition: opacity .15s, background .15s; }
.pv-nav:hover { opacity: 1; background: var(--accent); border-color: var(--accent); }
.pv-nav.prev { left: 12px; } .pv-nav.next { right: 12px; }
.pv-cap { flex: none; display: flex; align-items: center; gap: 12px; padding: 8px 14px; background: var(--panel); border-top: 1px solid #161616; font-size: var(--fs-l); }
.pv-cap b { color: var(--text-hi); }
.pv-cap span { color: var(--text-2); font-variant-numeric: tabular-nums; }
.pv-cap .pv-tip { margin-left: auto; color: var(--text-3); font-size: var(--fs-s); }

/* Learning reader */
.reader-frame { width: 100%; height: 100%; border: 0; background: #151515; display: block; }
.learn-card.sel { border-color: var(--accent); background: #22303f; }

/* Archive */
.proj-sec { display: flex; align-items: center; gap: 8px; padding: 14px 10px 4px; margin: 6px 8px 0; border-top: 1px solid #2a2a2a; color: var(--text-3); font-size: var(--fs-s); }
.proj-sec b { color: var(--c-tan); font-size: var(--fs-l); }
.proj-sec .i { width: 14px; height: 14px; color: var(--c-tan); }
.proj-archive { width: calc(100% - 16px); text-align: left; cursor: pointer; border-radius: 0 0 4px 4px; padding-bottom: 8px; }
/* always reachable: pinned to the bottom of the panel until you scroll down to it */
.proj-archive { position: sticky; bottom: 0; z-index: 2; margin-bottom: 0; padding-top: 10px; background: var(--panel); box-shadow: 0 -10px 14px -6px rgba(0,0,0,.55); border-radius: 0; }
.proj-archive:hover { background: #222; }
.proj-archive:hover span:last-child { color: var(--text-2); }
.proj-archive .tw { display: grid; place-items: center; width: 14px; transition: transform .15s; }
.proj-archive .tw .i { color: var(--text-3); }
.proj-archive[aria-expanded="true"] .tw { transform: rotate(90deg); }
.archive-grid .tile .thumb, .archive-grid .chip { filter: saturate(.7); }

/* "Heads-up" note above the work */
.proj-notice { display: flex; align-items: flex-start; gap: 8px; margin: 6px 8px 2px; padding: 8px 8px 8px 10px; border-radius: 6px;
  background: rgba(227, 179, 65, .1); border: 1px solid rgba(227, 179, 65, .35); color: var(--text); font-size: var(--fs-l); line-height: 1.45; flex: none; }
.proj-notice p { margin: 0; flex: 1; min-width: 0; }
.proj-notice b { color: #f0c860; }
.proj-notice-i { color: #f0c860; padding-top: 2px; display: grid; }
.proj-notice-x { color: var(--text-3); width: 22px; height: 22px; border-radius: 4px; display: grid; place-items: center; flex: none; }
.proj-notice-x:hover { color: var(--text-hi); background: rgba(255,255,255,.08); }
