/* Guru Setu Sourcing — the teacher-talent portal's colours, phone first.
   Tokens follow the portal's src/index.css. Change them there and here together. */

@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin-wght-normal.260c81a4759b.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin-ext-wght-normal.1ad231aac0a8.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Space Grotesk Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url("../fonts/space-grotesk-latin-wght-normal.87c506d88b9f.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Space Grotesk Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url("../fonts/space-grotesk-latin-ext-wght-normal.0bb2ef2eda4e.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  --canvas: #eef1f7;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --field-bg: #ffffff;
  --ink: #16202e;
  --muted: #5d6878;
  --line: #dce2ec;
  --line-strong: #c3ccda;
  --brand: #3d3ae0;
  --brand-strong: #2f2cc4;
  --on-brand: #ffffff;
  --brand-tint: #e8e8fc;
  --accent: #21b3af;
  --night: #12182a;
  --night-2: #1b2340;
  --on-night: #e7eaf1;
  --on-night-muted: #aab3c5;
  --good: #157a43;
  --good-mark: #1f9d57;
  --good-tint: #e3f4ea;
  --warn: #8a5a06;
  --warn-mark: #b5760a;
  --warn-tint: #f8eedb;
  --danger: #b42e2e;
  --danger-mark: #d23b3b;
  --danger-tint: #fbe5e5;
  --muted-tint: #eceff4;
  --hero: linear-gradient(140deg, #3d3ae0 0%, #2d2ab8 55%, #1f1c8c 100%);
  --focus: 0 0 0 3px rgba(61, 58, 224, 0.35);

  --font-body: "Inter Variable", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari",
    sans-serif;
  --font-display: "Space Grotesk Variable", "Inter Variable", system-ui, sans-serif;
  --radius-panel: 12px;
  --radius-control: 8px;
  --gutter: 16px;
  --bottom-nav: 64px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --canvas: #0e131b;
    --surface: #161c26;
    --surface-2: #1a212c;
    --field-bg: #1d2531;
    --ink: #e6ebf3;
    --muted: #8f99a9;
    --line: #2b3441;
    --line-strong: #3a4554;
    --brand: #7d7af4;
    --brand-strong: #9592f7;
    --on-brand: #0e131b;
    --brand-tint: #25284a;
    --good: #43c483;
    --good-mark: #43c483;
    --good-tint: #14301f;
    --warn: #d59b39;
    --warn-mark: #d59b39;
    --warn-tint: #33270f;
    --danger: #e8736f;
    --danger-mark: #e8736f;
    --danger-tint: #3a1b1b;
    --muted-tint: #222a36;
    --hero: linear-gradient(140deg, #2d2ba8 0%, #201e7e 55%, #15135a 100%);
    --focus: 0 0 0 3px rgba(125, 122, 244, 0.45);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #0e131b;
  --surface: #161c26;
  --surface-2: #1a212c;
  --field-bg: #1d2531;
  --ink: #e6ebf3;
  --muted: #8f99a9;
  --line: #2b3441;
  --line-strong: #3a4554;
  --brand: #7d7af4;
  --brand-strong: #9592f7;
  --on-brand: #0e131b;
  --brand-tint: #25284a;
  --good: #43c483;
  --good-mark: #43c483;
  --good-tint: #14301f;
  --warn: #d59b39;
  --warn-mark: #d59b39;
  --warn-tint: #33270f;
  --danger: #e8736f;
  --danger-mark: #e8736f;
  --danger-tint: #3a1b1b;
  --muted-tint: #222a36;
  --hero: linear-gradient(140deg, #2d2ba8 0%, #201e7e 55%, #15135a 100%);
  --focus: 0 0 0 3px rgba(125, 122, 244, 0.45);
}

/* ── base ─────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  font-feature-settings: "cv11", "ss01";
  overflow-x: hidden;
}
h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.2;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}
h1 {
  font-size: 1.5rem;
  font-weight: 650;
}
h2 {
  font-size: 1.125rem;
  font-weight: 620;
}
h3 {
  font-size: 1rem;
  font-weight: 620;
}
p {
  margin: 0 0 0.75rem;
}
a {
  color: var(--brand);
  text-underline-offset: 2px;
}
a:hover {
  color: var(--brand-strong);
}
img,
svg {
  max-width: 100%;
}
small,
.small {
  font-size: 0.875rem;
}
.muted {
  color: var(--muted);
}
.num {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
}
.wrap-any {
  overflow-wrap: anywhere;
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1rem 0;
}
code,
pre,
.mono {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.875rem;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
}
:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 6px;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
[hidden] {
  display: none !important;
}

/* ── shell: top bar + bottom nav on phones, navy sidebar on wide screens ─ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 var(--gutter);
  background: var(--night);
  color: var(--on-night);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--on-night);
  text-decoration: none;
  min-width: 0;
}
.brand:hover {
  color: #fff;
}
.brand-mark {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--night-2);
  display: grid;
  place-items: center;
  color: var(--accent);
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 640;
  font-size: 1rem;
  white-space: nowrap;
}
.brand-name span {
  color: var(--on-night-muted);
  font-weight: 500;
}
.topbar .me-link {
  margin-left: auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--night-2);
  color: var(--on-night);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
}

.bottomnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--bottom-nav) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.bottomnav a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 550;
  min-width: 0;
}
.bottomnav a[aria-current="page"] {
  color: var(--brand);
}
.bottomnav svg {
  width: 24px;
  height: 24px;
}
.count-dot {
  position: absolute;
  top: 6px;
  left: calc(50% + 6px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--danger-mark);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.sidebar {
  display: none;
}
.main {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px var(--gutter) calc(var(--bottom-nav) + 32px + env(safe-area-inset-bottom, 0px));
}
.plain-shell .main {
  padding-bottom: 32px;
}

@media (min-width: 960px) {
  .topbar,
  .bottomnav {
    display: none;
  }
  .shell {
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
    min-height: 100vh;
  }
  .sidebar {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 18px 12px;
    background: var(--night);
    color: var(--on-night);
  }
  .sidebar .brand {
    padding: 4px 8px 18px;
  }
  .sidebar .group {
    margin: 14px 10px 4px;
    color: var(--on-night-muted);
    font-size: 0.8125rem;
    font-weight: 550;
  }
  .sidebar a.nav {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 999px;
    color: var(--on-night);
    text-decoration: none;
    font-size: 0.9375rem;
  }
  .sidebar a.nav svg {
    width: 20px;
    height: 20px;
    flex: none;
    color: var(--on-night-muted);
  }
  .sidebar a.nav:hover {
    background: var(--night-2);
  }
  .sidebar a.nav[aria-current="page"] {
    background: #3d3ae0;
    color: #fff;
  }
  .sidebar a.nav[aria-current="page"] svg {
    color: #fff;
  }
  .sidebar .nav .count {
    margin-left: auto;
    min-width: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: var(--danger-mark);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
  }
  .sidebar .foot {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--night-2);
  }
  .sidebar .who {
    padding: 4px 10px 8px;
    font-size: 0.875rem;
    color: var(--on-night-muted);
  }
  .sidebar form button {
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    color: var(--on-night);
    font: inherit;
    font-size: 0.9375rem;
    padding: 8px 10px;
    border-radius: 999px;
    cursor: pointer;
  }
  .sidebar form button:hover {
    background: var(--night-2);
  }
  .main {
    padding: 28px 32px 48px;
  }
  h1 {
    font-size: 1.75rem;
  }
}

/* ── page header ─────────────────────────────────────────────────────── */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 16px;
  margin: 4px 0 16px;
}
.page-head > div:first-child {
  min-width: 0;
  flex: 1 1 260px;
}
.page-head p {
  margin: 0;
  color: var(--muted);
}
.back {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 0.875rem;
  color: var(--muted);
  text-decoration: none;
}
.back:hover {
  color: var(--brand);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* ── panels and layout helpers ───────────────────────────────────────── */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  padding: 16px;
  margin-bottom: 16px;
  min-width: 0;
}
.panel > h2:first-child,
.panel > h3:first-child {
  margin-bottom: 0.75rem;
}
.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.panel-head h2,
.panel-head h3 {
  margin: 0;
}
.panel.flush {
  padding: 0;
  overflow: hidden;
}
.panel.quiet {
  background: var(--surface-2);
}
.note {
  border-left: 3px solid var(--brand);
  background: var(--brand-tint);
  padding: 10px 12px;
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
  margin-bottom: 12px;
}
.note.warn {
  border-color: var(--warn-mark);
  background: var(--warn-tint);
}
.note.danger {
  border-color: var(--danger-mark);
  background: var(--danger-tint);
}
.note.good {
  border-color: var(--good-mark);
  background: var(--good-tint);
}
.note p:last-child {
  margin-bottom: 0;
}
.grid-2,
.grid-3 {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 720px) {
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .panel {
    padding: 20px;
  }
}
@media (min-width: 1100px) {
  .split {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr);
    gap: 16px;
    align-items: start;
  }
}
.stack > * + * {
  margin-top: 12px;
}
.row-gap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* ── buttons ─────────────────────────────────────────────────────────── */
.btn,
button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-control);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  max-width: 100%;
}
.btn:hover {
  border-color: var(--brand);
  color: var(--ink);
}
.btn-primary,
button.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
}
.btn-primary:hover {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  color: var(--on-brand);
}
.btn-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--brand);
}
.btn-quiet:hover {
  background: var(--brand-tint);
  border-color: transparent;
  color: var(--brand);
}
.btn-danger {
  color: var(--danger);
  border-color: var(--danger-mark);
}
.btn-danger:hover {
  background: var(--danger-tint);
  border-color: var(--danger-mark);
  color: var(--danger);
}
.btn-small {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.875rem;
}
.btn-block {
  width: 100%;
}
.btn[disabled],
button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn .kbd {
  display: none;
}
@media (hover: hover) and (min-width: 960px) {
  .btn .kbd {
    display: inline-block;
    padding: 0 5px;
    border-radius: 4px;
    border: 1px solid currentColor;
    font-size: 0.6875rem;
    line-height: 16px;
    opacity: 0.7;
  }
}
.link-button {
  background: none;
  border: 0;
  padding: 0;
  color: var(--brand);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── badges, chips, scores ───────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  background: var(--muted-tint);
  color: var(--muted);
}
.tone-brand {
  background: var(--brand-tint);
  color: var(--brand);
}
.tone-good {
  background: var(--good-tint);
  color: var(--good);
}
.tone-warn {
  background: var(--warn-tint);
  color: var(--warn);
}
.tone-danger {
  background: var(--danger-tint);
  color: var(--danger);
}
.tone-muted {
  background: var(--muted-tint);
  color: var(--muted);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 550;
}
.chip:hover {
  border-color: var(--brand);
  color: var(--ink);
}
.chip[aria-current="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
}
.chip .n {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  opacity: 0.8;
}
.reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}
.reasons li {
  font-size: 0.8125rem;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
}
.reasons li.ok {
  color: var(--good);
  border-color: transparent;
  background: var(--good-tint);
}
.reasons li.no {
  color: var(--danger);
  border-color: transparent;
  background: var(--danger-tint);
}
.score {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  font-family: var(--font-display);
  font-weight: 680;
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
  background: var(--muted-tint);
  color: var(--muted);
}
.score.good {
  background: var(--good-tint);
  color: var(--good);
}
.score.warn {
  background: var(--warn-tint);
  color: var(--warn);
}
.score.big {
  width: 64px;
  height: 64px;
  font-size: 1.75rem;
  border-radius: 14px;
}

