/* ==========================================================================
   NaukariDesk — design system
   Restyled to the brighter, glass-forward identity while keeping every
   selector, layout rule and breakpoint the app's JS depends on unchanged.
   Only tokens (color/type/radius/shadow) and surface treatments moved; the
   register, verdict spine, window bar and dynamic --spine/--verdict-*
   custom properties app.js sets at runtime are untouched. See DESIGN.md.
   ========================================================================== */

/* --- tokens ------------------------------------------------------------ */

:root {
  --paper:        #F6F8FD;
  --paper-2:      #EEF1FB;
  --raised:       #FFFFFF;
  --ink:          #12172C;
  --ink-2:        #3A4160;
  --muted:        #575E78;
  --rule:         #E3E7F6;
  --rule-strong:  #C7CCE3;

  --gold:         #E2861F;
  --gold-tint:    rgba(226, 134, 31, .14);

  --go:           #0C9A70;
  --go-tint:      rgba(12, 154, 112, .12);
  --check:        #A85F0C;
  --check-tint:   rgba(168, 95, 12, .12);
  --stop:         #D34438;
  --stop-tint:    rgba(211, 68, 56, .12);
  --neutral-tint: var(--paper-2);

  --focus:        #2B5CE6;

  --glass-border: rgba(23, 29, 56, .09);
  --shadow-sm:    0 1px 1px rgba(18, 23, 44, .04), 0 8px 18px -10px rgba(18, 23, 44, .18);
  --shadow:       0 1px 1px rgba(18, 23, 44, .04), 0 20px 40px -18px rgba(18, 23, 44, .28);

  /* major third, 16px base */
  --t-xs:   0.8125rem;   /* 13 */
  --t-sm:   0.875rem;    /* 14 */
  --t-base: 1rem;        /* 16 */
  --t-md:   1.25rem;     /* 20 */
  --t-lg:   1.5625rem;   /* 25 */
  --t-xl:   1.95rem;     /* 31 */

  --sans: "Public Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Fraunces", ui-serif, Georgia, "Times New Roman", serif;

  --measure: 68ch;
  --shell: 940px;

  /* Radii vary by hierarchy on purpose: records are flush inside their
     container, controls are gently rounded, overlays more so. Rounder than
     the previous document-style pass, to read as the softer, glassier
     identity. */
  --r-control: 10px;
  --r-panel: 18px;

  --tap: 44px;
}

/* --- reset ------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-base);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Soft drifting colour behind the glass surfaces — the one place the new
   identity is purely decorative. Fixed + z-index:-1 + pointer-events:none
   so it never affects layout or intercepts input. */
body::before, body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .55;
  pointer-events: none;
}
body::before {
  width: 46vw; height: 46vw; top: -18vw; right: -14vw;
  background: radial-gradient(circle, #FFD9A0, transparent 72%);
  animation: drift1 30s ease-in-out infinite alternate;
}
body::after {
  width: 40vw; height: 40vw; bottom: -16vw; left: -12vw;
  background: radial-gradient(circle, #C3D0F7, transparent 72%);
  animation: drift2 36s ease-in-out infinite alternate;
}
@keyframes drift1 { from { transform: translate(0,0); } to { transform: translate(-4vw, 3vw); } }
@keyframes drift2 { from { transform: translate(0,0); } to { transform: translate(3vw, -4vw); } }

@media (prefers-reduced-motion: reduce) {
  body::before, body::after, * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.25;
  margin: 0;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

p { margin: 0; }
ul, ol { margin: 0; padding: 0; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; }
a { color: var(--check); }

svg { display: block; flex-shrink: 0; }

/* --- focus ------------------------------------------------------------- */
/* One blue, used for focus and nothing else, so a focus ring is never
   mistaken for a verdict colour. */

:focus { outline: none; }

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

.skip-link {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--r-control);
  font-size: var(--t-sm);
  font-weight: 600;
  transition: top .15s ease;
}
.skip-link:focus { top: 8px; }

.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;
}

/* --- shell ------------------------------------------------------------- */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: 16px;
}

@media (min-width: 720px) {
  .shell { padding-inline: 24px; }
}

