/* Apply Pilot design system: warm paper, ink, one clay accent.
   iPhone-first; light and dark. */

:root {
  color-scheme: light dark;
  /* Warm paper and ink, one clay accent. Text/background pairs meet
     WCAG AA (4.5:1) in both themes. */
  --bg: #faf9f5;
  --surface: #ffffff;
  --surface-2: #f1efe8;
  --text: #1f1e1c;
  --text-2: #5f5c54;
  --text-3: #8a867b;
  --border: #e6e2d8;
  --primary: #b5532f;
  --primary-soft: #f8ebe4;
  --primary-ink: #ffffff;
  --danger: #b3261e;
  --danger-soft: #fbeceb;
  --success: #2f6f4f;
  --success-soft: #e8f2ec;
  --warn: #8a5a00;
  --warn-soft: #fbf1dc;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(31, 30, 28, 0.04);
  --tabbar-bg: rgba(250, 249, 245, 0.9);
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino,
           Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1f1e1c;
    --surface: #2a2927;
    --surface-2: #353431;
    --text: #f3f1ea;
    --text-2: #bdb9ad;
    --text-3: #8f8b80;
    --border: #3b3a36;
    --primary: #e0825f;
    --primary-soft: #3a2a23;
    --primary-ink: #1f1e1c;
    --danger: #f0867d;
    --danger-soft: #3a2422;
    --success: #7cc49c;
    --success-soft: #223229;
    --warn: #e3b25a;
    --warn-soft: #362c19;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --tabbar-bg: rgba(31, 30, 28, 0.9);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui,
               "Segoe UI", Roboto, sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  /* room for the bottom tab bar */
  padding: 0 16px calc(92px + env(safe-area-inset-bottom, 0px));
}

.page {
  max-width: 620px;
  margin: 0 auto;
}

/* ---------- type ---------- */

h1 { font-size: 1.65rem; font-weight: 700; letter-spacing: -0.01em;
     margin: 0.9em 0 0.35em; }
h2 { font-size: 1.12rem; font-weight: 650; letter-spacing: -0.005em;
     margin: 1.4em 0 0.5em; }
h3 { font-size: 1rem; font-weight: 650; margin: 1.2em 0 0.4em; }
p { margin: 0.55em 0; }

.muted { color: var(--text-2); font-size: 0.92rem; }
.tiny { color: var(--text-3); font-size: 0.82rem; }

a { color: var(--primary); }
.page a:not(.tab):not(.btn):not(.chip):not(.stat):not(.action-card):not(.menulink) {
  text-decoration: none;
}

/* ---------- slim top header ---------- */

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 -16px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: var(--tabbar-bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.app-header .brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  display: block;
  max-width: 620px;
  margin: 0 auto;
}

/* ---------- bottom tab bar ---------- */

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: flex;
  background: var(--tabbar-bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
}
.tabbar .tabinner {
  display: flex;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 2px 5px;
  color: var(--text-3);
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: var(--radius-sm);
  min-height: 52px;
  justify-content: center;
}
.tab svg { width: 24px; height: 24px; }
.tab.active { color: var(--primary); }
.tab:active { background: var(--surface-2); }

/* ---------- cards & rows ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin: 14px 0;
  box-shadow: var(--shadow);
}
.card > h2:first-child { margin-top: 0; }

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.row:last-child { border-bottom: none; }

/* tappable action cards on the dashboard */
.actions { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.action-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 16px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
}
.action-card:active { background: var(--surface-2); }
.action-card .t { font-weight: 650; font-size: 1.02rem; display: block; }
.action-card .s { color: var(--text-2); font-size: 0.88rem; display: block;
                  margin-top: 2px; }
.action-card .chev { color: var(--text-3); font-size: 1.4rem; line-height: 1; }
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-ink);
  font-size: 0.82rem;
  font-weight: 700;
  margin-right: 8px;
  vertical-align: 2px;
}

/* menu-style link list (profile / "You" tab) */
.menulist { margin: 14px 0; }
.menulink {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text);
  font-weight: 550;
}
.menulink:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.menulink:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.menulink:only-child { border-radius: var(--radius); }
.menulink + .menulink { border-top: none; }
.menulink:active { background: var(--surface-2); }
.menulink .chev { color: var(--text-3); font-size: 1.3rem; }
.menulink.danger { color: var(--danger); }

