/* X CVLT Client Portal - the Project Manager's matte look. Tokens only (styles/tokens.css):
   no color literals in this file. Layout: Dashboard -> Project (table) -> Sub Project (tabs). */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  min-height: 100vh; background-color: var(--page); color: var(--ink); font-family: var(--sans); font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(var(--page-dots) .8px, transparent .8px); background-size: 26px 26px;
}
a { color: inherit; text-decoration: none; }
img, video, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: var(--r-xs); }
main:focus { outline: none; }
[hidden] { display: none !important; }
.spacer { flex: 1; }
.muted { color: var(--ink-50); }
.faint { color: var(--ink-35); }
.small { font-size: 11px; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }

/* ---------- app bar ---------- */
.appbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; padding: 14px 30px; background: linear-gradient(var(--page) 70%, transparent); }
.wordmark { font-weight: 800; letter-spacing: .18em; font-size: 15px; white-space: nowrap; }
.crumbs { display: flex; align-items: center; gap: 9px; min-width: 0; color: var(--ink-42); font-size: 12px; font-weight: 500; }
.crumbs a:hover { color: var(--ink); }
.crumbs .on { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs .sep { color: var(--ink-22); }
.who { color: var(--ink-42); font-size: 11px; white-space: nowrap; }
.version-badge { font-size: 10px; color: var(--ink-50); border: 1px solid var(--fill-7); border-radius: var(--r-pill); padding: 3px 9px; white-space: nowrap; }
.preview-banner { margin: 0 30px 12px; padding: 10px 14px; border-radius: var(--r-md); font-size: 12px; font-weight: 700; background: var(--warn-fill); border: 1px solid var(--warn-line); color: var(--warn); }
main.page { padding: 6px 30px 10px; max-width: 2200px; margin: 0 auto; }
.credit { text-align: center; color: var(--ink-30); font-size: 10.5px; padding: 26px 16px; }
.credit a { text-decoration: underline; }

/* ---------- controls ---------- */
.ibtn { width: 33px; height: 33px; flex: none; border-radius: var(--r-pill); background: var(--fill-5); border: 1px solid var(--fill-7); color: var(--ink-72); display: inline-flex; align-items: center; justify-content: center; }
.ibtn:hover { background: var(--fill-8); border-color: var(--line-5); color: var(--ink); }
.ibtn svg { width: 16px; height: 16px; }
.btn { height: 30px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line-4); background: var(--fill-5); color: var(--ink); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; transition: background var(--t-fast); }
.btn:hover { background: var(--fill-8); }
.btn svg { width: 14px; height: 14px; }
.btn.light { background: var(--btn-light); color: var(--ink-dark); border: 0; box-shadow: var(--btn-light-shadow); }
.btn.ok { background: var(--ok-fill); border-color: var(--ok-line); color: var(--ok); }
.btn.bad { border-color: var(--bad-line); color: var(--bad); }
.btn.small { height: 27px; padding: 0 12px; font-size: 10px; }
.btn.big { height: 40px; padding: 0 18px; font-size: 12px; }
.btn.wide { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.seg { display: inline-flex; gap: 3px; padding: 3px; border-radius: var(--r-pill); background: var(--well); border: 1px solid var(--fill-6); box-shadow: var(--well-shadow); flex: none; }
.seg button { height: 27px; padding: 0 13px; border-radius: var(--r-pill); border: 1px solid transparent; background: none; font-size: 10px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-50); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--fill-8); border-color: var(--line-6); color: var(--ink); box-shadow: var(--inset-on), var(--glow-on); }
.seg.small button { height: 24px; padding: 0 10px; font-size: 9.5px; }
.seg.square { border-radius: var(--r-md); padding: 2px; background: var(--input-bg); }
.seg.square button { border-radius: var(--r-sm); height: 28px; letter-spacing: .1em; }
.seg.square button[aria-pressed="true"] { background: var(--seg-on); border-color: transparent; box-shadow: var(--inset-hi); }
.seg .n { margin-left: 6px; padding: 1px 5px; border-radius: var(--r-xs); background: var(--fill-5); font-size: 8.5px; }

.chip { height: 23px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border-radius: var(--r-pill); font-size: 9px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; background: var(--fill-5); border: 1px solid var(--fill-7); color: var(--ink-62); white-space: nowrap; }
.chip.warn { background: var(--warn-fill); border-color: var(--warn-line); color: var(--warn); }
.chip.warn::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 9px var(--warn); }
.count-pill { height: 18px; padding: 0 7px; border-radius: var(--r-pill); background: var(--fill-6); font-size: 10.5px; font-weight: 500; color: var(--ink-72); display: inline-flex; align-items: center; }

/* option tags: tinted by --h (a --c-* named color) */
.pill { height: 26px; display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; border-radius: var(--r-pill); font-size: 10px; font-weight: 500; white-space: nowrap;
  --h: var(--c-gray); background: color-mix(in srgb, var(--h) 11%, transparent); border: 1px solid color-mix(in srgb, var(--h) 30%, transparent); color: color-mix(in srgb, var(--h) 98%, var(--ink)); }
.pill.tiny { height: 19px; padding: 0 7px; font-size: 9px; gap: 5px; }
.pill.st { background: var(--fill-5); border-color: var(--line-4); color: var(--ink-85); }
.pill.st::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--h); flex: none; }
.h-gray { --h: var(--c-gray); } .h-brown { --h: var(--c-brown); } .h-orange { --h: var(--c-orange); } .h-amber { --h: var(--c-amber); }
.h-green { --h: var(--c-green); } .h-teal { --h: var(--c-teal); } .h-blue { --h: var(--c-blue); } .h-purple { --h: var(--c-purple); }
.h-pink { --h: var(--c-pink); } .h-red { --h: var(--c-red); }

.input, textarea.input, select.input { width: 100%; min-height: 40px; padding: 10px 12px; border-radius: var(--r-md); background: var(--input-bg); border: 1px solid var(--fill-7); color: var(--ink); }
textarea.input { min-height: 110px; resize: vertical; line-height: 1.5; }
.input:focus { outline: 2px solid var(--ink-50); outline-offset: 1px; }
.input.code { font-family: var(--mono); font-size: 26px; letter-spacing: .4em; text-align: center; min-height: 54px; }
.field { display: block; margin: 12px 0; }
.field > span { display: block; font-size: 8.5px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-42); margin-bottom: 7px; }
.error-text { color: var(--bad); font-size: 12px; margin: 8px 2px 0; }
.note { font-size: 11.5px; color: var(--ink-50); }
.switch { appearance: none; -webkit-appearance: none; width: 40px; height: 24px; border-radius: var(--r-pill); background: var(--fill-6); border: 1px solid var(--fill-7); position: relative; flex: none; transition: background var(--t-fast); cursor: pointer; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink-50); transition: transform var(--t-fast); }
.switch:checked { background: var(--ok-fill); border-color: var(--ok-line); }
.switch:checked::after { transform: translateX(16px); background: var(--ink); }

/* tiny caps label */
.cap { margin: 0; font-size: 8.5px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-35); }
.eyebrow { margin: 0 0 6px; display: flex; align-items: center; gap: 10px; font-size: 9px; font-weight: 500; letter-spacing: .34em; text-transform: uppercase; color: var(--ink-42); }
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--ink-30); }

