/* Components — §6. Exact values from the spec; structure from hairlines, not boxes. */

/* 6.1 Sidebar nav item */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 10px 22px;
  color: #7A7F86;
  font-weight: 500;
  background: transparent;
  text-decoration: none;
  transition: background 130ms ease, color 130ms ease;
}
.nav-item--active {
  color: var(--ink);
  font-weight: 600;
  background: var(--signal-soft);
  box-shadow: inset 3px 0 0 var(--signal);
}
.nav-item--parked { color: var(--faint-2); cursor: default; pointer-events: none; }

/* 6.2 Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-sans);
  cursor: pointer;
  white-space: nowrap;
  transition: background 130ms ease, color 130ms ease, border-color 130ms ease;
}
.btn--primary {
  background: var(--ink);
  color: #fff;
  border: none;
  font-size: 13.5px;
  font-weight: 600;
  padding: 11px 16px;
  border-radius: var(--r-control);
}
.btn--primary:hover { background: #000; }
.btn--ghost {
  background: var(--paper);
  color: var(--ink-3);
  border: 1px solid var(--line-2);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 13px;
  border-radius: 8px;
}
.btn--ghost:hover { border-color: #D9DBDE; }

/* 6.3 Input / search */
.input {
  border: 1px solid var(--line-2);
  border-radius: var(--r-control);
  padding: 9px 13px;
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  width: 100%;
}
.input::placeholder { color: var(--faint); }
.search { width: 190px; }

/* Toolbar / page header */
.page-head {
  padding: 26px 34px 0;
}
.page-head__row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.page-head__sub { font-size: 13.5px; color: var(--muted); margin-top: 5px; }
.page-head__actions { display: flex; align-items: center; gap: 10px; }

/* Running-tally stat strip (§ reference: time saved / active / interviews). Hairline
   dividers, no card-boxing; figures are mono/tabular and column-aligned. */
