/* Vidiicast design system: "the tally light".
   Blue marks anything you can press (buttons, links, switches, selections).
   Red is the on-air light: it only appears when something is live or recording. Shows and people get a flat identity tone
   so lists aren't a wall of grey. Everything else is ink on paper, Apple-style.
   Flat surfaces; shadows only on things that float. */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, "Helvetica Neue", sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", system-ui, Roboto, "Helvetica Neue", sans-serif;
  --font-rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  /* light appearance */
  --bg: #f5f5f7;
  --sidebar: rgba(236, 236, 241, 0.78);
  --bar: rgba(245, 245, 247, 0.78);
  --surface: #ffffff;
  --surface-2: #f2f2f5;
  --surface-hover: #f7f7f9;
  --fill: rgba(118, 118, 128, 0.12);
  --fill-2: rgba(118, 118, 128, 0.2);
  --label: #1d1d1f;
  --label-2: rgba(60, 60, 67, 0.8);       /* secondary text: 4.5:1 or better on every surface */
  --label-3: rgba(60, 60, 67, 0.36);      /* icons, chevrons and dividers only, never text */
  --placeholder: rgba(60, 60, 67, 0.72);
  --sep: rgba(60, 60, 67, 0.13);
  /* blue: anything you can press */
  --tint: #2f5ce0;
  --tint-hover: #2550c8;
  --tint-text: #2f5ce0;
  --tint-soft: rgba(47, 92, 224, 0.1);
  --on-tint: #ffffff;
  --red: #e5372c;
  --record: #f0605a;      /* the tally light: live and recording only */
  --record-soft: rgba(240, 96, 90, 0.14);
  --record-text: #c42b22;  /* the same red, deep enough for small text */
  --green: #28a745;
  --green-dot: #34c759;
  --orange: #ff9500;
  --shadow: none;          /* surfaces sit flat on the page */
  --shadow-pop: 0 0 0 0.5px rgba(0, 0, 0, 0.08), 0 12px 40px rgba(0, 0, 0, 0.18);   /* menus, sheets, popovers */

  --r-card: 14px;
  --r-control: 9px;
  --sidebar-w: 232px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --sidebar: rgba(28, 28, 30, 0.82);
    --bar: rgba(0, 0, 0, 0.78);
    --surface: #1c1c1e;
    --surface-2: #2c2c2e;
    --surface-hover: #242427;
    --fill: rgba(118, 118, 128, 0.24);
    --fill-2: rgba(118, 118, 128, 0.32);
    --label: #f5f5f7;
    --label-2: rgba(235, 235, 245, 0.62);
    --label-3: rgba(235, 235, 245, 0.32);
    --placeholder: rgba(235, 235, 245, 0.55);
    --sep: rgba(255, 255, 255, 0.09);
    --tint: #3d6cf0;
    --tint-hover: #4f7bff;
    --tint-text: #7fa2ff;
    --tint-soft: rgba(127, 162, 255, 0.16);
    --on-tint: #ffffff;
    --red: #ff5a50;
    --record-soft: rgba(240, 96, 90, 0.2);
    --record-text: #ff8a83;
    --green: #30d158;
    --green-dot: #30d158;
    --orange: #ff9f0a;
    --shadow: none;
    --shadow-pop: 0 0 0 0.5px rgba(255, 255, 255, 0.1), 0 16px 48px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--label);
  font: 400 15px/1.47 var(--font);
  letter-spacing: -0.009em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); }
p { margin: 0; }
a { color: var(--label); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--tint-soft); }

/* ---------- type scale ---------- */
.large-title { font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: -0.022em; }
.title-2 { font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -0.016em; }
.title-3 { font-size: 19px; line-height: 24px; font-weight: 600; letter-spacing: -0.012em; }
.headline { font-size: 15px; line-height: 20px; font-weight: 600; }
.subhead { font-size: 13px; line-height: 18px; color: var(--label-2); }
.footnote { font-size: 12px; line-height: 16px; color: var(--label-2); }
.secondary { color: var(--label-2); }
.tertiary { color: var(--label-2); }
.num { font-variant-numeric: tabular-nums; }
.rounded { font-family: var(--font-rounded); }
.destructive { color: var(--red) !important; }

/* ---------- icons ---------- */
.i { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: -3px; }
.i svg { width: 100%; height: 100%; display: block; }