/* ---------- dashboard cards ---------- */
.card { background: var(--fill-3); border: 1px solid var(--line-3); border-radius: var(--r-xl); box-shadow: var(--inset-hi), var(--card-drop); padding: 17px 19px 18px; min-width: 0; display: flex; flex-direction: column; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.015em; }
.card-head h2.caps { font-size: 11px; font-weight: 500; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-50); }
.blades { display: inline-flex; gap: 6px; align-items: center; }
.blades i { width: 2px; height: 12px; border-radius: 1px; background: var(--blade-silver); }
.blades i + i { width: 3px; height: 15px; background: var(--blade-ember); }
.dash-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-areas: "cal cal" "inv proj"; }
.dash-grid.no-inv { grid-template-areas: "cal cal" "proj proj"; }
.cal-card { grid-area: cal; flex-direction: row; gap: 16px; padding: 20px 22px 22px; }
.inv-card { grid-area: inv; } .proj-card { grid-area: proj; }

/* calendar */
.cal { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.month-title { margin: 0 6px 0 0; display: flex; align-items: baseline; gap: 11px; font-size: 38px; font-weight: 700; letter-spacing: -.025em; line-height: 1; white-space: nowrap; }
.month-title .yr { font-weight: 300; color: var(--ink-42); }
.dow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; margin-bottom: 8px; }
.dow span { font-size: 8.5px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-30); padding-left: 8px; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(86px, 1fr); gap: 7px; }
.month-grid.week { grid-auto-rows: minmax(220px, 1fr); }
.day { border-radius: 13px; padding: 8px; display: flex; flex-direction: column; gap: 3px; background: var(--fill-2); border: 1px solid var(--fill-5); min-width: 0; overflow: hidden; text-align: left; }
.day:hover { background: var(--fill-5); border-color: var(--line-5); }
.day.out { background: var(--fill-1); }
.day .n { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 12.5px; font-weight: 500; color: var(--ink-62); flex: none; }
.day.out .n { color: var(--ink-22); }
.day.today { background: var(--fill-5); border-color: var(--line-7); box-shadow: var(--inset-on), 0 0 30px var(--fill-6); }
.day.today .n { font-weight: 700; background: var(--ink); color: var(--ink-dark); box-shadow: var(--glow-today); }
.ev { display: flex; align-items: center; gap: 7px; padding: 3px 5px; border-radius: var(--r-xs); font-size: 10.5px; font-weight: 500; color: var(--ink-95); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 0; background: none; text-align: left; width: 100%; }
.ev:hover { background: var(--fill-6); }
.ev::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--k, var(--c-gray)); box-shadow: 0 0 9px var(--k, var(--c-gray)); }
.ev .t { font-weight: 700; color: var(--ink-50); font-size: 10px; }
.more { font-size: 8.5px; font-weight: 500; color: var(--ink-35); padding-left: 4px; }
.k-review { --k: var(--c-amber); } .k-delivery { --k: var(--c-blue); } .k-meeting { --k: var(--c-purple); } .k-show { --k: var(--c-red); }
.k-due { --k: var(--c-pink); } .k-invoice { --k: var(--c-green); } .k-other { --k: var(--c-gray); }
.agenda-list { display: flex; flex-direction: column; gap: 6px; }
.agenda-month { margin: 14px 2px 4px; }
.agenda-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-lg); background: var(--fill-2); border: 1px solid var(--line-2); text-align: left; width: 100%; color: inherit; }
.agenda-row:hover { background: var(--fill-5); border-color: var(--line-5); }
.agenda-row .d { width: 42px; text-align: center; flex: none; }
.agenda-row .d b { display: block; font-size: 20px; font-weight: 700; line-height: 1; }
.agenda-row .d small { font-size: 9.5px; color: var(--ink-42); }
.agenda-row .bar { width: 3px; align-self: stretch; border-radius: 2px; background: var(--k, var(--c-gray)); flex: none; }
.agenda-row .t { flex: 1; min-width: 0; } .agenda-row .t b { display: block; font-size: 12.5px; font-weight: 700; } .agenda-row .t small { color: var(--ink-42); font-size: 10.5px; }
.today-col { width: clamp(250px, 26%, 344px); flex: none; display: flex; flex-direction: column; gap: 8px; }
.today-card { display: flex; gap: 12px; align-items: center; padding: 15px 16px; border-radius: 18px; background: var(--fill-4); border: 1px solid var(--fill-7); box-shadow: var(--inset-hi), var(--card-drop); }
.today-card .ring { width: 46px; height: 46px; flex: none; }
.today-card .ring circle { fill: none; stroke-width: 3; }
.today-card .ring .track { stroke: var(--fill-7); } .today-card .ring .fill { stroke: var(--ok); stroke-linecap: round; }
.today-card b { display: block; font-size: 20px; font-weight: 700; } .today-card small { color: var(--ink-42); font-size: 11px; }
.todo { display: block; padding: 11px 12px; border-radius: var(--r-lg); background: var(--fill-2); border: 1px solid var(--line-2); text-align: left; width: 100%; color: inherit; }
.todo:hover { background: var(--fill-5); border-color: var(--line-5); }
.todo b { display: block; font-size: 12px; font-weight: 500; } .todo small { color: var(--ink-42); font-size: 9.5px; }
.todo.hot { background: var(--bad-fill); border-color: var(--warn-line); }
.todo-empty { padding: 11px 12px; font-size: 11px; color: var(--ink-42); border: 1px dashed var(--line-4); border-radius: var(--r-lg); }

/* invoices card */
.sum-row { display: flex; gap: 10px; align-items: stretch; margin-bottom: 8px; flex-wrap: wrap; }
.big-num { flex: 1; min-width: 160px; display: flex; flex-direction: column; justify-content: flex-end; }
.big-num span { font-size: 52px; font-weight: 300; letter-spacing: -.04em; line-height: 1.05; background: var(--big-number); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stage-box { min-width: 130px; padding: 11px 13px; border-radius: var(--r-xl); background: var(--fill-3); border: 1px solid var(--line-3); }
.stage-box b { display: block; font-size: 19px; font-weight: 700; margin-top: 10px; }
.stage-box.warn { background: var(--warn-fill); border-color: var(--warn-line); box-shadow: var(--warn-glow); }
.stage-box.ok { background: var(--ok-fill); border-color: var(--ok-line); }
.inv-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 118px 104px 100px; gap: 14px; align-items: center; min-height: 56px; padding: 6px 14px; border-radius: 13px; background: var(--fill-2); border: 1px solid var(--fill-5); margin-top: 7px; width: 100%; text-align: left; color: inherit; }
.inv-row:hover { background: var(--fill-5); border-color: var(--line-5); }
.avatar { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
  --h: var(--c-pink); background: color-mix(in srgb, var(--h) 12%, transparent); border: 1px solid color-mix(in srgb, var(--h) 30%, transparent); color: color-mix(in srgb, var(--h) 70%, var(--ink)); }
