/* Pars and Brews demo portal. Dark lounge chrome, lime accent, 8 px grid. */
:root {
  --black: #000000;
  --bg: #000000;
  --surface: #111111;
  --surface-2: #1a1a1a;
  --line: #2a2a2a;
  --line-strong: #3a3a3a;
  --text: #ffffff;
  --muted: #b0b0b0;
  --dim: #595959;
  --lime: #bada55;
  --lime-deep: #a3c43a;
  --grey-1: #e8e6e6;
  --grey-2: #c7c7c7;
  --ink: #1f1f1f;
  --danger: #ff7a7a;
  --radius: 4px;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Inter Tight", "Archivo", "Inter", system-ui, sans-serif;
  --shell: 1280px;
  --gutter: 16px;
  --row: 32px;
}
@media (min-width: 900px) {
  :root { --gutter: 32px; --row: 40px; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-head); margin: 0; line-height: 1.1; letter-spacing: -0.01em; }
h1 { font-size: 36px; font-weight: 800; }
h2 { font-size: 24px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0; }
@media (min-width: 900px) {
  h1 { font-size: 56px; }
  h2 { font-size: 32px; }
}
.muted { color: var(--muted); }
.small { font-size: 14px; }
.shell { width: 100%; max-width: var(--shell); margin: 0 auto; padding: 0 var(--gutter); }
.stack > * + * { margin-top: 16px; }

/* ---- header */
.site-head { border-bottom: 1px solid var(--line); }
.site-head .shell {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "logo phone" "nav nav";
  align-items: center;
  gap: 8px 16px;
  padding-top: 16px;
  padding-bottom: 16px;
}
.logo { grid-area: logo; display: inline-flex; align-items: center; height: 40px; text-decoration: none; }
.logo img { height: 40px; width: auto; display: block; }
.nav { grid-area: nav; display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; font-weight: 500; }
.nav a { display: inline-flex; align-items: center; min-height: 40px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--lime); }
.phone-slot { grid-area: phone; text-align: right; font-size: 14px; line-height: 1.2; }
.phone-slot .label { color: var(--muted); font-size: 12px; display: block; }
.phone-slot a, .phone-slot span.num { color: var(--lime); font-weight: 700; font-family: var(--font-head); font-size: 18px; text-decoration: none; }
.phone-slot span.pending { color: var(--muted); font-weight: 500; font-size: 14px; }
@media (min-width: 900px) {
  .site-head .shell {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "logo nav phone";
    padding-top: 24px;
    padding-bottom: 24px;
  }
  .logo img { height: 48px; }
  .logo { height: 48px; }
  .nav { justify-content: center; gap: 32px; font-size: 15px; }
}

main { flex: 1; padding: 32px 0 64px; }
@media (min-width: 900px) { main { padding: 48px 0 96px; } }

