:root {
  --navy-950: #061630;
  --navy-900: #0a2240;
  --navy-800: #11325e;
  --navy-700: #1a4378;
  --brand: #1d5299;
  --brand-hover: #17437f;
  --brand-soft: #eaf0f9;
  --brand-ring: rgba(29, 82, 153, 0.22);
  --gold: #c9a54c;

  --ink: #141c2b;
  --ink-2: #344055;
  --muted: #667085;
  --subtle: #98a2b3;
  --line: #e3e8ef;
  --line-strong: #cdd5e0;
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;

  --success: #0f7a4b;
  --success-soft: #e5f4ec;
  --good: #1d5299;
  --good-soft: #eaf0f9;
  --warning: #9a5b06;
  --warning-soft: #fdf2df;
  --danger: #b42318;
  --danger-soft: #fdecea;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.07), 0 6px 16px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 12px 32px rgba(10, 34, 64, 0.14);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink);
}

h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 20px; font-weight: 650; }
h3 { font-size: 16px; font-weight: 600; }

p { margin: 0; }

a {
  color: var(--brand);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; }
.spacer { flex: 1; }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  text-decoration: none !important;
}
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--brand-ring); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-hover); }
.btn-secondary { background: var(--surface); color: var(--ink-2); border-color: var(--line-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); border-color: var(--subtle); }
.btn-ghost { background: transparent; color: var(--brand); }
.btn-ghost:hover:not(:disabled) { background: var(--brand-soft); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: #f1c4bf; }
.btn-danger:hover:not(:disabled) { background: var(--danger-soft); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Cards & badges */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.card-body { padding: 22px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.8;
}
.badge.plain::before { display: none; }
.badge.tone-success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge.tone-good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.badge.tone-warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge.tone-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge.tone-neutral { background: #eef1f5; color: var(--ink-2); border-color: transparent; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.chip svg { width: 15px; height: 15px; color: var(--subtle); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: 14px; font-weight: 600; color: var(--ink); }
.req { color: var(--danger); margin-left: 2px; }
.optional { margin-left: 6px; font-size: 12px; font-weight: 500; color: var(--subtle); }
.help { font-size: 13px; color: var(--muted); margin-top: -2px; }

.input,
.select,
.textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.select {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--subtle); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}
.field.has-error .input,
.field.has-error .select,
.field.has-error .textarea,
.field.has-error .dropzone { border-color: var(--danger); }
.error { font-size: 13px; color: var(--danger); min-height: 0; }
.error:empty { display: none; }

.counter { align-self: flex-end; font-size: 12px; color: var(--subtle); margin-top: -2px; }
.counter.near { color: var(--warning); }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.15s, background 0.15s;
}
.choice:hover { border-color: var(--subtle); }
.choice input { accent-color: var(--brand); width: 16px; height: 16px; margin: 0; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--navy-800); }
.choice:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--brand-ring); }

.consent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: 14px;
  cursor: pointer;
}
.consent input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--brand); flex-shrink: 0; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }

/* Public layout */
.topbar {
  background: var(--navy-950);
  color: #fff;
  border-bottom: 3px solid var(--gold);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none !important; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--navy-700));
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 15px; letter-spacing: 0.02em; }
.brand-text small { font-size: 12px; color: rgba(255, 255, 255, 0.65); }
.topbar-link { color: rgba(255, 255, 255, 0.82); font-size: 14px; font-weight: 500; }
.topbar-link:hover { color: #fff; }

.hero {
  background:
    radial-gradient(900px 300px at 85% -40%, rgba(201, 165, 76, 0.18), transparent 60%),
    linear-gradient(180deg, var(--navy-900), var(--navy-800));
  color: #fff;
  padding: 48px 0 96px;
}
.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}
.hero h1 { color: #fff; font-size: 36px; }
.hero .lead { max-width: 680px; margin-top: 12px; font-size: 16px; color: rgba(255, 255, 255, 0.78); }
.hero-facts { display: flex; flex-wrap: wrap; gap: 32px; margin: 28px 0 0; padding: 0; list-style: none; }
.hero-facts li { display: flex; flex-direction: column; }
.hero-facts strong { font-size: 20px; color: #fff; }
.hero-facts span { font-size: 13px; color: rgba(255, 255, 255, 0.65); }

.apply-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  margin-top: -64px;
  padding-bottom: 64px;
  align-items: start;
}

.side-panel { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 16px; }
.stepper { padding: 10px; }
.stepper ol { list-style: none; margin: 0; padding: 0; }
.step-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  font: inherit;
  font-size: 14px;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}
