:root {
  --bg: #ffffff;
  --bg-soft: #f6f9fc;
  --card-bg: #ffffff;
  --border: #e4eaf0;
  --text-main: #1f2933;
  --text-soft: #56616f;
  --text-dim: #788293;
  --blue: #3b82f6;
  --blue-soft: #eef4ff;
  --teal: #129e8f;
  --teal-soft: #e7f8f5;
  --green: #2f9e64;
  --green-soft: #e9f7ef;
  --amber: #b45309;
  --amber-soft: #fef3e2;
  --red: #b91c1c;
  --red-soft: #fde8e8;
  --gray: #475569;
  --gray-soft: #eef1f4;
  --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 30px rgba(15, 23, 42, 0.07);
  --radius: 18px;
  --radius-sm: 12px;
  --max-width: 1120px;
}

* { box-sizing: border-box; }

/* Force the hidden attribute to win over any class that sets its own
   display (e.g. .tab-nav{display:flex}) — without this, an element
   can carry [hidden] and still render visible+clickable. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 {
  color: var(--text-main);
  line-height: 1.2;
  margin: 0 0 14px;
}

h1 { font-size: 2.3rem; font-weight: 700; }
h2 { font-size: 1.6rem; font-weight: 700; text-align: center; }
h3 { font-size: 1.02rem; font-weight: 600; }

p { color: var(--text-soft); margin: 0 0 12px; }

.muted { color: var(--text-dim); font-size: 0.9rem; }

a { color: var(--blue); text-decoration: none; }

ul { padding-left: 20px; margin: 0 0 12px; color: var(--text-soft); }
li { margin-bottom: 4px; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
}

.logo { display: flex; align-items: center; gap: 8px; color: var(--teal); }
.logo-text { font-weight: 700; font-size: 1.15rem; color: var(--text-main); }

.beta-tag {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--teal);
  background: var(--teal-soft);
  padding: 5px 12px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

/* Tab navigation */
.tab-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 24px;
  scrollbar-width: thin;
}

.tab-nav::-webkit-scrollbar { height: 4px; }

.tab-btn {
  flex: 0 0 auto;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tab-btn:hover { background: var(--blue-soft); color: var(--blue); }

.tab-btn.is-active {
  background: linear-gradient(135deg, var(--blue), var(--teal));
  color: #ffffff;
  border-color: transparent;
}

.tab-cta {
  margin-left: auto;
  flex: 0 0 auto;
  padding: 9px 20px;
  font-size: 0.85rem;
}

.workspace-tab-nav { background: var(--bg-soft); }

.exit-workspace {
  margin-left: auto;
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Panels */
.panel { display: none; }
.panel.is-active { display: block; }

/* Hero */
.hero { text-align: center; padding: 64px 24px 48px; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 14px;
}

.hero h1 { max-width: 760px; margin: 0 auto 18px; }
.hero-sub { max-width: 600px; margin: 0 auto 30px; font-size: 1.03rem; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--teal));
  color: #ffffff;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(15, 23, 42, 0.14); }

.btn-secondary { background: var(--blue-soft); color: var(--blue); box-shadow: none; }

.cta-note { margin-top: 12px; font-size: 0.85rem; color: var(--text-dim); }

/* Home — condensed How It Works summary */
.home-how-it-works {
  max-width: 560px;
  margin: 0 auto 28px;
  text-align: left;
  background: var(--blue-soft);
  border-radius: 16px;
  padding: 20px 24px;
}
.home-how-it-works-title { font-size: 1.02rem; margin: 0 0 10px; }
.home-how-it-works-list { margin: 0; padding-left: 20px; line-height: 1.6; font-size: 0.95rem; }

/* Guided public flow — bottom Continue buttons */
.panel-continue { display: flex; justify-content: center; margin-top: 32px; }

/* Sections */
.section { padding: 48px 24px; }

.section-intro { max-width: 680px; margin: 0 auto 28px; text-align: center; font-size: 1rem; }

/* Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* Feature grid */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature-grid-wide { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.feature-card { text-align: left; }
.feature-card p { margin-bottom: 0; font-size: 0.93rem; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.steps-5 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.step { text-align: center; }

.step-number {
  width: 34px;
  height: 34px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step p { font-size: 0.88rem; }

/* Stat grid */
.example-label {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}

.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 32px; }
.stat-grid-6 { grid-template-columns: repeat(6, 1fr); }
.stat-grid-3 { grid-template-columns: repeat(3, 1fr); }

.stat-card { text-align: center; padding: 20px 12px; }
.stat-number { display: block; font-size: 1.7rem; font-weight: 700; color: var(--teal); margin-bottom: 6px; }
.stat-label { font-size: 0.78rem; color: var(--text-soft); display: block; }

/* Preview / dashboard grid */
.preview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 24px; }
.preview-card h3 { margin-bottom: 10px; }

.chart-area { min-height: 140px; }

/* Pricing / FAQ */
.pricing-card, .privacy-card { max-width: 600px; margin: 0 auto; }
.pricing-card .btn { margin-top: 14px; }
.pricing-list { list-style: none; padding: 0; margin: 0 0 14px; }
.pricing-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-soft);
}
.pricing-list li:last-child { border-bottom: none; }
.muted-list li { color: var(--text-dim); }

