
:root {
  color-scheme: light dark;
  --bg: #f6f8ff;
  --surface: #ffffff;
  --surface-muted: #f0f4fc;
  --surface-hover: #f8faff;
  --text: #0f172a;
  --muted: #50607a;
  --muted-strong: #3c4a63;
  --border: #d8e0f0;
  --border-strong: #c2cce0;
  --accent: #4338ca;
  --accent-hover: #3730a3;
  --accent-muted: rgba(67, 56, 202, 0.09);
  --accent-fg: #ffffff;
  --danger: #c4221c;
  --danger-muted: rgba(196, 34, 28, 0.08);
  --success: #15803d;
  --success-muted: rgba(21, 128, 61, 0.09);
  --focus: #4338ca;
  --focus-ring: rgba(67, 56, 202, 0.28);
  --shadow-xs: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.08), 0 1px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 16px 48px rgba(15, 23, 42, 0.12), 0 4px 12px rgba(15, 23, 42, 0.06);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-btn: 11px;
  --radius-chip: 8px;
  --radius-full: 9999px;
  --bg-gradient: radial-gradient(ellipse 820px 620px at 8% -12%, rgba(67, 56, 202, 0.06) 0%, transparent 64%), radial-gradient(ellipse 620px 520px at 92% 112%, rgba(109, 40, 217, 0.045) 0%, transparent 64%);
  --btn-primary-bg: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
  --btn-primary-solid: #4338ca;
  --btn-primary-shadow: rgba(67, 56, 202, 0.28);
  --brand-gradient: linear-gradient(125deg, #4338ca 0%, #6d28d9 100%);
  --header-bg: rgba(255, 255, 255, 0.85);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04";
}

:root[data-theme="dark"] {
  --bg: #080b13;
  --surface: #0e1424;
  --surface-muted: #131d31;
  --surface-hover: #18253c;
  --text: #e8eefb;
  --muted: #9caac6;
  --muted-strong: #c4cee2;
  --border: #253651;
  --border-strong: #34496c;
  --accent: #93a0fb;
  --accent-hover: #b4c0ff;
  --accent-muted: rgba(147, 160, 251, 0.15);
  --accent-fg: #ffffff;
  --danger: #fb8585;
  --danger-muted: rgba(251, 133, 133, 0.12);
  --success: #5fd98c;
  --success-muted: rgba(95, 217, 140, 0.12);
  --focus: #93a0fb;
  --focus-ring: rgba(147, 160, 251, 0.32);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 1px rgba(0, 0, 0, 0.24);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.38), 0 1px 4px rgba(0, 0, 0, 0.22);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.55);
  --bg-gradient: radial-gradient(ellipse 800px 600px at 10% -10%, rgba(79, 70, 229, 0.18) 0%, transparent 65%), radial-gradient(ellipse 600px 500px at 90% 110%, rgba(124, 58, 237, 0.12) 0%, transparent 65%);
  --btn-primary-bg: linear-gradient(135deg, #5b52e8 0%, #7c3aed 100%);
  --btn-primary-solid: #5b52e8;
  --btn-primary-shadow: rgba(91, 82, 232, 0.4);
  --brand-gradient: linear-gradient(125deg, #a5b0ff 0%, #c4b5fd 100%);
  --header-bg: rgba(11, 16, 28, 0.86);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #080b13;
    --surface: #0e1424;
    --surface-muted: #131d31;
    --surface-hover: #18253c;
    --text: #e8eefb;
    --muted: #9caac6;
    --muted-strong: #c4cee2;
    --border: #253651;
    --border-strong: #34496c;
    --accent: #93a0fb;
    --accent-hover: #b4c0ff;
    --accent-muted: rgba(147, 160, 251, 0.15);
    --accent-fg: #ffffff;
    --danger: #fb8585;
    --danger-muted: rgba(251, 133, 133, 0.12);
    --success: #5fd98c;
    --success-muted: rgba(95, 217, 140, 0.12);
    --focus: #93a0fb;
    --focus-ring: rgba(147, 160, 251, 0.32);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 1px rgba(0, 0, 0, 0.24);
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.38), 0 1px 4px rgba(0, 0, 0, 0.22);
    --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.55);
    --bg-gradient: radial-gradient(ellipse 820px 620px at 8% -12%, rgba(99, 102, 241, 0.18) 0%, transparent 64%), radial-gradient(ellipse 620px 520px at 92% 112%, rgba(139, 92, 246, 0.12) 0%, transparent 64%);
    --btn-primary-bg: linear-gradient(135deg, #5b52e8 0%, #7c3aed 100%);
    --btn-primary-solid: #5b52e8;
    --btn-primary-shadow: rgba(91, 82, 232, 0.4);
    --brand-gradient: linear-gradient(125deg, #a5b0ff 0%, #c4b5fd 100%);
    --header-bg: rgba(11, 16, 28, 0.86);
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background-color: var(--bg);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--text);
}