.inv-row .t b { display: block; font-size: 12.5px; font-weight: 700; } .inv-row .t small { display: block; margin-top: 5px; color: var(--ink-42); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-row .when { font-size: 10px; font-weight: 500; color: var(--ink-62); } .inv-row .when small { display: block; margin-top: 5px; color: var(--ink-30); font-size: 9px; }
.inv-row .when.open { color: var(--warn); }
.inv-row .amt { text-align: right; font-size: 14px; font-weight: 700; } .inv-row .amt.paid { color: var(--ok); }

/* projects card */
.proj-row { display: flex; align-items: center; gap: 14px; padding: 13px 14px; border-radius: var(--r-xl); background: var(--fill-2); border: 1px solid var(--line-2); box-shadow: var(--inset-hi); margin-bottom: 9px; }
a.proj-row:hover { background: var(--fill-6); border-color: var(--line-5); }
.tile { width: 36px; height: 36px; border-radius: 11px; background: var(--fill-5); border: 1px solid var(--fill-7); color: var(--ink-72); display: inline-flex; align-items: center; justify-content: center; flex: none; overflow: hidden; }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile svg { width: 15px; height: 15px; }
.proj-row .t { flex: 1; min-width: 0; } .proj-row .t b { display: block; font-size: 13.5px; font-weight: 700; } .proj-row .t small { display: block; margin-top: 6px; font-size: 9.5px; color: var(--ink-35); }
.count { height: 24px; padding: 0 10px; border-radius: var(--r-sm); background: var(--fill-4); border: 1px solid var(--fill-7); font-size: 10px; font-weight: 500; color: var(--ink-62); display: inline-flex; align-items: center; white-space: nowrap; }
.heat { font-size: 9.5px; font-weight: 700; letter-spacing: .04em; padding: 3px 8px; border-radius: var(--r-pill); color: var(--ink-50); background: var(--fill-6); white-space: nowrap; }
.proj-row .date { min-width: 74px; text-align: right; font-size: 10.5px; font-weight: 500; color: var(--ink-62); }
.proj-row .date small { display: block; font-size: 7.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-30); margin-bottom: 6px; }

/* ---------- project: sub projects table ---------- */
.table-card { border-radius: var(--r-2xl); background: var(--table-bg); border: 1px solid var(--fill-6); box-shadow: var(--big-drop); position: relative; }
.table-card::before { content: ""; position: absolute; inset: 0 24px auto 24px; height: 1px; background: var(--hairline); }
.table-top { display: flex; align-items: center; gap: 16px; padding: 20px 20px 0; flex-wrap: wrap; }
.table-top h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.01em; line-height: 1; }
.table-top small { display: block; margin-top: 8px; font-size: 10.5px; color: var(--ink-42); }
.table-wrap { overflow-x: auto; margin: 14px 20px 0; border: 1px solid var(--line-2); border-bottom: 0; border-radius: 9px 9px 0 0; background: var(--panel-solid); }
.sp-table { width: 100%; border-collapse: collapse; }
.sp-table th { height: 38px; background: var(--th-bg); border-bottom: 1px solid var(--fill-6); font-size: 9px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-62); padding: 0 14px; text-align: left; white-space: nowrap; }
.sp-table td { height: 56px; padding: 0 14px; border-bottom: 1px solid var(--line-1); background: var(--panel-solid); white-space: nowrap; vertical-align: middle; }
.sp-table tbody tr { cursor: pointer; }
.sp-table tbody tr:hover td { background: var(--row-hover); }
.sp-table td.num { font-size: 26px; font-weight: 400; letter-spacing: -.03em; color: var(--ink-30); font-variant-numeric: tabular-nums; width: 50px; }
.name-cell { display: flex; align-items: center; gap: 11px; }
.name-cell b { font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.accent { display: inline-block; width: 2px; height: 22px; border-radius: 1px; background: var(--fill-6); flex: none; }
.track-cell { display: inline-flex; align-items: center; gap: 9px; }
.track-cell .glyph { width: 24px; height: 24px; border-radius: 50%; background: var(--fill-6); border: 1px solid var(--fill-7); display: inline-flex; align-items: center; justify-content: center; color: var(--ink-62); flex: none; }
.track-cell .glyph svg { width: 11px; height: 11px; }
.track-cell b { display: block; font-size: 10.5px; font-weight: 500; color: var(--ink-85); text-transform: uppercase; letter-spacing: .02em; }
.track-cell small { font-size: 8.5px; color: var(--ink-30); }
.assets-cell { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 500; color: var(--ink-72); }
.assets-cell svg { width: 20px; height: 20px; } .assets-cell .track { stroke: var(--fill-7); } .assets-cell .fill { stroke: var(--done); }
.dots { display: inline-flex; padding-left: 6px; } .dots i { width: 22px; height: 22px; border-radius: 50%; margin-left: -6px; border: 1px solid var(--dark-ring); box-shadow: var(--inset-on); }
.cell-pills { display: inline-flex; gap: 5px; }
.money { font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.table-foot { display: flex; gap: 14px; padding: 12px 20px; border-top: 1px solid var(--fill-6); font-size: 10px; color: var(--ink-30); flex-wrap: wrap; }
.table-foot .n { font-weight: 500; color: var(--ink-42); }
.d { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--line-6); margin-right: 6px; } .d.ok { background: var(--ok); } .d.flight { background: var(--flight); }
.sp-cards { display: none; }

/* ---------- sub project ---------- */
.sp-head { display: flex; align-items: center; gap: 16px; min-height: 76px; margin: 0 0 14px; }
.sp-title { margin: 0; font-size: 56px; font-weight: 700; letter-spacing: -.025em; line-height: 1; text-shadow: var(--title-glow); }
.sp-head .accent { height: 46px; width: 3px; }
.tabs { display: flex; gap: 6px; flex: none; }
.tabs a { height: 44px; padding: 0 14px; border-radius: var(--r-md); display: flex; flex-direction: column; justify-content: center; gap: 4px; background: var(--tab-bg); border: 1px solid var(--fill-6); min-width: 104px; }
.tabs a:hover { border-color: var(--line-5); }
.tabs a em { font-style: normal; font-size: 8.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-42); }
.tabs a em::before { content: "— "; }
.tabs a span { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.tabs a[aria-current="page"] { background: var(--tab-on); border-color: var(--tab-on); }
.tabs a[aria-current="page"] em { color: var(--ink-dark-50); } .tabs a[aria-current="page"] span { color: var(--ink-dark); }
.sp-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .93fr) minmax(0, 1fr); gap: 12px; }
.panel { border-radius: var(--r-lg); background: var(--panel-solid); border: 1px solid var(--fill-7); box-shadow: var(--panel-drop); min-width: 0; display: flex; flex-direction: column; min-height: 340px; }
.panel.auto { min-height: 0; }
.panel-head { min-height: 52px; padding: 8px 12px 8px 14px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--fill-6); flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-size: 14px; font-weight: 700; }
.panel-ico { width: 22px; height: 22px; border-radius: var(--r-xs); display: inline-flex; align-items: center; justify-content: center; flex: none; background: color-mix(in srgb, var(--tint) 24%, transparent); color: var(--tint); }
.panel-ico svg { width: 13px; height: 13px; }
.tint-peach { --tint: var(--tint-peach); } .tint-violet { --tint: var(--tint-violet); } .tint-amber { --tint: var(--tint-amber); }
.tint-green { --tint: var(--tint-green); } .tint-blue { --tint: var(--tint-blue); } .tint-muted { --tint: var(--tint-muted); }
.panel-body { padding: 12px 14px; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.panel-foot { display: flex; align-items: center; gap: 16px; min-height: 34px; padding: 6px 16px; border-top: 1px solid var(--fill-6); background: var(--well); border-radius: 0 0 var(--r-lg) var(--r-lg); margin-top: auto; flex-wrap: wrap; }
.stat { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--ink-50); }
.stat::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--dot, var(--done)); }
.stat b { font-size: 11px; font-weight: 500; color: var(--ink-85); }
.stat.blue { --dot: var(--flight); } .stat.amber { --dot: var(--tint-amber); } .stat.violet { --dot: var(--tint-violet); } .stat.peach { --dot: var(--peach); }
.hint { margin: 0; font-size: 11px; color: var(--ink-42); }
.empty-panel { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px; padding: 20px; color: var(--ink-42); font-size: 12px; }
.empty-panel b { color: var(--ink-72); font-size: 13px; }

