:root {
  --ink: #17312d;
  --muted: #687874;
  --green: #1d5d50;
  --green-dark: #163a34;
  --green-soft: #dfeee9;
  --cream: #f5f2ea;
  --paper: #fffefa;
  --line: #d8ded9;
  --orange: #d87843;
  --danger: #a23d39;
  --shadow: 0 20px 60px rgba(27, 55, 49, 0.09);
  --radius: 22px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(215, 231, 225, 0.9), transparent 28rem),
    radial-gradient(circle at 88% 20%, rgba(245, 217, 190, 0.6), transparent 24rem),
    var(--cream);
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.page-shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand span:last-child { display: flex; flex-direction: column; gap: 1px; }
.brand strong { font-size: 15px; letter-spacing: -0.01em; }
.brand small { color: var(--muted); font-size: 12px; }
.brand-mark {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 14px; background: var(--green-dark); color: white;
  font-family: Georgia, serif; font-size: 22px;
}

.privacy-badge {
  padding: 8px 12px; border: 1px solid rgba(29, 93, 80, .2); border-radius: 999px;
  background: rgba(255, 255, 255, .55); color: var(--green); font-size: 12px; font-weight: 700;
}
.topbar-actions { display: flex; align-items: center; gap: 16px; }

.main-column { width: min(940px, calc(100% - 32px)); margin: 30px auto 60px; flex: 1; }
.panel { background: rgba(255, 254, 250, .94); border: 1px solid rgba(216, 222, 217, .9); border-radius: var(--radius); box-shadow: var(--shadow); }
.welcome-panel { padding: clamp(28px, 5vw, 60px); }
.compact-panel { padding: 24px 28px; }
.eyebrow { color: var(--orange); text-transform: uppercase; letter-spacing: .12em; font-size: 11px; font-weight: 800; margin-bottom: 10px; }
h1, h2, h3 { margin: 0; letter-spacing: -.035em; }
h1 { max-width: 760px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(38px, 6vw, 66px); font-weight: 500; line-height: 1.03; }
h2 { font-size: clamp(24px, 3vw, 32px); }
h3 { font-size: 17px; }
.lead { max-width: 700px; margin: 22px 0 0; color: var(--muted); font-size: 18px; line-height: 1.65; }
.lead.small { font-size: 15px; margin-top: 12px; }

.promise-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 34px 0; }
.promise-grid > div { padding: 18px; border-radius: 16px; background: var(--green-soft); display: grid; gap: 4px; }
.promise-grid span { color: var(--green); font-size: 11px; font-weight: 800; }
.promise-grid strong { font-size: 14px; }
.promise-grid small { color: var(--muted); line-height: 1.4; }

.start-form { border-top: 1px solid var(--line); padding-top: 28px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 8px; margin-bottom: 16px; }
.field > span { font-size: 13px; font-weight: 750; }
.field small { color: var(--muted); font-weight: 500; }
input, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 13px; background: white;
  color: var(--ink); padding: 13px 15px; outline: none; transition: .18s ease;
}
input:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(29, 93, 80, .09); }
input:read-only { background: #f3f4f1; color: var(--muted); }
textarea { resize: vertical; min-height: 132px; line-height: 1.55; }
.consent-row { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: 13px; line-height: 1.5; margin: 8px 0 20px; }
.consent-row input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--green); }