/* ── lists of people, jobs, runs ─────────────────────────────────────── */
.list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.list > li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  min-width: 0;
}
.list > li:first-child {
  border-top: 0;
}
.list .grow {
  flex: 1 1 auto;
  min-width: 0;
}
.list .title {
  font-weight: 620;
  color: var(--ink);
  text-decoration: none;
  overflow-wrap: anywhere;
}
a.title:hover {
  color: var(--brand);
}
.list .meta {
  color: var(--muted);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}
.list .side {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  text-align: right;
}
.list input[type="checkbox"] {
  margin-top: 4px;
}
.empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
}
.empty h2,
.empty h3 {
  color: var(--ink);
}
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
  color: var(--muted);
}
.stats b {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-weight: 640;
}

/* figures: a row of headline numbers */
.figures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
  overflow: hidden;
  margin-bottom: 16px;
}
.figures li {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  min-width: 0;
}
.figures li:nth-child(-n + 2) {
  border-top: 0;
}
.figures li:nth-child(2n + 1) {
  border-left: 0;
}
.figures .v {
  display: block;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.figures .k {
  display: block;
  color: var(--muted);
  font-size: 0.8125rem;
}
@media (min-width: 720px) {
  .figures {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .figures li:nth-child(-n + 4) {
    border-top: 0;
  }
  .figures li:nth-child(2n + 1) {
    border-left: 1px solid var(--line);
  }
  .figures li:nth-child(4n + 1) {
    border-left: 0;
  }
}

/* meters: spend against budget, sends against caps */
.meter {
  margin: 10px 0;
}
.meter .label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.875rem;
}
.meter .label b {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
}
.bar {
  height: 8px;
  border-radius: 4px;
  background: var(--muted-tint);
  overflow: hidden;
  margin-top: 4px;
}
.bar > span {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--brand);
  max-width: 100%;
}
.bar.warn > span {
  background: var(--warn-mark);
}
.bar.danger > span {
  background: var(--danger-mark);
}