/* --- masthead ---------------------------------------------------------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--glass-border);
}

.masthead__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  min-width: 0;
}

.brand__seal {
  width: 32px; height: 32px;
  flex-shrink: 0;
}

.brand__name {
  font-family: var(--serif);
  font-size: var(--t-md);
  font-weight: 600;
  letter-spacing: -0.015em;
  white-space: nowrap;
}
.brand__name b { font-weight: 600; color: var(--gold); }

.brand__tagline {
  display: none;
  font-size: var(--t-xs);
  color: var(--muted);
  font-style: italic;
  font-family: var(--serif);
}
@media (min-width: 860px) { .brand__tagline { display: block; } }

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

.icon-btn {
  position: relative;
  width: var(--tap); height: var(--tap);
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-control);
  color: var(--ink-2);
  transition: background-color .12s ease, color .12s ease;
}
.icon-btn:hover { background: var(--neutral-tint); color: var(--ink); }
.icon-btn[aria-pressed="true"] { color: var(--gold); background: var(--gold-tint); }

.icon-btn__count {
  position: absolute; top: 4px; right: 4px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px;
  background: var(--gold); color: #fff;
  font-size: 10px; font-weight: 600; line-height: 17px;
  text-align: center;
}

/* Mobile search toggle only exists as a control below the desktop
   breakpoint, where the inline search field is hidden entirely. */
#mobileSearchToggle { display: inline-flex; }
@media (min-width: 720px) { #mobileSearchToggle { display: none; } }

.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-weight: 600;
  font-size: var(--t-sm);
  flex-shrink: 0;
}

.min-w-0 { min-width: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 18px;
  border-radius: var(--r-control);
  font-size: var(--t-sm);
  font-weight: 600;
  border: 1px solid transparent;
  transition: background-color .12s ease, border-color .12s ease, filter .12s ease;
  text-decoration: none;
}
.btn--primary { background: var(--gold); color: #2A1500; }
.btn--primary:hover { filter: brightness(1.06); }
.btn--secondary { background: var(--raised); color: var(--ink); border-color: var(--glass-border); box-shadow: var(--shadow-sm); }
.btn--secondary:hover { background: var(--neutral-tint); }
.btn--quiet { color: var(--ink-2); }
.btn--quiet:hover { background: var(--neutral-tint); }
.btn--block { width: 100%; }
.btn[aria-disabled="true"],
.btn:disabled {
  background: var(--neutral-tint);
  color: var(--muted);
  border-color: transparent;
  cursor: not-allowed;
  pointer-events: none;
}

.btn--compact { min-height: 36px; padding: 0 12px; font-size: var(--t-xs); }

/* --- search ------------------------------------------------------------ */

.search {
  position: relative;
  display: none;
  width: 240px;
}
@media (min-width: 720px) { .search { display: block; } }

.search__icon {
  position: absolute; left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}

.field {
  width: 100%;
  min-height: var(--tap);
  padding: 8px 12px;
  background: var(--raised);
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-control);
  color: var(--ink);
  font-size: var(--t-sm);
}
.field::placeholder { color: var(--muted); }
.field:focus-visible { border-color: var(--focus); outline-offset: 0; }

.search .field { padding-left: 34px; }

.search-drawer { padding-bottom: 12px; }
.search-drawer[hidden] { display: none; }
@media (min-width: 720px) { .search-drawer { display: none; } }

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

.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--rule);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  position: relative;
  padding: 12px 12px 11px;
  white-space: nowrap;
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--gold);
}

/* --- stats bar ----------------------------------------------------------- */

.stats-bar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin-top: 20px;
  background: var(--glass-border);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-panel);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
@media (min-width: 640px) { .stats-bar { grid-template-columns: repeat(4, 1fr); } }

.stat-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, .7);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
}
.stat-tile__value {
  font-family: var(--serif);
  font-size: var(--t-xl);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.stat-tile__label {
  font-size: var(--t-xs);
  color: var(--muted);
}

/* --- status line (the page's opening statement) ------------------------ */

.status-line {
  padding: 20px 0 18px;
  border-bottom: 1px solid var(--rule);
}

.status-line__headline {
  font-family: var(--serif);
  font-size: var(--t-lg);
  max-width: var(--measure);
  text-wrap: balance;
}

.status-line__detail {
  margin-top: 6px;
  font-size: var(--t-sm);
  color: var(--muted);
  max-width: var(--measure);
}

.status-line__action { margin-top: 14px; }

/* --- filters ----------------------------------------------------------- */

.filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 14px 0 12px;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }

.chip {
  padding: 7px 14px;
  min-height: 36px;
  white-space: nowrap;
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  background: rgba(255, 255, 255, .6);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: var(--t-xs);
  font-weight: 500;
  color: var(--ink-2);
  transition: background-color .12s ease, color .12s ease, border-color .12s ease;
}
.chip:hover { background: var(--raised); }
.chip[aria-pressed="true"] {
  background: var(--gold);
  border-color: var(--gold);
  color: #2A1500;
}