.stat-strip {
  display: flex;
  gap: 34px;
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat__value {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
}

@media (max-width: 600px) {
  .page-head { padding: 20px 20px 0; }
  .page-head__actions { width: 100%; }
  .page-head__actions .search { flex: 1; width: auto; }
  .table-scroll, .hint-bar { padding-left: 20px; padding-right: 20px; }
  .stat-strip { gap: 24px; }
}

/* Filter tabs under a page header */
.filters {
  display: flex;
  gap: 24px;
  margin-top: 22px;
  border-bottom: 1px solid var(--line);
}
.filter {
  font-size: 13.5px;
  font-weight: 500;
  padding: 0 1px 12px;
  color: var(--faint);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.filter--active {
  color: var(--ink);
  font-weight: 600;
  border-bottom: 2px solid var(--signal);
}

/* 6.4 Data table */
.table-scroll { padding: 0 34px; overflow-y: auto; flex: 1; }
.table-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 8px;
  border-bottom: 1px solid var(--line-2);
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 1;
}
.row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: var(--row-pad) 8px;
  border-bottom: 1px solid var(--line-3);
  cursor: pointer;
  color: inherit;
  transition: background 130ms ease;
}
.row:hover { background: #FAFAFA; }
/* Keyboard selection (↑↓) — a signal-tinted row with an inset bar, like active nav. */
.row--selected {
  background: var(--signal-soft);
  box-shadow: inset 2px 0 0 var(--signal);
}

.col-mono { width: 30px; flex: none; }
.col-company { flex: 1; min-width: 0; }
.col-match { width: 160px; }
.col-status { width: 120px; }
.col-updated { width: 54px; text-align: right; }

.cell-company { font-size: 14.5px; font-weight: 600; }
.cell-role { font-size: 12.5px; color: var(--faint); margin-top: 1px; }
.cell-updated { font-size: 12.5px; color: var(--faint); font-family: var(--font-mono); }

/* Monogram tile — the only per-row graphic (§6.4). */
.monogram {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 8px;
  background: var(--surface-track);
  color: #7A7F86;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}

/* 6.5 Match meter */
.meter {
  display: flex;
  align-items: center;
  gap: 10px;
}
.meter__track {
  flex: 1;
  height: 5px;
  background: var(--signal-soft);
  border-radius: 3px;
  overflow: hidden;
}
.meter__fill { height: 100%; background: var(--signal); border-radius: 3px; }
.meter__label {
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  width: 34px;
  text-align: right;
}

/* 6.6 Status text (a word, not a badge) */
.status { font-size: 13px; font-weight: 600; color: var(--muted); }
.status--signal { color: var(--signal); }

/* 6.7 Tabs */
.tabs {
  display: flex;
  gap: 28px;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
}
.tab {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 14px 2px;
  color: #7A7F86;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  text-decoration: none;
}
.tab--active { color: var(--ink); font-weight: 600; border-bottom: 2px solid var(--signal); }

/* 6.9 Chip */
.chip {
  font-size: 12.5px;
  color: var(--ink-3);
  background: var(--surface-3);
  padding: 5px 11px;
  border-radius: var(--r-chip);
}
.chip--signal { color: var(--signal); background: var(--signal-soft); font-weight: 500; }

/* 6.10 Pill (time, not job) */
.pill {
  font-size: 12px;
  font-weight: 600;
  color: var(--signal);
  background: var(--signal-soft);
  padding: 5px 11px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}

/* 6.14 Keyboard hint bar */
.hint-bar {
  padding: 12px 34px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 20px;
  font-size: 12px;
  color: var(--faint-2);
  align-items: center;
}
.hint-bar__key { font-family: var(--font-mono); }
.hint-bar__spacer { margin-left: auto; }

/* Empty state — calm, sells time not AI (§9). */
.empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 34px;
  gap: 14px;
}
.empty__title { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.empty__body { font-size: 13.5px; color: var(--muted); max-width: 380px; line-height: 1.6; }
.empty__actions { margin-top: 6px; display: flex; gap: 10px; }

/* Sign-in (signed-out landing) */
.signin {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.signin__card {
  width: 100%;
  max-width: 380px;
  background: var(--paper);
  border-radius: var(--r-window);
  box-shadow: 0 24px 60px -24px rgba(20, 25, 35, .35), 0 0 0 1px rgba(0, 0, 0, .04);
  padding: 40px 36px;
  text-align: center;
}
.signin__brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 22px;
}
.signin__title { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }
.signin__body { font-size: 13.5px; color: var(--muted); line-height: 1.6; margin-top: 8px; }
.signin__google {
  margin-top: 24px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: var(--r-control);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.signin__google:hover { background: #000; }
.signin__fine { margin-top: 16px; font-size: 12px; color: var(--faint); line-height: 1.5; }

/* Public legal pages (privacy) — readable prose column, no app shell. */
.legal {
  max-width: 680px;
  margin: 0 auto;
  padding: 64px 24px 96px;
}
.legal__brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 32px;
}
.legal h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.legal__meta { margin-top: 6px; font-size: 12.5px; color: var(--faint); font-family: var(--font-mono); }
.legal h2 { font-size: 15px; font-weight: 600; margin-top: 32px; }
.legal p, .legal li { font-size: 14px; color: var(--ink-2); line-height: 1.7; }
.legal p { margin-top: 12px; }
.legal ul { margin-top: 12px; padding-left: 20px; }
.legal li { margin-top: 6px; }
.legal a { color: var(--ink); text-decoration: underline; }
.legal strong { color: var(--ink); font-weight: 600; }

/* Extension authorize consent — full-width primary action inside the sign-in card. */
.auth-allow { margin-top: 24px; width: 100%; padding: 12px 16px; font-size: 14px; }

.flash {
  margin-top: 16px;
  font-size: 13px;
  color: var(--ink-3);
  background: var(--surface);
  border-radius: var(--r-control);
  padding: 10px 13px;
}

/* ── Phase 1: base profile ─────────────────────────────────────────────── */

/* Flash strip inside the shell (§9 — quiet, a line not a toast). */
.flash-strip {
  margin: 18px 34px 0;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--ink-3);
  background: var(--signal-soft);
  border-radius: var(--r-control);
  box-shadow: inset 2px 0 0 var(--signal);
}
.flash-strip--alert {
  background: #FBEBE6;
  color: #8A3A1B;
  box-shadow: inset 2px 0 0 #B0552E;
}

/* Scroll containers for the form + read sheet (mirror .table-scroll). */
.form-scroll, .sheet-scroll {
  padding: 22px 34px 48px;
  overflow-y: auto;
  flex: 1;
}

/* Form blocks — sections separated by hairlines, not boxes (§4). */
.form-block {
  border: none;
  margin: 0 0 30px;
  padding: 0 0 26px;
  border-bottom: 1px solid var(--line);
}
.form-block .eyebrow { margin-bottom: 16px; }

.field { margin-bottom: 14px; }
.field__label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.field-grid:has(.field:nth-child(3)) { grid-template-columns: repeat(3, 1fr); }
.field-grid .field { margin-bottom: 14px; }

textarea.input { resize: vertical; line-height: 1.5; min-height: 64px; }

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-3);
  margin: 2px 0 14px;
  cursor: pointer;
}
.check input { accent-color: var(--signal); width: 15px; height: 15px; }