/* audio */
.trk { display: flex; align-items: center; gap: 8px; padding: 8px 2px; font-size: 12px; font-weight: 500; flex-wrap: wrap; }
.trk + .trk { border-top: 1px solid var(--fill-5); }
.trk .star { color: var(--tint-amber); } .trk .star.dim { color: var(--ink-22); }
.trk .name { text-transform: uppercase; letter-spacing: .02em; }
.wave { width: 100%; height: 96px; border-radius: var(--r-sm); background: var(--wave-bg); }
.versions-mini { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--ink-50); }

/* boards */
.board-cards { display: flex; flex-wrap: wrap; gap: 10px; }
.board-card { border: 1px solid var(--fill-7); border-radius: var(--r-md); padding: 10px; background: var(--th-bg); width: 240px; max-width: 100%; text-align: left; color: inherit; }
.board-card:hover { border-color: var(--line-5); }
.board-title { display: flex; gap: 8px; align-items: baseline; margin-bottom: 8px; font-size: 12px; font-weight: 700; } .board-title small { color: var(--ink-35); font-size: 10px; font-weight: 400; }
.thumbs8 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.thumbs8 > * { aspect-ratio: 1; border-radius: 4px; background: var(--media-ph); overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--ink-35); }
.thumbs8 img { width: 100%; height: 100%; object-fit: cover; }
.thumbs8 svg { width: 14px; height: 14px; }

/* notes */
.notes { display: flex; gap: 12px; flex: 1; min-height: 0; }
.note-list { list-style: none; margin: 0; padding: 0 10px 0 0; width: 40%; border-right: 1px solid var(--line-2); overflow-y: auto; max-height: 360px; }
.note-list button { display: block; width: 100%; text-align: left; padding: 7px 8px; border-radius: var(--r-sm); border: 0; background: none; color: inherit; }
.note-list button:hover { background: var(--fill-4); }
.note-list button[aria-current="true"] { background: var(--fill-6); }
.note-list b { display: block; font-size: 12px; font-weight: 700; } .note-list small { color: var(--ink-35); font-size: 9.5px; display: flex; gap: 5px; align-items: center; margin-top: 3px; }
.note-body { flex: 1; min-width: 0; overflow-y: auto; max-height: 360px; }
.note-body h3 { margin: 0; font-size: 18px; font-weight: 700; }
.note-body .md h3, .note-body .md h4 { margin: 14px 0 4px; font-size: 13px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
.note-body .md p, .note-body .md li { color: var(--ink-72); font-size: 12px; margin: 0 0 5px; }
.note-body .md ul, .note-body .md ol { margin: 0 0 6px; padding-left: 18px; }
.note-meta { color: var(--ink-42); font-size: 11px; margin: 4px 0 6px; }

/* given */
.req { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; padding: 10px; border: 1px dashed var(--warn-line); background: var(--bad-fill); border-radius: var(--r-md); font-size: 12px; } .req small { width: 100%; color: var(--ink-42); }
.file-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: var(--r-sm); }
.file-row:hover { background: var(--fill-3); }
.ftype { width: 30px; height: 30px; border-radius: 7px; background: var(--fill-6); border: 1px solid var(--fill-7); font-size: 8px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-62); flex: none; text-transform: uppercase; }
.file-row .t { flex: 1; min-width: 0; } .file-row .t b { display: block; font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .file-row .t small { color: var(--ink-35); font-size: 10px; }
.group-cap { margin-top: 6px; }

/* treatment */
.deck-stage { position: relative; aspect-ratio: 16 / 9; background: var(--wave-bg); border: 1px solid var(--fill-7); border-radius: var(--r-xs); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.deck-stage img { width: 100%; height: 100%; object-fit: contain; }
.deck-stage .nav { position: absolute; top: 50%; transform: translateY(-50%); }
.deck-stage .nav.prev { left: 8px; } .deck-stage .nav.next { right: 8px; }

/* palette */
.pal-row { display: flex; gap: 8px; align-items: center; font-weight: 700; font-size: 13px; flex-wrap: wrap; }
.swatches-big { display: flex; flex: 1; min-height: 150px; border-radius: var(--r-sm); overflow: hidden; }
.swatches-big button { flex: 1; min-width: 36px; border: 0; display: flex; align-items: flex-end; justify-content: center; padding: 10px 4px; font-size: 10px; font-weight: 700; font-family: var(--mono); }

/* production */
.ld-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.ld { text-align: left; padding: 0; border: 0; background: none; color: inherit; }
.ld b { display: block; margin-top: 9px; font-size: 13px; font-weight: 700; } .ld small { color: var(--ink-35); font-size: 10.5px; }
.ld-thumb { aspect-ratio: 16 / 10; border-radius: var(--r-md); border: 1px solid var(--fill-7); position: relative; display: flex; align-items: center; justify-content: center; background: var(--media-ph); overflow: hidden; color: var(--ink-30); }
.ld[aria-current="true"] .ld-thumb { border-color: var(--ink-50); }
.ld-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ld-thumb > svg { width: 28px; height: 28px; }
.ld-thumb .pill { position: absolute; top: 8px; left: 8px; }
.ld-viewer { aspect-ratio: 16 / 7; border-radius: var(--r-md); background: var(--media-ph); display: flex; align-items: center; justify-content: center; text-align: center; color: var(--ink-42); padding: 20px; overflow: hidden; }
.ld-viewer img, .ld-viewer video { max-width: 100%; max-height: 100%; }

/* deliveries */
.del-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 12px; }
.review { display: flex; gap: 16px; }
.review-frame { flex: 1.3; aspect-ratio: 16 / 9; border-radius: var(--r-md); background: var(--media-ph); border: 1px solid var(--fill-7); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--ink-42); text-align: center; padding: 16px; overflow: hidden; }
.review-frame img { width: 100%; height: 100%; object-fit: cover; }
.review-frame svg { width: 30px; height: 30px; }
.review-side { flex: 1; min-width: 0; }
.vlabel { font-size: 38px; font-weight: 700; letter-spacing: -.025em; line-height: 1; margin: 0 0 6px; }
.review-side p { font-size: 12px; color: var(--ink-72); margin: 8px 0; }
.specs { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.ver-row { display: flex; gap: 10px; align-items: center; padding: 10px 8px; border-radius: var(--r-md); }
.ver-row + .ver-row { margin-top: 3px; }
.ver-row.on { background: var(--fill-5); }
.ver-row > b { width: 52px; font-size: 13px; font-weight: 700; flex: none; }
.ver-row .t { flex: 1; min-width: 0; font-size: 12px; } .ver-row .t small { display: block; color: var(--ink-35); font-size: 10px; margin-top: 3px; }
.sec { margin: 16px 0 6px; }

/* ---------- sheets, viewers, toast ---------- */
.sheet-scrim { position: fixed; inset: 0; z-index: 60; background: var(--scrim); display: flex; align-items: center; justify-content: center; padding: 12px; animation: fade var(--t-slow); }
.sheet { width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; padding: 22px 22px 20px; border-radius: var(--r-xl); background: var(--panel-solid); border: 1px solid var(--fill-7); box-shadow: var(--big-drop); }
.sheet h2 { margin: 0 0 6px; font-size: 22px; font-weight: 700; }
.sheet .lede { font-size: 13px; color: var(--ink-62); margin: 0 0 6px; } .sheet .lede b { color: var(--ink); }
.inv-lines { list-style: none; margin: 12px 0 0; padding: 0; font-size: 13px; }
.inv-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--fill-6); }
.inv-lines li.total { font-weight: 700; }
.payment-md { margin-top: 12px; padding: 12px 14px; border-radius: var(--r-md); background: var(--fill-4); font-size: 13px; }
.payment-md p { margin: 0 0 8px; } .payment-md ul, .payment-md ol { margin: 0 0 8px; padding-left: 18px; }
.progress { height: 4px; border-radius: var(--r-pill); background: var(--fill-6); overflow: hidden; margin-top: 10px; }
.progress i { display: block; height: 100%; width: 0; background: var(--ink); transition: width var(--t-fast); }
@keyframes fade { from { opacity: 0; } }
.viewer { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; background: var(--page); }
.viewer-bar { display: flex; align-items: center; gap: 8px; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; }
.viewer-bar .title { flex: 1; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pages { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; min-height: 0; }
.pages::-webkit-scrollbar { display: none; }
.page-slide { flex: 0 0 100%; scroll-snap-align: center; display: flex; align-items: center; justify-content: center; padding: 8px 16px; }
.page-slide img { max-height: 100%; width: auto; max-width: 100%; aspect-ratio: 16 / 9; object-fit: contain; border-radius: var(--r-xs); background: var(--media-ph); }
.thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); }
.thumbs button { flex: none; width: 96px; aspect-ratio: 16 / 9; padding: 0; border-radius: var(--r-xs); overflow: hidden; border: 2px solid transparent; background: var(--media-ph); }
.thumbs button[aria-current="true"] { border-color: var(--ink); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.lightbox-img { flex: 1; display: flex; align-items: center; justify-content: center; padding: 12px; min-height: 0; }
.lightbox-img img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--r-xs); }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 80; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 11px 18px; border-radius: var(--r-pill); background: var(--panel-solid); border: 1px solid var(--line-4); font-size: 13px; box-shadow: var(--big-drop); }

