/* © 2026 Anish Ojha. All rights reserved. Not licensed for copying or reuse.
   Redesign, Oct 2026: filter sidebar, card list, and the selected role shown
   beside the list. Loaded last; overrides the older stylesheets. */

:root {
  --canvas: #f7f7f4;
  --surface: #ffffff;
  --ink: #16181d;
  --muted: #5b606b;
  --line: #e4e4df;
  --line-strong: #d5d5ce;
  --cobalt: #0f7a5c;
  --cobalt-soft: #e6f2ee;
  --accent-ink: #0a5a44;
  --on-cobalt: #ffffff;
  --chip: #f1f1ec;
  --seg-1: #0f7a5c;
  --seg-2: #4fa585;
  --seg-3: #2f5bd3;
  --seg-4: #a7aca4;
  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 16px;
  --shadow: 0 1px 2px rgb(22 24 29 / 0.06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #111311; --surface: #1a1d1b; --ink: #ecedea; --muted: #a3a8a2;
    --line: #2a2e2c; --line-strong: #3a3f3c; --cobalt: #3dbe8b; --cobalt-soft: #16352b;
    --accent-ink: #7fddb4; --on-cobalt: #06231a; --chip: #232725;
    --seg-1: #3dbe8b; --seg-2: #2b8a65; --seg-3: #6e8ef5; --seg-4: #4a504c; --shadow: none;
  }
}
:root[data-theme="dark"] {
  --canvas: #111311; --surface: #1a1d1b; --ink: #ecedea; --muted: #a3a8a2;
  --line: #2a2e2c; --line-strong: #3a3f3c; --cobalt: #3dbe8b; --cobalt-soft: #16352b;
  --accent-ink: #7fddb4; --on-cobalt: #06231a; --chip: #232725;
  --seg-1: #3dbe8b; --seg-2: #2b8a65; --seg-3: #6e8ef5; --seg-4: #4a504c; --shadow: none;
}

body { font-size: 0.95rem; }
a { color: var(--accent-ink); }

/* ---------- Header ---------- */
.top {
  max-width: none; margin: 0;
  align-items: center; justify-content: flex-start; gap: 0.75rem 1rem;
  padding: 0.75rem max(1.25rem, calc((100% - 92rem) / 2 + 1.25rem));
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 0.6rem; }
.brand .logo { width: 28px; height: 28px; flex: none; }
.brand .logo .ring { stroke: var(--line-strong); }
.brand .logo .sweep { stroke: var(--cobalt); }
.brand .logo .blip { fill: var(--cobalt); }
h1 { font: 800 1.4rem/1 var(--display); font-stretch: 100%; letter-spacing: -0.02em; }
.scan { margin-left: auto; gap: 0.5rem; }
.updated { font-size: 0.82rem; display: inline-flex; align-items: center; gap: 0.45rem; }
.updated::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--cobalt); flex: none; }
.btn { border-radius: var(--radius-s); padding: 0.62rem 0.95rem; min-height: 2.5rem; }
.btn.primary { font-weight: 700; }
.btn.ghost { background: transparent; }
.theme-btn { min-width: 2.5rem; padding: 0.5rem; }

