/* Social Fix admin: same matte gray + orange as the public site.
   Layout: fixed left sidebar, main column with a sticky top bar, spreadsheet grid that scrolls inside its own box. */
:root {
  --bg: #2b2d31; --panel: #33363b; --panel-2: #3a3d43; --row-hover: #383b41;
  --fg: #f4f4f5; --muted: rgba(244,244,245,.64); --dim: rgba(244,244,245,.42); --line: rgba(255,255,255,.09);
  --accent: oklch(0.73 0.18 52); --accent-hot: oklch(0.8 0.15 62); --accent-ink: #1e1206;
  --ok: #7bc68f; --warn: #e6c06a; --bad: #ef8a7d;
  --display: "Sora", "Helvetica Neue", Arial, sans-serif;
  --body: "Host Grotesk", "Helvetica Neue", Arial, sans-serif;
  --side: 232px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.45 var(--body); }
[hidden] { display: none !important; }
input, select, textarea, button { font: inherit; color: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.brand { display: flex; align-items: center; gap: 10px; font: 800 16px/1 var(--display); letter-spacing: -.01em; }
.brand b { color: var(--accent); }
a.brand { color: inherit; text-decoration: none; }
.home-btn { text-decoration: none; display: inline-flex; align-items: center; }
.back-link { justify-self: center; font-size: 13px; color: var(--muted); text-decoration: none; }
.back-link:hover { color: var(--accent); }
.btn { background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); border-radius: 8px; padding: 9px 14px; font: 700 12px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--accent-hot); border-color: var(--accent-hot); }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--accent); }
.btn.danger { color: var(--bad); }
.btn.wide { width: 100%; padding: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.link-btn { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; }
.icon-btn { background: none; border: 1px solid var(--line); color: var(--fg); border-radius: 8px; width: 36px; height: 36px; cursor: pointer; }
.field { display: grid; gap: 5px; min-width: 0; }
.field > span { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.field input, .field select, .field textarea, .toolbar input, .toolbar select {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; width: 100%; min-width: 0;
}
.field textarea { resize: vertical; min-height: 70px; }
.form-msg { margin: 0; min-height: 1.2em; color: var(--muted); font-size: 13px; }
.form-msg.err { color: var(--bad); } .form-msg.ok { color: var(--ok); }
.grow { flex: 1; }

/* Login */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(380px, 100%); background: var(--panel); border-radius: 14px; padding: 28px; display: grid; gap: 16px; }
.login-card h1 { margin: 6px 0 0; font: 800 22px/1.1 var(--display); text-transform: uppercase; }

/* Shell */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100%; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: #25272b; border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 20px; }
.sidebar .brand { padding: 0 8px; }
.nav { display: grid; gap: 4px; }
.nav a { display: flex; justify-content: space-between; align-items: center; padding: 9px 10px; border-radius: 8px; color: var(--fg); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--panel); }
.nav a.active { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--accent); }
.nav a i { font-style: normal; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); border: 1px solid var(--line); border-radius: 999px; padding: 2px 6px; }
.me { margin-top: auto; padding: 10px 8px 0; border-top: 1px solid var(--line); display: grid; gap: 4px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.me .link-btn { justify-self: start; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 10; background: var(--bg); display: flex; align-items: center; gap: 12px; padding: calc(14px + env(safe-area-inset-top, 0px)) 24px 14px; border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 0; font: 800 20px/1 var(--display); text-transform: uppercase; letter-spacing: -.01em; }
#menu-btn { display: none; }
.sync { margin-left: auto; font-size: 12px; color: var(--dim); }
.view { padding: 20px 24px 60px; display: grid; gap: 16px; min-width: 0; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--panel); border-radius: 10px; padding: 12px 14px; }
.stat b { display: block; font: 800 24px/1 var(--display); font-variant-numeric: tabular-nums; }
.stat span { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

.panel { background: var(--panel); border-radius: 12px; padding: 16px 18px; display: grid; gap: 12px; }
.panel h2 { margin: 0; font: 800 15px/1.1 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.panel-head p { margin: 6px 0 0; color: var(--muted); max-width: 72ch; }
.scrape-form { display: grid; grid-template-columns: 160px 200px auto; gap: 10px; align-items: end; }
.scrape-form .btn { justify-self: start; padding-inline: 28px; }
.job-banner { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid color-mix(in oklch, var(--accent) 45%, transparent); border-radius: 10px; padding: 10px 14px; color: var(--fg); text-decoration: none; }
.job-banner::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s infinite; flex: none; }
.job-banner:hover { border-color: var(--accent); }
.job { background: var(--panel-2); border-radius: 10px; padding: 12px 14px; display: grid; gap: 10px; }
.job-head { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; }
.job-head b { font-family: var(--display); }
.job-groups { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 10px; font-size: 12px; background: var(--panel); color: var(--muted); }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.chip.running::before { background: var(--accent); animation: pulse 1.2s infinite; }
.chip.done::before { background: var(--ok); } .chip.failed::before { background: var(--bad); }
@keyframes pulse { 50% { opacity: .3; } }
.history summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.history ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; color: var(--muted); }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar input { width: 220px; } .toolbar select { width: auto; }
.count { margin: -6px 0 0; color: var(--dim); font-size: 12px; }

