/* Theia dashboard styles. Text sizes: 14px for what people read (table cells,
   messages, inputs), 13px for labels (headers, hints, sub-lines), 11–12px only for badges and codes.
   Sections: tokens · layout (app, sidebar, page) · cards and text · controls · pills and notices ·
   tables (creators, posts, jobs) · dialogs · errors · sign in · responsive.
   Every width-dependent rule is in the responsive section at the end, so it reads top to bottom. */

/* ---- tokens and base ---- */
:root {
  /* a cool neutral system with one violet accent: a pale frame (sidebar and page edges) holding one white sheet */
  --frame: #F7F7F8; --bg: #FFFFFF; --side: #F7F7F8; --card: #FFFFFF; --soft: #F7F7F8; --track: #ECECEE;
  --line: #E9E9EC; --line-2: #DCDCE0; --ink: #1B1B1F; --ink-2: #4A4A52; --ink-3: #4A4A52; --muted: #6B6B76;
  --accent: #5B3FD6; --accent-dk: #4A31B3; --accent-bg: #F1EEFD; --green: #23733A;
  --good-bg: #E3F4E6; --good: #23733A; --warn-bg: #FDF1DC; --warn: #985B06;
  --bad-bg: #FCE8EB; --bad: #B22A43; --info-bg: #E8F0FE; --info: #2756B8; --chip: #F0F0F2;
  --hover: #F4F4F5; --active: #ECECEE; --accent-fg: #FFFFFF; --r: 6px; --r-sheet: 12px;
  --float-shadow: 0 12px 32px rgba(20, 20, 40, .14), 0 0 0 1px rgba(20, 20, 40, .05);
  --serif: Inter, system-ui, sans-serif; --sans: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif; --mono: 'IBM Plex Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--frame); color: var(--ink); font-family: var(--sans); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); } a:hover { color: var(--accent-dk); }
code, .code { font-family: var(--mono); font-size: 12px; }

/* Scrollbars: slim, in the theme's warm greys (Windows and "always show scrollbars" macOS
   show them all the time; macOS overlay bars barely change). Not hidden: on the creators
   table, the bar is one of the cues that there are more columns to scroll to. */
html { scrollbar-width: thin; scrollbar-color: var(--line-2) var(--frame); }
.table-scroll { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.table-scroll:hover { scrollbar-color: #C4C4CC transparent; }
@supports not (scrollbar-color: auto) {  /* Safari */
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: transparent; }
  .table-scroll::-webkit-scrollbar-track { margin: 0 14px; }  /* clear of the card's rounded corners */
  ::-webkit-scrollbar-thumb { background: var(--line-2) padding-box; border: 3px solid transparent; border-radius: 10px; }
  ::-webkit-scrollbar-thumb:hover { background-color: #C4C4CC; }
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- layout: app and sidebar ---- */
.app { display: flex; min-height: 100vh; }
aside { width: 232px; flex-shrink: 0; background: var(--side); padding: 14px 10px 14px 12px;
        display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh;
        transition: margin-left .28s ease, visibility 0s linear 0s; }
.aside-top { position: relative; }
.brand { padding: 4px 8px; min-width: 0; } .brand b { display: block; font-weight: 600; font-size: 16px; line-height: 1.2; letter-spacing: -.01em; }
.brand span { font-size: 12px; color: var(--muted); }
.env-badge { display: inline-block; margin-top: 8px; padding: 2px 8px; border-radius: 5px; background: var(--warn-bg);  /* staging */
             color: var(--warn); font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; }
.aside-actions { position: absolute; top: 0; right: 0; display: flex; gap: 4px; }  /* lock + hide sidebar */
.brand b { padding-right: 72px; }  /* room for them */
.lock { margin: 0; display: flex; }
.aside-actions .icon-btn { width: 32px; height: 32px; background: transparent; }
.aside-actions .icon-btn .icon { width: 16px; height: 16px; }
.sidebar-open { position: fixed; top: 20px; left: 16px; z-index: 5; opacity: 0; visibility: hidden; pointer-events: none;
                transition: opacity .2s ease; }  /* shown when the sidebar is hidden (see responsive) */
nav { display: flex; flex-direction: column; gap: 2px; }
nav a { display: flex; gap: 9px; align-items: center; min-height: 32px; padding: 0 8px; border-radius: var(--r); color: var(--ink-2); text-decoration: none; }
nav a span { display: none; }  /* the 01-07 numbers: noise */
nav a.on { background: var(--active); color: var(--ink); font-weight: 500; }
nav a:hover:not(.on) { background: var(--hover); color: var(--ink); }
.nav-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent-bg);
             color: var(--accent); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.online { display: flex; align-items: center; gap: 8px; margin: -8px 0 0; padding: 0 8px; font-size: 12px; color: var(--muted); }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.run { margin-top: auto; padding: 10px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font-size: 12px; line-height: 1.5; color: var(--ink-3); }
.run b { font-weight: 600; }
.run > * { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }  /* one line each */
.run.paused { border-color: #F2C5CC; background: #FDF3F5; }
.run.paused code { color: var(--bad); }

/* ---- layout: the page ---- */
main { flex-grow: 1; min-width: 0; margin: 8px 8px 8px 0; padding: 28px 36px 56px; display: flex; flex-direction: column; gap: 20px;
       background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sheet); min-height: calc(100vh - 16px);
       transition: padding-left .28s ease; }
main > *, .card { min-width: 0; }  /* let cards shrink, so wide tables scroll instead of widening the page */
header.page { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.header-actions { display: flex; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.eyebrow { font-size: 12.5px; color: var(--muted); }
h1 { margin: 4px 0; font-weight: 600; font-size: 24px; line-height: 1.2; letter-spacing: -.015em; }
.question { font-size: 14px; color: var(--muted); }
h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.005em; }

/* ---- cards and text ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px 20px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.card.flush .card-head { padding: 14px 16px 0; }
.card-head h2 { display: inline-flex; align-items: center; gap: 8px; }
.card-head:has(h2 .count) { align-items: center; }
.head-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.card-note { margin: -4px 18px 12px; font-size: 13px; color: var(--muted); line-height: 1.5; }
/* Jobs: the database backup line, at the top of the card (the plain note's negative margin pulled it into the card's edge) */
.card-note.backup { margin: 0; padding: 14px 18px 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.card-note.backup b { font-weight: 500; color: var(--ink-3); }
.card-note.backup .detail { overflow-wrap: anywhere; }
.card-foot { margin: 12px 0 0; }
.count { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; background: var(--chip);
         color: var(--ink-3); font-size: 12px; font-weight: 500; line-height: 1; }
.hint { font-size: 13px; color: var(--muted); }
.sub { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.empty { padding: 28px 18px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.err { color: var(--bad); font-size: 13px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.tile { background: var(--soft); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.tile .l { font-size: 12.5px; color: var(--muted); } .tile .v { font-size: 18px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat-tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.card.schedule { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; padding: 16px 24px; }
.card.schedule h2 { display: flex; align-items: center; gap: 10px; }
.card.schedule p { margin: 6px 0 0; font-size: 14px; color: var(--ink-3); }

/* ---- controls: forms, buttons, icons ---- */
form.inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  height: 32px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r); font: inherit; font-size: 14px; background: var(--bg); color: var(--ink); }
textarea { height: auto; min-height: 80px; padding: 8px 10px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type=checkbox]:focus { outline: none; }  /* a click shouldn't leave a ring; the keyboard still gets one */
input[type=checkbox]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.btn { height: 30px; padding: 0 12px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); border-radius: var(--r); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn.dark { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.dark:hover { background: var(--accent-dk); border-color: var(--accent-dk); }
.btn.small { height: 26px; padding: 0 9px; font-size: 12.5px; }
.btn:hover { background: var(--hover); border-color: var(--line-2); }
.btn.busy { gap: 8px; cursor: progress; opacity: .85; }
.btn .icon { width: 15px; height: 15px; margin-right: 6px; }
.link-btn { padding: 0; border: 0; background: none; font: inherit; color: var(--accent); text-decoration: none; cursor: pointer; } .link-btn:hover { text-decoration: underline; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; padding: 0;
            border: 1px solid transparent; border-radius: var(--r); background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon-btn.busy { cursor: progress; color: var(--muted); }
.icon-btn .spinner { width: 14px; height: 14px; }
.spinner { width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
           display: inline-block; flex-shrink: 0; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pending-stage { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-3); }
.pending-stage.waiting { color: var(--muted); } .pending-stage.waiting .spinner { display: none; }  /* queued, not running */

/* ---- pills, chips and notices ---- */
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 5px; font-size: 12.5px; font-weight: 500; white-space: nowrap; background: var(--chip); color: var(--ink-3); }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.bad { background: var(--bad-bg); color: var(--bad); } .pill.info { background: var(--info-bg); color: var(--info); }
.flash { padding: 10px 14px; border-radius: var(--r); font-size: 14px; } .flash.ok { background: var(--good-bg); color: var(--good); } .flash.error { background: var(--bad-bg); color: var(--bad); }
#toasts { position: fixed; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 10; max-width: 420px; }
#toasts .flash { box-shadow: var(--float-shadow); }
.toast-code { display: block; margin-top: 4px; font-family: var(--mono); font-size: 11px; opacity: .85; }
.toast-meaning { display: block; margin-top: 2px; font-size: 13px; }

/* ---- tables ---- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--muted); background: var(--bg); padding: 9px 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover td { background: var(--hover); }
th:first-child, td:first-child { padding-left: 18px; } th:last-child, td:last-child { padding-right: 18px; }
td.num, th.num { text-align: right; }
tr.pending td { color: var(--muted); background: var(--soft); }
tr[hidden] { display: none !important; }  /* phones lay rows out as grids, which would override [hidden] */
.table-scroll { overflow-x: auto; max-width: 100%; position: relative; }  /* never cut off: scroll inside the card instead */
.who { display: flex; flex-direction: column; gap: 1px; } .who b { font-weight: 500; } .who span { font-size: 13px; color: var(--muted); }
.who a { color: var(--ink); text-decoration: none; } .who a:hover { text-decoration: underline; }

/* Data tables (creators, jobs): every column is as wide as its content, with the same padding,
   so the gap between any two columns is the same (2 × --cell-x). One column (Creator, Result)
   takes the spare width and cuts off with … when there's too little (full value on hover). */
.creators-table, .jobs-table { --cell-x: 14px; }
.creators-table th, .creators-table td, .jobs-table th, .jobs-table td { width: 1%; padding-left: var(--cell-x); padding-right: var(--cell-x); }
.creators-table tr > :first-child, .jobs-table tr > :first-child { padding-left: 18px; }
.creators-table tr > :last-child, .jobs-table tr > :last-child { padding-right: 18px; }

/* creators: many columns, so the table scrolls sideways inside the card when it doesn't fit.
   The tick box and name stay pinned on the left and the refresh button on the right (sticky);
   a soft shadow shows where columns are scrolled underneath (js/creators-table.js sets the classes). When it
   all fits, the spare width goes to the number columns (unsized), not the pinned ones (fixed). */
.creators-table { width: 100%; border-collapse: separate; border-spacing: 0; }  /* separate: borders move with pinned cells */
.creators-table th, .creators-table td { width: auto; }  /* number columns take the spare width; pinned ones are fixed */
.table-frame { --select-w: 38px; --name-w: 200px; --action-w: 68px; }  /* the pinned columns' widths */
.creators-table .cell-select { width: var(--select-w); min-width: var(--select-w); }
.creators-table .cell-creator, .creators-table th.col-creator { width: var(--name-w); min-width: var(--name-w); max-width: var(--name-w); }
.creators-table .cell-action { width: var(--action-w); min-width: var(--action-w); }
.creators-table .cell-select, .creators-table .cell-creator, .creators-table th.col-creator, .creators-table .cell-action {
  position: sticky; z-index: 1; background: var(--card); }
.creators-table .cell-select { left: 0; }
.creators-table .cell-creator, .creators-table th.col-creator { left: var(--select-w); }
.creators-table .cell-action { right: 0; }
.creators-table th.cell-select, .creators-table th.col-creator, .creators-table th.cell-action { background: var(--soft); z-index: 2; }
.creators-table tr.pending td { background: var(--soft); }
/* One shadow down each pinned edge, over the whole table (not per row), shown while columns
   are scrolled underneath. It lives on the frame around the scroller, so it doesn't scroll. */
.table-frame { position: relative; }
.table-frame::before, .table-frame::after { content: ""; position: absolute; top: 0; bottom: var(--scrollbar, 0px); width: 14px; z-index: 3;
  pointer-events: none; opacity: 0; transition: opacity .15s; }
.table-frame::before { left: calc(var(--select-w) + var(--name-w)); background: linear-gradient(to right, rgba(28, 27, 25, .10), transparent); }
.table-frame::after { right: var(--action-w); background: linear-gradient(to left, rgba(28, 27, 25, .10), transparent); }
.table-frame.more-left::before, .table-frame.more-right::after { opacity: 1; }
.table-frame.more-left .cell-creator, .table-frame.more-left th.col-creator { box-shadow: inset -1px 0 var(--track); }  /* hairline edges */
.table-frame.more-right .cell-action { box-shadow: inset 1px 0 var(--track); }
.creators-table th { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-top: 8px; padding-bottom: 8px; }
.creators-table td, .posts-table td { font-variant-numeric: tabular-nums; }
.creators-table td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.creators-table td.num, .posts-table td.num { white-space: nowrap; }
.creators-table .cell-action { text-align: right; white-space: nowrap; }
.creators-table td.cell-action { overflow: visible; padding-right: 18px; }  /* last visible cell (the phone summary follows it) */

/* creators: ticking rows for bulk actions */
.creators-table .cell-select { padding-right: 4px; overflow: visible; cursor: pointer; }  /* room for the focus ring */
.creators-table .cell-select input { width: 16px; height: 16px; margin: 0; display: block; accent-color: var(--ink); cursor: pointer; }
.creators-table tr.is-selected td { background: #F4F1FD; }
.bulk-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.bulk-bar[hidden], .card.selecting .head-actions > .btn { display: none; }
.bulk-count { margin-right: 4px; font-size: 14px; color: var(--ink-3); }
.btn.danger { color: var(--bad); border-color: #F2C5CC; } .btn.danger:hover { border-color: var(--bad); }
.btn.plain { border-color: transparent; background: transparent; color: var(--muted); } .btn.plain:hover { color: var(--ink); }
.creators-table .cell-summary { display: none; }  /* phones only */
.creators-table .who > * { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.creators-table .who .err-pill { display: inline-flex; }
.creators-table .sub { overflow: hidden; text-overflow: ellipsis; }
.creators-table .no-match td { padding: 28px 18px !important; text-align: center !important; color: var(--muted); white-space: normal !important; }
.mobile-sort { display: none; }  /* phones only */

/* sortable headers (Creators, Jobs); the link fills the whole cell, so anywhere in it sorts */
th.sortable { padding: 0; }
th.sortable a { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 3px;
                                padding: 8px var(--cell-x); user-select: none; -webkit-user-select: none; }
th.num.sortable a { justify-content: flex-end; text-align: right; }
th.sortable a:hover, th.sorted a { color: var(--ink); }
th.sortable a:hover { background: var(--track); }
th.sortable a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sort-label { position: relative; }  /* columns fit their header, so no cut-off needed */
th.sortable { overflow: visible; }  /* the arrow hangs into the padding */
.sort-mark { position: absolute; left: 100%; margin-left: 3px; font-size: 11px; opacity: 0; transition: opacity .15s; }  /* shown on hover, or when sorted */
th.num .sort-mark { left: auto; right: 100%; margin: 0 3px 0 0; }
th.sortable a:hover .sort-mark, th.sortable a:focus-visible .sort-mark { opacity: .45; }
th.sorted .sort-mark { opacity: 1; }

/* creators: search box (next to Add creators and Export) */
.table-search { position: relative; display: flex; align-items: center; margin: 0; }
.table-search .icon { position: absolute; left: 10px; width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.table-search input { height: 32px; width: 220px; padding-left: 32px; font-size: 14px; }

/* a creator's posts */
.posts-table .cell-thumb { width: 56px; }
.posts-table .cell-post { white-space: nowrap; }
.posts-table .col-caption { width: 100%; min-width: 180px; }
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; display: block; background: var(--track); }
.caption { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* jobs */
.jobs-table { width: 100%; min-width: 760px; }
.jobs-table th, .jobs-table td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jobs-table .cell-result, .jobs-table .col-result { width: 100%; max-width: 0; min-width: 200px; }  /* the flexible column */
.jobs-table .who { max-width: 260px; }
.jobs-table th { padding-top: 8px; padding-bottom: 8px; }
.jobs-table th.sortable { padding: 0; overflow: visible; }  /* the link carries the padding; the arrow hangs out */
.jobs-table .cell-id { color: var(--muted); font-variant-numeric: tabular-nums; }
.jobs-table .who > * { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jobs-table .cell-action { text-align: right; overflow: visible; }
.jobs-table .err-code { padding: 2px 6px; border-radius: 5px; background: var(--bad-bg); color: var(--bad); font-size: 11px; }
.jobs-table tr.job-done td, .jobs-table tr.job-cancelled td { color: var(--ink-3); }
.jobs-table .pending-stage { max-width: 100%; overflow: hidden; }

/* campaigns: the list and one campaign's videos. Wide screens scroll the table sideways inside the card; phones lay
   each row out as a card (see the phones block below).
   position: relative: the screen-reader-only header cell is absolutely positioned, and without a positioned
   ancestor it escaped this scroller and made the whole page scroll sideways. */
.camp-scroll { overflow-x: auto; max-width: 100%; position: relative; }
.camp-table { --cell-x: 14px; min-width: 760px; }
.camp-table th, .camp-table td { padding-left: var(--cell-x); padding-right: var(--cell-x); white-space: nowrap; font-variant-numeric: tabular-nums; }
.camp-table tr > :first-child { padding-left: 18px; } .camp-table tr > :last-child { padding-right: 18px; }
.camp-table th { padding-top: 8px; padding-bottom: 8px; }
.videos-table { min-width: 980px; }
.camp-table .who a { color: var(--ink); text-decoration: none; } .camp-table .who a:hover { text-decoration: underline; }
.camp-table .dim, .dim { color: var(--muted); }
.sub-inline { font-size: 13px; color: var(--muted); }
.plat { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 18px; padding: 0 5px; border-radius: 5px; background: var(--chip);
        color: var(--ink-3); font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: .03em; vertical-align: 1px; }
.plats { display: inline-flex; gap: 4px; }
.bar { display: flex; align-items: center; gap: 8px; }
.track { width: 70px; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; flex-shrink: 0; }
.track i { display: block; height: 100%; border-radius: 3px; background: var(--green); }
.track.tracking i { background: var(--accent); }
.vid { display: flex; align-items: center; gap: 10px; }
.vid .thumb { width: 36px; height: 44px; flex-shrink: 0; }
.thumb.ph { background: repeating-linear-gradient(135deg, var(--track), var(--track) 6px, #E4E4E8 6px, #E4E4E8 12px); }
.vid .who a { color: var(--accent); }
.cap { display: block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; font-size: 13px; color: var(--muted); }
.actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.actions form { margin: 0; }
.link-form { display: flex; gap: 6px; }
.link-form input { height: 32px; width: 190px; font-size: 13px; }
.pill.warn { background: var(--warn-bg); color: var(--warn); } .pill.accent { background: var(--accent-bg); color: var(--accent); }
.camp-table tr.video-waiting td { background: var(--soft); }
input[type=date] { height: 38px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 8px; font: inherit; font-size: 14px; background: var(--soft); color: var(--ink); }
input[type=date]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
dialog.modal .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
dialog.modal input[type=text], dialog.modal input[type=date] { width: 100%; }
dialog.modal fieldset.platform-pick { margin: 14px 0 0; padding: 0; border: 0; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
dialog.modal fieldset.platform-pick legend { float: left; margin-right: 6px; padding: 0; font-size: 13px; color: var(--ink-3); }
dialog.modal label.check { flex-direction: row; align-items: center; gap: 6px; margin: 0; font-size: 14px; color: var(--ink-2); }
label.check input { accent-color: var(--ink); }

/* New campaign: the Paste a brief / Fill in tabs, and what was read from a brief */
.tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line); margin: 10px 0 4px; }
.tabs button { padding: 7px 0 9px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: transparent;
               font: inherit; font-size: 14px; color: var(--muted); cursor: pointer; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 500; }
.tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[data-pane-body][hidden] { display: none; }
textarea.brief-text { width: 100%; min-height: 200px; margin-top: 4px; font-size: 14px; line-height: 1.5; resize: vertical; }
.brief-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.brief-tools [data-brief-example] { margin-left: auto; font-size: 13px; }
.brief-tools .hint:empty { display: none; }
.btn.listening { border-color: var(--bad); color: var(--bad); }
.btn.listening .icon { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.brief-flags { margin: 12px 0 4px; padding: 10px 14px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); font-size: 13px; line-height: 1.5; }
.brief-flags[hidden] { display: none; }
.brief-flags ul { margin: 6px 0 0; padding-left: 18px; } .brief-flags li { margin: 2px 0; }
.brief-flags .ok { color: var(--good); }
.flagged input, .flagged textarea, .flagged .check { border-color: #E3C77A; }
.flagged > input, .flagged > textarea { background: #FDF8E8; }

/* ---- dialogs (confirmations, Add creators) ---- */
dialog.modal { border: 1px solid var(--line); border-radius: 14px; padding: 24px; max-width: 460px; width: calc(100% - 32px);
               background: var(--card); color: var(--ink); box-shadow: 0 16px 48px rgba(28, 27, 25, .18); }
dialog.modal::backdrop { background: rgba(28, 27, 25, .35); }
dialog.modal h2 { margin: 0 0 10px; font-family: var(--serif); font-weight: 400; font-size: 22px; }
dialog.modal p { margin: 0 0 10px; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
dialog.modal label { display: flex; flex-direction: column; gap: 6px; margin: 14px 0 8px; font-size: 13px; color: var(--ink-3); }
dialog.modal textarea { width: 100%; min-height: 96px; resize: vertical; font-size: 14px; line-height: 1.5; }
dialog.modal .hint { font-size: 13px; color: var(--muted); }
dialog#confirm-dialog .confirm-code code { padding: 3px 8px; border-radius: 6px; background: var(--bad-bg); color: var(--bad); }
dialog#confirm-dialog .confirm-code code:empty { display: none; }
dialog#confirm-dialog [data-field]:empty, dialog#confirm-dialog .confirm-code[hidden] { display: none; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.form-error { padding: 8px 10px; border-radius: 8px; background: var(--bad-bg); color: var(--bad) !important; }

/* ---- errors ---- */
.err-pill { margin-top: 4px; width: fit-content; height: 22px; font-family: var(--mono); font-size: 11px; font-weight: 500; text-decoration: none; }
.error-card { border-color: #F2C5CC; background: #FDF3F5; display: flex; flex-direction: column; gap: 8px; }
.error-card.info { border-color: var(--line); background: var(--card); }
.error-card .error-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.error-card .code { padding: 3px 8px; border-radius: 6px; background: var(--bad-bg); color: var(--bad); }
.error-card.info .code { background: var(--chip); color: var(--ink-3); }
.error-card p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.error-card details { font-size: 13px; color: var(--muted); }
.error-card summary { cursor: pointer; }
.error-card pre { white-space: pre-wrap; word-break: break-word; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 8px 0 0; font-size: 11px; }
.error-list { display: flex; flex-direction: column; }
.error-list article { padding: 16px 0; border-top: 1px solid var(--track); display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; }
.error-list article:target { background: #F4F1FD; }
.error-list h3 { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.error-list p { margin: 0 0 4px; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.pause-note { margin-top: 6px; }

/* ---- team ---- */
.signed-in { margin: -10px 0 0; padding: 0 8px; font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite-form { display: flex; gap: 8px; margin: 0; }
.invite-form input { height: 32px; width: 200px; font-size: 14px; }
.invite-form select { height: 32px; }
.invite-link { border-color: var(--good-bg); display: flex; flex-direction: column; gap: 8px; }
.invite-link p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1 1 auto; min-width: 0; font-family: var(--mono); font-size: 13px; }
.team-list, .activity-list { list-style: none; margin: 0; padding: 0; }
.team-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
                padding: 12px 18px; border-top: 1px solid var(--track); }
.team-list .who b { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.team-list .actions { flex-wrap: wrap; }
.team-list .btn { white-space: nowrap; }
.activity-list li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--track); font-size: 14px; }
.activity-list b { font-weight: 500; }
.activity-list .subject { color: var(--ink-3); overflow-wrap: anywhere; }
.activity-list time { flex-shrink: 0; font-size: 13px; color: var(--muted); }
.activity-list .ip { font-family: var(--mono); font-size: 12px; }
.inline-label { flex-direction: row; align-items: center; gap: 8px; }
.inline-label select { height: 32px; }

/* ---- sign in ---- */
body.locked { overflow: hidden; }
body.locked .app { filter: blur(3px); opacity: .55; pointer-events: none; user-select: none; }
.ghost { display: block; background: var(--track); border-radius: 8px; }
body.locked nav .ghost { height: 14px; margin: 12px; }
body.locked main .ghost.title { width: 260px; height: 40px; }
body.locked .card-ghost { background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.login-backdrop { position: fixed; inset: 0; display: flex; align-items: flex-start; justify-content: center; padding: 16px; overflow-y: auto;
                  background: rgba(28, 27, 25, .28); }
.login-card { width: 100%; max-width: 400px; margin: auto; background: var(--card); border: 1px solid var(--line); border-radius: 16px;
              padding: 32px; box-shadow: 0 20px 60px rgba(28, 27, 25, .2); display: flex; flex-direction: column; gap: 6px; }
.login-card h1 { margin: 4px 0 0; font-size: 30px; }
.login-card p { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.login-card form { display: flex; flex-direction: column; gap: 14px; }
.login-card input[type=password], .login-card input[type=email], .login-card input[type=text] { width: 100%; height: 44px; font-size: 15px; }
.login-card label { font-size: 13px; color: var(--ink-3); }
.login-card fieldset { border: 0; margin: 0; padding: 14px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.login-card fieldset legend { padding: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); float: left; width: 100%; margin-bottom: 2px; }
.login-card fieldset legend + * { clear: both; }
.login-card .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.login-card .hint { margin: -4px 0 0; font-size: 13px; color: var(--muted); }
@media (max-width: 480px) { .login-card { padding: 24px 20px; } .login-card .pair { grid-template-columns: 1fr; } }
.login-card input[aria-invalid=true] { border-color: var(--bad); }
.login-card .btn { height: 44px; justify-content: center; font-size: 14px; }

/* ---- responsive ---- */

/* desktop: the sidebar can slide away */
@media (min-width: 1101px) {
  .app.sidebar-collapsed aside { margin-left: -240px; visibility: hidden;
                                 transition: margin-left .28s ease, visibility 0s linear .28s; }  /* hide after sliding out */
  .app.sidebar-collapsed main { padding-left: 72px; }
  .app.sidebar-collapsed .sidebar-open { opacity: 1; visibility: visible; pointer-events: auto; }
}

/* smaller screens: tables keep even gaps, just narrower ones */
@media (max-width: 1320px) {
  .creators-table, .jobs-table { --cell-x: 10px; }
}

/* small laptops, tablets and phones: the sidebar becomes a slim top bar */
@media (max-width: 1100px) {
  .app { flex-direction: column; }
  aside { position: static; width: auto; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center;
          gap: 8px 16px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .aside-top { display: contents; }  /* top bar: brand, then the menu, then the lock at the end */
  .aside-actions { position: static; order: 3; margin: 0; }
  .online { order: 2; margin: 0 0 0 auto; padding: 0; }  /* top bar: before the lock, pushed right */
  .signed-in { display: none; }  /* no room in the top bar; the lock button's tooltip and the Team page say who */
  .brand b { padding-right: 0; }
  .sidebar-open, .sidebar-close { display: none; }
  .brand { padding: 0; flex: 1 1 auto; }
  .brand b { font-size: 18px; }
  .brand > span:not(.env-badge) { display: none; }
  .env-badge { margin: 0 0 0 8px; vertical-align: 3px; }
  nav { flex-direction: row; gap: 4px; }
  nav a { min-height: 36px; }
  .run { margin: 0; flex: 1 1 100%; padding: 8px 12px; order: 4; }  /* its own row, below the lock too */
  .run > * { display: inline; }  /* a slim strip in the top bar: one row, parts separated by dots */
  .run > * + *::before { content: " · "; color: var(--muted); }
  main { padding: 20px 16px 48px; gap: 16px; }
  h1 { font-size: 30px; }
  .card { padding: 16px; }
  .card.flush .card-head { padding: 14px 16px 0; }
  header.page { align-items: flex-start; }
  .card.schedule { padding: 14px 16px; }
}

/* phones: every table row becomes a card with labelled values */
@media (max-width: 820px) {
  form.inline .btn { width: 100%; justify-content: center; }
  .run > b { display: block; }  /* phones: the title, then "@creator · time" */
  .run > b + *::before { content: none; }
  .sub { white-space: normal; }
  .card-note { margin: -4px 16px 12px; }
  .card-head .head-actions { width: 100%; gap: 8px; }
  .table-search { flex: 1 1 100%; order: -1; }  /* search gets its own full-width line on top */
  .table-search input { width: 100%; }
  .table-scroll { overflow-x: visible; }
  nav { flex-wrap: wrap; }
  nav a > span { display: none; }  /* four sections fit a phone's top bar without the 01–04 numbers */
  .invite-form { flex: 1 1 100%; flex-wrap: wrap; }
  .invite-form input { flex: 1 1 100%; width: auto; height: 38px; }  /* name on its own line, role and Invite below */
  .invite-form select { height: 38px; flex: 1 1 auto; }
  .team-list .actions { justify-content: flex-start; }
  .team-list li, .activity-list li { padding: 12px 16px; }
  .activity-list li { flex-direction: column; gap: 2px; }
  .copy-row { flex-direction: column; }
  .card-note.backup { padding: 14px 16px 2px; }
  .btn.small { height: 38px; }  /* a finger, not a cursor */

  .creators-table, .creators-table tbody, .posts-table, .posts-table tbody { display: block; }
  .creators-table thead, .posts-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .creators-table tr, .posts-table tr { display: grid; gap: 10px 12px; padding: 14px 16px; border-top: 1px solid var(--track); }
  .creators-table td, .posts-table td { display: block; padding: 0 !important; border: 0; text-align: left !important; min-width: 0; }
  .creators-table td, .jobs-table td, .creators-table .cell-creator, .jobs-table .cell-result { width: auto; max-width: none; min-width: 0; }
  .creators-table .cell-creator, .creators-table .cell-action { position: static; background: transparent; box-shadow: none; }
  .table-frame::before, .table-frame::after { display: none; }
  .creators-table td[data-label]::before, .posts-table td[data-label]::before {
    content: attr(data-label); display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }

  /* creators: a compact, tappable card; the full detail is on the creator's page. Ticking rows
     for bulk actions is a desktop thing. */
  .creators-table .cell-select, .bulk-bar { display: none !important; }
  .card.selecting .head-actions > .btn { display: inline-flex; }
  .mobile-sort { display: block; padding: 0 16px 12px; }
  .mobile-sort label { flex-direction: row; align-items: center; gap: 8px; }
  .mobile-sort select { height: 34px; flex: 1 1 auto; max-width: 220px; }
  .creators-table { min-width: 0; table-layout: auto; }
  .creators-table td { white-space: normal; }
  .creators-table tr { position: relative; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; }
  .creators-table tr:active { background: var(--soft); }
  .creators-table tr.no-match { display: block; }
  .creators-table tr.pending .cell-pending { grid-column: 1 / -1; }
  .creators-table .cell-creator { grid-column: 1 / 3; grid-row: 1; min-width: 0; }
  .creators-table .cell-creator .who > a:first-child::after { content: ""; position: absolute; inset: 0; }  /* whole card opens the page */
  .creators-table .cell-action, .creators-table .err-pill { position: relative; z-index: 1; }
  .creators-table .cell-action { grid-column: 3; grid-row: 1; justify-self: end; align-self: start; }
  .creators-table td.key-stat { grid-row: 2; }
  .creators-table td.key-stat .sub { display: none; }
  .creators-table td.more-detail { display: none; }
  .creators-table .cell-summary { display: block; grid-column: 1 / -1; grid-row: 3; font-size: 13px; line-height: 1.5;
                                   color: var(--muted); white-space: normal; }

  /* a creator's posts */
  .posts-table tr { grid-template-columns: 52px repeat(4, minmax(0, 1fr)); }
  .posts-table .cell-thumb { grid-column: 1; grid-row: 1 / 3; width: auto; }
  .posts-table .cell-post { grid-column: 2 / -1; grid-row: 1; }
  .posts-table .col-caption { grid-column: 2 / -1; grid-row: 2; width: auto; min-width: 0; font-size: 14px; }
  .posts-table td[data-label] { grid-row: 3; }
  .posts-table td[data-label="Likes"] { grid-column: 2; }
  .posts-table td[data-label="Comments"] { grid-column: 3; }
  .posts-table td[data-label="Plays"] { grid-column: 4; }
  .posts-table td[data-label="Engagement"] { grid-column: 5; }

  /* campaigns: the list and a campaign's videos become cards too, instead of a table to scroll sideways */
  .camp-scroll { overflow-x: visible; }
  .camp-table, .camp-table tbody { display: block; min-width: 0; }
  .camp-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .camp-table tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; padding: 14px 16px; border-top: 1px solid var(--track); }
  .camp-table td { display: block; padding: 0 !important; border: 0; white-space: normal; text-align: left !important; min-width: 0; }
  .camp-table td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
  .camp-table tr.video-waiting { background: var(--soft); }
  .camp-table tr.video-waiting td { background: transparent; }
  .camp-table .who b { overflow-wrap: anywhere; }
  .camp-table .who span { white-space: normal; }
  .camp-table .c-name { grid-column: 1 / 3; grid-row: 1; }
  .camp-table .c-status { grid-column: 3; grid-row: 1; justify-self: end; }
  .camp-table .c-prog { grid-column: 1 / 3; grid-row: 2; }
  .camp-table .c-plat { grid-column: 3; grid-row: 2; justify-self: end; }
  .camp-table .c-owed { grid-column: 1; grid-row: 3; }
  .camp-table .c-likes { grid-column: 2; grid-row: 3; }
  .camp-table .c-comments { grid-column: 3; grid-row: 3; }
  .videos-table .v-who { grid-column: 1 / 3; grid-row: 1; }
  .videos-table .v-status { grid-column: 3; grid-row: 1; justify-self: end; }
  .videos-table .v-video { grid-column: 1 / -1; grid-row: 2; }
  .videos-table .v-video:has(> .dim) { display: none; }  /* nothing posted yet: no empty line */
  .videos-table .v-draft { grid-column: 1 / -1; grid-row: 3; }
  .videos-table .v-draft:has(> .dim:only-child) { display: none; }
  .videos-table .v-results { grid-column: 1 / 3; grid-row: 4; }
  .videos-table .v-results:has(> .dim) { display: none; }
  .videos-table .v-payout { grid-column: 3; grid-row: 4; align-self: end; }
  .videos-table .v-actions { grid-column: 1 / -1; grid-row: 5; }
  .videos-table .v-actions:has(.actions:empty) { display: none; }
  .videos-table .actions { justify-content: flex-start; flex-wrap: wrap; }
  .videos-table .link-form { width: 100%; }
  .videos-table .link-form input { flex: 1 1 auto; width: auto; min-width: 0; height: 38px; }
  .cap { max-width: none; }

  /* jobs */
  .jobs-table, .jobs-table tbody { display: block; min-width: 0; }
  .jobs-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .jobs-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 12px 16px;
                   border-top: 1px solid var(--track); }
  .jobs-table td { display: block; padding: 0 !important; border: 0; white-space: normal; text-align: left !important; }
  .jobs-table .cell-id { display: none; }
  .jobs-table .cell-what { grid-column: 1; grid-row: 1; }
  .jobs-table .cell-status { grid-column: 2; grid-row: 1; justify-self: end; }
  .jobs-table .cell-when, .jobs-table .cell-took { font-size: 13px; color: var(--muted); }
  .jobs-table .cell-when { grid-column: 1; grid-row: 2; }
  .jobs-table .cell-took { grid-column: 2; grid-row: 2; justify-self: end; }
  .jobs-table .cell-result { grid-column: 1 / -1; font-size: 14px; }
  .jobs-table .cell-result:empty { display: none; }
  .jobs-table .cell-action { grid-column: 1 / -1; }
  .jobs-table .cell-action:empty { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.4s; }
  .btn.listening .icon { animation: none; }
  aside, main, .sidebar-open { transition: none !important; }
}

/* a creator's own page (me.html): one narrow column, none of the team's navigation */
.creator-shell { max-width: 720px; margin: 0 auto; padding: 24px 16px 64px; }
.creator-shell label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.draft-review, .draft-upload { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.draft-review input[type=text], .draft-upload input[type=text] { min-width: 0; flex: 1 1 160px; }
.draft-upload progress { width: 100%; }

/* campaign page: edit pencil, edit dialogs, draft player */
h1.title-edit { display: flex; align-items: center; gap: 10px; }
h1.title-edit .icon-btn { width: 32px; height: 32px; flex-shrink: 0; }
dialog.modal.wide { max-width: 560px; }
dialog.modal .dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
dialog.modal .dialog-actions.split { justify-content: space-between; border-top: 1px solid var(--line); padding-top: 14px; }
dialog.modal .dialog-actions form { margin: 0; }
dialog.modal .edit-row { display: flex; gap: 10px; align-items: flex-end; margin: 0 0 6px; }
dialog.modal .edit-row label { flex: 1 1 auto; margin: 8px 0 0; min-width: 0; }
dialog.modal .edit-row label.narrow { flex: 0 0 76px; }
dialog.modal .edit-row input { width: 100%; height: 38px; }
dialog.modal .edit-row .btn { flex-shrink: 0; }
dialog.modal .inline-action { margin: 0 0 12px; }
dialog.modal textarea { margin-top: 4px; }
.btn.danger { color: var(--bad); }
.link-btn b { font-weight: 600; }
dialog.draft-dialog video { width: 100%; max-height: 62vh; background: #000; border-radius: 8px; display: block; margin: 4px 0 10px; }
@media (max-width: 820px) {
  dialog.modal .edit-row { flex-wrap: wrap; }
  dialog.modal .edit-row label { flex: 1 1 100%; }
  dialog.modal .edit-row label.narrow { flex: 1 1 80px; }
}

/* creator page: each video is a card, not a table row */
.creator-shell .offer h3 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 20px; }
.creator-shell .offer > .hint { margin: 2px 0 12px; }
.creator-shell input[type=text], .creator-shell input[type=email], .creator-shell input[type=file] { width: 100%; }
.creator-shell .details-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.creator-shell .details-form .full, .creator-shell .details-form .actions-row { grid-column: 1 / -1; }
.vlist { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.vcard { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; background: var(--card); }
.vcard-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.vcard-head .who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vcard-head .who span { font-size: 13px; color: var(--muted); }
.vcard-head .meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.vcard-head .pay { font-weight: 600; font-variant-numeric: tabular-nums; }
.vcard-body { display: flex; flex-direction: column; gap: 8px; }
.vcard-body .draft-state { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.vcard-body .feedback { margin: 0; padding: 10px 12px; background: var(--soft); border-radius: 8px; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.vcard .draft-upload, .vcard .link-form { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin: 0; }
.vcard .link-form input, .vcard .draft-upload input[type=text] { width: 100%; height: 40px; font-size: 14px; flex: none; }
.vcard .draft-upload input[type=file] { font-size: 13px; }
.vcard .btn { justify-content: center; }
.offer-total { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 4px; }
.offer-total p { margin: 0; font-size: 14px; }
@media (max-width: 560px) { .creator-shell .details-form { grid-template-columns: 1fr; } .creator-shell { padding: 16px 14px 48px; } }

/* polish pass: wordmark, file picker, creator page spacing, a videos table that fits its card */
.brand { font-family: var(--serif); font-size: 22px; line-height: 1; color: var(--ink); letter-spacing: -.01em; }
.login-card .brand { margin-bottom: 6px; }
input[type=file] { font: inherit; font-size: 13px; color: var(--ink-3); max-width: 100%; }
input[type=file]::file-selector-button { height: 34px; margin-right: 10px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--card); color: var(--ink); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
input[type=file]::file-selector-button:hover { border-color: var(--ink); }
.creator-shell .card > h2 { margin: 0 0 14px; }
.creator-shell .details-form { margin-top: 4px; }
.videos-table { --cell-x: 10px; min-width: 0; }
.videos-table .v-draft { white-space: normal; max-width: 200px; }
.videos-table .v-draft .who { align-items: flex-start; text-align: left; }
.videos-table .v-draft .link-btn { text-align: left; text-decoration: none; color: var(--accent); }
.videos-table .v-draft .link-btn:hover { text-decoration: underline; }
.videos-table .link-form input { width: 140px; }
.videos-table .v-video { max-width: 170px; white-space: normal; }
.people-table .btn, .pill { white-space: nowrap; }
@media (max-width: 820px) {
  .videos-table .v-draft { grid-column: 1 / -1; max-width: none; }
  .videos-table .v-draft .who { flex-direction: column; align-items: flex-start; }
  .videos-table .v-video { max-width: none; }
}

/* creator page: header, one card per campaign, drop area */
.me-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.me-head h1 { margin: 0; font-size: 32px; }
.creator-shell .offer { margin-top: 0; padding: 20px 24px; border-top: 1px solid var(--line); }
.creator-shell .offer > .hint { margin: -8px 0 14px; }
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center;
  padding: 18px 14px; border: 1.5px dashed var(--line-2); border-radius: 10px; background: var(--soft); color: var(--ink-2); font-size: 14px; cursor: pointer;
  transition: border-color .15s, background-color .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--ink); background: var(--card); }
.dropzone.over { border-style: solid; }
.dropzone.has-file { border-style: solid; border-color: var(--good); }
.dropzone input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone .icon { width: 22px; height: 22px; color: var(--muted); }
.dropzone .dz-name { margin: 0; overflow-wrap: anywhere; }
.dropzone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 560px) { .me-head h1 { font-size: 26px; } }

/* /me spacing: video rows are flat (no box inside the campaign card), one rhythm of 16px between parts */
.creator-shell .offer { padding: 24px; }
.creator-shell .offer > h2 { margin: 0 0 4px; }
.creator-shell .offer > .hint { margin: 0 0 18px; }
.creator-shell .vlist { gap: 0; margin: 0; }
.creator-shell .vcard { border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; padding: 16px 0; gap: 12px; }
.creator-shell .vcard-head { align-items: center; }
.creator-shell .vcard-head .meta { flex-direction: row; align-items: center; gap: 10px; }
.creator-shell .vcard-body { gap: 12px; }
.creator-shell .offer-total { border-top: 1px solid var(--line); padding-top: 16px; margin: 0; }
.creator-shell .card > h2 + .details-form { margin-top: 16px; }
.creator-shell .details-form { gap: 16px 14px; }
.creator-shell .details-form label { gap: 6px; }
.me-head { margin-bottom: -6px; }

/* creator profile page */
.platform-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.platform-cards .card { display: flex; flex-direction: column; gap: 12px; }
.platform-cards .card-head { margin: 0; }
.empty-note { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px dashed var(--line-2); border-radius: 10px; background: var(--soft); font-size: 14px; }
.empty-note b { font-weight: 500; color: var(--ink-2); } .empty-note span { color: var(--muted); line-height: 1.5; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 0; }
.facts div { display: flex; flex-direction: column; gap: 1px; } .facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 0; font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; }
.card-head h2 a { color: var(--ink); text-decoration: none; } .card-head h2 a:hover { text-decoration: underline; }
@media (max-width: 820px) { .platform-cards { grid-template-columns: 1fr; gap: 16px; } }

.people-table .fol { white-space: nowrap; } .people-table .fol .dim { font-size: 12px; margin-left: 2px; }

/* The campaign's caption and hashtags, to copy from (/me) */
.caption-box { border: 1px solid var(--track); border-radius: 10px; padding: 12px 14px 14px; margin: 4px 0 14px; background: var(--soft); }
.caption-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.caption-box textarea { width: 100%; resize: vertical; font: inherit; line-height: 1.45; background: transparent; border: 0; padding: 0; color: inherit; }
.caption-box textarea:focus { outline: 2px solid var(--accent, #111); outline-offset: 2px; border-radius: 4px; }

.dlg-sub { margin: 18px 0 2px; font-size: 14px; }
.caption-form { display: grid; gap: 8px; justify-items: start; margin: 10px 0; }
.caption-form label { width: 100%; }
.caption-form textarea { width: 100%; }

/* To do and Payouts */
.stat-tiles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.todo-table td, .pay-table td { vertical-align: top; }
.pay-table td.v-actions, .todo-table td.v-actions { text-align: right; white-space: nowrap; }
.text-list { list-style: none; margin: 0; padding: 0; }
.text-item { padding: 16px 18px; border-top: 1px solid var(--track); display: grid; gap: 10px; }
.text-item:first-child { border-top: 0; }
.text-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.text-meta { display: flex; align-items: center; gap: 10px; }
.text-item .caption-box { margin: 0; }
.text-contact { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; }
@media (max-width: 720px) { .stat-tiles.three { grid-template-columns: 1fr; } }
.caption-box textarea { field-sizing: content; min-height: 2.9em; }
@media (max-width: 720px) {
  .todo-table, .todo-table tbody, .pay-table, .pay-table tbody { display: block; }
  .todo-table thead, .pay-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .todo-table tr, .pay-table tr { display: grid; gap: 8px; padding: 14px 16px; border-top: 1px solid var(--track); }
  .todo-table td, .pay-table td { display: block; padding: 0; border: 0; text-align: left; }
  .todo-table td[data-label]::before, .pay-table td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; color: var(--muted); }
  .todo-table td.num, .pay-table td.num { text-align: left; }
  .pay-table td.v-actions, .todo-table td.v-actions { text-align: left; }
  .todo-table .btn.small, .pay-table .btn.small { height: 40px; }
}

.check-problem { font-size: 12.5px; color: var(--bad, #9a3b1f); line-height: 1.35; margin-top: 4px; max-width: 28ch; }
.link-note { align-self: center; }

.account-card .facts { margin: 0 0 12px; }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 4px 0 0; }
.offer-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
dialog.modal .draft-upload { flex-direction: column; align-items: stretch; gap: 10px; }
dialog.modal .draft-upload .dialog-actions { width: 100%; }
.results-tiles { padding: 0 20px 16px; }
.v-draft .link-btn { display: block; margin-top: 4px; }

.agenda, .agenda ul { list-style: none; margin: 0; padding: 0; }
.agenda-day { padding: 12px 20px 4px; border-top: 1px solid var(--line); }
.agenda-day:first-child { border-top: 0; }
.agenda-day h3 { font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 0 0 6px; }
.meeting { display: grid; grid-template-columns: 76px 1fr auto; gap: 12px; align-items: start; padding: 8px 0; }
.meeting .when { font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; padding-top: 1px; }
.meeting .what { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.meeting .what .dim { font-size: 13px; }
.meeting.now .when { color: var(--ink); font-weight: 600; }
@media (max-width: 640px) { .meeting { grid-template-columns: 64px 1fr; } .meeting .btn { grid-column: 2; justify-self: start; } }
ol.steps { padding-left: 20px; display: grid; gap: 6px; }
.meeting .what .pill { align-self: flex-start; }

/* ---- review fixes: actions stay in view, a "needs you" strip, skeletons, toasts with Undo, phone tap sizes ---- */
::placeholder { color: #6B655C; opacity: 1; }                                  /* 5:1 on the field background */
.plat { font-size: 11px; }
.card-note { max-width: 78ch; }
p, .hint, .card-note, .empty-note span { text-wrap: pretty; }

.skel { display: block; background: var(--track); border-radius: 8px; }
.skel-title { width: 260px; max-width: 70%; height: 40px; }
.skel-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; }

.needs-you { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px 16px; background: var(--card);
             border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 12px; }
.needs-you > b { font-size: 13px; color: var(--ink-2); margin-right: 4px; }
.needs-chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--bg);
              color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer; }
.needs-chip:hover { border-color: var(--ink); }
.needs-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.videos-table .v-results .res { display: flex; flex-direction: column; gap: 4px; }
.videos-table .v-results .res-nums { white-space: nowrap; font-size: 14px; color: var(--ink-2); }
.videos-table .v-results .bar { font-size: 12px; }

@media (min-width: 821px) {
  .videos-table td.v-actions, .videos-table thead th:last-child { position: sticky; right: 0; background: var(--card); }
  .videos-table td.v-actions { box-shadow: -10px 0 8px -8px rgba(28, 27, 25, .10); }
  .videos-table tr.video-waiting td.v-actions { background: var(--soft); }
}

#toasts .toast-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
#toasts .toast-row .link-btn { font-weight: 600; white-space: nowrap; }

.accept-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 14px 16px; margin: 4px 0 14px;
              background: var(--soft); border: 1px solid var(--line); border-radius: 12px; }
.accept-bar p { margin: 0; }

@media (max-width: 820px) {
  /* one row of menu that scrolls, with the lock beside the name, instead of a menu that wraps and strands the lock */
  .aside-actions { order: 2; }
  .online { order: 3; }
  nav { order: 4; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  nav a { flex: 0 0 auto; }
  /* a finger, not a cursor: nothing you press is under 44px */
  .btn, .btn.small, .icon-btn, nav a, .needs-chip { min-height: 44px; }
  .btn.small { height: auto; }
  .icon-btn { min-width: 44px; }
  input:not([type=checkbox]):not([type=radio]):not([type=file]), select { min-height: 44px; }
  .invite-form input, .invite-form select { height: 44px; }
  .videos-table .link-form input { height: 44px; }
}

/* ---- design pass: quieter rows, 6px chips ---- */
.camp-table tr.video-waiting, tr.pending td { background: transparent; }
tr.video-waiting td { background: transparent; }
.needs-chip { border-radius: var(--r); min-height: 32px; }
@media (min-width: 821px) { .videos-table tr.video-waiting td.v-actions { background: var(--card); } }
dialog.modal { border-radius: var(--r-sheet); box-shadow: var(--float-shadow); }
dialog.modal h2 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; margin-bottom: 10px; }
dialog.modal::backdrop { background: rgba(20, 20, 30, .28); }

/* ---- the pipeline board ---- */
.seg { display: inline-flex; background: var(--active); border-radius: 7px; padding: 2px; gap: 2px; }
.seg button { white-space: nowrap; border: 0; background: transparent; height: 26px; padding: 0 10px; border-radius: 5px; color: var(--muted); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--bg); color: var(--ink); box-shadow: 0 0 0 1px var(--line-2); }
.seg-count { color: var(--muted); font-weight: 400; }
.filters { align-items: center; flex-wrap: wrap; }
.filters input[type=search] { width: 200px; }

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(236px, 1fr); gap: 12px; align-items: start; overflow-x: auto; padding-bottom: 6px; }
.board-pad { padding: 4px 16px 16px; }
.pipeline .stage-switch { display: none; }
.bcol { display: flex; flex-direction: column; gap: 8px; min-width: 0; background: var(--soft); border-radius: 8px; padding: 8px; }
.bcol-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 4px; flex-wrap: wrap; }
.bcol-head b { font-size: 13px; font-weight: 600; }
.bcol-hint { flex: 1 1 100%; font-size: 12px; color: var(--muted); }
.bcol-cards { display: flex; flex-direction: column; gap: 8px; }
.bcol-empty { padding: 14px 6px; text-align: center; font-size: 13px; color: var(--muted); }
.pcard { background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 10px 11px; display: flex; flex-direction: column; gap: 6px; }
.pcard:hover { border-color: var(--line-2); }
.pc-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pc-top a { color: var(--ink); text-decoration: none; } .pc-top a:hover { text-decoration: underline; }
.pc-pay { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 13px; }
.pc-meta { font-size: 12.5px; color: var(--muted); } .pc-meta a { color: var(--muted); }
.pc-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.pc-note { font-size: 12.5px; color: var(--ink-2); }
.pc-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 2px; }
.pc-actions:empty { display: none; }
@media (max-width: 820px) {
  /* a phone shows one stage at a time, chosen from a row of chips */
  .pipeline .stage-switch { display: flex; overflow-x: auto; max-width: 100%; }
  .board { display: block; overflow: visible; }
  .bcol { display: none; background: transparent; padding: 0; }
  .bcol.on { display: flex; }
  .bcol-head { display: none; }
  .seg button { height: 36px; }
}

/* ---- dark theme: the same names, a dark set of values. Follows the device unless the person chose one. ---- */
:root[data-theme="dark"] {
  --frame: #111113; --bg: #18181B; --side: #111113; --card: #18181B; --soft: #1F1F23; --track: #2A2A2F; --line: #2A2A2F; --line-2: #36363C;
  --ink: #EDEDF0; --ink-2: #C4C4CC; --ink-3: #C4C4CC; --muted: #8C8C96; --accent: #A28BFF; --accent-dk: #B9A7FF; --accent-bg: #2A2448; --accent-fg: #15102B; --green: #79D491;
  --good-bg: #18321F; --good: #79D491; --warn-bg: #3A2C12; --warn: #F0BF62; --bad-bg: #3A1A21; --bad: #FF8A9E; --info-bg: #1B2A45; --info: #8DB4FF; --chip: #26262B;
  --hover: #222226; --active: #2A2A2F; --float-shadow: 0 12px 32px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .06); color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --frame: #111113; --bg: #18181B; --side: #111113; --card: #18181B; --soft: #1F1F23; --track: #2A2A2F; --line: #2A2A2F; --line-2: #36363C;
    --ink: #EDEDF0; --ink-2: #C4C4CC; --ink-3: #C4C4CC; --muted: #8C8C96; --accent: #A28BFF; --accent-dk: #B9A7FF; --accent-bg: #2A2448; --accent-fg: #15102B; --green: #79D491;
    --good-bg: #18321F; --good: #79D491; --warn-bg: #3A2C12; --warn: #F0BF62; --bad-bg: #3A1A21; --bad: #FF8A9E; --info-bg: #1B2A45; --info: #8DB4FF; --chip: #26262B;
    --hover: #222226; --active: #2A2A2F; --float-shadow: 0 12px 32px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .06); color-scheme: dark;
  }
}
:root[data-theme="dark"] ::placeholder, :root:not([data-theme="light"]) ::placeholder { color: var(--muted); }
:root[data-theme="dark"] .run.paused { background: #2A1A1E; border-color: #5A2A33; }
:root[data-theme="dark"] dialog.modal::backdrop { background: rgba(0, 0, 0, .55); }
:root[data-theme="dark"] .pill.accent { background: var(--accent-bg); color: var(--accent); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .run.paused { background: #2A1A1E; border-color: #5A2A33; }
  :root:not([data-theme="light"]) dialog.modal::backdrop { background: rgba(0, 0, 0, .55); }
}
.camp-table tr.video-waiting td { background: transparent; }
.board { grid-auto-columns: minmax(204px, 1fr); }

/* menu icons */
nav a .nav-icon { display: block; width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; color: var(--muted); }
nav a.on .nav-icon, nav a:hover .nav-icon { color: var(--ink); }
nav a.on .nav-icon { color: var(--accent); }