.top .modes {
  max-width: none; margin: 0 0 0 0.5rem; padding: 4px; gap: 4px; flex-wrap: nowrap;
  background: var(--chip); border-radius: 10px;
}
.top .modes button {
  border: 0; background: transparent; color: var(--muted);
  font: 600 0.92rem/1 var(--body); padding: 0.55rem 1rem; border-radius: 7px; min-height: 2.25rem;
}
.top .modes button:hover { color: var(--ink); border: 0; }
.top .modes button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: var(--shadow); }
.modes .count:not(:empty) { background: var(--line); color: var(--ink); border-radius: 999px; padding: 0.1rem 0.45rem; font-size: 0.75rem; }
.modes .count.due, .modes button[aria-pressed="true"] .count.due { background: #fff1d6; color: #6b4a0b; }
:root[data-theme="dark"] .modes .count.due { background: #3a2c0c; color: #f3c972; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .modes .count.due { background: #3a2c0c; color: #f3c972; } }

@media (max-width: 52rem) {
  .top .modes { order: 3; width: 100%; margin: 0; }
  .top .modes button { flex: 1 1 0; justify-content: center; }
}
@media (max-width: 40rem) {
  .updated, #help-btn { display: none; }
  .top { padding-inline: 1rem; }
  .scan { width: 100%; margin-left: 0; order: 2; }
  .scan .btn { flex: 1 1 auto; }
  .scan .theme-btn { flex: none; }
  .shell, .site-foot { padding-inline: 1rem; }
}
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

.welcome {
  max-width: calc(92rem - 2.5rem);
  border: 1px solid var(--line); border-radius: var(--radius-l); box-shadow: var(--shadow);
}
@media (max-width: 92rem) { .welcome { margin-inline: 1.25rem; } }

/* ---------- Page shell: sidebar + content ---------- */
.shell {
  max-width: 92rem; margin: 0 auto; padding: 1.25rem 1.25rem 2.5rem;
  display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 1.75rem; align-items: start;
}
body[data-mode="tracker"] .shell { grid-template-columns: minmax(0, 1fr); }
body[data-mode="tracker"] .side-filters { display: none !important; }
.content { min-width: 0; display: flex; flex-direction: column; gap: 0.25rem; }
main { max-width: none; margin: 0; padding: 0; min-width: 0; }

/* ---------- Sidebar filters ---------- */
.side-filters {
  position: sticky; top: 1rem; max-height: calc(100dvh - 2rem); overflow: auto;
  display: flex; flex-direction: column; gap: 1.4rem; padding: 0.25rem 0.25rem 1rem 0;
}
.side-head { display: flex; justify-content: space-between; align-items: baseline; }
.side-head h2 { margin: 0; font: 700 1rem/1.2 var(--body); }
.side-reset {
  font: 600 0.85rem/1 var(--body); color: var(--accent-ink);
  background: none; border: 0; padding: 0.25rem 0; cursor: pointer;
}
.side-reset:hover { text-decoration: underline; }
.side-filters .chipset, .side-group {
  border: 0; margin: 0; padding: 0; min-width: 0;
  display: flex; flex-direction: column; align-items: stretch; gap: 0.35rem;
}
.side-filters .chipset legend, .side-label {
  float: none; width: 100%; padding: 0; margin: 0 0 0.45rem;
  font: 700 0.72rem/1 var(--body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.side-filters .chipset.list label, .side-check {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.25rem 0; margin: 0; border: 0; border-radius: 0; background: none;
  color: var(--ink); font: 400 0.95rem/1.3 var(--body); white-space: normal; cursor: pointer;
}
.side-filters .chipset.list label:has(input:checked) { background: none; border: 0; color: var(--ink); font-weight: 400; }
.side-filters .chipset.list input, .side-check input {
  position: static; opacity: 1; pointer-events: auto; margin: 0; flex: none;
  width: 1.1rem; height: 1.1rem; accent-color: var(--cobalt); cursor: pointer;
}
.side-filters .chipset.pills { flex-direction: row; flex-wrap: wrap; gap: 0.4rem; }
.side-filters .chipset.pills legend { margin-bottom: 0.5rem; }
.side-filters .chipset.pills label {
  font-size: 0.85rem; font-weight: 500; padding: 0.4rem 0.75rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
}
.side-filters .chipset.pills label:has(input:checked) {
  background: var(--cobalt-soft); border-color: var(--cobalt); color: var(--accent-ink); font-weight: 600;
}
.side-field { font-size: 0.85rem; color: var(--muted); margin-top: 0.1rem; }
.side-input, .side-filters select {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 0.65rem 0.8rem; min-height: 2.75rem;
}
.side-group #ctype { margin-top: 0.4rem; }
.side-filters .blocked-line { margin: 0; padding: 0; max-width: none; }

/* Wide: sidebar always visible. Narrow: it opens from the Filters button. */
@media (min-width: 64rem) {
  .side-filters[hidden] { display: flex; }
  .filters-toggle { display: none !important; }
}
.side-filters .chipset legend.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip-path: inset(50%);
}
@media (max-width: 64rem) {
  /* One column: search, then the filters (when opened), then the list. */
  .shell { display: flex; flex-direction: column; align-items: stretch; gap: 1rem; }
  .content { display: contents; }
  .topbar { order: 1; }
  .side-filters {
    order: 2; position: static; max-height: none;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l);
    padding: 1.1rem 1.25rem;
  }
  .side-filters[hidden] { display: none; }
  .discover-grid { order: 3; }
}

/* ---------- Search bar and quick picks ---------- */
.filters.topbar { position: static; background: none; backdrop-filter: none; border: 0; }
.topbar .row { max-width: none; padding: 0; gap: 0.6rem; }
.topbar .row + .row { padding-top: 0.75rem; }
input[type="search"], .topbar select {
  background: var(--surface); border-color: var(--line); border-radius: 10px;
  min-height: 2.75rem; padding: 0.6rem 0.85rem;
}
.search-field input {
  padding-left: 2.4rem; background-repeat: no-repeat; background-position: 0.85rem 50%; background-size: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b606b' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
}
.select { font-size: 0.85rem; }
.filters-toggle { min-height: 2.75rem; border-radius: 10px; }
.filters-toggle .badge { background: var(--cobalt); color: var(--on-cobalt); }
.presets { padding-bottom: 0 !important; }
.presets-label { display: none; }
.presets button { font: 500 0.85rem/1 var(--body); padding: 0.5rem 0.85rem; background: var(--surface); border-color: var(--line); }
.presets button:hover { border-color: var(--ink); }
.presets button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--canvas); font-weight: 700; }
body:not([data-mode="discover"]) .topbar .presets { display: none; }

