/* Career Agent: one neutral ground, near-black actions, one green accent kept to data (fit, done marks, progress).
   Light and dark themes; the theme follows the system unless the person picks one (data-theme on <html>). */
:root {
  --ground: #f9fafb; --surface: #ffffff; --raised: #f3f4f6; --active: #eceef1;
  --border: #e5e7eb; --rule: #f0f1f3; --control: #d1d5db;
  --text: #111111; --muted: #5f6368; --faint: #6b6b6b;
  --primary: #1d1f20; --on-primary: #ffffff;
  --accent: #1a7f4b; --accent-tint: #e3f4ea; --accent-ink: #0d4a2b;
  --warn-bg: #fffbeb; --warn-line: #fde68a; --warn-ink: #92400e;
  --bad-bg: #ffedea; --bad-ink: #831c1e; --bad: #c4242a;
  --focus: #1a7f4b;
  --radius-card: 8px; --radius-control: 6px; --radius-chip: 4px;
  --shadow-float: 0 8px 28px rgba(0,0,0,.12);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* old names kept for templates that still use them */
  --bg: var(--ground); --ok: var(--accent); --off: var(--faint); --warn: #b45309; --error: var(--bad);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #000000; --surface: #111111; --raised: #1a1a1a; --active: #222222;
    --border: #262626; --rule: #1c1c1c; --control: #444444;
    --text: #ffffff; --muted: #b4b4b4; --faint: #949494;
    --primary: #ffffff; --on-primary: #000000;
    --accent: #3fc07a; --accent-tint: #172a1d; --accent-ink: #3fc07a;
    --warn-bg: #2a2110; --warn-line: #5c4a1a; --warn-ink: #f0b85a;
    --bad-bg: #2c1a20; --bad-ink: #ef7d90; --bad: #e5566f; --warn: #f0b85a;
    --focus: #3fc07a;
    --shadow-float: 0 8px 28px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #000000; --surface: #111111; --raised: #1a1a1a; --active: #222222;
  --border: #262626; --rule: #1c1c1c; --control: #444444;
  --text: #ffffff; --muted: #b4b4b4; --faint: #949494;
  --primary: #ffffff; --on-primary: #000000;
  --accent: #3fc07a; --accent-tint: #172a1d; --accent-ink: #3fc07a;
  --warn-bg: #2a2110; --warn-line: #5c4a1a; --warn-ink: #f0b85a;
  --bad-bg: #2c1a20; --bad-ink: #ef7d90; --bad: #e5566f; --warn: #f0b85a;
  --focus: #3fc07a;
  --shadow-float: 0 8px 28px rgba(0,0,0,.6);
  color-scheme: dark;
}

/* ---------------------------------------------------------------- base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/20px var(--font); background: var(--ground); color: var(--text); font-feature-settings: "cv11"; }
h1 { font-size: 24px; line-height: 30px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 6px; text-wrap: balance; }
h2 { font-size: 16px; line-height: 22px; font-weight: 600; margin: 28px 0 10px; }
h3 { font-size: 14px; font-weight: 600; margin: 18px 0 8px; color: var(--text); }
p { margin: 0 0 10px; }
a { color: var(--text); text-decoration: underline; text-decoration-color: var(--control); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
small { font-size: 12px; }
code, pre, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
pre.code { background: var(--raised); border-radius: var(--radius-card); padding: 12px; overflow: auto; max-height: 60vh; white-space: pre-wrap; }
pre.diff { white-space: pre; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.hint, .page-tip { color: var(--muted); }
.error { color: var(--bad); }
.num, td.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- shell: sidebar on desktop, top bar + bottom bar on phones */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
           padding: 18px 12px 14px; border-right: 1px solid var(--border); background: var(--ground); }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px; }
.wordmark { font-weight: 700; font-size: 15px; text-decoration: none; color: var(--text); letter-spacing: -0.01em; }
.side-scope { margin: 2px 8px 18px; color: var(--muted); font-size: 12px; }
.side-group { margin: 22px 8px 6px; color: var(--muted); font-size: 12px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a, .side-link { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 6px 10px; border-radius: var(--radius-control);
           color: var(--muted); text-decoration: none; font: inherit; background: none; border: 0; cursor: pointer; text-align: left; width: 100%; }
.side-nav a.plain { padding-left: 36px; }
.side-nav a:hover, .side-link:hover { color: var(--text); background: var(--raised); }
.side-nav a.active { color: var(--text); background: var(--active); font-weight: 500; }
.side-nav .count { margin-left: auto; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); }
.side-nav a.active .count { color: var(--text); }
.side-foot { margin-top: auto; padding-top: 18px; }
.side-user { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding: 10px 10px 0;
             border-top: 1px solid var(--border); }
