@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&display=swap');

:root {
  --bg: #ffffff; --panel: #ffffff; --soft: #f6f6fa; --ink: #17171f; --muted: #6a6a80; --faint: #8c8ca0; --line: #e6e6ee;
  --accent: #3f3bd6; --accent-ink: #ffffff; --accent-soft: #efeefb; --warn: #8a4a12; --warn-soft: #fff3e8;
  --bad: #a3322a; --bad-soft: #fbe7e4; --good: #1e6b3a; --good-soft: #e3f5ea; --code: #f0f0f6;
  --radius: 16px; --radius-sm: 10px; --shadow: 0 1px 2px rgba(23,23,31,0.08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121216; --panel: #1a1a21; --soft: #1f1f28; --ink: #ececf2; --muted: #a2a2b8; --faint: #7d7d93; --line: #2b2b36;
    --accent: #8683ff; --accent-ink: #0f0f1a; --accent-soft: #26264a; --warn: #f0b070; --warn-soft: #3a2a16;
    --bad: #f08a80; --bad-soft: #3d1f1c; --good: #7fd49a; --good-soft: #17301e; --code: #262630; --shadow: 0 1px 2px rgba(0,0,0,0.4);
  }
}
:root[data-theme="dark"] {
  --bg: #121216; --panel: #1a1a21; --soft: #1f1f28; --ink: #ececf2; --muted: #a2a2b8; --faint: #7d7d93; --line: #2b2b36;
  --accent: #8683ff; --accent-ink: #0f0f1a; --accent-soft: #26264a; --warn: #f0b070; --warn-soft: #3a2a16;
  --bad: #f08a80; --bad-soft: #3d1f1c; --good: #7fd49a; --good-soft: #17301e; --code: #262630; --shadow: 0 1px 2px rgba(0,0,0,0.4);
}
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }
table.levels { border-collapse: collapse; margin: 8px 0; font-size: .9rem; }
table.levels td { padding: 6px 10px 6px 0; vertical-align: top; border-bottom: 1px solid var(--line); }
details.weeks { margin-top: 6px; }
details.weeks summary { cursor: pointer; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 500 15px/1.55 Manrope, system-ui, -apple-system, "Segoe UI", sans-serif; display: flex; }
a { color: var(--accent); font-weight: 700; }
h1, h2, h3, h4, h5 { line-height: 1.2; margin: 1.4em 0 .5em; letter-spacing: -0.02em; font-weight: 800; }
h1 { font-size: 2rem; margin-top: 0; letter-spacing: -0.03em; }
h2 { font-size: 1.35rem; } h3 { font-size: 1.05rem; } h4 { font-size: .95rem; }
b, strong { font-weight: 800; }

/* layout */
nav { width: 240px; flex: none; padding: 24px 14px; display: flex; flex-direction: column; gap: 3px; position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--soft); }
nav .brand { font-weight: 800; font-size: 1.05rem; padding: 4px 12px 18px; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; }
nav .brand::before { content: ''; width: 28px; height: 28px; border-radius: 8px; background: var(--accent); flex: none; background-image: linear-gradient(var(--accent-ink), var(--accent-ink)), linear-gradient(var(--accent-ink), var(--accent-ink)); background-size: 2px 14px, 14px 2px; background-position: center; background-repeat: no-repeat; }
nav .brand small { display: none; }
nav a.link { display: block; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--muted); text-decoration: none; font-weight: 700; font-size: .92rem; }
nav a.link:hover { color: var(--ink); background: var(--code); }
nav a.link.active { background: var(--panel); color: var(--accent); box-shadow: var(--shadow); }
.navgroup { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 16px 12px 4px; }
nav .spacer { flex: 1; }
.status { font-size: .78rem; color: var(--muted); padding: 12px 14px; margin: 10px 4px 0; background: var(--panel); border-radius: 12px; box-shadow: var(--shadow); font-weight: 700; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--bad); }
.dot.ok { background: var(--good); }
main { flex: 1; min-width: 0; padding: 40px 48px 80px; max-width: 1100px; }
.page { display: none; }
.page.active { display: block; }
.lead { color: var(--muted); margin: -2px 0 24px; max-width: 64ch; font-size: 1rem; }