/* Repeatable rows (experience, education, …). */
.repeat-row {
  position: relative;
  padding: 16px 16px 4px;
  margin-bottom: 12px;
  background: var(--paper-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-panel);
}
.repeat-row--inline { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: start; padding-bottom: 16px; }
.repeat-row--inline .field { margin-bottom: 0; }
.repeat-row__remove {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--faint);
  padding: 4px 6px;
}
.repeat-row__remove:hover { color: #8A3A1B; }
.repeat-row--inline .repeat-row__remove { position: static; align-self: center; }

.add-row { margin-top: 4px; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 6px;
}

.form-errors {
  margin-bottom: 22px;
  padding: 12px 14px;
  font-size: 13px;
  color: #8A3A1B;
  background: #FBEBE6;
  border-radius: var(--r-control);
  box-shadow: inset 2px 0 0 #B0552E;
}
.form-errors ul { margin: 6px 0 0; padding-left: 18px; }

/* Resume import panel. */
.import-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 18px 20px;
  margin-bottom: 18px;
  background: var(--surface);
  border-radius: var(--r-panel);
}
.import-panel__note { font-size: 13px; color: var(--muted); margin-top: 4px; max-width: 460px; line-height: 1.5; }
.import-panel__form { display: flex; align-items: center; gap: 10px; }
.file-field {
  position: relative;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
}
.file-field input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
}
.file-field__label {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 9px 13px;
}