/* ---------- stats ---------- */

.statgrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 14px 0;
}
@media (min-width: 480px) {
  .statgrid.four { grid-template-columns: repeat(4, 1fr); }
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 12px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  display: block;
}
.stat:active { background: var(--surface-2); }
.stat .n { font-size: 1.9rem; font-weight: 750; display: block;
           letter-spacing: -0.02em; line-height: 1.1; }
.stat .l { font-size: 0.82rem; color: var(--text-2); font-weight: 550; }

/* ---------- pills, chips, lists ---------- */

.pill {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 3px 11px;
  background: var(--surface-2);
  color: var(--text-2);
  white-space: nowrap;
}
.pill.good { background: var(--success-soft); color: var(--success); }
.pill.bad { background: var(--danger-soft); color: var(--danger); }
.pill.info { background: var(--primary-soft); color: var(--primary); }

.chipline { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 15px;
  font-size: 0.9rem;
  font-weight: 550;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
}
.chip.active {
  background: var(--primary);
  color: var(--primary-ink);
  border-color: var(--primary);
}

.applist { list-style: none; padding: 0; margin: 0; }
.applist li { border-bottom: 1px solid var(--border); }
.applist li:last-child { border-bottom: none; }
.applist a {
  text-decoration: none;
  color: var(--text);
  display: block;
  padding: 13px 2px;
}
.applist a:active { background: var(--surface-2); }

/* ---------- forms & buttons ---------- */

label { display: block; font-size: 0.9rem; font-weight: 550;
        color: var(--text-2); margin: 14px 0 4px; }

input, select, textarea {
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  width: 100%;
  margin: 6px 0;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
  border-color: var(--primary);
}
textarea { min-height: 110px; resize: vertical; }

button, .btn {
  font: inherit;
  font-size: 1rem;
  font-weight: 650;
  padding: 14px 18px;
  border-radius: 12px;
  width: 100%;
  margin: 8px 0;
  background: var(--primary);
  color: var(--primary-ink);
  border: none;
  cursor: pointer;
  text-align: center;
  display: inline-block;
  text-decoration: none;
  min-height: 50px;
}
button:active, .btn:active { opacity: 0.85; }
button:disabled { opacity: 0.5; }
.btn.ghost {
  background: var(--surface-2);
  color: var(--primary);
}
.btn.danger { background: var(--danger); color: #fff; }
.btn.rowbtn { width: auto; margin: 6px 6px 6px 0; padding: 12px 20px;
              min-height: 44px; }

/* inline button next to an input */
.searchrow { display: flex; gap: 8px; align-items: center; }
.searchrow input { flex: 1; margin: 6px 0; }
.searchrow button { width: auto; margin: 6px 0; padding: 13px 20px;
                    min-height: 50px; white-space: nowrap; }

pre.resume {
  white-space: pre-wrap;
  font-family: inherit;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 0.92rem;
}

pre.draft {
  white-space: pre-wrap;
  font-family: inherit;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 0.94rem;
}

/* ---------- notices ---------- */

.error, .notice, .warnbox {
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  margin: 12px 0;
  font-size: 0.94rem;
}
.error { background: var(--danger-soft); color: var(--danger); }
.notice { background: var(--success-soft); color: var(--success); }
.warnbox { background: var(--warn-soft); color: var(--warn); }

/* ---------- empty states ---------- */

.empty {
  text-align: center;
  padding: 36px 20px;
  color: var(--text-2);
}
.empty .big { font-size: 2.2rem; display: block; margin-bottom: 8px; }
.empty p { margin: 6px 0 14px; }
.empty .btn { max-width: 280px; margin-left: auto; margin-right: auto; }

/* ---------- misc ---------- */

.divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }

details.card { padding: 14px 18px; }
details.card summary { font-weight: 650; cursor: pointer; padding: 4px 0; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

@media (min-width: 700px) {
  body { padding-left: 24px; padding-right: 24px; }
}

/* ---------- live scan status ---------- */

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34c759;
  animation: pulse 1.5s ease-in-out infinite;
  vertical-align: middle;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin: 12px 0;
}