/* components */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin: 0 0 16px; }
.card h3 { margin-top: 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; min-width: 160px; }
label { display: block; font-weight: 700; font-size: .85rem; margin: 14px 0 5px; }
label small { font-weight: 600; color: var(--faint); }
textarea, input[type=text], input[type=number], input[type=url], input[type=date], select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--soft); color: var(--ink); font: inherit; font-weight: 600;
}
textarea { min-height: 96px; resize: vertical; }
textarea.big { min-height: 300px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; font-weight: 500; }
textarea:focus, input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
button { font: 700 .9rem Manrope, system-ui, sans-serif; cursor: pointer; border-radius: var(--radius-sm); border: 0; background: var(--code); color: var(--ink); padding: 10px 16px; }
button:hover { background: var(--line); }
button.primary { background: var(--accent); color: var(--accent-ink); }
button.primary:hover { background: var(--accent); filter: brightness(1.1); }
button.small { padding: 6px 12px; font-size: .8rem; border-radius: 8px; }
button.danger { color: var(--bad); }
button.danger:hover { background: var(--bad-soft); }
button:disabled { opacity: .55; cursor: wait; }
a > button { font: inherit; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: .76rem; font-weight: 700; margin: 2px 4px 2px 0; }
.chip.gap { background: var(--warn-soft); color: var(--warn); }
.chip.muted { background: var(--code); color: var(--muted); }
.muted { color: var(--muted); }
.notice { padding: 12px 16px; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--warn); margin: 0 0 16px; font-size: .9rem; font-weight: 600; }
.error { padding: 12px 16px; border-radius: var(--radius-sm); background: var(--bad-soft); color: var(--bad); margin: 10px 0; white-space: pre-wrap; font-weight: 600; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: 5px 0; font-weight: 600; }
.checklist .tick { display: inline-block; width: 1.4em; color: var(--good); }
.checklist .todo { color: var(--muted); }

