/* Talvanza Advisor — recruiter interface.

   Design intent: this is a working tool a recruiter opens forty times a day,
   not a landing page. Dense, quiet, fast to scan. The only colour that carries
   meaning is on the bands and the three evidence markers; everything else is
   deliberately grey so those read instantly. */

/* Talvanza Advisor — recruiter interface.

   Brand: deep teal system. White ground, black text, teal carrying the brand,
   green reserved for "verified". Design intent: a working tool a recruiter
   opens forty times a day — dense, quiet, fast to scan. Colour is used to mean
   something, never to decorate, so the bands and the three evidence markers
   read at a glance. */

:root {
  /* Brand */
  --primary:     #16697A;   /* trust + innovation — the brand colour */
  --primary-dark:#0D4A57;   /* text and emphasis on teal */
  --tint:        #E1F5EE;   /* soft teal backgrounds */
  --green:       #1D9E75;   /* verified / active. Never decorative. */

  --white:       #FFFFFF;
  --black:       #1A1A1A;
  --charcoal:    #2C2C2C;
  --gray-bg:     #F3F4F6;

  /* Applied */
  --ink:       var(--black);
  --muted:     #5A6570;
  --faint:     #8A939C;
  --line:      #DFE3E7;
  --line-soft: #EDEFF2;
  --paper:     var(--white);
  --card:      var(--white);

  --accent:      var(--primary);
  --accent-soft: var(--tint);

  /* Evidence markers, and the bands they roll up into */
  --met:       #157A5B;          /* darkened green — readable as body text */
  --met-soft:  var(--tint);
  --short:     #9A5A0B;
  --short-soft:#FBF1E3;
  --none:      #6C7482;

  --danger: #98261F;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --radius: 6px;
}

/* The brand sheet has a dark lockup, so dark mode is a brand variant rather
   than an inversion: charcoal ground, the green mark, teal lifted enough to
   stay legible on it. */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #F0F2F4; --muted: #9AA3AC; --faint: #7A838C;
    --line: #3A4046; --line-soft: #262B30;
    --paper: var(--black); --card: var(--charcoal);
    --accent: #4FA8BD; --accent-soft: #14323B;
    --met: var(--green); --met-soft: #10302A;
    --short: #D99F52; --short-soft: #2A2015;
    --none: #8B939C; --danger: #E4776E;
  }
}

* { box-sizing: border-box; }

/* The `hidden` attribute must actually hide things.

   The browser implements `hidden` as `display: none` in its own stylesheet,
   which ANY author `display` rule outranks. So `.modal { display: grid }` left
   the modal permanently on screen — an empty white card, and worse, a
   full-screen transparent overlay swallowing every click on the page.
   `#upload-actions` and the sign-in panel had the same fault.

   This one line is the fix, and it has to stay above everything that sets
   `display`. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

h1 { font-size: 1.4rem; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; margin: 0 0 .4rem; }
p { margin: 0 0 .8rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.dot { color: var(--faint); margin: 0 .4rem; }

/* ---- chrome ---- */

.bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .7rem 1.25rem;
  background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand {
  display: flex; align-items: center; gap: .55rem;
  font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent); font-size: .95rem; white-space: nowrap;
}
.brand span { color: var(--muted); font-weight: 500; letter-spacing: .02em; text-transform: none; }
.brand.big { font-size: 1.15rem; margin-bottom: .5rem; }
.mark { width: 1.5em; height: 1.5em; flex: none; }
.brand.big .mark { width: 1.9em; height: 1.9em; }
.bar-right { display: flex; align-items: center; gap: 1rem; }
.who { color: var(--muted); font-size: .88rem; }

.credits {
  font-family: var(--mono); font-size: .78rem;
  background: var(--accent-soft); color: var(--accent);
  padding: .2rem .55rem; border-radius: 999px; white-space: nowrap;
}
.credits.low { background: var(--short-soft); color: var(--short); }

main { max-width: 62rem; margin: 0 auto; padding: 1.5rem 1.25rem 5rem; }

.view-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.back { display: inline-block; margin-bottom: .9rem; }
.stack { display: flex; flex-direction: column; gap: .6rem; }
.empty { color: var(--muted); padding: 2rem 0; }

