/* Flowly Web — components and layout. Tokens are in tokens.css. */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overscroll-behavior-y: none;
}
body.page-home { background: var(--bg-home); }
body.no-scroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
a.card, a.row-item { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid rgba(0, 113, 227, 0.5); outline-offset: 2px;
}
img { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
.num { font-family: var(--mono); font-feature-settings: "tnum" 1; }
.muted { color: var(--text-2); }
.small { font-size: 12px; }
.lead-text { font-size: 14px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row-gap { display: flex; align-items: center; gap: 8px; }
.fill { position: absolute; inset: 0; }
.mt { margin-top: 16px; }

/* ---------- Layout ----------
   One container, three widths (tokens.css): reading content, card grids, production workspaces.
   The header shares the page's container so breadcrumbs line up with the content at every width. */
.container { width: 100%; max-width: var(--content-max); margin: 0 auto; padding-inline: max(var(--page-gutter), var(--safe-left)) max(var(--page-gutter), var(--safe-right)); }
body.page-home .container { max-width: var(--grid-max); }
body.page-production .container { max-width: var(--workspace-max); }
main.app-main { flex: 1; padding-block: 32px 64px; }
body.page-home main.app-main { padding-top: 48px; }
@media (max-width: 640px) { main.app-main { padding-block: 20px 48px; } body.page-home main.app-main { padding-top: 28px; } }

/* ---------- Header ---------- */
.app-header {
  position: sticky; top: 0; z-index: 40;
  background: light-dark(rgba(255, 255, 255, 0.82), rgba(28, 28, 30, 0.82));
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-strong);
}
body.page-home .app-header { background: light-dark(rgba(251, 251, 253, 0.85), rgba(28, 28, 30, 0.85)); border-bottom-color: var(--border); }
.app-header .container { height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; min-width: 0; color: var(--text); }
.brand:hover { opacity: 0.8; }
.brand img { width: 30px; height: 30px; border-radius: 50%; display: block; }
.crumbs { display: flex; align-items: center; gap: 12px; min-width: 0; }
.crumbs .sep { color: var(--text-3); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; }
.crumbs .sep::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-top: 1.5px solid currentColor; transform: rotate(45deg); }
.crumbs .crumb { font-size: 14px; color: var(--text-2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs a.crumb:hover { color: var(--text); }
.crumbs .crumb.current { color: var(--text); font-weight: 600; }
/* Kitsu-style pickers in the top bar: [production ▾] › [page ▾] */
.crumbs:has(.nav-pick) { gap: 8px; }
.crumbs .nav-pick { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px 0 10px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--card); font: inherit; font-size: 14px; cursor: pointer; min-width: 0; transition: border-color .15s, background .15s; }
.crumbs .nav-pick:hover, .crumbs .nav-pick[aria-expanded="true"] { border-color: light-dark(rgba(0, 0, 0, .2), rgba(255, 255, 255, 0.24)); background: light-dark(rgba(0, 0, 0, .02), rgba(255, 255, 255, 0.05)); color: var(--text); }
.crumbs .nav-pick .chev { margin-left: 2px; }
.crumbs .brand + .nav-pick { margin-left: 4px; }
.side-toggle { margin-left: -6px; color: var(--text-2); }
.side-toggle[aria-expanded="true"] { color: var(--text); }
.crumbs .nav-pick .nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs .nav-pick svg { width: 15px; height: 15px; flex: none; color: var(--text-2); }
.crumbs .nav-pick .chev { width: 12px; height: 12px; color: var(--text-3); }
.nav-mark { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; flex: none; }
.nav-mark.initials { display: inline-flex; align-items: center; justify-content: center; background: var(--blue-soft); color: var(--blue-700); font-size: 9px; font-weight: 700; }
.popover.nav-menu { min-width: 220px; }
.popover.nav-menu a.menu-item { text-decoration: none; color: inherit; }
.popover.nav-menu .menu-item svg:first-child { width: 16px; height: 16px; color: var(--text-2); flex: none; }
.seg-nav { display: flex; align-items: center; background: var(--subtle); padding: 4px; border-radius: 999px; border: 1px solid light-dark(rgba(0, 0, 0, 0.04), rgba(255, 255, 255, 0.08)); }
.seg-nav a { padding: 4px 16px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--text-2); transition: color .15s; }
.seg-nav a:hover { color: var(--text); }
.seg-nav a.active { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06); }
.header-tools { display: flex; align-items: center; gap: 16px; }
.icon-btn { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--text-2); position: relative; transition: color .15s, background .15s; }
.icon-btn:hover { color: var(--text); background: light-dark(rgba(0, 0, 0, 0.04), rgba(255, 255, 255, 0.08)); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .dot { position: absolute; top: 5px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); border: 1.5px solid var(--card); }
.vsep { width: 1px; height: 16px; background: var(--border-strong); }
.avatar-btn img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--border-strong); }
/* Tablet: the root crumb ("Feature Productions") is the first to go; the production and the current tab stay. */
@media (max-width: 900px) { .crumbs .crumb.root, .crumbs .sep.root { display: none; } .crumbs { gap: 8px; } }
/* Phone: [logo] [production › page] [search] [account] — the brand word goes, the production title truncates, nothing wraps or overflows. */
@media (max-width: 640px) {
  .header-tools { gap: 6px; }
  body.page-production .brand span { display: none; }
  body.page-production .mode-tag { display: none; } /* the footer still says Kitsu; the title needs the room */
  .crumbs { gap: 6px; flex: 1; }
  .crumbs .crumb.prod { flex: 0 1 auto; min-width: 48px; }
  .crumbs .crumb.current { flex: 0 0 auto; max-width: 40vw; }
  .seg-nav a { padding-inline: 12px; }
  .vsep { display: none; }
}
/* Coarse pointers: every header control is a comfortable target without changing the desktop look. */
@media (pointer: coarse) { .icon-btn { width: var(--touch); height: var(--touch); } .header-tools { gap: 4px; } }

/* ---------- Footer ---------- */
.app-footer { border-top: 1px solid var(--border-strong); background: light-dark(rgba(255, 255, 255, 0.5), rgba(28, 28, 30, 0.5)); padding-block: 24px; font-size: 12px; color: var(--text-2); }
.app-footer .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
body.page-home .app-footer { background: transparent; border-top-color: var(--border); padding-block: 32px; }
body.page-home .app-footer .container { justify-content: center; }
.demo-tag { display: inline-flex; align-items: center; gap: 6px; }
.demo-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }
.demo-tag.warn { color: var(--amber-700); }
.demo-tag.warn::before { background: var(--rose); }

/* ---------- Notices ---------- */
.notice { background: var(--amber-50); border-bottom: 1px solid rgba(253, 230, 138, 0.8); color: var(--amber-700); font-size: 13px; }
.notice .container { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-block: 10px; }
.notice details { margin-top: 4px; }
.notice summary { cursor: pointer; font-weight: 500; }
.notice ul { margin: 4px 0 0; padding-left: 18px; font-family: var(--mono); font-size: 11px; color: var(--amber-700); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px; border-radius: 999px; font-size: 13px; font-weight: 500; transition: background .15s, transform .1s, box-shadow .15s; white-space: nowrap; }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.btn-primary:hover { background: var(--blue-hover); }
.btn-primary:active { transform: scale(0.97); }
.btn-ghost { background: light-dark(rgba(0, 0, 0, 0.04), rgba(255, 255, 255, 0.08)); color: var(--text); }
.btn-ghost:hover { background: light-dark(rgba(0, 0, 0, 0.07), rgba(255, 255, 255, 0.13)); }
.btn-link { color: var(--blue); font-weight: 500; font-size: 13px; padding: 0; height: auto; }
.btn-link:hover { text-decoration: underline; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12px; }
.btn-play { width: 40px; height: 40px; border-radius: 50%; background: var(--blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; transition: background .15s; }
.btn-play:hover { background: var(--blue-hover); }
.btn-play svg { width: 20px; height: 20px; margin-left: 2px; }

/* ---------- Page headers ---------- */
.home-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 40px; }
.home-head h1 { font-size: 36px; font-weight: 600; letter-spacing: -0.021em; line-height: 1.15; }
.home-head p { font-size: 15px; color: var(--text-2); margin-top: 4px; }
@media (max-width: 640px) { .home-head { flex-direction: column; align-items: flex-start; margin-bottom: 28px; } .home-head h1 { font-size: 28px; } }

.prod-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 24px; }
.prod-head > div:first-child { min-width: 0; }
.prod-head .title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.prod-head h1 { font-size: clamp(22px, 1.4vw + 16px, 28px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; overflow-wrap: anywhere; }
.prod-head .subtitle { font-size: 14px; color: var(--text-2); margin-top: 4px; }
@media (max-width: 760px) { .prod-head { flex-direction: column; align-items: flex-start; gap: 10px; padding-bottom: 16px; } }
/* Phone: title + status, metadata, then the Kitsu line and its Refresh button — stacked, one thing per line. */
@media (max-width: 640px) { .prod-head .subtitle { display: none; } } /* fps / resolution / dates are Kitsu facts a phone screen does not need above the content */
/* Production context line: the episode switch (only when Kitsu has episodes) beside the quiet metadata. */
.prod-context { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.prod-context .subtitle { margin-top: 0; }
.ep-context { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ep-switch { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px 0 10px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--card); font-size: 13px; font-weight: 500; color: var(--text); transition: border-color .15s, background .15s; }
.ep-switch svg { width: 15px; height: 15px; color: var(--text-2); } .ep-switch .chev { width: 13px; height: 13px; }
.ep-switch:hover { border-color: light-dark(rgba(0, 0, 0, 0.18), rgba(255, 255, 255, 0.24)); }
.ep-switch.active { background: var(--blue-soft); border-color: rgba(0, 113, 227, 0.35); color: var(--blue-700); } .ep-switch.active svg { color: var(--blue-700); }
.popover.ep-menu { min-width: 200px; }
@media (max-width: 640px) { .prod-context { gap: 8px; } .ep-switch { height: 36px; font-size: 14px; } }
@media (pointer: coarse) { .ep-switch { min-height: 40px; } }
/* Scope tier (assets table, edits): "E02" / "Production-wide" above the type groups; a small tag on records elsewhere. */
.scope-head { display: flex; align-items: center; gap: 10px; padding: 0 16px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text); }
.scope-head .small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.asset-table .scope-row th { height: 40px; background: light-dark(#f3f4f6, #24272b); border-top: 1px solid var(--border-strong); border-bottom: 1px solid var(--border-strong); position: sticky; left: 0; }
.asset-table tbody:first-of-type .scope-row th { border-top: 0; }
.asset-table .scope-empty td { padding: 10px 16px 12px; }
.edit-scope .scope-head { padding: 0 0 12px; }
.scope-tag { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 999px; font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; background: var(--zinc-100); color: var(--text-2); white-space: nowrap; }
.scope-tag.ep { background: var(--blue-soft); color: var(--blue-700); }
.scope-tag.other { background: var(--amber-50); color: var(--amber-700); }
.ep-fact { display: inline-flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ep-fact .link-btn { font-size: 12px; }
.crumbs .crumb.ep { color: var(--blue-700); font-weight: 600; }
/* One quiet line for "nothing matches" (never a giant card) and the toolbar's active-filter state. */
.empty-inline { font-size: 13px; color: var(--text-2); margin: 0; padding: 6px 2px; }
.toolbar-toggle.active { background: var(--blue-soft); color: var(--blue-700); }
.toolbar-clear { font-size: 13px; }
/* Under an episode, tasks of production-wide entities are shown but marked: dashed edge, same colour. */
.cal-bar.prod-wide, .cal-pill.prod-wide { outline: 2px dashed rgba(255, 255, 255, 0.6); outline-offset: -3px; }
.cal-agenda-item.prod-wide .cal-dot { outline: 2px dashed var(--text-3); outline-offset: 1px; }

.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--emerald-50); color: var(--emerald-700); border: 1px solid rgba(167, 243, 208, 0.6); white-space: nowrap; }
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--emerald); }
.status-badge.tone-blue { background: var(--blue-50); color: var(--blue-700); border-color: rgba(191, 219, 254, 0.7); } .status-badge.tone-blue::before { background: var(--blue-500); }
.status-badge.tone-amber { background: var(--amber-50); color: var(--amber-700); border-color: rgba(253, 230, 138, 0.7); } .status-badge.tone-amber::before { background: var(--amber); }
.status-badge.tone-grey { background: var(--zinc-100); color: var(--zinc-500); border-color: var(--zinc-200); } .status-badge.tone-grey::before { background: var(--zinc-500); }