/* ---------- List + selected role ---------- */
.discover-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.detail-pane { display: none; }
@media (min-width: 80rem) {
  body[data-mode="discover"] .discover-grid { grid-template-columns: minmax(0, 26rem) minmax(0, 1fr); }
  body[data-mode="discover"] .detail-pane {
    display: block; position: sticky; top: 1rem; margin-top: 2.6rem;
    max-height: calc(100dvh - 2rem); overflow: auto;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l);
    box-shadow: var(--shadow); padding: 1.75rem;
  }
  body[data-mode="discover"] .job { grid-template-columns: 3rem minmax(0, 1fr); }
  body[data-mode="discover"] .side {
    grid-column: 2; grid-auto-flow: column; justify-content: start; justify-items: start; text-align: left; gap: 0.75rem;
  }
  body[data-mode="discover"] .side a { display: none; }
  body[data-mode="discover"] .score { width: 2.9rem; height: 2.9rem; border-width: 2.5px; }
  body[data-mode="discover"] .score-num { font-size: 1.1rem; }
  body[data-mode="discover"] .score-label { display: none; }
}
.pane-empty { text-align: center; color: var(--muted); padding: 4rem 1rem; }
.pane-empty h2 { font: 800 1.4rem/1.2 var(--display); color: var(--ink); margin: 0 0 0.4rem; }
.pane-empty p { margin: 0; }

.result-line { margin: 0.75rem 0 0.6rem; font-size: 0.85rem; }
.list { display: grid; gap: 0.55rem; }
.job {
  position: relative;
  grid-template-columns: 4rem 1fr auto;
  padding: 0.95rem 1.1rem;
  background: var(--surface); border: 1px solid var(--line); border-left-width: 1px;
  border-radius: var(--radius-m); box-shadow: var(--shadow);
  transition: border-color 120ms ease;
}
.job[data-elig] { border-left-color: var(--line); }
.job:hover { background: var(--surface); border-color: var(--line-strong); }
.job.is-selected { border: 2px solid var(--cobalt); padding: calc(0.95rem - 1px) calc(1.1rem - 1px); }
.job:has(.title-btn:focus-visible) { border-color: var(--cobalt); }
.job .title-btn::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.side a, .side .status-pill { position: relative; z-index: 1; }

.score {
  width: 3.4rem; height: 3.4rem; border-radius: 50%; border: 3px solid var(--cobalt);
  display: grid; place-items: center; align-content: center; gap: 0;
}
.job[data-elig="no"] .score, .job[data-elig="unclear"] .score { border-color: var(--line-strong); }
.score-num { font: 800 1.25rem/1 var(--display); font-stretch: 100%; }
.score-label { font-size: 0.6rem; margin-top: 0.1rem; }
.fitbar { display: none; }