.user-name { text-decoration: none; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-button { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: var(--radius-control);
               background: none; color: var(--muted); cursor: pointer; }
.icon-button:hover { background: var(--raised); color: var(--text); }
.icon-button .icon { width: 18px; height: 18px; }
.menu-close, .mobile-bar, .phone-bar, .scrim { display: none; }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.subtabs { display: flex; gap: 4px; padding: 14px 32px 0; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none;
           background: var(--ground); position: sticky; top: 0; z-index: 5; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs a { padding: 8px 10px 10px; color: var(--muted); text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtabs a:hover { color: var(--text); }
.subtabs a.active { color: var(--text); border-bottom-color: var(--text); font-weight: 500; }
.content { width: 100%; max-width: 1120px; padding: 28px 32px 96px; }
.signed-out-main { max-width: 480px; margin: 0 auto; padding-top: 10vh; }
.page-tip { margin: 0 0 18px; max-width: 70ch; }

/* ---------------------------------------------------------------- notices and messages */
.notice, .nextbar { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; justify-content: space-between;
          padding: 10px 14px; margin-bottom: 14px; border-radius: var(--radius-card); background: var(--raised); }
.notice p { margin: 0; }
.notice.next { background: var(--accent-tint); color: var(--accent-ink); }
.notice.next strong, .notice.next p { color: inherit; }
.flash { padding: 10px 14px; border-radius: var(--radius-card); margin-bottom: 16px; background: var(--accent-tint); color: var(--accent-ink); }
.flash.error { background: var(--bad-bg); color: var(--bad-ink); }
#toasts { position: fixed; right: 16px; bottom: 76px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 10px 14px; max-width: 340px;
         box-shadow: var(--shadow-float); }

/* ---------------------------------------------------------------- surfaces */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 18px 20px; margin-bottom: 16px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card.compact { padding: 12px 16px; }
.narrow { max-width: 400px; margin: 0 auto; }
.narrow.wide { max-width: 540px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.grid > .card, .grid2 > .card { margin-bottom: 0; }
a.card { color: inherit; text-decoration: none; display: flex; }
a.card.clickable:hover, a.card.step:hover { border-color: var(--control); background: var(--raised); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-between { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.stack { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
details.card.compact { margin-top: 16px; }
.compact summary { cursor: pointer; font-weight: 500; }
blockquote { margin: 6px 0; padding: 4px 0 4px 12px; border-left: 2px solid var(--control); color: var(--text); }
blockquote small { display: block; color: var(--muted); }
.description { white-space: pre-wrap; max-height: 70vh; overflow: auto; }
dl { margin: 0; }

/* ---------------------------------------------------------------- controls */
label { display: block; margin-bottom: 6px; color: var(--muted); }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=search], input[type=url], input[type=tel],
textarea, select { width: 100%; min-height: 36px; padding: 7px 10px; border: 1px solid var(--control); border-radius: var(--radius-control);
       background: var(--surface); color: var(--text); font: inherit; margin-bottom: 12px; }
textarea { min-height: 80px; line-height: 20px; }
select { width: auto; }
input[type=file] { font: inherit; color: var(--muted); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type=checkbox], input[type=radio] { accent-color: var(--text); width: 16px; height: 16px; }
input[type=range] { width: 100%; accent-color: var(--text); margin: 4px 0 12px; }
button, a.button { font: inherit; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
         min-height: 36px; padding: 0 14px; border-radius: var(--radius-control); border: 1px solid var(--control);
         background: var(--surface); color: var(--text); text-decoration: none; white-space: nowrap; }
button:hover, a.button:hover { background: var(--raised); }
button.primary, a.button.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
button.primary:hover, a.button.primary:hover { opacity: .88; background: var(--primary); }
button.secondary { background: var(--surface); }
button.link { border: 0; background: none; color: var(--text); padding: 0; min-height: 0; text-decoration: underline;
              text-decoration-color: var(--control); text-underline-offset: 3px; font-weight: 400; }
button:disabled { opacity: .5; cursor: not-allowed; }
.small, button.small, a.button.small { min-height: 30px; padding: 0 10px; font-size: 13px; }
form.inline { display: inline; }
form.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
form.row input[type=text] { flex: 1; min-width: 200px; margin: 0; width: auto; }
.stack label, .form-grid label { display: flex; flex-direction: column; gap: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px 16px; }
.form-grid fieldset { grid-column: 1 / -1; border: 1px solid var(--border); border-radius: var(--radius-card);
       display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 16px; }
.form-grid button { grid-column: 1 / -1; width: auto; justify-self: start; }
.form-grid input { margin-bottom: 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filters input[type=text] { flex: 1 1 240px; margin: 0; width: auto; }
.filters select { margin: 0; }
.chip { min-height: 28px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 400; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span { display: inline-block; padding: 6px 14px; border: 1px solid var(--control); border-radius: 999px; cursor: pointer;
                   background: var(--surface); user-select: none; }
.chip-check input:checked + span { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.chip-check input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.inline-label { display: inline; margin-right: 6px; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }

/* ---------------------------------------------------------------- tables: rules, no bands; cards on phones */
table.jobs { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card);
             overflow: hidden; }
table.jobs th, table.jobs td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.jobs th { color: var(--muted); font-weight: 400; font-size: 12px; white-space: nowrap; padding-top: 10px; padding-bottom: 10px;
                border-bottom-color: var(--border); }
table.jobs tr:last-child td { border-bottom: 0; }
table.jobs td small { color: var(--muted); }
tr.row-link { cursor: pointer; }
tr.row-link:hover td { background: var(--raised); }
tr.row-link a { text-decoration: none; font-weight: 500; }
tr.muted, .card.muted { opacity: .55; }
tr.needs td:first-child { box-shadow: inset 3px 0 0 var(--warn-line); }
table.kv td { padding: 4px 16px 4px 0; }
table.kv td:last-child { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- status marks */
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: var(--radius-chip); font-size: 12px; font-weight: 500;
         background: var(--raised); color: var(--muted); white-space: nowrap; flex: none; }
.badge.verified, .badge.accepted { background: var(--accent-tint); color: var(--accent-ink); }
.badge.flagged { background: var(--warn-bg); color: var(--warn-ink); }
.tier { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 22px; padding: 0 6px; border-radius: var(--radius-chip);
        font-weight: 600; font-size: 13px; background: var(--raised); color: var(--muted); flex: none; }
.tier-A, .tier-P { background: var(--accent); color: #fff; }
:root[data-theme="dark"] .tier-A, :root[data-theme="dark"] .tier-P { color: #000; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tier-A, :root:not([data-theme="light"]) .tier-P { color: #000; } }
.tier-B { background: var(--accent-tint); color: var(--accent-ink); }
.tier-C { background: var(--warn-bg); color: var(--warn-ink); }
.tier-Excluded { font-weight: 500; font-size: 12px; }
.gap { display: inline-flex; align-items: center; height: 20px; font-size: 12px; padding: 0 7px; border-radius: var(--radius-chip); white-space: nowrap;
       background: var(--raised); color: var(--muted); }
.gap-verified_match, .gap-strong_match, .gap-q-met { background: var(--accent-tint); color: var(--accent-ink); }
.gap-partial_match, .gap-transferable { background: var(--raised); color: var(--text); }
.gap-unverified_exposure, .gap-q-unknown { background: var(--warn-bg); color: var(--warn-ink); }
.gap-genuine_gap, .gap-mandatory_qualification_gap, .gap-q-unmet { background: var(--bad-bg); color: var(--bad-ink); }
.done-mark { color: var(--accent); font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--faint); }
.status { display: flex; gap: 12px; align-items: flex-start; }
.status small { color: var(--muted); }
.status.ok .dot { background: var(--accent); } .status.warn .dot { background: var(--warn); }
.score { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: var(--radius-chip); font-size: 12px; font-weight: 600;
         background: var(--warn-bg); color: var(--warn-ink); }
.score-4, .score-5 { background: var(--accent-tint); color: var(--accent-ink); } .score-1, .score-2 { background: var(--bad-bg); color: var(--bad-ink); }
ul.error { margin: 8px 0; }

/* ---------------------------------------------------------------- progress */
.bar, .progressline { height: 6px; background: var(--raised); border-radius: 3px; overflow: hidden; margin: 8px 0 12px; }
.bar span, .progressline span { display: block; height: 100%; background: var(--accent); transition: width .4s; }
.progress { margin-bottom: 16px; }
.progress.failed { box-shadow: inset 3px 0 0 var(--bad); }
.usage-bar { height: 8px; background: var(--accent); border-radius: 2px; min-width: 1px; }

/* ---------------------------------------------------------------- home: guided steps and updates */
.welcome { margin-bottom: 20px; }
ol.guide { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-direction: column; gap: 6px; }
.guide-step { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-card); background: var(--surface);
              border: 1px solid var(--border); }
.guide-step.done { background: transparent; border-color: transparent; color: var(--muted); padding-top: 6px; padding-bottom: 6px; }
.guide-step.done a { color: var(--muted); }
.guide-step.current { border-color: var(--text); padding: 18px; }
.guide-step.current h2 { margin: 2px 0 6px; font-size: 18px; }
.guide-num { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600;
             background: var(--raised); color: var(--muted); }
.guide-step.done .guide-num { background: var(--accent); color: #fff; }
.guide-step.current .guide-num { background: var(--primary); color: var(--on-primary); }
.guide-body { flex: 1; min-width: 0; padding-top: 2px; }
.card.tip { margin-top: 18px; }
.steps { display: grid; gap: 8px; }
.step { align-items: center; gap: 12px; }
.step .tick { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--raised); flex: none; }
.step.done { opacity: .7; } .step.done .tick { background: var(--accent); color: #fff; }
.notifications { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); }
.notifications li { padding: 12px 16px; border-bottom: 1px solid var(--rule); }
.notifications li:last-child { border-bottom: 0; }
.notifications li small { color: var(--muted); }
.notifications li.kind-needs_you { box-shadow: inset 3px 0 0 var(--warn-line); }
.notifications li.empty { color: var(--muted); }
a.note-link { color: inherit; text-decoration: none; display: block; }
.notifications li:has(a.note-link):hover { background: var(--raised); }

/* ---------------------------------------------------------------- setup, search progress */
.setup-step { margin-bottom: 12px; }
.setup-step.done { opacity: .8; }
.search-card, .ready-card { margin-bottom: 20px; }
.search-card h2, .ready-card h2 { margin: 0 0 8px; }
ol.stepper { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-direction: column; gap: 8px; }
ol.stepper li { display: flex; gap: 10px; align-items: flex-start; }
ol.stepper .mark { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--raised); font-size: 12px; }
ol.stepper li.done .mark { background: var(--accent); color: #fff; }
ol.stepper li.active .mark { background: var(--primary); color: var(--on-primary); font-weight: 600; }
ol.stepper li.waiting { color: var(--muted); }
.searchbar { background: var(--raised); }

/* ---------------------------------------------------------------- profile and skills */
.profile-head { display: grid; grid-template-columns: 1fr minmax(0, 360px); gap: 16px; align-items: start; }
.headline { font-size: 15px; margin: 0 0 4px; color: var(--muted); }
.skills { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
          border-radius: var(--radius-card); }
.skill + .skill { border-top: 1px solid var(--rule); }
.skill details { padding: 10px 14px; }
.skill summary { cursor: pointer; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; list-style: none; }
.skill summary::-webkit-details-marker { display: none; }
.skill .name { font-weight: 500; }
.skill.rejected .name { text-decoration: line-through; color: var(--muted); }
.skill-body { margin-top: 10px; }
.skill-body .row { margin-top: 8px; }
.skill-body input[type=text] { width: auto; margin: 0; }
.job { margin-bottom: 10px; } .job ul { margin: 8px 0 0; padding-left: 20px; }

/* ---------------------------------------------------------------- applications */
.next-box { border-color: var(--text); margin: 12px 0 18px; }
.next-box h2 { margin-top: 0; }
.next-box.next-awaiting_confirmation, .next-box.next-requires_manual_action { border-color: var(--warn-line); background: var(--warn-bg); }
.next-box ul { margin: 6px 0 10px; }
ol.self-apply { padding-left: 20px; display: flex; flex-direction: column; gap: 10px; margin: 10px 0 0; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.shots img { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-control); }
ul.checks { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 8px; }
ul.checks li { display: flex; gap: 10px; align-items: flex-start; }
ul.checks .mark { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; color: #fff; }
ul.checks .check-pass .mark { background: var(--accent); } ul.checks .check-warn .mark { background: var(--warn); }
ul.checks .check-fail .mark { background: var(--bad); }

/* ---------------------------------------------------------------- resumes */
.resume-preview { width: 100%; height: 75vh; border: 1px solid var(--border); border-radius: var(--radius-card); background: #fff; }
.compare pre { white-space: pre-wrap; font-size: 13px; background: var(--raised); border-radius: var(--radius-card); padding: 12px; max-height: 60vh; overflow: auto; }

/* ---------------------------------------------------------------- interview prep and mock interviews */
.card.how { margin-bottom: 8px; }
.levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 12px; }
.level-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); }
.level-card small { color: var(--muted); }
.level-card button { margin-top: auto; align-self: flex-start; }
ol.prep-q li { margin-bottom: 10px; }
ol.how-steps { padding-left: 20px; } ol.how-steps li { margin-bottom: 6px; }
.chat { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.chat .msg { max-width: 92%; }
.chat .msg.feedback p { margin: 6px 0; }
.answer-box textarea { width: 100%; }

/* ---------------------------------------------------------------- career counsellor */
.career-card { margin-bottom: 14px; }
.career-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.career-head .choose-box { flex: 1 1 260px; display: flex; gap: 8px; align-items: center; color: var(--text); margin: 0; font-size: 15px; font-weight: 500; }
.pay-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; margin: 8px 0; border: 1px solid var(--border); border-radius: var(--radius-card); }
.pay-row > div { padding: 10px 12px; } .pay-row > div + div { border-left: 1px solid var(--border); }
.inline-form { margin-top: 8px; }
.inline-form label { display: block; }

/* ---------------------------------------------------------------- registration */
fieldset.ai-choice { border: 1px solid var(--border); border-radius: var(--radius-card); padding: 12px 14px; margin: 14px 0; }
fieldset.ai-choice legend { font-weight: 600; padding: 0 6px; }
.radio-card { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-card);
              margin: 6px 0; cursor: pointer; color: var(--text); }
.radio-card input { margin-top: 2px; }
.radio-card:has(input:checked) { border-color: var(--text); background: var(--raised); }
.own-ai { margin-top: 10px; }
.own-ai select, .own-ai input[type=text], .own-ai input[type=password] { width: 100%; margin-bottom: 10px; }
.narrow textarea { width: 100%; margin-bottom: 12px; }
.request { padding: 12px 0; border-top: 1px solid var(--rule); }
.request:first-of-type { border-top: 0; }

/* ---------------------------------------------------------------- help chat (floats, so it may have a shadow) */
.helpchat { position: fixed; right: 20px; bottom: 20px; z-index: 40; }
.helpchat > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px;
                      border-radius: 999px; background: var(--primary); color: var(--on-primary); font-weight: 500; box-shadow: var(--shadow-float); }
.helpchat > summary::-webkit-details-marker { display: none; }
/* the panel opens above the button, so it is always on screen */
.helpchat-body { position: absolute; right: 0; bottom: calc(100% + 8px); width: min(380px, calc(100vw - 32px)); max-height: min(70vh, 560px); display: flex; flex-direction: column;
                 background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-float); overflow: hidden; }
.help-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; min-height: 160px; }
.msg { padding: 8px 12px; border-radius: 10px; max-width: 88%; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.bot { background: var(--raised); align-self: flex-start; }
.msg.me { background: var(--primary); color: var(--on-primary); align-self: flex-end; }
.msg.me.muted { opacity: .6; }
.msg.typing { color: var(--muted); }
.quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 14px; }
.msg .quick { padding: 6px 0 0; }
.help-form { display: flex; gap: 6px; padding: 10px 14px 14px; border-top: 1px solid var(--border); }
.help-form input[type=text] { margin: 0; }

/* ---------------------------------------------------------------- first-login tour */
dialog.tour { width: min(520px, calc(100vw - 32px)); border: 1px solid var(--border); border-radius: 12px; padding: 28px 28px 20px;
              background: var(--surface); color: var(--text); box-shadow: var(--shadow-float); }
dialog.tour::backdrop { background: rgba(0,0,0,.45); }
dialog.tour h2 { font-size: 20px; line-height: 26px; margin: 0 0 12px; }
.tour-slide { min-height: 170px; }
.tour-map { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; }
.tour-map dt { font-weight: 600; } .tour-map dd { margin: 0; color: var(--muted); }
.tour-actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.tour-dots { display: flex; gap: 6px; margin-right: auto; }
.tour-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--control); }
.tour-dots i.on { background: var(--text); }