/* ---- footer */
.site-foot { border-top: 1px solid var(--line); padding: 24px 0; font-size: 13px; color: var(--muted); }
.site-foot .shell { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-foot .fuel { color: var(--muted); text-decoration: none; }
.site-foot .fuel strong { color: var(--grey-2); font-weight: 600; }

/* ---- buttons and inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 48px; padding: 0 24px; border-radius: var(--radius);
  background: var(--lime); color: var(--black); border: 2px solid var(--lime);
  font-family: var(--font-head); font-weight: 700; font-size: 15px; letter-spacing: 0.04em; text-transform: uppercase;
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--lime-deep); border-color: var(--lime-deep); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--grey-2); }
.btn-sm { height: 40px; padding: 0 16px; font-size: 13px; }
.btn-block { width: 100%; }

label.field { display: block; }
label.field > span, .field-label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.input, select.input {
  width: 100%; height: 48px; padding: 0 16px; border-radius: var(--radius);
  background: var(--surface); color: var(--text); border: 1px solid var(--line-strong);
  font: inherit; font-size: 16px; outline: none; -webkit-appearance: none; appearance: none;
}
.input:focus { border-color: var(--lime); }
input[type="date"].input { color-scheme: dark; }
select.input {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 22px) 21px, calc(100% - 16px) 21px;
  background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; padding-right: 40px;
}
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--lime); flex: none; }
.error { color: var(--danger); font-size: 14px; min-height: 20px; }
.error:empty { display: none; }

/* ---- hero + hub */
.hero { display: grid; gap: 24px; }
.hero p.lead { font-size: 18px; color: var(--muted); max-width: 640px; }
.hero .demo-number { display: grid; gap: 4px; }
.hero .demo-number .label { font-size: 14px; color: var(--muted); }
.hero .demo-number a, .hero .demo-number .num {
  font-family: var(--font-head); font-weight: 800; font-size: 40px; color: var(--lime); text-decoration: none; line-height: 1;
}
.hero .demo-number .pending { font-family: var(--font-head); font-weight: 700; font-size: 24px; color: var(--muted); }
@media (min-width: 900px) {
  .hero { grid-template-columns: 1fr auto; align-items: end; gap: 48px; }
  .hero .demo-number a, .hero .demo-number .num { font-size: 56px; }
}
.section { margin-top: 48px; }
.section > h2 { margin-bottom: 24px; }
@media (min-width: 900px) { .section { margin-top: 64px; } }
.cards { display: grid; gap: 16px; grid-template-columns: 1fr; grid-auto-rows: 1fr; }
@media (min-width: 600px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; } }
.card {
  display: flex; flex-direction: column; gap: 8px; padding: 24px; min-height: 160px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: inherit; transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--lime); transform: translateY(-2px); }
.card h3 { font-size: 20px; }
.card p { color: var(--muted); font-size: 15px; flex: 1; }
.card .go { color: var(--lime); font-weight: 600; font-size: 14px; }
.facts { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; } }
.fact { padding: 16px 0; border-top: 1px solid var(--line); }
.fact h3 { margin-bottom: 8px; }
.fact p { color: var(--muted); font-size: 15px; }

/* ---- placeholder */
.placeholder { display: grid; gap: 16px; max-width: 640px; }
.placeholder p { color: var(--muted); font-size: 18px; }

/* ---- board */
.board-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.day-switch { display: flex; align-items: center; gap: 8px; }
.day-switch .btn-ghost { min-width: 48px; padding: 0 12px; }
.day-label { display: grid; gap: 2px; }
.day-label strong { font-family: var(--font-head); font-size: 20px; font-weight: 700; }
.day-label span { font-size: 13px; color: var(--muted); }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); align-items: center; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.legend .phone i { background: var(--lime); }
.legend .web i { background: var(--grey-1); }
.board-wrap { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) { .board-wrap { grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; } }

.grid { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.grid-head, .grid-body { display: grid; grid-template-columns: 44px repeat(5, minmax(0, 1fr)); }
@media (min-width: 900px) { .grid-head, .grid-body { grid-template-columns: 64px repeat(5, minmax(0, 1fr)); } }
.grid-head { border-bottom: 1px solid var(--line-strong); background: var(--surface-2); }
.grid-head > div { height: 40px; display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-weight: 700; font-size: 13px; border-left: 1px solid var(--line); }
.grid-head > div:first-child { border-left: 0; }
@media (min-width: 900px) { .grid-head > div { height: 48px; font-size: 15px; } }
.timecol { position: relative; }
.timecol .t { position: absolute; left: 0; right: 0; transform: translateY(-50%); text-align: center; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.timecol .t:first-child { transform: none; }
@media (min-width: 900px) { .timecol .t { font-size: 12px; } }
.bay {
  position: relative; border-left: 1px solid var(--line);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--row) - 1px), var(--line) calc(var(--row) - 1px), var(--line) var(--row));
}
.blk {
  position: absolute; left: 2px; right: 2px; border-radius: var(--radius); padding: 4px 6px; overflow: hidden;
  color: var(--black); font-size: 11px; line-height: 1.25; cursor: default;
  display: flex; flex-direction: column; gap: 1px;
}
@media (min-width: 900px) { .blk { padding: 8px; font-size: 13px; left: 4px; right: 4px; } }
.blk.phone { background: var(--lime); }
.blk.web { background: var(--grey-1); }
.blk strong { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.blk span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; opacity: .8; }
.blk.incoming { animation: incoming 2.4s ease-out 1; }
@keyframes incoming {
  0% { box-shadow: 0 0 0 0 rgba(186, 218, 85, .9); transform: scale(1.04); }
  60% { box-shadow: 0 0 0 12px rgba(186, 218, 85, 0); transform: scale(1); }
  100% { box-shadow: 0 0 0 0 rgba(186, 218, 85, 0); transform: scale(1); }
}
.now-line { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--danger); pointer-events: none; }

