:root {
    color-scheme: light;
    --navy-950: #071d30;
    --navy-900: #0d3150;
    --navy-800: #164668;
    --blue-600: #1672a8;
    --blue-100: #e9f5fb;
    --teal-600: #07887d;
    --teal-100: #e3f6f2;
    --green-600: #168554;
    --green-100: #e8f7ef;
    --amber-600: #b56b04;
    --amber-100: #fff4d8;
    --red-600: #c0363f;
    --red-100: #fdebed;
    --slate-900: #172534;
    --slate-700: #405265;
    --slate-500: #718095;
    --slate-300: #ccd5df;
    --slate-200: #dde5ec;
    --slate-100: #eef3f7;
    --surface: #ffffff;
    --background: #f4f7fa;
    --shadow: 0 18px 48px rgba(13, 49, 80, 0.09);
    --radius-lg: 22px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--background);
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--slate-900);
    background: var(--background);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.45;
}

button,
input,
select {
    font: inherit;
}

button,
a,
input,
select {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
}

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

.is-hidden {
    display: none !important;
}

.page-shell,
.topbar-inner {
    width: min(1160px, calc(100% - 32px));
    margin-inline: auto;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    color: #fff;
    background: linear-gradient(120deg, var(--navy-950), var(--navy-900));
    box-shadow: 0 6px 20px rgba(7, 29, 48, 0.18);
}

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

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: #fff;
    text-decoration: none;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 1.03rem;
    letter-spacing: 0.01em;
}

.brand small {
    margin-top: 1px;
    color: #bcd1df;
    font-size: 0.75rem;
}

.brand-mark {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    color: #fff;
    background: linear-gradient(145deg, #16a69b, #0a766f);
    box-shadow: 0 10px 25px rgba(7, 136, 125, 0.22);
    font-weight: 800;
    letter-spacing: -0.04em;
}

.brand-mark img {
    width: 34px;
    height: 34px;
    display: block;
    filter: brightness(0) invert(1);
}

.brand-mark-small {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 0.86rem;
    box-shadow: none;
}

.brand-mark-small img {
    width: 22px;
    height: 22px;
}

.main-nav {
    border-top: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(5, 23, 38, 0.28);
}

.nav-inner {
    display: flex;
    gap: 6px;
}

.nav-link {
    position: relative;
    padding: 11px 15px 12px;
    color: #c7d9e5;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 700;
}

.nav-link::after {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: #22b8ab;
    content: "";
    opacity: 0;
}

.nav-link.is-active {
    color: #fff;
}

.nav-link.is-active::after {
    opacity: 1;
}

.page-main {
    padding-top: 34px;
    padding-bottom: calc(64px + var(--safe-bottom));
}

.page-heading {
    max-width: 740px;
    margin-bottom: 28px;
}

.page-heading h1,
.history-heading h2 {
    margin: 0;
    color: var(--navy-950);
    letter-spacing: -0.035em;
    line-height: 1.08;
}

.page-heading h1 {
    font-size: clamp(2rem, 4vw, 3.25rem);
}

.page-heading p:not(.eyebrow) {
    margin: 12px 0 0;
    color: var(--slate-700);
    font-size: 1.02rem;
}

.compact-heading {
    margin-bottom: 22px;
}

.eyebrow {
    margin: 0 0 7px;
    color: var(--teal-600);
    font-size: 0.74rem;
    font-weight: 850;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.calculator-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
    align-items: start;
    gap: 22px;
}

.card {
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.builder-card,
.summary-card {
    padding: 25px;
}

.summary-card {
    position: sticky;
    top: 140px;
    overflow: hidden;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.summary-card[data-status="safe"] {
    border-color: #9fd8bf;
}

.summary-card[data-status="near"] {
    border-color: #e9c168;
    box-shadow: 0 18px 48px rgba(181, 107, 4, 0.12);
}

.summary-card[data-status="over"] {
    border-color: #e3999e;
    box-shadow: 0 18px 48px rgba(192, 54, 63, 0.12);
}

.section-title-row,
.history-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.section-title-row > div:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title-row h2,
.history-heading h2 {
    font-size: 1.25rem;
}

.step-badge {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: var(--navy-900);
    background: var(--blue-100);
    font-size: 0.8rem;
    font-weight: 850;
}

.factor-pill,
.count-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
    white-space: nowrap;
}

.factor-pill {
    color: #076b64;
    background: var(--teal-100);
}

.factor-pill.is-missing {
    color: var(--red-600);
    background: var(--red-100);
}

.count-badge {
    color: var(--slate-700);
    background: var(--slate-100);
}

.field {
    position: relative;
    display: grid;
    gap: 7px;
    margin-top: 18px;
}

.field > span:first-child {
    color: var(--slate-700);
    font-size: 0.79rem;
    font-weight: 800;
}

input,
select {
    width: 100%;
    min-height: 50px;
    padding: 11px 13px;
    color: var(--slate-900);
    background: #fff;
    border: 1px solid var(--slate-300);
    border-radius: var(--radius-sm);
    outline: 0;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

input::placeholder {
    color: #9aa7b4;
}

input:focus,
select:focus {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 4px rgba(22, 114, 168, 0.12);
}

select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--slate-500) 50%), linear-gradient(135deg, var(--slate-500) 50%, transparent 50%);
    background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.section-divider {
    height: 1px;
    margin: 26px 0 23px;
    background: var(--slate-200);
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 13px;
}

.input-unit {
    position: relative;
}

.input-unit input {
    padding-right: 45px;
}

.input-unit > span {
    position: absolute;
    right: 14px;
    top: 50%;
    color: var(--slate-500);
    font-size: 0.83rem;
    font-weight: 800;
    transform: translateY(-50%);
    pointer-events: none;
}

.suggestions {
    position: absolute;
    z-index: 20;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 245px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--slate-200);
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 15px 40px rgba(7, 29, 48, 0.16);
}

.suggestion {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 11px;
    border: 0;
    border-radius: 9px;
    color: var(--slate-900);
    background: transparent;
    text-align: left;
}

.suggestion:hover,
.suggestion:focus {
    background: var(--blue-100);
    outline: 0;
}

.suggestion small {
    color: var(--slate-500);
    white-space: nowrap;
}