/* ---- controls ---- */

button { font: inherit; cursor: pointer; }

.primary {
  background: var(--accent); color: #fff; border: 0;
  padding: .6rem 1.1rem; border-radius: var(--radius); font-weight: 550;
}
.primary:hover { background: var(--primary-dark); }
.primary:disabled { opacity: .5; cursor: not-allowed; filter: none; }

.link {
  background: none; border: 0; color: var(--accent);
  padding: 0; font: inherit; text-decoration: underline;
  text-underline-offset: 2px;
}
.danger-link { background: none; border: 0; color: var(--danger); text-decoration: underline; text-underline-offset: 2px; font: inherit; padding: 0; }
.file-label { cursor: pointer; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* ---- forms ---- */

.form { display: flex; flex-direction: column; gap: 1.1rem; max-width: 42rem; margin-top: 1.2rem; }
.form label, .card label { display: flex; flex-direction: column; gap: .35rem; }
.form label > span, .card label > span { font-weight: 550; font-size: .92rem; }
.form small { color: var(--muted); font-size: .84rem; }
.form em { color: var(--muted); font-style: normal; font-weight: 400; }

input, textarea {
  font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: .55rem .7rem; width: 100%;
}
textarea { resize: vertical; line-height: 1.5; }

.error {
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  border-left: 3px solid var(--danger);
  padding: .7rem .9rem; border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .9rem;
}
.error ul { margin: .5rem 0 0; padding-left: 1.1rem; }
.error li { margin-bottom: .35rem; }

.notice { padding: .8rem 1rem; border-radius: var(--radius); font-size: .9rem; margin-bottom: 1rem; }
.notice.warn { background: var(--short-soft); color: var(--short); border-left: 3px solid var(--short); }

/* ---- cards ---- */

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem 1.1rem;
  display: flex; flex-direction: column; gap: .9rem;
}

.row {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .85rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap;
}
.row:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.row .title { font-weight: 550; }
.row .meta { color: var(--muted); font-size: .85rem; }
.row-main { min-width: 0; }
.clickable { cursor: pointer; text-align: left; width: 100%; border: 1px solid var(--line); }

/* ---- drop zone ---- */

.drop {
  border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 2.2rem 1rem; text-align: center; background: var(--card);
  margin-bottom: 1.2rem; transition: border-color .12s, background .12s;
}
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop small { color: var(--muted); display: block; margin-top: .4rem; }

/* ---- prepared document rows ---- */

.doc { display: flex; align-items: baseline; gap: .75rem; font-size: .9rem; }
.doc .name { font-weight: 550; }
.doc .stripped { font-family: var(--mono); font-size: .76rem; color: var(--muted); }
.doc .token { font-family: var(--mono); font-size: .72rem; color: var(--faint); margin-left: auto; }
.doc.bad { color: var(--short); }

.totals { color: var(--muted); font-size: .9rem; }
#upload-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.3rem; flex-wrap: wrap; }

/* ---- progress ---- */

.progress { height: 8px; background: var(--line-soft); border-radius: 999px; overflow: hidden; margin: 1.2rem 0 .5rem; }
.progress-fill { height: 100%; width: 0; background: var(--accent); transition: width .4s ease; }
.progress-label { font-family: var(--mono); font-size: .82rem; color: var(--muted); }

/* ---- results ---- */

.result { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.result-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; padding: .75rem 1rem; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap;
}
.result-name { font-weight: 600; }

.band {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .07em;
  text-transform: uppercase; padding: .22rem .55rem; border-radius: 3px; white-space: nowrap;
}
.band-strong          { background: var(--met-soft);   color: var(--met); }
.band-strong, .band-good { font-weight: 600; }
.band-good            { background: var(--met-soft);   color: var(--met); }
.band-partial         { background: var(--accent-soft); color: var(--accent); }
.band-limited         { background: var(--line-soft);  color: var(--none); }
.band-different_field { background: var(--line-soft);  color: var(--none); }

