:root {
  --bg: #f6f5f1;
  --card: #ffffff;
  --ink: #1c1b18;
  --muted: #6f6b60;
  --line: #e5e2d9;
  --accent: #2f6f5e;
  --accent-ink: #ffffff;
  --accent-soft: #e3efeb;
  --danger: #b0492f;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Georgia, 'Times New Roman', serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

.wrap { max-width: 1040px; margin: 0 auto; padding: 28px 24px 64px; }

header.site {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-bottom: 20px; border-bottom: 1px solid var(--line); margin-bottom: 32px;
}
header.site h1 { font-size: 22px; font-weight: 600; letter-spacing: 0.2px; }
header.site h1 a { color: var(--ink); text-decoration: none; }
header.site h1 em { color: var(--accent); font-style: italic; }
header.site nav a {
  font-family: 'Helvetica Neue', Arial, sans-serif; font-size: 13px;
  color: var(--muted); text-decoration: none; margin-left: 18px;
}
header.site nav a:hover, header.site nav a.active { color: var(--accent); }

h2 { font-size: 28px; font-weight: 600; margin-bottom: 6px; }
p.lede { color: var(--muted); margin-bottom: 28px; font-size: 15px; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px;
}

.btn {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  display: inline-block; border: none; cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
  padding: 11px 22px; border-radius: 999px; font-size: 14px;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.88; }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn.small { padding: 7px 14px; font-size: 12px; }

input[type='text'], input[type='email'], input[type='password'] {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  width: 100%; padding: 11px 14px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 14px; background: #fdfdfb; color: var(--ink);
}
input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
label { font-family: 'Helvetica Neue', Arial, sans-serif; font-size: 12px; color: var(--muted); display: block; margin: 14px 0 6px; text-transform: uppercase; letter-spacing: 0.6px; }

.sans { font-family: 'Helvetica Neue', Arial, sans-serif; }
.muted { color: var(--muted); }

/* ---------- schedule ---------- */

.sched-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 800px) { .sched-grid { grid-template-columns: 1fr; } }

