:root {
  --ink: #10243f;
  --muted: #607089;
  --line: #dce4ee;
  --paper: #f7f9fc;
  --white: #ffffff;
  --teal: #087f73;
  --teal-dark: #05665d;
  --coral: #ff6b4a;
  --navy: #123766;
  --danger: #a53131;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button, .button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

.portal-topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(20px, 4vw, 64px);
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.portal-brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.portal-mark {
  width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center;
  background: var(--teal); color: white; font-weight: 800;
}
.portal-brand strong { display: block; }
.portal-brand span { display: block; color: var(--muted); font-size: 13px; }
.pilot-label {
  padding: 7px 11px; border-radius: 999px; background: #e9f7f4; color: var(--teal-dark);
  font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}

.portal-main { width: min(1160px, calc(100% - 32px)); margin: 40px auto 80px; }
.portal-narrow { width: min(760px, calc(100% - 32px)); margin: 48px auto 80px; }
.portal-hero { margin-bottom: 28px; }
.eyebrow { color: var(--teal); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 8px 0 10px; font-size: clamp(34px, 5vw, 60px); line-height: .98; letter-spacing: -.045em; }
h2 { margin: 0 0 8px; font-size: 22px; letter-spacing: -.02em; }
p { line-height: 1.65; color: var(--muted); }
.lede { font-size: 18px; max-width: 720px; }

.card {
  background: var(--white); border: 1px solid var(--line); border-radius: 20px; padding: clamp(20px, 3vw, 32px);
  box-shadow: 0 18px 50px rgba(16, 36, 63, .06);
}
.card + .card { margin-top: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: start; gap: 20px; margin-bottom: 20px; }
.card-head p { margin: 4px 0 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stack { display: grid; gap: 16px; }

.field { display: grid; gap: 7px; color: var(--ink); font-weight: 700; font-size: 14px; }
.field span { color: var(--muted); font-size: 12px; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid #cbd6e3; border-radius: 12px; padding: 12px 13px; color: var(--ink); background: white;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 3px solid rgba(8, 127, 115, .14); border-color: var(--teal);
}
.check-field {
  display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; color: var(--muted); line-height: 1.5;
}
.check-field input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--teal); }
.honeypot { position: absolute !important; left: -9999px !important; }

.button {
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 12px;
  padding: 10px 16px; border: 1px solid transparent; font-weight: 800; text-decoration: none;
}
.button-primary { background: var(--teal); color: white; }
.button-primary:hover { background: var(--teal-dark); }
.button-secondary { background: white; border-color: var(--line); color: var(--ink); }
.button-danger { background: #fff2f1; color: var(--danger); border-color: #f0cac5; }
.button:disabled { cursor: not-allowed; opacity: .55; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.notice {
  padding: 14px 16px; border-radius: 13px; background: #edf5ff; color: #244d7d; line-height: 1.5;
}
.notice strong { color: var(--navy); }
.notice.success { background: #e9f7f4; color: var(--teal-dark); }
.notice.error { background: #fff1ef; color: var(--danger); }
.notice.warning { background: #fff7e7; color: #805b13; }
.form-status { min-height: 24px; margin-top: 12px; color: var(--muted); }

.metric { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); }
.metric span { display: block; color: var(--muted); font-size: 13px; }
.metric strong { display: block; margin-top: 6px; font-size: 30px; }
.table-wrap { overflow-x: auto; }
.portal-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.portal-table th, .portal-table td { padding: 13px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; }
.portal-table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.pill { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: #edf5ff; color: #244d7d; font-size: 12px; font-weight: 800; }
.pill.reviewed { background: #e9f7f4; color: var(--teal-dark); }
.empty { padding: 30px 10px; text-align: center; color: var(--muted); }
.token-output { word-break: break-all; background: #f2f5f9; padding: 12px; border-radius: 10px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }

.task-brief {
  padding: 20px; border-radius: 16px; background: #f2f6fb; border-left: 4px solid var(--teal);
}
.task-brief p { margin: 8px 0 0; white-space: pre-wrap; }
.timer-chip { font-variant-numeric: tabular-nums; color: var(--teal-dark); font-weight: 800; }
.candidate-step { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.candidate-step b { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: white; }

.request-layout { display: grid; grid-template-columns: .85fr 1.15fr; gap: 28px; align-items: start; }
.benefit-list { list-style: none; padding: 0; margin: 24px 0; display: grid; gap: 13px; }
.benefit-list li { display: grid; grid-template-columns: 26px 1fr; gap: 9px; color: var(--muted); line-height: 1.45; }
.benefit-list li::before { content: "✓"; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: #e9f7f4; color: var(--teal); font-weight: 900; }

@media (max-width: 800px) {
  .grid-2, .grid-3, .request-layout { grid-template-columns: 1fr; }
  .portal-main, .portal-narrow { margin-top: 26px; }
  .portal-topbar { align-items: flex-start; }
  .card-head { display: grid; }
}
