:root {
  --bg: #e7e0d4;
  --ink: #1b1914;
  --ink-2: #2c2820;
  --cream: #f7f1e6;
  --paper: #fbf7ef;
  --muted: #6f685c;
  --line: rgba(27, 25, 20, 0.12);
  --line-strong: rgba(27, 25, 20, 0.22);
  --navy: #1b1914;
  --navy-soft: #ece6d8;
  --forest: #2f5a45;
  --forest-soft: #e4eee7;
  --ochre: #9a5b1f;
  --ochre-soft: #f3e6cf;
  --brick: #8a3d34;
  --brick-soft: #f3e4e1;
  --gold: #6e5424;
  --gold-soft: #f1e6cc;
  --copper: #c45c32;
  --wait: #5a564c;
  --shadow: 0 18px 40px rgba(27, 25, 20, 0.08);
  --serif: Palatino, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { color-scheme: light; }
body {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(196, 92, 50, 0.07), transparent 50%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.005em;
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  z-index: 80;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}
::selection {
  background: #e8c8b6;
  color: var(--ink);
}
:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

.mark {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.sub { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

.btn {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--cream);
  padding: 11px 18px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
  transition: background 160ms var(--ease), color 160ms var(--ease), transform 160ms var(--ease);
}
a.btn:hover { text-decoration: none; }
.btn:hover { background: #000; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: wait; }
.btn.busy::after { content: "…"; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: rgba(27, 25, 20, 0.05); }

.screen { display: none; min-height: 100vh; }
.screen.is-on { display: block; }

/* ——— Setup desk ——— */
.setup-frame {
  display: grid;
  grid-template-columns: minmax(260px, 32vw) 1fr;
  min-height: 100vh;
  height: 100vh;
}
.setup-rail {
  background: var(--ink);
  color: var(--cream);
  padding: 36px 32px 28px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}
.setup-rail .mark { color: #cbbba4; }
.rail-title {
  font-family: var(--serif);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 500;
  font-optical-sizing: auto;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin: 18px 0 12px;
  color: var(--cream);
  max-width: 16ch;
  text-wrap: balance;
}
.rail-lead {
  margin: 0 0 36px;
  color: #c4b8a6;
  font-size: 15px;
  max-width: 32ch;
}
.wizard-progress {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.wizard-progress button {
  width: 100%;
  display: flex;
  align-items: baseline;
  gap: 14px;
  border: 0;
  background: transparent;
  color: #8f8578;
  font: inherit;
  font-size: 15px;
  padding: 10px 0;
  cursor: pointer;
  text-align: left;
  border-bottom: 1px solid rgba(247, 241, 230, 0.08);
}
.wizard-progress .n {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: #6d655a;
  min-width: 1.8em;
}
.wizard-progress li.is-done button { color: #d8cfc0; }
.wizard-progress li.is-done .n { color: #c45c32; }
.wizard-progress li.is-on button {
  color: var(--cream);
}
.wizard-progress li.is-on .n { color: var(--copper); }
.rail-foot {
  margin: 28px 0 0;
  color: #7d7468;
  font-size: 13px;
  line-height: 1.45;
  max-width: 30ch;
}

.setup-stage {
  padding: clamp(32px, 7vh, 72px) clamp(24px, 6vw, 88px) 32px;
  max-width: 920px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.step-index {
  margin: 0 0 28px;
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.setup-card {
  background: transparent;
  border: 0;
  padding: 0;
  max-width: 640px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.setup-card fieldset { border: 0; margin: 0 0 22px; padding: 0; }
.setup-card legend,
.field-block h3 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 14px;
}
.field-block {
  margin: 28px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.field-block:first-of-type { margin-top: 8px; }
.field-block h3 span {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-left: 10px;
  font-weight: 600;
}
.wizard-step { display: none; }
.wizard-step.is-on {
  display: block;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 8px;
  animation: rise 380ms var(--ease);
}
.wizard-step h2 {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.06;
  margin: 0 0 12px;
  max-width: 16ch;
  color: var(--ink);
  text-wrap: balance;
  -webkit-font-smoothing: auto;
}
.wizard-step.is-on input[name="name"] {
  font-family: var(--serif);
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 500;
  padding-top: 4px;
}
.setup-lead {
  color: var(--muted);
  margin: 0 0 28px;
  font-size: 17px;
  max-width: 42ch;
}
.setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 16px;
}
.setup-grid .wide { grid-column: 1 / -1; }
.setup-grid label,
.file-drop {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.setup-grid label[hidden] { display: none; }
.setup-grid input,
.setup-grid select,
.setup-grid textarea,
.repeat-row input,
select,
input[type="search"],
input[type="number"],
input[type="text"],
input[type="email"],
input[type="password"] {
  font-family: var(--sans);
  font-size: 17px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  color: var(--ink);
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
  padding: 10px 0 12px;
  border-radius: 0;
  width: 100%;
}
.setup-grid select,
select {
  background: transparent;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231b1914' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
  padding-right: 22px;
}
.setup-grid textarea { min-height: 72px; resize: vertical; }
.setup-grid input:focus,
.setup-grid select:focus,
.setup-grid textarea:focus,
.repeat-row input:focus,
select:focus,
input:focus {
  outline: none;
  border-bottom-color: var(--copper);
}
.file-hint {
  margin-top: 2px;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 400;
  color: var(--muted);
}
.file-drop {
  position: relative;
  margin: 0 0 22px;
  min-height: 132px;
  justify-content: center;
  padding: 28px 20px;
  border: 1px dashed var(--line-strong);
  background: var(--paper);
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
}
.file-drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
}
.file-drop-ui {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  text-align: center;
}
.file-drop:hover { border-color: var(--copper); background: var(--paper); }

.repeat-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.repeat-row { display: flex; gap: 10px; align-items: center; }
.repeat-row input { flex: 1; }
.repeat-row .btn-ghost {
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 500;
  border: 0;
  color: var(--muted);
}
.repeat-row .btn-ghost:hover { color: var(--brick); background: transparent; }

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
}
.choice-row button {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font: inherit;
  padding: 10px 16px;
  cursor: pointer;
}
.choice-row button.is-on {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}

.setup-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.setup-actions .caption { margin: 0; }
.setup-actions-btns { display: flex; gap: 8px; margin-left: auto; }
.privacy-note {
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 16px;
  max-width: 48ch;
}
.consent-q {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  margin: 22px 0 12px;
  color: var(--ink);
}
.mail-consent { margin-top: 8px; }
#mailScanFields h3 { margin-top: 22px; }

@keyframes rise {
  from { transform: translateY(14px); }
  to { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .wizard-step.is-on, .btn { animation: none; transition: none; }
}

/* ——— App chrome ——— */
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 20px 36px;
  background: var(--ink);
  color: var(--cream);
  position: sticky;
  top: 0;
  z-index: 40;
}
.brand {
  text-decoration: none;
  color: inherit;
  min-width: 180px;
}
.brand:hover { text-decoration: none; }
.brand .mark { color: #cbbba4; }
.brand h1 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.03em;
  margin: 6px 0 0;
  color: var(--cream);
}
.brand .sub { color: #a89c8c; }
.app-nav {
  display: flex;
  gap: 4px;
  padding: 0;
  background: transparent;
  border: 0;
}
.app-nav a {
  color: #a89c8c;
  text-decoration: none;
  padding: 8px 12px 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: inset 0 -1px 0 transparent;
}
.app-nav a:hover { color: var(--cream); text-decoration: none; }
.app-nav a.is-on {
  background: transparent;
  color: var(--cream);
  box-shadow: inset 0 -2px 0 var(--copper);
}
.top-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.google-search {
  display: flex;
  min-width: 200px;
  flex: 1 1 240px;
  max-width: 380px;
}
.google-search input {
  width: 100%;
  border: 1px solid rgba(247, 241, 230, 0.28);
  background: rgba(247, 241, 230, 0.1);
  color: var(--cream);
  padding: 9px 12px;
  font: inherit;
  font-size: 14px;
  border-radius: 0;
}
.google-search input::placeholder { color: #a89c8c; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.top .btn {
  background: var(--cream);
  color: var(--ink);
  border-color: var(--cream);
}
.top .btn:hover { background: #fff; }
.top .btn-ghost {
  background: transparent;
  color: var(--cream);
  border-color: rgba(247, 241, 230, 0.28);
}
.top .btn-ghost:hover { background: rgba(247, 241, 230, 0.08); }
.seg {
  display: flex;
  border: 1px solid rgba(247, 241, 230, 0.2);
  background: transparent;
}
.seg-btn {
  border: 0;
  background: transparent;
  padding: 8px 12px;
  font: inherit;
  color: #a89c8c;
  cursor: pointer;
}
.seg-btn.is-on {
  background: var(--cream);
  color: var(--ink);
}

.view { display: none; }
.view.is-on { display: block; }

main { padding: 28px 36px 72px; max-width: 1280px; }
.sync-note {
  margin: 0 0 18px;
  padding: 12px 14px;
  background: var(--ochre-soft);
  border: 0;
  border-left: 3px solid var(--copper);
  color: var(--gold);
  font-size: 15px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
}
.profile-item .label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.profile-item .val {
  margin-top: 6px;
  font-size: 16px;
  font-weight: 550;
  word-break: break-word;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.kpi {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 16px 16px 14px;
}
.kpi .label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.kpi .value {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 500;
  line-height: 1.05;
  margin-top: 10px;
  font-variant-numeric: tabular-nums;
}
.kpi .hint { margin-top: 6px; color: var(--muted); font-size: 13px; }
.kpi.accent { border-color: var(--ink); }
.kpi.accent .value { color: var(--copper); }

.grid-2 {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 20px 20px 18px;
  margin-bottom: 12px;
}
.panel-h { margin-bottom: 16px; }
.panel-h.row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
}
.panel-h h2 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  margin: 0;
  letter-spacing: -0.02em;
}
.panel-h p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
select, input[type="search"] { min-width: 140px; }
input[type="search"] { min-width: 200px; flex: 1 1 180px; }

.funnel { display: flex; flex-direction: column; gap: 10px; }
.funnel-row { display: grid; grid-template-columns: 110px 1fr 64px; gap: 10px; align-items: center; }
.funnel-row .name { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.bar {
  height: 10px;
  background: var(--bg);
  border: 0;
  position: relative;
}
.bar > span {
  display: block;
  height: 100%;
  background: var(--ink);
}
.bar.assessment > span { background: var(--ochre); }
.bar.interview > span { background: var(--forest); }
.bar.offer > span { background: var(--gold); }
.bar.rejected > span { background: var(--brick); }
.bar.waiting > span { background: var(--wait); }
.funnel-row .n { text-align: right; font-variant-numeric: tabular-nums; }

.insights { display: flex; flex-direction: column; gap: 12px; }
.insight {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.insight:first-child { border-top: 0; padding-top: 0; }
.insight h3 { margin: 0; font-size: 13px; font-weight: 600; }
.insight .val {
  font-family: var(--serif);
  font-size: 24px;
  margin: 4px 0;
  color: var(--copper);
}
.insight p { margin: 0; color: var(--muted); }

.chart { height: 220px; }
.chart svg { width: 100%; height: 100%; display: block; }

.pill {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 0;
  background: var(--bg);
}
.pill.applied { background: var(--navy-soft); color: var(--ink); }
.pill.interview { background: var(--forest-soft); color: var(--forest); }
.pill.assessment { background: var(--ochre-soft); color: var(--ochre); }
.pill.offer { background: var(--gold-soft); color: var(--gold); }
.pill.rejected { background: var(--brick-soft); color: var(--brick); }
.pill.withdrawn, .pill.waiting { color: var(--wait); }
.pill.unlinked { background: var(--ochre-soft); color: var(--ochre); }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 8px 8px 8px 0;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 11px 8px 11px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
td.title { font-weight: 550; }
td.muted, .muted { color: var(--muted); }
a { color: var(--ink); text-decoration: none; border-bottom: 1px solid transparent; }
a:hover { border-bottom-color: var(--copper); }
.app-nav a, .brand, .btn, .brand:hover, .app-nav a:hover { border-bottom: 0; }

.company-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.company-row:last-child { border-bottom: 0; }
.meters { color: var(--muted); font-size: 13px; text-align: right; }

.track-card {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.track-card:last-child { border-bottom: 0; }
.track-card h3 { margin: 0 0 6px; font-size: 16px; }
.mini { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.mini b { color: var(--ink); font-weight: 600; }

.status-select {
  font: inherit;
  font-size: 13px;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
  padding: 3px 0;
}

footer {
  padding: 0 36px 36px;
  color: var(--muted);
  font-size: 13px;
  max-width: 1280px;
}

.empty { color: var(--muted); padding: 12px 0; }

@media (max-width: 1080px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .top, main, footer { padding-left: 18px; padding-right: 18px; }
  .top { flex-direction: column; align-items: flex-start; position: static; }
  .profile-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .setup-frame {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
  }
  .setup-rail {
    height: auto;
    position: static;
    padding: 22px 20px 8px;
  }
  .rail-title { font-size: 28px; margin-bottom: 8px; max-width: none; }
  .rail-lead { display: none; }
  .wizard-progress {
    flex-direction: row;
    overflow-x: auto;
    gap: 0;
    padding-bottom: 8px;
  }
  .wizard-progress button {
    border-bottom: 0;
    padding: 10px 14px 12px 0;
    white-space: nowrap;
  }
  .rail-foot { display: none; }
  .setup-stage { padding: 28px 20px 48px; min-height: 0; }
  .wizard-step h2 { font-size: 34px; }
}
@media (max-width: 700px) {
  .setup-grid { grid-template-columns: 1fr; }
  .top {
    flex-wrap: wrap;
    padding: 14px 16px;
    gap: 10px 12px;
  }
  .brand { min-width: 0; flex: 1 1 140px; }
  .brand h1 { font-size: 22px; }
  .app-nav { width: 100%; overflow-x: auto; }
  .top-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .top .btn, .top .btn-ghost { font-size: 14px; padding: 9px 12px; }
  .seg { display: none; }
  .profile-panel .filters { flex-wrap: wrap; }
  body.static-web #resumePathWrap { display: none; }
}
@media (max-width: 640px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
