:root {
  --bg: #f6f8f7;
  --surface: #ffffff;
  --line: rgba(17, 52, 56, 0.1);
  --line-strong: rgba(17, 52, 56, 0.16);
  --text: #0f2a2d;
  --text-soft: #2f4a4d;
  --muted: #6b7f82;
  --teal-800: #0a5a56;
  --teal-700: #0d7a74;
  --teal-500: #14b8a6;
  --teal-100: #ccfbf1;
  --teal-50: #ecfdf7;
  --amber-100: #fef3c7;
  --shadow-sm: 0 2px 8px rgba(15, 42, 45, 0.05);
  --shadow-md: 0 10px 24px rgba(15, 42, 45, 0.08);
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.brand-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--teal-700), var(--teal-500));
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  box-shadow: 0 4px 10px rgba(20, 184, 166, 0.28);
}

.eyebrow {
  margin: 0 0 2px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
}

.app-header h1 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sync-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(158, 92, 99, 0.14);
  color: #9e5c63;
}

.sync-pill.is-signed-in {
  background: rgba(20, 184, 166, 0.14);
  color: var(--teal-800);
}

.sync-pill.is-syncing {
  background: var(--amber-100);
  color: #92400e;
}

.primary-button,
.secondary-button,
.ghost-button {
  border-radius: 9px;
  border: 1px solid transparent;
  padding: 9px 14px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease;
}

.primary-button {
  background: var(--teal-700);
  color: white;
  box-shadow: 0 4px 10px rgba(13, 122, 116, 0.25);
}
.primary-button:hover {
  background: var(--teal-800);
  transform: translateY(-1px);
}
.primary-button:disabled,
.ghost-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.ghost-button {
  background: var(--teal-50);
  color: var(--teal-800);
  border-color: rgba(20, 184, 166, 0.2);
}
.ghost-button:hover { background: var(--teal-100); }

.secondary-button {
  background: var(--amber-100);
  color: #92400e;
}
.secondary-button:hover { background: #fde68a; }

.app-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 28px 80px;
  display: grid;
  gap: 20px;
}

.signed-out-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  padding: 28px;
}

.signed-out-card h2 {
  margin: 0 0 10px;
  font-size: 20px;
}

.signed-out-card p {
  margin: 0 0 8px;
  color: var(--text-soft);
  line-height: 1.5;
}

.signed-out-card code {
  background: var(--teal-50);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.config-warn {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--amber-100);
  color: #92400e;
  border-radius: 8px;
  font-size: 13px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

@media (max-width: 760px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
  display: grid;
  gap: 2px;
}

.stat-number {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}

.jobs-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  padding: 18px;
  display: grid;
  gap: 14px;
}

.jobs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.jobs-head h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.jobs-head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.jobs-head-actions input[type="search"],
.jobs-head-actions select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-size: 13px;
  outline: none;
}

.jobs-head-actions input[type="search"] { min-width: 220px; }

.job-type-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
  margin-bottom: 12px;
}

.type-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.type-tab:hover {
  border-color: var(--teal-500);
  background: var(--teal-50);
  color: var(--teal-800);
}

.type-tab.is-active {
  border-color: var(--teal-700);
  background: var(--teal-700);
  color: #fff;
  box-shadow: 0 3px 10px rgba(13, 122, 116, 0.18);
}

.type-tab-count {
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: inherit;
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
}

.type-tab.is-active .type-tab-count { background: rgba(255, 255, 255, 0.25); }

.jobs-empty {
  text-align: center;
  padding: 30px 10px;
  color: var(--muted);
}

.jobs-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.jobs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.jobs-table thead th {
  text-align: left;
  padding: 10px 12px;
  background: var(--teal-50);
  color: var(--teal-800);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}

/* Sortable header cells. The empty .sort-ind <span> is rendered to a tiny
   triangle when the column is the active sort target, otherwise hidden so
   non-active columns stay clean. */