.progress-fill {
  height: 100%;
  width: 40%;
  background: var(--primary);
  border-radius: 3px;
  animation: scan-slide 1.8s ease-in-out infinite;
}

@keyframes scan-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}

/* ---------- desktop: sidebar nav + wider content ---------- */

@media (min-width: 1024px) {
  body:has(.tabbar) { padding: 0 32px 48px calc(232px + 32px); }
  body:has(.tabbar) .page { max-width: 1040px; }
  .app-header { display: none; }
  .tabbar {
    top: 0; bottom: 0; right: auto;
    width: 232px;
    flex-direction: column;
    border-top: none;
    border-right: 1px solid var(--border);
    padding: 22px 12px;
  }
  .tabbar::before {
    content: "Apply Pilot";
    font-weight: 750;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
    color: var(--text);
    padding: 0 12px 20px;
  }
  .tabbar .tabinner { flex-direction: column; gap: 4px; max-width: none; }
  .tab {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 10px 12px;
    min-height: 0;
    font-size: 0.95rem;
    color: var(--text-2);
  }
  .tab svg { width: 20px; height: 20px; }
  .tab:hover { background: var(--surface-2); color: var(--text); }
  .tab.active { background: var(--primary-soft); color: var(--primary); }
  body:has(.tabbar) button, body:has(.tabbar) .btn { width: auto; min-width: 160px; }
  body:has(.tabbar) .empty .btn { width: 100%; }
  .statgrid { grid-template-columns: repeat(4, 1fr); }
  .actions { display: grid; grid-template-columns: repeat(3, 1fr); }
  .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .grid-2 > .card { margin: 0; }
}

/* ---------- page head + segmented toggle ---------- */

.pagehead { display: flex; align-items: center; justify-content: space-between;
            gap: 12px; flex-wrap: wrap; }
.pagehead h1 { margin-bottom: 0.2em; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 999px;
       padding: 3px; gap: 2px; }
.seg-item { padding: 7px 14px; border-radius: 999px; font-size: 0.88rem;
            font-weight: 600; color: var(--text-2); text-decoration: none; }
.seg-item.active { background: var(--surface); color: var(--text);
                   box-shadow: var(--shadow); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden;
           clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- kanban board ---------- */

.board-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  margin: 14px 0 0;
  padding-bottom: 12px;
  contain: layout paint;
}
.board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 272px;
  gap: 12px;
  width: max-content;
  padding: 4px 2px;
}
.kcol {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 10px;
  min-height: 160px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
}
.kcol.closed { opacity: 0.85; }
.board { grid-auto-columns: auto; }
.kcol { width: 272px; }
.kcol.empty { width: 132px; min-height: 120px; }
.kcol.empty .kcol-head { flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; }
.kcol-head span:first-child { line-height: 1.25; }
.kcol.over { width: 272px; }
.kcol.over { outline: 2px dashed var(--primary); outline-offset: -2px; }
.kcol-head { display: flex; justify-content: space-between; align-items: center;
             font-weight: 650; font-size: 0.92rem; padding: 4px 6px 10px; }
.kcol-head .count { background: var(--surface); border-radius: 999px;
                    padding: 1px 9px; font-size: 0.8rem; color: var(--text-2); }
.kcol-body { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.kcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 12px 8px;
  box-shadow: var(--shadow);
  cursor: grab;
}
.kcard.dragging { opacity: 0.5; }
.kcard-title { font-weight: 650; color: var(--text); text-decoration: none;
               display: block; line-height: 1.3; }
.kcard-sub { color: var(--text-2); font-size: 0.84rem; margin: 2px 0 6px; }
.kcard-move select { padding: 7px 10px; font-size: 0.85rem; margin: 6px 0 2px;
                     border-radius: 8px; }
@media (min-width: 1024px) {
  .kcol, .kcol.empty { width: 240px; }
  .kcol.empty .kcol-head { flex-direction: row; align-items: center; }
}

/* ---------- status dots, data tables ---------- */

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%;
       margin-right: 8px; vertical-align: 1px; background: var(--text-3); }