/* ---------- buttons ---------- */
.btn {
  font: 500 14px/20px var(--font); letter-spacing: -0.006em;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 32px; padding: 6px 14px; border-radius: 999px; border: 0;
  background: var(--fill); color: var(--tint-text); cursor: pointer; white-space: nowrap; text-decoration: none !important;
  transition: background-color 0.15s, transform 0.1s;
}
.btn:hover { background: var(--fill-2); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn.primary { background: var(--tint); color: var(--on-tint); }
.btn.primary:hover { background: var(--tint-hover); }
.btn.plain { background: transparent; color: var(--tint-text); padding-inline: 8px; }
.btn.plain:hover { background: var(--tint-soft); }
.btn.danger { color: var(--red); }
.btn.large { min-height: 44px; padding: 10px 22px; font-size: 16px; font-weight: 600; }
.btn.block { width: 100%; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 999px; border: 0; padding: 0; display: inline-grid; place-items: center;
  background: var(--fill); color: var(--label); cursor: pointer; transition: background-color 0.15s;
}
.icon-btn:hover { background: var(--fill-2); }
.icon-btn.plain { background: transparent; color: var(--label); }
.icon-btn.plain:hover { background: var(--tint-soft); }

/* ---------- inputs ---------- */
.field {
  font: 400 15px/20px var(--font); width: 100%; padding: 9px 12px; border-radius: var(--r-control);
  background: var(--surface-2); border: 1px solid transparent; color: var(--label); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field::placeholder { color: var(--placeholder); }
.field:focus { border-color: var(--tint); box-shadow: 0 0 0 3px var(--tint-soft); }
select.field {
  appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 1.8l3 2.7M3 7.5l3 2.7 3-2.7' fill='none' stroke='%238e8e93' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.label { display: block; font-size: 13px; font-weight: 500; color: var(--label-2); margin: 16px 0 6px; }
.search { position: relative; }
.search .i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--label-3); width: 15px; height: 15px; }
.search .field { padding-left: 32px; background: var(--fill); }

/* ---------- segmented control ---------- */
.segmented { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--fill); gap: 2px; }
.segmented button {
  font: 500 13px/18px var(--font); border: 0; background: transparent; color: var(--label);
  padding: 5px 14px; border-radius: 7px; cursor: pointer; white-space: nowrap;
}
.segmented button[aria-selected="true"] { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .segmented button[aria-selected="true"] { background: #636366; } }

/* ---------- status ---------- */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--label-2); white-space: nowrap; }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--label-3); }
.status.ready::before { background: var(--green-dot); }
.status.busy::before { background: var(--orange); }
.status.live::before { background: var(--record); }
.status.bad { color: var(--red); }
.status.bad::before { background: var(--red); }

/* ---------- grouped lists (cards) ---------- */
.card { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow); }
.card.pad { padding: 18px 20px; }
.list { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow); overflow: hidden; }
.cell {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; min-height: 52px;
  color: inherit; text-decoration: none !important; position: relative;
}
.cell + .cell::before { content: ''; position: absolute; top: 0; left: 16px; right: 0; height: 0.5px; background: var(--sep); }
.cell.indent + .cell.indent::before { left: 62px; }
a.cell:hover, button.cell:hover { background: var(--surface-hover); }
button.cell { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.cell .grow { flex: 1; min-width: 0; }
.cell .t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell .s { font-size: 13px; color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell.wrap .s { white-space: normal; line-height: 17px; margin-top: 2px; }
.cell .chev { color: var(--label-3); width: 14px; height: 14px; }
.cell .trail { display: flex; align-items: center; gap: 10px; flex: none; color: var(--label-2); font-size: 14px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 4px 8px; }
.section-head h2 { font-size: 19px; line-height: 24px; font-weight: 700; letter-spacing: -0.012em; }
.section-foot { margin: 8px 16px 0; font-size: 12px; line-height: 16px; color: var(--label-2); }
.empty { padding: 36px 24px; text-align: center; color: var(--label-2); }
.empty .i { width: 34px; height: 34px; color: var(--label-3); margin-bottom: 10px; }
.empty .headline { color: var(--label); margin-bottom: 4px; }

/* monogram for shows and workspaces: plain, no decoration (the name is the identity) */
.glyph {
  width: 34px; height: 34px; border-radius: 9px; flex: none; display: grid; place-items: center;
  background: var(--fill); color: var(--label); font: 650 13px/1 var(--font-display); letter-spacing: -0.01em;
}
.glyph .i { width: 17px; height: 17px; }
.glyph.lg { width: 48px; height: 48px; border-radius: 12px; font-size: 18px; }
.glyph.muted { background: var(--fill-2); color: var(--label-2); }
.glyph.sm { width: 26px; height: 26px; border-radius: 7px; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; }
.cell > .glyph { font-size: 13px; font-weight: 700; }

/* people */
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  color: var(--label); font-size: 13px; font-weight: 600; letter-spacing: 0.01em;
  background: var(--fill);
}
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.ghost { background: var(--fill); color: var(--label-2); }
.avatar.ghost .i { width: 17px; height: 17px; }
.role-tag { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--fill); color: var(--label-2); }
.role-tag.owner { background: var(--tint-soft); color: var(--tint-text); }
.role-tag.admin { color: var(--label); }