/* Spreadsheet grid */
.grid-wrap { overflow: auto; max-height: calc(100vh - 140px); border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.grid { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 13px; }
.grid th, .grid td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 0; text-align: left; vertical-align: middle; }
.grid th { position: sticky; top: 0; z-index: 2; background: var(--panel-2); font: 700 11px/1 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.grid th button { all: unset; display: flex; align-items: center; gap: 6px; padding: 10px; cursor: pointer; width: 100%; box-sizing: border-box; }
.grid th button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.grid th[aria-sort="ascending"] button::after { content: "▲"; color: var(--accent); }
.grid th[aria-sort="descending"] button::after { content: "▼"; color: var(--accent); }
.grid td:first-child, .grid th:first-child { position: sticky; left: 0; z-index: 1; background: var(--panel); }
.grid th:first-child { z-index: 3; background: var(--panel-2); }
.grid tbody tr:hover td { background: var(--row-hover); }
.grid .cell { display: block; padding: 8px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid input.cell, .grid select.cell { width: 100%; background: transparent; border: 0; border-radius: 0; }
.grid input.cell:focus, .grid select.cell:focus { background: var(--bg); outline: 2px solid var(--accent); outline-offset: -2px; }
.grid .name-btn { all: unset; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-weight: 600; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; box-sizing: border-box; width: 100%; }
.grid .name-btn:hover { color: var(--accent); }
.grid .name-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--dim); }
.dot.high { background: var(--accent); } .dot.medium { background: var(--warn); }
.new-tag { font: 700 9px/1 var(--display); letter-spacing: .08em; text-transform: uppercase; background: var(--accent); color: var(--accent-ink); border-radius: 4px; padding: 3px 5px; }
select.status { font-weight: 600; }
select.status, select.stage { font-weight: 600; }
select[data-s="Contacted"] { color: var(--warn); }
select[data-s="Call booked"], select[data-s="Proposal sent"] { color: var(--accent); }
select[data-s="Won"] { color: var(--ok); }
select[data-s="Lost"] { color: var(--dim); }
.src-tag { font: 700 9px/1 var(--display); letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--accent); color: var(--accent); border-radius: 4px; padding: 2px 5px; }
.grid .cell.due { color: var(--bad); font-weight: 600; }
.grid .w-weak { max-width: 320px; } .grid .w-notes { min-width: 240px; } .grid .w-short { min-width: 140px; }
.grid td.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 30px; text-align: center; color: var(--muted); margin: 0; }

/* Drawer */
.drawer-scrim, .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; }
.drawer { position: fixed; z-index: 50; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: var(--panel); border-left: 1px solid var(--line); display: flex; }
.drawer form { display: flex; flex-direction: column; width: 100%; min-height: 0; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: calc(16px + env(safe-area-inset-top, 0px)) 18px 16px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font: 800 17px/1.2 var(--display); }
.drawer-body { overflow-y: auto; padding: 16px 18px; display: grid; gap: 12px; flex: 1; }
.drawer-body .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.drawer-body .meta { font-size: 12px; color: var(--dim); }
.drawer-body .sources { margin: 0; padding-left: 18px; font-size: 13px; overflow-wrap: anywhere; }
.drawer-foot { display: flex; align-items: center; gap: 10px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); }