.list-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  font-size: var(--t-sm);
  color: var(--muted);
}

.list-bar__count { color: var(--ink-2); }

.sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sort select {
  min-height: 36px;
  padding: 4px 8px;
  background: var(--raised);
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-control);
  font-size: var(--t-xs);
  font-weight: 500;
}

/* --- the register ------------------------------------------------------ */

.register {
  border: 1px solid var(--glass-border);
  border-radius: var(--r-panel);
  background: rgba(255, 255, 255, .68);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  backdrop-filter: blur(24px) saturate(150%);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.record {
  position: relative;
  display: grid;
  gap: 4px 20px;
  padding: 18px 18px 18px 22px;
  border-top: 1px solid var(--rule);
  cursor: pointer;
  transition: background-color .12s ease;
}
.record:first-child { border-top: none; }
.record:hover { background: rgba(255, 255, 255, .55); }

/* The verdict spine. Scanning the left edge of the register tells you which
   records are worth reading before reading any of them. */
.record::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--spine, var(--rule-strong));
}

.record--closed { background: rgba(238, 241, 251, .55); }
.record--closed .record__title,
.record--closed .record__meta { color: var(--muted); }

.record__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.record__body { min-width: 0; flex: 1; }

.record__meta {
  font-size: var(--t-xs);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.record__title {
  font-size: var(--t-md);
  margin-top: 2px;
  max-width: var(--measure);
  text-wrap: pretty;
}

/* The title is a real <button>, not a styled div — it's the row's actual
   keyboard/AT-accessible trigger, so heading navigation ("jump by H key")
   keeps working, unlike a role="button" wrapper around the whole row would
   allow. The plain .record div also carries the same data-action, purely
   for mouse/touch users clicking empty row space; it carries no ARIA role. */
.record__title-btn {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.record__title-btn:hover { text-decoration: underline; text-decoration-color: var(--rule-strong); }

.record__verdict {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--verdict-fg, var(--muted));
}

.record__verdict-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.record__reason {
  font-weight: 400;
  color: var(--muted);
}

/* --- application window bar -------------------------------------------- */
/* The one place boldness is spent. Marker position is real data: it shows
   how far through the application window today falls, which also answers
   "have applications opened yet" — something the old design could not say. */

.window {
  margin-top: 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  max-width: 520px;
}

.window__date {
  font-size: var(--t-xs);
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.window__track {
  position: relative;
  height: 3px;
  background: var(--rule);
  border-radius: 2px;
}

.window__fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  border-radius: 2px;
  background: var(--spine, var(--rule-strong));
  width: var(--progress, 0%);
}

.window__marker {
  position: absolute;
  top: 50%;
  left: var(--progress, 0%);
  width: 11px; height: 11px;
  margin-left: -5.5px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--raised);
  border: 3px solid var(--spine, var(--rule-strong));
}

.window__remaining {
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.window__remaining--urgent { color: var(--stop); }

/* The single orchestrated motion: markers travel from the opening date to
   today once on first paint, which teaches the bar without a caption. */
@media (prefers-reduced-motion: no-preference) {
  .register--animate .window__fill,
  .register--animate .window__marker {
    animation: window-settle .6s cubic-bezier(.22, .61, .36, 1) both;
  }
}

@keyframes window-settle {
  from { width: 0; left: 0; }
}

.record__aside {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.record__posts {
  font-size: var(--t-sm);
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}

@media (min-width: 720px) {
  .record { grid-template-columns: 1fr auto; }
  .record__aside { grid-column: 2; grid-row: 1; align-items: center; }
}

/* --- job cards ----------------------------------------------------------- */
/* The vacancies/matched grid — individual glass cards rather than the flush
   ledger rows above. Shares .record__verdict, .window* and .btn/.icon-btn
   with the register (buildVacancyRecord() in app.js emits both from the
   same data), so a verdict or countdown reads identically everywhere. */

.job-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}
@media (min-width: 720px)  { .job-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .job-grid { grid-template-columns: repeat(3, 1fr); } }

.job-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 18px 20px;
  cursor: pointer;
  background: rgba(255, 255, 255, .68);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-top: 3px solid var(--spine, var(--rule-strong));
  border-radius: var(--r-panel);
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease;
}
@media (hover: hover) and (pointer: fine) {
  .job-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
}
.job-card:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.job-card--closed { opacity: .72; }

.job-card__badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }

.badge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge--neutral { background: var(--neutral-tint); color: var(--ink-2); }
.badge--go      { background: var(--go-tint);      color: var(--go); }
.badge--check   { background: var(--check-tint);   color: var(--check); }
.badge--stop    { background: var(--stop-tint);    color: var(--stop); }

.job-card__title { font-size: var(--t-md); margin-bottom: 2px; text-wrap: pretty; }
.job-card__title-btn { display: block; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.job-card__title-btn:hover { text-decoration: underline; text-decoration-color: var(--rule-strong); }

.job-card__org { color: var(--muted); font-size: var(--t-sm); margin-bottom: 4px; }

.job-card__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px 16px;
  margin: 8px 0 2px;
  font-size: var(--t-sm);
}
.job-card__meta-label {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 2px;
}

.job-card__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
}
.job-card__view { gap: 6px; }

/* --- notices, empty states --------------------------------------------- */

.notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 16px;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-panel);
  background: var(--neutral-tint);
  font-size: var(--t-sm);
  color: var(--ink-2);
}

.link-btn {
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
}

.empty {
  padding: 56px 24px;
  text-align: center;
  border: 1px dashed var(--rule-strong);
  border-radius: var(--r-panel);
  background: rgba(255, 255, 255, .4);
}
.empty h2 { font-size: var(--t-md); }
.empty p { margin-top: 6px; color: var(--muted); font-size: var(--t-sm); }
.empty__action { margin-top: 16px; }

/* --- generic panels (admit cards, results, keys) ------------------------ */

.panel-grid { display: grid; gap: 14px; }
@media (min-width: 720px) { .panel-grid { grid-template-columns: 1fr 1fr; } }

.panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  background: rgba(255, 255, 255, .68);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-panel);
  box-shadow: var(--shadow-sm);
}
.panel__title { font-size: var(--t-md); }
.panel__meta { font-size: var(--t-xs); color: var(--muted); }
.panel__row {
  display: flex; justify-content: space-between; gap: 12px;
  padding-top: 10px; border-top: 1px solid var(--rule);
  font-size: var(--t-sm);
}
.panel__row dt { color: var(--muted); }
.panel__row dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.panel__actions { margin-top: auto; padding-top: 4px; }

/* --- tags -------------------------------------------------------------- */

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: var(--t-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  border: 1px solid transparent;
}
.tag--go      { background: var(--go-tint);      color: var(--go);      border-color: rgba(12,154,112,.25); }
.tag--check   { background: var(--check-tint);   color: var(--check);   border-color: rgba(168,95,12,.25); }
.tag--stop    { background: var(--stop-tint);    color: var(--stop);    border-color: rgba(211,68,56,.25); }
.tag--neutral { background: var(--neutral-tint); color: var(--ink-2);   border-color: var(--rule-strong); }

/* --- dialogs ----------------------------------------------------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  background: rgba(18, 23, 44, .5);
  backdrop-filter: blur(4px);
}
.overlay[hidden] { display: none; }

@media (min-width: 720px) {
  .overlay { align-items: center; padding: 32px; }
}

.dialog {
  width: 100%;
  max-width: 520px;
  margin: auto;
  background: rgba(255, 255, 255, .86);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-panel);
  box-shadow: 0 30px 60px -20px rgba(18, 23, 44, .4);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
  animation: dialog-in .22s cubic-bezier(.2, .7, .3, 1);
}
.dialog--wide { max-width: 720px; }

@media (prefers-reduced-motion: no-preference) {
  @keyframes dialog-in { from { transform: translateY(16px); opacity: 0; } }
}

.dialog__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--rule);
}
.dialog__title { font-size: var(--t-md); }
.dialog__sub { font-size: var(--t-xs); color: var(--muted); margin-top: 3px; }
.dialog__close { margin-left: auto; }

.dialog__body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  /* A flex item won't shrink below its content's min-content height unless
     min-height is 0, which stops overflow-y:auto from ever engaging. */
  min-height: 0;
}
/* Flex children default to flex-shrink:1, so in a short window the browser
   squashes these blocks below their content height and `overflow:hidden`
   clips the text (dates were cut in half). Keep every section at its natural
   height and let the body scroll instead. */
.dialog__body > * { flex-shrink: 0; }