/* workspace switcher and account button in the sidebar */
.ws-switch, .me-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: 10px;
  background: none; font: inherit; color: var(--label); text-align: left; cursor: pointer;
}
.ws-switch { margin: -8px 0 12px; background: var(--fill); }
.ws-switch:hover, .me-btn:hover { background: var(--fill-2); }
.ws-switch .grow, .me-btn .grow { flex: 1; min-width: 0; display: grid; }
.ws-switch .t, .me-btn .t { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-switch .s, .me-btn .s { font-size: 11px; color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-switch .updown { width: 14px; height: 14px; color: var(--label-3); flex: none; }
.me-btn .i { width: 16px; height: 16px; color: var(--label-3); }

/* role and show pickers in sheets */
.role-pick { display: grid; gap: 8px; }
.role-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--fill); cursor: pointer; }
.role-opt:has(input:checked) { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--tint); }
.role-opt input { margin-top: 3px; accent-color: var(--tint); }
.role-opt .t { display: block; font-weight: 600; font-size: 14px; }
.role-opt .s { display: block; font-size: 12px; line-height: 16px; color: var(--label-2); margin-top: 2px; }
.checks { display: grid; gap: 2px; max-height: 200px; overflow: auto; border-radius: 10px; background: var(--fill); padding: 4px; }
.check { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 14px; }
.check:hover { background: var(--fill); }
.check input { accent-color: var(--tint); width: 16px; height: 16px; }
.sheet-err { color: var(--red); font-size: 13px; margin-top: 10px; min-height: 0; }
.sheet-err:empty { display: none; }
.sheet .show-pick[hidden] { display: none; }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px;
  background: var(--sidebar); backdrop-filter: saturate(180%) blur(30px); -webkit-backdrop-filter: saturate(180%) blur(30px);
  border-right: 0.5px solid var(--sep);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; font: 700 17px/1 var(--font-display); letter-spacing: -0.02em; color: var(--label); text-decoration: none !important; }
/* the Vidiicast mark: the record light with a sound wave either side, like an on-air sign */
.app-icon {
  display: inline-block; width: 28px; height: 28px; border-radius: 25%; flex: none;
  background: url(/logo-small.svg) center / cover no-repeat;
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.14), 0 1px 3px rgba(0, 0, 0, 0.22);
}
.app-icon.big { width: 72px; height: 72px; background-image: url(/logo.svg); box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.14), 0 10px 30px rgba(0, 0, 0, 0.25); }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px;
  color: var(--label); font-size: 14px; font-weight: 500; text-decoration: none !important;
}
.nav a { color: var(--label-2); transition: background-color 0.15s, color 0.15s; }
.nav a .i { color: inherit; }
.nav a:hover { background: var(--fill); color: var(--label); }
.nav a[aria-current="page"] { background: var(--fill); color: var(--label); font-weight: 600; }
.nav a[aria-current="page"] .i { color: var(--tint-text); }
.nav .count { margin-left: auto; font-size: 12px; color: var(--label-2); font-variant-numeric: tabular-nums; }
.sidebar .bottom { margin-top: auto; display: grid; gap: 10px; padding: 0 4px; }
.mini-meter { padding: 12px; border-radius: 10px; background: var(--fill); font-size: 12px; color: var(--label-2); }
.mini-meter .bar { height: 4px; border-radius: 2px; background: var(--fill-2); overflow: hidden; margin: 8px 0 0; }
.mini-meter .bar > div { height: 100%; background: var(--tint); border-radius: 2px; }