.dot.ok { background: var(--success); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--danger); }
.plainlist { margin: 6px 0 0; padding-left: 18px; }
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.dtable { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.dtable th { text-align: left; color: var(--text-2); font-weight: 600;
             padding: 8px 8px; border-bottom: 1px solid var(--border);
             white-space: nowrap; }
.dtable td { padding: 9px 8px; border-bottom: 1px solid var(--border);
             vertical-align: top; }
.dtable tr:last-child td { border-bottom: none; }
@media (max-width: 1023px) { .grid-2 > .card { margin: 14px 0; } }

/* ---------- setup checklist ---------- */

.setup-head { display: flex; justify-content: space-between; align-items: baseline; }
.setup-head h2 { margin: 0; }
.meter { height: 8px; background: var(--surface-2); border-radius: 999px;
         overflow: hidden; margin: 12px 0 6px; }
.meter-fill { height: 100%; background: var(--primary); border-radius: 999px;
              transition: width 0.3s ease; }
.steps { list-style: none; padding: 0; margin: 8px 0 0; }
.step { display: flex; align-items: center; gap: 12px; padding: 12px 0;
        border-bottom: 1px solid var(--border); }
.step:last-child { border-bottom: none; }
.step .check { flex: none; width: 28px; height: 28px; border-radius: 50%;
               display: inline-flex; align-items: center; justify-content: center;
               font-size: 0.85rem; font-weight: 700; background: var(--surface-2);
               color: var(--text-2); }
.step.done .check { background: var(--success-soft); color: var(--success); }
.step.done strong { color: var(--text-2); text-decoration: line-through; }
.step-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.step-body .muted { font-size: 0.86rem; }
.step .rowbtn { flex: none; margin: 0; min-width: 0 !important; }
a.row { color: var(--text); text-decoration: none; }

/* ---------- discovery: preferences form + review cards ---------- */
.check { display: flex; align-items: center; gap: 10px; font-weight: 500;
         color: var(--text); margin: 10px 0; }
.check input { width: auto; margin: 0; min-width: 20px; min-height: 20px; }
.checkgrid { display: grid; grid-template-columns: 1fr; gap: 2px; }
@media (min-width: 560px) { .checkgrid { grid-template-columns: 1fr 1fr; } }
.qbadges { display: flex; flex-wrap: wrap; gap: 6px; }
.qbadges a.pill { text-decoration: none; }
.quick { display: flex; gap: 8px; margin: 10px 0 6px; }
.quick button { flex: 1; }

/* ---------- tailoring: resume view, flags, ATS, profile editor ---------- */

.resumeview {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin: 12px 0;
  font-size: 0.92rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.rv-h1 { font-weight: 750; font-size: 1.1rem; }
.rv-h2 { font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
         font-size: 0.82rem; color: var(--text-2); margin-top: 12px;
         border-bottom: 1px solid var(--border); padding-bottom: 2px; }
.rv-role { font-weight: 650; margin-top: 8px; }
.rv-bullet { padding-left: 14px; position: relative; }
.rv-bullet::before { content: "•"; position: absolute; left: 2px;
                     color: var(--text-3); }
.rv-flag { border-radius: 6px; padding: 4px 6px 4px 14px; margin: 3px 0; }
.rv-flagged { background: var(--warn-soft); outline: 1px solid var(--warn); }
.rv-user_attested { background: var(--primary-soft); }
.rv-reason { display: block; font-size: 0.78rem; color: var(--warn);
             font-weight: 550; }
.rv-user_attested .rv-reason { color: var(--primary); }
.flaglist { padding-left: 18px; }
.flaglist li { margin: 6px 0; }
label.attest { display: flex; gap: 10px; align-items: flex-start;
               font-size: 0.95rem; color: var(--text); margin: 12px 0; }
label.attest input { width: auto; margin-top: 4px; flex: none; }
.approveform { margin-top: 8px; }

.scorerow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
            margin: 10px 0; }
.scorebox { background: var(--surface-2); border-radius: var(--radius-sm);
            padding: 12px; text-align: center; }
.scorelabel { display: block; font-size: 0.8rem; font-weight: 650;
              color: var(--text-2); }
.score { display: block; font-size: 1.9rem; font-weight: 750;
         letter-spacing: -0.02em; line-height: 1.2; }
.score.good { color: var(--success); }
.score.mid { color: var(--warn); }
.score.low { color: var(--danger); }
.kwline { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.kw { font-size: 0.8rem; font-weight: 600; border-radius: 999px;
      padding: 3px 10px; background: var(--surface-2); color: var(--text-2); }
.kw.ok { background: var(--success-soft); color: var(--success); }
.kw.warn { background: var(--warn-soft); color: var(--warn); }
.kw.miss { background: var(--danger-soft); color: var(--danger); }
.card details { margin: 10px 0; }
.card details summary { font-weight: 600; cursor: pointer; padding: 6px 0; }

.rowgroup { border: 1px solid var(--border); border-radius: var(--radius-sm);
            padding: 4px 12px 8px; margin: 10px 0; background: var(--surface); }
.rowfields { display: flex; gap: 10px; }
.rowfields .grow { flex: 1; }
.rowfields .narrow { width: 88px; flex: none; }
.rowfields .narrow2 { width: 34%; flex: none; }
.linkbtn { background: none; color: var(--danger); width: auto; min-height: 0;
           padding: 4px 0; margin: 2px 0; font-size: 0.85rem; font-weight: 600; }
.stickysave { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom, 0px));
              z-index: 5; padding: 6px 0; }
textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
                font-size: 0.86rem; }
.busybar { margin: 8px 0; }
@media (min-width: 600px) {
  .grid-2.tight { display: grid; grid-template-columns: 1fr 1fr;
                  column-gap: 12px; }
}
@media (min-width: 1024px) {
  .stickysave { bottom: 0; }
  .grid-2 { align-items: start; }
  .grid-2 > .card { margin: 14px 0; }
  body:has(.tabbar) .linkbtn { min-width: 0; }
}

.blockerbox { background: var(--danger-soft); border: 1px solid var(--danger);
              border-radius: var(--radius-sm); padding: 10px 14px;
              margin: 8px 0 12px; }
.blockerbox h3 { color: var(--danger); margin: 2px 0 4px; }
.blockerbox ul { padding-left: 18px; margin: 6px 0; }
.blockerbox li { margin: 6px 0; }

.qhead { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.qline { margin: 4px 0; font-size: 0.95rem; }
.qconcerns { margin: 6px 0; padding-left: 18px; font-size: 0.9rem;
             color: var(--warn); }
details.why { margin: 6px 0; }
details.why summary { cursor: pointer; font-size: 0.85rem;
                      color: var(--text-2); }

.btnrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0; }
.btnrow form { margin: 0; }
.btnrow button, .btnrow .btn { width: auto; margin: 0; }

/* ---------- master resume versions ---------- */
.resume-versions { padding: 6px 18px; }
.version-row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center;
               justify-content: space-between; padding: 12px 0;
               border-bottom: 1px solid var(--border); }
.version-row:last-of-type { border-bottom: none; }
.version-main { min-width: 0; flex: 1 1 260px; }
.version-main strong { word-break: break-word; margin-right: 6px; }
.version-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.version-actions form { margin: 0; }
.version-actions .rowbtn { margin: 0; min-width: 0 !important; }
.danger-text { color: var(--danger) !important; }
.delete-older { margin: 8px 0 10px; }

/* ---------- "Ask coach" button, top right on every page ---------- */
.coach-fab {
  position: fixed;
  top: calc(7px + env(safe-area-inset-top, 0px));
  right: 12px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px 7px 10px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 650;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, #7c5cff, #3b8bff);
  box-shadow: 0 4px 14px rgba(59, 139, 255, 0.35);
}
.coach-fab svg { width: 17px; height: 17px; }
.coach-fab:active { transform: scale(0.97); }
@media (min-width: 1024px) {
  .coach-fab { top: 18px; right: 24px; padding: 9px 16px 9px 12px; font-size: 0.92rem; }
}
@media (min-width: 1024px) {
  /* Reserve a strip at the top so the coach button never covers content. */
  body:has(.coach-fab) .page { padding-top: 52px; }
  body:has(.coach-fab) .page > h1:first-of-type,
  body:has(.coach-fab) .page > .pagehead:first-of-type h1 { margin-top: 0.2em; }
}
.title-sugs { margin: 4px 0 10px; }
.title-sugs .chip { width: auto; min-height: 0; margin: 0; cursor: pointer;
                    font-size: 0.86rem; padding: 7px 12px; min-width: 0 !important;
                    color: var(--primary); border-color: var(--primary-soft);
                    background: var(--primary-soft); }