.jobs-table thead th.th-sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  white-space: nowrap;
}
.jobs-table thead th.th-sortable:hover { color: var(--teal-900, #0f766e); }
.jobs-table thead th .sort-ind {
  display: inline-block;
  margin-left: 6px;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 5px solid currentColor;
  opacity: 0;
  transition: opacity 120ms ease;
  vertical-align: middle;
}
.jobs-table thead th.is-sorted .sort-ind { opacity: 0.85; }
.jobs-table thead th.sorted-desc .sort-ind {
  border-bottom: 0;
  border-top: 5px solid currentColor;
}

.jobs-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.jobs-table tbody tr:last-child td { border-bottom: 0; }

.jobs-table tbody tr:hover { background: rgba(20, 184, 166, 0.04); }

/* Rows are edit-entry points — show it with cursor + focus ring. */
.jobs-table tbody tr.job-row { cursor: pointer; }
.jobs-table tbody tr.job-row:focus-visible {
  outline: 2px solid var(--accent, #14b8a6);
  outline-offset: -2px;
}

.cell-muted { color: var(--muted, #94a3b8); }

.jd-badge {
  display: inline-block;
  margin-left: 6px;
  font-size: 12px;
  opacity: 0.75;
  vertical-align: middle;
  cursor: default;
}

/* Fit-score pill on job rows. The --fit-color variable is set inline based
   on score band (teal ≥75, amber ≥50, red <50). */
.fit-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  min-width: 28px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: var(--fit-color, #0f766e);
  border-radius: 999px;
  vertical-align: middle;
  cursor: default;
  letter-spacing: 0.02em;
}

/* Collapsible archived-JD section in the edit modal */
.description-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ghost-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--accent, #14b8a6);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.ghost-link:hover { text-decoration: underline; }
.description-empty-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted, #94a3b8);
  font-size: 12px;
  font-style: italic;
}
/* Author `display: block` above overrides the user-agent `[hidden]` rule, so
   the hint kept showing even when we set `hidden = true`. Restore the default. */
.description-empty-hint[hidden] { display: none; }
#field-description {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.5;
}

.job-title-cell strong {
  font-weight: 600;
  display: block;
  color: var(--text);
}

.job-title-cell a {
  font-size: 11px;
  color: var(--teal-700);
  text-decoration: none;
}
.job-title-cell a:hover { text-decoration: underline; }

.status-chip {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.row-actions button {
  padding: 5px 9px;
  font-size: 12px;
}

.row-delete-button {
  border: 1px solid rgba(244, 63, 94, 0.18);
  border-radius: 8px;
  background: #ffe4e6;
  color: #b1172c;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.row-delete-button:hover { background: #fecaca; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
}

.modal[hidden] { display: none; }

.modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(15, 42, 45, 0.4);
  backdrop-filter: blur(2px);
}

.modal-body {
  position: relative;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 20px 22px 18px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.modal-head h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.icon-button {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.icon-button:hover { background: var(--teal-50); color: var(--teal-800); }

.job-form .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}

.job-form .form-grid label {
  display: grid;
  gap: 4px;
}

.job-form .form-grid .span-2 { grid-column: span 2; }

.job-form span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.job-form input,
.job-form select,
.job-form textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-size: 13px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.job-form input:focus,
.job-form select:focus,
.job-form textarea:focus {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

.job-form textarea { resize: vertical; min-height: 80px; }

.modal-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
}

.modal-actions .spacer { flex: 1; }

@media (max-width: 620px) {
  .job-form .form-grid { grid-template-columns: 1fr; }
  .job-form .form-grid .span-2 { grid-column: span 1; }
}

/* ---------- View tabs ---------- */

.view-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  align-self: flex-start;
}

.view-tab {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}
.view-tab:hover { background: var(--teal-50); }
.view-tab.is-active {
  background: var(--teal-700);
  color: #fff;
  box-shadow: 0 2px 6px rgba(13, 122, 116, 0.25);
}

/* ---------- Funnel analytics ---------- */

.funnel-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  padding: 20px 22px;
  display: grid;
  grid-template-columns: 1fr 280px;
  grid-template-areas:
    "head head"
    "bars side"
    "conv side";
  gap: 18px 24px;
}

@media (max-width: 820px) {
  .funnel-section {
    grid-template-columns: 1fr;
    grid-template-areas: "head" "bars" "conv" "side";
  }
}

.funnel-head { grid-area: head; }
.funnel-head h2 { margin: 0 0 4px; font-size: 16px; letter-spacing: -0.01em; }
.funnel-sub { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

.funnel-bars { grid-area: bars; display: grid; gap: 10px; }

.funnel-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: center;
  gap: 12px;
}

.funnel-row-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.funnel-bar-wrap {
  position: relative;
  height: 28px;
  background: var(--teal-50);
  border-radius: 8px;
  overflow: hidden;
}

.funnel-bar {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--teal-700), var(--teal-500));
  border-radius: 8px;
  transition: width 220ms ease;
}