.faq-list { max-width: 700px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq-item p { margin-bottom: 0; font-size: 0.93rem; }

/* Prototype banner */
.prototype-banner {
  max-width: 720px;
  margin: 0 auto 28px;
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid #f3dca8;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 0.86rem;
  font-weight: 600;
  text-align: center;
}

/* Shortcut row */
.shortcut-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }

/* Form */
.form-card { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.sample-card { max-width: 560px; margin: 0 auto 20px; }
.sample-card h3 { font-size: 0.95rem; margin-bottom: 8px; }
.sample-card-hint { font-size: 0.82rem; color: var(--text-dim); margin-bottom: 4px; }
.sample-entry-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--text-soft);
  cursor: pointer;
}
.sample-entry-btn:hover,
.sample-entry-btn:focus-visible {
  color: var(--teal);
  text-decoration: underline;
}
.sample-loaded-note {
  max-width: 560px;
  margin: 0 auto 16px;
  background: var(--teal-soft);
  color: var(--teal);
  border: 1px solid var(--teal);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 0.86rem;
  font-weight: 600;
  text-align: center;
}
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-size: 0.88rem; font-weight: 600; color: var(--text-main); }
.optional-tag { font-weight: 500; color: var(--text-dim); text-transform: none; font-size: 0.78rem; }

.form-row input, .form-row select, .form-row textarea {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-main);
}

.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.form-row-toggle { flex-direction: row; align-items: center; }
.toggle-label { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; font-weight: 500; color: var(--text-soft); cursor: pointer; padding: 4px 0; }
.toggle-label input { width: 18px; height: 18px; cursor: pointer; }

.form-submit { margin-top: 6px; align-self: flex-start; }

.confirmation-card { max-width: 560px; margin: 24px auto 0; text-align: center; }
.confirmation-card h3 { font-size: 1.15rem; }

.fallback-note { text-align: center; font-size: 0.85rem; color: var(--text-dim); margin-top: 18px; }

/* Report / on-demand card */
.report-card { max-width: 720px; margin: 0 auto 28px; text-align: center; }
.report-card h3 { font-size: 1.1rem; margin-bottom: 10px; }
.report-card p { margin-bottom: 0; }
.on-demand-card { text-align: center; }
.on-demand-card p { font-size: 0.92rem; }

/* Alerts / mini lists */
.alert-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.alert-item { padding: 8px 12px; border-radius: var(--radius-sm); font-size: 0.86rem; font-weight: 600; }
.alert-amber { background: var(--amber-soft); color: var(--amber); }
.alert-red { background: var(--red-soft); color: var(--red); }
.alert-blue { background: var(--blue-soft); color: var(--blue); }
.alert-empty { color: var(--text-dim); font-weight: 500; font-size: 0.88rem; }

.mini-stat-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.mini-stat-list li { display: flex; justify-content: space-between; font-size: 0.9rem; color: var(--text-soft); }

.recent-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 0.88rem; color: var(--text-soft); }
.recent-list li { border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.recent-list li:last-child { border-bottom: none; padding-bottom: 0; }

.list-empty { color: var(--text-dim); font-style: italic; border-bottom: none !important; }

.tag-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.tag-list li { background: var(--blue-soft); color: var(--blue); font-size: 0.8rem; font-weight: 600; padding: 5px 12px; border-radius: 999px; margin: 0; }

/* Follow-up groups */
.followup-groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 8px; }
.followup-group { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.followup-group h3 { display: flex; justify-content: space-between; align-items: center; font-size: 0.95rem; }
.followup-group h3 .count-pill { background: var(--blue-soft); color: var(--blue); font-size: 0.78rem; padding: 2px 9px; border-radius: 999px; }
.followup-entry { font-size: 0.86rem; color: var(--text-soft); padding: 8px 0; border-bottom: 1px solid var(--border); }
.followup-entry:last-child { border-bottom: none; }
.followup-entry .next-action { color: var(--text-dim); font-size: 0.78rem; display: block; margin-top: 2px; }

/* Approval queue */
.approval-list { display: flex; flex-direction: column; gap: 14px; max-width: 760px; margin: 0 auto; }
.approval-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.approval-card .draft-text { font-size: 0.92rem; color: var(--text-main); margin-bottom: 10px; }
.approval-card .approval-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.approval-card select { padding: 6px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); font-size: 0.85rem; }
.approval-note { text-align: center; color: var(--text-dim); font-size: 0.85rem; }

