:root {
  color-scheme: light;
  --ink: #172d39;
  --muted: #4d6570;
  --deep: #102e36;
  --accent: #006b58;
  --accent-dark: #004f41;
  --mint: #c9f1d9;
  --surface: #f4f8f7;
  --line: #d9e5e3;
  --white: #fff;
  --danger: #a02b40;
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: var(--ink);
  background: var(--surface);
  line-height: 1.55;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
html { scroll-behavior: smooth; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .2em; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2, h3 { line-height: 1.2; overflow-wrap: anywhere; }
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); letter-spacing: -.045em; font-weight: 750; }
h2 { font-size: 1.22rem; letter-spacing: -.02em; }
h3 { font-size: 1.08rem; }
button, input, textarea, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: default; opacity: .54; }
:focus-visible { outline: 3px solid #078367; outline-offset: 3px; }
.container { width: min(1120px, calc(100% - 44px)); margin-inline: auto; }
.narrow { width: min(470px, calc(100% - 44px)); margin-inline: auto; }
.stack { display: grid; gap: 16px; min-width: 0; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; border: 1px solid transparent; border-radius: 9px; font-weight: 650; font-size: .94rem; padding: 10px 16px; min-height: 44px; text-align: center; line-height: 1.35; }
.button:hover { text-decoration: none; }
.button.primary { background: var(--accent); color: var(--white); }
.button.primary:hover:enabled, a.button.primary:hover { background: var(--accent-dark); }
.button.secondary { background: var(--white); color: var(--ink); border-color: var(--line); }
.button.secondary:hover:enabled, a.button.secondary:hover { background: #eaf4f0; }
.button.small { min-height: 38px; padding: 7px 12px; font-size: .87rem; }
.button.full { width: 100%; }
.text-link, .back-link { color: var(--accent-dark); font-weight: 700; font-size: .91rem; }
.back-link { display: inline-block; margin-bottom: 18px; }
.muted, .optional { color: var(--muted); font-weight: 450; font-size: .9rem; }
.optional { margin-left: 5px; }
.preserve { white-space: pre-wrap; overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }

.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: inherit; line-height: 1.12; font-size: 1.07rem; font-weight: 800; letter-spacing: .08em; }
.brand:hover { text-decoration: none; }
.brand-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--accent); color: white; font-size: 1.45rem; letter-spacing: 0; }
.brand small { display: block; margin-top: 4px; font-size: .74rem; font-weight: 550; letter-spacing: .01em; opacity: .85; }
.site-footer { border-top: 1px solid var(--line); padding: 22px 0; color: var(--muted); font-size: .85rem; }
.hero { color: white; background: radial-gradient(ellipse at 85% 105%, #23775f, transparent 52%), var(--deep); overflow: hidden; }
.hero-content { position: relative; isolation: isolate; padding-block: clamp(48px, 8vw, 92px); }
.hero-content::after { content: ''; width: min(48vw, 550px); aspect-ratio: 1; border-radius: 36%; position: absolute; z-index: -1; right: 0; top: 50%; transform: translate(10%, -50%) rotate(28deg); background: repeating-radial-gradient(ellipse at 52% 51%, transparent 0 23px, #9aeac43b 24px 25px); mask-image: linear-gradient(125deg, transparent 5%, #000 70%); }
.hero h1 { font-size: clamp(3.2rem, 7.5vw, 6rem); line-height: .98; letter-spacing: -.065em; }
.hero p { color: #d7ede7; font-size: clamp(1rem, 2vw, 1.18rem); margin: 23px 0; max-width: 40ch; }
.hero-button { background: var(--mint); color: #12372b; }
.hero-button:hover { background: #e1fbe8; }
.hero-button:focus-visible, .sidebar :focus-visible { outline-color: var(--mint); }
.public-list { padding-block: 36px 54px; scroll-margin-top: 20px; }
.section-heading { display: flex; align-items: center; gap: 10px; }
.public-list > .section-heading { margin-bottom: 18px; }
.public-list h2 { font-size: clamp(1.25rem, 3vw, 1.6rem); }
.count { display: inline-grid; place-items: center; min-width: 28px; padding: 1px 7px; border-radius: 20px; background: #e2efe9; color: var(--accent-dark); font-weight: 700; font-size: .82rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 295px), 1fr)); gap: 16px; }
.listing { padding: 24px; display: flex; flex-direction: column; align-items: start; gap: 12px; min-height: 160px; }
.listing p { color: var(--muted); overflow-wrap: anywhere; }
.listing .text-link { margin-top: auto; }

.admin-layout { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar { background: var(--deep); color: #ecf9f6; padding: 28px 18px; display: flex; flex-direction: column; gap: 35px; min-width: 0; }
.sidebar .brand { margin-left: 8px; }
.sidebar .brand-icon { background: var(--mint); color: var(--deep); }
.sidebar nav { display: grid; gap: 6px; }
.sidebar nav a, .nav-button { color: inherit; display: block; border: 0; padding: 11px 12px; border-radius: 8px; background: transparent; text-align: left; font-weight: 550; font-size: .91rem; }
.sidebar nav a:hover, .nav-button:hover { background: #ffffff14; text-decoration: none; }
.sidebar nav .nav-active { background: #ffffff20; color: #e5fff1; font-weight: 700; }
.sign-out { margin-top: auto; }
.admin-main { padding: clamp(22px, 4vw, 54px); width: 100%; max-width: 1460px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px 22px; flex-wrap: wrap; margin-bottom: 23px; }
.page-heading p { color: var(--muted); margin-top: 6px; overflow-wrap: anywhere; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 22px; }
.metric, .card { background: var(--white); border: 1px solid var(--line); border-radius: 14px; min-width: 0; }
.metric { padding: 17px 20px; display: grid; gap: 6px; }
.metric span { font-weight: 600; color: var(--muted); font-size: .88rem; }
.metric strong { font-size: 2rem; color: var(--accent-dark); line-height: 1.12; }
.card-header { padding: 17px 22px; border-bottom: 1px solid var(--line); }
.padded { padding: clamp(16px, 3vw, 26px); }
.empty { display: grid; justify-items: center; text-align: center; gap: 9px; padding: 32px 18px; }
.empty p { color: var(--muted); font-size: .93rem; }
.empty-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: #e1f2ea; color: var(--accent-dark); font-size: 1.38rem; }
.empty .button { margin-top: 5px; }
.badge { width: fit-content; display: inline-block; border-radius: 30px; background: #e9edf1; color: #3e5465; padding: 4px 10px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.badge.open, .badge.shortlisted { background: #daf2e5; color: #095b42; }
.badge.new { background: #dfedfd; color: #21558a; }
.badge.review { background: #fff0cc; color: #6e4900; }
.badge.closed, .badge.rejected { background: #f8e8ea; color: #833143; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .91rem; text-align: left; }
th, td { padding: 13px 18px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
thead th { background: #f6f9f9; color: var(--muted); font-weight: 650; }
tbody tr:last-child > * { border-bottom: 0; }
tbody th small { display: block; color: var(--muted); font-weight: 450; }
.filters, .pagination { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filters select { width: auto; max-width: 100%; }
.pagination { border-bottom: 0; border-top: 1px solid var(--line); }

.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 280px); align-items: start; gap: 18px; }
.question-card { padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: #f7faf9; }
.question-header, .question-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.question-header { justify-content: space-between; }
.icon-button { display: inline-grid; place-items: center; min-height: 34px; min-width: 34px; border: 1px solid var(--line); background: white; border-radius: 7px; font-size: .86rem; color: var(--ink); font-weight: 650; padding-inline: 8px; }
.icon-button:hover:enabled { background: #eaf4f0; }
.danger { color: var(--danger); }
.add-question, .options > button { justify-self: start; }
.option-row { display: flex; align-items: center; gap: 8px; }
.option-row label { display: flex; flex: 1; align-items: center; gap: 8px; min-width: 0; }
.option-row input { margin: 0; }
label, legend { font-weight: 650; font-size: .93rem; }
input:not([type=hidden], [type=checkbox], [type=radio]), select, textarea { display: block; margin-top: 5px; width: 100%; min-height: 42px; border: 1px solid #bacdc9; border-radius: 8px; background: white; color: var(--ink); padding: 9px 11px; font-weight: 450; }
input::placeholder, textarea::placeholder { color: #5f7580; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 17px; height: 17px; flex: none; margin: 0; }
textarea { resize: vertical; }
.check-label { display: flex; align-items: center; gap: 8px; width: fit-content; }
.notice, .error { padding: 11px 14px; border-radius: 8px; margin-bottom: 14px; font-weight: 600; }
.notice { border: 1px solid #aed9c9; background: #e2f4ec; color: #175843; }
.error { border: 1px solid #efbdc5; background: #fff0f2; color: #842236; }
.field-error { display: block; margin-top: 5px; color: var(--danger); font-weight: 650; }
[aria-invalid=true] { border-color: var(--danger) !important; }

.auth-wrap { padding-block: clamp(38px, 8vw, 82px); }
.auth-card { padding: clamp(22px, 4vw, 34px); }
.auth-card > p { color: var(--muted); margin: 12px 0 20px; }
.auth-card > p.error { color: #842236; }
.message-card { justify-items: center; text-align: center; overflow-wrap: anywhere; }
.message-card h1 { font-size: clamp(1.8rem, 5vw, 2.55rem); }
.receipt { display: grid; gap: 3px; background: var(--surface); border-radius: 8px; padding: 9px 13px; }
.receipt span { font-size: .8rem; color: var(--muted); }
.receipt strong { color: var(--accent-dark); letter-spacing: .045em; }
.candidate-wrap { max-width: 820px; padding-block: 30px 56px; }
.candidate-heading { margin-bottom: 22px; }
.candidate-heading .badge { margin-bottom: 9px; }
.candidate-heading p { color: var(--muted); margin-top: 10px; }
.contact-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.email-field { min-width: 0; }
.email-field > .muted, .google-email { margin-top: 6px; }
.google-email [role=status]:empty { display: none; }
.google-email [role=status] { margin-top: 4px; }
.integration-settings { max-width: 720px; }
.required { color: var(--danger); }
.candidate-questions { gap: 21px; }
.question-field { min-width: 0; border: 0; margin: 0; padding: 0; overflow-wrap: anywhere; }
.question-field legend { margin-bottom: 6px; padding: 0; }
.question-code { display: block; max-width: 100%; overflow-x: auto; margin: 8px 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--deep); font: 500 .9rem/1.5 Consolas, 'Courier New', monospace; }
.question-card summary { cursor: pointer; width: fit-content; font-weight: 650; font-size: .9rem; }
.review-key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 9px; margin-top: 7px; }
.score { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 10px; margin-bottom: 0; }
.choice { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; margin: 5px 0; font-weight: 500; cursor: pointer; }
.choice:has(input:checked) { border-color: #57a98d; background: #eff9f5; }
.choice-letter { color: var(--accent-dark); font-weight: 700; }
.form-footer { justify-content: space-between; }
.answer-list dt, .detail-list dt { font-weight: 700; overflow-wrap: anywhere; }
.answer-list dd, .detail-list dd { overflow-wrap: anywhere; margin-bottom: 13px; }
.answer-list dd { padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.answer-list dd:last-child, .detail-list dd:last-child { margin-bottom: 0; }
.answer-list ul { margin: 4px 0 0; padding-left: 21px; }

@media (max-width: 980px) {
  .editor-layout { grid-template-columns: minmax(0, 1fr); }
  .publish-card { max-width: 480px; }
}
@media (max-width: 740px) {
  .admin-layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { padding: 13px 16px; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px 15px; }
  .sidebar .brand { margin-left: 0; margin-right: auto; }
  .sidebar nav { order: 3; width: 100%; display: flex; flex-wrap: wrap; }
  .sidebar nav a, .nav-button { font-size: .82rem; padding: 8px 9px; }
  .sign-out { margin-top: 0; }
  .metrics { gap: 8px; }
  .metric { padding: 12px 10px; }
  .metric span { font-size: .75rem; overflow-wrap: anywhere; }
  .metric strong { font-size: 1.55rem; }
}
@media (max-width: 520px) {
  .contact-fields { grid-template-columns: minmax(0, 1fr); }
  .hero-content::after { opacity: .55; }
  .container, .narrow { width: calc(100% - 32px); }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
