/* Desk v3: the logged-in app for clippers and campaigners.
   Tinted canvas with raised cards (light), charcoal canvas with lifted surfaces (dark), glass top bar,
   centred content, a tab bar on phones, and a two-column campaign wizard with a live summary. */
:root { --canvas: #F4F4F6; --card-sh: 0 1px 2px rgb(16 16 20 / .05), 0 10px 30px -16px rgb(16 16 20 / .12); --card-r: 20px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --canvas: #0B0B0D; --card-sh: 0 1px 0 rgb(255 255 255 / .03) inset; } }
:root[data-theme="dark"] { --canvas: #0B0B0D; --card-sh: 0 1px 0 rgb(255 255 255 / .03) inset; }

body:has(.shell) { background: var(--canvas); }
.shell { background: var(--canvas); }
.rail { background: var(--surface); border-right: 1px solid var(--line); }
.rail a.nv { transition: background .15s, color .15s; }
.rail a.nv[aria-current="page"] { background: var(--sunk); box-shadow: inset 0 0 0 1px var(--line); }
.rail a.nv[aria-current="page"] i { color: var(--signal); }

.appbar { background: color-mix(in srgb, var(--canvas) 76%, transparent); -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6); border-bottom: 1px solid var(--line); }
.appbar .search, .pill-earn { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); border-color: transparent; }
.appbar .iconbtn { border-radius: 12px; }
.content { width: 100%; margin-inline: auto; }

/* Cards: one surface, one hairline, one soft shadow */
.panel, .kpi, .dkpi, .dcard, .dcard2, .pcard, .drop, .sheet, .sup, .ern, .wh-card, .wh-task, .ctop, .un-card, .queue button, .content .sc, .content .checklist a, .content .checklist div.it {
  background: var(--surface); border-color: var(--line); box-shadow: var(--card-sh); }
.panel, .dcard, .dcard2, .sheet, .sup, .ern, .wh-card, .ctop { border-radius: var(--card-r); }
.content .input, .content .select, .content .textarea, .content .prefix { background: var(--surface); }
.content .input:focus, .content .select:focus, .content .textarea:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--fg) 10%, transparent); }

/* Page header */
.content .pgh h1, .content .dh h1 { letter-spacing: -.035em; }

