@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/source-sans-3-latin.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/source-sans-3-latin.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/source-sans-3-latin.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/source-sans-3-latin.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 800; font-display: swap; src: url("/fonts/source-sans-3-latin.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 900; font-display: swap; src: url("/fonts/source-sans-3-latin.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --font-sans: "Source Sans 3", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #172421;
  --muted: #687773;
  --line: #dde5e2;
  --canvas: #f4f7f5;
  --card: #ffffff;
  --green: #0b7068;
  --green-deep: #07564f;
  --green-soft: #dff1ed;
  --coral: #e3745c;
  --shadow: 0 12px 35px rgba(24, 57, 50, 0.07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: none; text-size-adjust: none; }
html, body { max-width: 100%; overflow-x: hidden; }
body.modal-open { overflow: hidden; }
body {
  width: 100%;
  margin: 0;
  min-width: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  transition: background .2s ease, color .2s ease;
}

img, svg { max-width: 100%; }

button, input, select, textarea {
  font: inherit;
}

button,
.button,
.app-tab,
.metric-heading,
.metric-value,
.trend-value,
.card-header h2,
.year-filter,
.status-badge,
.period-stat strong,
.change-point-overview strong,
.footer > span,
th,
td {
  white-space: nowrap;
}

.metric-value,
.trend-value,
.ranking-position,
.ranking-value,
.period-stat strong,
.change-point-overview strong,
th,
td {
  font-variant-numeric: tabular-nums;
}

.metric-heading > span:first-child,
.card-header h2,
.chart-selection-summary {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shutdown-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(32px, env(safe-area-inset-top)) max(32px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(32px, env(safe-area-inset-left));
  text-align: center;
}

.shutdown-screen > div {
  max-width: 520px;
  padding: 36px;
  background: white;
  border: 1px solid rgba(219, 229, 225, .9);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.shutdown-screen .brand-mark {
  margin: 0 auto 20px;
}

.shutdown-screen p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(11, 112, 104, .42);
  outline-offset: 3px;
}
.hidden { display: none !important; }

body:not(.features-ready) .app-shell [data-feature],
body:not(.features-ready) #syncButton,
body:not(.features-ready) #syncPill {
  display: none !important;
}

body.no-js .app-shell,
body.no-js .app-auth-screen,
body.no-js .toast,
body.no-js .best-self-thanks,
body.no-js .account-delete-animation {
  display: none !important;
}

body.js-enabled .no-js-screen {
  display: none !important;
}

.app-tabs {
  width: min(1180px, calc(100% - 40px));
  margin: 8px auto 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .92);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  box-shadow: 0 8px 24px rgba(24, 57, 50, .05);
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.app-tab {
  flex: 0 1 48px;
  width: 48px;
  min-width: 40px;
  height: 44px;
  min-height: 44px;
  padding: 4px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.app-tab:hover { color: var(--green); background: var(--green-soft); }
.app-tab.active { color: white; background: var(--green); box-shadow: 0 8px 20px rgba(11, 112, 104, .2); }
.app-tab-icon { width: 34px; height: 34px; display: block; border-radius: 8px; object-fit: cover; transition: transform .16s ease, box-shadow .16s ease; }
.app-tab:hover .app-tab-icon { transform: translateY(-1px); }
.app-tab.active .app-tab-icon { box-shadow: 0 0 0 2px rgba(255, 255, 255, .92); }
.app-tab:focus-visible { outline: 3px solid var(--green); outline: 3px solid color-mix(in srgb, var(--green) 45%, white); outline-offset: 2px; }

.app-refresh-button.refreshing svg { animation: app-refresh-spin .7s linear infinite; }
@keyframes app-refresh-spin { to { transform: rotate(360deg); } }

.ranking-hero,
.comparison-page-hero {
  margin: 0 0 20px;
}

.ranking-hero h1,
.comparison-page-hero h1 { margin: 2px 0 7px; font-size: clamp(1.8rem, 3vw, 2.65rem); line-height: 1.05; }
.ranking-hero p:last-child,
.comparison-page-hero p:last-child { max-width: 820px; margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.5; }
.main-content.ranking-page { width: min(calc(100% - 40px), 1180px); }
.main-content.comparison-page { width: min(calc(100% - 40px), 1180px); }
.main-content.tables-page { width: min(calc(100% - 40px), 1180px); }
#comparisonPageContent { min-width: 0; }
.tables-page-hero { margin: 0 0 20px; }
.tables-page-hero h1 { margin: 2px 0 7px; font-size: clamp(1.8rem, 3vw, 2.65rem); line-height: 1.05; }
.tables-page-hero p:last-child { max-width: 820px; margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.5; }
#tablesPageContent { min-width: 0; }
.tables-page .weekday-card,
.tables-page .period-card,
.tables-page .table-card { margin-bottom: 16px; }
.ranking-criteria { margin-bottom: 10px; padding: 12px; border-radius: 17px; }
.ranking-criteria-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; margin-bottom: 8px; }
.ranking-criteria-header > div { min-width: 0; }
.ranking-criteria-header .card-kicker { margin-bottom: 1px; font-size: .59rem; }
.ranking-criteria-header h2 { margin: 0; font-size: .98rem; line-height: 1.15; white-space: nowrap; }
.ranking-criteria-summary { flex: 0 0 auto; padding: 4px 8px; color: var(--green-deep); background: var(--green-soft); border-radius: 999px; font-size: .7rem; font-weight: 900; white-space: nowrap; }
.ranking-score-requirements { display: flex; align-items: center; gap: 6px; min-width: 0; margin-bottom: 8px; padding: 6px 8px; overflow-x: auto; color: var(--muted); background: var(--canvas); border: 1px solid var(--line); border-radius: 10px; scrollbar-width: thin; }
.ranking-score-requirements strong, .ranking-score-requirements span { flex: 0 0 auto; font-size: .68rem; line-height: 1.15; white-space: nowrap; }
.ranking-score-requirements span { padding: 3px 6px; border-radius: 999px; font-weight: 800; }
.ranking-score-requirements .fulfilled { color: var(--green-deep); background: var(--green-soft); }
.ranking-score-requirements .open { color: #8a392c; background: var(--coral-soft); }
.ranking-criteria-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.ranking-criterion { min-width: 0; padding: 7px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.ranking-criterion.is-fulfilled { border-color: var(--green); border-color: color-mix(in srgb, var(--green) 45%, var(--line)); }
.ranking-criterion.is-open { border-color: var(--coral); border-color: color-mix(in srgb, var(--coral) 38%, var(--line)); }
.ranking-criterion-title { display: flex; align-items: center; justify-content: space-between; gap: 5px; min-width: 0; }
.ranking-criterion-title strong { overflow: hidden; font-size: .76rem; white-space: nowrap; text-overflow: ellipsis; }
.ranking-criterion-title span { display: grid; place-items: center; flex: 0 0 18px; width: 18px; height: 18px; border-radius: 50%; font-size: .7rem; font-weight: 900; }
.ranking-criterion.is-fulfilled .ranking-criterion-title span { color: var(--green-deep); background: var(--green-soft); }
.ranking-criterion.is-open .ranking-criterion-title span { color: #8a392c; background: var(--coral-soft); }
.ranking-criterion-requirement, .ranking-criterion-detail { display: block; width: 100%; overflow: hidden; font-size: .62rem; line-height: 1.3; white-space: nowrap; text-overflow: ellipsis; }
.ranking-criterion-requirement { margin-top: 3px; color: var(--muted); }
.ranking-criterion-detail { margin-top: 2px; color: var(--ink); font-weight: 800; }
.main-content.blood-count-page { width: min(calc(100% - 40px), 1180px); }
.main-content.best-self-page { width: min(calc(100% - 40px), 1180px); }
.main-content.blood-pressure-page { width: min(calc(100% - 40px), 1180px); }
.best-self-page-hero { margin: 0 0 20px; }
.best-self-page-hero h1 { margin: 2px 0 7px; font-size: clamp(1.8rem, 3vw, 2.65rem); line-height: 1.05; }
.best-self-page-hero p:last-child { max-width: 820px; margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.5; }
.best-self-page .best-self-card { margin-bottom: 16px; }
.blood-pressure-page-hero { margin: 0 0 20px; }
.blood-pressure-page-hero h1 { margin: 2px 0 7px; font-size: clamp(1.8rem, 3vw, 2.65rem); line-height: 1.05; }
.blood-pressure-page-hero p:last-child { max-width: 820px; margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.5; }
.blood-pressure-page .blood-pressure-card { margin-bottom: 16px; }
.blood-count-hero { margin: 0 0 20px; }
.blood-count-hero h1 { margin: 2px 0 7px; font-size: clamp(1.8rem, 3vw, 2.65rem); line-height: 1.05; }
.blood-count-hero p:last-child { max-width: 820px; margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.5; }
.blood-count-view-tabs { width: fit-content; display: flex; gap: 6px; margin: 0 0 16px; padding: 5px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 24px rgba(24,57,50,.06); }
.blood-count-view-tab { min-width: 116px; min-height: 44px; padding: 9px 18px; color: var(--muted); background: transparent; border: 0; border-radius: 10px; font: inherit; font-size: 14px; font-weight: 850; cursor: pointer; }
.blood-count-view-tab:hover { color: var(--green); background: var(--green-soft); }
.blood-count-view-tab.active { color: white; background: var(--green); box-shadow: 0 7px 18px rgba(11,112,104,.2); }
.blood-count-view-tab:focus-visible { outline: 3px solid rgba(11,112,104,.25); outline-offset: 2px; }
.blood-count-reference-editor { min-width: 0; padding: 22px; overflow: hidden; }
.blood-count-reference-editor-table { width: 100%; min-width: 720px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.blood-count-reference-editor-table th, .blood-count-reference-editor-table td { padding: 12px 11px; vertical-align: middle; border-bottom: 1px solid #e0eae7; text-align: left; }
.blood-count-reference-editor-table thead th { color: #65736f; background: #f1f7f5; font-size: 11px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.blood-count-reference-editor-table thead th:first-child { width: 38%; border-radius: 10px 0 0 10px; }
.blood-count-reference-editor-table thead th:nth-child(2) { width: 18%; }
.blood-count-reference-editor-table thead th:last-child { width: 44%; border-radius: 0 10px 10px 0; }
.blood-count-reference-editor-table tbody th { overflow: hidden; }
.blood-count-reference-editor-table tbody th strong { display: block; margin-top: 5px; color: var(--ink); font-size: 14px; line-height: 1.25; overflow-wrap: anywhere; }
.blood-count-reference-editor-table tbody td { color: var(--green-deep); font-size: 12px; font-weight: 800; }
.blood-count-reference-section { display: inline-flex; padding: 3px 7px; color: var(--green-deep); background: var(--green-soft); border-radius: 999px; font-size: 9px; font-weight: 850; white-space: nowrap; }
.blood-count-reference-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.blood-count-reference-inputs label { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 7px; }
.blood-count-reference-inputs label > span { color: var(--muted); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.blood-count-reference-inputs input { width: 100%; min-width: 0; height: 40px; padding: 8px 10px; color: var(--ink); background: white; border: 1px solid #cbdcd7; border-radius: 9px; font: inherit; font-size: 15px; font-weight: 750; text-align: right; }
.blood-count-reference-inputs input:focus { outline: 3px solid rgba(11,112,104,.15); border-color: var(--green); }
.blood-count-general-reference { display: block; max-width: 100%; margin-top: 5px; color: var(--muted); font-size: 10px; font-weight: 650; line-height: 1.25; white-space: normal; }
.blood-count-reference-priority-note { margin-top: 16px; padding: 13px 15px; color: var(--green-deep); background: var(--green-soft); border: 1px solid rgba(11,112,104,.16); border-radius: 12px; font-size: 12px; line-height: 1.45; }
.blood-count-entry-layout { display: block; }
.blood-count-extended-layout { margin-top: 16px; }
.blood-count-calendar-panel { min-width: 0; margin-bottom: 16px; padding: 18px; }
.blood-count-table-card { min-width: 0; padding: 22px; overflow: hidden; }
.blood-count-table-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.blood-count-table-heading h2 { margin: 2px 0 0; font-size: 24px; }
.blood-count-section-hint { max-width: 720px; margin: 5px 0 0; color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1.4; }
.blood-count-table-heading > span { color: var(--muted); font-size: 12px; font-weight: 800; white-space: nowrap; }
.blood-count-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.blood-count-table { width: 100%; min-width: 820px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.blood-count-table th, .blood-count-table td { padding: 12px 11px; vertical-align: middle; border-bottom: 1px solid #e0eae7; text-align: left; }
.blood-count-table thead th { color: #65736f; background: #f1f7f5; font-size: 11px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.blood-count-table thead th:first-child { width: 40%; border-radius: 10px 0 0 10px; }
.blood-count-table thead th:nth-child(2) { width: 17%; }
.blood-count-table thead th:nth-child(3) { width: 25%; }
.blood-count-table thead th:last-child { width: 18%; border-radius: 0 10px 10px 0; }
.blood-count-table tbody th { width: 40%; max-width: 40%; overflow: hidden; white-space: normal; }
.blood-count-table tbody th strong { display: block; max-width: 100%; color: var(--ink); font-size: 15px; line-height: 1.2; overflow-wrap: anywhere; white-space: normal; }
.blood-count-code { color: var(--green); font-size: .82em; font-weight: 900; }
.blood-count-wiki-link { color: inherit; text-decoration-color: rgba(11,112,104,.42); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.blood-count-wiki-link:hover { color: var(--green); text-decoration-color: currentColor; }
.blood-count-wiki-link:focus-visible { outline: 3px solid rgba(11,112,104,.24); outline-offset: 2px; border-radius: 3px; }
.blood-count-table tbody th small { display: block; width: 100%; max-width: 100%; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.3; overflow-wrap: break-word; white-space: normal; word-break: normal; hyphens: auto; }
.blood-count-table tbody td { color: var(--green-deep); font-size: 12px; font-weight: 800; }
.blood-count-reference strong,
.blood-count-reference small { display: block; white-space: nowrap; }
.blood-count-reference strong { color: var(--ink); font-size: 13px; }
.blood-count-reference small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.blood-count-reference .blood-count-athlete-context { max-width: 220px; white-space: normal; line-height: 1.25; }
.blood-count-table input { width: 100%; min-width: 0; height: 40px; padding: 8px 10px; color: var(--ink); background: white; border: 1px solid #cbdcd7; border-radius: 9px; font: inherit; font-size: 15px; font-weight: 700; text-align: right; }
.blood-count-table input:focus { outline: 3px solid rgba(11,112,104,.15); border-color: var(--green); }
.blood-count-submit-row { min-height: 50px; display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 16px; }
.blood-count-submit-row .form-status { flex: 1; margin: 0; }
.blood-count-note { margin-top: 16px; padding: 15px 18px; color: #31504a; background: #edf8f5; border: 1px solid rgba(11,112,104,.18); border-left: 4px solid var(--green); border-radius: 12px; font-size: 13px; line-height: 1.55; }
.blood-count-history-card { min-width: 0; padding: 22px; overflow: hidden; }
.blood-count-history-empty { min-height: 180px; display: grid; place-content: center; gap: 6px; padding: 30px; color: var(--muted); background: var(--soft); border: 1px dashed var(--line); border-radius: 14px; text-align: center; }
.blood-count-history-empty strong { color: var(--ink); font-size: 17px; }
.blood-count-history-empty span { font-size: 13px; }
.blood-count-history-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; }
.blood-count-history-table th, .blood-count-history-table td { padding: 12px 13px; border-bottom: 1px solid #e0eae7; vertical-align: middle; }
.blood-count-history-table thead th { position: sticky; top: 0; z-index: 3; color: #65736f; background: #f1f7f5; font-size: 11px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.blood-count-history-sticky { position: sticky; left: 0; z-index: 2; width: 300px; min-width: 300px; max-width: 300px; overflow: hidden; background: var(--card); box-shadow: 1px 0 0 #d9e6e2; }
.blood-count-history-table thead .blood-count-history-sticky { z-index: 4; background: #f1f7f5; }
.blood-count-history-metric-heading { border-radius: 10px 0 0 10px; text-align: left; }
.blood-count-history-date-heading { min-width: 158px; text-align: center; white-space: nowrap; }
.blood-count-history-table thead th:last-child { border-radius: 0 10px 10px 0; }
.blood-count-history-section { display: inline-flex; padding: 4px 8px; color: var(--green-deep); background: var(--green-soft); border-radius: 999px; font-size: 10px; font-weight: 850; white-space: nowrap; }
.blood-count-history-metric { overflow: hidden; text-align: left; }
.blood-count-history-metric strong, .blood-count-history-metric small { display: block; max-width: 100%; overflow-wrap: anywhere; word-break: normal; white-space: normal; }
.blood-count-history-metric strong { margin-top: 7px; color: var(--ink); font-size: clamp(10.5px, .8vw, 12.5px); line-height: 1.22; }
.blood-count-history-metric small { margin-top: 3px; color: var(--green); font-size: 9px; font-weight: 850; line-height: 1.25; }
.blood-count-history-value { min-width: 158px; max-width: 158px; overflow: hidden; color: var(--ink) !important; font-size: 15px !important; font-weight: 900 !important; text-align: center !important; white-space: normal; }
.blood-count-history-value > strong, .blood-count-history-value > small, .blood-count-history-status { display: block; max-width: 100%; overflow-wrap: anywhere; }
.blood-count-history-value > strong { font-size: 14px; line-height: 1.2; }
.blood-count-history-value-unit { font-size: 9px; font-weight: 750; }
.blood-count-history-value > small { margin-top: 5px; color: currentColor; font-size: 9px; font-weight: 700; line-height: 1.2; }
.blood-count-history-status { width: fit-content; margin: 6px auto 0; padding: 3px 7px; border: 1px solid currentColor; border-radius: 999px; font-size: 9px; font-weight: 900; line-height: 1; white-space: nowrap; }
.blood-count-history-value.is-normal { color: #176b46 !important; background: #e7f7ee; }
.blood-count-history-value.is-low { color: #1f5f91 !important; background: #e8f3fb; }
.blood-count-history-value.is-high { color: #a42920 !important; background: #fdecea; }
.blood-count-history-value.is-unrated { color: #665a35 !important; background: #f7f2df; }
.blood-count-history-value.is-empty { color: var(--muted) !important; font-weight: 650 !important; }
.blood-count-footer { max-width: 1180px; margin-inline: auto; }
.main-content.wiki-page { width: min(calc(100% - 40px), 1180px); }
.wiki-hero { margin: 0 0 18px; }
.wiki-hero h1 { margin: 2px 0 7px; font-size: clamp(1.8rem, 3vw, 2.65rem); line-height: 1.05; }
.wiki-term-count { display: inline-flex; align-items: center; margin-left: .35em; padding: .22em .55em; color: white; background: var(--green); border-radius: 999px; font-size: .42em; font-weight: 850; line-height: 1.2; vertical-align: middle; white-space: nowrap; }
.wiki-hero p:last-child { max-width: 820px; margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.5; }
.wiki-search { position: relative; z-index: 12; width: 100%; margin: 0 auto 14px; }
.wiki-search > label { display: block; margin: 0 0 6px 2px; color: var(--ink); font-size: .76rem; font-weight: 850; }
.wiki-search-control { position: relative; width: 100%; }
.wiki-search-control > svg { position: absolute; top: 50%; left: 16px; width: 20px; height: 20px; pointer-events: none; fill: none; stroke: var(--green); stroke-width: 2; stroke-linecap: round; transform: translateY(-50%); }
.wiki-search input { width: 100%; height: 50px; padding: 0 48px 0 48px; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); font-size: 1rem; font-weight: 650; outline: none; }
.wiki-search input::placeholder { color: var(--muted); font-weight: 500; opacity: .9; }
.wiki-search input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(11,112,104,.14), var(--shadow); }
.wiki-search input::-webkit-search-cancel-button { display: none; }
.wiki-search-clear { position: absolute; top: 50%; right: 8px; width: 36px; height: 36px; min-height: 36px; display: grid; place-items: center; padding: 0; color: var(--muted); background: transparent; border: 0; border-radius: 10px; font-size: 1.4rem; line-height: 1; cursor: pointer; transform: translateY(-50%); }
.wiki-search-clear:hover { color: var(--green-deep); background: var(--green-soft); }
.wiki-search-results { position: absolute; top: calc(100% - 17px); right: 0; left: 0; z-index: 30; max-height: min(360px, 52vh); margin: 0; padding: 6px; overflow-y: auto; overscroll-behavior: contain; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 45px rgba(24,57,50,.16); list-style: none; }
.wiki-search-results[hidden] { display: none; }
.wiki-search-option { min-height: 44px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px 11px; border-radius: 10px; color: var(--ink); cursor: pointer; }
.wiki-search-option + .wiki-search-option { margin-top: 2px; }
.wiki-search-option:hover, .wiki-search-option.is-active { color: var(--green-deep); background: var(--green-soft); }
.wiki-search-option strong { min-width: 0; overflow: hidden; font-size: .92rem; white-space: nowrap; text-overflow: ellipsis; }
.wiki-search-option span { min-width: 25px; color: var(--muted); font-size: .7rem; font-weight: 850; text-align: center; }
.wiki-search-option.is-active span { color: var(--green-deep); }
.wiki-search-hint { min-height: 17px; margin: 5px 2px 0; color: var(--muted); font-size: .7rem; line-height: 1.2; }
.wiki-alphabet { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(34px, 1fr)); gap: 7px; margin: 0 auto 24px; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.wiki-alphabet-letter { min-width: 34px; height: 36px; display: grid; place-items: center; color: #8c9996; background: var(--soft); border: 1px solid transparent; border-radius: 10px; font-size: 13px; font-weight: 850; line-height: 1; text-decoration: none; }
.wiki-alphabet-letter.is-active { color: white; background: var(--green); border-color: var(--green); box-shadow: 0 6px 14px rgba(11,112,104,.2); cursor: pointer; }
.wiki-alphabet-letter.is-active:hover { background: #095f58; transform: translateY(-1px); }
.wiki-alphabet-letter.is-active:focus-visible { outline: 3px solid rgba(11,112,104,.28); outline-offset: 2px; }
.wiki-alphabet-letter.is-active.is-selected { color: white; background: var(--ink); border-color: var(--ink); box-shadow: 0 0 0 3px rgba(11,112,104,.18); }
.wiki-alphabet-letter.is-empty { opacity: .62; }
.wiki-letter-section { width: 100%; display: grid; gap: 14px; margin: 0 auto 28px; scroll-margin-top: 110px; }
.wiki-letter-section[hidden] { display: none; }
.wiki-letter-heading { display: flex; align-items: center; gap: 11px; margin: 0; }
.wiki-letter-heading h2 { width: 38px; height: 38px; display: grid; place-items: center; margin: 0; color: white; background: var(--ink); border-radius: 11px; font-size: 18px; font-weight: 900; line-height: 1; white-space: nowrap; }
.wiki-topic-card { width: 100%; min-width: 0; min-height: 680px; height: auto; display: flex; flex-direction: column; margin: 0; padding: 28px; overflow: visible; }
.wiki-topic-heading { flex: 0 0 auto; display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: start; gap: 16px; margin-bottom: 22px; }
.wiki-topic-icon { width: 56px; height: 56px; display: grid; place-items: center; color: white; background: linear-gradient(145deg, var(--green), #4aa79c); border-radius: 17px; box-shadow: 0 12px 24px rgba(11,112,104,.18); }
.wiki-topic-icon svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wiki-topic-heading h2 { margin: 1px 0 5px; scroll-margin-top: 110px; color: var(--ink); font-size: 30px; letter-spacing: -.025em; }
.wiki-topic-heading p:last-child { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.wiki-accordion { width: 100%; min-width: 0; min-height: 0; display: grid; flex: 1 1 auto; align-content: start; gap: 10px; }
.wiki-item { width: 100%; min-width: 0; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.wiki-item[open] { border-color: rgba(11,112,104,.32); box-shadow: 0 10px 24px rgba(19,59,51,.07); }
.wiki-item summary { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; color: var(--ink); background: var(--green-soft); list-style: none; font-size: 14px; font-weight: 850; cursor: pointer; user-select: none; }
.wiki-item summary::-webkit-details-marker { display: none; }
.wiki-item summary:hover { color: var(--green); }
.wiki-item summary:focus-visible { outline: 3px solid rgba(11,112,104,.25); outline-offset: -3px; }
.wiki-item summary > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wiki-toggle { width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center; color: white; background: var(--green); border-radius: 999px; font-size: 20px; font-weight: 500; line-height: 1; transition: transform .2s ease; }
.wiki-item[open] .wiki-toggle { transform: rotate(45deg); }
.wiki-item-content { width: 100%; min-width: 0; display: grid; gap: 12px; padding: 18px 20px 20px; overflow-wrap: anywhere; animation: wiki-reveal .2s ease-out; }
.wiki-item[open] .wiki-item-content { max-height: none; overflow: visible; }
.wiki-item-content > * { width: 100%; max-width: none; box-sizing: border-box; }
.wiki-item-content p { margin: 0; color: #4d5d59; font-size: 14px; line-height: 1.65; }
.wiki-item-content strong { color: var(--ink); }
.wiki-note,
.wiki-warning { padding: 13px 15px; color: #31504a; background: #edf8f5; border-left: 4px solid var(--green); border-radius: 10px; font-size: 13px; line-height: 1.55; }
.wiki-warning { color: #744238; background: #fff3ef; border-left-color: var(--coral); }
.wiki-number-row { display: flex; flex-wrap: wrap; gap: 8px; max-width: 100%; overflow: visible; padding: 3px 0 6px; }
.wiki-number-row span { flex: 0 0 auto; padding: 8px 12px; color: var(--green); background: var(--green-soft); border: 1px solid rgba(11,112,104,.18); border-radius: 999px; font-size: 13px; font-weight: 850; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wiki-formula { width: 100%; max-width: 100%; padding: 10px 13px; overflow: visible; overflow-wrap: anywhere; color: var(--ink); background: var(--soft); border: 1px solid var(--line); border-radius: 10px; font-size: 14px; white-space: normal; }
.wiki-calculation { display: grid; gap: 8px; margin: 0; padding-left: 23px; color: #4d5d59; font-size: 13px; line-height: 1.55; }
.wiki-calculation strong { font-variant-numeric: tabular-nums; }
.wiki-item-content .wiki-related { margin-top: 2px; padding-top: 10px; color: var(--muted); border-top: 1px solid var(--line); font-size: 13px; line-height: 1.8; }
.wiki-related a { display: inline-block; margin: 2px; padding: 2px 8px; color: var(--green-deep); background: var(--green-soft); border: 1px solid rgba(11,112,104,.18); border-radius: 999px; font-weight: 800; line-height: 1.45; white-space: nowrap; text-decoration: none; }
.wiki-related a:hover { color: white; background: var(--green); }
.wiki-related a:focus-visible { outline: 3px solid rgba(11,112,104,.28); outline-offset: 2px; }
.wiki-footer { width: 100%; max-width: none; margin-inline: auto; }
@keyframes wiki-reveal { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.ranking-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: auto; gap: 10px; align-items: stretch; width: 100%; max-width: none; margin-inline: auto; }
.ranking-calendar-panel { width: 100%; min-width: 0; margin-top: 12px; padding: 18px; overflow: hidden; }
.ranking-calendar-heading { width: min(100%, 760px); margin: 0 auto 14px; }
.ranking-calendar-heading h2 { margin: 2px 0 4px; color: var(--ink); font-size: clamp(1.2rem, 2vw, 1.55rem); line-height: 1.15; }
.ranking-calendar-heading p:last-child { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.ranking-calendar { width: min(100%, 760px); margin: 0 auto; }
.ranking-calendar-day:not(.is-done):not(.is-future) { color: var(--ink); }
.ranking-calendar-result { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.ranking-calendar-result-header { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.ranking-calendar-result-header h3 { margin: 1px 0 0; color: var(--ink); font-size: 1.08rem; }
.ranking-calendar-result-header > span { color: var(--green-deep); font-size: .75rem; font-weight: 850; white-space: nowrap; }
.ranking-calendar-result-list { gap: 6px; }
.ranking-calendar-result-list .ranking-row { min-height: 44px; padding: 5px 7px; }
.ranking-card { display: flex; flex-direction: column; grid-column: span 2; min-width: 0; height: 100%; padding: 13px 12px; overflow: hidden; background: linear-gradient(155deg, var(--card), var(--green-soft)); background: linear-gradient(155deg, var(--card), color-mix(in srgb, var(--green-soft) 22%, var(--card))); }
.ranking-card:nth-child(4) { grid-column: 2 / span 2; }
.ranking-card:nth-child(5) { grid-column: 4 / span 2; }
.card.ranking-card { border-radius: 17px; }
.apex-card { background: linear-gradient(155deg, var(--card), #fff9e4); background: linear-gradient(155deg, var(--card), color-mix(in srgb, #f7d96b 14%, var(--card))); }
.ranking-card .ranking-card-header { display: flex; flex-direction: column; flex: 0 0 62px; align-items: center; justify-content: center; gap: 2px; width: 100%; min-height: 62px; text-align: center; }
.ranking-card .ranking-card-header > div { width: 100%; min-width: 0; }
.ranking-card .ranking-card-header .card-kicker, .ranking-card .ranking-card-header h2 { width: 100%; overflow: hidden; white-space: nowrap; text-align: center; text-overflow: ellipsis; }
.ranking-card .ranking-card-header .card-kicker { margin-bottom: 2px; font-size: clamp(.51rem, .56vw, .62rem); letter-spacing: .08em; }
.ranking-card .ranking-card-header h2 { margin-bottom: 0; padding: 1px 0; font-size: clamp(.82rem, .93vw, 1.02rem); line-height: 1.12; }
.ranking-card .ranking-card-header > strong { max-width: 100%; overflow: hidden; color: var(--green); font-size: clamp(.58rem, .65vw, .7rem); line-height: 1.1; white-space: nowrap; text-align: center; text-overflow: ellipsis; }
.ranking-rule { margin: 4px 0 18px; color: var(--muted); font-size: .92rem; line-height: 1.45; }
.daily-participation { color: var(--green-deep); font-weight: 750; }
.compact-ranking-rule { width: 100%; max-width: 100%; min-height: 14px; margin: 0 auto 6px; padding-inline: 1px; overflow: hidden; font-size: .68rem; line-height: 1.1; white-space: nowrap; text-align: center; text-overflow: ellipsis; }
.ranking-list { display: grid; align-content: start; gap: 4px; width: 100%; margin: 0; padding: 0; list-style: none; counter-reset: none; }
.ranking-share-button { width: 34px; height: 34px; min-height: 34px; display: inline-grid; place-items: center; align-self: flex-end; flex: 0 0 34px; margin-top: auto; padding: 0; color: white; background: var(--green); border: 0; border-radius: 10px; cursor: pointer; transition: transform .18s ease, background .18s ease, opacity .18s ease; }
.ranking-share-button:hover:not(:disabled) { background: var(--green-deep); transform: translateY(-1px); }
.ranking-share-button:disabled { opacity: .55; cursor: wait; }
.ranking-share-button svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ranking-share-button.preparing svg { animation: share-icon-pulse .8s ease-in-out infinite alternate; }
.ranking-share-button.share-error { color: white; background: var(--coral); }
@keyframes share-icon-pulse { to { opacity: .42; transform: scale(.82); } }
.ranking-row { position: relative; display: grid; grid-template-columns: 22px 28px minmax(0, 1fr) auto; align-items: center; gap: 3px; min-height: 38px; padding: 3px 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); background: color-mix(in srgb, var(--card) 91%, var(--canvas)); box-shadow: 0 4px 12px rgba(24, 57, 50, .04); transition: transform .18s ease, box-shadow .18s ease; }
.ranking-row:hover { transform: translateY(-2px); box-shadow: 0 13px 28px rgba(24, 57, 50, .1); }
.ranking-row.is-current-user { border-color: var(--green); box-shadow: inset 4px 0 0 var(--green); }
.ranking-position { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: var(--green-deep); background: var(--green-soft); font-size: .64rem; font-weight: 900; }
.ranking-row[data-rank="1"] .ranking-position { color: #604400; background: #f7d96b; }
.ranking-row[data-rank="2"] .ranking-position { color: #4a5558; background: #dce3e5; }
.ranking-row[data-rank="3"] .ranking-position { color: #673e25; background: #dfaa80; }
.ranking-row[data-rank="1"] { border-color: #dcc464; background: linear-gradient(110deg, #fff9df, var(--card)); border-color: color-mix(in srgb, #d1a718 48%, var(--line)); background: linear-gradient(110deg, color-mix(in srgb, #f7d96b 15%, var(--card)), var(--card)); }
.ranking-row[data-rank="2"] { border-color: #bdc7ca; border-color: color-mix(in srgb, #9aa8ac 42%, var(--line)); }
.ranking-row[data-rank="3"] { border-color: #d3ab8c; border-color: color-mix(in srgb, #b97846 38%, var(--line)); }
.ranking-dino { display: grid; place-items: center; width: 28px; height: 28px; overflow: hidden; border: 2px solid #abd1ca; border: 2px solid color-mix(in srgb, var(--green) 28%, white); border-radius: 8px; background: var(--green-soft); box-shadow: 0 4px 10px rgba(11, 112, 104, .13); }
.ranking-dino img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); }
.ranking-row[data-rank="1"] .ranking-dino { border-color: #d8ac19; box-shadow: 0 7px 20px rgba(216, 172, 25, .25); }
.ranking-person { display: grid; justify-self: start; width: 100%; max-width: 100%; min-width: 0; }
.ranking-person strong, .ranking-person span { display: block; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ranking-person strong { font-size: .78rem; line-height: 1.02; }
.ranking-person span { margin-top: 0; color: var(--muted); font-size: .63rem; line-height: 1.02; }
.ranking-value { min-width: 28px; margin-left: 2px; text-align: right; white-space: nowrap; }
.ranking-value strong { display: block; color: var(--green-deep); font-size: .78rem; line-height: .96; }
.ranking-value span { color: var(--muted); font-size: .52rem; line-height: .96; }
.ranking-empty { padding: 15px 4px; overflow: hidden; border: 1px dashed var(--line); border-radius: 11px; color: var(--muted); font-size: .66rem; white-space: nowrap; text-align: center; text-overflow: ellipsis; }
.ranking-footer { margin-top: 14px; }

body.dark .app-tabs { background: var(--card); }

@media (max-width: 900px) {
  .app-tabs { width: min(calc(100% - 24px), 1180px); justify-content: flex-start; overflow-x: auto; }
  .main-content.ranking-page { width: min(calc(100% - 24px), 1180px); }
  .main-content.comparison-page { width: min(calc(100% - 24px), 1180px); }
  .main-content.tables-page { width: min(calc(100% - 24px), 1180px); }
  .app-tab { flex: 0 1 48px; }
  .ranking-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ranking-card,
  .ranking-card:nth-child(4),
  .ranking-card:nth-child(5) { grid-column: auto; }
  .ranking-card:last-child { grid-column: 1 / -1; width: calc(50% - 6px); justify-self: center; }
  .ranking-card { height: auto; }
  .ranking-card .ranking-card-header { flex-basis: auto; min-height: 62px; }
  .ranking-card .ranking-card-header .card-kicker { font-size: .66rem; }
  .ranking-card .ranking-card-header h2 { font-size: 1.08rem; }
  .ranking-card .ranking-card-header > strong { font-size: .76rem; }
  .compact-ranking-rule { min-height: 18px; overflow: visible; font-size: .74rem; text-overflow: clip; }
  .ranking-criteria-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ranking-criterion:last-child { grid-column: 1 / -1; }
  .ranking-share-button { width: 44px; height: 44px; min-height: 44px; flex-basis: 44px; border-radius: 12px; }
  .ranking-share-button svg { width: 19px; }
}

@media (max-width: 640px) {
  .app-tabs { gap: 4px; padding-right: 5px; padding-left: 5px; }
  .main-content.ranking-page {
    width: 100%;
    padding-right: max(12px, env(safe-area-inset-right));
    padding-left: max(12px, env(safe-area-inset-left));
  }
  .main-content.comparison-page {
    width: 100%;
    padding-right: max(12px, env(safe-area-inset-right));
    padding-left: max(12px, env(safe-area-inset-left));
  }
  .main-content.tables-page {
    width: 100%;
    padding-right: max(12px, env(safe-area-inset-right));
    padding-left: max(12px, env(safe-area-inset-left));
  }
  .main-content.blood-pressure-page {
    width: 100%;
    padding-right: max(12px, env(safe-area-inset-right));
    padding-left: max(12px, env(safe-area-inset-left));
  }
  .ranking-grid { grid-template-columns: 1fr; }
  .ranking-criteria { padding: 11px 10px; }
  .ranking-criteria-header { align-items: flex-start; }
  .ranking-criteria-header h2 { font-size: .92rem; }
  .ranking-criteria-summary { font-size: .65rem; }
  .ranking-criteria-grid { grid-template-columns: 1fr; }
  .ranking-criterion:last-child { grid-column: auto; }
  .ranking-criterion { padding: 8px 9px; }
  .ranking-criterion-requirement, .ranking-criterion-detail { font-size: .68rem; }
  .ranking-card:last-child { grid-column: auto; width: 100%; }
  .ranking-hero { margin-bottom: 16px; }
  .ranking-hero h1 { font-size: clamp(1.7rem, 8.5vw, 2.15rem); line-height: 1.08; overflow-wrap: anywhere; }
  .ranking-hero p:last-child { font-size: .9rem; line-height: 1.45; }
  .ranking-grid { gap: 10px; }
  .ranking-calendar-panel { padding: 13px 10px; border-radius: 16px; }
  .ranking-calendar-heading { margin-bottom: 11px; padding-inline: 2px; }
  .ranking-calendar-heading h2 { font-size: 1.12rem; }
  .ranking-calendar-heading p:last-child { font-size: .76rem; }
  .ranking-calendar { padding: 10px 8px; }
  .ranking-calendar .best-self-calendar-header { grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 5px; }
  .ranking-calendar .best-self-calendar-header strong { min-width: 0; overflow: hidden; font-size: .92rem; white-space: nowrap; text-overflow: ellipsis; }
  .ranking-calendar .best-self-calendar-selected { grid-template-columns: 1fr; gap: 2px; }
  .ranking-calendar .best-self-calendar-selected em { text-align: left; }
  .ranking-calendar .best-self-calendar-weekdays,
  .ranking-calendar .best-self-calendar-grid { gap: 4px; }
  .ranking-calendar .best-self-calendar-day,
  .ranking-calendar .best-self-calendar-empty { min-height: 42px; }
  .ranking-calendar .best-self-calendar-day { border-radius: 10px; }
  .ranking-calendar .best-self-calendar-legend { gap: 8px 11px; font-size: .66rem; }
  .ranking-calendar-result { margin-top: 13px; padding-top: 13px; }
  .ranking-calendar-result-header { align-items: flex-start; flex-direction: column; gap: 3px; }
  .ranking-calendar-result-header > span { font-size: .7rem; }
  .ranking-card { padding: 13px 12px; border-radius: 16px; }
  .ranking-row {
    grid-template-columns: 28px 38px minmax(0, 1fr) auto;
    grid-template-areas: "position dino person value";
    align-items: center;
    gap: 5px;
    min-height: 50px;
    padding: 5px 7px 5px 5px;
  }
  .ranking-position { grid-area: position; }
  .ranking-dino { grid-area: dino; }
  .ranking-person { grid-area: person; justify-self: start; width: 100%; padding-top: 0; }
  .ranking-value { grid-area: value; display: block; min-width: 30px; margin-left: 2px; padding-bottom: 0; text-align: right; }
  .ranking-person strong { font-size: .88rem; }
  .ranking-person span { font-size: .73rem; }
  .ranking-value strong { font-size: .9rem; }
  .ranking-value span { font-size: .65rem; }
  .ranking-value strong { display: block; }
  .ranking-position { width: 28px; height: 28px; }
  .ranking-dino { width: 38px; height: 38px; border-radius: 11px; }
  .ranking-footer { align-items: center; gap: 10px; text-align: center; }
  .ranking-footer > span:not(.footer-powered) { max-width: 100%; overflow-wrap: anywhere; white-space: normal; }
}

.no-js-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(34px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(34px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 20% 15%, rgba(11, 112, 104, .16), transparent 28%),
    linear-gradient(145deg, #f7faf8 0%, #e8f2ef 100%);
}

.no-js-card {
  text-align: center;
}

.no-js-card h1 {
  margin-bottom: 10px;
}

.app-auth-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(34px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(34px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 20% 15%, rgba(11, 112, 104, .16), transparent 28%),
    linear-gradient(145deg, #f7faf8 0%, #e8f2ef 100%);
}

.app-auth-screen:not(.hidden) + .app-shell {
  display: none;
}

.app-auth-card {
  width: min(100%, 480px);
  padding: 30px;
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(219, 229, 225, .95);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(24, 57, 50, .14);
}

.app-auth-logo {
  display: block;
  width: 156px;
  height: 156px;
  object-fit: cover;
  margin: 0 auto 18px;
  border-radius: 34px;
  box-shadow: 0 18px 44px rgba(11, 112, 104, .18);
}

.app-auth-card h1 {
  margin-bottom: 8px;
  font-size: clamp(32px, 6vw, 44px);
  text-align: center;
}

.app-auth-card .eyebrow,
.app-auth-card > p {
  text-align: center;
}

.app-auth-card > p {
  color: var(--muted);
  line-height: 1.55;
}

.app-auth-form {
  margin-top: 22px;
}
.auth-field-hint { display: block; margin-top: -3px; color: var(--muted); font-size: 11px; line-height: 1.35; }

.totp-setup {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 17px;
  text-align: center;
  background: #f3f8f6;
  border: 1px solid #e0ebe8;
  border-radius: 15px;
}

.totp-setup p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.totp-qr {
  width: 178px;
  height: 178px;
  display: grid;
  place-items: center;
  padding: 10px;
  background: white;
  border: 1px solid #dfe8e5;
  border-radius: 14px;
}

.totp-qr-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.totp-setup img {
  width: 178px;
  height: 178px;
  padding: 10px;
  background: white;
  border: 1px solid #dfe8e5;
  border-radius: 14px;
}

.totp-setup code {
  display: block;
  max-width: 100%;
  padding: 8px 10px;
  overflow-wrap: anywhere;
  color: #174943;
  background: #e7f3ef;
  border-radius: 9px;
  font-size: 12px;
}

.totp-setup hr {
  width: 100%;
  margin: 4px 0;
  border: 0;
  border-top: 1px solid #dce9e5;
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  padding-top: max(12px, env(safe-area-inset-top));
  padding-right: max(28px, env(safe-area-inset-right), calc((100vw - 1180px) / 2));
  padding-bottom: 12px;
  padding-left: max(28px, env(safe-area-inset-left), calc((100vw - 1180px) / 2));
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(213, 225, 221, 0.8);
  position: sticky;
  top: 0;
  z-index: 20;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-size: 18px; letter-spacing: -0.02em; }
.brand strong { color: var(--green); }
.brand-title { display: inline-flex; align-items: baseline; gap: 3px; }
.brand-copy { display: grid; gap: 3px; }
.brand-title-row { display: inline-flex; align-items: center; gap: 8px; }
.header-powered-text { display: inline-flex; align-items: center; gap: 6px; color: #60736e; line-height: 1; }
.header-powered-text strong { color: var(--green); font-size: 11px; font-weight: 850; white-space: nowrap; }
.version-badge { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; color: #55726c; background: #eef5f3; border: 1px solid #d9e8e4; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; overflow: hidden; background: #dff1ed; border-radius: 12px; box-shadow: 0 7px 16px rgba(11, 112, 104, .22); }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: cover; }
.powered-badge { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 13px; color: #5d6e69; background: rgba(255, 255, 255, .78); border: 1px solid rgba(217, 232, 228, .95); border-radius: 999px; box-shadow: 0 8px 18px rgba(24, 57, 50, .05); }
.powered-label { font-size: 9px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.powered-badge strong { color: var(--green); font-size: 12px; font-weight: 850; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 13px; margin-left: auto; }
.app-session-button { min-height: 40px; display: inline-grid; align-content: center; gap: 1px; padding: 0 12px; color: #37534e; background: #f8fbfa; border: 1px solid #d8e5e1; border-radius: 12px; cursor: pointer; text-align: left; transition: .2s ease; }
.app-session-button:hover { color: var(--green); background: white; border-color: #a8cec7; transform: translateY(-1px); }
.app-session-button span { max-width: 116px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 850; }
.app-session-button small { color: #7c8b87; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.admin-session-button { color: white; background: var(--green); border-color: var(--green); }
.admin-session-button small { color: rgba(255,255,255,.78); }
.admin-session-button:hover { color: white; background: var(--green-deep); border-color: var(--green-deep); }
.sync-pill { display: flex; align-items: center; gap: 8px; max-width: min(38vw, 360px); padding: 8px 12px; color: #53635f; background: #f0f5f3; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.sync-pill #syncPillText { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #98a5a1; }
.sync-pill.connected .status-dot { background: #30a98b; box-shadow: 0 0 0 4px rgba(48, 169, 139, .12); }
.sync-pill.syncing .status-dot { background: #e2a33e; animation: pulse 1.1s infinite; }
.sync-pill.error .status-dot { background: #dc6557; }
@keyframes pulse { 50% { opacity: .4; transform: scale(.75); } }
.loading-dino { width: 38px; height: 30px; display: inline-grid; place-items: center; overflow: hidden; }
.loading-dino::before { content: "🦖"; display: block; font-size: 23px; line-height: 1; transform-origin: 50% 100%; animation: dino-run .42s steps(2, end) infinite; }
.loading-dino::after { content: ""; width: 26px; height: 2px; margin-top: -2px; background: repeating-linear-gradient(90deg, rgba(11,112,104,.55) 0 6px, transparent 6px 11px); border-radius: 999px; animation: dino-track .42s linear infinite; }
.sync-dino { display: none; width: 30px; height: 24px; margin-left: -2px; }
.sync-dino::before { font-size: 18px; }
.sync-dino::after { width: 20px; }
.sync-pill.syncing .sync-dino { display: inline-grid; }
@keyframes dino-run {
  0% { transform: translateY(0) rotate(-4deg) scaleX(1); }
  50% { transform: translateY(-3px) rotate(4deg) scaleX(1); }
  100% { transform: translateY(0) rotate(-4deg) scaleX(1); }
}
@keyframes dino-track { to { transform: translateX(-11px); } }

.icon-button { width: 40px; height: 40px; display: grid; place-items: center; padding: 0; color: #5f6e6a; background: white; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: .2s ease; }
.icon-button:hover { color: var(--green); border-color: #b9d1cb; transform: translateY(-1px); }
.icon-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sync-header-button { color: var(--green); background: #edf7f4; border-color: #cfe4df; }
.sync-header-button:hover { background: white; border-color: #9fc8c0; }
.app-refresh-button,
.header-logout-button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 12px; font-size: 12px; font-weight: 850; cursor: pointer; transition: .2s ease; white-space: nowrap; }
.app-refresh-button { width: 40px; padding: 0; color: white; background: #173d38; border: 1px solid #173d38; box-shadow: 0 7px 16px rgba(23, 61, 56, .18); }
.header-logout-button { padding: 0 13px; }
.app-refresh-button:hover { background: var(--green); border-color: var(--green); transform: translateY(-1px); box-shadow: 0 9px 20px rgba(11, 112, 104, .24); }
.header-logout-button { color: #8b4a43; background: #fff5f3; border: 1px solid #f0d0ca; }
.header-logout-button:hover { color: white; background: var(--coral); border-color: var(--coral); transform: translateY(-1px); }
.app-refresh-button svg,
.header-logout-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .theme-icon-sun { display: none; }
body[data-theme="dark"] .theme-toggle .theme-icon-moon { display: none; }
body[data-theme="dark"] .theme-toggle .theme-icon-sun { display: block; }
.topbar-auth-button { min-height: 40px; display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; color: var(--green); background: #edf7f4; border: 1px solid #cfe4df; border-radius: 12px; font-size: 12px; font-weight: 800; cursor: pointer; transition: .2s ease; }
.topbar-auth-button:hover { background: white; border-color: #9fc8c0; transform: translateY(-1px); }
.topbar-auth-button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.topbar-auth-button .auth-icon-logout { display: none; }
.topbar-auth-button.connected { color: #8b4a43; background: #fff1ef; border-color: #f0d0ca; }
.topbar-auth-button.connected .auth-icon-login { display: none; }
.topbar-auth-button.connected .auth-icon-logout { display: block; }
.shutdown-topbar-button { color: #8b4a43; }
.shutdown-topbar-button:hover { color: #d45d52; border-color: #efc8c2; }

.main-content { width: min(100%, 1180px); margin: 0 auto; padding: clamp(30px, 4.6vw, 52px) clamp(16px, 3vw, 28px) 34px; }
.hero-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; margin-bottom: 30px; }
.eyebrow, .card-kicker { margin: 0 0 8px; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .14em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-family: var(--font-sans); font-size: clamp(38px, 5vw, 56px); font-weight: 800; line-height: 1.04; letter-spacing: -.035em; }
.intro { max-width: 610px; margin-bottom: 0; color: var(--muted); font-size: 16px; line-height: 1.6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; flex-shrink: 0; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 16px; border: 0; border-radius: 11px; text-decoration: none; font-weight: 720; font-size: 13px; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button.disabled,
.button[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.button-primary { color: white; background: var(--green); box-shadow: 0 8px 20px rgba(11, 112, 104, .18); }
.button-primary:hover { background: var(--green-deep); }
.button-secondary { color: #42524e; background: white; border: 1px solid var(--line); }
.button-dark { color: white; background: #173d38; margin-left: auto; white-space: nowrap; }
.button-danger { color: #9c4037; background: #fff1ef; border: 1px solid #f3d3ce; }
.button-full { width: 100%; margin-top: 18px; }

.confirmation-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; margin: 0; padding: 20px; background: #f4f7f5; color: #172421; }
.confirmation-card { width: min(92vw, 520px); padding: 34px; background: white; border: 1px solid #dde5e2; border-radius: 22px; box-shadow: 0 18px 55px rgba(24,57,50,.12); text-align: center; }
.confirmation-card h1 { margin: 0 0 12px; font-size: clamp(28px, 6vw, 42px); }
.confirmation-title-success { color: #0b7068; }
.confirmation-title-error { color: #9c4037; }
.confirmation-card p { margin: 0 0 24px; color: #687773; line-height: 1.6; }
.confirmation-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; color: white; background: #0b7068; border-radius: 12px; text-decoration: none; font-weight: 800; }

.notice { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; padding: 18px 20px; color: #173d38; background: #dff0ec; border: 1px solid #c6e3dd; border-radius: 16px; }
.notice-icon { width: 42px; height: 42px; display: grid; flex: 0 0 auto; place-items: center; color: var(--green); background: rgba(255,255,255,.7); border-radius: 12px; }
.notice-icon svg { width: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notice strong { display: block; margin-bottom: 4px; font-size: 14px; }
.notice p { margin: 0; color: #4b6b65; font-size: 13px; line-height: 1.45; }
.notice.error { color: #6d302a; background: #fff0ed; border-color: #f0d0ca; }
.notice.error .notice-icon { color: #c95d4f; }
.history-notice { background: #e5f2ef; }
.history-notice-body { flex: 1; min-width: 160px; }
.history-notice-heading { display: flex; justify-content: space-between; gap: 18px; }
.history-notice-heading > span { color: var(--green); font-size: 12px; font-weight: 800; white-space: nowrap; }
.progress-track { display: block; width: 100%; height: 5px; margin-top: 10px; overflow: hidden; appearance: none; -webkit-appearance: none; background: rgba(11, 112, 104, .13); border: 0; border-radius: 999px; }
.progress-track::-webkit-progress-bar { background: rgba(11, 112, 104, .13); border-radius: inherit; }
.progress-track::-webkit-progress-value { background: var(--green); border-radius: inherit; transition: width .35s ease; }
.progress-track::-moz-progress-bar { background: var(--green); border-radius: inherit; transition: width .35s ease; }
.history-notice.running .history-spinner .loading-dino { animation: dino-cruise 1.1s ease-in-out infinite; }
.history-notice.paused { background: #fff6e6; border-color: #efdfbe; }
.history-notice.paused .notice-icon { color: #a7772e; }
.history-notice.error { background: #fff0ed; border-color: #f0d0ca; }
@keyframes rotate { to { transform: rotate(360deg); } }
@keyframes dino-cruise { 50% { transform: translateX(2px); } }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.metric-card, .card { background: var(--card); border: 1px solid rgba(219, 229, 225, .9); box-shadow: var(--shadow); }
.metric-card { min-height: 184px; padding: 23px 24px; border-radius: 18px; }
.metric-card-primary { color: white; background: linear-gradient(138deg, #0b7068 0%, #075750 100%); border-color: transparent; position: relative; overflow: hidden; }
.metric-card-primary::after { content: ""; position: absolute; width: 170px; height: 170px; right: -70px; bottom: -100px; border: 27px solid rgba(255,255,255,.06); border-radius: 50%; }
.readiness-card { background: linear-gradient(138deg, #173d38 0%, #0b7068 100%); }
.dino-day-avatar { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(92px, 118px) minmax(0, 1fr); align-items: center; gap: 13px; margin: 14px 0 10px; padding: 10px 12px 10px 8px; color: white; background: linear-gradient(135deg, rgba(154,242,214,.18), rgba(255,255,255,.09)); border: 1px solid var(--avatar-border, rgba(255,255,255,.2)); border-radius: 18px; box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 14px 28px rgba(0,0,0,.09); }
.dino-avatar-art { position: relative; display: grid; place-items: center; min-width: 0; width: 100%; max-width: 118px; aspect-ratio: 1; overflow: hidden; background: radial-gradient(circle at 50% 45%, rgba(255,255,238,.98) 0 44%, rgba(144,231,207,.86) 45% 100%); border: 1px solid rgba(255,255,255,.42); border-radius: 20px; box-shadow: 0 12px 22px var(--avatar-glow, rgba(5, 24, 22, .16)); transform-origin: 50% 70%; }
.dino-avatar-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,.16), transparent 43%, rgba(11,112,104,.08)); pointer-events: none; }
.dino-avatar-image { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1.025); filter: saturate(var(--avatar-saturation, .98)) contrast(1.03) brightness(var(--avatar-brightness, 1)); }
.dino-avatar-placeholder span { display: grid; place-items: center; width: 44px; height: 44px; color: rgba(255,255,255,.88); background: rgba(11,112,104,.42); border: 1px solid rgba(255,255,255,.28); border-radius: 999px; font-size: 22px; font-weight: 950; }
.dino-avatar-copy { display: grid; gap: 2px; min-width: 0; }
.dino-avatar-copy strong { color: white; font-size: 14px; font-weight: 950; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dino-avatar-copy span { color: rgba(224, 255, 249, .84); font-size: 11px; font-weight: 800; line-height: 1.25; }
.dino-day-avatar-apex { --avatar-border: rgba(154,242,214,.48); --avatar-glow: rgba(21, 221, 181, .28); --avatar-saturation: .98; }
.dino-day-avatar-runner { --avatar-border: rgba(122,232,209,.44); --avatar-glow: rgba(16, 185, 129, .24); --avatar-saturation: .98; }
.dino-day-avatar-steady { --avatar-border: rgba(167,226,203,.42); --avatar-glow: rgba(34, 197, 154, .2); --avatar-saturation: .94; }
.dino-day-avatar-small { --avatar-border: rgba(190,232,162,.36); --avatar-glow: rgba(101, 163, 13, .18); --avatar-saturation: .9; --avatar-brightness: .99; }
.dino-day-avatar-slow { --avatar-border: rgba(194,218,190,.34); --avatar-glow: rgba(77, 124, 15, .18); --avatar-saturation: .86; --avatar-brightness: .98; }
.dino-day-avatar-empty { --avatar-border: rgba(255,255,255,.2); --avatar-glow: rgba(255,255,255,.12); }
.dino-day-avatar-apex .dino-avatar-art { animation: avatar-sprint 1.15s ease-in-out infinite; }
.dino-day-avatar-runner .dino-avatar-art { animation: avatar-run 1.45s ease-in-out infinite; }
.dino-day-avatar-steady .dino-avatar-art { animation: avatar-steady 2.2s ease-in-out infinite; }
.dino-day-avatar-small .dino-avatar-art { animation: avatar-small 2.6s ease-in-out infinite; }
.dino-day-avatar-slow .dino-avatar-art { animation: avatar-slow 3.4s ease-in-out infinite; }
@keyframes avatar-sprint { 50% { transform: translateX(4px) translateY(-2px) rotate(-1deg); } }
@keyframes avatar-run { 50% { transform: translateX(2px) translateY(-1px); } }
@keyframes avatar-steady { 50% { transform: translateY(-1px); } }
@keyframes avatar-small { 50% { transform: translateY(-2px) scale(.985); } }
@keyframes avatar-slow { 50% { transform: translateX(-1px) rotate(.7deg); } }
.metric-heading { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; font-weight: 750; }
.metric-card-primary .metric-heading { color: #cce8e3; }
.metric-icon { width: 34px; height: 34px; display: grid; place-items: center; background: rgba(255,255,255,.12); border-radius: 10px; }
.metric-icon-soft { color: var(--green); background: var(--green-soft); }
.metric-icon svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.metric-value { display: flex; align-items: baseline; gap: 7px; margin: 19px 0 5px; font-size: 46px; font-weight: 760; line-height: 1; letter-spacing: -.045em; }
.metric-value small { font-size: 15px; font-weight: 650; letter-spacing: 0; opacity: .7; }
.metric-value-dark { color: var(--ink); }
.metric-card > p { margin: 0; color: var(--muted); font-size: 12px; }
.metric-card-primary > p { color: #b7dad4; }
.trend-value { margin: 28px 0 9px; color: var(--ink); font-size: 24px; font-weight: 780; letter-spacing: -.025em; }
.trend-value.up { color: var(--green); }
.trend-value.down { color: var(--coral); }
.change-point-card { grid-column: 1 / -1; min-height: 0; padding: 22px 24px; }
.change-point-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.change-point-header > div:first-child { flex: 1; min-width: 0; }
.change-point-header .metric-heading { max-width: 310px; }
.change-point-header > div:first-child > strong { display: block; margin-top: 5px; color: var(--ink); font-size: 18px; letter-spacing: -.015em; }
.change-point-controls { display: grid; grid-template-columns: minmax(160px, .8fr) minmax(230px, 1.2fr); gap: 10px; width: min(100%, 520px); }
.change-point-select { display: grid; gap: 5px; min-width: 190px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.change-point-select select { min-height: 42px; padding: 0 34px 0 12px; color: var(--ink); background: #f3f6f5; border: 1px solid #dfe8e5; border-radius: 10px; outline: none; font: inherit; font-size: 12px; letter-spacing: 0; text-transform: none; cursor: pointer; }
.change-point-select select:disabled { cursor: not-allowed; opacity: .65; }
.change-point-select select:focus { border-color: #77aaa3; box-shadow: 0 0 0 4px rgba(11,112,104,.08); }
.change-point-overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 18px 0 12px; }
.change-point-overview > div { display: grid; gap: 5px; min-width: 0; padding: 12px 14px; background: var(--green-soft); border: 1px solid rgba(11,112,104,.1); border-radius: 12px; }
.change-point-overview span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.change-point-overview strong { color: var(--ink); font-size: 18px; overflow-wrap: anywhere; }
.change-point-overview strong.up { color: var(--green); }
.change-point-overview strong.down { color: var(--coral); }
.change-point-overview strong.good { color: var(--green); }
.change-point-overview strong.bad { color: var(--coral); }
.change-point-card > p { line-height: 1.45; }
.change-point-card > small { display: block; margin-top: 5px; color: #909c98; font-size: 10px; line-height: 1.4; }

.normal-distribution-card { grid-column: 1 / -1; min-height: 0; padding: 22px 24px 18px; }
.normal-distribution-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.normal-distribution-header > div:first-child { flex: 1; min-width: 0; }
.normal-distribution-header .metric-heading { max-width: 310px; }
.normal-distribution-header > div:first-child > strong { display: block; margin-top: 5px; color: var(--ink); font-size: 18px; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.normal-distribution-select { width: min(100%, 250px); }
.normal-distribution-overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 16px 0 12px; }
.normal-distribution-overview > div { display: grid; gap: 4px; min-width: 0; padding: 10px 13px; background: var(--green-soft); border: 1px solid rgba(11,112,104,.1); border-radius: 12px; }
.normal-distribution-overview span { overflow: hidden; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .05em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.normal-distribution-overview strong { overflow: hidden; color: var(--ink); font-size: 17px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.normal-distribution-card > p { margin-bottom: 8px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.normal-distribution-card > small { display: block; overflow: hidden; margin-top: 4px; color: #909c98; font-size: 10px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.normal-distribution-chart-wrap { position: relative; min-height: 300px; margin-top: 4px; }
#normalDistributionChart { display: block; width: 100%; height: auto; min-height: 280px; overflow: visible; }
.normal-distribution-area.good { fill: url(#normalDistributionGradientGood); }
.normal-distribution-area.bad { fill: url(#normalDistributionGradientBad); }
.normal-distribution-curve { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.normal-distribution-curve.good { stroke: var(--green); filter: drop-shadow(0 3px 3px rgba(11,112,104,.12)); }
.normal-distribution-curve.bad { stroke: var(--coral); filter: drop-shadow(0 3px 3px rgba(227,116,92,.12)); }
.normal-distribution-tick { stroke: #cbd7d3; stroke-width: 1; }
.normal-distribution-mean { stroke: var(--muted); stroke-width: 1.8; stroke-dasharray: 7 6; opacity: .72; }
.normal-distribution-latest { stroke: var(--muted); stroke-width: 2.5; stroke-dasharray: 4 4; }
.normal-distribution-latest.good { stroke: var(--green); }
.normal-distribution-latest.bad { stroke: var(--coral); }
.normal-distribution-latest-point { fill: var(--muted); stroke: white; stroke-width: 3; }
.normal-distribution-latest-point.good { fill: var(--green); filter: drop-shadow(0 2px 4px rgba(11,112,104,.34)); }
.normal-distribution-latest-point.bad { fill: var(--coral); filter: drop-shadow(0 2px 4px rgba(227,116,92,.38)); }
.normal-distribution-label { fill: var(--muted); font-size: 11px; font-weight: 800; }
.normal-distribution-label.latest.good { fill: var(--green); }
.normal-distribution-label.latest.bad { fill: var(--coral); }

.card { border-radius: 18px; }
.main-feature-empty { margin-bottom: 16px; padding: 28px; text-align: center; }
.main-feature-empty h2 { margin-bottom: 8px; font-size: 26px; font-weight: 800; letter-spacing: -.025em; }
.main-feature-empty p:last-child { max-width: 620px; margin: 0 auto; color: var(--muted); line-height: 1.55; }
.chart-card { margin-bottom: 16px; padding: 26px 27px 22px; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.card-header h2 { margin: 0; font-family: var(--font-sans); font-size: 25px; font-weight: 800; letter-spacing: -.02em; }
.range-control { display: inline-flex; flex-wrap: wrap; padding: 4px; background: #eef3f1; border-radius: 10px; }
.range-control button { padding: 7px 12px; color: #6b7975; background: transparent; border: 0; border-radius: 7px; font-size: 11px; font-weight: 750; cursor: pointer; }
.range-control button.active { color: var(--green); background: white; box-shadow: 0 2px 8px rgba(26, 60, 52, .09); }
.chart-filters { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; }
.year-filter { display: grid; gap: 4px; margin: 0; }
.year-filter span { color: #788682; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.year-filter select { width: 132px; height: 38px; padding: 0 30px 0 11px; color: #4f5f5b; background: #f3f6f5; border: 1px solid #e0e7e5; border-radius: 9px; outline: none; font-size: 11px; font-weight: 750; cursor: pointer; }
.year-filter select:focus { border-color: #77aaa3; box-shadow: 0 0 0 3px rgba(11,112,104,.08); }
.chart-selection-summary { margin: 12px 0 0 2px; color: #7c8985; font-size: 11px; }
.chart-wrap { min-height: 380px; margin-top: 15px; position: relative; overscroll-behavior-x: contain; }
#hrvChart,
#rhrChart,
#sleepChart,
#comparisonChart,
#comparisonDifferenceChart,
#bloodPressureChart { display: block; width: 100%; height: auto; min-height: 340px; overflow: visible; }
.chart-grid { stroke: #e3e9e7; stroke-width: 1; }
.chart-axis-label { fill: #84908d; font-size: 12px; }
.chart-y-title { fill: #8a9693; font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.chart-line { fill: none; stroke: var(--green); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 3px 3px rgba(11,112,104,.12)); }
.chart-area { fill: url(#areaGradient); }
.chart-area-rhr { fill: url(#rhrAreaGradient); }
.chart-area-sleep { fill: url(#sleepAreaGradient); }
.chart-trend-arrow { fill: none; stroke: #9b2fae; stroke-width: 3.2; stroke-dasharray: 12 7; stroke-linecap: round; opacity: 1; filter: drop-shadow(0 2px 2px rgba(95, 25, 111, .28)); pointer-events: none; }
.chart-trend-arrow.systolic { stroke: var(--green); }
.chart-trend-arrow.diastolic { stroke: #4f8cc9; }
.chart-trend-arrow.pulse { stroke: #e86f51; }
.trend-arrow-head { fill: #9b2fae; }
.trend-arrow-head.systolic { fill: var(--green); }
.trend-arrow-head.diastolic { fill: #4f8cc9; }
.trend-arrow-head.pulse { fill: #e86f51; }
.chart-point { fill: white; stroke: var(--green); stroke-width: 2.3; cursor: help; }
.chart-point-latest { fill: var(--green); stroke: white; stroke-width: 4; filter: drop-shadow(0 2px 4px rgba(11,112,104,.38)); }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 14px; }
.chart-legend { display: flex; align-items: center; gap: 8px; margin-left: 54px; color: #788682; font-size: 11px; }
.chart-legend span { width: 22px; height: 3px; background: var(--green); border-radius: 2px; }
.chart-legend .trend-arrow-legend,
.blood-pressure-legend .trend-arrow-legend { width: 28px; height: 8px; border-radius: 0; clip-path: polygon(0 37%, 78% 37%, 78% 0, 100% 50%, 78% 100%, 78% 63%, 0 63%); }
.chart-legend .trend-arrow-legend { background: linear-gradient(90deg, #9b2fae 0 7px, transparent 7px 11px, #9b2fae 11px 18px, transparent 18px 22px, #9b2fae 22px 25px, transparent 25px); }
.blood-pressure-legend .trend-arrow-legend { background: linear-gradient(90deg, var(--green) 0 7px, transparent 7px 11px, var(--green) 11px 18px, transparent 18px 22px, var(--green) 22px 25px, transparent 25px); }

.comparison-header { align-items: flex-start; }
.comparison-subline { max-width: 690px; margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.comparison-card { --comparison-first: #0072b2; --comparison-second: #d55e00; }
.comparison-controls { display: grid; grid-template-columns: repeat(3, minmax(140px, 1fr)); gap: 12px; align-items: stretch; margin-top: 18px; }
.comparison-controls.comparison-controls-manual { grid-template-columns: repeat(3, minmax(140px, .5fr)) repeat(2, minmax(250px, 1fr)); }
.comparison-metric,
.comparison-duration,
.comparison-offset,
.comparison-period { min-width: 0; margin: 0; padding: 12px 14px; background: linear-gradient(135deg, rgba(223, 241, 237, .72), rgba(255, 255, 255, .92)); border: 1px solid rgba(11, 112, 104, .14); border-radius: 14px; }
.comparison-metric,
.comparison-duration,
.comparison-offset { display: grid; align-content: center; gap: 6px; color: #5f6f6b; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.comparison-period { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.comparison-period legend { padding: 0 5px; color: var(--ink); font-size: 11px; font-weight: 850; letter-spacing: .04em; }
.comparison-period label { min-width: 0; color: #5f6f6b; font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.comparison-metric select,
.comparison-duration select,
.comparison-offset select,
.comparison-period input { width: 100%; min-width: 0; height: 44px; padding: 0 11px; color: var(--ink); background: white; border: 1px solid #dce8e4; border-radius: 10px; outline: none; font: inherit; font-size: 12px; font-weight: 700; letter-spacing: normal; text-transform: none; }
.comparison-period input { display: block; margin-top: 6px; }
.comparison-metric select:focus,
.comparison-duration select:focus,
.comparison-offset select:focus,
.comparison-period input:focus { border-color: #77aaa3; box-shadow: 0 0 0 4px rgba(11, 112, 104, .08); }
.comparison-summary.comparison-warning { color: var(--coral); font-weight: 750; }
.comparison-line { fill: none; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.comparison-line-first { stroke: var(--comparison-first); filter: drop-shadow(0 3px 3px rgba(0, 114, 178, .18)); }
.comparison-line-second { stroke: var(--comparison-second); stroke-dasharray: 12 7; filter: drop-shadow(0 3px 3px rgba(213, 94, 0, .18)); }
.comparison-point { fill: white; stroke-width: 2.4; cursor: help; }
.comparison-point-first { stroke: var(--comparison-first); }
.comparison-point-second { fill: var(--comparison-second); stroke: white; }
.comparison-legend { flex-wrap: wrap; row-gap: 5px; }
.comparison-legend strong { margin-right: 12px; overflow: hidden; font-size: inherit; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.comparison-legend .comparison-swatch { flex: 0 0 22px; }
.comparison-legend .comparison-swatch-first { background: var(--comparison-first); }
.comparison-legend .comparison-swatch-second { background: repeating-linear-gradient(90deg, var(--comparison-second) 0 8px, transparent 8px 12px); }
body[data-theme="dark"] .comparison-card { --comparison-first: #56b4e9; --comparison-second: #e69f00; }
.comparison-difference { margin-top: 22px; padding-top: 20px; border-top: 1px solid rgba(11, 112, 104, .13); }
.comparison-difference-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.comparison-difference-header h3 { margin: 2px 0 0; color: var(--ink); font-size: 18px; font-weight: 800; }
.comparison-difference-header > p { max-width: 620px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; text-align: right; }
.comparison-difference-wrap { min-height: 290px; margin-top: 8px; }
#comparisonDifferenceChart { min-height: 260px; }
.comparison-difference-grid { stroke: #e3e9e7; stroke-width: 1; }
.comparison-difference-grid.zero { stroke: #6f7c78; stroke-width: 1.6; }
.comparison-difference-bar { opacity: .9; }
.comparison-difference-bar.good { fill: #16845f; }
.comparison-difference-bar.bad { fill: #d1493f; }
.comparison-difference-bar.neutral { fill: #7b8784; }
.comparison-difference-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 9px; margin: 2px 0 0 54px; color: #788682; font-size: 11px; }
.comparison-difference-swatch { width: 15px; height: 8px; border-radius: 3px; }
.comparison-difference-swatch.good { background: #16845f; }
.comparison-difference-swatch.bad { background: #d1493f; }
.comparison-difference-swatch.neutral { background: #7b8784; }
body[data-theme="dark"] .chart-trend-arrow:not(.systolic):not(.diastolic):not(.pulse) { stroke: #e1a0f1; filter: drop-shadow(0 2px 2px rgba(225, 160, 241, .22)); }
body[data-theme="dark"] .trend-arrow-head:not(.systolic):not(.diastolic):not(.pulse) { fill: #e1a0f1; }
body[data-theme="dark"] .chart-legend .trend-arrow-legend { background: linear-gradient(90deg, #e1a0f1 0 7px, transparent 7px 11px, #e1a0f1 11px 18px, transparent 18px 22px, #e1a0f1 22px 25px, transparent 25px); }
body[data-theme="dark"] .comparison-difference-grid { stroke: #29443e; }
body[data-theme="dark"] .comparison-difference-grid.zero { stroke: #a7b8b3; }
body[data-theme="dark"] .comparison-difference-bar.good,
body[data-theme="dark"] .comparison-difference-swatch.good { fill: #45c79c; background: #45c79c; }
body[data-theme="dark"] .comparison-difference-bar.bad,
body[data-theme="dark"] .comparison-difference-swatch.bad { fill: #ff7b70; background: #ff7b70; }

.blood-pressure-card { margin-bottom: 16px; padding: 26px 27px 22px; }
.blood-pressure-subline { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.blood-pressure-form { display: grid; grid-template-columns: repeat(5, minmax(110px, 1fr)); gap: 12px; align-items: end; margin-top: 20px; padding: 16px; background: linear-gradient(135deg, rgba(223, 241, 237, .76), rgba(255, 255, 255, .92)); border: 1px solid rgba(11, 112, 104, .14); border-radius: 16px; box-shadow: inset 0 1px 0 rgba(255,255,255,.72), 0 10px 24px rgba(24, 57, 50, .045); }
.blood-pressure-form label { margin: 0; color: #5f6f6b; font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.blood-pressure-form input { width: 100%; min-height: 44px; margin-top: 6px; padding: 0 12px; color: var(--ink); background: white; border: 1px solid #dce8e4; border-radius: 11px; outline: none; box-shadow: 0 1px 0 rgba(255,255,255,.85); }
.blood-pressure-form input:focus { border-color: #77aaa3; box-shadow: 0 0 0 4px rgba(11,112,104,.08); }
.blood-pressure-form input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
.blood-pressure-form input[type="number"]::-webkit-outer-spin-button,
.blood-pressure-form input[type="number"]::-webkit-inner-spin-button { margin: 0; -webkit-appearance: none; }
.blood-pressure-note { grid-column: 1 / span 3; }
.blood-pressure-form-actions { grid-column: 4 / span 2; display: flex; gap: 9px; justify-content: flex-end; }
.blood-pressure-form-actions .button { min-height: 44px; }
.blood-pressure-overview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 20px; }
.blood-pressure-chart-header { margin-top: 8px; }
.blood-pressure-chart-header h3 { margin: 0; color: var(--ink); font-size: 20px; letter-spacing: -.02em; }
.blood-pressure-line { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 3px 3px rgba(11,112,104,.1)); }
.blood-pressure-line.systolic { stroke: var(--green); }
.blood-pressure-line.diastolic { stroke: #4f8cc9; }
.blood-pressure-line.pulse { stroke: #e86f51; stroke-dasharray: 8 7; }
.blood-pressure-point { stroke: var(--green); }
.blood-pressure-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 15px; margin: 8px 0 18px 54px; color: #788682; font-size: 11px; }
.blood-pressure-legend span { width: 22px; height: 3px; border-radius: 2px; }
.blood-pressure-legend .systolic { background: var(--green); }
.blood-pressure-legend .diastolic { background: #4f8cc9; }
.blood-pressure-legend .pulse { background: repeating-linear-gradient(90deg, #e86f51 0 8px, transparent 8px 13px); }
.blood-pressure-table-scroll { max-height: 430px; border-top: 1px solid var(--line); }
.blood-pressure-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.button-small { min-height: 32px; padding: 0 10px; font-size: 11px; border-radius: 9px; }

.weekday-card { margin-bottom: 16px; padding: 26px 27px 22px; }
.weekday-header > p { margin: 0; color: var(--muted); font-size: 12px; font-weight: 650; }
.weekday-chart-wrap { min-height: 350px; margin-top: 14px; position: relative; overscroll-behavior-x: contain; }
#weekdayChart { display: block; width: 100%; height: auto; min-height: 330px; overflow: visible; }
.weekday-bar { fill: var(--green); transition: opacity .18s ease, transform .18s ease; transform-box: fill-box; transform-origin: bottom; }
.weekday-bar:hover { opacity: .82; transform: scaleY(1.015); }
.weekday-bar.weekend { fill: #4e9d94; }
.weekday-value-label { fill: var(--ink); font-size: 13px; font-weight: 800; }
.weekday-axis-label { fill: #65736f; font-size: 12px; font-weight: 700; }
.weekday-count-label { fill: #99a39f; font-size: 10px; }
.weekday-legend { display: flex; align-items: center; gap: 8px; margin-left: 54px; color: #788682; font-size: 11px; }
.weekday-legend span { width: 12px; height: 12px; background: var(--green); border-radius: 3px; }

.period-card { margin-bottom: 16px; padding: 26px 27px 22px; }
.period-overview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 22px 0 20px; }
.period-stat { display: grid; grid-template-columns: 1fr auto auto; align-items: baseline; gap: 5px; padding: 15px 16px; background: #f3f8f6; border: 1px solid #e2ece9; border-radius: 12px; }
.period-stat > span { grid-column: 1 / -1; margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.period-stat strong { color: var(--ink); font-size: 25px; letter-spacing: -.035em; }
.period-stat small { color: var(--muted); font-size: 11px; font-weight: 700; }
.period-chart-meta { display: flex; justify-content: space-between; gap: 18px; margin: 4px 4px 0 64px; }
.period-chart-meta strong { color: #4f5f5b; font-size: 12px; }
.period-chart-meta span { color: #8a9693; font-size: 11px; }
.period-chart-wrap { min-height: 345px; position: relative; overscroll-behavior-x: contain; }
#periodChart { display: block; width: 100%; height: auto; min-height: 325px; overflow: visible; }
.period-bar { fill: #75aaa3; transition: opacity .18s ease, transform .18s ease; transform-box: fill-box; transform-origin: bottom; }
.period-bar:hover { opacity: .82; transform: scaleY(1.015); }
.period-bar.latest { fill: var(--green); }
.period-value-label { fill: var(--ink); font-size: 12px; font-weight: 800; }
.period-axis-label { fill: #667571; font-size: 11px; font-weight: 700; }
.period-legend { display: flex; align-items: center; gap: 8px; margin-left: 54px; color: #788682; font-size: 11px; }
.period-legend span { width: 12px; height: 12px; background: #75aaa3; border-radius: 3px; }

.best-self-card { margin-bottom: 16px; padding: 26px 27px 24px; }
.best-self-subline { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.best-self-subline strong { color: var(--ink); }
.best-self-overview .period-stat small { grid-column: auto; }
.best-self-chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 20px; }
.best-self-chart-panel { min-width: 0; padding: 18px; background: #f8fbfa; border: 1px solid #e1ebe8; border-radius: 15px; }
.best-self-panel-header { margin-bottom: 8px; }
.best-self-panel-header h3 { margin: 0 0 4px; font-size: 15px; }
.best-self-panel-header p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.best-self-chart-wrap { min-height: 280px; position: relative; overflow: hidden; }
#bestSelfQuestionChart,
#bestSelfDistributionChart { display: block; width: 100%; min-width: 0; height: auto; min-height: 260px; overflow: visible; }
.best-self-bar { fill: var(--green); transition: opacity .18s ease, transform .18s ease; transform-box: fill-box; transform-origin: bottom; }
.best-self-bar:hover { opacity: .82; transform: scaleY(1.015); }
.best-self-bar-strong { fill: #35a88d; }
.best-self-import { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px) auto; gap: 12px; align-items: end; margin-top: 18px; padding: 16px; background: #f3f8f6; border: 1px solid #e0ebe8; border-radius: 14px; }
.best-self-import strong { display: block; margin-bottom: 4px; font-size: 13px; }
.best-self-import p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.best-self-import code { color: #174943; font-size: 11px; }
.best-self-import input { height: 44px; background: white; }
.best-self-modal { width: min(100%, 760px); }
.best-self-calendar { margin: 0 0 18px; padding: 15px; background: #fbfdfc; border: 1px solid #dbe8e4; border-radius: 16px; }
.best-self-calendar-header { display: grid; grid-template-columns: 42px 1fr 42px; align-items: center; gap: 8px; margin-bottom: 12px; }
.best-self-calendar-header strong { color: var(--ink); text-align: center; font-size: 16px; letter-spacing: -.015em; text-transform: capitalize; }
.best-self-calendar-header .icon-button { width: 44px; height: 44px; color: var(--green); background: #eef8f5; border: 1px solid #cfe5df; font-size: 24px; line-height: 1; }
.best-self-calendar-selected { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 8px; margin: 0 0 12px; padding: 11px 12px; background: #eef8f5; border: 1px solid #cfe5df; border-radius: 12px; }
.best-self-calendar-selected span { color: #73817d; font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.best-self-calendar-selected strong { color: var(--ink); font-size: 14px; }
.best-self-calendar-selected em { color: var(--green); font-size: 12px; font-style: normal; font-weight: 900; text-align: right; }
.best-self-calendar-weekdays,
.best-self-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.best-self-calendar-weekdays { margin-bottom: 7px; }
.best-self-calendar-weekdays span { color: #71807c; text-align: center; font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.best-self-calendar-empty { min-height: 48px; }
.best-self-calendar-day { min-height: 48px; display: grid; place-items: center; gap: 1px; padding: 5px 2px; color: #52625e; background: white; border: 1px solid #dde8e4; border-radius: 12px; font-weight: 850; cursor: pointer; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease; }
.best-self-calendar-day:hover { transform: translateY(-1px); border-color: #93c9c1; box-shadow: 0 9px 18px rgba(25, 74, 66, .1); }
.best-self-calendar-day small { color: inherit; font-size: 9px; font-weight: 950; line-height: 1; }
.best-self-calendar-day.is-done { color: white; background: linear-gradient(135deg, #00875a, #0b7068); border-color: #007452; box-shadow: 0 8px 18px rgba(0, 135, 90, .2); }
.best-self-calendar-day.is-today { border-color: #f59f00; box-shadow: inset 0 0 0 2px rgba(245, 159, 0, .42); }
.best-self-calendar-day.is-selected { border-color: #173f39; box-shadow: 0 0 0 3px rgba(11, 112, 104, .18), 0 9px 20px rgba(11, 112, 104, .18); }
.best-self-calendar-day.is-selected span { text-decoration: underline; text-underline-offset: 3px; }
.ranking-calendar .best-self-calendar-day.is-selected,
.blood-count-calendar-panel .best-self-calendar-day.is-selected {
  position: relative;
  z-index: 2;
  border-color: #173f39;
  outline: 3px solid var(--coral);
  outline-offset: 1px;
  box-shadow: 0 8px 22px rgba(23, 63, 57, .28), inset 0 0 0 2px rgba(255, 255, 255, .78);
  transform: translateY(-1px);
}
.ranking-calendar .best-self-calendar-day.is-selected::after,
.blood-count-calendar-panel .best-self-calendar-day.is-selected::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 9px;
  height: 9px;
  background: var(--coral);
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(23, 63, 57, .32);
}
.best-self-calendar-day.is-future,
.best-self-calendar-day:disabled { color: #a4afac; background: #f3f5f4; border-color: #e3e9e7; box-shadow: none; cursor: not-allowed; opacity: .62; }
.best-self-calendar-day.is-future:hover,
.best-self-calendar-day:disabled:hover { transform: none; border-color: #e3e9e7; box-shadow: none; }
.best-self-calendar-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; color: #74827e; font-size: 11px; font-weight: 800; }
.best-self-calendar-legend span { display: inline-flex; align-items: center; gap: 6px; }
.best-self-calendar-legend i { width: 12px; height: 12px; display: inline-block; border-radius: 4px; }
.legend-done { background: #00875a; }
.legend-today { background: white; border: 2px solid #f59f00; }
.legend-selected { background: var(--coral); border: 2px solid #173f39; box-shadow: 0 0 0 2px rgba(238, 108, 77, .24); }
.best-self-question-list { display: grid; gap: 10px; }
.best-self-question-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px; background: #fbfdfc; border: 1px solid #e4ece9; border-radius: 13px; }
.best-self-question-row p { margin: 0; color: #31423e; font-size: 13px; line-height: 1.45; }
.best-self-question-row p span { color: var(--green); font-weight: 900; }
.best-self-answer-group { display: inline-flex; gap: 8px; }
.best-self-answer { width: 50px; height: 44px; display: grid; place-items: center; border-radius: 12px; font-size: 17px; font-weight: 950; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease; }
.best-self-answer:hover { transform: translateY(-1px) scale(1.02); }
.best-self-zero { color: #b42318; background: #ffdfd8; border: 2px solid #e54835; }
.best-self-one { color: #006b4a; background: #d5f8ed; border: 2px solid #00875a; }
.best-self-zero.selected { color: white; background: #d92d20; border-color: #a61b12; box-shadow: 0 10px 22px rgba(217, 45, 32, .36); }
.best-self-one.selected { color: white; background: #00875a; border-color: #005c42; box-shadow: 0 10px 22px rgba(0, 135, 90, .34); }
.best-self-submit-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; }
.best-self-submit-row span { color: var(--muted); font-size: 12px; font-weight: 800; }

.settings-modal { width: min(100%, 980px); }
.import-export-page-hero { margin: 0 0 22px; }
.import-export-page-hero h1 { margin: 2px 0 7px; font-size: clamp(1.8rem, 3vw, 2.65rem); line-height: 1.05; }
.import-export-page-hero p:last-child { max-width: 820px; margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.5; }
.import-export-page-content { display: grid; gap: 18px; }
.import-export-page-section { min-width: 0; padding: 20px; background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 13px 34px rgba(18, 54, 47, .055); }
.import-export-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.import-export-section-heading h2 { margin: 2px 0 0; font-size: 21px; letter-spacing: -.025em; }
.import-export-section-heading > p { max-width: 460px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; text-align: right; }
.import-export-task-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; min-width: 0; }
.biometric-import-export-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.import-export-task { position: relative; display: grid; align-content: start; gap: 14px; min-width: 0; padding: 17px; background: #f8fbfa; border: 1px solid #e1ebe8; border-radius: 15px; }
.import-export-task > div:first-of-type { padding-right: 30px; }
.import-export-task h3 { margin: 0 0 5px; font-size: 16px; letter-spacing: -.02em; }
.import-export-task p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.import-export-step { position: absolute; top: 13px; right: 13px; width: 25px; height: 25px; display: grid; place-items: center; color: white; background: var(--green); border-radius: 50%; font-size: 11px; font-weight: 900; }
.import-export-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.import-export-card { display: grid; align-content: start; gap: 15px; min-width: 0; padding: 18px; background: #f8fbfa; border: 1px solid #e1ebe8; border-radius: 15px; }
.import-export-card h3 { margin: 0 0 6px; font-size: 17px; letter-spacing: -.02em; }
.import-export-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.import-export-form { display: grid; gap: 9px; padding: 14px; background: #f3f8f6; border: 1px solid #e0ebe8; border-radius: 13px; }
.import-export-form label { margin: 0; }
.import-export-form input { width: 100%; min-width: 0; min-height: 42px; background: white; }
.import-export-form code { color: #174943; font-size: 11px; }
.import-export-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.import-export-actions .button { min-width: 0; flex: 1 1 190px; white-space: normal; }
.apple-health-converter-task .import-export-form,
.apple-health-import-task .import-export-form { grid-template-columns: 1fr; align-items: end; }
.apple-health-converter-task .import-export-form > label,
.apple-health-import-task .import-export-form > label,
.apple-health-local-note,
.apple-health-converter-progress { grid-column: 1 / -1; }
.apple-health-converter-task .import-export-form > .button,
.apple-health-import-task .import-export-form > .button { width: 100%; min-height: 42px; white-space: normal; }
.apple-health-local-note { display: flex; align-items: center; gap: 7px; color: #47655e !important; }
.apple-health-local-note svg { width: 17px; height: 17px; flex: 0 0 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.apple-health-converter-progress { display: grid; gap: 7px; padding-top: 3px; }
.apple-health-converter-progress > div { display: flex; justify-content: space-between; gap: 14px; color: var(--ink); font-size: 11px; }
.apple-health-converter-progress span { color: var(--green); font-weight: 850; white-space: nowrap; }
.apple-health-converter-progress progress { width: 100%; height: 9px; overflow: hidden; appearance: none; -webkit-appearance: none; border: 0; border-radius: 999px; background: #dce9e5; }
.apple-health-converter-progress progress::-webkit-progress-bar { background: #dce9e5; border-radius: 999px; }
.apple-health-converter-progress progress::-webkit-progress-value { background: linear-gradient(90deg, #087c68, #2fc9a8); border-radius: 999px; }
.apple-health-converter-progress progress::-moz-progress-bar { background: linear-gradient(90deg, #087c68, #2fc9a8); border-radius: 999px; }
.apple-health-converter-result { display: grid; gap: 12px; padding: 15px; color: #16483f; background: #eaf9f4; border: 1px solid #bde7d9; border-radius: 13px; }
.apple-health-converter-result-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.apple-health-converter-result-heading > div { display: flex; align-items: center; gap: 10px; min-width: 0; }
.apple-health-converter-result-heading strong,
.apple-health-converter-result-heading small { display: block; }
.apple-health-converter-result-heading small { margin-top: 2px; color: #52756d; font-size: 11px; }
.apple-health-converter-check { width: 28px; height: 28px; display: grid; flex: 0 0 28px; place-items: center; color: white; background: var(--green); border-radius: 50%; font-weight: 900; }
.apple-health-converter-ratio { flex: 0 0 auto; padding: 5px 9px; color: #086252; background: white; border: 1px solid #bde7d9; border-radius: 999px; font-size: 11px; font-weight: 900; white-space: nowrap; }
.apple-health-converter-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.apple-health-converter-stats > div { min-width: 0; padding: 9px 11px; background: rgba(255, 255, 255, .72); border: 1px solid rgba(189, 231, 217, .9); border-radius: 10px; }
.apple-health-converter-stats dt { color: #5d7b74; font-size: 10px; font-weight: 750; }
.apple-health-converter-stats dd { margin: 2px 0 0; color: #103e36; font-size: 14px; font-weight: 900; white-space: nowrap; }
.apple-health-converter-breakdown { color: #476d64 !important; font-weight: 700; }
.apple-health-converter-actions .button { flex-basis: 220px; }
.apple-health-converter-actions svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.import-export-empty { margin: 14px 0 0; padding: 15px; color: var(--muted); background: #f8fbfa; border: 1px dashed #d7e4e0; border-radius: 13px; text-align: center; }

.table-card { padding: 25px 27px 8px; }
.table-header { padding-bottom: 20px; }
.table-header > p { margin: 0; color: var(--muted); font-size: 12px; font-weight: 650; }
.table-scroll { max-height: 490px; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { position: sticky; top: 0; z-index: 2; padding: 13px 14px; color: #7a8884; background: white; text-align: left; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
td { padding: 15px 14px; border-top: 1px solid #edf1f0; color: #4d5d59; }
tbody tr:hover { background: #f7faf8; }
td strong { color: var(--ink); font-size: 15px; }
.muted-cell { display: inline-block; margin-top: 3px; color: #7c8985; font-size: 11px; font-weight: 750; }
.delta { display: inline-flex; min-width: 58px; align-items: center; gap: 4px; font-weight: 700; }
.delta.up { color: var(--green); }
.delta.down { color: var(--coral); }
.status-badge { display: inline-flex; padding: 5px 9px; color: #54706a; background: #e9f3f0; border-radius: 999px; font-size: 10px; font-weight: 750; }
.status-badge.preview { color: #776c58; background: #f4efe4; }
.empty-row td { padding: 40px; text-align: center; color: var(--muted); }

.footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; padding: 20px 2px 0; color: #899491; font-size: 11px; }
.footer-powered { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; color: #53635f; font-weight: 800; }
.footer-powered strong { color: var(--green); font-weight: 850; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); background: rgba(15, 35, 31, .52); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal { width: min(100%, 470px); max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 27px; background: white; border-radius: 20px; box-shadow: 0 28px 80px rgba(13, 39, 34, .3); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; }
.modal-header h2 { margin: 0; font-family: var(--font-sans); font-size: 28px; font-weight: 800; }
.modal-close { font-size: 27px; line-height: 1; }
.modal-copy { margin-bottom: 22px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.modal-copy.small { margin: 12px 0 0; font-size: 12px; }
label { display: block; margin: 14px 0 7px; color: #3d4e49; font-size: 12px; font-weight: 720; }
input, select, textarea { min-width: 0; max-width: 100%; }
input, select { width: 100%; height: 48px; padding: 0 13px; color: var(--ink); background: #f8faf9; border: 1px solid #d8e2df; border-radius: 10px; outline: none; transition: .18s; }
input[type="file"] { height: auto; min-height: 48px; padding: 7px; line-height: 1.35; }
input[type="file"]::file-selector-button { min-height: 32px; margin-right: 10px; padding: 5px 10px; color: var(--green); background: white; border: 1px solid #d4e2df; border-radius: 8px; font: inherit; font-weight: 800; cursor: pointer; }
input[type="file"]::-webkit-file-upload-button { min-height: 32px; margin-right: 10px; padding: 5px 10px; color: var(--green); background: white; border: 1px solid #d4e2df; border-radius: 8px; font: inherit; font-weight: 800; cursor: pointer; }
input[type="date"], input[type="time"] { min-width: 0; }
input[type="date"]::-webkit-date-and-time-value, input[type="time"]::-webkit-date-and-time-value { min-height: 1.2em; text-align: left; }
input:focus, select:focus { background: white; border-color: #6eaaa2; box-shadow: 0 0 0 4px rgba(11,112,104,.09); }
.password-field { width: 100%; height: 48px; display: flex; align-items: center; overflow: hidden; background: #f8faf9; border: 1px solid #d8e2df; border-radius: 10px; transition: .18s; }
.password-field:focus-within { background: white; border-color: #6eaaa2; box-shadow: 0 0 0 4px rgba(11,112,104,.09); }
.password-field input { min-width: 0; height: 46px; padding-right: 8px; background: transparent; border: 0; box-shadow: none; }
.password-field input:focus { background: transparent; border: 0; box-shadow: none; }
.password-toggle-button { align-self: stretch; flex: 0 0 auto; padding: 0 12px; color: var(--green); background: transparent; border: 0; border-left: 1px solid #d8e2df; font-size: 11px; font-weight: 850; cursor: pointer; }
.password-toggle-button:hover { background: rgba(11, 112, 104, .07); }
.admin-user-actions .password-field,
.admin-user-controls .password-field { height: 40px; }
.admin-user-actions .password-field input,
.admin-user-controls .password-field input { height: 38px; }
.captcha-box { display: grid; gap: 8px; margin: 14px 0 16px; padding: 13px; background: #f3f8f6; border: 1px solid #dbe8e4; border-radius: 13px; }
.captcha-box.hidden { display: none; }
.captcha-row { display: grid; grid-template-columns: auto 1fr auto; gap: 9px; align-items: center; }
.captcha-row span { color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.captcha-row strong { justify-self: start; color: var(--green); font-size: 18px; letter-spacing: .04em; }
.captcha-refresh { min-height: 32px; padding: 0 10px; color: var(--green); background: white; border: 1px solid #d4e2df; border-radius: 999px; font-size: 11px; font-weight: 850; cursor: pointer; }
.captcha-refresh:hover { border-color: rgba(11, 112, 104, .42); }
.captcha-box label { margin: 0; }
.captcha-box input { height: 42px; text-align: center; font-size: 18px; font-weight: 850; }
.captcha-box.is-recaptcha { justify-items: start; }
.captcha-box.is-recaptcha .captcha-row { grid-template-columns: auto 1fr; }
.recaptcha-widget { min-height: 78px; transform-origin: left top; }
.captcha-hint { margin: -2px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.captcha-hint.error { color: #9c4037; font-weight: 800; }
.auth-switch { margin: 15px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.auth-switch button { padding: 0; color: var(--green); background: transparent; border: 0; font: inherit; font-weight: 850; text-decoration: underline; cursor: pointer; }
.auth-switch button:hover { color: var(--green-deep); }
.source-setting { display: grid; gap: 8px; margin-bottom: 18px; padding: 16px; background: #f5f8f7; border: 1px solid #e2e9e7; border-radius: 13px; }
.source-setting label { margin: 0; color: var(--ink); font-size: 12px; font-weight: 850; }
.source-setting select { width: 100%; height: 43px; padding: 0 12px; color: var(--ink); background: white; border: 1px solid #d8e4e1; border-radius: 10px; font: inherit; font-weight: 750; }
.source-setting p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.account-setting { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px; margin: 0 0 18px; padding: 16px; background: #fffaf1; border: 1px solid #f0dfba; border-radius: 13px; }
.account-setting strong { font-size: 13px; }
.account-setting p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.account-setting .button { flex: 0 0 auto; }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.account-password-form { display: grid; flex: 1 1 100%; gap: 12px; padding: 15px; background: rgba(255,255,255,.78); border: 1px solid #ead8aa; border-radius: 12px; }
.account-password-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.account-password-fields > div { min-width: 0; }
.account-password-fields label { margin-top: 0; }
.account-password-actions { display: flex; justify-content: flex-end; gap: 8px; }
.account-password-form .form-status { margin: 0; }
.recovery-codes { flex: 1 1 100%; padding: 13px; background: rgba(255,255,255,.78); border: 1px dashed #dcc991; border-radius: 12px; }
.recovery-codes pre { margin: 10px 0 0; padding: 12px; overflow-x: auto; color: #183932; background: #fffdf7; border: 1px solid #efe0b9; border-radius: 10px; font-size: 13px; line-height: 1.65; letter-spacing: .04em; }
.connected-state { display: flex; gap: 12px; margin-bottom: 22px; padding: 17px; background: #edf7f4; border-radius: 13px; }
.connected-state > span { width: 11px; height: 11px; flex: 0 0 auto; margin-top: 4px; background: #35a88d; border-radius: 50%; box-shadow: 0 0 0 5px rgba(53,168,141,.12); }
.connected-state strong { font-size: 13px; }
.connected-state p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.history-setting { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 0 0 20px; padding: 17px; background: #f5f8f7; border: 1px solid #e2e9e7; border-radius: 13px; }
.history-setting strong { font-size: 13px; }
.history-setting p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.history-setting .button { flex: 0 0 auto; }
.user-admin-panel { margin: 18px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
.user-list-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.user-badge { display: inline-flex; padding: 4px 8px; color: #54706a; background: #e9f3f0; border-radius: 999px; font-size: 9px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.user-badge.admin { color: white; background: var(--green); }
.user-badge.pending { color: #7b622e; background: #fff2d4; }
.admin-modal { width: min(100%, 1160px); overflow-x: hidden; }
.admin-overlay-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.admin-users-section,
.admin-create-panel { min-width: 0; padding: 18px; background: #f7faf9; border: 1px solid #e2e9e7; border-radius: 16px; }
.admin-security-section { margin-top: 18px; padding: 18px; background: #f7faf9; border: 1px solid #e2e9e7; border-radius: 16px; }
.admin-security-grid { display: grid; grid-template-columns: minmax(250px, .85fr) minmax(0, 1.15fr); gap: 14px; align-items: start; }
.admin-security-card { padding: 15px; background: white; border: 1px solid #e0e8e5; border-radius: 14px; }
.admin-security-card h4 { margin: 0 0 10px; font-size: 14px; }
.admin-security-card strong { display: block; margin-bottom: 5px; color: var(--ink); font-size: 13px; }
.admin-security-card p { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.admin-test-email-form { display: grid; gap: 9px; }
.admin-test-email-form label { margin: 0; color: var(--ink); font-size: 12px; font-weight: 850; }
.admin-test-email-form input { width: 100%; min-width: 0; height: 42px; }
.admin-test-email-form .button { width: 100%; }
.admin-test-email-form .form-status { margin: 0; overflow-wrap: anywhere; white-space: normal; }
.protection-card { border-color: #f0dfba; }
.protection-card.active { background: #fff6f2; border-color: rgba(227, 116, 92, .44); box-shadow: 0 14px 34px rgba(227, 116, 92, .1); }
.protection-card.active strong { color: var(--coral); }
.protection-card label { margin-top: 10px; }
.protection-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.protection-actions .button { flex: 1 1 160px; }
.audit-event-list { display: grid; gap: 8px; max-height: 360px; overflow: auto; padding-right: 2px; }
.audit-event { display: grid; gap: 5px; padding: 11px; background: #f8fbfa; border: 1px solid #e2e9e7; border-radius: 12px; }
.audit-event div { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.audit-event strong { margin: 0; font-size: 12px; }
.audit-event span,
.audit-event p,
.audit-event small { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.admin-section-header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 14px; }
.admin-section-header h3,
.admin-create-panel h3 { margin: 0 0 5px; font-size: 16px; }
.admin-section-header p,
.admin-create-panel p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.admin-user-list { display: grid; gap: 12px; }
.admin-user-card { display: grid; gap: 14px; padding: 15px; background: white; border: 1px solid #e0e8e5; border-radius: 14px; box-shadow: 0 8px 20px rgba(24, 57, 50, .045); }
.admin-user-card.inactive { opacity: .72; }
.admin-user-card-header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.admin-user-card-header > div:first-child { min-width: 0; }
.admin-user-card-header strong { display: block; font-size: 15px; }
.admin-user-card-header strong,
.admin-user-card-header span { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.admin-user-card-header span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.admin-user-dataset-summary { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px 18px; min-width: 0; padding: 10px 12px; color: var(--ink); background: var(--green-soft); border: 1px solid rgba(11, 112, 104, .16); border-radius: 12px; }
.admin-user-dataset-total { min-width: 118px; }
.admin-user-dataset-total span,
.admin-user-dataset-total strong { display: block; white-space: nowrap; }
.admin-user-dataset-total span { color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.admin-user-dataset-total strong { margin-top: 1px; color: var(--green-deep); font-size: 22px; font-variant-numeric: tabular-nums; line-height: 1.05; }
.admin-user-dataset-breakdown { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; min-width: 0; }
.admin-user-dataset-breakdown > span { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 4px 8px; color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: 999px; font-size: 10px; font-weight: 750; white-space: nowrap; }
.admin-user-dataset-breakdown strong { color: var(--ink); font-size: 11px; font-variant-numeric: tabular-nums; }
.admin-user-dataset-summary > small { grid-column: 1 / -1; color: #a52218; font-size: 10px; font-weight: 750; }
.admin-user-dataset-summary.is-unavailable { background: #fff3ef; border-color: rgba(238, 108, 77, .28); }
.admin-user-controls { display: grid; grid-template-columns: minmax(180px, 1.3fr) minmax(150px, 1fr) minmax(140px, .8fr) minmax(140px, .8fr); gap: 10px; align-items: end; }
.admin-user-actions { display: grid; grid-template-columns: minmax(180px, 1fr) auto auto auto; gap: 8px; align-items: end; }
.admin-user-controls > *,
.admin-user-actions > * { min-width: 0; }
.admin-feature-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 11px; background: #f3f8f6; border: 1px solid #e0ebe8; border-radius: 12px; }
.admin-feature-controls > span { margin-right: 4px; color: var(--muted); font-size: 11px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.admin-feature-controls label { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; margin: 0; padding: 6px 10px; color: #31504a; background: white; border: 1px solid #dfe9e6; border-radius: 999px; font-size: 12px; font-weight: 850; }
.admin-feature-controls input { width: 16px; height: 16px; accent-color: var(--green); }
.admin-user-controls label,
.admin-user-actions label { margin: 0; }
.admin-user-actions .button { min-height: 40px; padding: 0 12px; }
.admin-user-actions input { height: 40px; }
.admin-user-controls input,
.admin-user-controls select { height: 40px; }
.admin-active-toggle { display: flex !important; align-items: center; gap: 8px; height: 40px; margin: 0; color: #41524e; font-size: 12px; font-weight: 800; }
.admin-active-toggle input { width: 18px; height: 18px; accent-color: var(--green); }
.admin-empty { margin: 0; padding: 18px; color: var(--muted); background: white; border-radius: 12px; text-align: center; }
.admin-modal-description { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.admin-overview { display: grid; gap: 16px; margin: 18px 0; padding: 18px; background: #f7faf9; border: 1px solid #e2e9e7; border-radius: 16px; }
.admin-overview-head,
.admin-overview-panel-head { min-width: 0; }
.admin-overview-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.admin-overview-head h3,
.admin-overview-head p,
.admin-overview-panel-head h3,
.admin-overview-panel-head p { margin: 0; overflow-wrap: anywhere; }
.admin-overview-head h3 { font-size: 16px; }
.admin-overview-head p,
.admin-overview-panel-head p { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.admin-version { flex: 0 0 auto; max-width: 100%; padding: 5px 9px; color: var(--green-deep); background: white; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; font-weight: 900; overflow-wrap: anywhere; }
.admin-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.admin-summary-item { min-width: 0; padding: 11px 12px; background: white; border: 1px solid var(--line); border-radius: 10px; text-align: center; }
.admin-summary-item span,
.admin-summary-item strong,
.admin-summary-item small { display: block; overflow-wrap: anywhere; }
.admin-summary-item span { color: var(--muted); font-size: 11px; font-weight: 850; }
.admin-summary-item strong { margin-top: 2px; color: var(--ink); font-size: 23px; line-height: 1.15; }
.admin-summary-item small { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.admin-daily-sync { min-width: 0; padding: 11px 12px; background: white; border: 1px solid var(--line); border-radius: 12px; }
.admin-daily-sync-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.admin-daily-sync-head h3,
.admin-daily-sync-head p { margin: 0; }
.admin-daily-sync-head h3 { font-size: 13px; }
.admin-daily-sync-head p { margin-top: 2px; color: var(--muted); font-size: 10px; }
.admin-daily-sync-head > strong { flex: 0 0 auto; color: var(--green); font-size: 15px; font-variant-numeric: tabular-nums; }
.admin-daily-sync-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 6px; min-width: 0; }
.admin-daily-sync-item { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 7px; min-width: 0; padding: 7px 9px; background: #f6f8f7; border-radius: 9px; }
.admin-daily-sync-dot { width: 8px; height: 8px; background: #9aa7a3; border-radius: 50%; }
.admin-daily-sync-item.is-synced .admin-daily-sync-dot { background: #00875a; box-shadow: 0 0 0 3px rgba(0, 135, 90, .12); }
.admin-daily-sync-item strong { min-width: 0; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.admin-daily-sync-item small { color: var(--muted); font-size: 9px; font-weight: 800; white-space: nowrap; }
.admin-daily-sync-item.is-synced small { color: #00764f; }
.admin-daily-sync-empty { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 11px; }
.admin-overview-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.admin-overview-panel { min-width: 0; }
.admin-overview-panel + .admin-overview-panel { padding-left: 18px; border-left: 1px solid var(--line); }
.admin-overview-panel-head { margin-bottom: 7px; }
.admin-overview-panel-head h3 { margin: 0; font-size: 14px; }
.admin-control-list { display: grid; min-width: 0; }
.admin-control-item { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-width: 0; padding: 9px 0; border-top: 1px solid var(--line); }
.admin-control-dot { width: 9px; height: 9px; border-radius: 50%; background: #879792; }
.admin-control-dot.is-success { background: #00875a; }
.admin-control-dot.is-warning { background: #d99016; }
.admin-control-dot.is-danger { background: #d92d20; }
.admin-control-dot.is-info { background: var(--green); }
.admin-control-copy { min-width: 0; }
.admin-control-copy strong,
.admin-control-copy span { display: block; overflow-wrap: anywhere; }
.admin-control-copy strong { font-size: 12px; }
.admin-control-copy span { margin-top: 1px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.admin-state-badge { max-width: 116px; padding: 4px 8px; overflow: hidden; color: var(--muted); background: #edf2f0; border-radius: 8px; font-size: 10px; font-weight: 900; line-height: 1.25; white-space: nowrap; text-align: center; text-overflow: ellipsis; }
.admin-state-badge.is-success { color: #006341; background: #dff6ed; }
.admin-state-badge.is-warning { color: #7b570b; background: #fff0cb; }
.admin-state-badge.is-danger { color: #a52218; background: #ffe5e1; }
.admin-state-badge.is-info { color: var(--green-deep); background: var(--green-soft); }
.admin-user-card.is-inactive { border-color: #d99016; }
.admin-user-card-head { display: flex; justify-content: space-between; gap: 12px; min-width: 0; }
.admin-user-identity { min-width: 0; }
.admin-user-identity strong,
.admin-user-identity span,
.admin-user-identity small { display: block; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.admin-user-identity small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.admin-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.admin-badge { display: inline-flex; align-items: center; min-height: 24px; max-width: 100%; padding: 0 8px; overflow: hidden; color: var(--muted); background: #edf2f0; border-radius: 999px; font-size: 10px; font-weight: 900; white-space: nowrap; text-overflow: ellipsis; }
.admin-badge.is-admin { color: white; background: var(--green); }
.admin-badge.is-active,
.admin-badge.is-success { color: #006341; background: #dff6ed; }
.admin-badge.is-warning { color: #7b570b; background: #fff0cb; }
.admin-badge.is-off,
.admin-badge.is-danger { color: #a52218; background: #ffe5e1; }
.admin-user-status-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; min-width: 0; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.admin-user-status-panel { min-width: 0; }
.admin-user-status-panel + .admin-user-status-panel { padding-left: 18px; border-left: 1px solid var(--line); }
.admin-user-status-head { margin-bottom: 6px; }
.admin-user-status-head h4,
.admin-user-status-head span,
.admin-user-edit-head h4 { margin: 0; overflow-wrap: anywhere; }
.admin-user-status-head h4,
.admin-user-edit-head h4 { font-size: 13px; }
.admin-user-status-head span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.admin-user-edit-head { padding-top: 2px; }
.library-panel { padding: 18px; color: #77423b; background: #fff2ef; border: 1px solid #f2d6d1; border-radius: 13px; }
.library-panel strong { display: block; margin-bottom: 6px; font-size: 13px; }
.library-panel p { margin: 0; color: #775c57; font-size: 12px; line-height: 1.55; }
.mfa-icon { width: 52px; height: 52px; display: grid; place-items: center; margin: 0 auto 14px; color: white; background: var(--green); border-radius: 15px; font-size: 12px; font-weight: 850; }
#mfaForm { text-align: center; }
#mfaForm h3 { margin-bottom: 7px; }
#mfaForm p { color: var(--muted); font-size: 13px; line-height: 1.5; }
#mfaForm label { text-align: left; }
#mfaInput { text-align: center; font-size: 21px; letter-spacing: .2em; }
.form-status { margin: 17px 0 0; padding: 11px 13px; color: #6d4d20; background: #fff5df; border-radius: 10px; font-size: 12px; line-height: 1.45; }
.form-status.error { color: #8b3c33; background: #fff0ed; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 200; max-width: 380px; padding: 13px 16px; color: white; background: #173d38; border-radius: 11px; box-shadow: 0 14px 35px rgba(15, 39, 34, .24); font-size: 13px; }
.best-self-thanks { position: fixed; inset: 0; z-index: 210; display: grid; place-items: center; padding: 24px; pointer-events: none; }
.best-self-thanks > div { display: grid; justify-items: center; gap: 7px; min-width: min(86vw, 300px); padding: 24px 26px; color: var(--ink); background: rgba(255, 255, 255, .96); border: 1px solid rgba(219, 229, 225, .95); border-radius: 24px; box-shadow: 0 28px 80px rgba(13, 39, 34, .28); animation: thanks-pop 2.1s ease both; }
.thanks-dino { display: block; font-size: 54px; line-height: 1; transform-origin: 50% 85%; animation: dino-thanks 1.05s ease-in-out 2; }
.best-self-thanks strong { color: var(--green); font-size: 22px; }
.best-self-thanks small { color: var(--muted); text-align: center; font-size: 12px; font-weight: 750; }
.account-delete-animation { position: fixed; inset: 0; z-index: 230; display: grid; place-items: center; padding: 24px; background: rgba(15, 35, 31, .48); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.account-delete-animation > div { display: grid; justify-items: center; gap: 8px; min-width: min(88vw, 330px); padding: 25px 27px; color: var(--ink); background: rgba(255, 255, 255, .97); border: 1px solid rgba(242, 206, 198, .95); border-radius: 24px; box-shadow: 0 28px 80px rgba(13, 39, 34, .32); animation: delete-pop 1.8s ease-in-out infinite; }
.crying-dino { position: relative; display: block; font-size: 58px; line-height: 1; transform-origin: 50% 90%; animation: dino-cry 1.05s ease-in-out infinite; }
.crying-dino::after { content: "💧"; position: absolute; right: -10px; top: 16px; font-size: 20px; animation: dino-tear .75s ease-in infinite; }
.account-delete-animation strong { color: var(--coral); font-size: 21px; }
.account-delete-animation small { max-width: 260px; color: var(--muted); text-align: center; font-size: 12px; font-weight: 750; line-height: 1.45; }
@keyframes dino-thanks {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
  25% { transform: translateY(-8px) rotate(-7deg) scale(1.08); }
  50% { transform: translateY(0) rotate(0deg) scale(1); }
  70% { transform: translateY(3px) rotate(8deg) scale(.96); }
}
@keyframes dino-cry {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  35% { transform: translateY(2px) rotate(-5deg); }
  70% { transform: translateY(0) rotate(5deg); }
}
@keyframes dino-tear {
  0% { opacity: 0; transform: translateY(-3px) scale(.82); }
  22% { opacity: 1; }
  100% { opacity: 0; transform: translateY(18px) scale(1.05); }
}
@keyframes thanks-pop {
  0% { opacity: 0; transform: translateY(18px) scale(.9); }
  12% { opacity: 1; transform: translateY(0) scale(1); }
  82% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-14px) scale(.96); }
}
@keyframes delete-pop {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(3px) scale(.985); }
}

body[data-theme="dark"] {
  color-scheme: dark;
  color-scheme: dark;
  --ink: #e8f4f1;
  --muted: #9caeaa;
  --line: #253f39;
  --canvas: #071210;
  --card: #0d1d1a;
  --green: #6bded1;
  --green-deep: #47bfb2;
  --green-soft: rgba(107, 222, 209, .15);
  --coral: #ff9a88;
  --shadow: 0 18px 44px rgba(0, 0, 0, .34);
}

body[data-theme="dark"] .topbar { background: rgba(8, 19, 17, .9); border-bottom-color: #1d3631; }
body[data-theme="dark"] .app-auth-screen { background: radial-gradient(circle at 20% 15%, rgba(107, 222, 209, .14), transparent 28%), linear-gradient(145deg, #071210 0%, #0e211d 100%); }
body[data-theme="dark"] .app-auth-card { background: rgba(13, 29, 26, .95); border-color: rgba(48, 76, 70, .9); box-shadow: 0 24px 70px rgba(0, 0, 0, .36); }
body[data-theme="dark"] .totp-setup,
body[data-theme="dark"] .captcha-box { background: #10221e; border-color: #29443e; }
body[data-theme="dark"] .totp-setup img,
body[data-theme="dark"] .totp-qr { background: #f8fbfa; border-color: #dfe8e5; }
body[data-theme="dark"] .totp-setup code { color: #d9fff8; background: rgba(107, 222, 209, .11); }
body[data-theme="dark"] .totp-setup hr { border-top-color: #29443e; }
body[data-theme="dark"] .version-badge { color: #a8d9d1; background: rgba(107, 222, 209, .1); border-color: rgba(107, 222, 209, .24); }
body[data-theme="dark"] .header-powered-text { color: #9caeaa; }
body[data-theme="dark"] .powered-badge { color: #b8cac5; background: rgba(255, 255, 255, .06); border-color: rgba(107, 222, 209, .18); box-shadow: none; }
body[data-theme="dark"] .footer-powered { color: #c7d8d3; }
body[data-theme="dark"] .powered-label { color: #8fa19d; }
body[data-theme="dark"] .shutdown-screen > div,
body[data-theme="dark"] .metric-card,
body[data-theme="dark"] .card,
body[data-theme="dark"] .modal { background: var(--card); border-color: rgba(48, 76, 70, .9); }
body[data-theme="dark"] .wiki-item { background: #10221e; border-color: #29443e; }
body[data-theme="dark"] .wiki-item[open] { border-color: rgba(107,222,209,.42); }
body[data-theme="dark"] .wiki-item summary { background: rgba(107,222,209,.11); }
body[data-theme="dark"] .wiki-search input,
body[data-theme="dark"] .wiki-search-results { color: #e3f0ec; background: #10221e; border-color: #365e56; }
body[data-theme="dark"] .wiki-search-option { color: #d7e8e4; }
body[data-theme="dark"] .wiki-search-option:hover,
body[data-theme="dark"] .wiki-search-option.is-active { color: #d9fff8; background: rgba(107,222,209,.14); }
body[data-theme="dark"] .wiki-search-clear:hover { color: #d9fff8; background: rgba(107,222,209,.14); }
body[data-theme="dark"] .wiki-alphabet { background: var(--card); border-color: #29443e; }
body[data-theme="dark"] .wiki-alphabet-letter { color: #9cafaa; background: #142a25; }
body[data-theme="dark"] .wiki-alphabet-letter.is-active { color: #08211d; background: #6bded1; border-color: #6bded1; }
body[data-theme="dark"] .wiki-letter-heading h2 { color: #08211d; background: #6bded1; }
body[data-theme="dark"] .wiki-formula { color: #eaf4f1; background: #142a25; border-color: #29443e; }
body[data-theme="dark"] .wiki-item-content .wiki-related { color: #9cafaa; border-top-color: #29443e; }
body[data-theme="dark"] .wiki-related a { color: #bff7ef; background: rgba(107,222,209,.11); border-color: rgba(107,222,209,.28); }
body[data-theme="dark"] .wiki-related a:hover { color: #08211d; background: #6bded1; }
body[data-theme="dark"] .wiki-item-content p,
body[data-theme="dark"] .wiki-calculation { color: #b8cac5; }
body[data-theme="dark"] .wiki-note { color: #ccece6; background: rgba(107,222,209,.1); }
body[data-theme="dark"] .wiki-warning { color: #ffd0c8; background: rgba(255,154,136,.1); }
body[data-theme="dark"] .blood-count-table thead th { color: #aec0bb; background: #132c27; }
body[data-theme="dark"] .blood-count-table th, body[data-theme="dark"] .blood-count-table td { border-bottom-color: #29443e; }
body[data-theme="dark"] .blood-count-table tbody th strong { color: #e3f0ec; }
body[data-theme="dark"] .blood-count-table tbody th small { color: #9cadab; }
body[data-theme="dark"] .blood-count-table tbody td { color: #bff7ef; }
body[data-theme="dark"] .blood-count-table input { color: #e3f0ec; background: #11231f; border-color: #365e56; }
body[data-theme="dark"] .blood-count-reference strong { color: #e3f0ec; }
body[data-theme="dark"] .blood-count-note { color: #ccece6; background: rgba(107,222,209,.1); border-color: rgba(107,222,209,.28); border-left-color: #6bded1; }
body[data-theme="dark"] .blood-count-view-tabs { background: var(--card); border-color: #29443e; }
body[data-theme="dark"] .blood-count-view-tab.active { color: #08211d; background: #6bded1; }
body[data-theme="dark"] .blood-count-reference-editor-table th, body[data-theme="dark"] .blood-count-reference-editor-table td { border-bottom-color: #29443e; }
body[data-theme="dark"] .blood-count-reference-editor-table thead th { color: #aec0bb; background: #132c27; }
body[data-theme="dark"] .blood-count-reference-editor-table tbody th strong { color: #e3f0ec; }
body[data-theme="dark"] .blood-count-reference-editor-table tbody td { color: #bff7ef; }
body[data-theme="dark"] .blood-count-reference-section { color: #bff7ef; background: rgba(107,222,209,.11); }
body[data-theme="dark"] .blood-count-reference-inputs input { color: #e3f0ec; background: #11231f; border-color: #365e56; }
body[data-theme="dark"] .blood-count-reference-priority-note { color: #bff7ef; background: rgba(107,222,209,.08); border-color: #365e56; }
body[data-theme="dark"] .blood-count-history-empty { background: #11231f; border-color: #365e56; }
body[data-theme="dark"] .blood-count-history-empty strong { color: #e3f0ec; }
body[data-theme="dark"] .blood-count-history-table th, body[data-theme="dark"] .blood-count-history-table td { border-bottom-color: #29443e; }
body[data-theme="dark"] .blood-count-history-table thead th { color: #aec0bb; background: #132c27; }
body[data-theme="dark"] .blood-count-history-sticky { background: #10221e; box-shadow: 1px 0 0 #29443e; }
body[data-theme="dark"] .blood-count-history-table thead .blood-count-history-sticky { background: #132c27; }
body[data-theme="dark"] .blood-count-history-section { color: #bff7ef; background: rgba(107,222,209,.11); }
body[data-theme="dark"] .blood-count-history-metric strong { color: #e3f0ec; }
body[data-theme="dark"] .blood-count-history-value.is-normal { color: #aaf0cb !important; background: #173b2d; }
body[data-theme="dark"] .blood-count-history-value.is-low { color: #b8dcf5 !important; background: #18344a; }
body[data-theme="dark"] .blood-count-history-value.is-high { color: #ffc0ba !important; background: #4a2523; }
body[data-theme="dark"] .blood-count-history-value.is-unrated { color: #eadca8 !important; background: #3c3520; }
body[data-theme="dark"] .blood-count-history-value.is-empty { color: #91a39e !important; background: transparent; }
body[data-theme="dark"] .sync-pill { color: #b8cac5; background: #122520; }
body[data-theme="dark"] .app-session-button { color: #c9d9d5; background: #122520; border-color: #29433d; }
body[data-theme="dark"] .app-session-button:hover { color: var(--green); border-color: #49766f; }
body[data-theme="dark"] .app-session-button small { color: #8fa19d; }
body[data-theme="dark"] .admin-session-button { color: #08211d; background: var(--green); border-color: var(--green); }
body[data-theme="dark"] .admin-session-button small { color: rgba(8, 33, 29, .72); }
body[data-theme="dark"] .admin-session-button:hover { color: #061815; background: #d6fff8; border-color: #d6fff8; }
body[data-theme="dark"] .status-dot { background: #6f8580; }
body[data-theme="dark"] .icon-button,
body[data-theme="dark"] .button-secondary { color: #c9d9d5; background: #122520; border-color: #29433d; }
body[data-theme="dark"] .icon-button:hover,
body[data-theme="dark"] .button-secondary:hover { border-color: #49766f; }
body[data-theme="dark"] .theme-toggle.active { color: #f5d37a; border-color: rgba(245, 211, 122, .42); background: rgba(245, 211, 122, .1); }
body[data-theme="dark"] .topbar-auth-button { color: var(--green); background: rgba(107, 222, 209, .12); border-color: rgba(107, 222, 209, .28); }
body[data-theme="dark"] .topbar-auth-button:hover { border-color: rgba(107, 222, 209, .52); background: rgba(107, 222, 209, .18); }
body[data-theme="dark"] .sync-header-button { color: var(--green); background: rgba(107, 222, 209, .12); border-color: rgba(107, 222, 209, .28); }
body[data-theme="dark"] .sync-header-button:hover { border-color: rgba(107, 222, 209, .52); background: rgba(107, 222, 209, .18); }
body[data-theme="dark"] .app-refresh-button { color: #08211d; background: #d6fff8; border-color: #d6fff8; box-shadow: none; }
body[data-theme="dark"] .app-refresh-button:hover { color: #061815; background: var(--green); border-color: var(--green); }
body[data-theme="dark"] .header-logout-button { color: #ffafa2; background: rgba(227, 116, 92, .12); border-color: rgba(227, 116, 92, .34); }
body[data-theme="dark"] .header-logout-button:hover { color: #10201d; background: #ffafa2; border-color: #ffafa2; }
body[data-theme="dark"] .topbar-auth-button.connected { color: #ffafa2; background: rgba(227, 116, 92, .12); border-color: rgba(227, 116, 92, .34); }
body[data-theme="dark"] .topbar-auth-button.connected:hover { border-color: rgba(255, 154, 136, .52); background: rgba(227, 116, 92, .18); }
body[data-theme="dark"] .shutdown-topbar-button { color: #ffafa2; }
body[data-theme="dark"] .shutdown-topbar-button:hover { color: #ffd0c9; border-color: rgba(255, 154, 136, .46); }
body[data-theme="dark"] .button-dark { color: #08211d; background: #d6fff8; }
body[data-theme="dark"] .button-danger { color: #ffc4ba; background: rgba(227, 116, 92, .12); border-color: rgba(227, 116, 92, .35); }
body[data-theme="dark"] .ranking-share-button { color: #08211d; background: #d6fff8; }
body[data-theme="dark"] .ranking-share-button:hover:not(:disabled) { background: var(--green); }
body[data-theme="dark"] .ranking-share-button.share-error { color: #10201d; background: #ffafa2; }
body[data-theme="dark"] .notice { color: #ddfff8; background: #0e2b26; border-color: #245149; }
body[data-theme="dark"] .notice p { color: #a8c6bf; }
body[data-theme="dark"] .notice-icon { background: rgba(255, 255, 255, .08); }
body[data-theme="dark"] .notice.error,
body[data-theme="dark"] .history-notice.error,
body[data-theme="dark"] .library-panel,
body[data-theme="dark"] .form-status.error { color: #ffc6bd; background: rgba(227, 116, 92, .12); border-color: rgba(227, 116, 92, .32); }
body[data-theme="dark"] .notice.error .notice-icon { color: #ff9a88; }
body[data-theme="dark"] .history-notice { background: #0f2925; }
body[data-theme="dark"] .history-notice.paused,
body[data-theme="dark"] .form-status { color: #f1d59c; background: rgba(226, 163, 62, .12); border-color: rgba(226, 163, 62, .28); }
body[data-theme="dark"] .history-notice.paused .notice-icon { color: #f1c06a; }
body[data-theme="dark"] .metric-card-primary { background: linear-gradient(138deg, #0b7068 0%, #043833 100%); }
body[data-theme="dark"] .readiness-card { background: linear-gradient(138deg, #214b45 0%, #07564f 100%); }
body[data-theme="dark"] .metric-card-primary .metric-heading { color: #d3f2ed; }
body[data-theme="dark"] .metric-card-primary > p { color: #bce2db; }
body[data-theme="dark"] .range-control { background: #122520; }
body[data-theme="dark"] .range-control button { color: #9db0ab; }
body[data-theme="dark"] .range-control button.active { color: var(--green); background: #1a332e; box-shadow: 0 2px 10px rgba(0, 0, 0, .22); }
body[data-theme="dark"] .year-filter span,
body[data-theme="dark"] .chart-selection-summary,
body[data-theme="dark"] .chart-legend,
body[data-theme="dark"] .weekday-legend,
body[data-theme="dark"] .period-legend,
body[data-theme="dark"] .period-chart-meta span,
body[data-theme="dark"] .footer { color: #8fa19d; }
body[data-theme="dark"] .year-filter select,
body[data-theme="dark"] input,
body[data-theme="dark"] select { color: var(--ink); background: #11231f; border-color: #29443e; }
body[data-theme="dark"] .comparison-metric,
body[data-theme="dark"] .comparison-duration,
body[data-theme="dark"] .comparison-offset,
body[data-theme="dark"] .comparison-period { background: linear-gradient(135deg, rgba(16, 42, 36, .96), rgba(13, 31, 27, .96)); border-color: #29443e; }
body[data-theme="dark"] .comparison-metric,
body[data-theme="dark"] .comparison-duration,
body[data-theme="dark"] .comparison-offset,
body[data-theme="dark"] .comparison-period label { color: #9eb0ac; }
body[data-theme="dark"] .comparison-point { fill: var(--card); }
body[data-theme="dark"] .password-field { background: #11231f; border-color: #29443e; }
body[data-theme="dark"] .password-field:focus-within { background: #142a25; border-color: #5aa79d; box-shadow: 0 0 0 4px rgba(107, 222, 209, .1); }
body[data-theme="dark"] .password-toggle-button { color: var(--green); border-left-color: #29443e; }
body[data-theme="dark"] .password-toggle-button:hover { background: rgba(107, 222, 209, .12); }
body[data-theme="dark"] .captcha-row strong { color: #d9fff8; }
body[data-theme="dark"] .captcha-refresh { color: var(--green); background: #11231f; border-color: #29443e; }
body[data-theme="dark"] .captcha-refresh:hover { border-color: #5aa79d; background: #142a25; }
body[data-theme="dark"] .captcha-hint { color: #9ebbb5; }
body[data-theme="dark"] .captcha-hint.error { color: #ffb3a8; }
body[data-theme="dark"] .auth-switch { color: #9caeaa; }
body[data-theme="dark"] .auth-switch button { color: var(--green); }
body[data-theme="dark"] .year-filter select:focus,
body[data-theme="dark"] input:focus,
body[data-theme="dark"] select:focus { background: #142a25; border-color: #5aa79d; box-shadow: 0 0 0 4px rgba(107, 222, 209, .1); }
body[data-theme="dark"] .password-field input:focus { background: transparent; border: 0; box-shadow: none; }
body[data-theme="dark"] .chart-grid { stroke: #203a35; }
body[data-theme="dark"] .normal-distribution-tick { stroke: #35514b; }
body[data-theme="dark"] .chart-axis-label,
body[data-theme="dark"] .chart-y-title,
body[data-theme="dark"] .weekday-count-label,
body[data-theme="dark"] .period-axis-label { fill: #8fa19d; }
body[data-theme="dark"] .chart-point { fill: var(--card); stroke: var(--green); }
body[data-theme="dark"] .chart-point-latest { fill: var(--green); stroke: #071210; }
body[data-theme="dark"] .weekday-value-label,
body[data-theme="dark"] .period-value-label { fill: var(--ink); }
body[data-theme="dark"] .weekday-axis-label { fill: #b2c2be; }
body[data-theme="dark"] .period-stat,
body[data-theme="dark"] .best-self-chart-panel,
body[data-theme="dark"] .best-self-import,
body[data-theme="dark"] .blood-pressure-form,
body[data-theme="dark"] .import-export-page-section,
body[data-theme="dark"] .import-export-task,
body[data-theme="dark"] .import-export-card,
body[data-theme="dark"] .import-export-form,
body[data-theme="dark"] .best-self-calendar,
body[data-theme="dark"] .best-self-question-row,
body[data-theme="dark"] .source-setting,
body[data-theme="dark"] .account-setting,
body[data-theme="dark"] .recovery-codes,
body[data-theme="dark"] .connected-state,
body[data-theme="dark"] .history-setting { background: #10221e; border-color: #29443e; }
body[data-theme="dark"] .recovery-codes pre { color: #d9fff8; background: #11231f; border-color: #29443e; }
body[data-theme="dark"] .account-password-form { background: #10221e; border-color: #365e56; }
body[data-theme="dark"] .best-self-subline,
body[data-theme="dark"] .best-self-panel-header p,
body[data-theme="dark"] .best-self-import p,
body[data-theme="dark"] .import-export-section-heading > p,
body[data-theme="dark"] .import-export-task p,
body[data-theme="dark"] .import-export-card p,
body[data-theme="dark"] .best-self-submit-row span { color: #8fa19d; }
body[data-theme="dark"] .best-self-question-row p,
body[data-theme="dark"] .best-self-subline strong { color: #c7d8d3; }
body[data-theme="dark"] .best-self-import input,
body[data-theme="dark"] .blood-pressure-form input { background: #11231f; border-color: #29443e; box-shadow: none; }
body[data-theme="dark"] .import-export-form input { background: #11231f; border-color: #29443e; }
body[data-theme="dark"] .best-self-import code,
body[data-theme="dark"] .import-export-form code { color: #d9fff8; }
body[data-theme="dark"] .apple-health-local-note { color: #a9c7bf !important; }
body[data-theme="dark"] .apple-health-converter-progress progress,
body[data-theme="dark"] .apple-health-converter-progress progress::-webkit-progress-bar { background: #29443e; }
body[data-theme="dark"] .apple-health-converter-result { color: #d9fff8; background: #123129; border-color: #365e56; }
body[data-theme="dark"] .apple-health-converter-result-heading small,
body[data-theme="dark"] .apple-health-converter-breakdown { color: #a9c7bf !important; }
body[data-theme="dark"] .apple-health-converter-ratio,
body[data-theme="dark"] .apple-health-converter-stats > div { color: #d9fff8; background: #10221e; border-color: #365e56; }
body[data-theme="dark"] .apple-health-converter-stats dt { color: #9db7b0; }
body[data-theme="dark"] .apple-health-converter-stats dd { color: #e7fff8; }
body[data-theme="dark"] .best-self-calendar-header strong { color: #e3f0ec; }
body[data-theme="dark"] .best-self-calendar-header .icon-button { color: #d9fff8; background: #132c27; border-color: #365e56; }
body[data-theme="dark"] .best-self-calendar-selected { background: #132c27; border-color: #365e56; }
body[data-theme="dark"] .best-self-calendar-selected span { color: #9cadab; }
body[data-theme="dark"] .best-self-calendar-selected strong { color: #e3f0ec; }
body[data-theme="dark"] .best-self-calendar-selected em { color: #9af2d6; }
body[data-theme="dark"] .best-self-calendar-weekdays span,
body[data-theme="dark"] .best-self-calendar-legend { color: #9cadab; }
body[data-theme="dark"] .best-self-calendar-day { color: #d5e6e2; background: #11231f; border-color: #29443e; }
body[data-theme="dark"] .best-self-calendar-day.is-done { color: white; background: linear-gradient(135deg, #007a55, #0b7068); border-color: #14a37b; box-shadow: 0 8px 18px rgba(0, 135, 90, .22); }
body[data-theme="dark"] .best-self-calendar-day.is-today { border-color: #fbbf24; box-shadow: inset 0 0 0 2px rgba(251, 191, 36, .48); }
body[data-theme="dark"] .best-self-calendar-day.is-selected { border-color: #e4fff9; box-shadow: 0 0 0 3px rgba(107, 222, 209, .2), 0 9px 20px rgba(0, 0, 0, .2); }
body[data-theme="dark"] .ranking-calendar .best-self-calendar-day.is-selected,
body[data-theme="dark"] .blood-count-calendar-panel .best-self-calendar-day.is-selected {
  border-color: #f4fffc;
  outline-color: #ff8063;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .46), inset 0 0 0 2px rgba(10, 30, 26, .72);
}
body[data-theme="dark"] .ranking-calendar .best-self-calendar-day.is-selected::after,
body[data-theme="dark"] .blood-count-calendar-panel .best-self-calendar-day.is-selected::after {
  background: #ff8063;
  border-color: #10231f;
}
body[data-theme="dark"] .best-self-calendar-day.is-future,
body[data-theme="dark"] .best-self-calendar-day:disabled { color: #66736f; background: #0d1a17; border-color: #1e302c; box-shadow: none; opacity: .62; }
body[data-theme="dark"] .legend-today { background: #11231f; border-color: #fbbf24; }
body[data-theme="dark"] .legend-selected { background: #11231f; border-color: #e4fff9; }
body[data-theme="dark"] .best-self-zero { color: #ffd5ce; background: rgba(217, 45, 32, .22); border-color: #f97066; }
body[data-theme="dark"] .best-self-one { color: #d9fff8; background: rgba(0, 135, 90, .24); border-color: #31c48d; }
body[data-theme="dark"] .best-self-zero.selected { color: white; background: #d92d20; border-color: #ffb4aa; box-shadow: 0 10px 24px rgba(217, 45, 32, .42); }
body[data-theme="dark"] .best-self-one.selected { color: white; background: #00875a; border-color: #9af2d6; box-shadow: 0 10px 24px rgba(0, 135, 90, .42); }
body[data-theme="dark"] .admin-users-section,
body[data-theme="dark"] .admin-create-panel,
body[data-theme="dark"] .admin-security-section,
body[data-theme="dark"] .admin-security-card,
body[data-theme="dark"] .audit-event,
body[data-theme="dark"] .admin-user-card,
body[data-theme="dark"] .admin-empty,
body[data-theme="dark"] .admin-feature-controls { background: #10221e; border-color: #29443e; }
body[data-theme="dark"] .admin-overview { background: #10221e; border-color: #29443e; }
body[data-theme="dark"] .admin-version,
body[data-theme="dark"] .admin-summary-item,
body[data-theme="dark"] .admin-daily-sync { background: #11231f; border-color: #29443e; }
body[data-theme="dark"] .admin-daily-sync-item { background: #10221e; }
body[data-theme="dark"] .admin-daily-sync-item.is-synced small { color: #9af2d6; }
body[data-theme="dark"] .admin-state-badge,
body[data-theme="dark"] .admin-badge { background: #1a302b; }
body[data-theme="dark"] .admin-state-badge.is-success,
body[data-theme="dark"] .admin-badge.is-active,
body[data-theme="dark"] .admin-badge.is-success { color: #9af2d6; background: rgba(0, 135, 90, .24); }
body[data-theme="dark"] .admin-state-badge.is-warning,
body[data-theme="dark"] .admin-badge.is-warning { color: #f5d37a; background: rgba(217, 144, 22, .2); }
body[data-theme="dark"] .admin-state-badge.is-danger,
body[data-theme="dark"] .admin-badge.is-off,
body[data-theme="dark"] .admin-badge.is-danger { color: #ffb3a8; background: rgba(217, 45, 32, .2); }
body[data-theme="dark"] .admin-state-badge.is-info { color: #d9fff8; background: rgba(107, 222, 209, .14); }
body[data-theme="dark"] .admin-badge.is-admin { color: #08211d; background: var(--green); }
body[data-theme="dark"] .admin-user-card { box-shadow: none; }
body[data-theme="dark"] .admin-user-dataset-summary { background: #142b26; border-color: #294b43; }
body[data-theme="dark"] .admin-user-dataset-breakdown > span { background: #10211d; border-color: #29443e; }
body[data-theme="dark"] .admin-user-dataset-summary.is-unavailable { background: #321f1b; border-color: #774136; }
body[data-theme="dark"] .admin-active-toggle { color: #c7d8d3; }
body[data-theme="dark"] .admin-feature-controls label { color: #d7e8e4; background: #11231f; border-color: #29443e; }
body[data-theme="dark"] .admin-test-email-form input { color: #e3f0ec; background: #11231f; border-color: #365e56; }
body[data-theme="dark"] .protection-card.active { background: rgba(227, 116, 92, .12); border-color: rgba(227, 116, 92, .42); box-shadow: none; }
body[data-theme="dark"] .protection-card input { background: #11231f; border-color: #29443e; }
body[data-theme="dark"] .period-chart-meta strong,
body[data-theme="dark"] label { color: #c7d8d3; }
body[data-theme="dark"] .table-scroll { border-top-color: var(--line); }
body[data-theme="dark"] th { color: #99aaa6; background: #0d1d1a; }
body[data-theme="dark"] td { color: #b8c8c4; border-top-color: #1f3833; }
body[data-theme="dark"] tbody tr:hover { background: #10241f; }
body[data-theme="dark"] .muted-cell { color: #8fa19d; }
body[data-theme="dark"] .status-badge { color: #bce2db; background: rgba(107, 222, 209, .12); }
body[data-theme="dark"] .status-badge.preview { color: #e8d1a1; background: rgba(245, 211, 122, .12); }
body[data-theme="dark"] .modal-backdrop { background: rgba(2, 8, 7, .72); }
body[data-theme="dark"] .modal { box-shadow: 0 28px 80px rgba(0, 0, 0, .55); }
body[data-theme="dark"] .modal-close { color: #c8d7d3; }
body[data-theme="dark"] .library-panel p { color: #e4b9b1; }
body[data-theme="dark"] .toast { color: #08211d; background: #d6fff8; }
body[data-theme="dark"] .best-self-thanks > div { color: var(--ink); background: rgba(14, 31, 28, .97); border-color: rgba(48, 76, 70, .9); box-shadow: 0 28px 80px rgba(0, 0, 0, .58); }
body[data-theme="dark"] .best-self-thanks small { color: #9caeaa; }
body[data-theme="dark"] .account-delete-animation { background: rgba(2, 8, 7, .74); }
body[data-theme="dark"] .account-delete-animation > div { color: var(--ink); background: rgba(14, 31, 28, .98); border-color: rgba(227, 116, 92, .42); box-shadow: 0 28px 80px rgba(0, 0, 0, .58); }
body[data-theme="dark"] .account-delete-animation small { color: #9caeaa; }

@media (max-width: 1120px) {
  .topbar {
    min-height: 96px;
    height: auto;
    flex-wrap: wrap;
    align-content: center;
    gap: 12px;
    padding-top: max(12px, env(safe-area-inset-top));
    padding-right: max(22px, env(safe-area-inset-right));
    padding-bottom: 12px;
    padding-left: max(22px, env(safe-area-inset-left));
  }
  .topbar-actions { gap: 9px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-overlay-layout { grid-template-columns: 1fr; }
  .admin-create-panel { order: -1; }
}

@media (max-width: 980px) {
  .topbar { position: sticky; }
  .header-powered-text { display: none; }
  .hero-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .hero-actions { width: 100%; }
  .hero-actions .button { flex: 1 1 190px; }
  .chart-card,
  .weekday-card,
  .period-card,
  .table-card,
  .blood-pressure-card { padding: 22px; }
  .card-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .chart-filters,
  .period-control { width: 100%; }
  .comparison-controls,
  .comparison-controls.comparison-controls-manual { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .year-filter { width: min(100%, 220px); }
  .best-self-chart-grid { grid-template-columns: 1fr; }
  .best-self-import { grid-template-columns: 1fr; }
  .blood-pressure-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .blood-pressure-note { grid-column: 1 / -1; }
  .blood-pressure-form-actions { grid-column: 1 / -1; justify-content: stretch; }
  .blood-pressure-form-actions .button { flex: 1; }
  .blood-pressure-overview { grid-template-columns: 1fr; }
  .import-export-task-grid { grid-template-columns: 1fr; }
  .import-export-grid { grid-template-columns: 1fr; }
  .import-export-section-heading { align-items: flex-start; flex-direction: column; }
  .import-export-section-heading > p { max-width: none; text-align: left; }
  .admin-security-grid { grid-template-columns: 1fr; }
  .admin-overview-columns { grid-template-columns: 1fr; }
  .admin-overview-panel + .admin-overview-panel { padding-top: 14px; padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
  .admin-user-controls { grid-template-columns: 1fr 180px 100px; }
  .admin-user-controls .button { grid-column: 1 / -1; }
  .admin-user-actions { grid-template-columns: 1fr 1fr; }
  .admin-user-actions label { grid-column: 1 / -1; }
}

@media (max-width: 840px) {
  .main-content { padding-top: 38px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .period-overview { grid-template-columns: 1fr; }
  .modal { width: min(100%, 680px); }
}

@media (max-width: 620px) {
  .topbar {
    min-height: 64px;
    height: auto;
    padding-top: max(9px, env(safe-area-inset-top));
    padding-right: max(12px, env(safe-area-inset-right));
    padding-bottom: 9px;
    padding-left: max(12px, env(safe-area-inset-left));
    gap: 8px;
  }
  .brand { font-size: 16px; }
  .brand-mark { width: 36px; height: 36px; border-radius: 11px; }
  .topbar-actions { gap: 7px; flex: 1 1 auto; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
  .icon-button { width: 44px; height: 44px; border-radius: 11px; }
  .app-refresh-button,
  .header-logout-button { min-width: 44px; min-height: 44px; padding: 0 10px; border-radius: 11px; }
  .header-logout-button span { display: none; }
  .app-refresh-button { width: 44px; padding: 0; }
  .topbar-auth-button { min-height: 44px; padding: 0 10px; border-radius: 11px; }
  .app-session-button { min-height: 44px; padding: 0 9px; }
  .app-session-button span { max-width: 82px; }
  .sync-pill { max-width: 42px; padding: 8px; overflow: hidden; white-space: nowrap; }
  .sync-pill #syncPillText { display: none; }
  .main-content { padding: 26px 14px 24px; }
  .main-content.blood-count-page { width: 100%; }
  .main-content.best-self-page { width: 100%; }
  .main-content.blood-pressure-page { width: 100%; }
  .main-content.tables-page { width: 100%; }
  .main-content.wiki-page { width: 100%; }
  .wiki-search { margin-bottom: 12px; }
  .wiki-search input { height: 48px; padding-right: 46px; padding-left: 44px; font-size: .95rem; }
  .wiki-search-control > svg { left: 14px; width: 19px; height: 19px; }
  .wiki-search-results { max-height: min(320px, 48vh); }
  .wiki-search-option { min-height: 46px; padding: 10px; }
  .wiki-alphabet { grid-template-columns: repeat(auto-fit, minmax(44px, 1fr)); gap: 6px; margin-bottom: 20px; padding: 10px; }
  .wiki-alphabet-letter { min-width: 44px; height: 44px; font-size: 12px; }
  .wiki-letter-section { margin-bottom: 22px; scroll-margin-top: 92px; }
  .wiki-letter-heading h2 { width: 34px; height: 34px; font-size: 16px; }
  .wiki-topic-card { min-height: 780px; padding: 18px 14px; }
  .wiki-topic-heading { grid-template-columns: 48px minmax(0, 1fr); gap: 12px; margin-bottom: 17px; }
  .wiki-topic-icon { width: 48px; height: 48px; border-radius: 14px; }
  .wiki-topic-icon svg { width: 26px; height: 26px; }
  .wiki-topic-heading h2 { scroll-margin-top: 92px; font-size: 26px; }
  .wiki-item summary { min-height: 52px; padding: 12px; font-size: 13px; }
  .wiki-item-content { padding: 15px 14px 17px; }
  .wiki-item-content p { font-size: 13px; }
  .blood-count-table-card { padding: 18px 14px; }
  .blood-count-view-tabs { width: 100%; }
  .blood-count-view-tab { min-width: 0; flex: 1; }
  .blood-count-history-card { padding: 18px 14px; }
  .blood-count-reference-editor { padding: 18px 14px; }
  .blood-count-reference-editor-table { min-width: 680px; }
  .blood-count-history-sticky { width: 210px; min-width: 210px; max-width: 210px; }
  .blood-count-history-date-heading, .blood-count-history-value { min-width: 144px; max-width: 144px; }
  .blood-count-history-metric strong { font-size: 10.5px; }
  .blood-count-table-heading { align-items: start; flex-direction: column; gap: 5px; }
  .blood-count-table th, .blood-count-table td { padding: 10px 7px; }
  .blood-count-table { min-width: 760px; }
  .blood-count-table thead th:first-child { width: 40%; }
  .blood-count-table thead th:nth-child(2) { width: 17%; }
  .blood-count-table thead th:nth-child(3) { width: 25%; }
  .blood-count-table thead th:last-child { width: 18%; }
  .blood-count-table tbody th small { font-size: 11px; }
  .blood-count-table input { padding-inline: 7px; }
  .blood-count-submit-row { align-items: stretch; flex-direction: column; }
  .blood-count-submit-row .button { width: 100%; }
  h1 { font-size: clamp(34px, 11vw, 44px); }
  .intro { font-size: 15px; }
  .hero-actions { width: 100%; }
  .hero-actions .button { flex: 1; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card-primary { grid-column: auto; }
  .metric-card { min-height: auto; padding: 20px; }
  .metric-value { font-size: 40px; }
  .change-point-header { align-items: stretch; flex-direction: column; }
  .change-point-controls { grid-template-columns: 1fr; width: 100%; }
  .change-point-select { width: 100%; min-width: 0; }
  .change-point-overview { grid-template-columns: 1fr; }
  .normal-distribution-header { align-items: stretch; flex-direction: column; }
  .normal-distribution-select { width: 100%; }
  .normal-distribution-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .notice { align-items: flex-start; flex-wrap: wrap; }
  .notice .button { width: 100%; margin-left: 0; }
  .history-notice-heading { align-items: flex-start; }
  .history-setting,
  .account-setting { align-items: flex-start; flex-direction: column; }
  .account-actions { width: 100%; flex-direction: column; }
  .account-password-fields { grid-template-columns: 1fr; }
  .account-password-actions { flex-direction: column-reverse; }
  .history-setting .button,
  .account-setting .button { width: 100%; }
  .chart-card, .weekday-card, .period-card, .table-card, .blood-pressure-card, .normal-distribution-card { padding: 18px 15px; }
  .comparison-controls,
  .comparison-controls.comparison-controls-manual { grid-template-columns: 1fr; }
  .comparison-period { grid-template-columns: 1fr; }
  .comparison-difference-header { align-items: flex-start; flex-direction: column; gap: 8px; }
  .comparison-difference-header > p { max-width: none; text-align: left; }
  .comparison-difference-legend { margin-left: 0; }
  .best-self-card { padding: 18px 15px; }
  .import-export-page-section { padding: 16px 14px; }
  .apple-health-converter-task .import-export-form { grid-template-columns: 1fr; }
  .apple-health-converter-task .import-export-form > label,
  .apple-health-local-note,
  .apple-health-converter-progress { grid-column: 1; }
  .apple-health-converter-task .import-export-form > .button { width: 100%; white-space: normal; }
  .apple-health-converter-result-heading { align-items: flex-start; flex-direction: column; }
  .apple-health-converter-stats { grid-template-columns: 1fr; }
  .apple-health-converter-stats > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .apple-health-converter-stats dd { margin: 0; }
  .import-export-actions { flex-direction: column; }
  .import-export-actions .button { width: 100%; flex: 1 1 auto; }
  .card-header { align-items: flex-start; flex-direction: column; }
  .chart-filters { width: 100%; align-items: stretch; flex-direction: column; }
  .year-filter select { width: 100%; }
  .range-control { align-self: stretch; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .range-control button { min-height: 44px; padding: 7px 8px; }
  .chart-wrap,
  .weekday-chart-wrap,
  .period-chart-wrap,
  .normal-distribution-chart-wrap {
    min-height: 280px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
  }
  #hrvChart,
  #rhrChart,
  #sleepChart,
  #comparisonChart,
  #comparisonDifferenceChart,
  #bloodPressureChart,
  #weekdayChart,
  #periodChart,
  #normalDistributionChart { width: 720px; min-height: 280px; }
  #comparisonChart { width: 100%; min-height: 280px; }
  #comparisonDifferenceChart { width: 100%; min-height: 280px; }
  #bestSelfQuestionChart,
  #bestSelfDistributionChart { width: 100%; min-width: 0; min-height: 250px; }
  .period-chart-meta { margin-left: 0; }
  .chart-legend { margin-left: 0; }
  .blood-pressure-legend { margin-left: 0; }
  .weekday-legend { margin-left: 0; }
  .period-legend { margin-left: 0; }
  .table-scroll { overflow-x: auto; }
  table { min-width: 980px; }
  .blood-count-table { min-width: 760px; }
  .blood-pressure-form { grid-template-columns: 1fr; }
  .blood-pressure-form-actions { flex-direction: column; }
  .footer { flex-direction: column; }
  .footer-powered { margin-left: 0; }
  .admin-overlay-layout { grid-template-columns: 1fr; }
  .best-self-question-row,
  .best-self-submit-row { grid-template-columns: 1fr; }
  .best-self-calendar { padding: 12px; }
  .best-self-calendar-selected { grid-template-columns: 1fr; align-items: start; }
  .best-self-calendar-selected em { text-align: left; }
  .best-self-calendar-weekdays,
  .best-self-calendar-grid { gap: 5px; }
  .best-self-calendar-day,
  .best-self-calendar-empty { min-height: 44px; }
  .best-self-question-row { align-items: stretch; }
  .best-self-answer-group { display: grid; grid-template-columns: 1fr 1fr; }
  .best-self-answer { width: 100%; }
  .best-self-submit-row { display: grid; }
  .best-self-submit-row .button { width: 100%; }
  .admin-section-header { flex-direction: column; }
  .admin-section-header .button { width: 100%; }
  .admin-overview-head { display: grid; }
  .admin-version { justify-self: start; }
  .admin-summary-grid { grid-template-columns: 1fr 1fr; }
  .admin-user-status-grid { grid-template-columns: 1fr; }
  .admin-user-status-panel + .admin-user-status-panel { padding-top: 14px; padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
  .admin-badges { justify-content: flex-start; }
  .admin-user-controls,
  .admin-user-actions { grid-template-columns: 1fr; }
  .admin-feature-controls { align-items: stretch; flex-direction: column; }
  .admin-feature-controls > span { margin-right: 0; }
  .admin-feature-controls label { width: 100%; justify-content: flex-start; }
  .admin-user-card-header { flex-direction: column; }
  .admin-user-dataset-summary { grid-template-columns: 1fr; gap: 8px; }
  .admin-user-dataset-breakdown { justify-content: flex-start; }
  .modal-backdrop {
    align-items: stretch;
    justify-items: stretch;
    padding-top: max(10px, env(safe-area-inset-top));
    padding-right: max(10px, env(safe-area-inset-right));
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    padding-left: max(10px, env(safe-area-inset-left));
  }
  .modal {
    width: 100%;
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    padding: 20px;
    border-radius: 18px;
  }
  .admin-users-section,
  .admin-create-panel { padding: 14px; }
  .toast {
    right: 12px;
    bottom: 12px;
    left: 12px;
    max-width: none;
  }
}

@media (max-width: 430px) {
  .wiki-topic-card { min-height: 840px; }
  .brand-title { display: none; }
  .version-badge { min-height: 20px; padding: 0 6px; font-size: 10px; }
  .brand { gap: 7px; }
  .brand-mark { width: 34px; height: 34px; }
  .topbar-auth-button { width: 38px; padding: 0; justify-content: center; }
  .topbar-auth-button span { display: none; }
  .app-session-button small { display: none; }
  .app-session-button span { max-width: 54px; }
  .admin-session-button span { max-width: 44px; }
  .sync-pill { display: none; }
  .hero-actions { flex-direction: column; }
  .hero-actions .button { width: 100%; flex: 1 1 auto; }
  .range-control { grid-template-columns: 1fr; }
  .period-stat { grid-template-columns: 1fr auto; }
  .admin-user-card { padding: 12px; }
  .admin-user-actions .button { width: 100%; }
  .admin-summary-grid { grid-template-columns: 1fr; }
  .admin-control-item { grid-template-columns: 10px minmax(0, 1fr); }
  .admin-state-badge { grid-column: 2; justify-self: start; max-width: 100%; }
}

@media (max-width: 360px) {
  .topbar { padding-left: max(9px, env(safe-area-inset-left)); padding-right: max(9px, env(safe-area-inset-right)); }
  .icon-button,
  .topbar-auth-button { width: 44px; height: 44px; min-height: 44px; }
  .app-session-button { min-height: 44px; padding: 0 7px; }
  .version-badge { display: none; }
  .main-content { padding-left: 10px; padding-right: 10px; }
}

@media (hover: none) {
  .ranking-row:hover,
  .ranking-share-button:hover:not(:disabled),
  .app-session-button:hover,
  .header-logout-button:hover,
  .app-refresh-button:hover,
  .button:hover { transform: none; }
}