.button-row, .composer-actions, .copy-row { display: flex; align-items: center; gap: 10px; }
.button { border: 0; border-radius: 13px; padding: 13px 18px; font-weight: 750; transition: transform .15s ease, opacity .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button.primary { background: var(--green-dark); color: white; }
.button.primary:hover { background: var(--green); }
.button.secondary { background: var(--green-soft); color: var(--green-dark); }
.button.voice { display: flex; align-items: center; gap: 9px; background: #f3f1eb; color: var(--ink); }
.button.voice.recording { background: #f6ddd6; color: var(--danger); }
.mic-icon { width: 12px; height: 17px; border: 2px solid currentColor; border-radius: 8px; position: relative; }
.mic-icon::after { content: ""; position: absolute; width: 18px; height: 9px; border: 2px solid currentColor; border-top: 0; border-radius: 0 0 10px 10px; left: -5px; top: 9px; }
.text-button { border: 0; background: none; color: var(--danger); padding: 0; text-decoration: underline; }
.quiet-link { color: var(--green); font-size: 13px; font-weight: 700; text-decoration: none; }

.error-message { color: var(--danger); min-height: 1.2em; margin: 8px 0; font-size: 13px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.interview-layout { display: grid; gap: 18px; }
.interview-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.progress-box { width: min(260px, 38%); display: grid; gap: 8px; text-align: right; color: var(--green); font-weight: 800; }
.progress-track { height: 7px; border-radius: 999px; background: #e7e8e2; overflow: hidden; }
.progress-bar { width: 0; height: 100%; border-radius: inherit; background: var(--orange); transition: width .35s ease; }
.chat-card { padding: clamp(20px, 4vw, 36px); }
.history { max-height: 340px; overflow: auto; display: grid; gap: 12px; padding-right: 4px; }
.message { max-width: 82%; border-radius: 18px; padding: 16px 18px; line-height: 1.55; }
.assistant-message { background: var(--green-soft); border-bottom-left-radius: 5px; margin: 10px auto 24px 0; }
.assistant-message h3 { margin-bottom: 6px; }
.assistant-message p { margin: 0; }
.assistant-message small { display: block; margin-top: 8px; color: var(--muted); }
.history .assistant-mini { justify-self: start; background: #eef3ef; color: var(--muted); font-size: 13px; }
.history .answer-mini { justify-self: end; background: var(--green-dark); color: white; border-bottom-right-radius: 5px; white-space: pre-wrap; }
.answer-composer { padding-top: 20px; border-top: 1px solid var(--line); }
.composer-actions { justify-content: space-between; margin-top: 12px; }
.audio-ready { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: #f6e9e2; display: flex; align-items: center; gap: 9px; color: var(--ink); font-size: 13px; }
.audio-ready .text-button { margin-left: auto; }
.pulse-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 5px rgba(216,120,67,.14); }
.microcopy { margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

.summary-card, .complete-card { padding: clamp(24px, 5vw, 48px); }
.summary-section { margin: 28px 0; padding-top: 22px; border-top: 1px solid var(--line); }
.summary-item { padding: 14px 0; }
.summary-question { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.summary-answer { white-space: pre-wrap; line-height: 1.55; }
.complete-card { text-align: center; }
.complete-card p { max-width: 560px; margin: 14px auto 0; color: var(--muted); line-height: 1.6; }
.success-mark { width: 58px; height: 58px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 28px; font-weight: 900; }
footer { padding: 18px; color: var(--muted); text-align: center; font-size: 11px; }

.admin-main { width: min(1180px, calc(100% - 32px)); margin: 28px auto 70px; flex: 1; }
.admin-login { max-width: 520px; margin: 70px auto; padding: 42px; }
.admin-login h1, .dashboard-title-row h1 { font-size: clamp(34px, 5vw, 54px); }
.dashboard-title-row { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 24px; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.metric-card { padding: 20px; border-radius: 18px; color: white; background: var(--green-dark); }
.metric-card:nth-child(2) { background: var(--green); }
.metric-card:nth-child(3) { background: #bb6b3f; }
.metric-card:nth-child(4) { background: #6e7c77; }
.metric-card strong { display: block; font-family: Georgia, serif; font-size: 38px; font-weight: 500; }
.metric-card span { font-size: 12px; opacity: .82; }
.admin-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; }
.admin-grid > .panel, .interviews-panel { padding: 28px; }
.panel-copy { color: var(--muted); line-height: 1.6; margin: 0 0 20px; }
.access-value { display: grid; gap: 8px; margin-top: 16px; }
.access-value > span { font-size: 12px; font-weight: 800; }
.accent-access { padding: 16px; border-radius: 15px; background: var(--green-soft); }
.accent-access input { color: var(--green-dark); font-weight: 850; letter-spacing: .08em; }
.status-panel p { color: var(--muted); line-height: 1.6; }
.status-list { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 9px; color: var(--muted); font-size: 13px; }
.status-list li::before { content: "○"; margin-right: 8px; }
.status-list li.done { color: var(--green); font-weight: 700; }
.status-list li.done::before { content: "✓"; }
.invite-result { margin-top: 18px; padding: 15px; border-radius: 14px; background: var(--green-soft); }
.invite-result > span { display: block; font-size: 12px; font-weight: 800; margin-bottom: 8px; }
.copy-row input { min-width: 0; }
.interviews-panel { margin-top: 18px; }
.advanced-invites { margin-top: 18px; padding: 0; overflow: hidden; }
.advanced-invites > summary { cursor: pointer; padding: 20px 28px; font-weight: 800; list-style: none; }
.advanced-invites > summary::-webkit-details-marker { display: none; }
.advanced-invites > summary::after { content: "+"; float: right; color: var(--green); font-size: 20px; }
.advanced-invites[open] > summary::after { content: "−"; }
.advanced-invites summary small { color: var(--muted); font-weight: 500; margin-left: 8px; }
.advanced-content { padding: 24px 28px 28px; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.session-list { display: grid; gap: 12px; }
.empty-state { padding: 34px; text-align: center; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); }
.session-card { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.session-card summary { list-style: none; cursor: pointer; padding: 18px; display: grid; grid-template-columns: 1.5fr 1fr auto; align-items: center; gap: 12px; }
.session-card summary::-webkit-details-marker { display: none; }
.session-person strong { display: block; }
.session-person small, .session-meta { color: var(--muted); font-size: 12px; }
.status-pill { padding: 7px 10px; border-radius: 999px; background: #eceeea; color: var(--muted); font-size: 11px; font-weight: 800; }
.status-pill.complete { background: var(--green-soft); color: var(--green); }
.status-pill.review { background: #f6e9e2; color: #a95730; }
.session-details { padding: 0 18px 20px; border-top: 1px solid var(--line); }
.answer-row { padding: 15px 0; border-bottom: 1px solid #eceeea; }
.answer-row:last-child { border-bottom: 0; }
.answer-row strong { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.answer-row p { margin: 0; white-space: pre-wrap; line-height: 1.5; }

@media (max-width: 760px) {
  .topbar { width: min(100% - 28px, 1180px); padding: 15px 0; }
  .privacy-badge, .brand small { display: none; }
  .topbar-actions { gap: 8px; }
  .main-column { margin-top: 14px; }
  .promise-grid, .field-row, .metrics-grid, .admin-grid { grid-template-columns: 1fr; }
  .promise-grid { gap: 8px; }
  .promise-grid > div { grid-template-columns: 32px 1fr; }
  .promise-grid small { grid-column: 2; }
  .interview-header { align-items: flex-start; flex-direction: column; }
  .progress-box { width: 100%; text-align: left; }
  .message { max-width: 94%; }
  .composer-actions { align-items: stretch; flex-direction: column; }
  .composer-actions .button { width: 100%; justify-content: center; }
  .button-row { align-items: stretch; flex-direction: column; }
  .dashboard-title-row { align-items: flex-start; }
  .session-card summary { grid-template-columns: 1fr auto; }
  .session-meta { grid-column: 1 / -1; }
}
