/* The Jobs pages. They load the practice app's styles.css first (colours, buttons, top nav, page,
   callouts, toasts) and add their own pieces here. */

:root {
  --st-applied: #8fb0dc; --st-referred: #5fc8d2; --st-pending: #f0b452; --st-assessment: #fb9a5b;
  --st-scheduling: #f28dc0; --st-paperwork: #d9c75a; --st-expired: #b8a493; --st-interviewing: #b796f2;
  --st-offer: #5fcf8f; --st-accepted: #7fe0a6; --st-rejected: #f08a8a; --st-withdrawn: #a0a8b4; --st-other: #5fc8d2;
}

.jobs { display: flex; flex-direction: column; gap: 18px; }
.jobs > h1 { margin-bottom: 0; }
.jobs > p.lead { margin: 0 0 6px; max-width: 80ch; }
.jobs h2 { font-size: 16px; }
.jobs p { margin: 0; }
.jobs .small { font-size: 12.5px; }
.jobs .callout { margin: 0; }
.jobs :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.jobs input[type="text"], .jobs input[type="url"], .jobs input[type="search"], .jobs input[type="date"],
.jobs select, .jobs textarea {
  font: inherit; color: var(--text); background: var(--bg-input);
  border: 1px solid var(--border-strong); border-radius: 6px; padding: 6px 9px; min-width: 0;
}
.jobs textarea { width: 100%; resize: vertical; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; }
.jobs input:focus, .jobs select:focus, .jobs textarea:focus { border-color: var(--accent); outline: none; }
.jobs select:disabled { opacity: 0.6; }

a.button-like, label.button-like {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer;
  font: inherit; color: var(--text); background: var(--bg-elev-2);
  border: 1px solid var(--border-strong); border-radius: 6px; padding: 6px 12px;
}
a.button-like:hover, label.button-like:hover { border-color: var(--text-faint); text-decoration: none; }
a.button-like.primary, label.button-like.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
a.button-like.primary:hover, label.button-like.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }

.privacy-banner {
  display: flex; gap: 12px; align-items: center; padding: 12px 16px;
  border: 1px solid var(--pass); background: var(--pass-soft); border-radius: var(--radius);
}
.privacy-banner svg { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--pass); stroke-width: 2; stroke-linecap: round; }
.privacy-banner strong { color: var(--pass); }

.panel {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0;
}
.panel h2 + .setup-steps { margin-top: -4px; }
.setup-steps { margin: 0; padding-left: 22px; display: grid; gap: 10px; color: var(--text-dim); }
.setup-steps strong { color: var(--text); }
.setup-steps .copy-block { margin: 8px 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 12px; color: var(--text-dim); font-weight: 600; }
.field small { font-size: 12px; }
.check { display: flex; gap: 8px; align-items: flex-start; color: var(--text-dim); }
.check input { margin-top: 3px; accent-color: var(--accent); }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.settings-grid .wide { grid-column: 1 / -1; }

.copy-block { position: relative; background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px; }
.copy-block pre { padding: 10px 70px 10px 12px; font-size: 12.5px; line-height: 1.55; max-height: 360px; overflow: auto; color: var(--text); }
.copy-block button { position: absolute; top: 6px; right: 6px; }
.copy-block.prompt { border-color: var(--accent); }
.sub-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); margin: 6px 0 4px; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 8px; }

/* ---------- skills ---------- */
.skill-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr)); gap: 14px; }
.skill-card {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; min-width: 0; scroll-margin-top: 72px;
}
.skill-card:target, .skill-card.focus { border-color: var(--accent); }
.skill-card header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.skill-card h2 { font-size: 17px; }
.skill-card > p { color: var(--text-dim); }
.skill-name { color: var(--accent); }
.skill-card header .chip { margin-right: auto; }
.skill-card header h2 + .skill-name { margin-left: auto; }
.doc-list { margin: 6px 0; padding-left: 18px; display: grid; gap: 4px; }
.kit-download { margin-top: 8px; }
.fields { display: grid; gap: 10px; }
.prompt-area { display: flex; flex-direction: column; gap: 6px; margin-top: auto; }
.empty-prompt { border: 1px dashed var(--border-strong); border-radius: 6px; padding: 12px; color: var(--text-faint); font-size: 13px; }
.rules { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--text-dim); }

/* ---------- tracker: mail bar ---------- */
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.mailbar {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center;
}
.mailbar .what { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 320px; }
.mailbar .what b { font-weight: 600; }
.mailbar .what span { color: var(--text-dim); font-size: 12.5px; overflow-wrap: anywhere; }
.mailbar .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.bar { height: 6px; background: var(--bg-elev-2); border-radius: 3px; overflow: hidden; max-width: 520px; }
.bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width 0.2s; }

