/* Studio: the layout system of ui-plan §9. Three type sizes, two text colours, the 8-point grid. */
:root {
  --text: #ECEAE5;
  --quiet: #B5B1A8;
  --page: #191918;
  --sidebar: #232220;
  --field: #1F1E1C;
  --tile: #2A2926;
  --hair: #2F2E2B;
  --outline: #3D3B37;
  --field-border: #6E6A63;
  --focus: #8DB6F0;
  --blue-bg: #1B2A40; --blue: #8DB6F0;
  --amber-bg: #3A2A10; --amber: #F0C46E;
  --green-bg: #17301E; --green: #7FCB8F;
  --red-bg: #3D1A1A; --red: #F09A9A;
  --grey-bg: #2A2926; --grey: #B5B1A8;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--page);
  color: var(--text);
  font: 400 14px/20px -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.num, time, .t { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- frame */
.frame { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100%; }
.side {
  background: var(--sidebar);
  display: flex; flex-direction: column;
  padding: 16px 12px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 8px; padding: 4px 8px 16px; font-weight: 600; }
.brand img { width: 20px; height: 20px; border-radius: 5px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; height: 36px; padding: 0 12px; border-radius: 6px;
  color: var(--quiet); font-weight: 500; white-space: nowrap;
}
.nav a:hover { color: var(--text); background: var(--field); }
.nav a[aria-current="page"] { color: var(--text); background: var(--tile); }
.me { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 8px 0; border-top: 1px solid var(--hair); }
.me img, .me .dot { width: 28px; height: 28px; border-radius: 50%; background: var(--tile); flex: none; }
.me .dot { display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: var(--text); }
.me .who { display: flex; flex-direction: column; overflow: hidden; flex: 1 1 calc(100% - 36px); min-width: 0; }
.me .who .name, .me .who .role { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .who .name { font-weight: 500; }
.me .who .role { font-size: 12px; line-height: 16px; color: var(--quiet); }
/* the clients' videos (ui-plan §3): a quiet heading per client, each video with its due date */
.nav.videos { margin-top: 20px; }
.nav.videos .label { margin: 0 0 4px; padding: 0 12px; font-size: 12px; font-weight: 500; color: var(--quiet); }
.nav.videos a { justify-content: space-between; gap: 8px; padding: 0 12px 0 20px; }
.nav.videos a span:first-child { overflow: hidden; text-overflow: ellipsis; }
.nav.videos .due { font-size: 12px; font-weight: 400; color: var(--quiet); font-variant-numeric: tabular-nums; flex: none; }
.me form { margin: 0; }

main { padding: 24px 40px 64px; max-width: 1240px; width: 100%; }

/* ---------------------------------------------------------------- page header: breadcrumb, title, status line (8 apart) */
.head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 32px; }
.crumb { font-size: 12px; line-height: 16px; color: var(--quiet); }
.crumb a:hover { color: var(--text); }
h1 { font-size: 28px; line-height: 34px; font-weight: 600; margin: 0; }
.line { font-size: 12px; line-height: 16px; color: var(--quiet); }

/* ---------------------------------------------------------------- sections */
section + section { margin-top: 32px; }
.label { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--quiet); margin: 0 0 12px; }
.empty { color: var(--quiet); padding: 10px 0; border-top: 1px solid var(--hair); }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: 6px;
  font: inherit; font-weight: 500; color: var(--text);
  background: transparent; border: 1px solid var(--outline); cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--field); }
.btn.primary { background: var(--text); color: var(--page); border-color: var(--text); font-weight: 600; height: 40px; padding: 0 16px; }
.btn.primary:hover { background: #fff; }
.btn.quiet { border-color: transparent; color: var(--quiet); padding: 0 8px; }
.btn.quiet:hover { color: var(--text); background: var(--field); }

/* ---------------------------------------------------------------- status chip (ui-plan §5) */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: 12px;
  font-size: 12px; line-height: 16px; font-weight: 500; white-space: nowrap;
}
.chip.blue { background: var(--blue-bg); color: var(--blue); }
.chip.amber { background: var(--amber-bg); color: var(--amber); }
.chip.green { background: var(--green-bg); color: var(--green); }
.chip.red { background: var(--red-bg); color: var(--red); }
.chip.grey { background: var(--grey-bg); color: var(--grey); }
.si { flex: none; display: block; }