.funnel-bar-value {
  position: relative;
  z-index: 1;
  padding: 0 12px;
  line-height: 28px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.funnel-bar-pct { color: var(--muted); font-weight: 600; }

.funnel-conversions {
  grid-area: conv;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.conv-card {
  background: var(--teal-50);
  border: 1px solid rgba(20, 184, 166, 0.18);
  border-radius: 10px;
  padding: 12px 14px;
}
.conv-rate { font-size: 22px; font-weight: 800; color: var(--teal-800); letter-spacing: -0.02em; }
.conv-label { font-size: 12px; font-weight: 700; color: var(--text); margin-top: 2px; }
.conv-frac { font-size: 11px; color: var(--muted); margin-top: 2px; }

.funnel-side {
  grid-area: side;
  display: grid;
  gap: 14px;
  align-content: start;
}

.funnel-side-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
}
.funnel-side-card h3 {
  margin: 0 0 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}
.funnel-side-card ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.funnel-side-card li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-soft);
}
.funnel-side-card li .dot {
  width: 8px; height: 8px; border-radius: 999px; flex: 0 0 auto;
}
.funnel-side-card li b {
  margin-left: auto;
  font-weight: 700;
  color: var(--text);
}
.funnel-side-card li.muted { color: var(--muted); font-style: italic; }

.upcoming-link {
  display: grid;
  gap: 2px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 4px 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  border-radius: 6px;
}
.upcoming-link:hover {
  background: var(--teal-50);
  padding: 4px 6px;
  margin: 0 -6px;
}
.upcoming-when {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--teal-800);
}
.upcoming-title { font-size: 13px; font-weight: 600; color: var(--text); }
.upcoming-company { font-size: 12px; color: var(--muted); }

/* ---------- Interview prep block ---------- */

.prep-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fbfdfd;
  display: grid;
  gap: 10px;
}
.prep-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.prep-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
}
.prep-body[hidden] { display: none; }

/* Status timeline — vertical list of stage transitions. The dots are colored
   to match each stage's chip; the connector line is a CSS pseudo on the <ol>
   so we don't need a separate DOM element per gap. */
.timeline {
  margin: 0;
  padding: 4px 4px 4px 24px;
  list-style: none;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--line-strong) 0%, var(--line) 100%);
}
.timeline-item {
  position: relative;
  padding: 4px 0 14px;
}
.timeline-item:last-child { padding-bottom: 4px; }
.timeline-dot {
  position: absolute;
  left: -18px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--line-strong);
}
.timeline-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.timeline-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.timeline-dur {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.timeline-when {
  font-size: 11.5px;
  color: var(--muted);
}
.timeline-empty {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  font-style: italic;
}
.prep-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}
.prep-grid label { display: grid; gap: 4px; }
.prep-grid .span-2 { grid-column: span 2; }
.prep-grid span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.prep-grid input,
.prep-grid textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-size: 13px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.prep-grid input:focus,
.prep-grid textarea:focus {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}
.prep-grid textarea { resize: vertical; }

@media (max-width: 620px) {
  .prep-grid { grid-template-columns: 1fr; }
  .prep-grid .span-2 { grid-column: span 1; }
}

/* ---------- Profile drawer ---------- */

.modal-body-wide {
  width: min(780px, calc(100vw - 32px));
}

.modal-sub {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.profile-form { display: grid; gap: 18px; }

.profile-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 0;
  background: #fbfdfd;
}
.profile-group legend {
  padding: 0 8px;
  margin-left: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--teal-800);
}
.profile-group .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}
.profile-group .form-grid label { display: grid; gap: 4px; }
.profile-group .form-grid .span-2 { grid-column: span 2; }
.profile-group .form-grid span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.profile-group .form-grid input,
.profile-group .form-grid select,
.profile-group .form-grid textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-size: 13px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.profile-group .form-grid input:focus,
.profile-group .form-grid select:focus,
.profile-group .form-grid textarea:focus {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}
.profile-group .form-grid textarea { resize: vertical; }