.live-preview {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin: 16px 0;
    padding: 12px 13px;
    border-radius: 11px;
    color: var(--slate-700);
    background: var(--slate-100);
    font-size: 0.84rem;
}

.live-preview strong {
    color: var(--navy-900);
}

.button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 14px;
    border: 1px solid transparent;
    border-radius: 11px;
    font-weight: 800;
    text-decoration: none;
    transition: transform 100ms ease, filter 150ms ease, background 150ms ease;
}

.button:active:not(:disabled) {
    transform: translateY(1px);
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.46;
}

.button-large {
    min-height: 50px;
    padding: 11px 17px;
}

.button-full {
    width: 100%;
}

.button-primary {
    color: #fff;
    background: linear-gradient(135deg, #0b8b81, #08736b);
    box-shadow: 0 8px 18px rgba(7, 136, 125, 0.19);
}

.button-primary:hover:not(:disabled) {
    filter: brightness(1.06);
}

.button-secondary {
    color: var(--navy-900);
    background: var(--blue-100);
    border-color: #c4dfed;
}

.button-ghost {
    color: #d7e6ef;
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.12);
}

.empty-state {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 32px 16px 25px;
    color: var(--slate-500);
    text-align: center;
}

.empty-state p {
    margin: 0;
    font-size: 0.88rem;
}

.empty-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px dashed #aab8c6;
    border-radius: 50%;
    font-size: 1.5rem;
}

.meal-items {
    display: grid;
    gap: 9px;
    margin-top: 18px;
}

.meal-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid var(--slate-200);
    border-radius: 12px;
    background: #fbfcfd;
}

.meal-item strong,
.meal-item small {
    display: block;
}

.meal-item strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9rem;
}

.meal-item small {
    margin-top: 2px;
    color: var(--slate-500);
    font-size: 0.72rem;
}

.item-ke {
    color: var(--navy-900);
    font-size: 0.82rem;
    font-weight: 850;
    white-space: nowrap;
}

.remove-item {
    border: 0;
    color: var(--red-600);
    background: transparent;
    font-weight: 850;
}

.remove-item {
    width: 31px;
    height: 31px;
    border-radius: 8px;
    font-size: 1.12rem;
}

.remove-item:hover {
    background: var(--red-100);
}

.limit-block {
    margin: 22px 0 16px;
}

.limit-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
    color: var(--slate-500);
    font-size: 0.74rem;
}

.limit-label strong {
    color: var(--slate-700);
}

.progress-track {
    width: 100%;
    height: 9px;
    display: block;
    overflow: hidden;
    appearance: none;
    border: 0;
    border-radius: 999px;
    background: var(--slate-100);
}

.progress-track::-webkit-progress-bar {
    border-radius: inherit;
    background: var(--slate-100);
}

.progress-track::-webkit-progress-value {
    border-radius: inherit;
    background: var(--green-600);
}

.progress-track::-moz-progress-bar {
    border-radius: inherit;
    background: var(--green-600);
}

.summary-card[data-status="near"] .progress-track::-webkit-progress-value {
    background: var(--amber-600);
}

.summary-card[data-status="near"] .progress-track::-moz-progress-bar {
    background: var(--amber-600);
}

.summary-card[data-status="over"] .progress-track::-webkit-progress-value {
    background: var(--red-600);
}

.summary-card[data-status="over"] .progress-track::-moz-progress-bar {
    background: var(--red-600);
}

.limit-warning {
    min-height: 18px;
    margin: 7px 0 0;
    color: var(--slate-500);
    font-size: 0.73rem;
    font-weight: 700;
}

.summary-card[data-status="near"] .limit-warning {
    color: var(--amber-600);
}

.summary-card[data-status="over"] .limit-warning {
    color: var(--red-600);
}

.totals-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid var(--slate-200);
    border-radius: 12px;
}

.totals-grid > div {
    padding: 12px 13px;
}

.totals-grid > div + div {
    border-left: 1px solid var(--slate-200);
}

.totals-grid span,
.totals-grid strong {
    display: block;
}

.totals-grid span {
    color: var(--slate-500);
    font-size: 0.72rem;
}

.totals-grid strong {
    margin-top: 2px;
    color: var(--navy-900);
    font-size: 1.05rem;
}

.insulin-result {
    margin-top: 12px;
    padding: 15px;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, var(--navy-900), var(--navy-800));
}

.insulin-result > span,
.insulin-result > strong,
.insulin-result > small {
    display: block;
}

.insulin-result > span {
    color: #c2d9e7;
    font-size: 0.73rem;
    font-weight: 700;
}

.insulin-result > strong {
    margin-top: 2px;
    font-size: 2rem;
    line-height: 1.05;
}

.insulin-result > small {
    margin-top: 5px;
    color: #c2d9e7;
    font-size: 0.72rem;
}

.confirm-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 22px 0;
    padding: 13px;
    border: 1px solid var(--slate-200);
    border-radius: 12px;
    color: var(--slate-700);
    background: #fbfcfd;
    font-size: 0.82rem;
    font-weight: 650;
}

.confirm-row input {
    flex: 0 0 auto;
    width: 19px;
    min-height: 19px;
    margin: 1px 0 0;
    accent-color: var(--teal-600);
}

.confirm-compact {
    margin: 13px 0;
    padding: 10px;
    font-size: 0.73rem;
}

.history-section {
    margin-top: 42px;
}

.history-heading {
    margin-bottom: 16px;
}

.date-navigator {
    display: flex;
    align-items: center;
    gap: 6px;
}

.date-navigator input {
    min-height: 42px;
    width: 155px;
    padding: 8px 9px;
    font-size: 0.83rem;
    font-weight: 750;
}

.icon-button {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--slate-300);
    border-radius: 10px;
    color: var(--navy-900);
    background: #fff;
    font-size: 1.45rem;
}

.history-list {
    display: grid;
    gap: 13px;
}

.history-card {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr) auto;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--slate-200);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 25px rgba(13, 49, 80, 0.05);
}

.history-time {
    color: var(--navy-900);
    font-size: 1.05rem;
    font-weight: 850;
}

.history-time small {
    display: block;
    margin-top: 2px;
    color: var(--slate-500);
    font-size: 0.68rem;
    font-weight: 700;
}