.evidence { list-style: none; margin: 0; padding: .7rem 1rem; display: flex; flex-direction: column; gap: .5rem; }
.evidence li { display: grid; grid-template-columns: 1.1rem 1fr; gap: .55rem; font-size: .9rem; line-height: 1.5; }
.evidence li::before { font-family: var(--mono); font-weight: 600; }
.evidence li.met::before  { content: "✓"; color: var(--met); }
.evidence li.part::before { content: "~"; color: var(--short); }
.evidence li.none::before { content: "✗"; color: var(--none); }
.evidence li.flag::before { content: "⚑"; color: var(--short); }
.evidence li.flag { color: var(--short); }

.source { color: var(--faint); font-size: .82rem; }

/* ---- sign in ---- */

.signin { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.signin .card { width: 100%; max-width: 23rem; }

/* ---- modal ---- */

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; padding: 1.5rem; z-index: 20; }
.modal-card { background: var(--card); border-radius: 8px; padding: 1.4rem; max-width: 30rem; width: 100%; }
.modal-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.1rem; }
.modal-actions button { flex: 1 1 auto; }
.secondary { background: var(--card); color: var(--ink); border: 1px solid var(--line); padding: .6rem 1.1rem; border-radius: var(--radius); font-weight: 550; }
.secondary:hover { border-color: var(--accent); color: var(--accent); }

/* ---- toast ---- */

.toast {
  position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--paper);
  padding: .6rem 1rem; border-radius: var(--radius); font-size: .9rem; z-index: 30;
}

@media (max-width: 34rem) {
  .doc .token { display: none; }
  main { padding: 1rem .9rem 4rem; }
}

/* ---- job description helpers ---- */

.jd-tools { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; margin-bottom: .1rem; }

.jd-saved {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  background: var(--met-soft); color: var(--met);
  border-radius: var(--radius); padding: .6rem .9rem;
  font-size: .9rem; margin-bottom: 1rem;
}
.jd-saved .tick { font-weight: 700; }
.jd-saved .link { color: inherit; }

.hint {
  margin-top: .4rem; font-size: .84rem;
  color: var(--short); background: var(--short-soft);
  padding: .4rem .6rem; border-radius: 4px;
}

.jd-view {
  white-space: pre-wrap; font-size: .88rem; line-height: 1.5;
  max-height: 22rem; overflow-y: auto;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .8rem; margin: 0;
}
.hint { width: 100%; }
.modal-card ul { margin: .5rem 0 .9rem; padding-left: 1.1rem; font-size: .9rem; }
.modal-card li { margin-bottom: .25rem; }

/* ---- tabs ---- */

.tabs { display: flex; gap: .25rem; margin-left: 1.5rem; flex: 1; }
.tab {
  background: none; border: 0; color: var(--muted);
  padding: .4rem .7rem; border-radius: var(--radius); font-weight: 550; font-size: .92rem;
}
.tab:hover { color: var(--ink); background: var(--line-soft); }
.tab.on { color: var(--accent); background: var(--accent-soft); }

.head-actions { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }

/* ---- market mapping ---- */

.headline {
  font-size: 1.05rem; line-height: 1.55; max-width: 46rem;
  border-left: 3px solid var(--accent); padding-left: .9rem; margin-bottom: 1.4rem;
}

.figures {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); overflow: hidden; margin-bottom: 1.8rem;
}
.fig { padding: .9rem 1rem; border-right: 1px solid var(--line-soft); }
.fig:last-child { border-right: 0; }
.fig dt {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: .2rem;
}
.fig dd { margin: 0; font-size: 1.5rem; font-variant-numeric: tabular-nums; }

.chart-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem; overflow-x: auto; }
.chart { width: 100%; height: auto; display: block; min-width: 30rem; }
.chart .grid { stroke: var(--line-soft); stroke-width: 1; }
.chart .axis { fill: var(--faint); font-size: 11px; font-family: var(--mono); }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .line-reviewed { stroke: var(--accent); }
.chart .line-strong { stroke: var(--met); }
.chart .area { fill: var(--accent); opacity: .07; }
.chart .dot { fill: var(--card); stroke-width: 2; }
.chart .dot-reviewed { stroke: var(--accent); }
.chart .dot-strong { stroke: var(--met); }