/* tables that turn into stacked rows on phones */
.rtable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
.rtable th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.8125rem;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
.rtable td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
}
.rtable tr:last-child td {
  border-bottom: 0;
}
.rtable .r {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 719px) {
  .rtable thead {
    display: none;
  }
  .rtable,
  .rtable tbody,
  .rtable tr,
  .rtable td {
    display: block;
    width: 100%;
  }
  .rtable tr {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
  }
  .rtable tr:last-child {
    border-bottom: 0;
  }
  .rtable td {
    border: 0;
    padding: 2px 16px;
    display: flex;
    gap: 12px;
    justify-content: space-between;
  }
  .rtable td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.8125rem;
    flex: none;
  }
  .rtable td:not([data-label])::before,
  .rtable td[data-label=""]::before {
    content: none;
  }
  .rtable td.first {
    font-weight: 600;
  }
  .rtable .r {
    text-align: right;
  }
}

/* ── forms ───────────────────────────────────────────────────────────── */
.field {
  margin-bottom: 14px;
  min-width: 0;
}
.field > label,
.field > .label {
  display: block;
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 4px;
}
.field .help {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8125rem;
}
.field .errorlist,
.errorlist {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  color: var(--danger);
  font-size: 0.875rem;
  font-weight: 550;
}
.errorlist.nonfield {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-control);
  background: var(--danger-tint);
}
input[type="text"],
input[type="search"],
input[type="email"],
input[type="url"],
input[type="number"],
input[type="password"],
input[type="tel"],
input[type="file"],
select,
textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: var(--radius-control);
  border: 1px solid var(--line-strong);
  background: var(--field-bg);
  color: var(--ink);
  font: inherit;
  font-size: 1rem; /* 16px stops phones zooming in on focus */
}
textarea {
  resize: vertical;
  line-height: 1.45;
}
input[type="file"] {
  padding: 8px;
}
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235d6878' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--focus);
}
.field.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.field.check > label {
  font-weight: 550;
  margin: 0;
}
.field.check .help {
  margin-top: 0;
}
input[type="checkbox"],
input[type="radio"] {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  flex: none;
  accent-color: var(--brand);
}
.has-error input,
.has-error select,
.has-error textarea {
  border-color: var(--danger-mark);
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}
.inline-form .field {
  margin: 0;
  flex: 1 1 180px;
}
.searchbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.searchbar input[type="search"],
.searchbar input[type="text"] {
  flex: 1 1 220px;
  width: auto;
}
.searchbar select {
  flex: 1 1 150px;
  width: auto;
}
fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
legend {
  font-weight: 620;
  font-family: var(--font-display);
  margin-bottom: 8px;
}
.counter {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  font-size: 0.8125rem;
  color: var(--muted);
}
.counter .n {
  font-variant-numeric: tabular-nums;
}
.counter.over {
  color: var(--danger);
  font-weight: 600;
}
details > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--brand);
  min-height: 32px;
  list-style-position: inside;
}
details[open] > summary {
  margin-bottom: 8px;
}