.title-btn { font: 700 1rem/1.3 var(--body); }
.title-btn:hover .title { text-decoration: none; }
.job:hover .title { color: var(--accent-ink); }
.meta { font-size: 0.86rem; gap: 0 0.75rem; }
.tags { gap: 0.3rem; margin-top: 0.45rem; }
.tag { font-size: 0.74rem; font-weight: 600; padding: 0.15rem 0.55rem; border: 0; background: var(--chip); color: var(--muted); border-radius: 6px; }
.tag.elig-yes, .tag.official { background: var(--cobalt-soft); color: var(--accent-ink); }

.matchbar { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.55rem; max-width: 22rem; }
.matchbar-track { flex: 1; height: 4px; border-radius: 2px; background: var(--chip); overflow: hidden; }
.matchbar-fill { display: block; height: 100%; border-radius: 2px; background: var(--seg-2); }
.matchbar-fill.strong { background: var(--cobalt); }
.matchbar-label { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }

.side { gap: 0.5rem; }
.side a {
  color: var(--ink); font-size: 0.86rem; font-weight: 700;
  border: 1px solid var(--line); border-radius: var(--radius-s); padding: 0.5rem 0.85rem; text-decoration: none;
}
.side a:hover { border-color: var(--ink); text-decoration: none; }
.age { font-size: 0.8rem; }

@media (max-width: 40rem) {
  .job { grid-template-columns: 3rem 1fr; padding: 0.9rem; }
  .score { width: 2.75rem; height: 2.75rem; border-width: 2px; }
  .score-num { font-size: 1.05rem; }
  .score-label { display: none; }
}
.more { border-radius: var(--radius-s); }
.more[hidden] { display: none; }

/* ---------- Loading skeletons ---------- */
.sk { display: block; position: relative; overflow: hidden; background: var(--chip); border-radius: 6px; }
.sk::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 65%, transparent), transparent);
  animation: sk-shimmer 1.3s ease-in-out infinite;
}
@keyframes sk-shimmer { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .sk::after { animation: none; } }
.job.skeleton { display: flex; align-items: center; gap: 1rem; min-height: 6.25rem; }
.job.skeleton:hover { border-color: var(--line); }
.sk-ring { width: 2.9rem; height: 2.9rem; border-radius: 50%; flex: none; }
.sk-lines { flex: 1; display: grid; gap: 0.55rem; }
.sk-line { height: 0.75rem; }
.sk-title { height: 1.6rem; width: 80%; }
.sk-stat { width: 5rem; height: 4.3rem; border-radius: var(--radius-m); flex: none; }
.sk-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; margin-bottom: 1.25rem; }
.sk-tile { height: 3.2rem; border-radius: 10px; }
.pane-loading { display: grid; gap: 0.7rem; }
.pane-loading .d-title-block { display: grid; gap: 0.6rem; }
.w30 { width: 30%; } .w45 { width: 45%; } .w55 { width: 55%; } .w70 { width: 70%; } .w90 { width: 90%; }
.empty { border-radius: var(--radius-l); max-width: none; }