.resume-file-control {
  display: grid;
  gap: 6px;
}
.resume-file-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.resume-file-name {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.resume-file-name.has-file {
  color: var(--teal-800);
  font-weight: 700;
}

@media (max-width: 620px) {
  .profile-group .form-grid { grid-template-columns: 1fr; }
  .profile-group .form-grid .span-2 { grid-column: span 1; }
  .resume-file-row { grid-template-columns: 1fr; }
}

/* Saved-answers list — same shape as the extension dashboard, with a search
   bar and per-row meta strip so users can audit auto-captured rows. */
.qa-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.qa-toolbar #qa-search {
  flex: 1 1 auto;
  padding: 8px 11px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-size: 13px;
  outline: none;
}
.qa-toolbar #qa-search:focus {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}
.qa-list {
  display: grid;
  gap: 8px;
}
.qa-list .qa-row {
  display: flex;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fcfdfd;
  align-items: flex-start;
}
.qa-list .qa-row-fields {
  flex: 1 1 auto;
  display: grid;
  gap: 6px;
  min-width: 0;
}
.qa-list .qa-row-meta {
  display: flex;
  gap: 6px;
  align-items: center;
}
.qa-tag {
  display: inline-block;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
}
.qa-tag-captured {
  background: #fef3c7;
  color: #92400e;
}
.qa-tag-manual {
  background: #ecfdf5;
  color: #047857;
}
.qa-list .qa-row input.qa-question,
.qa-list .qa-row textarea.qa-answer {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-size: 13px;
  outline: none;
}
.qa-list .qa-row textarea.qa-answer { resize: vertical; min-height: 44px; }
.qa-list .qa-row input.qa-question:focus,
.qa-list .qa-row textarea.qa-answer:focus {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}
.qa-list .qa-row-remove {
  flex: 0 0 auto;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: #b91c1c;
  font-size: 12px;
  cursor: pointer;
}
.qa-list .qa-row-remove:hover { background: #fef2f2; border-color: #fecaca; }
.qa-empty {
  padding: 12px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}
.qa-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  align-items: center;
}
.section-tab {
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}
.section-tab:hover { background: var(--teal-50); border-color: var(--teal-500); }
.section-tab.is-active {
  background: var(--teal-700);
  color: #fff;
  border-color: var(--teal-700);
}
.section-tab-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
}
.section-tab.is-current:not(.is-active) .section-tab-badge {
  background: var(--teal-100);
  color: var(--teal-800);
}

.section-set-active {
  background: transparent;
  border: 1px dashed var(--teal-500);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--teal-800);
  cursor: pointer;
}
.section-set-active:hover { background: var(--teal-50); }
.section-set-active[hidden] { display: none; }

.ai-key-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.ai-key-hint a { color: var(--teal-700); text-decoration: none; }
.ai-key-hint a:hover { text-decoration: underline; }

/* ---------- AI cover letter (inside job modal) ---------- */

.prep-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ai-status {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ai-cover-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.ai-cover-hint {
  flex: 1 1 auto;
  min-width: 180px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}
#ai-cover-text {
  width: 100%;
  padding: 11px 12px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.5;
  outline: none;
  resize: vertical;
  min-height: 160px;
}
#ai-cover-text:focus {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

/* Fit analysis result panel. Score ring uses a conic-gradient so the filled
   arc tracks the score (--fit-pct goes 0..100), tinted by --fit-color. */
.fit-result {
  display: grid;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fcfdfd;
}
.fit-result[hidden] { display: none; }
.fit-score-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}
.fit-score-ring {
  --fit-color: #0f766e;
  --fit-pct: 0;
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    conic-gradient(var(--fit-color) calc(var(--fit-pct) * 1%), #e5e7eb 0);
  position: relative;
}
.fit-score-ring::before {
  content: "";
  position: absolute;
  inset: 6px;
  background: #fff;
  border-radius: 50%;
}
.fit-score-num,
.fit-score-cap {
  position: relative;
  z-index: 1;
  line-height: 1;
}
.fit-score-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--fit-color);
}
.fit-score-cap {
  margin-top: 2px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.fit-summary {
  flex: 1 1 auto;
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #1f2937;
}
.fit-lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 520px) {
  .fit-lists { grid-template-columns: 1fr; }
}
.fit-list-block .eyebrow {
  margin: 0 0 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
}
.fit-list {
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
  line-height: 1.45;
  color: #1f2937;
}
.fit-list li { margin: 2px 0; }
.fit-list-empty {
  list-style: none;
  margin-left: -18px;
  color: var(--muted);
  font-style: italic;
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: var(--shadow-md);
  z-index: 200;
}

.toast[hidden] { display: none; }

.toast.is-error { background: #9e5c63; }