/* ---------- tracker: filters, charts ---------- */
.strip { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chipf {
  border-radius: 999px; padding: 5px 12px; gap: 8px; font-size: 13px;
  background: var(--bg-elev); border: 1px solid var(--border);
}
.chipf .n { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--text-dim); }
.chipf[aria-pressed="true"] { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--text-faint)); flex: none; }

.chart-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.chart-head p { color: var(--text-dim); font-size: 12.5px; }
.chart { width: 100%; height: 220px; overflow: visible; }
.chart text { font-family: var(--sans); fill: var(--text-dim); font-size: 11px; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-bar { fill: var(--accent); }
.chart .chart-value { fill: var(--text); font-weight: 600; text-anchor: middle; }
.chart-date { text-anchor: middle; }
.chart-empty { color: var(--text-dim); min-height: 160px; display: flex; align-items: center; justify-content: center; }
.sankey-panel svg { width: 100%; height: auto; overflow: visible; }
/* a halo in the panel's colour keeps labels readable where they cross a ribbon */
.sankey-panel text {
  font-family: var(--sans); fill: var(--text); font-size: 12px;
  paint-order: stroke; stroke: var(--bg-elev); stroke-width: 4px; stroke-linejoin: round;
}
.sankey-panel .sankey-label { fill: var(--text-dim); }

/* ---------- tracker: ledger ---------- */
.toolbar { display: flex; gap: 10px 12px; align-items: center; flex-wrap: wrap; }
.toolbar input[type="search"] { flex: 1 1 220px; }
.toolbar label { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.sortdir { min-width: 34px; justify-content: center; }
.sorth {
  all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
  font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; border-radius: 4px;
}
.sorth:hover, .sorth[aria-pressed="true"] { color: var(--text); }
.sorth .arr { font-size: 11px; opacity: 0.35; }
.sorth[aria-pressed="true"] .arr { opacity: 1; }

.ledger { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.lhead, .app > .summary {
  display: grid; grid-template-columns: minmax(0, 1.3fr) 11rem minmax(0, 2fr) 5.5rem;
  gap: 14px; align-items: center; padding: 11px 16px;
}
.lhead {
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); font-weight: 600;
  border-bottom: 1px solid var(--border); background: var(--bg-elev-2); padding-block: 8px;
}
.lhead .right { justify-self: end; }
.app { border-bottom: 1px solid var(--border); }
.app:last-child { border-bottom: 0; }
.app > .summary {
  width: 100%; text-align: left; background: none; border: 0; border-radius: 0; white-space: normal; color: var(--text);
}
.app > .summary:hover { background: var(--bg-elev-2); }
.who { min-width: 0; }
.who .co { font-weight: 600; overflow-wrap: anywhere; }
.who .pos { display: block; color: var(--text-dim); font-size: 13px; overflow-wrap: anywhere; }
.via { color: var(--text-faint); font-size: 11.5px; }
.prep-tag { display: block; margin-top: 3px; font-size: 11.5px; font-weight: 600; color: var(--accent); }
.chip.st {
  border: 0; border-radius: 6px; padding: 3px 8px; font-weight: 600; max-width: 100%;
  color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent);
}
.chip.st .dot { background: var(--c); }
.statuscell { display: flex; flex-direction: column; gap: 3px; min-width: 0; align-items: flex-start; }
.statuscell .item { font-size: 12px; color: var(--st-pending); overflow-wrap: anywhere; }
.ovr { font-size: 11px; color: var(--text-faint); }
.detail { font-size: 13.5px; min-width: 0; overflow-wrap: anywhere; }
.detail .subj { display: block; color: var(--text-faint); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.when { text-align: right; font-size: 12px; color: var(--text-dim); }
.when b { display: block; color: var(--text); font-weight: 500; }

.trail { padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 12px; background: var(--bg); border-top: 1px dashed var(--border); }
.tl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tl li {
  display: grid; grid-template-columns: 6.5rem 9.5rem minmax(0, 1fr) auto; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--border); align-items: baseline; font-size: 13px;
}
.tl li:last-child { border-bottom: 0; }
.tl .d { color: var(--text-dim); font-size: 12px; }
.tl .s { color: var(--text-faint); font-size: 12px; display: block; overflow-wrap: anywhere; }
.tl a { font-size: 12.5px; white-space: nowrap; }
.edit, .handoff { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.edit label, .handoff .lbl { font-size: 12.5px; color: var(--text-dim); min-width: 5.5rem; }
.handoff { padding-top: 12px; border-top: 1px solid var(--border); }
.handoff input[type="url"] { flex: 1 1 300px; }
.handoff + .handoff { border-top: 0; padding-top: 0; }

.empty-state { padding: 36px 20px; text-align: center; color: var(--text-dim); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.empty-state strong { color: var(--text); font-size: 16px; }
.empty-state p { max-width: 60ch; }
.foot { color: var(--text-faint); }

/* ---------- job finder ---------- */
.finder-filters { display: flex; flex-direction: column; gap: 10px; }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.kpi-label { font-size: 12.5px; color: var(--text-dim); }
.kpi b { font-size: 24px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12px; color: var(--text-faint); }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-dim); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-item i { width: 10px; height: 10px; border-radius: 2px; }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: rgba(255, 255, 255, 0.04); }
.hbars { display: flex; flex-direction: column; gap: 2px; }
.hbar {
  display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr) 2rem; align-items: center; gap: 10px;
  background: none; border: 0; border-radius: 6px; padding: 4px 6px; color: var(--text);
  font: inherit; font-size: 13px; text-align: left; cursor: pointer;
}
.hbar:hover, .hbar[aria-pressed="true"] { background: var(--bg-elev-2); }
.hbar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 12px; }
.hbar-track i { display: block; height: 100%; min-width: 2px; background: var(--accent); border-radius: 0 4px 4px 0; }
.hbar-n { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--text-dim); text-align: right; }
.table-wrap { overflow-x: auto; }
table.postings { width: 100%; border-collapse: collapse; font-size: 13px; }
.postings th {
  text-align: left; font-weight: 600; font-size: 12px; color: var(--text-dim);
  padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.postings td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.postings tr:last-child td { border-bottom: 0; }
.postings .t-role { min-width: 14rem; }
.postings .t-role a { font-weight: 600; }
.postings td .dot { display: inline-block; margin-right: 6px; vertical-align: 1px; }
.postings .mono { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.tag {
  display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 999px;
  border: 1px solid var(--border-strong); color: var(--text-dim); white-space: nowrap;
}
.tag.on { border-color: var(--pass); color: var(--pass); }
a.button-like.small { padding: 3px 9px; font-size: 12px; }
.searches { display: block; }
.searches summary { cursor: pointer; font-weight: 600; }
.searches ul { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 13px; }
.searches .dot { display: inline-block; margin-right: 6px; }
.warn-text { color: var(--warn); }
.viz-tip {
  position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none; max-width: 280px;
  background: var(--bg-elev-2); border: 1px solid var(--border-strong); border-radius: 6px;
  padding: 6px 9px; font-size: 12.5px; color: var(--text); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* ---------- home ---------- */
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.home-card {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; display: flex; flex-direction: column; gap: 10px; color: var(--text);
}
.home-card:hover { border-color: var(--accent); text-decoration: none; }
.home-card h2 { font-size: 19px; }
.home-card p { margin: 0; color: var(--text-dim); }
.home-card ul { margin: 0; padding-left: 18px; color: var(--text-dim); display: grid; gap: 4px; }
.home-card .go { color: var(--accent); font-weight: 600; margin-top: auto; }

@media (max-width: 760px) {
  .settings-grid, .two-col { grid-template-columns: minmax(0, 1fr); }
  .chart { height: auto; }
  .lhead { display: none; }
  .app > .summary {
    grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who when" "st st" "det det"; gap: 6px 12px;
  }
  .who { grid-area: who; }
  .statuscell { grid-area: st; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
  .detail { grid-area: det; }
  .when { grid-area: when; }
  .tl li { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "d a" "c c" "t t"; gap: 4px 10px; }
  .tl .d { grid-area: d; } .tl .c { grid-area: c; } .tl .t { grid-area: t; } .tl a { grid-area: a; }
  /* Job finder: each posting becomes a card, its button on the right */
  .postings thead { display: none; }
  .postings tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
  .postings tr:last-child { border-bottom: 0; }
  .postings td { grid-column: 1; padding: 0; border: 0; }
  .postings .t-role { min-width: 0; }
  .postings td:last-child { grid-column: 2; grid-row: 1 / span 6; align-self: center; }
  .hbar { grid-template-columns: minmax(0, 7rem) minmax(0, 1fr) 2rem; }
}
@media (prefers-reduced-motion: reduce) { .bar i { transition: none; } }