/* result panel */
.result { margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.result .bar { display: flex; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: .82rem; color: var(--muted); flex-wrap: wrap; font-weight: 600; }
.result .bar .grow { flex: 1; }
.result .body { padding: 8px 24px 22px; font-weight: 500; }
.result .body h2 { font-size: 1.2rem; } .result .body h3 { font-size: 1.05rem; } .result .body h4 { font-size: .98rem; }
.result .body ul, .result .body ol { padding-left: 1.3em; }
.result .body li { margin: 3px 0; }
.result .body code { background: var(--code); padding: 1px 6px; border-radius: 5px; font-size: .88em; }
.result .body pre { background: var(--code); padding: 12px; border-radius: var(--radius-sm); overflow-x: auto; }
.result .body pre code { background: none; padding: 0; }
.result .body blockquote { margin: 10px 0; padding: 4px 14px; border-left: 3px solid var(--accent); color: var(--muted); }
.tablewrap { overflow-x: auto; margin: 10px 0; border: 1px solid var(--line); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th, td { border-bottom: 1px solid var(--line); padding: 9px 12px; text-align: left; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { background: var(--soft); font-weight: 800; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
.working { padding: 16px; color: var(--muted); font-weight: 600; }

/* stats bars */
.bars { display: grid; grid-template-columns: minmax(120px, 230px) 1fr 90px; gap: 6px 12px; align-items: center; font-size: .86rem; font-weight: 600; }
.bar-track { height: 8px; background: var(--code); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 6px; }
.bar-fill.gap { background: var(--warn); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }

/* jobs and repos */
.job { border-top: 1px solid var(--line); padding: 14px 0; }
.job:first-child { border-top: 0; }
.job .title { font-weight: 800; }
.repo-table td, .repo-table th { font-size: .84rem; }
.quick { display: flex; gap: 14px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin-top: 8px; }
.quick b { color: var(--ink); }

/* chat */
.chat-log { max-height: 58vh; min-height: 120px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; }
.msg { max-width: 86%; padding: 10px 16px; border-radius: 16px; background: var(--soft); font-weight: 500; }
.msg.user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); white-space: pre-wrap; font-weight: 600; }
.msg.assistant p:first-child { margin-top: 0; } .msg.assistant p:last-child { margin-bottom: 0; }
.msg.assistant ul, .msg.assistant ol { padding-left: 1.3em; margin: 6px 0; }
.msg.pending { color: var(--muted); }
.chat-input { display: flex; gap: 10px; align-items: flex-end; }
.chat-input textarea { flex: 1; }
.starter { border-radius: 99px; font-size: .85rem; padding: 7px 14px; }

/* v2 */
.pipe select, .pipe input[type=date] { width: auto; }
.pipe { margin-top: 8px; }
.cvbox { max-height: 420px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; padding: 4px 18px; background: var(--soft); margin-top: 10px; }
.repo-panel { margin-top: 12px; }
.repo-form, .repo-final { border-top: 1px solid var(--line); padding-top: 4px; }
.idea h3 { margin-bottom: 6px; }
details summary { cursor: pointer; font-weight: 700; }
input[type=range] { padding: 0; }
.row > select, .row > input[type=text]:not(.grow), .row > input[type=number], .row > input[type=url]:not(.grow) { width: auto; }
.row > select.grow, .row > input.grow { flex: 1; width: auto; }

/* v3 */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { background: var(--soft); border-radius: var(--radius); padding: 18px 20px; }
.tile.accent { background: var(--accent-soft); } .tile.accent .n { color: var(--accent); }
.tile.warn { background: var(--warn-soft); } .tile.warn .n { color: var(--warn); }
.tile .n { font-size: 2rem; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.tile .l { font-size: .8rem; color: var(--muted); margin-top: 8px; font-weight: 700; }
.tile .d { font-size: .74rem; color: var(--faint); margin-top: 6px; line-height: 1.35; font-weight: 500; }
.hero { background: var(--accent); color: var(--accent-ink); border-radius: var(--radius); padding: 20px 24px; margin: 0 0 18px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.hero .k { font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; opacity: .8; }
.hero .t { font-size: 1.25rem; font-weight: 800; margin-top: 4px; letter-spacing: -0.01em; }
.hero .d { font-size: .9rem; opacity: .92; margin-top: 4px; }
.hero button { background: var(--accent-ink); color: var(--accent); }
.hero a { color: var(--accent-ink); }
.pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 14px; }
.pill { font-size: .82rem; font-weight: 700; padding: 7px 14px; border-radius: 99px; background: var(--code); color: var(--muted); border: 0; }
.pill.on { background: var(--ink); color: var(--bg); }
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.skill-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; background: var(--panel); }
.skill-card.stale { border-style: dashed; opacity: .7; }
.skill-card .name { font-size: 1rem; font-weight: 800; }
.skill-card .sub { font-size: .8rem; color: var(--muted); margin-top: 2px; font-weight: 600; }
.lvl { display: flex; gap: 4px; margin-top: 12px; }
.lvl i { height: 8px; flex: 1; border-radius: 4px; background: var(--line); display: block; }
.lvl i.on { background: var(--accent); }
.stale .lvl i.on { background: var(--faint); }
.lvl i.tgt { outline: 2px solid var(--warn); outline-offset: -2px; }
.skill-card .foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; font-size: .78rem; font-weight: 700; flex-wrap: wrap; }
.skill-card select { width: auto; padding: 3px 6px; font-size: .78rem; border-radius: 7px; }
.trust { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .74rem; font-weight: 800; }
.trust.t1 { background: var(--code); color: var(--muted); } .trust.t2 { background: var(--accent-soft); color: var(--accent); } .trust.t3 { background: var(--warn-soft); color: var(--warn); } .trust.t4 { background: var(--good-soft); color: var(--good); }
.mkt { font-size: .76rem; font-weight: 800; }
.mkt.rising { color: var(--good); } .mkt.falling { color: var(--bad); } .mkt.steady, .mkt.saved, .mkt.new { color: var(--muted); }
.ev { border-top: 1px solid var(--line); padding: 12px 0; }
.ev:first-child { border-top: 0; }
.ev .title { font-weight: 800; }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.mode { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; background: var(--panel); }
.mode.on { border-color: var(--accent); background: var(--accent-soft); }
.mode b { display: block; margin-bottom: 4px; }
.mode small { color: var(--muted); display: block; font-weight: 600; }
.cand { border-top: 1px solid var(--line); padding: 12px 0; }
.cand:first-child { border-top: 0; }
.score { display: inline-block; min-width: 44px; text-align: center; padding: 3px 8px; border-radius: 8px; font-weight: 800; font-size: .82rem; }
.score.hi { background: var(--good-soft); color: var(--good); } .score.mid { background: var(--warn-soft); color: var(--warn); } .score.lo { background: var(--code); color: var(--muted); }
.q-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; background: var(--panel); margin-top: 14px; }
.q-card .stem { font-size: 1.05rem; margin: 0 0 12px; white-space: pre-wrap; font-weight: 700; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin: 6px 0; cursor: pointer; font-weight: 600; }
.opt input { margin-top: 3px; }
.opt.correct { border-color: var(--good); background: var(--good-soft); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.feedback { margin-top: 12px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--soft); }
.spark { font-family: ui-monospace, Menlo, monospace; font-size: .78rem; color: var(--muted); letter-spacing: 1px; }
.trend { font-size: .72rem; padding: 2px 8px; border-radius: 99px; font-weight: 800; }
.trend.rising { background: var(--good-soft); color: var(--good); } .trend.falling { background: var(--bad-soft); color: var(--bad); } .trend.new { background: var(--code); color: var(--muted); }
.pack { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 16px 20px; margin-bottom: 12px; }
.obj-row input { margin-bottom: 4px; }
.q-item { border-top: 1px solid var(--line); padding: 8px 0; }
.q-item .stem { font-weight: 600; }
.notif { padding: 6px 0; border-top: 1px solid var(--line); font-size: .86rem; font-weight: 600; }
.notif:first-child { border-top: 0; }
.notif.alert { color: var(--good); } .notif.warn { color: var(--warn); }
@media (max-width: 700px) { .modes { grid-template-columns: 1fr; } }