.step-link:disabled { cursor: default; }
.step-link:not(:disabled):hover { background: var(--surface-2); color: var(--ink); }
.step-num {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--surface);
}
.step-link.is-current { background: var(--brand-soft); color: var(--navy-800); font-weight: 600; }
.step-link.is-current .step-num { border-color: var(--brand); background: var(--brand); color: #fff; }
.step-link.is-done { color: var(--ink-2); }
.step-link.is-done .step-num { border-color: var(--success); background: var(--success); color: #fff; }

.poster { display: block; width: 100%; height: auto; padding: 0; overflow: hidden; }
.info-card { padding: 18px 20px; }
.info-card h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 10px; }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 13px; color: var(--ink-2); }
.check-list li { display: flex; gap: 8px; align-items: flex-start; }
.check-list svg { width: 14px; height: 14px; margin-top: 3px; color: var(--success); flex-shrink: 0; }
.about { margin: -8px 0 24px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); font-size: 14px; color: var(--ink-2); }
.about summary { cursor: pointer; font-weight: 600; color: var(--brand); }
.about p { margin-top: 10px; }
.other-input { margin-top: 10px; max-width: 420px; }
.guidelines { margin-top: 8px; padding: 16px 18px; border-radius: var(--radius); background: var(--brand-soft); }
.guidelines .bullets { color: var(--navy-800); }

.form-card { overflow: hidden; }
.progress-track { height: 4px; background: var(--line); }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--navy-700)); transition: width 0.3s ease; }
.step { padding: 32px 36px 8px; }
.step-header { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.step-count { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); margin-bottom: 6px; }
.step-header p.muted { margin-top: 6px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 20px; }
.field.span-2 { grid-column: 1 / -1; }

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 36px;
  margin-top: 24px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.save-hint { font-size: 13px; color: var(--subtle); }
.form-alert {
  margin: 0 36px 24px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 14px;
}