.history-content h3 {
    margin: 0;
    color: var(--slate-900);
    font-size: 1rem;
}

.history-products {
    margin: 5px 0 0;
    color: var(--slate-700);
    font-size: 0.78rem;
}

.history-metrics {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.metric {
    padding: 4px 8px;
    border-radius: 999px;
    color: var(--slate-700);
    background: var(--slate-100);
    font-size: 0.7rem;
    font-weight: 800;
}

.metric.metric-insulin {
    color: #075e59;
    background: var(--teal-100);
}

.metric.metric-over {
    color: var(--red-600);
    background: var(--red-100);
}

.metric.metric-muted {
    color: #72510d;
    background: #fff2d8;
}

.history-actions {
    display: flex;
    align-items: flex-start;
}

.edit-meal-button {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid #c4dfed;
    border-radius: 11px;
    background: var(--blue-100);
}

.edit-meal-button img {
    width: 18px;
    height: 18px;
    display: block;
    opacity: 0.82;
}

.edit-meal-button:hover,
.edit-meal-button:focus-visible {
    border-color: var(--blue-600);
    outline: 0;
}

.history-empty,
.history-loading {
    padding: 28px;
    border: 1px dashed var(--slate-300);
    border-radius: 16px;
    color: var(--slate-500);
    background: rgba(255, 255, 255, 0.55);
    text-align: center;
}

.alert {
    margin: 0 0 18px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 0.84rem;
    font-weight: 700;
}

.alert-danger {
    color: #8f252c;
    background: var(--red-100);
    border-color: #f2c0c4;
}

.alert-warning {
    color: #7a4a08;
    background: var(--amber-100);
    border-color: #efd18a;
}

.alert-info,
.alert-success {
    color: #08655f;
    background: var(--teal-100);
    border-color: #aedfd9;
}

.factor-form {
    max-width: 940px;
}

.factor-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.factor-card {
    position: relative;
    display: grid;
    gap: 12px;
    padding: 18px;
    border: 1px solid var(--slate-200);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 25px rgba(13, 49, 80, 0.045);
}

.factor-sequence {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: var(--slate-500);
    background: var(--slate-100);
    font-size: 0.7rem;
    font-weight: 850;
}

.factor-label {
    max-width: calc(100% - 28px);
    min-height: 42px;
    color: var(--navy-950);
    font-weight: 850;
}

.factor-input-wrap {
    position: relative;
}

.factor-input-wrap input {
    padding-right: 70px;
    font-size: 1.2rem;
    font-weight: 850;
}

.factor-input-wrap > span {
    position: absolute;
    right: 12px;
    top: 50%;
    color: var(--slate-500);
    font-size: 0.72rem;
    font-weight: 800;
    transform: translateY(-50%);
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.muted {
    color: var(--slate-500);
    font-size: 0.79rem;
}

.button-neutral {
    color: var(--slate-700);
    background: var(--slate-100);
    border-color: var(--slate-300);
}

.button-danger {
    color: #fff;
    background: var(--red-600);
}

.edit-dialog {
    width: min(920px, calc(100% - 28px));
    max-height: min(90vh, 860px);
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 22px;
    color: var(--slate-900);
    background: #fff;
    box-shadow: 0 35px 100px rgba(7, 29, 48, 0.35);
}

.edit-dialog::backdrop {
    background: rgba(7, 29, 48, 0.66);
    backdrop-filter: blur(3px);
}

.edit-form {
    max-height: min(90vh, 860px);
    padding: 25px;
    overflow-y: auto;
}

.dialog-header,
.dialog-section-title,
.dialog-actions,
.dialog-actions > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dialog-header {
    padding-bottom: 18px;
    border-bottom: 1px solid var(--slate-200);
}

.dialog-header h2,
.dialog-section-title h3 {
    margin: 0;
    color: var(--navy-950);
}

.dialog-header h2 {
    font-size: 1.55rem;
    letter-spacing: -0.025em;
}

.dialog-close {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 11px;
    color: var(--slate-700);
    background: var(--slate-100);
    font-size: 1.45rem;
}

.edit-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1.4fr;
    gap: 12px;
}

.dialog-section-title {
    margin: 25px 0 10px;
}

.dialog-section-title h3 {
    font-size: 1.05rem;
}

.edit-items {
    display: grid;
    gap: 10px;
}

.edit-item-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.5fr) minmax(120px, 0.7fr) minmax(150px, 0.9fr) 42px;
    align-items: end;
    gap: 10px;
    padding: 13px;
    border: 1px solid var(--slate-200);
    border-radius: 14px;
    background: #fbfcfd;
}

.edit-item-row .field {
    margin-top: 0;
}

.edit-item-remove {
    width: 42px;
    height: 50px;
    display: grid;
    place-items: center;
    border: 1px solid #efc1c5;
    border-radius: 10px;
    color: var(--red-600);
    background: var(--red-100);
    font-size: 1.25rem;
    font-weight: 850;
}

.edit-bottom-grid {
    display: grid;
    grid-template-columns: minmax(220px, 0.7fr) minmax(360px, 1.3fr);
    align-items: end;
    gap: 18px;
    margin-top: 18px;
}

.edit-calculation {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    overflow: hidden;
    border: 1px solid var(--slate-200);
    border-radius: 13px;
}

.edit-calculation > div {
    padding: 12px;
}

.edit-calculation > div + div {
    border-left: 1px solid var(--slate-200);
}

.edit-calculation span,
.edit-calculation strong {
    display: block;
}

.edit-calculation span {
    color: var(--slate-500);
    font-size: 0.7rem;
}

.edit-calculation strong {
    margin-top: 2px;
    color: var(--navy-900);
}

.dialog-actions {
    margin-top: 16px;
    padding-top: 17px;
    border-top: 1px solid var(--slate-200);
}

.meal-type-choices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 14px;
}

.meal-choice {
    min-height: 66px;
    display: grid;
    align-content: center;
    gap: 2px;
    padding: 10px 12px;
    border: 1px solid var(--slate-200);
    border-radius: 13px;
    color: var(--navy-900);
    background: #f8fafb;
    text-align: left;
}

.meal-choice:hover,
.meal-choice:focus-visible {
    border-color: #74c8bf;
    background: var(--teal-100);
}

