/* Frameflow — "grading suite" theme.
   Neutral graphite surfaces (no colour cast), true black around the picture,
   and colour reserved for meaning: amber = open note, green = resolved. */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/fonts/schibsted-grotesk.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --surround: #000;
  --bg: #1c1d1f;
  --panel: #222326;
  --raised: #2a2b2e;
  --hover: #303135;
  --line: #333438;
  --line-soft: #2a2b2e;
  --text: #ececec;
  --text-2: #a5a6aa;
  --text-3: #74757a;
  --note: #f0b44a;
  --note-soft: rgba(240, 180, 74, .14);
  --done: #5fbf8f;
  --focus: #8ab4f8;
  --primary: #f1f1f1;
  --primary-ink: #18181a;
  --danger: #f07167;
  --r-sm: 5px;
  --r: 8px;
  --r-lg: 12px;
  --font: "Schibsted Grotesk", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --nav-w: 232px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 400 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: rgba(138, 180, 248, .35); }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
svg.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
svg.i.fill { fill: currentColor; stroke: none; }
#app { min-height: 100%; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation-duration: .01ms !important; } }

/* ---------------------------------------------------------- controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--raised); font-size: 13px; font-weight: 500; white-space: nowrap; transition: background .12s, border-color .12s, color .12s; }
.btn:hover { background: var(--hover); border-color: #404146; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); font-weight: 600; }
.btn.primary:hover { background: #fff; border-color: #fff; }
.btn.quiet { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.quiet:hover { background: var(--hover); color: var(--text); }
.btn.icon { width: 32px; padding: 0; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.icon.sm { width: 28px; padding: 0; }
.btn.danger:hover { color: var(--danger); }
.btn.on { color: var(--text); background: var(--hover); }
.btn:disabled { opacity: .45; cursor: default; }
.input { width: 100%; height: 36px; padding: 0 11px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg); outline: none; font-size: 13.5px; transition: border-color .12s; }
.input:hover { border-color: #404146; }
.input:focus, .textbox:focus-within { border-color: #5a5b61; box-shadow: 0 0 0 3px rgba(255,255,255,.05); }
select.input { appearance: none; padding-right: 30px; background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a5a6aa' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 9px center; }
label.field { display: block; margin-bottom: 16px; }
label.field > span { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 0; border-top: 1px solid var(--line-soft); cursor: pointer; }
.switch-row .t { font-size: 13.5px; }
.switch-row .d { font-size: 12.5px; color: var(--text-3); }
.switch { position: relative; width: 34px; height: 20px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: #46474c; transition: background .15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--done); }
.switch input:checked + span::after { transform: translateX(14px); }
.switch input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.seg { display: inline-flex; padding: 2px; border-radius: var(--r); background: var(--bg); border: 1px solid var(--line-soft); }
.seg button { border: 0; background: none; color: var(--text-3); font-size: 12.5px; font-weight: 500; height: 26px; padding: 0 10px; border-radius: 6px; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--raised); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.seg.icons button { width: 30px; padding: 0; justify-content: center; }
.avatar { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 600; color: #fff; background: var(--c, #555); flex: none; letter-spacing: 0; }
.avatar.lg { width: 30px; height: 30px; font-size: 12.5px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #3d3e43; border-top-color: var(--text); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; padding: 80px 0; }
.mark { width: 26px; height: 26px; border-radius: 7px; background: var(--primary); display: grid; place-items: center; flex: none; }
.mark::after { content: ""; width: 0; height: 0; border-left: 8px solid var(--primary-ink); border-top: 5px solid transparent; border-bottom: 5px solid transparent; margin-left: 2px; }

/* ---------------------------------------------------------- auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth form { width: 100%; max-width: 340px; }
.auth .brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; margin-bottom: 40px; }
.auth h1 { font-size: 26px; line-height: 1.15; font-weight: 600; letter-spacing: -.02em; margin: 0 0 8px; }
.auth p { margin: 0 0 28px; color: var(--text-2); }
.auth .btn { width: 100%; height: 38px; margin-top: 4px; }
.auth .input { height: 40px; }
.err { color: var(--danger); font-size: 13px; min-height: 20px; margin-top: 8px; }

/* ---------------------------------------------------------- app shell */
.shell { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); min-height: 100vh; }
.shell.guest { grid-template-columns: minmax(0, 1fr); }
.nav { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--panel); border-right: 1px solid var(--line-soft); padding: 14px 10px; }
.nav .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 600; font-size: 14px; letter-spacing: -.005em; }
.nav .brand span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-group { margin-bottom: 18px; }
.nav-title { font-size: 12px; color: var(--text-3); padding: 0 8px 6px; font-weight: 500; }
.nav-item { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 8px; border-radius: 6px; color: var(--text-2); font-size: 13.5px; font-weight: 450; }
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.on { background: var(--raised); color: var(--text); }
.nav-item .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .cnt { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.nav-projects { overflow-y: auto; flex: 1; min-height: 0; margin: 0 -2px; padding: 0 2px; }
.nav-foot { border-top: 1px solid var(--line-soft); padding-top: 10px; display: flex; align-items: center; gap: 4px; }
.nav-foot .who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; padding: 5px 6px; border-radius: 6px; border: 0; background: none; text-align: left; font-size: 13px; }
.nav-foot .who:hover { background: var(--hover); }
.nav-foot .who span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { min-width: 0; display: flex; flex-direction: column; }
.toolbar { position: sticky; top: 0; z-index: 10; height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 24px; background: rgba(28, 29, 31, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-soft); }
.crumbs { display: flex; align-items: center; min-width: 0; flex: 1; font-size: 13.5px; }
.crumbs a, .crumbs span.c { color: var(--text-2); padding: 3px 6px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.crumbs a:hover { color: var(--text); background: var(--hover); }
.crumbs .sep { color: #4f5055; display: inline-flex; }
.crumbs .sep svg { width: 14px; height: 14px; }
.crumbs > :last-child { color: var(--text); font-weight: 500; }
.search { position: relative; width: 220px; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search .input { height: 32px; padding-left: 32px; background: var(--panel); font-size: 13px; }
.guestbar { height: 60px; display: flex; align-items: center; gap: 14px; padding: 0 28px; border-bottom: 1px solid var(--line-soft); background: var(--panel); }
.guestbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.guestbar .divider { width: 1px; height: 20px; background: var(--line); }
.name-btn { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px 0 4px; border-radius: 99px; border: 1px solid var(--line); background: none; font-size: 13px; color: var(--text-2); }
.name-btn:hover { color: var(--text); background: var(--hover); }

/* ---------------------------------------------------------- library */
.page { padding: 28px 24px 64px; width: 100%; max-width: 1760px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.head h1 { margin: 0; font-size: 24px; line-height: 1.2; font-weight: 600; letter-spacing: -.02em; }
.head .facts { display: flex; gap: 16px; margin-top: 6px; color: var(--text-3); font-size: 13px; }
.head .facts .open { color: var(--note); }
.head .acts { display: flex; gap: 8px; align-items: center; }
.subhead { font-size: 13px; font-weight: 500; color: var(--text-2); margin: 0 0 12px; }
.folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-bottom: 32px; }
.folder { position: relative; display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 10px 0 14px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line-soft); transition: background .12s, border-color .12s; }
.folder:hover { background: var(--raised); border-color: var(--line); }
.folder > svg { color: var(--text-2); width: 18px; height: 18px; }
.folder .txt { flex: 1; min-width: 0; }
.folder .n { font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder .d { font-size: 12px; color: var(--text-3); }
.folder .more { opacity: 0; }
.folder:hover .more, .folder .more:focus-visible { opacity: 1; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 28px 20px; }
.tile { display: block; min-width: 0; }
.frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: #111214 no-repeat 0 0; display: grid; place-items: center; color: #55565b; outline: 1px solid rgba(255,255,255,.04); outline-offset: -1px; }
.frame > svg.i { width: 28px; height: 28px; stroke-width: 1.4; }
.frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .2s; }
.frame img.loaded { opacity: 1; }
.frame img.wave { object-fit: fill; padding: 22% 9%; filter: brightness(.85); }
.frame.scrubbing img { opacity: 0 !important; }
.frame .scrubline { position: absolute; left: 0; bottom: 0; height: 2px; background: #fff; width: 0; opacity: 0; }
.frame.scrubbing .scrubline { opacity: 1; }
.chip { position: absolute; display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px; border-radius: 4px; font-size: 11.5px; font-weight: 500; font-variant-numeric: tabular-nums; background: rgba(0,0,0,.72); color: #f2f2f2; backdrop-filter: blur(4px); }
.chip svg.i { width: 12px; height: 12px; stroke-width: 2; }
.chip.dur { right: 8px; bottom: 8px; }
.chip.notes { left: 8px; top: 8px; color: var(--note); }
.chip.notes.done { color: var(--done); }
.chip.fmt { left: 8px; bottom: 8px; color: #cfcfcf; letter-spacing: .02em; }
.tile .cap { display: flex; align-items: flex-start; gap: 6px; margin-top: 10px; }
.tile .cap .n { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 500; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-top: 3px; }
.tile .cap .btn { margin: -1px -6px 0 0; opacity: 0; }
.tile:hover .cap .btn, .tile .cap .btn:focus-visible { opacity: 1; }
.tile .sub { display: flex; gap: 12px; font-size: 12px; color: var(--text-3); margin-top: 1px; font-variant-numeric: tabular-nums; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 500; color: var(--text-3); font-size: 12px; padding: 0 12px 10px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.table td { padding: 8px 12px; border-bottom: 1px solid var(--line-soft); color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.table tr.row { cursor: pointer; }
.table tr.row:hover td { background: var(--panel); }
.table td.name { color: var(--text); font-weight: 500; width: 100%; max-width: 0; }
.table td.name > div { display: flex; align-items: center; gap: 12px; min-width: 0; }
.table td.name span { overflow: hidden; text-overflow: ellipsis; }
.table .mini { position: relative; width: 64px; height: 36px; border-radius: 4px; overflow: hidden; background: #111214; display: grid; place-items: center; color: #55565b; flex: none; }
.table .mini img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.table .mini img.loaded { opacity: 1; }
.table .mini img.wave { object-fit: fill; padding: 8px 4px; }
.table .open { color: var(--note); }
.table .done { color: var(--done); }
.table .r { text-align: right; }
.table td:last-child, .table th:last-child { padding-right: 4px; }
.table .row .btn { opacity: 0; }
.table .row:hover .btn, .table .row .btn:focus-visible { opacity: 1; }

.empty { padding: 72px 24px; text-align: center; color: var(--text-3); border: 1px dashed var(--line); border-radius: var(--r-lg); }
.empty svg.i { width: 26px; height: 26px; margin-bottom: 12px; stroke-width: 1.5; }
.empty .t { color: var(--text-2); font-weight: 500; margin-bottom: 4px; }

/* ---------------------------------------------------------- player */
.pshell { height: 100vh; height: 100dvh; display: grid; grid-template-rows: 56px minmax(0, 1fr); background: var(--bg); }
.pbar { display: flex; align-items: center; gap: 12px; padding: 0 12px 0 10px; border-bottom: 1px solid var(--line-soft); background: var(--panel); min-width: 0; }
.pbar .title { min-width: 0; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.pbar .title .n { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.3; }
.pbar .title .p { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbar .acts { display: flex; align-items: center; gap: 6px; }
.pbar .vdiv { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.player { display: grid; grid-template-columns: minmax(0, 1fr) 360px; min-height: 0; }
.screen { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surround); }
.stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; user-select: none; -webkit-user-select: none; }
.stage video, .stage > img.media { width: 100%; height: 100%; object-fit: contain; display: block; }
.stage iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.stage.pinning { cursor: crosshair; }
.stage .placeholder { text-align: center; color: var(--text-2); }
.stage .placeholder svg.i { width: 40px; height: 40px; stroke-width: 1.3; color: var(--text-3); margin-bottom: 12px; }
.wave { position: relative; width: 86%; height: 44%; cursor: pointer; }
.wave-base, .wave-fill { position: absolute; top: 0; bottom: 0; left: 0; width: 100%; -webkit-mask: var(--wave) 0 0 / 100% 100% no-repeat; mask: var(--wave) 0 0 / 100% 100% no-repeat; }
.wave-base { background: #4a4b50; }
.wave-prog { position: absolute; inset: 0; overflow: hidden; width: 0; }
.wave-fill { width: var(--ww, 100%); background: var(--text); }
.overlay { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 24px; text-align: center; background: rgba(0,0,0,.78); }
.overlay .box { max-width: 360px; }
.overlay h3 { margin: 16px 0 6px; font-size: 15px; font-weight: 600; }
.overlay p { margin: 0 0 16px; color: var(--text-2); font-size: 13px; }
.overlay svg.i { width: 26px; height: 26px; color: var(--text-2); }
.meter { width: 240px; height: 3px; border-radius: 99px; background: #333; margin: 0 auto; overflow: hidden; }
.meter > div { height: 100%; background: var(--text); transition: width .4s; }
.pins { position: absolute; z-index: 3; pointer-events: none; }
.pin { position: absolute; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; border: 2px solid #fff; background: var(--c, #555); color: #fff; font-size: 10.5px; font-weight: 600; display: grid; place-items: center; box-shadow: 0 2px 10px rgba(0,0,0,.6); pointer-events: auto; cursor: pointer; padding: 0; transition: transform .12s; }
.pin.active { transform: scale(1.3); border-color: var(--note); }
.pin.draft { background: var(--note); border-color: #fff; color: #1a1a1a; }
.pin.draft svg.i { width: 13px; height: 13px; stroke-width: 2.2; }

/* the transport: the one place the UI gets expressive */
.transport { padding: 8px 16px 12px; background: #0e0f10; border-top: 1px solid #1d1e20; }
.timeline { position: relative; height: 30px; cursor: pointer; touch-action: none; }
.timeline .track { position: absolute; left: 0; right: 0; top: 18px; height: 4px; border-radius: 2px; background: #2c2d31; overflow: hidden; }
.timeline .buf { position: absolute; inset: 0 auto 0 0; background: #45464b; }
.timeline .prog { position: absolute; inset: 0 auto 0 0; background: var(--text); }
.timeline .head { position: absolute; top: 12px; width: 2px; height: 16px; margin-left: -1px; background: #fff; border-radius: 1px; pointer-events: none; box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
.timeline .ticks { position: absolute; left: 0; right: 0; top: 0; height: 14px; }
.tick { position: absolute; top: 2px; width: 3px; height: 11px; margin-left: -1.5px; padding: 0; border: 0; border-radius: 1.5px; background: var(--note); transition: transform .12s; }
.tick::before { content: ""; position: absolute; inset: -4px -5px; }
.tick:hover, .tick.active { transform: scaleY(1.35); }
.tick.active { box-shadow: 0 0 0 2px #0e0f10, 0 0 0 3px var(--note); }
.tick.resolved { background: var(--done); opacity: .55; }
.preview { position: absolute; bottom: 36px; transform: translateX(-50%); pointer-events: none; opacity: 0; transition: opacity .1s; z-index: 4; text-align: center; }
.timeline:hover .preview { opacity: 1; }
.preview .pf { width: 160px; height: 90px; border-radius: 5px; background: #000 no-repeat 0 0 / 1000% 100%; border: 1px solid #3a3b3f; margin-bottom: 4px; box-shadow: 0 6px 20px rgba(0,0,0,.6); }
.preview .pt { display: inline-block; font-size: 11.5px; font-weight: 500; font-variant-numeric: tabular-nums; background: #000; border: 1px solid #3a3b3f; border-radius: 4px; padding: 2px 6px; }
.ctrls { display: flex; align-items: center; gap: 2px; margin-top: 2px; }
.ctrls .btn { color: var(--text-2); }
.ctrls .btn:hover { color: var(--text); }
.ctrls .btn.play { color: var(--text); }
.readout { display: inline-flex; align-items: baseline; gap: 8px; height: 30px; padding: 0 12px; margin: 0 10px; border-radius: 6px; background: #000; border: 1px solid #26272a; font-variant-numeric: tabular-nums; cursor: pointer; user-select: none; }
.readout:hover { border-color: #3a3b3f; }
.readout .cur { font-size: 15px; font-weight: 600; letter-spacing: .03em; line-height: 28px; color: #fff; }
.readout .dur { font-size: 12px; color: var(--text-3); letter-spacing: .02em; }
.readout .mode { font-size: 10.5px; color: var(--text-3); font-weight: 500; }
.techinfo { display: flex; gap: 12px; font-size: 12px; color: var(--text-3); margin-right: 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ctrls select { height: 28px; border-radius: 6px; background: transparent; border: 1px solid transparent; color: var(--text-2); font-size: 12.5px; padding: 0 4px; }
.ctrls select:hover { background: var(--hover); color: var(--text); }
.vol { width: 76px; accent-color: #fff; }
.spacer { flex: 1; }

/* notes panel */
.notes { display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-left: 1px solid var(--line-soft); }
.notes-head { padding: 14px 16px 12px; border-bottom: 1px solid var(--line-soft); }
.notes-head .row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.notes-head h2 { margin: 0; font-size: 14px; font-weight: 600; flex: 1; }
.notes-head .stat { font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.notes-head .stat b { color: var(--note); font-weight: 500; }
.notes-head .seg { width: 100%; }
.notes-head .seg button { flex: 1; justify-content: center; }
.nlist { flex: 1; overflow-y: auto; }
.note { position: relative; padding: 14px 16px 12px; border-bottom: 1px solid var(--line-soft); cursor: pointer; transition: background .12s; }
.note:hover { background: rgba(255,255,255,.018); }
.note.active { background: var(--raised); }
.note.active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--note); }
.note.resolved.active::before { background: var(--done); }
.note-h { display: flex; align-items: center; gap: 9px; min-width: 0; }
.note-h .who { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-h .via { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.note-h time { font-size: 12px; color: var(--text-3); white-space: nowrap; margin-left: auto; padding-left: 6px; }
.resolve { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #55565b; background: none; display: grid; place-items: center; color: transparent; flex: none; padding: 0; margin-left: 4px; transition: border-color .12s, background .12s, color .12s; }
.resolve svg.i { width: 12px; height: 12px; stroke-width: 3; }
.resolve:hover { border-color: var(--done); color: var(--done); }
.resolve.on { background: var(--done); border-color: var(--done); color: #0f2a1d; }
.resolve:disabled { cursor: default; }
.note-b { margin: 7px 0 0 33px; font-size: 13.5px; line-height: 1.5; color: #dcdcde; white-space: pre-wrap; overflow-wrap: anywhere; }
.note.resolved > .note-b, .note.resolved > .note-h .who { color: var(--text-3); }
.tcl { display: inline-flex; align-items: center; gap: 4px; margin-right: 6px; padding: 0; border: 0; background: none; color: var(--note); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; vertical-align: 0; }
.tcl:hover { text-decoration: underline; text-underline-offset: 3px; }
.note.resolved .tcl { color: var(--done); }
.tcl svg.i { width: 12px; height: 12px; stroke-width: 2.2; }
.note-a { display: flex; gap: 14px; margin: 8px 0 0 33px; font-size: 12.5px; }
.note-a button { border: 0; background: none; padding: 0; color: var(--text-3); }
.note-a button:hover { color: var(--text); }
.replies { margin: 10px 0 0 33px; display: grid; gap: 12px; }
.reply .note-h .avatar { width: 20px; height: 20px; font-size: 9.5px; }
.reply .note-b { margin: 4px 0 0 29px; }
.reply .note-a { margin-left: 29px; margin-top: 4px; }
.nlist .empty { margin: 20px 16px; padding: 44px 20px; font-size: 13px; }
.compose { padding: 12px 16px 16px; border-top: 1px solid var(--line-soft); background: var(--panel); }
.compose .ctx { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--text-2); margin-bottom: 8px; }
.compose .ctx .input { height: 30px; font-size: 13px; }
.textbox { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg); transition: border-color .12s; }
.textbox textarea { display: block; width: 100%; min-height: 64px; max-height: 220px; resize: none; border: 0; background: none; outline: none; padding: 11px 12px 4px; font-size: 13.5px; line-height: 1.5; }
.textbox .tools { display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 8px; }
.tcpill { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px; border-radius: 6px; border: 0; background: var(--note-soft); color: var(--note); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tcpill svg.i { width: 13px; height: 13px; stroke-width: 2.2; }
.tcpill.off { background: transparent; color: var(--text-3); }
.tcpill.off span { text-decoration: line-through; }
.tools .btn.on { color: var(--note); background: var(--note-soft); }
.compose .note-off { font-size: 13px; color: var(--text-3); display: flex; align-items: center; gap: 8px; justify-content: center; padding: 6px; }
.hint { font-size: 11.5px; color: var(--text-3); }

/* ---------------------------------------------------------- modal / toast */
.modal-bg { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.6); animation: fade .14s ease-out; }
.modal { width: 100%; max-width: 440px; max-height: calc(100vh - 40px); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 24px 64px rgba(0,0,0,.55); animation: rise .16s ease-out; }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 0 20px; }
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.modal-body { padding: 16px 20px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line-soft); }
.modal .lead { margin: 0 0 18px; color: var(--text-2); font-size: 13.5px; }
.modal .lead b { color: var(--text); font-weight: 500; }
.linkbox { display: flex; gap: 8px; }
.linkbox .input { font-size: 12.5px; color: var(--text-2); }
.notice { display: flex; gap: 10px; margin-top: 14px; padding: 10px 12px; border-radius: var(--r); background: var(--note-soft); color: #e9cf9d; font-size: 12.5px; }
.notice svg.i { color: var(--note); margin-top: 1px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px) scale(.99); } }
.links { margin: 0 -20px; }
.link-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 20px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line-soft); }
.link-row:first-child { border-top: 0; }
.link-row .t { font-weight: 500; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.link-row .t svg.i { color: var(--text-3); }
.link-row .p { font-size: 12px; color: var(--text-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-row .props { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 12px; color: var(--text-2); }
.link-row .props span { display: inline-flex; align-items: center; gap: 5px; }
.link-row .props svg.i { width: 13px; height: 13px; color: var(--text-3); }
.link-row .props .warn { color: var(--note); }
.link-row .acts { display: flex; gap: 4px; }
.menu { position: fixed; z-index: 60; min-width: 180px; padding: 4px; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 12px 32px rgba(0,0,0,.5); animation: fade .1s; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; height: 32px; padding: 0 10px; border: 0; background: none; border-radius: 5px; font-size: 13px; text-align: left; color: var(--text); }
.menu button:hover { background: var(--hover); }
.menu button svg.i { color: var(--text-2); }
#toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: var(--r); background: var(--primary); color: var(--primary-ink); font-size: 13px; font-weight: 500; box-shadow: 0 10px 30px rgba(0,0,0,.45); animation: rise .16s ease-out; }
.toast.err { background: #3a2422; color: #ffd9d5; border: 1px solid #5b3430; }

/* ---------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .player { grid-template-columns: minmax(0, 1fr) 320px; }
  .techinfo { display: none; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .nav { display: none; }
  .toolbar { padding: 0 14px; }
  .search { width: 150px; }
  .page { padding: 20px 14px 48px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px 12px; }
  .table .hide-md { display: none; }
  .pshell { height: auto; min-height: 100vh; grid-template-rows: 56px auto; }
  .player { grid-template-columns: minmax(0, 1fr); }
  .stage { height: 56.25vw; max-height: 64vh; min-height: 200px; flex: none; }
  .notes { border-left: 0; border-top: 1px solid var(--line-soft); min-height: 60vh; }
  .vol, .hide-sm { display: none !important; }
  .readout { margin: 0 6px; padding: 0 8px; }
  .readout .cur { font-size: 13.5px; }
  .guestbar { padding: 0 14px; }
  .tile .cap .btn, .folder .more, .table .row .btn { opacity: 1; }
  .crumbs a, .crumbs span.c { max-width: 110px; }
}

.folder .latest { margin-left: 10px; padding: 1px 6px; border-radius: 4px; background: var(--hover); color: var(--text); font-size: 11px; font-weight: 500; }
.master { display: grid; gap: 10px; padding: 14px; border-radius: var(--r); background: var(--bg); border: 1px solid var(--line-soft); }
.master .t { font-weight: 500; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.master .p { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.links .link-row:first-child { border-top: 1px solid var(--line-soft); }
.frame.scrubbing > svg.i, .frame.scrubbing .chip.fmt { opacity: 0; }
.ctrls select { appearance: none; -webkit-appearance: none; padding: 0 8px; text-align: center; }
#toasts { top: 68px; bottom: auto; }

.ftile .stack { position: relative; padding-top: 7px; }
.ftile .stack::before { content: ""; position: absolute; left: 12px; right: 12px; top: 0; height: 14px; border-radius: 7px 7px 0 0; background: #2c2d31; }
.ftile .stack::after { content: ""; position: absolute; left: 6px; right: 6px; top: 3px; height: 14px; border-radius: 7px 7px 0 0; background: #35363a; }
.ftile .frame { z-index: 1; }
.ftile .frame img { filter: brightness(.82); }
.ftile:hover .frame img { filter: none; }
.chip.fcount { left: 8px; bottom: 8px; }
.chip.latest { right: 8px; top: 8px; background: var(--primary); color: var(--primary-ink); font-weight: 600; }

.slugbox { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); overflow: hidden; }
.slugbox:focus-within { border-color: #5a5b61; box-shadow: 0 0 0 3px rgba(255,255,255,.05); }
.slugbox .pre { padding: 0 2px 0 11px; color: var(--text-3); font-size: 13.5px; white-space: nowrap; max-width: 65%; overflow: hidden; text-overflow: ellipsis; }
.slugbox .input { border: 0; box-shadow: none !important; padding-left: 0; background: transparent; }

/* drawing on the frame */
.drawview, .drawlayer { position: absolute; overflow: visible; }
.drawview { z-index: 2; pointer-events: none; }
.drawlayer { z-index: 4; cursor: crosshair; touch-action: none; }
.drawbar { position: absolute; z-index: 6; top: 12px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 10px; background: rgba(24,25,27,.94); border: 1px solid #3a3b3f; box-shadow: 0 10px 30px rgba(0,0,0,.5); max-width: calc(100% - 16px); overflow-x: auto; }
.drawbar button { width: 32px; height: 32px; border: 0; border-radius: 7px; background: none; color: var(--text-2); display: grid; place-items: center; flex: none; padding: 0; }
.drawbar button:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.drawbar button.on { background: var(--hover); color: #fff; }
.drawbar button:disabled { opacity: .35; cursor: default; }
.drawbar .sw { width: 26px; }
.drawbar .sw::after { content: ""; width: 16px; height: 16px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.drawbar .sw.on::after { box-shadow: 0 0 0 2px #18181a, 0 0 0 3.5px #fff; }
.drawbar .sep { width: 1px; height: 20px; background: #3a3b3f; margin: 0 4px; flex: none; }
.drawbar .done { width: auto; padding: 0 12px; margin-left: 4px; background: var(--primary); color: var(--primary-ink); font-size: 12.5px; font-weight: 600; }
.drawbar .done:hover { background: #fff !important; color: var(--primary-ink) !important; }