body {
  margin: 0;
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner,
.footer-inner,
.page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  line-height: 1.2;
  gap: 2px;
}

.brand strong {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--accent);
}

.brand span {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.01em;
}

nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

nav a,
.theme-toggle,
button,
.button {
  min-height: 40px;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-chip);
}

nav a:hover {
  background: var(--surface-muted);
  color: var(--text);
}

nav a[aria-current="page"] {
  background: var(--accent-muted);
  color: var(--accent);
  font-weight: 700;
}

.theme-toggle,
button,
.button {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--surface);
  color: var(--muted-strong);
  padding: 0.5rem 1.05rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

button.primary,
.button.primary {
  background-color: var(--btn-primary-solid);
  background-image: var(--btn-primary-bg);
  border-color: transparent;
  color: var(--accent-fg);
  font-weight: 700;
  padding: 0.6rem 1.5rem;
  box-shadow: 0 2px 10px var(--btn-primary-shadow), 0 1px 3px rgba(0, 0, 0, 0.08);
}

button.primary:hover,
.button.primary:hover {
  transform: translateY(-1px);
  background-color: var(--btn-primary-solid);
  background-image: var(--btn-primary-bg);
  box-shadow: 0 6px 22px var(--btn-primary-shadow), 0 2px 6px rgba(0, 0, 0, 0.1);
  border-color: transparent;
  color: var(--accent-fg);
}

button.primary:active,
.button.primary:active {
  transform: translateY(0);
}

button:hover,
.button:hover,
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface-hover);
}

.page {
  padding: 52px 0 72px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(290px, 0.7fr);
  gap: 40px;
  align-items: start;
}

.home-hero {
  grid-template-columns: minmax(0, 760px);
}

h1,
h2,
h3 {
  line-height: 1.15;
  margin: 0 0 0.7rem;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 4rem);
  max-width: 14ch;
  font-weight: 800;
}

h2 {
  font-size: 1.45rem;
  font-weight: 700;
}

h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

p {
  margin: 0 0 1rem;
}

.lead {
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  max-width: 56rem;
  line-height: 1.65;
}

.body-copy {
  max-width: 64rem;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: var(--radius-chip);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  background: var(--accent-muted);
  color: var(--accent);
  margin-bottom: 18px;
}