.legend { display: flex; gap: 1.2rem; font-size: .85rem; color: var(--muted); margin-top: .6rem; flex-wrap: wrap; }
.swatch { display: inline-block; width: .8rem; height: .2rem; border-radius: 2px; vertical-align: middle; margin-right: .35rem; }

.scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th, td { text-align: left; padding: .55rem .9rem; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
thead th {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted); font-weight: 500;
  border-bottom: 1px solid var(--line);
}
tbody tr:last-child td { border-bottom: 0; }
td.wrap { white-space: normal; min-width: 14rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.scarce-high { color: var(--short); font-weight: 600; }

/* ---- plan ---- */

.meter { height: 8px; background: var(--line-soft); border-radius: 999px; overflow: hidden; margin: .4rem 0 .3rem; }
.meter-fill { height: 100%; background: var(--accent); }
.meter-fill.low { background: var(--short); }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; }
.choice { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .3rem; }
.choice .chosen { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.modal-card label { display: flex; flex-direction: column; gap: .35rem; margin-top: 1rem; }
.modal-card label > span { font-weight: 550; font-size: .92rem; }
.disclosure {
  background: var(--line-soft); border-radius: var(--radius);
  padding: .6rem .8rem; font-size: .88rem; color: var(--muted); margin: 0;
}
.excerpt {
  font-family: var(--mono); font-size: .85rem;
  background: var(--gray-bg); border-left: 3px solid var(--accent);
  padding: .6rem .8rem; border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--ink);
}

/* ---- the location declaration ---- */

.attest {
  background: var(--tint); border-radius: var(--radius);
  padding: .9rem 1rem; display: flex; flex-direction: column; gap: .5rem;
}
.attest-check { display: grid !important; grid-template-columns: auto 1fr; gap: .6rem; align-items: start; }
.attest-check input { width: auto; margin-top: .2rem; accent-color: var(--primary); }
.attest-check span { font-weight: 500; font-size: .92rem; line-height: 1.5; }
.attest .muted { margin: 0; }

/* ---- seats ---- */

.seats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.seats li {
  display: grid; grid-template-columns: 1fr auto auto; gap: 1rem;
  align-items: baseline; padding: .6rem 0;
  border-bottom: 1px solid var(--line-soft); font-size: .92rem;
}
.seats li:last-child { border-bottom: 0; }
.seat-name { font-weight: 550; }
.seat-you {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .08em;
  text-transform: uppercase; background: var(--tint); color: var(--primary);
  padding: .1rem .4rem; border-radius: 3px; margin-left: .5rem;
}
.seat-role { color: var(--muted); font-size: .85rem; }
.seat-seen { color: var(--faint); font-size: .82rem; white-space: nowrap; }
.seat-empty .seat-name { font-weight: 400; color: var(--faint); font-style: italic; }

/* ---- plan tab spacing ---- */

#plan-body { display: flex; flex-direction: column; gap: 1.1rem; }
#plan-body > .muted { margin: 0; }

.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.card-head h2 { margin: 0; }
.small-btn { padding: .4rem .8rem; font-size: .88rem; }

.seats li {
  grid-template-columns: 1fr auto auto auto;
  padding: .7rem 0;
}
.seat-select {
  font: inherit; font-size: .85rem; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 4px; padding: .25rem .4rem; width: auto;
}
.seat-actions { display: flex; gap: .8rem; align-items: baseline; }
.tiny { font-size: .82rem; }

.password {
  font-family: var(--mono); font-size: 1.15rem; letter-spacing: .02em;
  background: var(--tint); color: var(--primary-dark);
  padding: .8rem 1rem; border-radius: var(--radius);
  text-align: center; user-select: all; margin: .8rem 0;
}

@media (max-width: 48rem) {
  .seats li { grid-template-columns: 1fr auto; row-gap: .3rem; }
  .seat-seen { grid-column: 1 / -1; }
}
.role-legend {
  list-style: none; margin: .8rem 0 0; padding: .8rem 0 0;
  border-top: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: .35rem;
  font-size: .85rem; color: var(--muted);
}
.role-legend strong { color: var(--ink); font-weight: 600; }
