@import url("https://fonts.googleapis.com/css2?family=Familjen+Grotesk:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  --ink: #12242e;
  --teal: #1d5e63;
  --paper: #f7f6f2;
  --surface: #ffffff;
  --text-2: #3d4b52;
  --text-muted: #8a8980;
  --line: #e3e2db;
  --line-strong: #c8cdcb;
  --pending: #9b6b25;
  --pending-bg: #fbf6ec;
  --pending-line: #d9c9a8;
  --pending-text: #7a5418;
  --danger: #9b4a2f;
  --danger-bg: #fbf2ee;
  --danger-line: #dabfb3;
  --font-sans: "Familjen Grotesk", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --radius: 4px;
  --radius-sm: 3px;
  --tap: 44px;
  --measure: 68ch;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body:has(dialog[open]) { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: var(--teal); text-underline-offset: .2em; }
a:hover { color: var(--ink); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.15rem, 2vw, 1.5rem); font-weight: 600; letter-spacing: -.025em; line-height: 1.15; }
h2 { margin-bottom: 14px; font-size: clamp(2.15rem, 5vw, 3.5rem); font-weight: 600; letter-spacing: -.04em; line-height: 1; }
h3 { margin-bottom: 8px; font-size: 1.25rem; font-weight: 600; letter-spacing: -.018em; line-height: 1.3; }
p { color: var(--text-2); text-wrap: pretty; }