.nav a i.badge { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.grid .th { display: block; padding: 10px; }
.more-row { margin: 0; }
.grid .mini { margin: 6px 10px; padding: 6px 10px; font-size: 11px; }

@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 45; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; }
  #menu-btn { display: inline-block; }
  .view { padding: 16px 16px 60px; }
  .topbar { padding-inline: 16px; }
  .topbar .sync { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scrape-form { grid-template-columns: 1fr 1fr; }
  .scrape-form .btn { grid-column: 1 / -1; justify-self: stretch; }
  .toolbar input { width: 100%; }
  .toolbar select { flex: 1 1 40%; }
  .grid-wrap { max-height: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }
.field > .pw-wrap { position: relative; display: block; font-size: inherit; letter-spacing: normal; text-transform: none; color: inherit; }
.pw-wrap input { width: 100%; padding-right: 64px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); font: 600 12px/1 var(--body, inherit); padding: 6px 8px; cursor: pointer; }
.pw-toggle:hover { color: var(--accent); }
.save-pw { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.save-pw input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }

/* ---------- Video editing ---------- */
.btn.ok { background: var(--ok); border-color: var(--ok); color: #0f2416; }
.btn.ok:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.danger, .btn.ghost.danger { color: var(--bad); }
.btn.ghost.danger:hover { border-color: var(--bad); }
.vtools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
#video-filters .chip { background: var(--panel); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 6px 12px; font-size: 12px; cursor: pointer; }
#video-filters .chip::before { content: none; }
#video-filters .chip.on { background: var(--panel-2); color: var(--fg); border-color: var(--accent); }
.vstore { font-size: 12px; color: var(--dim); }
.notice { margin: 0; padding: 12px 14px; border-radius: 10px; background: rgba(230, 192, 106, .1); border: 1px solid rgba(230, 192, 106, .35); color: var(--warn); font-size: 13px; }
.vform { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }
.vform h2 { grid-column: 1 / -1; margin: 0; font: 800 15px/1.2 var(--display); text-transform: uppercase; }
.vform .wide { grid-column: 1 / -1; }
.vform-foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }
.vlist { display: grid; gap: 14px; }
.vcard { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: grid; gap: 14px; position: relative; }
.vcard.drop { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 140, 40, .18); }
.vcard.drop::after { content: attr(data-drop-hint); position: absolute; inset: 0; display: grid; place-items: center; background: rgba(43, 45, 49, .82); border-radius: 14px; font: 700 15px/1 var(--display); color: var(--accent); text-transform: uppercase; letter-spacing: .06em; pointer-events: none; }
.vhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.vhead h3 { margin: 0; font: 800 17px/1.25 var(--display); overflow-wrap: anywhere; }
.vmeta { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.stage-pill { flex: none; font: 700 10.5px/1 var(--display); letter-spacing: .08em; text-transform: uppercase; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.stage-pill.editing { color: var(--accent); border-color: var(--accent); }
.stage-pill.ready, .stage-pill.delivered { color: var(--ok); border-color: var(--ok); }
.vnotes { margin: 0; color: var(--muted); font-size: 13px; white-space: pre-line; overflow-wrap: anywhere; }

/* The progress bar: four steps on a line that fills in green. */
.steps-bar { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); }
.step { position: relative; display: grid; justify-items: center; gap: 6px; text-align: center; padding: 0 4px; }
.step::before { content: ""; position: absolute; top: 14px; left: calc(-50% + 16px); right: calc(50% + 16px); height: 3px; border-radius: 3px; background: var(--line); }
.step:first-child::before { display: none; }
.step.done::before, .step.current::before { background: var(--ok); }
.step .dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 800 13px/1 var(--display); background: var(--bg); border: 2px solid var(--line); color: var(--dim); position: relative; z-index: 1; }
.step.done .dot { background: var(--ok); border-color: var(--ok); color: #0f2416; }
.step.current .dot { border-color: var(--accent); color: var(--accent); animation: step-pulse 1.6s ease-in-out infinite; }
.step .label { font-size: 12px; font-weight: 600; color: var(--muted); }
.step.done .label { color: var(--fg); }
.step.current .label { color: var(--accent); }
.step .when { font-size: 11px; color: var(--dim); }
@keyframes step-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 140, 40, .45); } 50% { box-shadow: 0 0 0 7px rgba(255, 140, 40, 0); } }