/* ---------------------------------------------------------------- tables: header 40, one-line rows 40, lines only between rows */
.scroll { overflow-x: auto; }
.table { min-width: 860px; }
.tr { display: grid; align-items: center; column-gap: 24px; min-height: 40px; border-bottom: 1px solid var(--hair); }
.tr.th { position: sticky; top: 0; background: var(--page); z-index: 1; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--quiet); border-bottom-color: var(--hair); }
.table .tr:not(.th):has(.rowlink):hover { background: var(--field); }  /* only rows that open something (10 Nov) */
.tr:has(.rowlink) { position: relative; }
.rowlink::after { content: ""; position: absolute; inset: 0; }  /* the name's link covers its row */
.rowlink:focus-visible { outline: none; }
.rowlink:focus-visible::after { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: 6px; }
.tr:has(.rowlink):hover .rowlink .code, .tr:has(.rowlink):hover a.rowlink { text-decoration: underline; text-underline-offset: 3px; }
.shots .tr { grid-template-columns: minmax(0, 1.3fr) 136px repeat(3, minmax(0, 1fr)) 88px 112px; padding: 0 8px; }
.cell-shot { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code { font-weight: 600; }
.name { color: var(--quiet); }
.step { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--quiet); }
.step.has { color: var(--blue); }
.step.has span { background: var(--blue-bg); border-radius: 4px; padding: 2px 6px; }
.right { text-align: right; justify-self: end; }
.dim { color: var(--quiet); font-size: 12px; }

.videos .tr { grid-template-columns: minmax(0, 1fr) 280px 96px 24px; padding: 0 8px; }
.videos a.tr { color: var(--text); }
.chev { color: var(--quiet); }

/* ---------------------------------------------------------------- list rows (My work): tile, two lines, time, one button */
.rows .row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 96px auto; align-items: center; column-gap: 12px; min-height: 64px; padding: 0 8px; border-bottom: 1px solid var(--hair); }
.rows .row:first-child { border-top: 1px solid var(--hair); }
.rows .row:hover { background: var(--field); }
.tile { width: 40px; height: 40px; border-radius: 6px; background: var(--tile); display: grid; place-items: center; }
.two { min-width: 0; }
.two .a, .two .b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.narrow { display: none; }
.two .b { font-size: 12px; line-height: 16px; color: var(--quiet); margin-top: 2px; }

/* ---------------------------------------------------------------- usage (Odin only) */
.usage { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 10px 0; border-top: 1px solid var(--hair); font-size: 12px; line-height: 16px; color: var(--quiet); }
.usage b { font-weight: 500; color: var(--quiet); }
.usage .ok { color: var(--text); }
.usage .amber { color: var(--amber); }
.usage .red { color: var(--red); }
.banner { border-radius: 8px; padding: 12px 16px; margin-bottom: 24px; background: var(--amber-bg); color: var(--amber); }