/* ── flash messages ──────────────────────────────────────────────────── */
.flash {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}
.flash li {
  padding: 10px 14px;
  border-radius: var(--radius-control);
  margin-bottom: 6px;
  background: var(--brand-tint);
  color: var(--ink);
  border-left: 3px solid var(--brand);
}
.flash li.success {
  background: var(--good-tint);
  border-color: var(--good-mark);
}
.flash li.warning {
  background: var(--warn-tint);
  border-color: var(--warn-mark);
}
.flash li.error {
  background: var(--danger-tint);
  border-color: var(--danger-mark);
}

/* ── job header tabs ─────────────────────────────────────────────────── */
.job-head {
  margin-bottom: 12px;
}
.job-head h1 {
  overflow-wrap: anywhere;
}
.job-head .meta {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 12px 0 16px;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.tabs a {
  flex: 1 1 auto;
  text-align: center;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  white-space: nowrap;
}
.tabs a:hover {
  color: var(--ink);
  background: var(--surface-2);
}
.tabs a[aria-current="page"] {
  background: var(--brand-tint);
  color: var(--brand);
}
.tabs .n {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  margin-left: 4px;
}

/* ── the send queue card: the screen people use most ─────────────────── */
.queue-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.queue-filters select {
  flex: 1 1 160px;
  width: auto;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  max-width: 760px;
}
.card-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: 0.875rem;
}
.step-name {
  font-weight: 650;
  color: var(--brand);
}
.card-person {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
}
.card-person .who {
  flex: 1 1 auto;
  min-width: 0;
}
.card-person h2 {
  font-size: 1.375rem;
  margin: 0 0 2px;
  overflow-wrap: anywhere;
}
.card-person .headline {
  margin: 0;
  overflow-wrap: anywhere;
}
.card-person .where {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}
.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0 16px 8px;
}
.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 16px 40px;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 0.875rem;
  background: var(--brand-tint);
  color: var(--brand);
}
.steps > li::after {
  content: "";
  position: absolute;
  left: 13.5px;
  top: 32px;
  bottom: 4px;
  width: 1px;
  background: var(--line);
}
.steps > li:last-child::after {
  display: none;
}
.steps > li.done::before {
  content: "✓";
  background: var(--good-tint);
  color: var(--good);
}
.steps .step-title {
  font-weight: 620;
  margin: 3px 0 8px;
}
.steps textarea {
  font-size: 0.9375rem;
  background: var(--surface-2);
}
.card-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.card-foot .spacer {
  flex: 1 1 auto;
}
.caps-line {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 0.8125rem;
  color: var(--muted);
}
.caps-line b {
  color: var(--ink);
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
}
.done-banner {
  margin-bottom: 12px;
  max-width: 760px;
}