/* ---------------------------------------------------------------- phones and tablets */
@media (max-width: 900px) {
  .shell { display: block; }
  .mobile-bar { display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 8px; position: sticky; top: 0; z-index: 20;
                background: var(--ground); border-bottom: 1px solid var(--border); }
  .mobile-bar .wordmark { font-size: 16px; }
  .mobile-spacer { flex: 1; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 50; transform: translateX(-100%); transition: transform .2s ease;
             background: var(--surface); padding-top: 12px; }
  body.menu-open .sidebar { transform: none; box-shadow: var(--shadow-float); }
  body.menu-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 45; }
  .menu-close { display: inline-grid; }
  .subtabs { top: 52px; padding: 6px 12px 0; }
  .content { padding: 18px 16px 120px; }
  .phone-bar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
               height: calc(60px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
               background: var(--surface); border-top: 1px solid var(--border); }
  .phone-bar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
                 color: var(--muted); text-decoration: none; font-size: 11px; min-height: 44px; }
  .phone-bar a .icon { width: 20px; height: 20px; }
  .phone-bar a.active { color: var(--text); font-weight: 600; }
  .phone-bar .dot-count { position: absolute; top: 8px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
  .helpchat { bottom: calc(72px + env(safe-area-inset-bottom)); right: 12px; }
  #toasts { left: 16px; right: 16px; bottom: calc(124px + env(safe-area-inset-bottom)); }
  .profile-head { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  h1 { font-size: 21px; line-height: 27px; }
  .card { padding: 14px 16px; }
  /* tables become stacked rows: the first cells stay on top, the rest wrap under them */
  table.jobs, table.jobs tbody, table.jobs tr, table.jobs td { display: block; width: 100%; }
  table.jobs thead { display: none; }
  table.jobs tr { padding: 12px 14px; border-bottom: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
  table.jobs tr:last-child { border-bottom: 0; }
  table.jobs td { width: auto; padding: 0; border: 0; color: var(--muted); font-size: 13px; }
  table.jobs td:nth-child(2) { flex: 1 1 70%; color: var(--text); font-size: 14px; }
  table.jobs td:empty { display: none; }
  .filters > * { flex: 1 1 140px; }
  dialog.tour { padding: 22px 20px 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* application status: one colour per meaning */
.badge.status-ok { background: var(--accent-tint); color: var(--accent-ink); }
.badge.status-warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge.status-bad { background: var(--bad-bg); color: var(--bad-ink); }
.badge.status-info { background: var(--raised); }
.status-box .status-line .badge { font-size: 15px; height: auto; padding: 4px 10px; }
.tracker { display: flex; flex-wrap: wrap; gap: 8px 18px; list-style: none; padding: 0; margin: 10px 0; }
.tracker li { color: var(--muted, #888); } .tracker li.done { color: inherit; font-weight: 600; }
.callout { border-left: 3px solid var(--accent, #2563eb); padding: 8px 12px; margin: 10px 0; background: var(--raised); border-radius: 6px; }
table.kv th { text-align: left; font-weight: 500; padding-right: 14px; white-space: nowrap; vertical-align: top; }
ul.plain { padding-left: 18px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.todo-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; margin: 8px 0; }
.todo-item.tone-warn { border-left: 3px solid var(--warn-ink, #b45309); }
@media (max-width: 640px) { .todo-item { flex-direction: column; align-items: stretch; } .todo-item .button { text-align: center; } }

/* larger text option (sizes are in px, so scale the page) */
html[data-text="large"] body { zoom: 1.18; }
/* phone first: big tap targets, no sideways scroll on tables */
@media (max-width: 640px) {
  .button, button { min-height: 44px; }
  table.jobs, table.kv { display: block; overflow-x: auto; }
  .status-box .actions { display: flex; flex-direction: column; gap: 8px; }
}
.scam-flag { border-left: 3px solid var(--bad-ink, #b91c1c); }

.side-legal { font-size: 12px; margin: 4px 12px; color: var(--muted, #888); } .side-legal a { color: inherit; }

form.heard { margin-top: 4px; } form.heard button.link { padding: 0; min-height: 0; }