.meal-choice.is-selected {
    border-color: var(--teal-600);
    color: #075d57;
    background: var(--teal-100);
    box-shadow: inset 0 0 0 1px var(--teal-600);
}

.meal-choice strong,
.meal-choice small { display: block; }
.meal-choice strong { font-size: .84rem; }
.meal-choice small { color: var(--slate-500); font-size: .7rem; }
.meal-types-complete { margin-top: 14px; padding: 13px; border-radius: 12px; color: #08655f; background: var(--teal-100); font-weight: 750; }

.glucose-entry {
    display: grid;
    gap: 6px;
    margin-top: 12px;
    padding: 13px;
    border: 1px solid #c7dce8;
    border-radius: 13px;
    background: #f2f8fb;
    color: var(--navy-900);
    font-size: .8rem;
    font-weight: 800;
}

.glucose-entry .input-unit { margin-top: 0; }
.correction-result { margin-top: 13px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .15); }
.correction-result > span,
.correction-result > strong,
.correction-result > small,
.pen-result > span,
.pen-result > strong { display: block; }
.correction-result > span,
.pen-result > span { color: #c2d9e7; font-size: .73rem; font-weight: 700; }
.correction-result > strong,
.pen-result > strong {
    display: flex;
    align-items: baseline;
    gap: .22em;
    flex-wrap: nowrap;
    white-space: nowrap;
}
.correction-result > strong { margin-top: 3px; font-size: 2rem; line-height: 1.05; }
.correction-result > strong > span,
.pen-result > strong > span { display: inline; }
.correction-result > small { margin-top: 5px; color: #c2d9e7; font-size: .7rem; }
.pen-result { margin-top: 13px; padding: 13px; border-radius: 11px; color: #082b2b; background: #bceee6; }
.pen-result > span { color: #245e5a; }
.pen-result > strong { margin-top: 4px; font-size: 2.4rem; line-height: 1; }

.report-button { white-space: nowrap; }
.report-dialog {
    width: min(540px, calc(100% - 28px));
    padding: 0;
    border: 0;
    border-radius: 20px;
    color: var(--slate-900);
    background: #fff;
    box-shadow: 0 35px 100px rgba(7, 29, 48, .35);
}
.report-dialog::backdrop { background: rgba(7, 29, 48, .66); backdrop-filter: blur(3px); }
.report-form { padding: 24px; }
.report-form > p { color: var(--slate-700); font-size: .86rem; }
.report-actions { justify-content: flex-end; }

.correction-settings {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 210px;
    align-items: end;
    gap: 25px;
    margin-bottom: 18px;
    padding: 20px;
    border: 1px solid #bfdde9;
    border-radius: 16px;
    background: #eef7fa;
}
.correction-settings h2 { margin: 0; color: var(--navy-950); font-size: 1.25rem; }
.correction-settings p:not(.eyebrow) { margin: 6px 0 0; color: var(--slate-700); font-size: .82rem; }
.unit-choice { margin: 0; }
.factor-field { display: grid; gap: 5px; color: var(--slate-600); font-size: .72rem; font-weight: 750; }
.factor-field .factor-input-wrap input { font-size: 1rem; }

.edit-correction-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 12px;
    padding: 13px;
    border-radius: 14px;
    background: #eef7fa;
}
.edit-correction-grid .field { margin-top: 0; }
.edit-calculation { grid-template-columns: repeat(5, minmax(90px, 1fr)); }
.edit-pen-total { background: var(--teal-100); }

.quick-layout {
    display: grid;
    grid-template-columns: minmax(280px, 350px) minmax(0, 1fr);
    align-items: start;
    gap: 24px;
}
.quick-form { position: sticky; top: 24px; padding: 20px; }
.quick-form textarea { width: 100%; resize: vertical; padding: 12px; border: 1px solid var(--slate-300); border-radius: 10px; font: inherit; }
.quick-preview { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding: 12px; border-radius: 11px; color: var(--slate-700); background: var(--teal-100); }
.quick-preview strong { color: #075d57; font-size: 1.2rem; }
.quick-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 15px; }
.quick-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.quick-list-heading h2 { margin: 0; color: var(--navy-950); }
.quick-list { display: grid; gap: 10px; }
.quick-card { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--slate-200); border-radius: 15px; background: #fff; box-shadow: 0 8px 25px rgba(13, 49, 80, .05); }
.quick-ke { min-height: 62px; display: grid; place-content: center; border-radius: 13px; color: #075d57; background: var(--teal-100); text-align: center; }
.quick-ke strong { font-size: 1.45rem; line-height: 1; }
.quick-ke span { margin-top: 2px; font-size: .7rem; font-weight: 800; }
.quick-card-content h3 { margin: 0; color: var(--navy-950); font-size: 1rem; }
.quick-card-content p { margin: 4px 0; color: var(--slate-700); font-size: .8rem; }
.quick-card-content small { display: block; color: var(--slate-500); font-size: .7rem; }
.quick-card-actions { display: flex; align-items: center; gap: 6px; }
.quick-delete { width: 38px; height: 38px; border: 1px solid #efc1c5; border-radius: 10px; color: var(--red-600); background: var(--red-100); font-size: 1.2rem; }
.quick-warning { max-width: 900px; }

.analysis-heading { max-width: 860px; }
.analysis-controls {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
}
.analysis-presets { display: flex; flex-wrap: wrap; gap: 7px; }
.analysis-preset {
    min-height: 42px;
    padding: 8px 13px;
    border: 1px solid var(--slate-300);
    border-radius: 10px;
    color: var(--slate-700);
    background: #fff;
    font-size: .82rem;
    font-weight: 800;
}
.analysis-preset:hover,
.analysis-preset.is-active {
    border-color: #73c9c1;
    color: #075d57;
    background: var(--teal-100);
}
.analysis-range-form { display: flex; align-items: end; gap: 9px; }
.analysis-range-form label { display: grid; gap: 4px; color: var(--slate-500); font-size: .72rem; font-weight: 800; }
.analysis-range-form input { min-height: 42px; padding: 8px 10px; }
.analysis-range-form .button { min-height: 42px; }
.analysis-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 14px 0;
}
.analysis-stats article {
    min-width: 0;
    padding: 16px 18px;
    border: 1px solid var(--slate-200);
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(13, 49, 80, .045);
}
.analysis-stats span,
.analysis-stats strong { display: block; }
.analysis-stats span { color: var(--slate-500); font-size: .72rem; font-weight: 750; }
.analysis-stats strong { margin-top: 4px; overflow-wrap: anywhere; color: var(--navy-950); font-size: clamp(1.15rem, 2vw, 1.65rem); line-height: 1.1; }
.analysis-chart-card {
    width: 100%;
    padding: 22px;
    overflow: hidden;
}
.analysis-chart-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.analysis-chart-heading h2 { margin: 0; color: var(--navy-950); font-size: 1.35rem; }
.analysis-chart-heading .eyebrow { margin-bottom: 3px; }
.analysis-chart { width: 100%; border: 1px solid #d8e7ed; border-radius: 16px; background: linear-gradient(180deg, #f8fcfd, #fff); overflow: hidden; }
.analysis-chart svg { width: 100%; height: auto; display: block; }
.analysis-grid-line { stroke: #dbe7ec; stroke-width: 1; }
.analysis-tick-line { stroke: #edf3f5; stroke-width: 1; }
.analysis-axis-label { fill: #718095; font-size: 12px; font-weight: 700; }
.analysis-y-label { font-size: 11px; }
.analysis-unit-label { fill: #405265; font-size: 12px; font-weight: 800; }
.analysis-area { fill: rgba(22, 114, 168, .1); }
.analysis-line { fill: none; stroke: var(--blue-600); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.analysis-point { cursor: pointer; outline: none; }
.analysis-point-hit { fill: transparent; }
.analysis-point-dot { fill: #fff; stroke: var(--teal-600); stroke-width: 4; transition: fill .16s ease, r .16s ease; }
.analysis-point:hover .analysis-point-dot,
.analysis-point:focus .analysis-point-dot,
.analysis-point.is-selected .analysis-point-dot { fill: #18a398; stroke: #075d57; }
.analysis-empty { padding: 56px 20px; border: 1px dashed var(--slate-300); border-radius: 15px; color: var(--slate-500); background: #fbfcfd; text-align: center; }
.analysis-detail {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 12px;
    border: 1px solid #c8e6e2;
    border-radius: 14px;
    background: var(--teal-100);
    overflow: hidden;
}
.analysis-detail > div { min-width: 0; padding: 13px 15px; }
.analysis-detail > div + div { border-left: 1px solid #c8e6e2; }
.analysis-detail span,
.analysis-detail strong { display: block; }
.analysis-detail span { color: #36726e; font-size: .68rem; font-weight: 750; }
.analysis-detail strong { margin-top: 3px; overflow-wrap: anywhere; color: #063e3a; font-size: .87rem; }
.analysis-rankings {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}
.analysis-ranking-card { min-width: 0; padding: 21px; }
.analysis-ranking-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.analysis-ranking-card h2 { margin: 0; color: var(--navy-950); font-size: 1.22rem; }
.analysis-ranking-card .eyebrow { margin-bottom: 3px; }
.analysis-ranking-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.analysis-ranking-list li {
    min-width: 0;
    min-height: 49px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 8px 11px;
    border: 1px solid var(--slate-200);
    border-radius: 12px;
    background: #fbfcfd;
}
.analysis-rank-number {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: var(--slate-700);
    background: var(--slate-100);
    font-size: .78rem;
    font-weight: 850;
}
.analysis-ranking-list li:nth-child(1) .analysis-rank-number { color: #795300; background: #fff0b8; }
.analysis-ranking-list li:nth-child(2) .analysis-rank-number { color: #56616d; background: #e7edf2; }
.analysis-ranking-list li:nth-child(3) .analysis-rank-number { color: #824a27; background: #f5dfd0; }
.analysis-rank-name { min-width: 0; overflow: hidden; color: var(--slate-900); font-size: .88rem; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.analysis-ranking-list strong { color: var(--navy-900); font-size: .86rem; white-space: nowrap; }
.analysis-ranking-list .analysis-ranking-empty {
    min-height: 110px;
    display: grid;
    grid-template-columns: 1fr;
    place-items: center;
    color: var(--slate-500);
    border-style: dashed;
    text-align: center;
    font-size: .82rem;
    font-weight: 600;
}

.auth-body {
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 20% 10%, rgba(24, 163, 152, 0.2), transparent 32%),
        radial-gradient(circle at 90% 95%, rgba(22, 114, 168, 0.22), transparent 35%),
        linear-gradient(145deg, #071d30, #0d3150);
}

.auth-shell {
    width: min(100%, 450px);
}

.auth-card {
    padding: 34px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.24);
}

.auth-card .brand-mark {
    margin-bottom: 25px;
}

.auth-card h1 {
    margin: 0;
    color: var(--navy-950);
    font-size: 2rem;
    letter-spacing: -0.04em;
}

.auth-copy {
    margin: 11px 0 21px;
    color: var(--slate-700);
    font-size: 0.92rem;
}

.stack-form {
    display: grid;
    gap: 4px;
}

.remember-login {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin: 7px 0 13px;
    padding: 12px 13px;
    color: var(--slate-700);
    border: 1px solid var(--slate-200);
    border-radius: 12px;
    background: #f8fbfc;
    cursor: pointer;
}

.remember-login input {
    flex: 0 0 auto;
    width: 20px;
    min-height: 20px;
    margin: 1px 0 0;
    accent-color: var(--teal-600);
}

.remember-login strong,
.remember-login small {
    display: block;
}

.remember-login strong {
    color: var(--navy-950);
    font-size: 0.84rem;
}

.remember-login small {
    margin-top: 2px;
    color: var(--slate-500);
    font-size: 0.72rem;
    line-height: 1.4;
}

.privacy-note {
    margin: 19px 0 0;
    color: var(--slate-500);
    font-size: 0.72rem;
    text-align: center;
}

@media (max-width: 900px) {
    .calculator-layout {
        grid-template-columns: 1fr;
    }

    .summary-card {
        position: static;
    }

    .factor-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quick-layout {
        grid-template-columns: 1fr;
    }

    .quick-form {
        position: static;
    }

    .analysis-controls { align-items: stretch; flex-direction: column; }
    .analysis-range-form { justify-content: flex-end; }
    .analysis-detail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .analysis-detail > div + div { border-left: 0; }
    .analysis-detail > div:nth-child(even) { border-left: 1px solid #c8e6e2; }
    .analysis-detail > div:nth-child(n + 3) { border-top: 1px solid #c8e6e2; }
}

@media (max-width: 620px) {
    .page-shell,
    .topbar-inner {
        width: min(100% - 22px, 1160px);
    }

    .topbar > .topbar-inner {
        min-height: 58px;
    }

    .brand small {
        display: none;
    }

    .brand-mark-small {
        width: 36px;
        height: 36px;
    }

    .button-ghost {
        min-height: 38px;
        padding-inline: 10px;
        font-size: 0.78rem;
    }

    .nav-link {
        flex: 0 0 auto;
        padding-inline: 8px;
        text-align: center;
        font-size: 0.83rem;
    }

    .nav-inner {
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .nav-inner::-webkit-scrollbar { display: none; }

    .page-main {
        padding-top: 25px;
        padding-bottom: calc(34px + var(--safe-bottom));
    }

    .page-heading h1 {
        font-size: 2.05rem;
    }

    .page-heading p:not(.eyebrow) {
        font-size: 0.92rem;
    }

    .builder-card,
    .summary-card {
        padding: 18px;
        border-radius: 17px;
    }

    .section-title-row {
        align-items: flex-start;
    }

    .section-title-row h2 {
        font-size: 1.08rem;
    }

    .factor-pill {
        max-width: 135px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .field-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    input,
    select {
        min-height: 52px;
        font-size: 16px;
    }

    .history-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .date-navigator {
        width: 100%;
        flex-wrap: wrap;
    }

    .report-button {
        width: 100%;
    }

    .date-navigator label {
        flex: 1;
    }

    .date-navigator input {
        width: 100%;
    }

    .history-card {
        grid-template-columns: 58px minmax(0, 1fr);
        gap: 11px;
        padding: 14px;
    }

    .history-actions {
        grid-column: 2;
        justify-content: flex-end;
    }

    .edit-dialog {
        width: 100%;
        max-width: none;
        max-height: 94vh;
        margin: auto 0 0;
        border-radius: 22px 22px 0 0;
    }

    .edit-form {
        max-height: 94vh;
        padding: 20px 14px calc(20px + var(--safe-bottom));
    }

    .edit-meta-grid,
    .edit-correction-grid,
    .edit-bottom-grid {
        grid-template-columns: 1fr;
    }

    .edit-item-row {
        grid-template-columns: 1fr 1fr 42px;
    }

    .edit-item-row .edit-name-field {
        grid-column: 1 / -1;
    }

    .edit-item-row .edit-item-remove {
        grid-column: 3;
    }

    .edit-bottom-grid {
        gap: 10px;
    }

    .edit-calculation {
        min-width: 0;
        grid-template-columns: repeat(2, 1fr);
    }

    .edit-calculation > div + div { border-left: 0; }
    .edit-calculation > div { border-bottom: 1px solid var(--slate-200); }
    .edit-calculation .edit-pen-total { grid-column: 1 / -1; }

    .dialog-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .dialog-actions > div {
        align-items: stretch;
    }

    .dialog-actions > div .button {
        flex: 1;
    }

    .factor-grid {
        grid-template-columns: 1fr;
    }

    .correction-settings {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .meal-type-choices {
        grid-template-columns: 1fr 1fr;
    }

    .quick-card {
        grid-template-columns: 62px minmax(0, 1fr);
        gap: 10px;
    }

    .quick-card-actions {
        grid-column: 2;
        justify-content: flex-end;
    }

    .analysis-controls,
    .analysis-chart-card,
    .analysis-ranking-card { padding: 15px; border-radius: 17px; }
    .analysis-presets { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; }
    .analysis-preset { min-width: 0; padding-inline: 5px; }
    .analysis-range-form { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
    .analysis-range-form .button { grid-column: 1 / -1; }
    .analysis-range-form input { width: 100%; }
    .analysis-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .analysis-stats article { padding: 13px; }
    .analysis-chart-heading { align-items: flex-start; flex-direction: column; }
    .analysis-chart-heading .count-badge { align-self: flex-start; }
    .analysis-detail { grid-template-columns: 1fr; }
    .analysis-detail > div:nth-child(even) { border-left: 0; }
    .analysis-detail > div + div,
    .analysis-detail > div:nth-child(n + 3) { border-top: 1px solid #c8e6e2; }
    .analysis-rankings { grid-template-columns: 1fr; }
    .analysis-ranking-card h2 { font-size: 1.1rem; }

    .report-dialog {
        width: 100%;
        max-width: none;
        margin: auto 0 0;
        border-radius: 20px 20px 0 0;
    }

    .factor-card {
        padding: 16px;
    }

    .factor-label {
        min-height: auto;
    }

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

    .auth-body {
        padding: 13px;
    }

    .auth-card {
        padding: 25px 20px;
        border-radius: 21px;
    }
}

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

/* Glupilot 2.0 · Landingpage und Mehrbenutzer-Administration */
textarea {
    width: 100%;
    font: inherit;
    resize: vertical;
}

.alert-success {
    color: #12633f;
    border-color: #a7dcc0;
    background: #e8f7ef;
}

.account-actions,
.account-name {
    display: flex;
    align-items: center;
}

.account-actions { gap: 14px; }
.account-name { align-items: flex-end; flex-direction: column; line-height: 1.15; }
.account-name small { color: #9eb8ca; font-size: 0.68rem; }
.account-name strong { max-width: 190px; overflow: hidden; color: #fff; font-size: 0.86rem; text-overflow: ellipsis; white-space: nowrap; }
.nav-link-admin { margin-left: auto; color: #aee9e3; }

.landing-body {
    background: #f6f8f9;
}

.landing-header {
    position: absolute;
    inset: 0 0 auto;
    z-index: 20;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(180deg, rgba(5, 25, 40, 0.64), transparent);
}

.landing-nav {
    width: min(1240px, calc(100% - 48px));
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-inline: auto;
}

.landing-brand small { color: rgba(255, 255, 255, 0.72); }
.landing-nav-actions { display: flex; align-items: center; gap: 22px; }
.landing-text-link { color: #fff; font-size: 0.9rem; font-weight: 750; text-decoration: none; }

.landing-hero {
    position: relative;
    min-height: 790px;
    display: flex;
    align-items: center;
    overflow: hidden;
    color: #fff;
    background: var(--navy-950);
}

.landing-hero > img,
.landing-hero-shade {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.landing-hero > img { object-fit: cover; object-position: center; }
.landing-hero-shade { background: linear-gradient(90deg, rgba(5, 25, 40, 0.96) 0%, rgba(5, 25, 40, 0.85) 34%, rgba(5, 25, 40, 0.2) 72%, rgba(5, 25, 40, 0.08)); }

.landing-hero-content {
    position: relative;
    z-index: 2;
    width: min(1240px, calc(100% - 48px));
    margin: 70px auto 0;
}

.landing-kicker {
    margin: 0 0 18px;
    color: #91e0d9;
    font-size: 0.77rem;
    font-weight: 850;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.landing-hero h1 {
    max-width: 760px;
    margin: 0;
    color: #fff;
    font-size: clamp(3.1rem, 6.7vw, 6.3rem);
    font-weight: 790;
    letter-spacing: -0.065em;
    line-height: 0.96;
}

.landing-hero-content > p:not(.landing-kicker) {
    max-width: 610px;
    margin: 27px 0 0;
    color: #d7e4ec;
    font-size: clamp(1.02rem, 1.4vw, 1.22rem);
    line-height: 1.65;
}

.landing-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.landing-button-light { color: #fff; border: 1px solid rgba(255, 255, 255, 0.45); background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(8px); }
.landing-button-light:hover { background: rgba(255, 255, 255, 0.18); }
.landing-trust-list { display: flex; flex-wrap: wrap; gap: 12px 26px; padding: 0; margin: 34px 0 0; color: #c8d7e1; list-style: none; font-size: 0.82rem; font-weight: 700; }
.landing-trust-list li::before { margin-right: 8px; color: #59cec4; content: "✓"; }
.landing-alert { margin-top: 24px; }

.landing-section {
    width: min(1160px, calc(100% - 40px));
    padding: 108px 0;
    margin-inline: auto;
}

.landing-section-heading { max-width: 760px; margin-bottom: 48px; }
.landing-story-heading { max-width: 940px; }
.landing-section-heading h2,
.landing-mobile-copy h2,
.landing-request-copy h2 { margin: 0; color: var(--navy-950); font-size: clamp(2.1rem, 4vw, 4rem); letter-spacing: -0.052em; line-height: 1.05; }
.landing-section-heading > p:not(.eyebrow),
.landing-mobile-copy > p:not(.eyebrow):not(.landing-medical-note),
.landing-request-copy > p:not(.eyebrow):not(.landing-request-hint) { color: var(--slate-700); font-size: 1.08rem; line-height: 1.7; }
.landing-section-heading > p:not(.eyebrow) { margin: 22px 0 0; }
.landing-section-heading > p:not(.eyebrow) + p:not(.eyebrow) { margin-top: 14px; }

.landing-feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.landing-feature-grid article { min-height: 255px; padding: 30px; border: 1px solid #dbe4e9; border-radius: 24px; background: #fff; box-shadow: 0 18px 60px rgba(13, 49, 80, 0.06); }
.landing-feature-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; color: #087b72; background: var(--teal-100); font-size: 0.82rem; font-weight: 900; }
.landing-feature-grid h3 { margin: 42px 0 9px; color: var(--navy-950); font-size: 1.3rem; letter-spacing: -0.025em; }
.landing-feature-grid p { margin: 0; color: var(--slate-700); line-height: 1.65; }

.landing-mobile-section {
    width: min(1240px, calc(100% - 40px));
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: stretch;
    margin: 0 auto 110px;
    overflow: hidden;
    border-radius: 34px;
    background: var(--navy-950);
    box-shadow: 0 30px 80px rgba(7, 29, 48, 0.18);
}

.landing-mobile-image { min-height: 640px; }
.landing-mobile-image img { width: 100%; height: 100%; display: block; object-fit: cover; }
.landing-mobile-copy { display: flex; justify-content: center; flex-direction: column; padding: clamp(38px, 6vw, 86px); }
.landing-mobile-copy .eyebrow { color: #72d9d0; }
.landing-mobile-copy h2 { color: #fff; }
.landing-mobile-copy > p:not(.eyebrow):not(.landing-medical-note) { color: #c8d9e4; }
.landing-proof-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 30px; }
.landing-proof-grid div { padding: 18px 12px; border: 1px solid rgba(255,255,255,0.12); border-radius: 16px; background: rgba(255,255,255,0.05); }
.landing-proof-grid strong,
.landing-proof-grid span { display: block; }
.landing-proof-grid strong { color: #72d9d0; font-size: 1.55rem; }
.landing-proof-grid span { margin-top: 4px; color: #b7cad7; font-size: 0.75rem; font-weight: 700; }
.landing-medical-note { margin: 26px 0 0; color: #8fa9b9; font-size: 0.77rem; line-height: 1.6; }

.landing-request-section {
    width: min(1160px, calc(100% - 40px));
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(360px, 0.7fr);
    gap: 72px;
    align-items: center;
    padding: 30px 0 120px;
    margin-inline: auto;
    scroll-margin-top: 30px;
}

.landing-request-hint { padding-left: 15px; border-left: 3px solid #32a99f; color: var(--slate-500); font-size: 0.85rem; }
.landing-request-form { display: grid; gap: 15px; padding: 28px; border: 1px solid var(--slate-200); border-radius: 24px; background: #fff; box-shadow: var(--shadow); }
.landing-request-form textarea { min-height: 112px; padding: 13px; color: var(--slate-900); border: 1px solid var(--slate-300); border-radius: 10px; background: #fff; }
.landing-request-form textarea:focus { border-color: var(--blue-600); outline: 3px solid rgba(22, 114, 168, 0.12); }
.landing-honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.landing-footer { color: #b9ccd8; background: var(--navy-950); }
.landing-footer > div { width: min(1160px, calc(100% - 40px)); min-height: 130px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-inline: auto; }
.landing-footer p { margin: 0; font-size: 0.84rem; }
.auth-back { position: absolute; top: 25px; left: 28px; color: #fff; font-size: 0.84rem; font-weight: 750; text-decoration: none; }
.auth-shell-multi { position: relative; padding-block: 70px; }

.admin-heading { max-width: 820px; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 20px; }
.admin-create-card,
.admin-summary-card { padding: 26px; }
.admin-setup-card { width: min(620px, 100%); }
.admin-create-card { display: grid; gap: 14px; }
.admin-create-card h2,
.admin-summary-card h2,
.admin-section-heading h2 { margin: 0; color: var(--navy-950); letter-spacing: -0.035em; }
.admin-form-note { margin: 0; color: var(--slate-500); font-size: 0.76rem; line-height: 1.55; }
.admin-summary-card { color: #d8e6ee; background: linear-gradient(145deg, var(--navy-950), var(--navy-800)); }
.admin-summary-card h2 { color: #fff; font-size: 2rem; }
.admin-summary-card > p:last-child { margin-top: 24px; color: #adbfcb; line-height: 1.6; }
.admin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 28px; }
.admin-stats div { padding: 16px; border: 1px solid rgba(255,255,255,0.12); border-radius: 14px; background: rgba(255,255,255,0.05); }
.admin-stats strong,
.admin-stats span { display: block; }
.admin-stats strong { color: #77dcd3; font-size: 1.7rem; }
.admin-stats span { margin-top: 3px; color: #b7cad7; font-size: 0.75rem; }

.admin-user-section,
.admin-request-section { margin-top: 48px; }
.admin-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.admin-user-list,
.admin-request-list { display: grid; gap: 12px; }
.admin-user-card { padding: 20px; }
.admin-user-head,
.admin-user-footer,
.admin-request-content,
.admin-request-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.admin-user-head > div { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.admin-user-head > div > strong { color: var(--navy-950); font-size: 1.08rem; }
.admin-user-head small,
.admin-user-footer span,
.admin-request-content time { color: var(--slate-500); font-size: 0.75rem; }
.status-pill { display: inline-flex; padding: 4px 8px; border-radius: 999px; color: var(--slate-700); background: var(--slate-100); font-size: 0.68rem; font-weight: 800; }
.status-active { color: #11603d; background: var(--green-100); }
.status-disabled { color: #9b2932; background: var(--red-100); }
.status-admin { color: #085e7b; background: var(--blue-100); }
.admin-user-fields { display: grid; grid-template-columns: 1.2fr 0.7fr 1fr; gap: 12px; margin-top: 16px; }
.admin-user-footer { padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--slate-200); }
.admin-request-card { padding: 20px; }
.admin-request-card.is-processed { opacity: 0.68; }
.admin-request-content > div { display: flex; flex-direction: column; }
.admin-request-content a { color: var(--blue-600); font-size: 0.85rem; }
.admin-request-card > p { margin: 14px 0; color: var(--slate-700); }
.admin-request-actions { justify-content: flex-end; }
.admin-empty { padding: 28px; color: var(--slate-500); text-align: center; }

@media (max-width: 900px) {
    .landing-text-link { display: none; }
    .landing-hero { min-height: 740px; }
    .landing-hero-shade { background: linear-gradient(90deg, rgba(5,25,40,0.93), rgba(5,25,40,0.74) 60%, rgba(5,25,40,0.35)); }
    .landing-feature-grid { grid-template-columns: 1fr; }
    .landing-feature-grid article { min-height: 0; }
    .landing-mobile-section { grid-template-columns: 0.85fr 1.15fr; }
    .landing-request-section { grid-template-columns: 1fr 1fr; gap: 32px; }
    .admin-grid { grid-template-columns: 1fr; }
    .admin-user-fields { grid-template-columns: 1fr 1fr; }
    .admin-user-fields .field:last-child { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
    .account-name { display: none; }
    .nav-link-admin { margin-left: 0; }
    .landing-nav { width: calc(100% - 28px); min-height: 72px; }
    .landing-nav-actions .button { padding-inline: 13px; }
    .landing-hero { min-height: 720px; align-items: flex-end; }
    .landing-hero > img { object-position: 64% center; }
    .landing-hero-shade { background: linear-gradient(180deg, rgba(5,25,40,0.28) 10%, rgba(5,25,40,0.9) 55%, rgba(5,25,40,0.99)); }
    .landing-hero-content { width: calc(100% - 32px); padding-bottom: 42px; margin-top: 100px; }
    .landing-hero h1 { font-size: clamp(2.75rem, 14vw, 4.2rem); }
    .landing-hero-content > p:not(.landing-kicker) { font-size: 0.98rem; }
    .landing-hero-actions { display: grid; }
    .landing-hero-actions .button { width: 100%; }
    .landing-trust-list { display: grid; gap: 7px; }
    .landing-section { padding: 76px 0; }
    .landing-section-heading { margin-bottom: 28px; }
    .landing-feature-grid article { padding: 24px; }
    .landing-feature-grid h3 { margin-top: 30px; }
    .landing-mobile-section { width: calc(100% - 24px); grid-template-columns: 1fr; margin-bottom: 80px; border-radius: 24px; }
    .landing-mobile-image { min-height: 430px; max-height: 55vh; }
    .landing-mobile-copy { padding: 34px 22px; }
    .landing-proof-grid { grid-template-columns: 1fr 1fr 1fr; }
    .landing-proof-grid strong { font-size: 1.22rem; }
    .landing-request-section { grid-template-columns: 1fr; padding-bottom: 80px; }
    .landing-request-form { padding: 20px; }
    .landing-footer > div { align-items: flex-start; flex-direction: column; justify-content: center; }
    .auth-back { top: 16px; left: 18px; }
    .admin-create-card,
    .admin-summary-card { padding: 20px; }
    .admin-stats { grid-template-columns: 1fr; }
    .admin-user-head,
    .admin-user-footer,
    .admin-request-content { align-items: flex-start; flex-direction: column; }
    .admin-user-fields { grid-template-columns: 1fr; }
    .admin-user-fields .field:last-child { grid-column: auto; }
    .admin-user-footer .button { width: 100%; }
    .admin-request-actions { align-items: stretch; flex-direction: column; }
    .admin-request-actions form,
    .admin-request-actions .button { width: 100%; }
}