.title-sugs .chip.add-all { color: var(--text); background: var(--surface); border-color: var(--border); }

/* ---------- browser extension install steps ---------- */
.install-steps { padding-left: 1.4em; margin: 8px 0 12px; }
.install-steps li { margin: 6px 0; line-height: 1.45; }

/* ---------- apply path stepper ---------- */
.stepper { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 12px;
           flex-wrap: wrap; }
.stepper li { display: flex; align-items: center; gap: 6px; font-size: 0.85rem;
              color: var(--text-3); font-weight: 600; margin-right: 8px; }
.stepper li .dotnum { width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); font-size: 0.8rem; }
.stepper li.done { color: var(--success); }
.stepper li.done .dotnum { background: var(--success-soft); }
.stepper li.current { color: var(--primary); }
.stepper li.current .dotnum { background: var(--primary); color: var(--primary-ink); }
.apply-next .howto { margin: 8px 0 12px; padding-left: 20px; }
.apply-next .howto li { margin: 4px 0; }

/* ---------- Apply mode ---------- */
.flow-counts .chip { cursor: default; }
.flow-card h2 { font-size: 1.2rem; }
.flow-card details.doc, .flow-card details.jd { margin: 10px 0; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 12px; background: var(--surface); }
.flow-card details summary { cursor: pointer; font-weight: 650; }
.docview { background: #fff; color: #16191d; border-radius: 8px; padding: 18px 20px;
  margin-top: 8px; font-size: 0.92rem; line-height: 1.45; }