.content { min-width: 0; padding: 0 40px 80px; }
.view { max-width: 1040px; margin: 0 auto; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 44px 0 26px; }
.view-head .sub { margin-top: 4px; color: var(--label-2); font-size: 15px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 2px; font-size: 14px; margin-bottom: 6px; }
.back .i { width: 14px; height: 14px; }
.stack { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr); }
.stack > * { min-width: 0; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.grid-2 > * { min-width: 0; }
@media (max-width: 980px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* mobile tab bar */
.tabbar { display: none; }
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .content { padding: 0 16px 100px; }
  .view-head { padding-top: 24px; }
  .large-title { font-size: 30px; line-height: 36px; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; justify-content: space-around;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: var(--bar); backdrop-filter: saturate(180%) blur(30px); -webkit-backdrop-filter: saturate(180%) blur(30px);
    border-top: 0.5px solid var(--sep);
  }
  .tabbar a { display: grid; justify-items: center; gap: 2px; font-size: 10px; font-weight: 500; color: var(--label-2); padding: 4px 10px; text-decoration: none !important; }
  .tabbar a .i { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"] { color: var(--tint-text); }
}

/* ---------- overview ---------- */
.studios { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.studio-card { padding: 18px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.studio-card .top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.studio-card .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.ring-card { display: flex; align-items: center; gap: 20px; padding: 20px; }
.ring { width: 92px; height: 92px; flex: none; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--fill-2); }
.ring .value { stroke: var(--tint); transition: stroke-dashoffset 0.8s cubic-bezier(.2, .8, .2, 1); }
.ring .value.warn { stroke: var(--orange); }
.ring .center { position: absolute; inset: 0; display: grid; place-items: center; font: 600 17px/1 var(--font-rounded); font-variant-numeric: tabular-nums; }
.stat-row { display: flex; gap: 28px; flex-wrap: wrap; }
.stat .v { font: 600 26px/1.1 var(--font-rounded); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 13px; color: var(--label-2); margin-top: 2px; }

/* ---------- recordings table ---------- */
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filters .search { flex: 1; min-width: 200px; max-width: 340px; }
.filters select.field { width: auto; background-color: var(--fill); }
.rec-cell .meta { display: flex; gap: 12px; font-size: 13px; color: var(--label-2); white-space: nowrap; overflow: hidden; }
.rec-cell .cols { display: flex; align-items: center; gap: 22px; flex: none; color: var(--label-2); font-size: 14px; }
.rec-cell .cols .len { width: 56px; text-align: right; }
.rec-cell .cols .size { width: 70px; text-align: right; }
.rec-cell .cols .st { width: 128px; }
@media (max-width: 900px) { .rec-cell .cols .size, .rec-cell .cols .len { display: none; } }
@media (max-width: 560px) { .rec-cell .cols .st { width: auto; } }

/* ---------- recording detail ---------- */
.meta-line { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-top: 6px; color: var(--label-2); font-size: 15px; }
.theatre { background: #000; border-radius: 18px; padding: 10px; box-shadow: var(--shadow); }
.theatre .tracks { display: grid; gap: 8px; grid-template-columns: repeat(var(--n, 1), minmax(0, 1fr)); }
@media (max-width: 700px) { .theatre .tracks { grid-template-columns: 1fr; } }
.theatre .trk { position: relative; border-radius: 11px; overflow: hidden; background: #111; }
.theatre video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #111; }
.theatre .who {
  position: absolute; left: 8px; bottom: 8px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; color: #fff;
  background: rgba(30, 30, 30, 0.55); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.transport { display: flex; align-items: center; gap: 14px; padding: 12px 8px 4px; color: #f5f5f7; }
.transport .icon-btn { background: transparent; color: #f5f5f7; width: 36px; height: 36px; }
.transport .icon-btn:hover { background: rgba(255, 255, 255, 0.12); }
.transport .icon-btn.play { width: 44px; height: 44px; background: #f5f5f7; color: #000; }
.transport .icon-btn .i { width: 24px; height: 24px; }
.transport .icon-btn.play .i { width: 20px; height: 20px; }
.transport .time { font: 500 13px/1 var(--font-rounded); font-variant-numeric: tabular-nums; color: rgba(245, 245, 247, 0.7); min-width: 44px; }
@media (max-width: 560px) { .transport { gap: 6px; padding-inline: 2px; } .transport .time { min-width: 36px; } }
.scrub { flex: 1; min-width: 0; width: 100%; -webkit-appearance: none; appearance: none; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.22); outline: none; cursor: pointer; }
.scrub::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); }
.scrub::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; }

.transcript { max-height: 640px; overflow-y: auto; padding: 6px 0; }
.tline { display: grid; grid-template-columns: 54px 1fr; gap: 12px; padding: 8px 18px; cursor: pointer; border-radius: 8px; margin: 0 6px; }
.tline:hover { background: var(--fill); }
.tline.now { background: var(--fill); }
.tline .tc { font: 500 12px/22px var(--font-rounded); color: var(--label-2); font-variant-numeric: tabular-nums; }
.tline .sp { font-weight: 600; margin-right: 6px; }
.tline mark { background: rgba(255, 204, 0, 0.45); color: inherit; border-radius: 3px; }
.notes { display: grid; gap: 22px; padding: 20px; }
.notes h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; }
.chap { display: flex; gap: 12px; padding: 5px 8px; margin: 0 -8px; border-radius: 7px; cursor: pointer; }
.chap:hover { background: var(--fill); }
.chap .tc { font: 500 13px/20px var(--font-rounded); color: var(--label-2); font-variant-numeric: tabular-nums; min-width: 42px; }
.clip { padding: 10px 12px; margin: 0 -12px; border-radius: 10px; cursor: pointer; }
.clip:hover { background: var(--fill); }

/* ---------- show settings ---------- */
.show-settings { margin-top: 18px; border-top: 0.5px solid var(--sep); }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 0.5px solid var(--sep); cursor: pointer; }
.setting .t { display: block; font-weight: 500; }
.setting .s { display: block; font-size: 13px; color: var(--label-2); max-width: 480px; }
.setting select.field { width: auto; background-color: var(--fill); flex: none; }

/* iOS-style switch */
.switch {
  appearance: none; -webkit-appearance: none; flex: none; margin: 0; cursor: pointer;
  width: 44px; height: 26px; border-radius: 13px; background: var(--fill-2); position: relative; transition: background-color 0.2s;
}
.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); transition: transform 0.2s;
}
.switch:checked { background: var(--tint); }
.switch:checked::after { transform: translateX(18px); }

/* ---------- sheet (dialog) ---------- */
dialog.sheet {
  border: 0; padding: 0; border-radius: 16px; width: min(420px, calc(100vw - 32px));
  background: var(--surface); color: var(--label); box-shadow: var(--shadow-pop);
}
dialog.sheet::backdrop { background: rgba(0, 0, 0, 0.32); backdrop-filter: blur(2px); }
dialog.sheet[open] { animation: sheet-in 0.22s cubic-bezier(.2, .9, .3, 1.1); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.sheet .body { padding: 22px 22px 6px; }
.sheet .body .title-3 { margin-bottom: 6px; }
.sheet .body p { color: var(--label-2); font-size: 14px; }
.sheet .acts { display: flex; justify-content: flex-end; gap: 8px; padding: 18px 22px 20px; }

/* ---------- menu (popover) ---------- */
.menu {
  position: fixed; z-index: 60; min-width: 220px; padding: 5px; border-radius: 11px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(180%) blur(30px); -webkit-backdrop-filter: saturate(180%) blur(30px);
  box-shadow: var(--shadow-pop);
}
.menu button, .menu a {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; border-radius: 7px;
  background: none; color: var(--label); font: 400 14px/20px var(--font); text-align: left; cursor: pointer; text-decoration: none !important;
}
.menu button:hover, .menu a:hover { background: var(--fill-2); color: var(--label); }
.menu button.danger { color: var(--red); }
.menu button.danger:hover { background: var(--red); color: #fff; }
.menu hr { border: 0; height: 0.5px; background: var(--sep); margin: 4px 8px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 80;
  display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px;
  background: rgba(40, 40, 42, 0.86); color: #fff; font-size: 14px; font-weight: 500;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  animation: toast-in 0.25s cubic-bezier(.2, .9, .3, 1.1);
}
.toast .i { color: var(--green-dot); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }
@media (max-width: 760px) { .toast { bottom: 90px; } }

/* ---------- sign in, sign up and other account pages ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: 1fr auto; justify-items: center; align-items: center; padding: 24px 16px 16px; }
.login .panel { width: 100%; max-width: 360px; text-align: center; }
.login .app-icon { margin: 0 auto 18px; }
.login .large-title { font-size: 28px; line-height: 34px; }
.login .lede { margin-top: 6px; color: var(--label-2); text-wrap: pretty; }
.login .fields { display: grid; gap: 10px; margin-top: 26px; text-align: left; }
.login .field { font-size: 16px; padding: 12px 14px; }
.login .hint { font-size: 12px; color: var(--label-2); margin: -4px 2px 0; }
.login .btn.large { margin-top: 16px; }
.login .err { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 10px; text-wrap: pretty; }
.login .ok { color: var(--label-2); font-size: 14px; margin-top: 10px; }
.login .links { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 18px; margin-top: 18px; font-size: 14px; }
.login .links a { color: var(--tint-text); text-decoration: none; text-underline-offset: 3px; }
.login .links a:hover { text-decoration: underline; }
.login .badge-row { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; padding: 6px 12px; border-radius: 999px; background: var(--fill); font-size: 13px; color: var(--label-2); }
.login .done-icon { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; background: var(--tint-soft); color: var(--tint); }
.login [hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* markers on the player and recording page */
.scrub-wrap { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; }
.ticks { position: absolute; left: 7px; right: 7px; top: 50%; height: 0; pointer-events: none; }
.ticks i { position: absolute; top: -13px; width: 3px; height: 9px; margin-left: -1.5px; border-radius: 2px; background: #0a84ff; }
.ticks i.cue { background: #ffd60a; }
.ticks i.nudge { background: #ff9f0a; }
.marker-cell { cursor: pointer; }
.marker-cell:hover { background: var(--surface-hover); }
.marker-cell .tc { font: 600 13px/1 var(--font-rounded); color: var(--label-2); min-width: 52px; }
.mk-dot { width: 10px; height: 10px; border-radius: 50%; background: #0a84ff; flex: none; }
.mk-dot.cue { background: #ffd60a; }
.mk-dot.nudge { background: #ff9f0a; }
.prep-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.sheet textarea.field { resize: vertical; min-height: 120px; font: 400 14px/20px var(--font); }
.sheet textarea.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; }
.check-line { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; cursor: pointer; }
.check-line input { accent-color: var(--tint); width: 16px; height: 16px; }

/* ---------- date and time picker ---------- */
.dp {
  position: fixed; z-index: 70; width: min(452px, calc(100vw - 16px)); border-radius: 16px; overflow: hidden;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(180%) blur(30px); -webkit-backdrop-filter: saturate(180%) blur(30px);
  box-shadow: var(--shadow-pop), 0 0 0 0.5px var(--sep); animation: dp-in 0.18s cubic-bezier(.2, .9, .3, 1.15); transform-origin: top left;
}
.dp.out { animation: dp-out 0.14s forwards; }
@keyframes dp-in { from { opacity: 0; transform: translateY(-4px) scale(0.97); } }
@keyframes dp-out { to { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.dp-main { display: grid; grid-template-columns: minmax(0, 1fr) 108px; }
.dp-cal { padding: 14px 12px 10px 16px; }
.dp-head { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.dp-month { flex: 1; font-weight: 600; font-size: 15px; }
.dp-nav { width: 30px; height: 30px; border: 0; border-radius: 50%; background: none; color: var(--label); display: grid; place-items: center; cursor: pointer; }
.dp-nav:hover { background: var(--tint-soft); }
.dp-nav:disabled { color: var(--label-3); background: none; cursor: default; }
.dp-nav .i { width: 16px; height: 16px; }
.dp-dow, .dp-days { display: grid; grid-template-columns: repeat(7, 1fr); }
.dp-dow span { text-align: center; font-size: 11px; font-weight: 600; color: var(--label-2); padding: 4px 0 6px; }
.dp .day {
  width: 36px; height: 36px; margin: 1px auto; border: 0; border-radius: 50%; background: none; color: var(--label);
  font: 400 15px/1 var(--font); font-variant-numeric: tabular-nums; cursor: pointer; transition: background-color 0.12s, transform 0.12s;
}
.dp .day:hover:not(:disabled) { background: var(--fill); }
.dp .day:active:not(:disabled) { transform: scale(0.92); }
.dp .day.today { color: var(--record-text); font-weight: 650; }   /* Apple Calendar's red "today" */
.dp .day.on { background: var(--tint); color: var(--on-tint); font-weight: 600; }
.dp .day.on.today { background: var(--record); color: #fff; }
.dp .day:disabled { color: var(--label-3); opacity: 0.5; cursor: default; }
.dp-times { max-height: 276px; overflow-y: auto; padding: 10px 8px; border-left: 0.5px solid var(--sep); display: grid; gap: 2px; align-content: start; scrollbar-width: thin; }
.dp .tm {
  border: 0; border-radius: 8px; padding: 7px 0; background: none; color: var(--label); font: 400 13px/1 var(--font);
  font-variant-numeric: tabular-nums; cursor: pointer; transition: background-color 0.12s;
}
.dp .tm:hover { background: var(--fill); }
.dp .tm.on { background: var(--tint); color: var(--on-tint); font-weight: 600; }
.dp-foot { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 0.5px solid var(--sep); }
.dp-sum { flex: 1; text-align: center; font-size: 13px; color: var(--label-2); }
.dp-foot .btn { min-height: 32px; padding: 6px 14px; font-size: 14px; }
.picker-field { display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; color: var(--label); }
.picker-field .i { width: 16px; height: 16px; color: var(--label-2); }
.picker-field .ph { color: var(--label-2); }
.picker-field .val { flex: 1; }
@media (max-width: 480px) {
  .dp-main { grid-template-columns: 1fr; }
  .dp-times { display: flex; overflow-x: auto; overflow-y: hidden; max-height: none; border-left: 0; border-top: 0.5px solid var(--sep); padding: 8px; }
  .dp .tm { flex: none; padding: 8px 10px; }
}

.show-acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.show-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
@media (max-width: 640px) { .show-acts { order: 3; width: 100%; justify-content: flex-start; } }

/* ---------- skeletons: the page's shape while it loads ---------- */
.sk { display: block; background: var(--fill); border-radius: 7px; position: relative; overflow: hidden; }
.sk::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: shimmer 1.5s cubic-bezier(.4, 0, .2, 1) infinite;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sk::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent); } }
@keyframes shimmer { to { transform: translateX(100%); } }
.sk.t { height: 13px; }
.sk.s { height: 11px; margin-top: 7px; }
.sk.h1 { height: 34px; width: 240px; border-radius: 9px; }
.sk.h2 { height: 18px; width: 120px; }
.sk.btn { height: 32px; width: 110px; border-radius: 999px; }
.sk.round { border-radius: 50%; }
.sk-block { background: var(--surface); border-radius: var(--r-card); }
.skeleton { pointer-events: none; }
.skeleton .cell { min-height: 60px; }

/* one quiet crossfade when a page's content arrives (no per-section entrances) */
.view.in { animation: view-in 0.22s ease-out; }
@keyframes view-in { from { opacity: 0; } }

/* the tally light: anything live pulses, nothing else does */
.status.live::before { box-shadow: 0 0 0 0 var(--record); animation: tally 1.8s ease-out infinite; }
@keyframes tally { 0% { box-shadow: 0 0 0 0 var(--record-soft); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }

/* timecode numerals for durations */
.tc-num { font-family: var(--font-rounded); font-variant-numeric: tabular-nums; letter-spacing: 0; }

/* ---------- overview: one hero, everything else quiet ---------- */
.ov { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(260px, 1fr); gap: 24px; align-items: start; }
.ov-main, .ov-side { display: grid; gap: 28px; min-width: 0; }
@media (max-width: 980px) { .ov { grid-template-columns: minmax(0, 1fr); } }
.hero { position: relative; padding: 26px 26px 18px; border-radius: 20px; }
.hero.on-air { box-shadow: inset 0 0 0 1.5px var(--record); }
.hero-top { display: flex; align-items: center; gap: 16px; padding-right: 96px; }
.hero-name { font: 700 28px/32px var(--font-display); letter-spacing: -0.022em; overflow-wrap: anywhere; }
.hero-line { margin-top: 4px; font-size: 15px; color: var(--label-2); }
.hero-acts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.hero-new { position: absolute; top: 18px; right: 14px; }
.hero-more { margin-top: 22px; border-top: 0.5px solid var(--sep); }
.more-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.more-row + .more-row { border-top: 0.5px solid var(--sep); }
.more-row .grow { min-width: 0; }
.more-row .t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.more-row .s { font-size: 13px; color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.more-all { display: inline-block; font-size: 13px; font-weight: 500; color: var(--tint-text); padding: 4px 0 6px; }
.hero-empty { display: grid; justify-items: center; gap: 10px; padding: 56px 24px; text-align: center; border-radius: 20px; }
.hero-empty .app-icon { margin-bottom: 8px; }
.hero-empty p { max-width: 380px; margin-bottom: 10px; }
@media (max-width: 560px) {
  .hero { padding: 20px 18px 12px; }
  .hero-top { padding-right: 0; }
  .hero-new { position: static; margin-top: 4px; }
  .hero-name { font-size: 24px; line-height: 28px; }
  .hero-acts .btn { flex: 1; }
}

.month { padding: 22px; }
.m-label { font-size: 13px; font-weight: 600; color: var(--label-2); }
.m-big { font-size: 46px; line-height: 1; font-weight: 600; letter-spacing: -0.03em; margin: 10px 0 6px; }
.m-sub { font-size: 14px; color: var(--label-2); }
.m-store { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; margin-top: 20px; padding-top: 16px; border-top: 0.5px solid var(--sep); font-size: 13px; color: var(--label-2); text-decoration: none !important; }
.m-store .bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--fill); overflow: hidden; margin-top: 8px; }
.m-store .bar span { display: block; height: 100%; border-radius: 2px; background: var(--tint); }
.m-store .bar span.warn { background: var(--orange); }
.date-chip { width: 40px; flex: none; display: grid; justify-items: center; padding: 5px 0 6px; border-radius: 9px; background: var(--fill); line-height: 1; }
.date-chip span { font-size: 10px; font-weight: 600; color: var(--record-text); }
.date-chip b { font: 600 17px/1.1 var(--font-rounded); margin-top: 2px; }
.rec-row .len { font-size: 14px; color: var(--label-2); min-width: 48px; text-align: right; }
.hero-top .grow, .more-row .grow { flex: 1; min-width: 0; }

.switch:checked::after { background: var(--on-tint); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theatre { background: var(--surface); } }

/* links that go somewhere read as links */
.section-head a.subhead, a.subhead[data-link], .back { color: var(--tint-text); font-weight: 500; }
.icon-btn.plain:hover, .btn.plain:hover { background: var(--tint-soft); }

/* identity tones for shows, workspaces and people: flat, one colour each, set from the id */
.glyph[style*="--tone"], .avatar[style*="--tone"] { background: color-mix(in srgb, var(--tone) 15%, transparent); color: var(--tone); }
.avatar.ghost[style*="--tone"] { background: var(--fill); color: var(--label-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.glyph, .avatar)[style*="--tone"] { --tone: var(--tone-d) !important; } }
:root[data-theme="dark"] :is(.glyph, .avatar)[style*="--tone"] { --tone: var(--tone-d) !important; }

/* ---------- skip link (keyboard users jump past the sidebar) ---------- */
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 8px 14px; border-radius: 999px; background: var(--tint); color: var(--on-tint); font-size: 14px; font-weight: 600; }
.skip:focus { top: 12px; text-decoration: none; }

/* ---------- agreeing to the terms at sign-up ---------- */
.agree { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; text-align: left; font-size: 13px; line-height: 18px; color: var(--label-2); cursor: pointer; }
.agree input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--tint); }
.agree a { color: var(--tint-text); text-decoration: underline; text-underline-offset: 2px; }
.legal-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; padding-top: 24px; font-size: 12px; }
.legal-foot a { color: var(--label-2); }

/* ---------- legal pages ---------- */
.doc-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; max-width: 760px; margin: 0 auto; padding: 22px 24px 0; }
.doc-bar .brand { padding: 0; }
.doc-nav { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; }
.doc-nav a { color: var(--label-2); }
.doc-nav a[aria-current="page"] { color: var(--label); font-weight: 600; }
.doc { max-width: 760px; margin: 0 auto; padding: 40px 24px 24px; font-size: 16px; line-height: 1.6; }
.doc h1 { font-size: 40px; line-height: 1.1; font-weight: 700; letter-spacing: -0.025em; }
.doc .updated { margin-top: 10px; font-size: 14px; color: var(--label-2); }
.doc .intro { margin-top: 24px; font-size: 19px; line-height: 1.5; color: var(--label); max-width: 64ch; }
.doc h2 { font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -0.015em; margin: 48px 0 12px; scroll-margin-top: 16px; }
.doc h3 { font-size: 16px; font-weight: 650; margin: 24px 0 6px; }
.doc p, .doc ul { max-width: 68ch; }
.doc p + p { margin-top: 12px; }
.doc ul { margin: 8px 0 0; padding-left: 22px; }
.doc li + li { margin-top: 6px; }
.doc a { color: var(--tint-text); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--tint-text) 40%, transparent); text-underline-offset: 3px; }
.doc code { font: 13px/1.4 ui-monospace, "SF Mono", Menlo, monospace; background: var(--fill); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }
.doc .toc { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 28px; padding: 14px; border-radius: var(--r-card); background: var(--surface); }
.doc .toc a { padding: 5px 11px; border-radius: 999px; background: var(--fill); color: var(--label); font-size: 14px; text-decoration: none; }
.doc .toc a:hover { background: var(--fill-2); }
.doc table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; line-height: 1.45; background: var(--surface); border-radius: var(--r-card); overflow: hidden; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 0.5px solid var(--sep); }
.doc th { font-weight: 600; color: var(--label-2); font-size: 13px; }
.doc tr:last-child td { border-bottom: 0; }
.doc-foot { max-width: 760px; margin: 0 auto; padding: 24px 24px 48px; font-size: 13px; color: var(--label-2); border-top: 0.5px solid var(--sep); }
.doc-foot a { color: var(--label-2); }
@media (max-width: 600px) {
  .doc { padding-top: 28px; }
  .doc h1 { font-size: 32px; }
  .doc .intro { font-size: 17px; }
  .doc table, .doc thead, .doc tbody, .doc tr, .doc td { display: block; }
  .doc thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .doc tr { border-bottom: 0.5px solid var(--sep); padding: 6px 0; }
  .doc td { border: 0; padding: 4px 14px; }
  .doc td:first-child { font-weight: 600; padding-top: 10px; }
}

/* links inside sheets (e.g. the Terms prompt) */
.sheet .body a { color: var(--tint-text); text-decoration: underline; text-underline-offset: 2px; }