/* Tables */
.table-card-wrap { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); background: var(--card-bg); overflow: hidden; }
.table-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.table-header h3 { margin: 0; font-size: 1.05rem; }
.btn-text { background: none; border: none; color: var(--text-dim); font-size: 0.82rem; cursor: pointer; text-decoration: underline; padding: 0; }
.table-scroll { overflow-x: auto; }

.inquiries-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; min-width: 880px; }
.inquiries-table th, .inquiries-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text-soft); white-space: nowrap; }
.inquiries-table th { color: var(--text-dim); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.03em; font-weight: 600; }
.inquiries-table td.notes-cell, .inquiries-table td.asking-cell { white-space: normal; max-width: 200px; }
.empty-row td { color: var(--text-dim); text-align: center; white-space: normal; }

.badge { display: inline-block; font-size: 0.74rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.badge-new { background: var(--blue-soft); color: var(--blue); }
.badge-needs-reply { background: var(--red-soft); color: var(--red); }
.badge-follow-up { background: var(--amber-soft); color: var(--amber); }
.badge-waiting { background: var(--gray-soft); color: var(--gray); }
.badge-booked, .badge-resolved { background: var(--teal-soft); color: var(--teal); }
.badge-not-fit { background: var(--gray-soft); color: var(--gray); }

.flag-icon { font-size: 0.85rem; margin-right: 4px; }

.mini-timeline { display: flex; align-items: center; gap: 4px; }
.mini-timeline .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.mini-timeline .dot.is-filled { background: var(--teal); }
.mini-timeline .bar { width: 12px; height: 2px; background: var(--border); }

/* Donut chart */
.donut-wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.donut-chart { width: 110px; height: 110px; border-radius: 50%; flex: 0 0 auto; position: relative; }
.donut-hole { position: absolute; inset: 18px; background: var(--card-bg); border-radius: 50%; }
.donut-legend { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 0.82rem; color: var(--text-soft); }
.donut-legend li { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* Bar charts */
.bar-chart-v { display: flex; align-items: flex-end; gap: 10px; height: 130px; padding-top: 10px; overflow-x: auto; }
.bar-col { flex: 1 0 56px; min-width: 56px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar-col .bar { width: 60%; border-radius: 6px 6px 0 0; min-height: 3px; }
.bar-col .bar-value { font-size: 0.78rem; color: var(--text-dim); margin-bottom: 4px; }
.bar-col .bar-label { font-size: 0.74rem; color: var(--text-dim); margin-top: 6px; text-align: center; line-height: 1.25; }

.bar-chart-h { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: flex; align-items: center; gap: 8px; }
.bar-row .bar-row-label { flex: 0 0 90px; font-size: 0.78rem; color: var(--text-dim); }
.bar-row .bar-track { flex: 1; background: var(--bg-soft); border-radius: 999px; height: 10px; overflow: hidden; }
.bar-row .bar-fill { height: 100%; border-radius: 999px; }
.bar-row .bar-row-value { flex: 0 0 56px; font-size: 0.78rem; color: var(--text-dim); text-align: right; }

/* Line chart */
.line-chart-svg { width: 100%; height: 120px; }
.line-chart-labels { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-dim); margin-top: 4px; }

.chart-empty { color: var(--text-dim); font-size: 0.85rem; text-align: center; padding: 24px 0; }

/* Privacy / help cards */
.help-card { max-width: 700px; margin: 0 auto 16px; }
.future-card { border-style: dashed; }

/* Beta feedback section (kept separate from customer inquiry data) */
.feedback-card {
  max-width: 700px;
  margin: 0 auto;
  border-color: var(--teal);
  background: var(--teal-soft);
}

.feedback-card h3 { color: var(--teal); }

.feedback-form {
  margin-top: 16px;
  max-width: none;
}

.feedback-form textarea { background: var(--bg); }

.feedback-confirmation {
  margin-top: 18px;
  background: var(--bg);
  border-color: var(--teal);
}

.feedback-confirmation label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 12px 0 6px;
  color: var(--text-main);
}

.feedback-status {
  display: inline-block;
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 999px;
  margin: 0 0 10px;
}

.feedback-packet {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  background: var(--bg-soft);
}

.feedback-copy-note { margin-top: 8px; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 26px 24px; }
.footer-inner { display: flex; justify-content: space-between; font-size: 0.82rem; color: var(--text-dim); }

/* Responsive */
@media (max-width: 960px) {
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .followup-groups { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .steps { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .stat-grid-6 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 600px) {
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.35rem; }
  .hero { padding: 48px 20px 36px; }
  .feature-grid, .steps { grid-template-columns: 1fr; }
  .stat-grid, .stat-grid-6, .stat-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { flex-direction: column; gap: 6px; text-align: center; }
  .table-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .form-submit { align-self: stretch; text-align: center; }
  .tab-cta { margin-left: 0; }
}

@media (max-width: 420px) {
  .stat-grid, .stat-grid-6, .stat-grid-3 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .btn-primary { transition: none; }
  .card:hover, .btn-primary:hover { transform: none; }
}
