:root {
  --bg: #0b0e13;
  --bg-glow: #1a2033;
  --panel: #141821;
  --panel-2: #1b202a;
  --line: #272d3b;
  --text: #e8ebf1;
  --text-2: #c6ccd8;
  --muted: #949db0;
  --accent: #7c9cff;
  --accent-hover: #9db3ff;
  --accent-2: #a78bfa;
  --accent-ink: #0a1230;
  --apply: #34d399;
  --stretch: #fbbf24;
  --skip: #f87171;
  --star: #f5c542;
  --topbar: rgba(11, 14, 19, 0.8);
  --err-bg: #2a1620; --err-line: #5b2333; --err-ink: #ffd9df;
  --ok-bg: #13241e; --ok-line: #2b5346; --ok-ink: #d3f7e7;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 12px 32px -16px rgba(0,0,0,.6);
  --focus: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7fb;
    --bg-glow: #e3e9fb;
    --panel: #ffffff;
    --panel-2: #f2f4f9;
    --line: #dfe3ec;
    --text: #151923;
    --text-2: #3a4252;
    --muted: #5b6475;
    --accent: #3d5eea;
    --accent-hover: #2f4fd6;
    --accent-2: #7c4ddb;
    --accent-ink: #ffffff;
    --apply: #0f8a5f;
    --stretch: #a86a0c;
    --skip: #cf3b36;
    --star: #b7860b;
    --topbar: rgba(246, 247, 251, 0.82);
    --err-bg: #fdecee; --err-line: #f3b9c0; --err-ink: #7a1624;
    --ok-bg: #e8f7f0; --ok-line: #a9dcc6; --ok-ink: #0d4a33;
    --shadow: 0 1px 2px rgba(20,25,40,.04), 0 10px 28px -18px rgba(20,25,40,.25);
    color-scheme: light;
  }
}

/* Registered so the ring gauge can animate between values. */
@property --p { syntax: "<number>"; inherits: false; initial-value: 0; }

* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(90% 60% at 50% -10%, var(--bg-glow) 0%, transparent 70%) no-repeat, var(--bg); color: var(--text); font-family: var(--sans); line-height: 1.5; min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }
[hidden] { display: none !important; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }

/* Top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--topbar); backdrop-filter: blur(10px) saturate(1.4); z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -0.01em; white-space: nowrap; }
.brand .logo { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--accent-ink); background: linear-gradient(135deg, var(--accent), var(--accent-2)); font-size: 16px; }
.topbar-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.conn-status { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conn-status::before { content: ""; flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.conn-status[data-state="on"] { color: var(--apply); }
.conn-status[data-state="on"]::before { background: var(--apply); box-shadow: 0 0 0 3px color-mix(in srgb, var(--apply) 25%, transparent); }

.star-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); border: 1px solid var(--line); border-radius: 10px; padding: 7px 11px; background: var(--panel); white-space: nowrap; }
.star-btn:hover { text-decoration: none; color: var(--text); border-color: var(--star); }
.star-btn .star { color: var(--star); font-size: 14px; line-height: 1; }
.star-btn:hover .star { transform: rotate(-12deg) scale(1.15); }
.star-btn .star { transition: transform .2s ease; display: inline-block; }
@media (max-width: 640px) { .star-btn .star-text { display: none; } }
@media (max-width: 520px) { .topbar { padding: 10px 14px; } .conn-status { display: none; } .brand { font-size: 15px; } }

/* Buttons */
.btn { font: inherit; font-weight: 600; font-size: 14px; padding: 9px 16px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; transition: transform .05s, background .15s, border-color .15s, color .15s, opacity .15s, box-shadow .15s; white-space: nowrap; }
.btn.small { padding: 6px 11px; font-size: 13px; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { color: var(--text); border-color: var(--muted); }
.btn-lg { padding: 11px 20px; font-size: 15px; }
.kbd { font-family: var(--mono); font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; }
@media (hover: none) { .kbd { display: none; } }

/* Layout */
.wrap { max-width: 820px; margin: 0 auto; padding: 22px 16px 60px; }
.hero { text-align: center; margin: 22px 0 22px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--text-2); border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 4px 12px; margin-bottom: 14px; }
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--apply); }
.hero h1 { font-size: clamp(28px, 5vw, 44px); margin: 0 0 10px; letter-spacing: -0.03em; line-height: 1.1; font-weight: 800; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { max-width: 540px; margin: 0 auto; color: var(--muted); font-size: 15px; }

.steps { list-style: none; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; padding: 0; margin: 0 0 18px; }
.steps li > * { font: inherit; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; border: 1px dashed var(--line); background: none; color: var(--muted); display: inline-block; }
.steps button { cursor: pointer; }
.steps button:hover { color: var(--text); border-color: var(--muted); }
.steps li[data-done="true"] > * { border-style: solid; border-color: var(--ok-line); color: var(--apply); }
.steps li[data-done="true"] > *::after { content: " ✓"; }

.banner { border-radius: 10px; padding: 12px 14px; margin: 0 0 18px; font-size: 14px; border: 1px solid var(--line); animation: rise .25s ease; }
.banner[data-kind="error"] { background: var(--err-bg); border-color: var(--err-line); color: var(--err-ink); }
.banner[data-kind="info"] { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-ink); }
.banner a { color: inherit; text-decoration: underline; }
.banner-action { margin-left: 6px; color: inherit; border-color: currentColor; }