.vfiles h4 { margin: 0 0 6px; font: 700 11px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.vfiles ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.vfile { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; background: var(--bg); border-radius: 10px; padding: 8px 10px; }
.vfile.uploading { grid-template-columns: minmax(0, 1fr) minmax(80px, 2fr) auto auto; }
.vname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.vsize, .utext { font-size: 12px; color: var(--dim); white-space: nowrap; }
.vacts, .row-acts { display: flex; gap: 6px; }
.btn.mini { padding: 6px 10px; font-size: 11px; }
.vacts .mini, .row-acts .mini { margin: 0; }
.vfile.failed { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto; border: 1px solid rgba(239, 138, 125, .35); }
.utext.bad { color: var(--bad); white-space: normal; }
.ubar { height: 8px; border-radius: 8px; background: var(--panel-2); overflow: hidden; }
.ubar .fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--ok)); transition: width .3s; }
.player { grid-column: 1 / -1; width: 100%; max-height: 70vh; border-radius: 8px; background: #000; }
.vempty { margin: 0; font-size: 13px; color: var(--dim); }
.vactions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 4px; border-top: 1px solid var(--line); padding-top: 14px; }
.grid .cell.strong { font-weight: 600; }
.grid .cell.dim { color: var(--dim); }
.grid select.cell { min-width: 140px; }
#view-team .form-msg { overflow-wrap: anywhere; }

@media (max-width: 860px) {
  .vform { grid-template-columns: 1fr; }
  .vcard { padding: 14px; }
  .step .label { font-size: 11px; }
  .step .when { display: none; }
  .vfile { grid-template-columns: minmax(0, 1fr) auto; }
  .vfile .vsize { display: none; }
  .vfile.uploading { grid-template-columns: minmax(0, 1fr) auto; }
  .vfile.uploading .ubar { grid-column: 1 / -1; order: 3; }
  .vfile .vacts { grid-column: 1 / -1; justify-content: flex-end; }
  .vfile.uploading > .btn { justify-self: end; }
  .vfile.failed { grid-template-columns: minmax(0, 1fr); }
  .vhead { flex-direction: column; }
}

/* ---------- Shared: pill tabs and toggles, hints, help notes ---------- */
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pills > button { display: inline-flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 6px 12px; font-size: 12.5px; cursor: pointer; }
.pills > button:hover { color: var(--fg); }
.pills > button.on { background: var(--panel-2); color: var(--fg); border-color: var(--accent); }
.pills > button b { font-weight: 700; font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }
.pills > button.on b { color: var(--accent); }
.hint { margin: 0; font-size: 12.5px; color: var(--dim); }
.help { font-size: 13px; color: var(--muted); }
.help summary { cursor: pointer; color: var(--accent); }
.help ul, .help ol { margin: 8px 0; padding-left: 20px; display: grid; gap: 4px; }
.help p { margin: 6px 0 0; }
.stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.nav a i:not(.badge) { color: var(--muted); }
.x { background: none; border: 0; color: var(--dim); cursor: pointer; padding: 4px 6px; border-radius: 6px; font-size: 12px; }
.x:hover { color: var(--bad); }

/* Settings tabs */
.subnav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 16px 24px 0; }
.subnav a { color: var(--muted); text-decoration: none; padding: 7px 12px; border-radius: 8px; font-weight: 500; }
.subnav a:hover { color: var(--fg); background: var(--panel); }
.subnav a.on { color: var(--fg); background: var(--panel-2); box-shadow: inset 0 -2px 0 var(--accent); }
.subnav .link-btn { font-size: 13px; padding: 7px 4px; }
.subnav .form-msg { flex: 1 1 100%; text-align: right; }
.subnav ~ .view { padding-top: 16px; }

