:root {
  --h5-ink: #25343d;
  --h5-muted: #657785;
  --h5-primary: #18b889;
  --h5-primary-strong: #119672;
  --h5-primary-soft: #e7f8f2;
  --h5-blue: #4398e8;
  --h5-blue-strong: #267ac5;
  --h5-blue-soft: #e8f3fd;
  --h5-warning: #b77916;
  --h5-danger: #d94b50;
  --h5-paper: #fff;
  --h5-canvas: #f6f9fa;
  --h5-line: #e5edf0;
  --h5-radius-sm: 12px;
  --h5-radius-md: 16px;
  --h5-radius-lg: 24px;
  --h5-space-1: 4px;
  --h5-space-2: 8px;
  --h5-space-3: 12px;
  --h5-space-4: 16px;
  --h5-space-5: 20px;
  --h5-space-6: 24px;
  --h5-control-height: 48px;
  --h5-shadow: 0 6px 24px rgba(38, 80, 94, .06);
  --h5-gradient-primary: linear-gradient(135deg, #18b889 0%, #4bbfba 48%, #4398e8 100%);
  --h5-gradient-soft: linear-gradient(135deg, #dff7ed 0%, #e9f3fe 100%);
  --h5-gradient-hero: linear-gradient(180deg, #20bfa1 0%, #a9d6eb 55%, #f7fafc 100%);
  --color-primary: var(--h5-primary);
  --color-primary-dark: var(--h5-primary-strong);
  --color-primary-light: var(--h5-primary-soft);
  --color-secondary: var(--h5-blue);
  --color-secondary-dark: var(--h5-blue-strong);
  --color-secondary-light: var(--h5-blue-soft);
  --color-background: var(--h5-canvas);
  --color-surface: var(--h5-paper);
  --color-text-primary: var(--h5-ink);
  --color-text-secondary: var(--h5-muted);
  --color-success: #168568;
  --color-info: var(--h5-blue-strong);
  --color-warning: var(--h5-warning);
  --color-danger: var(--h5-danger);
  --gradient-primary: var(--h5-gradient-primary);
  --gradient-soft: var(--h5-gradient-soft);
  --gradient-hero: var(--h5-gradient-hero);
  --radius-small: var(--h5-radius-sm);
  --radius-medium: var(--h5-radius-md);
  --radius-card: var(--h5-radius-lg);
  --radius-pill: 999px;
  --shadow-card: var(--h5-shadow);
  --glass-background: rgba(255, 255, 255, .45);
  --glass-border: rgba(255, 255, 255, .55);
  --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", Inter, sans-serif;
  --h5-keyboard-offset: 0px;
  --ink: var(--h5-ink);
  --muted: var(--h5-muted);
  --green: var(--h5-primary);
  --green2: var(--h5-primary-strong);
  --green-2: var(--h5-primary-strong);
  --mint: var(--h5-primary-soft);
  --pale: var(--h5-primary-soft);
  --blue: var(--h5-blue);
  --bluebg: var(--h5-blue-soft);
  --amber: var(--h5-warning);
  --amberbg: #fff5e7;
  --orange: var(--h5-warning);
  --red: var(--h5-danger);
  --redbg: #fff0ed;
  --paper: var(--h5-paper);
  --bg: var(--h5-canvas);
  --line: var(--h5-line);
  --shadow: var(--h5-shadow);
  font-family: var(--font-family);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: clip; }
body { -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; }
button, [role="button"], a[href] {
  min-height: var(--h5-control-height) !important;
  touch-action: manipulation;
}
button:active:not(:disabled), [role="button"]:active:not([aria-disabled="true"]) {
  filter: brightness(.94);
}
button:disabled, [aria-disabled="true"] {
  cursor: not-allowed;
  filter: saturate(.55);
}
button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, a[href]:focus-visible, [role="button"]:focus-visible {
  outline: 3px solid #79a98a;
  outline-offset: 3px;
}
input, select, textarea { min-width: 0; max-width: 100%; }
.app, .page, .screen, main { min-width: 0; max-width: 100%; }
.footer, .mobile-footer, .bottom-actions, [data-sticky-actions] {
  bottom: var(--h5-keyboard-offset, 0px);
  transition: bottom .12s ease-out;
}
img { max-width: 100%; height: auto; }
.question[aria-invalid="true"] { border-color: #b64f47; }
.h5-validation-error {
  margin: 8px 0 0;
  color: #a5403d;
  font-size: 12px;
  line-height: 1.5;
}
@media (max-width: 599px) {
  input:not([type="checkbox"]):not([type="radio"]), select, textarea {
    font-size: max(16px, 1em);
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

.top.management-nav { padding: calc(10px + env(safe-area-inset-top)) 20px 10px; }
.top.management-nav .toprow { min-height: 48px; gap: 12px; }
.top.management-nav #back { display: none; }
.top.management-nav .brand { position: static; max-width: calc(100% - 94px); margin-right: auto; transform: none; gap: 9px; font-size: 15px; white-space: nowrap; }
.top.management-nav .brand-logo { width: 34px; height: 34px; flex: 0 0 34px; object-fit: cover; border-radius: 12px; }
.top.management-nav .headstatus { min-width: 68px; min-height: 40px; padding: 0 2px 0 8px; color: var(--h5-primary-strong); font-size: 13px; font-weight: 650; }
.screen.management-screen { display: flex; min-height: calc(100dvh - 68px); flex-direction: column; gap: 20px; padding: 20px 20px calc(24px + env(safe-area-inset-bottom)); }
.management-home-theme .app { background: var(--h5-canvas); }
.management-service { padding: 22px; border: 1px solid rgba(255,255,255,.86); border-radius: var(--h5-radius-lg); background: var(--h5-gradient-soft); }
.management-kicker { display: block; color: var(--h5-primary-strong); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.management-service h1 { margin: 7px 0 6px; color: var(--h5-ink); font-size: 25px; line-height: 1.25; letter-spacing: -.02em; }
.management-service-name { margin: 0; color: var(--h5-muted); font-size: 15px; line-height: 1.5; }
.management-status { display: inline-flex; align-items: center; min-height: 28px; margin-top: 14px; padding: 3px 11px; border-radius: 999px; background: rgba(24,184,137,.11); color: #11795e; font-size: 12px; font-weight: 650; }
.management-disclaimer { margin: 12px 0 0; color: #657785; font-size: 12px; line-height: 1.5; }
.management-task { padding: 20px; border: 1px solid var(--h5-line); border-radius: var(--h5-radius-lg); background: #fff; }
.management-task h2 { margin: 7px 0 6px; color: var(--h5-ink); font-size: 20px; line-height: 1.35; }
.management-task > p { margin: 0; color: var(--h5-muted); font-size: 14px; line-height: 1.55; }
.management-action { width: 100%; margin-top: 18px; border-radius: 16px !important; }
.management-error { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding: 12px; border-radius: 12px; background: #fff5e7; color: #80591f; font-size: 12px; line-height: 1.45; }
.management-error button { flex: none; min-height: 36px !important; padding: 0 10px; border-radius: 10px; background: #fff; color: #11795e; font-size: 12px; font-weight: 650; }
.management-records { overflow: hidden; border: 1px solid var(--h5-line); border-radius: 18px; background: #fff; }
.management-records h2 { margin: 0; padding: 17px 16px 10px; color: var(--h5-ink); font-size: 16px; }
.management-row { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 0; background: #fff; text-align: left; }
.management-row + .management-row { border-top: 1px solid var(--h5-line); }
.management-row span { display: grid; gap: 4px; }
.management-row strong { color: var(--h5-ink); font-size: 14px; font-weight: 650; }
.management-row small { color: var(--h5-muted); font-size: 12px; line-height: 1.4; }
.management-row i { color: #8b9aa3; font-size: 24px; font-style: normal; line-height: 1; }
.footer.management-footer { display: none !important; }
.health-profile-overlay { position: fixed; z-index: 30; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding: 20px 16px env(safe-area-inset-bottom); background: rgba(24,40,46,.32); }
.health-profile-sheet { position: relative; width: min(100%, 480px); padding: 24px 20px 20px; border-radius: 24px 24px 18px 18px; background: #fff; box-shadow: 0 -10px 36px rgba(37,52,61,.14); }
.health-profile-sheet h2 { margin: 0 34px 18px 0; color: var(--h5-ink); font-size: 20px; }
.health-profile-close { position: absolute; top: 15px; right: 16px; width: 36px; min-height: 36px !important; border-radius: 50%; background: #f1f5f6; color: #52646d; font-size: 24px; line-height: 1; }
.profile-data-row { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--h5-line); color: var(--h5-muted); font-size: 14px; }
.profile-data-row strong { color: var(--h5-ink); font-weight: 600; }
.management-profile-empty { color: var(--h5-muted); font-size: 14px; line-height: 1.5; }
@media (max-width: 360px) {
  .screen.management-screen { gap: 16px; padding-right: 16px; padding-left: 16px; }
  .management-service, .management-task { padding: 18px; }
  .management-service h1 { font-size: 23px; }
  .top.management-nav { padding-right: 16px; padding-left: 16px; }
  .top.management-nav .brand { font-size: 14px; }
}

.health-page { min-height: 100dvh; background: var(--color-background); color: var(--color-text-primary); font-family: var(--font-family); }
.health-hero { padding: 24px 20px 28px; border-radius: 0 0 28px 28px; background: var(--gradient-hero); }
.health-hero .eyebrow { color: #176e66; font-size: 12px; }
.health-hero .h1 { max-width: 360px; margin-top: 12px; color: #173b3a; font-size: 28px; line-height: 1.25; letter-spacing: -.02em; }
.health-hero .sub { max-width: 34em; color: #355c62; font-size: 15px; line-height: 1.55; }
.glass-card { border: 1px solid var(--glass-border); border-radius: var(--radius-card); background: var(--glass-background); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.health-card { border: 1px solid var(--h5-line); border-radius: var(--radius-card); background: var(--color-surface); padding: 20px; box-shadow: var(--shadow-card); }
.primary-button { min-height: 52px; border: 0; border-radius: var(--radius-pill); background: var(--color-primary); color: #fff; font-size: 16px; font-weight: 600; }
.app { background: rgba(255, 255, 255, .96); }
.top { background: rgba(255, 255, 255, .78); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); }
.screen { padding-right: 20px; padding-left: 20px; }
.btn { min-height: 52px; border-radius: 999px; background: var(--color-primary); font-size: 16px; box-shadow: 0 8px 20px rgba(24, 184, 137, .16); }
.btn.secondary { background: var(--color-primary-light); color: var(--color-primary-dark); }
.btn.ghost { border-color: var(--h5-line); color: var(--color-primary-dark); }
.h1 { font-size: 28px; line-height: 1.28; letter-spacing: -.02em; }
.sub { font-size: 15px; line-height: 1.6; }
.card { padding: 18px; border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.cardhead h2 { font-size: 17px; }
.minor, .field-label { font-size: 13px; }
.field { min-height: 48px; border-color: var(--h5-line); border-radius: var(--radius-small); font-size: 16px; }
.notice { border-radius: var(--radius-small); font-size: 13px; line-height: 1.55; }
.pill { font-size: 12px; }
.question { padding: 16px; border-radius: var(--radius-medium); }
.qmeta { font-size: 12px; }
.question h2 { font-size: 16px; line-height: 1.5; }
.choice { min-height: 48px; border-color: var(--h5-line); border-radius: var(--radius-small); font-size: 14px; }
.result-hero { padding: 20px; border-radius: var(--radius-card); background: var(--gradient-primary); }
.result-hero h1 { font-size: 24px; }
.result-hero p { font-size: 14px; }
.report-cover { background: var(--gradient-primary); }
.report-page .report-cover .report-eyebrow, .report-cover .report-title, .report-cover .report-subtitle, .report-cover .report-meta { color: #fff; }
.report-cover .report-title { font-size: 28px; letter-spacing: -.02em; }
.report-cover .report-meta span { border-color: rgba(255,255,255,.42); background: rgba(255,255,255,.18); }
.report-status-panel, .report-segmented, .report-card, .report-list, .report-empty, .report-status-card { border-color: var(--h5-line); box-shadow: var(--shadow-card); }
.report-list-row, .report-enrollment-card { min-height: 52px; }
.report-next-step { margin: 18px 15px 24px; padding: 20px; border: 1px solid rgba(255,255,255,.8); border-radius: 24px; background: linear-gradient(135deg, rgba(224,248,238,.92), rgba(232,243,253,.94)); box-shadow: 0 10px 28px rgba(48,105,104,.08); }
.report-next-step-label { color: var(--h5-primary-strong); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.report-next-step h2 { margin: 6px 0 8px; color: #183f38; font-size: 19px; line-height: 1.3; letter-spacing: -.01em; }
.report-next-step p { margin: 0; color: #49656a; font-size: 14px; line-height: 1.55; }
.report-next-step-status { display: inline-block; margin-top: 12px; color: var(--h5-blue-strong); font-size: 12px; }
.report-flow-steps { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin: 10px 0 16px; padding: 0; list-style: none; }
.report-flow-steps li { display: flex; align-items: center; gap: 6px; min-width: 0; color: #7a8b91; font-size: 11px; white-space: nowrap; }
.report-flow-steps li span { display: grid; flex: 0 0 24px; width: 24px; height: 24px; place-items: center; border: 1px solid var(--h5-line); border-radius: 50%; background: #fff; font-size: 10px; }
.report-flow-steps li.current { color: var(--h5-primary-strong); font-weight: 700; }
.report-flow-steps li.current span, .report-flow-steps li.done span { border-color: transparent; background: var(--h5-gradient-primary); color: #fff; }
.report-category-group + .report-category-group { margin-top: 15px; }
.report-category-group h4 { margin: 0 0 8px; color: var(--h5-muted); font-size: 12px; font-weight: 600; }
.report-category-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.report-category-option { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 9px 11px; border: 1px solid var(--h5-line); border-radius: 12px; background: rgba(255,255,255,.82); color: var(--h5-ink); font-size: 13px; line-height: 1.35; }
.report-category-option input { flex: 0 0 auto; accent-color: var(--h5-primary-strong); }
.report-upload-subhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 20px; }
.report-upload-subhead h3 { margin: 0; font-size: 16px; }
.report-upload-subhead span { color: var(--h5-muted); font-size: 11px; }
.report-picker-row { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-top: 12px; }
.report-picker-row .btn { padding: 0 8px; font-size: 12px; }
.report-picker-row .btn:disabled { opacity: .55; }
.toast { font-size: 13px; }
.footer { background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,.94) 20%, rgba(255,255,255,.98)); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }

@media (max-width: 380px) {
  .report-flow-steps { gap: 4px; }
  .report-flow-steps li { gap: 4px; font-size: 10px; }
  .report-flow-steps li span { flex-basis: 21px; width: 21px; height: 21px; }
  .report-picker-row { gap: 5px; }
  .report-picker-row .btn { padding: 0 5px; font-size: 11px; }
}

@media (prefers-reduced-transparency: reduce) {
  .top, .footer, .glass-card { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

@media (prefers-contrast: more) {
  .card, .question, .field, .choice, .report-card, .report-list, .report-status-card { border-color: #657785; }
}
