/* ==========================================================================
   Service Solar Pros — Media Portal · shared stylesheet for every mockup screen
   --------------------------------------------------------------------------
   Direction: "the job sheet". A warm, sun-readable paper ground (phones in
   Florida daylight wash out dark UIs), brand navy as ink, brand gold as the
   ONE action colour. Navy only for the top bar and the team chrome, so the
   site's identity carries without a dark screen in the sun.

   Mapping to the API (for the build):
     .item-card / .upload-row / .my-row  -> one row of GET /api/items
       [data-field="note"]       items.note
       [data-field="tags"]       items.tags   (Install, Repair, Before/After, Team, Review, Other)
       [data-field="preferred"]  items.preferred (star)
       [data-field="direction"]  items.direction
       [data-field="used_url"]   items.used_url ("Used in a post" when set)
       [data-field="comments"]   comment count
       [data-field="status"]     processing | ready | failed (+ client-side upload states)
     .idea                       one row of GET /api/ideas (date, title, body, item_ids)
     .thread .msg--client / .msg--team   comments.author = client | team
   ========================================================================== */

:root {
  /* brand (from the SSP site CSS) */
  --deep: #0A1220;
  --panel: #0E1A2E;
  --gold: #F6B41A;
  --gold-2: #FFD777;
  --sky: #4FB0FF;
  --disp: 'Geist', 'Plus Jakarta Sans', system-ui, sans-serif;
  --body: 'Geist', 'Plus Jakarta Sans', system-ui, sans-serif;

  /* portal tokens */
  --paper: #F5F2EA;
  --paper-2: #EDE8DC;
  --card: #FFFFFF;
  --ink: #0A1220;
  --ink-2: #33415A;
  --ink-3: #56647A;          /* 5.4:1 on --paper */
  --line: #E0D9C9;
  --line-2: #CFC6B2;
  --gold-ink: #7A5000;       /* gold-family text on light grounds, 7:1 */
  --gold-wash: #FFF4D6;
  --link: #0B5CA8;
  --ok: #17673D;
  --ok-wash: #E3F3E8;
  --warn: #8A4B00;
  --warn-wash: #FFEFD6;
  --bad: #B3261E;
  --bad-wash: #FDE8E6;
  --info-wash: #E3EEFB;

  --r-sm: 10px;
  --r: 14px;
  --r-lg: 22px;
  --shadow: 0 1px 2px rgba(10, 18, 32, .06), 0 6px 18px -8px rgba(10, 18, 32, .18);
  --shadow-lg: 0 24px 60px -20px rgba(10, 18, 32, .45);
  --ease: cubic-bezier(.19, 1, .22, 1);
  --tap: 48px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--disp); line-height: 1.15; margin: 0; text-wrap: balance; letter-spacing: -.02em; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--link); }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
svg.i { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i--sm { width: 18px; height: 18px; }
svg.i--fill { fill: currentColor; stroke: none; }

/* ---------- CLIENT SHELL (phone first; centred column on a desktop) ---------- */
body.client {
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(246, 180, 26, .18), transparent 60%),
    linear-gradient(180deg, #13223A 0%, var(--deep) 100%) fixed;
}
.shell {
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--paper);
  position: relative;
  display: flex;
  flex-direction: column;
}
@media (min-width: 560px) {
  .shell { box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 30px 80px -30px rgba(0, 0, 0, .7); }
}

.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: var(--deep);
  color: #fff;
  position: sticky; top: 0; z-index: 5;
  border-bottom: 3px solid var(--gold);
}
.topbar__logo { height: 46px; width: auto; }
.topbar__title { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.topbar__title strong { font-family: var(--disp); font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.topbar__title span { font-size: 13px; color: #B9C6D8; }
.topbar__spacer { flex: 1; }
.icon-btn {
  min-width: 44px; min-height: 44px;
  display: inline-grid; place-items: center;
  border-radius: 12px; border: 0; background: rgba(255, 255, 255, .08); color: #fff; cursor: pointer; text-decoration: none;
}
.icon-btn--light { background: var(--card); color: var(--ink); border: 1px solid var(--line); }

.page { padding: 22px 16px 32px; flex: 1; }
.page--center { display: flex; flex-direction: column; justify-content: center; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-ink); }
.h1 { font-size: 28px; font-weight: 700; margin-top: 6px; }
.h2 { font-size: 20px; font-weight: 650; }
.lede { color: var(--ink-2); font-size: 17px; margin-top: 8px; }
.muted { color: var(--ink-3); }
.small { font-size: 14px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 28px 0 12px; }
.section-head .small { white-space: nowrap; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--tap); padding: 0 20px;
  border-radius: var(--r); border: 1.5px solid transparent;
  font-weight: 650; font-size: 17px; text-decoration: none; cursor: pointer;
  transition: transform 160ms var(--ease), background-color 160ms ease, box-shadow 160ms ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--gold); color: var(--deep); box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, 0 8px 20px -10px rgba(180, 120, 0, .8); }