/* ---------- Form inquiries (inbox) ---------- */
.inbox-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.inbox-tools input { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; width: min(360px, 100%); }
.bulkbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 30px; }
.pick-all { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.pick-all input, .icard .pick { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.icards { display: grid; gap: 10px; }
.icard { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 12px; align-items: start; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; cursor: pointer; }
.icard:hover { border-color: color-mix(in oklch, var(--accent) 40%, var(--line)); }
.icard .pick { margin-top: 3px; }
.icard.archived, .icard.spam { opacity: .78; }
.icard.booking { border-color: color-mix(in oklch, var(--ok) 45%, var(--line)); }
.ibody { display: grid; gap: 8px; min-width: 0; }
.ihead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-width: 0; }
.iname { all: unset; cursor: pointer; font: 700 15px/1.25 var(--display); overflow-wrap: anywhere; }
.iname:hover { color: var(--accent); }
.iname:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.ibiz { color: var(--muted); overflow-wrap: anywhere; }
.bchip { display: inline-block; border: 1px solid color-mix(in oklch, var(--accent) 60%, transparent); color: var(--accent); border-radius: 999px; padding: 2px 9px; font: 700 11px/1.4 var(--display); letter-spacing: .02em; white-space: nowrap; }
.tag { font: 700 9.5px/1 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 3px 6px; }
.tag.booked { color: var(--ok); border-color: color-mix(in oklch, var(--ok) 60%, transparent); }
.tag.warn { color: var(--warn); border-color: color-mix(in oklch, var(--warn) 60%, transparent); }
.iage { margin-left: auto; font-size: 12px; color: var(--dim); white-space: nowrap; }
.iage.late { color: var(--bad); font-weight: 600; }
.imsg { margin: 0; white-space: pre-line; overflow-wrap: anywhere; color: var(--fg); opacity: .9; }
.iacts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.iacts a.btn, .tacts a.btn, .bk-acts a.btn, .contact-bar a.btn { text-decoration: none; }
.iacts select.stage { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font-size: 12.5px; }
.more { position: relative; }
.more > summary { list-style: none; cursor: pointer; border: 1px solid var(--line); border-radius: 8px; padding: 3px 10px; font-size: 15px; line-height: 1.2; color: var(--muted); }
.more > summary::-webkit-details-marker { display: none; }
.more > summary:hover, .more[open] > summary { color: var(--fg); border-color: var(--accent); }
.more .menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 190px; display: grid; padding: 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.more .menu button { background: none; border: 0; text-align: left; padding: 9px 10px; border-radius: 6px; cursor: pointer; }
.more .menu button:hover { background: var(--panel); }
.more .menu button.danger { color: var(--bad); }

/* ---------- Today ---------- */
.today { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.tpanel { gap: 8px; }
.thead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.thead a, .thead .link-btn { font-size: 13px; text-decoration: none; }
.tlist { list-style: none; margin: 0; padding: 0; }
.tday h3 { margin: 10px 0 2px; font: 700 11px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.tday:first-child h3 { margin-top: 2px; }
.trow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.tday .trow:first-child, .tlist > .trow:first-child { border-top: 0; }
.tname { all: unset; cursor: pointer; display: grid; min-width: 0; flex: 1 1 160px; color: var(--fg); text-decoration: none; }
.tname b { font-weight: 600; overflow-wrap: anywhere; }
.tname span { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.tname:hover b { color: var(--accent); }
.tname:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.ttime { font: 700 13px/1 var(--display); font-variant-numeric: tabular-nums; min-width: 66px; }
.tmeta { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.tmeta .iage { margin: 0; }
.tacts { display: inline-flex; gap: 6px; }
.tnone, .tmore { list-style: none; padding: 10px 0 2px; color: var(--muted); font-size: 13px; margin: 0; }
.tmore a { text-decoration: none; }

/* ---------- Bookings ---------- */
.bk-list { display: grid; gap: 18px; }
.bk-day { display: grid; gap: 8px; }
.bk-day h2 { margin: 0; font: 700 12px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.bk-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 14px; align-items: start; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.bk-row.cancelled { opacity: .7; }
.bk-row.cancelled .bk-time b { text-decoration: line-through; }
.bk-time { display: grid; gap: 4px; }
.bk-time b { font: 800 17px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.bk-time span { font-size: 12px; color: var(--dim); }
.bk-main { display: grid; gap: 6px; min-width: 0; }
.bk-meta { margin: 0; font-size: 13px; color: var(--muted); }
.bk-note { background: transparent; border: 1px dashed var(--line); border-radius: 8px; padding: 6px 9px; font-size: 13px; width: 100%; max-width: 520px; }
.bk-note:focus { border-style: solid; background: var(--panel-2); outline: none; border-color: var(--accent); }
.bk-acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.notice a { color: inherit; font-weight: 600; }

/* ---------- Availability ---------- */
.av-form { display: grid; gap: 16px; }
.day-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.day-row:first-child { border-top: 0; }
.day-name { font-weight: 600; }
.ranges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.range { display: inline-flex; align-items: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 3px 4px 3px 8px; font-size: 13px; color: var(--muted); }
.range input { background: transparent; border: 0; padding: 4px 0; color: var(--fg); font-variant-numeric: tabular-nums; }
.range input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 4px; }
.closed { color: var(--dim); font-size: 13px; }
.types { display: grid; gap: 12px; justify-items: start; }
.type-row { display: grid; grid-template-columns: minmax(0, 2fr) 90px 130px auto 28px; gap: 8px 10px; align-items: end; width: 100%; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.type-row .t-about { grid-column: 1 / -1; }
.type-row input, .type-row select { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; width: 100%; min-width: 0; }
.t-on { display: inline-flex; align-items: center; gap: 6px; padding-bottom: 10px; font-size: 13px; cursor: pointer; }
.t-on input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.type-row .x { padding-bottom: 12px; }
.rules { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.rules input { max-width: 140px; }
.days-off { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.days-off input { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
#av-off-list > button b { color: var(--dim); }
.savebar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--bg); border-top: 1px solid var(--line); }
.cals { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cal { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; align-items: center; background: var(--panel-2); border-radius: 10px; padding: 10px 12px; }
.cal-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dim); }
.cal.ok .cal-dot { background: var(--ok); } .cal.bad .cal-dot { background: var(--bad); }
.cal-text { display: grid; gap: 2px; min-width: 0; }
.cal-text span { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.cal.bad .cal-text span { color: var(--bad); }
.cal-form { display: grid; grid-template-columns: 180px minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.cal-foot { display: flex; align-items: center; gap: 10px; }

/* ---------- Email & alerts ---------- */
.em-form { max-width: 720px; }
.em-form .hint { margin-top: -6px; }
.key-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; letter-spacing: normal; text-transform: none; color: var(--fg); }
.key-mask { font: 600 15px/1 var(--body); letter-spacing: .08em; padding: 8px 0; }
.em-form .vform-foot { flex-wrap: wrap; }

/* ---------- Lead drawer: contact, next steps, activity ---------- */
.contact-bar, .won-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.won-bar { background: color-mix(in oklch, var(--ok) 12%, var(--panel)); border: 1px solid color-mix(in oklch, var(--ok) 45%, transparent); border-radius: 10px; padding: 10px 12px; }
.won-bar > span { font-weight: 600; color: var(--ok); margin-right: 4px; }
.activity { display: grid; gap: 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px 0; }
.activity h3 { margin: 0; font: 700 11px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.activity .quick { display: flex; flex-wrap: wrap; gap: 6px; }
.note-row { display: flex; gap: 6px; }
.note-row input { flex: 1; min-width: 0; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
.acts { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 260px; overflow-y: auto; }
.acts li { display: grid; gap: 1px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.acts li:first-child { border-top: 0; }
.acts-what { overflow-wrap: anywhere; }
.acts-when { font-size: 11.5px; color: var(--dim); }
.acts-none { color: var(--dim); }

@media (max-width: 1100px) {
  .rules { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .subnav { padding: 12px 16px 0; }
  .topbar { gap: 10px; }
  .topbar h1 { font-size: 17px; }
  .today { grid-template-columns: minmax(0, 1fr); }
  .stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats.three .stat { padding: 10px; }
  .stats.three .stat b { font-size: 20px; }
  .stats.three .stat span { font-size: 10px; letter-spacing: .06em; }
  .icard { padding: 12px; gap: 10px; }
  .iage { margin-left: 0; }
  /* The ⋯ sits at the right end of its row, so its menu (anchored right) opens on screen even when it wraps. */
  .iacts .more { margin-left: auto; }
  .bk-row { grid-template-columns: 76px minmax(0, 1fr); padding: 12px; gap: 10px; }
  .bk-acts { grid-column: 1 / -1; justify-content: flex-start; }
  .day-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .type-row { grid-template-columns: minmax(0, 1fr) 80px 28px; }
  .type-row .t-name { grid-column: 1; grid-row: 1; }
  .type-row .t-min { grid-column: 2; grid-row: 1; }
  .type-row > :nth-child(5) { grid-column: 3; grid-row: 1; }
  .type-row .t-where { grid-column: 1; grid-row: 2; }
  .type-row .t-on { grid-column: 2 / 4; grid-row: 2; }
  .rules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cal-form { grid-template-columns: minmax(0, 1fr); }
  .cal-form .btn { justify-self: start; }
  .inbox-tools input { width: 100%; }
}