/* ---------- Role details (pane and drawer share these) ---------- */
.detail h2 { font: 800 clamp(1.3rem, 1.7vw, 1.65rem)/1.15 var(--display); font-stretch: 100%; letter-spacing: -0.02em; margin: 0; }
.d-head { display: flex; flex-wrap: wrap; gap: 1rem 1.25rem; align-items: flex-start; justify-content: space-between; margin: 0 0 1.1rem; }
.d-title-block { flex: 1 1 18rem; min-width: 0; }
.d-meta { margin: 0 0 0.4rem; color: var(--muted); font-size: 0.85rem; }
.d-title-block .tags { margin-top: 0.6rem; }
.d-stats { display: flex; gap: 0.6rem; }
.d-stat { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 0.65rem 1rem; text-align: center; min-width: 5rem; }
.d-stat b { display: block; font: 800 1.75rem/1 var(--display); }
.d-stat span { display: block; font-size: 0.75rem; color: var(--muted); margin-top: 0.3rem; }
.d-stat.match b { color: var(--accent-ink); }
.d-break { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; margin: 0 0 1.1rem; }
.d-break div { background: var(--canvas); border-radius: 10px; padding: 0.6rem 0.75rem; }
.d-break span { display: block; font-size: 0.72rem; color: var(--muted); }
.d-break b { font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 34rem) { .d-break { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.detail .actions { margin: 0 0 1.25rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.detail .actions .open-link { margin-left: auto; }
.d-fit { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem 1.5rem; margin: 0 0 1.25rem; }
.d-fit h3 { margin: 0 0 0.45rem; font: 700 0.95rem/1.2 var(--body); }
.d-fit p { margin: 0 0 0.5rem; font-size: 0.9rem; color: var(--muted); }
.d-fit .chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.d-note { margin: 0 0 1.25rem; padding: 0.75rem 1rem; border-radius: var(--radius-m); background: var(--canvas); color: var(--muted); font-size: 0.9rem; }
.detail dl { margin-top: 1rem; }
.why { background: var(--cobalt-soft); border-radius: var(--radius-m); }
.breakdown .b-track { background: var(--chip); }
.desc { border-top-color: var(--line); }

dialog { border-color: var(--line); border-radius: var(--radius-l); padding: 1.75rem; }
dialog::backdrop { background: rgb(17 19 17 / 0.3); }
@media (min-width: 48rem) {
  dialog#detail {
    margin: 0 0 0 auto; width: min(44rem, 70vw); height: 100dvh; max-height: 100dvh;
    border-radius: var(--radius-l) 0 0 var(--radius-l); border-right: 0; padding: 2rem 2rem 2.5rem;
  }
  dialog#detail[open] { animation: slide-in 200ms ease-out; }
}
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { dialog#detail[open] { animation: none; } }

/* ---------- Review and Tracker ---------- */
.review-card, .learned { max-width: none; }
.review-card { border-radius: var(--radius-l); padding: 1.5rem 1.75rem; box-shadow: var(--shadow); }
.rc-fits { background: var(--cobalt-soft); }
.rc-fits h3 { color: var(--accent-ink); }
.rc-gaps { background: var(--canvas); border: 1px solid var(--line); }
.rc-gaps h3 { color: var(--ink); }
.rc-fits, .rc-gaps { border-radius: var(--radius-m); }
.review-progress { font-size: 0.88rem; }

.tracker { display: grid; gap: 1.75rem; }
.t-group { margin: 0; background: none; border: 0; padding: 0; box-shadow: none; }
.t-group > h2, .t-group > summary { font: 700 1rem/1.2 var(--body); margin: 0 0 0.6rem; }
.t-group .n { font-size: 0.85rem; }
.t-due > h2 { color: #8a5a00; }
:root[data-theme="dark"] .t-due > h2 { color: #f3c972; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .t-due > h2 { color: #f3c972; } }
.t-due .t-item { border-color: #f0d9a8; }
.t-list { border-top: 0; display: grid; gap: 0.5rem; }
.t-item { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 0.85rem 1rem; background: var(--surface); box-shadow: var(--shadow); }
.t-item .title-btn { font-size: 0.98rem; }
.t-item .title-btn:hover .t-title { color: var(--accent-ink); }
.t-controls { gap: 0.4rem; }
.t-controls .btn { border-radius: var(--radius-s); min-height: 2.25rem; padding: 0.45rem 0.75rem; font-size: 0.85rem; }
.t-controls select { min-height: 2.25rem; border-radius: var(--radius-s); background: var(--surface); }

/* Pay box: one quiet border instead of a coloured side stripe. */
.pay-box { border: 1px solid var(--line) !important; border-radius: var(--radius-m) !important; background: var(--surface); }

/* ---------- Footer ---------- */
.site-foot {
  max-width: 92rem; margin: 0 auto; padding: 1.25rem 1.25rem 2.5rem;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 0.8rem;
}
.site-foot p { margin: 0 0 0.3rem; max-width: 60rem; }