.rail { display: grid; gap: 24px; }
.rail h2 { font-size: 20px; display: flex; align-items: center; gap: 8px; }
.rail .status { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: auto; font-family: var(--font-body); }
.rail .status.live::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); margin-right: 6px; animation: blink 1.6s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.calls { display: grid; gap: 8px; }
.call { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 8px; }
.call.incoming { animation: incoming 2.4s ease-out 1; }
.call .top { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.call .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none; }
.call .dot.live { background: var(--lime); animation: blink 1.2s infinite; }
.call .num { font-weight: 600; }
.call .dur { color: var(--muted); margin-left: auto; font-variant-numeric: tabular-nums; }
.call .sum { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.call .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.call .code { color: var(--lime); font-weight: 600; }
.inqs { display: grid; gap: 8px; }
.inq { padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-size: 13px; display: grid; gap: 2px; }
.inq strong { font-weight: 600; }
.inq span { color: var(--muted); }
.empty { color: var(--muted); font-size: 14px; padding: 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius); }

.toast {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 40;
  background: var(--lime); color: var(--black); padding: 16px; border-radius: var(--radius);
  font-weight: 600; font-size: 15px; transform: translateY(120%); opacity: 0; transition: transform .25s, opacity .25s;
}
.toast.show { transform: none; opacity: 1; }
@media (min-width: 900px) { .toast { left: auto; right: 32px; bottom: 32px; width: 360px; } }

.drawer-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 50; opacity: 0; pointer-events: none; transition: opacity .2s; }
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; z-index: 60; background: var(--surface); border-left: 1px solid var(--line);
  top: 0; right: 0; bottom: 0; width: 100%; max-width: 480px; transform: translateX(100%); transition: transform .25s;
  display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.drawer .d-head { padding: 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px; }
.drawer .d-head h3 { font-size: 18px; flex: 1; }
.drawer .d-meta { padding: 16px; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--muted); display: grid; gap: 4px; }
.drawer .d-body { padding: 16px; overflow: auto; white-space: pre-wrap; font-size: 14px; line-height: 1.6; color: var(--grey-2); }
.drawer .d-body.empty-text { color: var(--muted); }
.x { width: 40px; height: 40px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: transparent; color: var(--text); font-size: 20px; cursor: pointer; }

/* ---- book flow */
.book { max-width: 560px; margin: 0 auto; display: grid; gap: 24px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.steps div { height: 40px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); border-top: 3px solid var(--line-strong); padding-top: 8px; }
.steps div b { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex: none; }
.steps div.active { color: var(--text); border-top-color: var(--lime); }
.steps div.active b { background: var(--lime); color: var(--black); border-color: var(--lime); }
.steps div.done { color: var(--grey-2); border-top-color: var(--lime); }
.steps div.done b { border-color: var(--lime); color: var(--lime); }
.panel { display: none; gap: 24px; }
.panel.active { display: grid; }
.panel h2 { font-size: 28px; }
.row2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .row2 { grid-template-columns: 1fr 1fr; } }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg button {
  height: 48px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--lime); color: var(--black); border-color: var(--lime); }