/* ── sign-in: the portal's indigo band with the bridge across it ─────── */
.signin {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}
.signin-band {
  position: relative;
  background: var(--hero);
  color: #fff;
  padding: 28px 24px 84px;
  overflow: hidden;
}
.signin-band .brand-name {
  color: #fff;
}
.signin-band .brand-name span {
  color: rgba(255, 255, 255, 0.72);
}
.signin-band h1 {
  margin: 28px 0 6px;
  font-size: 1.75rem;
  max-width: 18ch;
}
.signin-band p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  max-width: 36ch;
}
.signin-band .bridge {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 90px;
  color: rgba(255, 255, 255, 0.28);
}
.signin-card {
  position: relative;
  align-self: start;
  width: min(420px, calc(100% - 32px));
  margin: -48px auto 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px 20px;
}
.signin-card h2 {
  font-size: 1.25rem;
}
@media (min-width: 960px) {
  .signin {
    grid-template-rows: none;
    grid-template-columns: minmax(0, 1.1fr) minmax(420px, 1fr);
  }
  .signin-band {
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
  }
  .signin-band h1 {
    margin-top: auto;
    font-size: 2.5rem;
  }
  .signin-band p {
    margin-bottom: 140px;
    font-size: 1.0625rem;
  }
  .signin-band .bridge {
    height: 150px;
  }
  .signin-card {
    margin: auto;
    align-self: center;
    width: 400px;
    padding: 32px 28px;
  }
}