.btn--primary:hover { background: #FFC233; }
.btn--dark { background: var(--deep); color: #fff; }
.btn--dark:hover { background: #17284A; }
.btn--ghost { background: var(--card); color: var(--ink); border-color: var(--line-2); }
.btn--ghost:hover { border-color: var(--ink-3); }
.btn--quiet { background: transparent; color: var(--ink-2); }
.btn--block { width: 100%; }
.btn--lg { min-height: 60px; font-size: 18px; border-radius: 18px; }
.btn--sm { min-height: 44px; padding: 0 14px; font-size: 15px; border-radius: 12px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- PHOTO PLACEHOLDERS (CSS only, labelled; no stock) ---------- */
.ph {
  position: relative; overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-sm);
  background: #8DA3B8;
}
.ph__label {
  position: absolute; left: 8px; bottom: 8px; right: 8px;
  font-size: 12px; font-weight: 600; line-height: 1.25;
  color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .7);
}
.ph__label::before { content: ""; position: absolute; inset: -40px -8px -8px; background: linear-gradient(180deg, transparent, rgba(5, 10, 20, .5)); z-index: -1; }
.ph--sq { aspect-ratio: 1; }
.ph--wide { aspect-ratio: 16 / 10; }
/* roof install: sky top, panel array bottom */
.ph--roof {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .22) 0 1px, transparent 1px 13%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .18) 0 1px, transparent 1px 11%),
    linear-gradient(170deg, #A9CDEA 0 38%, #1D3A66 38.5% 100%);
}
/* close-up panel cells */
.ph--panel {
  background:
    repeating-linear-gradient(90deg, rgba(220, 235, 255, .35) 0 2px, transparent 2px 22%),
    repeating-linear-gradient(0deg, rgba(220, 235, 255, .3) 0 2px, transparent 2px 18%),
    linear-gradient(135deg, #2B5DA8 0%, #163A73 55%, #0E2650 100%);
}
/* dirty / before */
.ph--before {
  background:
    radial-gradient(60% 40% at 30% 40%, rgba(150, 120, 60, .55), transparent 70%),
    radial-gradient(40% 30% at 75% 70%, rgba(170, 140, 80, .5), transparent 70%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .12) 0 2px, transparent 2px 22%),
    linear-gradient(135deg, #6B7360 0%, #4A5243 100%);
}
/* team / people */
.ph--team {
  background:
    radial-gradient(14% 20% at 34% 44%, #E9C9A7 0 60%, transparent 62%),
    radial-gradient(14% 20% at 62% 42%, #C99A74 0 60%, transparent 62%),
    radial-gradient(24% 36% at 34% 100%, #0E1A2E 0 70%, transparent 72%),
    radial-gradient(24% 36% at 62% 100%, #0E1A2E 0 70%, transparent 72%),
    linear-gradient(180deg, #F2C66B 0%, #E39A3C 100%);
}
/* dusk / review / truck */
.ph--dusk {
  background:
    radial-gradient(30% 30% at 78% 70%, rgba(255, 210, 120, .9), transparent 70%),
    linear-gradient(180deg, #23345A 0%, #7B4E6E 55%, #F09A4A 100%);
}
/* repair: wiring / inverter */
.ph--repair {
  background:
    linear-gradient(90deg, transparent 0 40%, #D7DDE3 40% 66%, transparent 66%),
    repeating-linear-gradient(180deg, transparent 0 18px, rgba(10, 18, 32, .18) 18px 20px),
    linear-gradient(180deg, #A9B4BF 0%, #7E8B97 100%);
}
/* critter guard mesh */
.ph--mesh {
  background:
    repeating-linear-gradient(45deg, rgba(30, 30, 30, .35) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(-45deg, rgba(30, 30, 30, .35) 0 1px, transparent 1px 7px),
    linear-gradient(170deg, #B9A88C 0 45%, #1D3A66 45.5% 100%);
}
/* clean / after */
.ph--after {
  background:
    linear-gradient(115deg, transparent 0 46%, rgba(255, 255, 255, .45) 48%, transparent 52%),
    repeating-linear-gradient(90deg, rgba(220, 235, 255, .35) 0 2px, transparent 2px 22%),
    repeating-linear-gradient(0deg, rgba(220, 235, 255, .3) 0 2px, transparent 2px 18%),
    linear-gradient(135deg, #2F6BC4 0%, #1A4690 100%);
}
.ph__play {
  position: absolute; inset: 0; margin: auto;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(10, 18, 32, .62); color: #fff;
  display: grid; place-items: center;
}
.ph__play svg { width: 18px; height: 18px; margin-left: 2px; }
.ph__dur {
  position: absolute; top: 8px; right: 8px;
  font-size: 12px; font-weight: 650; color: #fff;
  background: rgba(10, 18, 32, .72); padding: 2px 7px; border-radius: 6px;
}

/* ---------- PILLS / STATUS ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 650; line-height: 1;
  padding: 6px 10px; border-radius: 999px; white-space: nowrap;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill--new { background: var(--info-wash); color: #0B4A8A; }
.pill--used { background: var(--ok-wash); color: var(--ok); }
.pill--up { background: var(--gold-wash); color: var(--gold-ink); }
.pill--resumed { background: var(--warn-wash); color: var(--warn); }
.pill--done { background: var(--ok-wash); color: var(--ok); }
.pill--wait { background: var(--paper-2); color: var(--ink-2); }
.pill--bad { background: var(--bad-wash); color: var(--bad); }
.pill--icon::before { display: none; }

.tag {
  display: inline-flex; align-items: center;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  background: var(--paper-2); border-radius: 7px; padding: 4px 8px;
}

/* ---------- TAB BAR (client) ---------- */
.tabbar {
  position: sticky; bottom: 0; z-index: 6;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px -16px rgba(10, 18, 32, .25);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.tabbar a {
  min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 12.5px; font-weight: 600; text-decoration: none; color: var(--ink-3); border-radius: 12px;
}
.tabbar a[aria-current="page"] { color: var(--deep); background: var(--gold-wash); }
.tabbar a[aria-current="page"] svg { stroke: var(--gold-ink); }

/* ---------- PIN ---------- */
.pin-hero { text-align: center; padding: 8px 0 4px; }
.pin-hero img { width: 120px; margin: 0 auto 18px; filter: drop-shadow(0 10px 18px rgba(10, 18, 32, .25)); }
.pin-field { display: block; margin-top: 26px; }
.pin-field > span { display: block; font-weight: 650; margin-bottom: 8px; }
.pin-input {
  width: 100%; min-height: 64px;
  border: 2px solid var(--line-2); border-radius: 18px; background: var(--card);
  text-align: center; font-family: var(--disp); font-size: 26px; font-weight: 700; letter-spacing: .22em;
  padding: 0 0 0 .22em;
  font-variant-numeric: tabular-nums;
}
.pin-input::placeholder { color: #B8B0A0; }
.pin-input:focus { outline: none; border-color: var(--deep); box-shadow: 0 0 0 4px rgba(246, 180, 26, .45); }
.pin-input.is-wrong { border-color: var(--bad); background: #FFF8F7; box-shadow: 0 0 0 4px rgba(179, 38, 30, .12); }
.alert {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px; border-radius: var(--r); font-size: 15px; margin-top: 14px;
}
.alert--bad { background: var(--bad-wash); color: #7A1A14; border: 1px solid #F3C2BD; }
.alert strong { display: block; color: inherit; }
.fineprint { font-size: 14px; color: var(--ink-3); text-align: center; margin-top: 18px; }
.lock-note { display: flex; gap: 8px; align-items: center; justify-content: center; font-size: 14px; color: var(--ink-3); margin-top: 26px; }

/* ---------- UPLOAD ---------- */
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  width: 100%; min-height: 250px; padding: 28px 20px;
  border: 2px dashed var(--line-2); border-radius: var(--r-lg);
  background:
    radial-gradient(120% 80% at 50% 0%, var(--gold-wash), transparent 70%),
    var(--card);
  text-align: center; cursor: pointer; text-decoration: none; color: var(--ink);
  transition: border-color 160ms ease, transform 160ms var(--ease);
}
.drop:hover { border-color: var(--gold); }
.drop:active { transform: scale(.99); }
.drop__icon {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--gold); color: var(--deep);
  display: grid; place-items: center;
  box-shadow: 0 0 0 10px rgba(246, 180, 26, .18), 0 14px 26px -12px rgba(180, 120, 0, .9);
}
.drop__icon svg { width: 36px; height: 36px; stroke-width: 2.2; }
.drop__title { font-family: var(--disp); font-size: 23px; font-weight: 700; letter-spacing: -.02em; }
.drop__sub { color: var(--ink-3); font-size: 15px; }
.drop--compact { min-height: 0; flex-direction: row; justify-content: flex-start; text-align: left; padding: 14px 16px; gap: 14px; border-style: solid; border-color: var(--line); }
.drop--compact .drop__icon { width: 52px; height: 52px; flex: none; box-shadow: 0 0 0 6px rgba(246, 180, 26, .16); }
.drop--compact .drop__icon svg { width: 26px; height: 26px; }
.drop--compact .drop__title { font-size: 18px; }

.howto { display: grid; gap: 10px; margin: 8px 0 0; padding: 0; list-style: none; counter-reset: s; }
.howto li {
  display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px;
  counter-increment: s; font-size: 15.5px; color: var(--ink-2);
}
.howto li::before {
  content: counter(s); width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; color: var(--deep); background: var(--paper-2);
}
.howto strong { color: var(--ink); display: block; }

.size-note {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 14px; color: var(--ink-2);
  background: var(--paper-2); border-radius: var(--r); padding: 12px 14px; margin-top: 16px;
}
.size-note svg { color: var(--ok); margin-top: 1px; }

.summary {
  display: flex; align-items: center; gap: 14px;
  background: var(--deep); color: #fff; border-radius: var(--r-lg); padding: 16px;
  margin-top: 14px;
}
.summary__ring {
  --p: 64;
  width: 58px; height: 58px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--gold) calc(var(--p) * 1%), rgba(255, 255, 255, .14) 0);
  display: grid; place-items: center;
}
.summary__ring span { width: 46px; height: 46px; border-radius: 50%; background: var(--deep); display: grid; place-items: center; font-size: 14px; font-weight: 700; }
.summary strong { display: block; font-size: 17px; }
.summary p { color: #B9C6D8; font-size: 14px; }

.upload-list { display: grid; gap: 10px; margin: 14px 0 0; padding: 0; list-style: none; }
.upload-row {
  display: grid; grid-template-columns: 72px 1fr; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px;
  box-shadow: var(--shadow);
}
.upload-row .ph { aspect-ratio: 1; border-radius: 10px; }
.upload-row .ph__label { display: none; }
.upload-row .ph__play { width: 30px; height: 30px; }
.upload-row .ph__play svg { width: 13px; height: 13px; }
.upload-row__body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.upload-row__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.upload-row__name { font-weight: 650; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-row__meta { font-size: 13.5px; color: var(--ink-3); }
.upload-row__note { font-size: 14px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.upload-row__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.upload-row--needs-note { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(246, 180, 26, .22); }

.progress { height: 8px; border-radius: 99px; background: var(--paper-2); overflow: hidden; }
.progress > span {
  display: block; height: 100%; width: calc(var(--p, 0) * 1%); border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), #FFC94A);
  position: relative; overflow: hidden;
}
.progress--live > span::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .65), transparent);
  animation: shimmer 1.4s linear infinite;
}
.progress--done > span { background: var(--ok); }
.progress--resumed > span { background: linear-gradient(90deg, #C98E10, #E5A417 70%, var(--gold)); }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .progress--live > span::after { animation: none; } * { transition: none !important; } }
.resume-note { font-size: 13px; color: var(--warn); display: flex; gap: 6px; align-items: center; }

/* ---------- BOTTOM SHEET ---------- */
.scrim { position: fixed; inset: 0; background: rgba(10, 18, 32, .55); z-index: 20; }
.sheet {
  position: fixed; z-index: 21;
  left: 50%; transform: translateX(-50%);
  bottom: 0; width: 100%; max-width: 480px;
  max-height: 94vh; overflow: auto;
  background: var(--paper);
  border-radius: 24px 24px 0 0;
  box-shadow: var(--shadow-lg);
}
.sheet__grab { width: 44px; height: 5px; border-radius: 9px; background: var(--line-2); margin: 10px auto 4px; }
.sheet__head { display: flex; align-items: center; gap: 12px; padding: 8px 16px 14px; }
.sheet__head .ph { width: 64px; flex: none; aspect-ratio: 1; border-radius: 12px; }
.sheet__head .ph__label { display: none; }
.sheet__head h2 { font-size: 20px; }
.sheet__head p { font-size: 14px; color: var(--ink-3); }
.sheet__head .icon-btn { margin-left: auto; }
.sheet__body { padding: 0 16px 16px; }
.sheet__foot {
  position: sticky; bottom: 0; display: grid; grid-template-columns: 1fr 2fr; gap: 10px;
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  background: var(--paper);
  border-top: 1px solid var(--line);
}

/* ---------- FORMS ---------- */
.field { display: block; }
.field + .field, .field + .group, .group + .field, .group + .group { margin-top: 22px; }
.field__label { display: block; font-weight: 650; font-size: 16px; margin-bottom: 4px; }
.field__hint { display: block; font-size: 14px; color: var(--ink-3); margin-bottom: 8px; }
.input, .textarea, .select {
  width: 100%; min-height: 52px;
  border: 1.5px solid var(--line-2); border-radius: var(--r); background: var(--card);
  padding: 12px 14px; font-size: 17px; line-height: 1.45;
}
.textarea { min-height: 112px; resize: vertical; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--deep); box-shadow: 0 0 0 4px rgba(246, 180, 26, .4); }
.input::placeholder, .textarea::placeholder { color: #747F90; }
.counter { font-size: 13px; color: var(--ink-3); text-align: right; margin-top: 4px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  border: 1.5px solid var(--line-2); border-radius: 999px; background: var(--card);
  font-size: 15.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; user-select: none; text-decoration: none;
}
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; width: 100%; height: 100%; }
.chip:has(input:checked), .chip.is-on { background: var(--deep); border-color: var(--deep); color: #fff; }
.chip:has(input:checked)::before, .chip.is-on::before {
  content: ""; width: 12px; height: 7px; border: solid var(--gold); border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg) translate(1px, -2px);
}
.chip:has(input:focus-visible) { outline: 3px solid var(--sky); outline-offset: 2px; }
.chip__count { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.chip.is-on .chip__count { color: #B9C6D8; }

.star-card {
  border: 1.5px solid var(--line-2); border-radius: var(--r-lg); background: var(--card); padding: 14px;
}
.star-card.is-on { border-color: var(--gold); background: linear-gradient(180deg, var(--gold-wash), var(--card) 70%); }
.star-toggle {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px;
  background: none; border: 0; padding: 0; text-align: left; cursor: pointer;
}
.star-toggle__icon {
  width: 52px; height: 52px; flex: none; border-radius: 16px;
  display: grid; place-items: center; background: var(--paper-2); color: var(--ink-3);
}
.star-card.is-on .star-toggle__icon { background: var(--gold); color: var(--deep); }
.star-toggle__icon svg { width: 28px; height: 28px; }
.star-toggle strong { display: block; font-size: 17px; color: var(--ink); }
.star-toggle__text { font-size: 14px; color: var(--ink-3); }
.star-card .field { margin-top: 14px; }

.seg { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.seg label {
  position: relative; min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px solid var(--line-2); border-radius: var(--r); background: var(--card); font-weight: 650; font-size: 15.5px; cursor: pointer;
}
.seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; width: 100%; height: 100%; }
.seg label:has(input:checked) { border-color: var(--deep); background: var(--deep); color: #fff; }
.seg label:has(input:checked) svg { stroke: var(--gold); }

.pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pick label { position: relative; display: block; cursor: pointer; border-radius: 12px; min-height: 44px; }
.pick .ph { aspect-ratio: 1; border-radius: 12px; }
.pick .ph__label { display: none; }
.pick input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 2; width: 100%; height: 100%; }
.pick label:has(input:checked) .ph { outline: 3px solid var(--gold); outline-offset: 2px; }
.pick label:has(input:checked)::after {
  content: ""; position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; z-index: 1;
  background: var(--gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230A1220' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 15px no-repeat;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}

/* ---------- MY UPLOADS ---------- */
.filter-tabs { display: flex; gap: 8px; margin: 18px 0 4px; flex-wrap: wrap; }
.my-list { display: grid; gap: 12px; padding: 0; margin: 12px 0 0; list-style: none; }
.my-row {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow);
}
.my-row__main { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 12px; }
.my-row .ph { aspect-ratio: 1; border-radius: 12px; }
.my-row .ph__label { display: none; }
.my-row .ph__play { width: 34px; height: 34px; }
.my-row__info { min-width: 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.my-row__note { font-size: 15px; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.my-row__meta { font-size: 13.5px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.my-row__star { color: var(--gold-ink); font-weight: 650; display: inline-flex; gap: 4px; align-items: center; }
.my-row__star svg { width: 15px; height: 15px; }
.my-row__foot {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-top: 1px solid var(--line);
}
.my-row__foot a, .my-row__foot button {
  min-height: 50px; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--card); border: 0; font-size: 15px; font-weight: 650; color: var(--ink-2); text-decoration: none; cursor: pointer;
}
.my-row__foot a.is-post { color: var(--ok); }
.my-row__foot .badge { background: var(--deep); color: #fff; font-size: 12px; border-radius: 99px; padding: 1px 7px; }
.my-row__foot .badge--new { background: var(--bad); }

/* ---------- IDEAS ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow); }
.ideas { display: grid; gap: 10px; padding: 0; margin: 0; list-style: none; }
.idea {
  display: grid; grid-template-columns: 58px 1fr; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px;
}
.date-block {
  width: 58px; border-radius: 12px; overflow: hidden; text-align: center; border: 1px solid var(--line); background: var(--card);
  align-self: start;
}
.date-block b { display: block; background: var(--deep); color: var(--gold); font-size: 11.5px; letter-spacing: .1em; padding: 4px 0; }
.date-block span { display: block; font-family: var(--disp); font-size: 22px; font-weight: 700; padding: 4px 0 6px; }
.date-block--none b { background: var(--paper-2); color: var(--ink-3); }
.date-block--none span { font-size: 13px; padding: 10px 0 12px; color: var(--ink-3); font-family: var(--body); font-weight: 600; }
.idea h3 { font-size: 16.5px; font-weight: 650; }
.idea p { font-size: 14.5px; color: var(--ink-2); margin-top: 4px; }
.idea__meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.idea__thumbs { display: flex; gap: 6px; }
.idea__thumbs .ph { width: 34px; aspect-ratio: 1; border-radius: 7px; }
.idea__thumbs .ph__label { display: none; }
.kind { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 4px 8px; border-radius: 6px; }
.kind--event { background: #E6ECFA; color: #23409A; }
.kind--promo { background: var(--gold-wash); color: var(--gold-ink); }
.kind--season { background: var(--ok-wash); color: var(--ok); }
.kind--idea { background: var(--paper-2); color: var(--ink-2); }
.soon { font-size: 12.5px; font-weight: 650; color: var(--bad); }
.saved-toast {
  display: flex; gap: 10px; align-items: center; background: var(--ok-wash); color: var(--ok);
  border-radius: var(--r); padding: 12px 14px; font-size: 15px; font-weight: 600; margin-top: 14px;
}

/* ==========================================================================
   TEAM SIDE (desktop first at 1440; collapses cleanly to 375)
   ========================================================================== */
body.team { background: #F1EEE6; }
.t-top {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 28px; background: var(--deep); color: #fff;
  border-bottom: 3px solid var(--gold);
  position: sticky; top: 0; z-index: 5;
}
.t-top__logo { height: 46px; width: auto; }
.t-top__title strong { font-family: var(--disp); font-weight: 650; font-size: 17px; display: block; letter-spacing: -.01em; }
.t-top__title span { font-size: 13px; color: #B9C6D8; }
.t-top nav { display: flex; gap: 4px; margin-left: 24px; }
.t-top nav a {
  min-height: 44px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 10px;
  color: #B9C6D8; text-decoration: none; font-weight: 600; font-size: 15px;
}
.t-top nav a[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, .09); }
.t-top__spacer { flex: 1; }
.t-top .who { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #B9C6D8; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-size: 13px; font-weight: 700; background: var(--gold); color: var(--deep);
}
.avatar--client { background: #2B5DA8; color: #fff; }

.t-wrap { max-width: 1440px; margin: 0 auto; padding: 24px 28px 48px; }
.t-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; margin-top: 22px; }
.t-layout .toolbar { margin-top: 0; }
.t-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.t-head h1 { font-size: 30px; font-weight: 700; }
.t-head p { color: var(--ink-3); margin-top: 4px; }
.stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 16px; min-width: 112px;
}
.stat b { display: block; font-family: var(--disp); font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--ink-3); }
.stat--hot b { color: var(--gold-ink); }

.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center;
  margin: 20px 0 18px; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.toolbar__group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.toolbar__label { font-size: 12.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); margin-right: 4px; }
.toolbar .chip { min-height: 44px; padding: 0 14px; font-size: 14.5px; }
.toolbar .chip--star.is-on { background: var(--gold); border-color: var(--gold); color: var(--deep); }
.toolbar .chip--star.is-on::before { border-color: var(--deep); }
.toolbar__sep { width: 1px; align-self: stretch; background: var(--line); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 18px; padding: 0; margin: 0; list-style: none; }
.item-card {
  position: relative; display: flex; flex-direction: column; height: 100%;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow); text-decoration: none; color: inherit;
  transition: transform 200ms var(--ease), box-shadow 200ms ease;
}
.item-card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(10, 18, 32, .06), 0 18px 34px -16px rgba(10, 18, 32, .35); }
.item-card .ph { border-radius: 0; }
.item-card__badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; z-index: 2; }
.star-badge {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: var(--gold); color: var(--deep); box-shadow: 0 4px 10px -4px rgba(0, 0, 0, .5);
}
.star-badge svg { width: 18px; height: 18px; }
.new-dot { font-size: 12px; font-weight: 700; background: #fff; color: var(--deep); border-radius: 7px; padding: 6px 8px; line-height: 1; box-shadow: 0 4px 10px -4px rgba(0, 0, 0, .5); align-self: center; }
.used-dot { font-size: 12px; font-weight: 700; background: var(--ok); color: #fff; border-radius: 7px; padding: 6px 8px; line-height: 1; align-self: center; }
.item-card__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.item-card__note { font-size: 14.5px; line-height: 1.45; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.item-card__dir { font-size: 13.5px; color: var(--gold-ink); background: var(--gold-wash); border-radius: 8px; padding: 6px 8px; display: flex; gap: 6px; }
.item-card__dir svg { width: 15px; height: 15px; margin-top: 2px; flex: none; }
.item-card__tags { display: flex; flex-wrap: wrap; gap: 5px; }
.item-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 4px; font-size: 13px; color: var(--ink-3); }
.item-card__foot .c { display: inline-flex; gap: 5px; align-items: center; }
.item-card.is-used .ph { filter: saturate(.5) brightness(.95); }

/* side panel: ideas & dates */
.aside { position: sticky; top: 86px; display: grid; gap: 16px; }
.aside .card { padding: 18px; }
.aside h2 { font-size: 18px; display: flex; align-items: center; gap: 8px; }
.aside .ideas { margin-top: 4px; }
.aside .idea h3 { font-size: 15px; }
.aside .idea p { font-size: 13.5px; }
.month { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 16px 0 8px; }

/* ---------- ITEM DETAIL ---------- */
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-3); margin-bottom: 12px; flex-wrap: wrap; }
.crumbs a { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-weight: 600; text-decoration: none; }
.d-layout {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(360px, 1fr); gap: 24px 28px; align-items: start;
  grid-template-areas: "stage side" "comments side";
}
.d-stage { grid-area: stage; min-width: 0; }
.d-side { grid-area: side; min-width: 0; }
.d-comments { grid-area: comments; min-width: 0; }
.stage { background: #0B1322; border-radius: var(--r-lg); padding: 14px; box-shadow: var(--shadow-lg); }
.stage .ph { border-radius: 12px; aspect-ratio: 16 / 10; }
.stage .ph__label { font-size: 14px; left: 16px; bottom: 14px; }
.stage .ph__play { width: 76px; height: 76px; }
.stage .ph__play svg { width: 30px; height: 30px; }
.stage__bar { display: flex; align-items: center; gap: 14px; padding: 12px 4px 2px; color: #B9C6D8; font-size: 13.5px; flex-wrap: wrap; }
.stage__bar .scrub { flex: 1; min-width: 120px; height: 5px; border-radius: 9px; background: rgba(255, 255, 255, .15); position: relative; }
.stage__bar .scrub::after { content: ""; position: absolute; inset: 0 70% 0 0; background: var(--gold); border-radius: inherit; }
.stage__bar .icon-btn { color: #fff; }
.d-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 18px 0 0; }
.d-title h1 { font-size: 24px; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 16px; }
.panel h2 { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-family: var(--body); }
.quote { font-size: 18px; line-height: 1.5; margin-top: 10px; color: var(--ink); }
.quote::before { content: "\201C"; color: var(--gold-ink); font-family: var(--disp); font-weight: 700; margin-right: 2px; }
.quote::after { content: "\201D"; color: var(--gold-ink); font-family: var(--disp); font-weight: 700; }
.byline { font-size: 13.5px; color: var(--ink-3); margin-top: 8px; }
.dir-box { margin-top: 16px; padding: 14px; border-radius: var(--r); background: var(--gold-wash); border: 1px solid #F5D98C; display: flex; gap: 12px; }
.dir-box .star-badge { flex: none; }
.dir-box strong { display: block; font-size: 14px; color: var(--gold-ink); }
.dir-box p { font-size: 15.5px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; margin: 14px 0 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; }

.used-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 10px; }
.used-form .input { min-height: 48px; font-size: 15.5px; }
.dl { margin-top: 12px; }
.dl-note { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--ink-2); margin-top: 10px; }
.dl-note svg { color: var(--ok); margin-top: 1px; }

.thread { display: grid; gap: 14px; margin: 14px 0 0; padding: 0; list-style: none; }
.msg { display: grid; grid-template-columns: 36px 1fr; gap: 10px; }
.msg__bubble { background: var(--paper); border-radius: 4px 16px 16px 16px; padding: 10px 14px; }
.msg--client .msg__bubble { background: #E9F1FC; }
.msg__who { font-size: 13px; font-weight: 700; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.msg__who span { font-weight: 500; color: var(--ink-3); }
.msg__role { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 2px 6px; border-radius: 5px; background: var(--deep); color: var(--gold); }
.msg--client .msg__role { background: #2B5DA8; color: #fff; }
.msg__text { font-size: 15px; margin-top: 3px; }
.reply { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 16px; align-items: end; }
.reply .textarea { min-height: 52px; font-size: 15.5px; }

/* ---------- RESPONSIVE (team down to phone) ---------- */
@media (max-width: 1100px) {
  .t-layout { grid-template-columns: 1fr; }
  .aside { position: static; }
  .d-layout { grid-template-columns: 1fr; grid-template-areas: "stage" "side" "comments"; }
}
@media (max-width: 720px) {
  .t-top { padding: 10px 16px; gap: 10px; }
  .t-top nav { display: none; }
  .t-top .who span { display: none; }
  .t-top__logo { height: 40px; }
  .t-wrap { padding: 16px 16px 40px; }
  .t-head h1 { font-size: 24px; }
  .stats { width: 100%; }
  .stat { min-width: 0; flex: 1; padding: 8px 12px; }
  .stat b { font-size: 20px; }
  .toolbar { gap: 12px; }
  .toolbar__sep { display: none; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .item-card__body { padding: 10px; }
  .item-card__note { font-size: 13.5px; }
  .item-card__dir { display: none; }
  .item-card__tags .tag:nth-child(n+2) { display: none; }
  .stage { padding: 8px; }
  .used-form { grid-template-columns: 1fr; }
  .panel { padding: 16px; }
  .d-title h1 { font-size: 20px; }
  .stage__bar .res { display: none; }
  .stage__bar { gap: 10px; }
}

/* ==========================================================================
   INDEX (screen catalogue)
   ========================================================================== */
body.index { background: var(--paper); }
.ix-hero { background: var(--deep); color: #fff; border-bottom: 3px solid var(--gold); }
.ix-hero__in { max-width: 1240px; margin: 0 auto; padding: 36px 28px 40px; display: flex; gap: 24px; align-items: center; }
.ix-hero img { width: 86px; flex: none; }
.ix-hero h1 { font-size: clamp(26px, 4vw, 44px); font-weight: 700; }
.ix-hero p { color: #B9C6D8; margin-top: 8px; max-width: 64ch; }
.ix-wrap { max-width: 1240px; margin: 0 auto; padding: 32px 28px 64px; }
.ix-wrap h2 { font-size: 22px; margin: 8px 0 4px; }
.ix-wrap > p { color: var(--ink-3); margin-bottom: 16px; }
.ix-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; padding: 0; margin: 0 0 40px; list-style: none; }
.ix-grid--wide { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.ix-card {
  display: flex; flex-direction: column; height: 100%; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow);
  transition: transform 200ms var(--ease), box-shadow 200ms ease;
}
.ix-card:hover { transform: translateY(-3px); box-shadow: 0 18px 34px -16px rgba(10, 18, 32, .35); }
.ix-thumb { background: #E7E1D3; aspect-ratio: 375 / 560; overflow: hidden; border-bottom: 1px solid var(--line); }
.ix-grid--wide .ix-thumb { aspect-ratio: 1440 / 900; }
.ix-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.ix-card__body { padding: 14px 16px 16px; }
.ix-card__body b { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-ink); }
.ix-card__body h3 { font-size: 17px; margin-top: 4px; }
.ix-card__body p { font-size: 14px; color: var(--ink-3); margin-top: 4px; }
@media (max-width: 720px) {
  .ix-hero__in { padding: 24px 16px; gap: 16px; }
  .ix-hero img { width: 60px; }
  .ix-wrap { padding: 24px 16px 48px; }
  .ix-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .ix-grid--wide { grid-template-columns: 1fr; }
}