.summary { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-size: 15px; display: grid; gap: 4px; }
.summary strong { font-family: var(--font-head); font-size: 18px; }
.bucket h3 { margin-bottom: 12px; }
.slots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 600px) { .slots { grid-template-columns: repeat(3, 1fr); } }
.slot {
  min-height: 64px; padding: 8px 12px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  font: inherit; cursor: pointer; display: grid; gap: 2px; text-align: left; align-content: center;
}
.slot strong { font-weight: 600; font-size: 15px; }
.slot span { font-size: 13px; color: var(--muted); }
.slot[aria-pressed="true"] { background: var(--lime); color: var(--black); border-color: var(--lime); }
.slot[aria-pressed="true"] span { color: var(--ink); }
.note { font-size: 13px; color: var(--dim); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions .btn { flex: 1; }
.confirm .code { font-family: var(--font-head); font-weight: 800; font-size: 48px; color: var(--lime); letter-spacing: .02em; line-height: 1; }
.confirm dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 24px; font-size: 15px; }
.confirm dt { color: var(--muted); }
.confirm dd { margin: 0; }
.confirm .total { font-weight: 700; }
.confirm a.plain { color: var(--lime); font-weight: 600; text-decoration: none; }

/* ---- leg B: shared page head, tabs, tables */
.page-head { display: grid; gap: 24px; margin-bottom: 32px; }
.page-head .lead { color: var(--muted); font-size: 17px; max-width: 640px; }
@media (min-width: 900px) { .page-head { grid-template-columns: 1fr auto; align-items: end; } }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stats > div { padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 2px; min-width: 0; }
.stats .n { font-family: var(--font-head); font-weight: 700; font-size: 20px; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats .l { font-size: 12px; color: var(--muted); }
@media (min-width: 900px) { .stats > div { min-width: 140px; padding: 16px 20px; } .stats .n { font-size: 24px; } }

.tabbed { display: grid; gap: 24px; }
.tab-rail { display: flex; gap: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tab-rail::-webkit-scrollbar { display: none; }
.tab-rail button {
  flex: none; height: 44px; padding: 0 12px; background: transparent; border: 0; border-bottom: 2px solid transparent;
  color: var(--muted); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.tab-rail button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--lime); }
.tab-panel { display: none; }
.tab-panel.active { display: grid; gap: 24px; align-content: start; min-width: 0; }
.tab-panel > h2 { font-size: 22px; }
@media (min-width: 900px) {
  .tabbed { grid-template-columns: 200px minmax(0, 1fr); gap: 32px; align-items: start; }
  .tab-rail { flex-direction: column; gap: 0; border-bottom: 0; border-left: 1px solid var(--line); overflow: visible; position: sticky; top: 24px; }
  .tab-rail button { height: 44px; padding: 0 16px; text-align: left; border-bottom: 0; border-left: 2px solid transparent; margin-left: -1px; font-size: 15px; }
  .tab-rail button[aria-selected="true"] { border-left-color: var(--lime); }
  .tab-panel > h2 { font-size: 26px; }
}

.table-wrap { width: 100%; max-width: 100%; overflow-x: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.tbl { width: 100%; max-width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; }
.tbl th, .tbl td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; vertical-align: top; }
.tbl th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num, .tbl td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl td .sub { display: block; color: var(--muted); font-size: 12px; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: var(--surface-2); }
.tbl .hide-m { display: none; }
@media (min-width: 900px) { .tbl .hide-m { display: table-cell; } .tbl th, .tbl td { padding: 12px 16px; } }
.st-pending { color: var(--lime); }
.st-approved { color: var(--grey-2); }
.st-held { color: var(--lime); }
.st-discarded { color: var(--dim); }
.empty[hidden] { display: none; }

/* ---- gate */
.gate { min-height: 50vh; display: grid; align-content: center; justify-items: center; text-align: center; gap: 16px; max-width: 400px; margin: 0 auto; }
.gate p { color: var(--muted); }
.gate-form { width: 100%; display: grid; gap: 16px; text-align: left; margin-top: 8px; }

/* ---- books: receipts */
.drop { padding: 32px 24px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface); display: grid; gap: 12px; justify-items: center; text-align: center; transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--lime); background: var(--surface-2); }
.drop-title { font-family: var(--font-head); font-weight: 700; font-size: 18px; }
.drop .actions { justify-content: center; }
.drop .actions .btn { flex: none; }
.samples { display: grid; gap: 8px; }
.samples .actions .btn { flex: none; }
.progress { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.progress[hidden] { display: none; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--lime); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.review { display: grid; gap: 24px; padding: 24px; background: var(--surface); border: 1px solid var(--lime); border-radius: var(--radius); }
.review[hidden] { display: none; }
.review-img { display: grid; gap: 8px; }
.review-img img { width: 100%; max-height: 360px; object-fit: contain; object-position: top; border-radius: var(--radius); background: var(--surface-2); display: block; }
.review-form { display: grid; gap: 16px; }
.rv-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.conf { font-size: 13px; color: var(--muted); white-space: nowrap; }
.items { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.items div { display: flex; justify-content: space-between; gap: 16px; }
.items span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.items:empty { display: none; }
@media (min-width: 900px) { .review { grid-template-columns: 260px minmax(0, 1fr); } }

/* ---- books: import */
.preview { display: grid; gap: 16px; }
.preview[hidden] { display: none; }
.preview-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.result { font-size: 15px; color: var(--grey-2); }
.result:empty { display: none; }
.dup td { color: var(--dim); }
.dup td:first-child::before { content: "skip "; color: var(--muted); font-size: 11px; text-transform: uppercase; }

/* ---- books: mail */
.mail { display: grid; gap: 24px; min-width: 0; }
.mail-list h2 { font-size: 22px; margin-bottom: 12px; }
.msgs { display: grid; gap: 4px; max-height: 320px; overflow-y: auto; }
.msg { display: grid; gap: 2px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-align: left; color: inherit; font: inherit; cursor: pointer; min-width: 0; }
.msg:hover { border-color: var(--line-strong); }
.msg .top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.msg .from { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg.unread .from::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); margin-right: 6px; vertical-align: 2px; }
.msg .when { color: var(--muted); white-space: nowrap; }
.msg .subj { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg .prev { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg .att { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--grey-2); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 1px 6px; margin-top: 4px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; justify-self: start; }
.chat { display: grid; gap: 12px; min-width: 0; }
.chat-log { display: grid; gap: 8px; align-content: start; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); height: 360px; overflow-y: auto; font-size: 15px; }
.bubble { max-width: 92%; padding: 10px 14px; border-radius: var(--radius); line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.me { justify-self: end; background: var(--lime); color: var(--black); }
.bubble.bot { justify-self: start; background: var(--surface-2); border: 1px solid var(--line); }
.bubble.thinking { color: var(--muted); }
.step { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); padding: 2px 4px; }
.step::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); margin-top: 7px; flex: none; }
.suggest { display: flex; gap: 8px; flex-wrap: wrap; }
.suggest .btn { height: auto; min-height: 40px; padding: 8px 12px; white-space: normal; text-align: left; text-transform: none; letter-spacing: 0; font-family: var(--font-body); font-weight: 500; font-size: 13px; }
.chat-form { display: flex; gap: 8px; }
.chat-form .input { flex: 1; min-width: 0; }
.chat-form .btn { flex: none; padding: 0 20px; }
@media (min-width: 900px) {
  .mail { grid-template-columns: 340px minmax(0, 1fr); gap: 32px; align-items: start; }
  .msgs { max-height: 560px; }
  .chat-log { height: 440px; }
}