.dialog__foot {
  padding: 16px 20px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* Full-width stacked actions on mobile; a row once there's space. */
@media (min-width: 560px) {
  .dialog__foot { flex-direction: row; flex-wrap: wrap; }
  .dialog__foot .btn { flex: 1 1 auto; }
  .dialog__foot .btn--primary { flex-grow: 2; }
}

/* --- verdict block in the job dialog ----------------------------------- */

.verdict {
  padding: 14px 16px;
  border: 1px solid var(--glass-border);
  border-left: 4px solid var(--spine, var(--rule-strong));
  border-radius: var(--r-control);
  background: var(--verdict-bg, var(--neutral-tint));
}
.verdict__title { font-size: var(--t-base); font-weight: 600; font-family: var(--sans); }
.verdict__reason { font-size: var(--t-sm); margin-top: 4px; color: var(--ink-2); max-width: var(--measure); }

.findings { list-style: none; margin-top: 12px; display: grid; gap: 8px; }
.finding {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 8px;
  font-size: var(--t-sm);
  line-height: 1.45;
}
.finding--blocker { color: var(--stop); }
.finding--warning { color: var(--check); }
.finding--info    { color: var(--muted); }

/* --- definition grid --------------------------------------------------- */

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-control);
  overflow: hidden;
  /* overflow:hidden clips the rows to the rounded corners, so never let this
     box be sized below its content or the values get sliced in half. */
  min-height: min-content;
}
@media (min-width: 560px) { .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.fact { background: var(--raised); padding: 10px 12px; }
.fact dt { font-size: var(--t-xs); color: var(--muted); }
.fact dd { margin: 2px 0 0; font-size: var(--t-sm); font-weight: 600; }

.prose-block {
  padding: 14px 16px;
  background: var(--paper-2);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-control);
}
.prose-block h3 { font-family: var(--sans); font-size: var(--t-sm); color: var(--muted); font-weight: 500; }
.prose-block p { margin-top: 5px; font-size: var(--t-sm); max-width: var(--measure); }

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

.form { display: grid; gap: 16px; }
.form__row { display: grid; gap: 16px; }
@media (min-width: 560px) { .form__row--split { grid-template-columns: 1fr 1fr; } }

.form__group { display: grid; gap: 6px; }
.form__label { font-size: var(--t-sm); font-weight: 600; }
.form__hint { font-size: var(--t-xs); color: var(--muted); }

.chip-set { display: flex; flex-wrap: wrap; gap: 6px; }

.checkbox {
  display: flex; align-items: center; gap: 10px;
  min-height: var(--tap);
  padding: 0 12px;
  background: var(--raised);
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-control);
  font-size: var(--t-sm);
}
.checkbox input { width: 18px; height: 18px; accent-color: var(--gold); }

.callout {
  padding: 12px 14px;
  border-radius: var(--r-control);
  font-size: var(--t-sm);
  border: 1px solid;
  max-width: var(--measure);
}
.callout--info  { background: var(--gold-tint); border-color: rgba(226,134,31,.3); color: #6B4E06; }
.callout--error { background: var(--stop-tint); border-color: rgba(211,68,56,.3); color: var(--stop); }
.callout strong { display: block; margin-bottom: 2px; }
.callout[hidden] { display: none; }

/* --- tracked applications ---------------------------------------------- */

.tracked {
  display: flex; flex-wrap: wrap; gap: 10px;
  align-items: center; justify-content: space-between;
  padding: 14px;
  background: var(--raised);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-control);
}
.tracked__ref { font-size: var(--t-xs); color: var(--muted); margin-top: 3px; }
.tracked__ref b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* --- toast ------------------------------------------------------------- */
/* Replaces alert(), which blocks the page and is unreadable to a screen
   reader in context. */

.toast-region {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 60;
  display: grid;
  gap: 8px;
  width: calc(100% - 32px);
  max-width: 420px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-control);
  background: var(--ink);
  color: #fff;
  font-size: var(--t-sm);
  box-shadow: 0 12px 30px -10px rgba(18, 23, 44, .5);
}
.toast--error { background: var(--stop); }

@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toast-in .2s ease both; }
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

/* --- footer ------------------------------------------------------------ */

.footer {
  margin-top: 56px;
  padding: 24px 0 32px;
  border-top: 1px solid var(--rule);
  font-size: var(--t-xs);
  color: var(--muted);
}
.footer__inner {
  display: flex; flex-wrap: wrap;
  gap: 10px 20px;
  align-items: center; justify-content: space-between;
}
.footer nav { display: flex; gap: 12px; }
.footer nav button {
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
}
.footer a, .footer button { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.footer a:hover, .footer button:hover { color: var(--ink); }

.main { flex: 1; padding-bottom: 24px; }

/* --- utilities --------------------------------------------------------- */

[hidden] { display: none !important; }
.stack { display: grid; gap: 14px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
