@font-face {
  font-family: Inter;
  src: url("/fonts/InterVariable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #102743;
  --muted: #51627a;
  --paper: #fffdf8;
  --white: #fff;
  --line: #e4dfd2;
  --control: #6d695d;
  --accent: #ffe5a0;
  --soft: #fff0bd;
  --focus: #a9782f;
  --navy-line: #687b93;
  --on-dark: #fffdf8;
  --ease: cubic-bezier(.23, 1, .32, 1);
  --gutter: clamp(16px, 3vw, 32px);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; color: var(--ink); background: var(--paper); line-height: 1.55;
  transition: background-color 180ms var(--ease), color 180ms var(--ease);
}
#app { min-height: 100vh; display: flex; flex-direction: column; }
#main { flex: 1; }
h1, h2, h3, p { margin: 0; overflow-wrap: anywhere; }
h2 { font-size: clamp(20px, 2.5vw, 28px); line-height: 1.13; letter-spacing: -.045em; }
a { color: #17395f; text-underline-offset: 4px; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip-link { position: absolute; z-index: 5; top: 12px; left: var(--gutter); transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.wrap { width: min(1180px, calc(100% - 2 * var(--gutter))); margin-inline: auto; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}

.mt-xs { margin-top: 8px; }
.mt-sm { margin-top: 12px; }
.mt-md { margin-top: 18px; }
.mt-lg { margin-top: 24px; }
.pt-md { padding-top: 20px; }
.stack-xs { display: grid; gap: 8px; }
.stack-sm { display: grid; gap: 12px; }
.inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.muted-text { color: var(--muted); font-size: 14px; }

.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: min(1180px, calc(100% - 2 * var(--gutter))); margin: 12px auto 0;
  min-height: 76px; padding: 0 12px 0 4px; position: relative; z-index: 2;
  color: var(--ink);
}
body.is-task-screen, body:has(.task-screen) {
  background: var(--ink);
  color: var(--on-dark);
}
body.is-task-screen .site-header, body:has(.task-screen) .site-header {
  color: var(--on-dark);
  border-color: transparent;
}
.brand { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.brand-logo { display: block; height: 50px; width: auto; max-width: none; object-fit: contain; }
.brand-logo-light { display: none; }
body.is-task-screen .brand-logo-dark, body:has(.task-screen) .brand-logo-dark { display: none; }
body.is-task-screen .brand-logo-light, body:has(.task-screen) .brand-logo-light { display: block; }

body.is-authorize-screen, body:has(.authorize-world) {
  background: var(--ink);
  color: var(--on-dark);
}
body.is-authorize-screen .site-header,
body.is-authorize-screen .site-footer,
body.is-error-screen .site-header,
body.is-error-screen .site-footer,
body:has(.authorize-world) .site-header,
body:has(.authorize-world) .site-footer,
body:has(.error-screen) .site-header,
body:has(.error-screen) .site-footer {
  display: none;
}

.authorize-world {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 15px; padding: clamp(24px, 5vw, 48px) 16px;
}
.authorize-header {
  display: grid; justify-items: center; gap: 6px;
  animation: task-enter 300ms var(--ease) both;
}
.authorize-top {
  display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px;
  font-size: clamp(18px, 2.4vw, 22px); font-weight: 600; color: var(--on-dark); letter-spacing: -.02em;
}
.authorize-icon { display: block; height: 30px; width: auto; }
.authorize-text-logo { display: block; height: 22px; width: auto; margin-top: 2px; }
.authorize-signed-in { font-size: 13px; color: #88919c; text-align: center; }
.authorize-signed-in strong { color: var(--on-dark); font-weight: 600; }
.authorize-switch {
  background: none; border: 0; padding: 0 2px; color: #88919c;
  font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}
.authorize-squircle {
  width: min(460px, 100%); background: #193454; color: var(--on-dark);
  border-radius: 28px; padding: clamp(24px, 4vw, 34px);
  box-shadow: 0 20px 50px rgba(4, 13, 25, .42);
  animation: field-enter 340ms 40ms var(--ease) both;
  transition: box-shadow 200ms var(--ease), border-color 200ms var(--ease);
}
.authorize-squircle.handoff-confirmed {
  border-color: rgba(255, 229, 160, .55);
  box-shadow: 0 0 0 3px rgba(255, 229, 160, .16), 0 20px 50px rgba(4, 13, 25, .42);
}
.authorize-squircle .skeleton {
  background: linear-gradient(90deg, rgba(255,253,248,.10) 25%, rgba(255,253,248,.04) 50%, rgba(255,253,248,.10) 75%);
  background-size: 200% 100%;
}
.authorize-squircle .notice.error {
  background: rgba(248, 113, 113, .14); color: #fecaca; border-color: rgba(248, 113, 113, .45);
  margin-top: 12px; margin-bottom: 0;
}
.authorize-app-name {
  font-size: clamp(28px, 4.5vw, 36px); font-weight: 750; line-height: 1.1;
  letter-spacing: -.04em; text-align: center; color: var(--on-dark); margin-bottom: 14px;
}
.authorize-subtitle { font-size: 15px; color: #c4d3e3; margin-bottom: 14px; }
.authorize-subtitle-center {
  text-align: center; margin-top: -12px; margin-bottom: 4px; padding-bottom: 16px;
  border-bottom: 1px solid rgba(213, 223, 235, .16);
}
.perm-list { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 10px; }
.perm-item { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 550; color: #eef3f8; }
.perm-icon {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid
}
.perm-icon-link svg { width: 25px; height: 25px; display: block; }
.perm-icon svg { width: 14px; height: 14px; display: block; }
.perm-icon-allow {
	color: #193454;
	background-color: #6ee7b7;
}
.perm-icon-deny { color: #193454; background-color: #fca5a5; }
.perm-icon-link { color: #dadada; border: none; font-size: 16px; }
.authorize-redirect {
  display: flex; align-items: flex-start; gap: 10px; text-align: left;
  font-size: 13.5px; line-height: 1.45; color: #c4d3e3;
  padding-top: 16px; margin-top: 16px; border-top: 1px solid rgba(213, 223, 235, .16); margin-bottom: 20px;
}
.authorize-redirect .perm-icon { margin-top: 1px; }
.authorize-origin { color: var(--on-dark); font-weight: 600; word-break: break-word; }
.authorize-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.authorize-actions-single { grid-template-columns: 1fr; }
.authorize-actions .button { justify-content: center; text-align: center; }
.authorize-squircle .button:not(.secondary) { background: #f2d991; color: var(--ink); border-color: transparent; }
.authorize-squircle .button.secondary { background: transparent; color: #dce6f2; border-color: rgba(213, 223, 235, .28); }
.authorize-status { font-size: 14px; color: #b5c6da; text-align: center; min-height: 1.4em; margin-top: 12px; }
.authorize-status:empty { display: none; }
.authorize-footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 16px;
  font-size: 13px; color: #d5dfeb;
}
.authorize-footer-logo { display: block; height: 22px; width: auto; }
.authorize-footer a {
  color: #d5dfeb; text-decoration: none; font-weight: 550;
  display: inline-flex; align-items: center; min-height: 36px;
}
.authorize-footer a:hover { text-decoration: underline; }

.error-screen {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  gap: 28px; padding: clamp(24px, 4vw, 48px) 16px;
}
.error-screen-dark { gap: 32px; }
.error-state {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 14px; max-width: 680px; width: 100%;
  animation: field-enter 300ms var(--ease) both;
}
.error-state-compact { gap: 12px; padding-block: 6px 2px; }
.error-logo {
  display: block; width: min(82vw, 52vh, 540px); height: auto; margin-bottom: 6px;
}
.error-state-compact .error-logo { width: min(72%, 260px); height: auto; }
.error-heading {
  display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 8px 14px; margin: 0; line-height: 1.25;
}
.error-code {
  font-size: clamp(24px, 3.8vw, 32px); font-weight: 800; letter-spacing: -.04em;
  font-variant-numeric: tabular-nums; color: #4568a2;
}
.error-state-dark .error-code { color: var(--accent); }
.error-state-compact .error-code { font-size: 22px; }
.error-divider {
  display: inline-block; width: 1.5px; height: 1.35em;
  background: currentColor; opacity: .28; flex: none;
}
.error-quip {
  font-size: clamp(18px, 2.5vw, 22px); font-weight: 650; letter-spacing: -.025em;
  color: var(--ink);
}
.error-state-dark .error-quip { color: var(--on-dark); }
.error-state-compact .error-quip { font-size: 17px; }
.error-detail {
  font-size: 15px; line-height: 1.55; color: var(--muted); max-width: 44ch;
}
.error-state-dark .error-detail { color: #c4d3e3; }
.error-meta { margin-top: -4px; font-size: 12.5px; color: var(--muted); }
.error-state-dark .error-meta { color: #88919c; }
.error-actions {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
  margin-top: 8px; width: 100%;
}
.error-state-dark .button:not(.secondary) {
  background: #f2d991; color: var(--ink); border-color: transparent;
}
.error-state-dark .button.secondary {
  background: transparent; color: #dce6f2; border-color: rgba(213, 223, 235, .28);
}
.error-footer { opacity: .88; color: var(--muted); }
.error-footer a { color: var(--muted); }
.error-screen-dark .error-footer,
.error-screen-dark .error-footer a { color: #d5dfeb; }

#top-nav { display: flex; align-items: center; gap: 8px; }
#top-nav:empty, #nav-toggle { display: none; }
#top-nav a, .footer-links a, .site-header > nav > a, .site-header > a:not(.brand) {
  color: inherit; display: inline-flex; align-items: center; min-height: 44px; min-width: 44px;
  padding: 4px 12px; font-weight: 600; font-size: 14px; border-radius: 8px;
  transition: background-color 140ms ease-out;
}
#top-nav a { text-decoration: none; }
#top-nav a[aria-current] { background: var(--soft); color: var(--ink); }
body.is-task-screen #top-nav a[aria-current], body:has(.task-screen) #top-nav a[aria-current] {
  background: var(--accent); color: var(--ink);
}

.site-footer { background: var(--ink); color: var(--on-dark); padding: 28px 0; }
.footer-inner {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "brand links" "brand copyright";
  align-items: center; gap: 4px 24px; border-top: 1px solid var(--navy-line); padding-top: 24px;
}
.footer-logo { grid-area: brand; display: block; height: 34px; width: auto; max-width: 100%; }
.footer-inner > span { grid-area: copyright; color: #d5dfeb; font-size: 13px; text-align: right; }
.footer-links { grid-area: links; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 8px; }
.footer-links a { padding-inline: 4px; color: #d5dfeb; }

.app-main { padding-block: clamp(36px, 5vw, 72px) clamp(52px, 8vw, 96px); }
.view-enter { animation: view-enter 200ms var(--ease) both; }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 28px; }
.label { font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #9d5910; }
.page-title { font-size: clamp(34px, 5vw, 56px); font-weight: 750; line-height: 1.02; letter-spacing: -.055em; text-wrap: balance; }
.page-description { color: var(--muted); max-width: 58ch; margin-top: 12px; }
.page-description:empty { display: none; }

.task-screen .app-main { padding-top: clamp(36px, 5vw, 72px); }
.task-screen .page-header { margin-bottom: clamp(24px, 4vw, 44px); }
.task-screen .page-header > div { width: 100%; }
.task-screen .page-title { color: var(--accent); max-width: 72%; font-size: clamp(38px, 5.8vw, 76px); }
.handoff .page-title { max-width: 12ch; text-wrap: initial; }
.handoff .task-grid { align-items: stretch; }
.task-screen .page-description { color: #d5dfeb; }
.task-grid { display: grid; grid-template-columns: minmax(0, 48fr) minmax(0, 50fr); gap: 2%; align-items: start; }
.card { min-width: 0; padding: clamp(20px, 2.4vw, 28px); border: 1px solid var(--line); background: var(--white); color: var(--ink); border-radius: 12px; }
.card p { color: var(--muted); margin-block: 10px 16px; font-size: 15px; }
.card p:last-child { margin-bottom: 0; }
.task-grid > .card { border-color: var(--navy-line); border-radius: 16px; }
.task-grid h2 { margin-bottom: 14px; }

.ring-panel { background: var(--soft); position: relative; overflow: hidden; isolation: isolate; }
.ring-panel::after {
  content: ""; position: absolute; pointer-events: none; z-index: -1;
  width: 240px; height: 240px; border: 1px solid #e9b968; border-radius: 50%;
  bottom: -130px; right: -70px;
  box-shadow: 0 0 0 40px var(--soft), 0 0 0 41px #e9b968, 0 0 0 80px var(--soft), 0 0 0 81px #e9b968;
  opacity: .42; transition: opacity 180ms ease-out;
}
.ring-panel.handoff-confirmed::after { opacity: .9; }
.request-panel { min-height: 192px; }
.request-panel .label { color: #75420c; font-size: 13px; margin: 0 0 12px; }
.request-panel h2 { font-size: clamp(26px, 3.2vw, 42px); }
.request-panel h3 { font-size: 14px; }
.scope-list { margin: 8px 0 0; padding-left: 20px; overflow-wrap: anywhere; }
.decision-panel { min-height: 192px; background: var(--ink); color: var(--on-dark); }
.decision-panel h2 { color: var(--accent); }
.decision-panel p { color: #d5dfeb; }
.handoff-actions { display: grid; gap: 12px; }
.handoff-status { min-height: 1.55em; }
.user-chip {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px;
  background: rgba(255, 253, 248, .85); color: var(--ink);
  border: 1px solid var(--control); border-radius: 999px;
  padding: 5px 12px; font-size: 13px; font-weight: 600; margin-bottom: 14px;
}
.decision-panel .user-chip {
  background: rgba(255, 253, 248, .12); color: var(--on-dark); border-color: var(--navy-line);
}

.auth-single .auth-panel { width: min(100%, 520px); }
.auth-context { background: rgba(255, 253, 248, .06); color: var(--on-dark); }
.auth-context p { margin: 0; color: #d5dfeb; }
.auth-divider {
  display: flex; align-items: center; gap: 12px; margin-block: 16px;
  color: var(--muted); font-size: 13px; font-weight: 600;
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.section { margin-bottom: 32px; min-width: 0; }
.section-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-heading h2 { font-size: 20px; }

.overview-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch; gap: 16px; margin-bottom: 32px;
}
.overview-grid .page-header { align-items: flex-start; margin: 0; }
.overview-grid .page-title { font-size: clamp(40px, 5.5vw, 72px); line-height: .96; }
.overview-grid .card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 18px;
  animation: field-enter 280ms var(--ease) both;
}
.overview-grid .card:nth-child(2) { animation-delay: 25ms; }
.overview-grid .card:nth-child(3) { animation-delay: 65ms; }
.overview-grid .card:nth-child(4) { animation-delay: 105ms; }
.overview-grid .card > div { min-width: 0; }
.overview-grid .card .button, .overview-grid .badge { margin-top: auto; }
.overview-primary { background: var(--soft); }
.account-bottom-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start;
}
.form-card { max-width: 520px; }

.toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px;
  padding-bottom: 16px; border-bottom: 1px solid var(--line);
}
.admin-panel-enter { animation: view-enter 180ms var(--ease) both; }
.admin-panel-split {
  display: grid; grid-template-columns: minmax(290px, 400px) minmax(0, 1fr);
  gap: 28px; align-items: start;
}
.admin-panel-wide { max-width: 960px; }
.records-page > .section { max-width: 760px; width: 100%; margin-inline: auto; }
.passkey-add-bar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px;
}
.passkey-add-bar .field { margin-bottom: 0; flex: 1 1 200px; }

.list { border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.list-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px; }
.list-row + .list-row { border-top: 1px solid var(--line); }
.app-edit-form {
  flex: 1 0 100%; margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--line);
  animation: status-enter 160ms var(--ease) both;
}
.app-edit-form .field { margin-bottom: 12px; }
.app-edit-form textarea { min-height: 88px; }
.records-page .list { border: 0; background: transparent; }
.records-page .list-row { padding: 20px 0; }
.records-page .row-main { position: relative; padding-left: 24px; }
.records-page .row-main::before { content: ""; position: absolute; left: 0; top: .65em; width: 9px; height: 9px; border-radius: 50%; background: var(--focus); }
.records-page .row-main strong { font-size: clamp(18px, 2.2vw, 24px); font-weight: 650; letter-spacing: -.03em; }
.row-main { min-width: 0; flex: 1 1 240px; overflow-wrap: anywhere; }
.row-main strong, .row-main small { display: block; }
.row-main small, .empty { color: var(--muted); font-size: 13.5px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.empty { padding: 20px; }

.badge-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.badge {
  display: inline-flex; align-items: center; background: var(--soft); color: var(--ink);
  border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 600;
}
.badge-ok { background: #e3f3ea; color: #154d30; }
.badge-warn { background: #fff0bd; color: #6e4508; }
.badge-danger { background: #fae9e6; color: #782a26; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 0.92em; white-space: pre-wrap; overflow-wrap: anywhere; }

.audit-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.audit-table { width: 100%; border-collapse: collapse; font-size: 13.5px; text-align: left; }
.audit-table th, .audit-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.audit-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--paper); white-space: nowrap; }
.audit-table tr:last-child td { border-bottom: 0; }

.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 14px; font-weight: 650; }
.field input, .field textarea, .field select {
  width: 100%; min-width: 0; min-height: 46px; padding: 10px 12px;
  border: 1px solid var(--control); border-radius: 8px; background: var(--white); color: var(--ink);
}
.field textarea { min-height: 100px; resize: vertical; }
.field-hint { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.captcha-slot { margin-bottom: 16px; min-height: 65px; }
.prereq-badges { margin-top: 0; margin-bottom: 14px; }
.checkbox-field {
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px;
  font-size: 14px; font-weight: 550; cursor: pointer;
}
.checkbox-field input[type="checkbox"] {
  width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ink); flex: none;
}

.password-wrap { position: relative; display: flex; align-items: center; }
.password-wrap input { padding-right: 72px; }
.password-toggle {
  position: absolute; right: 6px; min-height: 34px; min-width: 56px; padding: 4px 10px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink);
  font-size: 13px; font-weight: 600;
}

.button, .tab, .skip-link {
  display: inline-flex; justify-content: center; align-items: center; gap: 10px;
  background: var(--accent); color: var(--ink); border: 1px solid var(--control); border-radius: 8px;
  padding: 9px 16px; min-height: 44px; min-width: 44px; max-width: 100%;
  font-weight: 650; font-size: 14px; text-decoration: none; text-align: center; line-height: 1.35;
  transition: background-color 150ms ease-out, border-color 150ms ease-out, transform 120ms ease-out;
}
.button.small { min-height: 38px; padding: 6px 12px; font-size: 13.5px; }
.button.secondary, .tab { background: transparent; }
.button.danger { background: #fae9e6; color: #782a26; border-color: #ac423d; }
.button:active:not(:disabled) { transform: translateY(1px); }
.button:disabled { cursor: wait; opacity: .72; }
.button[aria-busy="true"]::before {
  content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin 700ms linear infinite; flex: none;
}
body.is-task-screen .site-header .button.secondary,
body:has(.task-screen) .site-header .button.secondary,
.decision-panel .button.secondary {
  color: var(--on-dark); border-color: var(--navy-line);
}
.tab[aria-current] { background: var(--soft); border-color: var(--focus); }
.full { width: 100%; }
.site-header .subtle-link { color: inherit; margin-top: 0; }
.subtle-link { display: inline-flex; align-items: center; min-height: 40px; min-width: 44px; margin-top: 6px; font-size: 14px; }

.notice {
  border: 1px solid var(--control); background: var(--soft); color: var(--ink);
  border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px;
  animation: status-enter 160ms var(--ease) both;
}
.notice.error { background: #fae9e6; color: #782a26; border-color: #ac423d; }

.loading-screen { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 55vh; }
.spinner { width: 20px; height: 20px; border: 2px solid var(--line); border-top-color: var(--focus); border-radius: 50%; animation: spin 800ms linear infinite; }
.skeleton {
  height: 18px; border-radius: 6px;
  background: linear-gradient(90deg, rgba(16,39,67,.08) 25%, rgba(16,39,67,.03) 50%, rgba(16,39,67,.08) 75%);
  background-size: 200% 100%; animation: shimmer 1.2s ease-in-out infinite;
}
.skeleton-lg { height: 32px; width: 65%; }
.skeleton-md { height: 18px; width: 85%; }

.modal {
  margin: auto; padding: clamp(20px, 3vw, 28px); width: min(460px, calc(100% - 2 * var(--gutter)));
  border: 1px solid var(--control); border-radius: 14px; background: var(--white); color: var(--ink);
  box-shadow: 0 24px 48px rgba(16, 39, 67, .24);
}
.modal::backdrop { background: rgba(16, 39, 67, .55); backdrop-filter: blur(2px); }
.modal[open] { animation: modal-enter 180ms var(--ease) both; }
.modal h2 { font-size: 22px; margin-bottom: 10px; }
.modal p { color: var(--muted); font-size: 15px; margin-bottom: 16px; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.legal-wrap { max-width: 760px; padding-block: 48px 80px; margin-inline: auto; width: calc(100% - 2 * var(--gutter)); }
.legal-wrap h1 { font-size: clamp(36px, 6vw, 60px); line-height: 1.05; letter-spacing: -.055em; }
.legal-wrap h2 { margin-bottom: 12px; }
.legal-wrap section { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 24px; }
.legal-date, .legal-lead { margin-top: 12px; }
.legal-wrap a { overflow-wrap: anywhere; }

.task-screen [data-enter] { animation: task-enter var(--entry-duration, 360ms) var(--ease) both; }
.task-screen .task-grid > .card:nth-child(1) { animation: field-enter 360ms 30ms var(--ease) both; }
.task-screen .task-grid > .card:nth-child(2) { animation: field-enter 360ms 80ms var(--ease) both; }
.handoff { --entry-duration: 380ms; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes view-enter { from { opacity: .6; transform: translateY(6px); } }
@keyframes task-enter { from { opacity: .75; transform: translateY(8px); } }
@keyframes field-enter { from { opacity: .7; transform: translateY(10px); } }
@keyframes status-enter { from { opacity: 0; transform: translateY(-2px); } }
@keyframes menu-enter { from { opacity: 0; transform: translateY(-6px); } }
@keyframes modal-enter { from { opacity: 0; transform: scale(.97) translateY(6px); } }

@media (hover: hover) and (pointer: fine) {
  .button:not(:disabled):hover, .tab:hover, .password-toggle:hover { background: var(--soft); color: var(--ink); border-color: var(--focus); }
  .authorize-squircle .button:not(.secondary):not(:disabled):hover,
  .error-state-dark .button:not(.secondary):not(:disabled):hover { background: var(--accent); color: var(--ink); border-color: transparent; }
  .authorize-squircle .button.secondary:not(:disabled):hover,
  .error-state-dark .button.secondary:not(:disabled):hover { background: rgba(255, 253, 248, .08); color: var(--on-dark); border-color: rgba(213, 223, 235, .5); }
  .button.danger:not(:disabled):hover { background: #f4d8d3; color: #782a26; border-color: #8f2f2b; }
  #top-nav a:hover { background: rgba(16, 39, 67, .06); }
  body.is-task-screen #top-nav a:hover, body:has(.task-screen) #top-nav a:hover { background: rgba(255, 253, 248, .12); }
}
@media (max-width: 959px) {
  .task-grid { grid-template-columns: minmax(0, 640px); gap: 16px; }
  .task-grid > .auth-context { padding: 0; border: 0; }
  .task-screen .page-title { max-width: 14ch; }
  .handoff .page-title { max-width: 12ch; }
  .admin-panel-split { grid-template-columns: 1fr; gap: 24px; }
  .account-bottom-grid { grid-template-columns: 1fr; }
}
@media (max-width: 639px) {
  #nav-toggle { display: inline-flex; }
  #top-nav {
    position: absolute; top: calc(100% + 8px); right: 0; flex-direction: column; align-items: stretch;
    padding: 8px; min-width: 185px; background: var(--paper); border: 1px solid var(--line);
    border-radius: 10px; box-shadow: 0 12px 28px rgba(16, 39, 67, .16); z-index: 20;
    animation: menu-enter 160ms var(--ease) both;
  }
  body.is-task-screen #top-nav, body:has(.task-screen) #top-nav { background: var(--ink); border-color: var(--navy-line); }
  .brand-logo { height: 42px; }
  .footer-inner { grid-template-columns: 1fr; grid-template-areas: "links" "brand" "copyright"; }
  .footer-links { justify-content: flex-start; }
  .footer-logo { height: 30px; width: auto; }
  .footer-inner > span { text-align: left; }
  .page-header { display: grid; justify-items: start; }
  .handoff .page-title { max-width: 9ch; }
  .task-screen .app-main { padding-top: 28px; }
  .overview-grid { grid-template-columns: 1fr; gap: 12px; margin-bottom: 24px; }
  .overview-grid .page-header { margin-bottom: 4px; }
  .overview-grid .page-title { font-size: clamp(36px, 9.5vw, 48px); }
  .overview-grid .card { min-height: 0; gap: 16px; }
  .overview-grid .card .button { width: 100%; margin-top: 0; }
  .overview-grid .badge { margin-top: 0; }
  .list-row { flex-wrap: wrap; }
  .records-page .list-row { flex-direction: column; align-items: flex-start; }
  .records-page .row-actions { padding-left: 24px; }
}
@media (max-width: 479px) {
  .error-heading { flex-direction: column; gap: 4px; }
  .error-divider { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
