:root {
  --volt: #d97706;
  --volt-dark: #b45309;
  --ink: #1c2430;
  --ink-deep: #12181f;
  --bg: #f2f0eb;
  --surface: #ffffff;
  --line: #ddd6c9;
  --text: #2b3440;
  --muted: #6d7684;
  --ok: #1e7d46;
  --ok-bg: #e6f4ec;
  --warn: #9a3412;
  --warn-bg: #fdf0e7;
  --radius: 14px;
  --shadow: 0 12px 28px rgba(28, 36, 48, 0.12);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner {
  max-width: 1100px; margin: 0 auto; padding: 16px 20px;
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
}
.brand { color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: 0.05em; }
.brand span { color: var(--volt-dark); }
.header-owner { margin: 0 0 0 auto; color: var(--muted); }
.header-owner strong { color: var(--ink); }

.hero { background: linear-gradient(135deg, var(--ink-deep), var(--ink) 60%, #3d3423); color: #fff; padding: 42px 0 36px; }
.hero-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 26px; align-items: start; }
.eyebrow { color: #f2c98a; text-transform: uppercase; letter-spacing: 0.15em; font-size: 0.78rem; font-weight: 700; margin: 0; }
.hero h1 { font-size: 2.1rem; margin: 10px 0 12px; line-height: 1.18; }
.pitch-strip {
  background: rgba(217, 119, 6, 0.16); border-left: 4px solid var(--volt);
  padding: 10px 14px; border-radius: 0 8px 8px 0; color: #ffe1b3; max-width: 640px; font-weight: 600;
}
.hero-lede { color: #d5dbe3; max-width: 640px; }
.hero-lede strong { color: #fff; }
.hero-instruction { color: #eef2f6; max-width: 640px; }

.ledger-card { background: var(--surface); color: var(--text); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card-kicker { color: var(--volt-dark); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.76rem; font-weight: 700; margin: 0 0 10px; }
.ledger-facts { margin: 0; display: grid; gap: 9px; }
.ledger-facts div { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; }
.ledger-facts dt { color: var(--muted); }
.ledger-facts dd { margin: 0; font-size: 1.35rem; font-weight: 800; color: var(--ink); }
.ledger-facts dd.ledger-status { font-size: 1rem; text-align: right; }
.price-line { border-top: 1px solid var(--line); margin: 14px 0 0; padding-top: 12px; color: var(--muted); }
.price-line strong { color: var(--volt-dark); }

.timeline-section { padding: 30px 0 6px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.section-head h2, .owner-section h2, .notes-grid h2 { color: var(--ink); }
.section-sub { color: var(--muted); max-width: 760px; }

.button {
  border: 0; cursor: pointer; border-radius: 9px; padding: 12px 18px;
  font-size: 0.98rem; font-weight: 700; font-family: inherit;
}
.button:disabled { opacity: 0.55; cursor: not-allowed; }
.button:focus-visible, a:focus-visible { outline: 3px solid var(--volt); outline-offset: 2px; }
.button-primary { background: var(--volt); color: #fff; }
.button-primary:hover:not(:disabled) { background: var(--volt-dark); }
.button-ghost { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); }
.button-ghost:hover:not(:disabled) { border-color: var(--volt); }
.button-pay { background: var(--ok); color: #fff; }
.button-pay:hover:not(:disabled) { background: #17653a; }
.button-plan { background: var(--ink); color: #fff; }
.button-plan:hover:not(:disabled) { background: var(--ink-deep); }
.button-block { display: block; width: 100%; margin-top: 10px; }

.stage-rail {
  list-style: none; margin: 18px 0 22px; padding: 0;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px;
}
.stage {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; position: relative;
}
.stage-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); margin-bottom: 4px; }
.stage-name { font-weight: 700; color: var(--ink); font-size: 0.9rem; }
.stage-day { color: var(--muted); font-size: 0.8rem; }
.stage.is-current { border-color: var(--volt); box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.25); }
.stage.is-current .stage-dot { background: var(--volt); }
.stage.is-done .stage-dot { background: var(--ok); }
.stage.is-done .stage-name { color: var(--ok); }

.chase-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 22px; align-items: start; }
.inbox-panel, .control-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow);
}
.panel-top h3, .control-panel h3 { margin: 0 0 4px; color: var(--ink); }
.panel-sub, .control-note { color: var(--muted); margin: 0 0 14px; font-size: 0.94rem; }

.halt-banner {
  background: var(--warn-bg); border: 1.5px solid var(--warn); color: var(--warn);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; font-size: 0.95rem;
}
.paid-banner {
  background: var(--ok-bg); border: 1.5px solid var(--ok); color: var(--ok);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; font-size: 0.95rem;
}

.inbox { display: flex; flex-direction: column; gap: 14px; }
.msg-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: #fdfcf9; }
.msg-card.msg-sms { background: #f4f7f4; border-left: 5px solid var(--ok); }
.msg-card.msg-email { border-left: 5px solid var(--volt); }
.msg-card.msg-client { background: #eef2f7; border-left: 5px solid #5b7ea6; }
.msg-card.msg-system { background: var(--ok-bg); border-left: 5px solid var(--ok); }
.msg-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.msg-chip {
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase;
  background: var(--ink); color: #fff; border-radius: 999px; padding: 3px 9px;
}
.msg-chip.chip-day { background: var(--volt-dark); }
.msg-chip.chip-client { background: #5b7ea6; }
.msg-chip.chip-system { background: var(--ok); }
.msg-subject { margin: 0 0 6px; font-weight: 700; color: var(--ink); }
.msg-body p { margin: 0 0 8px; color: var(--text); }
.msg-body p:last-child { margin-bottom: 0; }

.decision-box { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 6px; }
.decision-kicker { font-weight: 800; color: var(--ink); margin: 10px 0 2px; }

.plan-card { border: 1.5px solid var(--ink); border-radius: 12px; padding: 14px 16px; margin-top: 16px; background: #f7f5f0; }
.plan-kicker { margin: 0 0 8px; font-weight: 800; color: var(--ink); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; }
.plan-facts { margin: 0; display: grid; gap: 6px; }
.plan-facts div { display: flex; justify-content: space-between; gap: 12px; }
.plan-facts dt { color: var(--muted); }
.plan-facts dd { margin: 0; font-weight: 700; color: var(--ink); }
.plan-note { color: var(--muted); font-size: 0.92rem; margin: 10px 0 0; }

.reply-sim { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; }
.reply-sim-kicker { margin: 0; font-weight: 800; color: var(--ink); font-size: 0.9rem; }
.reply-sim-note { color: var(--muted); font-size: 0.88rem; margin: 8px 0 0; }

.owner-section { padding: 30px 0 6px; }
.owner-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 22px; align-items: start; margin-top: 14px; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.dash-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.dash-table th, .dash-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.dash-table th { background: #f7f4ee; color: var(--ink); font-size: 0.88rem; text-transform: uppercase; letter-spacing: 0.05em; }
.dash-table tr:last-child td { border-bottom: 0; }
.stage-cell { font-weight: 600; color: var(--volt-dark); }
.optout-log { margin: 0; padding: 12px 16px; background: var(--warn-bg); color: var(--warn); font-weight: 600; border-top: 1px solid var(--line); }

.owner-side { display: flex; flex-direction: column; gap: 16px; }
.owner-text { background: var(--surface); border: 1.5px solid var(--ok); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.demo-label { color: var(--ok); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.11em; margin: 0; }
.demo-label-dark { color: var(--warn); }
.owner-text-body { font-size: 1.15rem; font-weight: 700; color: var(--ink); margin: 8px 0 0; }
.mock-note { color: var(--muted); font-size: 0.86rem; margin: 10px 0 0; }

.compliance-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.never-list { margin: 10px 0 0; padding-left: 20px; color: var(--muted); }
.never-list li { margin-bottom: 7px; }

.notes-section { padding: 34px 0 46px; }
.notes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.notes-grid li { margin-bottom: 8px; color: var(--muted); }
.notes-grid li strong { color: var(--text); }
.notes-grid p { color: var(--muted); }
.notes-section .price-line { border-top: 0; padding-top: 0; }

.site-footer { background: var(--ink-deep); padding: 20px 0 28px; color: #aeb9c6; font-size: 0.9rem; }

@media (max-width: 860px) {
  .hero-grid, .chase-grid, .owner-grid, .notes-grid { grid-template-columns: 1fr; }
  .stage-rail { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 1.7rem; }
  .header-owner { margin-left: 0; }
}

/* ---- View toggle (Customer view | Owner Admin) ---- */
.view-bar {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding-top: 20px;
}
.view-toggle {
  display: inline-flex; background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 999px; padding: 4px; gap: 4px;
}
.view-btn {
  border: 0; cursor: pointer; border-radius: 999px; padding: 9px 18px;
  font-size: 0.95rem; font-weight: 700; font-family: inherit;
  background: transparent; color: var(--muted);
}
.view-btn:hover { color: var(--ink); }
.view-btn.is-active { background: var(--volt); color: #fff; }
.view-btn:focus-visible { outline: 3px solid var(--volt); outline-offset: 2px; }
.view-hint { margin: 0; color: var(--muted); max-width: 620px; font-size: 0.95rem; }
.view-hint strong { color: var(--ink); }

/* ---- Owner Admin panel ---- */
.admin-panel { padding: 26px 0 8px; }
.admin-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 26px; box-shadow: var(--shadow);
}
.admin-card h2 { color: var(--ink); margin: 6px 0 4px; font-size: 1.45rem; }
.admin-sub { color: var(--muted); max-width: 720px; margin: 0 0 18px; }
.admin-subhead { color: var(--ink); margin: 24px 0 8px; font-size: 1.05rem; }
.admin-note { color: var(--muted); font-size: 0.92rem; margin: 8px 0 0; max-width: 720px; }

.admin-headline {
  background: linear-gradient(135deg, var(--ink-deep), var(--ink) 65%, #3d3423);
  border-radius: 12px; padding: 18px 22px; color: #fff;
}
.admin-headline-label {
  margin: 0; color: #f2c98a; text-transform: uppercase; letter-spacing: 0.13em;
  font-size: 0.76rem; font-weight: 700;
}
.admin-headline-value { margin: 2px 0 0; font-size: 2.2rem; font-weight: 800; color: var(--volt); line-height: 1.15; }
.admin-headline-note { margin: 4px 0 0; color: #d5dbe3; font-size: 0.94rem; max-width: 640px; }

.admin-table-wrap {
  overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.admin-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.admin-table th, .admin-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table th { background: #f7f4ee; color: var(--ink); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table .amount-cell { font-weight: 700; color: var(--ink); white-space: nowrap; }
.admin-table .stage-cell { font-weight: 600; color: var(--volt-dark); }
.badge-new {
  display: inline-block; background: var(--volt); color: #fff; border-radius: 999px;
  padding: 2px 9px; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.07em;
  text-transform: uppercase; margin-left: 8px; vertical-align: middle; white-space: nowrap;
}

.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 22px 0 4px; }
.admin-stat { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: #fdfcf9; }
.admin-stat-value { margin: 0; font-size: 1.5rem; font-weight: 800; color: var(--ink); line-height: 1.2; }
.admin-stat-label { margin: 2px 0 0; color: var(--muted); font-size: 0.86rem; font-weight: 600; }

.admin-insight {
  background: rgba(217, 119, 6, 0.1); border-left: 4px solid var(--volt);
  padding: 12px 16px; border-radius: 0 10px 10px 0; color: var(--text);
  font-weight: 600; margin: 16px 0 0;
}

.history-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.history-item {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: #fdfcf9;
}
.history-when { font-weight: 800; color: var(--volt-dark); font-size: 0.86rem; white-space: nowrap; }
.history-text { flex: 1 1 260px; color: var(--text); }
.history-state {
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}
.state-sent { background: var(--ok-bg); color: var(--ok); }
.state-scheduled { background: #eef0f2; color: var(--muted); }
.state-skipped { background: var(--warn-bg); color: var(--warn); }
.state-event { background: var(--ink); color: #fff; }

.admin-empty { color: var(--muted); font-style: italic; margin: 8px 0 0; }
.optout-entry {
  background: var(--warn-bg); border: 1.5px solid var(--warn); color: var(--warn);
  border-radius: 10px; padding: 12px 14px; margin: 10px 0 0; font-size: 0.95rem;
}
.optout-entry .badge-new { margin-left: 0; margin-right: 8px; }

@media (max-width: 860px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
  .admin-card { padding: 20px 16px; }
  .admin-table { min-width: 0; }
  .admin-table thead { display: none; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
  .admin-table tr { border-bottom: 2px solid var(--line); padding: 8px 0; }
  .admin-table tr:last-child { border-bottom: 0; }
  .admin-table td { border-bottom: 0; display: flex; justify-content: space-between; gap: 14px; padding: 5px 16px; text-align: right; }
  .admin-table td::before {
    content: attr(data-label); font-weight: 700; color: var(--muted);
    text-transform: uppercase; font-size: 0.74rem; letter-spacing: 0.05em; text-align: left;
  }
}
