@font-face {
    font-family: Cairo;
    src: url('../fonts/Cairo-Variable.ttf') format('truetype');
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
}
:root {
    --color-brand: #8a2a2b;
    --color-brand-hover: #732124;
    --color-brand-pressed: #59191a;
    --color-canvas: #eeebe8;
    --color-surface: #fbf9f6;
    --color-text: #302321;
    --color-muted: #705c55;
    --color-border: #ded5ce;
    --color-beige: #e9d2be;
    --color-on-brand: #fff9f2;
    --color-accent: #ffc197;
    --color-nav-selected: #a14746;
    --color-nav-divider: #bd8176;
    --color-disabled: #e4ddd7;
    --color-negative: #b72b33;
    --color-positive: #47701f;
    --color-success-tint: #ecf1e7;
    --color-warning-tint: #f8eddc;
    --color-danger-tint: #faedec;
    --space-4: 4px; --space-8: 8px; --space-12: 12px; --space-16: 16px;
    --space-20: 20px; --space-24: 24px; --space-32: 32px; --space-40: 40px;
    --radius-control: 8px; --radius-card: 12px; --radius-pill: 999px;
    font-family: Cairo, 'Segoe UI', sans-serif;
    color: var(--color-text); background: var(--color-canvas);
    font-size: 16px; line-height: 1.5; font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
.field input[type=number], .field input[data-decimal=true] { text-align: left; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
button:disabled { cursor: not-allowed; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
h1 { font-size: 44px; line-height: 56px; font-weight: 800; }
h2 { font-size: 24px; line-height: 32px; font-weight: 700; }
p, .small { color: var(--color-muted); }
.small { font-size: 14px; line-height: 20px; }
:where(a, button, input):focus-visible { outline: 3px solid var(--color-text); outline-offset: 3px; }
.brand { display: flex; flex-direction: column; gap: var(--space-4); flex: none; }
.brand img, .ui-icon { display: block; flex: none; }
.brand span { color: var(--color-on-brand); font-weight: 700; font-size: 14px; line-height: 20px; text-align: center; letter-spacing: 4px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-8); min-height: 48px; min-width: 168px; max-width: 100%; padding: 11px var(--space-12); border: 1px solid transparent; border-radius: var(--radius-control); font-size: 16px; line-height: 24px; font-weight: 600; text-align: center; text-decoration: none; }
.primary { color: var(--color-on-brand); background: var(--color-brand); }
.primary:hover { background: var(--color-brand-hover); }
.primary:active { background: var(--color-brand-pressed); }
.secondary { color: var(--color-text); background: var(--color-surface); border-color: var(--color-border); }
.secondary:hover, .secondary:active { background: var(--color-beige); }
.secondary:focus-visible { outline-color: var(--color-brand); }
.button:disabled { color: var(--color-muted); background: var(--color-disabled); }
.button[aria-busy=true] { color: var(--color-on-brand); background: var(--color-brand); cursor: wait; }
.button.secondary[aria-busy=true] { color: var(--color-text); background: var(--color-surface); }
.icon-button { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 48px; height: 48px; padding: 12px; border: 0; border-radius: var(--radius-control); background: var(--color-surface); }
.icon-button:hover, .icon-button:active { background: var(--color-beige); }
.icon-button:disabled { opacity: .45; }
.icon-button.on-brand { background: transparent; }
.icon-button.on-brand:hover { background: var(--color-nav-selected); }
.on-brand:focus-visible, .nav-item:focus-visible { outline-color: var(--color-accent); }
.field { display: flex; flex-direction: column; gap: var(--space-4); }
.field label { font-size: 18px; line-height: 26px; font-weight: 600; }
.field input { width: 100%; min-height: 48px; padding: 11px var(--space-12); color: var(--color-text); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-control); }
.field input:hover { border-color: var(--color-muted); }
.field input:focus-visible { outline: 2px solid var(--color-brand); outline-offset: -2px; }
.field input:disabled { background: var(--color-disabled); }
.field-helper { min-height: 20px; font-size: 14px; line-height: 20px; color: var(--color-muted); }
.field-invalid input { border-color: var(--color-negative); }
.field-invalid .field-helper { color: var(--color-brand); }
.notice { padding: var(--space-16); border: 1px solid var(--color-border); border-radius: var(--radius-control); background: var(--color-surface); }
.notice strong { font-weight: 600; }
.notice.success { background: var(--color-success-tint); }
.notice.warning { background: var(--color-warning-tint); }
.notice.error { background: var(--color-danger-tint); border-color: var(--color-negative); }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 10; padding: 12px; background: var(--color-surface); }
.skip-link:focus { top: 12px; }
.workspace { display: flex; min-height: 100dvh; }
.desktop-sidebar { width: 280px; flex: none; background: var(--color-brand); }
.sidebar-content { display: flex; flex-direction: column; gap: var(--space-32); align-items: center; min-height: 100dvh; padding: 32px 16px 24px; color: var(--color-on-brand); }
.desktop-sidebar .sidebar-content { position: sticky; top: 0; height: 100dvh; overflow-y: auto; }
.sidebar-content nav, .sidebar-bottom { width: 248px; max-width: 100%; flex-shrink: 0; }
.sidebar-content nav { display: flex; flex-direction: column; gap: var(--space-4); }
.nav-item { width: 100%; display: flex; align-items: center; gap: var(--space-16); min-height: 56px; padding: 14px var(--space-16); position: relative; color: var(--color-on-brand); background: transparent; border: 0; border-radius: var(--radius-control); font-size: 20px; line-height: 28px; text-decoration: none; text-align: left; }
.nav-item.selected, .nav-item:hover { background: var(--color-nav-selected); }
.nav-item.selected::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 4px; background: var(--color-accent); }
.nav-item:disabled { opacity: .45; background: transparent; }
.coming-next { font-size: 14px; line-height: 20px; color: var(--color-on-brand); opacity: .75; }
.sidebar-bottom { display: flex; flex-direction: column; gap: var(--space-8); margin-top: auto; }
.nav-divider { height: 1px; background: var(--color-nav-divider); }
.profile { display: flex; align-items: center; gap: var(--space-12); min-height: 72px; padding: var(--space-8) 0; }
.avatar { width: 48px; height: 48px; flex: none; border-radius: var(--radius-pill); display: inline-flex; align-items: center; justify-content: center; background: var(--color-beige); color: var(--color-text); font-weight: 600; }
.profile-text { display: flex; flex-direction: column; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.profile-text .small { color: var(--color-on-brand); }
.profile-branch, .profile-name { font-weight: 600; }
.workspace-main { flex: 1; min-width: 0; }
#main-content { position: relative; }
.navigation-toggle { display: none; background: var(--color-brand); }
.navigation-toggle:hover, .navigation-toggle:active { background: var(--color-brand-hover); }
.dashboard-content { display: flex; flex-direction: column; gap: var(--space-16); padding: var(--space-24); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-12); }
.metric-card { display: flex; flex-direction: column; gap: var(--space-4); min-height: 128px; padding: 16px; border: 1px solid var(--color-border); border-radius: var(--radius-card); background: var(--color-surface); }
.metric-card h2 { font-size: 16px; line-height: 24px; font-weight: 600; }
.metric-value { color: var(--color-text); font-size: 32px; line-height: 40px; font-weight: 700; }
.panel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-16); }
.empty-panel { display: flex; flex-direction: column; gap: var(--space-8); min-height: 248px; padding: var(--space-20); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-card); }
.detail-panel { min-height: 216px; }
.empty-message { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: var(--space-8); text-align: center; padding: 12px 0; }
.empty-panel h2, .empty-message p { overflow-wrap: anywhere; }
.navigation-dialog { position: fixed; inset: 0; width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: var(--color-text); overflow-y: auto; }
.navigation-dialog::backdrop { background: rgb(48 35 33 / .28); }
.mobile-sidebar { width: min(312px, calc(100% - 78px)); min-height: 100%; background: var(--color-brand); }
.mobile-sidebar .sidebar-content { min-height: 100dvh; }
.drawer-close { position: fixed; left: min(326px, calc(100% - 64px)); top: 16px; }
.drawer-open, .drawer-open body { overflow: hidden; }
.access-layout { display: grid; grid-template-columns: 1fr 2fr; min-height: 100dvh; }
.access-brand { display: flex; flex-direction: column; gap: var(--space-32); padding: 48px; background: var(--color-brand); }
.access-mobile-brand { display: none; }
.access-desktop-brand { width: 272px; }
.brand-story { display: flex; flex-direction: column; gap: 40px; margin-top: auto; }
.brand-story p { color: var(--color-on-brand); font-size: 44px; line-height: 56px; font-weight: 800; }
.brand-story span { color: var(--color-on-brand); font-size: 14px; line-height: 20px; }
.access-main { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: var(--space-24); padding: var(--space-40); min-width: 0; }
.access-card { display: flex; flex-direction: column; align-items: center; gap: var(--space-20); width: 480px; max-width: 100%; padding: var(--space-40); border: 1px solid var(--color-border); border-radius: var(--radius-card); background: var(--color-surface); text-align: center; }
.eyebrow { color: var(--color-brand); font-size: 14px; line-height: 20px; }
.access-card h1 { font-size: 32px; line-height: 42px; font-weight: 700; }
.access-note { border-top: 1px solid var(--color-border); padding-top: var(--space-20); width: 100%; font-size: 14px; line-height: 20px; color: var(--color-muted); }
.access-action { min-width: 208px; }
.google-button { display: inline-flex; align-items: center; min-height: 48px; flex: none; }
.google-button img { display: block; width: 180px; height: 40px; }
.startup-layout { min-height: 100dvh; display: flex; flex-direction: column; background: var(--color-canvas); }
.startup-header { height: 88px; flex: none; display: flex; align-items: center; padding: var(--space-24); background: var(--color-brand); }
.startup-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-16); padding: var(--space-20); }
.state-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-12); width: 560px; max-width: 100%; min-height: 312px; padding: var(--space-24); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-card); text-align: center; }
.workspace-main > main > .state-panel { margin: 24px auto; width: calc(100% - 48px); max-width: 560px; }
.state-symbol { display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--radius-control); background: var(--color-beige); }
#blazor-error-ui { display: none; position: fixed; inset: 0; z-index: 1000; }
#blazor-error-ui .startup-main { min-height: calc(100dvh - 88px); }
@media (max-width: 1099px) {
    .desktop-sidebar { display: none; }
    .navigation-toggle { display: inline-flex; position: absolute; top: 24px; left: 24px; }
    /* Share the existing first content row; no banner height or sticky offset. */
    .dashboard-content > .page-heading, .ingredients-content > .back-link:first-child,
    .ingredients-content > .module-heading:first-child > div:first-child { margin-left: 64px; min-height: 48px; }
    .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--space-16); }
    .access-layout { grid-template-columns: minmax(300px, 1fr) 2fr; }
    .access-brand { padding: 32px; }
    .access-desktop-brand { display: none; }
    .access-mobile-brand { display: flex; }
    .brand-story p { font-size: 32px; line-height: 42px; }
    .access-main { padding: var(--space-24); }
}
@media (max-width: 699px) {
    .navigation-toggle { top: 16px; left: 16px; }
    .dashboard-content { padding: var(--space-20); }
    h1 { font-size: 32px; line-height: 42px; font-weight: 700; }
    .panel-grid { grid-template-columns: minmax(0, 1fr); }
    .empty-panel { min-height: 232px; padding: var(--space-16); }
    .detail-panel { min-height: 216px; }
    .access-layout { display: flex; flex-direction: column; }
    .access-brand { height: 176px; padding: var(--space-24); justify-content: center; align-items: center; }
    .brand-story { display: none; }
    .access-main { justify-content: flex-start; padding: 32px 20px 20px; }
    .access-card { padding: var(--space-24); width: 350px; }
    .state-panel { min-height: 352px; }
}
@media (max-width: 359px) {
    .dashboard-content { padding: 16px; }
    .metrics { grid-template-columns: minmax(0, 1fr); }
    .access-main { padding-left: 16px; padding-right: 16px; }
    .access-card { padding: 20px; }
}
@media (prefers-reduced-motion: no-preference) {
    .button[aria-busy=true] .ui-icon { animation: spin 1s linear infinite; }
    @keyframes spin { to { transform: rotate(360deg); } }
}