/* ---------------------------------------------------------------- sign-in and messages */
.center { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.card p { margin: 0; color: var(--quiet); }
.card .brand { padding: 0; font-size: 14px; }

@media (max-width: 760px) {
  .frame { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .side { position: relative; height: auto; flex-direction: row; align-items: center; gap: 8px; padding: 8px 16px; }
  .brand { padding: 0 8px 0 0; }
  .brand span { display: none; }
  .nav { flex-direction: row; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: none; }
  .me { margin: 0 0 0 auto; border: 0; padding: 0; flex: none; flex-wrap: nowrap; }
  .me .who, .me img, .me .dot { display: none; }
  .nav.videos { display: none; }
  main { padding: 24px 16px 48px; }
  .rows .row { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .rows .row time { display: none; }
  .wide { display: none; }
  .narrow { display: inline; }
}

/* ================================================================ part D: shared pieces (the pages in app/pages) */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.blender { margin: 0 0 16px; padding: 8px 12px; border-radius: 8px; background: var(--tile); display: flex; flex-direction: column; gap: 2px; font-size: 12px; line-height: 16px; color: var(--quiet); }
.blender .label { margin: 0; }
/* the Blender dot (Odin, 10 Nov): green while Blender is open and talking to Studio, grey when it is closed or not
   set up; the word always sits beside it (status as shape, colour and word, ui-plan §9) */
.blender .conn { display: flex; align-items: baseline; gap: 8px; }
.blender .conn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--field-border); flex: none; transform: translateY(-1px); }
.blender[data-state="open"] .conn { color: var(--green); }
a.blender { color: var(--quiet); text-decoration: none; }  /* the status opens the Blender page (10 Nov) */
a.blender:hover { background: var(--outline); }
a.blender[aria-current="page"] { box-shadow: inset 0 0 0 1px var(--outline); }
.blender[data-state="open"] .conn .dot { background: #4CAF63; }
.help { position: relative; }
.help summary { list-style: none; }
.help summary::-webkit-details-marker { display: none; }
.helpbox { position: absolute; bottom: 40px; left: 0; width: 280px; background: var(--field); border: 1px solid var(--outline); border-radius: 8px; padding: 16px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.4); z-index: 10; }
.helpbox .label { margin: 0; }
.helpbox form { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
textarea, input[type="text"], input[type="search"], input[type="date"], select {
  width: 100%; font: inherit; color: var(--text); background: var(--field); border: 1px solid var(--field-border); border-radius: 6px; padding: 8px 10px;
}
textarea { resize: vertical; min-height: 64px; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.notice { border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; background: var(--grey-bg); color: var(--text); }
.notice.amber { background: var(--amber-bg); color: var(--amber); }
.notice.red { background: var(--red-bg); color: var(--red); }
.notice .next { color: var(--quiet); }
.warnbox { border: 1px solid var(--outline); border-radius: 8px; background: var(--field); padding: 16px; margin: 0 0 16px; max-width: 520px; }
.warnbox p { margin: 0 0 8px; }
.warnbox form { display: flex; flex-direction: column; gap: 8px; }
.more > summary { cursor: pointer; list-style: none; color: var(--quiet); font-size: 12px; line-height: 16px; font-weight: 500; padding: 4px 0; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary::before { content: "›"; display: inline-block; width: 12px; transition: transform .12s; }
.more[open] > summary::before { transform: rotate(90deg); }
.more[open] > summary { color: var(--text); }
.offline { background: var(--amber-bg); color: var(--amber); border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; }
.skeleton { height: 40px; border-radius: 6px; background: var(--tile); margin-bottom: 8px; opacity: .6; }
.rows .row.amber { background: var(--amber-bg); }
.rows .row .reason { color: var(--quiet); font-size: 12px; line-height: 16px; }
.rows .row .reason.amber { color: var(--amber); }
.player { width: 100%; max-width: 360px; }
.player video { width: 100%; aspect-ratio: 9 / 16; background: #000; border-radius: 8px; display: block; }
.player .scrub { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.player .scrub input { flex: 1; }
.player .sound-line { margin-top: 4px; font-size: 12px; color: var(--quiet); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.two-col { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 32px; align-items: start; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > label, .field > .label { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--quiet); }
.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px; background: var(--tile); color: var(--quiet); font-size: 12px; }
.pill.amber { background: var(--amber-bg); color: var(--amber); }  /* the Blockout preview tag on Needs you (ui-plan §4.2) */
.tick { display: inline-block; width: 16px; text-align: center; }
.tick.ok { color: var(--green); }
.tick.todo { color: var(--amber); }
@media (max-width: 760px) {
  .two-col { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .blender { display: none; }
  .helpbox { bottom: auto; top: 40px; }
  .player { max-width: none; }
}

/* ---- part D: My work */
.rows .notes { padding: 4px 8px 8px 60px; border-bottom: 1px solid var(--hair); margin-top: -1px; }
.rows .row .btn, .rows .row form { justify-self: end; }
.rows .row img, .rows .row video.thumbv { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; }
.notice { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.step-line { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--hair); }
.step-line form.inline { display: flex; gap: 8px; align-items: center; }
.step-line form.inline input { width: 220px; }
@media (max-width: 760px) {
  .step-line { grid-template-columns: 24px minmax(0, 1fr); }
  .step-line > :nth-child(3) { grid-column: 2; }
  .rows .notes { padding-left: 8px; }
}

.narrow-form { max-width: 320px; }

[hidden] { display: none !important; }

/* Phone: Help sits in the top bar, so its box opens below the bar, inside the screen. */
@media (max-width: 760px) {
  .help { position: static; }
  .helpbox { bottom: auto; top: 100%; left: auto; right: 8px; width: min(280px, calc(100vw - 16px)); }
}
/* the Blender page (10 Nov) */
.blender-state { display: flex; align-items: center; gap: 8px; color: var(--quiet); }
.blender-state .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--field-border); }
.blender-state[data-state="open"] { color: var(--green); }
.blender-state[data-state="open"] .dot { background: #4CAF63; }
.bl-get { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bl-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; max-width: 70ch; }
.rows .row.bl-device { grid-template-columns: minmax(0, 1fr) 96px auto; }