/* Tabs — segmented control */
.tabs { display: flex; gap: 4px; margin: 0 auto 18px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; width: fit-content; max-width: 100%; overflow-x: auto; }
.tab { background: none; border: none; color: var(--muted); font: inherit; font-weight: 600; font-size: 14px; padding: 8px 16px; cursor: pointer; border-radius: 9px; white-space: nowrap; transition: background .15s, color .15s; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); background: var(--panel-2); box-shadow: 0 1px 0 var(--line) inset, 0 1px 3px rgba(0,0,0,.15); }
@media (max-width: 520px) { .tabs { width: 100%; } .tab { flex: 1 1 0; min-width: 0; padding: 8px 4px; font-size: 13px; white-space: normal; line-height: 1.25; } }
.badge { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); border-radius: 999px; padding: 1px 7px; font-size: 11px; margin-left: 4px; }
.badge:empty { display: none; }

/* Panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.panel-head h2 { font-size: 15px; margin: 0; color: var(--text); font-weight: 700; letter-spacing: -0.01em; }
.panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 2px; }
.row { display: flex; gap: 8px; align-items: center; }
.wrap-row { flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.count { margin-top: -8px; text-align: right; }
.over { color: var(--stretch); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.field-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 620px) { .grid2 { grid-template-columns: 1fr; } }
textarea, input, select { font: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; color: var(--text); transition: border-color .15s, box-shadow .15s; }
textarea, input { width: 100%; font-size: 14px; padding: 10px 12px; }
textarea { font-family: var(--mono); font-size: 13px; line-height: 1.55; resize: vertical; }
textarea::placeholder, input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
textarea:hover, input:hover, select:hover { border-color: color-mix(in srgb, var(--muted) 50%, var(--line)); }
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }

/* Scorecard */
.scorecard { animation: rise .35s ease; border-color: color-mix(in srgb, var(--accent) 25%, var(--line)); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.scorecard .verdict-row { display: flex; gap: 24px; align-items: center; }
.scorecard.stale .verdict-row, .scorecard.stale .metrics, .scorecard.stale .reqs { opacity: .45; }
.stale-note { margin: 0; font-size: 13px; color: var(--stretch); }

/* Ring gauge — the hero. --p is 0..100, --gc is the ring color. */
.gauge {
  --gc: var(--accent);
  width: 128px; height: 128px; border-radius: 50%; flex-shrink: 0;
  background: conic-gradient(var(--gc) calc(var(--p) * 1%), var(--line) 0);
  display: grid; place-items: center;
  transition: --p .9s cubic-bezier(.2,.8,.2,1);
  filter: drop-shadow(0 6px 18px color-mix(in srgb, var(--gc) 25%, transparent));
}
.gauge-inner {
  width: 100px; height: 100px; border-radius: 50%; background: var(--panel);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.gauge-inner #odds-num { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.gauge-cap { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

.verdict-main { display: flex; flex-direction: column; gap: 6px; }
.verdict-badge { align-self: flex-start; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 6px 14px; border-radius: 999px; }
.verdict-badge[data-v="apply"], .verdict-mini[data-v="apply"] { background: color-mix(in srgb, var(--apply) 15%, transparent); color: var(--apply); }
.verdict-badge[data-v="stretch"], .verdict-mini[data-v="stretch"] { background: color-mix(in srgb, var(--stretch) 15%, transparent); color: var(--stretch); }
.verdict-badge[data-v="skip"], .verdict-mini[data-v="skip"] { background: color-mix(in srgb, var(--skip) 15%, transparent); color: var(--skip); }
.verdict-badge[data-v="maybe"], .verdict-mini[data-v="maybe"] { background: var(--panel-2); color: var(--muted); }
.odds-label { color: var(--text-2); font-size: 14px; }

/* Loading skeleton */
.scorecard.loading .gauge { animation: pulse 1.2s ease-in-out infinite; }
.skeleton { height: 14px; border-radius: 999px; background: linear-gradient(90deg, var(--panel-2) 0%, var(--line) 50%, var(--panel-2) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes pulse { 50% { opacity: .55; } }

.sub-h { font-size: 13px; margin: 0 0 8px; color: var(--muted); font-weight: 600; }
.reqs { border-top: 1px solid var(--line); padding-top: 14px; }
.reqs ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.reqs li { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: baseline; font-size: 13px; padding: 6px 8px; border-radius: 8px; }
.reqs li:nth-child(odd) { background: color-mix(in srgb, var(--panel-2) 60%, transparent); }
.req-icon { font-weight: 800; text-align: center; }
.req-val { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.reqs li[data-state="met"] .req-icon { color: var(--apply); }
.reqs li[data-state="partial"] .req-icon { color: var(--stretch); }
.reqs li[data-state="unmet"] .req-icon { color: var(--skip); }
.reqs li[data-state="unknown"] .req-icon { color: var(--muted); }

.metrics { display: grid; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.metric { display: grid; grid-template-columns: 160px 1fr auto; align-items: center; gap: 12px; font-size: 13px; }
.metric .m-label { color: var(--muted); }
.m-track { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.m-fill { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width .6s ease; }
.m-fill.good { background: var(--apply); }
.m-fill.mid { background: var(--stretch); }
.m-fill.bad { background: var(--skip); }
.m-val { font-family: var(--mono); font-size: 12px; color: var(--text-2); text-align: right; min-width: 84px; }
.flag { justify-self: start; font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); font-weight: 600; }
.flag.warn { color: var(--skip); border-color: color-mix(in srgb, var(--skip) 40%, transparent); background: color-mix(in srgb, var(--skip) 10%, transparent); }
.flag.ok { color: var(--apply); border-color: color-mix(in srgb, var(--apply) 40%, transparent); background: color-mix(in srgb, var(--apply) 10%, transparent); }
.scorecard-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 10px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.disclaimer { margin: 0; opacity: .8; }
@media (max-width: 620px) {
  .scorecard .verdict-row { flex-direction: column; text-align: center; }
  .verdict-badge { align-self: center; }
  .metric { grid-template-columns: 110px 1fr auto; }
  .m-val { min-width: 0; }
}

/* Recent scores */
.recent-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.recent-item { width: 100%; font: inherit; font-size: 14px; color: var(--text); text-align: left; cursor: pointer; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; transition: border-color .15s, transform .1s; }
.recent-item:hover { border-color: var(--muted); }
.recent-item:active { transform: translateY(1px); }
.recent-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.verdict-mini { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 999px; }

/* Tracker */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stats:empty { display: none; }
.stats span { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.stats strong { color: var(--text); font-size: 20px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .stats { grid-template-columns: 1fr 1fr; } }
.filters { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; }
.filters select { padding: 8px 10px; font-size: 13px; }
@media (max-width: 520px) { .filters { grid-template-columns: 1fr 1fr; } .filters input { grid-column: 1 / -1; } }
.tracker-list { display: flex; flex-direction: column; gap: 8px; }
.empty { text-align: center; padding: 28px 20px; margin: 0; border: 1px dashed var(--line); border-radius: 12px; }
.track-card { background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--muted); border-radius: 10px; padding: 10px 12px; display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.track-card[data-status="interview"] { border-left-color: var(--accent); }
.track-card[data-status="offer"] { border-left-color: var(--apply); }
.track-card[data-status="rejected"] { border-left-color: var(--skip); opacity: .8; }
.track-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.track-title { font-weight: 600; font-size: 14px; }
.track-sub { color: var(--muted); font-size: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.track-sub a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; display: inline-block; vertical-align: bottom; }
.notes { font-size: 12px; padding: 5px 8px; background: transparent; border-color: transparent; color: var(--text-2); }
.notes:hover { border-color: var(--line); }
.fitpill { font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--bg); }
.fitpill[data-v="apply"] { color: var(--apply); }
.fitpill[data-v="stretch"] { color: var(--stretch); }
.fitpill[data-v="skip"] { color: var(--skip); }
.track-actions { display: flex; gap: 6px; align-items: center; }
.track-actions select { font-size: 12px; padding: 5px 8px; border-radius: 8px; }
.del { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 16px; padding: 4px 6px; border-radius: 6px; }
.del:hover { color: var(--skip); background: color-mix(in srgb, var(--skip) 10%, transparent); }
@media (max-width: 520px) { .track-card { grid-template-columns: 1fr; } }

.calib { width: 100%; border-collapse: collapse; font-size: 13px; }
.calib th, .calib td { text-align: left; padding: 9px 6px; border-bottom: 1px solid var(--line); }
.calib tbody tr:last-child > * { border-bottom: none; }
.calib thead th { color: var(--muted); font-weight: 600; font-size: 12px; }
.calib td { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* Footer + star CTA */
.star-cta { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--panel)), var(--panel)); }
.star-cta p { margin: 0; color: var(--text-2); font-size: 14px; }
.star-cta strong { color: var(--text); }
.footer { max-width: 820px; margin: 0 auto; padding: 22px 16px 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* Improve my chances */
.improve-cta { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 14px 16px; border-radius: 12px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--panel-2)), var(--panel-2)); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); }
.improve-cta > div { display: flex; flex-direction: column; gap: 2px; max-width: 520px; }
.improve { border-color: color-mix(in srgb, var(--accent) 25%, var(--line)); animation: rise .35s ease; }
#improve-body { display: flex; flex-direction: column; gap: 12px; }
#improve-body .sub-h { margin: 6px 0 0; }
.improve-summary { margin: 0; font-size: 15px; color: var(--text); }
.rewrites { display: grid; gap: 10px; }
.rewrite { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.rewrite p { margin: 0; }
.rw-before { color: var(--muted); font-size: 13px; text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }
.rw-after { font-size: 14px; color: var(--text); }
.rw-tag { display: inline-block; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 1px 7px; border-radius: 999px; margin-right: 8px; vertical-align: 1px; background: var(--bg); color: var(--muted); text-decoration: none; }
.rw-after .rw-tag { background: color-mix(in srgb, var(--apply) 15%, transparent); color: var(--apply); }
.rw-about { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.rw-about p { margin: 0; }
.rw-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.warn-note { font-size: 12px; color: var(--stretch); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.gap-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.gap-list li { display: flex; flex-direction: column; gap: 2px; font-size: 13px; padding: 10px 12px; border-radius: 10px; border: 1px dashed var(--line); }
.gap-list span { color: var(--muted); }