.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-head strong { font-size: 16px; }
.cal-nav { background: none; border: 1px solid var(--line); border-radius: 8px; width: 32px; height: 32px; cursor: pointer; font-size: 15px; color: var(--ink); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .dow { font-family: 'Helvetica Neue', Arial, sans-serif; font-size: 11px; color: var(--muted); text-align: center; padding: 4px 0; text-transform: uppercase; }
.cal .day {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  aspect-ratio: 1; border-radius: 10px; border: 1px solid transparent;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; cursor: pointer; background: none; color: var(--ink);
}
.cal .day:not(:disabled):hover { border-color: var(--accent); }
.cal .day.selected { background: var(--accent); color: #fff; }
.cal .day:disabled { color: #c9c5ba; cursor: default; }

.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.slot {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  padding: 10px 0; border: 1px solid var(--line); border-radius: 10px;
  background: #fdfdfb; font-size: 13px; cursor: pointer; text-align: center; color: var(--ink);
}
.slot:not(:disabled):hover { border-color: var(--accent); }
.slot.selected { background: var(--accent); color: #fff; border-color: var(--accent); }
.slot:disabled { opacity: 0.35; cursor: default; text-decoration: line-through; }

.invite { text-align: center; }
.invite .big { font-size: 42px; margin: 10px 0 4px; }
.invite-link {
  font-family: ui-monospace, Menlo, monospace; font-size: 13px;
  background: var(--accent-soft); border-radius: 10px; padding: 12px 16px;
  margin: 18px 0; word-break: break-all;
}
.invite .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- dashboard ---------- */

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 28px; }
@media (max-width: 700px) { .stats { grid-template-columns: 1fr; } }
.stat .n { font-size: 34px; font-weight: 600; }
.stat .l { font-family: 'Helvetica Neue', Arial, sans-serif; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; margin-top: 2px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { font-family: 'Helvetica Neue', Arial, sans-serif; font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 12px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: none; }
.pill { font-family: 'Helvetica Neue', Arial, sans-serif; font-size: 11px; padding: 3px 10px; border-radius: 999px; }
.pill.scheduled { background: #efe9d8; color: #7a6a33; }
.pill.in_progress { background: #dde8f5; color: #33567a; }
.pill.completed { background: var(--accent-soft); color: var(--accent); }

.section-title { font-size: 18px; font-weight: 600; margin: 30px 0 12px; }

/* transcript modal */
.modal-back {
  position: fixed; inset: 0; background: rgba(28, 27, 24, 0.45);
  display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 50;
}
.modal {
  background: var(--card); border-radius: var(--radius); max-width: 720px; width: 100%;
  max-height: 84vh; display: flex; flex-direction: column;
}
.modal header { padding: 20px 24px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal .body { padding: 20px 24px; overflow-y: auto; }
.modal .close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--muted); }

.turn { margin-bottom: 14px; }
.turn .who { font-family: 'Helvetica Neue', Arial, sans-serif; font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 3px; }
.turn.ai .who { color: var(--accent); }
.turn.employee .who { color: #33567a; }
.turn .txt { font-size: 14.5px; line-height: 1.55; }

/* ---------- interview call ---------- */

.call { max-width: 680px; margin: 0 auto; text-align: center; }
.orb {
  width: 148px; height: 148px; border-radius: 50%; margin: 26px auto 18px;
  background: radial-gradient(circle at 34% 30%, #57a08c, var(--accent) 65%);
  box-shadow: 0 0 0 0 rgba(47, 111, 94, 0.25);
  transition: transform 0.3s;
}
.orb.speaking { animation: pulse 1.4s infinite; }
.orb.listening { background: radial-gradient(circle at 34% 30%, #6d94c4, #33567a 65%); animation: pulse 2s infinite; }
.orb.idle { opacity: 0.7; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(47, 111, 94, 0.30); }
  70% { box-shadow: 0 0 0 26px rgba(47, 111, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 111, 94, 0); }
}
.status-line { font-family: 'Helvetica Neue', Arial, sans-serif; font-size: 13px; color: var(--muted); min-height: 20px; margin-bottom: 6px; }
.heard { font-style: italic; color: #33567a; min-height: 20px; font-size: 14.5px; margin-bottom: 12px; }
.caption { font-size: 19px; line-height: 1.5; min-height: 60px; margin: 0 auto 22px; max-width: 560px; }
.timer { font-family: ui-monospace, Menlo, monospace; font-size: 13px; color: var(--muted); }

.live-transcript { text-align: left; margin-top: 34px; max-height: 300px; overflow-y: auto; }

.answer-box { display: flex; gap: 10px; max-width: 560px; margin: 0 auto; }
.answer-box input { flex: 1; }

.hidden { display: none !important; }

/* ---------- org chart ---------- */

.wrap.wide { max-width: 1400px; }

.org-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.org-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; align-items: center; }
.org-legend span { display: flex; align-items: center; gap: 5px; }

.progress-track { height: 5px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 8px 0 14px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #57a08c, var(--accent)); border-radius: 99px; transition: width 0.6s ease; }

.warn-banner { background: #f7edd3; border: 1px solid #e2d3a1; color: #7a6a33; border-radius: 10px; padding: 9px 14px; font-size: 12.5px; margin-bottom: 10px; }

/* pan/zoom viewport */
.chart-viewport {
  position: relative; overflow: hidden; height: calc(100vh - 250px); min-height: 420px;
  border-radius: var(--radius); background:
    radial-gradient(circle, #e8e5dc 1px, transparent 1px) 0 0 / 26px 26px,
    var(--card);
  border: 1px solid var(--line);
  cursor: grab; touch-action: none;
}
.chart-viewport.panning { cursor: grabbing; }
.chart-canvas { position: absolute; transform-origin: 0 0; will-change: transform; }

.zoom-controls {
  position: absolute; bottom: 16px; left: 16px; z-index: 5;
  display: flex; gap: 6px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 8px; box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  font-family: 'Helvetica Neue', Arial, sans-serif;
}
.zoom-controls button {
  background: none; border: none; cursor: pointer; font-size: 15px;
  width: 28px; height: 28px; border-radius: 50%; color: var(--ink);
}
.zoom-controls button:hover { background: var(--accent-soft); }
.zoom-controls .zpct { font-size: 12px; color: var(--muted); min-width: 42px; text-align: center; }
.zoom-controls .zfit { width: auto; font-size: 12px; padding: 0 10px; }

/* tree connectors */
.tree, .tree ul { display: flex; justify-content: center; padding: 0; margin: 0; }
.tree ul { padding-top: 34px; position: relative; }
.tree li { list-style: none; position: relative; padding: 34px 12px 0; display: flex; flex-direction: column; align-items: center; }
.tree > li { padding-top: 12px; }
.tree li::before, .tree li::after {
  content: ''; position: absolute; top: 0; right: 50%;
  border-top: 2px solid #d8d3c6; width: 50%; height: 34px;
}
.tree li::after { right: auto; left: 50%; border-left: 2px solid #d8d3c6; }
.tree li:only-child::before, .tree li:only-child::after { border-top: 0 none; }
.tree li:first-child::before, .tree li:last-child::after { border-top: 0 none; }
.tree li:last-child::before { border-right: 2px solid #d8d3c6; border-radius: 0 10px 0 0; }
.tree li:first-child::after { border-radius: 10px 0 0 0; }
.tree > li::before, .tree > li::after { display: none; }
.tree ul::before {
  content: ''; position: absolute; top: 0; left: calc(50% - 1px);
  border-left: 2px solid #d8d3c6; height: 34px;
}

/* modern employee cards */
.node {
  --dept: #7a8fa5;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background: var(--card);
  border: 1px solid var(--line); border-top: 3px solid var(--dept);
  border-radius: 12px; padding: 11px 14px; width: 172px;
  box-shadow: 0 2px 6px rgba(30, 26, 12, 0.07);
  cursor: pointer; position: relative; text-align: left;
  display: flex; align-items: center; gap: 10px;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
  animation: nodeIn 0.35s ease both;
}
@keyframes nodeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.node:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(30, 26, 12, 0.13); }
.node.selected { outline: 2px solid var(--accent); outline-offset: 1px; }
.node .avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: color-mix(in srgb, var(--dept) 18%, white);
  color: var(--dept); font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid color-mix(in srgb, var(--dept) 45%, white);
}
.node .n-name { font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.node .n-title { font-size: 10.5px; color: var(--muted); margin-top: 1px; line-height: 1.3; }
.node.root { --dept: var(--accent); width: 196px; border-radius: 999px; border-top-width: 1px; border-color: #9fceb4; background: linear-gradient(135deg, #dbeee2, #c2e4d0); }
.node.root .avatar { background: var(--accent); color: #fff; border-color: var(--accent); }

.node .chip {
  position: absolute; top: -8px; right: -7px;
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 700; color: #fff;
  border: 2px solid var(--card); box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.chip.pending { background: #b8b2a3; }
.chip.scheduled { background: #4a76a8; }
.chip.in_progress { background: #4a76a8; animation: chipPulse 1.4s infinite; }
.chip.completed { background: var(--accent); }
.chip.flagged { background: #d98a2b; }
@keyframes chipPulse { 0% { box-shadow: 0 0 0 0 rgba(74,118,168,0.5); } 70% { box-shadow: 0 0 0 8px rgba(74,118,168,0); } 100% { box-shadow: 0 0 0 0 rgba(74,118,168,0); } }
.node .flag-corner { position: absolute; top: -8px; left: -7px; width: 20px; height: 20px; border-radius: 50%; background: #d98a2b; color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center; border: 2px solid var(--card); }

.node .kids-toggle {
  position: absolute; bottom: -11px; left: 50%; transform: translateX(-50%);
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  font-size: 10px; color: var(--muted); padding: 2px 9px; cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.10); white-space: nowrap;
}
.node .kids-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* legend chips reuse */
.org-legend .chip { position: static; width: 16px; height: 16px; border-width: 0; font-size: 9px; }

/* ---------- employee panel ---------- */

.panel-back { position: fixed; inset: 0; background: rgba(28, 27, 24, 0.32); z-index: 40; backdrop-filter: blur(2px); }
.panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: 440px; max-width: 94vw;
  background: var(--bg); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; box-shadow: -12px 0 40px rgba(0,0,0,0.16);
  animation: panelIn 0.22s ease;
}
@keyframes panelIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.panel .p-head {
  --dept: #7a8fa5;
  padding: 24px 22px 18px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--dept) 16%, white), var(--card));
  border-bottom: 1px solid var(--line);
  display: flex; gap: 14px; align-items: center; position: relative;
}
.panel .p-avatar {
  width: 52px; height: 52px; border-radius: 50%; flex: none;
  background: var(--dept); color: #fff; font-weight: 700; font-size: 18px;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  display: flex; align-items: center; justify-content: center;
}
.panel .p-name { font-size: 21px; font-weight: 600; line-height: 1.2; }
.panel .p-chips { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.pill2 {
  font-family: 'Helvetica Neue', Arial, sans-serif; font-size: 11px;
  padding: 3px 10px; border-radius: 999px; background: var(--card);
  border: 1px solid var(--line); color: var(--muted);
}
.pill2.status-completed { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill2.status-scheduled, .pill2.status-in_progress { background: #dde8f5; color: #33567a; border-color: transparent; }
.pill2.status-pending { background: #efece3; color: #8a8578; border-color: transparent; }
.pill2.dept { border-color: color-mix(in srgb, var(--dept) 40%, white); color: var(--dept); }
.panel .close { position: absolute; top: 14px; right: 14px; background: none; border: none; font-size: 17px; cursor: pointer; color: var(--muted); }
.panel .body { padding: 18px 22px 26px; overflow-y: auto; }

.facts {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px;
  font-family: 'Helvetica Neue', Arial, sans-serif;
}
.fact { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; }
.fact .fk { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.fact .fv { font-size: 13px; margin-top: 3px; line-height: 1.35; }
.fact.wide { grid-column: 1 / -1; }

.p-section {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 15px; margin-bottom: 10px;
}
.p-section .p-h {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.7px;
  color: var(--muted); margin-bottom: 6px; display: flex; align-items: center; gap: 6px;
}
.p-section .p-b { font-size: 14px; line-height: 1.55; }
.p-section .p-b > div { margin-bottom: 4px; }
.p-section .p-b.muted { color: var(--muted); font-style: italic; font-size: 13px; }
.p-section.red { background: #fdf3ec; border-color: #ecccb2; }
.p-section.red .p-h { color: var(--danger); }
.p-section.red .p-b { color: #8a3c22; }
.panel-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

/* ---------- dashboard ---------- */

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.kpi .k-n { font-size: 30px; font-weight: 600; line-height: 1.1; }
.kpi .k-n small { font-size: 15px; color: var(--muted); font-weight: 400; }
.kpi .k-l { font-family: 'Helvetica Neue', Arial, sans-serif; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; margin-top: 5px; }
.kpi .progress-track { margin: 10px 0 0; }

.dash-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-bottom: 22px; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.dash-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.dash-card .sub { font-family: 'Helvetica Neue', Arial, sans-serif; font-size: 11px; color: var(--muted); }

.donut-wrap { display: flex; align-items: center; gap: 18px; }
.donut-legend { font-family: 'Helvetica Neue', Arial, sans-serif; font-size: 12px; display: grid; gap: 6px; }
.donut-legend span { display: flex; align-items: center; gap: 7px; color: var(--muted); }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.dept-bars { display: grid; gap: 9px; font-family: 'Helvetica Neue', Arial, sans-serif; }
.dept-bar .db-top { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 3px; }
.dept-bar .db-top b { font-weight: 600; }
.dept-bar .db-track { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.dept-bar .db-fill { height: 100%; border-radius: 99px; transition: width 0.6s ease; }

.flag-list, .activity-list { display: grid; gap: 10px; font-family: 'Helvetica Neue', Arial, sans-serif; }
.flag-item { background: #fdf3ec; border: 1px solid #ecccb2; border-radius: 10px; padding: 10px 13px; cursor: pointer; }
.flag-item:hover { border-color: #d98a2b; }
.flag-item .fi-name { font-size: 13px; font-weight: 600; color: #8a3c22; }
.flag-item .fi-flag { font-size: 12px; color: #8a3c22; opacity: 0.85; margin-top: 2px; }
.activity-item { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.activity-item .chip { position: static; flex: none; }
.activity-item .ai-when { margin-left: auto; color: var(--muted); font-size: 11.5px; white-space: nowrap; }

/* ---------- engine scores (findings panel) ---------- */
.score-group { margin-top: 10px; }
.score-group:first-of-type { margin-top: 4px; }
.score-group-h {
  font-family: var(--sans); font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 4px;
}
.score-row { display: flex; align-items: center; justify-content: space-between; padding: 3px 0; }
.score-name { font-family: var(--sans); font-size: 12.5px; }
.score-badge {
  font-family: var(--sans); font-size: 11px; font-weight: 700; min-width: 26px; text-align: center;
  padding: 2px 7px; border-radius: 999px;
}
.score-badge.s-high { background: #e3efe5; color: #2e5c3a; }
.score-badge.s-mid  { background: #f6ecd9; color: #8a6d1f; }
.score-badge.s-low  { background: #fdeae2; color: #a13c1c; }
.score-badge.s-null { background: #f0efeb; color: var(--muted); font-weight: 500; }
.score-badge.s-raw  { background: #e9ecf4; color: #3d4d75; }
.score-quote {
  font-size: 12px; color: var(--muted); font-style: italic; line-height: 1.45;
  margin: 1px 0 6px; padding-left: 10px; border-left: 2px solid var(--line);
}

/* Honeypot field on the booking form — off-screen rather than display:none,
   because some form-filling bots deliberately skip display:none inputs.
   Screen readers skip it via aria-hidden on the wrapper. */
.hp-wrap {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