.app-shell { min-height: 100vh; }
.topbar { border-bottom: 1px solid var(--line); background: var(--paper); }
.topbar-inner, .portal-main, .site-footer { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.topbar-inner { padding-top: 22px; }
.brandbar { display: flex; align-items: center; gap: 18px; }
.brand-lockup, .footer-brand {
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -.035em;
  text-decoration: none;
}
.brand-lockup:hover { color: var(--ink); }
.brand-mark { flex: 0 0 auto; }
.brand-divider { width: 1px; height: 38px; background: var(--line-strong); }
.org-ident { min-width: 0; }
.org-ident .eyebrow { margin-bottom: 2px; }
.eyebrow, .notice-label {
  margin: 0 0 10px;
  color: var(--teal);
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .13em;
  line-height: 1.45;
  text-transform: uppercase;
}
.tabs { margin-top: 22px; display: flex; gap: 30px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  min-height: 50px;
  padding: 0 0 2px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  flex: 0 0 auto;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 500;
}
.tab:hover { background: transparent; color: var(--ink); transform: none; }
.tab.active { border-bottom-color: var(--teal); color: var(--ink); }

.portal-main { padding-block: 28px 96px; }
.notice {
  padding: 18px 20px;
  border: 1px solid var(--pending-line);
  border-radius: var(--radius);
  background: var(--pending-bg);
  display: grid;
  gap: 6px;
}
.notice-label { margin: 0; color: var(--pending-text); }
.notice p { max-width: 92ch; margin: 0; color: var(--pending-text); font-size: .9rem; }
.notice strong { color: var(--pending-text); }
.process-flow { margin: 28px 0 72px; padding: 0; border-block: 1px solid var(--line-strong); display: grid; list-style: none; }
.process-flow li { min-height: 92px; padding: 17px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 12px; }
.process-flow li:last-child { border-bottom: 0; }
.process-flow li > span { color: var(--text-muted); font-family: var(--font-mono); font-size: .68rem; }
.process-flow strong, .process-flow small { display: block; }
.process-flow small { margin-top: 2px; color: var(--text-muted); font-size: .78rem; line-height: 1.4; }

.view { display: none; }
.view.active-view { display: block; animation: view-in 220ms cubic-bezier(.22, 1, .36, 1) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.section-head { margin-bottom: 30px; padding-bottom: 28px; border-bottom: 1px solid var(--ink); display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.section-head > div { max-width: 720px; }
.section-head p:last-child { max-width: var(--measure); margin-bottom: 0; }

button, .button-link, .link-button {
  min-height: 46px;
  padding: 10px 17px;
  border: 1px solid var(--teal);
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--teal);
  color: var(--surface);
  cursor: pointer;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  transition: background-color 150ms ease-out, border-color 150ms ease-out, color 150ms ease-out, transform 150ms ease-out;
}
button:hover, .button-link:hover { border-color: var(--ink); background: var(--ink); color: var(--surface); transform: translateY(-1px); }
button:disabled { border-color: var(--line-strong); background: var(--line); color: var(--text-muted); cursor: not-allowed; transform: none; }
button.secondary { border-color: var(--line-strong); background: transparent; color: var(--ink); }
button.secondary:hover { border-color: var(--ink); background: var(--surface); color: var(--ink); }
button.link-button, .link-button { min-height: var(--tap); padding-inline: 6px; border: 0; background: transparent; color: var(--teal); text-decoration: underline; text-underline-offset: .22em; }
button.link-button:hover, .link-button:hover { background: transparent; color: var(--ink); transform: none; }
.small-button { min-height: var(--tap); padding: 8px 11px; font-size: .8rem; }
.is-busy { cursor: wait; }

.panel { margin: 0; padding: 28px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.form-grid { display: grid; gap: 20px; }
.form-grid > label, .date-field, .dialog-form > label { min-width: 0; color: var(--ink); font-size: .88rem; font-weight: 600; }
.full { grid-column: 1 / -1; }
input, select, textarea {
  width: 100%;
  min-height: 48px;
  margin-top: 7px;
  padding: 10px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}
textarea { min-height: 112px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); outline: 2px solid var(--teal); outline-offset: 0; }
input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 1; }
.field-help, .form-note { display: block; margin-top: 7px; color: var(--text-muted); font-size: .78rem; font-weight: 400; line-height: 1.5; }
.date-control { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.date-control > input { margin-top: 7px; }
.date-picker-shell { position: relative; min-width: 72px; margin-top: 7px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--radius); }
.date-picker-button { height: 100%; display: grid; place-items: center; color: var(--ink); font-size: .82rem; font-weight: 600; }
.native-date-picker { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.compensation-tools, .actions, .claim-actions, .dialog-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.consent-group { border: 1px solid var(--line); border-radius: var(--radius); }
.preference-group { border: 1px solid var(--line); border-radius: var(--radius); }
.field-label { display: block; padding: 13px 14px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: .88rem; font-weight: 600; }
.check { min-height: 52px; margin: 0; padding: 13px 14px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 20px 1fr; align-items: start; gap: 11px; color: var(--text-2); font-size: .86rem; font-weight: 400; }
.check:last-child { border-bottom: 0; }
.check input { width: 18px; min-height: 18px; height: 18px; margin: 3px 0 0; padding: 0; accent-color: var(--teal); }
.actions { margin-top: 4px; }
.result-box { margin-top: 20px; padding: 22px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.result-box h3:last-child, .result-box p:last-child { margin-bottom: 0; }
.recovery-form { margin-top: 24px; }

.request-list, .request-grid { border-bottom: 1px solid var(--line-strong); }
.request-card, .pass-row {
  min-height: 126px;
  padding-block: 22px;
  border: 0;
  border-top: 1px solid var(--line-strong);
  border-radius: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 24px;
  background: transparent;
}
.request-card h3, .pass-row h3 { margin-bottom: 4px; }
.request-card p, .pass-row p { margin-bottom: 4px; }
.request-card .actions { justify-content: flex-end; }
.pass-range { margin-bottom: 10px; color: var(--ink); font-family: var(--font-mono); font-size: .84rem; line-height: 1.55; }
.pass-range.compact { margin-bottom: 4px; font-size: .76rem; }
.pass-range-separator { color: var(--text-muted); }
.pass-facts { margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 10px 24px; }
.pass-facts div { display: flex; gap: 7px; }
.pass-facts dt { color: var(--text-muted); font-size: .76rem; }
.pass-facts dd { margin: 0; color: var(--text-2); font-size: .76rem; }
.pass-row-status { display: grid; justify-items: start; gap: 8px; }
.badge, .status {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: .76rem;
  font-weight: 500;
  white-space: nowrap;
}
.badge::before, .status::before { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; background: currentColor; content: ""; }
.badge.open, .badge.confirmed, .status-open, .status-confirmed, .badge.success { color: var(--teal); }
.badge.candidate, .badge.pending, .status-pending, .badge.backup { color: var(--pending-text); }
.badge.cancelled, .badge.expired, .badge.rejected, .status-cancelled, .status-error { color: var(--danger); }
.badge.past, .status-past, .status-neutral { color: var(--text-muted); }
.deadline { margin: 8px 0; color: var(--pending-text); font-size: .84rem; }
.category-tag { color: var(--text-muted); font-family: var(--font-mono); font-size: .72rem; }
.muted { color: var(--text-muted); }
.empty { padding: 44px 0; border-block: 1px solid var(--line-strong); color: var(--text-2); }
.empty-strong { font-size: 1.1rem; }
.empty p:last-child { margin-bottom: 0; }
.empty-error { color: var(--danger); }

.status-panel, .contact-box, .next-steps { margin-top: 20px; padding: 22px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.status-panel h3, .contact-box h3, .next-steps h3 { margin-top: 0; }
.contact-box { border-color: color-mix(in srgb, var(--teal) 40%, var(--line)); }
.claim-list { margin: 20px 0 0; padding: 0; border-bottom: 1px solid var(--line-strong); list-style: none; }
.claim-row { padding-block: 18px; border-top: 1px solid var(--line-strong); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 20px; }
.claim-row p { margin-bottom: 3px; }

.admin-table { width: 100%; margin: 16px 0 30px; border-collapse: collapse; font-size: .78rem; }
.admin-table th, .admin-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.admin-table th { color: var(--text-muted); font-family: var(--font-mono); font-size: .65rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.admin-table td { color: var(--text-2); }
.admin-table code { font-family: var(--font-mono); font-size: .7rem; }
#admin-content { overflow-x: auto; }
.admin-summary { margin-bottom: 34px; border-block: 1px solid var(--line-strong); }
.admin-summary dl { margin: 0; display: grid; grid-template-columns: repeat(5, minmax(110px, 1fr)); }
.admin-summary div { padding: 18px 12px; border-right: 1px solid var(--line); }
.admin-summary div:last-child { border-right: 0; }
.admin-summary dt { color: var(--text-muted); font-family: var(--font-mono); font-size: .65rem; letter-spacing: .08em; text-transform: uppercase; }
.admin-summary dd { margin: 4px 0 0; color: var(--ink); font-size: 1.4rem; font-weight: 600; }
.table-wrap { overflow-x: auto; }

dialog { width: min(680px, calc(100% - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: 0; overflow: auto; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--paper); color: var(--ink); }
dialog::backdrop { background: rgba(18, 36, 46, .66); }
.dialog-form { padding: 28px; display: grid; gap: 18px; }
.dialog-head { padding-bottom: 20px; border-bottom: 1px solid var(--ink); }
.dialog-head h2 { font-size: clamp(2.1rem, 6vw, 3.2rem); }
.dialog-head p:last-child { margin-bottom: 0; }
.profile-claim { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.dialog-actions { margin: 0; padding: 4px 0 0; justify-content: flex-end; }

.site-footer { width: 100%; padding: 36px max(20px, calc((100% - 1120px) / 2)); background: var(--ink); display: flex; align-items: center; flex-wrap: wrap; gap: 18px 30px; color: rgba(247, 246, 242, .62); font-size: .78rem; }
.footer-brand { margin-right: auto; color: var(--paper); font-size: 1.25rem; }
.footer-brand:hover { color: var(--paper); }
.site-footer a:not(.footer-brand) { min-height: var(--tap); display: inline-flex; align-items: center; color: #cfe3e4; }
.site-footer a:hover { color: var(--paper); }

.toast { position: fixed; right: 20px; bottom: 20px; z-index: 20; max-width: min(420px, calc(100% - 40px)); padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--ink); color: var(--paper); font-size: .88rem; }
.hidden { display: none !important; }

.legal-topbar .topbar-inner { min-height: 82px; padding-block: 18px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.header-link { min-height: var(--tap); display: inline-flex; align-items: center; font-weight: 600; }
.legal-page { width: min(920px, calc(100% - 40px)); margin-inline: auto; padding-block: clamp(60px, 9vw, 108px); }
.legal-head { padding-bottom: 38px; border-bottom: 1px solid var(--ink); }
.legal-head h1 { margin-bottom: 18px; font-size: clamp(2.9rem, 7vw, 5rem); letter-spacing: -.045em; line-height: .98; }
.legal-head p:last-child { margin-bottom: 0; font-size: 1.1rem; }
.legal-page > .notice { margin-top: 28px; }
.legal-sections { margin-top: 34px; }
.legal-sections section { padding-block: 26px; border-bottom: 1px solid var(--line-strong); display: grid; gap: 18px; }
.legal-sections h2 { margin: 0; font-size: 1.3rem; letter-spacing: -.02em; }
.legal-sections p { max-width: var(--measure); margin-bottom: 12px; }
.legal-sections p:last-child { margin-bottom: 0; }
.legal-page > .actions { margin-top: 34px; }

@media (min-width: 720px) {
  .topbar-inner { padding-top: 26px; }
  .process-flow { grid-template-columns: repeat(4, 1fr); }
  .process-flow li { padding-inline: 16px; border-right: 1px solid var(--line); border-bottom: 0; }
  .process-flow li:first-child { padding-left: 0; }
  .process-flow li:last-child { border-right: 0; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legal-sections section { grid-template-columns: minmax(190px, .55fr) minmax(0, 1.45fr); }
}

@media (max-width: 719px) {
  .topbar-inner, .portal-main { width: min(100% - 32px, 620px); }
  .topbar-inner { padding-top: 14px; }
  .brandbar { align-items: flex-start; gap: 11px; }
  .brand-lockup { font-size: 1.3rem; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-divider { height: 34px; }
  .org-ident h1 { font-size: 1.02rem; }
  .org-ident .eyebrow { max-width: 24ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tabs { width: calc(100vw - 16px); margin-left: -8px; padding-inline: 8px; gap: 24px; }
  .portal-main { padding-top: 20px; }
  .process-flow { margin-bottom: 56px; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .section-head .secondary { align-self: stretch; }
  .panel { padding: 22px 18px; }
  .request-card, .pass-row, .claim-row { grid-template-columns: 1fr; align-items: start; gap: 14px; }
  .request-card .actions { justify-content: flex-start; }
  .actions > button:not(.link-button), .actions > .button-link { flex: 1 1 auto; }
  dialog { width: 100%; max-width: none; max-height: 100dvh; height: 100dvh; border: 0; border-radius: 0; }
  .dialog-form { min-height: 100%; padding: 24px 18px; }
  .dialog-actions { position: sticky; bottom: 0; margin-inline: -18px; padding: 14px 18px; border-top: 1px solid var(--line); background: var(--paper); }
  .dialog-actions button { flex: 1; }
  .site-footer { align-items: flex-start; flex-direction: column; }
  .admin-summary { overflow-x: auto; }
  .admin-summary dl { min-width: 620px; }
  .legal-topbar .topbar-inner { width: min(100% - 32px, 620px); }
  .legal-page { width: min(100% - 32px, 620px); }
}

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