:root {
  --bg: #f6f5f2; --surface: #ffffff; --ink: #1d232b; --muted: #6b7280; --line: #e3e1db;
  --accent: #1f3a5f; --accent-ink: #ffffff; --soft: #eef2f7; --partner: #1f3a5f; --tag: #e8eef6;
  --good: #2f6b4f; --warn: #8a5a12; --bad: #8b2f2f;
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.55 var(--sans); display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
body > main { flex: 1; min-height: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-weight: normal; }
.error { color: var(--bad); }
button { font: inherit; cursor: pointer; border-radius: 8px; padding: 10px 16px; border: 1px solid transparent; }
button:disabled { opacity: .55; cursor: default; }
.primary { background: var(--accent); color: var(--accent-ink); }
.ghost { background: transparent; border-color: var(--line); color: var(--ink); }

.top { flex: none; display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.brand { font-family: var(--serif); font-size: 18px; }
.brand span { color: var(--muted); }

/* Welcome */
.welcome { display: flex; justify-content: center; align-items: flex-start; padding: 48px 16px; overflow-y: auto; }
.welcome-card { max-width: 620px; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 36px; }
.welcome h1 { font-family: var(--serif); font-weight: normal; font-size: 30px; margin: 0 0 12px; }
.lede { font-size: 17px; color: #39414c; margin: 0 0 20px; }
.facts { padding-left: 18px; margin: 0 0 24px; }
.facts li { margin-bottom: 8px; }
label { display: block; font-weight: 600; margin-bottom: 6px; }
input[type=text] { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 18px; }

/* Interview layout */
.interview { display: grid; grid-template-columns: minmax(0, 1fr) 420px; }
.chat { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.progress { display: flex; gap: 4px; list-style: none; margin: 0; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--surface); overflow-x: auto; }
.progress li { flex: 1; min-width: 70px; font-size: 11.5px; color: var(--muted); border-top: 3px solid var(--line); padding-top: 6px; white-space: nowrap; }
.progress li.done { border-color: #9fb1c8; }
.progress li.now { border-color: var(--accent); color: var(--ink); font-weight: 600; }
.messages { flex: 1; overflow-y: auto; padding: 24px 20px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: min(680px, 100%); overflow-wrap: anywhere; padding: 12px 16px; border-radius: 12px; white-space: pre-wrap; }
.msg.interviewer { background: var(--surface); border: 1px solid var(--line); align-self: flex-start; }
.msg.partner { background: var(--partner); color: #fff; align-self: flex-end; }
.msg.typing { color: var(--muted); font-style: italic; }
.composer { display: flex; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface); }
.composer textarea { flex: 1; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; resize: none; }
.done { padding: 18px 20px; border-top: 1px solid var(--line); background: var(--surface); }
.done p { margin: 0 0 10px; font-weight: 600; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }

/* Card */
.card-panel { overflow-y: auto; background: var(--surface); padding: 20px 22px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.card-head h2 { font-family: var(--serif); font-weight: normal; font-size: 20px; margin: 0; }
.card-panel.flash { animation: flash 1.2s ease; }
@keyframes flash { from { background: var(--soft); } to { background: var(--surface); } }
.card .kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.card .k { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.card .k.block { margin: 14px 0 6px; }
.card .sub { font-size: 12.5px; font-weight: 600; margin: 6px 0 2px; }
.card .wf { margin-top: 18px; padding-top: 12px; border-top: 2px solid var(--ink); }
.card .wf h3 { font-family: var(--serif); font-weight: normal; font-size: 18px; margin: 0 0 8px; display: flex; gap: 8px; align-items: baseline; }
.card .num { font-family: var(--sans); font-size: 12px; background: var(--accent); color: #fff; border-radius: 10px; padding: 1px 7px; }
.card ul { margin: 0; padding-left: 18px; font-size: 13.5px; }
.card .steps { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.card .steps th { text-align: left; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); padding: 4px 4px; }
.card .steps td { border-bottom: 1px solid var(--line); padding: 4px 4px; vertical-align: top; }
.tag { display: inline-block; font-size: 11px; background: var(--tag); border-radius: 10px; padding: 0 7px; }
.tag.t-interested { background: #dcefe4; } .tag.t-no { background: #f3dddd; } .tag.t-maybe { background: #f5ead2; }
.card-toggle { display: none; }

@media (max-width: 900px) {
  .interview { grid-template-columns: minmax(0, 1fr); position: relative; }
  .chat { border-right: 0; }
  .card-panel { position: absolute; inset: 0; z-index: 5; display: none; }
  .card-panel.open { display: block; }
  .card-toggle { display: block; position: fixed; right: 16px; bottom: 110px; z-index: 6; background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
  .top { padding: 12px 16px; }
  .brand span { display: none; }
  .ghost#copyLink { padding: 6px 10px; font-size: 13px; }
  .messages, .composer, .done { padding-left: 16px; padding-right: 16px; }
  .progress { padding: 10px 16px; }
  .welcome { padding: 20px 16px; }
  .welcome-card { padding: 24px; }
  .welcome h1 { font-size: 25px; }
  .card .kv { grid-template-columns: 100px 1fr; }
}

@media print {
  .top, .chat, .card-toggle { display: none !important; }
  .interview { display: block; }
  body { display: block; height: auto; }
  .card-panel { display: block !important; position: static; overflow: visible; }
}

.btn-link { display: inline-block; text-decoration: none; border-radius: 8px; padding: 10px 16px; }
.done .muted { font-weight: normal; margin: 0 0 10px; }

/* Public mode: email field and consent notice on the start screen */
.consent { border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin: 0 0 20px; background: var(--soft); }
.consent h2 { font-size: 16px; margin: 0 0 8px; }
.consent ul { padding-left: 18px; margin: 0 0 10px; }
.consent li { margin-bottom: 6px; }
label.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; margin: 0; }
label.check input { margin-top: 3px; }
input[type=email] { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 18px; }