/* ---------- sign-in, simple pages, settings ---------- */
.center-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.simple-card { width: 100%; max-width: 420px; padding: 28px 26px; border-radius: var(--r-2xl); background: var(--fill-3); border: 1px solid var(--line-3); box-shadow: var(--inset-hi), var(--big-drop); }
.simple-card .wordmark { display: block; margin-bottom: 26px; }
.simple-card h1 { margin: 0 0 8px; font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.simple-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.simple-page main:not(.simple-card):not(.doc) { width: 100%; max-width: 420px; padding: 28px 26px; border-radius: var(--r-2xl); background: var(--fill-3); border: 1px solid var(--line-3); }
.simple-page form { margin-top: 20px; }
.doc-page { justify-content: flex-start; }
.doc { width: 100%; max-width: 720px; padding: 28px 26px; border-radius: var(--r-2xl); background: var(--fill-3); border: 1px solid var(--line-3); }
.doc h1 { margin: 0 0 6px; } .doc h2 { font-size: 16px; margin: 24px 0 8px; } .doc p, .doc li { color: var(--ink-62); }
.settings-grid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
.pref-row { display: grid; grid-template-columns: 1fr 58px 58px; gap: 10px; align-items: center; padding: 9px 4px; font-size: 12.5px; }
.pref-row.head { padding-top: 0; }
.pref-row + .pref-row { border-top: 1px solid var(--fill-5); }
.pref-row .switch { justify-self: center; }
.device-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px; }
.device-row + .device-row { border-top: 1px solid var(--fill-5); }
.device-row .t { flex: 1; min-width: 0; } .device-row .t b { display: block; font-size: 12.5px; } .device-row .t small { color: var(--ink-42); font-size: 10.5px; }

.skeleton { border-radius: var(--r-xl); min-height: 160px; margin-bottom: 12px; background: var(--fill-3); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }
.empty-page { max-width: 520px; margin: 60px auto; text-align: center; padding: 30px; border-radius: var(--r-2xl); background: var(--fill-3); border: 1px solid var(--line-3); color: var(--ink-50); }
.empty-page b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 6px; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .sp-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 1100px) {
  .dash-grid, .dash-grid.no-inv { grid-template-columns: minmax(0, 1fr); grid-template-areas: "cal" "inv" "proj"; gap: 12px; }
  .dash-grid.no-inv { grid-template-areas: "cal" "proj"; }
  .del-grid, .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .appbar { padding: 12px 14px; } main.page { padding: 4px 12px 10px; } .preview-banner { margin: 0 12px 10px; }
}
@media (max-width: 860px) {
  .sp-grid { grid-template-columns: minmax(0, 1fr); }
  .panel { min-height: 0; }
  .table-wrap, .table-foot .scroll-hint { display: none; }
  .sp-cards { display: flex; flex-direction: column; gap: 8px; padding: 14px 12px 0; }
  .sp-card { display: block; padding: 12px 14px; border-radius: var(--r-xl); background: var(--panel-solid); border: 1px solid var(--line-2); }
  .sp-card .top { display: flex; align-items: center; gap: 10px; }
  .sp-card .num { font-size: 22px; color: var(--ink-30); width: 32px; }
  .sp-card .top b { flex: 1; font-size: 15px; }
  .sp-card dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 10px 0 0; align-items: center; }
  .sp-card dt { font-size: 8.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-35); }
  .sp-card dd { margin: 0; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px; font-size: 12px; }
  .review { flex-direction: column; }
}
@media (max-width: 760px) {
  .cal-card { flex-direction: column; padding: 14px; }
  .today-col { width: auto; }
  .month-title { font-size: 28px; }
  .month-grid { grid-auto-rows: 46px; gap: 4px; } .month-grid.week { grid-auto-rows: 46px; } .dow { gap: 4px; } .dow span { padding-left: 0; text-align: center; }
  .day { padding: 4px; border-radius: 9px; align-items: center; } .day .ev { font-size: 0; padding: 0; gap: 0; width: auto; } .day .ev::before { width: 5px; height: 5px; } .day .ev .t, .day .more { display: none; }
  .day .evs { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; }
  .inv-row { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; padding: 6px 10px; } .inv-row .when, .inv-row .pill { display: none; }
  .proj-row .count, .proj-row .heat, .proj-row .date { display: none; }
  .sp-head { flex-direction: column; align-items: flex-start; gap: 10px; } .sp-title { font-size: 38px; }
  .tabs { width: 100%; } .tabs a { flex: 1; min-width: 0; }
  .crumbs .mid, .crumbs .sep.mid, .who { display: none; }
  .notes { flex-direction: column; } .note-list { width: 100%; border-right: 0; border-bottom: 1px solid var(--line-2); padding: 0 0 8px; max-height: 180px; }
  .big-num span { font-size: 40px; }
}