/* ---------- Tabs row ---------- */
.tabs-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--border-strong); padding-bottom: 20px; margin-bottom: 24px; flex-wrap: wrap; }
/* Seven tabs, one strip: scrolls sideways (snap on touch) instead of wrapping; the active tab is scrolled into view by production.js. */
.seg-tabs { display: inline-flex; padding: 4px; background: var(--pill-bg); border-radius: 12px; gap: 4px; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04); max-width: 100%; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.seg-tabs::-webkit-scrollbar { display: none; }
.seg-tabs a { flex-shrink: 0; scroll-snap-align: center; }
.seg-tabs a { padding: 6px 20px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--text-2); transition: color .15s, background .15s; white-space: nowrap; }
.seg-tabs a:hover { color: var(--text); }
.seg-tabs a.active { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.tabs-aside { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.tabs-aside .dot-sep { color: var(--text-3); }
@media (max-width: 760px) { .tabs-row { padding-bottom: 14px; margin-bottom: 16px; gap: 10px; } .seg-tabs { width: 100%; } .seg-tabs a { padding-inline: 14px; } .tabs-aside { font-size: 12px; } }
@media (pointer: coarse) { .seg-tabs a { padding-block: 12px; } }

.select-compact { appearance: none; -webkit-appearance: none; font: inherit; font-size: 13px; color: var(--text); background: var(--card) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>") no-repeat right 8px center; border: 1px solid var(--border-strong); border-radius: 8px; padding: 4px 26px 4px 10px; height: 30px; cursor: pointer; }
.select-compact:hover { border-color: light-dark(rgba(0, 0, 0, 0.18), rgba(255, 255, 255, 0.24)); }
@media (pointer: coarse) { .select-compact { height: 40px; font-size: 14px; } .btn-sm { height: 36px; } .filter-group button { padding-block: 8px; } }

/* Adaptive toolbar (search + filters + sort): one row on desktop; on a phone the search takes the row and the
   filters fold behind a "Filters" button (each toolbar keeps its own fields; the pattern is shared). */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .search-box { flex: 1 1 220px; max-width: 320px; }
.toolbar-filters, .toolbar-primary { display: contents; }
.toolbar-toggle { display: none; }
.toolbar-aside { margin-left: auto; font-size: 13px; color: var(--text-2); display: inline-flex; gap: 10px; align-items: center; }
@media (max-width: 640px) {
  .toolbar .search-box { flex-basis: 100%; max-width: none; }
  .toolbar-primary { display: flex; gap: 8px; order: 0; } .toolbar-primary > .select-compact { height: 40px; font-size: 14px; max-width: 60vw; }
  .toolbar-toggle { display: inline-flex; order: 1; }
  .toolbar-aside { order: 2; margin-left: auto; }
  .toolbar-filters { display: none; order: 3; flex-basis: 100%; flex-wrap: wrap; gap: 8px; }
  .toolbar.filters-open .toolbar-filters { display: flex; }
  .toolbar-filters > .select-compact { flex: 1 1 calc(50% - 8px); min-width: 0; height: 40px; font-size: 14px; }
  .select-compact { max-width: 100%; }
}
.filter-group { display: inline-flex; gap: 2px; }
.filter-group button { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; color: var(--text-2); transition: background .15s, color .15s; }
.filter-group button:hover { color: var(--text); }
.filter-group button.active { background: light-dark(rgba(0, 0, 0, 0.06), rgba(255, 255, 255, 0.11)); color: var(--text); }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.card.clickable { cursor: pointer; transition: box-shadow .2s, border-color .2s; }
.card.clickable:hover { box-shadow: var(--shadow-card-hover); border-color: light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.17)); }

/* Card grids: column count follows the width (never giant cards on an ultrawide, one column on a phone). */
.grid { display: grid; gap: clamp(14px, 1.5vw, 24px); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
@media (max-width: 480px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* Artwork frame with graceful fallback */
.art { position: relative; overflow: hidden; background: var(--zinc-100); border-radius: 12px; }
.art img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.art.ratio-16-10 { aspect-ratio: 16 / 10; }
.art.ratio-16-9 { aspect-ratio: 16 / 9; }
.art.ratio-4-3 { aspect-ratio: 4 / 3; }
.art.ratio-1-1 { aspect-ratio: 1 / 1; }
.art .fallback { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--text-2); font-size: 12px; font-weight: 500; background: linear-gradient(135deg, light-dark(#f1f1f4, #27272d), light-dark(#e6e6ea, #2f2f33)); }
.art .fallback svg { width: 22px; height: 22px; opacity: 0.6; }
.art .fallback .initials { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; color: var(--zinc-500); }
.art .badge-corner { position: absolute; left: 8px; top: 8px; font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #fff; background: rgba(0, 0, 0, 0.45); padding: 2px 7px; border-radius: 999px; backdrop-filter: blur(6px); }

/* Production card (home) */
/* The card is an <article>: the title's link is stretched over it (one primary target), and any other
   control inside (Resume E0x) sits above that overlay — no nested anchors. */
.prod-card { position: relative; padding: 12px; display: flex; flex-direction: column; }
.prod-card .prod-open::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-card); }
.prod-card .prod-open:focus-visible { outline: none; }
.prod-card:has(.prod-open:focus-visible) { outline: 2px solid rgba(0, 113, 227, 0.5); outline-offset: 2px; }
.prod-card .prod-resume { position: relative; z-index: 1; }
.prod-card:hover .art img { transform: scale(1.02); }
.prod-card .art { margin-bottom: 14px; }
.prod-card .body { padding: 0 6px 4px; flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.prod-card .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.prod-card h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.prod-card .pct { font-size: 13px; font-weight: 500; color: var(--text-2); }
.prod-card .stage { font-size: 13px; color: var(--text-2); margin-bottom: 16px; }
.prod-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.prod-resume { font-size: 12px; white-space: nowrap; }
.progress { width: 100%; height: 6px; border-radius: 999px; background: var(--subtle); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--blue); border-radius: 999px; transition: width .4s; }

/* Concept card (VisDev) */
.concept-card { overflow: hidden; }
.concept-card .art { border-radius: 0; aspect-ratio: 16 / 10; }
.concept-card .body { padding: 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.concept-card h3 { font-size: 15px; font-weight: 600; }
.concept-card .meta { font-size: 13px; color: var(--text-2); margin-top: 2px; }

/* Asset card */
.asset-card { padding: 16px; }
.asset-card .art { margin-bottom: 12px; }
.asset-card .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.asset-card h4 { font-size: 14px; font-weight: 600; }
.asset-card .stage { font-size: 11px; font-weight: 500; color: var(--emerald-700); white-space: nowrap; }
.asset-card .stage.tone-blue { color: var(--blue); }
.asset-card .stage.tone-amber { color: var(--amber-700); }
.asset-card .stage.tone-grey { color: var(--text-2); }
.asset-card .meta { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* ---------- Pills (task / review statuses) ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11px; font-weight: 500; line-height: 1; white-space: nowrap; border: 1px solid transparent; --c: var(--zinc-500); --bg: var(--zinc-100); --bd: var(--zinc-200); color: var(--c); background: var(--bg); border-color: var(--bd); }
.pill .pulse { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.pill.st-approved { background: var(--emerald); color: #fff; border-color: var(--emerald); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); }
.pill.st-active { background: var(--emerald-50); color: var(--emerald-700); border-color: rgba(167, 243, 208, 0.8); }
.pill.st-review { background: var(--blue-50); color: var(--blue-700); border-color: rgba(191, 219, 254, 0.8); }
.pill.st-done, .pill.st-queue, .pill.st-standby { background: var(--bg); color: var(--c); border-color: var(--bd); }
.pill.st-done { font-weight: 600; }
.pill.st-live { background: var(--bg); color: var(--c); border-color: var(--bd); font-weight: 600; }
.pill.st-none { background: transparent; color: var(--text-3); border-color: transparent; }
.pill.st-retake { background: var(--rose-50); color: var(--rose-700); border-color: rgba(254, 205, 211, 0.9); font-weight: 600; }
/* Concept review statuses (soft pills, as in the VisDev reference cards) */
.pill.cst-approved { background: var(--emerald-50); color: var(--emerald-700); border-color: rgba(167, 243, 208, 0.7); }
.pill.cst-review { background: var(--blue-50); color: var(--blue); border-color: rgba(191, 219, 254, 0.8); }
.pill.cst-changes { background: var(--amber-50); color: var(--amber-700); border-color: rgba(253, 230, 138, 0.8); }
.pill.cst-draft { background: var(--zinc-100); color: var(--zinc-500); border-color: var(--zinc-200); }
/* Tone pills (edit statuses and other labelled states) */
.pill.tone-green { background: var(--emerald-50); color: var(--emerald-700); border-color: rgba(167, 243, 208, 0.8); }
.pill.tone-blue { background: var(--blue-50); color: var(--blue-700); border-color: rgba(191, 219, 254, 0.8); }
.pill.tone-amber { background: var(--amber-50); color: var(--amber-700); border-color: rgba(253, 230, 138, 0.8); }
.pill.tone-grey { background: var(--zinc-100); color: var(--zinc-500); border-color: var(--zinc-200); }
.pill.lg { height: 26px; padding: 0 12px; font-size: 12px; }
button.pill { cursor: pointer; transition: transform .1s, box-shadow .15s; }
button.pill:hover { box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15); }
button.pill:active { transform: scale(0.96); }

/* ---------- Asset table (grouped rows; same lane/pill language as the shot table) ---------- */
.asset-screen > * + * { margin-top: 16px; }
.asset-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.asset-toolbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-box { display: flex; align-items: center; gap: 8px; width: min(100%, 320px); height: 40px; padding: 0 12px; background: var(--card); border: 1px solid var(--border-strong); border-radius: 10px; color: var(--text-2); }
.search-box:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15); }
.search-box svg { width: 18px; height: 18px; flex-shrink: 0; }
.search-field { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; font: inherit; font-size: 14px; color: var(--text); outline: none; }
.search-field::placeholder { color: var(--text-3); }
.search-field::-webkit-search-cancel-button { -webkit-appearance: none; }
.group-select { height: 40px; padding: 0 30px 0 12px; border-radius: 10px; font-size: 14px; background-position: right 10px center; }
.filter-chip { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 4px 0 12px; border-radius: 999px; background: light-dark(rgba(0, 0, 0, 0.06), rgba(255, 255, 255, 0.11)); font-size: 13px; color: var(--text); }
.filter-chip .icon-btn { width: 26px; height: 26px; border-radius: 50%; }
.filter-chip .icon-btn svg { width: 16px; height: 16px; }
.table-note { font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.link-btn { color: var(--blue); font-weight: 500; }
.link-btn:hover { text-decoration: underline; }
/* `overflow: clip` keeps the rounded corners without making the card a scroll container (which would pin the sticky header to the card instead of the page). */
.asset-table-block .table-card { overflow: clip; }
/* The table fills the card; it only becomes a horizontal scroller (.scroll, set by the feature) when the columns cannot fit. The page keeps scrolling vertically. */
.asset-table-wrap { overflow: visible; }
.asset-table-wrap.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.asset-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.asset-table th, .asset-table td { padding: 0; text-align: left; font-weight: inherit; vertical-align: middle; }
.asset-table thead th { position: sticky; top: 56px; z-index: 2; height: 44px; background: light-dark(#f9f9fa, #202022); border-bottom: 1px solid var(--border-strong); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); user-select: none; white-space: nowrap; }
.asset-table thead th.c-asset { left: 0; z-index: 3; padding-left: 24px; width: 320px; min-width: 200px; }
.asset-table.dense thead th.c-asset { width: 240px; }
/* Many columns: mixed-case wrapped labels stay readable at ~65 px per column. */
.asset-table.dense thead th.c-dept { text-transform: none; letter-spacing: 0; font-size: 10.5px; white-space: normal; line-height: 1.2; padding: 6px 3px; }
.asset-table.dense thead th.c-dept > span::before { display: none; }
.asset-table thead th.c-dept .lbl-short { display: none; }
.asset-table.dense thead th.c-dept .lbl-full { display: none; }
.asset-table.dense thead th.c-dept .lbl-short { display: inline; }
.asset-table thead th.c-dept { color: var(--c); background-color: light-dark(#f9f9fa, #202022); background-image: linear-gradient(var(--lane, transparent), var(--lane, transparent)); text-align: center; padding: 0 8px; overflow: hidden; text-overflow: ellipsis; }
.asset-table thead th.c-dept > span::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--dot); margin-right: 6px; vertical-align: 1px; }
.asset-table th.c-asset { position: sticky; left: 0; z-index: 1; background: var(--card); border-right: 1px solid light-dark(rgba(0, 0, 0, 0.04), rgba(255, 255, 255, 0.08)); }
.asset-table td.c-dept { background: var(--lane); text-align: center; padding: 8px 6px; height: 54px; }
.asset-table td.c-dept .pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.asset-table .group-row th { position: sticky; left: 0; z-index: 1; background: light-dark(#f9f9fa, #202022); border-top: 1px solid var(--border-strong); border-bottom: 1px solid var(--border-strong); height: 44px; }
.asset-table tbody:first-of-type .group-row th { border-top: 0; }
.group-head { position: sticky; left: 0; display: flex; align-items: center; gap: 10px; width: max-content; max-width: 100%; padding: 0 16px; }
.group-toggle { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--text); }
.group-toggle:hover { background: light-dark(rgba(0, 0, 0, 0.04), rgba(255, 255, 255, 0.08)); }
.group-toggle svg { width: 16px; height: 16px; color: var(--text-2); transition: transform .15s; }
.group-toggle svg.open { transform: rotate(90deg); }
.group-count { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 999px; background: light-dark(rgba(0, 0, 0, 0.06), rgba(255, 255, 255, 0.11)); font-size: 11px; font-weight: 600; color: var(--text-2); }
.asset-row { cursor: pointer; transition: background .12s; }
.asset-row:hover th.c-asset { background: light-dark(#fbfbfc, #1e1e20); }
.asset-row th.c-asset { border-bottom: 1px solid rgba(236, 236, 238, 0.8); height: 54px; }
.asset-row td.c-dept { border-bottom: 1px solid rgba(236, 236, 238, 0.8); }
.asset-row.canceled .asset-name { text-decoration: line-through; color: var(--text-2); }
.asset-link { display: flex; align-items: center; gap: 12px; height: 100%; min-width: 0; padding: 0 16px 0 24px; color: inherit; text-decoration: none; }
.asset-name { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-thumb, .shot-thumb { width: 64px; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; background: var(--zinc-100); flex-shrink: 0; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05); }
.row-thumb .art, .shot-thumb .art { border-radius: 0; height: 100%; }
.row-thumb img, .shot-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.row-thumb .fallback { padding: 0; font-size: 10px; gap: 0; }
.row-thumb .fallback span:not(.initials) { display: none; }
.row-thumb .fallback .initials { font-size: 12px; }
.asset-row:hover .row-thumb img { transform: scale(1.05); }
.pill.st-stack { background: var(--card); color: var(--c, var(--text)); border-color: var(--bd, var(--border-strong)); font-weight: 600; box-shadow: 0 1px 0 0 var(--bd, var(--border-strong)), 0 3px 0 -1px light-dark(#fff, var(--card)), 0 3px 0 0 var(--bd, var(--border-strong)); }
.popover.task-details { min-width: 240px; max-width: 320px; }
.popover .task-detail { display: flex; align-items: center; gap: 10px; padding: 8px 10px; font-size: 13px; }
.popover .task-detail .who { font-weight: 500; }
.popover .task-detail + .task-detail { border-top: 1px solid var(--border); }
.group-toggle:focus-visible, .asset-link:focus-visible, .pill:focus-visible, .link-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
@media (max-width: 900px) { .asset-table thead th.c-asset, .asset-link { padding-left: 16px; } .asset-table thead th.c-asset, .asset-table.dense thead th.c-asset { width: 200px; } }
/* Phone: the same rows drawn as compact cards — thumbnail + name, then only the tasks that exist, labelled by task type.
   Nothing is removed: every task is here, the drawer keeps the full detail. (No second DOM: the table reflows.) */
@media (max-width: 640px) {
  .search-box { width: 100%; } .asset-toolbar-right { width: 100%; justify-content: space-between; }
  .asset-table-wrap.scroll { overflow-x: visible; }
  .asset-table { display: block; min-width: 0 !important; }
  .asset-table thead { display: none; }
  .asset-table tbody, .asset-table tr, .asset-table th.c-asset { display: block; }
  .asset-table .group-row, .asset-table .scope-row { display: block; background: light-dark(#f9f9fa, #202022); border-top: 1px solid var(--border-strong); border-bottom: 1px solid var(--border-strong); }
  .asset-table .scope-row { background: light-dark(#f3f4f6, #24272b); } .asset-table .scope-row th { display: block; position: static; height: auto; padding: 8px 0; border: 0; background: none; } .scope-head { padding: 0 12px; } .scope-head .small { display: none; } .scope-label { white-space: nowrap; }
  .asset-table .scope-empty, .asset-table .scope-empty td { display: block; }
  .asset-table .group-row th { display: block; position: static; height: auto; padding: 6px 0; border: 0; background: none; }
  .group-head { position: static; width: auto; padding: 0 12px; }
  .asset-row { padding: 10px 12px 8px; border-bottom: 1px solid rgba(236, 236, 238, 0.8); }
  .asset-row th.c-asset { position: static; height: auto; border: 0; width: auto; }
  .asset-link { padding: 0; height: auto; }
  .asset-row td.c-dept { display: none; }
  .asset-row td.c-dept.has-task { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: auto; padding: 5px 0 5px 76px; background: none; border: 0; text-align: left; }
  .asset-row td.c-dept.has-task::before { content: attr(data-label); font-size: 12px; font-weight: 500; color: var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .asset-row td.c-dept .pill { max-width: 60%; }
}

/* ---------- Shot table ---------- */
.table-card { overflow: hidden; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.shot-table { min-width: 880px; }
.shot-row { display: grid; grid-template-columns: minmax(220px, 3fr) repeat(3, minmax(64px, 1fr)) repeat(6, minmax(82px, 1fr)) 20px; align-items: stretch; }
.shot-row > div { display: flex; align-items: center; justify-content: center; }
.shot-row > .c-shot { justify-content: flex-start; padding: 12px 16px; gap: 12px; min-width: 0; }
.shot-row.head { background: light-dark(#f9f9fa, #202022); border-bottom: 1px solid var(--border-strong); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); user-select: none; }
.shot-row.head > div { padding-block: 10px; }
.shot-row.head > .c-shot { padding-block: 10px; }
.shot-row.head .c-num { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; }
.shot-row.head .c-dept { color: var(--c); background: var(--lane); gap: 6px; }
.shot-row.head .c-dept::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--dot); }
.shot-row.body { border-bottom: 1px solid rgba(236, 236, 238, 0.8); cursor: pointer; transition: background .12s; }
.shot-row.body:last-child { border-bottom: 0; }
.shot-row.body:hover { background: light-dark(#fbfbfc, #1e1e20); }
.shot-row.body .c-dept { background: var(--lane); padding: 12px 6px; }
.shot-row .c-dept.dept-render { border-right: 1px solid rgba(254, 205, 211, 0.5); }
.shot-row.body .c-num { font-family: var(--mono); font-size: 12px; color: var(--text-2); font-feature-settings: "tnum" 1; }
.shot-row.body .c-num.frames { color: var(--text); font-weight: 500; }
.shot-row .c-more { background: var(--card); }
.shot-row .c-more .icon-btn { width: 20px; height: 20px; border-radius: 4px; }
.shot-row .c-more .icon-btn svg { width: 16px; height: 16px; }
.shot-row.body:hover .shot-thumb img { transform: scale(1.05); }
.shot-id { display: flex; align-items: center; gap: 6px; min-width: 0; }
.shot-id .code { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; }
/* Phone: a shot row becomes a card — thumbnail + code, the frame numbers labelled, then only the tasks that exist (label = task type). */
@media (max-width: 640px) {
  .table-scroll { overflow-x: visible; }
  .shot-table { min-width: 0 !important; }
  .shot-row.head { display: none; }
  .shot-row.body { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 12px; }
  .shot-row.body > .c-shot { flex: 1 1 100%; padding: 0; }
  .shot-row.body > .c-num { padding: 0; display: inline-flex; gap: 4px; }
  .shot-row.body > .c-num::before { content: attr(data-label); font-family: var(--font); font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
  .shot-row.body > .c-num.empty { display: none; }
  .shot-row.body > .c-dept { background: none; padding: 0; display: inline-flex; gap: 6px; border: 0; }
  .shot-row.body > .c-dept::before { content: attr(data-label); font-size: 11px; font-weight: 600; color: var(--c); }
  .shot-row.body > .c-dept.empty { display: none; }
  .shot-row .c-more { display: none; }
}
.ver { font-size: 11px; font-weight: 500; padding: 2px 6px; border-radius: 4px; background: var(--zinc-100); color: var(--text-2); }

/* ---------- Edits ---------- */
.stack-lg { display: flex; flex-direction: column; gap: 24px; }
.edit-head-live { align-items: flex-start; gap: 14px; }
.edit-thumb { width: 112px; flex-shrink: 0; border-radius: 8px; }
.edit-thumb .fallback { font-size: 10px; } .edit-thumb .fallback .initials { font-size: 16px; }
.edit-card { max-width: 860px; padding: 24px; }
.edit-card.selected { box-shadow: 0 0 0 2px var(--blue), var(--shadow-card); }
.edit-card .poster { position: relative; }
.edit-card .poster .art { border-radius: 12px; }
.edit-card .poster .play-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: linear-gradient(to top, light-dark(rgba(0, 0, 0, 0.35), rgba(255, 255, 255, 0.24)), transparent 50%); }
.edit-card .poster .play-overlay .btn-play { width: 56px; height: 56px; background: light-dark(rgba(255, 255, 255, 0.92), rgba(28, 28, 30, 0.92)); color: var(--text); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2); }
.edit-card .poster .play-overlay .btn-play:hover { background: var(--card); }
.edit-card .poster .play-overlay .btn-play svg { width: 26px; height: 26px; }
.edit-card .poster .meta-overlay { position: absolute; left: 14px; bottom: 12px; color: #fff; font-size: 12px; font-weight: 500; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); display: flex; gap: 10px; font-family: var(--mono); }
.edit-card .poster .meta-overlay span + span::before { content: "·"; margin-right: 10px; opacity: .7; }
.edit-card .head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 0 16px; border-bottom: 1px solid light-dark(rgba(236, 236, 238, 1), #2a2a2e); }
.edit-card .head h3 { font-size: 16px; font-weight: 600; }
.edit-card .head .meta { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.edit-card .conform { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0; }
.edit-card .conform .left { display: flex; align-items: center; gap: 12px; }
.edit-card .conform .v { font-size: 13px; font-weight: 500; display: block; }
.edit-card .conform .by { font-size: 12px; color: var(--text-2); }
.edit-body { padding-top: 16px; border-top: 1px solid light-dark(rgba(236, 236, 238, 1), #2a2a2e); max-width: 520px; }
.section-title { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.version-list { display: flex; flex-direction: column; }
.version-list .item { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid light-dark(rgba(236, 236, 238, 1), #2a2a2e); font-size: 13px; }
.version-list .item:last-child { border-bottom: 0; }
.version-list .item .v { font-weight: 500; font-family: var(--mono); font-size: 12px; }
.version-list .item .note { color: var(--text-2); font-size: 12px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.version-list .item .when { color: var(--text-3); font-size: 12px; white-space: nowrap; }
.version-list .item.current .v { color: var(--blue); }
.shot-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.shot-strip .chip { flex: 0 0 auto; width: 118px; cursor: pointer; display: block; }
.shot-strip .chip .art { border-radius: 8px; }
.shot-strip .chip .lbl { display: flex; align-items: baseline; justify-content: space-between; margin-top: 6px; font-size: 12px; }
.shot-strip .chip .lbl .code { font-weight: 600; }
.shot-strip .chip .lbl .f { color: var(--text-2); font-family: var(--mono); font-size: 11px; }
.shot-strip .chip .idx { font-size: 10px; color: var(--text-3); font-weight: 600; letter-spacing: .04em; }
.scope-note { font-size: 12px; color: var(--text-2); margin-top: 8px; line-height: 1.5; }
.scope-note strong { color: var(--text); font-weight: 500; }

.empty { padding: 48px 24px; text-align: center; color: var(--text-2); font-size: 13px; }
.empty h3 { font-size: 15px; color: var(--text); font-weight: 600; margin-bottom: 4px; }

/* ---------- Drawer ---------- */
.scrim { position: fixed; inset: 0; z-index: 60; background: light-dark(rgba(0, 0, 0, 0.28), rgba(255, 255, 255, 0.24)); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; transition: opacity .2s; }
.scrim.show { opacity: 1; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(520px, 100%); height: 100dvh; background: var(--card); box-shadow: -8px 0 40px rgba(0, 0, 0, 0.12); transform: translateX(100%); transition: transform .25s cubic-bezier(.2, .8, .2, 1); display: flex; flex-direction: column; padding-top: var(--safe-top); padding-right: var(--safe-right); }
@media (max-width: 640px) { .drawer-head { padding: 12px 10px 12px 16px; } .drawer-head h2 { font-size: 17px; } .drawer-body { padding: 16px 16px calc(32px + var(--safe-bottom)); } }
.drawer.show { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 14px 24px; border-bottom: 1px solid var(--border-strong); }
.drawer-head .kicker { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.drawer-head h2 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.drawer-body { overflow-y: auto; padding: 20px 24px 40px; flex: 1; }
.stack > * + * { margin-top: 22px; }
.drawer .art.hero { border-radius: 12px; }
.kv { margin-bottom: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 13px; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; }
.task-list { display: flex; flex-direction: column; border: 1px solid var(--border-strong); border-radius: 12px; overflow: hidden; }
.task-list .task { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-bottom: 1px solid light-dark(rgba(236, 236, 238, 1), #2a2a2e); font-size: 13px; background: var(--card); }
.task-list .task:last-child { border-bottom: 0; }
.task-list .task .name { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.task-list .task .name::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dot); }
.task-list .task .who { color: var(--text-2); font-size: 12px; margin-left: auto; margin-right: 10px; }
.notes { display: flex; flex-direction: column; gap: 12px; }
.note { display: flex; gap: 10px; font-size: 13px; }
.note .ini { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%; background: var(--zinc-100); color: var(--zinc-500); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; }
.note .who { font-weight: 500; }
.note .when { color: var(--text-3); font-size: 12px; margin-left: 6px; }
.note .txt { color: var(--text); margin-top: 2px; line-height: 1.5; }
.note-form { display: flex; gap: 8px; margin-top: 12px; }
.note-form input { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-link { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border: 1px solid var(--border-strong); border-radius: 10px; font-size: 12px; font-weight: 500; background: var(--card); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.chip-link:hover { border-color: light-dark(rgba(0, 0, 0, 0.18), rgba(255, 255, 255, 0.24)); box-shadow: var(--shadow-card); }
.chip-link .art { width: 40px; aspect-ratio: 16 / 10; border-radius: 6px; }
.chip-link > svg { width: 18px; height: 18px; color: var(--text-2); margin-left: 4px; }
.chip-link .sub { color: var(--text-2); font-weight: 400; }
.version-select { display: inline-flex; gap: 4px; padding: 3px; background: var(--pill-bg); border-radius: 8px; }
.version-select button { padding: 3px 10px; border-radius: 6px; font-size: 12px; font-weight: 500; color: var(--text-2); font-family: var(--mono); }
.version-select button.active { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }

/* ---------- Modal ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { width: min(440px, 100%); background: var(--card); border-radius: 20px; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18); padding: 24px; transform: translateY(8px) scale(.98); opacity: 0; transition: transform .2s, opacity .2s; max-height: calc(100dvh - 32px); overflow-y: auto; }
@media (max-width: 640px) { .modal-wrap { align-items: flex-end; padding: 0; } .modal { width: 100%; border-radius: 18px 18px 0 0; padding: 20px 16px calc(20px + var(--safe-bottom)); max-height: min(92dvh, 100%); } }
.modal.show { transform: none; opacity: 1; }
.modal h2 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.modal .lead { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.modal.player { width: min(960px, 100%); padding: 0; overflow: hidden; background: #111114; color: #fff; border-radius: 16px; }
.form { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 500; color: var(--text-2); }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input[type="text"], input[type="number"], select.input, textarea.input {
  font: inherit; font-size: 13px; color: var(--text); height: 36px; padding: 0 10px; background: var(--card); border: 1px solid light-dark(rgba(0, 0, 0, 0.12), rgba(255, 255, 255, 0.2)); border-radius: 8px; width: 100%; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; padding: 8px 10px; resize: vertical; min-height: 64px; }
input:focus, select.input:focus, textarea.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.2); outline: none; }
.form .hint { font-size: 12px; color: var(--text-2); }
.form .hint:empty { display: none; }
.form .hint.error { color: var(--rose-700); }
.form .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

/* ---------- Player ---------- */
.player-stage { position: relative; aspect-ratio: 16 / 9; background: #000; }
.player-stage img, .player-stage video { width: 100%; height: 100%; object-fit: contain; }
.player-stage .no-video { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: rgba(0, 0, 0, 0.55); color: #fff; text-align: center; padding: 24px; }
.player-stage .no-video svg { width: 28px; height: 28px; opacity: .8; }
.player-stage .no-video strong { font-size: 15px; font-weight: 600; }
.player-stage .no-video span { font-size: 12px; color: rgba(255, 255, 255, 0.7); max-width: 360px; }
.player-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; font-size: 13px; flex-wrap: wrap; }
.player-bar .name { font-weight: 600; font-size: 14px; }
.player-bar .meta { color: rgba(255, 255, 255, 0.6); font-family: var(--mono); font-size: 12px; display: flex; gap: 12px; flex-wrap: wrap; }
.player-bar .close { color: rgba(255, 255, 255, 0.7); }
.player-bar .close:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.player-scrub { height: 4px; background: rgba(255, 255, 255, 0.15); margin: 0 18px 14px; border-radius: 2px; position: relative; }
.player-scrub > span { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--blue); border-radius: 2px; }

/* ---------- Popover ---------- */
.popover { position: fixed; z-index: 80; min-width: 160px; max-height: calc(100dvh - 16px); overflow-y: auto; background: light-dark(rgba(255, 255, 255, 0.92), rgba(28, 28, 30, 0.92)); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%); border: 1px solid light-dark(rgba(0, 0, 0, 0.08), rgba(255, 255, 255, 0.14)); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 6px; opacity: 0; transform: translateY(-4px); transition: opacity .15s, transform .15s; }
.popover.under-modal { z-index: 65; } /* a modal it opened (z 70) sits above it, still above a drawer (61) */
/* Phone: every menu / picker is a bottom sheet — never off-screen, always thumb-reachable, scrolls inside. */
.popover.sheet { left: 8px !important; right: 8px; bottom: calc(8px + var(--safe-bottom)); top: auto !important; width: auto !important; min-width: 0; max-width: none !important; max-height: min(72dvh, 560px); border-radius: 16px; padding: 8px; transform: translateY(12px); background: light-dark(rgba(255, 255, 255, 0.98), rgba(28, 28, 30, 0.98)); }
.popover.sheet.show { transform: translateY(0); }
.popover.sheet .menu-item { padding: 11px 12px; font-size: 14px; }
.popover.sheet .result { padding: 10px 12px; font-size: 14px; }
.popover.show { opacity: 1; transform: none; }
.popover .menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border-radius: 8px; font-size: 13px; text-align: left; }
.popover .menu-item:hover { background: light-dark(rgba(0, 0, 0, 0.05), rgba(255, 255, 255, 0.1)); }
.popover .menu-item.active { background: var(--blue-soft); }
.popover .menu-item .pill { pointer-events: none; }
.popover .menu-item .check { margin-left: auto; width: 14px; height: 14px; color: var(--blue); }
.popover .menu-title { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); padding: 6px 10px 4px; }
.popover .menu-sep { height: 1px; background: light-dark(rgba(0, 0, 0, 0.06), rgba(255, 255, 255, 0.11)); margin: 4px 0; }
.popover .menu-title.plain { font-weight: 400; text-transform: none; letter-spacing: 0; }
.popover.wide { width: 320px; }
.popover .search-input { margin: 4px; width: calc(100% - 8px); }
.popover .result { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; font-size: 13px; width: 100%; text-align: left; }
.popover .result:hover { background: light-dark(rgba(0, 0, 0, 0.05), rgba(255, 255, 255, 0.1)); }
.popover .result .kind { font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); width: 56px; flex-shrink: 0; }
.popover .result .sub { color: var(--text-2); font-size: 12px; margin-left: auto; }
.popover .notif { padding: 8px 10px; font-size: 13px; border-radius: 8px; display: flex; gap: 10px; align-items: flex-start; }
.popover .notif .ini { flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%; background: var(--zinc-100); color: var(--zinc-500); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; }
.popover .notif .when { color: var(--text-3); font-size: 11px; }
.popover .profile { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.popover .profile img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.popover .profile .n { font-size: 13px; font-weight: 600; }
.popover .profile .r { font-size: 12px; color: var(--text-2); }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-bottom)); max-width: calc(100vw - 32px); text-align: center; transform: translate(-50%, 12px); z-index: 90; background: rgba(29, 29, 31, 0.92); color: #fff; font-size: 13px; padding: 9px 14px; border-radius: 999px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Dailies (modest mock) ---------- */
.list-card .row-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid light-dark(rgba(236, 236, 238, 1), #2a2a2e); font-size: 13px; cursor: pointer; }
.list-card .row-item:last-child { border-bottom: 0; }
.list-card .row-item:hover { background: light-dark(#fbfbfc, #1e1e20); }
.list-card .row-item .art { width: 56px; aspect-ratio: 16 / 10; border-radius: 6px; flex-shrink: 0; }
.list-card .row-item .t { font-weight: 600; }
.list-card .row-item .s { color: var(--text-2); font-size: 12px; }
.list-card .row-item .pill { margin-left: auto; }

/* ---------- Data-source states (Kitsu mode) ---------- */
.mode-tag { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--amber-700); background: var(--amber-50); border: 1px solid rgba(253, 230, 138, 0.8); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.mode-tag.live { color: var(--emerald-700); background: var(--emerald-50); border-color: rgba(167, 243, 208, 0.8); }
.demo-tag.live::before { background: var(--emerald); }
.avatar-initials { width: 28px; height: 28px; border-radius: 50%; background: var(--blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; }
.avatar-initials.lg { width: 32px; height: 32px; font-size: 12px; }
.refresh-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--text-2); margin: -8px 0 20px; flex-wrap: wrap; }
@media (max-width: 640px) { .refresh-bar { margin: 0 0 14px; } .refresh-bar .text { row-gap: 2px; } }
.refresh-bar .text { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.refresh-bar .src { font-weight: 600; color: var(--emerald-700); }
.refresh-bar .stale { color: var(--amber-700); }
.refresh-bar .err { color: var(--rose-700); }
.refresh-bar.has-error .src { color: var(--rose-700); }
.refresh-bar .btn svg { width: 14px; height: 14px; }
.card.empty.loading { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--blue); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.card.empty.error-state h3 { color: var(--rose-700); }
.meta-line { font-size: 12px; color: var(--text-3); }
.shot-row.body.canceled .code { text-decoration: line-through; color: var(--text-2); }
.task-list .task .due { font-size: 11px; color: var(--text-3); margin-right: 10px; white-space: nowrap; }
.readonly-note { border-left: 2px solid var(--border-strong); padding-left: 10px; }
.container.narrow { max-width: 480px; }
.login-card { padding: 28px; margin-top: 24px; }
.login-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 8px; }
.login-head svg { width: 22px; height: 22px; color: var(--blue); margin-top: 6px; flex-shrink: 0; }
.login-head h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.login-head .lead { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.form label[hidden] { display: none; }
button.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- Sign-in page (standalone) ---------- */
body.page-login { background: light-dark(#fdfbfd, #201e20); }
.login-page { min-height: 100vh; display: flex; flex-direction: column; }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 10px; height: 64px; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; border-bottom: 1px solid light-dark(rgba(0, 0, 0, 0.04), rgba(255, 255, 255, 0.08)); background: light-dark(rgba(253, 251, 253, 0.9), rgba(28, 28, 30, 0.9)); }
.login-brand img { width: 28px; height: 28px; border-radius: 50%; }
.login-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px 48px; }
.login-card { width: 100%; max-width: 440px; padding: 36px 32px 32px; border-radius: 16px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04); border-color: light-dark(rgba(0, 0, 0, 0.04), rgba(255, 255, 255, 0.08)); }
.login-card h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; text-align: center; margin-bottom: 6px; }
.login-hint { font-size: 12px; color: var(--text-2); text-align: center; margin-bottom: 22px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-form .field { display: flex; flex-direction: column; gap: 6px; }
.login-form .field[hidden] { display: none; }
.login-form label { font-size: 12px; font-weight: 600; color: var(--text); }
.login-form .label-row { display: flex; align-items: baseline; justify-content: space-between; }
.login-form .link, .login-secondary .link { font-size: 12px; font-weight: 500; color: var(--blue); }
.login-form .link:hover, .login-secondary .link:hover { text-decoration: underline; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > svg { position: absolute; left: 11px; width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.input-wrap input { width: 100%; height: 40px; padding-left: 36px; padding-right: 40px; border-radius: 8px; border: 1px solid light-dark(rgba(0, 0, 0, 0.12), rgba(255, 255, 255, 0.2)); background: var(--card); font-size: 14px; }
.input-wrap input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.2); }
.input-wrap .eye { position: absolute; right: 6px; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--text-2); }
.input-wrap .eye:hover { color: var(--text); background: light-dark(rgba(0, 0, 0, 0.04), rgba(255, 255, 255, 0.08)); }
.input-wrap .eye svg { width: 16px; height: 16px; }
.form-error { font-size: 12px; color: var(--rose-700); background: var(--rose-50); border: 1px solid rgba(254, 205, 211, 0.8); border-radius: 8px; padding: 8px 10px; margin: 0; }
.form-error[hidden] { display: none; }
.btn-block { width: 100%; justify-content: center; height: 42px; border-radius: 8px; font-size: 14px; font-weight: 600; margin-top: 4px; }
.login-secondary { margin-top: 20px; font-size: 12px; color: var(--text-2); text-align: center; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
@media (max-width: 480px) { .login-card { padding: 28px 20px 24px; } .login-card h1 { font-size: 22px; } }

/* ---------- Calendar ---------- */
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-title { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; margin-left: 10px; }
.cal-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.cal-toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.cal-toggle input { accent-color: var(--blue); width: 15px; height: 15px; }
.cal-weekend-note { font-size: 12px; font-weight: 500; color: var(--amber-700); background: var(--amber-50); border: 1px solid rgba(253, 230, 138, 0.8); border-radius: 999px; padding: 3px 10px; }
.cal-card { padding: 20px; overflow: hidden; }
.cal-scroll { overflow-x: auto; }
.cal-head { display: grid; gap: 12px; text-align: center; font-size: 13px; font-weight: 500; color: var(--text-2); padding-bottom: 12px; }
.cal-weeks { display: flex; flex-direction: column; gap: 12px; }
.cal-week { position: relative; display: grid; gap: 12px; }
.cal-day { position: relative; min-height: 148px; background: var(--cal-cell); border-radius: 12px; padding: 40px 8px 8px; transition: background .15s; }
.cal-week.no-items .cal-day { min-height: 64px; } /* nothing scheduled that week: a short row */
.cal-day:hover { background: var(--cal-cell-hover); }
.cal-day.other-month .cal-num { color: var(--text-3); }
.cal-day.weekend { background: light-dark(#faf8f9, #232021); }
.cal-day.today { background: var(--card); box-shadow: 0 0 0 2px var(--cal-today), 0 4px 16px rgba(2, 132, 199, 0.12); }
.cal-day.today .cal-num { color: var(--cal-today); }
.cal-day-head { position: absolute; top: 8px; left: 10px; right: 8px; display: flex; align-items: center; justify-content: space-between; }
.cal-day-head .cal-num { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; display: inline-flex; align-items: center; gap: 5px; }
.cal-day-head .mon { font-size: 11px; font-weight: 500; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; opacity: .7; }
.today-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cal-today); animation: pulse 1.6s ease-in-out infinite; }
.today-badge { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--cal-today); background: rgba(2, 132, 199, 0.1); padding: 2px 6px; border-radius: 4px; }
.cal-items { display: flex; flex-direction: column; gap: 6px; }
.cal-lanes { position: absolute; left: 0; right: 0; display: grid; gap: 6px 12px; pointer-events: none; }
.cal-bar { pointer-events: auto; height: 32px; margin: 0 6px; padding: 0 12px; border-radius: 8px; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--cal-span); color: var(--cal-span-text); font-size: 13px; font-weight: 500; letter-spacing: .01em; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); overflow: hidden; white-space: nowrap; transition: background .15s; }
.cal-bar:hover { background: var(--cal-span-hover); }
.cal-bar .lbl { overflow: hidden; text-overflow: ellipsis; }
.cal-bar .meta { font-family: var(--mono); font-size: 11px; color: var(--cal-span-meta); opacity: .85; flex-shrink: 0; }
.cal-bar .cont { color: var(--cal-span-meta); font-weight: 700; }
.cal-bar.cont-before { border-top-left-radius: 2px; border-bottom-left-radius: 2px; margin-left: 0; }
.cal-bar.cont-after { border-top-right-radius: 2px; border-bottom-right-radius: 2px; margin-right: 0; }
.cal-bar.kind-leave { background: var(--cal-leave-bg); color: var(--cal-leave); border: 1px solid rgba(2, 132, 199, 0.35); box-shadow: none; }
.cal-bar.kind-leave .meta, .cal-bar.kind-leave .cont { color: var(--cal-leave); }
.cal-bar.tinted { background: var(--ev-dark); }
.cal-bar.tinted:hover { background: var(--ev); }
.cal-bar.tinted .meta, .cal-bar.tinted .cont { color: rgba(255, 255, 255, 0.85); }
.cal-pill { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 3px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; line-height: 1.1; color: #fff; background: var(--cal-milestone); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); text-align: center; }
.cal-pill svg { width: 13px; height: 13px; flex-shrink: 0; opacity: .9; }
.cal-pill .txt { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.cal-pill .lbl { max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.15; }
.cal-pill .sub { font-size: 9px; font-weight: 500; opacity: .85; }
.cal-pill.kind-deadline { background: var(--cal-deadline); }
.cal-pill.kind-client { background: var(--cal-client); }
.cal-pill.kind-kickoff { background: var(--cal-kickoff); }
.cal-pill.kind-start { background: var(--cal-span); }
.cal-pill.kind-meeting { background: var(--card); color: var(--text); border-radius: 999px; box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25); }
.cal-pill.kind-meeting svg { color: var(--cal-meeting); }
.cal-pill.kind-meeting .sub { color: var(--text-2); }
.cal-pill.kind-leave { background: var(--cal-leave-bg); color: var(--cal-leave); box-shadow: none; }
.cal-pill.tinted { background: var(--ev-dark); }
.cal-pill.tinted.kind-deadline { background: var(--ev-dark); box-shadow: inset 0 0 0 2px var(--cal-deadline); }
.cal-more { align-self: flex-start; font-size: 11px; font-weight: 600; color: var(--blue); padding: 2px 4px; border-radius: 4px; }
.cal-more:hover { background: rgba(0, 113, 227, 0.08); }
.cal-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--cal-span); flex-shrink: 0; }
.cal-dot.kind-deadline { background: var(--cal-deadline); } .cal-dot.kind-milestone { background: var(--cal-milestone); } .cal-dot.kind-client { background: var(--cal-client); } .cal-dot.kind-kickoff { background: var(--cal-kickoff); } .cal-dot.kind-meeting { background: var(--cal-meeting); } .cal-dot.kind-leave { background: var(--cal-leave); }
.cal-unscheduled { font-size: 13px; }
.cal-unscheduled .list-card { margin-top: 12px; }
.cal-unsched-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; }
.cal-unsched-foot .btn[hidden] { display: none; }
.cal-drawer-swatch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--cal-span); color: var(--cal-span-text); font-weight: 600; }
.cal-drawer-swatch .meta { font-size: 11px; font-weight: 500; opacity: .8; }
.cal-drawer-swatch.kind-deadline { background: var(--cal-deadline); } .cal-drawer-swatch.kind-milestone { background: var(--cal-milestone); } .cal-drawer-swatch.kind-client { background: var(--cal-client); } .cal-drawer-swatch.kind-kickoff { background: var(--cal-kickoff); }
.cal-drawer-swatch.kind-meeting { background: var(--card); color: var(--text); border: 1px solid var(--border-strong); } .cal-drawer-swatch.kind-leave { background: var(--cal-leave-bg); color: var(--cal-leave); }
.cal-drawer-swatch.tinted { background: var(--ev-dark); color: #fff; }
.btn.danger { color: var(--rose-700); }
.btn-primary.danger { background: var(--rose-700); color: #fff; }
a.menu-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; font-size: 13px; }
a.menu-item:hover { background: light-dark(rgba(0, 0, 0, 0.05), rgba(255, 255, 255, 0.1)); }
/* Tablet: the month grid stays, with tighter cells; it scrolls inside its card before it squeezes the labels. */
@media (max-width: 1024px) { .cal-card { padding: 12px; } .cal-head, .cal-week { gap: 6px; } .cal-day { min-height: 120px; padding-inline: 6px; } .cal-bar { margin: 0 3px; padding: 0 8px; font-size: 12px; } }
@media (max-width: 760px) { .cal-scroll { overflow-x: auto; } .cal-head, .cal-week { min-width: 720px; } .cal-title { font-size: 18px; } .cal-tools { gap: 10px; } }
/* Phone: the agenda (calendar.js renders it instead of the grid) — one block per day with events, today marked. */
.cal-agenda { padding: 4px 0; }
.cal-agenda-empty { padding: 20px 16px; margin: 0; }
.cal-agenda-day { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; padding: 12px 14px; border-bottom: 1px solid rgba(236, 236, 238, 0.9); }
.cal-agenda-day:last-child { border-bottom: 0; }
.cal-agenda-head { display: flex; flex-direction: column; align-items: center; gap: 2px; padding-top: 2px; }
.cal-agenda-num { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.cal-agenda-wd { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); }
.cal-agenda-head.today .cal-agenda-num { color: var(--cal-today); }
.cal-agenda-items { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cal-agenda-item { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 10px; border-radius: 10px; background: var(--cal-cell); }
.cal-agenda-item:active { background: var(--cal-cell-hover); }
.cal-agenda-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.cal-agenda-text .lbl { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-agenda-text .sub { font-size: 11px; color: var(--text-2); }
.cal-agenda-item.tinted .cal-dot { background: var(--ev); }
@media (max-width: 640px) { .cal-toolbar { gap: 8px; } .cal-nav .btn { height: 36px; } .cal-tools { width: 100%; justify-content: space-between; } .cal-tools .select-compact { flex: 1; min-width: 0; } }

/* ---------- Pipeline network ---------- */
.pipe-screen > * + * { margin-top: 14px; }
.pipe-summary { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 12px; }
.pipe-card { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--card); text-align: left; transition: box-shadow .15s, border-color .15s; }
.pipe-card .n { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.pipe-card .l { font-size: 12px; color: var(--text-2); }
.pipe-card.blue { background: var(--blue-50); border-color: rgba(191, 219, 254, 0.9); } .pipe-card.blue .n { color: var(--blue-700); }
.pipe-card.red { background: var(--rose-50); border-color: rgba(254, 205, 211, 0.9); } .pipe-card.red .n { color: var(--rose-700); }
.pipe-card.amber { background: var(--amber-50); border-color: rgba(253, 230, 138, 0.9); } .pipe-card.amber .n { color: var(--amber-700); }
.pipe-card[aria-pressed] { cursor: pointer; }
.pipe-card[aria-pressed]:hover { box-shadow: var(--shadow-card-hover); }
.pipe-card.active { outline: 2px solid var(--blue); outline-offset: 1px; }
.pipe-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pipe-toolbar-left, .pipe-toolbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pipe-toolbar-left { flex: 1 1 520px; min-width: 0; }
.pipe-toolbar-right { margin-left: auto; }
.pipe-search { width: min(100%, 280px); }
.pipe-zoomctl { display: inline-flex; align-items: center; gap: 2px; height: 40px; padding: 0 4px; background: var(--card); border: 1px solid var(--border-strong); border-radius: 10px; }
.pipe-zoomctl .pipe-tbtn { width: 32px; height: 32px; padding: 0; border-radius: 8px; }
.pipe-zoomctl .pipe-tbtn svg { width: 18px; height: 18px; }
.pipe-zoom { min-width: 48px; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--text); }
.pipe-toolbar .btn.active { background: var(--blue-soft); color: var(--blue-700); }
.pipe-notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 10px; background: var(--blue-50); border: 1px solid rgba(191, 219, 254, 0.9); font-size: 13px; color: var(--blue-700); }
.pipe-notice.warn { background: var(--amber-50); border-color: rgba(253, 230, 138, 0.9); color: var(--amber-700); }

/* The canvas takes the workspace width and most of the viewport height (dvh: the phone's browser chrome is accounted for). */
.pipe-canvas { position: relative; height: max(560px, calc(100dvh - 300px)); border: 1px solid var(--border-strong); border-radius: 16px; background: light-dark(#fbfcfe, #1d1e20); overflow: hidden; touch-action: none; user-select: none; cursor: grab; }
.pipe-canvas.link-mode { cursor: crosshair; }
.pipe-canvas.link-mode .pipe-node:not(.link-source) .pipe-node-card { box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.35); }
.pipe-canvas.link-mode .pipe-node.link-source .pipe-node-card { box-shadow: 0 0 0 3px var(--blue); }
.pipe-linkbar { left: 50%; top: 14px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 10px; max-width: calc(100% - 28px); padding: 6px 8px 6px 12px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 12px; box-shadow: var(--shadow-pop); }
.pipe-linkbar svg { width: 14px; height: 14px; flex-shrink: 0; }
.pipe-linkbar > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pipe-linkbar .btn-ghost { background: rgba(255, 255, 255, 0.16); color: #fff; }
/* Selection bar: what is selected and what can be done with it — no right-click needed (touch parity). */
.pipe-selbar { left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; max-width: calc(100% - 28px); padding: 6px; border-radius: 14px; background: light-dark(rgba(255, 255, 255, 0.96), rgba(28, 28, 30, 0.96)); border: 1px solid var(--border-strong); box-shadow: var(--shadow-pop); cursor: default; }
.pipe-selbar-name { font-size: 13px; font-weight: 600; padding: 0 8px 0 10px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pipe-selbar .btn { gap: 4px; padding: 0 10px; } .pipe-selbar .btn svg { width: 15px; height: 15px; }
.pipe-selbar .btn.active { background: var(--blue-soft); color: var(--blue-700); }
.pipe-lib-toggle { display: none; } /* only when the library is a panel (≤ 1100 px) */
.pipe-lib-close { display: none; }
.pipe-lib-scrim { display: none; }
.pipe-lib-headbtns { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.pipe-canvas { outline: none; }
.pipe-canvas.panning { cursor: grabbing; }
.pipe-canvas.linking { cursor: crosshair; }
.pipe-grid { position: absolute; inset: 0; background-image: radial-gradient(rgba(37, 99, 235, 0.10) 1px, transparent 1.2px), linear-gradient(rgba(37, 99, 235, 0.045) 1px, transparent 1px); background-size: 24px 24px, 120px 120px; pointer-events: none; }
.pipe-world { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; will-change: transform; }
.pipe-edges { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.pipe-edge { fill: none; stroke: #9aa3b2; stroke-width: 2; }
.pipe-edge.done { stroke: var(--emerald); }
.pipe-edge.active { stroke: var(--blue-500); }
.pipe-edge.blocks { stroke: var(--rose); stroke-dasharray: 6 5; }
.pipe-edge.temp { stroke: var(--blue); stroke-dasharray: 4 4; }
/* Casting links (Kitsu facts): quieter than a dependency — thin, dotted, muted; never a blocker colour. */
.pipe-edge.cast { stroke: #b9c0cc; stroke-width: 1.4; stroke-dasharray: 2 5; stroke-linecap: round; }
.pipe-edges marker.cast path { fill: #b9c0cc; }
.pipe-edge-hit { fill: none; stroke: transparent; stroke-width: 14; }
.pipe-edges marker path { fill: #9aa3b2; }
.pipe-edges marker.done path { fill: var(--emerald); }
.pipe-edges marker.active path { fill: var(--blue-500); }
.pipe-edges marker.blocks path { fill: var(--rose); }
.pipe-edge-label rect { fill: #fff; stroke: var(--rose); stroke-width: 1.2; }
.pipe-edge-label text { font: 600 11px Inter, system-ui, sans-serif; fill: var(--rose-700); }

.pipe-node { position: absolute; width: 232px; --accent: #c4c9d4; --accent-soft: rgba(196, 201, 212, 0.12); cursor: pointer; outline: none; }
.pipe-node.tone-done { --accent: var(--emerald); --accent-soft: rgba(16, 185, 129, 0.10); }
.pipe-node.tone-progress { --accent: var(--amber); --accent-soft: rgba(245, 158, 11, 0.10); }
.pipe-node.tone-hold { --accent: var(--blue-500); --accent-soft: rgba(59, 130, 246, 0.10); }
.pipe-node.tone-retake { --accent: var(--rose); --accent-soft: rgba(244, 63, 94, 0.10); }
.pipe-node.tone-gate { --accent: #8b93a7; --accent-soft: rgba(139, 147, 167, 0.12); }
.pipe-node-card { background: var(--card); border: 2px solid var(--accent); border-radius: 14px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 18px rgba(15, 23, 42, 0.06); transition: box-shadow .15s, transform .15s; }
.pipe-node:hover .pipe-node-card { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05), 0 12px 28px rgba(15, 23, 42, 0.10); }
/* selection (click / shift+click): light blue tint + soft ring; open inspector / menu target / focus: strong ring */
/* Selection = an OUTER blue ring (Flowly blue); the card's own border keeps the status colour. */
.pipe-node.selected .pipe-node-card { background: light-dark(#f3f8ff, #202123); box-shadow: 0 0 0 2px light-dark(#fff, var(--card)), 0 0 0 5px var(--blue), 0 0 0 9px rgba(0, 113, 227, 0.18), 0 8px 20px rgba(15, 23, 42, 0.10); }
.pipe-node.selected .pipe-node-foot { background: rgba(0, 113, 227, 0.08); }
.pipe-node.pipe-note.selected .pipe-note-card { box-shadow: 0 0 0 2px light-dark(#fff, var(--card)), 0 0 0 5px var(--blue), 0 0 0 9px rgba(0, 113, 227, 0.18), 0 8px 18px rgba(120, 90, 0, 0.10); }
.pipe-node.open .pipe-node-card, .pipe-node:focus-visible .pipe-node-card, .pipe-node.menu-target .pipe-node-card { box-shadow: 0 0 0 2px light-dark(#fff, var(--card)), 0 0 0 4px var(--blue), 0 12px 28px rgba(15, 23, 42, 0.14); }
.pipe-node.menu-target .pipe-node-card, .pipe-node.open .pipe-node-card { transform: translateY(-1px); }
.pipe-node.pipe-note.menu-target .pipe-note-card, .pipe-node.pipe-note.open .pipe-note-card { box-shadow: 0 0 0 2px light-dark(#fff, var(--card)), 0 0 0 5px var(--blue), 0 8px 18px rgba(120, 90, 0, 0.10); }
.pipe-menu-head { display: flex; flex-direction: column; gap: 1px; padding: 6px 10px 8px; border-bottom: 1px solid light-dark(rgba(0, 0, 0, 0.06), rgba(255, 255, 255, 0.11)); margin-bottom: 4px; }
.pipe-menu-head .pipe-menu-kind { font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.pipe-menu-head strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pipe-node.dragging .pipe-node-card { transform: scale(1.02); box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16); }
.pipe-node.unresolved .pipe-node-card { border-style: dashed; }
.pipe-node-top { display: flex; align-items: center; gap: 6px; height: 24px; margin-bottom: 4px; padding-left: 6px; }
.pipe-date { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--card); border: 1px solid var(--border-strong); font-size: 11px; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.pipe-date .alert { width: 14px; height: 14px; }
.pipe-date.state-today { color: var(--amber-700); border-color: rgba(253, 230, 138, 0.9); background: var(--amber-50); }
.pipe-date.state-today .alert { color: var(--amber); }
.pipe-date.state-overdue { color: var(--rose-700); border-color: rgba(254, 205, 211, 0.9); background: var(--rose-50); }
.pipe-date.state-overdue .alert { color: var(--rose); }
.pipe-date.state-done { color: var(--text-3); text-decoration: line-through; }
.pipe-retake { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--rose-50); border: 1px solid rgba(254, 205, 211, 0.9); color: var(--rose-700); font-size: 11px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.pipe-flag.warn { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--amber-50); border: 1px solid rgba(253, 230, 138, 0.9); color: var(--amber-700); font-size: 11px; font-weight: 600; }
.pipe-node-body { display: flex; gap: 10px; padding: 10px 10px 8px; }
.pipe-thumb { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: var(--zinc-100); flex-shrink: 0; }
.pipe-thumb .art { border-radius: 0; height: 100%; aspect-ratio: auto; }
.pipe-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pipe-thumb .fallback { padding: 0; gap: 0; }
.pipe-thumb .fallback span:not(.initials) { display: none; }
.pipe-thumb .fallback .initials { font-size: 14px; }
.pipe-thumb.gate { display: flex; align-items: center; justify-content: center; color: #8b93a7; background: light-dark(#f1f3f7, #22262e); }
.pipe-thumb.gate svg { width: 26px; height: 26px; }
.pipe-node-text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pipe-kind { font-size: 11px; color: var(--text-2); }
.pipe-name { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pipe-desc { font-size: 11px; color: var(--text-2); line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pipe-node-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border-top: 1px solid light-dark(rgba(0, 0, 0, 0.05), rgba(255, 255, 255, 0.1)); background: var(--accent-soft); border-radius: 0 0 12px 12px; }
.pipe-dept { font-size: 12px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipe-node-foot .pill { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.pill.st-gate { background: light-dark(#f1f3f7, #22262e); color: var(--text-2); border-color: var(--border-strong); }
.pipe-wait { position: absolute; left: 10px; bottom: -10px; height: 20px; padding: 0 8px; border-radius: 999px; background: var(--rose-700); color: #fff; font-size: 10px; font-weight: 600; display: inline-flex; align-items: center; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); }
.pipe-node.tone-done .pipe-wait { display: none; }
.pipe-hidden { position: absolute; top: 50%; transform: translateY(-50%); height: 20px; min-width: 24px; padding: 0 6px; border-radius: 999px; background: var(--card); border: 1px dashed #9aa3b2; color: var(--text-2); font-size: 10px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.pipe-hidden.in { left: -14px; } .pipe-hidden.out { right: -14px; }
/* ports: input on the left edge, output on the right edge — always present, quiet until used */
.pipe-port { position: absolute; top: 50%; width: 12px; height: 12px; margin-top: 12px; transform: translateY(-50%); border-radius: 50%; background: var(--card); border: 2px solid #b6bcc9; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); padding: 0; transition: transform .12s, border-color .12s, background .12s; }
.pipe-port.in { left: -7px; }
.pipe-port.out { right: -7px; cursor: crosshair; }
.pipe-node:hover .pipe-port, .pipe-node:focus-within .pipe-port { border-color: var(--blue); }
.pipe-port.out:hover, .pipe-canvas.linking .pipe-port.out:active { transform: translateY(-50%) scale(1.35); background: var(--blue); border-color: var(--blue); }
.pipe-node.drop .pipe-port.in { transform: translateY(-50%) scale(1.5); background: var(--blue); border-color: var(--card); box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.35); }
.pipe-node.drop .pipe-node-card { box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.5); }
.pipe-node.drop-invalid .pipe-node-card { box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.45); }
.pipe-node.drop-invalid .pipe-port.in { border-color: var(--rose); background: var(--rose-50); }
.pipe-canvas.linking .pipe-node:not(.drop):not(.drop-invalid) .pipe-port.in { border-color: var(--blue); background: var(--blue-50); }
.popover.pipe-menu { min-width: 220px; max-width: 320px; }
.popover.pipe-menu .menu-item .pill { pointer-events: none; }
.popover.pipe-menu .menu-item.danger { color: var(--rose-700); }
.pipe-minimap { position: absolute; left: 14px; bottom: 14px; width: 176px; height: 110px; background: light-dark(rgba(255, 255, 255, 0.92), rgba(28, 28, 30, 0.92)); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow-card); cursor: pointer; }
.pipe-minimap .mm-node { fill: #c4c9d4; }
.pipe-minimap .mm-node.tone-done { fill: var(--emerald); } .pipe-minimap .mm-node.tone-progress { fill: var(--amber); } .pipe-minimap .mm-node.tone-hold { fill: var(--blue-500); } .pipe-minimap .mm-node.tone-retake { fill: var(--rose); } .pipe-minimap .mm-node.tone-custom { fill: #8b93a7; }
.pipe-minimap .mm-view { fill: rgba(0, 113, 227, 0.08); stroke: var(--blue); stroke-width: 1; stroke-dasharray: 3 2; }
.pipe-overlay { position: absolute; z-index: 2; }
.pipe-legend { top: 14px; right: 14px; display: flex; gap: 18px; padding: 10px 14px; background: light-dark(rgba(255, 255, 255, 0.94), rgba(28, 28, 30, 0.94)); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow-card); font-size: 12px; cursor: default; }
.pipe-legend .menu-title { padding: 0 0 4px; }
.pipe-legend .row { display: flex; align-items: center; gap: 8px; line-height: 20px; color: var(--text); }
.pipe-legend .dot { width: 10px; height: 10px; border-radius: 50%; background: #c4c9d4; }
.pipe-legend .dot.kind-asset { background: var(--emerald); } .pipe-legend .dot.kind-shot { background: var(--blue-500); } .pipe-legend .dot.kind-edit { background: var(--indigo); } .pipe-legend .dot.kind-department { background: #8b93a7; }
.pipe-legend .dot.tone-done { background: var(--emerald); } .pipe-legend .dot.tone-progress { background: var(--amber); } .pipe-legend .dot.tone-hold { background: var(--blue-500); } .pipe-legend .dot.tone-retake { background: var(--rose); } .pipe-legend .dot.tone-neutral { background: #c4c9d4; }
.pipe-legend .edge-sample { width: 22px; height: 0; border-top: 2px solid #9aa3b2; }
.pipe-legend .edge-sample.cast { border-top: 2px dotted #b9c0cc; }
/* Group backdrops — Flowly-owned organisation drawn beneath the nodes; the head names the group and counts live members. */
.pipe-group { position: absolute; box-sizing: border-box; border-radius: 16px; border: 1px solid rgba(20, 30, 50, 0.1); background: rgba(240, 243, 248, 0.55); pointer-events: none; }
.pipe-group-head { display: flex; align-items: baseline; gap: 10px; padding: 12px 18px 0; font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipe-group-count { font-weight: 500; font-size: 12px; color: var(--text-3, var(--text-2)); }
.pipe-group.kind-production, .pipe-group.kind-episode, .pipe-group.kind-shared { border-radius: 22px; border-color: rgba(20, 30, 50, 0.14); background: light-dark(rgba(248, 249, 252, 0.7), rgba(28, 28, 30, 0.7)); }
.pipe-group.kind-production .pipe-group-head, .pipe-group.kind-episode .pipe-group-head, .pipe-group.kind-shared .pipe-group-head { padding: 16px 24px 0; font-size: 15px; color: var(--text); }
.pipe-group.kind-shared { border-style: dashed; }
.pipe-group.kind-asset-type { background: rgba(16, 185, 129, 0.06); border-color: rgba(16, 185, 129, 0.22); }
.pipe-group.kind-shots { background: rgba(59, 130, 246, 0.05); border-color: rgba(59, 130, 246, 0.2); }
.pipe-group.kind-sequence { background: rgba(59, 130, 246, 0.06); border-color: rgba(59, 130, 246, 0.26); border-radius: 12px; }
.pipe-group.kind-edits { background: rgba(99, 102, 241, 0.06); border-color: rgba(99, 102, 241, 0.22); }
/* Interactive parts of a backdrop: header, four edge strips, resize handle. The body stays transparent to the pointer. */
.pipe-group-head, .pipe-group-edge, .pipe-group-resize { pointer-events: auto; }
.pipe-group-head { cursor: grab; outline: none; border-radius: 16px 16px 0 0; }
.pipe-group-head:hover, .pipe-group-head:focus-visible { background: rgba(0, 113, 227, 0.06); }
.pipe-group-head:focus-visible { box-shadow: inset 0 0 0 2px var(--blue); }
.pipe-group-edge { position: absolute; }
.pipe-group-edge.t { left: 0; right: 0; top: -3px; height: 8px; cursor: grab; }
.pipe-group-edge.b { left: 0; right: 0; bottom: -3px; height: 8px; cursor: grab; }
.pipe-group-edge.l { top: 0; bottom: 0; left: -3px; width: 8px; cursor: grab; }
.pipe-group-edge.r { top: 0; bottom: 0; right: -3px; width: 8px; cursor: grab; }
.pipe-group-resize { position: absolute; right: 4px; bottom: 4px; width: 16px; height: 16px; cursor: nwse-resize; opacity: 0.55; background: linear-gradient(135deg, transparent 0 50%, rgba(20, 30, 50, 0.35) 50% 62%, transparent 62% 74%, rgba(20, 30, 50, 0.35) 74% 86%, transparent 86%); border-radius: 0 0 10px 0; }
.pipe-group:hover .pipe-group-resize, .pipe-group.selected .pipe-group-resize { opacity: 1; }
.pipe-group.selected { border-color: var(--blue); border-width: 2px; box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.22); }
.pipe-group.selected .pipe-group-head { background: rgba(0, 113, 227, 0.10); color: var(--blue-700); }
.pipe-group.selected .pipe-group-label { color: var(--blue-700); }
.pipe-group.dragging { box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.22), 0 18px 40px rgba(15, 23, 42, 0.14); opacity: 0.96; }
.pipe-group.dragging .pipe-group-head, .pipe-group.dragging .pipe-group-edge { cursor: grabbing; }
.pipe-group.resizing { border-style: dashed; border-color: var(--blue); }
.pipe-group.kind-custom { background: rgba(0, 113, 227, 0.045); border-color: rgba(0, 113, 227, 0.28); border-style: dashed; }
.pipe-group.kind-custom .pipe-group-head { color: var(--blue-700); }
/* Marquee (Shift+drag on the background) in screen space above the world layer. */
.pipe-marquee { position: absolute; z-index: 3; border: 1.5px solid var(--blue); background: rgba(0, 113, 227, 0.08); border-radius: 4px; pointer-events: none; }
.pipe-canvas.marqueeing { cursor: crosshair; }
/* Connector selection: a soft blue halo under the line; the line keeps its meaning colour. */
.pipe-edge-halo { fill: none; stroke: transparent; stroke-width: 10; stroke-linecap: round; }
.pipe-edge-group.selected .pipe-edge-halo { stroke: rgba(0, 113, 227, 0.28); }
.pipe-edge-group.selected .pipe-edge { stroke-width: 3; }
.pipe-edge-group.selected .pipe-edge.cast { stroke-width: 2.2; stroke: light-dark(#8593a8, #a0abbb); }
.pipe-edge-hit { pointer-events: stroke; cursor: pointer; }
.pipe-edge-group:hover .pipe-edge-halo { stroke: rgba(0, 113, 227, 0.14); }
.pipe-date.src-flowly { border-style: solid; }
.pipe-due-src.src-flowly { font-weight: 600; }
.pipe-form { display: flex; flex-direction: column; gap: 10px; padding: 8px 12px 10px; min-width: 260px; }
.pipe-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); }
.pipe-form .input { font-size: 13px; }
.pipe-confirm .pipe-picker-actions { padding: 6px 12px 10px; }
.btn-primary.danger { background: var(--rose); border-color: var(--rose); }
.pipe-minimap .mm-group { fill: rgba(20, 30, 50, 0.05); stroke: rgba(20, 30, 50, 0.12); stroke-width: 0.6; }
.pipe-minimap .mm-group.kind-asset-type { fill: rgba(16, 185, 129, 0.12); } .pipe-minimap .mm-group.kind-shots, .pipe-minimap .mm-group.kind-sequence { fill: rgba(59, 130, 246, 0.1); } .pipe-minimap .mm-group.kind-edits { fill: rgba(99, 102, 241, 0.12); } .pipe-minimap .mm-group.kind-custom { fill: rgba(0, 113, 227, 0.10); }
.pipe-editing-tag { left: 50%; top: 14px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 12px; font-weight: 500; box-shadow: var(--shadow-card); white-space: nowrap; max-width: calc(100% - 28px); overflow: hidden; text-overflow: ellipsis; }
.pipe-editing-tag svg { width: 14px; height: 14px; flex-shrink: 0; }
.pipe-editing-tag .short { display: none; }
@media (max-width: 640px) { .pipe-editing-tag .full { display: none; } .pipe-editing-tag .short { display: inline; } .pipe-editing-tag { left: auto; right: 8px; transform: none; top: 8px; } }
.pipe-empty { left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; padding: 28px 32px; background: light-dark(rgba(255, 255, 255, 0.96), rgba(28, 28, 30, 0.96)); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: var(--shadow-card); cursor: default; }
.pipe-empty h3 { font-size: 16px; font-weight: 600; } .pipe-empty p { font-size: 13px; color: var(--text-2); margin: 6px 0 14px; max-width: 360px; }

.pipe-node.kind-asset .pipe-kind::before, .pipe-node.kind-shot .pipe-kind::before, .pipe-node.kind-edit .pipe-kind::before, .pipe-node.kind-department .pipe-kind::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; background: #8b93a7; }
.pipe-node.kind-asset .pipe-kind::before { background: var(--emerald); } .pipe-node.kind-shot .pipe-kind::before { background: var(--blue-500); } .pipe-node.kind-edit .pipe-kind::before { background: var(--indigo); }

/* sticky notes: Flowly-owned text on the board, no ports, no state */
.pipe-node.pipe-note { width: 200px; }
.pipe-note-card { position: relative; min-height: 96px; padding: 12px 14px 12px; background: light-dark(#fff7c2, #5f571c); border: 1px solid #f1dd7a; border-radius: 4px 4px 12px 4px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06), 0 8px 18px rgba(120, 90, 0, 0.10); transform: rotate(-0.6deg); transition: box-shadow .15s; }
.pipe-node.pipe-note:hover .pipe-note-card { box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08), 0 14px 28px rgba(120, 90, 0, 0.14); }
.pipe-node.pipe-note:focus-visible .pipe-note-card { box-shadow: 0 0 0 2px light-dark(#fff, var(--card)), 0 0 0 5px var(--blue), 0 8px 18px rgba(120, 90, 0, 0.10); }
.pipe-node.pipe-note.placed .pipe-note-card { animation: pipe-placed 1.4s ease-out 2; }
.pipe-note-pin { position: absolute; top: 6px; right: 8px; color: light-dark(#b48a00, #f8da76); opacity: 0.6; }
.pipe-note-pin svg { width: 13px; height: 13px; }
.pipe-note-text { font-size: 13px; line-height: 1.4; color: light-dark(#4a3d00, #fbefb6); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 160px; overflow: hidden; }
.pipe-minimap .mm-node.tone-note { fill: #f1dd7a; }
.pipe-legend .dot.kind-note { background: #f1dd7a; }
.popover.pipe-note-menu { width: 280px; }
.pipe-note-editor { padding: 4px 6px 2px; display: flex; flex-direction: column; gap: 8px; }
.pipe-note-editor textarea { width: 100%; }
.pipe-note-quote { background: light-dark(#fff7c2, #5f571c); border: 1px solid #f1dd7a; border-radius: 8px; padding: 12px 14px; white-space: pre-wrap; color: light-dark(#4a3d00, #fbefb6); }

/* filters popover + inspector */
.popover.pipe-filters { width: 280px; max-height: min(70vh, 560px); overflow-y: auto; }
.pipe-filter { display: flex; align-items: center; gap: 8px; padding: 5px 10px; font-size: 13px; cursor: pointer; }
.pipe-filter-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 8px 6px 2px; }
.pipe-state { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.pipe-state.done { background: var(--emerald-50); color: var(--emerald-700); } .pipe-state.blocked { background: var(--rose-50); color: var(--rose-700); } .pipe-state.ready { background: var(--blue-50); color: var(--blue-700); } .pipe-state.neutral { background: var(--zinc-100); color: var(--text-2); } .pipe-state.warn { background: var(--amber-50); color: var(--amber-700); }
.warn-text { color: var(--amber-700); }
.pipe-deps { display: flex; flex-direction: column; border: 1px solid var(--border-strong); border-radius: 12px; overflow: hidden; }
.pipe-dep { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.pipe-dep:last-child { border-bottom: 0; }
.pipe-dep-icon { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--zinc-100); color: var(--text-2); }
.pipe-dep-icon svg { width: 13px; height: 13px; }
.pipe-dep.ok .pipe-dep-icon { background: var(--emerald); color: #fff; } .pipe-dep.waiting .pipe-dep-icon { background: var(--rose); color: #fff; } .pipe-dep.ready .pipe-dep-icon { background: var(--blue); color: #fff; }
.pipe-dep-name { flex: 1; min-width: 0; display: flex; flex-direction: column; color: inherit; }
.pipe-dep-name .n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .pipe-dep-name .s { font-size: 11px; color: var(--text-2); }
.pipe-dep .icon-btn.sm { width: 26px; height: 26px; } .pipe-dep .icon-btn.sm svg { width: 15px; height: 15px; }
.pipe-deplabel.state-waiting { background: var(--zinc-100); color: var(--text-2); border-color: var(--zinc-200); } .pipe-deplabel.state-done { background: var(--emerald-50); color: var(--emerald-700); } .pipe-deplabel.state-prerequisites-met { background: var(--blue-50); color: var(--blue-700); }
.pipe-adddep { display: flex; gap: 8px; margin-top: 10px; } .pipe-adddep select { flex: 1; min-width: 0; }
.pipe-noteform { display: flex; flex-direction: column; gap: 8px; } .pipe-noteform .two { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; } .pipe-noteform label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-2); }
.pipe-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pipe-actions .btn.danger { color: var(--rose-700); margin-left: auto; }
.pipe-gate-hero { display: flex; align-items: center; justify-content: center; gap: 10px; height: 120px; border-radius: 14px; background: light-dark(#f1f3f7, #22262e); color: var(--text-2); font-size: 13px; }
.pipe-gate-hero svg { width: 28px; height: 28px; }
.pipe-pick { display: flex; flex-direction: column; max-height: 200px; overflow-y: auto; border: 1px solid var(--border-strong); border-radius: 10px; }
.pipe-pick-item { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; font-size: 13px; text-align: left; border-bottom: 1px solid var(--border); }
.pipe-pick-item:last-child { border-bottom: 0; } .pipe-pick-item:hover { background: light-dark(#fbfbfc, #1e1e20); } .pipe-pick-item.active { background: var(--blue-soft); color: var(--blue-700); }
.pipe-pick-item .n { font-weight: 500; } .pipe-pick-item .s { color: var(--text-2); font-size: 12px; }
.pipe-pick .small { padding: 10px 12px; }
.modal.modal-wide { width: min(560px, 100%); }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 900px) { .pipe-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) {
  /* Tablet (≤ 1100 px, the same fold as the casting library): the Node Library is a right-hand panel; the canvas keeps most of the height. */
  .pipe-lib-toggle { display: inline-flex; } .pipe-lib-close { display: inline-flex; } .pipe-lib-collapse { display: none; }
  .pipe-lib { position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(440px, 100%); border-radius: 0; display: flex; flex-direction: column; overflow: auto; padding: max(6px, var(--safe-top)) max(0px, var(--safe-right)) max(12px, var(--safe-bottom)) 0; transform: translateX(100%); transition: transform .25s cubic-bezier(.2, .8, .2, 1); visibility: hidden; }
  .pipe-lib.panel-open { transform: translateX(0); visibility: visible; }
  .pipe-lib-scrim { display: block; position: fixed; inset: 0; z-index: 60; background: light-dark(rgba(0, 0, 0, 0.28), rgba(255, 255, 255, 0.24)); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .pipe-screen.lib-open .pipe-lib-scrim { opacity: 1; pointer-events: auto; }
  .pipe-lib-row { flex-wrap: wrap; overflow: visible; scroll-snap-type: none; }
  .pipe-lib-card { width: calc(50% - 5px); }
  .pipe-lib-hint { display: none; }
  .pipe-canvas { height: max(480px, calc(100dvh - 250px)); }
  .pipe-selbar { max-width: calc(100% - 16px); bottom: 8px; }
}
@media (max-width: 640px) {
  .pipe-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Phone: compact toolbar (search row + icon row), the library as a bottom sheet, the canvas nearly all of the rest. */
  .pipe-toolbar { gap: 8px; } .pipe-toolbar-left { display: contents; } .pipe-search { width: 100%; flex-basis: 100%; }
  .pipe-toolbar-right { margin-left: 0; flex: 1 1 auto; justify-content: flex-end; flex-wrap: nowrap; gap: 6px; }
  .pipe-zoomctl { height: 36px; } .pipe-zoomctl .pipe-tbtn { width: 30px; height: 30px; } .pipe-zoom { min-width: 40px; font-size: 12px; }
  .pipe-toolbar-right .btn span { display: none; } .pipe-toolbar-right .btn { padding: 0 10px; }
  .pipe-canvas { height: max(420px, calc(100dvh - 230px)); border-radius: 12px; }
  .pipe-legend { display: none; } .pipe-editing-tag { font-size: 11px; } .pipe-minimap { width: 104px; height: 66px; left: 8px; bottom: 60px; } /* above the selection bar */
  .pipe-lib { top: auto; left: 0; right: 0; width: 100%; height: min(78dvh, 640px); border-radius: 18px 18px 0 0; transform: translateY(100%); }
  .pipe-lib.panel-open { transform: translateY(0); }
  .pipe-lib-card { width: calc(50% - 5px); }
  .pipe-selbar { bottom: 8px; padding: 4px; gap: 2px; } .pipe-selbar .btn span { display: none; } .pipe-selbar .btn { padding: 0 9px; } .pipe-selbar-name { max-width: 120px; font-size: 12px; }
  .pipe-linkbar { top: 8px; font-size: 11px; }
}
/* Coarse pointers: ports and handles you can actually hit; the selection bar's buttons grow. */
@media (pointer: coarse) {
  .pipe-port { width: 20px; height: 20px; }
  .pipe-group-resize { width: 28px; height: 28px; }
  .pipe-selbar .btn, .pipe-linkbar .btn { height: 38px; }
  .pipe-zoomctl { height: 44px; } .pipe-zoomctl .pipe-tbtn { width: 38px; height: 38px; }
  .pipe-lib-switch button { padding-block: 9px; }
}

/* ---------- Pipeline: node library + placement picker ---------- */
.pipe-lib { background: var(--card); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: var(--shadow-card); }
.pipe-lib-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 16px; }
.pipe-lib-title { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.pipe-lib-title strong { font-size: 14px; }
.pipe-lib-kindtag { display: none; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-700); }
.pipe-lib.collapsed .pipe-lib-kindtag { display: inline-flex; }
.pipe-lib.collapsed .pipe-lib-hint { display: none; }
.pipe-lib-hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipe-lib-body { padding: 0 16px 14px; }
.pipe-lib-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pipe-lib-switch { display: inline-flex; gap: 2px; padding: 3px; background: var(--pill-bg); border-radius: 10px; }
.pipe-lib-switch button { padding: 6px 16px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.pipe-lib-switch button:hover { color: var(--text); }
.pipe-lib-switch button.active { background: var(--blue); color: #fff; box-shadow: 0 1px 3px rgba(0, 113, 227, 0.3); }
.pipe-lib-search { width: min(100%, 260px); height: 36px; }
.pipe-lib-filterwrap:empty { display: none; }
.pipe-lib-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.pipe-lib-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 500; color: var(--text-2); background: var(--zinc-100); transition: background .12s, color .12s; }
.pipe-lib-chip:hover { color: var(--text); }
.pipe-lib-chip.active { background: var(--blue-soft); color: var(--blue-700); }
.pipe-lib-chip .n { font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 999px; background: light-dark(rgba(0, 0, 0, 0.06), rgba(255, 255, 255, 0.11)); }
.pipe-lib-chip.active .n { background: rgba(0, 113, 227, 0.15); }
.pipe-lib-row { display: flex; gap: 10px; overflow-x: auto; padding: 12px 2px 6px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.pipe-lib-row > [role="listitem"] { flex-shrink: 0; scroll-snap-align: start; }
.pipe-lib-card { position: relative; display: flex; flex-direction: column; width: 168px; padding: 6px 6px 8px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--card); text-align: left; cursor: grab; transition: box-shadow .15s, transform .15s, border-color .15s; }
.pipe-lib-card:hover { box-shadow: var(--shadow-card-hover); border-color: rgba(0, 113, 227, 0.35); }
.pipe-lib-card:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.pipe-lib-card:active, .pipe-lib-card.dragging { cursor: grabbing; transform: scale(0.98); opacity: 0.85; }
.pipe-lib-thumb { width: 100%; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: var(--zinc-100); }
.pipe-lib-thumb .art { border-radius: 0; height: 100%; aspect-ratio: auto; }
.pipe-lib-thumb img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.pipe-lib-thumb .fallback { padding: 0; gap: 0; }
.pipe-lib-thumb .fallback span:not(.initials) { display: none; }
.pipe-lib-thumb.gate { display: flex; align-items: center; justify-content: center; color: #8b93a7; background: light-dark(#f1f3f7, #22262e); }
.pipe-lib-thumb.gate svg { width: 26px; height: 26px; }
.pipe-lib-text { display: flex; flex-direction: column; gap: 1px; padding: 8px 4px 0; min-width: 0; }
.pipe-lib-text .n { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipe-lib-text .s { font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipe-lib-count { position: absolute; right: 10px; bottom: 10px; height: 20px; padding: 0 8px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-700); font-size: 10px; font-weight: 600; display: inline-flex; align-items: center; }
.pipe-lib-empty { padding: 8px 4px; }
.pipe-canvas.dropping { box-shadow: inset 0 0 0 2px var(--blue); }
.pipe-node.candidate { opacity: 0.85; pointer-events: none; }
.pipe-node.candidate .pipe-node-card { border-style: dashed; border-color: var(--blue); }
@keyframes pipe-placed { 0% { box-shadow: 0 0 0 0 rgba(0, 113, 227, 0.55); } 70% { box-shadow: 0 0 0 14px rgba(0, 113, 227, 0); } 100% { box-shadow: 0 0 0 0 rgba(0, 113, 227, 0); } }
.pipe-node.placed .pipe-node-card { animation: pipe-placed 1.4s ease-out 2; }
.pipe-picker { width: 300px; background: var(--card); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 12px; cursor: default; z-index: 4; }
.pipe-picker-title { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.pipe-picker-title strong { font-size: 13px; }
.pipe-picker-opts { display: flex; flex-direction: column; max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.pipe-picker-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 13px; cursor: pointer; }
.pipe-picker-opt:last-child { border-bottom: 0; }
.pipe-picker-opt:hover { background: light-dark(#fbfbfc, #1e1e20); }
.pipe-picker-opt .l { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pipe-picker-opt .n { font-weight: 500; }
.pipe-picker-opt .s { font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipe-picker-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.pipe-picker-dup { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: var(--amber-50); border: 1px solid rgba(253, 230, 138, 0.9); color: var(--amber-700); font-size: 12px; display: flex; flex-direction: column; gap: 6px; }
.pipe-picker-dup[hidden], .pipe-lib-body[hidden] { display: none; }
.actions-inline { display: flex; gap: 6px; flex-wrap: wrap; }
.pipe-picker-form { display: flex; flex-direction: column; gap: 10px; }
.pipe-picker-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); }
.pipe-empty.light { background: transparent; border: 0; box-shadow: none; color: var(--text-2); pointer-events: none; }
.pipe-empty.light > svg { width: 28px; height: 28px; color: var(--text-3); }
.pipe-empty.light h3 { color: var(--text); }
.pipe-empty.light .btn { pointer-events: auto; }
@media (max-width: 640px) { .pipe-lib-search { width: 100%; } .pipe-picker { width: min(300px, calc(100% - 16px)); } .pipe-lib-hint { display: none; } }

/* ---------- Casting board ---------- */
/* Board + Asset Library: the board takes the workspace, the library is a bounded sticky column (--side-panel: 300–420 px).
   ≤ 1100 px the library folds into a slide-in panel (a bottom sheet ≤ 640 px) behind the "Asset Library" button. */
.cast-screen { display: grid; grid-template-columns: minmax(0, 1fr) var(--side-panel); gap: var(--gap-lg); align-items: start; }
.cast-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.cast-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cast-head-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.cast-lead { margin: 0; color: var(--text-2); font-size: 14px; }
.cast-for { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; } /* Breakdown's "For:" scope, drawn as Flowly chips */
.cast-for-label { font-size: 12px; color: var(--text-3); margin-right: 4px; }
.cast-lib-toggle { display: none; } /* only when the library is a panel (≤ 1100 px) */
.cast-lib-toggle .n { font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 999px; background: var(--blue); color: #fff; }
.cast-lib-close { display: none; margin-left: auto; }
.cast-scrim { display: none; }
.cast-count { font-size: 13px; color: var(--text-2); display: inline-flex; gap: 10px; align-items: center; }
/* Tap-to-cast: the armed asset, sticky above the rows; rows announce themselves as targets. */
.cast-armed { position: sticky; top: calc(var(--header-h) + 8px); z-index: 5; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px 8px 8px; border-radius: 12px; background: var(--blue); color: #fff; box-shadow: var(--shadow-pop); }
.cast-armed .small.muted { color: rgba(255, 255, 255, 0.85); }
.cast-armed-thumb { width: 36px; flex-shrink: 0; } .cast-armed-thumb .art { width: 36px; height: 36px; aspect-ratio: 1; border-radius: 8px; }
.cast-armed-text { flex: 1 1 160px; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.cast-armed .btn-ghost { background: rgba(255, 255, 255, 0.16); color: #fff; } .cast-armed .btn-ghost:hover { background: rgba(255, 255, 255, 0.26); }
.cast-armed .btn-primary { background: var(--card); color: var(--blue-700); }
.cast-shot.armed-target { cursor: pointer; box-shadow: inset 0 0 0 1.5px rgba(0, 113, 227, 0.35); }
.cast-shot.armed-target:hover { background: rgba(0, 113, 227, 0.06); box-shadow: inset 0 0 0 2px var(--blue); }
.cast-shot.armed-dup { box-shadow: inset 0 0 0 1.5px rgba(245, 158, 11, 0.35); }
.cast-shot.armed-invalid { opacity: 0.6; }
.cast-tap { flex-shrink: 0; align-self: flex-start; }
.cast-tap-done { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--amber-700); padding-top: 6px; }
.cast-tap-done svg { width: 14px; height: 14px; }
.cast-shot > .cast-add-row { display: none; } /* the phone card's single "+ Add asset" (shown ≤ 640 px) */
.cast-board { display: flex; flex-direction: column; gap: 16px; }
.cast-seq { background: var(--card); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: var(--shadow-card); overflow: clip; }
.cast-seq-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.cast-seq-head h3 { margin: 0; font-size: 15px; }
.cast-seq-head .btn { margin-left: auto; }
.cast-rows { display: flex; flex-direction: column; }
.cast-shot { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); position: relative; transition: background .12s, box-shadow .12s; }
.cast-shot:last-child { border-bottom: 0; }
.cast-shot.selected { background: rgba(0, 113, 227, 0.045); box-shadow: inset 3px 0 0 var(--blue); }
.cast-shot.canceled { opacity: 0.7; }
.cast-shot.busy { opacity: 0.85; }
/* Drop feedback: the whole row is the target (Flowly blue); the asset's own lane gets the stronger ring; a duplicate says so in amber. */
.cast-shot.drop { background: rgba(0, 113, 227, 0.07); box-shadow: inset 0 0 0 2px var(--blue); }
.cast-shot.drop-dup { background: rgba(245, 158, 11, 0.08); box-shadow: inset 0 0 0 2px var(--amber); }
.cast-shot.drop-invalid { background: rgba(225, 29, 72, 0.06); box-shadow: inset 0 0 0 2px var(--rose); } /* an asset dropped onto itself (For: Assets) */
.cast-lane.drop-lane { box-shadow: 0 0 0 2px var(--blue), 0 0 0 6px rgba(0, 113, 227, 0.18); background: rgba(0, 113, 227, 0.08); }
.cast-shot-meta { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.cast-shot-meta .cast-shot-text { flex: 1; }
.cast-select { display: flex; align-items: center; padding-top: 4px; }
.cast-select input { width: 16px; height: 16px; accent-color: var(--blue); cursor: pointer; }
.cast-shot-thumb { width: 96px; flex-shrink: 0; }
.cast-shot-thumb .art { aspect-ratio: 16 / 9; border-radius: 8px; }
.cast-shot-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; }
.cast-shot-text .cast-shot-code { flex-basis: 100%; }
.cast-shot-code { font-weight: 600; font-size: 14px; color: var(--text); }
.cast-shot-code:hover { color: var(--blue); }
.cast-shot-sub { font-size: 12px; color: var(--text-2); }
.cast-shot-sub.warn { color: var(--amber-700); }
.cast-lanes { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 2px; }
.cast-lane { border: 1px dashed rgba(20, 30, 50, 0.16); border-radius: 12px; padding: 8px 10px; min-height: 64px; background: rgba(240, 243, 248, 0.45); display: flex; flex-direction: column; gap: 6px; transition: box-shadow .12s, background .12s; }
.cast-lane.unknown { border-color: rgba(244, 63, 94, 0.35); }
.cast-lane-head { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.cast-lane-body { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cast-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 3px; background: var(--card); border: 1px solid var(--border-strong); border-radius: 999px; font-size: 12px; font-weight: 500; max-width: 100%; transition: box-shadow .15s; }
.cast-chip-thumb { width: 26px; height: 26px; flex-shrink: 0; }
.cast-chip-thumb .art { width: 26px; height: 26px; aspect-ratio: 1; border-radius: 50%; font-size: 9px; }
.cast-chip-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.cast-chip-n { font-size: 11px; color: var(--blue-700); background: var(--blue-50); border-radius: 999px; padding: 0 6px; }
.cast-chip-tag { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); border: 1px solid var(--border); border-radius: 999px; padding: 0 5px; } /* shared asset of another production (from its Kitsu casting row) */
.cast-episode-mark { aspect-ratio: 16 / 9; border-radius: 8px; background: var(--subtle); color: var(--text-3); display: grid; place-items: center; }
.cast-episode-mark svg { width: 22px; height: 22px; }
.cast-chip-x { display: inline-flex; width: 18px; height: 18px; border-radius: 50%; align-items: center; justify-content: center; color: var(--text-3); }
.cast-chip-x svg { width: 12px; height: 12px; }
.cast-chip-x:hover { background: var(--rose-50); color: var(--rose); }
.cast-chip.pending { opacity: 0.55; border-style: dashed; }
.cast-chip.pending.adding { border-color: var(--blue); }
.cast-chip.flash { animation: cast-flash 1.2s ease-out 2; }
@keyframes cast-flash { 0% { box-shadow: 0 0 0 0 rgba(0, 113, 227, 0.55); } 60% { box-shadow: 0 0 0 6px rgba(0, 113, 227, 0); } 100% { box-shadow: 0 0 0 0 rgba(0, 113, 227, 0); } }
.cast-add { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-3); padding: 4px 8px; border-radius: 999px; border: 1px dashed transparent; }
.cast-add:hover, .cast-add:focus-visible { color: var(--blue); border-color: var(--blue); background: rgba(0, 113, 227, 0.06); }
.cast-add svg { width: 14px; height: 14px; }
.cast-add.compact { padding: 4px; }
.cast-add.compact span { display: none; }
.cast-empty { color: var(--text-3); font-size: 12px; }
.cast-picker .cast-picker-list { max-height: 280px; overflow: auto; padding: 4px; }
.cast-pick-thumb { width: 28px; height: 28px; flex-shrink: 0; }
.cast-pick-thumb .art { width: 28px; height: 28px; aspect-ratio: 1; border-radius: 6px; font-size: 9px; }
.popover .result[disabled] { opacity: 0.5; cursor: default; }
/* Asset library (right column, stays in view while the rows scroll) */
.cast-side { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 24px); }
.cast-lib { background: var(--card); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: var(--shadow-card); padding: 14px; display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow: auto; }
.cast-lib-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.cast-lib .pipe-lib-filters { margin-top: 0; }
.cast-lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.cast-asset { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 6px; border-radius: 10px; border: 1px solid transparent; cursor: grab; outline: none; text-align: left; }
.cast-asset:hover, .cast-asset:focus-visible { border-color: var(--border-strong); background: rgba(0, 113, 227, 0.04); }
.cast-asset:focus-visible { box-shadow: 0 0 0 2px var(--blue); }
.cast-asset.armed { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 0 1px var(--blue); }
.cast-asset-thumb { position: relative; }
.cast-asset-check { position: absolute; left: 4px; top: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
.cast-asset-check svg { width: 12px; height: 12px; }
.cast-asset-more { position: absolute; right: 9px; top: 9px; width: 26px; height: 26px; opacity: 0; transition: opacity .12s; background: light-dark(rgba(255, 255, 255, 0.92), rgba(28, 28, 30, 0.92)); box-shadow: 0 0 0 1px var(--border-strong); }
.cast-asset:hover .cast-asset-more, .cast-asset:focus-within .cast-asset-more, .cast-asset.armed .cast-asset-more { opacity: 1; }
.cast-asset-more svg { width: 15px; height: 15px; }
.cast-asset.dragging { opacity: 0.5; }
.cast-asset[draggable="false"] { cursor: default; }
.cast-asset-thumb .art { aspect-ratio: 16 / 10; border-radius: 8px; }
.cast-asset-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cast-asset-type { font-size: 11px; color: var(--text-3); }
.cast-lib-hint { margin: 0; padding: 0 2px; line-height: 1.4; }
.cast-selected { background: var(--card); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: var(--shadow-card); padding: 14px; display: flex; flex-direction: column; gap: 10px; overflow: auto; }
.cast-selected:empty { display: none; }
.cast-selected-head { display: flex; align-items: center; gap: 10px; }
.cast-selected-head .cast-shot-thumb { width: 72px; }
.cast-selected-head .btn { margin-left: auto; }
/* Wide monitors (≥ 1800 px): a little more air between the rows and the library; lanes keep filling the board. */
@media (min-width: 1800px) { .cast-screen { gap: 28px; } .cast-shot { grid-template-columns: 260px minmax(0, 1fr); } }
/* Tablet (≤ 1100 px): the board takes the full width; the library is a right-hand panel opened from the toolbar. */
@media (max-width: 1100px) {
  .cast-screen { grid-template-columns: 1fr; }
  .cast-lib-toggle { display: inline-flex; }
  .cast-lib-close { display: inline-flex; }
  .cast-side { position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(420px, 100%); max-height: none; padding: max(12px, var(--safe-top)) max(12px, var(--safe-right)) max(12px, var(--safe-bottom)) 12px; background: var(--bg); box-shadow: -8px 0 40px rgba(0, 0, 0, 0.12); transform: translateX(100%); transition: transform .25s cubic-bezier(.2, .8, .2, 1); visibility: hidden; overflow: auto; }
  .cast-side.open { transform: translateX(0); visibility: visible; }
  .cast-scrim { display: block; position: fixed; inset: 0; z-index: 60; background: light-dark(rgba(0, 0, 0, 0.28), rgba(255, 255, 255, 0.24)); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .cast-screen.lib-open .cast-scrim { opacity: 1; pointer-events: auto; }
  .cast-lib { overflow: visible; }
  /* the shot's meta sits above its lanes (which scroll sideways) instead of squeezing beside them */
  .cast-shot { grid-template-columns: 1fr; gap: 8px; } .cast-shot-meta { align-items: center; } .cast-shot-thumb { width: 80px; }
}
/* Phone (≤ 640 px): stacked shot cards — meta on top, lanes as sections (empty ones hidden), one "+ Add asset";
   the library is a bottom sheet with its search, filters and armed asset intact. */
@media (max-width: 640px) {
  .cast-head-tools { margin-left: 0; width: 100%; justify-content: space-between; }
  .cast-lead { display: none; } /* the For switch and the library button say it; the banner explains tap-to-cast when armed */
  .cast-shot { grid-template-columns: 1fr; gap: 8px; padding: 12px; }
  .cast-shot-thumb { width: 72px; }
  .cast-lanes { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: 1fr; overflow: visible; gap: 6px; }
  .cast-lane { flex-direction: row; align-items: flex-start; gap: 8px; padding: 6px 8px; min-height: 0; border-style: solid; }
  .cast-lane-head { flex: 0 0 84px; padding-top: 6px; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cast-lane-body { flex: 1; min-width: 0; }
  .cast-lane.empty { display: none; }
  .cast-lane .cast-add:not(.compact) span { display: none; } .cast-lane .cast-add { padding: 6px; }
  .cast-shot > .cast-add-row { display: inline-flex; justify-self: start; min-height: 36px; border-color: var(--border-strong); background: var(--card); }
  .cast-chip-name { max-width: 34vw; }
  .cast-seq-head { padding: 10px 12px; }
  .cast-armed { top: 6px; border-radius: 10px; }
  .cast-side { top: auto; left: 0; right: 0; width: 100%; height: auto; max-height: min(82dvh, 720px); border-radius: 18px 18px 0 0; transform: translateY(100%); box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.16); padding-bottom: max(16px, var(--safe-bottom)); }
  .cast-lib-head > .small { display: none; } .cast-lib-head strong { font-size: 15px; }
  .cast-side.open { transform: translateY(0); }
  .cast-lib-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .cast-selected { display: none; } /* the selected row is right there on the board */
}
/* Coarse pointers: comfortable targets on the board without changing the desktop drawing. */
@media (pointer: coarse) {
  .cast-select { padding: 6px; margin: -6px; } .cast-select input { width: 22px; height: 22px; }
  .cast-chip { padding: 5px 8px 5px 4px; min-height: 36px; }
  .cast-chip-x { width: 28px; height: 28px; margin: -4px -4px -4px 0; } .cast-chip-x svg { width: 14px; height: 14px; }
  .cast-add { min-height: 36px; }
  .cast-asset { padding: 8px; } .cast-asset-more { opacity: 1; width: 30px; height: 30px; right: 11px; top: 11px; }
  .pipe-lib-chip { height: 36px; padding-inline: 14px; }
  .cast-lib-toggle, .toolbar-toggle { height: 36px; }
}

/* ---------- Schedule workspace: one tab, three lenses (Calendar / Timeline / Agenda) ---------- */
:root {
  --tl-line: rgb(var(--ink-rgb) / 0.10);
  --tl-weekend: rgb(var(--ink-rgb) / 0.025);
  --tl-row: rgb(var(--ink-rgb) / 0.045);
  --tl-label-w: 210px;
  --tl-row-h: 40px;
}
.sched-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: -8px; }
/* Visually secondary to the production tabs: smaller, lighter, same blue "selected" language. */
.sched-views { display: inline-flex; padding: 3px; background: var(--subtle); border: 1px solid var(--border-strong); border-radius: 10px; gap: 2px; }
.sched-views a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 7px; font-size: 12.5px; font-weight: 500; color: var(--text-2); white-space: nowrap; transition: color .15s, background .15s; }
.sched-views a svg { width: 14px; height: 14px; }
.sched-views a:hover { color: var(--text); }
.sched-views a.active { background: var(--blue); color: #fff; box-shadow: 0 1px 2px rgba(0, 113, 227, 0.3); }
.sched-source { display: inline-flex; align-items: center; gap: 8px; }
@media (pointer: coarse) { .sched-views a { padding-block: 9px; } }
@media (max-width: 640px) { .sched-head { gap: 8px; } .sched-views { width: 100%; } .sched-views a { flex: 1; justify-content: center; padding-inline: 6px; } .sched-source { width: 100%; } .sched-source .select-compact { flex: 1; min-width: 0; } }

/* ---- Timeline (Gantt) ---- */
.tl-toolbar .tl-ctl { display: inline-flex; align-items: center; gap: 6px; }
.tl-toolbar .tl-ctl > .small { white-space: nowrap; }
.tl-fit { white-space: nowrap; }
.tl-fit svg { width: 14px; height: 14px; }
.cal-title .tl-year { font-weight: 400; color: var(--text-2); font-size: 15px; }
.tl-card { padding: 0; overflow: clip; } /* clip, not hidden: hidden would make it a scroll box and stop the sticky header */
/* Full height: the page scrolls the rows, never a box inside the card (Felix, 2026-11-12). Only a window wider
   than the card pans sideways in here; a stretched one (.fits) has no box at all, so its date header sticks to
   the top of the page while the rows scroll under it. */
.tl-scroll { overflow-x: auto; overflow-y: hidden; }
.tl-scroll.fits { overflow: visible; }
.tl-scroll:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
/* The chart column never shrinks below the window's width; on a wide monitor it stretches, so the row rules reach the edge of the card. */
.tl-grid { display: grid; grid-template-columns: var(--tl-label-w) minmax(var(--tl-canvas), 1fr); width: max-content; min-width: 100%; position: relative; }
.tl-corner, .tl-rowlabel { position: sticky; left: 0; z-index: 3; background: var(--card); border-right: 1px solid var(--border-strong); }
.tl-corner { grid-area: 1 / 1; z-index: 5; top: 0; display: flex; align-items: flex-end; padding: 8px 12px; height: 54px; border-bottom: 1px solid var(--border-strong); }
.tl-axis { grid-area: 1 / 2; position: sticky; top: 0; z-index: 4; background: var(--card); height: 54px; border-bottom: 1px solid var(--border-strong); }
.tl-months, .tl-ticks { position: relative; height: 27px; }
.tl-month, .tl-tick { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; border-left: 1px solid var(--tl-line); padding-left: 6px; }
.tl-tick { overflow: hidden; }
/* The month name follows its own band while the chart is panned, so you always know where you are. */
.tl-month span { position: sticky; left: calc(var(--tl-label-w) + 8px); /* clear of the sticky row-label column */ display: inline-block; font-size: 10.5px; font-weight: 600; letter-spacing: .06em; color: var(--text-2); text-transform: uppercase; white-space: nowrap; }
.tl-tick { border-left-color: light-dark(rgba(0, 0, 0, 0.05), rgba(255, 255, 255, 0.1)); justify-content: center; padding-left: 0; }
.tl-tick span { font-size: 10.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tl-tick.weekend { background: var(--tl-weekend); }
/* Weekend bands (every 7 days from the window's first Saturday) and month boundaries, behind every row. */
/* Both overlays are absolutely positioned, NOT grid items: they must span every row without
   taking part in auto-placement (and `grid-row: 1 / -1` cannot span implicit rows). */
.tl-bands, .tl-todayline { position: absolute; top: 54px; bottom: 0; left: var(--tl-label-w); width: var(--tl-canvas); pointer-events: none; }
.tl-bands { z-index: 0;
  background-image: var(--tl-months), repeating-linear-gradient(to right, var(--tl-weekend) 0 calc(2 * var(--d)), transparent calc(2 * var(--d)) calc(7 * var(--d)));
  background-position: 0 0, var(--tl-weekend-x) 0; background-repeat: no-repeat, repeat-x;
  background-size: auto, calc(7 * var(--d)) 100%; /* one week per tile, so every tile is in phase */ }
.tl-todayline { z-index: 2; }
.tl-todayline::before { content: ""; position: absolute; top: 0; bottom: 0; left: var(--x); width: 2px; background: var(--cal-today); opacity: .85; }
/* The "Today" flag rides in the sticky date header, so it never hides a bar. */
.tl-todaymark { position: absolute; top: 5px; left: var(--x); transform: translateX(-50%); z-index: 1; font-size: 10px; font-weight: 600; color: #fff; background: var(--cal-today); border-radius: 4px; padding: 1px 6px; white-space: nowrap; }
.tl-rowlabel { display: flex; align-items: center; gap: 7px; min-height: var(--tl-row-h); padding: 4px 10px 4px 26px; font-size: 12.5px; border-bottom: 1px solid var(--tl-row); text-align: left; }
.tl-rowlabel.group { padding-left: 8px; font-size: 13px; font-weight: 600; background: var(--card); cursor: pointer; }
.tl-rowlabel.group:hover { background: var(--subtle); }
.tl-rowlabel .chev { width: 14px; height: 14px; color: var(--text-2); flex-shrink: 0; }
.tl-rowlabel .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-rowlabel .t { flex: 0 1 auto; min-width: 2em; }
.tl-rowlabel .s { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 4 auto; } /* the grey folder gives way before the name */
.tl-rowlabel .n { margin-left: auto; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tl-swatch { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex-shrink: 0; }
.tl-track { position: relative; grid-column: 2; min-height: var(--tl-row-h); height: calc(6px + var(--lanes, 1) * 34px); border-bottom: 1px solid var(--tl-row); z-index: 1; }
.tl-track.slim { background: transparent; }
.tl-bar { position: absolute; height: 26px; margin-top: 7px; border-radius: 8px; display: flex; align-items: center; gap: 6px; padding: 0 10px; background: var(--cal-span); color: #fff; font-size: 11px; font-weight: 500; overflow: hidden; white-space: nowrap; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.14); }
.tl-bar:hover { filter: brightness(1.12); z-index: 2; }
.tl-bar.tinted { background: var(--ev-dark); }
.tl-bar .lbl { overflow: hidden; text-overflow: ellipsis; }
.tl-bar .st { margin-left: auto; font-family: var(--mono); font-size: 9.5px; opacity: .85; flex-shrink: 0; }
.tl-bar.clip-start { border-top-left-radius: 1px; border-bottom-left-radius: 1px; }
.tl-bar.clip-end { border-top-right-radius: 1px; border-bottom-right-radius: 1px; }
/* Deadline / start markers: a date, not a duration — never drawn as a bar with invented length. */
.tl-bar.marker { border-radius: 3px; padding: 0; box-shadow: 0 0 0 1px light-dark(rgba(255, 255, 255, .7), rgba(28, 28, 30, 0.7)), 0 1px 2px rgba(0, 0, 0, .2); }
.tl-bar.marker.kind-deadline { background: var(--cal-deadline); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); box-shadow: none; }
.tl-bar.marker.kind-deadline.tinted { background: var(--ev-dark); }
.tl-bar.marker.kind-start { background: var(--cal-span); clip-path: polygon(0 0, 100% 50%, 0 100%); box-shadow: none; }
.tl-bar.marker.kind-start.tinted { background: var(--ev-dark); }
.tl-bar.marker.kind-deadline, .tl-bar.marker.kind-start { height: 12px; margin-top: 14px; }
/* a deadline is a dot (Felix, 2026-11-12), with a white ring so it reads on the today line and on bands */
.tl-bar.marker.kind-deadline { clip-path: none; border-radius: 50%; box-shadow: 0 0 0 2px light-dark(#fff, var(--card)), 0 1px 3px rgba(0, 0, 0, .25); }
/* Schedule slots look like the month grid's slot bars: their own colour, the name centred */
.tl-bar.slot { background: var(--ev, var(--cal-span)); justify-content: center; font-weight: 600; font-size: 12px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
.tl-bar.slot:hover { background: var(--ev-dark, var(--cal-span)); filter: none; }
.tl-bar.marker.kind-deadline.slot { background: var(--cal-deadline); }
/* a slot's name beside its bar / deadline diamond when it does not fit inside */
.tl-out { position: absolute; height: 26px; margin-top: 7px; display: flex; align-items: center; font-size: 12px; font-weight: 600; color: var(--ev-dark, var(--text)); white-space: nowrap; z-index: 1; text-decoration: none; cursor: pointer; }
.tl-out:hover { text-decoration: underline; }
.tl-anchor { position: absolute; top: 0; bottom: 0; width: 0; pointer-events: none; } /* where a right-click's pop-up opens */
.tl-out.deadline { color: var(--cal-deadline); }
.tl-bar.prod-wide { outline: 1px dashed rgba(255, 255, 255, 0.75); outline-offset: -3px; }
.tl-notes { display: flex; gap: 14px; flex-wrap: wrap; margin-top: -14px; }
.tl-notes .warn-text { color: var(--amber-700); }
@media (min-width: 1440px) { :root { --tl-label-w: 250px; } }
@media (max-width: 1024px) { :root { --tl-label-w: 168px; } .tl-rowlabel { font-size: 12px; padding-left: 20px; } }
@media (max-width: 640px) { :root { --tl-label-w: 128px; } .tl-rowlabel .n { display: none; } .tl-toolbar .tl-ctl { flex: 1 1 calc(50% - 8px); } .tl-toolbar .tl-ctl > .select-compact { flex: 1; min-width: 0; } }

/* ---- Agenda: the same events, chronologically; a first-class view at every width ---- */
.ag-sub { margin-left: 10px; }
.ag-list { padding: 4px 0; }
.ag-group + .ag-group { border-top: 1px solid light-dark(rgba(236, 236, 238, 1), #2a2a2e); }
.ag-head { display: flex; align-items: baseline; gap: 10px; padding: 14px 18px 8px; }
.ag-head h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.ag-head .s { font-size: 12px; color: var(--text-2); }
.ag-head .n { margin-left: auto; font-size: 12px; color: var(--text-3); }
.ag-group.today .ag-head h3 { color: var(--cal-today); }
.ag-items { display: flex; flex-direction: column; }
.ag-item { display: grid; grid-template-columns: 12px minmax(90px, 1.3fr) minmax(70px, .9fr) minmax(90px, 1.2fr) auto minmax(86px, auto) 16px; align-items: center; gap: 12px; padding: 9px 18px; border-top: 1px solid rgba(240, 240, 242, .9); font-size: 13px; min-height: 44px; }
.ag-item:hover { background: light-dark(#fbfbfc, #1e1e20); }
.ag-item .cal-dot { width: 9px; height: 9px; border-radius: 50%; }
.ag-item.tinted .cal-dot { background: var(--ev); }
.ag-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-type, .ag-ctx { color: var(--text-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-when { font-size: 12px; color: var(--text-2); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ag-when.due { color: var(--rose-700); font-weight: 600; }
.ag-chev { width: 16px; height: 16px; color: var(--text-3); }
.ag-item.prod-wide .cal-dot { outline: 2px dashed var(--text-3); outline-offset: 1px; }
@media (max-width: 900px) { .ag-item { grid-template-columns: 12px minmax(80px, 1.4fr) minmax(64px, 1fr) auto minmax(78px, auto) 16px; } .ag-ctx { display: none; } }
@media (max-width: 640px) {
  .ag-head { padding: 12px 14px 6px; }
  .ag-item { grid-template-columns: 10px minmax(0, 1fr) auto; grid-template-areas: "dot name pill" "dot meta when"; gap: 2px 10px; padding: 10px 14px; }
  .ag-item .cal-dot { grid-area: dot; align-self: start; margin-top: 5px; }
  .ag-name { grid-area: name; } .ag-type { grid-area: meta; } .ag-when { grid-area: when; } .ag-item .pill { grid-area: pill; justify-self: end; }
  .ag-ctx, .ag-chev { display: none; }
}

/* ---------- Schedule editing (ADR-0027): add, drag, resize, edit, undo, export ---------- */
.sched-head-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.sched-export svg { width: 15px; height: 15px; }
.sched-hint { margin-top: -8px; }
.seg-mini { display: inline-flex; padding: 2px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--subtle); gap: 2px; }
.seg-mini button { height: 24px; padding: 0 10px; border-radius: 6px; font-size: 12px; font-weight: 500; color: var(--text-2); }
.seg-mini button.active { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); }

/* drag handles: the ends of a bar change one date, the body moves both */
.editable { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.editable:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.editable.dragging { cursor: grabbing; opacity: .85; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); z-index: 5; }
.editable.saving { opacity: .6; pointer-events: none; animation: sched-pulse 1s ease-in-out infinite alternate; }
@keyframes sched-pulse { from { opacity: .45; } to { opacity: .8; } }
body.sched-dragging, body.sched-dragging * { cursor: grabbing !important; }
.cal-bar, .cal-pill { position: relative; }
.edge { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; z-index: 1; }
.edge.l { left: 0; } .edge.r { right: 0; }
.edge::after { content: ""; position: absolute; top: 25%; bottom: 25%; width: 2px; border-radius: 2px; background: light-dark(rgba(255, 255, 255, 0.85), rgba(28, 28, 30, 0.85)); opacity: 0; transition: opacity .12s; }
.edge.l::after { left: 2px; } .edge.r::after { right: 2px; }
.editable:hover .edge::after, .editable:focus-visible .edge::after, .editable.dragging .edge::after { opacity: 1; }
@media (pointer: coarse) { .edge { width: 16px; } .edge::after { opacity: .8; } }
.drag-tip { position: fixed; z-index: 95; pointer-events: none; background: rgba(29, 29, 31, 0.92); color: #fff; font-size: 12px; font-weight: 500; padding: 5px 10px; border-radius: 8px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2); white-space: nowrap; }

/* empty space → add */
.cal-day.can-add { cursor: copy; }
.cal-day.pick { background: color-mix(in srgb, var(--blue) 12%, var(--card)); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--blue) 45%, light-dark(white, var(--card))); }
.cal-weeks.can-pick, .tl-track.can-add { -webkit-user-select: none; user-select: none; } /* dragging across days draws a range, never selects text */
/* Flowly schedule slots: a solid bar in the slot's own colour, its name centred (the studio's schedule slides) */
.cal-bar.slot { background: var(--ev); justify-content: center; font-weight: 600; }
.cal-bar.slot:hover { background: var(--ev-dark); }
.cal-bar.slot .meta { position: absolute; right: 12px; font-family: inherit; font-weight: 500; }
.cal-bar.ghost { pointer-events: none; background: color-mix(in srgb, var(--blue) 80%, var(--card)); color: #fff; justify-content: center; font-weight: 600; outline: 2px dashed rgba(255, 255, 255, 0.7); outline-offset: -4px; }
/* the pop-up after a drag: Flowly's .form, compact */
.popover.slot-popover { padding: 14px; }
.slot-pop { width: 300px; margin-top: 0; gap: 12px; }
.slot-pop-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 13px; }
.slot-pop-head span { font-size: 12px; color: var(--text-2); }
.form .field { display: flex; flex-direction: column; gap: 6px; }
.form .field-label { font-size: 12px; font-weight: 500; color: var(--text-2); }
.slot-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.slot-swatches button { width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--sw); cursor: pointer; padding: 0; transition: transform .12s; }
.slot-swatches button:hover { transform: scale(1.1); }
.slot-swatches button[aria-checked="true"] { box-shadow: 0 0 0 2px light-dark(#fff, var(--card)), 0 0 0 4px var(--sw); }
/* the slot drawer */
.slot-swatch { color: #fff; }
.slot-sub { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.slot-sub .drawer-sub { margin-top: 0; }
.slot-cast .row-item { padding: 10px 12px; }
.slot-cast .row-item .pill { margin-left: auto; }
.slot-cast .slot-uncast { flex-shrink: 0; }
.slot-form { margin-top: 0; }
.slot-form .actions { justify-content: space-between; }
.slot-delete { color: var(--rose-700); }
.popover.slot-picker { width: 320px; padding: 8px; }
.slot-pick-search { width: 100%; height: 36px; margin-bottom: 6px; }
.slot-pick-list { max-height: 320px; overflow-y: auto; }
.slot-pick-empty { padding: 8px 10px; margin: 0; }
.cal-add { width: 22px; height: 22px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: var(--blue); opacity: 0; transition: opacity .12s, background .12s; margin-left: auto; }
.cal-add svg { width: 15px; height: 15px; }
.cal-day:hover .cal-add, .cal-add:focus-visible { opacity: 1; }
.cal-add:hover { background: color-mix(in srgb, var(--blue) 12%, var(--card)); }
@media (pointer: coarse) { .cal-add { opacity: .7; width: 32px; height: 32px; } }
.cal-day-head { gap: 6px; }
.cal-weeks.week-mode .cal-day { min-height: 420px; }
.tl-track.can-add { cursor: copy; }
.tl-pick { position: absolute; top: 3px; bottom: 3px; border-radius: 5px; background: color-mix(in srgb, var(--blue) 18%, transparent); border: 1.5px dashed var(--blue); pointer-events: none; }
.ag-head .ag-add { margin-left: 8px; display: inline-flex; align-items: center; gap: 2px; font-size: 12px; }
.ag-head .ag-add svg { width: 13px; height: 13px; }
.ag-group.drop { background: color-mix(in srgb, var(--blue) 7%, var(--card)); box-shadow: inset 3px 0 0 var(--blue); }
.unsched-cta { color: var(--blue); font-weight: 500; margin-left: auto; margin-right: 10px; }

/* dialog + editor */
.modal.sched-modal { width: min(520px, 100%); }
.sched-form .field { display: flex; flex-direction: column; gap: 5px; }
.sched-form .field-label { font-size: 12px; font-weight: 500; color: var(--text-2); }
.sched-form input[type="date"] { font: inherit; font-size: 13px; height: 36px; padding: 0 10px; border: 1px solid light-dark(rgba(0, 0, 0, 0.12), rgba(255, 255, 255, 0.2)); border-radius: 8px; background: var(--card); width: 100%; color: var(--text); }
.sched-form input[type="date"]:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.2); outline: none; }
.assignee-list { display: flex; flex-direction: column; gap: 6px; }
.assignee-row { display: flex; align-items: center; gap: 6px; }
.assignee-row .icon-btn svg { width: 16px; height: 16px; }
.add-person { align-self: flex-start; font-size: 12px; }
.check-row { flex-direction: row !important; align-items: center; gap: 8px !important; color: var(--text) !important; font-size: 13px !important; }
.sched-editor { margin-top: 4px; }
.drawer-sub { font-size: 13px; font-weight: 600; margin-top: 8px; }
.sched-note { padding: 10px 12px; background: var(--subtle); border-radius: 8px; }

/* toast: tones and an action (Undo) */
.toast { display: inline-flex; align-items: center; gap: 12px; }
.toast.has-action { pointer-events: auto; padding-right: 6px; }
.toast.tone-ok .toast-msg::before { content: "✓ "; color: #6ee7b7; font-weight: 700; }
.toast.tone-error { background: rgba(159, 18, 57, 0.95); }
.toast.tone-busy .toast-msg::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border: 2px solid rgba(255, 255, 255, .5); border-top-color: var(--card); border-radius: 50%; animation: sched-spin .8s linear infinite; vertical-align: -1px; }
@keyframes sched-spin { to { transform: rotate(360deg); } }
.toast-action { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 12px; font-weight: 600; }
.toast-action:hover { background: rgba(255, 255, 255, 0.28); }
.toast-action svg { width: 13px; height: 13px; }

/* Export PDF — client view (only exists while printing) */
.print-sheet { display: none; }
@media print {
  @page { size: landscape; margin: 12mm; }
  body.printing > *:not(.print-sheet) { display: none !important; }
  body.printing { background: #fff; }
  body.printing .print-sheet { display: block; font-family: var(--font, Inter, sans-serif); color: #1d1d1f; }
}
.ps-head h1 { font-size: 20px; font-weight: 600; margin: 0; }
.ps-head p { margin: 2px 0 0; font-size: 12px; color: light-dark(#555, #bfbfbf); }
.ps-head .ps-gen { color: light-dark(#888, #999999); }
.ps-chart { margin-top: 14px; border-top: 1px solid light-dark(#ddd, #3b3b3b); }
.ps-axis, .ps-row { display: grid; grid-template-columns: 170px 1fr; }
.ps-axis { height: 34px; border-bottom: 1px solid light-dark(#ddd, #3b3b3b); }
.ps-label { font-size: 10.5px; padding: 3px 6px 3px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-track { position: relative; border-left: 1px solid light-dark(#ddd, #3b3b3b); }
.ps-month { position: absolute; top: 0; height: 16px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding-left: 4px; border-left: 1px solid light-dark(#ccc, #4a4a4a); overflow: hidden; white-space: nowrap; }
.ps-tick { position: absolute; top: 18px; font-size: 9px; color: light-dark(#888, #999999); padding-left: 2px; border-left: 1px solid light-dark(#eee, #2b2b2b); height: 14px; }
.ps-group { font-size: 11px; font-weight: 700; padding: 8px 0 3px; border-bottom: 1px solid light-dark(#eee, #2b2b2b); break-after: avoid; }
.ps-row { min-height: 18px; border-bottom: 1px solid light-dark(#f2f2f2, #282828); break-inside: avoid; }
.ps-bar { position: absolute; top: 3px; height: 12px; border-radius: 3px; background: #6c9ce3; color: #fff; font-size: 8.5px; line-height: 12px; padding: 0 4px; overflow: hidden; white-space: nowrap; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.ps-bar.marker { width: 10px; padding: 0; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.ps-bar.marker span { display: none; }
.ps-foot { margin-top: 10px; font-size: 10px; color: light-dark(#888, #999999); }

/* Flowly-owned production (created in Flowly, not in Kitsu) */
.pill.prod-flowly-tag { --c: var(--blue-700); --bg: var(--blue-50); --bd: var(--blue-200); }
.home-head .btn-primary { flex: none; }

/* Studio menu (Flow brand, top left) and studio pages */
.brand { padding: 4px; border-radius: 10px; }
button.brand { background: none; border: 0; padding: 4px 6px 4px 0; cursor: pointer; font: inherit; font-weight: 700; font-size: 18px; border-radius: 10px; }
.studio-eyebrow { font-size: 12px !important; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); margin: 0 0 2px !important; }

/* Production cards: big cover, title, three pills (end date · type · status) */
.prod-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 18px; }
.prod-card { padding: 10px; }
.prod-card .art { margin-bottom: 12px; }
.prod-card .body { padding: 0 4px 4px; justify-content: flex-start; gap: 8px; }
.prod-card h2 { font-size: 16px; line-height: 1.3; }
.prod-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.prod-pills:empty { display: none; }
.prod-card .prod-resume { align-self: flex-start; margin-top: 2px; }
.prod-status-btn { position: relative; z-index: 1; cursor: pointer; font-size: 11px; font-weight: 500; line-height: 1; } /* looks exactly like the other status pills; only it opens a menu */
.prod-status-btn:hover { box-shadow: none; } .prod-status-btn:active { transform: none; }
.pill.prod-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.tone-blue    { --c: var(--blue-700);    --bg: var(--blue-50);    --bd: var(--blue-200); }
.tone-indigo  { --c: var(--indigo-700);  --bg: var(--indigo-50);  --bd: var(--indigo-200); }
.tone-emerald { --c: var(--emerald-700); --bg: var(--emerald-50); --bd: var(--emerald-200); }
.tone-amber   { --c: var(--amber-700);   --bg: var(--amber-50);   --bd: var(--amber-200); }
.tone-rose    { --c: var(--rose-700);    --bg: var(--rose-50);    --bd: var(--rose-200); }
.tone-teal    { --c: var(--teal-700);    --bg: var(--teal-50);    --bd: var(--teal-200); }
.tone-zinc    { --c: var(--zinc-500);    --bg: var(--zinc-100);   --bd: var(--zinc-200); }

/* New production modal — quiet: a big name field, pill choices, three small fields */
.modal.np-modal { width: min(480px, 100%); padding: 28px; }
.np-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.np-head h2 { font-size: 20px; }
.np-form { display: flex; flex-direction: column; gap: 22px; margin-top: 20px; }
.np-title { width: 100%; border: 0; border-bottom: 1px solid var(--border-strong); border-radius: 0; padding: 6px 0 10px; font: inherit; font-size: 22px; font-weight: 600; letter-spacing: -0.015em; color: var(--text); background: transparent; height: auto; box-shadow: none; }
.np-title:focus { border-bottom-color: var(--blue); box-shadow: none; outline: none; }
.np-title::placeholder { color: var(--text-3); font-weight: 500; }
.np-section { display: flex; flex-direction: column; gap: 10px; }
.np-label, .np-field > span { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.np-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.np-chip { position: relative; cursor: pointer; }
.np-chip input { position: absolute; opacity: 0; pointer-events: none; }
.np-chip span { display: inline-flex; align-items: center; height: 30px; padding: 0 13px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--text-2); background: light-dark(rgba(0, 0, 0, 0.04), rgba(255, 255, 255, 0.08)); border: 1px solid transparent; transition: background .15s, color .15s, border-color .15s; }
.np-chip:hover span { background: light-dark(rgba(0, 0, 0, 0.07), rgba(255, 255, 255, 0.13)); color: var(--text); }
.np-chip input:checked + span { color: var(--c); background: var(--bg); border-color: var(--bd); }
.np-chip input:focus-visible + span { box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.25); }
.np-custom { align-self: flex-start; width: 220px; }
.np-custom[hidden], .np-desc[hidden], .np-more[hidden] { display: none; }
.np-row { display: grid; grid-template-columns: 0.7fr 1fr 1fr; gap: 12px; }
.np-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.np-field input, .np-custom { font: inherit; font-size: 14px; height: 38px; padding: 0 12px; border: 1px solid light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.17)); border-radius: 10px; background: var(--card); color: var(--text); width: 100%; }
.np-field input:focus, .np-custom:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.2); outline: none; }
.np-more { align-self: flex-start; margin-top: -8px; }
.np-actions { display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 480px) { .np-row { grid-template-columns: 1fr 1fr; } .np-row .np-field:first-child { grid-column: 1 / -1; } .modal.np-modal { padding: 22px 18px calc(22px + var(--safe-bottom)); } }
.np-cover { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; max-height: 220px; border-radius: 14px; overflow: hidden; background: light-dark(rgba(0, 0, 0, 0.03), rgba(255, 255, 255, 0.07)); border: 1.5px dashed light-dark(rgba(0, 0, 0, 0.14), rgba(255, 255, 255, 0.23)); cursor: pointer; transition: border-color .15s, background .15s; }
.np-cover:hover, .np-cover.over { border-color: var(--blue); background: var(--blue-soft); }
.np-cover:has(img) { border-style: solid; border-color: transparent; }
.np-cover.busy { opacity: .6; pointer-events: none; }
.np-cover img { width: 100%; height: 100%; object-fit: cover; }
.np-cover-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--text-2); font-size: 14px; font-weight: 500; }
.np-cover-empty svg { width: 26px; height: 26px; opacity: .55; margin-bottom: 4px; }
.np-cover-empty small { font-size: 12px; font-weight: 400; color: var(--text-3); }
.np-cover-actions { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 6px; opacity: 0; transition: opacity .15s; }
.np-cover:hover .np-cover-actions, .np-cover:focus-visible .np-cover-actions { opacity: 1; }
.np-cover-btn { font-size: 12px; font-weight: 500; color: #fff; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(8px); padding: 5px 10px; border-radius: 999px; }
/* FPS / Start / End: one per row, label left, field right */
.np-rows { display: flex; flex-direction: column; gap: 10px; }
.np-rows .np-field { flex-direction: row; align-items: center; gap: 16px; }
.np-rows .np-field > span { flex: 0 0 120px; }
.np-rows .np-field > span em { font-style: normal; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text-3); opacity: .8; margin-left: 2px; }
.np-rows .np-field input { flex: 1; }
.np-rows .np-field input[type="number"] { flex: 0 0 120px; }
@media (max-width: 480px) { .np-rows .np-field > span { flex-basis: 96px; } }

/* ---------- Studio sidebar (Kitsu-style; app/shell.js mountSidebar / setSidebar) ----------
   Below the top bar (the bar and the logo never move). Docked from 1100 px when open; a slide-over below.
   The slide itself is a Web Animation in shell.js; CSS only holds the resting states. */
:root { --side-w: 232px; --bar-h: 56px; }
.app-side { position: fixed; top: calc(var(--bar-h) + var(--safe-top)); left: 0; bottom: 0; width: var(--side-w); z-index: 38; display: flex; flex-direction: column;
  background: var(--bg-home); border-right: 1px solid var(--border-strong); padding-left: var(--safe-left);
  transform: translateX(-100%); visibility: hidden; will-change: transform; }
body.side-open .app-side { transform: none; visibility: visible; }
body.page-login .app-side, body.page-login .side-scrim { display: none; }
.side-scroll { flex: 1; overflow-y: auto; padding: 8px 10px 16px; overscroll-behavior: contain; }
.side-title { font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); padding: 16px 10px 6px; }
.side-title:first-child { padding-top: 8px; }
.side-link { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 8px; font-size: 13.5px; font-weight: 500; color: var(--text); transition: background .12s; }
.side-link svg { width: 17px; height: 17px; color: var(--text-2); flex: none; }
.side-link:hover { background: light-dark(rgba(0, 0, 0, 0.045), rgba(255, 255, 255, 0.09)); }
.side-link.active { background: var(--blue-soft); color: light-dark(#0b5cb8, #6cadf6); }
.side-link.active svg { color: var(--blue); }
.side-foot { flex: none; padding: 8px 10px calc(10px + var(--safe-bottom)); border-top: 1px solid var(--border); }
.side-scrim { position: fixed; inset: calc(var(--bar-h) + var(--safe-top)) 0 0 0; z-index: 37; background: light-dark(rgba(0, 0, 0, 0.18), rgba(255, 255, 255, 0.24)); opacity: 0; visibility: hidden; }
body.side-anim #app { overflow-x: clip; } /* the gliding content may overshoot the right edge for 280 ms */
/* the right edge you drag to resize (wide screens); narrow enough, the menu becomes icons only (body.side-rail) */
.side-grip { position: absolute; top: 0; bottom: 0; right: -4px; width: 8px; z-index: 2; cursor: col-resize; touch-action: none; display: none; }
.side-grip::after { content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px; background: transparent; transition: background .15s; }
.side-grip:hover::after, body.side-resizing .side-grip::after { background: var(--blue); }
body.side-resizing, body.side-resizing * { cursor: col-resize !important; user-select: none; }
body.side-resizing #app > main, body.side-resizing #app > .app-footer { transition: none !important; }
@media (min-width: 1100px) {
  body.side-rail .side-scroll { padding: 8px 8px 16px; }
  body.side-rail .side-title { height: 1px; padding: 0; margin: 10px 8px; font-size: 0; background: var(--border); }
  body.side-rail .side-title:first-child { margin-top: 4px; background: transparent; }
  body.side-rail .side-link { justify-content: center; padding: 0; gap: 0; }
  body.side-rail .side-link span { display: none; }
  body.side-rail .side-foot { padding-left: 8px; padding-right: 8px; }
}
@media (max-width: 1099.98px) { .app-side { width: 232px; } } /* the slide-over keeps its own width */
@media (min-width: 1100px) {
  .side-grip { display: block; }
  .side-scrim { display: none; }
  body.side-open #app > main, body.side-open #app > .app-footer { margin-left: var(--side-w); }
}
@media (max-width: 1099.98px) {
  .app-side { box-shadow: 12px 0 40px rgba(0, 0, 0, 0.12); z-index: 39; }
  body.side-open .side-scrim { opacity: 1; visibility: visible; }
}
.app-header .header-tools { margin-left: auto; } /* stays right when the brand moves into the docked sidebar */
/* keyboard focus in menus (↑ / ↓): the focused option is highlighted like a hover */
.popover .menu-item:focus-visible, .popover .menu-item:focus { outline: none; background: rgba(0, 113, 227, 0.1); }

/* ---------- date picker (ui/date-pick.js): one pill, Flowly's own month calendar in a popover ---------- */
.dtp-btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 9px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--card); color: var(--text); font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: border-color .15s, box-shadow .15s; }
.dtp-btn:hover { border-color: light-dark(rgba(0, 0, 0, 0.18), rgba(255, 255, 255, 0.24)); box-shadow: var(--shadow-card); }
.dtp-btn:focus-visible { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15); }
.dtp-btn svg { width: 14px; height: 14px; color: var(--text-2); flex: none; }
.dtp-btn .chev { width: 12px; height: 12px; margin-left: -1px; }
.dtp-btn.empty { color: var(--text-2); }
.popover.dtp-pop { padding: 12px; width: 268px; }
.dtp-head { display: flex; align-items: center; gap: 2px; margin-bottom: 8px; }
.dtp-title { flex: 1; font-size: 14px; font-weight: 600; padding-left: 4px; }
.dtp-nav svg { width: 16px; height: 16px; }
.dtp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dtp-wd { font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); text-align: center; padding: 4px 0; }
.dtp-day { height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; cursor: pointer; transition: background .12s; }
.dtp-day:hover { background: var(--blue-50, #eef5fe); }
.dtp-day.we { color: var(--text-2); }
.dtp-day.out { color: var(--text-3); }
.dtp-day.today { box-shadow: inset 0 0 0 1.5px var(--blue); color: var(--blue); font-weight: 600; }
.dtp-day.on { background: var(--blue); color: #fff; font-weight: 600; box-shadow: none; }
.dtp-quicks { display: flex; flex-wrap: nowrap; gap: 6px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.dtp-quicks .dtp-quick { flex: 1; }
.dtp-foot { display: flex; justify-content: flex-end; margin-top: 8px; }
.dtp-quick, .dtp-clear { white-space: nowrap; height: 26px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--card); font: inherit; font-size: 12px; font-weight: 500; color: var(--text); cursor: pointer; }
.dtp-quick:hover { border-color: var(--blue); color: var(--blue); }
.dtp-clear { border-color: transparent; color: var(--text-2); }
.dtp-clear:hover { color: var(--rose-700); }

/* Flowly task type (data/curbstomp-schedule.js FLOWLY_TASK_TYPES): a pill in the type's colour + a menu with each colour */
.tt-pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px 0 9px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--tt) 35%, var(--card)); background: color-mix(in srgb, var(--tt) 12%, var(--card)); color: color-mix(in srgb, var(--tt) 75%, light-dark(black, #f5f5f5)); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.tt-pill:hover { border-color: var(--tt); }
.tt-pill .chev { width: 12px; height: 12px; opacity: .6; }
.tt-pill.none { background: var(--card); border-color: var(--border-strong); color: var(--text-2); font-weight: 500; }
.tt-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.tt-dot.none { box-shadow: inset 0 0 0 1.5px var(--text-3); }
.popover.tt-menu { min-width: 220px; }

/* ---------- Production → People (features/production-people.js) ---------- */
.prp-sec { margin-top: 8px; }
.prp-sec + .prp-sec { margin-top: 24px; }
.prp-h { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--text-2, #3a3a3c); text-transform: none; }
.prp-n { font-weight: 500; color: var(--text-3); }
.prp-via { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; color: var(--text-3); background: var(--zinc-100, #f4f4f5); }
.prp-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px 8px 0; }
.prp-tab { height: 32px; border: 1px solid var(--border, #e5e5ea); border-radius: 9px; background: transparent; font: inherit; font-size: 13px; font-weight: 500; color: var(--text-3); cursor: pointer; }
.prp-tab:hover { background: var(--zinc-100, #f4f4f5); }
.prp-tab.on { background: var(--blue-50, #eaf2fe); border-color: color-mix(in srgb, var(--accent, #0a6cf0) 35%, var(--card)); color: var(--accent, #0a6cf0); }
.prp-pick-sub { font-size: 12px; color: var(--text-3); }
.prp-list { display: flex; flex-direction: column; background: var(--surface, #fff); border: 1px solid var(--border, #e5e5ea); border-radius: 14px; overflow: hidden; }
.prp-row { display: grid; grid-template-columns: 34px minmax(160px, 1fr) 2fr 32px; align-items: center; gap: 14px; padding: 10px 14px; }
.prp-row + .prp-row { border-top: 1px solid var(--border, #e5e5ea); }
.prp-who { display: flex; flex-direction: column; min-width: 0; }
.prp-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prp-role { font-size: 12px; color: var(--text-3); }
.prp-depts { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.prp-remove { opacity: 0; transition: opacity .12s; }
.prp-row:hover .prp-remove, .prp-remove:focus-visible { opacity: 1; }
@media (hover: none) { .prp-remove { opacity: 1; } }
.prp-pop { padding: 0; }
.prp-picker { width: 320px; display: flex; flex-direction: column; }
.prp-pick-field { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border, #e5e5ea); color: var(--text-3); }
.prp-pick-field svg { width: 15px; height: 15px; flex: none; }
.prp-pick-search { flex: 1; min-width: 0; border: 0; outline: 0; box-shadow: none; padding: 0; height: auto; background: transparent; font: inherit; color: var(--text-1, inherit); }
.prp-pick-search:focus, .prp-pick-search:focus-visible { outline: 0; box-shadow: none; border: 0; }
.prp-pick-list { max-height: 340px; overflow-y: auto; padding: 6px; }
.prp-pick { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 0; border-radius: 8px; background: transparent; font: inherit; text-align: left; cursor: pointer; }
.prp-pick:hover, .prp-pick:focus-visible { background: var(--zinc-100, #f4f4f5); outline: 0; }
.prp-pick:disabled { opacity: .5; }
.prp-pick-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prp-pick-dept { display: flex; gap: 4px; }
.prp-pick-dept .pp-dept { height: 20px; font-size: 11px; padding: 0 7px; }
.prp-pick-none { padding: 14px; text-align: center; color: var(--text-3); font-size: 13px; }
/* /link — approve a program's sign-in (features/device-link.js) */
.dl { max-width: 560px; padding-top: 40px; }
.dl-card { padding: 24px; }
.dl-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.dl-head > svg { width: 28px; height: 28px; color: var(--blue, #0071e3); flex: none; margin-top: 2px; }
.dl-head h1 { margin: 0; font-size: 20px; }
.dl-head p { margin: 4px 0 0; color: var(--text-2); font-size: 13px; }
.dl-entry { display: flex; gap: 8px; }
.dl-code { flex: 1; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 10px; font: 600 18px ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase; }
.dl-code:focus { outline: none; border-color: var(--blue, #0071e3); box-shadow: 0 0 0 3px rgba(0,113,227,.12); }
.dl-ask p { margin: 0 0 8px; font-size: 14px; }
.dl-hint { font: 600 22px ui-monospace, monospace; letter-spacing: .12em; text-align: center; margin: 6px 0 4px !important; }
.dl-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.dl-err { color: light-dark(#c62828, #df6161); font-size: 13px; margin: 0 0 10px; }
.dl-done { text-align: center; padding: 10px 0; }
.dl-done > svg { width: 36px; height: 36px; color: light-dark(#1e9e57, #81e7ae); }
.dl-done h2 { margin: 8px 0 4px; font-size: 18px; }
.dl-done p { margin: 0; color: var(--text-2); font-size: 13px; }
.dl-mine { margin-top: 28px; }
.dl-mine h2 { font-size: 14px; margin: 0 0 10px; }
.dl-dev { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); margin-bottom: 6px; }
.dl-dev > svg { width: 18px; height: 18px; color: var(--text-2); }
.dl-dev-t { flex: 1; display: flex; flex-direction: column; }
.dl-dev-t span { font-size: 12px; color: var(--text-3, #86868b); }
.dl-none { color: var(--text-3, #86868b); font-size: 13px; }

/* Light · Dark · System (ui/theme.js): the account menu and Settings › Interface */
.theme-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 3px; margin: 2px 4px 4px; border-radius: 9px; background: var(--subtle); border: 1px solid var(--border); min-width: 228px; }
.theme-seg button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 28px; padding: 0 8px; border: 0; border-radius: 7px; background: transparent; color: var(--text-2); font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; }
.theme-seg button svg { width: 14px; height: 14px; }
.theme-seg button:hover { color: var(--text); }
.theme-seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.st-row-control .theme-seg { margin: 0; }
.app-update { white-space: nowrap; }