@media (max-width: 760px) {
  body { flex-direction: column; }
  nav { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; padding: 10px; }
  nav .brand, nav .spacer, .status, .navgroup { display: none; }
  nav a.link { padding: 7px 10px; font-size: .85rem; }
  main { padding: 18px 16px 60px; }
}

.facts { padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: .86rem; font-weight: 600; }
.facts.pass { background: var(--good-soft); color: var(--good); } .facts.warn { background: var(--warn-soft); color: var(--warn); } .facts.block { background: var(--bad-soft); color: var(--bad); }
.facts .muted { color: inherit; opacity: .85; font-weight: 500; }
.row > input[type=date] { width: auto; }

a.tile { text-decoration: none; color: inherit; display: block; }
a.tile { border: 1px solid transparent; } a.tile:hover { border-color: var(--accent); }

#save-msg.ok { color: var(--good); }

/* modes: job search and creator add pages and controls */
body:not(.jobsearch) .js-only { display: none !important; }
body.jobsearch .not-js { display: none !important; }
body:not(.creator) .creator-only { display: none !important; }
.subpage { margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line); }
.subpage h2 { font-size: 1.25rem; letter-spacing: -0.02em; margin: 0 0 12px; }

/* browser build */
.web-only { display: none !important; }
body.web .web-only { display: block !important; }
body.web small.web-only { display: inline !important; }
body.web .not-web { display: none !important; }
