:root {
  --red: #C8102E; --red-dark: #A00C24; --red-soft: #FDECEF;
  --ink: #16161B; --ink-2: #4A4A55; --ink-3: #85858F;
  --line: #E4E5EA; --line-2: #F0F1F4; --bg: #F6F7F9; --card: #FFFFFF;
  --blue: #2563EB; --green: #15803D; --green-soft: #E7F6EC; --amber: #B45309; --amber-soft: #FEF3C7; --gray-soft: #EEF0F3;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,16,24,.06), 0 1px 1px rgba(16,16,24,.04);
  --font: Montserrat, 'Proxima Nova', 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
h1 { font-size: 24px; font-weight: 800; letter-spacing: -.3px; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 700; }
p { margin: 0 0 8px; }
code, pre { font-family: var(--mono); font-size: 12.5px; }
[hidden] { display: none !important; }

#app { display: flex; min-height: 100vh; }
.sidebar { width: 236px; flex: none; background: #111114; color: #C9C9D1; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; font-size: 16px; font-weight: 600; }
.brand b { font-weight: 900; }
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand b { font-size: 19px; letter-spacing: .2px; }
.brand small { font-size: 11px; font-weight: 500; opacity: .6; text-transform: uppercase; letter-spacing: .8px; margin-top: 2px; }
#nav { display: flex; flex-direction: column; padding: 6px 10px; gap: 1px; }
#nav a { color: #C9C9D1; padding: 8px 12px; border-radius: 8px; font-weight: 500; }
#nav a:hover { background: #1E1E24; color: #fff; }
#nav a.active { background: var(--red); color: #fff; font-weight: 600; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; color: #6F6F7A; padding: 16px 12px 6px; font-weight: 600; }
.side-foot { margin-top: auto; padding: 14px 18px; font-size: 12px; color: #8F8F99; border-top: 1px solid #222228; }
.side-foot b { color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 24px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.crumbs { font-weight: 600; color: var(--ink-2); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs a { color: var(--ink-3); }
.top-right { display: flex; align-items: center; gap: 14px; }
.who { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 13px; }
.who select { font-weight: 600; }
.icon-btn { background: none; border: 0; font-size: 18px; cursor: pointer; position: relative; padding: 6px; border-radius: 8px; color: var(--ink); }
.icon-btn:hover { background: var(--gray-soft); }
.icon-btn .dot { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; background: var(--red); border-radius: 50%; }
.menu-btn { display: none; }
#view { padding: 24px; max-width: 1320px; width: 100%; }
#view.full { max-width: none; padding: 0; height: calc(100vh - 56px); overflow: hidden; }

/* layout bits */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--ink-3); margin-top: 4px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line-2); gap: 10px; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mb { margin-bottom: 16px; }
.empty { text-align: center; padding: 48px 20px; color: var(--ink-3); }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 6px; }
.note { background: #F3F6FD; border: 1px solid #DCE5FA; color: #23407A; border-radius: 8px; padding: 10px 14px; font-size: 13px; }
.note.warn { background: var(--amber-soft); border-color: #F7DC8E; color: #7A4B06; }
.note.ok { background: var(--green-soft); border-color: #BFE6CB; color: #135C2E; }

/* forms */
input, select, textarea, button { font: inherit; color: inherit; }
input[type=text], input[type=email], input[type=number], input[type=search], input[type=url], input[type=date], input[type=datetime-local], input[type=password], select, textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; width: 100%; outline: none; min-height: 36px;
}
input:focus, select:focus, textarea:focus { border-color: #9DB7F5; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
select { padding-right: 28px; }
.who select, .inline select, select.inline { width: auto; }
textarea { resize: vertical; min-height: 80px; }
textarea.code { font-family: var(--mono); font-size: 12.5px; line-height: 1.5; tab-size: 2; white-space: pre; }
label.f { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 12.5px; color: var(--ink-2); }
label.f .hint { font-weight: 400; color: var(--ink-3); }
.hint { font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }
label.chk { display: flex; align-items: center; gap: 8px; cursor: pointer; }
input[type=color] { width: 40px; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: #fff; cursor: pointer; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 14px; font-weight: 600; cursor: pointer; white-space: nowrap; min-height: 36px; color: var(--ink); }
.btn:hover { background: var(--bg); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-dark); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--gray-soft); }
.btn.danger { color: var(--red); }
.btn.sm { padding: 4px 10px; min-height: 30px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.seg { display: inline-flex; background: var(--gray-soft); border-radius: 8px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 6px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

/* tables */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-3); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #FBFBFC; }
table.t th.sortable { cursor: pointer; user-select: none; }
table.t th.sortable:hover, table.t th.sorted { color: var(--ink); }
table.t th .sort-arrow { font-size: 10px; }
table.t td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: #FAFAFB; }
table.t tr.sel td { background: #F0F5FF; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--gray-soft); color: var(--ink-2); white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill.sent, .pill.subscribed, .pill.delivered, .pill.on { background: var(--green-soft); color: var(--green); }
.pill.scheduled, .pill.sending { background: #E8EFFE; color: var(--blue); }
.pill.awaiting_approval { background: var(--amber-soft); color: var(--amber); }
.pill.texting { background: #E6F0FB; color: #1F5FA8; }
.pill.no_contact { background: var(--gray-soft); color: var(--ink-3); }
.pill.unsubscribed, .pill.bounced, .pill.failed, .pill.rejected, .pill.expired { background: var(--red-soft); color: var(--red); }
.tag { display: inline-block; background: var(--gray-soft); color: var(--ink-2); border-radius: 5px; padding: 1px 7px; font-size: 12px; margin: 1px 3px 1px 0; }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--line-2); color: var(--ink-3); font-size: 13px; }

/* stats */
.stat { padding: 16px 18px; }
.stat .k { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-3); font-weight: 600; }
.stat .v { font-size: 28px; font-weight: 800; letter-spacing: -.5px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .s { color: var(--ink-3); font-size: 12.5px; }
table.t tr.year-row td { background: #F6F7F9; color: var(--ink-3); font-size: 12px; font-weight: 700; letter-spacing: .6px; padding: 6px 14px; border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); }
.spend-tile { display: flex; gap: 16px; align-items: stretch; }
.spend-tile > :first-child { flex: none; }
.spend-split { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; border-left: 1px solid var(--line-2); padding-left: 14px; line-height: 1.25; }
.spend-split > div { display: flex; justify-content: space-between; gap: 8px; white-space: nowrap; }
.spend-split span { color: var(--ink-2); }
.g-contact-stats { grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.9fr); }
.spend-split b { font-variant-numeric: tabular-nums; }
.bar-mini { height: 6px; background: var(--gray-soft); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.bar-mini > i { display: block; height: 100%; background: var(--red); border-radius: 3px; }
.chart { width: 100%; display: block; }
.chart .gridline { stroke: var(--line-2); }
.chart .axis { fill: var(--ink-3); font-size: 11px; }
.chart .bar { fill: var(--red); }
.chart .bar:hover, .chart .hit:hover + .bar { fill: var(--red-dark); }
.chart .line { fill: none; stroke: var(--red); stroke-width: 2; }
.chart .area { fill: rgba(200,16,46,.08); }
.chart-tip { position: fixed; pointer-events: none; background: var(--ink); color: #fff; padding: 6px 10px; border-radius: 6px; font-size: 12px; z-index: 100; white-space: nowrap; }

/* modal & toast */
.modal-back { position: fixed; inset: 0; background: rgba(16,16,24,.45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 50; overflow-y: auto; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 560px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal.wide { max-width: 980px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line-2); }
#toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.2); max-width: 420px; animation: pop .18s ease-out; }
.toast.err { background: var(--red); }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 28px; text-align: center; color: var(--ink-3); cursor: pointer; transition: .15s; background: #FCFCFD; }
.drop.over, .drop:hover { border-color: var(--red); background: var(--red-soft); color: var(--red); }

/* popover */
.pop { position: absolute; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.15); z-index: 40; min-width: 280px; max-height: 420px; overflow: auto; }
.pop .item { padding: 10px 14px; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.pop .item.unread { background: #FFF8F8; }

/* media grid */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.media-item { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; cursor: pointer; position: relative; }
.media-item .thumb { aspect-ratio: 4/3; background: #EEF0F3 center/contain no-repeat; }
.media-item .meta { padding: 8px 10px; font-size: 12px; color: var(--ink-3); }
.media-item .meta b { color: var(--ink); font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-item.sel { outline: 3px solid var(--red); }
.saved { color: var(--green); font-weight: 600; }

/* template gallery */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.tpl-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; transition: .15s; }
.tpl-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.tpl-thumb { height: 300px; overflow: hidden; position: relative; background: #EEF0F3; }
.tpl-thumb iframe { width: 640px; height: 1400px; border: 0; transform: scale(.41); transform-origin: 0 0; pointer-events: none; position: absolute; left: 0; top: 0; }
.tpl-card .meta { padding: 12px 14px; border-top: 1px solid var(--line-2); }
.tpl-card .meta b { display: block; }

/* editor */
.editor { display: grid; grid-template-columns: 340px 1fr; height: calc(100vh - 56px); }
.editor-side { background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.editor-tabs { display: flex; border-bottom: 1px solid var(--line); }
.editor-tabs button { flex: 1; border: 0; background: none; padding: 12px 6px; font-weight: 600; color: var(--ink-3); cursor: pointer; border-bottom: 2px solid transparent; }
.editor-tabs button.on { color: var(--ink); border-bottom-color: var(--red); }
.editor-panel { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.block-palette { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.block-palette button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 4px; line-height: 1.2; font-size: 11.5px; border: 1px solid var(--line); background: #fff; border-radius: 10px; cursor: pointer; font-weight: 600; }
.block-palette button:hover { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.block-palette .ic { font-size: 17px; line-height: 1; }
.layers { display: flex; flex-direction: column; gap: 4px; }
.layer { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: #fff; font-size: 13px; }
.layer:hover { border-color: #C7CAD3; }
.layer.sel { border-color: var(--blue); background: #F0F5FF; }
.layer .ic { width: 22px; text-align: center; color: var(--ink-3); }
.layer .nm { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.layer[draggable=true] { cursor: grab; }
.layer.drag-over { box-shadow: 0 -2px 0 var(--blue); }
.editor-stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #E9EBEF; }
.stage-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.stage-bar .title-in { font-weight: 700; font-size: 15px; border-color: transparent; max-width: 360px; }
.stage-bar .title-in:hover { border-color: var(--line); }
.stage-scroll { flex: 1; overflow: auto; display: flex; justify-content: center; padding: 24px; min-height: 0; position: relative; }
.device { position: relative; background: #fff; transition: width .2s; box-shadow: 0 8px 30px rgba(0,0,0,.12); border-radius: 6px; overflow: hidden; align-self: flex-start; }
.device.mobile { border-radius: 36px; border: 12px solid #16161B; }
.device iframe { width: 100%; border: 0; display: block; }
.sel-toolbar { display: flex; gap: 4px; flex-wrap: wrap; padding-bottom: 8px; border-bottom: 1px solid var(--line-2); }
.fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.fieldset > .fs-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 12.5px; color: var(--ink-2); }
.img-field { display: flex; gap: 10px; align-items: center; }
.img-field .prev { width: 64px; height: 48px; border-radius: 6px; background: #EEF0F3 center/cover no-repeat; flex: none; border: 1px solid var(--line); }
.rich { border: 1px solid var(--line); border-radius: 8px; padding: 10px; min-height: 90px; outline: none; background: #fff; line-height: 1.5; }
.rich:focus { border-color: #9DB7F5; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.rich-bar { display: flex; gap: 4px; margin-bottom: 4px; flex-wrap: wrap; }
.rich-bar button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 2px 9px; cursor: pointer; font-size: 13px; }
.color-row { display: flex; gap: 8px; align-items: center; }
.color-row input[type=text] { font-family: var(--mono); font-size: 12.5px; }
.layout-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.layout-pick button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px; cursor: pointer; font-size: 12px; text-align: left; display: flex; gap: 8px; align-items: center; }
.layout-pick button.on { border-color: var(--red); background: var(--red-soft); }
.layout-pick svg { flex: none; }

/* campaign */
.steps { display: flex; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px; margin-bottom: 18px; width: fit-content; flex-wrap: wrap; }
.steps button { border: 0; background: none; padding: 8px 14px; border-radius: 7px; cursor: pointer; font-weight: 600; color: var(--ink-3); }
.steps button.on { background: var(--ink); color: #fff; }
.steps button .n { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--gray-soft); color: var(--ink-2); font-size: 11px; margin-right: 6px; }
.steps button.on .n { background: var(--red); color: #fff; }
.inbox-preview { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; gap: 12px; background: #fff; }
.inbox-preview .av { width: 40px; height: 40px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.inbox-preview .from { font-weight: 700; }
.inbox-preview .subj { font-weight: 600; }
.inbox-preview .pre { color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.check-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; }
.check-list .ok { color: var(--green); font-weight: 800; }
.check-list .bad { color: var(--red); font-weight: 800; }
.phone { width: 390px; max-width: 100%; height: 760px; border: 12px solid #16161B; border-radius: 40px; overflow: hidden; background: #fff; margin: auto; }
.phone iframe { width: 100%; height: 100%; border: 0; }
.rule { display: grid; grid-template-columns: 1.3fr 1fr 1.3fr auto; gap: 8px; align-items: center; }
.rule .two { display: flex; gap: 6px; align-items: center; }
.rule .when { grid-column: 1 / -1; gap: 8px; margin: -2px 0 6px; }
.rule .when select { width: auto; }
.fan-plays { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.fan-play { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.fan-play .fan-count { font-size: 20px; font-weight: 800; }
@media (max-width: 980px) { .fan-plays { grid-template-columns: 1fr; } }
.rule-group { border: 1px dashed #C9CBD3; border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; background: #FBFBFC; }
.kbd { font-family: var(--mono); font-size: 11.5px; background: var(--gray-soft); border-radius: 4px; padding: 1px 5px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 4px 11px; cursor: pointer; font-size: 12.5px; font-weight: 600; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.approval { border: 2px solid #F7DC8E; background: #FFFBEB; border-radius: 12px; padding: 16px 18px; }

@media (max-width: 980px) {
  .sidebar { position: fixed; left: -260px; z-index: 60; transition: left .2s; }
  body.nav-open .sidebar { left: 0; }
  .menu-btn { display: inline-flex; }
  #view.full { height: auto; overflow: visible; }
  .g3, .g4, .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-contact-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g-contact-stats .spend-tile { grid-column: 1 / -1; }
  .editor { grid-template-columns: 1fr; height: auto; }
  .editor-side { max-height: 60vh; }
  .who span { display: none; }
}
@media (max-width: 640px) {
  #view { padding: 16px; }
  .g2, .g3, .g4, .g5 { grid-template-columns: minmax(0, 1fr); }
  .g-contact-stats { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 0 12px; }
  .rule { grid-template-columns: 1fr; }
}

/* ---------- editor additions ---------- */
.block-dots { position: absolute; inset: 0; pointer-events: none; }
.bdot { position: absolute; pointer-events: none; width: 30px; height: 26px; border-radius: 7px; border: 1px solid rgba(0,0,0,.12); background: rgba(255,255,255,.94); box-shadow: 0 2px 6px rgba(0,0,0,.18); cursor: pointer; font-size: 18px; line-height: 1; color: var(--ink); opacity: 0; transition: opacity .12s; }
.bdot.hov, .bdot.sel, .bdot:focus-visible { opacity: 1; pointer-events: auto; }
.layer .layer-dots { border: 0; background: transparent; font-size: 18px; line-height: 1; padding: 0 6px; border-radius: 6px; cursor: pointer; color: var(--ink-3); }
.layer .layer-dots:hover { background: var(--gray-soft); color: var(--ink); }
.pop-menu { position: fixed; z-index: 80; min-width: 190px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.18); padding: 5px; display: flex; flex-direction: column; max-height: 60vh; overflow-y: auto; }
.pop-menu button { text-align: left; border: 0; background: transparent; padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 13.5px; color: var(--ink); display: flex; justify-content: space-between; gap: 14px; }
.pop-menu button:hover:not(:disabled) { background: var(--gray-soft); }
.pop-menu button:disabled { color: var(--ink-3); cursor: default; }
.pop-menu button.danger { color: var(--red); }
.pop-menu .hint { color: var(--ink-3); font-size: 11.5px; font-family: ui-monospace, monospace; }
.pop-menu .sep { height: 1px; background: var(--line-2); margin: 4px 2px; }
.btn.hist { font-weight: 600; }
.btn.hist:disabled { opacity: .45; cursor: default; }
.ft-wrap { position: relative; display: block; }
.ft-wrap input, .ft-wrap textarea { width: 100%; padding-right: 74px; }
.ft-tools { position: absolute; right: 5px; top: 5px; display: flex; gap: 3px; }
.ft-wrap:not(.ta) .ft-tools { top: 50%; transform: translateY(-50%); }
.ft-btn { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 1px 6px; font-size: 11.5px; font-weight: 700; color: var(--ink-2); cursor: pointer; font-family: ui-monospace, monospace; line-height: 18px; }
.ft-btn:hover { border-color: #C7CAD3; color: var(--ink); }
.ft-btn.caps.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.is-caps { text-transform: uppercase; }
.rich-bar .grow { flex: 1; }
.rich-bar .ft-btn { padding: 2px 8px; }
.crop-box { position: relative; overflow: hidden; border-radius: 8px; cursor: crosshair; touch-action: none; user-select: none; background: #EEF0F3; }
.crop-box img { display: block; width: 100%; height: auto; pointer-events: none; }
.crop-frame { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 999px rgba(10,12,20,.5); border-radius: 2px; pointer-events: none; display: none; }
.crop-dot { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; border: 2px solid #fff; background: var(--blue); box-shadow: 0 1px 4px rgba(0,0,0,.4); pointer-events: none; }
.ratio-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.ratio-chips button, .seg.sm button { font-size: 12px; }
.ratio-chips button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 10px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.ratio-chips button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg.sm { flex-wrap: wrap; }
.seg.sm button { padding: 4px 10px; }
.zoom-row { flex-direction: row !important; align-items: center; gap: 10px; }
.zoom-row input { flex: 1; }
.hint.warn, label.f .hint.warn { color: var(--amber); }
.swatch { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line); cursor: pointer; padding: 0; flex: none; }
.pv-stage { background: #E7E9EE; border-radius: 12px; padding: 18px; display: flex; justify-content: center; max-height: 70vh; overflow: auto; }
.pv-device { background: #fff; box-shadow: 0 8px 30px rgba(0,0,0,.12); align-self: flex-start; }
.pv-device.mobile { width: 390px; border: 12px solid #16161B; border-radius: 36px; overflow: hidden; }
.pv-device.desktop { width: 680px; border-radius: 6px; overflow: hidden; }
.pv-frame { width: 100%; height: 66vh; border: 0; display: block; }
.kit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.kit-card { overflow: hidden; display: flex; flex-direction: column; }
.kit-prev { display: block; height: 170px; overflow: hidden; background: #EEF0F3; border-bottom: 1px solid var(--line-2); position: relative; }
.kit-thumb { width: 640px; height: 420px; border: 0; transform: scale(.46); transform-origin: 0 0; pointer-events: none; position: absolute; left: 50%; margin-left: -147px; }
.role-list { display: grid; gap: 8px; }
.role-list > div { display: flex; gap: 10px; align-items: baseline; }
.role-list b { min-width: 74px; }
.autosave.busy { color: var(--ink-3); }
.autosave.saved { color: var(--green); }
.autosave.err { color: var(--red); }
.count-badge { display: inline-block; vertical-align: middle; font-size: 15px; font-weight: 700; background: var(--gray-soft); color: var(--ink-2); border-radius: 999px; padding: 3px 12px; margin-left: 6px; }
.contact-totals { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.contact-totals .ct { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; display: flex; flex-direction: column; min-width: 120px; color: var(--ink); }
.contact-totals .ct b { font-size: 22px; font-weight: 800; }
.contact-totals .ct span { font-size: 12.5px; color: var(--ink-3); }
.contact-totals a.ct:hover { border-color: #C7CAD3; }
.contact-totals .ct.on { border-color: var(--blue); background: #F0F5FF; }
.test-sum { background: var(--gray-soft); border-radius: 8px; padding: 10px 12px; font-size: 13.5px; }
.outbox-counts { display: flex; gap: 6px; margin: 4px 0; }
.opp-logo{width:34px;height:34px;flex:0 0 34px;border-radius:50%;border:1px solid var(--line,#ddd);display:flex;align-items:center;justify-content:center;padding:4px;cursor:pointer;color:#fff;font-weight:700}
.opp-logo img{width:100%;height:100%;object-fit:contain}
/* Phone frame: Safari doesn't clip iframes to a rounded parent, so round and mask them too. */
.device.mobile, .pv-device.mobile { background: #16161B; isolation: isolate; -webkit-mask-image: -webkit-radial-gradient(white, black); mask-image: radial-gradient(white, black); }
.device.mobile iframe, .pv-device.mobile iframe { border-radius: 24px; background: #fff; }
.tc-btn { min-width: 28px; }
.mark-note { font-size: 12px; font-weight: 600; color: #B0008F; background: #FFE6F8; border-radius: 6px; padding: 3px 8px; }
.kit-pv-scroll { max-height: calc(100vh - 150px); overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }

/* Sign-in */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.signin form { width: 100%; max-width: 380px; }
.signin-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.signin-brand b { display: block; font-size: 20px; }
.signin-brand small { color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; font-size: 11px; font-weight: 600; }
.acct { font-weight: 600; }
.user-off td { color: var(--ink-3); }
/* Review & send: who it goes to */
.aud-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.aud-list li { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; }
.aud-list li .muted { min-width: 58px; text-transform: uppercase; letter-spacing: .4px; font-size: 11px; }

/* ================================================================== Bullpen (sponsor CRM) */
.brand img { border-radius: 9px; }
.nav-count { float: right; background: rgba(255,255,255,.14); color: #fff; border-radius: 99px; font-size: 11px; font-weight: 700; padding: 1px 7px; margin-top: 1px; }
#nav a.active .nav-count { background: rgba(255,255,255,.25); }
.suite { display: flex; flex-direction: column; gap: 4px; }
.suite-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; color: #6F6F7A; font-weight: 600; margin-bottom: 4px; }
.suite-app { display: grid; grid-template-columns: 22px 1fr; column-gap: 9px; align-items: center; color: #C9C9D1; padding: 6px 8px; border-radius: 8px; font-weight: 600; font-size: 13px; }
.suite-app img { width: 22px; height: 22px; object-fit: contain; grid-row: span 2; border-radius: 5px; }
.suite-app span { font-size: 11px; font-weight: 500; color: #8F8F99; }
.suite-app:hover { background: #1E1E24; color: #fff; }
.suite-app.on { background: #1E1E24; color: #fff; }

.top-search { flex: 0 1 340px; min-width: 120px; }
.top-search input { width: 100%; background: var(--bg); }
.search-pop { position: fixed; z-index: 70; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.18); padding: 5px; max-height: 70vh; overflow-y: auto; }
.search-pop .sr { display: grid; grid-template-columns: 64px 1fr; column-gap: 8px; padding: 7px 10px; border-radius: 6px; color: var(--ink); }
.search-pop .sr > .muted { grid-column: 2; }
.search-pop .sr:hover, .search-pop .sr.on { background: var(--gray-soft); }
.sr-kind { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-3); font-weight: 700; padding-top: 2px; grid-row: span 2; }

.filters { padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.filters-bar { margin-bottom: 14px; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.mini-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-3); font-weight: 700; margin-bottom: 6px; }
.link-btn { background: none; border: 0; color: var(--ink-3); cursor: pointer; font-size: 11px; padding: 0 4px; }
.link-btn:hover { color: var(--red); }
.stale { color: var(--amber); }
.overdue { color: var(--red); font-weight: 700; }
.due-today { color: var(--amber); font-weight: 700; }
.icon-btn.dots { font-size: 18px; line-height: 1; padding: 2px 8px; color: var(--ink-3); }

/* profile pages: details on the left, history on the right */
.profile { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 16px; align-items: start; }
.profile-side, .profile-main { min-width: 0; }
.profile .card-pad { padding: 16px 18px; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 10px 0 0; font-size: 13.5px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv + .kv { margin-top: 6px; }
.background { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-2); font-size: 13.5px; }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--red-soft); color: var(--red-dark); font-weight: 800; font-size: 12.5px; flex: none; }
.avatar.big { width: 52px; height: 52px; font-size: 18px; }
.people { display: flex; flex-direction: column; margin-top: 8px; }
.person-row { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--line-2); }
.person-row:first-child { border-top: 0; }
.person-row .grow { min-width: 0; overflow-wrap: anywhere; }
.contact-links a { color: var(--ink-2); }
.former, .done-tasks { margin-top: 10px; font-size: 13px; }
.former summary, .done-tasks summary, .follow summary { cursor: pointer; color: var(--ink-3); font-weight: 600; font-size: 13px; }
.former-row { padding: 4px 0; }
.co-box { margin-top: 8px; }
.past-jobs { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.group-boxes { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 12px; max-height: 50vh; overflow-y: auto; }
a.tag:hover { background: #E2E5EA; }
.form-grid .wide-f { grid-column: 1 / -1; }

/* log box */
.composer textarea { width: 100%; resize: vertical; }
.composer .seg { flex-wrap: wrap; }
.act-form .when-inline input { width: auto; }
.chip { font-weight: 500; }
.follow { font-size: 13px; }

/* history */
.timeline { display: flex; flex-direction: column; }
.tl-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--ink-3); font-weight: 700; padding: 12px 20px 4px; background: #FBFBFC; border-bottom: 1px solid var(--line-2); }
.tl-label.day { font-size: 12.5px; letter-spacing: .3px; text-transform: none; color: var(--ink-2); padding: 10px 20px; }
.act { display: flex; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line-2); }
.act:last-child { border-bottom: 0; }
.act.future { background: #F7FAFF; }
.act-main { flex: 1; min-width: 0; }
.act-head { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; }
.act-what { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; min-width: 0; }
.act-co { font-weight: 600; }
.kind-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-3); }
.person-chip { font-size: 12.5px; background: var(--gray-soft); color: var(--ink-2); border-radius: 99px; padding: 1px 9px; font-weight: 600; }
.person-chip:hover { background: #E2E5EA; }
.act-meta { color: var(--ink-3); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 0 5px; margin-top: 2px; }
.act-body { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 6px; line-height: 1.55; }
.act.k-stage .act-what b { font-weight: 600; color: var(--ink-2); }
.kind-ic { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; background: var(--gray-soft); color: var(--ink-2); }
.kind-ic.k-call { background: #E7F6EC; color: var(--green); }
.kind-ic.k-meeting { background: #EAF1FE; color: var(--blue); }
.kind-ic.k-email { background: var(--amber-soft); color: var(--amber); }
.kind-ic.k-stage { background: var(--red-soft); color: var(--red); font-size: 12px; }

/* tasks */
.tasks { display: flex; flex-direction: column; }
.task { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.task:last-child { border-bottom: 0; }
.task input[type=checkbox] { margin-top: 3px; width: 16px; height: 16px; flex: none; }
.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 600; cursor: pointer; overflow-wrap: anywhere; }
.task.done .task-title { text-decoration: line-through; color: var(--ink-3); }
.task-meta { font-size: 12.5px; color: var(--ink-3); }

/* deals */
.pill.stage.open { background: color-mix(in srgb, var(--blue) calc(var(--p, .3) * 22%), #EEF0F3); color: #1E3A8A; }
.pill.stage.won { background: var(--green-soft); color: var(--green); }
.pill.stage.lost { background: var(--gray-soft); color: var(--ink-3); }
.pill.stage::before { display: none; }
.deal-list { display: flex; flex-direction: column; margin-top: 6px; }
.deal-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; text-align: left; background: none; border: 0; border-top: 1px solid var(--line-2); padding: 9px 0; cursor: pointer; font: inherit; color: inherit; }
.deal-row:first-child { border-top: 0; }
.deal-row:hover b { color: var(--blue); }
.deal-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.deal-col { background: #EEF0F3; border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.deal-col.over { outline: 2px dashed var(--blue); outline-offset: -2px; }
.deal-col-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; padding: 2px 4px 4px; }
.deal-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; cursor: pointer; box-shadow: var(--shadow); overflow-wrap: anywhere; }
.deal-card:hover { border-color: #C7CAD3; }
.deal-card.dragging { opacity: .5; }

/* home */
.home-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
.agenda { display: flex; flex-direction: column; }
.agenda-day { font-size: 12.5px; font-weight: 700; color: var(--ink-2); padding: 10px 20px 6px; background: #FBFBFC; border-bottom: 1px solid var(--line-2); }
.agenda-item { display: flex; gap: 12px; align-items: center; padding: 10px 20px; border-bottom: 1px solid var(--line-2); color: var(--ink); }
.agenda-item:hover { background: #FAFAFB; }
.agenda-item .grow { min-width: 0; }
.agenda-time { width: 66px; flex: none; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink-2); font-size: 13px; }
.stage-sum { display: flex; flex-direction: column; margin-top: 8px; }
.stage-line { display: flex; gap: 10px; align-items: center; padding: 6px 0; color: var(--ink); border-top: 1px solid var(--line-2); }
.stage-line:first-child { border-top: 0; }
.quiet { display: flex; flex-direction: column; margin-top: 8px; }
.quiet-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line-2); color: var(--ink); }
.quiet-row:first-child { border-top: 0; }
.quiet-row span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty.small { padding: 28px 20px; }

/* month calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head { font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-3); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.cal-day { min-height: 104px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day:nth-child(7n + 7) { border-right: 0; }
.cal-day.other { background: #FBFBFC; }
.cal-day.other .cal-num { color: #B6B7BF; }
.cal-day.today .cal-num { background: var(--red); color: #fff; border-radius: 99px; padding: 0 7px; align-self: flex-start; }
.cal-num { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.cal-item { text-align: left; border: 0; border-radius: 5px; padding: 2px 6px; font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: #EAF1FE; color: #1E3A8A; }
.cal-item.k-call { background: #E7F6EC; color: #14532D; }
.cal-time { font-weight: 700; }

/* pickers */
.pick { position: relative; }
.pick input { width: 100%; }
.pick-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 90; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.18); padding: 4px; max-height: 260px; overflow-y: auto; }
.pick-row { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 6px; cursor: pointer; font: inherit; color: var(--ink); }
.pick-row:hover { background: var(--gray-soft); }
.pick-row.new { color: var(--blue); font-weight: 600; }

@media (max-width: 1100px) {
  .home-grid { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .profile { grid-template-columns: minmax(250px, 300px) minmax(0, 1fr); }
  .top-search { flex-basis: 220px; }
  .cal-day { min-height: 78px; }
}
@media (max-width: 640px) {
  .top-search { display: none; }
  .act { padding: 12px 14px; }
  .cal-item .cal-time { display: none; }
}
td.nowrap { white-space: nowrap; }

.filters-bar select, .page-head label.row select, .filters select { width: auto; max-width: 100%; }
label.row { flex-wrap: nowrap; }

.cal-opt { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; gap: 8px; }
.cal-opt h3 { margin: 0; }
@media (max-width: 780px) {
  .profile { grid-template-columns: 1fr; }
}

/* People, companies and their phone/email read as text (black), not blue links; underline on hover. */
a[href^="#/companies/"], a[href^="#/people/"], a[href^="tel:"], a[href^="mailto:"] { color: var(--ink); }
a[href^="#/companies/"]:hover, a[href^="#/people/"]:hover, a[href^="tel:"]:hover, a[href^="mailto:"]:hover { text-decoration: underline; }
.contact-links a, .act-meta a { color: var(--ink-2); }
a.person-chip { color: var(--ink-2); }
a.person-chip:hover { text-decoration: none; }
.rem-ic { font-size: 15px; line-height: 1.4; flex: none; }
.task.reminder.due { background: #FFFBEB; margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 6px; }

/* ---------- Bird Brain ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend i.dash { width: 16px; height: 0; border-top: 2px dashed var(--ink); border-radius: 0; }
.up { color: var(--green); font-weight: 600; font-size: 12.5px; }
.down { color: var(--red); font-weight: 600; font-size: 12.5px; }
.up .muted, .down .muted { font-weight: 400; }
.stat .s .up, .stat .s .down { font-size: 12.5px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 9px 14px; font-weight: 600; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--red); }
.tabs a:hover { color: var(--ink); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.play-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.play { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; cursor: pointer; }
.play:hover { border-color: var(--ink-3); }
.play h3 { margin: 0; font-size: 15.5px; line-height: 1.3; }
.play .why { color: var(--ink-2); font-size: 13px; line-height: 1.45; }
.play .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--ink-3); margin-top: auto; }
.play .count { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pill.now { background: var(--green-soft); color: var(--green); }
.pill.later { background: var(--gray-soft); color: var(--ink-3); }
.pill.sold { background: var(--green-soft); color: var(--green); }
.pill.hold { background: var(--amber-soft); color: var(--amber); }
.pill.pitched { background: #E8EFFE; color: var(--blue); }
.pill.released { background: var(--gray-soft); color: var(--ink-3); }
.pill.pending { background: var(--amber-soft); color: var(--amber); }
.inv-item { padding: 14px 18px; border-top: 1px solid var(--line-2); }
.inv-item:first-child { border-top: 0; }
.inv-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.inv-head b { font-size: 14.5px; }
.inv-asg { display: grid; grid-template-columns: minmax(0, 2fr) auto auto auto auto; gap: 6px 14px; align-items: center; margin-top: 8px; font-size: 13px; }
.inv-asg > div { display: contents; }
.chips.months span { padding: 2px 7px; border-radius: 6px; background: var(--gray-soft); color: var(--ink-3); font-size: 11.5px; font-weight: 600; }
.chips.months span.on { background: var(--ink); color: #fff; }
.chips.months span.now { outline: 2px solid var(--red); outline-offset: 1px; }
.placeholder-card { border-style: dashed; background: var(--line-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.fan-plays { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.fan-play { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.fan-play .fan-count { font-size: 20px; font-weight: 800; }
@media (max-width: 980px) { .fan-plays { grid-template-columns: 1fr; } }
.play .count { color: var(--ink); }
@media (max-width: 1100px) { .grid[style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; } }
.period-pick { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.period-pick input[type=date] { width: auto; }
td.sub-rows { background: var(--bg, #f6f6f8); padding: 6px 16px 12px; }
tr.open td { font-weight: 600; }
.pill.biz { background: #E8EEFC; color: #1D4ED8; }
.pill.likely { background: #F1EEFC; color: #5B3FC4; }
.score { display: inline-block; min-width: 34px; padding: 2px 6px; border-radius: 6px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, #2a78d6 calc(var(--s) * 0.45%), #EEF0F3); color: var(--ink); }
tr.order-row { cursor: pointer; }
tr.order-row .caret { display: inline-block; width: 1em; color: var(--ink-3); }
tr.order-item td { font-size: 13px; background: rgba(0,0,0,.025); }
table.t tr.year-row .ys { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
table.t tr.year-row .ys-range { font-weight: 500; letter-spacing: 0; color: var(--ink-3); opacity: .8; }
table.t tr.year-row .ys-sum { margin-left: auto; display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; font-weight: 500; letter-spacing: 0; }
table.t tr.year-row .ys-part b { color: var(--ink-2); font-weight: 700; }
table.t tr.year-row .ys-total { color: var(--ink); font-weight: 800; font-size: 13px; }
.deal-line { display: grid; grid-template-columns: minmax(0, 2.4fr) 90px 120px 150px 36px; gap: 10px; align-items: end; }
.deal-line [hidden] { display: block; visibility: hidden; }
/* Schedule */
.gcal-wrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(560px, 1fr)); gap: 0 16px; }
.gcal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.gcal-head { padding: 6px 8px; font-size: 11px; font-weight: 700; letter-spacing: .5px; color: var(--ink-3); text-transform: uppercase; border-bottom: 1px solid var(--line); }
.gcal-cell { min-height: 84px; padding: 4px 6px 6px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); font-size: 11.5px; line-height: 1.3; overflow: hidden; cursor: pointer; }
.gcal-cell.blank { background: var(--bg); cursor: default; }
.gcal-cell.game { background: #FFF8F8; }
.gcal-cell.past { opacity: .72; }
.gcal-cell.today .gcal-day { background: var(--red); color: #fff; border-radius: 10px; padding: 0 6px; display: inline-block; }
.gcal-day { font-weight: 700; color: var(--ink-3); font-size: 11px; }
.gcal-opp { font-weight: 700; color: var(--ink); }
.gcal-promo { color: var(--red-dark); }
.gs { font-size: 11.5px; padding: 1px 6px; border-radius: 5px; margin-top: 2px; background: var(--green-soft); color: var(--green); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs.hold, .gs.pitched { background: var(--amber-soft); color: var(--amber); }
td .gs { white-space: normal; display: inline-block; margin: 2px 4px 2px 0; }
tr.past td { color: var(--ink-3); }

/* Fan Universe */
.uni { display: grid; grid-template-columns: minmax(220px, 1fr) repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.uni-size { display: flex; flex-direction: column; justify-content: center; text-align: center; padding: 18px; }
.uni-size .v { font-size: 34px; font-weight: 800; letter-spacing: -.6px; font-variant-numeric: tabular-nums; }
.uni-size .k { color: var(--ink-2); font-weight: 600; }
.uni-size dl { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; text-align: left; }
.uni-size dt { color: var(--ink-3); } .uni-size dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.uni-tile { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.uni-tile .top { padding: 14px 16px 6px; text-align: center; }
.uni-tile .top .v { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.uni-tile .top .k { font-weight: 600; color: var(--ink-2); }
.uni-tile .top .s { font-size: 12px; color: var(--ink-3); min-height: 16px; }
.uni-tile .spark { display: block; width: 100%; height: 90px; margin-top: auto; }
.uni-tile .foot { border-top: 1px solid var(--line); padding: 8px; text-align: center; font-size: 12.5px; color: var(--ink-3); background: var(--gray-soft); }
.chips-pick { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }
.chips-pick label { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; font-size: 13px; cursor: pointer; background: #fff; }
.chips-pick label.on { border-color: var(--ink-2); background: var(--gray-soft); font-weight: 600; }
.chips-pick input { margin: 0; }
.explore-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; }
.explore-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 64px 64px; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; border-top: 1px solid var(--line); }
.explore-row:first-of-type { border-top: 0; }
.explore-row .bars { display: flex; flex-direction: column; gap: 3px; }
.explore-row .bars i { display: block; height: 7px; border-radius: 3px; }
.explore-row .num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) { .uni { grid-template-columns: repeat(2, minmax(0, 1fr)); } .uni-size { grid-column: 1 / -1; } }

/* Funnels */
.funnel { display: flex; flex-direction: column; gap: 6px; }
.funnel-step { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr) 96px; gap: 12px; align-items: center; }
.funnel-label { font-size: 13.5px; font-weight: 600; }
.funnel-bar { height: 26px; background: var(--gray-soft); border-radius: 4px; overflow: hidden; }
.funnel-bar > i { display: block; height: 100%; border-radius: 4px; }
.funnel-n { text-align: right; font-variant-numeric: tabular-nums; }
.channel-off { opacity: .6; }

/* Two-step sign-in (two-step.js) */
.two-step-qr { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.two-step-qr .qr { width: 200px; height: 200px; background: #fff; padding: 6px; border-radius: 8px; border: 1px solid #e3e6ea; }
.two-step-qr .qr svg { width: 100%; height: 100%; display: block; }
.setup-key { font-size: 14px; letter-spacing: .04em; word-break: break-all; user-select: all; }
.code-input { font-size: 22px; letter-spacing: .25em; text-align: center; font-variant-numeric: tabular-nums; }
pre.backup-codes { font-size: 15px; line-height: 1.7; padding: 10px 14px; background: #f5f6f8; border-radius: 8px; columns: 2; margin: 0; user-select: all; }