.team { display: flex; flex-direction: column; gap: 10px; }
.team-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.6fr 36px;
  gap: 10px;
  align-items: start;
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover { color: var(--danger); border-color: #f1c4bf; background: var(--danger-soft); }
.icon-btn svg { width: 16px; height: 16px; }
.add-row { align-self: flex-start; }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 26px 20px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--brand); background: var(--brand-soft); }
.dropzone:focus-within { box-shadow: 0 0 0 3px var(--brand-ring); }
.dropzone svg { width: 28px; height: 28px; color: var(--brand); }
.dropzone strong { font-size: 14px; }
.dropzone span { font-size: 13px; color: var(--muted); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.file-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}
.file-icon.k-pdf { background: #fde8e7; color: #b42318; }
.file-icon.k-ppt, .file-icon.k-pptx { background: #fdeee3; color: #b54708; }
.file-icon.k-image { background: #e6f1fb; color: #175cd3; }
.file-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.file-meta strong { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta span { font-size: 12px; color: var(--muted); }

.review-section { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; }
.review-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.review-head h3 { font-size: 14px; }
.review-list { margin: 0; padding: 4px 16px; }
.review-list > div { display: grid; grid-template-columns: 220px 1fr; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.review-list > div:last-child { border-bottom: 0; }
.review-list dt { color: var(--muted); }
.review-list dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
.review-list .empty { color: var(--subtle); font-style: italic; }
.review-intro { margin-bottom: 20px; }

.footer { padding: 28px 0 40px; font-size: 13px; color: var(--muted); text-align: center; }

/* Confirmation */
.center-page { display: grid; place-items: center; min-height: calc(100vh - 67px); padding: 40px 16px; }
.success-card { max-width: 560px; width: 100%; padding: 40px; text-align: center; }
.success-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 20px; border-radius: 50%; background: var(--success-soft); color: var(--success); }
.success-icon svg { width: 30px; height: 30px; }
.ref-box { margin: 24px 0; padding: 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-2); }
.ref-box span { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.ref-box strong { font-size: 22px; letter-spacing: 0.06em; font-variant-numeric: tabular-nums; }
.next-steps { text-align: left; list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 14px; }
.next-steps li { display: flex; gap: 12px; font-size: 14px; }
.next-steps b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 12px; flex-shrink: 0; }

/* Admin shell */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--navy-950);
  color: rgba(255, 255, 255, 0.8);
  padding: 20px 14px;
}
.sidebar .brand { padding: 4px 8px 20px; margin-bottom: 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.side-label { padding: 0 10px; margin: 8px 0 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255, 255, 255, 0.4); }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.side-nav a svg { width: 18px; height: 18px; opacity: 0.85; }
.side-nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.side-nav a.active { background: rgba(255, 255, 255, 0.1); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.side-user {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--navy-700);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.side-user-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.side-user-meta strong { color: #fff; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-meta small { font-size: 12px; color: rgba(255, 255, 255, 0.5); }
.signout { border: 0; background: none; color: rgba(255, 255, 255, 0.6); cursor: pointer; padding: 6px; border-radius: 6px; }
.signout:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.signout svg { width: 18px; height: 18px; display: block; }

.main { padding: 32px 40px 64px; min-width: 0; }
.main > .card + .card { margin-top: 24px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-head p { margin-top: 4px; color: var(--muted); }
.head-actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi { padding: 18px 20px; }
.kpi-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi-value { margin-top: 6px; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 15px; font-weight: 500; color: var(--subtle); margin-left: 2px; }
.kpi-sub { font-size: 12px; color: var(--subtle); margin-top: 2px; }

.toolbar { display: flex; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toolbar .input, .toolbar .select { min-height: 38px; height: 38px; padding-top: 6px; padding-bottom: 6px; font-size: 14px; }
.search { position: relative; flex: 1; min-width: 220px; }
.search svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--subtle); }
.search .input { padding-left: 36px; }
.toolbar .select { width: auto; min-width: 160px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  padding: 11px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 14px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.table td .cell-title { min-width: 180px; white-space: normal; }
.table tbody tr:last-child td { border-bottom: 0; }
.table.clickable tbody tr { cursor: pointer; transition: background 0.1s; }
.table.clickable tbody tr:hover { background: #f7f9fc; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .center { text-align: center; }
.cell-title { display: flex; flex-direction: column; gap: 2px; }
.cell-title strong { font-weight: 600; }
.cell-title.plain strong { font-weight: 500; }
.cell-title span { font-size: 12px; color: var(--subtle); font-variant-numeric: tabular-nums; }

.score-cell { display: flex; align-items: center; gap: 8px; min-width: 118px; }
.bar { flex: 1; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; min-width: 44px; }
.bar > i { display: block; height: 100%; border-radius: 99px; }
.score-cell b { font-variant-numeric: tabular-nums; font-size: 14px; min-width: 44px; text-align: right; }
.score-cell b small { color: var(--subtle); font-weight: 500; }
.ai-wait { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.ai-wait .spinner { width: 13px; height: 13px; color: var(--brand); }

.band-excellent { --band: var(--success); --band-soft: var(--success-soft); }
.band-good { --band: var(--good); --band-soft: var(--good-soft); }
.band-fair { --band: var(--warning); --band-soft: var(--warning-soft); }
.band-weak { --band: var(--danger); --band-soft: var(--danger-soft); }
.bar > i { background: var(--band, var(--brand)); }

.empty-state { padding: 56px 24px; text-align: center; color: var(--muted); }
.empty-state svg { width: 40px; height: 40px; color: var(--line-strong); margin-bottom: 12px; }
.empty-state h3 { color: var(--ink); margin-bottom: 4px; }

/* Application detail */
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brand); }
.app-title { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.app-title .pitch { font-size: 16px; color: var(--ink-2); max-width: 760px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 4px; }

.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.summary-tile { padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.summary-tile .kpi-value { margin: 0; }
.summary-tile .bar { flex: none; margin-top: 4px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.tab {
  padding: 12px 16px;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected='true'] { color: var(--brand); border-bottom-color: var(--brand); }
.tab .count { margin-left: 6px; padding: 1px 7px; border-radius: 99px; background: var(--line); color: var(--ink-2); font-size: 12px; }

.ai-overview { margin-bottom: 24px; overflow: hidden; }
.ai-overview .card-head { background: linear-gradient(90deg, var(--navy-900), var(--navy-800)); color: #fff; border-bottom: 0; }
.ai-overview .card-head h2 { color: #fff; font-size: 16px; }
.ai-overview .card-head .muted { color: rgba(255, 255, 255, 0.6); }
.ai-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: rgba(255, 255, 255, 0.12); color: var(--gold); }
.ai-icon svg { width: 18px; height: 18px; }
.ai-overview .btn-secondary { background: rgba(255, 255, 255, 0.08); color: #fff; border-color: rgba(255, 255, 255, 0.25); }
.ai-overview .btn-secondary:hover:not(:disabled) { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.4); }
.ai-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; }
.ai-summary { font-size: 15px; color: var(--ink-2); }
.ai-lists { display: grid; gap: 18px; }
.list-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 8px; }
.bullets { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.bullets.flags li::marker { color: var(--danger); }
.disclaimer { display: flex; gap: 10px; align-items: flex-start; margin-top: 20px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.disclaimer svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.ai-progress { display: flex; align-items: center; gap: 14px; padding: 28px 22px; color: var(--ink-2); }
.ai-progress .spinner { width: 22px; height: 22px; color: var(--brand); }
.ai-steps { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.ai-failed { padding: 22px; display: flex; gap: 14px; align-items: flex-start; }
.ai-failed p { color: var(--danger); font-size: 14px; }

.scorecard { display: grid; gap: 16px; }
.criterion { padding: 0; overflow: hidden; }
.criterion-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 22px 0; }
.criterion-title { display: flex; gap: 12px; align-items: baseline; }
.criterion-index { font-size: 13px; font-weight: 700; color: var(--subtle); font-variant-numeric: tabular-nums; }
.criterion-questions { margin: 8px 22px 0 50px; padding: 0; list-style: none; display: grid; gap: 2px; font-size: 13px; color: var(--muted); }
.ai-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--band-soft, var(--surface-2));
  color: var(--band, var(--muted));
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.ai-chip b { font-size: 15px; }
.ai-chip .conf { font-weight: 500; opacity: 0.85; }
.criterion-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; margin-top: 16px; border-top: 1px solid var(--line); }
.ai-box { padding: 18px 22px; background: var(--surface-2); border-right: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.ai-box .list-title { display: flex; align-items: center; gap: 6px; }
.ai-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; }
.ai-cols .bullets { font-size: 13px; }
.list-title svg, .ai-chip svg { width: 14px; height: 14px; flex-shrink: 0; }
.ai-failed > svg { width: 20px; height: 20px; color: var(--danger); flex-shrink: 0; }
.list-title.pos { color: var(--success); }
.list-title.neg { color: var(--warning); }
.judge-box { padding: 18px 22px; display: flex; flex-direction: column; gap: 12px; }
.judge-head { display: flex; justify-content: space-between; align-items: center; }
.judge-head .label { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }

.scale { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 4px; }
.scale-btn {
  position: relative;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
}
.scale-btn:hover { border-color: var(--brand); color: var(--brand); }
.scale-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--brand-ring); }
.scale-btn.is-ai::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: var(--gold);
  transform: translateX(-50%);
}
.scale-btn[aria-pressed='true'] { background: var(--brand); border-color: var(--brand); color: #fff; }
.scale-legend { display: flex; justify-content: space-between; font-size: 11px; color: var(--subtle); margin-top: -6px; }
.judge-box .textarea { min-height: 80px; font-size: 14px; }

.overall-card { padding: 22px; }
.overall-card .textarea { margin-top: 10px; }

.savebar {
  position: sticky;
  bottom: 16px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  background: var(--navy-950);
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.savebar-total { display: flex; flex-direction: column; line-height: 1.2; }
.savebar-total small { font-size: 12px; color: rgba(255, 255, 255, 0.6); }
.savebar-total strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.savebar-total strong span { font-size: 14px; color: rgba(255, 255, 255, 0.55); font-weight: 500; }
.savebar .status-text { font-size: 13px; color: rgba(255, 255, 255, 0.65); }
.savebar .btn-secondary { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.3); }
.savebar .btn-secondary:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); }
.savebar .btn-primary { background: #fff; color: var(--navy-900); }
.savebar .btn-primary:hover:not(:disabled) { background: #e9eef6; }

.answers { display: grid; gap: 16px; }
.answer-section .card-head h3 { font-size: 15px; }
.answer-list { margin: 0; padding: 0 22px; }
.answer-list > div { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.answer-list > div:last-child { border-bottom: 0; }
.answer-list dt { color: var(--muted); font-weight: 500; }
.answer-list dd { margin: 0; white-space: pre-wrap; word-break: break-word; color: var(--ink); }
.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: normal; }
.mini-table th, .mini-table td { text-align: left; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.mini-table th { color: var(--muted); font-weight: 600; }

.docs { display: grid; gap: 16px; }
.doc-card .card-head { flex-wrap: wrap; }
.doc-card .file-meta strong { white-space: normal; }
.doc-status { display: flex; gap: 8px; align-items: center; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.thumb { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); text-decoration: none !important; }
.thumb img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); transition: border-color 0.15s, box-shadow 0.15s; }
.thumb:hover img { border-color: var(--brand); box-shadow: var(--shadow); }
.digest { padding: 18px 22px; font-size: 14px; color: var(--ink-2); }
.digest h4 { font-size: 14px; margin: 14px 0 6px; }
.digest h4:first-child { margin-top: 0; }
.digest p { margin: 0 0 8px; }
.digest ul { margin: 0 0 8px; padding-left: 20px; }
.digest-toggle { padding: 0 22px 18px; }
.digest.collapsed { max-height: 260px; overflow: hidden; -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent); mask-image: linear-gradient(180deg, #000 70%, transparent); }

.panel-table td, .panel-table th { white-space: nowrap; }
.panel-table tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--line-strong); }
.score-tag { display: inline-grid; place-items: center; min-width: 32px; height: 26px; padding: 0 6px; border-radius: 6px; font-weight: 600; font-variant-numeric: tabular-nums; background: var(--band-soft); color: var(--band); }
.comments-list { display: grid; gap: 12px; margin-top: 20px; }
.comment { padding: 16px 18px; }
.comment-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.comment-head .avatar { width: 28px; height: 28px; font-size: 11px; }
.comment p { font-size: 14px; color: var(--ink-2); white-space: pre-wrap; }

/* Login */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: var(--surface);
}
.auth-aside {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 48px;
  color: #fff;
  background:
    radial-gradient(700px 400px at 100% 0%, rgba(201, 165, 76, 0.16), transparent 60%),
    linear-gradient(160deg, var(--navy-950), var(--navy-800));
}
.auth-aside h2 { color: #fff; font-size: 30px; max-width: 440px; }
.auth-aside p { color: rgba(255, 255, 255, 0.7); max-width: 440px; margin-top: 12px; }
.auth-points { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 14px; }
.auth-points li { display: flex; gap: 12px; color: rgba(255, 255, 255, 0.85); font-size: 14px; }
.auth-points svg { width: 18px; height: 18px; color: var(--gold); flex-shrink: 0; margin-top: 2px; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; }
.auth-form { width: 100%; max-width: 380px; display: grid; gap: 18px; }
.auth-form h1 { font-size: 24px; }

/* Dialog & toast */
dialog {
  width: min(480px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  color: var(--ink);
}
dialog::backdrop { background: rgba(6, 22, 48, 0.5); }
.dialog-head { padding: 20px 24px 0; }
.dialog-body { padding: 18px 24px; display: grid; gap: 16px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; background: var(--surface-2); border-top: 1px solid var(--line); }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 10px; }
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  max-width: 420px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--navy-950);
  color: #fff;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.2s ease;
}
.toast.tone-success { border-left: 4px solid #3ccf8e; }
.toast.tone-danger { border-left: 4px solid #f97066; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

.skeleton { border-radius: 6px; background: linear-gradient(90deg, #eef1f5, #f7f9fb, #eef1f5); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Responsive */
@media (max-width: 1100px) {
  .kpis, .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .criterion-body { grid-template-columns: 1fr; }
  .ai-box { border-right: 0; border-bottom: 1px solid var(--line); }
  .ai-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .apply-layout { grid-template-columns: 1fr; margin-top: -72px; }
  .side-panel { position: static; }
  .stepper ol { display: flex; overflow-x: auto; gap: 4px; }
  .step-link { width: auto; white-space: nowrap; }
  .step-link .step-label { display: none; }
  .step-link.is-current .step-label { display: inline; }
  .info-card { display: none; }
  .poster { max-width: 320px; margin: 0 auto; }

  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; gap: 12px; padding: 10px 16px; overflow-x: auto; }
  .sidebar .brand { padding: 0; margin: 0; border: 0; }
  .sidebar .brand-text, .side-label { display: none; }
  .side-nav { flex-direction: row; }
  .side-nav a span { display: none; }
  .side-user { margin: 0 0 0 auto; padding: 0; border: 0; }
  .side-user-meta { display: none; }
  .main { padding: 24px 16px 48px; }
  .page-head { flex-direction: column; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .hero { padding: 32px 0 88px; }
  .hero h1 { font-size: 28px; }
  .hero-facts { gap: 20px; }
  .step { padding: 24px 20px 4px; }
  .form-actions { padding: 16px 20px; flex-wrap: wrap; }
  .form-actions .save-hint { order: 3; width: 100%; text-align: center; }
  .form-alert { margin: 0 20px 20px; }
  .field-grid { grid-template-columns: 1fr; }
  .team-row { grid-template-columns: 1fr 36px; }
  .team-row > :nth-child(2), .team-row > :nth-child(3) { grid-column: 1; }
  .team-row > .icon-btn { grid-column: 2; grid-row: 1; }
  .review-list > div, .answer-list > div { grid-template-columns: 1fr; gap: 4px; }
  .kpis, .summary-grid { grid-template-columns: 1fr; }
  .scale { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .scale-legend { display: none; }
  .ai-cols { grid-template-columns: 1fr; }
  .savebar { flex-wrap: wrap; gap: 10px; padding: 10px 14px; bottom: 8px; }
  .savebar .status-text { display: none; }
  .savebar .btn { flex: 1; }
  .card-head { flex-wrap: wrap; }
  .ai-overview .card-head .spacer { display: none; }
  .criterion-head { flex-direction: column; }
  .criterion-questions { margin-left: 22px; }
  .success-card { padding: 28px 20px; }
}
