:root {
  --bg: #eef1f4;
  --surface: #ffffff;
  --raised: #f7f9fb;
  --ink: #18233a;
  --ink-2: #3a465c;
  --muted: #667185;
  --line: #e1e6ec;
  --line-strong: #cdd5df;
  --high: #0e8a6a;
  --high-soft: #e3f4ee;
  --mid: #b8720b;
  --mid-soft: #fbf0dc;
  --low: #95a0b0;
  --focus: #2a63d4;
  --shadow: 0 1px 2px rgb(24 35 58 / 0.05), 0 8px 28px -12px rgb(24 35 58 / 0.18);

  --font: "Schibsted Grotesk", system-ui, -apple-system, sans-serif;
  --fs-xs: 0.78rem;
  --fs-sm: 0.875rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.5rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d121a;
    --surface: #141b26;
    --raised: #1a2330;
    --ink: #e9edf3;
    --ink-2: #c3cad6;
    --muted: #8d97a8;
    --line: #232d3c;
    --line-strong: #2f3b4d;
    --high: #3cc79b;
    --high-soft: #143329;
    --mid: #e9a73e;
    --mid-soft: #33270f;
    --low: #5e6a7c;
    --focus: #79a6ff;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 30px -14px rgb(0 0 0 / 0.6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--fs-md)/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button, select, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Header -------------------------------------------------------------- */
.top {
  position: sticky;
  top: 0;
  z-index: 3;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}

.top__inner {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0.875rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand__mark { width: 2rem; height: 2rem; flex: none; }
.brand__track { fill: none; stroke: var(--ink); stroke-width: 5; }
.brand__arc { fill: none; stroke: var(--high); stroke-width: 5; stroke-linecap: round; }

.brand__name {
  margin: 0;
  font-size: var(--fs-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand__sub { margin: 0; font-size: var(--fs-xs); color: var(--muted); }

.tabs {
  display: flex;
  padding: 0.25rem;
  gap: 0.125rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.tab {
  border: 0;
  background: none;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--muted);
  cursor: pointer;
}

.tab:hover { color: var(--ink); }
.tab[aria-pressed="true"] { background: var(--ink); color: var(--surface); }

.tab__count {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
  margin-left: 0.15rem;
}

/* Controls ------------------------------------------------------------ */
.page { max-width: 68rem; margin: 0 auto; padding: 1.5rem 1.25rem 5rem; }

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 0.875rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }

.chip span {
  display: block;
  padding: 0.375rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-2);
}

.chip:hover span { border-color: var(--ink-2); }
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.chip input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

.selects { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.select select {
  appearance: none;
  padding: 0.4rem 2rem 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23667185' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 0.8rem center;
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
}

.job__tips ul { margin: 0; padding-left: 1.1rem; }
.job__tips li + li { margin-top: 0.25rem; }

.refine { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; width: 100%; order: 3; }
.search { flex: 1 1 18rem; min-width: 0; }
.search input {
  width: 100%;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-sm);
}
.search input::placeholder { color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 0.4rem; font-size: var(--fs-sm); color: var(--ink-2); cursor: pointer; }
.check input { accent-color: var(--high); width: 1rem; height: 1rem; }
.check.is-off { opacity: 0.5; }

.status { margin: 0 0 0.75rem 0.25rem; font-size: var(--fs-sm); color: var(--muted); min-height: 1.4em; }

/* Job list: one panel, rows divided ----------------------------------- */
.jobs {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.job {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) 5rem 9.5rem;
  gap: 0 1.25rem;
  align-items: start;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--line);
}

.job:first-child { border-top: 0; }
.job:hover { background: var(--raised); }

/* Logo tile */
.logo {
  position: relative;
  width: 3rem;
  height: 3rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.logo img { width: 2rem; height: 2rem; object-fit: contain; }

.logo__mono {
  font-weight: 700;
  font-size: var(--fs-md);
  letter-spacing: -0.01em;
  color: #fff;
}

.logo.is-mono { border-color: transparent; background: hsl(var(--hue, 215) 42% 38%); }

/* Text */
.job__title { margin: 0; font-size: var(--fs-lg); font-weight: 650; line-height: 1.3; letter-spacing: -0.01em; }
.job__title a { text-decoration: none; }
.job__title a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

.job__where { margin: 0.15rem 0 0.6rem; font-size: var(--fs-sm); color: var(--muted); }
.job__company { color: var(--ink-2); font-weight: 600; }
.job__location::before { content: ", "; }

.tags { list-style: none; margin: 0 0 0.6rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.375rem; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.125rem 0.55rem;
  border-radius: 6px;
  background: var(--raised);
  border: 1px solid var(--line);
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.job:hover .tag { background: var(--surface); }
.tag svg { width: 0.85rem; height: 0.85rem; stroke: currentColor; fill: none; stroke-width: 1.6; opacity: 0.75; }
.tag--quiet { color: var(--muted); }
.tag--stretch { background: var(--mid-soft); border-color: transparent; color: var(--mid); }
.job:hover .tag--stretch { background: var(--mid-soft); }
.tag--sector { text-transform: capitalize; }
.tag--new { background: var(--high-soft); border-color: transparent; color: var(--high); font-weight: 700; }
.job:hover .tag--new { background: var(--high-soft); }

.job__reason { margin: 0 0 0.4rem; max-width: 62ch; color: var(--ink-2); font-size: 0.95rem; }

.job__more summary {
  cursor: pointer;
  width: fit-content;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--muted);
  list-style: none;
}

.job__more summary::-webkit-details-marker { display: none; }
.job__more summary::before { content: "+ "; }
.job__more[open] summary::before { content: "− "; }
.job__more summary:hover { color: var(--ink); }

.job__more dl {
  margin: 0.6rem 0 0;
  padding: 0.75rem 0.9rem;
  border-left: 2px solid var(--line-strong);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.4rem 0.9rem;
  max-width: 64ch;
  font-size: var(--fs-sm);
}

.job__more dt { font-weight: 600; color: var(--muted); }
.job__more dd { margin: 0; color: var(--ink-2); }

/* Fit gauge: the signature element */
.gauge {
  --band: var(--low);
  position: relative;
  width: 5rem;
  height: 5rem;
  display: grid;
  place-items: center;
  align-content: center;
}

.gauge[data-band="high"] { --band: var(--high); }
.gauge[data-band="mid"] { --band: var(--mid); }

.gauge svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge__track { fill: none; stroke: var(--line); stroke-width: 4.5; }

.gauge__arc {
  fill: none;
  stroke: var(--band);
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-dasharray: 169.65;
  stroke-dashoffset: 169.65;
  transition: stroke-dashoffset 900ms cubic-bezier(0.22, 1, 0.36, 1);
}

.gauge.is-unscored .gauge__track { stroke-dasharray: 3 5; }

.gauge__value {
  position: relative;
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--ink);
}

.gauge__label {
  position: relative;
  margin-top: 0.15rem;
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1;
}

.gauge.is-unscored .gauge__value { color: var(--low); }

/* Actions */
.job__actions { display: flex; flex-direction: column; gap: 0.4rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn svg { width: 1rem; height: 1rem; stroke: currentColor; fill: none; stroke-width: 1.8; }
.btn:hover { border-color: var(--ink-2); }
.btn--primary { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.btn--primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn--ghost { border-color: transparent; background: none; color: var(--muted); font-weight: 500; }
.btn--ghost:hover { color: var(--ink); border-color: transparent; text-decoration: underline; text-underline-offset: 3px; }
.btn:disabled { opacity: 0.5; cursor: progress; }

.applied-on { margin: 0 0 0.2rem; font-size: var(--fs-xs); color: var(--muted); text-align: center; }

.empty { padding: 3.5rem 1.5rem; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-size: var(--fs-lg); margin-bottom: 0.25rem; }

/* Footer and toast */
.foot { max-width: 68rem; margin: -3.5rem auto 0; padding: 0 1.25rem 2.5rem; font-size: var(--fs-xs); color: var(--muted); }
.foot p { margin: 0.15rem 0; }
.foot .warn { color: var(--mid); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0.65rem 0.6rem 1.1rem;
  border-radius: 12px;
  background: var(--ink);
  color: var(--surface);
  box-shadow: 0 12px 32px -8px rgb(0 0 0 / 0.35);
  font-size: var(--fs-sm);
  font-weight: 500;
  max-width: calc(100vw - 2rem);
}

.toast[hidden], .toast button[hidden] { display: none; }

.toast button {
  border: 0;
  border-radius: 8px;
  padding: 0.3rem 0.75rem;
  background: color-mix(in srgb, var(--surface) 16%, transparent);
  font-weight: 600;
  cursor: pointer;
}

.job.is-leaving { opacity: 0.4; transition: opacity 160ms ease; }

@media (prefers-reduced-motion: reduce) {
  .gauge__arc, .job.is-leaving { transition: none; }
}

/* Narrow screens ------------------------------------------------------ */
@media (max-width: 44rem) {
  .page { padding-inline: 0.75rem; }
  .top__inner { padding-inline: 1rem; }
  .tabs { width: 100%; justify-content: space-between; }
  .tab { flex: 1; }
  .controls { flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .chip span { white-space: nowrap; }
  .selects { min-width: 0; }
  .refine { order: 0; }
  .search { flex-basis: 100%; }
  .select { flex: 1 1 0; min-width: 0; }
  .select select { width: 100%; min-width: 0; }
  .jobs { border-radius: 12px; }
  .job {
    grid-template-columns: 2.75rem minmax(0, 1fr) 4rem;
    gap: 0 0.875rem;
    padding: 1rem;
  }
  .logo { width: 2.75rem; height: 2.75rem; border-radius: 10px; }
  .logo img { width: 1.75rem; height: 1.75rem; }
  .gauge { width: 4rem; height: 4rem; }
  .gauge__value { font-size: 0.9rem; }
  .gauge__label { font-size: 0.6rem; }
  .job__actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; margin-top: 0.75rem; }
  .job__actions .btn { flex: 1; }
  .applied-on { width: 100%; text-align: left; }
  .job__more dl { grid-template-columns: 1fr; }
}