/* ── misc ────────────────────────────────────────────────────────────── */
.kv {
  display: grid;
  grid-template-columns: minmax(0, 9rem) minmax(0, 1fr);
  gap: 6px 12px;
  margin: 0;
}
.kv dt {
  color: var(--muted);
  font-size: 0.875rem;
}
.kv dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.timeline li {
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
}
.timeline li:first-child {
  border-top: 0;
}
.timeline .when {
  color: var(--muted);
  font-size: 0.8125rem;
}
.timeline .text {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-control);
  background: var(--surface-2);
  border: 1px solid var(--line);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.875rem;
}
.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
}
.query-text {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}
.more-list a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  color: var(--ink);
  text-decoration: none;
  border-top: 1px solid var(--line);
  font-weight: 550;
}
.more-list a:first-child {
  border-top: 0;
}
.more-list a:hover {
  background: var(--surface-2);
}
.more-list .muted {
  font-weight: 400;
  font-size: 0.875rem;
}
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  vertical-align: -2px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.htmx-request .htmx-hide-busy {
  opacity: 0.5;
}
@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 3s;
  }
  * {
    scroll-behavior: auto !important;
  }
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottom-nav) + 16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 40;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--night);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  max-width: calc(100% - 32px);
}
@media (min-width: 960px) {
  .toast {
    bottom: 24px;
  }
}
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  margin-right: 6px;
}
.dot.good {
  background: var(--good-mark);
}
.dot.warn {
  background: var(--warn-mark);
}
.dot.danger {
  background: var(--danger-mark);
}

.btn[aria-pressed="true"] {
  border-color: var(--brand);
  background: var(--brand-tint);
  color: var(--brand);
}

/* "Must match" on a job's requirements: tick-boxes as pills, easy to hit on a phone. */
.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 8px;
}
.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 550;
  cursor: pointer;
}
.check-pill input[type="checkbox"],
.check-pill input[type="radio"] {
  margin: 0;
}
.check-pill:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-tint);
}
.check-pill:has(input:focus-visible) {
  box-shadow: var(--focus);
}

/* Back, at the top of every page below the main ones. */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  margin: -8px 0 4px -10px;
  padding: 0 12px 0 6px;
  border-radius: var(--radius-control);
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}
.back-link:hover {
  color: var(--ink);
  background: var(--surface-2);
}
.back-link:focus-visible {
  box-shadow: var(--focus);
  outline: none;
}
.back-link svg {
  width: 20px;
  height: 20px;
}
/* "Profile" on each person in a list: opens LinkedIn in a new tab. */
.profile-link svg {
  width: 16px;
  height: 16px;
}
.list .side .profile-link {
  min-height: 40px;
  white-space: nowrap;
}

/* "Found by which search" on a job's Candidates tab: a whole row of its own. */
.searchbar .search-pick {
  flex: 1 1 100%;
}

/* "What the search results say" under a person in a job's list: the row's full width. */
.list > li:has(> .row-more) {
  flex-wrap: wrap;
}
.list > li > .row-more {
  flex: 1 1 100%;
  min-width: 0;
  margin-top: -4px;
}
.row-more summary {
  cursor: pointer;
  color: var(--brand);
  font-weight: 600;
  font-size: 0.9rem;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}
.row-more p {
  margin: 4px 0;
  font-size: 0.9rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}