/* ---------- Deliveries tab: the PM's Delivery + Preview page, read-only for clients (portal v0.3.4) ---------- */
.dl2 { display: grid; grid-template-columns: var(--dl-split, minmax(0, 1.55fr) minmax(0, 1fr)); gap: 12px; height: calc(100vh - 210px); min-height: 600px; position: relative; color: var(--dl-ink); }
.dl-panel { min-height: 0; display: flex; flex-direction: column; border-radius: 12px; background: var(--dl-panel); border: 1px solid var(--dl-l08); overflow: hidden; container-type: inline-size; }
.dl-empty { align-items: center; justify-content: center; gap: 8px; grid-column: 1 / -1; color: var(--dl-ink-45); }
.dl-empty svg { width: 30px; height: 30px; }
.dl-grip { position: absolute; top: 0; bottom: 0; width: 12px; cursor: col-resize; z-index: 2; }
.dl-grip::after { content: ""; position: absolute; top: 50%; left: 5px; width: 2px; height: 36px; margin-top: -18px; border-radius: 2px; background: var(--dl-l13); opacity: 0; transition: opacity .15s; }
.dl-grip:hover::after { opacity: 1; }
@media (max-width: 1100px) { .dl-grip { display: none; } }
.dl-head { flex: none; height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 14px; border-bottom: 1px solid var(--dl-l07); }
.dl-head .spacer, .dl-src .spacer, .dl-comh .spacer, .dl-crow .spacer, .dl-comfoot .spacer, .dl-foot .spacer { flex: 1; }
.dl-ico { flex: none; width: 22px; height: 22px; display: grid; place-items: center; }
.dl-ico svg { width: 20px; height: 20px; }
.dl-ico.send { color: var(--dl-icon-green); } .dl-ico.play { color: var(--dl-teal); }
.dl-title { font: 650 14px/1.2 var(--sans); white-space: nowrap; }
.dl-pill { flex: none; height: 18px; padding: 0 7px; border-radius: 999px; background: var(--dl-l07); display: grid; place-items: center; white-space: nowrap; font: 600 10.5px/1 var(--sans); color: var(--dl-ink-72); }
.dl-tray { flex: none; display: flex; gap: 2px; padding: 2px; border-radius: 9px; background: var(--dl-l03); border: 1px solid var(--dl-l07); }
.dl-tray button { width: 26px; height: 24px; border: 0; border-radius: 7px; display: grid; place-items: center; background: transparent; color: var(--dl-ink-60); cursor: pointer; }
.dl-tray button:hover { background: var(--dl-l08); color: var(--dl-ink); }
.dl-tray button.on { background: var(--dl-l10); color: var(--dl-ink); }
.dl-tray svg { width: 13px; height: 13px; }
.dl-sizer { flex: none; display: flex; align-items: center; gap: 6px; color: var(--dl-ink-45); }
.dl-sizer[hidden] { display: none; }
.dl-sq { width: 12px; height: 12px; border: 1.5px solid currentColor; border-radius: 3px; display: block; }
.dl-sq.small { width: 8px; height: 8px; }
.dl-slider { width: 90px; accent-color: var(--dl-ink); }
.dl-tool { flex: none; height: 44px; box-sizing: border-box; display: flex; align-items: center; gap: 8px; padding: 0 16px; border-bottom: 1px solid var(--dl-l05); }
.dl-searchbox { width: 180px; height: 28px; box-sizing: border-box; display: flex; align-items: center; gap: 6px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--dl-l08); background: var(--dl-l03); color: var(--dl-ink-45); }
.dl-searchbox svg { width: 12px; height: 12px; flex: none; }
.dl-search { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--dl-ink); font: 500 11.5px/1 var(--sans); }
.dl-search::placeholder { color: var(--dl-ink-40); }
.dl-cols { flex: 1; min-height: 0; display: flex; overflow-x: auto; overflow-y: hidden; }
.dl-col { flex: none; display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--dl-l06); background: var(--dl-parent); width: 150px; }
.dl-col.list { width: 250px; }
.dl-col.last { background: transparent; flex: 1 0 auto; min-width: 320px; width: auto; border-right: 0; }
.dl-col.grid.last { min-width: 560px; }
.dl-col.grid:nth-last-child(2) { width: 170px; }
.dl-colh { flex: none; height: 32px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px; }
.dl-colh span { font: 700 9.5px/1 var(--mono); letter-spacing: .14em; color: var(--dl-ink-50); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-colh small { font: 500 10px/1 var(--mono); color: var(--dl-ink-35); white-space: nowrap; }
.dl-colb { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 8px 12px; display: flex; flex-direction: column; gap: 4px; }
.dl-col.grid.last .dl-colb { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--dl-tile, 180px), 1fr)); align-content: start; gap: 8px; }
.dl-hint { margin: 10px 4px; color: var(--dl-ink-40); font-size: 12px; }
.dl-tile { padding: 5px; border-radius: 9px; cursor: pointer; border: 1px solid transparent; min-width: 0; }
.dl-tile:hover { background: var(--dl-l04); }
.dl-tile.on { background: var(--dl-l09); box-shadow: inset 0 0 0 1px var(--dl-ring); }
.dl-thumbwrap { position: relative; aspect-ratio: 16 / 9; }
.dl-tile.file .dl-scrub { position: absolute; inset: 0; border-radius: 6px; border: 1px solid var(--dl-l07); overflow: hidden; cursor: ew-resize; background: var(--media-ph); }
.dl-scrub { position: relative; overflow: hidden; }
.dl-pic { position: absolute; inset: 0; background-repeat: no-repeat; }
.dl-playhead { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--dl-white); box-shadow: var(--dl-shadow); opacity: 0; pointer-events: none; }
.dl-tc { position: absolute; right: 6px; bottom: 6px; height: 18px; padding: 0 6px; display: none; align-items: center; border-radius: 5px; background: var(--dl-chip-bg); font: 650 10px/1 var(--mono); color: var(--dl-ink); }
.dl-tc.small { right: auto; left: 5px; bottom: 5px; height: 15px; font-size: 9px; padding: 0 5px; }
.dl-scrub.scrubbing .dl-playhead { opacity: 1; }
.dl-scrub.scrubbing .dl-tc:not(:empty) { display: flex; }
.dl-scrub.scrubbing ~ .dl-bar { opacity: 0; }
.dl-bar { position: absolute; left: 1px; right: 1px; bottom: 1px; height: 3px; border-radius: 0 0 6px 6px; background: transparent; }
.dl-bar.approved { background: var(--dl-green); }
.dl-bar.changes_requested { background: var(--dl-amber); }
.dl-badge { position: absolute; top: 6px; right: 6px; height: 17px; min-width: 17px; padding: 0 5px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; gap: 3px; border-radius: 5px; font: 700 9.5px/1 var(--mono); z-index: 1; }
.dl-badge svg { width: 10px; height: 10px; }
.dl-badge.ok { background: var(--dl-green-bg); color: var(--dl-green); }
.dl-badge.warn { background: var(--dl-amber-bg); color: var(--dl-amber); }
.dl-row .dl-badge { position: static; }
.dl-name { display: block; margin-top: 6px; font: 600 12px/1.25 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-meta { display: block; margin-top: 2px; font: 500 10px/1.2 var(--mono); color: var(--dl-ink-45); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-folder { position: absolute; inset: 0; }
.dl-ftab { position: absolute; top: 0; left: 0; width: 42%; height: 7px; border-radius: 5px 5px 0 0; background: var(--dl-folder); border: 1px solid var(--dl-l14); border-bottom: 0; box-sizing: border-box; }
.dl-fbody { position: absolute; top: 6px; left: 0; right: 0; bottom: 0; border-radius: 0 7px 7px 7px; background: var(--dl-folder); border: 1px solid var(--dl-l14); padding: 5px; box-sizing: border-box; display: grid; gap: 4px; grid-template-columns: 1fr; grid-template-rows: 1fr; place-items: stretch; color: var(--dl-ink-40); }
.dl-fbody > svg { width: 26px; height: 26px; place-self: center; }
.dl-fbody .dl-scrub { border-radius: 4px; background: var(--media-ph); cursor: ew-resize; min-height: 0; }
.dl-fbody.n2 { grid-template-columns: 1fr 1fr; }
.dl-fbody.n3 { grid-template-columns: 1.7fr 1fr; grid-template-rows: 1fr 1fr; }
.dl-fbody.n3 .dl-scrub:first-child { grid-row: 1 / span 2; }
.dl-row { height: 32px; box-sizing: border-box; display: flex; align-items: center; gap: 8px; padding: 0 8px; border-radius: 7px; cursor: pointer; flex: none; }
.dl-row:hover { background: var(--dl-l04); }
.dl-row.on { background: var(--dl-l09); box-shadow: inset 0 0 0 1px var(--dl-ring); }
.dl-row.on .dl-rname { font-weight: 650; }
/* v0.4.0: password sign-in */
.pw-wrap { position: relative; display: block; }
.pw-wrap .input { width: 100%; padding-right: 64px; box-sizing: border-box; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); height: 28px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--dl-ink-60); font: 600 12px/1 var(--sans); cursor: pointer; }
.pw-eye:hover, .pw-eye:focus-visible { background: var(--dl-l08); color: var(--dl-ink); outline: none; }
.pw-forgot { margin-top: 14px; text-align: center; }
.pw-form { display: grid; gap: 10px; }
/* v0.3.5: selection, the right-click menu, download progress */
.dl-tile.picked, .dl-row.picked, .dl-tile.on.picked, .dl-row.on.picked { background: var(--dl-pick); box-shadow: inset 0 0 0 1px var(--dl-pick-ring); }
.dl-tile, .dl-row { user-select: none; -webkit-user-select: none; }
.dl-menu { position: fixed; z-index: 900; min-width: 220px; padding: 6px; border-radius: 12px; background: var(--dl-menu-bg); box-shadow: var(--dl-menu-shadow); color: var(--dl-ink); }
.dl-mhead { padding: 6px 10px 8px; font: 600 10.5px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--dl-ink-45); }
.dl-mi { width: 100%; display: grid; grid-template-columns: 18px 1fr; column-gap: 10px; align-items: center; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--dl-ink); font: 600 13px/1.2 var(--sans); text-align: left; cursor: pointer; }
.dl-mi svg { width: 16px; height: 16px; color: var(--dl-ink-72); }
.dl-mi small { grid-column: 2; margin-top: 3px; font: 500 11px/1.2 var(--sans); color: var(--dl-ink-50); }
.dl-mi:hover:not([disabled]), .dl-mi:focus-visible { background: var(--dl-l08); outline: none; }
.dl-mi[disabled] { opacity: .45; cursor: default; }
.dl-job { flex: none; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--dl-l05); }
.dl-job[hidden] { display: none; }
.dl-jobtext { flex: 1 1 auto; min-width: 0; display: grid; gap: 4px; }
.dl-jobtext b { font: 650 12px/1 var(--sans); }
.dl-jobtext small { font: 500 11px/1.2 var(--sans); color: var(--dl-ink-50); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-jobbar { flex: 0 1 160px; height: 4px; border-radius: 2px; background: var(--dl-l10); overflow: hidden; }
.dl-jobbar i { display: block; height: 100%; background: var(--dl-blue); transition: width .2s linear; }
.dl-ricon { flex: none; color: var(--dl-ink-50); display: grid; place-items: center; }
.dl-ricon svg { width: 15px; height: 15px; }
.dl-rthumb { flex: none; width: 22px; height: 14px; border-radius: 3px; overflow: hidden; background: var(--media-ph); }
.dl-rthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dl-rname { flex: 1; min-width: 0; font: 500 12px/1 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-rsize { flex: none; font: 500 10.5px/1 var(--mono); color: var(--dl-ink-45); }
.dl-chev { flex: none; color: var(--dl-ink-35); display: grid; place-items: center; }
.dl-chev svg { width: 12px; height: 12px; transform: rotate(-90deg); }
.dl-foot { flex: none; height: 34px; box-sizing: border-box; display: flex; align-items: center; gap: 14px; padding: 0 14px; border-top: 1px solid var(--dl-l05); font: 500 11px/1 var(--sans); color: var(--dl-ink-50); white-space: nowrap; overflow: hidden; }
.dl-foot b { color: var(--dl-ink); font: 650 11px/1 var(--mono); }
.dl-foot .dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; margin-right: 6px; vertical-align: middle; background: var(--dl-ink-40); }
.dl-foot .dot.ok { background: var(--dl-green); } .dl-foot .dot.blue { background: var(--dl-blue); }
.dl-foot .faint { overflow: hidden; text-overflow: ellipsis; font: 500 10.5px/1 var(--mono); color: var(--dl-ink-35); }
/* preview */
.dl-sign { display: flex; gap: 8px; }
.dl-btn { flex: none; height: 28px; padding: 0 13px; display: flex; align-items: center; gap: 6px; border-radius: 999px; border: 1px solid var(--dl-l13); background: transparent; color: var(--dl-ink); font: 650 11.5px/1 var(--sans); white-space: nowrap; cursor: pointer; }
.dl-btn svg { width: 12px; height: 12px; }
.dl-btn.ok { background: var(--dl-green); border-color: transparent; color: var(--dl-black); }
.dl-btn:disabled { opacity: .45; cursor: not-allowed; }
.dl-titlerow { flex: none; height: 44px; box-sizing: border-box; display: flex; align-items: center; gap: 8px; padding: 0 16px; border-bottom: 1px solid var(--dl-l05); }
.dl-fname { flex: 1; min-width: 0; font: 650 16px/1.2 var(--sans); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-chip { flex: none; height: 17px; padding: 0 6px; display: flex; align-items: center; border-radius: 5px; background: var(--dl-l07); color: var(--dl-ink-60); font: 700 9px/1 var(--mono); letter-spacing: .06em; }
.dl-chip.ok { background: var(--dl-green-chip); color: var(--dl-green); }
.dl-chip.warn { background: var(--dl-amber-bg); color: var(--dl-amber); }
.dl-pbody { flex: 1; min-height: 0; overflow: hidden; padding: 12px 16px 0; display: flex; flex-direction: column; gap: 12px; }
.dl-player { position: relative; flex: none; border-radius: 12px; background: var(--dl-player); border: 1px solid var(--dl-l08); overflow: hidden; container: dlp / inline-size; aspect-ratio: var(--dl-aspect, 16 / 9); max-height: 52vh; min-height: 220px; }   /* LED-wall masters (7680x1080) letterbox inside rather than shrinking the player to a strip */
.dl-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--dl-player); cursor: pointer; }
.dl-over { position: absolute; left: 0; right: 0; bottom: 0; padding: 32px 12px 8px; background: var(--dl-fade); transition: opacity .35s; }
.dl-over.idle { opacity: 0; }
.dl-over:hover { opacity: 1; }
.dl-bar2 { position: relative; height: 14px; cursor: pointer; }
.dl-bar2 > i { position: absolute; left: 0; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 2px; }
.dl-track { right: 0; background: var(--dl-l25); }
.dl-buf { background: var(--dl-l20); width: 0; }
.dl-prog { background: var(--dl-white); width: 0; }
.dl-bar2 > .dl-dot { width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%; background: var(--dl-white); box-shadow: var(--dl-dot-shadow); }
.dl-marks { position: absolute; inset: 0; pointer-events: none; }
.dl-mark { position: absolute; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--dl-amber); border: 1.5px solid var(--dl-mark-line); box-sizing: border-box; pointer-events: auto; }
.dl-crow { display: flex; align-items: center; gap: 4px; color: var(--dl-white); }
.dl-cbtn { width: 48px; height: 48px; border: 0; border-radius: 11px; display: grid; place-items: center; background: transparent; color: var(--dl-white); cursor: pointer; }
.dl-cbtn:hover { background: var(--dl-l14); }
.dl-cbtn svg { width: 22px; height: 22px; }
.dl-tc2 { margin-left: 6px; font: 600 17px/1 var(--mono); text-shadow: var(--dl-text-shadow); white-space: nowrap; }
.dl-total { opacity: .6; font-weight: 600; }
@container dlp (max-width: 470px) { [data-dl-opt] { display: none; } }
.dl-speed { height: 32px; min-width: 40px; padding: 0 8px; border: 0; border-radius: 9px; background: var(--dl-l18); color: var(--dl-white); font: 700 14px/1 var(--mono); cursor: pointer; }
.dl-qual { height: 20px; padding: 0 6px; margin: 0 4px; border: 0; border-radius: 5px; background: var(--dl-white); color: var(--dl-black); font: 700 10px/1 var(--mono); cursor: pointer; }
.dl-below { flex: 1; min-height: 220px; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px; container: dld / inline-size; }
.dl-src { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dl-kick { font: 700 9.5px/1 var(--mono); letter-spacing: .14em; color: var(--dl-ink-45); }
.dl-seg { flex: none; display: flex; gap: 2px; padding: 2px; border-radius: 9px; background: var(--dl-l03); border: 1px solid var(--dl-l07); }
.dl-seg button { height: 24px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--dl-ink-60); font: 600 11px/1 var(--sans); cursor: pointer; display: flex; align-items: center; gap: 5px; }
.dl-seg button.on { background: var(--dl-l10); color: var(--dl-ink); }
.dl-seg button small { font: 600 9.5px/1 var(--mono); color: var(--dl-ink-45); }
.dl-srcnote { font: 500 11px/1 var(--sans); color: var(--dl-ink-45); white-space: nowrap; }
.dl-com { min-height: 180px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.dl-comh { flex: none; display: flex; align-items: center; gap: 10px; }
.dl-comh > b { font: 650 18px/1 var(--sans); }
.dl-ibtn { width: 26px; height: 26px; border: 0; border-radius: 8px; display: grid; place-items: center; background: transparent; color: var(--dl-ink-50); cursor: pointer; }
.dl-ibtn:hover { background: var(--dl-l08); color: var(--dl-ink); }
.dl-ibtn svg { width: 13px; height: 13px; }
.dl-combox { flex: none; border-radius: 12px; background: var(--dl-box); border: 1px solid var(--dl-l08); padding: 10px 12px; }
.dl-combox.typing { border-color: var(--dl-l28); }
.dl-ta { width: 100%; box-sizing: border-box; resize: none; border: 0; outline: 0; background: transparent; color: var(--dl-ink); font: 500 12.5px/1.45 var(--sans); }
.dl-ta::placeholder { color: var(--dl-ink-40); }
.dl-comfoot { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.dl-stamp { height: 22px; padding: 0 8px; display: flex; align-items: center; gap: 5px; border-radius: 999px; background: var(--dl-amber-bg); border: 1px solid var(--dl-amber-line); color: var(--dl-amber); font: 650 10.5px/1 var(--mono); cursor: pointer; }
.dl-stamp svg { width: 11px; height: 11px; }
.dl-stamp.off { background: transparent; border-color: var(--dl-l13); color: var(--dl-ink-50); }
.dl-send { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--dl-l13); background: transparent; color: var(--dl-ink-45); display: grid; place-items: center; cursor: pointer; }
.dl-combox.typing .dl-send { background: var(--dl-white); color: var(--dl-black); border-color: transparent; }
.dl-send svg { width: 12px; height: 12px; }
.dl-comlist { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.dl-cmt { display: flex; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--dl-l05); }
.dl-cmt.reply { border: 0; padding: 8px 0 0; }
.dl-cmt.done .dl-ctext { text-decoration: line-through; opacity: .6; }
.dl-av { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--dl-teal); color: var(--dl-black); font: 700 10px/1 var(--sans); }
.dl-cbody { flex: 1; min-width: 0; }
.dl-cwho { display: flex; align-items: baseline; gap: 6px; }
.dl-cwho b { font: 650 12.5px/1.2 var(--sans); }
.dl-cwho small { font: 500 10.5px/1 var(--sans); color: var(--dl-ink-40); }
.dl-ctext { margin-top: 4px; font: 500 12.5px/1.45 var(--sans); color: var(--dl-ink-85); overflow-wrap: anywhere; }
.dl-tchip { height: 16px; padding: 0 5px; margin-right: 6px; border: 0; border-radius: 4px; background: var(--dl-amber-bg); color: var(--dl-amber); font: 650 10px/16px var(--mono); cursor: pointer; vertical-align: 1px; }
.dl-details { border-top: 1px solid var(--dl-l08); padding: 12px 0 14px; display: flex; flex-direction: column; gap: 10px; }
.dl-dh { font: 650 15px/1 var(--sans); }
.dl-dgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.dl-dtile { padding: 8px 10px; border-radius: 8px; background: var(--dl-l03); border: 1px solid var(--dl-l06); min-width: 0; }
.dl-dtile small { display: block; font: 700 8.5px/1 var(--mono); letter-spacing: .12em; color: var(--dl-ink-40); }
.dl-dtile b { display: block; margin-top: 6px; font: 650 12.5px/1 var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-dcard { border-radius: 8px; background: var(--dl-l03); border: 1px solid var(--dl-l06); padding: 4px 10px; }
.dl-drow { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font: 500 11.5px/1.2 var(--sans); color: var(--dl-ink-50); }
.dl-drow b { color: var(--dl-ink); font-weight: 600; text-align: right; overflow-wrap: anywhere; }
/* wide preview: Details beside Comments, never scrolling */
@container dld (min-width: 720px) {
  .dl-below { grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .dl-src { grid-column: 1 / -1; }
  .dl-com { grid-column: 1; grid-row: 2; }
  .dl-details { grid-column: 2; grid-row: 2; border-top: 0; border-left: 1px solid var(--dl-l10); padding: 0 0 0 20px; overflow: hidden; }
  .dl-dgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 600px) { .dl-btn { padding: 0 10px; } }
@container (max-width: 520px) { [data-dl-cnt] { display: none !important; } }
/* a narrow Preview: its header wraps - sign-off on a full-width row of its own - and the source note gives way */
@container (max-width: 560px) {
  .dl-right .dl-head { height: auto; min-height: 52px; flex-wrap: wrap; row-gap: 8px; padding: 10px 12px; }
  .dl-sign { flex: 1 0 100%; }
  .dl-sign .dl-btn { flex: 1; justify-content: center; }
  .dl-srcnote { display: none; }
}
/* phones and small windows: the two panels stack */
@media (max-width: 1100px) {
  .dl2 { grid-template-columns: minmax(0, 1fr) !important; height: auto; }
  .dl-left { height: 70vh; }
  .dl-col.grid.last { min-width: 260px; }
}