.panel,
.stat,
.notice {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel {
  padding: clamp(24px, 4vw, 36px);
}

.notice {
  padding: 11px 16px;
  margin: 0 0 22px;
  box-shadow: none;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.notice-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.notice.error {
  border-color: color-mix(in srgb, var(--danger) 30%, var(--border));
  background: var(--danger-muted);
  color: var(--danger);
}

.notice.success {
  border-color: color-mix(in srgb, var(--success) 30%, var(--border));
  background: var(--success-muted);
  color: var(--success);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.field {
  display: grid;
  gap: 6px;
}

.field.full,
.fieldset.full {
  grid-column: 1 / -1;
}

label {
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.01em;
}

legend {
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0 6px;
}

.hint,
.meta {
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.5;
}

input,
select,
textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  padding: 0.7rem 0.875rem;
  font: inherit;
  font-size: 0.95rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

input[readonly] {
  background: var(--surface-muted);
  color: var(--muted);
}

textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.6;
}

fieldset {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 0;
  background: var(--surface-muted);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 6px 16px;
  margin-top: 12px;
}

.check {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  font-weight: 400;
  font-size: 0.92rem;
  padding: 5px 6px;
  border-radius: 6px;
  cursor: pointer;
}

.check:hover {
  background: var(--accent-muted);
}

.check input {
  width: 16px;
  height: 16px;
  margin-top: 0.22rem;
  accent-color: var(--accent);
  cursor: pointer;
}

.check span {
  color: var(--muted);
  line-height: 1.5;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
  align-items: center;
}

details {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--surface-muted);
}

.details-grid {
  margin-top: 16px;
}

summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.93rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  user-select: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary::before {
  content: '›';
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1;
  color: var(--muted);
  display: inline-block;
}

details[open] summary::before {
  transform: rotate(90deg);
}

.dashboard-holding {
  margin: 40px 0;
  padding: clamp(28px, 5vw, 48px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  color: var(--muted);
}

.dashboard-holding p:first-child {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 16px;
  margin: 28px 0;
}

.stat {
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.stat:nth-child(1)::before { background: linear-gradient(90deg, #4f46e5, #7c3aed); }
.stat:nth-child(2)::before { background: linear-gradient(90deg, #0891b2, #0e7490); }
.stat:nth-child(3)::before { background: linear-gradient(90deg, #7c3aed, #a855f7); }
.stat:nth-child(4)::before { background: linear-gradient(90deg, #059669, #10b981); }
.stat:nth-child(5)::before { background: linear-gradient(90deg, #d97706, #f59e0b); }
.stat:nth-child(6)::before { background: linear-gradient(90deg, #dc2626, #ef4444); }

.stat strong {
  display: block;
  font-size: 2.5rem;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 6px;
}

.stat span {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.4;
}

.breakdowns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.breakdowns .panel:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.breakdown-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.breakdown-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.breakdown-list li:last-child {
  border-bottom: none;
}

.breakdown-list li span {
  color: var(--muted);
}

.breakdown-list li strong {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-muted);
  padding: 2px 9px;
  border-radius: var(--radius-chip);
  white-space: nowrap;
  min-width: 28px;
  text-align: center;
}

.site-footer {
  border-top: 1px solid var(--border);
}

.footer-inner {
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}

.footer-nav a {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--accent);
}

/* Home hero + register panel */
.hero-copy,
.hero-aside {
  min-width: 0;
}

.register-panel h2 {
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.register-panel .actions {
  margin-top: 18px;
}

.register-panel .primary {
  width: 100%;
}

.auth-panel {
  max-width: 620px;
  margin: 0 auto;
}

.auth-panel h1 {
  max-width: 18ch;
}

.form-foot-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

.form-foot-note svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.trust-row {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 11px 22px;
  padding: 0;
  margin: 26px 0 0;
}

.trust-row li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.trust-row svg {
  color: var(--accent);
}

/* Home features */
.features {
  margin-top: clamp(56px, 9vw, 96px);
}

.features-head {
  max-width: 62ch;
  margin-bottom: 26px;
}

.section-lead {
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.12rem);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 18px;
}

.feature-card {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}

.feature-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.feature-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--accent-muted);
  color: var(--accent);
}

.feature-card h3 {
  margin: 2px 0 0;
  font-size: 1.05rem;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* Home closing CTA */
.home-cta {
  margin-top: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  background: linear-gradient(0deg, var(--accent-muted), var(--accent-muted)), var(--surface);
}

.home-cta h2 {
  margin-bottom: 6px;
}

.home-cta p {
  margin: 0;
  max-width: 60ch;
  color: var(--muted);
}

.home-cta .primary {
  flex-shrink: 0;
}

/* Authenticated response form */
.app-panel {
  padding: clamp(22px, 4vw, 36px);
}

.app-head {
  margin-bottom: 24px;
}

.app-head h1 {
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  max-width: 22ch;
}

.tablist-wrap {
  margin-bottom: 26px;
}

.tab-select-wrap {
  display: none;
  grid-template-columns: 1fr;
  gap: 7px;
}

.tab-select-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.tab-select {
  font-weight: 600;
  font-size: 0.98rem;
  padding: 0.78rem 0.9rem;
}

.tablist {
  display: flex;
  gap: 4px;
  padding: 5px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  scrollbar-width: thin;
}

.tab {
  flex: 1 1 0;
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0.6rem 0.95rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted-strong);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.tab:hover {
  color: var(--text);
  background: var(--surface-hover);
  border-color: transparent;
}

.tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}

.tab-index {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: var(--radius-chip);
  background: var(--accent-muted);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
}

.tab[aria-selected="true"] .tab-index {
  background: var(--btn-primary-bg);
  color: var(--accent-fg);
}

.tab-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background: var(--success);
  opacity: 0;
}

.tab.has-content .tab-dot {
  opacity: 1;
}

.tab-progress {
  height: 4px;
  margin-top: 10px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.tab-progress span {
  display: block;
  height: 100%;
  width: 25%;
  border-radius: inherit;
  background: var(--btn-primary-bg);
}

.tabpanel {
  outline: none;
}

.tabpanel[hidden] {
  display: none;
}

#response-form:not(.tabs-ready) .tabpanel + .tabpanel {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}

.panel-title {
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 1.3rem;
}

.panel-desc {
  margin: 0 0 22px;
  max-width: 64ch;
  color: var(--muted);
  font-size: 0.95rem;
}

.optional-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-muted);
  padding: 3px 9px;
  border-radius: var(--radius-chip);
}

.field-error {
  display: none;
  align-items: center;
  gap: 6px;
  margin: 2px 0 0;
  color: var(--danger);
  font-size: 0.83rem;
  font-weight: 600;
}

.field-error svg {
  flex-shrink: 0;
}

.field.has-error .field-error {
  display: flex;
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: var(--danger);
}

.field.has-error input:focus,
.field.has-error textarea:focus {
  box-shadow: 0 0 0 3px var(--danger-muted);
}

.form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.form-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.button.ghost {
  background: transparent;
}

.draft-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.83rem;
  color: var(--muted);
}

.draft-status::before {
  content: "";
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--muted);
}

.draft-status.is-saved::before {
  background: var(--success);
}

.draft-status.is-restored::before {
  background: var(--accent);
}

.link-btn {
  min-height: 0;
  margin-left: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.83rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.link-btn:hover {
  border: 0;
  background: none;
  color: var(--accent-hover);
}

@media (max-width: 780px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
    gap: 10px;
  }

  .hero,
  .form-grid,
  .breakdowns {
    grid-template-columns: 1fr;
  }

  h1 {
    max-width: 100%;
  }

  nav {
    gap: 2px;
  }

  .home-cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .home-cta .primary {
    width: 100%;
  }

  .tab {
    flex: 0 0 auto;
    padding: 0.55rem 0.8rem;
  }

  .tablist {
    display: none;
  }

  .tab-select-wrap {
    display: grid;
  }

  .form-foot {
    flex-direction: column;
    align-items: stretch;
  }

  .form-nav {
    width: 100%;
  }

  .form-nav .primary,
  .form-nav .button {
    flex: 1 1 auto;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: no-preference) {
  nav a,
  .theme-toggle,
  button,
  .button {
    transition: border-color 140ms, background 140ms, color 140ms, box-shadow 140ms, transform 80ms;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  }

  input,
  select,
  textarea {
    transition: border-color 150ms, box-shadow 150ms;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  }

  .stat,
  .breakdowns .panel,
  .feature-card {
    transition: transform 150ms, box-shadow 150ms, border-color 150ms;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  }

  .tab {
    transition: background 140ms, color 140ms, border-color 140ms, box-shadow 140ms;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  }

  .tab-progress span {
    transition: width 220ms cubic-bezier(0.4, 0, 0.2, 1);
  }

  .tab-dot {
    transition: opacity 160ms ease;
  }

  .check {
    transition: background 120ms cubic-bezier(0.4, 0, 0.2, 1);
  }

  summary::before {
    transition: transform 180ms cubic-bezier(0.4, 0, 0.2, 1);
  }
}