/* ---- books: ledger */
.ledger-sec { margin-top: 48px; display: grid; gap: 16px; }
.ledger-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ledger-head .actions .btn { flex: none; }
.ledger-sec .empty { margin: 0; }
.thumb { width: 28px; height: 28px; object-fit: cover; border-radius: 2px; vertical-align: middle; margin-right: 8px; background: var(--surface-2); }

/* ---- modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); z-index: 70; display: grid; place-items: center; padding: 16px; }
.modal-backdrop[hidden] { display: none; }
.modal { width: 100%; max-width: 480px; padding: 24px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); display: grid; gap: 16px; }
.modal p { color: var(--grey-2); font-size: 15px; }
.modal .actions { justify-content: flex-end; }
.modal .actions .btn { flex: none; }

/* ---- follow-ups */
.seq-wrap { display: grid; gap: 24px; }
.seq-list-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.seq-list-head h2 { font-size: 22px; }
#seq-cards { display: grid; gap: 8px; }
.seq-card { display: grid; gap: 4px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-align: left; color: inherit; font: inherit; cursor: pointer; }
.seq-card[aria-pressed="true"] { border-color: var(--lime); }
.seq-card strong { font-family: var(--font-head); font-size: 16px; }
.seq-card span { font-size: 13px; color: var(--muted); }
.seq-editor { display: grid; gap: 16px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.steps-ed { display: grid; gap: 12px; }
.step-ed { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.step-ed .step-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.step-ed .step-top strong { font-family: var(--font-head); font-size: 15px; }
.step-ed .delays { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.step-ed textarea.input { height: auto; min-height: 120px; padding: 12px 16px; resize: vertical; line-height: 1.45; font-size: 15px; }
.row3 { display: grid; gap: 16px; }
@media (min-width: 600px) { .row3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .seq-wrap { grid-template-columns: 300px minmax(0, 1fr); gap: 32px; align-items: start; } }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { position: relative; padding: 0 0 24px 28px; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--lime); }
.timeline li::after { content: ""; position: absolute; left: 10px; top: 20px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline .when { font-family: var(--font-head); font-weight: 700; font-size: 16px; }
.timeline .delay { color: var(--muted); font-size: 13px; margin-left: 8px; font-family: var(--font-body); font-weight: 400; }
.timeline .subj { margin-top: 4px; font-weight: 600; font-size: 15px; }
.timeline .body { margin-top: 8px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); white-space: pre-wrap; font-size: 14px; color: var(--grey-2); line-height: 1.5; }
.timeline:empty { display: none; }

/* ---- reports */
.cards.reports { grid-auto-rows: auto; }
.card.disabled { opacity: .6; cursor: default; }
.card.disabled:hover { border-color: var(--line); transform: none; }
.card.disabled .go { color: var(--muted); }
.dupflag { display: block; margin-top: 6px; font-size: 13px; color: var(--lime); }
.st-dup { display: block; margin-top: 2px; font-size: 12px; color: var(--lime); }
.report-page { display: grid; gap: 24px; max-width: 880px; }
.report-page video { width: 100%; max-width: 880px; aspect-ratio: 16 / 9; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.report-page .facts { grid-template-columns: 1fr; }
@media (min-width: 600px) { .report-page .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.report-page .actions { display: flex; flex-wrap: wrap; gap: 12px; }
.enroll { display: grid; gap: 8px; }
.enroll .input { height: 40px; padding: 0 32px 0 12px; font-size: 14px; background-position: calc(100% - 18px) 17px, calc(100% - 12px) 17px; }
.enroll .btn { width: 100%; }
@media (min-width: 900px) { .enroll { grid-template-columns: minmax(0, 1fr) auto; } .enroll .btn { width: auto; } }

/* column widths: the phone gets four ledger columns, the desktop all of them */
.tbl th.c-date { width: 60px; }
.tbl th.c-num { width: 84px; }
.tbl th.c-st { width: 94px; }
@media (max-width: 899px) { .tbl { font-size: 13px; } .tbl th, .tbl td { padding: 10px 8px; } }
.tbl th.c-bay { width: 64px; }
.tbl th.c-enroll { width: 128px; }
.tbl th.c-when { width: 118px; }
.tbl th.c-step { width: 56px; }
@media (min-width: 900px) {
  .tbl th.c-date { width: 90px; }
  .tbl th.c-num { width: 110px; }
  .tbl th.c-st { width: 110px; }
  .tbl th.c-bay { width: 80px; }
  .tbl th.c-enroll { width: 300px; }
  .tbl th.c-when { width: 170px; }
}
@media (max-width: 899px) {
  .stats > div { padding: 12px 10px; }
  .stats .n { font-size: 17px; letter-spacing: -0.02em; }
  .thumb { display: none; }
}

/* ---- ads desk */
.honest { display: grid; gap: 8px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 32px; }
.honest-row { display: grid; grid-template-columns: 1fr; gap: 2px 16px; font-size: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.honest-row .k { color: var(--muted); }
.honest-row strong { font-family: var(--font-head); font-size: 16px; }
.honest-row .d { color: var(--dim); font-size: 13px; }
.honest > p { padding-top: 4px; }
@media (min-width: 900px) { .honest-row { grid-template-columns: 220px 260px 1fr; align-items: baseline; } .honest { padding: 20px 24px; } }
.ads-grid { display: grid; gap: 40px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) { .ads-grid { grid-template-columns: minmax(0, 1fr) 380px; gap: 40px; align-items: start; } }
.ads-main, .ads-side { display: grid; gap: 40px; min-width: 0; }
.ads-sec { display: grid; gap: 16px; min-width: 0; align-content: start; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sec-head h2 { font-size: 22px; }
.campaigns { display: grid; gap: 16px; }
@media (min-width: 600px) { .campaigns { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.campaign-card { display: grid; gap: 16px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; align-content: start; }
.campaign-card.paused { border-style: dashed; }
.cc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.cc-title { display: grid; gap: 4px; min-width: 0; }
.cc-title h3 { font-size: 17px; }
.cc-obj { font-size: 12px; color: var(--muted); }
.switch { position: relative; width: 56px; height: 32px; flex: none; border-radius: 16px; border: 1px solid var(--line-strong); background: var(--surface-2); cursor: pointer; padding: 0; }
.switch i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--dim); transition: transform .15s, background .15s; }
.switch[aria-checked="true"] { background: var(--lime); border-color: var(--lime); }
.switch[aria-checked="true"] i { transform: translateX(24px); background: var(--black); }
.switch:disabled { opacity: .5; cursor: wait; }
.cc-budget { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.field.inline { display: flex; align-items: center; gap: 8px; }
.field.inline > span { margin: 0; white-space: nowrap; }
.input.budget { width: 96px; height: 40px; padding: 0 12px; }
.sparks { display: grid; gap: 8px; }
.spark-row { display: grid; grid-template-columns: 10px auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.spark-key { width: 10px; height: 10px; border-radius: 2px; display: block; }
.k-spend { background: #3987e5; }
.k-bookings { background: #bada55; }
.spark-label { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spark { width: 100%; height: 36px; display: block; overflow: visible; }
.spark .base { stroke: var(--line-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
.spark-val { font-family: var(--font-head); font-size: 15px; font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; }
.cc-foot { display: grid; gap: 8px; }
.cc-foot .btn { justify-self: start; }
@media (min-width: 600px) { .cc-foot { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } .cc-foot .btn { grid-row: 1 / span 2; grid-column: 2; } }

.modal.sched { max-width: 720px; max-height: calc(100vh - 32px); overflow: auto; gap: 12px; padding: 20px; }
.modal.sched .d-head { display: flex; align-items: center; gap: 16px; }
.modal.sched .d-head h3 { flex: 1; font-size: 18px; }
.presets { display: flex; gap: 8px; flex-wrap: wrap; }
.presets .btn { height: 36px; padding: 0 12px; font-size: 12px; }
.sched-grid { display: grid; grid-template-columns: 44px repeat(7, minmax(0, 1fr)); gap: 2px; touch-action: none; user-select: none; -webkit-user-select: none; }
.sg-corner, .sg-day { height: 24px; font-size: 12px; color: var(--muted); display: flex; align-items: center; justify-content: center; font-weight: 600; }
.sg-hour { font-size: 10px; color: var(--dim); display: flex; align-items: center; justify-content: flex-end; padding-right: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sg-cell { height: 14px; background: var(--surface-2); border-radius: 2px; cursor: pointer; }
.sg-cell[aria-checked="true"] { background: var(--lime); }
.sg-cell:focus-visible { outline: 2px solid var(--text); outline-offset: -1px; }
@media (min-width: 600px) { .sg-cell { height: 16px; } }
.modal.sched .actions { justify-content: flex-end; }
.modal.sched .actions .btn { flex: none; }
body.modal-open { overflow: hidden; }

.rules { display: grid; gap: 8px; }
.rule { display: grid; gap: 6px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.rule.fires { border-color: var(--lime); }
.rule-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.rule-top strong { font-family: var(--font-head); font-size: 15px; }
.plat { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 2px 6px; border-radius: 2px; border: 1px solid var(--line-strong); color: var(--grey-2); white-space: nowrap; }
.rule-text { font-size: 14px; }
.rule-eval { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.rule .fire { color: var(--lime); font-weight: 600; }
.rule:not(.fires) .fire { color: var(--muted); font-weight: 500; }
.rule .btn { justify-self: start; margin-top: 4px; }
.rule-form { display: grid; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.rule-form h3 { font-size: 15px; }

.chart { width: 100%; min-width: 0; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.bars .grid { stroke: var(--line); stroke-width: 1; }
.bars .axis { stroke: var(--line-strong); stroke-width: 1; }
.bars .tick { fill: var(--muted); font-size: 11px; font-family: var(--font-body); }
.bars .val { fill: var(--grey-2); font-size: 12px; font-weight: 600; font-family: var(--font-body); }
.bars .day { cursor: default; outline: none; }
.bars .day.hot rect:not(.hit) { filter: brightness(1.18); }
.bars .day:focus-visible .hit { stroke: var(--text); stroke-width: 1; }
.readout { font-size: 14px; color: var(--grey-2); min-height: 22px; }
.legend.viz i { border-radius: 2px; }
.k-meta { background: #3987e5; }
.k-google { background: #d95926; }
.k-direct { background: #8a8a8a; }
.tableview { display: grid; gap: 12px; }
.tableview summary { cursor: pointer; font-size: 14px; color: var(--muted); }
.click { font-size: 12px; padding: 2px 6px; border-radius: 2px; border: 1px solid var(--line-strong); color: var(--grey-2); white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.click.fbclid { border-color: #3987e5; }
.click.gclid { border-color: #d95926; }
.click.none { color: var(--muted); }
.tbl th.c-click { width: 76px; }
#last-bookings th.c-date { width: 72px; }
#last-bookings td .sub { white-space: nowrap; }
@media (max-width: 599px) { .modal.sched { padding: 16px; gap: 10px; } .presets .btn { height: 32px; padding: 0 10px; font-size: 11px; } .modal.sched .actions .btn { height: 44px; } }
.ads .ledger-head h3 { font-size: 17px; }

.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; font-size: 13px; }
.checklist li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); color: var(--grey-2); }
.checklist .who { color: var(--muted); font-weight: 600; }
.connect-form { display: grid; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.connect-form .input:disabled { opacity: .6; cursor: not-allowed; }
.connect-form .note { color: var(--lime); font-size: 13px; }

.loglist { display: grid; gap: 4px; }
.logrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: inherit; font: inherit; text-align: left; cursor: pointer; font-size: 13px; min-width: 0; }
.logrow:hover { border-color: var(--line-strong); }
.logrow .act { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logrow .dry { font-size: 11px; color: var(--lime); text-transform: uppercase; letter-spacing: .04em; }
.drawer.wide { max-width: 640px; }
.d-body.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