.docview h2, .docview h3, .docview h4 { color: #16191d; margin: 0.8em 0 0.3em; }
.docview h2 { font-size: 1.3rem; } .docview h3 { font-size: 1rem; text-transform: uppercase;
  letter-spacing: 0.04em; border-bottom: 1px solid #e3e7ec; padding-bottom: 3px; }
.docview ul { margin: 4px 0 8px; padding-left: 18px; }
.jdtext { white-space: pre-wrap; font-size: 0.88rem; color: var(--text-2); margin-top: 8px;
  max-height: 360px; overflow: auto; }
.flow-card label.check { display: flex; gap: 8px; align-items: center; margin-top: 8px;
  color: var(--text); font-weight: 600; }
.apply-cta { border-color: var(--primary); background: var(--primary-soft); margin: 14px 0; }
.apply-cta .t { color: var(--primary); }

/* Onboarding: four questions */
.onboarding-form fieldset { border: 0; border-bottom: 1px solid var(--border); padding: 0 0 16px; margin: 0 0 16px; }
.onboarding-form fieldset:last-of-type { border-bottom: 0; }
.onboarding-form legend { font-weight: 600; font-size: 1.02rem; margin-bottom: 8px; padding: 0; }
.onboarding-form .check { margin: 4px 0; }
.sample-job h2 { font-size: 1.15rem; }

/* Approve in one screen */
.ready-list .ready-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.ready-list .ready-row:last-of-type { border-bottom: 0; }
.ready-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Apply session */
.session-list { padding-left: 32px; }
.session-list li { margin: 6px 0; }

/* Interview prep */
.prep-list > li { margin: 14px 0; }
.prep-list .stories { margin: 6px 0 0; color: var(--muted, inherit); }

/* One pipeline strip, identical on Home / Apply / Jobs / Track. */
.pipeline { display: flex; align-items: stretch; gap: 4px; margin: 12px 0 16px;
  overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
.pipeline .pstage { flex: 1 0 auto; min-width: 84px; text-align: center;
  padding: 8px 10px; border-radius: 12px; border: 1px solid var(--border);
  text-decoration: none; color: inherit; }
.pipeline .pstage .n { display: block; font-size: 1.25rem; font-weight: 750; line-height: 1.2; }
.pipeline .pstage .l { display: block; font-size: 0.74rem; color: var(--text-2); font-weight: 550; white-space: nowrap; }
.pipeline .pstage.here { border-color: var(--primary); background: var(--primary-soft); }
.pipeline .pstage.zero .n { opacity: .45; }
.pipeline .parrow { align-self: center; color: var(--text-2); opacity: .6; }
.queue-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 10px; }
.queue-nav .btn[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.queue-list a.row.current { border-color: var(--primary); }
.docbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.queue-nav .btn { flex: 0 0 auto; width: auto; padding: 8px 14px; }
.queue-nav > span { white-space: nowrap; }
.docbar .btn { flex: 0 0 auto; width: auto; padding: 6px 12px; font-size: 0.86rem; min-height: 0; }
.vendor-group { border-bottom: 1px solid var(--border); }
.vendor-group > summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; cursor: pointer; list-style: none; }
.vendor-group > summary::-webkit-details-marker { display: none; }
.vendor-group[open] > summary { border-bottom: 1px dashed var(--border); }
.vendor-group .row { padding-left: 14px; }
.fresh.new { color: var(--success); font-weight: 600; }
.fresh.recent { color: var(--text-2); }
.fresh.older { color: var(--warn); }
.fresh.stale { color: var(--danger); }
.fresh.unknown { color: var(--text-3); }


/* ==========================================================================
   2026-10 refresh: calmer type, a pipeline that fits a phone, tidier rows.
   Kept as one layer so the component rules above stay readable.
   ========================================================================== */

body { line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, h2, .app-header .brand, .action-card .t, .empty strong {
  font-family: var(--serif); font-weight: 600; letter-spacing: -0.012em;
}
h1 { font-size: 1.8rem; line-height: 1.2; margin: 0.8em 0 0.3em; }
h2 { font-size: 1.2rem; line-height: 1.3; }
.app-header .brand { font-size: 1.12rem; }
.muted { font-size: 0.93rem; }
a { text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px;
                 border-radius: 6px; }

/* cards: a hairline and paper, no heavy shadow */
.card, .action-card { box-shadow: none; }
.card { padding: 18px 18px 16px; }
.action-card.apply-cta { background: var(--primary-soft);
                         border-color: var(--primary); }
.action-card.apply-cta .t { color: var(--text); }
.setup-head { gap: 6px 12px; flex-wrap: wrap; }
.setup-head > .muted, .setup-head > .tiny { margin-left: auto; }

/* buttons */
button, .btn { border-radius: 12px; font-weight: 600;
               transition: filter .12s ease, background .12s ease; }
button:hover, .btn:hover { filter: brightness(0.96); }
.btn.ghost { background: transparent; color: var(--text);
             border: 1px solid var(--border); }
.btn.ghost:hover { background: var(--surface-2); filter: none; }
.count-badge { background: var(--primary); color: var(--primary-ink); }

/* pills and chips */
.pill { font-weight: 600; letter-spacing: 0.005em; }
.chip.active { background: var(--text); color: var(--bg);
               border-color: var(--text); }
.row > span:last-child { display: inline-flex; align-items: center;
                         gap: 6px; flex-shrink: 0; flex-wrap: wrap;
                         justify-content: flex-end; max-width: 46%; }
.row > span:first-child { min-width: 0; }

/* the coach button: ink, not a gradient */
.coach-fab { background: var(--text); color: var(--bg);
             box-shadow: 0 2px 10px rgba(31, 30, 28, 0.18); }

/* tab bar */
.tab { font-weight: 600; }
.tab.active { color: var(--primary); }

/* pipeline: all six stages visible on a phone (3 x 2), one row when wide */
.pipeline { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
            overflow: visible; padding-bottom: 0; }
.pipeline .parrow { display: none; }
.pipeline .pstage { min-width: 0; padding: 9px 6px; border-radius: 12px;
                    background: var(--surface); }
.pipeline .pstage .n { font-family: var(--serif); font-size: 1.35rem;
                       font-weight: 600; }
.pipeline .pstage .l { font-size: 0.72rem; white-space: normal;
                       line-height: 1.25; }
.pipeline .pstage.here { background: var(--primary-soft); }
.pipeline .pstage.here .n { color: var(--primary); }
@media (min-width: 560px) {
  .pipeline { grid-template-columns: repeat(6, 1fr); }
}

/* stats and numbers in the serif */
.stat .n { font-family: var(--serif); font-weight: 600; }

/* notices: a left rule instead of a flat block */
.notice, .warnbox, .error { border-left: 3px solid currentColor;
                            border-radius: var(--radius-sm); }

/* forms */
input, select, textarea { border-radius: 12px; }
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft); outline: none; }

/* queue navigation and document buttons on the Apply card */
.queue-nav { margin: 4px 0 12px; }
.docbar .btn { border: 1px solid var(--border); background: var(--surface);
               color: var(--text); }
.vendor-group > summary { padding: 13px 0; }
.fresh.new { color: var(--success); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
.vendor-group > summary > span:last-child { display: inline-flex; gap: 6px;
  align-items: center; flex-shrink: 0; }
.vendor-group > summary > span:first-child { min-width: 0; }

/* Owner account controls */
.pill.warn { background: var(--warn-soft); color: var(--warn); }
form.stack { display: grid; gap: 10px; max-width: 420px; }
form.stack label { display: grid; gap: 4px; }

/* Log out: at the foot of the sidebar on desktop; on phones it is the
   button on the You tab (the coach button owns the header's corner). */
.logout-form { margin: 0; }
.logout-form.side { display: none; }
.linkbtn { background: none; border: 0; padding: 6px 8px; font: inherit;
  font-size: .9rem; color: var(--muted); cursor: pointer; width: auto;
  text-decoration: underline; text-underline-offset: 3px; }
.linkbtn:hover { color: var(--text); background: none; }
@media (min-width: 1024px) {
  .logout-form.side { display: block; margin-top: auto; padding: 12px 16px; }
}

/* What changed (tailoring) */
.change { border-top: 1px solid var(--border); padding: 10px 0; }
.change .now { margin: 0 0 4px; }
.change .was { margin: 0 0 6px; color: var(--muted); }
.change form { margin: 0; }
/* First search box on the questions page */
.searchbox { padding: 12px 14px; margin: 0 0 12px; }
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%; vertical-align: -1px;
  animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

.row .why { color: var(--text); }

/* Easy touches: waiting count on the Apply tab; keyboard hint on desktop. */
.tab span { position: relative; }
.tabbadge { position: absolute; top: -14px; right: -16px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--primary); color: var(--primary-ink); font-size: 0.62rem; line-height: 16px; text-align: center; font-weight: 700; }
.kbd-hint { display: none; margin-top: 8px; }
.kbd-hint kbd { font: inherit; font-size: 0.72rem; padding: 0 5px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); }
@media (hover: hover) and (min-width: 700px) { .kbd-hint { display: block; } }