/* Campaign wizard */
.stepper { gap: 6px; }
.stepper span { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); transition: background .2s, color .2s; }
.stepper span.on { background: var(--fg); color: var(--surface); box-shadow: none; }
.stepper span.done { color: var(--fg); }
.cw-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; max-width: 1060px; }
.cw-main { min-width: 0; padding: clamp(20px, 3vw, 32px); border-radius: var(--card-r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--card-sh); }
.cw-main .formcol { max-width: none; }
.cw-main .actions { padding-top: 18px; margin-top: 6px; border-top: 1px solid var(--line); }
.cw-main .actions .btn.solid { min-width: 148px; height: 46px; border-radius: 12px; }
.cw-sum { position: sticky; top: 84px; display: grid; gap: 16px; padding: 20px; border-radius: var(--card-r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--card-sh); }
.cw-k { font: 500 11.5px var(--mono); letter-spacing: .02em; text-transform: uppercase; color: var(--mute); }
.cw-ep { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cw-th { flex: none; width: 52px; height: 52px; border-radius: 12px; background: var(--sunk) center / cover; }
.cw-ep span:last-child { min-width: 0; } .cw-ep b { display: block; font-size: 14.5px; font-weight: 600; line-height: 1.3; } .cw-ep small { color: var(--mute); font-size: 12.5px; }
.cw-sum dl { margin: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.cw-sum dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.cw-sum dt { font-size: 13.5px; color: var(--mute); } .cw-sum dd { margin: 0; font-size: 13.5px; font-weight: 500; color: var(--fg); text-align: right; }
.cw-note { display: flex; gap: 8px; font-size: 12.5px; line-height: 1.5; color: var(--mute); } .cw-note i { flex: none; font-size: 16px; color: var(--ok); margin-top: 1px; }
@media (max-width: 1080px) { .cw-grid { grid-template-columns: minmax(0, 1fr); } .cw-sum { position: static; order: -1; } .cw-sum dl { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; } .cw-ep, .cw-note { grid-column: 1 / -1; } }

/* Phones: bottom tab bar replaces the drawer for the main places; "More" still opens the full menu */
.tabbar { display: none; }
@media (max-width: 760px) {
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
    background: color-mix(in srgb, var(--surface) 80%, transparent); -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6); border-top: 1px solid var(--line); }
  .tabbar a, .tabbar button { position: relative; display: grid; justify-items: center; gap: 2px; padding: 6px 0 4px; border: 0; border-radius: 12px; background: none; color: var(--mute); font: 500 11px var(--body); text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .tabbar i { font-size: 23px; }
  .tabbar [aria-current="page"] { color: var(--fg); } .tabbar [aria-current="page"] i { color: var(--signal); }
  .tabbar a:active, .tabbar button:active { transform: scale(.94); }
  .tabbar span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar em { position: absolute; top: 2px; left: calc(50% + 7px); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 99px; background: var(--signal); color: #fff; font: 600 10.5px/17px var(--body); font-style: normal; }
  .appbar .menu { display: none !important; }
  .appbar { height: 58px; padding-inline: 16px; }
  .content { padding: 20px 16px calc(100px + env(safe-area-inset-bottom, 0px)); }
  #app:has(.tabbar) .scn { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  .stepper { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
  .stepper span { flex: none; }
  .cw-sum dl { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-transparency: reduce) { .appbar, .tabbar { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; } }

/* ---------- Campaigner: campaigns list ---------- */
.cg { margin-top: 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.cg-c { display: grid; grid-template-rows: auto 1fr; border-radius: var(--card-r); overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--card-sh); color: var(--fg); text-decoration: none; transition: transform .25s var(--ease), box-shadow .25s; }
.cg-c:hover { transform: translateY(-2px); box-shadow: var(--card-sh), 0 18px 40px -20px rgb(16 16 20 / .25); }
.cg-im { position: relative; aspect-ratio: 16 / 8; background: var(--sunk) center 30% / cover; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 12px; }
.cg-im::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(0 0 0 / .35), transparent 45%); }
.cg-im > * { position: relative; z-index: 1; }
.cg-im .badge { background: rgb(255 255 255 / .92); color: #111113; } .cg-im .badge.live { color: #C4111F; }
.cg-d { height: 24px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: 99px; background: rgb(0 0 0 / .45); color: #fff; font-size: 12px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.cg-b { display: grid; gap: 12px; padding: 16px; align-content: start; }
.cg-b > b { font-size: 16px; font-weight: 600; letter-spacing: -.02em; }
.cg-m { display: flex; justify-content: space-between; font-size: 13px; color: var(--mute); } .cg-m em { font-style: normal; color: var(--fg); }
.cg .meter { display: flex; }
.cg .strip > span { display: grid; } .cg .strip > span + span { border-left: 1px solid var(--line-2); padding-left: 12px; }
.cg-new { display: grid; place-content: center; justify-items: center; gap: 6px; min-height: 260px; border-radius: var(--card-r); border: 1.5px dashed var(--line-2); color: var(--fg); text-decoration: none; text-align: center; padding: 20px; transition: border-color .2s, background .2s; }
.cg-new:hover { border-color: var(--fg); background: var(--surface); }
.cg-new i { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: var(--fg); color: var(--surface); margin-bottom: 6px; }
.cg-new small { color: var(--mute); font-size: 13px; }

/* ---------- Campaigner: campaign detail ---------- */
.chd { display: grid; grid-template-columns: 176px minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 14px; border-radius: var(--card-r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--card-sh); }
.chd-im { position: relative; aspect-ratio: 16 / 10; border-radius: 14px; background: var(--sunk) center 30% / cover; display: grid; place-items: center; overflow: hidden; }
.chd-im i { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; background: rgb(255 255 255 / .9); color: #111113; box-shadow: 0 6px 20px rgb(0 0 0 / .3); }
.chd-t { min-width: 0; display: grid; gap: 6px; }
.chd-k { display: inline-flex; align-items: center; gap: 6px; width: fit-content; font-size: 13px; color: var(--mute); text-decoration: none; } .chd-k:hover { color: var(--fg); }
.chd h1 { font-size: clamp(22px, 2.2vw, 30px); font-weight: 650; letter-spacing: -.035em; line-height: 1.1; }
.chd h1 .r1 { font-weight: 300; } .chd h1 .r2 { font-weight: 700; }
.chd-m { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; color: var(--mute); }
.chd-m > span:not(.badge) { display: inline-flex; align-items: center; gap: 5px; } .chd-m i { font-size: 15px; }
.chd-a { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; padding-right: 6px; }
.cnote { margin-top: 16px; }
.cstat { margin-top: 16px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-radius: var(--card-r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--card-sh); overflow: hidden; }
.cstat > div { display: grid; gap: 4px; padding: 18px 20px; min-width: 0; } .cstat > div + div { border-left: 1px solid var(--line); }
.cs-l { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--mute); } .cs-l i { font-size: 15px; }
.cstat b { font-size: clamp(20px, 2vw, 26px); font-weight: 500; letter-spacing: -.04em; }
.cstat small { font-size: 12.5px; color: var(--mute); }
.cbud { margin-top: 16px; display: grid; gap: 12px; }
.cbud-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; } .cbud-h > span { font-size: 13.5px; color: var(--mute); } .cbud-h > span b { color: var(--fg); font-weight: 600; }
.cbud .meter { height: 12px; margin: 0; } .cbud .legend { margin: 0; } .cbud .hint { margin: 0; }
.legend i.sw-r { background: repeating-linear-gradient(135deg, var(--signal) 0 2px, color-mix(in srgb, var(--signal) 30%, transparent) 2px 4px); }
.cgrid { margin-top: 16px; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.segtabs.sm button { height: 30px; padding: 0 12px; font-size: 13px; }
.clist { list-style: none; margin: 0; padding: 0; }
.clist li { display: grid; grid-template-columns: 52px minmax(0, 1fr) 92px 92px; gap: 16px; align-items: center; padding: 14px 20px; }
.clist li + li { border-top: 1px solid var(--line); }
.clist li:hover { background: color-mix(in srgb, var(--sunk) 55%, transparent); }
.cl-v .qcard { width: 52px !important; aspect-ratio: 9 / 13 !important; padding: 0; border-radius: 10px; }
.cl-v .qcard > :not(.rb) { display: none; }
.cl-t { min-width: 0; display: grid; gap: 4px; } .cl-t > b { font-size: 14.5px; font-weight: 600; }
.cl-by { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--mute); min-width: 0; white-space: nowrap; } .cl-by .av { width: 20px; height: 20px; font-size: 9px; } .cl-by .dot { opacity: .6; }
.cl-t .ribbon { width: min(180px, 100%); height: 4px; margin-top: 6px; }
.cl-t .ribbon .seg { top: -3px; bottom: -3px; } .cl-t .ribbon .seg::before, .cl-t .ribbon .seg::after { top: -2px; bottom: -2px; width: 4px; }
.cl-t .reason { font-size: 12.5px; color: var(--mute); }
.cl-n { display: grid; text-align: right; } .cl-n b { font-size: 14.5px; font-weight: 500; } .cl-n small { font-size: 12px; color: var(--mute); }
.ctx-p { text-align: left; margin: 10px 0 8px; font-size: 14.5px; line-height: 1.6; color: var(--fg-2); }
.cwait { margin-top: 12px; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; margin-inline: -10px; border-radius: 14px; color: var(--fg); text-decoration: none; }
.cwait:hover { background: var(--sunk); } .cwait .un-ico { width: 44px; height: 44px; font-size: 21px; border-radius: 13px; }
.cwait b { display: block; font-size: 14.5px; } .cwait small { color: var(--mute); font-size: 12.5px; }

/* ---------- Campaigner: review drafts ---------- */
.kbd-h { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--mute); white-space: nowrap; }
.kbd-h kbd { min-width: 22px; height: 22px; display: inline-grid; place-items: center; padding: 0 5px; border-radius: 6px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2), 0 1px 0 var(--line-2); font: 500 11px var(--mono); color: var(--fg); }
.kbd-h kbd:not(:first-child) { margin-left: 8px; } .kbd-h kbd:nth-child(2) { margin-left: 0; }
.rv3 { display: grid; grid-template-columns: 250px minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.rv3 .queue { position: sticky; top: 84px; }
.queue button { grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; transition: border-color .2s, background .2s; } .queue button:hover { border-color: var(--line-2); }
.queue .qw { color: var(--warn); margin-left: auto; align-self: center; }
.rv-d { min-width: 0; overflow: hidden; }
.rv-h { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.rv-h b { display: block; font-size: 14.5px; } .rv-h small { color: var(--mute); font-size: 12.5px; }
.rv-n { font-size: 12.5px; color: var(--mute); padding: 4px 10px; border-radius: 99px; background: var(--sunk); }
.rv-b { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 22px; padding: 20px; align-items: start; }
.rv-b .vp { max-width: none; margin: 0; }
.rv-x { min-width: 0; display: grid; gap: 14px; }
.rv-r { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; } .rv-r .label { flex-basis: 100%; } .rv-r b { font-size: 18px; font-weight: 500; letter-spacing: -.03em; } .rv-r .mute { font-size: 13px; }
.rv-x .transcript { margin: 0; font-size: 15px; }
.rv-cap { margin-top: 4px; font-size: 14.5px; line-height: 1.55; }
.rv-dec { position: sticky; top: 84px; }
.rv-tc { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rv-w { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--warn-bg); color: var(--warn); font-size: 13.5px; line-height: 1.5; }
.rv-dec .btn.primary { background: var(--signal); color: #fff; height: 48px; border-radius: 12px; }
.rv-dec .btn.primary:disabled { background: var(--sunk); color: var(--mute); }
.ask summary { display: flex; align-items: center; gap: 8px; }

/* ---------- Campaigner screens: smaller widths ---------- */
@media (max-width: 1240px) { .rv3 { grid-template-columns: 220px minmax(0, 1fr); } .rv-dec { grid-column: 2; position: static; } .rv3 .queue { position: static; } }
@media (max-width: 1100px) { .cgrid { grid-template-columns: minmax(0, 1fr); } .chd { grid-template-columns: 140px minmax(0, 1fr); } .chd-a { grid-column: 1 / -1; justify-content: flex-start; padding: 0; } }
@media (max-width: 900px) {
  .cstat { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cstat > div:nth-child(3) { border-left: 0; } .cstat > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .rv3 { grid-template-columns: minmax(0, 1fr); } .rv-dec { grid-column: auto; } .kbd-h { display: none; }
  .rv3 .queue { display: flex; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding: 2px 16px; } .rv3 .queue button { flex: none; width: 210px; }
}
@media (max-width: 620px) {
  .chd { grid-template-columns: minmax(0, 1fr); } .chd-im { aspect-ratio: 16 / 8; }
  .chd-a > * { flex: 1; justify-content: center; }
  .clist li { grid-template-columns: 44px minmax(0, 1fr) auto; padding: 12px 16px; gap: 12px; } .clist li .cl-n:last-child { display: none; } .cl-v .qcard { width: 44px !important; }
  .rv-b { grid-template-columns: minmax(0, 1fr); } .rv-b .vp { max-width: 220px; margin: 0 auto; }
  .cg { grid-template-columns: minmax(0, 1fr); } .cg-new { min-height: 140px; }
  .panel-h { flex-wrap: wrap; }
}

/* ---------- Clipper: campaign page ---------- */
.rp-hero { display: grid; gap: 2px; padding: 16px 18px; border-radius: 16px; background: var(--fg); color: var(--surface); }
.rp-hero small { font-size: 12.5px; opacity: .7; }
.rp-hero b { font-size: clamp(28px, 2.6vw, 36px); font-weight: 500; letter-spacing: -.05em; line-height: 1.1; }
.rp-hero span { font-size: 13px; opacity: .75; }
.watch .player { border-radius: var(--card-r); box-shadow: var(--card-sh); }
.watch .ctx { border-radius: var(--card-r); }
/* Phones: the earn-and-join action stays in reach above the tab bar */
.jbar { display: none; }
@media (max-width: 900px) {
  .jbar { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 44; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 16px; border-radius: 18px;
    background: color-mix(in srgb, var(--surface) 86%, transparent); -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6); box-shadow: inset 0 0 0 1px var(--line), 0 16px 40px -16px rgb(0 0 0 / .35); }
  .jbar span { min-width: 0; display: grid; } .jbar b { font-size: 16px; font-weight: 600; letter-spacing: -.03em; } .jbar small { font-size: 12px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .jbar .btn { flex: none; height: 44px; padding: 0 18px; border-radius: 12px; }
  .content:has(.jbar) { padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }
  #app:has(.jbar) .scn { display: none; }
}
@media (max-width: 760px) { .cw-sum { order: 0; } .player .big { font-size: clamp(19px, 5.4vw, 30px); } .watch .player { aspect-ratio: 4 / 3.4; } }
@media (max-width: 760px) { .jbar { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); } .content:has(.jbar) { padding-bottom: calc(170px + env(safe-area-inset-bottom, 0px)); } }

/* ---------- Clipper: my clips ---------- */
.clist.mc li { grid-template-columns: 52px minmax(0, 1fr) 120px 84px 96px 150px; }
.mc-s { display: flex; } .mc-a { display: flex; justify-content: flex-end; }
@media (max-width: 1180px) { .clist.mc li { grid-template-columns: 52px minmax(0, 1fr) 110px 84px 96px; } .mc-a { grid-column: 2 / -1; justify-content: flex-start; } .mc-a:empty { display: none; } }
@media (max-width: 620px) {
  .clist.mc li { grid-template-columns: 44px minmax(0, 1fr); row-gap: 8px; }
  .clist.mc .cl-n { display: none; } .mc-s, .mc-a { grid-column: 2; }
}
