:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-muted: #f1f4f6;
  --surface-hover: #edf4f2;
  --text: #17212b;
  --text-muted: #68747e;
  --text-subtle: #8b969f;
  --border: #dfe5e8;
  --border-strong: #c8d1d6;
  --accent: #16705d;
  --accent-hover: #0d5c4c;
  --accent-soft: #e3f2ed;
  --danger: #b42318;
  --danger-soft: #fef0ee;
  --focus: #2563eb;
  --shadow-sm: 0 1px 2px rgb(16 24 40 / 4%);
  --shadow-md: 0 12px 28px rgb(16 24 40 / 8%);
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --sidebar-width: 16.5rem;
  --transition: 160ms ease;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121719;
  --surface: #1a2023;
  --surface-muted: #222a2e;
  --surface-hover: #23352f;
  --text: #f1f5f4;
  --text-muted: #b0bbb9;
  --text-subtle: #84908f;
  --border: #313b3f;
  --border-strong: #455054;
  --accent: #5ac4a9;
  --accent-hover: #84d5bf;
  --accent-soft: #173c34;
  --danger: #ff9b8d;
  --danger-soft: #47241f;
  --focus: #8ab4ff;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 20%);
  --shadow-md: 0 12px 28px rgb(0 0 0 / 24%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 20rem; margin: 0; color: var(--text); background: var(--bg); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, dialog { outline-offset: 3px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, dialog:focus-visible { outline: 3px solid var(--focus); }
button { border: 0; }
svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
h1, h2, h3, p { overflow-wrap: break-word; }
h1, h2 { letter-spacing: -0.035em; }
h1 { margin: 0.3rem 0 0.7rem; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.08; }
h2 { margin: 0.25rem 0 0; font-size: clamp(1.25rem, 2vw, 1.5rem); line-height: 1.2; }

.skip-link { position: fixed; z-index: 10; top: 0.75rem; left: 0.75rem; padding: 0.6rem 0.85rem; color: #fff; background: #17212b; border-radius: var(--radius-sm); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.app-shell { min-height: 100vh; }
.app-sidebar { position: fixed; z-index: 3; inset: 0 auto 0 0; display: flex; flex-direction: column; width: var(--sidebar-width); padding: 1.5rem 1rem; background: var(--surface); border-right: 1px solid var(--border); }
.brand { display: inline-flex; align-items: center; width: fit-content; color: var(--text); text-decoration: none; }
.brand-logo { width: 9.5rem; height: 2rem; }
.app-nav { display: grid; gap: 0.35rem; margin-top: 3rem; }
.app-nav__link, .sidebar-action { display: flex; align-items: center; gap: 0.75rem; min-height: 2.75rem; padding: 0.65rem 0.75rem; color: var(--text-muted); border-radius: var(--radius-sm); font-size: 0.92rem; font-weight: 650; text-align: left; text-decoration: none; transition: color var(--transition), background var(--transition); }
.app-nav__link:hover, .app-nav__link:focus-visible, .sidebar-action:hover { color: var(--accent); background: var(--surface-hover); }
.app-nav__link[aria-current="page"], .mobile-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.app-nav__link svg, .sidebar-action svg { width: 1.1rem; height: 1.1rem; }
.sidebar-footer { display: grid; gap: 0.75rem; margin-top: auto; }
.sidebar-action { width: 100%; cursor: pointer; background: transparent; }
.account-panel { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.65rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.account-avatar { display: grid; width: 2rem; height: 2rem; place-items: center; color: var(--accent); background: var(--accent-soft); border-radius: 50%; font-size: 0.65rem; font-weight: 800; }
.current-user { min-width: 0; color: var(--text-muted); font-size: 0.78rem; overflow-wrap: anywhere; }
.icon-button { display: inline-grid; width: 2.5rem; height: 2.5rem; place-items: center; color: var(--text-muted); background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm); cursor: pointer; transition: color var(--transition), background var(--transition), border-color var(--transition); }
.icon-button:hover { color: var(--accent); background: var(--surface-hover); border-color: var(--border); }
.icon-button--primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.icon-button--primary:hover { color: #fff; background: var(--accent-hover); border-color: var(--accent-hover); }
.mobile-header, .mobile-nav { display: none; }

.app-main { width: min(100% - 3rem, 82rem); margin: 0 1.5rem 0 calc(var(--sidebar-width) + 1.5rem); padding: 3rem 0 4rem; }
.api-status { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0 0 1.75rem; color: var(--text-subtle); font-size: 0.78rem; }
.api-status::before { width: 0.45rem; height: 0.45rem; background: currentColor; border-radius: 50%; content: ""; }
.api-status--ok { color: var(--accent); }
.api-status--error { color: var(--danger); }
.page-message { margin: 0 0 1rem; padding: 0.85rem 1rem; color: var(--danger); background: var(--danger-soft); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); border-radius: var(--radius-sm); }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; }
.eyebrow, .section-kicker { margin: 0; color: var(--accent); font-size: 0.7rem; font-weight: 750; letter-spacing: 0.09em; text-transform: uppercase; }
.description { max-width: 40rem; margin: 0; color: var(--text-muted); font-size: 1rem; }

.dashboard-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1rem; margin-top: 2.25rem; }
.metric-card, .recent-card, .content-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.metric-card { grid-column: span 4; min-height: 11.5rem; padding: 1.35rem; }
.metric-card--featured { grid-column: span 5; background: var(--accent); border-color: var(--accent); }
:root[data-theme="dark"] .metric-card--featured { background: #125e50; border-color: #125e50; }
.dashboard-chart { grid-column: span 7; }
.dashboard-chart .chart-container { min-height: 10rem; margin-top: 0.5rem; }
.dashboard-chart .chart-container svg { height: 9rem; }
.dashboard-chart .chart-empty { min-height: 8rem; }
.dashboard-chart .chart-label { font-size: 14px; }
.dashboard-table { width: 100%; }
.dashboard-table th, .dashboard-table td { padding: 0.55rem; }
.metric-card--featured .section-kicker, .metric-card--featured .metric-detail, .metric-card--featured .latest-value { color: #fff; }
.metric-card--featured .metric-detail { color: rgb(255 255 255 / 78%); }
.metric-card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.metric-icon { display: grid; width: 2.25rem; height: 2.25rem; place-items: center; color: var(--accent); background: var(--accent-soft); border-radius: 50%; }
.metric-card--featured .metric-icon { color: var(--accent); background: #fff; }
.metric-icon svg { width: 1.1rem; height: 1.1rem; }
.metric-value, .latest-value { margin: 1.6rem 0 0.2rem; font-size: clamp(2rem, 4vw, 2.5rem); font-weight: 720; letter-spacing: -0.06em; line-height: 1; }
.metric-detail { margin: 0; color: var(--text-muted); font-size: 0.84rem; }
.recent-card { grid-column: span 7; padding: 1.35rem; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.section-heading--compact { align-items: center; margin-bottom: 0.75rem; }
.section-description { margin: 0.45rem 0 0; color: var(--text-muted); font-size: 0.9rem; }
.section-count { margin: 0; color: var(--text-muted); font-size: 0.85rem; white-space: nowrap; }
.inline-link, .text-button { color: var(--accent); font-size: 0.86rem; font-weight: 700; text-decoration: none; }
.inline-link:hover, .text-button:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 0.2rem; }
.recent-list { display: grid; margin: 0; padding: 0; list-style: none; }
.recent-item { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem 1rem; padding: 0.8rem 0; border-top: 1px solid var(--border); }
.recent-item__value { font-weight: 720; }
.recent-item__date { color: var(--text-muted); font-size: 0.82rem; }
.recent-item__context { color: var(--text-muted); font-size: 0.82rem; text-align: right; }
.recent-empty { padding: 1.25rem 0; color: var(--text-muted); font-size: 0.9rem; }

.content-section { margin-top: 1.25rem; padding: clamp(1.25rem, 3vw, 2rem); }
.glucose-entry { margin-top: 2.5rem; }
.glucose-entry .section-heading { align-items: center; margin-bottom: 0; }
.reading-dialog { width: min(calc(100% - 1.5rem), 42rem); max-width: none; max-height: min(90dvh, 48rem); margin: auto; padding: clamp(1.25rem, 4vw, 2rem); overflow-x: hidden; overflow-y: auto; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 1.5rem 5rem rgb(16 24 40 / 24%); }
.reading-dialog::backdrop { background: rgb(15 33 37 / 65%); backdrop-filter: blur(3px); }
.reading-dialog__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; margin-bottom: 1.5rem; }
.reading-dialog__header .icon-button { flex: none; }
.reading-dialog .reading-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.reading-dialog .form-actions { flex-wrap: wrap; }
.reading-dialog .form-message { flex-basis: 100%; }
.reading-dialog input { min-width: 0; }
.reading-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.15rem; }
.account-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.15rem; max-width: 56rem; }
.settings-section { max-width: 62rem; }
.account-email { display: grid; gap: 0.25rem; padding: 1rem; background: var(--surface-muted); border: 1px solid var(--border); border-radius: var(--radius-md); }
.account-email span { color: var(--text-muted); font-size: 0.8rem; }
.account-email strong { overflow-wrap: anywhere; }
.settings-divider { height: 1px; margin: 2rem 0; background: var(--border); }
.form-field { min-width: 0; }
.form-field--wide { grid-column: 1 / -1; }
.form-field--compact { width: min(100%, 16rem); }
label { display: block; margin-bottom: 0.45rem; color: var(--text); font-size: 0.84rem; font-weight: 700; }
.optional { color: var(--text-muted); font-weight: 400; }
input, select, textarea { width: 100%; min-height: 2.8rem; padding: 0.6rem 0.75rem; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); transition: border-color var(--transition), box-shadow var(--transition), background var(--transition); }
input:hover, select:hover, textarea:hover { border-color: var(--text-subtle); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: 0; }
textarea { min-height: 6.25rem; resize: vertical; }
textarea::placeholder { color: var(--text-subtle); }
.field-hint { margin: 0.35rem 0 0; color: var(--text-muted); font-size: 0.76rem; }
.form-actions, .filter-actions, .period-buttons, .pagination { display: flex; align-items: center; gap: 0.75rem; }
.form-message { min-height: 1.5rem; margin: 0; color: var(--text-muted); font-size: 0.86rem; }
.form-message--error, .section-message--error { color: var(--danger); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 2.75rem; padding: 0.6rem 0.95rem; border: 1px solid transparent; border-radius: var(--radius-sm); cursor: pointer; font-size: 0.88rem; font-weight: 720; transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition); }
.button svg { width: 1rem; height: 1rem; stroke-width: 2.3; }
.button:active:not(:disabled) { transform: translateY(1px); }
.button:disabled { cursor: not-allowed; opacity: 0.55; }
.button--primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.button--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.button--secondary { color: var(--accent); background: var(--surface); border-color: var(--border-strong); }
.button--secondary:hover { background: var(--surface-hover); border-color: var(--accent); }
.text-button { min-height: 2.5rem; padding: 0.35rem 0; background: transparent; cursor: pointer; }
.filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 0.9rem; align-items: end; margin-bottom: 1rem; padding: 1rem; background: var(--surface-muted); border: 1px solid var(--border); border-radius: var(--radius-md); }
.filter-actions { padding-bottom: 0; }
.section-message { min-height: 1.35rem; margin: 0 0 0.75rem; color: var(--text-muted); font-size: 0.86rem; }
.table-wrap { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-md); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.9rem 1rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { color: var(--text-muted); background: var(--surface-muted); font-size: 0.7rem; font-weight: 750; letter-spacing: 0.07em; text-transform: uppercase; }
td { font-size: 0.88rem; }
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: var(--surface-hover); }
tbody tr:last-child td { border-bottom: 0; }
.table-actions { display: flex; justify-content: flex-end; gap: 0.75rem; white-space: nowrap; }
.table-actions .text-button { min-height: auto; font-size: 0.82rem; }
.empty-cell { padding: 2.5rem 1rem; color: var(--text-muted); text-align: center; }
.pagination { justify-content: center; margin-top: 1.25rem; }
.pagination p { min-width: 7.5rem; margin: 0; color: var(--text-muted); font-size: 0.86rem; text-align: center; }
.chart-toolbar { display: flex; justify-content: flex-end; margin: -0.5rem 0 0.75rem; }
.chart-container { min-height: 18rem; padding: 1rem; background: var(--surface-muted); border: 1px solid var(--border); border-radius: var(--radius-md); }
.chart-container svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-axis { stroke: var(--border-strong); stroke-width: 1; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart-point { fill: var(--surface); stroke: var(--accent); stroke-width: 2.5; }
.chart-label { fill: var(--text-muted); font-size: 12px; }
.chart-empty { display: grid; min-height: 14rem; place-items: center; margin: 0; color: var(--text-muted); text-align: center; }
.admin-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 2rem; }
.admin-metrics .metric-card { min-height: 10rem; }
.admin-filters { grid-template-columns: minmax(0, 1fr) minmax(10rem, 14rem) auto; }
.admin-table td:nth-child(2) { overflow-wrap: anywhere; }
.period-button { min-height: 2.25rem; padding: 0.4rem 0.7rem; color: var(--text-muted); background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm); cursor: pointer; font-size: 0.8rem; font-weight: 700; }
.period-button:hover { color: var(--accent); background: var(--surface-hover); }
.period-button[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.auth-page { display: grid; min-height: 100vh; grid-template-columns: minmax(18rem, 0.9fr) minmax(20rem, 1.1fr); background: var(--bg); }
.auth-intro { display: flex; flex-direction: column; justify-content: space-between; min-height: 100%; padding: clamp(2rem, 6vw, 5rem); color: #fff; background: var(--accent); }
.auth-intro .brand { color: #fff; }
.auth-intro .brand-logo { color: #fff; }
.auth-intro__content { max-width: 28rem; margin: auto 0; }
.auth-intro .eyebrow { color: #c1eadc; }
.auth-intro h1 { font-size: clamp(2.25rem, 5vw, 4rem); }
.auth-intro .description { color: rgb(255 255 255 / 78%); }
.auth-disclaimer { margin: 2rem 0 0; color: rgb(255 255 255 / 70%); font-size: 0.78rem; }
.auth-content { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-card { width: min(100%, 29rem); }
.auth-card__header { margin-bottom: 1.75rem; }
.auth-card__header h2 { font-size: 1.75rem; }
.auth-card__header p { margin: 0.55rem 0 0; color: var(--text-muted); font-size: 0.9rem; }
.auth-form { display: grid; gap: 1rem; }
.auth-form[hidden] { display: none !important; }
.auth-form .button { width: 100%; margin-top: 0.25rem; }
.auth-tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.25rem; margin-bottom: 1.25rem; padding: 0.25rem; background: var(--surface-muted); border-radius: var(--radius-sm); }
.auth-tab { min-height: 2.5rem; color: var(--text-muted); background: transparent; border-radius: calc(var(--radius-sm) - 0.15rem); cursor: pointer; font-size: 0.84rem; font-weight: 700; }
.auth-tab[aria-selected="true"] { color: var(--text); background: var(--surface); box-shadow: var(--shadow-sm); }
.auth-divider { display: flex; align-items: center; gap: 0.75rem; margin: 1.5rem 0; color: var(--text-subtle); font-size: 0.75rem; text-align: center; }
.auth-divider::before, .auth-divider::after { flex: 1; height: 1px; background: var(--border); content: ""; }
.auth-switch { margin: 0; color: var(--text-muted); font-size: 0.84rem; text-align: center; }
.auth-switch a { color: var(--accent); font-weight: 700; }

.landing-body { background: var(--surface); }
.landing-header__actions { display: flex; align-items: center; gap: 0.75rem; }
.theme-select { width: auto; min-height: 2.5rem; cursor: pointer; }
:root[data-theme="dark"] .landing-hero::before { background: radial-gradient(circle, #1d3a33 0%, transparent 70%); }
:root[data-theme="dark"] .feature-card { background: var(--surface-muted); border-color: var(--border); }
:root[data-theme="dark"] .feature-icon { background: var(--accent-soft); }
:root[data-theme="dark"] .final-cta { background: var(--accent-soft); }
.landing-hero { position: relative; isolation: isolate; }
.landing-hero::before { position: absolute; z-index: -1; top: 8%; right: 0; width: min(58vw, 40rem); aspect-ratio: 1; background: radial-gradient(circle, #e2f3ec 0%, rgb(226 243 236 / 0%) 70%); pointer-events: none; content: ""; }
.landing-hero h1 span { color: var(--accent); }
.landing-actions .button, .final-cta .button { gap: 0.9rem; border-radius: 0.7rem; box-shadow: 0 0.6rem 1.4rem rgb(22 112 93 / 18%); }
.landing-actions .button:hover, .final-cta .button:hover { box-shadow: 0 0.8rem 1.6rem rgb(22 112 93 / 25%); transform: translateY(-2px); }
.landing-actions .button svg, .final-cta .button svg { width: 1.1rem; height: 1.1rem; }
.landing-section__intro h2 { max-width: 34rem; }
.preview-reading { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.preview-reading__icon { display: grid; flex: none; width: 2.5rem; height: 2.5rem; place-items: center; color: #b8e4d7; background: rgb(255 255 255 / 12%); border-radius: 0.75rem; }
.preview-chart .preview-label { margin-bottom: 0.75rem; }
.preview-area { fill: rgb(158 240 213 / 12%); stroke: none; }
.feature-card { display: flex; flex-direction: column; border: 1px solid #e4eeea; transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition); }
.feature-card:hover { border-color: #b7d9cd; box-shadow: var(--shadow-md); transform: translateY(-3px); }
.feature-icon { display: grid; width: 3.25rem; height: 3.25rem; place-items: center; color: var(--accent); background: #dff1e9; border-radius: 0.85rem; }
.feature-icon svg { width: 1.5rem; height: 1.5rem; stroke-width: 1.8; }
.feature-card h3 { margin: auto 0 0.65rem; padding-top: 2.75rem; font-size: 1.22rem; letter-spacing: -0.02em; }
.feature-card p { max-width: 28rem; }
.landing-header, .landing-hero, .landing-section, .privacy-section, .final-cta, .landing-footer { width: min(100% - 3rem, 72rem); margin-inline: auto; }
.landing-header { display: flex; align-items: center; justify-content: space-between; min-height: 5.5rem; }
.landing-nav { display: flex; gap: 2rem; }
.landing-nav a, .landing-text-link { color: var(--text-muted); font-size: 0.88rem; font-weight: 700; text-decoration: none; }
.landing-nav a:hover, .landing-text-link:hover { color: var(--accent); }
.landing-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(24rem, 0.9fr); gap: clamp(2rem, 7vw, 6rem); align-items: center; min-height: min(44rem, calc(100vh - 5.5rem)); padding: 5rem 0 6rem; }
.landing-hero h1 { max-width: 44rem; margin-top: 0.5rem; font-size: clamp(3rem, 6vw, 5.5rem); line-height: 0.98; letter-spacing: -0.065em; }
.landing-lead { max-width: 33rem; margin: 1.5rem 0 0; color: var(--text-muted); font-size: 1.1rem; line-height: 1.65; }
.landing-actions { display: flex; align-items: center; gap: 1.25rem; margin-top: 2.25rem; }
.landing-actions .button, .final-cta .button { min-height: 3.25rem; padding-inline: 1.25rem; }
.landing-note { max-width: 31rem; margin: 2rem 0 0; color: var(--text-subtle); font-size: 0.77rem; }
.product-preview { overflow: hidden; color: #eafaf5; background: #125e50; border: 1px solid #0f5548; border-radius: 1.25rem; box-shadow: 0 2rem 4rem rgb(10 55 46 / 18%); transform: rotate(2deg); }
.preview-topbar { display: flex; align-items: center; gap: 0.65rem; min-height: 3.8rem; padding: 0 1.25rem; border-bottom: 1px solid rgb(255 255 255 / 15%); font-size: 0.86rem; font-weight: 700; }
.preview-mark { display: grid; width: 1.75rem; height: 1.75rem; place-items: center; color: var(--accent); background: #fff; border-radius: 50%; font-size: 0.6rem; }
.preview-status { margin-left: auto; color: #b8e4d7; font-size: 0.7rem; font-weight: 600; }
.preview-content { display: grid; gap: 1.5rem; padding: clamp(1.5rem, 4vw, 2.5rem); }
.preview-label { margin: 0; color: #b8e4d7; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.preview-value { margin: 0.3rem 0; font-size: clamp(2.5rem, 5vw, 3.8rem); font-weight: 750; letter-spacing: -0.07em; line-height: 1; }.preview-value small { font-size: 0.8rem; letter-spacing: normal; }.preview-muted { margin: 0; color: #b8e4d7; font-size: 0.78rem; }
.preview-chart { padding: 1rem 0 0; border-top: 1px solid rgb(255 255 255 / 15%); }.preview-chart svg { width: 100%; height: auto; }.preview-grid { stroke: rgb(255 255 255 / 14%); }.preview-line { fill: none; stroke: #9ef0d5; stroke-width: 3; }.preview-chart circle { fill: #fff; stroke: #9ef0d5; stroke-width: 4; }
.preview-list { display: flex; justify-content: space-between; padding: 0.85rem 1rem; color: #b8e4d7; background: rgb(0 0 0 / 12%); border-radius: var(--radius-sm); font-size: 0.78rem; }.preview-list strong { color: #fff; }
.landing-section { padding: 7rem 0; border-top: 1px solid var(--border); }.landing-section__intro { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 2rem; align-items: start; }.landing-section h2, .privacy-section h2, .final-cta h2 { font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.06; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 3.5rem; }.feature-card { min-height: 16rem; padding: 1.5rem; background: #f4f8f7; border-radius: var(--radius-lg); }.feature-icon { color: var(--accent); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.08em; }.feature-card h3 { margin: 3rem 0 0.5rem; font-size: 1.15rem; }.feature-card p, .privacy-section p { margin: 0; color: var(--text-muted); font-size: 0.92rem; line-height: 1.65; }
.privacy-section { display: grid; grid-template-columns: auto minmax(0, 36rem); gap: 2rem; align-items: start; padding: 5rem 0; border-top: 1px solid var(--border); }.privacy-symbol { display: grid; width: 4rem; height: 4rem; place-items: center; color: #fff; background: var(--accent); border-radius: 50%; font-size: 2rem; font-weight: 300; }.privacy-section h2 { margin-bottom: 1rem; }
.final-cta { padding: 7rem 1.5rem; text-align: center; background: #e4f4ee; border-radius: 1.25rem; }.final-cta h2 { max-width: 38rem; margin: 0.6rem auto 2rem; }.landing-footer { display: flex; align-items: center; justify-content: space-between; padding: 2.5rem 0; }.landing-footer p { margin: 0; color: var(--text-subtle); font-size: 0.78rem; }

@media (max-width: 70rem) {
  .app-main { width: min(100% - 2rem, 68rem); margin-left: calc(var(--sidebar-width) + 1rem); margin-right: 1rem; }
  .metric-card { grid-column: span 6; }
  .metric-card--featured, .recent-card { grid-column: span 12; }
  .dashboard-chart { grid-column: span 12; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-actions { grid-column: 1 / -1; }
}

@media (max-width: 52rem) {
  body { min-width: 0; }
  .app-sidebar { display: none; }
  .mobile-header { position: sticky; z-index: 3; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 0.8rem 1rem; background: color-mix(in srgb, var(--bg) 90%, transparent); border-bottom: 1px solid var(--border); backdrop-filter: blur(14px); }
  .mobile-header__actions { display: flex; gap: 0.35rem; }
  .app-main { width: min(100% - 2rem, 42rem); margin: 0 auto; padding: 1.75rem 0 6rem; }
  .mobile-nav { position: fixed; z-index: 4; right: 0.75rem; bottom: max(0.75rem, env(safe-area-inset-bottom)); left: 0.75rem; display: grid; grid-template-columns: repeat(5, 1fr); padding: 0.35rem; background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-md); backdrop-filter: blur(14px); }
  .mobile-nav a, .mobile-nav button { display: grid; min-height: 3rem; place-items: center; gap: 0.1rem; color: var(--text-muted); background: transparent; border-radius: var(--radius-sm); font-size: 0.64rem; font-weight: 700; text-decoration: none; cursor: pointer; }
  .mobile-nav a:hover, .mobile-nav a:focus-visible, .mobile-nav button:hover, .mobile-nav button:focus-visible { color: var(--accent); background: var(--accent-soft); }
  .mobile-nav svg { width: 1.05rem; height: 1.05rem; }
  .mobile-nav:has(.admin-nav-link) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .mobile-nav:has(.admin-nav-link):not(:has(a[href="#history"])) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .mobile-nav .admin-nav-link { font-size: 0.58rem; overflow-wrap: anywhere; text-align: center; }
  .admin-metrics { grid-template-columns: 1fr; }
  .admin-filters { grid-template-columns: 1fr; }
  .admin-table td:last-child { display: grid; margin: 0; }
  .admin-table td:last-child::before { display: block; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading .button { width: 100%; }
  .dashboard-grid { margin-top: 1.5rem; }
  .metric-card, .metric-card--featured, .recent-card { grid-column: span 12; }
  .dashboard-table, .dashboard-table tbody { display: table; }
  .recent-card { overflow-x: auto; }
  .dashboard-table { min-width: 24rem; }
  .dashboard-table thead { display: table-header-group; }
  .dashboard-table tbody tr { display: table-row; padding: 0; border: 0; box-shadow: none; }
  .dashboard-table td { display: table-cell; }
  .dashboard-table td::before { display: none; }
  .glucose-entry { margin-top: 1.5rem; }
  .reading-dialog .reading-form { grid-template-columns: 1fr; }
  .reading-form { grid-template-columns: 1fr; }
  .account-form { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .section-heading .button { width: 100%; }
  .filters { grid-template-columns: 1fr; }
  .filter-actions { flex-wrap: wrap; }
  .filter-actions .button { flex: 1; }
  .table-wrap { overflow: visible; border: 0; }
  table, tbody { display: block; }
  thead { display: none; }
  tbody { display: grid; gap: 0.75rem; }
  tbody tr { display: grid; gap: 0.5rem; padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
  tbody tr:hover { background: var(--surface); }
  td { display: grid; grid-template-columns: minmax(7rem, 0.9fr) minmax(0, 1.1fr); gap: 1rem; padding: 0; border: 0; font-size: 0.86rem; }
  td::before { color: var(--text-muted); font-size: 0.74rem; font-weight: 700; content: attr(data-label); }
  td:last-child { display: block; margin-top: 0.35rem; }
  td:last-child::before { display: none; }
  .table-actions { justify-content: flex-start; }
  .empty-cell { display: block; padding: 2rem 1rem; text-align: center; }
  .empty-cell::before { display: none; }
  .pagination { justify-content: space-between; gap: 0.4rem; }
  .pagination .button { padding-inline: 0.7rem; }
  .pagination p { min-width: 0; }
  .period-buttons { flex-wrap: wrap; }
  .chart-toolbar { justify-content: flex-start; margin-top: 0; }
  .chart-container { min-height: 15rem; padding: 0.5rem; }
  .auth-page { display: block; }
  .auth-intro { min-height: 17rem; padding: 1.5rem; }
  .auth-intro__content { margin: auto 0 0; }
  .auth-intro h1 { margin-bottom: 0.4rem; }
  .auth-disclaimer { display: none; }
  .auth-content { align-items: flex-start; padding: 1.5rem 1rem 2rem; }
  .landing-header, .landing-hero, .landing-section, .privacy-section, .final-cta, .landing-footer { width: min(100% - 2rem, 42rem); }.landing-header { min-height: 4.75rem; }.landing-nav { display: none; }.landing-header .button { min-height: 2.5rem; padding-inline: 0.75rem; }.landing-hero { grid-template-columns: 1fr; gap: 3rem; min-height: 0; padding: 4rem 0; }.landing-hero h1 { font-size: clamp(2.8rem, 13vw, 4.4rem); }.landing-lead { font-size: 1rem; }.product-preview { max-width: 29rem; margin: 0 auto; transform: none; }.landing-section { padding: 4.5rem 0; }.landing-section__intro { grid-template-columns: 1fr; gap: 0.75rem; }.feature-grid { grid-template-columns: 1fr; margin-top: 2rem; }.feature-card { min-height: 0; }.feature-card h3 { margin-top: 0; }.privacy-section { grid-template-columns: 1fr; gap: 1.25rem; padding: 4.5rem 0; }.final-cta { padding: 4.5rem 1.25rem; }.landing-footer { align-items: flex-start; flex-direction: column; gap: 1rem; padding: 2rem 0; }
}

@media (max-width: 24rem) {
  .app-main { width: min(100% - 1.25rem, 42rem); }
  .content-section, .metric-card, .recent-card { padding: 1rem; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .form-actions .button { width: 100%; }
  .period-buttons { gap: 0.35rem; }
  .period-button { padding-inline: 0.5rem; }
}

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