/* Resume quality score on the match card. */
.qscore { display: flex; gap: 14px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin: 0 0 12px; }
.qscore .score { font-size: 1.6rem; font-weight: 700; line-height: 1; min-width: 44px; text-align: center; padding-top: 2px; }
.qscore ul { margin: 4px 0 0; padding-left: 18px; }

/* Compact views: skill chips, folded profile rows, "show all" folds. */
.skillchips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.skillchip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.skillchip input { margin: 0; padding: 2px 4px; min-height: 0; border: none; background: transparent; font-size: 0.9rem; border-radius: 6px; }
.skillchip input:focus { outline: 1px solid var(--primary); background: var(--bg); }
.skillchip .chipyears { width: 4ch; text-align: center; color: var(--text-3); }
.skillchip .chipx { width: auto; min-height: 0; margin: 0; padding: 0 6px; border: none; background: transparent; color: var(--text-3); font-size: 1.1rem; line-height: 1; cursor: pointer; min-width: 0 !important; }
details.rowfold > summary { cursor: pointer; font-weight: 600; padding: 4px 0; list-style: none; }
details.rowfold > summary::before { content: "\25B8"; display: inline-block; width: 1em; color: var(--text-3); }
details.rowfold[open] > summary::before { content: "\25BE"; }
details.more > summary { cursor: pointer; color: var(--primary); padding: 8px 0; list-style: none; }
details.more > summary::before { content: "\25B8 "; }
details.more[open] > summary::before { content: "\25BE "; }
details.card > summary { cursor: pointer; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before { content: "\25B8"; display: inline-block; width: 1.1em; color: var(--text-3); }
details.card[open] > summary::before { content: "\25BE"; }
details.card > summary + * { margin-top: 10px; }