/* Parse progress banner. */
.parse-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-3);
  background: var(--signal-soft);
  border-radius: var(--r-control);
  padding: 11px 14px;
  margin-bottom: 18px;
}
.parse-banner:empty { display: none; }
.parse-banner--done { color: var(--signal); font-weight: 500; }
.parse-banner--alert { background: #FBEBE6; color: #8A3A1B; }
.parse-banner__spinner {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid var(--signal-soft);
  border-top-color: var(--signal);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .parse-banner__spinner { animation: none; } }

/* Read view — reuses the §6.11 document sheet. */
.document-sheet {
  background: var(--paper);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .09);
  border-radius: var(--r-doc);
  padding: 44px;
  max-width: 660px;
  margin: 0 auto;
}
.profile-head { padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.profile-head__name { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.profile-head__headline { font-size: 14.5px; color: var(--ink-3); margin-top: 4px; }
.profile-head__contact, .profile-head__links { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.sheet-section { margin-bottom: 24px; }
.sheet-section .eyebrow { margin-bottom: 12px; }
.sheet-body { font-size: 13.5px; color: var(--ink-3); line-height: 1.6; }
.entry { margin-bottom: 16px; }
.entry__row { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; }
.entry__title { font-size: 14px; font-weight: 600; }
.entry__dates { font-size: 12.5px; color: var(--faint); white-space: nowrap; }
.entry__meta { font-size: 12.5px; color: var(--muted); margin: 2px 0 4px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 600px) {
  .form-scroll, .sheet-scroll { padding-left: 20px; padding-right: 20px; }
  .field-grid, .field-grid:has(.field:nth-child(3)) { grid-template-columns: 1fr; }
  .repeat-row--inline { grid-template-columns: 1fr; }
  .flash-strip { margin-left: 20px; margin-right: 20px; }
  .document-sheet { padding: 28px 22px; }
}

/* ── Phase 2: applications + tailoring ──────────────────────────────────── */

/* New-application form — narrower than the profile form. */
.app-form { max-width: 720px; }

/* Tailor screen (§5) — header / tabs / two-pane body, all filling the main column. */
.tailor { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.tailor-head {
  padding: 20px 34px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
}
.tailor-head__title { flex: 1; min-width: 0; }
.tailor-head__role { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.tailor-head__sub { font-size: 12.5px; color: var(--faint); margin-top: 2px; }
.tailor-head__actions { display: flex; align-items: center; gap: 10px; }
.tailor-head__match { font-size: 13px; font-weight: 600; color: var(--signal); white-space: nowrap; }

/* Compact status select in the tailor header. */
.status-form { display: inline-flex; }
.status-select { width: auto; padding: 8px 10px; font-size: 13px; cursor: pointer; }

.tailor-body { flex: 1; display: flex; min-height: 0; }

/* Left: job context (§5 — 36%). */
.job-context {
  width: 36%;
  max-width: 430px;
  flex: none;
  border-right: 1px solid var(--line);
  padding: 24px 28px;
  overflow-y: auto;
}
.job-context__jd {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.65;
  color: #5B6168;
  background: var(--surface);
  border-radius: var(--r-panel);
  padding: 16px;
}
.job-context__jd p { margin: 0 0 10px; }
.job-context__jd p:last-child { margin-bottom: 0; }
.job-context__empty { color: var(--faint); }
.job-context__label { margin-top: 24px; }

.reqs { margin-top: 12px; display: flex; flex-direction: column; gap: 13px; }
.req { display: flex; align-items: flex-start; gap: 11px; }
.req__mark { color: var(--signal); font-weight: 700; font-size: 14px; line-height: 1.3; }
.req__mark--gap { color: var(--faint); }
.req__body { flex: 1; }
.req__label { font-size: 13.5px; color: var(--ink-3); }
.req__note { font-size: 11.5px; margin-top: 1px; color: var(--signal); }
.req__note--gap { color: var(--faint); }

.base-chip {
  margin-top: 26px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  background: var(--surface-3);
  padding: 9px 13px;
  border-radius: var(--r-control);
  text-decoration: none;
}
.base-chip__caret { color: var(--faint); }

/* Right: tailored documents. */
.tailor-docs {
  flex: 1;
  min-width: 0;
  padding: 24px 32px;
  overflow-y: auto;
  background: var(--paper-2);
}
.tailor-pane[hidden] { display: none; }

/* Action row above a sheet: the "what changed" strip + an export/copy button,
   aligned to the document's own column width. */
.doc-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 660px;
  margin: 0 auto 18px;
}
.doc-toolbar .change-strip { flex: 1; margin: 0; max-width: none; }
.doc-toolbar .btn { flex-shrink: 0; }

/* Off-screen but in the DOM, so JS can read the copy payload and screen readers skip it. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* "What changed" strip above a sheet (§6.12). */
.change-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  max-width: 660px;
  margin-left: auto;
  margin-right: auto;
}
.change-strip__log { font-size: 12.5px; color: var(--muted); }
.change-strip .pill { margin-left: auto; }
.pill--mono { font-family: var(--font-mono); }

/* Inline changed text + reordered bullet (§6.12). */
.hl { background: var(--signal-soft); border-radius: 3px; padding: 0 3px; }

.bullets {
  margin: 9px 0 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bullet {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-3);
  padding-left: 14px;
  position: relative;
}
.bullet::before { content: "•"; position: absolute; left: 0; color: #C4C8CD; }
.bullet--changed {
  border-left: 2px solid var(--signal);
  background: var(--signal-soft);
  border-radius: 0 4px 4px 0;
  padding: 3px 8px 3px 12px;
}
.bullet--changed::before { content: none; }

/* Cover-letter sheet — prose. */
.cover-sheet { font-size: 14px; line-height: 1.7; color: var(--ink-2); }
.cover-sheet__date { font-size: 12px; color: var(--faint); font-family: var(--font-mono); }
.cover-sheet__salutation { margin: 20px 0 0; }
.cover-sheet__para { margin: 16px 0 0; }
.cover-sheet__closing { margin-top: 22px; }

/* TMAY sheet. */
.tmay-head { display: flex; align-items: center; justify-content: space-between; }
.tmay-head__title { font-size: 17px; font-weight: 600; }
.tmay-body { margin: 22px 0 0; font-size: 15.5px; line-height: 1.75; color: var(--ink-2); }
.tone-tags { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.tone-tag {
  font-size: 12.5px;
  color: var(--muted);
  background: var(--surface-3);
  padding: 6px 12px;
  border-radius: var(--r-pill);
}
.tone-tag--active { color: #fff; background: var(--ink); font-weight: 600; }
.tmay-tip {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--faint);
  line-height: 1.55;
}

/* Generating / failed states in the doc pane. */
.tailor-status {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  max-width: 660px;
  margin: 0 auto;
  padding: 28px;
  background: var(--paper);
  border-radius: var(--r-doc);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .09);
}
.tailor-status__title { font-size: 15px; font-weight: 600; }
.tailor-status__note { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.55; max-width: 440px; }
.tailor-status__actions { margin-top: 14px; }

@media (max-width: 760px) {
  .tailor-head { padding: 16px 20px; flex-wrap: wrap; }
  .tailor-body { flex-direction: column; }
  .job-context {
    width: auto;
    max-width: none;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .tailor-docs { padding: 20px; }
  .tabs { padding: 0 20px; overflow-x: auto; }
}
