@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;800&display=swap');

/* =====================================================================
   RUTI App - Design system
   Dark is the native identity; light mirrors it on a clean surface.
   ===================================================================== */

:root,
:root[data-theme="dark"] {
    color-scheme: dark;

    --bg:            #0B1120;
    --bg-2:          #0F172A;
    --surface:       #1E293B;
    --surface-2:     #172236;
    --surface-glass: rgba(15, 23, 42, 0.72);
    --line:          rgba(148, 163, 184, 0.16);
    --line-strong:   rgba(148, 163, 184, 0.28);

    --text:          #F8FAFC;
    --text-2:        #CBD5E1;
    --muted:         #94A3B8;

    --accent:        #38BDF8;
    --accent-2:      #60A5FA;
    --accent-ink:    #04111F;
    --accent-soft:   rgba(56, 189, 248, 0.14);
    --primary:       #2563EB;
    --primary-ink:   #FFFFFF;

    --ok:            #34D399;
    --warn:          #FBBF24;
    --danger:        #F87171;
    --ok-soft:       rgba(52, 211, 153, 0.14);
    --warn-soft:     rgba(251, 191, 36, 0.14);
    --danger-soft:   rgba(248, 113, 113, 0.14);

    --stage-glow-1:  rgba(14, 165, 233, 0.22);
    --stage-glow-2:  rgba(37, 99, 235, 0.20);
    --device-border: rgba(148, 163, 184, 0.18);
    --device-shadow: 0 40px 120px -30px rgba(2, 6, 23, 0.9);

    --tint-egyptian:  rgba(251, 191, 36, 0.10);
    --tint-gulf:      rgba(56, 189, 248, 0.10);
    --tint-levantine: rgba(52, 211, 153, 0.10);
    --tint-international: rgba(167, 139, 250, 0.10);
}

:root[data-theme="light"] {
    color-scheme: light;

    --bg:            #F8FAFC;
    --bg-2:          #EEF2F7;
    --surface:       #FFFFFF;
    --surface-2:     #F1F5F9;
    --surface-glass: rgba(255, 255, 255, 0.78);
    --line:          rgba(15, 23, 42, 0.08);
    --line-strong:   rgba(15, 23, 42, 0.16);

    --text:          #0F172A;
    --text-2:        #334155;
    --muted:         #64748B;

    --accent:        #0EA5E9;
    --accent-2:      #2563EB;
    --accent-ink:    #FFFFFF;
    --accent-soft:   rgba(14, 165, 233, 0.12);
    --primary:       #2563EB;
    --primary-ink:   #FFFFFF;

    --ok:            #059669;
    --warn:          #B45309;
    --danger:        #DC2626;
    --ok-soft:       rgba(5, 150, 105, 0.10);
    --warn-soft:     rgba(217, 119, 6, 0.12);
    --danger-soft:   rgba(220, 38, 38, 0.10);

    --stage-glow-1:  rgba(14, 165, 233, 0.16);
    --stage-glow-2:  rgba(37, 99, 235, 0.10);
    --device-border: rgba(15, 23, 42, 0.08);
    --device-shadow: 0 40px 100px -40px rgba(15, 23, 42, 0.35);

    --tint-egyptian:  rgba(245, 158, 11, 0.10);
    --tint-gulf:      rgba(14, 165, 233, 0.10);
    --tint-levantine: rgba(16, 185, 129, 0.10);
    --tint-international: rgba(139, 92, 246, 0.10);
}

:root {
    --font: 'Cairo', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;

    --fs-xs: 0.8125rem;   /* 13 */
    --fs-sm: 0.875rem;    /* 14 */
    --fs-md: 1rem;        /* 16 */
    --fs-lg: 1.125rem;    /* 18 */
    --fs-xl: 1.5rem;      /* 24 */
    --fs-2xl: 2rem;       /* 32 */

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;

    --radius-device: 34px;
    --radius-lg: 22px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --radius-pill: 999px;

    --device-width: 430px;
    --tabbar-h: 72px;
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* =====================================================================
   Base
   ===================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

html,
body {
    height: 100%;
    margin: 0;
}

body {
    font-family: var(--font);
    font-size: var(--fs-md);
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    background-image:
        radial-gradient(60vmax 60vmax at 12% 8%, var(--stage-glow-1), transparent 60%),
        radial-gradient(50vmax 50vmax at 92% 96%, var(--stage-glow-2), transparent 60%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

html[lang^="ar"] body {
    line-height: 1.75;
}

h1, h2, h3, p {
    margin: 0;
}

h1 { font-size: var(--fs-xl); font-weight: 800; line-height: 1.3; }
h2 { font-size: var(--fs-lg); font-weight: 700; line-height: 1.4; }

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea,
optgroup,
option {
    font: inherit;
    color: inherit;
}

/* Native dropdown lists use the app font too */
select,
select option {
    font-family: var(--font);
}

button {
    cursor: pointer;
    background: none;
    border: 0;
    padding: 0;
}

img {
    max-width: 100%;
    display: block;
}

ul,
ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

[hidden] {
    display: none !important;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 6px;
}

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

.skip-link {
    position: absolute;
    inset-inline-start: var(--space-4);
    top: -60px;
    z-index: 100;
    padding: var(--space-2) var(--space-4);
    background: var(--primary);
    color: var(--primary-ink);
    border-radius: var(--radius-sm);
    transition: top 0.2s;
}

.skip-link:focus {
    top: var(--space-4);
}

.sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.icon {
    width: 20px;
    height: 20px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon--xl {
    width: 40px;
    height: 40px;
    stroke-width: 1.4;
}

[dir="rtl"] .flip-rtl {
    transform: scaleX(-1);
}

:root[data-theme="dark"] .icon--when-light,
:root[data-theme="light"] .icon--when-dark,
:root[data-view="frame"] .icon--when-full,
:root[data-view="full"] .icon--when-frame {
    display: none;
}

/* =====================================================================
   Stage & device frame
   ===================================================================== */

.stage {
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
}

.device {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: var(--device-width);
    height: min(920px, calc(100vh - 48px));   /* older browsers */
    height: min(920px, calc(100dvh - 48px));
    overflow: hidden;
    background: var(--surface-glass);
    border: 1px solid var(--device-border);
    border-radius: var(--radius-device);
    box-shadow: var(--device-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    backdrop-filter: blur(24px) saturate(140%);
    transition: max-width 0.45s var(--ease), border-radius 0.45s var(--ease), height 0.45s var(--ease);
}

:root[data-view="full"] .device {
    --device-width: 1180px;
    height: calc(100vh - 48px);
    height: calc(100dvh - 48px);
    border-radius: var(--radius-lg);
}

.screen {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding: var(--space-2) var(--space-5) calc(var(--tabbar-h) + var(--space-6));
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
}

.screen:focus {
    outline: none;
}

@media (max-width: 520px) {
    .stage {
        padding: 0;
        align-items: stretch;
    }

    /*
     * Phones: pin the app to the screen edges. This always matches the visible
     * screen (address bar shown or hidden, any screen height, Android or iPhone),
     * so the tab bar and the RUTI dock stay at the bottom. Units like 100dvh
     * aren't supported by every Android browser, which pushed them off-screen.
     */
    .device,
    :root[data-view="full"] .device {
        position: fixed;
        inset: 0;
        max-width: none;
        height: auto;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .view-toggle {
        display: none;
    }
}

@media (max-width: 899px) {
    .view-toggle {
        display: none;
    }
}

/* =====================================================================
   Top bar
   ===================================================================== */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: calc(var(--space-4) + env(safe-area-inset-top, 0px)) var(--space-5) var(--space-3);
    flex: none;
}

.brand {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
}

.brand__logo {
    height: 30px;
    width: auto;
}

:root[data-theme="light"] .brand__logo {
    filter: drop-shadow(0 0 0.5px rgba(15, 23, 42, 0.4));
}

.brand__badge {
    font-size: 11px;
    font-weight: 700;
    padding: 1px var(--space-2);
    border-radius: var(--radius-pill);
    color: var(--accent);
    background: var(--accent-soft);
    white-space: nowrap;
}

.topbar__actions {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-pill);
    color: var(--text-2);
    transition: background-color 0.2s, color 0.2s;
}

.icon-btn:hover {
    background: var(--accent-soft);
    color: var(--text);
}

.icon-btn--text {
    width: auto;
    padding-inline: var(--space-3);
    font-size: var(--fs-xs);
    font-weight: 700;
}

.wallet-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding-inline: var(--space-3);
    margin-inline-end: var(--space-1);
    border-radius: var(--radius-pill);
    border: 1px solid var(--line);
    font-size: var(--fs-xs);
    font-weight: 700;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.wallet-chip .icon {
    width: 16px;
    height: 16px;
    color: var(--accent);
}

@media (max-width: 380px) {
    .wallet-chip span {
        display: none;
    }
}

/* =====================================================================
   Views
   ===================================================================== */

.view {
    animation: view-in 0.35s var(--ease);
}

@keyframes view-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

.view__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding-block: var(--space-3) var(--space-5);
}

:root[data-view="full"] .screen {
    padding-bottom: calc(var(--tabbar-h) + var(--space-8) + var(--space-4));
}

:root[data-view="full"] .view[data-view="home"] {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: var(--space-8);
    align-items: start;
}


@media (max-width: 899px) {
    :root[data-view="full"] .view[data-view="home"] {
        display: block;
    }
}

/* =====================================================================
   Hero & voice orb
   ===================================================================== */

.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-block: var(--space-4) var(--space-5);
}

.hero__greet {
    font-size: var(--fs-sm);
    color: var(--muted);
    font-weight: 600;
}

.hero__title {
    font-size: var(--fs-2xl);
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.25;
    margin-top: var(--space-1);
}

html[lang^="ar"] .hero__title {
    letter-spacing: 0;
}

.hero__hint {
    max-width: 34ch;
    font-size: var(--fs-xs);
    color: var(--muted);
    margin-top: var(--space-2);
}

.orb {
    --orb-size: 168px;
    position: relative;
    width: var(--orb-size);
    height: var(--orb-size);
    margin-top: var(--space-6);
    border-radius: 50%;
    isolation: isolate;
    transition: transform 0.3s var(--ease);
}

.orb:active {
    transform: scale(0.97);
}

.orb:focus-visible {
    outline-offset: 10px;
    border-radius: 50%;
}

.orb__halo {
    position: absolute;
    inset: -28px;
    z-index: -2;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.35), transparent 65%);
    opacity: 0.55;
    transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}

.orb__ring {
    position: absolute;
    inset: -9px;
    z-index: -1;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0deg, var(--accent) 80deg, var(--accent-2) 140deg, transparent 220deg);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
    opacity: 0.45;
}

.orb__core {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background:
        radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.55), transparent 32%),
        radial-gradient(circle at 50% 60%, #38BDF8 0%, #0EA5E9 38%, #2563EB 78%, #1E3A8A 100%);
    box-shadow:
        inset 0 -14px 30px rgba(15, 23, 42, 0.35),
        inset 0 8px 18px rgba(255, 255, 255, 0.18),
        0 18px 50px -12px rgba(14, 165, 233, 0.65);
}

.wave {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 56px;
}

.wave i {
    display: block;
    width: 6px;
    height: 100%;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.92);
    transform-origin: center;
    transform: scaleY(var(--h, 0.3));
    transition: transform 0.3s var(--ease);
}

.wave i:nth-child(1) { --h: 0.22; }
.wave i:nth-child(2) { --h: 0.48; }
.wave i:nth-child(3) { --h: 0.72; }
.wave i:nth-child(4) { --h: 0.48; }
.wave i:nth-child(5) { --h: 0.22; }

.orb[data-state="listening"] .orb__halo,
.orb[data-state="speaking"] .orb__halo {
    opacity: 1;
    transform: scale(1.08);
}

.orb[data-state="listening"] .orb__ring,
.orb[data-state="thinking"] .orb__ring {
    opacity: 1;
    animation: orb-spin 1.6s linear infinite;
}

.orb[data-state="thinking"] .orb__ring {
    animation-duration: 0.9s;
}

.orb[data-state="listening"] .wave i,
.orb[data-state="speaking"] .wave i {
    animation: wave-bar 0.9s ease-in-out infinite;
}

.orb[data-state="speaking"] .wave i {
    animation-duration: 0.6s;
}

.orb .wave i:nth-child(2) { animation-delay: -0.15s; }
.orb .wave i:nth-child(3) { animation-delay: -0.3s; }
.orb .wave i:nth-child(4) { animation-delay: -0.45s; }
.orb .wave i:nth-child(5) { animation-delay: -0.6s; }

/* Live microphone level from voice.js (0..1) overrides the idle scale. */
.orb[data-level] .wave i {
    animation: none;
    transform: scaleY(calc(0.18 + var(--level, 0) * var(--h) * 1.6));
    transition-duration: 0.08s;
}

@keyframes orb-spin {
    to { transform: rotate(360deg); }
}

@keyframes wave-bar {
    0%, 100% { transform: scaleY(calc(var(--h) * 0.6)); }
    50%      { transform: scaleY(calc(var(--h) * 1.35)); }
}

.orb-status {
    min-height: 1.6em;
    max-width: 30ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--accent);
}

/* =====================================================================
   Conversation feed & composer
   ===================================================================== */

.feed {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.bubble {
    max-width: 88%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--fs-sm);
    border-radius: 18px;
    animation: bubble-in 0.25s var(--ease);
}

.bubble p + p {
    margin-top: var(--space-2);
}

.bubble--ruti {
    align-self: flex-start;
    background: var(--surface);
    border: 1px solid var(--line);
    border-start-start-radius: 6px;
}

.bubble--user {
    align-self: flex-end;
    background: var(--primary);
    color: var(--primary-ink);
    border-start-end-radius: 6px;
}

.bubble__author {
    display: block;
    font-size: 11px;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 2px;
}

.bubble--typing p::after {
    content: '';
    display: inline-block;
    width: 1.2em;
    text-align: start;
    animation: typing 1.2s steps(4) infinite;
}

@keyframes typing {
    0%   { content: ''; }
    25%  { content: '.'; }
    50%  { content: '..'; }
    75%  { content: '...'; }
}

@keyframes bubble-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: none; }
}

.composer {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    padding: 5px;
    padding-inline-start: var(--space-4);
    border-radius: var(--radius-pill);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.composer:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.composer__input {
    flex: 1;
    min-width: 0;
    height: 42px;
    border: 0;
    background: transparent;
    font-size: var(--fs-sm);
}

.composer__input:focus {
    outline: none;
}

.composer__input::placeholder {
    color: var(--muted);
}

.composer__btn {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    flex: none;
    transition: background-color 0.2s, transform 0.15s;
}

.composer__btn:active {
    transform: scale(0.94);
}

.composer__btn--mic {
    color: var(--text-2);
}

.composer__btn--mic:hover {
    background: var(--accent-soft);
}

.composer__btn--mic.is-active {
    color: var(--accent-ink);
    background: var(--accent);
}

.composer__btn--send {
    background: var(--primary);
    color: var(--primary-ink);
}

.chips {
    display: flex;
    gap: var(--space-2);
    overflow-x: auto;
    padding-block: var(--space-3) var(--space-2);
    margin-inline: calc(var(--space-5) * -1);
    padding-inline: var(--space-5);
    scrollbar-width: none;
}

.chips::-webkit-scrollbar {
    display: none;
}

.chip {
    flex: none;
    height: 34px;
    padding-inline: var(--space-4);
    border-radius: var(--radius-pill);
    border: 1px solid var(--line-strong);
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--text-2);
    white-space: nowrap;
    transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}

.chip:hover {
    border-color: var(--accent);
    color: var(--text);
    background: var(--accent-soft);
}

/* =====================================================================
   Content blocks
   ===================================================================== */

.block {
    padding-block: var(--space-6) var(--space-2);
}

.block + .block {
    border-top: 1px solid var(--line);
}

.block__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.block__meta {
    font-size: var(--fs-xs);
    color: var(--muted);
    white-space: nowrap;
}

.link {
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--accent);
}

.empty-line {
    font-size: var(--fs-sm);
    color: var(--muted);
}

/* Timeline: today's meals in chronological order */
.timeline {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    padding-inline-start: 22px;
}

.timeline::before {
    content: '';
    position: absolute;
    inset-block: 8px 8px;
    inset-inline-start: 5px;
    width: 2px;
    border-radius: 2px;
    background: var(--line-strong);
}

.timeline__item {
    position: relative;
}

.timeline__item::before {
    content: '';
    position: absolute;
    top: 7px;
    inset-inline-start: -22px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg-2);
    border: 2px solid var(--line-strong);
}

.timeline__item.is-now::before {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 0 0 5px var(--accent-soft);
}

.timeline__item.is-consumed::before,
.timeline__item.is-cooked::before {
    border-color: var(--ok);
    background: var(--ok);
}

.timeline__slot {
    display: block;
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--muted);
}

.timeline__item.is-now .timeline__slot {
    color: var(--accent);
}

.timeline__body {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-top: 2px;
}

.timeline__icon {
    font-size: 26px;
    line-height: 1;
}

.timeline__name {
    font-weight: 700;
}

.timeline__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: var(--fs-xs);
    color: var(--muted);
}

.timeline__empty {
    margin-top: 2px;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--accent);
}

/* Stock rows */
.stock-list {
    display: flex;
    flex-direction: column;
}

.stock-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    column-gap: var(--space-3);
    row-gap: 6px;
    padding-block: var(--space-3);
}

.stock-row + .stock-row {
    border-top: 1px solid var(--line);
}

.stock-row__icon {
    font-size: 20px;
    line-height: 1;
    grid-row: span 2;
}

.stock-row__name {
    font-size: var(--fs-sm);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stock-row__qty {
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
}

.stock-row.is-low .stock-row__qty { color: var(--warn); }
.stock-row.is-out .stock-row__qty { color: var(--danger); }

.meter {
    grid-column: 2 / -1;
    display: block;
    height: 4px;
    border-radius: 4px;
    background: var(--line);
    overflow: hidden;
}

.meter > span {
    display: block;
    width: var(--level, 0%);
    height: 100%;
    border-radius: inherit;
    background: var(--ok);
}

.stock-row.is-low .meter > span { background: var(--warn); }
.stock-row.is-out .meter > span { background: var(--danger); }

/* Recipe rail */
.recipe-rail {
    display: flex;
    gap: var(--space-3);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-inline: calc(var(--space-5) * -1);
    padding-inline: var(--space-5);
    padding-bottom: var(--space-2);
    scrollbar-width: none;
}

.recipe-rail::-webkit-scrollbar {
    display: none;
}

.recipe-rail > li {
    scroll-snap-align: start;
    flex: none;
}

.recipe-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 140px;
    min-height: 150px;
    padding: var(--space-4);
    text-align: start;
    border-radius: var(--radius-lg);
    background: var(--tint, var(--surface));
    border: 1px solid var(--line);
    transition: border-color 0.2s, transform 0.2s var(--ease);
}

.recipe-tile:hover {
    border-color: var(--accent);
}

.recipe-tile:active {
    transform: scale(0.98);
}

.recipe-tile--egyptian      { --tint: var(--tint-egyptian); }
.recipe-tile--gulf          { --tint: var(--tint-gulf); }
.recipe-tile--levantine     { --tint: var(--tint-levantine); }
.recipe-tile--international { --tint: var(--tint-international); }

.recipe-tile__icon {
    font-size: 34px;
    line-height: 1.1;
    margin-bottom: auto;
}

.recipe-tile__name {
    font-size: var(--fs-sm);
    font-weight: 700;
    line-height: 1.35;
    margin-top: var(--space-3);
}

.recipe-tile__meta {
    font-size: 11px;
    color: var(--muted);
}

/* Store strip */
.store-strip {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.store-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 6px var(--space-3);
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    font-size: var(--fs-xs);
}

.store-chip__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand, var(--accent));
}

.store-chip__name {
    font-weight: 700;
}

.store-chip__meta {
    color: var(--muted);
}

/* =====================================================================
   Planner, pantry, cart, profile
   ===================================================================== */

.day {
    padding-block: var(--space-4);
}

.day + .day {
    border-top: 1px solid var(--line);
}

.day__title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--fs-sm);
    font-weight: 700;
    margin-bottom: var(--space-2);
}

.day.is-today .day__title {
    color: var(--accent);
}

.meal-row {
    display: grid;
    grid-template-columns: 64px 26px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-2);
    padding-block: var(--space-2);
    font-size: var(--fs-sm);
}

.meal-row.is-empty {
    grid-template-columns: 64px minmax(0, 1fr);
}

.meal-row__slot {
    font-size: var(--fs-xs);
    color: var(--muted);
    font-weight: 600;
}

.meal-row__icon {
    font-size: 20px;
    line-height: 1;
}

.meal-row__name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.meal-row__name--muted {
    color: var(--muted);
    font-weight: 400;
}

.shelf {
    padding-block: var(--space-3);
}

.shelf__title {
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--muted);
    margin-bottom: var(--space-1);
}

.cart-list {
    display: flex;
    flex-direction: column;
}

.cart-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: var(--space-3);
    padding-block: var(--space-3);
}

.cart-row + .cart-row {
    border-top: 1px solid var(--line);
}

.cart-row__icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    font-size: 18px;
}

.cart-row__info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cart-row__name {
    font-size: var(--fs-sm);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-row__store {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--muted);
}

.cart-row__store::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand, var(--accent));
}

.cart-row__qty {
    font-size: var(--fs-xs);
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.cart-row__price {
    font-size: var(--fs-sm);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.summary {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--line-strong);
}

.summary__row {
    display: flex;
    justify-content: space-between;
    font-size: var(--fs-sm);
    padding-block: var(--space-1);
}

.summary__row--total {
    font-size: var(--fs-md);
    margin-bottom: var(--space-4);
}

.wallet-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    overflow: hidden;
    color: #F8FAFC;
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(56, 189, 248, 0.55), transparent 55%),
        linear-gradient(135deg, #1E3A8A, #0F172A 70%);
}

.wallet-card__label {
    font-size: var(--fs-xs);
    opacity: 0.8;
}

.wallet-card__amount {
    font-size: var(--fs-2xl);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.wallet-card__owner {
    margin-top: var(--space-4);
    font-size: var(--fs-xs);
    opacity: 0.8;
}

.details {
    margin: var(--space-6) 0 0;
}

.details > div {
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
    padding-block: var(--space-3);
    border-bottom: 1px solid var(--line);
    font-size: var(--fs-sm);
}

.details dt {
    color: var(--muted);
}

.details dd {
    margin: 0;
    font-weight: 600;
    text-align: end;
}

.settings {
    margin-top: var(--space-6);
    display: flex;
    flex-direction: column;
}

.setting {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding-block: var(--space-3);
    font-size: var(--fs-sm);
    font-weight: 600;
    text-align: start;
}

.setting + .setting {
    border-top: 1px solid var(--line);
}

.setting .icon {
    color: var(--accent);
}

.setting__value {
    margin-inline-start: auto;
    color: var(--muted);
    font-weight: 400;
}

.credits {
    margin-top: var(--space-8);
    text-align: center;
    font-size: 11px;
    color: var(--muted);
}

/* =====================================================================
   Shared components
   ===================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    height: 48px;
    padding-inline: var(--space-6);
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: var(--fs-sm);
    transition: filter 0.2s, transform 0.15s;
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn--primary {
    background: var(--primary);
    color: var(--primary-ink);
}

.btn--primary:hover {
    filter: brightness(1.08);
}

.btn--ghost {
    border: 1px solid var(--line-strong);
}

.btn--sm {
    height: 36px;
    padding-inline: var(--space-4);
    font-size: var(--fs-xs);
}

.btn--block {
    width: 100%;
}

.pill {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding-inline: var(--space-2);
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
    background: var(--surface-2);
    color: var(--text-2);
    white-space: nowrap;
}

.pill--accent   { background: var(--accent-soft); color: var(--accent); }
.pill--planned  { background: var(--accent-soft); color: var(--accent); }
.pill--cooked,
.pill--consumed { background: var(--ok-soft);     color: var(--ok); }
.pill--skipped  { background: var(--surface-2);   color: var(--muted); }

.badge {
    position: absolute;
    top: -6px;
    inset-inline-end: -10px;
    min-width: 18px;
    height: 18px;
    padding-inline: 5px;
    border-radius: var(--radius-pill);
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
}

.notice {
    padding: var(--space-4);
    margin-bottom: var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--fs-sm);
}

.notice p {
    margin-top: var(--space-1);
    color: var(--text-2);
}

.notice--warn {
    background: var(--warn-soft);
    border: 1px solid var(--warn);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-8) var(--space-4);
    text-align: center;
    color: var(--muted);
    font-size: var(--fs-sm);
}

.empty-state .icon {
    color: var(--accent);
    margin-bottom: var(--space-2);
}

.empty-state__title {
    font-size: var(--fs-md);
    font-weight: 700;
    color: var(--text);
}

/* =====================================================================
   Tab bar
   ===================================================================== */

.tabbar {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding: 0 var(--space-2) env(safe-area-inset-bottom, 0px);
    background: var(--surface-glass);
    border-top: 1px solid var(--line);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    backdrop-filter: blur(20px) saturate(140%);
}

:root[data-view="full"] .tabbar {
    left: 50%;
    right: auto;
    width: min(560px, calc(100% - 32px));
    bottom: var(--space-4);
    transform: translateX(-50%);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
}

.tabbar__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding-block: var(--space-2);
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    transition: color 0.2s;
}

.tabbar__item:hover,
.tabbar__item[aria-current="page"] {
    color: var(--accent);
}

.tabbar__icon-wrap {
    position: relative;
    display: inline-flex;
}

.tabbar__orb {
    justify-self: center;
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin-top: -26px;
    border-radius: 50%;
    color: #fff;
    background: radial-gradient(circle at 50% 60%, #38BDF8 0%, #0EA5E9 40%, #2563EB 100%);
    box-shadow: 0 0 0 5px var(--bg-2), 0 12px 30px -8px rgba(14, 165, 233, 0.7);
    transition: transform 0.2s var(--ease);
}

:root[data-view="full"] .tabbar__orb {
    margin-top: 0;
    width: 48px;
    height: 48px;
    box-shadow: 0 8px 24px -8px rgba(14, 165, 233, 0.7);
}

.tabbar__orb:active {
    transform: scale(0.94);
}

.tabbar__orb .icon {
    width: 24px;
    height: 24px;
}

/* =====================================================================
   Toasts
   ===================================================================== */

.toasts {
    position: absolute;
    inset-inline: var(--space-4);
    bottom: calc(var(--tabbar-h) + var(--space-4) + env(safe-area-inset-bottom, 0px));
    z-index: 60;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    pointer-events: none;
}

.toast {
    max-width: 100%;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--text);
    color: var(--bg);
    font-size: var(--fs-sm);
    font-weight: 600;
    box-shadow: 0 12px 30px -12px rgba(2, 6, 23, 0.6);
    pointer-events: auto;
    animation: toast-in 0.3s var(--ease);
}

.toast--error {
    background: var(--danger);
    color: #fff;
}

.toast--success {
    background: var(--ok);
    color: #04140D;
}

.toast.is-leaving {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.25s, transform 0.25s;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

/* =====================================================================
   Phase 2: assistant cards, actions, controls
   ===================================================================== */

.orb-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    margin-top: var(--space-4);
}

.icon-btn--sm {
    width: 30px;
    height: 30px;
}

.icon-btn--sm .icon {
    width: 16px;
    height: 16px;
}

.mute-btn .icon--when-muted,
.mute-btn.is-muted .icon--when-sound {
    display: none;
}

.mute-btn.is-muted .icon--when-muted {
    display: block;
}

.mute-btn.is-muted {
    color: var(--danger);
}

.bubble__extra {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-top: var(--space-3);
}

.bubble--ruti:has(.card) {
    max-width: 100%;
    width: 100%;
}

.card {
    padding: var(--space-4);
    border-radius: var(--radius-md);
    background: var(--surface-2);
    border: 1px solid var(--line);
}

.card__head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.card__icon {
    font-size: 26px;
    line-height: 1;
}

.card__title {
    font-size: var(--fs-sm);
    font-weight: 800;
    margin: 0;
}

.card__subtitle {
    font-size: var(--fs-xs);
    color: var(--muted);
}

.card__stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-2);
    margin: var(--space-4) 0 0;
}

.card__stat {
    display: flex;
    flex-direction: column-reverse;
    padding: var(--space-2);
    border-radius: var(--radius-sm);
    background: var(--surface);
    text-align: center;
}

.card__stat dd {
    margin: 0;
    font-size: var(--fs-lg);
    font-weight: 800;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
}

.card__stat dt {
    font-size: 11px;
    color: var(--muted);
}

.card__days {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.card__day-label {
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--accent);
}

.card__meals li {
    display: grid;
    grid-template-columns: 52px 22px minmax(0, 1fr);
    align-items: center;
    gap: var(--space-2);
    font-size: var(--fs-xs);
    padding-block: 2px;
}

.card__meal-slot {
    color: var(--muted);
}

.card__meal-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card__more {
    margin-top: var(--space-2);
    font-size: var(--fs-xs);
    color: var(--muted);
}

.card__lines {
    margin-top: var(--space-3);
}

.card__line {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-2);
    padding-block: var(--space-2);
}

.card__line + .card__line {
    border-top: 1px solid var(--line);
}

.card__line-icon {
    font-size: 18px;
    line-height: 1;
}

.card__line-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.card__line-name {
    font-size: var(--fs-xs);
    font-weight: 700;
}

.card__line-detail {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--muted);
}

.card__line-value {
    font-size: var(--fs-xs);
    font-weight: 700;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.card__line.is-low .card__line-value { color: var(--warn); }
.card__line.is-out .card__line-value { color: var(--danger); }

.card__rows {
    margin: var(--space-3) 0 0;
    padding-top: var(--space-2);
    border-top: 1px solid var(--line);
}

.card__row {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    padding-block: 3px;
    font-size: var(--fs-xs);
}

.card__row dt {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-2);
}

.card__row dd {
    margin: 0;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.card__row.is-strong {
    font-size: var(--fs-sm);
}

.card__row.is-strong dt,
.card__row.is-strong dd {
    color: var(--text);
    font-weight: 800;
}

.card__row.is-warn dd {
    color: var(--danger);
}

.swatch {
    display: inline-block;
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand, var(--accent));
}

/* Cooking step */
.card--cooking {
    border-color: var(--accent);
    background: linear-gradient(180deg, var(--accent-soft), transparent 70%), var(--surface-2);
}

.card__step {
    margin-top: var(--space-3);
}

.progress {
    height: 4px;
    border-radius: 4px;
    background: var(--line);
    overflow: hidden;
}

.progress > span {
    display: block;
    height: 100%;
    background: var(--accent);
    border-radius: inherit;
    transition: width 0.4s var(--ease);
}

.card__step-label {
    margin-top: var(--space-3);
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
}

.card__step-text {
    margin-top: var(--space-1);
    font-size: var(--fs-md);
    font-weight: 600;
    line-height: 1.7;
}

.timer-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-3);
    height: 34px;
    padding-inline: var(--space-4);
    border-radius: var(--radius-pill);
    border: 1px solid var(--accent);
    color: var(--accent);
    font-size: var(--fs-xs);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.timer-btn.is-running {
    background: var(--accent);
    color: var(--accent-ink);
}

.timer-btn.is-done {
    border-color: var(--ok);
    background: var(--ok-soft);
    color: var(--ok);
}

/* Reply actions */
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.action-btn {
    min-height: 34px;
    padding: 4px var(--space-4);
    border-radius: var(--radius-pill);
    font-size: var(--fs-xs);
    font-weight: 700;
    border: 1px solid var(--line-strong);
    color: var(--text);
    transition: background-color 0.2s, border-color 0.2s, opacity 0.2s;
}

.action-btn:hover {
    border-color: var(--accent);
}

.action-btn--primary {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--primary-ink);
}

.action-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

/* Small inline buttons in lists */
.mini-btn {
    flex: none;
    height: 28px;
    padding-inline: var(--space-3);
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-soft);
    white-space: nowrap;
}

.mini-btn--quiet {
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--line);
}

.mini-btn:disabled {
    opacity: 0.5;
}

.timeline__text {
    flex: 1;
    min-width: 0;
}

.meal-row {
    grid-template-columns: 64px 26px minmax(0, 1fr) auto;
}

.meal-row__actions {
    display: inline-flex;
    justify-content: flex-end;
}

.view__lead {
    font-size: var(--fs-xs);
    color: var(--muted);
    margin-bottom: var(--space-2);
}

/* Cart grouped by store */
.cart-store + .cart-store {
    margin-top: var(--space-4);
}

.cart-store__title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--fs-sm);
    font-weight: 800;
}

.cart-store__fee {
    margin-inline-start: auto;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
}

.cart-row {
    grid-template-columns: 34px minmax(0, 1fr) auto;
}

.cart-row__info .cart-row__price {
    font-size: var(--fs-xs);
    color: var(--muted);
    font-weight: 600;
}

.stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-pill);
}

.stepper__btn {
    width: 32px;
    height: 32px;
    font-size: var(--fs-lg);
    font-weight: 700;
    color: var(--accent);
}

.stepper__btn:disabled {
    opacity: 0.4;
}

.stepper__value {
    min-width: 22px;
    text-align: center;
    font-size: var(--fs-sm);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.btn--spaced {
    margin-top: var(--space-2);
}

.wallet-card__topup {
    align-self: flex-start;
    margin-top: var(--space-4);
    height: 32px;
    padding-inline: var(--space-4);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.14);
    color: #F8FAFC;
    font-size: var(--fs-xs);
    font-weight: 700;
}

.wallet-card__topup:hover {
    background: rgba(255, 255, 255, 0.22);
}

@media (max-width: 380px) {
    .card__stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* =====================================================================
   Full-width view only applies on wide screens
   ===================================================================== */

@media (max-width: 899px) {
    :root[data-view="full"] .device {
        --device-width: 430px;
        height: min(920px, calc(100vh - 48px));
        height: min(920px, calc(100dvh - 48px));
        border-radius: var(--radius-device);
    }

    :root[data-view="full"] .tabbar {
        left: 0;
        right: 0;
        width: auto;
        bottom: 0;
        transform: none;
        border-width: 1px 0 0;
        border-radius: 0;
    }

    :root[data-view="full"] .tabbar__orb {
        margin-top: -26px;
        width: 56px;
        height: 56px;
    }
}

@media (max-width: 520px) {
    :root[data-view="full"] .device {
        height: auto;   /* pinned to the screen edges (see .device above) */
        border-radius: 0;
    }
}

/* =====================================================================
   Motion preferences
   ===================================================================== */

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

/* =====================================================================
   RUTI App - accounts, profile and app shell
   ===================================================================== */

/* ---------- Shared controls ---------- */

.prefs {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.btn--lg {
    height: 52px;
    font-size: var(--fs-md);
}

.btn--danger {
    background: var(--danger);
    color: #fff;
}

.btn .icon {
    width: 18px;
    height: 18px;
}

.btn.is-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn.is-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    animation: spin 0.7s linear infinite;
}

.btn--ghost.is-loading::after {
    border-color: var(--line-strong);
    border-top-color: var(--accent);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.link-btn {
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.link-btn:disabled {
    color: var(--muted);
    cursor: default;
}

.link-btn--muted {
    color: var(--muted);
    font-weight: 600;
    font-size: var(--fs-xs);
}

.alert {
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--fs-sm);
    font-weight: 600;
    border: 1px solid transparent;
}

.alert--error   { background: var(--danger-soft); border-color: var(--danger); color: var(--text); }
.alert--success { background: var(--ok-soft);     border-color: var(--ok);     color: var(--text); }
.alert--info    { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }

.pill--ok {
    gap: 4px;
    background: var(--ok-soft);
    color: var(--ok);
}

.pill .icon {
    width: 12px;
    height: 12px;
    stroke-width: 2.5;
}

/* ---------- Forms ---------- */

.form {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.form__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
}

.form__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.field__label {
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--text-2);
    padding: 0;
}

.field__control {
    position: relative;
    display: flex;
    align-items: center;
}

.field__input {
    width: 100%;
    height: 50px;
    padding-inline: var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid var(--line-strong);
    background: var(--surface);
    font-size: var(--fs-md);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.field__input::placeholder {
    color: var(--muted);
    opacity: 0.7;
}

.field__input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.field__input[type="date"] {
    min-height: 50px;
}

[dir="rtl"] .field__input[type="date"] {
    text-align: right;
}

:root[data-theme="dark"] .field__input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.6;
}

.field__icon {
    position: absolute;
    inset-inline-start: 14px;
    width: 18px;
    height: 18px;
    color: var(--muted);
    pointer-events: none;
}

/* Padding follows the page direction, not the input's own direction,
   so left-to-right inputs (email, phone) still clear the icon in Arabic. */
[dir="rtl"] .field__icon ~ .field__input {
    padding-right: 44px;
    padding-left: var(--space-4);
}

[dir="ltr"] .field__icon ~ .field__input {
    padding-left: 44px;
    padding-right: var(--space-4);
}

.field__toggle {
    position: absolute;
    inset-inline-end: 6px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    color: var(--muted);
}

[dir="rtl"] .field__control:has(.field__toggle) .field__input {
    padding-left: 48px;
}

[dir="ltr"] .field__control:has(.field__toggle) .field__input {
    padding-right: 48px;
}

.field__toggle .icon--hide,
.field__toggle.is-visible .icon--show {
    display: none;
}

.field__toggle.is-visible .icon--hide {
    display: block;
}

.field__hint {
    font-size: 12px;
    color: var(--muted);
}

.field__error {
    font-size: 12px;
    font-weight: 700;
    color: var(--danger);
}

.field.has-error .field__input,
.field__input[aria-invalid="true"] {
    border-color: var(--danger);
}

/* Inputs in LTR (email, phone) keep their text aligned with the page */
[dir="rtl"] .field__input[dir="ltr"] {
    text-align: right;
}

[dir="rtl"] .field__input[dir="ltr"]::placeholder {
    text-align: right;
}

.otp-input {
    height: 64px;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: 0.5em;
    text-align: center !important;
    font-variant-numeric: tabular-nums;
    padding-inline-start: calc(var(--space-4) + 0.5em);
}

.strength {
    height: 4px;
    margin-top: -8px;
    border-radius: 4px;
    background: var(--line);
    overflow: hidden;
}

.strength > span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    transition: width 0.25s, background-color 0.25s;
}

.strength[data-level="1"] > span { width: 25%;  background: var(--danger); }
.strength[data-level="2"] > span { width: 50%;  background: var(--warn); }
.strength[data-level="3"] > span { width: 75%;  background: var(--accent); }
.strength[data-level="4"] > span { width: 100%; background: var(--ok); }

.segmented {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    padding: 4px;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--line-strong);
}

.segmented__option {
    position: relative;
    cursor: pointer;
}

.segmented__option input {
    position: absolute;
    opacity: 0;
    inset: 0;
    cursor: pointer;
}

.segmented__option span {
    display: grid;
    place-items: center;
    height: 40px;
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--muted);
    transition: background-color 0.2s, color 0.2s;
}

.segmented__option input:checked + span {
    background: var(--primary);
    color: var(--primary-ink);
}

.segmented__option input:focus-visible + span {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.check {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--fs-sm);
    cursor: pointer;
}

.check--top {
    align-items: flex-start;
    line-height: 1.6;
}

.check input {
    flex: none;
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--primary);
}

.check--top input {
    margin-top: 3px;
}

/* ---------- Auth layout ---------- */

.layout-auth {
    min-height: 100dvh;
}

.auth {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

.auth__brand {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 35vh;
    height: 35dvh;
    min-height: 190px;
    padding-top: env(safe-area-inset-top, 0px);
}

.auth__brand::before {
    content: '';
    position: absolute;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.28), transparent 65%);
    pointer-events: none;
}

.auth__logo {
    position: relative;
    width: min(210px, 55vw);
    height: auto;
}

.auth__pitch {
    display: none;
}

.auth__main {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: var(--space-6) var(--space-5) calc(var(--space-6) + env(safe-area-inset-bottom, 0px));
    background: var(--surface-glass);
    border-top: 1px solid var(--device-border);
    border-radius: 28px 28px 0 0;
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
}

.auth__main:focus {
    outline: none;
}

.auth__top {
    position: absolute;
    top: calc(var(--space-3) + env(safe-area-inset-top, 0px));
    inset-inline-end: var(--space-3);
    z-index: 5;
}

.auth__panel {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}

.auth__title {
    font-size: var(--fs-xl);
    font-weight: 800;
    line-height: 1.3;
}

.auth__subtitle {
    margin: var(--space-1) 0 var(--space-6);
    font-size: var(--fs-sm);
    color: var(--muted);
}

.auth__email {
    color: var(--text);
    unicode-bidi: isolate;
}

.auth__icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin-bottom: var(--space-4);
    border-radius: 18px;
    background: var(--accent-soft);
    color: var(--accent);
}

.auth__icon .icon {
    width: 26px;
    height: 26px;
}

.auth__switch {
    margin-top: var(--space-6);
    text-align: center;
    font-size: var(--fs-sm);
    color: var(--muted);
}

.auth__legal {
    margin-top: auto;
    padding-top: var(--space-8);
    text-align: center;
    font-size: 11px;
    color: var(--muted);
}

.resend {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-5);
    font-size: var(--fs-sm);
    color: var(--muted);
}

.legal section + section {
    margin-top: var(--space-5);
}

.legal h2 {
    font-size: var(--fs-md);
    margin-bottom: var(--space-1);
}

.legal p {
    font-size: var(--fs-sm);
    color: var(--text-2);
    line-height: 1.8;
}

@media (min-width: 900px) {
    .auth {
        flex-direction: row;
    }

    .auth__brand {
        flex: 0 0 46%;
        flex-direction: column;
        justify-content: center;
        gap: var(--space-8);
        padding: var(--space-8);
        border-inline-end: 1px solid var(--line);
        background:
            radial-gradient(70% 60% at 50% 40%, rgba(37, 99, 235, 0.25), transparent 70%),
            transparent;
    }

    .auth__brand::before {
        display: none;
    }

    .auth__logo {
        width: 230px;
    }

    .auth__pitch {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: var(--space-6);
        max-width: 360px;
        text-align: center;
    }

    .auth__orb {
        display: grid;
        place-items: center;
        width: 150px;
        height: 150px;
        border-radius: 50%;
        background:
            radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.55), transparent 32%),
            radial-gradient(circle at 50% 60%, #38BDF8 0%, #0EA5E9 38%, #2563EB 78%, #1E3A8A 100%);
        box-shadow: 0 30px 80px -20px rgba(14, 165, 233, 0.7);
    }

    .auth__tagline {
        font-size: var(--fs-xl);
        font-weight: 800;
        line-height: 1.4;
    }

    .auth__features {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--space-3) var(--space-5);
        text-align: start;
    }

    .auth__features li {
        display: flex;
        align-items: center;
        gap: var(--space-2);
        font-size: var(--fs-sm);
        color: var(--text-2);
    }

    .auth__features .icon {
        color: var(--accent);
    }

    .auth__brand {
        position: sticky;
        top: 0;
        align-self: flex-start;
        height: 100vh;
        height: 100dvh;
    }

    .auth__main {
        min-height: 100vh;
        min-height: 100dvh;
        padding: calc(var(--space-8) + 24px) var(--space-8) var(--space-8);
        background: transparent;
        border: 0;
        border-radius: 0;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    /* Centred when it fits, top-aligned and fully scrollable when it doesn't */
    .auth__panel {
        margin-block: auto;
    }

    .auth__legal {
        margin-top: var(--space-8);
    }
}

/* ---------- App shell ---------- */

.topbar__user {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
    margin-inline-end: auto;
}

.topbar__hello {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
}

.topbar__greet {
    font-size: 11px;
    color: var(--muted);
}

.topbar__name {
    font-size: var(--fs-sm);
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avatar {
    display: grid;
    place-items: center;
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #0EA5E9, #2563EB);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 0 0 2px var(--bg-2), 0 0 0 3px var(--accent);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar--sm {
    width: 38px;
    height: 38px;
    font-size: var(--fs-sm);
}

.avatar--xl {
    width: 112px;
    height: 112px;
    font-size: 36px;
    box-shadow: 0 0 0 4px var(--bg-2), 0 0 0 6px var(--accent);
}

.tabbar__item--ruti .icon {
    color: var(--accent);
}

.home-title,
.hero__title {
    max-width: 18ch;
}

.composer-dock {
    padding-top: var(--space-2);
}

.composer-dock .chips {
    padding-top: 0;
}

/* ---------- Upcoming sections ---------- */

.soon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-6) var(--space-2);
    text-align: center;
}

.soon__icon {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    border-radius: 24px;
    background: var(--accent-soft);
    color: var(--accent);
}

.soon__icon .icon {
    width: 34px;
    height: 34px;
}

.soon__title {
    font-size: var(--fs-lg);
    font-weight: 800;
}

.soon__lead {
    max-width: 36ch;
    font-size: var(--fs-sm);
    color: var(--muted);
}

.soon__list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    width: 100%;
    max-width: 340px;
    margin: var(--space-2) 0;
    text-align: start;
}

.soon__list li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    font-size: var(--fs-sm);
}

.soon__list .icon {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    color: var(--ok);
}

/* ---------- Profile ---------- */

.profile-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4) 0 var(--space-6);
    text-align: center;
}

.profile-head__avatar {
    position: relative;
    margin-bottom: var(--space-2);
}

.avatar-edit {
    position: absolute;
    bottom: 0;
    inset-inline-end: -4px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 0 4px var(--bg-2);
}

.avatar-edit .icon {
    width: 18px;
    height: 18px;
}

.profile-head__name {
    font-size: var(--fs-xl);
    font-weight: 800;
}

.profile-head__email {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--fs-sm);
    color: var(--muted);
}

.customer-id {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-2);
    padding: 6px var(--space-4);
    border-radius: var(--radius-pill);
    border: 1px dashed var(--line-strong);
    font-size: var(--fs-xs);
}

.customer-id__label {
    color: var(--muted);
}

.customer-id__value {
    font-weight: 800;
    letter-spacing: 0.06em;
    font-variant-numeric: tabular-nums;
}

.customer-id .icon {
    width: 16px;
    height: 16px;
    color: var(--accent);
}

.tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.tile {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--line);
}

.tile .icon {
    color: var(--accent);
    margin-bottom: var(--space-2);
}

.tile__label {
    font-size: var(--fs-xs);
    color: var(--muted);
}

.tile__value {
    font-size: var(--fs-md);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.tile__hint {
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--accent);
}

.tile--wallet {
    color: #F8FAFC;
    border: 0;
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(56, 189, 248, 0.55), transparent 55%),
        linear-gradient(135deg, #1E3A8A, #0F172A 70%);
}

.tile--wallet .icon,
.tile--wallet .tile__label {
    color: rgba(248, 250, 252, 0.85);
}

.panel {
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--line);
    overflow: hidden;
}

.panel + .panel,
.signout + .panel,
.panel + .signout {
    margin-top: var(--space-3);
}

.panel__summary {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.panel__summary::-webkit-details-marker {
    display: none;
}

.panel__summary > .icon:first-child {
    color: var(--accent);
}

.panel__chevron {
    margin-inline-start: auto;
    color: var(--muted);
    transition: transform 0.2s var(--ease);
}

.panel[open] .panel__chevron {
    transform: rotate(90deg);
}

[dir="rtl"] .panel[open] .panel__chevron {
    transform: scaleX(-1) rotate(90deg);
}

.panel__body {
    padding: 0 var(--space-4) var(--space-4);
}

.panel__title {
    font-size: var(--fs-sm);
    font-weight: 800;
}

.panel__text {
    font-size: var(--fs-sm);
    color: var(--text-2);
}

.panel--danger .panel__summary > .icon:first-child,
.panel--danger .panel__summary span {
    color: var(--danger);
}

.setting--static {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--line);
}

.setting--static > span:nth-child(2) {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.setting--static small {
    font-size: 12px;
    font-weight: 400;
    color: var(--muted);
}

.panel .settings {
    margin-top: 0;
}

.signout {
    margin-top: var(--space-3);
}

/* ---------- Photo cropper ---------- */

.cropper {
    width: min(420px, calc(100vw - 32px));
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--bg-2);
    color: var(--text);
}

.cropper::backdrop {
    background: rgba(2, 6, 23, 0.7);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.cropper__inner {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    padding: var(--space-5);
}

.cropper__title {
    font-size: var(--fs-lg);
    font-weight: 800;
}

.cropper__stage {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    touch-action: none;
}

.cropper__stage canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
}

.cropper__stage canvas:active {
    cursor: grabbing;
}

.cropper__mask {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: 50%;
    box-shadow: 0 0 0 999px rgba(2, 6, 23, 0.55);
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: -2px;
}

.cropper__zoom {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--fs-sm);
    font-weight: 600;
}

.cropper__zoom input {
    flex: 1;
    accent-color: var(--primary);
}

.cropper__hint {
    font-size: var(--fs-xs);
    color: var(--muted);
}

.cropper__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
}

.cropper__actions .btn.is-loading::after {
    border-color: rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
}

.credits .link {
    font-size: 11px;
}

@media (max-width: 380px) {
    .form__grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Google / Microsoft ---------- */

.divider {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: var(--space-5) 0;
    font-size: var(--fs-xs);
    color: var(--muted);
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line-strong);
}

.social {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.btn--social {
    gap: var(--space-3);
    height: 50px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    color: var(--text);
}

.btn--social:hover {
    border-color: var(--accent);
}

:root[data-theme="light"] .btn--social {
    background: #fff;
}

.provider-logo {
    width: 20px;
    height: 20px;
    flex: none;
}

.providers {
    display: flex;
    flex-direction: column;
    margin-top: var(--space-3);
}

.provider {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding-block: var(--space-3);
}

.provider + .provider {
    border-top: 1px solid var(--line);
}

.provider__text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    font-size: var(--fs-sm);
}

.provider__text small {
    font-size: 12px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: start;
    unicode-bidi: plaintext;
}

/* ---------- Passkeys ---------- */

.passkeys {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-top: var(--space-5);
    padding-top: var(--space-5);
    border-top: 1px solid var(--line);
}

.passkeys__head {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.passkeys__head .icon {
    color: var(--accent);
    width: 22px;
    height: 22px;
}

.passkeys__head span {
    display: flex;
    flex-direction: column;
    font-size: var(--fs-sm);
}

.passkeys__head small {
    color: var(--muted);
    font-size: 12px;
}

.passkeys .providers {
    margin-top: 0;
}

.provider > .icon {
    color: var(--muted);
}

.passkey-signin {
    margin-top: var(--space-3);
}

.passkey-signin .icon {
    color: var(--accent);
}

/* ---------- Selects ---------- */

select.field__input {
    appearance: none;
    -webkit-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    cursor: pointer;
}

[dir="ltr"] select.field__input {
    padding-right: 40px;
    background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
}

[dir="rtl"] select.field__input {
    padding-left: 40px;
    background-position: 14px 50%, 20px 50%;
}

select.field__input option {
    background: var(--bg-2);
    color: var(--text);
}

/* ---------- Family ---------- */

.avatar--md {
    width: 46px;
    height: 46px;
    font-size: var(--fs-md);
}

.avatar--female {
    background: linear-gradient(135deg, #F472B6, #A855F7);
}

.avatar--male {
    background: linear-gradient(135deg, #0EA5E9, #2563EB);
}

.members {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.member {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--line);
    transition: border-color 0.2s;
}

a.member:hover {
    border-color: var(--accent);
}

.member--self {
    background: transparent;
    border-style: dashed;
}

.member__text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    font-size: var(--fs-sm);
}

.member__text small {
    font-size: 12px;
    color: var(--muted);
}

.member__allergy {
    margin-top: 2px;
    font-size: 11px;
    font-weight: 700;
    color: var(--warn);
}

.member__chevron {
    color: var(--muted);
}

.form-danger {
    margin-top: var(--space-6);
    text-align: center;
}

.link-btn--danger {
    color: var(--danger);
}

.btn .icon {
    flex: none;
}

a.tile {
    transition: border-color 0.2s, transform 0.15s;
}

a.tile:hover {
    border-color: var(--accent);
}

a.tile:active {
    transform: scale(0.98);
}

/* ---------- Wallet ---------- */

.page-wallet .wallet-card {
    margin-top: var(--space-2);
}

.amounts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
}

.amount {
    height: 48px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line-strong);
    background: var(--surface);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    transition: border-color 0.2s, background-color 0.2s;
}

.amount:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.amounts + .field__hint {
    margin-top: var(--space-2);
}

.ledger__date {
    margin: var(--space-4) 0 var(--space-1);
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--muted);
}

.ledger__row {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    padding-block: var(--space-3);
}

.ledger__row + .ledger__row {
    border-top: 1px solid var(--line);
}

.ledger__icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 800;
    background: var(--ok-soft);
    color: var(--ok);
}

.ledger__row.is-debit .ledger__icon {
    background: var(--danger-soft);
    color: var(--danger);
}

.ledger__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: var(--fs-sm);
}

.ledger__text small {
    font-size: 11px;
    color: var(--muted);
    text-align: start;
}

.ledger__amount {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: var(--fs-sm);
    font-weight: 800;
    color: var(--ok);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ledger__row.is-debit .ledger__amount {
    color: var(--text);
}

.ledger__amount small {
    font-size: 11px;
    font-weight: 400;
    color: var(--muted);
}

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    margin-top: var(--space-5);
}

/* =====================================================================
   Food: library
   ===================================================================== */

.search {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    height: 48px;
    padding-inline: var(--space-4);
    border-radius: var(--radius-pill);
    background: var(--surface);
    border: 1px solid var(--line-strong);
}

.search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.search .icon {
    color: var(--muted);
}

.search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    background: transparent;
    font-size: var(--fs-sm);
}

.search input:focus {
    outline: none;
}

.filter-row {
    display: flex;
    gap: var(--space-2);
    overflow-x: auto;
    padding-block: var(--space-3) 0;
    margin-inline: calc(var(--space-5) * -1);
    padding-inline: var(--space-5);
    scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
    display: none;
}

.chip {
    display: inline-flex;
    align-items: center;
}

.chip.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--primary-ink);
}

.chip--quiet {
    height: 30px;
    border-style: dashed;
}

.program-filter {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: var(--space-4) 0;
    font-size: var(--fs-sm);
    font-weight: 700;
}

.program-filter label {
    white-space: nowrap;
    color: var(--text-2);
}

.program-filter .field__input {
    height: 42px;
    font-size: var(--fs-sm);
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
}

:root[data-view="full"] .recipe-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.recipe-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
    height: 100%;
    min-height: 170px;
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--tint, var(--surface));
    transition: border-color 0.2s, transform 0.15s;
}

.recipe-card:hover {
    border-color: var(--accent);
}

.recipe-card:active {
    transform: scale(0.98);
}

.recipe-card--egypt   { --tint: var(--tint-egyptian); }
.recipe-card--gulf    { --tint: var(--tint-gulf); }
.recipe-card--levant  { --tint: var(--tint-levantine); }
.recipe-card--maghreb { --tint: var(--tint-international); }

.recipe-card__icon {
    font-size: 34px;
    line-height: 1.1;
    margin-bottom: auto;
}

.recipe-card__name {
    margin-top: var(--space-3);
    font-size: var(--fs-sm);
    font-weight: 800;
    line-height: 1.35;
}

.recipe-card__meta {
    font-size: 11px;
    color: var(--muted);
}

.recipe-card__kcal {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-2);
}

.recipe-card__badge {
    position: absolute;
    top: var(--space-3);
    inset-inline-end: var(--space-3);
    padding: 1px var(--space-2);
    border-radius: var(--radius-pill);
    background: var(--ok-soft);
    color: var(--ok);
    font-size: 10px;
    font-weight: 800;
}

.recipe-card__warn {
    position: absolute;
    bottom: var(--space-3);
    inset-inline-end: var(--space-3);
    color: var(--warn);
    font-size: 14px;
}

.hint-card {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-5);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    border: 1px dashed var(--accent);
    background: var(--accent-soft);
    font-size: var(--fs-sm);
}

.hint-card .icon {
    color: var(--accent);
}

/* =====================================================================
   Food: recipe detail
   ===================================================================== */

.recipe__head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-6) var(--space-4);
    margin-bottom: var(--space-2);
    border-radius: var(--radius-lg);
    text-align: center;
    background: var(--tint, var(--surface));
}

.recipe__head--egypt   { --tint: var(--tint-egyptian); }
.recipe__head--gulf    { --tint: var(--tint-gulf); }
.recipe__head--levant  { --tint: var(--tint-levantine); }
.recipe__head--maghreb { --tint: var(--tint-international); }

.recipe__icon {
    font-size: 56px;
    line-height: 1.1;
}

.recipe__title {
    font-size: var(--fs-xl);
    font-weight: 800;
}

.recipe__desc {
    max-width: 40ch;
    font-size: var(--fs-sm);
    color: var(--text-2);
}

.recipe__facts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.recipe__facts li {
    padding: 2px var(--space-3);
    border-radius: var(--radius-pill);
    background: var(--surface);
    font-size: var(--fs-xs);
    font-weight: 700;
}

.nutrients {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-2);
    margin: 0 0 var(--space-2);
}

.nutrient {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    padding: var(--space-3) var(--space-1);
    border-radius: var(--radius-md);
    background: var(--surface);
    text-align: center;
}

.nutrient dd {
    margin: 0;
    font-size: var(--fs-lg);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.nutrient dd small {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
}

.nutrient dt {
    font-size: 11px;
    color: var(--muted);
}

.nutrient--kcal dd {
    color: var(--accent);
}

.fit-list {
    display: flex;
    flex-direction: column;
}

.fit {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding-block: var(--space-2);
}

.fit + .fit {
    border-top: 1px solid var(--line);
}

.fit__mark {
    display: grid;
    place-items: center;
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 800;
}

.fit--yes .fit__mark     { background: var(--ok-soft);     color: var(--ok); }
.fit--no .fit__mark      { background: var(--danger-soft); color: var(--danger); }
.fit--pending .fit__mark { background: var(--surface-2);   color: var(--muted); }

.fit__text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    font-size: var(--fs-sm);
}

.fit__text small {
    font-size: 12px;
    color: var(--muted);
}

.fit__who {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
}

.page-recipe .stepper__value {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding-inline: var(--space-1);
}

.page-recipe .stepper__value small {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
}

.ingredients {
    display: flex;
    flex-direction: column;
}

.ingredient {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    padding-block: var(--space-2);
    font-size: var(--fs-sm);
}

.ingredient + .ingredient {
    border-top: 1px solid var(--line);
}

.ingredient__icon {
    font-size: 18px;
    line-height: 1;
}

.ingredient__name small {
    margin-inline-start: 4px;
    font-size: 11px;
    color: var(--muted);
}

.ingredient__qty {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ingredient.is-optional {
    opacity: 0.75;
}

.steps {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.step {
    display: flex;
    gap: var(--space-3);
}

.step__n {
    display: grid;
    place-items: center;
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--primary-ink);
    font-weight: 800;
    font-size: var(--fs-sm);
}

.step__body p {
    font-size: var(--fs-md);
    line-height: 1.8;
}

.step__timer {
    display: inline-block;
    margin-top: var(--space-1);
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--accent);
}

@media (max-width: 380px) {
    .nutrients {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* =====================================================================
   Food section tabs
   ===================================================================== */

.food-tabs {
    display: flex;
    gap: var(--space-1);
    margin: 0 calc(var(--space-5) * -1) var(--space-2);
    padding: 0 var(--space-5) var(--space-1);
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--line);
}

.food-tabs::-webkit-scrollbar {
    display: none;
}

.food-tabs__item {
    position: relative;
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: var(--space-2) var(--space-3);
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--muted);
    white-space: nowrap;
}

.food-tabs__item.is-active {
    color: var(--text);
}

.food-tabs__item.is-active::after {
    content: '';
    position: absolute;
    inset-inline: var(--space-3);
    bottom: -5px;
    height: 3px;
    border-radius: 3px;
    background: var(--accent);
}

.food-tabs__badge {
    min-width: 18px;
    height: 18px;
    padding-inline: 5px;
    border-radius: var(--radius-pill);
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
}

.banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--fs-sm);
    font-weight: 700;
}

.banner--warn {
    background: var(--warn-soft);
    border: 1px solid var(--warn);
}

/* =====================================================================
   Pantry & essentials rows
   ===================================================================== */

.pantry-list {
    display: flex;
    flex-direction: column;
}

.pantry-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: var(--space-2);
    padding-block: var(--space-2);
}

.pantry-row + .pantry-row {
    border-top: 1px solid var(--line);
}

.pantry-row__icon {
    font-size: 20px;
    line-height: 1;
}

.pantry-row__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: var(--fs-sm);
}

.pantry-row__text small {
    font-size: 12px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.pantry-row.is-low .pantry-row__state  { color: var(--warn);   font-weight: 700; }
.pantry-row.is-out .pantry-row__state  { color: var(--danger); font-weight: 700; }
.pantry-row.is-out .pantry-row__icon   { opacity: 0.5; }

.pantry-row .stepper__btn {
    width: 30px;
    height: 30px;
}

.page-pantry .panel,
.page-essentials .panel {
    margin-bottom: var(--space-4);
}

.page-essentials .pantry-list {
    margin-bottom: var(--space-4);
}

/* =====================================================================
   Cart
   ===================================================================== */

.cart-store {
    margin-bottom: var(--space-4);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 3px solid var(--brand, var(--accent));
}

.cart-store__head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    font-size: var(--fs-sm);
}

.cart-store__meta {
    margin-inline-start: auto;
    font-size: 11px;
    color: var(--muted);
}

.cart-store__warn {
    margin-top: var(--space-2);
    font-size: 12px;
    font-weight: 700;
    color: var(--warn);
}

.cart-lines {
    margin-top: var(--space-2);
}

.cart-line {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    grid-template-areas:
        "icon text  total"
        "icon step  step"
        "cmp  cmp   cmp";
    align-items: center;
    column-gap: var(--space-3);
    row-gap: var(--space-1);
    padding-block: var(--space-3);
}

.cart-line + .cart-line {
    border-top: 1px solid var(--line);
}

.cart-line__icon  { grid-area: icon; font-size: 20px; align-self: start; }
.cart-line__text  { grid-area: text; display: flex; flex-direction: column; min-width: 0; font-size: var(--fs-sm); }
.cart-line__text small { font-size: 11px; color: var(--muted); }
.cart-line__total { grid-area: total; font-size: var(--fs-sm); font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cart-line .stepper { grid-area: step; justify-self: start; }
.cart-line .compare { grid-area: cmp; }

.compare summary {
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    list-style: none;
}

.compare summary::-webkit-details-marker {
    display: none;
}

.compare ul {
    margin-top: var(--space-2);
    border-radius: var(--radius-md);
    background: var(--surface-2);
}

.compare li {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    font-size: 12px;
}

.compare li + li {
    border-top: 1px solid var(--line);
}

.compare__price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.compare__price small {
    font-size: 10px;
    font-weight: 600;
    color: var(--muted);
}

.compare__price.is-cheaper small {
    color: var(--ok);
}

.wallet-line {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--ok-soft);
    font-size: var(--fs-xs);
}

.wallet-line strong {
    margin-inline-start: auto;
    white-space: nowrap;
}

.wallet-line.is-short {
    background: var(--danger-soft);
}

.wallet-line .icon {
    color: var(--accent);
}

.summary .form {
    margin-top: var(--space-4);
}

.cart-clear {
    display: block;
    margin: var(--space-4) auto 0;
}

/* =====================================================================
   Orders
   ===================================================================== */

.order .panel__summary {
    align-items: center;
}

.order__status {
    flex: none;
    padding: 2px var(--space-2);
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 800;
}

.order__status--placed    { background: var(--accent-soft); color: var(--accent); }
.order__status--delivered { background: var(--ok-soft);     color: var(--ok); }
.order__status--cancelled { background: var(--surface-2);   color: var(--muted); }

.order__head {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    font-size: var(--fs-sm);
}

.order__head small {
    font-size: 11px;
    font-weight: 400;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order__total {
    font-size: var(--fs-sm);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.order__lines li {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-2);
    padding-block: 6px;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.order__fees {
    color: var(--muted);
    border-top: 1px dashed var(--line-strong);
}

.order__actions {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

/* =====================================================================
   Recipe: shopping actions
   ===================================================================== */

.ingredient.is-missing .ingredient__qty {
    color: var(--warn);
}

.ingredient.is-missing .ingredient__name::after {
    content: ' •';
    color: var(--warn);
}

.recipe-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-top: var(--space-4);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.recipe-actions__status {
    font-size: var(--fs-sm);
    font-weight: 700;
}

/* =====================================================================
   Meal plan
   ===================================================================== */

.segmented--3 {
    grid-template-columns: repeat(3, 1fr);
}

.checks {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-5);
}

.plan-programs {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    margin-bottom: var(--space-4);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--surface);
    font-size: var(--fs-xs);
}

.plan-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
    margin: 0 0 var(--space-3);
}

.plan-stats > div {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.plan-stats dd {
    margin: 0;
    font-size: var(--fs-xl);
    font-weight: 800;
    color: var(--accent);
}

.plan-stats dt {
    font-size: 11px;
    color: var(--muted);
}

.plan-fit {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--fs-sm);
    font-weight: 700;
}

.plan-fit.is-full    { background: var(--ok-soft);   color: var(--ok); }
.plan-fit.is-partial { background: var(--warn-soft); color: var(--text); border: 1px solid var(--warn); }

.week-costs li {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    padding-block: var(--space-2);
    font-size: var(--fs-sm);
}

.week-costs li + li {
    border-top: 1px solid var(--line);
}

.week-costs bdi {
    font-weight: 700;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.week-costs__total {
    font-weight: 800;
}

.week-costs__total bdi {
    color: var(--accent);
}

.plan-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin: var(--space-5) 0;
}

.plan-actions__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
}

.plan-day {
    padding-block: var(--space-3);
}

.plan-day + .plan-day {
    border-top: 1px solid var(--line);
}

.plan-day__title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--fs-sm);
    font-weight: 800;
    margin-bottom: var(--space-1);
}

.plan-day.is-today .plan-day__title {
    color: var(--accent);
}

.plan-meal {
    display: grid;
    grid-template-columns: 64px 26px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-2);
    padding-block: var(--space-2);
}

.plan-meal__slot {
    font-size: var(--fs-xs);
    color: var(--muted);
    font-weight: 600;
}

.plan-meal__icon {
    font-size: 20px;
    line-height: 1;
}

.plan-meal__name {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: var(--fs-sm);
    font-weight: 700;
}

.plan-meal__name .pill {
    align-self: flex-start;
    margin-top: 2px;
}

.plan-meal__miss {
    font-size: 11px;
    font-weight: 600;
    color: var(--warn);
}

.plan-meal.is-cooked .plan-meal__name,
.plan-meal.is-skipped .plan-meal__name {
    color: var(--muted);
}

.plan-meal.is-skipped .plan-meal__name {
    text-decoration: line-through;
}

.plan-meal__actions {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
}

.more {
    position: relative;
}

.more summary {
    display: grid;
    place-items: center;
    width: 30px;
    height: 28px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    list-style: none;
    color: var(--muted);
    font-weight: 800;
}

.more summary::-webkit-details-marker {
    display: none;
}

.more__menu {
    position: absolute;
    top: calc(100% + 4px);
    inset-inline-end: 0;
    z-index: 10;
    min-width: 180px;
    padding: var(--space-1);
    border-radius: var(--radius-md);
    background: var(--bg-2);
    border: 1px solid var(--line-strong);
    box-shadow: 0 16px 40px -12px rgba(2, 6, 23, 0.6);
}

.more__menu button {
    display: block;
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    text-align: start;
}

.more__menu button:hover {
    background: var(--accent-soft);
}

.weeks {
    display: flex;
    gap: var(--space-2);
    overflow-x: auto;
    margin: 0 calc(var(--space-5) * -1) var(--space-3);
    padding: 0 var(--space-5) var(--space-1);
    scrollbar-width: none;
}

.week {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--line);
    font-size: var(--fs-xs);
}

.week.is-current {
    border-color: var(--accent);
}

.week__label {
    font-weight: 800;
}

.week__state {
    color: var(--ok);
    font-weight: 700;
}

.center {
    text-align: center;
    margin: var(--space-4) 0;
}

.page-plan .panel {
    margin-top: var(--space-5);
}

/* Home: today's meals */
.today__list li {
    display: grid;
    grid-template-columns: 56px 26px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-2);
    padding-block: var(--space-2);
}

.today__list li + li {
    border-top: 1px solid var(--line);
}

.today__slot {
    font-size: var(--fs-xs);
    color: var(--muted);
}

.today__icon {
    font-size: 20px;
}

.today__name {
    font-size: var(--fs-sm);
    font-weight: 700;
}

/* =====================================================================
   Cooking mode
   ===================================================================== */

.page-cook .tabbar {
    display: none;
}

.page-cook .screen {
    padding-bottom: var(--space-8);
}

.cook {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.cook__head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.cook__icon {
    font-size: 40px;
    line-height: 1;
}

.cook__title {
    font-size: var(--fs-lg);
    font-weight: 800;
}

.cook__meta {
    font-size: var(--fs-xs);
    color: var(--muted);
}

.cook__progress {
    height: 6px;
    border-radius: 6px;
    background: var(--line);
    overflow: hidden;
}

.cook__progress span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width 0.35s var(--ease);
}

[dir="rtl"] .cook__progress span {
    margin-inline-start: 0;
}

.cook__counter {
    font-size: var(--fs-sm);
    font-weight: 800;
    color: var(--accent);
}

.cook__text {
    min-height: 8em;
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.8;
}

.cook__timer .timer-btn {
    height: 48px;
    padding-inline: var(--space-5);
    font-size: var(--fs-md);
}

.cook__nav {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--space-2);
}

.cook__nav .btn {
    height: 56px;
    padding-inline: var(--space-3);
    font-size: var(--fs-md);
    white-space: nowrap;
}

.cook__finish {
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    background: var(--ok-soft);
    text-align: center;
    font-weight: 700;
}

.cook__finish p {
    margin-bottom: var(--space-4);
}

.cook__tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
}

.cook-tool {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    height: 46px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--line-strong);
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--muted);
}

.cook-tool.is-on {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

.cook-tool:disabled {
    opacity: 0.4;
}

.cook__hint {
    font-size: var(--fs-xs);
    color: var(--muted);
    text-align: center;
}

.plan-meal--alt {
    padding-top: 0;
}

.plan-meal--alt .plan-meal__name {
    font-weight: 600;
}

.plan-meal__for {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
}

/* =====================================================================
   Searchable dropdowns
   ===================================================================== */

.combo {
    position: relative;
}

.combo__input {
    cursor: text;
}

[dir="rtl"] .combo__input {
    padding-left: 44px;
}

[dir="ltr"] .combo__input {
    padding-right: 44px;
}

.combo__toggle {
    position: absolute;
    top: 0;
    inset-inline-end: 0;
    width: 44px;
    height: 50px;
    cursor: pointer;
}

.combo__toggle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: translate(-50%, -70%) rotate(45deg);
    transition: transform 0.2s var(--ease);
}

.combo.is-open .combo__toggle::before {
    transform: translate(-50%, -30%) rotate(-135deg);
}

.combo__list {
    max-height: 264px;
    margin-top: 6px;
    padding: 4px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: var(--radius-md);
    border: 1px solid var(--line-strong);
    background: var(--bg-2);
    box-shadow: 0 16px 40px -16px rgba(2, 6, 23, 0.6);
    scrollbar-width: thin;
}

.combo__option {
    padding: 10px var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    cursor: pointer;
}

.combo__option.is-active {
    background: var(--accent-soft);
    color: var(--text);
}

.combo__option[aria-selected="true"] {
    font-weight: 800;
    color: var(--accent);
}

.combo__empty {
    padding: var(--space-3);
    font-size: var(--fs-sm);
    color: var(--muted);
    text-align: center;
}

.combo.has-error .combo__input {
    border-color: var(--danger);
}

/* =====================================================================
   Home: briefing
   ===================================================================== */

.page-home .screen {
    padding-bottom: calc(var(--tabbar-h) + 150px);
}

.brief {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-2) 0 var(--space-5);
    text-align: center;
}

.orb--brief {
    --orb-size: 112px;
    margin: var(--space-2) 0 var(--space-4);
}

.orb--brief .wave {
    height: 40px;
    gap: 4px;
}

.orb--brief .wave i {
    width: 5px;
}

.brief__date {
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--muted);
}

.brief__greeting {
    margin-top: 2px;
    font-size: var(--fs-2xl);
    font-weight: 800;
    line-height: 1.25;
}

html[lang^="ar"] .brief__greeting {
    letter-spacing: 0;
}

.brief__text {
    max-width: 38ch;
    margin-top: var(--space-3);
    font-size: var(--fs-md);
    line-height: 1.85;
    color: var(--text-2);
}

.brief__text p + p {
    margin-top: 2px;
}

.brief__listen {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-4);
    padding: 6px var(--space-4);
    border-radius: var(--radius-pill);
    border: 1px solid var(--line-strong);
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--accent);
}

.brief__listen .icon {
    width: 16px;
    height: 16px;
}

.brief-cards {
    display: grid;
    gap: var(--space-3);
}

:root[data-view="full"] .brief-cards {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    align-items: start;
}

.bcard {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--line);
}

a.bcard:hover {
    border-color: var(--accent);
}

.bcard__title {
    font-size: var(--fs-xs);
    font-weight: 800;
    color: var(--muted);
    text-transform: none;
}

.bcard__meals li {
    display: grid;
    grid-template-columns: 24px 54px minmax(0, 1fr);
    align-items: center;
    gap: var(--space-2);
    padding-block: 4px;
    font-size: var(--fs-sm);
}

.bcard__meals li span:nth-child(2) {
    font-size: var(--fs-xs);
    color: var(--muted);
}

.bcard__meals li.is-cooked strong {
    color: var(--muted);
    text-decoration: line-through;
}

.bcard__empty {
    font-size: var(--fs-sm);
    color: var(--accent);
}

.bcard__list li a {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding-block: 6px;
    font-size: var(--fs-sm);
    font-weight: 600;
}

.bcard__list li + li {
    border-top: 1px solid var(--line);
}

.bcard__list .icon {
    width: 16px;
    height: 16px;
    margin-inline-start: auto;
    color: var(--muted);
}

.sleep-picks {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
}

.sleep-pick {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--space-2);
    border-radius: var(--radius-md);
    border: 1px solid var(--line-strong);
    font-size: var(--fs-xs);
    font-weight: 700;
}

.sleep-pick span {
    font-size: 22px;
    line-height: 1.2;
}

.sleep-pick.is-active {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

.bcard__chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

/* One microphone, docked above the tabs (the device frame is its containing block) */
.dock {
    position: fixed;
    inset-inline: 0;
    bottom: calc(var(--tabbar-h) + var(--space-3) + env(safe-area-inset-bottom, 0px));
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    pointer-events: none;
}

:root[data-view="full"] .dock {
    bottom: calc(var(--tabbar-h) + var(--space-8));
}

.dock::before {
    content: '';
    position: absolute;
    inset: -28px 0 -16px;
    z-index: -1;
    background: linear-gradient(to top, var(--bg-2) 45%, transparent);
    pointer-events: none;
}

body.sheet-open .dock {
    visibility: hidden;
}

body.sheet-open .toasts {
    top: calc(var(--space-8) + env(safe-area-inset-top, 0px));
    bottom: auto;
}

.dock > * {
    pointer-events: auto;
}

.dock__side {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    color: var(--text-2);
    box-shadow: 0 0 0 5px var(--bg-2);
}

/* =====================================================================
   Conversation sheet
   ===================================================================== */

.sheet {
    position: absolute;
    inset: 0;
    z-index: 40;
}

.sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.55);
    opacity: 0;
    transition: opacity 0.22s var(--ease);
}

.sheet__panel {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    height: 88%;
    margin-inline: auto;
    max-width: 760px;
    border-radius: 28px 28px 0 0;
    background: var(--bg-2);
    border-top: 1px solid var(--line-strong);
    box-shadow: 0 -20px 60px -20px rgba(2, 6, 23, 0.8);
    transform: translateY(100%);
    transition: transform 0.24s var(--ease);
}

.sheet.is-open .sheet__backdrop { opacity: 1; }
.sheet.is-open .sheet__panel { transform: none; }

.sheet__head {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-5) var(--space-2);
}

.sheet__titles {
    flex: 1;
    min-width: 0;
}

.sheet__title {
    font-size: var(--fs-lg);
    font-weight: 800;
}

.sheet .orb-status {
    margin: 0;
    max-width: none;
    font-size: var(--fs-xs);
    text-align: start;
}

.sheet .feed {
    flex: 1;
    overflow-y: auto;
    margin: 0;
    padding: var(--space-2) var(--space-5);
    overscroll-behavior: contain;
}

.sheet .chips {
    margin: 0;
    padding: var(--space-2) var(--space-5);
}

.sheet .composer {
    margin: var(--space-2) var(--space-5) calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
}

body.sheet-open .tabbar {
    visibility: hidden;
}

/* =====================================================================
   Conversations page
   ===================================================================== */

.history-day {
    padding-block: var(--space-4);
}

.history-day + .history-day {
    border-top: 1px solid var(--line);
}

.history-day__title {
    margin-bottom: var(--space-3);
    font-size: var(--fs-xs);
    font-weight: 800;
    color: var(--muted);
    text-align: center;
}

.bubble__time {
    display: block;
    margin-top: 4px;
    font-size: 10px;
    opacity: 0.7;
    text-align: end;
}

.page-conversations .search {
    margin-bottom: var(--space-3);
}

/* ---------- Home v2: logo on top, the orb is the talk button ---------- */

.brief__logo {
    width: 132px;
    height: auto;
    margin: var(--space-2) 0 var(--space-4);
}

:root[data-theme="light"] .brief__logo {
    filter: drop-shadow(0 1px 1px rgba(15, 23, 42, 0.25));
}

.dock {
    align-items: center;
    gap: var(--space-6);
}

.dock__center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.orb--dock {
    --orb-size: 72px;
    margin: 0;
    box-shadow: 0 0 0 5px var(--bg-2);
    border-radius: 50%;
}

.orb--dock .orb__halo {
    inset: -16px;
}

.orb--dock .orb__ring {
    inset: -6px;
}

.orb--dock .wave {
    height: 28px;
    gap: 3px;
}

.orb--dock .wave i {
    width: 4px;
}

.dock__hey {
    font-family: var(--font);
    font-size: var(--fs-xs);
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--accent);
    white-space: nowrap;
}

.bcard--tomorrow .bcard__chips {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bcard--tomorrow .chip {
    justify-content: center;
}

/* =====================================================================
   Planner (agenda)
   ===================================================================== */

.week {
    display: grid;
    grid-template-columns: 28px repeat(7, minmax(0, 1fr)) 28px;
    align-items: center;
    gap: 4px;
    margin-bottom: var(--space-4);
}

.week__nav {
    display: grid;
    place-items: center;
    height: 56px;
    color: var(--muted);
}

.week__day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 0;
    border-radius: var(--radius-md);
    transition: background-color 0.2s;
}

.week__day:hover {
    background: var(--accent-soft);
}

.week__name {
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
}

.week__num {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: var(--fs-sm);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.week__day.is-today .week__num {
    color: var(--accent);
    box-shadow: inset 0 0 0 1.5px var(--accent);
}

.week__day.is-selected .week__num {
    background: var(--primary);
    color: var(--primary-ink);
    box-shadow: none;
}

.week__dots {
    display: flex;
    gap: 2px;
    height: 5px;
}

.week__dots i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
}

.quick-add {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    padding: 5px;
    padding-inline-start: var(--space-4);
    margin-bottom: var(--space-5);
    border-radius: var(--radius-pill);
    background: var(--surface);
    border: 1px dashed var(--line-strong);
}

.quick-add:focus-within {
    border-style: solid;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.quick-add input {
    flex: 1;
    min-width: 0;
    height: 40px;
    border: 0;
    background: transparent;
    font-size: var(--fs-sm);
}

.quick-add input:focus {
    outline: none;
}

.quick-add input::placeholder {
    color: var(--muted);
}

.day-agenda__title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
    font-size: var(--fs-md);
    font-weight: 800;
}

.agenda {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.agenda__item {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--surface);
    border-inline-start: 3px solid var(--accent);
}

.agenda__item--bill        { border-inline-start-color: var(--warn); }
.agenda__item--birthday    { border-inline-start-color: #F472B6; }
.agenda__item--alarm       { border-inline-start-color: #A78BFA; }
.agenda__item--appointment { border-inline-start-color: var(--ok); }
.agenda__item--travel      { border-inline-start-color: #FB923C; }
.agenda__item--meal        { border-inline-start-color: var(--line-strong); background: transparent; border: 1px dashed var(--line); border-inline-start-width: 3px; }

.agenda__time {
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
}

.agenda__body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.agenda__title {
    font-size: var(--fs-sm);
    font-weight: 700;
}

.agenda__meta {
    font-size: 11px;
    color: var(--muted);
}

.agenda__item.is-done .agenda__title,
.agenda__item.is-cooked .agenda__title {
    color: var(--muted);
    text-decoration: line-through;
}

.agenda__sub {
    margin: var(--space-5) 0 var(--space-2);
    font-size: var(--fs-xs);
    font-weight: 800;
    color: var(--muted);
}

.agenda--compact .agenda__item {
    grid-template-columns: 64px minmax(0, 1fr);
    padding: var(--space-2) var(--space-3);
}

.check-btn {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--line-strong);
    color: transparent;
    font-weight: 800;
}

.check-btn:hover {
    border-color: var(--ok);
    color: var(--ok);
}

.check-btn.is-on {
    border-color: var(--ok);
    background: var(--ok);
    color: #04140D;
}

/* Event form */
.type-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-2);
}

.type-pick {
    position: relative;
    cursor: pointer;
}

.type-pick input {
    position: absolute;
    opacity: 0;
    inset: 0;
}

.type-pick span {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--space-2) 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line-strong);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

.type-pick b {
    font-size: 20px;
    font-weight: 400;
}

.type-pick input:checked + span {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

.type-pick input:focus-visible + span {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.field__input--area {
    height: auto;
    min-height: 90px;
    padding-block: var(--space-3);
    resize: vertical;
    line-height: 1.6;
}

/* Notifications */
.bell {
    position: relative;
}

.bell__count {
    position: absolute;
    top: 2px;
    inset-inline-end: 2px;
    min-width: 16px;
    height: 16px;
    padding-inline: 4px;
    border-radius: var(--radius-pill);
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 16px;
    text-align: center;
}

.notif-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.notif a {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--surface);
    font-size: var(--fs-sm);
}

.notif.is-new a {
    border-inline-start: 3px solid var(--accent);
}

.notif span {
    color: var(--text-2);
}

.notif small {
    font-size: 11px;
    color: var(--muted);
}

/* Calendar sync */
.calendar-sync__title {
    margin-top: var(--space-5);
}

.calendar-link {
    margin: var(--space-3) 0;
}

.sync-steps {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    margin-bottom: var(--space-3);
    font-size: 12px;
    color: var(--text-2);
}

.bcard__events li span:nth-child(2) {
    font-variant-numeric: tabular-nums;
}

/* Push notifications & install */
.push-box {
    padding: var(--space-4);
    margin-bottom: var(--space-4);
    border-radius: var(--radius-md);
    background: var(--surface-2);
}

.push-box .panel__title {
    margin-bottom: var(--space-2);
}

.push-on {
    color: var(--ok);
    font-weight: 700;
}

.push-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-top: var(--space-3);
}

.install-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    border: 1px dashed var(--accent);
    font-size: var(--fs-sm);
}

/* Diagnostics */
.diag li {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    column-gap: var(--space-2);
    padding-block: var(--space-2);
    font-size: var(--fs-sm);
    border-bottom: 1px solid var(--line);
}

.diag li > span {
    grid-row: span 3;
    font-weight: 800;
}

.diag li small {
    grid-column: 2;
    font-size: 12px;
    color: var(--muted);
    word-break: break-word;
}

.diag li.is-ok > span { color: var(--ok); }
.diag li.is-bad > span { color: var(--danger); }

/* =====================================================================
   Car
   ===================================================================== */

.car-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-8) var(--space-4);
    text-align: center;
}

.car-empty__icon {
    font-size: 64px;
}

.car-empty h1 {
    font-size: var(--fs-xl);
    font-weight: 800;
}

.car-empty p {
    max-width: 34ch;
    color: var(--text-2);
}

.car-card {
    margin: var(--space-2) 0 var(--space-4);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--accent-soft), var(--surface));
    border: 1px solid var(--line);
}

.car-card__head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.car-card__head > div {
    flex: 1;
    min-width: 0;
}

.car-card__icon {
    font-size: 40px;
    line-height: 1;
}

.car-card__name {
    font-size: var(--fs-lg);
    font-weight: 800;
}

.car-card__meta {
    font-size: var(--fs-xs);
    color: var(--text-2);
}

.plate {
    padding: 0 6px;
    border-radius: 4px;
    border: 1px solid var(--line-strong);
    font-weight: 700;
    white-space: nowrap;
}

.odo {
    display: grid;
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.odo__value {
    display: flex;
    flex-direction: column;
}

.odo__label {
    font-size: var(--fs-xs);
    color: var(--muted);
    font-weight: 700;
}

.odo__value strong {
    align-self: flex-start;
    font-size: 2rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.odo__value strong small {
    font-size: var(--fs-sm);
    color: var(--muted);
}

.odo__hint {
    font-size: 11px;
    color: var(--muted);
}

.odo__form {
    display: flex;
    gap: var(--space-2);
}

.odo__form .field__input {
    flex: 1;
    min-width: 0;
    height: 42px;
}

.svc-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.svc {
    --state: var(--line-strong);
    border-radius: var(--radius-md);
    background: var(--surface);
    border-inline-start: 3px solid var(--state);
}

.svc.is-overdue { --state: var(--danger); }
.svc.is-due     { --state: var(--warn); }
.svc.is-soon    { --state: #FACC15; }
.svc.is-ok      { --state: var(--ok); }

.svc:not(:has(details)),
.svc__details > summary {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
}

.svc__details > summary {
    cursor: pointer;
    list-style: none;
}

.svc__details > summary::-webkit-details-marker {
    display: none;
}

.svc__icon {
    font-size: 20px;
    line-height: 1;
}

.svc__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: var(--fs-sm);
}

.svc__text small {
    font-size: 12px;
    color: var(--muted);
}

.svc__state {
    padding: 2px var(--space-2);
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 800;
    color: var(--state);
    background: color-mix(in srgb, var(--state) 14%, transparent);
    white-space: nowrap;
}

.svc.is-unknown .svc__state {
    color: var(--muted);
}

.svc__form {
    padding: 0 var(--space-3) var(--space-3);
}

.fuel-stats {
    margin-bottom: var(--space-4);
}

.fuel-stats .nutrient dd {
    font-size: var(--fs-md);
}

.fuel-list {
    display: flex;
    flex-direction: column;
}

.fuel-row {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    padding-block: var(--space-2);
}

.fuel-row + .fuel-row {
    border-top: 1px solid var(--line);
}

.fuel-row__date {
    font-size: var(--fs-xs);
    color: var(--muted);
}

.fuel-row__main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: var(--fs-sm);
}

.fuel-row__main small {
    font-size: 12px;
    color: var(--muted);
}

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

.setup-box {
    padding: var(--space-4);
    border-radius: var(--radius-md);
    border: 1px dashed var(--line-strong);
}

.setup-box legend {
    padding-inline: var(--space-2);
    font-size: var(--fs-sm);
    font-weight: 800;
}

.checks--grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
}

.vehicle-switch {
    margin-bottom: var(--space-3);
}

.page-service .panel,
.page-papers .panel,
.page-fuel .panel {
    margin-block: var(--space-4);
}

@media (max-width: 380px) {
    .type-grid--4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* =====================================================================
   Health
   ===================================================================== */

.doses {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.dose {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--surface);
    border-inline-start: 3px solid var(--line-strong);
}

.dose.is-due     { border-inline-start-color: var(--accent); background: var(--accent-soft); }
.dose.is-late    { border-inline-start-color: var(--warn); }
.dose.is-taken   { border-inline-start-color: var(--ok); }
.dose.is-skipped { opacity: 0.6; }

.dose__time {
    font-size: var(--fs-sm);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.dose__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: var(--fs-sm);
}

.dose__text small {
    font-size: 12px;
    color: var(--muted);
}

.dose.is-taken .dose__text strong {
    color: var(--muted);
    text-decoration: line-through;
}

.dose__actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.vitals {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
}

:root[data-view="full"] .vitals {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.vital {
    --tone: var(--line-strong);
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--surface);
    border-top: 3px solid var(--tone);
}

.vital.is-ok   { --tone: var(--ok); }
.vital.is-warn { --tone: var(--warn); }
.vital.is-bad  { --tone: var(--danger); }

.vital__label {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
}

.vital__value {
    font-size: var(--fs-xl);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.vital__value small {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
}

.vital__note {
    font-size: 11px;
    color: var(--text-2);
}

.tone--ok   { color: var(--ok); font-weight: 700; }
.tone--warn { color: var(--warn); font-weight: 700; }
.tone--bad  { color: var(--danger); font-weight: 700; }

.chart-box {
    margin-bottom: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.chart {
    direction: ltr;
    display: block;
    width: 100%;
    height: 130px;
}

.chart__line {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2.5;
    stroke-linejoin: round;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}

.chart__line--1 {
    stroke: #F472B6;
}

.chart__dot {
    fill: var(--accent);
    stroke: none;
}

.chart__dot.chart__line--1 {
    fill: #F472B6;
}

.chart__label {
    font-size: 10px;
    fill: var(--muted);
}

.med-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.med-card {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--line);
}

.med-card:hover {
    border-color: var(--accent);
}

.med-card__icon {
    font-size: 22px;
}

.med-card__body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: var(--fs-sm);
}

.med-card__body small {
    font-size: 12px;
    color: var(--muted);
}

.med-card__stock {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.med-card__stock small {
    font-size: 10px;
    font-weight: 600;
    color: var(--muted);
}

.med-card__stock.is-low {
    color: var(--warn);
}

.presets {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.time-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.time-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.time-row .field__input {
    flex: 1;
}

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

.plain-list li {
    padding-block: var(--space-2);
    font-size: var(--fs-sm);
}

.plain-list li + li {
    border-top: 1px solid var(--line);
}

.reading-form {
    margin: var(--space-3) 0 var(--space-5);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

/* Apple Health connection */
.connect-status {
    margin-bottom: var(--space-4);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--surface-2);
    font-size: var(--fs-sm);
    font-weight: 700;
}

.connect-status.is-ok {
    background: var(--ok-soft);
    color: var(--ok);
}

.howto {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding-inline-start: var(--space-5);
    list-style: decimal;
    font-size: var(--fs-sm);
    line-height: 1.7;
}

.code-box {
    margin-top: var(--space-2);
    padding: var(--space-3);
    border-radius: var(--radius-sm);
    background: var(--bg);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.8;
    text-align: left;
}

@media (max-width: 380px) {
    .form__grid--3 {
        grid-template-columns: 1fr;
    }
}

/* =====================================================================
   Places & map
   ===================================================================== */

.places {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.place-row {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--surface-2);
}

.place-row__icon {
    font-size: 22px;
}

.place-row__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: var(--fs-sm);
}

.place-row__text small {
    font-size: 12px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.place-search {
    padding-inline-end: 6px;
}

.place-results {
    margin-top: var(--space-2);
    border-radius: var(--radius-md);
    background: var(--bg-2);
    border: 1px solid var(--line-strong);
    overflow: hidden;
}

.place-results button {
    display: block;
    width: 100%;
    padding: var(--space-3);
    font-size: var(--fs-sm);
    text-align: start;
    line-height: 1.5;
}

.place-results li + li {
    border-top: 1px solid var(--line);
}

.place-results button:hover {
    background: var(--accent-soft);
}

.place-results__note {
    padding: var(--space-3);
    font-size: var(--fs-sm);
    color: var(--muted);
}

.map-wrap {
    position: relative;
    margin: var(--space-3) 0 var(--space-2);
}

.map {
    height: 340px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line-strong);
}

.map-error {
    padding: var(--space-6);
    text-align: center;
    color: var(--muted);
}

.map-locate {
    position: absolute;
    right: 12px;
    bottom: 28px;
    z-index: 500;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    color: #0B1120;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.map-pin {
    background: none;
    border: 0;
}

.map-pin span {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50% 50% 50% 0;
    background: var(--primary);
    transform: rotate(-45deg);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
    font-size: 20px;
}

.map-pin i {
    font-style: normal;
    transform: rotate(45deg); /* keep the emoji upright inside the tilted pin */
}

.leaflet-container {
    font-family: var(--font);
}

/* Voice picker */
.voice-pick {
    padding: var(--space-3) var(--space-4) var(--space-4);
}

.voice-pick__row {
    display: flex;
    gap: var(--space-2);
}

.voice-pick__row .field__input {
    flex: 1;
    min-width: 0;
}

/* =====================================================================
   Weather & commute
   ===================================================================== */

.wx {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    gap: var(--space-3);
}

.wx__icon {
    font-size: 36px;
    line-height: 1;
}

.wx__temp {
    font-size: 2rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.wx__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: var(--fs-sm);
}

.wx__text small {
    font-size: 12px;
    color: var(--muted);
}

.wx-commute {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    background: var(--accent-soft);
    font-size: var(--fs-sm);
    font-weight: 700;
}

.wx-commute small {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
}

.wx__credit {
    font-size: 10px;
    color: var(--muted);
}

.commute-form {
    margin-top: var(--space-5);
    padding-top: var(--space-4);
    border-top: 1px solid var(--line);
}

.day-picks {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}

.day-pick {
    position: relative;
}

.day-pick input {
    position: absolute;
    opacity: 0;
    inset: 0;
}

.day-pick span {
    display: block;
    padding: var(--space-2) 0;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

.day-pick input:checked + span {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

.day-pick input:focus-visible + span {
    outline: 2px solid var(--accent);
}

/* =====================================================================
   Admin
   ===================================================================== */

.admin-tabs {
    margin-bottom: var(--space-4);
}

.kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
    margin-bottom: var(--space-5);
}

:root[data-view="full"] .kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kpis--small .kpi__value {
    font-size: var(--fs-lg);
}

:root[data-view="full"] .kpis--small {
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.kpi {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--line);
}

.kpi__label {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
}

.kpi__value {
    font-size: var(--fs-xl);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.25;
}

.kpi__note {
    font-size: 11px;
    color: var(--ok);
    font-weight: 700;
}

.chart--bars {
    height: 160px;
}

.chart__bar {
    fill: var(--accent);
    opacity: 0.85;
}

.chart__bar:hover {
    opacity: 1;
}

.admin-grid {
    display: grid;
    gap: var(--space-4);
}

:root[data-view="full"] .admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.admin-grid > .block,
.admin-grid > form.block {
    margin: 0;
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--line);
}

.admin-list li + li {
    border-top: 1px solid var(--line);
}

.admin-list a {
    display: flex;
    flex-direction: column;
    padding-block: var(--space-2);
    font-size: var(--fs-sm);
}

.admin-list small {
    font-size: 11px;
    color: var(--muted);
}

.admin-list--plain li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
    padding-block: var(--space-2);
    font-size: var(--fs-sm);
}

.admin-list--plain li strong {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.admin-list--small li {
    font-size: 12px;
}

.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-sm);
}

.table th,
.table td {
    padding: var(--space-2) var(--space-3);
    text-align: start;
    white-space: nowrap;
    border-bottom: 1px solid var(--line);
}

.table th {
    font-size: 11px;
    font-weight: 800;
    color: var(--muted);
    background: var(--surface);
}

.table tbody tr:hover {
    background: var(--surface);
}

.table__actions {
    display: flex;
    gap: var(--space-2);
    align-items: center;
}

.status {
    display: inline-block;
    padding: 1px var(--space-2);
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 800;
    background: var(--surface-2);
    color: var(--muted);
}

.status--active,
.status--delivered,
.status--closed  { background: var(--ok-soft);     color: var(--ok); }
.status--pending,
.status--placed  { background: var(--warn-soft);   color: var(--warn); }
.status--open    { background: var(--accent-soft); color: var(--accent); }
.status--suspended,
.status--cancelled { background: var(--danger-soft); color: var(--danger); }

.admin-person .avatar {
    flex: none;
}

.admin-person .car-card__name small {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--muted);
}

.admin-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2) var(--space-4);
    margin: var(--space-4) 0 0;
}

.admin-facts dt {
    font-size: 11px;
    color: var(--muted);
}

.admin-facts dd {
    margin: 0;
    font-size: var(--fs-sm);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.ticket-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.ticket-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--surface);
    border-inline-start: 3px solid var(--line-strong);
}

.ticket-row.is-open    { border-inline-start-color: var(--accent); }
.ticket-row.is-pending { border-inline-start-color: var(--warn); }

.ticket-row__main,
.ticket-row__side {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ticket-row__side {
    align-items: flex-end;
    flex: none;
}

.ticket-row__main strong {
    font-size: var(--fs-sm);
}

.ticket-row small {
    font-size: 11px;
    color: var(--muted);
}

.thread {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin: var(--space-3) 0 var(--space-5);
}

.reply-form {
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    background: var(--surface);
    margin-bottom: var(--space-3);
}

.field--end {
    display: flex;
    align-items: flex-end;
}

.log-box {
    max-height: 360px;
    overflow: auto;
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--bg);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.diag li.is-warn > span {
    color: var(--warn);
}

/* Home v3: briefing is spoken; text only on request */
.brief__hint {
    margin-top: var(--space-2);
    font-size: var(--fs-sm);
    color: var(--muted);
}

.brief__more {
    margin-top: var(--space-2);
}

.brief__more > summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px var(--space-3);
    border-radius: var(--radius-pill);
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--accent);
    cursor: pointer;
    list-style: none;
}

.brief__more > summary::-webkit-details-marker {
    display: none;
}

.brief__more > summary::after {
    content: '';
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s;
}

.brief__more[open] > summary::after {
    transform: rotate(-135deg) translateY(-2px);
}

.brief__more .brief__text {
    margin: var(--space-3) auto 0;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--surface);
    text-align: start;
}

.icon-previews {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    margin-bottom: var(--space-3);
}

.icon-previews figure {
    margin: 0;
    text-align: center;
}

.icon-previews img {
    display: block;
    width: 64px;
    height: 64px;
    margin: 0 auto 4px;
    border-radius: 12px;
    background: repeating-conic-gradient(#3a4252 0 25%, #2a3140 0 50%) 0 0 / 12px 12px;
}

.icon-previews figcaption {
    font-size: 10px;
    color: var(--muted);
}

/* =====================================================================
   Section menus (compact tabs → floating vertical menu)
   ===================================================================== */

.secnav__toggle,
.secnav__menu,
.secnav__backdrop {
    display: none;
}

.food-tabs.is-compact {
    position: relative;
    z-index: 30;
    overflow: visible;
    padding-bottom: var(--space-2);
}

.food-tabs.is-compact > .food-tabs__item {
    display: none;
}

.food-tabs.is-compact > .secnav__toggle {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    height: 42px;
    padding-inline: var(--space-4);
    border-radius: var(--radius-pill);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    font-size: var(--fs-sm);
    font-weight: 800;
}

.food-tabs.is-open > .secnav__toggle {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.secnav__icon {
    font-size: 16px;
    line-height: 1;
}

.secnav__chevron {
    width: 7px;
    height: 7px;
    margin-inline-start: 2px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s var(--ease);
}

.food-tabs.is-open .secnav__chevron {
    transform: rotate(-135deg) translateY(-2px);
}

.food-tabs.is-compact > .secnav__menu:not([hidden]) {
    position: absolute;
    z-index: 2;
    top: calc(100% - 2px);
    inset-inline-start: var(--space-5);
    display: flex;
    flex-direction: column;
    width: min(300px, calc(100% - 2 * var(--space-5)));
    padding: 6px;
    border-radius: var(--radius-lg);
    background: var(--bg-2);
    border: 1px solid var(--line-strong);
    box-shadow: 0 24px 60px -18px rgba(2, 6, 23, 0.85);
    animation: secnav-in 0.16s var(--ease);
}

@keyframes secnav-in {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
    to   { opacity: 1; transform: none; }
}

.secnav__item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-height: 46px;
    padding: 0 var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--fs-sm);
    font-weight: 700;
}

.secnav__item:hover,
.secnav__item:focus-visible {
    background: var(--accent-soft);
    outline: none;
}

.secnav__item.is-active {
    color: var(--accent);
}

.secnav__item .secnav__icon {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--surface);
    font-size: 16px;
}

.secnav__text {
    flex: 1;
}

.secnav__check {
    font-weight: 800;
}

.food-tabs.is-open > .secnav__backdrop {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: block;
    background: rgba(2, 6, 23, 0.55);
    animation: secnav-fade 0.16s ease;
}

@keyframes secnav-fade {
    from { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .food-tabs.is-compact > .secnav__menu,
    .food-tabs.is-open > .secnav__backdrop {
        animation: none;
    }
}

/* =====================================================================
   Guided tour & what's new
   ===================================================================== */

.tour {
    position: fixed;
    inset: 0;
    z-index: 1000;
    animation: tour-in 0.2s ease;
}

.tour.is-leaving {
    opacity: 0;
    transition: opacity 0.2s;
}

@keyframes tour-in {
    from { opacity: 0; }
}

.tour__hole {
    position: fixed;
    pointer-events: none;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.9), 0 0 0 9999px rgba(2, 6, 23, 0.8);
    transition: top 0.3s var(--ease), left 0.3s var(--ease), width 0.3s var(--ease), height 0.3s var(--ease);
}

.tour.is-centered {
    background: rgba(2, 6, 23, 0.8);
}

.tour.is-centered .tour__hole {
    display: none;
}

.tour__card {
    position: fixed;
    width: min(340px, calc(100vw - 24px));
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    background: var(--bg-2);
    border: 1px solid var(--line-strong);
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8);
    color: var(--text);
    transition: top 0.3s var(--ease), left 0.3s var(--ease);
}

.tour.is-centered .tour__card {
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%);
    text-align: center;
}

.tour__top {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.tour.is-centered .tour__top {
    justify-content: center;
}

.tour__icon {
    font-size: 28px;
    line-height: 1;
}

.tour__badge {
    flex: 1;
    font-size: 11px;
    font-weight: 800;
    color: var(--accent);
}

.tour.is-centered .tour__badge {
    flex: none;
}

.tour__skip {
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--muted);
}

.tour.is-centered .tour__skip {
    position: absolute;
    top: var(--space-4);
    inset-inline-end: var(--space-4);
}

.tour__title {
    font-size: var(--fs-lg);
    font-weight: 800;
    margin-bottom: var(--space-2);
}

.tour__text {
    font-size: var(--fs-sm);
    line-height: 1.8;
    color: var(--text-2);
}

.tour__foot {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-4);
}

.tour__dots {
    display: flex;
    gap: 4px;
}

.tour__dots i {
    width: 6px;
    height: 6px;
    border-radius: 3px;
    background: var(--line-strong);
    transition: width 0.2s;
}

.tour__dots i.is-on {
    width: 16px;
    background: var(--accent);
}

.tour__count {
    flex: 1;
    font-size: 11px;
    color: var(--muted);
}

.tour__back {
    padding: 8px var(--space-3);
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--text-2);
}

.tour__next {
    padding: 8px var(--space-5);
    border-radius: var(--radius-pill);
    background: var(--primary);
    color: var(--primary-ink);
    font-size: var(--fs-sm);
    font-weight: 800;
}

body.tour-open {
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .tour, .tour__hole, .tour__card { animation: none; transition: none; }
}

/* About RUTI */
.about-head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.about-head img {
    width: 96px;
    height: auto;
}

.about-head p {
    font-size: var(--fs-sm);
    color: var(--text-2);
}

.about-facts {
    margin-top: 0;
}

.release {
    margin-bottom: var(--space-3);
    font-size: var(--fs-sm);
}

.release__head {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: var(--fs-xs);
}

.release ul {
    display: flex;
    flex-direction: column;
    gap: 4px;
    line-height: 1.7;
}

.about-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: var(--space-4) 0 var(--space-2);
}

/* Install banner (phone browsers) */
.install-banner {
    position: relative;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    grid-template-areas: "icon body" "icon actions";
    column-gap: var(--space-3);
    row-gap: var(--space-2);
    margin: 0 0 var(--space-4);
    padding: var(--space-3) var(--space-4);
    padding-inline-end: 44px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--accent-soft), var(--surface));
    border: 1px solid var(--accent);
    animation: install-in 0.25s var(--ease);
}

.install-banner.is-leaving {
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.2s, transform 0.2s;
}

@keyframes install-in {
    from { opacity: 0; transform: translateY(-6px); }
}

.install-banner__icon {
    grid-area: icon;
    width: 44px;
    height: 44px;
    border-radius: 11px;
}

.install-banner__body {
    grid-area: body;
    min-width: 0;
}

.install-banner__title {
    display: block;
    font-size: var(--fs-sm);
    font-weight: 800;
}

.install-banner__text {
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-2);
}

.install-banner__share {
    width: 16px;
    height: 16px;
    margin-inline: 2px;
    vertical-align: -3px;
    color: var(--accent);
}

.install-banner__actions {
    grid-area: actions;
}

.install-banner__actions:empty {
    display: none;
}

.install-banner__close {
    position: absolute;
    top: var(--space-2);
    inset-inline-end: var(--space-2);
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: var(--muted);
}

/* Admin → Email delivery */
.mailcheck {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin: var(--space-3) 0;
}

.mailcheck__item {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--surface);
    border-inline-start: 3px solid var(--ok);
}

.mailcheck__item.is-warn { border-inline-start-color: var(--warn); }
.mailcheck__item.is-bad  { border-inline-start-color: var(--danger); }

.mailcheck__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-2);
}

.mailcheck__mark {
    font-weight: 800;
    color: var(--ok);
}

.is-warn .mailcheck__mark { color: var(--warn); }
.is-bad .mailcheck__mark  { color: var(--danger); }

.mailcheck__head small {
    font-size: 12px;
    color: var(--muted);
}

.mailcheck__found {
    margin-top: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    color: var(--text-2);
    overflow-wrap: anywhere;
}

.mailcheck__fix {
    margin-top: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-sm);
    background: var(--bg);
    font-size: var(--fs-sm);
}

.dns-record {
    display: grid;
    gap: 6px;
    margin: var(--space-2) 0 0;
    text-align: left;
}

.dns-record > div {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: var(--space-2);
    align-items: start;
}

.dns-record dt {
    font-size: 11px;
    color: var(--muted);
}

.dns-record dd {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
}

.dns-record code {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--surface-2);
    overflow-wrap: anywhere;
}

.mailcheck__item.is-unknown { border-inline-start-color: var(--muted); }
.is-unknown .mailcheck__mark { color: var(--muted); }

.dkim-regen {
    margin-top: var(--space-3);
}

/* =====================================================================
   Cycle & PMS
   ===================================================================== */

.page-cycle {
    --rose: #F472B6;
    --rose-soft: rgba(244, 114, 182, 0.16);
    --pms: #F59E0B;
    --fertile: #34D399;
}

.cycle-hero {
    margin: var(--space-3) 0 var(--space-4);
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    background: linear-gradient(140deg, var(--rose-soft), var(--surface));
    border: 1px solid var(--line);
    text-align: center;
}

.cycle-hero__icon {
    font-size: 40px;
}

.cycle-hero__title {
    margin-top: var(--space-2);
    font-size: var(--fs-xl);
    font-weight: 800;
}

.cycle-hero__sub {
    margin-top: 4px;
    font-size: var(--fs-sm);
    color: var(--text-2);
}

.cycle-hero__action {
    margin-top: var(--space-4);
}

.cycle-phase {
    display: inline-block;
    padding: 2px var(--space-3);
    border-radius: var(--radius-pill);
    background: var(--rose-soft);
    color: var(--rose);
    font-size: 12px;
    font-weight: 800;
}

.cycle-hero.is-pms .cycle-phase { background: rgba(245, 158, 11, 0.16); color: var(--pms); }
.cycle-hero.is-fertile .cycle-phase,
.cycle-hero.is-ovulation .cycle-phase { background: rgba(52, 211, 153, 0.16); color: var(--fertile); }
.cycle-hero.is-late .cycle-phase { background: var(--danger-soft); color: var(--danger); }
.cycle-hero.is-regular .cycle-phase { background: var(--surface-2); color: var(--text-2); }

.cycle-first {
    margin-top: var(--space-4);
    text-align: start;
}

.cycle-windows {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-2);
    margin-bottom: var(--space-5);
}

.cycle-window {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--surface);
    border-top: 3px solid var(--line-strong);
    font-size: 11px;
    color: var(--muted);
}

.cycle-window strong {
    font-size: var(--fs-sm);
    color: var(--text);
}

.cycle-window.is-pms { border-top-color: var(--pms); }
.cycle-window.is-fertile { border-top-color: var(--fertile); }
.cycle-window.is-ovulation { border-top-color: var(--fertile); }

.cycle-cal {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}

.cycle-cal__head {
    padding-bottom: 4px;
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-align: center;
}

.cycle-cal__day {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    border-radius: 50%;
    font-size: var(--fs-sm);
    font-variant-numeric: tabular-nums;
}

.cycle-cal__day.is-period    { background: var(--rose); color: #fff; font-weight: 800; }
.cycle-cal__day.is-predicted { box-shadow: inset 0 0 0 2px var(--rose); color: var(--rose); font-weight: 700; }
.cycle-cal__day.is-pms       { background: rgba(245, 158, 11, 0.18); color: var(--pms); }
.cycle-cal__day.is-fertile   { background: rgba(52, 211, 153, 0.16); color: var(--fertile); }
.cycle-cal__day.is-ovulation { background: var(--fertile); color: #0B1120; font-weight: 800; }
.cycle-cal__day.is-today     { outline: 2px solid var(--accent); outline-offset: 1px; }

.cycle-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-4);
    margin-top: var(--space-3);
    font-size: 11px;
    color: var(--text-2);
}

.cycle-legend span::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-inline-end: 6px;
    border-radius: 50%;
    vertical-align: -1px;
}

.cycle-legend .is-period::before    { background: var(--rose); }
.cycle-legend .is-predicted::before { box-shadow: inset 0 0 0 2px var(--rose); }
.cycle-legend .is-pms::before       { background: var(--pms); }
.cycle-legend .is-fertile::before   { background: rgba(52, 211, 153, 0.5); }
.cycle-legend .is-ovulation::before { background: var(--fertile); }

.cycle-more {
    margin-top: var(--space-3);
}

.cycle-more > summary {
    cursor: pointer;
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--accent);
    padding: var(--space-2) 0;
}

@media (max-width: 380px) {
    .cycle-windows {
        grid-template-columns: 1fr;
    }
}

/* =====================================================================
   Linked family
   ===================================================================== */

.head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.linked-badge {
    font-size: 0.85em;
}

.request-card {
    padding: var(--space-4);
    margin-bottom: var(--space-2);
    border-radius: var(--radius-md);
    background: var(--accent-soft);
    border: 1px solid var(--accent);
}

.request-card__text {
    font-weight: 700;
    margin-bottom: var(--space-3);
}

.request-card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.share-note {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: var(--space-3) 0 var(--space-4);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--surface);
    font-size: var(--fs-sm);
    color: var(--text-2);
}

.share-note strong {
    color: var(--text);
}

.linked-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: var(--space-4) 0;
    text-align: center;
}

.linked-card h1 {
    font-size: var(--fs-xl);
    font-weight: 800;
}

.radio-row {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3);
    margin-bottom: var(--space-2);
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    cursor: pointer;
}

.radio-row:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.radio-row input {
    margin-top: 4px;
}

.radio-row span {
    display: flex;
    flex-direction: column;
    font-size: var(--fs-sm);
}

.radio-row small {
    color: var(--muted);
}

.wa-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
}

.pending-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.access-note {
    margin: var(--space-2) 0 var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    background: var(--surface);
    font-size: var(--fs-sm);
    color: var(--text-2);
}

.dose__badge {
    padding: 2px var(--space-2);
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
}

.dose__badge.is-taken { background: var(--ok-soft); color: var(--ok); }
.dose__badge.is-late  { background: var(--warn-soft); color: var(--warn); }

/* Choose a specific dish for a meal */
.more__link {
    display: block;
    padding: var(--space-2) var(--space-3);
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--accent);
}

.choice-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.choice {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--line);
}

.choice.is-current {
    border-color: var(--accent);
}

.choice__icon {
    font-size: 26px;
}

.choice__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: var(--fs-sm);
}

.choice__text small {
    font-size: 12px;
    color: var(--muted);
}

/* =====================================================================
   1.12 – New navigation: header, bottom bar with the raised orb,
   side menu (avatar), analytics rings, Services and Settings
   ===================================================================== */

/* Header: avatar · · · bell */
.topbar__user {
    padding: 0;
    border: 0;
    background: none;
    border-radius: 50%;
    cursor: pointer;
    color: inherit;
}

.topbar__user:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.topbar__spacer {
    flex: 1;
}

/* Bottom bar: Home · Planner · [orb] · Wallet · Services */
.tabbar {
    grid-template-columns: repeat(2, 1fr) 84px repeat(2, 1fr);
    overflow: visible;
}

.tabbar__orb {
    --orb: 62px;
    position: relative;
    justify-self: center;
    align-self: start;
    width: var(--orb);
    height: var(--orb);
    font-size: calc(var(--orb) * 0.258);    /* 16px at 62px – the waves scale with the orb */
    margin-top: calc(var(--orb) * -0.39);   /* floats above the bar's centre */
    border-radius: 50%;
    display: grid;
    place-items: center;
    text-decoration: none;
    /* the active-tab colour at the edges, darker towards the middle */
    background: radial-gradient(circle at 50% 50%, #0C4A6E 0%, #0369A1 40%, var(--accent) 100%);
    background: radial-gradient(circle at 50% 50%,
        color-mix(in srgb, var(--accent) 30%, #020617) 0%,
        color-mix(in srgb, var(--accent) 62%, #020617) 42%,
        var(--accent) 100%);
    /* transparent glass frame – no drop shadow */
    box-shadow:
        0 0 0 6px rgba(255, 255, 255, 0.10),
        0 0 0 7px rgba(255, 255, 255, 0.22);
    transition: transform 0.15s ease;
}

/* Keep the mobile proportions on bigger screens: the orb grows with the screen */
@media (min-width: 700px) {
    :root[data-view="full"] .tabbar__orb { --orb: clamp(62px, 5.2vw, 84px); }

}

.tabbar__orb:active {
    transform: scale(0.94);
}

.tabbar__orb .icon {
    width: 24px;
    height: 24px;
}

/* =====================================================================
   Toasts
   ===================================================================== */

.toasts {
    position: absolute;
    inset-inline: var(--space-4);
    bottom: calc(var(--tabbar-h) + var(--space-4) + env(safe-area-inset-bottom, 0px));
    z-index: 60;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    pointer-events: none;
}

.toast {
    max-width: 100%;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--text);
    color: var(--bg);
    font-size: var(--fs-sm);
    font-weight: 600;
    box-shadow: 0 12px 30px -12px rgba(2, 6, 23, 0.6);
    pointer-events: auto;
    animation: toast-in 0.3s var(--ease);
}

.toast--error {
    background: var(--danger);
    color: #fff;
}

.toast--success {
    background: var(--ok);
    color: #04140D;
}

.toast.is-leaving {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.25s, transform 0.25s;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

/* =====================================================================
   Phase 2: assistant cards, actions, controls
   ===================================================================== */

.orb-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    margin-top: var(--space-4);
}

.icon-btn--sm {
    width: 30px;
    height: 30px;
}

.icon-btn--sm .icon {
    width: 16px;
    height: 16px;
}

.mute-btn .icon--when-muted,
.mute-btn.is-muted .icon--when-sound {
    display: none;
}

.mute-btn.is-muted .icon--when-muted {
    display: block;
}

.mute-btn.is-muted {
    color: var(--danger);
}

.bubble__extra {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-top: var(--space-3);
}

.bubble--ruti:has(.card) {
    max-width: 100%;
    width: 100%;
}

.card {
    padding: var(--space-4);
    border-radius: var(--radius-md);
    background: var(--surface-2);
    border: 1px solid var(--line);
}

.card__head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.card__icon {
    font-size: 26px;
    line-height: 1;
}

.card__title {
    font-size: var(--fs-sm);
    font-weight: 800;
    margin: 0;
}

.card__subtitle {
    font-size: var(--fs-xs);
    color: var(--muted);
}

.card__stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-2);
    margin: var(--space-4) 0 0;
}

.card__stat {
    display: flex;
    flex-direction: column-reverse;
    padding: var(--space-2);
    border-radius: var(--radius-sm);
    background: var(--surface);
    text-align: center;
}

.card__stat dd {
    margin: 0;
    font-size: var(--fs-lg);
    font-weight: 800;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
}

.card__stat dt {
    font-size: 11px;
    color: var(--muted);
}

.card__days {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.card__day-label {
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--accent);
}

.card__meals li {
    display: grid;
    grid-template-columns: 52px 22px minmax(0, 1fr);
    align-items: center;
    gap: var(--space-2);
    font-size: var(--fs-xs);
    padding-block: 2px;
}

.card__meal-slot {
    color: var(--muted);
}

.card__meal-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card__more {
    margin-top: var(--space-2);
    font-size: var(--fs-xs);
    color: var(--muted);
}

.card__lines {
    margin-top: var(--space-3);
}

.card__line {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-2);
    padding-block: var(--space-2);
}

.card__line + .card__line {
    border-top: 1px solid var(--line);
}

.card__line-icon {
    font-size: 18px;
    line-height: 1;
}

.card__line-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.card__line-name {
    font-size: var(--fs-xs);
    font-weight: 700;
}

.card__line-detail {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--muted);
}

.card__line-value {
    font-size: var(--fs-xs);
    font-weight: 700;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.card__line.is-low .card__line-value { color: var(--warn); }
.card__line.is-out .card__line-value { color: var(--danger); }

.card__rows {
    margin: var(--space-3) 0 0;
    padding-top: var(--space-2);
    border-top: 1px solid var(--line);
}

.card__row {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    padding-block: 3px;
    font-size: var(--fs-xs);
}

.card__row dt {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-2);
}

.card__row dd {
    margin: 0;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.card__row.is-strong {
    font-size: var(--fs-sm);
}

.card__row.is-strong dt,
.card__row.is-strong dd {
    color: var(--text);
    font-weight: 800;
}

.card__row.is-warn dd {
    color: var(--danger);
}

.swatch {
    display: inline-block;
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand, var(--accent));
}

/* Cooking step */
.card--cooking {
    border-color: var(--accent);
    background: linear-gradient(180deg, var(--accent-soft), transparent 70%), var(--surface-2);
}

.card__step {
    margin-top: var(--space-3);
}

.progress {
    height: 4px;
    border-radius: 4px;
    background: var(--line);
    overflow: hidden;
}

.progress > span {
    display: block;
    height: 100%;
    background: var(--accent);
    border-radius: inherit;
    transition: width 0.4s var(--ease);
}

.card__step-label {
    margin-top: var(--space-3);
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
}

.card__step-text {
    margin-top: var(--space-1);
    font-size: var(--fs-md);
    font-weight: 600;
    line-height: 1.7;
}

.timer-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-3);
    height: 34px;
    padding-inline: var(--space-4);
    border-radius: var(--radius-pill);
    border: 1px solid var(--accent);
    color: var(--accent);
    font-size: var(--fs-xs);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.timer-btn.is-running {
    background: var(--accent);
    color: var(--accent-ink);
}

.timer-btn.is-done {
    border-color: var(--ok);
    background: var(--ok-soft);
    color: var(--ok);
}

/* Reply actions */
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.action-btn {
    min-height: 34px;
    padding: 4px var(--space-4);
    border-radius: var(--radius-pill);
    font-size: var(--fs-xs);
    font-weight: 700;
    border: 1px solid var(--line-strong);
    color: var(--text);
    transition: background-color 0.2s, border-color 0.2s, opacity 0.2s;
}

.action-btn:hover {
    border-color: var(--accent);
}

.action-btn--primary {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--primary-ink);
}

.action-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

/* Small inline buttons in lists */
.mini-btn {
    flex: none;
    height: 28px;
    padding-inline: var(--space-3);
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-soft);
    white-space: nowrap;
}

.mini-btn--quiet {
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--line);
}

.mini-btn:disabled {
    opacity: 0.5;
}

.timeline__text {
    flex: 1;
    min-width: 0;
}

.meal-row {
    grid-template-columns: 64px 26px minmax(0, 1fr) auto;
}

.meal-row__actions {
    display: inline-flex;
    justify-content: flex-end;
}

.view__lead {
    font-size: var(--fs-xs);
    color: var(--muted);
    margin-bottom: var(--space-2);
}

/* Cart grouped by store */
.cart-store + .cart-store {
    margin-top: var(--space-4);
}

.cart-store__title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--fs-sm);
    font-weight: 800;
}

.cart-store__fee {
    margin-inline-start: auto;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
}

.cart-row {
    grid-template-columns: 34px minmax(0, 1fr) auto;
}

.cart-row__info .cart-row__price {
    font-size: var(--fs-xs);
    color: var(--muted);
    font-weight: 600;
}

.stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-pill);
}

.stepper__btn {
    width: 32px;
    height: 32px;
    font-size: var(--fs-lg);
    font-weight: 700;
    color: var(--accent);
}

.stepper__btn:disabled {
    opacity: 0.4;
}

.stepper__value {
    min-width: 22px;
    text-align: center;
    font-size: var(--fs-sm);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.btn--spaced {
    margin-top: var(--space-2);
}

.wallet-card__topup {
    align-self: flex-start;
    margin-top: var(--space-4);
    height: 32px;
    padding-inline: var(--space-4);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.14);
    color: #F8FAFC;
    font-size: var(--fs-xs);
    font-weight: 700;
}

.wallet-card__topup:hover {
    background: rgba(255, 255, 255, 0.22);
}

@media (max-width: 380px) {
    .card__stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* =====================================================================
   Full-width view only applies on wide screens
   ===================================================================== */

@media (max-width: 899px) {
    :root[data-view="full"] .device {
        --device-width: 430px;
        height: min(920px, calc(100vh - 48px));
        height: min(920px, calc(100dvh - 48px));
        border-radius: var(--radius-device);
    }

    :root[data-view="full"] .tabbar {
        left: 0;
        right: 0;
        width: auto;
        bottom: 0;
        transform: none;
        border-width: 1px 0 0;
        border-radius: 0;
    }

    :root[data-view="full"] .tabbar__orb {
        margin-top: -26px;
        width: 56px;
        height: 56px;
    }
}

@media (max-width: 520px) {
    :root[data-view="full"] .device {
        height: auto;   /* pinned to the screen edges (see .device above) */
        border-radius: 0;
    }
}

/* =====================================================================
   Motion preferences
   ===================================================================== */

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

/* =====================================================================
   RUTI App - accounts, profile and app shell
   ===================================================================== */

/* ---------- Shared controls ---------- */

.prefs {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.btn--lg {
    height: 52px;
    font-size: var(--fs-md);
}

.btn--danger {
    background: var(--danger);
    color: #fff;
}

.btn .icon {
    width: 18px;
    height: 18px;
}

.btn.is-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn.is-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    animation: spin 0.7s linear infinite;
}

.btn--ghost.is-loading::after {
    border-color: var(--line-strong);
    border-top-color: var(--accent);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.link-btn {
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.link-btn:disabled {
    color: var(--muted);
    cursor: default;
}

.link-btn--muted {
    color: var(--muted);
    font-weight: 600;
    font-size: var(--fs-xs);
}

.alert {
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--fs-sm);
    font-weight: 600;
    border: 1px solid transparent;
}

.alert--error   { background: var(--danger-soft); border-color: var(--danger); color: var(--text); }
.alert--success { background: var(--ok-soft);     border-color: var(--ok);     color: var(--text); }
.alert--info    { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }

.pill--ok {
    gap: 4px;
    background: var(--ok-soft);
    color: var(--ok);
}

.pill .icon {
    width: 12px;
    height: 12px;
    stroke-width: 2.5;
}

/* ---------- Forms ---------- */

.form {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.form__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
}

.form__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.field__label {
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--text-2);
    padding: 0;
}

.field__control {
    position: relative;
    display: flex;
    align-items: center;
}

.field__input {
    width: 100%;
    height: 50px;
    padding-inline: var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid var(--line-strong);
    background: var(--surface);
    font-size: var(--fs-md);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.field__input::placeholder {
    color: var(--muted);
    opacity: 0.7;
}

.field__input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.field__input[type="date"] {
    min-height: 50px;
}

[dir="rtl"] .field__input[type="date"] {
    text-align: right;
}

:root[data-theme="dark"] .field__input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.6;
}

.field__icon {
    position: absolute;
    inset-inline-start: 14px;
    width: 18px;
    height: 18px;
    color: var(--muted);
    pointer-events: none;
}

/* Padding follows the page direction, not the input's own direction,
   so left-to-right inputs (email, phone) still clear the icon in Arabic. */
[dir="rtl"] .field__icon ~ .field__input {
    padding-right: 44px;
    padding-left: var(--space-4);
}

[dir="ltr"] .field__icon ~ .field__input {
    padding-left: 44px;
    padding-right: var(--space-4);
}

.field__toggle {
    position: absolute;
    inset-inline-end: 6px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    color: var(--muted);
}

[dir="rtl"] .field__control:has(.field__toggle) .field__input {
    padding-left: 48px;
}

[dir="ltr"] .field__control:has(.field__toggle) .field__input {
    padding-right: 48px;
}

.field__toggle .icon--hide,
.field__toggle.is-visible .icon--show {
    display: none;
}

.field__toggle.is-visible .icon--hide {
    display: block;
}

.field__hint {
    font-size: 12px;
    color: var(--muted);
}

.field__error {
    font-size: 12px;
    font-weight: 700;
    color: var(--danger);
}

.field.has-error .field__input,
.field__input[aria-invalid="true"] {
    border-color: var(--danger);
}

/* Inputs in LTR (email, phone) keep their text aligned with the page */
[dir="rtl"] .field__input[dir="ltr"] {
    text-align: right;
}

[dir="rtl"] .field__input[dir="ltr"]::placeholder {
    text-align: right;
}

.otp-input {
    height: 64px;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: 0.5em;
    text-align: center !important;
    font-variant-numeric: tabular-nums;
    padding-inline-start: calc(var(--space-4) + 0.5em);
}

.strength {
    height: 4px;
    margin-top: -8px;
    border-radius: 4px;
    background: var(--line);
    overflow: hidden;
}

.strength > span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    transition: width 0.25s, background-color 0.25s;
}

.strength[data-level="1"] > span { width: 25%;  background: var(--danger); }
.strength[data-level="2"] > span { width: 50%;  background: var(--warn); }
.strength[data-level="3"] > span { width: 75%;  background: var(--accent); }
.strength[data-level="4"] > span { width: 100%; background: var(--ok); }

.segmented {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    padding: 4px;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--line-strong);
}

.segmented__option {
    position: relative;
    cursor: pointer;
}

.segmented__option input {
    position: absolute;
    opacity: 0;
    inset: 0;
    cursor: pointer;
}

.segmented__option span {
    display: grid;
    place-items: center;
    height: 40px;
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--muted);
    transition: background-color 0.2s, color 0.2s;
}

.segmented__option input:checked + span {
    background: var(--primary);
    color: var(--primary-ink);
}

.segmented__option input:focus-visible + span {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.check {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--fs-sm);
    cursor: pointer;
}

.check--top {
    align-items: flex-start;
    line-height: 1.6;
}

.check input {
    flex: none;
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--primary);
}

.check--top input {
    margin-top: 3px;
}

/* ---------- Auth layout ---------- */

.layout-auth {
    min-height: 100dvh;
}

.auth {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

.auth__brand {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 35vh;
    height: 35dvh;
    min-height: 190px;
    padding-top: env(safe-area-inset-top, 0px);
}

.auth__brand::before {
    content: '';
    position: absolute;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.28), transparent 65%);
    pointer-events: none;
}

.auth__logo {
    position: relative;
    width: min(210px, 55vw);
    height: auto;
}

.auth__pitch {
    display: none;
}

.auth__main {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: var(--space-6) var(--space-5) calc(var(--space-6) + env(safe-area-inset-bottom, 0px));
    background: var(--surface-glass);
    border-top: 1px solid var(--device-border);
    border-radius: 28px 28px 0 0;
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
}

.auth__main:focus {
    outline: none;
}

.auth__top {
    position: absolute;
    top: calc(var(--space-3) + env(safe-area-inset-top, 0px));
    inset-inline-end: var(--space-3);
    z-index: 5;
}

.auth__panel {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}

.auth__title {
    font-size: var(--fs-xl);
    font-weight: 800;
    line-height: 1.3;
}

.auth__subtitle {
    margin: var(--space-1) 0 var(--space-6);
    font-size: var(--fs-sm);
    color: var(--muted);
}

.auth__email {
    color: var(--text);
    unicode-bidi: isolate;
}

.auth__icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin-bottom: var(--space-4);
    border-radius: 18px;
    background: var(--accent-soft);
    color: var(--accent);
}

.auth__icon .icon {
    width: 26px;
    height: 26px;
}

.auth__switch {
    margin-top: var(--space-6);
    text-align: center;
    font-size: var(--fs-sm);
    color: var(--muted);
}

.auth__legal {
    margin-top: auto;
    padding-top: var(--space-8);
    text-align: center;
    font-size: 11px;
    color: var(--muted);
}

.resend {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-5);
    font-size: var(--fs-sm);
    color: var(--muted);
}

.legal section + section {
    margin-top: var(--space-5);
}

.legal h2 {
    font-size: var(--fs-md);
    margin-bottom: var(--space-1);
}

.legal p {
    font-size: var(--fs-sm);
    color: var(--text-2);
    line-height: 1.8;
}

@media (min-width: 900px) {
    .auth {
        flex-direction: row;
    }

    .auth__brand {
        flex: 0 0 46%;
        flex-direction: column;
        justify-content: center;
        gap: var(--space-8);
        padding: var(--space-8);
        border-inline-end: 1px solid var(--line);
        background:
            radial-gradient(70% 60% at 50% 40%, rgba(37, 99, 235, 0.25), transparent 70%),
            transparent;
    }

    .auth__brand::before {
        display: none;
    }

    .auth__logo {
        width: 230px;
    }

    .auth__pitch {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: var(--space-6);
        max-width: 360px;
        text-align: center;
    }

    .auth__orb {
        display: grid;
        place-items: center;
        width: 150px;
        height: 150px;
        border-radius: 50%;
        background:
            radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.55), transparent 32%),
            radial-gradient(circle at 50% 60%, #38BDF8 0%, #0EA5E9 38%, #2563EB 78%, #1E3A8A 100%);
        box-shadow: 0 30px 80px -20px rgba(14, 165, 233, 0.7);
    }

    .auth__tagline {
        font-size: var(--fs-xl);
        font-weight: 800;
        line-height: 1.4;
    }

    .auth__features {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--space-3) var(--space-5);
        text-align: start;
    }

    .auth__features li {
        display: flex;
        align-items: center;
        gap: var(--space-2);
        font-size: var(--fs-sm);
        color: var(--text-2);
    }

    .auth__features .icon {
        color: var(--accent);
    }

    .auth__brand {
        position: sticky;
        top: 0;
        align-self: flex-start;
        height: 100vh;
        height: 100dvh;
    }

    .auth__main {
        min-height: 100vh;
        min-height: 100dvh;
        padding: calc(var(--space-8) + 24px) var(--space-8) var(--space-8);
        background: transparent;
        border: 0;
        border-radius: 0;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    /* Centred when it fits, top-aligned and fully scrollable when it doesn't */
    .auth__panel {
        margin-block: auto;
    }

    .auth__legal {
        margin-top: var(--space-8);
    }
}

/* ---------- App shell ---------- */

.topbar__user {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
    margin-inline-end: auto;
}

.topbar__hello {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
}

.topbar__greet {
    font-size: 11px;
    color: var(--muted);
}

.topbar__name {
    font-size: var(--fs-sm);
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avatar {
    display: grid;
    place-items: center;
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #0EA5E9, #2563EB);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 0 0 2px var(--bg-2), 0 0 0 3px var(--accent);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar--sm {
    width: 38px;
    height: 38px;
    font-size: var(--fs-sm);
}

.avatar--xl {
    width: 112px;
    height: 112px;
    font-size: 36px;
    box-shadow: 0 0 0 4px var(--bg-2), 0 0 0 6px var(--accent);
}

.tabbar__item--ruti .icon {
    color: var(--accent);
}

.home-title,
.hero__title {
    max-width: 18ch;
}

.composer-dock {
    padding-top: var(--space-2);
}

.composer-dock .chips {
    padding-top: 0;
}

/* ---------- Upcoming sections ---------- */

.soon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-6) var(--space-2);
    text-align: center;
}

.soon__icon {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    border-radius: 24px;
    background: var(--accent-soft);
    color: var(--accent);
}

.soon__icon .icon {
    width: 34px;
    height: 34px;
}

.soon__title {
    font-size: var(--fs-lg);
    font-weight: 800;
}

.soon__lead {
    max-width: 36ch;
    font-size: var(--fs-sm);
    color: var(--muted);
}

.soon__list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    width: 100%;
    max-width: 340px;
    margin: var(--space-2) 0;
    text-align: start;
}

.soon__list li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    font-size: var(--fs-sm);
}

.soon__list .icon {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    color: var(--ok);
}

/* ---------- Profile ---------- */

.profile-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4) 0 var(--space-6);
    text-align: center;
}

.profile-head__avatar {
    position: relative;
    margin-bottom: var(--space-2);
}

.avatar-edit {
    position: absolute;
    bottom: 0;
    inset-inline-end: -4px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 0 4px var(--bg-2);
}

.avatar-edit .icon {
    width: 18px;
    height: 18px;
}

.profile-head__name {
    font-size: var(--fs-xl);
    font-weight: 800;
}

.profile-head__email {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--fs-sm);
    color: var(--muted);
}

.customer-id {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-2);
    padding: 6px var(--space-4);
    border-radius: var(--radius-pill);
    border: 1px dashed var(--line-strong);
    font-size: var(--fs-xs);
}

.customer-id__label {
    color: var(--muted);
}

.customer-id__value {
    font-weight: 800;
    letter-spacing: 0.06em;
    font-variant-numeric: tabular-nums;
}

.customer-id .icon {
    width: 16px;
    height: 16px;
    color: var(--accent);
}

.tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.tile {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--line);
}

.tile .icon {
    color: var(--accent);
    margin-bottom: var(--space-2);
}

.tile__label {
    font-size: var(--fs-xs);
    color: var(--muted);
}

.tile__value {
    font-size: var(--fs-md);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.tile__hint {
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--accent);
}

.tile--wallet {
    color: #F8FAFC;
    border: 0;
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(56, 189, 248, 0.55), transparent 55%),
        linear-gradient(135deg, #1E3A8A, #0F172A 70%);
}

.tile--wallet .icon,
.tile--wallet .tile__label {
    color: rgba(248, 250, 252, 0.85);
}

.panel {
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--line);
    overflow: hidden;
}

.panel + .panel,
.signout + .panel,
.panel + .signout {
    margin-top: var(--space-3);
}

.panel__summary {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.panel__summary::-webkit-details-marker {
    display: none;
}

.panel__summary > .icon:first-child {
    color: var(--accent);
}

.panel__chevron {
    margin-inline-start: auto;
    color: var(--muted);
    transition: transform 0.2s var(--ease);
}

.panel[open] .panel__chevron {
    transform: rotate(90deg);
}

[dir="rtl"] .panel[open] .panel__chevron {
    transform: scaleX(-1) rotate(90deg);
}

.panel__body {
    padding: 0 var(--space-4) var(--space-4);
}

.panel__title {
    font-size: var(--fs-sm);
    font-weight: 800;
}

.panel__text {
    font-size: var(--fs-sm);
    color: var(--text-2);
}

.panel--danger .panel__summary > .icon:first-child,
.panel--danger .panel__summary span {
    color: var(--danger);
}

.setting--static {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--line);
}

.setting--static > span:nth-child(2) {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.setting--static small {
    font-size: 12px;
    font-weight: 400;
    color: var(--muted);
}

.panel .settings {
    margin-top: 0;
}

.signout {
    margin-top: var(--space-3);
}

/* ---------- Photo cropper ---------- */

.cropper {
    width: min(420px, calc(100vw - 32px));
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--bg-2);
    color: var(--text);
}

.cropper::backdrop {
    background: rgba(2, 6, 23, 0.7);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.cropper__inner {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    padding: var(--space-5);
}

.cropper__title {
    font-size: var(--fs-lg);
    font-weight: 800;
}

.cropper__stage {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    touch-action: none;
}

.cropper__stage canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
}

.cropper__stage canvas:active {
    cursor: grabbing;
}

.cropper__mask {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: 50%;
    box-shadow: 0 0 0 999px rgba(2, 6, 23, 0.55);
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: -2px;
}

.cropper__zoom {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--fs-sm);
    font-weight: 600;
}

.cropper__zoom input {
    flex: 1;
    accent-color: var(--primary);
}

.cropper__hint {
    font-size: var(--fs-xs);
    color: var(--muted);
}

.cropper__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
}

.cropper__actions .btn.is-loading::after {
    border-color: rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
}

.credits .link {
    font-size: 11px;
}

@media (max-width: 380px) {
    .form__grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Google / Microsoft ---------- */

.divider {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: var(--space-5) 0;
    font-size: var(--fs-xs);
    color: var(--muted);
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line-strong);
}

.social {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.btn--social {
    gap: var(--space-3);
    height: 50px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    color: var(--text);
}

.btn--social:hover {
    border-color: var(--accent);
}

:root[data-theme="light"] .btn--social {
    background: #fff;
}

.provider-logo {
    width: 20px;
    height: 20px;
    flex: none;
}

.providers {
    display: flex;
    flex-direction: column;
    margin-top: var(--space-3);
}

.provider {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding-block: var(--space-3);
}

.provider + .provider {
    border-top: 1px solid var(--line);
}

.provider__text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    font-size: var(--fs-sm);
}

.provider__text small {
    font-size: 12px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: start;
    unicode-bidi: plaintext;
}

/* ---------- Passkeys ---------- */

.passkeys {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-top: var(--space-5);
    padding-top: var(--space-5);
    border-top: 1px solid var(--line);
}

.passkeys__head {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.passkeys__head .icon {
    color: var(--accent);
    width: 22px;
    height: 22px;
}

.passkeys__head span {
    display: flex;
    flex-direction: column;
    font-size: var(--fs-sm);
}

.passkeys__head small {
    color: var(--muted);
    font-size: 12px;
}

.passkeys .providers {
    margin-top: 0;
}

.provider > .icon {
    color: var(--muted);
}

.passkey-signin {
    margin-top: var(--space-3);
}

.passkey-signin .icon {
    color: var(--accent);
}

/* ---------- Selects ---------- */

select.field__input {
    appearance: none;
    -webkit-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    cursor: pointer;
}

[dir="ltr"] select.field__input {
    padding-right: 40px;
    background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
}

[dir="rtl"] select.field__input {
    padding-left: 40px;
    background-position: 14px 50%, 20px 50%;
}

select.field__input option {
    background: var(--bg-2);
    color: var(--text);
}

/* ---------- Family ---------- */

.avatar--md {
    width: 46px;
    height: 46px;
    font-size: var(--fs-md);
}

.avatar--female {
    background: linear-gradient(135deg, #F472B6, #A855F7);
}

.avatar--male {
    background: linear-gradient(135deg, #0EA5E9, #2563EB);
}

.members {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.member {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--line);
    transition: border-color 0.2s;
}

a.member:hover {
    border-color: var(--accent);
}

.member--self {
    background: transparent;
    border-style: dashed;
}

.member__text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    font-size: var(--fs-sm);
}

.member__text small {
    font-size: 12px;
    color: var(--muted);
}

.member__allergy {
    margin-top: 2px;
    font-size: 11px;
    font-weight: 700;
    color: var(--warn);
}

.member__chevron {
    color: var(--muted);
}

.form-danger {
    margin-top: var(--space-6);
    text-align: center;
}

.link-btn--danger {
    color: var(--danger);
}

.btn .icon {
    flex: none;
}

a.tile {
    transition: border-color 0.2s, transform 0.15s;
}

a.tile:hover {
    border-color: var(--accent);
}

a.tile:active {
    transform: scale(0.98);
}

/* ---------- Wallet ---------- */

.page-wallet .wallet-card {
    margin-top: var(--space-2);
}

.amounts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
}

.amount {
    height: 48px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line-strong);
    background: var(--surface);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    transition: border-color 0.2s, background-color 0.2s;
}

.amount:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.amounts + .field__hint {
    margin-top: var(--space-2);
}

.ledger__date {
    margin: var(--space-4) 0 var(--space-1);
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--muted);
}

.ledger__row {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    padding-block: var(--space-3);
}

.ledger__row + .ledger__row {
    border-top: 1px solid var(--line);
}

.ledger__icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 800;
    background: var(--ok-soft);
    color: var(--ok);
}

.ledger__row.is-debit .ledger__icon {
    background: var(--danger-soft);
    color: var(--danger);
}

.ledger__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: var(--fs-sm);
}

.ledger__text small {
    font-size: 11px;
    color: var(--muted);
    text-align: start;
}

.ledger__amount {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: var(--fs-sm);
    font-weight: 800;
    color: var(--ok);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ledger__row.is-debit .ledger__amount {
    color: var(--text);
}

.ledger__amount small {
    font-size: 11px;
    font-weight: 400;
    color: var(--muted);
}

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    margin-top: var(--space-5);
}

/* =====================================================================
   Food: library
   ===================================================================== */

.search {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    height: 48px;
    padding-inline: var(--space-4);
    border-radius: var(--radius-pill);
    background: var(--surface);
    border: 1px solid var(--line-strong);
}

.search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.search .icon {
    color: var(--muted);
}

.search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    background: transparent;
    font-size: var(--fs-sm);
}

.search input:focus {
    outline: none;
}

.filter-row {
    display: flex;
    gap: var(--space-2);
    overflow-x: auto;
    padding-block: var(--space-3) 0;
    margin-inline: calc(var(--space-5) * -1);
    padding-inline: var(--space-5);
    scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
    display: none;
}

.chip {
    display: inline-flex;
    align-items: center;
}

.chip.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--primary-ink);
}

.chip--quiet {
    height: 30px;
    border-style: dashed;
}

.program-filter {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: var(--space-4) 0;
    font-size: var(--fs-sm);
    font-weight: 700;
}

.program-filter label {
    white-space: nowrap;
    color: var(--text-2);
}

.program-filter .field__input {
    height: 42px;
    font-size: var(--fs-sm);
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
}

:root[data-view="full"] .recipe-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.recipe-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
    height: 100%;
    min-height: 170px;
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--tint, var(--surface));
    transition: border-color 0.2s, transform 0.15s;
}

.recipe-card:hover {
    border-color: var(--accent);
}

.recipe-card:active {
    transform: scale(0.98);
}

.recipe-card--egypt   { --tint: var(--tint-egyptian); }
.recipe-card--gulf    { --tint: var(--tint-gulf); }
.recipe-card--levant  { --tint: var(--tint-levantine); }
.recipe-card--maghreb { --tint: var(--tint-international); }

.recipe-card__icon {
    font-size: 34px;
    line-height: 1.1;
    margin-bottom: auto;
}

.recipe-card__name {
    margin-top: var(--space-3);
    font-size: var(--fs-sm);
    font-weight: 800;
    line-height: 1.35;
}

.recipe-card__meta {
    font-size: 11px;
    color: var(--muted);
}

.recipe-card__kcal {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-2);
}

.recipe-card__badge {
    position: absolute;
    top: var(--space-3);
    inset-inline-end: var(--space-3);
    padding: 1px var(--space-2);
    border-radius: var(--radius-pill);
    background: var(--ok-soft);
    color: var(--ok);
    font-size: 10px;
    font-weight: 800;
}

.recipe-card__warn {
    position: absolute;
    bottom: var(--space-3);
    inset-inline-end: var(--space-3);
    color: var(--warn);
    font-size: 14px;
}

.hint-card {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-5);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    border: 1px dashed var(--accent);
    background: var(--accent-soft);
    font-size: var(--fs-sm);
}

.hint-card .icon {
    color: var(--accent);
}

/* =====================================================================
   Food: recipe detail
   ===================================================================== */

.recipe__head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-6) var(--space-4);
    margin-bottom: var(--space-2);
    border-radius: var(--radius-lg);
    text-align: center;
    background: var(--tint, var(--surface));
}

.recipe__head--egypt   { --tint: var(--tint-egyptian); }
.recipe__head--gulf    { --tint: var(--tint-gulf); }
.recipe__head--levant  { --tint: var(--tint-levantine); }
.recipe__head--maghreb { --tint: var(--tint-international); }

.recipe__icon {
    font-size: 56px;
    line-height: 1.1;
}

.recipe__title {
    font-size: var(--fs-xl);
    font-weight: 800;
}

.recipe__desc {
    max-width: 40ch;
    font-size: var(--fs-sm);
    color: var(--text-2);
}

.recipe__facts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.recipe__facts li {
    padding: 2px var(--space-3);
    border-radius: var(--radius-pill);
    background: var(--surface);
    font-size: var(--fs-xs);
    font-weight: 700;
}

.nutrients {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-2);
    margin: 0 0 var(--space-2);
}

.nutrient {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    padding: var(--space-3) var(--space-1);
    border-radius: var(--radius-md);
    background: var(--surface);
    text-align: center;
}

.nutrient dd {
    margin: 0;
    font-size: var(--fs-lg);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.nutrient dd small {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
}

.nutrient dt {
    font-size: 11px;
    color: var(--muted);
}

.nutrient--kcal dd {
    color: var(--accent);
}

.fit-list {
    display: flex;
    flex-direction: column;
}

.fit {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding-block: var(--space-2);
}

.fit + .fit {
    border-top: 1px solid var(--line);
}

.fit__mark {
    display: grid;
    place-items: center;
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 800;
}

.fit--yes .fit__mark     { background: var(--ok-soft);     color: var(--ok); }
.fit--no .fit__mark      { background: var(--danger-soft); color: var(--danger); }
.fit--pending .fit__mark { background: var(--surface-2);   color: var(--muted); }

.fit__text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    font-size: var(--fs-sm);
}

.fit__text small {
    font-size: 12px;
    color: var(--muted);
}

.fit__who {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
}

.page-recipe .stepper__value {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding-inline: var(--space-1);
}

.page-recipe .stepper__value small {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
}

.ingredients {
    display: flex;
    flex-direction: column;
}

.ingredient {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    padding-block: var(--space-2);
    font-size: var(--fs-sm);
}

.ingredient + .ingredient {
    border-top: 1px solid var(--line);
}

.ingredient__icon {
    font-size: 18px;
    line-height: 1;
}

.ingredient__name small {
    margin-inline-start: 4px;
    font-size: 11px;
    color: var(--muted);
}

.ingredient__qty {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ingredient.is-optional {
    opacity: 0.75;
}

.steps {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.step {
    display: flex;
    gap: var(--space-3);
}

.step__n {
    display: grid;
    place-items: center;
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--primary-ink);
    font-weight: 800;
    font-size: var(--fs-sm);
}

.step__body p {
    font-size: var(--fs-md);
    line-height: 1.8;
}

.step__timer {
    display: inline-block;
    margin-top: var(--space-1);
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--accent);
}

@media (max-width: 380px) {
    .nutrients {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* =====================================================================
   Food section tabs
   ===================================================================== */

.food-tabs {
    display: flex;
    gap: var(--space-1);
    margin: 0 calc(var(--space-5) * -1) var(--space-2);
    padding: 0 var(--space-5) var(--space-1);
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--line);
}

.food-tabs::-webkit-scrollbar {
    display: none;
}

.food-tabs__item {
    position: relative;
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: var(--space-2) var(--space-3);
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--muted);
    white-space: nowrap;
}

.food-tabs__item.is-active {
    color: var(--text);
}

.food-tabs__item.is-active::after {
    content: '';
    position: absolute;
    inset-inline: var(--space-3);
    bottom: -5px;
    height: 3px;
    border-radius: 3px;
    background: var(--accent);
}

.food-tabs__badge {
    min-width: 18px;
    height: 18px;
    padding-inline: 5px;
    border-radius: var(--radius-pill);
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
}

.banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--fs-sm);
    font-weight: 700;
}

.banner--warn {
    background: var(--warn-soft);
    border: 1px solid var(--warn);
}

/* =====================================================================
   Pantry & essentials rows
   ===================================================================== */

.pantry-list {
    display: flex;
    flex-direction: column;
}

.pantry-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: var(--space-2);
    padding-block: var(--space-2);
}

.pantry-row + .pantry-row {
    border-top: 1px solid var(--line);
}

.pantry-row__icon {
    font-size: 20px;
    line-height: 1;
}

.pantry-row__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: var(--fs-sm);
}

.pantry-row__text small {
    font-size: 12px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.pantry-row.is-low .pantry-row__state  { color: var(--warn);   font-weight: 700; }
.pantry-row.is-out .pantry-row__state  { color: var(--danger); font-weight: 700; }
.pantry-row.is-out .pantry-row__icon   { opacity: 0.5; }

.pantry-row .stepper__btn {
    width: 30px;
    height: 30px;
}

.page-pantry .panel,
.page-essentials .panel {
    margin-bottom: var(--space-4);
}

.page-essentials .pantry-list {
    margin-bottom: var(--space-4);
}

/* =====================================================================
   Cart
   ===================================================================== */

.cart-store {
    margin-bottom: var(--space-4);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 3px solid var(--brand, var(--accent));
}

.cart-store__head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    font-size: var(--fs-sm);
}

.cart-store__meta {
    margin-inline-start: auto;
    font-size: 11px;
    color: var(--muted);
}

.cart-store__warn {
    margin-top: var(--space-2);
    font-size: 12px;
    font-weight: 700;
    color: var(--warn);
}

.cart-lines {
    margin-top: var(--space-2);
}

.cart-line {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    grid-template-areas:
        "icon text  total"
        "icon step  step"
        "cmp  cmp   cmp";
    align-items: center;
    column-gap: var(--space-3);
    row-gap: var(--space-1);
    padding-block: var(--space-3);
}

.cart-line + .cart-line {
    border-top: 1px solid var(--line);
}

.cart-line__icon  { grid-area: icon; font-size: 20px; align-self: start; }
.cart-line__text  { grid-area: text; display: flex; flex-direction: column; min-width: 0; font-size: var(--fs-sm); }
.cart-line__text small { font-size: 11px; color: var(--muted); }
.cart-line__total { grid-area: total; font-size: var(--fs-sm); font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cart-line .stepper { grid-area: step; justify-self: start; }
.cart-line .compare { grid-area: cmp; }

.compare summary {
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    list-style: none;
}

.compare summary::-webkit-details-marker {
    display: none;
}

.compare ul {
    margin-top: var(--space-2);
    border-radius: var(--radius-md);
    background: var(--surface-2);
}

.compare li {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    font-size: 12px;
}

.compare li + li {
    border-top: 1px solid var(--line);
}

.compare__price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.compare__price small {
    font-size: 10px;
    font-weight: 600;
    color: var(--muted);
}

.compare__price.is-cheaper small {
    color: var(--ok);
}

.wallet-line {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--ok-soft);
    font-size: var(--fs-xs);
}

.wallet-line strong {
    margin-inline-start: auto;
    white-space: nowrap;
}

.wallet-line.is-short {
    background: var(--danger-soft);
}

.wallet-line .icon {
    color: var(--accent);
}

.summary .form {
    margin-top: var(--space-4);
}

.cart-clear {
    display: block;
    margin: var(--space-4) auto 0;
}

/* =====================================================================
   Orders
   ===================================================================== */

.order .panel__summary {
    align-items: center;
}

.order__status {
    flex: none;
    padding: 2px var(--space-2);
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 800;
}

.order__status--placed    { background: var(--accent-soft); color: var(--accent); }
.order__status--delivered { background: var(--ok-soft);     color: var(--ok); }
.order__status--cancelled { background: var(--surface-2);   color: var(--muted); }

.order__head {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    font-size: var(--fs-sm);
}

.order__head small {
    font-size: 11px;
    font-weight: 400;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order__total {
    font-size: var(--fs-sm);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.order__lines li {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-2);
    padding-block: 6px;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.order__fees {
    color: var(--muted);
    border-top: 1px dashed var(--line-strong);
}

.order__actions {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

/* =====================================================================
   Recipe: shopping actions
   ===================================================================== */

.ingredient.is-missing .ingredient__qty {
    color: var(--warn);
}

.ingredient.is-missing .ingredient__name::after {
    content: ' •';
    color: var(--warn);
}

.recipe-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-top: var(--space-4);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.recipe-actions__status {
    font-size: var(--fs-sm);
    font-weight: 700;
}

/* =====================================================================
   Meal plan
   ===================================================================== */

.segmented--3 {
    grid-template-columns: repeat(3, 1fr);
}

.checks {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-5);
}

.plan-programs {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    margin-bottom: var(--space-4);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--surface);
    font-size: var(--fs-xs);
}

.plan-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
    margin: 0 0 var(--space-3);
}

.plan-stats > div {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.plan-stats dd {
    margin: 0;
    font-size: var(--fs-xl);
    font-weight: 800;
    color: var(--accent);
}

.plan-stats dt {
    font-size: 11px;
    color: var(--muted);
}

.plan-fit {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--fs-sm);
    font-weight: 700;
}

.plan-fit.is-full    { background: var(--ok-soft);   color: var(--ok); }
.plan-fit.is-partial { background: var(--warn-soft); color: var(--text); border: 1px solid var(--warn); }

.week-costs li {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    padding-block: var(--space-2);
    font-size: var(--fs-sm);
}

.week-costs li + li {
    border-top: 1px solid var(--line);
}

.week-costs bdi {
    font-weight: 700;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.week-costs__total {
    font-weight: 800;
}

.week-costs__total bdi {
    color: var(--accent);
}

.plan-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin: var(--space-5) 0;
}

.plan-actions__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
}

.plan-day {
    padding-block: var(--space-3);
}

.plan-day + .plan-day {
    border-top: 1px solid var(--line);
}

.plan-day__title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--fs-sm);
    font-weight: 800;
    margin-bottom: var(--space-1);
}

.plan-day.is-today .plan-day__title {
    color: var(--accent);
}

.plan-meal {
    display: grid;
    grid-template-columns: 64px 26px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-2);
    padding-block: var(--space-2);
}

.plan-meal__slot {
    font-size: var(--fs-xs);
    color: var(--muted);
    font-weight: 600;
}

.plan-meal__icon {
    font-size: 20px;
    line-height: 1;
}

.plan-meal__name {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: var(--fs-sm);
    font-weight: 700;
}

.plan-meal__name .pill {
    align-self: flex-start;
    margin-top: 2px;
}

.plan-meal__miss {
    font-size: 11px;
    font-weight: 600;
    color: var(--warn);
}

.plan-meal.is-cooked .plan-meal__name,
.plan-meal.is-skipped .plan-meal__name {
    color: var(--muted);
}

.plan-meal.is-skipped .plan-meal__name {
    text-decoration: line-through;
}

.plan-meal__actions {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
}

.more {
    position: relative;
}

.more summary {
    display: grid;
    place-items: center;
    width: 30px;
    height: 28px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    list-style: none;
    color: var(--muted);
    font-weight: 800;
}

.more summary::-webkit-details-marker {
    display: none;
}

.more__menu {
    position: absolute;
    top: calc(100% + 4px);
    inset-inline-end: 0;
    z-index: 10;
    min-width: 180px;
    padding: var(--space-1);
    border-radius: var(--radius-md);
    background: var(--bg-2);
    border: 1px solid var(--line-strong);
    box-shadow: 0 16px 40px -12px rgba(2, 6, 23, 0.6);
}

.more__menu button {
    display: block;
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    text-align: start;
}

.more__menu button:hover {
    background: var(--accent-soft);
}

.weeks {
    display: flex;
    gap: var(--space-2);
    overflow-x: auto;
    margin: 0 calc(var(--space-5) * -1) var(--space-3);
    padding: 0 var(--space-5) var(--space-1);
    scrollbar-width: none;
}

.week {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--line);
    font-size: var(--fs-xs);
}

.week.is-current {
    border-color: var(--accent);
}

.week__label {
    font-weight: 800;
}

.week__state {
    color: var(--ok);
    font-weight: 700;
}

.center {
    text-align: center;
    margin: var(--space-4) 0;
}

.page-plan .panel {
    margin-top: var(--space-5);
}

/* Home: today's meals */
.today__list li {
    display: grid;
    grid-template-columns: 56px 26px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-2);
    padding-block: var(--space-2);
}

.today__list li + li {
    border-top: 1px solid var(--line);
}

.today__slot {
    font-size: var(--fs-xs);
    color: var(--muted);
}

.today__icon {
    font-size: 20px;
}

.today__name {
    font-size: var(--fs-sm);
    font-weight: 700;
}

/* =====================================================================
   Cooking mode
   ===================================================================== */

.page-cook .tabbar {
    display: none;
}

.page-cook .screen {
    padding-bottom: var(--space-8);
}

.cook {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.cook__head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.cook__icon {
    font-size: 40px;
    line-height: 1;
}

.cook__title {
    font-size: var(--fs-lg);
    font-weight: 800;
}

.cook__meta {
    font-size: var(--fs-xs);
    color: var(--muted);
}

.cook__progress {
    height: 6px;
    border-radius: 6px;
    background: var(--line);
    overflow: hidden;
}

.cook__progress span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width 0.35s var(--ease);
}

[dir="rtl"] .cook__progress span {
    margin-inline-start: 0;
}

.cook__counter {
    font-size: var(--fs-sm);
    font-weight: 800;
    color: var(--accent);
}

.cook__text {
    min-height: 8em;
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.8;
}

.cook__timer .timer-btn {
    height: 48px;
    padding-inline: var(--space-5);
    font-size: var(--fs-md);
}

.cook__nav {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--space-2);
}

.cook__nav .btn {
    height: 56px;
    padding-inline: var(--space-3);
    font-size: var(--fs-md);
    white-space: nowrap;
}

.cook__finish {
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    background: var(--ok-soft);
    text-align: center;
    font-weight: 700;
}

.cook__finish p {
    margin-bottom: var(--space-4);
}

.cook__tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
}

.cook-tool {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    height: 46px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--line-strong);
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--muted);
}

.cook-tool.is-on {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

.cook-tool:disabled {
    opacity: 0.4;
}

.cook__hint {
    font-size: var(--fs-xs);
    color: var(--muted);
    text-align: center;
}

.plan-meal--alt {
    padding-top: 0;
}

.plan-meal--alt .plan-meal__name {
    font-weight: 600;
}

.plan-meal__for {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
}

/* =====================================================================
   Searchable dropdowns
   ===================================================================== */

.combo {
    position: relative;
}

.combo__input {
    cursor: text;
}

[dir="rtl"] .combo__input {
    padding-left: 44px;
}

[dir="ltr"] .combo__input {
    padding-right: 44px;
}

.combo__toggle {
    position: absolute;
    top: 0;
    inset-inline-end: 0;
    width: 44px;
    height: 50px;
    cursor: pointer;
}

.combo__toggle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: translate(-50%, -70%) rotate(45deg);
    transition: transform 0.2s var(--ease);
}

.combo.is-open .combo__toggle::before {
    transform: translate(-50%, -30%) rotate(-135deg);
}

.combo__list {
    max-height: 264px;
    margin-top: 6px;
    padding: 4px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: var(--radius-md);
    border: 1px solid var(--line-strong);
    background: var(--bg-2);
    box-shadow: 0 16px 40px -16px rgba(2, 6, 23, 0.6);
    scrollbar-width: thin;
}

.combo__option {
    padding: 10px var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    cursor: pointer;
}

.combo__option.is-active {
    background: var(--accent-soft);
    color: var(--text);
}

.combo__option[aria-selected="true"] {
    font-weight: 800;
    color: var(--accent);
}

.combo__empty {
    padding: var(--space-3);
    font-size: var(--fs-sm);
    color: var(--muted);
    text-align: center;
}

.combo.has-error .combo__input {
    border-color: var(--danger);
}

/* =====================================================================
   Home: briefing
   ===================================================================== */

.page-home .screen {
    padding-bottom: calc(var(--tabbar-h) + 150px);
}

.brief {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-2) 0 var(--space-5);
    text-align: center;
}

.orb--brief {
    --orb-size: 112px;
    margin: var(--space-2) 0 var(--space-4);
}

.orb--brief .wave {
    height: 40px;
    gap: 4px;
}

.orb--brief .wave i {
    width: 5px;
}

.brief__date {
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--muted);
}

.brief__greeting {
    margin-top: 2px;
    font-size: var(--fs-2xl);
    font-weight: 800;
    line-height: 1.25;
}

html[lang^="ar"] .brief__greeting {
    letter-spacing: 0;
}

.brief__text {
    max-width: 38ch;
    margin-top: var(--space-3);
    font-size: var(--fs-md);
    line-height: 1.85;
    color: var(--text-2);
}

.brief__text p + p {
    margin-top: 2px;
}

.brief__listen {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-4);
    padding: 6px var(--space-4);
    border-radius: var(--radius-pill);
    border: 1px solid var(--line-strong);
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--accent);
}

.brief__listen .icon {
    width: 16px;
    height: 16px;
}

.brief-cards {
    display: grid;
    gap: var(--space-3);
}

:root[data-view="full"] .brief-cards {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    align-items: start;
}

.bcard {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--line);
}

a.bcard:hover {
    border-color: var(--accent);
}

.bcard__title {
    font-size: var(--fs-xs);
    font-weight: 800;
    color: var(--muted);
    text-transform: none;
}

.bcard__meals li {
    display: grid;
    grid-template-columns: 24px 54px minmax(0, 1fr);
    align-items: center;
    gap: var(--space-2);
    padding-block: 4px;
    font-size: var(--fs-sm);
}

.bcard__meals li span:nth-child(2) {
    font-size: var(--fs-xs);
    color: var(--muted);
}

.bcard__meals li.is-cooked strong {
    color: var(--muted);
    text-decoration: line-through;
}

.bcard__empty {
    font-size: var(--fs-sm);
    color: var(--accent);
}

.bcard__list li a {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding-block: 6px;
    font-size: var(--fs-sm);
    font-weight: 600;
}

.bcard__list li + li {
    border-top: 1px solid var(--line);
}

.bcard__list .icon {
    width: 16px;
    height: 16px;
    margin-inline-start: auto;
    color: var(--muted);
}

.sleep-picks {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
}

.sleep-pick {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--space-2);
    border-radius: var(--radius-md);
    border: 1px solid var(--line-strong);
    font-size: var(--fs-xs);
    font-weight: 700;
}

.sleep-pick span {
    font-size: 22px;
    line-height: 1.2;
}

.sleep-pick.is-active {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

.bcard__chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

/* One microphone, docked above the tabs (the device frame is its containing block) */
.dock {
    position: fixed;
    inset-inline: 0;
    bottom: calc(var(--tabbar-h) + var(--space-3) + env(safe-area-inset-bottom, 0px));
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    pointer-events: none;
}

:root[data-view="full"] .dock {
    bottom: calc(var(--tabbar-h) + var(--space-8));
}

.dock::before {
    content: '';
    position: absolute;
    inset: -28px 0 -16px;
    z-index: -1;
    background: linear-gradient(to top, var(--bg-2) 45%, transparent);
    pointer-events: none;
}

body.sheet-open .dock {
    visibility: hidden;
}

body.sheet-open .toasts {
    top: calc(var(--space-8) + env(safe-area-inset-top, 0px));
    bottom: auto;
}

.dock > * {
    pointer-events: auto;
}

.dock__side {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    color: var(--text-2);
    box-shadow: 0 0 0 5px var(--bg-2);
}

/* =====================================================================
   Conversation sheet
   ===================================================================== */

.sheet {
    position: absolute;
    inset: 0;
    z-index: 40;
}

.sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.55);
    opacity: 0;
    transition: opacity 0.22s var(--ease);
}

.sheet__panel {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    height: 88%;
    margin-inline: auto;
    max-width: 760px;
    border-radius: 28px 28px 0 0;
    background: var(--bg-2);
    border-top: 1px solid var(--line-strong);
    box-shadow: 0 -20px 60px -20px rgba(2, 6, 23, 0.8);
    transform: translateY(100%);
    transition: transform 0.24s var(--ease);
}

.sheet.is-open .sheet__backdrop { opacity: 1; }
.sheet.is-open .sheet__panel { transform: none; }

.sheet__head {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-5) var(--space-2);
}

.sheet__titles {
    flex: 1;
    min-width: 0;
}

.sheet__title {
    font-size: var(--fs-lg);
    font-weight: 800;
}

.sheet .orb-status {
    margin: 0;
    max-width: none;
    font-size: var(--fs-xs);
    text-align: start;
}

.sheet .feed {
    flex: 1;
    overflow-y: auto;
    margin: 0;
    padding: var(--space-2) var(--space-5);
    overscroll-behavior: contain;
}

.sheet .chips {
    margin: 0;
    padding: var(--space-2) var(--space-5);
}

.sheet .composer {
    margin: var(--space-2) var(--space-5) calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
}

body.sheet-open .tabbar {
    visibility: hidden;
}

/* =====================================================================
   Conversations page
   ===================================================================== */

.history-day {
    padding-block: var(--space-4);
}

.history-day + .history-day {
    border-top: 1px solid var(--line);
}

.history-day__title {
    margin-bottom: var(--space-3);
    font-size: var(--fs-xs);
    font-weight: 800;
    color: var(--muted);
    text-align: center;
}

.bubble__time {
    display: block;
    margin-top: 4px;
    font-size: 10px;
    opacity: 0.7;
    text-align: end;
}

.page-conversations .search {
    margin-bottom: var(--space-3);
}

/* ---------- Home v2: logo on top, the orb is the talk button ---------- */

.brief__logo {
    width: 132px;
    height: auto;
    margin: var(--space-2) 0 var(--space-4);
}

:root[data-theme="light"] .brief__logo {
    filter: drop-shadow(0 1px 1px rgba(15, 23, 42, 0.25));
}

.dock {
    align-items: center;
    gap: var(--space-6);
}

.dock__center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.orb--dock {
    --orb-size: 72px;
    margin: 0;
    box-shadow: 0 0 0 5px var(--bg-2);
    border-radius: 50%;
}

.orb--dock .orb__halo {
    inset: -16px;
}

.orb--dock .orb__ring {
    inset: -6px;
}

.orb--dock .wave {
    height: 28px;
    gap: 3px;
}

.orb--dock .wave i {
    width: 4px;
}

.dock__hey {
    font-family: var(--font);
    font-size: var(--fs-xs);
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--accent);
    white-space: nowrap;
}

.bcard--tomorrow .bcard__chips {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bcard--tomorrow .chip {
    justify-content: center;
}

/* =====================================================================
   Planner (agenda)
   ===================================================================== */

.week {
    display: grid;
    grid-template-columns: 28px repeat(7, minmax(0, 1fr)) 28px;
    align-items: center;
    gap: 4px;
    margin-bottom: var(--space-4);
}

.week__nav {
    display: grid;
    place-items: center;
    height: 56px;
    color: var(--muted);
}

.week__day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 0;
    border-radius: var(--radius-md);
    transition: background-color 0.2s;
}

.week__day:hover {
    background: var(--accent-soft);
}

.week__name {
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
}

.week__num {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: var(--fs-sm);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.week__day.is-today .week__num {
    color: var(--accent);
    box-shadow: inset 0 0 0 1.5px var(--accent);
}

.week__day.is-selected .week__num {
    background: var(--primary);
    color: var(--primary-ink);
    box-shadow: none;
}

.week__dots {
    display: flex;
    gap: 2px;
    height: 5px;
}

.week__dots i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
}

.quick-add {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    padding: 5px;
    padding-inline-start: var(--space-4);
    margin-bottom: var(--space-5);
    border-radius: var(--radius-pill);
    background: var(--surface);
    border: 1px dashed var(--line-strong);
}

.quick-add:focus-within {
    border-style: solid;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.quick-add input {
    flex: 1;
    min-width: 0;
    height: 40px;
    border: 0;
    background: transparent;
    font-size: var(--fs-sm);
}

.quick-add input:focus {
    outline: none;
}

.quick-add input::placeholder {
    color: var(--muted);
}

.day-agenda__title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
    font-size: var(--fs-md);
    font-weight: 800;
}

.agenda {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.agenda__item {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--surface);
    border-inline-start: 3px solid var(--accent);
}

.agenda__item--bill        { border-inline-start-color: var(--warn); }
.agenda__item--birthday    { border-inline-start-color: #F472B6; }
.agenda__item--alarm       { border-inline-start-color: #A78BFA; }
.agenda__item--appointment { border-inline-start-color: var(--ok); }
.agenda__item--travel      { border-inline-start-color: #FB923C; }
.agenda__item--meal        { border-inline-start-color: var(--line-strong); background: transparent; border: 1px dashed var(--line); border-inline-start-width: 3px; }

.agenda__time {
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
}

.agenda__body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.agenda__title {
    font-size: var(--fs-sm);
    font-weight: 700;
}

.agenda__meta {
    font-size: 11px;
    color: var(--muted);
}

.agenda__item.is-done .agenda__title,
.agenda__item.is-cooked .agenda__title {
    color: var(--muted);
    text-decoration: line-through;
}

.agenda__sub {
    margin: var(--space-5) 0 var(--space-2);
    font-size: var(--fs-xs);
    font-weight: 800;
    color: var(--muted);
}

.agenda--compact .agenda__item {
    grid-template-columns: 64px minmax(0, 1fr);
    padding: var(--space-2) var(--space-3);
}

.check-btn {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--line-strong);
    color: transparent;
    font-weight: 800;
}

.check-btn:hover {
    border-color: var(--ok);
    color: var(--ok);
}

.check-btn.is-on {
    border-color: var(--ok);
    background: var(--ok);
    color: #04140D;
}

/* Event form */
.type-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-2);
}

.type-pick {
    position: relative;
    cursor: pointer;
}

.type-pick input {
    position: absolute;
    opacity: 0;
    inset: 0;
}

.type-pick span {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--space-2) 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line-strong);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

.type-pick b {
    font-size: 20px;
    font-weight: 400;
}

.type-pick input:checked + span {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

.type-pick input:focus-visible + span {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.field__input--area {
    height: auto;
    min-height: 90px;
    padding-block: var(--space-3);
    resize: vertical;
    line-height: 1.6;
}

/* Notifications */
.bell {
    position: relative;
}

.bell__count {
    position: absolute;
    top: 2px;
    inset-inline-end: 2px;
    min-width: 16px;
    height: 16px;
    padding-inline: 4px;
    border-radius: var(--radius-pill);
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 16px;
    text-align: center;
}

.notif-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.notif a {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--surface);
    font-size: var(--fs-sm);
}

.notif.is-new a {
    border-inline-start: 3px solid var(--accent);
}

.notif span {
    color: var(--text-2);
}

.notif small {
    font-size: 11px;
    color: var(--muted);
}

/* Calendar sync */
.calendar-sync__title {
    margin-top: var(--space-5);
}

.calendar-link {
    margin: var(--space-3) 0;
}

.sync-steps {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    margin-bottom: var(--space-3);
    font-size: 12px;
    color: var(--text-2);
}

.bcard__events li span:nth-child(2) {
    font-variant-numeric: tabular-nums;
}

/* Push notifications & install */
.push-box {
    padding: var(--space-4);
    margin-bottom: var(--space-4);
    border-radius: var(--radius-md);
    background: var(--surface-2);
}

.push-box .panel__title {
    margin-bottom: var(--space-2);
}

.push-on {
    color: var(--ok);
    font-weight: 700;
}

.push-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-top: var(--space-3);
}

.install-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    border: 1px dashed var(--accent);
    font-size: var(--fs-sm);
}

/* Diagnostics */
.diag li {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    column-gap: var(--space-2);
    padding-block: var(--space-2);
    font-size: var(--fs-sm);
    border-bottom: 1px solid var(--line);
}

.diag li > span {
    grid-row: span 3;
    font-weight: 800;
}

.diag li small {
    grid-column: 2;
    font-size: 12px;
    color: var(--muted);
    word-break: break-word;
}

.diag li.is-ok > span { color: var(--ok); }
.diag li.is-bad > span { color: var(--danger); }

/* =====================================================================
   Car
   ===================================================================== */

.car-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-8) var(--space-4);
    text-align: center;
}

.car-empty__icon {
    font-size: 64px;
}

.car-empty h1 {
    font-size: var(--fs-xl);
    font-weight: 800;
}

.car-empty p {
    max-width: 34ch;
    color: var(--text-2);
}

.car-card {
    margin: var(--space-2) 0 var(--space-4);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--accent-soft), var(--surface));
    border: 1px solid var(--line);
}

.car-card__head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.car-card__head > div {
    flex: 1;
    min-width: 0;
}

.car-card__icon {
    font-size: 40px;
    line-height: 1;
}

.car-card__name {
    font-size: var(--fs-lg);
    font-weight: 800;
}

.car-card__meta {
    font-size: var(--fs-xs);
    color: var(--text-2);
}

.plate {
    padding: 0 6px;
    border-radius: 4px;
    border: 1px solid var(--line-strong);
    font-weight: 700;
    white-space: nowrap;
}

.odo {
    display: grid;
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.odo__value {
    display: flex;
    flex-direction: column;
}

.odo__label {
    font-size: var(--fs-xs);
    color: var(--muted);
    font-weight: 700;
}

.odo__value strong {
    align-self: flex-start;
    font-size: 2rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.odo__value strong small {
    font-size: var(--fs-sm);
    color: var(--muted);
}

.odo__hint {
    font-size: 11px;
    color: var(--muted);
}

.odo__form {
    display: flex;
    gap: var(--space-2);
}

.odo__form .field__input {
    flex: 1;
    min-width: 0;
    height: 42px;
}

.svc-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.svc {
    --state: var(--line-strong);
    border-radius: var(--radius-md);
    background: var(--surface);
    border-inline-start: 3px solid var(--state);
}

.svc.is-overdue { --state: var(--danger); }
.svc.is-due     { --state: var(--warn); }
.svc.is-soon    { --state: #FACC15; }
.svc.is-ok      { --state: var(--ok); }

.svc:not(:has(details)),
.svc__details > summary {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
}

.svc__details > summary {
    cursor: pointer;
    list-style: none;
}

.svc__details > summary::-webkit-details-marker {
    display: none;
}

.svc__icon {
    font-size: 20px;
    line-height: 1;
}

.svc__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: var(--fs-sm);
}

.svc__text small {
    font-size: 12px;
    color: var(--muted);
}

.svc__state {
    padding: 2px var(--space-2);
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 800;
    color: var(--state);
    background: color-mix(in srgb, var(--state) 14%, transparent);
    white-space: nowrap;
}

.svc.is-unknown .svc__state {
    color: var(--muted);
}

.svc__form {
    padding: 0 var(--space-3) var(--space-3);
}

.fuel-stats {
    margin-bottom: var(--space-4);
}

.fuel-stats .nutrient dd {
    font-size: var(--fs-md);
}

.fuel-list {
    display: flex;
    flex-direction: column;
}

.fuel-row {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    padding-block: var(--space-2);
}

.fuel-row + .fuel-row {
    border-top: 1px solid var(--line);
}

.fuel-row__date {
    font-size: var(--fs-xs);
    color: var(--muted);
}

.fuel-row__main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: var(--fs-sm);
}

.fuel-row__main small {
    font-size: 12px;
    color: var(--muted);
}

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

.setup-box {
    padding: var(--space-4);
    border-radius: var(--radius-md);
    border: 1px dashed var(--line-strong);
}

.setup-box legend {
    padding-inline: var(--space-2);
    font-size: var(--fs-sm);
    font-weight: 800;
}

.checks--grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
}

.vehicle-switch {
    margin-bottom: var(--space-3);
}

.page-service .panel,
.page-papers .panel,
.page-fuel .panel {
    margin-block: var(--space-4);
}

@media (max-width: 380px) {
    .type-grid--4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* =====================================================================
   Health
   ===================================================================== */

.doses {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.dose {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--surface);
    border-inline-start: 3px solid var(--line-strong);
}

.dose.is-due     { border-inline-start-color: var(--accent); background: var(--accent-soft); }
.dose.is-late    { border-inline-start-color: var(--warn); }
.dose.is-taken   { border-inline-start-color: var(--ok); }
.dose.is-skipped { opacity: 0.6; }

.dose__time {
    font-size: var(--fs-sm);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.dose__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: var(--fs-sm);
}

.dose__text small {
    font-size: 12px;
    color: var(--muted);
}

.dose.is-taken .dose__text strong {
    color: var(--muted);
    text-decoration: line-through;
}

.dose__actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.vitals {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
}

:root[data-view="full"] .vitals {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.vital {
    --tone: var(--line-strong);
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--surface);
    border-top: 3px solid var(--tone);
}

.vital.is-ok   { --tone: var(--ok); }
.vital.is-warn { --tone: var(--warn); }
.vital.is-bad  { --tone: var(--danger); }

.vital__label {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
}

.vital__value {
    font-size: var(--fs-xl);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.vital__value small {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
}

.vital__note {
    font-size: 11px;
    color: var(--text-2);
}

.tone--ok   { color: var(--ok); font-weight: 700; }
.tone--warn { color: var(--warn); font-weight: 700; }
.tone--bad  { color: var(--danger); font-weight: 700; }

.chart-box {
    margin-bottom: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.chart {
    direction: ltr;
    display: block;
    width: 100%;
    height: 130px;
}

.chart__line {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2.5;
    stroke-linejoin: round;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}

.chart__line--1 {
    stroke: #F472B6;
}

.chart__dot {
    fill: var(--accent);
    stroke: none;
}

.chart__dot.chart__line--1 {
    fill: #F472B6;
}

.chart__label {
    font-size: 10px;
    fill: var(--muted);
}

.med-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.med-card {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--line);
}

.med-card:hover {
    border-color: var(--accent);
}

.med-card__icon {
    font-size: 22px;
}

.med-card__body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: var(--fs-sm);
}

.med-card__body small {
    font-size: 12px;
    color: var(--muted);
}

.med-card__stock {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.med-card__stock small {
    font-size: 10px;
    font-weight: 600;
    color: var(--muted);
}

.med-card__stock.is-low {
    color: var(--warn);
}

.presets {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.time-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.time-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.time-row .field__input {
    flex: 1;
}

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

.plain-list li {
    padding-block: var(--space-2);
    font-size: var(--fs-sm);
}

.plain-list li + li {
    border-top: 1px solid var(--line);
}

.reading-form {
    margin: var(--space-3) 0 var(--space-5);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

/* Apple Health connection */
.connect-status {
    margin-bottom: var(--space-4);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--surface-2);
    font-size: var(--fs-sm);
    font-weight: 700;
}

.connect-status.is-ok {
    background: var(--ok-soft);
    color: var(--ok);
}

.howto {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding-inline-start: var(--space-5);
    list-style: decimal;
    font-size: var(--fs-sm);
    line-height: 1.7;
}

.code-box {
    margin-top: var(--space-2);
    padding: var(--space-3);
    border-radius: var(--radius-sm);
    background: var(--bg);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.8;
    text-align: left;
}

@media (max-width: 380px) {
    .form__grid--3 {
        grid-template-columns: 1fr;
    }
}

/* =====================================================================
   Places & map
   ===================================================================== */

.places {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.place-row {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--surface-2);
}

.place-row__icon {
    font-size: 22px;
}

.place-row__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: var(--fs-sm);
}

.place-row__text small {
    font-size: 12px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.place-search {
    padding-inline-end: 6px;
}

.place-results {
    margin-top: var(--space-2);
    border-radius: var(--radius-md);
    background: var(--bg-2);
    border: 1px solid var(--line-strong);
    overflow: hidden;
}

.place-results button {
    display: block;
    width: 100%;
    padding: var(--space-3);
    font-size: var(--fs-sm);
    text-align: start;
    line-height: 1.5;
}

.place-results li + li {
    border-top: 1px solid var(--line);
}

.place-results button:hover {
    background: var(--accent-soft);
}

.place-results__note {
    padding: var(--space-3);
    font-size: var(--fs-sm);
    color: var(--muted);
}

.map-wrap {
    position: relative;
    margin: var(--space-3) 0 var(--space-2);
}

.map {
    height: 340px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line-strong);
}

.map-error {
    padding: var(--space-6);
    text-align: center;
    color: var(--muted);
}

.map-locate {
    position: absolute;
    right: 12px;
    bottom: 28px;
    z-index: 500;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    color: #0B1120;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.map-pin {
    background: none;
    border: 0;
}

.map-pin span {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50% 50% 50% 0;
    background: var(--primary);
    transform: rotate(-45deg);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
    font-size: 20px;
}

.map-pin i {
    font-style: normal;
    transform: rotate(45deg); /* keep the emoji upright inside the tilted pin */
}

.leaflet-container {
    font-family: var(--font);
}

/* Voice picker */
.voice-pick {
    padding: var(--space-3) var(--space-4) var(--space-4);
}

.voice-pick__row {
    display: flex;
    gap: var(--space-2);
}

.voice-pick__row .field__input {
    flex: 1;
    min-width: 0;
}

/* =====================================================================
   Weather & commute
   ===================================================================== */

.wx {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    gap: var(--space-3);
}

.wx__icon {
    font-size: 36px;
    line-height: 1;
}

.wx__temp {
    font-size: 2rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.wx__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: var(--fs-sm);
}

.wx__text small {
    font-size: 12px;
    color: var(--muted);
}

.wx-commute {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    background: var(--accent-soft);
    font-size: var(--fs-sm);
    font-weight: 700;
}

.wx-commute small {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
}

.wx__credit {
    font-size: 10px;
    color: var(--muted);
}

.commute-form {
    margin-top: var(--space-5);
    padding-top: var(--space-4);
    border-top: 1px solid var(--line);
}

.day-picks {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}

.day-pick {
    position: relative;
}

.day-pick input {
    position: absolute;
    opacity: 0;
    inset: 0;
}

.day-pick span {
    display: block;
    padding: var(--space-2) 0;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

.day-pick input:checked + span {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

.day-pick input:focus-visible + span {
    outline: 2px solid var(--accent);
}

/* =====================================================================
   Admin
   ===================================================================== */

.admin-tabs {
    margin-bottom: var(--space-4);
}

.kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
    margin-bottom: var(--space-5);
}

:root[data-view="full"] .kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kpis--small .kpi__value {
    font-size: var(--fs-lg);
}

:root[data-view="full"] .kpis--small {
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.kpi {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--line);
}

.kpi__label {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
}

.kpi__value {
    font-size: var(--fs-xl);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.25;
}

.kpi__note {
    font-size: 11px;
    color: var(--ok);
    font-weight: 700;
}

.chart--bars {
    height: 160px;
}

.chart__bar {
    fill: var(--accent);
    opacity: 0.85;
}

.chart__bar:hover {
    opacity: 1;
}

.admin-grid {
    display: grid;
    gap: var(--space-4);
}

:root[data-view="full"] .admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.admin-grid > .block,
.admin-grid > form.block {
    margin: 0;
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--line);
}

.admin-list li + li {
    border-top: 1px solid var(--line);
}

.admin-list a {
    display: flex;
    flex-direction: column;
    padding-block: var(--space-2);
    font-size: var(--fs-sm);
}

.admin-list small {
    font-size: 11px;
    color: var(--muted);
}

.admin-list--plain li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
    padding-block: var(--space-2);
    font-size: var(--fs-sm);
}

.admin-list--plain li strong {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.admin-list--small li {
    font-size: 12px;
}

.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-sm);
}

.table th,
.table td {
    padding: var(--space-2) var(--space-3);
    text-align: start;
    white-space: nowrap;
    border-bottom: 1px solid var(--line);
}

.table th {
    font-size: 11px;
    font-weight: 800;
    color: var(--muted);
    background: var(--surface);
}

.table tbody tr:hover {
    background: var(--surface);
}

.table__actions {
    display: flex;
    gap: var(--space-2);
    align-items: center;
}

.status {
    display: inline-block;
    padding: 1px var(--space-2);
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 800;
    background: var(--surface-2);
    color: var(--muted);
}

.status--active,
.status--delivered,
.status--closed  { background: var(--ok-soft);     color: var(--ok); }
.status--pending,
.status--placed  { background: var(--warn-soft);   color: var(--warn); }
.status--open    { background: var(--accent-soft); color: var(--accent); }
.status--suspended,
.status--cancelled { background: var(--danger-soft); color: var(--danger); }

.admin-person .avatar {
    flex: none;
}

.admin-person .car-card__name small {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--muted);
}

.admin-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2) var(--space-4);
    margin: var(--space-4) 0 0;
}

.admin-facts dt {
    font-size: 11px;
    color: var(--muted);
}

.admin-facts dd {
    margin: 0;
    font-size: var(--fs-sm);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.ticket-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.ticket-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--surface);
    border-inline-start: 3px solid var(--line-strong);
}

.ticket-row.is-open    { border-inline-start-color: var(--accent); }
.ticket-row.is-pending { border-inline-start-color: var(--warn); }

.ticket-row__main,
.ticket-row__side {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ticket-row__side {
    align-items: flex-end;
    flex: none;
}

.ticket-row__main strong {
    font-size: var(--fs-sm);
}

.ticket-row small {
    font-size: 11px;
    color: var(--muted);
}

.thread {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin: var(--space-3) 0 var(--space-5);
}

.reply-form {
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    background: var(--surface);
    margin-bottom: var(--space-3);
}

.field--end {
    display: flex;
    align-items: flex-end;
}

.log-box {
    max-height: 360px;
    overflow: auto;
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--bg);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.diag li.is-warn > span {
    color: var(--warn);
}

/* Home v3: briefing is spoken; text only on request */
.brief__hint {
    margin-top: var(--space-2);
    font-size: var(--fs-sm);
    color: var(--muted);
}

.brief__more {
    margin-top: var(--space-2);
}

.brief__more > summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px var(--space-3);
    border-radius: var(--radius-pill);
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--accent);
    cursor: pointer;
    list-style: none;
}

.brief__more > summary::-webkit-details-marker {
    display: none;
}

.brief__more > summary::after {
    content: '';
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s;
}

.brief__more[open] > summary::after {
    transform: rotate(-135deg) translateY(-2px);
}

.brief__more .brief__text {
    margin: var(--space-3) auto 0;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--surface);
    text-align: start;
}

.icon-previews {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    margin-bottom: var(--space-3);
}

.icon-previews figure {
    margin: 0;
    text-align: center;
}

.icon-previews img {
    display: block;
    width: 64px;
    height: 64px;
    margin: 0 auto 4px;
    border-radius: 12px;
    background: repeating-conic-gradient(#3a4252 0 25%, #2a3140 0 50%) 0 0 / 12px 12px;
}

.icon-previews figcaption {
    font-size: 10px;
    color: var(--muted);
}

/* =====================================================================
   Section menus (compact tabs → floating vertical menu)
   ===================================================================== */

.secnav__toggle,
.secnav__menu,
.secnav__backdrop {
    display: none;
}

.food-tabs.is-compact {
    position: relative;
    z-index: 30;
    overflow: visible;
    padding-bottom: var(--space-2);
}

.food-tabs.is-compact > .food-tabs__item {
    display: none;
}

.food-tabs.is-compact > .secnav__toggle {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    height: 42px;
    padding-inline: var(--space-4);
    border-radius: var(--radius-pill);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    font-size: var(--fs-sm);
    font-weight: 800;
}

.food-tabs.is-open > .secnav__toggle {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.secnav__icon {
    font-size: 16px;
    line-height: 1;
}

.secnav__chevron {
    width: 7px;
    height: 7px;
    margin-inline-start: 2px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s var(--ease);
}

.food-tabs.is-open .secnav__chevron {
    transform: rotate(-135deg) translateY(-2px);
}

.food-tabs.is-compact > .secnav__menu:not([hidden]) {
    position: absolute;
    z-index: 2;
    top: calc(100% - 2px);
    inset-inline-start: var(--space-5);
    display: flex;
    flex-direction: column;
    width: min(300px, calc(100% - 2 * var(--space-5)));
    padding: 6px;
    border-radius: var(--radius-lg);
    background: var(--bg-2);
    border: 1px solid var(--line-strong);
    box-shadow: 0 24px 60px -18px rgba(2, 6, 23, 0.85);
    animation: secnav-in 0.16s var(--ease);
}

@keyframes secnav-in {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
    to   { opacity: 1; transform: none; }
}

.secnav__item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-height: 46px;
    padding: 0 var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--fs-sm);
    font-weight: 700;
}

.secnav__item:hover,
.secnav__item:focus-visible {
    background: var(--accent-soft);
    outline: none;
}

.secnav__item.is-active {
    color: var(--accent);
}

.secnav__item .secnav__icon {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--surface);
    font-size: 16px;
}

.secnav__text {
    flex: 1;
}

.secnav__check {
    font-weight: 800;
}

.food-tabs.is-open > .secnav__backdrop {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: block;
    background: rgba(2, 6, 23, 0.55);
    animation: secnav-fade 0.16s ease;
}

@keyframes secnav-fade {
    from { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .food-tabs.is-compact > .secnav__menu,
    .food-tabs.is-open > .secnav__backdrop {
        animation: none;
    }
}

/* =====================================================================
   Guided tour & what's new
   ===================================================================== */

.tour {
    position: fixed;
    inset: 0;
    z-index: 1000;
    animation: tour-in 0.2s ease;
}

.tour.is-leaving {
    opacity: 0;
    transition: opacity 0.2s;
}

@keyframes tour-in {
    from { opacity: 0; }
}

.tour__hole {
    position: fixed;
    pointer-events: none;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.9), 0 0 0 9999px rgba(2, 6, 23, 0.8);
    transition: top 0.3s var(--ease), left 0.3s var(--ease), width 0.3s var(--ease), height 0.3s var(--ease);
}

.tour.is-centered {
    background: rgba(2, 6, 23, 0.8);
}

.tour.is-centered .tour__hole {
    display: none;
}

.tour__card {
    position: fixed;
    width: min(340px, calc(100vw - 24px));
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    background: var(--bg-2);
    border: 1px solid var(--line-strong);
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8);
    color: var(--text);
    transition: top 0.3s var(--ease), left 0.3s var(--ease);
}

.tour.is-centered .tour__card {
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%);
    text-align: center;
}

.tour__top {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.tour.is-centered .tour__top {
    justify-content: center;
}

.tour__icon {
    font-size: 28px;
    line-height: 1;
}

.tour__badge {
    flex: 1;
    font-size: 11px;
    font-weight: 800;
    color: var(--accent);
}

.tour.is-centered .tour__badge {
    flex: none;
}

.tour__skip {
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--muted);
}

.tour.is-centered .tour__skip {
    position: absolute;
    top: var(--space-4);
    inset-inline-end: var(--space-4);
}

.tour__title {
    font-size: var(--fs-lg);
    font-weight: 800;
    margin-bottom: var(--space-2);
}

.tour__text {
    font-size: var(--fs-sm);
    line-height: 1.8;
    color: var(--text-2);
}

.tour__foot {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-4);
}

.tour__dots {
    display: flex;
    gap: 4px;
}

.tour__dots i {
    width: 6px;
    height: 6px;
    border-radius: 3px;
    background: var(--line-strong);
    transition: width 0.2s;
}

.tour__dots i.is-on {
    width: 16px;
    background: var(--accent);
}

.tour__count {
    flex: 1;
    font-size: 11px;
    color: var(--muted);
}

.tour__back {
    padding: 8px var(--space-3);
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--text-2);
}

.tour__next {
    padding: 8px var(--space-5);
    border-radius: var(--radius-pill);
    background: var(--primary);
    color: var(--primary-ink);
    font-size: var(--fs-sm);
    font-weight: 800;
}

body.tour-open {
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .tour, .tour__hole, .tour__card { animation: none; transition: none; }
}

/* About RUTI */
.about-head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.about-head img {
    width: 96px;
    height: auto;
}

.about-head p {
    font-size: var(--fs-sm);
    color: var(--text-2);
}

.about-facts {
    margin-top: 0;
}

.release {
    margin-bottom: var(--space-3);
    font-size: var(--fs-sm);
}

.release__head {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: var(--fs-xs);
}

.release ul {
    display: flex;
    flex-direction: column;
    gap: 4px;
    line-height: 1.7;
}

.about-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: var(--space-4) 0 var(--space-2);
}

/* Install banner (phone browsers) */
.install-banner {
    position: relative;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    grid-template-areas: "icon body" "icon actions";
    column-gap: var(--space-3);
    row-gap: var(--space-2);
    margin: 0 0 var(--space-4);
    padding: var(--space-3) var(--space-4);
    padding-inline-end: 44px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--accent-soft), var(--surface));
    border: 1px solid var(--accent);
    animation: install-in 0.25s var(--ease);
}

.install-banner.is-leaving {
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.2s, transform 0.2s;
}

@keyframes install-in {
    from { opacity: 0; transform: translateY(-6px); }
}

.install-banner__icon {
    grid-area: icon;
    width: 44px;
    height: 44px;
    border-radius: 11px;
}

.install-banner__body {
    grid-area: body;
    min-width: 0;
}

.install-banner__title {
    display: block;
    font-size: var(--fs-sm);
    font-weight: 800;
}

.install-banner__text {
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-2);
}

.install-banner__share {
    width: 16px;
    height: 16px;
    margin-inline: 2px;
    vertical-align: -3px;
    color: var(--accent);
}

.install-banner__actions {
    grid-area: actions;
}

.install-banner__actions:empty {
    display: none;
}

.install-banner__close {
    position: absolute;
    top: var(--space-2);
    inset-inline-end: var(--space-2);
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: var(--muted);
}

/* Admin → Email delivery */
.mailcheck {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin: var(--space-3) 0;
}

.mailcheck__item {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--surface);
    border-inline-start: 3px solid var(--ok);
}

.mailcheck__item.is-warn { border-inline-start-color: var(--warn); }
.mailcheck__item.is-bad  { border-inline-start-color: var(--danger); }

.mailcheck__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-2);
}

.mailcheck__mark {
    font-weight: 800;
    color: var(--ok);
}

.is-warn .mailcheck__mark { color: var(--warn); }
.is-bad .mailcheck__mark  { color: var(--danger); }

.mailcheck__head small {
    font-size: 12px;
    color: var(--muted);
}

.mailcheck__found {
    margin-top: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    color: var(--text-2);
    overflow-wrap: anywhere;
}

.mailcheck__fix {
    margin-top: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-sm);
    background: var(--bg);
    font-size: var(--fs-sm);
}

.dns-record {
    display: grid;
    gap: 6px;
    margin: var(--space-2) 0 0;
    text-align: left;
}

.dns-record > div {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: var(--space-2);
    align-items: start;
}

.dns-record dt {
    font-size: 11px;
    color: var(--muted);
}

.dns-record dd {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
}

.dns-record code {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--surface-2);
    overflow-wrap: anywhere;
}

.mailcheck__item.is-unknown { border-inline-start-color: var(--muted); }
.is-unknown .mailcheck__mark { color: var(--muted); }

.dkim-regen {
    margin-top: var(--space-3);
}

/* =====================================================================
   Cycle & PMS
   ===================================================================== */

.page-cycle {
    --rose: #F472B6;
    --rose-soft: rgba(244, 114, 182, 0.16);
    --pms: #F59E0B;
    --fertile: #34D399;
}

.cycle-hero {
    margin: var(--space-3) 0 var(--space-4);
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    background: linear-gradient(140deg, var(--rose-soft), var(--surface));
    border: 1px solid var(--line);
    text-align: center;
}

.cycle-hero__icon {
    font-size: 40px;
}

.cycle-hero__title {
    margin-top: var(--space-2);
    font-size: var(--fs-xl);
    font-weight: 800;
}

.cycle-hero__sub {
    margin-top: 4px;
    font-size: var(--fs-sm);
    color: var(--text-2);
}

.cycle-hero__action {
    margin-top: var(--space-4);
}

.cycle-phase {
    display: inline-block;
    padding: 2px var(--space-3);
    border-radius: var(--radius-pill);
    background: var(--rose-soft);
    color: var(--rose);
    font-size: 12px;
    font-weight: 800;
}

.cycle-hero.is-pms .cycle-phase { background: rgba(245, 158, 11, 0.16); color: var(--pms); }
.cycle-hero.is-fertile .cycle-phase,
.cycle-hero.is-ovulation .cycle-phase { background: rgba(52, 211, 153, 0.16); color: var(--fertile); }
.cycle-hero.is-late .cycle-phase { background: var(--danger-soft); color: var(--danger); }
.cycle-hero.is-regular .cycle-phase { background: var(--surface-2); color: var(--text-2); }

.cycle-first {
    margin-top: var(--space-4);
    text-align: start;
}

.cycle-windows {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-2);
    margin-bottom: var(--space-5);
}

.cycle-window {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--surface);
    border-top: 3px solid var(--line-strong);
    font-size: 11px;
    color: var(--muted);
}

.cycle-window strong {
    font-size: var(--fs-sm);
    color: var(--text);
}

.cycle-window.is-pms { border-top-color: var(--pms); }
.cycle-window.is-fertile { border-top-color: var(--fertile); }
.cycle-window.is-ovulation { border-top-color: var(--fertile); }

.cycle-cal {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}

.cycle-cal__head {
    padding-bottom: 4px;
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-align: center;
}

.cycle-cal__day {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    border-radius: 50%;
    font-size: var(--fs-sm);
    font-variant-numeric: tabular-nums;
}

.cycle-cal__day.is-period    { background: var(--rose); color: #fff; font-weight: 800; }
.cycle-cal__day.is-predicted { box-shadow: inset 0 0 0 2px var(--rose); color: var(--rose); font-weight: 700; }
.cycle-cal__day.is-pms       { background: rgba(245, 158, 11, 0.18); color: var(--pms); }
.cycle-cal__day.is-fertile   { background: rgba(52, 211, 153, 0.16); color: var(--fertile); }
.cycle-cal__day.is-ovulation { background: var(--fertile); color: #0B1120; font-weight: 800; }
.cycle-cal__day.is-today     { outline: 2px solid var(--accent); outline-offset: 1px; }

.cycle-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-4);
    margin-top: var(--space-3);
    font-size: 11px;
    color: var(--text-2);
}

.cycle-legend span::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-inline-end: 6px;
    border-radius: 50%;
    vertical-align: -1px;
}

.cycle-legend .is-period::before    { background: var(--rose); }
.cycle-legend .is-predicted::before { box-shadow: inset 0 0 0 2px var(--rose); }
.cycle-legend .is-pms::before       { background: var(--pms); }
.cycle-legend .is-fertile::before   { background: rgba(52, 211, 153, 0.5); }
.cycle-legend .is-ovulation::before { background: var(--fertile); }

.cycle-more {
    margin-top: var(--space-3);
}

.cycle-more > summary {
    cursor: pointer;
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--accent);
    padding: var(--space-2) 0;
}

@media (max-width: 380px) {
    .cycle-windows {
        grid-template-columns: 1fr;
    }
}

/* =====================================================================
   Linked family
   ===================================================================== */

.head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.linked-badge {
    font-size: 0.85em;
}

.request-card {
    padding: var(--space-4);
    margin-bottom: var(--space-2);
    border-radius: var(--radius-md);
    background: var(--accent-soft);
    border: 1px solid var(--accent);
}

.request-card__text {
    font-weight: 700;
    margin-bottom: var(--space-3);
}

.request-card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.share-note {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: var(--space-3) 0 var(--space-4);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--surface);
    font-size: var(--fs-sm);
    color: var(--text-2);
}

.share-note strong {
    color: var(--text);
}

.linked-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: var(--space-4) 0;
    text-align: center;
}

.linked-card h1 {
    font-size: var(--fs-xl);
    font-weight: 800;
}

.radio-row {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3);
    margin-bottom: var(--space-2);
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    cursor: pointer;
}

.radio-row:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.radio-row input {
    margin-top: 4px;
}

.radio-row span {
    display: flex;
    flex-direction: column;
    font-size: var(--fs-sm);
}

.radio-row small {
    color: var(--muted);
}

.wa-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
}

.pending-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.access-note {
    margin: var(--space-2) 0 var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    background: var(--surface);
    font-size: var(--fs-sm);
    color: var(--text-2);
}

.dose__badge {
    padding: 2px var(--space-2);
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
}

.dose__badge.is-taken { background: var(--ok-soft); color: var(--ok); }
.dose__badge.is-late  { background: var(--warn-soft); color: var(--warn); }

/* Choose a specific dish for a meal */
.more__link {
    display: block;
    padding: var(--space-2) var(--space-3);
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--accent);
}

.choice-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.choice {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--line);
}

.choice.is-current {
    border-color: var(--accent);
}

.choice__icon {
    font-size: 26px;
}

.choice__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: var(--fs-sm);
}

.choice__text small {
    font-size: 12px;
    color: var(--muted);
}

/* =====================================================================
   1.12 – New navigation: header, bottom bar with the raised orb,
   side menu (avatar), analytics rings, Services and Settings
   ===================================================================== */

/* Header: avatar · · · bell */
.topbar__user {
    padding: 0;
    border: 0;
    background: none;
    border-radius: 50%;
    cursor: pointer;
    color: inherit;
}

.topbar__user:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.topbar__spacer {
    flex: 1;
}

/* Bottom bar: Home · Planner · [orb] · Wallet · Services */
.tabbar {
    grid-template-columns: repeat(2, 1fr) 84px repeat(2, 1fr);
    overflow: visible;
}

.tabbar__orb {
    --orb: 62px;
    position: relative;
    justify-self: center;
    align-self: start;
    width: var(--orb);
    height: var(--orb);
    font-size: calc(var(--orb) * 0.258);    /* 16px at 62px – the waves scale with the orb */
    margin-top: calc(var(--orb) * -0.39);   /* floats above the bar's centre */
    border-radius: 50%;
    display: grid;
    place-items: center;
    text-decoration: none;
    /* the active-tab colour at the edges, darker towards the middle */
    background: radial-gradient(circle at 50% 50%, #0C4A6E 0%, #0369A1 40%, var(--accent) 100%);
    background: radial-gradient(circle at 50% 50%,
        color-mix(in srgb, var(--accent) 30%, #020617) 0%,
        color-mix(in srgb, var(--accent) 62%, #020617) 42%,
        var(--accent) 100%);
    /* transparent glass frame – no drop shadow */
    box-shadow:
        0 0 0 6px rgba(255, 255, 255, 0.10),
        0 0 0 7px rgba(255, 255, 255, 0.22);
    transition: transform 0.15s ease;
}

.tabbar__orb:active {
    transform: scale(0.94);
}

.tabbar__orb:focus-visible {
    outline: 2px solid #22D3EE;
    outline-offset: 9px;
}

.tabbar__orb .orb__halo {
    display: none;
}

.tabbar__orb .orb__core {
    position: relative;
    display: grid;
    place-items: center;
    width: auto;
    height: auto;
    background: none;          /* override the older orb core (gradient disc) */
    box-shadow: none;
    border: 0;
    animation: none;
}

/* Large, rounded sound-wave bars */
.tabbar__orb .wave {
    display: flex;
    gap: 0.25em;
    align-items: center;
    height: 1.875em;
}

.tabbar__orb .wave i {
    display: block;
    width: 0.25em;
    height: 0.75em;
    border-radius: 0.25em;
    background: #fff;
    opacity: 1;
    transform-origin: center;
    /* alive even when idle: a slow, gentle wave */
    animation: orb-wave-idle 2.4s ease-in-out infinite;
}

.tabbar__orb .wave i:nth-child(2),
.tabbar__orb .wave i:nth-child(4) { height: 1.375em; }
.tabbar__orb .wave i:nth-child(3) { height: 1.875em; }
.tabbar__orb .wave i:nth-child(2) { animation-delay: 0.2s; }
.tabbar__orb .wave i:nth-child(3) { animation-delay: 0.4s; }
.tabbar__orb .wave i:nth-child(4) { animation-delay: 0.6s; }
.tabbar__orb .wave i:nth-child(5) { animation-delay: 0.8s; }

/* Listening or speaking: faster and stronger */
.tabbar__orb[data-state="listening"] .wave i,
.tabbar__orb[data-state="speaking"] .wave i {
    animation: orb-wave 0.8s ease-in-out infinite;
}
.tabbar__orb[data-state="listening"] .wave i:nth-child(2),
.tabbar__orb[data-state="speaking"] .wave i:nth-child(2) { animation-delay: 0.1s; }
.tabbar__orb[data-state="listening"] .wave i:nth-child(3),
.tabbar__orb[data-state="speaking"] .wave i:nth-child(3) { animation-delay: 0.2s; }
.tabbar__orb[data-state="listening"] .wave i:nth-child(4),
.tabbar__orb[data-state="speaking"] .wave i:nth-child(4) { animation-delay: 0.3s; }
.tabbar__orb[data-state="listening"] .wave i:nth-child(5),
.tabbar__orb[data-state="speaking"] .wave i:nth-child(5) { animation-delay: 0.4s; }

/* Thinking: a soft pulse of the whole orb */
.tabbar__orb[data-state="thinking"] {
    animation: orb-think 1.1s ease-in-out infinite;
}

@keyframes orb-wave-idle {
    0%, 100% { transform: scaleY(0.75); }
    50%      { transform: scaleY(1); }
}

@keyframes orb-think {
    0%, 100% { filter: brightness(1); }
    50%      { filter: brightness(1.18); }
}

@media (prefers-reduced-motion: reduce) {
    .tabbar__orb .wave i,
    .tabbar__orb[data-state="thinking"] { animation: none !important; }
}

@keyframes orb-breathe {
    0%, 100% { opacity: 0.55; transform: scale(1); }
    50%      { opacity: 1;    transform: scale(1.06); }
}

@keyframes orb-wave {
    0%, 100% { transform: scaleY(0.5); }
    50%      { transform: scaleY(1.1); }
}

@media (prefers-reduced-motion: reduce) {
    .tabbar__orb .orb__halo,
    .tabbar__orb .wave i { animation: none !important; }
}

/* Home: listen button on the briefing */
.brief__listen {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-3);
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: var(--fs-sm);
    font-weight: 700;
    cursor: pointer;
}

.brief__listen .icon { color: var(--accent); }

/* ---------------- Side menu ---------------- */
.drawer {
    position: absolute;
    inset: 0;
    z-index: 60;
}

.drawer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.55);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.drawer__panel {
    position: absolute;
    top: 0;
    bottom: 0;
    inset-inline-start: 0;
    width: min(86%, 380px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: calc(var(--space-4) + env(safe-area-inset-top, 0px)) var(--space-3) calc(var(--space-6) + env(safe-area-inset-bottom, 0px));
    background: var(--bg);
    border-inline-end: 1px solid var(--line);
    transform: translateX(-102%);
    transition: transform 0.22s ease;
    outline: none;
}

[dir="rtl"] .drawer__panel {
    transform: translateX(102%);
}

.drawer.is-open .drawer__backdrop { opacity: 1; }
.drawer.is-open .drawer__panel { transform: none; }

@media (prefers-reduced-motion: reduce) {
    .drawer__panel, .drawer__backdrop { transition: none; }
}

.drawer__card {
    margin-bottom: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--line);
}

.drawer__me {
    padding: var(--space-4);
}

.drawer__profile {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    color: var(--text);
}

.drawer__name {
    margin-top: var(--space-3);
    font-size: var(--fs-lg);
    font-weight: 800;
}

.verified {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 3px var(--space-3) 3px var(--space-2);
    border-radius: var(--radius-pill);
    background: rgba(56, 189, 248, 0.14);
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
}

.verified .icon {
    width: 16px;
    height: 16px;
    padding: 2px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--bg);
}

.drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.drawer__head h3,
.drawer__title {
    font-size: var(--fs-sm);
    font-weight: 800;
}

.drawer__title {
    padding: var(--space-1) var(--space-2) var(--space-2);
}

.drawer__link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-3) var(--space-2);
    border: 0;
    border-radius: var(--radius-md);
    background: none;
    color: var(--text);
    font: inherit;
    font-size: var(--fs-sm);
    font-weight: 600;
    text-align: start;
    cursor: pointer;
}

.drawer__link:hover,
.drawer__link:focus-visible {
    background: var(--surface-2);
}

.drawer__link > span:first-of-type {
    flex: 1;
}

.drawer__link--danger {
    color: var(--danger);
}

.drawer__chev {
    color: var(--muted);
}

.drawer__badge {
    min-width: 20px;
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
}

.drawer__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-2);
    font-size: var(--fs-sm);
    font-weight: 600;
}

.drawer__row--wide { display: none; }

@media (min-width: 900px) {
    .drawer__row--wide { display: flex; }
}

.drawer__version {
    margin-top: var(--space-2);
    text-align: center;
    font-size: 11px;
    color: var(--muted);
}

.seg {
    display: inline-flex;
    padding: 3px;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
}

.seg__btn,
.seg__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px var(--space-3);
    border: 0;
    border-radius: var(--radius-pill);
    background: none;
    color: var(--text-2);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.seg__btn .icon,
.seg__link .icon { width: 14px; height: 14px; }

.seg__btn[aria-pressed="true"] {
    background: var(--accent);
    color: #0B1120;
}

.seg__link {
    background: var(--surface-2);
    color: var(--text);
}

/* Analytics rings */
.rings {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
}

.rings__loading {
    grid-column: 1 / -1;
    padding: var(--space-4) 0;
    text-align: center;
    font-size: var(--fs-sm);
    color: var(--muted);
}

.ring {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.ring__svg {
    width: 76px;
    height: 76px;
    transform: rotate(-90deg);
}

.ring__track,
.ring__value {
    fill: none;
    stroke-width: 7;
}

.ring__track { stroke: var(--surface-2); }

.ring__value {
    stroke-linecap: round;
    transition: stroke-dasharray 0.6s ease;
}

.ring__text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.ring__text strong { font-size: var(--fs-sm); font-weight: 800; }
.ring__text span { font-size: 12px; font-weight: 700; }
.ring__text small { font-size: 11px; color: var(--muted); }

/* ---------------- Services: square tiles, two per row ---------------- */
.services {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.service {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    aspect-ratio: 1;
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text);
    text-decoration: none;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.service:hover { border-color: var(--accent); }
.service:active { transform: scale(0.97); }
.service:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.service__icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    font-size: 28px;
}

.service--food .service__icon     { background: rgba(245, 158, 11, 0.16); }
.service--shopping .service__icon { background: rgba(56, 189, 248, 0.16); }
.service--health .service__icon   { background: rgba(52, 211, 153, 0.16); }
.service--car .service__icon      { background: rgba(167, 139, 250, 0.16); }

.service__title,
.service__text {
    display: block;
}

.service__title {
    overflow-wrap: anywhere;   /* "transportation" wraps inside the tile */
    hyphens: auto;
    font-size: var(--fs-md);
    font-weight: 800;
    line-height: 1.25;
}

.service__text {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--muted);
}

.service .drawer__badge {
    position: absolute;
    top: var(--space-3);
    inset-inline-end: var(--space-3);
}

.services__soon {
    margin-top: var(--space-4);
    text-align: center;
    font-size: 12px;
    color: var(--muted);
}

/* 4 in a row only when the app really is wide (full view on a desktop) –
   the phone frame stays 2 × 2 whatever the browser width */
@media (min-width: 900px) {
    :root[data-view="full"] .services { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------------- Settings ---------------- */
.settings-group {
    margin-top: var(--space-4);
}

.settings-group__title {
    padding: 0 var(--space-2) var(--space-2);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

/* =====================================================================
   1.13 – Invite & earn, family photos, referral analytics
   ===================================================================== */

.beta {
    display: inline-block;
    margin-top: var(--space-2);
    padding: 2px var(--space-2);
    border-radius: 6px;
    background: rgba(245, 158, 11, 0.16);
    color: #F59E0B;
    font-size: 11px;
    font-weight: 700;
}

.invite-hero {
    margin: var(--space-3) 0 var(--space-4);
    padding: var(--space-5) var(--space-4);
    border-radius: var(--radius-lg);
    background: linear-gradient(140deg, rgba(56, 189, 248, 0.16), var(--surface));
    border: 1px solid var(--line);
    text-align: center;
}

.invite-hero__icon { font-size: 44px; }
.invite-hero h1 { margin-top: var(--space-2); font-size: var(--fs-xl); font-weight: 800; }
.invite-hero p { margin-top: var(--space-2); font-size: var(--fs-sm); color: var(--text-2); }

.invite-link {
    display: flex;
    gap: var(--space-2);
    align-items: center;
}

.invite-link .field__input {
    flex: 1;
    min-width: 0;
    font-size: 13px;
}

.share-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-2);
    margin-top: var(--space-4);
}

.share-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: var(--space-3) var(--space-1);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}

.share-btn__dot {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--brand, var(--accent));
    color: #fff;
    font-size: 16px;
    font-weight: 900;
}

.invite-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.invite-stats > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-3) var(--space-1);
    border-radius: var(--radius-md);
    background: var(--surface);
    text-align: center;
}

.invite-stats strong { font-size: var(--fs-md); font-weight: 800; }
.invite-stats span { font-size: 11px; color: var(--muted); }

.invite-friends li {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.invite-friends li > span:nth-child(2) { flex: 1; }

.invite-steps {
    padding-inline-start: var(--space-5);
    font-size: var(--fs-sm);
    line-height: 1.8;
}

.invite-banner {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: linear-gradient(120deg, rgba(56, 189, 248, 0.18), rgba(167, 139, 250, 0.14));
    border: 1px solid var(--line);
    color: var(--text);
}

.invite-banner > a {
    display: flex;
    flex: 1;
    align-items: center;
    gap: var(--space-3);
    color: inherit;
}

.invite-banner > span:first-child,
.invite-banner > a > span:first-child { font-size: 26px; }

.invite-banner strong { display: block; font-size: var(--fs-sm); font-weight: 800; }
.invite-banner small { display: block; font-size: 12px; color: var(--text-2); }
.invite-banner > span:nth-child(2) { flex: 1; }

.invite-card {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    background: linear-gradient(120deg, rgba(56, 189, 248, 0.18), rgba(167, 139, 250, 0.14));
    color: var(--text);
}

.invite-card__icon { font-size: 26px; }
.invite-card__text { display: flex; flex: 1; flex-direction: column; }
.invite-card__text strong { font-size: var(--fs-sm); font-weight: 800; }
.invite-card__text small { font-size: 12px; color: var(--text-2); }

/* Family photo field */
.photo-field {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.photo-field > div { flex: 1; min-width: 0; }

/* Admin */
.admin-user-cell {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.kpi__sub {
    font-size: 11px;
    color: var(--muted);
}

.funnel-row {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr) 56px;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-2);
    font-size: var(--fs-sm);
}

.funnel-row strong { text-align: end; }

.funnel-bar {
    height: 12px;
    border-radius: 6px;
    background: var(--surface-2);
    overflow: hidden;
}

.funnel-bar i {
    display: block;
    height: 100%;
    border-radius: 6px;
    background: var(--accent);
}

.daily-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 140px;
    padding-top: var(--space-2);
}

.daily-chart__col {
    display: flex;
    flex: 1;
    flex-direction: column-reverse;
    height: 100%;
}

.daily-chart__col i { display: block; width: 100%; border-radius: 2px; }
.daily-chart__col .org { background: var(--surface-2); }
.daily-chart__col .inv { background: var(--accent); }

.legend::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-inline-end: 4px;
    border-radius: 2px;
    vertical-align: -1px;
}

.legend--inv::before { background: var(--accent); }
.legend--org::before { background: var(--surface-2); border: 1px solid var(--line); }

/* =====================================================================
   1.14 – International mobile numbers, profile completion
   ===================================================================== */

.phone-field__row {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: var(--space-2);
}

.phone-field__country {
    min-width: 0;
    font-size: 14px;
}

.phone-field__number {
    min-width: 0;
    letter-spacing: 0.04em;
}

@media (max-width: 360px) {
    .phone-field__row { grid-template-columns: 1fr; }
}

/* Completion ring around the avatar */
.avatar-ring {
    position: relative;
    display: inline-grid;
    place-items: center;
    padding: 3px;
    border-radius: 50%;
    background: conic-gradient(var(--accent) calc(var(--pct) * 1%), var(--surface-2) 0);
}

.avatar-ring > .avatar {
    border: 2px solid var(--bg);
}

.avatar-ring__pct {
    position: absolute;
    bottom: -6px;
    inset-inline-end: -6px;
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    background: var(--accent);
    color: #0B1120;
    font-size: 11px;
    font-weight: 800;
    box-shadow: 0 0 0 2px var(--bg);
}

/* Profile: complete-your-profile checklist */
.complete-card {
    margin: var(--space-4) 0;
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    background: linear-gradient(140deg, rgba(56, 189, 248, 0.14), var(--surface));
    border: 1px solid var(--line);
}

.complete-card__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
}

.complete-card__head h2 {
    font-size: var(--fs-md);
    font-weight: 800;
}

.complete-card__head strong {
    font-size: var(--fs-lg);
    font-weight: 800;
    color: var(--accent);
}

.complete-card__bar {
    height: 8px;
    margin: var(--space-3) 0;
    border-radius: 4px;
    background: var(--surface-2);
    overflow: hidden;
}

.complete-card__bar i {
    display: block;
    height: 100%;
    border-radius: 4px;
    background: var(--accent);
}

.complete-steps {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.complete-steps li {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.complete-steps__mark {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: none;
    border-radius: 50%;
    background: var(--surface-2);
    font-size: 15px;
}

.complete-steps li.is-done .complete-steps__mark {
    background: var(--ok, #34D399);
    color: #0B1120;
    font-weight: 900;
}

.complete-steps__text {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.complete-steps__text strong { font-size: var(--fs-sm); }
.complete-steps__text small { font-size: 12px; color: var(--muted); }
.complete-steps li.is-done .complete-steps__text strong { color: var(--muted); text-decoration: line-through; }

/* Light theme: the glass frame gets a faint cyan tint so it stays visible on white */
[data-theme="light"] .tabbar__orb {
    box-shadow:
        0 0 0 6px rgba(8, 145, 178, 0.10),
        0 0 0 7px rgba(8, 145, 178, 0.28);
}

/* =====================================================================
   1.14.1 – Request a ride, Nearby
   ===================================================================== */

.services-quick {
    display: grid;
    gap: var(--space-2);
    margin-top: var(--space-4);
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.ride {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-top: var(--space-3);
}

.ride__point {
    display: flex;
    gap: var(--space-3);
}

.ride__dot {
    width: 14px;
    height: 14px;
    flex: none;
    margin-top: 34px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.2);
}

.ride__dot--to {
    background: #F87171;
    box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.2);
}

.ride__field {
    position: relative;
    flex: 1;
    min-width: 0;
}

.ride__suggest {
    position: absolute;
    z-index: 5;
    inset-inline: 0;
    margin-top: 4px;
    padding: var(--space-1);
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.35);
}

.ride__option {
    display: block;
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text);
    font: inherit;
    font-size: var(--fs-sm);
    text-align: start;
    cursor: pointer;
}

.ride__option:hover { background: var(--surface-2); }

.ride__route {
    font-weight: 800;
    margin-bottom: var(--space-2);
}

.ride__list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.ride-card {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    grid-template-areas: "logo text price" "logo text open";
    align-items: center;
    gap: 2px var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--line);
}

.ride-card.is-best { border-color: var(--ok, #34D399); }

.ride-card__logo {
    grid-area: logo;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--brand);
    color: #fff;
    font-weight: 900;
    font-size: 18px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.ride-card__text { grid-area: text; display: flex; flex-direction: column; min-width: 0; }
.ride-card__text small { font-size: 12px; color: var(--muted); }
.ride-card__price { grid-area: price; font-weight: 800; text-align: end; white-space: nowrap; }
.ride-card .mini-btn { grid-area: open; justify-self: end; }

.nearby-types { flex-wrap: nowrap; overflow-x: auto; }

.nearby__status {
    margin: var(--space-3) 0;
    text-align: center;
}

.nearby__status p { margin-bottom: var(--space-3); color: var(--text-2); }

.nearby__list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.nearby-item {
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--line);
}

.nearby-item__head {
    display: flex;
    justify-content: space-between;
    gap: var(--space-2);
}

.nearby-item__dist {
    flex: none;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
}

.nearby-item__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px var(--space-2);
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted);
}

.nearby-item__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

/* =====================================================================
   1.15 – One orb everywhere (overrides the original desktop rules that
   shrank it to 48 px and stopped it floating)
   ===================================================================== */
.tabbar__orb,
:root[data-view="full"] .tabbar__orb,
:root[data-view="frame"] .tabbar__orb {
    width: var(--orb, 62px);
    height: var(--orb, 62px);
    margin-top: calc(var(--orb, 62px) * -0.39);
    box-shadow:
        0 0 0 6px rgba(255, 255, 255, 0.10),
        0 0 0 7px rgba(255, 255, 255, 0.22);
}

:root[data-theme="light"] .tabbar__orb,
:root[data-theme="light"][data-view="full"] .tabbar__orb,
:root[data-theme="light"][data-view="frame"] .tabbar__orb {
    box-shadow:
        0 0 0 6px rgba(8, 145, 178, 0.10),
        0 0 0 7px rgba(8, 145, 178, 0.28);
}

/* Wide screens (full view): grow with the screen, keeping the mobile proportions */
@media (min-width: 700px) {
    :root[data-view="full"] .tabbar__orb { --orb: clamp(66px, 5.2vw, 84px); }
}

/* =====================================================================
   1.15 – Badges, logos, "Around you", places, sound switch
   ===================================================================== */

/* Verified seal and admin shield beside a name (like Meta / X) */
.name-badges {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-inline-start: 6px;
    vertical-align: -0.12em;
}

.badge-icon {
    width: 0.95em;
    height: 0.95em;
    flex: none;
}

.badge-icon--verified { color: var(--accent); }
.badge-icon--admin { color: #F5B83D; }

/* Real platform logos (letter underneath if one can't load) */
.share-btn__dot--logo,
.ride-card__logo {
    position: relative;
    overflow: hidden;
}

.share-btn__dot--logo img,
.ride-card__logo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 7px;
    object-fit: contain;
    background: #fff;
    border-radius: inherit;
}

/* Services: "Around you" quick actions */
.services-around__title {
    margin: var(--space-5) 0 var(--space-2);
    font-size: var(--fs-sm);
    font-weight: 800;
    color: var(--text-2);
}

.services-around {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
}

.around-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    background: linear-gradient(140deg, rgba(56, 189, 248, 0.16), rgba(167, 139, 250, 0.10));
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: var(--text);
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.around-card:hover { border-color: var(--accent); }
.around-card:active { transform: scale(0.97); }
.around-card__icon { font-size: 26px; margin-bottom: var(--space-1); }
.around-card strong { font-size: var(--fs-sm); font-weight: 800; }
.around-card small { font-size: 12px; line-height: 1.4; color: var(--muted); }

/* Places */
.place-row.is-empty { opacity: 0.7; }

.chip--radio { cursor: pointer; }
.chip--radio input { position: absolute; opacity: 0; pointer-events: none; }
.chip--radio:has(input:checked) { background: var(--accent); color: #0B1120; border-color: var(--accent); }

.nearby-around { margin: var(--space-3) 0; }

/* =====================================================================
   1.16 – Bills, Spending, Emergency, Prayer
   ===================================================================== */

.life-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-2);
    margin: var(--space-3) 0;
}

.life-summary > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-3) var(--space-1);
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--line);
    text-align: center;
}

.life-summary strong { font-size: var(--fs-md); font-weight: 800; }
.life-summary span { font-size: 11px; color: var(--muted); }

.life-optin {
    margin-top: var(--space-4);
    padding: var(--space-5) var(--space-4);
    border-radius: var(--radius-lg);
    background: linear-gradient(140deg, rgba(56, 189, 248, 0.14), var(--surface));
    border: 1px solid var(--line);
    text-align: center;
}

.life-optin p { margin-bottom: var(--space-4); color: var(--text-2); line-height: 1.7; }

.insight {
    margin-bottom: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: rgba(56, 189, 248, 0.10);
    font-size: var(--fs-sm);
    line-height: 1.6;
}

/* Bills */
.bill-list { display: flex; flex-direction: column; gap: var(--space-2); }

.bill-card {
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--line);
    border-inline-start: 4px solid var(--line);
}

.bill-card--overdue { border-inline-start-color: var(--danger); }
.bill-card--today,
.bill-card--soon { border-inline-start-color: #F59E0B; }
.bill-card--ok { border-inline-start-color: var(--ok, #34D399); }

.bill-card__head { display: flex; align-items: center; gap: var(--space-3); }
.bill-card__icon { font-size: 26px; }
.bill-card__text { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.bill-card__text small { font-size: 12px; color: var(--muted); }
.bill-card__due { margin: var(--space-2) 0; font-size: 12px; color: var(--text-2); }

.bill-card__pay {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.bill-card__pay .field__input { flex: 1; min-width: 0; }

/* Spending */
.month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: var(--space-2) 0;
}

.cat-bars { display: flex; flex-direction: column; gap: var(--space-3); }
.cat-bar__head { display: flex; justify-content: space-between; gap: var(--space-2); font-size: var(--fs-sm); }
.cat-bar__head small { font-weight: 500; color: var(--muted); }

.cat-bar__track {
    height: 8px;
    margin: 6px 0 2px;
    border-radius: 4px;
    background: var(--surface-2);
    overflow: hidden;
}

.cat-bar__track i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.cat-bar.is-near .cat-bar__track i { background: #F59E0B; }
.cat-bar.is-over .cat-bar__track i { background: var(--danger); }
.cat-bar.is-over .cat-bar__head strong { color: var(--danger); }

.budget-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
    font-size: var(--fs-sm);
}

.spend-lines li { display: flex; align-items: center; gap: var(--space-2); }
.spend-lines li > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Emergency */
.sos {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    margin: var(--space-4) 0;
}

.sos-btn {
    --hold: 0;
    position: relative;
    display: grid;
    place-items: center;
    width: 168px;
    height: 168px;
    border: 0;
    border-radius: 50%;
    background: radial-gradient(circle, #EF4444 0%, #B91C1C 70%);
    color: #fff;
    cursor: pointer;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    box-shadow: 0 0 0 10px rgba(239, 68, 68, 0.15), 0 0 0 22px rgba(239, 68, 68, 0.07);
    transition: transform 0.15s ease;
}

.sos-btn.is-holding { transform: scale(0.96); }
.sos-btn.is-sending { animation: sos-pulse 1s ease-in-out infinite; }
.sos-btn__label { font-size: 40px; font-weight: 900; letter-spacing: 0.06em; }

.sos-btn__ring {
    position: absolute;
    inset: -8px;
    width: calc(100% + 16px);
    height: calc(100% + 16px);
    transform: rotate(-90deg);
    pointer-events: none;
}

.sos-btn__ring circle {
    fill: none;
    stroke: #fff;
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 339.3;
    stroke-dashoffset: calc(339.3 * (1 - var(--hold)));
}

@keyframes sos-pulse {
    0%, 100% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0.25), 0 0 0 22px rgba(239, 68, 68, 0.1); }
    50%      { box-shadow: 0 0 0 18px rgba(239, 68, 68, 0.35), 0 0 0 34px rgba(239, 68, 68, 0.12); }
}

@media (prefers-reduced-motion: reduce) {
    .sos-btn.is-sending { animation: none; }
}

.sos__hint { font-size: 12px; color: var(--muted); text-align: center; }
.sos__result { width: 100%; display: flex; flex-direction: column; gap: var(--space-2); text-align: center; }
.sos__sent { font-weight: 800; color: var(--danger); }
.sos__wa { background: #25D366; color: #fff; }

.sos-numbers {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: var(--space-2);
}

.sos-number {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-3) var(--space-1);
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text);
    text-align: center;
}

.sos-number span { font-size: 22px; }
.sos-number strong { font-size: var(--fs-md); font-weight: 900; }
.sos-number small { font-size: 11px; color: var(--muted); }

.medical-id__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2) var(--space-3);
    margin-bottom: var(--space-3);
}

.medical-id__grid dt { font-size: 11px; color: var(--muted); }
.medical-id__grid dd { font-size: var(--fs-sm); font-weight: 700; }
.medical-id__wide { grid-column: 1 / -1; }

.around-card--sos {
    background: linear-gradient(140deg, rgba(239, 68, 68, 0.18), rgba(239, 68, 68, 0.06));
    border-color: rgba(239, 68, 68, 0.45);
}

.drawer__link--sos { color: var(--danger); font-weight: 800; }
.drawer__emoji { width: 24px; text-align: center; }

/* Prayer */
.prayer-next {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin: var(--space-3) 0;
    padding: var(--space-5) var(--space-4);
    border-radius: var(--radius-lg);
    background: linear-gradient(140deg, rgba(56, 189, 248, 0.18), rgba(52, 211, 153, 0.10));
    border: 1px solid var(--line);
    text-align: center;
}

.prayer-next__label { font-size: 12px; color: var(--muted); }
.prayer-next__name { font-size: var(--fs-xl); font-weight: 900; }
.prayer-next__time { font-size: var(--fs-lg); font-weight: 800; }
.prayer-next__left { font-size: var(--fs-sm); color: var(--accent); font-weight: 700; }

.ramadan-card {
    display: grid;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    background: linear-gradient(140deg, rgba(245, 184, 61, 0.20), var(--surface));
    border: 1px solid rgba(245, 184, 61, 0.45);
}

.ramadan-card div { display: flex; justify-content: space-between; font-size: var(--fs-sm); }

.prayer-list {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--line);
    overflow: hidden;
}

.prayer-list li {
    display: flex;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--line);
    font-size: var(--fs-sm);
}

.prayer-list li:last-child { border-bottom: 0; }
.prayer-list li.is-sunrise { color: var(--muted); }
.prayer-list li.is-next { background: rgba(56, 189, 248, 0.12); color: var(--accent); font-weight: 800; }

.qibla__dial {
    position: relative;
    width: 180px;
    height: 180px;
    margin: var(--space-2) auto var(--space-3);
    border-radius: 50%;
    border: 2px solid var(--line);
    background: radial-gradient(circle, var(--surface) 60%, var(--surface-2));
}

.qibla__n {
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: 900;
    color: var(--danger);
}

.qibla__needle {
    --deg: 0deg;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 78px;
    margin-left: -1px;
    transform-origin: 50% 100%;
    transform: translateY(-100%) rotate(var(--deg));
    background: var(--accent);
    font-size: 22px;
    line-height: 0;
    transition: transform 0.3s ease;
}

.tasbeeh__row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-2);
}

.tasbeeh__btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: var(--space-4) var(--space-1);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: var(--fs-sm);
    font-weight: 700;
    cursor: pointer;
}

.tasbeeh__btn:active { transform: scale(0.96); }
.tasbeeh__btn strong { font-size: var(--fs-lg); color: var(--accent); }

/* =====================================================================
   1.17 – Holidays
   ===================================================================== */
.week__day.is-holiday .week__num { color: #F5B83D; font-weight: 900; }
.week__day.is-holiday::after {
    content: "🇪🇬";
    position: absolute;
    top: 2px;
    inset-inline-end: 4px;
    font-size: 9px;
}
.week__day { position: relative; }

.holiday-banner {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text);
}
.holiday-banner.is-public { background: linear-gradient(140deg, rgba(245, 184, 61, 0.18), var(--surface)); border-color: rgba(245, 184, 61, 0.45); }
.holiday-banner > span:first-child { font-size: 24px; }
.holiday-banner small { display: block; font-size: 12px; color: var(--muted); }

.holiday-list { display: flex; flex-direction: column; gap: var(--space-2); }
.holiday {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--line);
}
.holiday.is-past { opacity: 0.55; }
.holiday__icon { font-size: 22px; }
.holiday__text { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.holiday__text small { font-size: 12px; color: var(--muted); }

/* =====================================================================
   1.19 – National ID check
   ===================================================================== */
.id-points { list-style: none; display: grid; gap: 8px; margin: var(--space-3) 0; font-size: var(--fs-sm); color: var(--text-2); }
.consent { display: flex; gap: 10px; align-items: flex-start; padding: var(--space-3); border-radius: var(--radius-md);
    background: var(--surface); border: 1px solid var(--line); font-size: var(--fs-sm); line-height: 1.7; cursor: pointer; }
.consent input { margin-top: 5px; width: 18px; height: 18px; flex: none; }
.id-pick { display: grid; gap: var(--space-2); margin-top: var(--space-3); }
.id-pick label.btn { cursor: pointer; }
.id-busy { margin-top: var(--space-4); text-align: center; font-weight: 700; color: var(--accent); }
.id-error { margin-top: var(--space-3); padding: var(--space-3); border-radius: var(--radius-md); background: rgba(239, 68, 68, .12); color: #FCA5A5; font-size: var(--fs-sm); }
.id-result { margin-top: var(--space-4); padding: var(--space-4); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); display: grid; gap: var(--space-2); }
.id-result h2 { font-size: var(--fs-md); font-weight: 800; }
.id-warn { padding: var(--space-3); border-radius: var(--radius-md); background: rgba(245, 158, 11, .14); color: #FCD34D; font-size: var(--fs-sm); line-height: 1.7; }
.id-status { margin-top: var(--space-3); padding: var(--space-4); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.id-status__badge { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--accent); margin-bottom: var(--space-3); font-size: var(--fs-md); }
.id-row__ok { display: flex; align-items: center; gap: 8px; font-weight: 700; }

/* =====================================================================
   1.20 – Car catalogue & car licence
   ===================================================================== */
.plate-ro { min-height: 48px; display: flex; align-items: center; padding: 0 var(--space-3); border-radius: var(--radius-md);
    background: var(--surface-2); border: 1px dashed var(--line); color: var(--muted); font-size: var(--fs-sm); }
.car-specs { margin-top: -4px; }
.plate-chip span { font-size: var(--fs-md); font-weight: 800; letter-spacing: .06em; }
.doc-card { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-3) 0; padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.doc-card.is-ok { border-color: rgba(52, 211, 153, .45); }
.doc-card__icon { font-size: 26px; }
.doc-card__text { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.doc-card__text small { font-size: 12px; color: var(--muted); }

/* =====================================================================
   1.21 – Kids care
   ===================================================================== */
.child-head { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-3) 0; }
.child-head h1 { font-size: var(--fs-xl); font-weight: 900; }
.kid-today { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); margin-bottom: var(--space-3); }
.kid-today > div { display: flex; flex-direction: column; align-items: center; padding: var(--space-3) var(--space-1); border-radius: var(--radius-md);
    background: var(--surface); border: 1px solid var(--line); text-align: center; }
.kid-today strong { font-size: var(--fs-lg); font-weight: 900; }
.kid-today span { font-size: 11px; color: var(--muted); }
.kid-today small { font-size: 10px; color: var(--muted); }
.kid-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: var(--space-3); }
.kid-quick__label { flex-basis: 100%; font-size: var(--fs-sm); font-weight: 700; }
.kid-diapers p { margin-bottom: var(--space-2); font-size: var(--fs-sm); }
.kid-food__lead { font-weight: 800; margin-bottom: var(--space-2); }
.kid-food ul { display: grid; gap: 6px; padding-inline-start: 1.2em; font-size: var(--fs-sm); color: var(--text-2); }
.mood-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.mood-week > div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: var(--space-2) 0; border-radius: var(--radius-md); background: var(--surface); }
.mood-week span { font-size: 22px; }
.mood-week small { font-size: 11px; color: var(--muted); }
.kid-log li { display: flex; align-items: center; gap: var(--space-2); }
.kid-log li > span { flex: 1; min-width: 0; }
@media (max-width: 380px) { .kid-today { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* =====================================================================
   1.23 – Pay by QR
   ===================================================================== */
.pay-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); margin: var(--space-3) 0; }
.pay-action { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: var(--space-3); border-radius: var(--radius-lg);
    background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; text-align: center; }
.pay-action span { font-size: 26px; }
.pay-action small { font-size: 11px; color: var(--muted); }
.pay-receive { display: grid; gap: var(--space-2); justify-items: center; }
.pay-qr { padding: 14px; border-radius: var(--radius-lg); background: #FFFFFF; line-height: 0; }
.pay-qr img, .pay-qr canvas { display: block; width: 220px; height: 220px; }
.pay-link { max-width: 100%; overflow-wrap: anywhere; font-size: 11px; color: var(--muted); text-align: center; }
.pay-to { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-3) 0; padding: var(--space-3); border-radius: var(--radius-lg);
    background: var(--surface); border: 1px solid var(--line); }
.pay-to strong { display: flex; align-items: center; gap: 6px; font-size: var(--fs-md); }
.pay-to small { color: var(--muted); }
.pay-find { display: grid; gap: var(--space-3); margin-top: var(--space-3); }
.qr-scanner { display: grid; gap: var(--space-2); }
.qr-scanner video { width: 100%; max-height: 60vh; border-radius: var(--radius-lg); background: #000; object-fit: cover; }

/* =====================================================================
   1.24 – Home care
   ===================================================================== */
.home-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--space-3); }
.home-presets form { margin: 0; }
.home-presets .chip small { color: var(--muted); font-weight: 500; }

/* =====================================================================
   1.25 – Services as a phone-style home screen
   Gradient "squircle" icons with a glass highlight; label underneath.
   ===================================================================== */
.page-services { --icon: 64px; }
.app-section { margin-top: var(--space-4); }
.app-section__title { margin: 0 0 var(--space-3); font-size: var(--fs-md); font-weight: 800; color: var(--text); }
.app-grid {
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4) var(--space-2);
}
.app-icon {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px;
    color: var(--text); text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.app-icon__tile {
    position: relative; display: grid; place-items: center; width: var(--icon); aspect-ratio: 1;
    border-radius: 27%; overflow: hidden; isolation: isolate;
    background: var(--g, linear-gradient(145deg, #64D2FF, #0A84FF));
    box-shadow: 0 10px 22px -10px rgba(0, 0, 0, .55), 0 2px 6px -2px rgba(0, 0, 0, .3),
                inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -3px 8px rgba(0, 0, 0, .18);
    transition: transform .18s cubic-bezier(.3, .7, .4, 1.4), box-shadow .18s ease;
}
/* the glass: a soft reflection over the top half and a thin inner rim */
.app-icon__tile::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: radial-gradient(130% 75% at 28% -5%, rgba(255, 255, 255, .58), rgba(255, 255, 255, .08) 48%, transparent 62%);
}
.app-icon__tile::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28);
}
.app-icon__tile svg { width: 54%; height: 54%; filter: drop-shadow(0 1.5px 1.5px rgba(0, 0, 0, .22)); }
.app-icon__label {
    max-width: 100%; font-size: 12px; font-weight: 650; line-height: 1.3; text-align: center;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.app-icon__badge {
    position: absolute; top: -6px; inset-inline-end: calc(50% - var(--icon) / 2 - 8px);
    min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; display: grid; place-items: center;
    background: #FF3B30; color: #fff; font-size: 12px; font-weight: 800; border: 2px solid var(--bg, #0B1120);
}
.app-icon:active .app-icon__tile { transform: scale(.9); }
.app-icon:focus-visible { outline: none; }
.app-icon:focus-visible .app-icon__tile { box-shadow: 0 0 0 3px var(--bg, #0B1120), 0 0 0 5px var(--accent); }
@media (hover: hover) {
    .app-icon:hover .app-icon__tile { transform: translateY(-3px); box-shadow: 0 16px 28px -12px rgba(0, 0, 0, .6), 0 2px 6px -2px rgba(0, 0, 0, .3),
        inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -3px 8px rgba(0, 0, 0, .18); }
}
@media (prefers-reduced-motion: reduce) { .app-icon__tile { transition: none; } }

/* bigger icons and more per row on wider screens */
@media (min-width: 560px) { .page-services { --icon: 72px; } .app-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); } .app-icon__label { font-size: 13px; } }
@media (min-width: 1000px) { .page-services { --icon: 84px; } .app-grid { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: var(--space-5) var(--space-3); } }

/* each app's colour */
.app-icon--home     { --g: linear-gradient(150deg, #5BE584 0%, #2FB8A8 55%, #1C8C9E 100%); }
.app-icon--kitchen  { --g: linear-gradient(150deg, #FFC24A 0%, #FF8A2A 55%, #F2582A 100%); }
.app-icon--health   { --g: linear-gradient(150deg, #FF8AA0 0%, #FF3B5C 55%, #D9214A 100%); }
.app-icon--car      { --g: linear-gradient(150deg, #6EC1FF 0%, #2D7CFF 55%, #4B3FE0 100%); }
.app-icon--ride     { --g: linear-gradient(150deg, #FFE27A 0%, #FFC21A 50%, #FF9500 100%); }
.app-icon--shopping { --g: linear-gradient(150deg, #E48BFF 0%, #A855F7 55%, #6D3BEF 100%); }
.app-icon--bills    { --g: linear-gradient(150deg, #7CF0B4 0%, #22C38E 55%, #0E8F6E 100%); }
.app-icon--spending { --g: linear-gradient(150deg, #8EE3FF 0%, #2FB2F0 55%, #1B6FE0 100%); }
.app-icon--prayer   { --g: linear-gradient(150deg, #8C8DFF 0%, #5148D9 55%, #2B2A8F 100%); }
.app-icon--holidays { --g: linear-gradient(150deg, #FF9FB2 0%, #FF6B6B 55%, #F2453D 100%); }
.app-icon--nearby   { --g: linear-gradient(150deg, #FF8A7A 0%, #FF453A 55%, #D7263D 100%); }

/* =====================================================================
   1.26 – One icon style for every service
   Dark: transparent tile, cyan border, 50% white drawing.
   Light: the inverse – solid cyan tile, white drawing.
   ===================================================================== */
.app-icon__tile {
    background: transparent;
    border: 1.5px solid var(--accent);
    color: rgba(255, 255, 255, .5);
    box-shadow: 0 0 0 0 transparent;
    transition: transform .18s cubic-bezier(.3, .7, .4, 1.4), box-shadow .2s ease, background .2s ease;
}
.app-icon__tile::before,
.app-icon__tile::after { display: none; }
.app-icon__tile svg { width: 100%; height: 100%; filter: none; }
:root[data-theme="light"] .app-icon__tile { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
@media (hover: hover) {
    .app-icon:hover .app-icon__tile { transform: translateY(-3px); box-shadow: 0 0 0 4px rgba(56, 189, 248, .15), 0 12px 24px -12px rgba(56, 189, 248, .45); }
    :root[data-theme="light"] .app-icon:hover .app-icon__tile { box-shadow: 0 0 0 4px rgba(14, 165, 233, .18), 0 12px 24px -12px rgba(14, 165, 233, .5); }
}

/* the same icon at the top of each service (section header) and in page titles */
.app-head { display: flex; align-items: center; gap: 12px; margin: var(--space-2) 0 var(--space-3); }
.app-head__title { font-size: var(--fs-xl); font-weight: 900; line-height: 1.2; }
.app-icon__tile--head { width: 52px; border-radius: 27%; }
.app-title { display: flex; align-items: center; gap: 12px; }
.app-icon__tile--title { width: 44px; flex: none; border-radius: 27%; }

/* =====================================================================
   1.26.1 – Icons: drawing in the dock's active cyan, a border gradient that
   echoes the app background (cyan top-left → navy → blue bottom-right),
   a smooth drop shadow, and room between sections.
   ===================================================================== */
.app-icon__tile {
    border: 0;
    color: var(--accent);                                   /* the active-tab cyan */
    box-shadow: 0 12px 26px -12px rgba(0, 0, 0, .75), 0 4px 10px -4px rgba(2, 8, 23, .55), 0 0 22px -8px rgba(56, 189, 248, .28);
}
.app-icon__tile::before {
    display: block; content: ""; position: absolute; inset: 0; z-index: 0; border-radius: inherit; padding: 1.6px;
    background: linear-gradient(135deg, #38BDF8 0%, rgba(14, 165, 233, .55) 30%, rgba(30, 41, 59, .55) 55%, rgba(37, 99, 235, .85) 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    pointer-events: none;
}
.app-icon__tile svg { position: relative; z-index: 1; }
:root[data-theme="light"] .app-icon__tile {
    background: var(--accent); color: #FFFFFF;              /* the inverse: solid active-tab cyan, white drawing */
    box-shadow: 0 12px 24px -12px rgba(14, 165, 233, .6), 0 4px 10px -4px rgba(15, 23, 42, .18);
}
:root[data-theme="light"] .app-icon__tile::before { display: none; }
@media (hover: hover) {
    .app-icon:hover .app-icon__tile { box-shadow: 0 16px 30px -12px rgba(0, 0, 0, .8), 0 4px 10px -4px rgba(2, 8, 23, .55), 0 0 28px -6px rgba(56, 189, 248, .45); }
}

/* a clear gap between sections */
.app-section + .app-section { margin-top: clamp(28px, 5vw, 44px); }

/* =====================================================================
   1.27 – Household measures (معلقة / كوباية / ربع كيلو) beside the weight
   ===================================================================== */
.ingredient__qty { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; text-align: end; }
.ingredient__home { font-weight: 800; color: var(--text); white-space: nowrap; }
.ingredient__exact { font-size: 12px; color: var(--muted); white-space: nowrap; }
.cook__needs { list-style: none; margin: var(--space-3) 0 0; padding: var(--space-3); display: grid; gap: 8px;
    border-radius: var(--radius-lg); background: var(--accent-soft); border: 1px solid rgba(56, 189, 248, .3); }
.cook__needs li { font-size: var(--fs-md); font-weight: 700; line-height: 1.5; }

/* =====================================================================
   1.27.1 – Insights (screen + print/PDF), usage notice, user activity
   ===================================================================== */
.ins-cover { margin: var(--space-3) 0; }
.ins-cover__logo { height: 54px; margin-bottom: 8px; }
.ins-cover h1 { font-size: var(--fs-xl); font-weight: 900; }
.ins-cover__meta { color: var(--muted); font-size: var(--fs-sm); }
.ins-cover__conf { margin-top: 6px; font-size: 12px; color: var(--accent); }
.ins-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin: var(--space-3) 0; }
.ins-live { font-size: 13px; font-weight: 800; color: #22C38E; animation: ins-pulse 2s ease-in-out infinite; }
@keyframes ins-pulse { 50% { opacity: .45; } }
.ins-summary { padding: var(--space-4); border-radius: var(--radius-lg); background: var(--accent-soft); border: 1px solid rgba(56, 189, 248, .35); }
.ins-summary h2 { font-size: var(--fs-lg); font-weight: 900; margin-bottom: var(--space-2); }
.ins-summary ul { display: grid; gap: 8px; padding-inline-start: 1.1em; }
.ins-summary li { line-height: 1.6; }
.ins-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-2); margin: var(--space-4) 0; }
.ins-kpi { padding: var(--space-3); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 2px; }
.ins-kpi span { font-size: 12px; color: var(--muted); }
.ins-kpi strong { font-size: 26px; font-weight: 900; }
.ins-kpi.is-live strong { color: #22C38E; }
.ins-kpi small.is-up { color: #22C38E; font-weight: 800; } .ins-kpi small.is-down { color: #F43F5E; font-weight: 800; }
.ins-section { margin-top: clamp(28px, 5vw, 44px); }
.ins-section h2 { font-size: var(--fs-lg); font-weight: 900; }
.ins-section__lead { color: var(--text-2); margin: 4px 0 var(--space-3); }
.ins-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--space-3); }
.ins-card { padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 8px; align-content: start; }
.ins-card--wide { grid-column: 1 / -1; }
.ins-card h3 { font-size: var(--fs-md); font-weight: 800; }
.ins-card__chart { position: relative; height: 240px; }
.ins-card--wide .ins-card__chart { height: 280px; }
.ins-card__what, .ins-card__read { font-size: 13px; line-height: 1.6; color: var(--text-2); }
.ins-card__read { padding: 8px 10px; border-radius: 10px; background: var(--accent-soft); color: var(--text); }
.ins-method { margin-top: var(--space-5); font-size: 13px; color: var(--text-2); display: grid; gap: 6px; }
.ins-userbars { display: grid; gap: 6px; margin-bottom: var(--space-3); }
.ins-userbars > div { display: grid; grid-template-columns: 100px 1fr auto; gap: 8px; align-items: center; font-size: 13px; }
.ins-userbars i { display: block; height: 8px; border-radius: 4px; background: var(--accent); }
.usage-card { padding: var(--space-3) var(--space-4); display: grid; gap: var(--space-2); font-size: var(--fs-sm); line-height: 1.6; }
.switch-row { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.switch-row input { width: 20px; height: 20px; accent-color: var(--accent); }

/* Export → Save as PDF */
@media print {
    @page { size: A4; margin: 14mm; }
    body.page-insights { background: #fff !important; color: #0B1120 !important; }
    body.page-insights .app-header, body.page-insights .tabbar, body.page-insights .ins-bar, body.page-insights .admin-tabs,
    body.page-insights .ruti-orb, body.page-insights .drawer, body.page-insights #ruti-orb { display: none !important; }
    .ins-cover { min-height: 40vh; display: grid; align-content: center; text-align: center; page-break-after: always; }
    .ins-cover h1 { font-size: 34px; color: #0B1120; }
    .ins-summary { page-break-after: always; background: #F0F9FF; border-color: #7DD3FC; }
    .ins-section { page-break-before: always; }
    .ins-card { break-inside: avoid; background: #fff; border-color: #CBD5E1; }
    .ins-card__read { background: #F0F9FF; color: #0B1120; }
    .ins-kpi { background: #fff; border-color: #CBD5E1; }
    .ins-card__what, .ins-section__lead, .ins-method { color: #334155; }
}


/* =====================================================================
   1.27.3 – One icon language: line icons (no frame) instead of emoji
   ===================================================================== */
.uic { width: 1.2em; height: 1.2em; display: inline-block; vertical-align: -0.22em; color: var(--accent); flex: none; stroke-width: 1.6; }
.btn .uic, .chip .uic, .pill .uic, .badge .uic, .tabbar .uic, .uic--inherit { color: currentColor; }
.uic--danger { color: var(--danger, #EF4444); }
.uic--ok { color: var(--ok, #22C38E); }
/* where an emoji sat inside a soft square, keep the line icon bare */
.brief__icon, .card__icon, .list-icon, .row__icon, .tile-emoji { background: none !important; box-shadow: none !important; }
/* a big emoji used as an illustration scales to its text */
.empty-state .uic, .hero .uic { width: 2.6em; height: 2.6em; stroke-width: 1.3; }
/* light theme: readable accent (WCAG AA) */
:root[data-theme="light"] { --accent: #0369A1; }
.wx__icon, .soon__icon, .drawer__emoji, .invite-card__icon { background: none !important; box-shadow: none !important; border: 0 !important; }
.drawer__emoji .uic { width: 24px; height: 24px; }
.seg__btn .uic { color: currentColor; }
.sos-number span .uic { width: 28px; height: 28px; stroke-width: 1.5; }
.uic.uic--danger, .btn .uic.uic--danger, .drawer .uic.uic--danger { color: var(--danger, #EF4444); }
.uic.uic--ok, .btn .uic.uic--ok { color: var(--ok, #22C38E); }


/* =====================================================================
   1.27.4 – Recipe photos (4:3, 1440x1080; thumbnails 480x360)
   ===================================================================== */
.recipe__photo { margin: 0 0 var(--space-3); border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 4 / 3; background: #0B0F19;
    box-shadow: 0 18px 40px -22px rgba(0, 0, 0, .7); }
.recipe__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (min-width: 900px) { .recipe__photo { aspect-ratio: 16 / 9; } }   /* wide screens: same photo, a calmer crop around the centred dish */
.recipe-card__photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; border-radius: var(--radius-md); margin-bottom: 8px; background: #0B0F19; }
.rphoto { min-width: 120px; }
.rphoto__img { width: 96px; height: 72px; object-fit: cover; border-radius: 10px; display: block; margin-bottom: 6px; background: #0B0F19; }
.rphoto__form { display: inline-block; margin: 2px 4px 0 0; }
.rphoto label.mini-btn { cursor: pointer; }


/* =====================================================================
   1.27.5 – Medicine picker (Egyptian drug list) and information card
   ===================================================================== */
.drug-picker { position: relative; grid-column: 1 / -1; }
.drug-results { position: absolute; inset-inline: 0; top: 100%; z-index: 30; margin: 4px 0 0; padding: 6px; list-style: none; max-height: 320px; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .6); }
.drug-results button { width: 100%; display: grid; gap: 1px; text-align: start; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: var(--text); cursor: pointer; font: inherit; }
.drug-results button:hover, .drug-results button:focus-visible { background: var(--accent-soft); }
.drug-results small { color: var(--muted); font-size: 12px; direction: ltr; text-align: start; }
.drug-results .drug-other b { color: var(--accent); }
.drug-card { margin: 0 0 var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 8px; }
.drug-card__head { display: grid; gap: 2px; } .drug-card__head b { font-size: var(--fs-lg); } .drug-card__head span { color: var(--muted); font-size: 12px; }
.drug-card__facts { display: grid; gap: 6px; margin: 0; } .drug-card__facts div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.drug-card__facts dt { color: var(--muted); } .drug-card__facts dd { margin: 0; font-weight: 700; text-align: end; }
.drug-card details { border-top: 1px solid var(--line); padding: 8px 0 0; } .drug-card summary { cursor: pointer; font-weight: 800; }
.drug-card details p { font-size: 13px; line-height: 1.6; color: var(--text-2); margin-top: 6px; text-align: start; }
.drug-card__safety { font-size: 12px; color: var(--warn, #FBBF24); font-weight: 700; }

.drug-orig { border: 0 !important; padding: 4px 0 0 !important; } .drug-orig summary { font-weight: 600 !important; font-size: 12px; color: var(--muted); }


/* =====================================================================
   1.27.9 – Lab results and the medical record
   ===================================================================== */
.labs-note { font-size: 12.5px; line-height: 1.6; padding: 10px 14px; border-radius: var(--radius-md); background: rgba(251, 191, 36, .1); border: 1px solid rgba(251, 191, 36, .35); margin-bottom: var(--space-3); }
.labs-upload { display: grid; gap: 8px; }
.sec-title { font-size: var(--fs-lg); font-weight: 900; margin: var(--space-4) 0 var(--space-2); }
.lab-row { display: grid; grid-template-columns: 1fr 90px auto; gap: 6px 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.lab-row__name { font-weight: 700; font-size: 14px; grid-column: 1 / -1; }
.lab-row__unit { font-size: 12px; color: var(--muted); }
.lab-row__range { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.lab-row__range input { width: 64px; padding: 4px 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); }
.lab-more { margin: var(--space-3) 0; } .lab-more summary { cursor: pointer; font-weight: 800; color: var(--accent); }
.lab-group__title { font-size: var(--fs-md); font-weight: 900; margin: var(--space-3) 0 var(--space-2); }
.lab-doctor, .lab-food { padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); margin-bottom: var(--space-3); }
.lab-doctor { background: rgba(248, 113, 113, .08); border: 1px solid rgba(248, 113, 113, .35); }
.lab-food { background: var(--accent-soft); border: 1px solid rgba(56, 189, 248, .3); }
.lab-doctor h3, .lab-food h3 { font-size: var(--fs-md); font-weight: 900; margin-bottom: 6px; }
.lab-doctor ul, .lab-food ul { display: grid; gap: 6px; padding-inline-start: 1.1em; margin-bottom: 8px; font-size: 14px; line-height: 1.6; }
.lab-test { padding: 12px 14px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); margin-bottom: 8px; display: grid; gap: 4px; }
.lab-test header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lab-test--high { border-color: rgba(248, 113, 113, .45); } .lab-test--low { border-color: rgba(251, 191, 36, .45); }
.lab-test__value strong { font-size: 22px; font-weight: 900; } .lab-test__value small { color: var(--muted); margin-inline-start: 8px; }
.lab-test__range { font-size: 12px; color: var(--muted); }
.lab-test__about { font-size: 13px; color: var(--text-2); line-height: 1.6; } .lab-test__mean { font-size: 13px; font-weight: 700; line-height: 1.6; }
.lab-tumour-note { font-size: 13px; line-height: 1.6; padding: 8px 12px; border-radius: 10px; background: rgba(248, 113, 113, .08); margin-bottom: 8px; }
.lab-hist { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }

/* 1.27.12 – sleep card: three matching line icons */
.sleep-pick .uic { width: 30px; height: 30px; stroke-width: 1.5; }
.sleep-pick.is-active .uic { color: currentColor; }

/* =====================================================================
   1.57.0 – Admin: RUTI learning
   ===================================================================== */
.lrn-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lrn-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 14px 0 10px; }
.lrn-stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.lrn-stat b { font-size: 1.5rem; line-height: 1.2; }
.lrn-stat span { font-size: .82rem; color: var(--muted); }
.lrn-stat--warn { border-color: var(--warn); background: var(--warn-soft); }
.lrn-run { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin-bottom: 12px; }
.lrn-run p { margin: 0; font-size: .88rem; }
.lrn-tabs { display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 8px 0; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.lrn-tabs::-webkit-scrollbar { display: none; }
.lrn-tabs a { flex: 0 0 auto; white-space: nowrap; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: inherit; font-weight: 600; font-size: .9rem; }
.lrn-tabs a:hover { background: var(--accent-soft); }
.lrn-badge { display: inline-block; min-width: 1.5em; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .78rem; text-align: center; }
.lrn-block { padding-top: 10px; scroll-margin-top: 60px; }
.lrn-block h2 { margin: 12px 0 4px; font-size: 1.15rem; }
.lrn-block > p.muted { margin: 0 0 10px; font-size: .88rem; }
.lrn-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lrn-item { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.lrn-item__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 260px; }
.lrn-item__text b { overflow-wrap: anywhere; }
.lrn-item__do { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex: 0 1 auto; }
.lrn-select { width: auto; min-width: 0; max-width: 100%; padding-block: 6px; font-size: .88rem; }
.lrn-guess { align-self: flex-start; font-size: .82rem; padding: 2px 10px; border-radius: 999px; }
.lrn-guess--ok { background: var(--ok-soft); color: var(--ok); }
.lrn-guess--warn { background: var(--warn-soft); color: var(--warn); }
.lrn-guess--low { background: var(--danger-soft); color: var(--danger); }
.lrn-list--small li { font-size: .9rem; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.lrn-find { margin-bottom: 10px; }
.lrn-skill { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px; overflow: hidden; scroll-margin-top: 70px; }
.lrn-skill > summary { cursor: pointer; list-style: none; padding: 12px 14px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(70px, 160px) auto; gap: 6px 12px; align-items: center; }
.lrn-skill > summary::-webkit-details-marker { display: none; }
.lrn-skill[open] > summary { border-bottom: 1px solid var(--line); }
.lrn-skill__name { font-weight: 700; }
.lrn-new { font-size: .75rem; font-weight: 600; color: var(--ok); background: var(--ok-soft); border-radius: 999px; padding: 1px 8px; }
.lrn-meter, .lrn-conf i { display: block; }
.lrn-meter { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.lrn-meter i { display: block; height: 100%; border-radius: inherit; }
[dir="rtl"] .lrn-meter i { margin-inline-start: 0; }
.lrn-meter--ok i, .lrn-conf--ok i { background: var(--ok); }
.lrn-meter--warn i, .lrn-conf--warn i { background: var(--warn); }
.lrn-meter--low i, .lrn-conf--low i { background: var(--danger); }
.lrn-pct { font-size: 1.05rem; min-width: 3.2em; text-align: end; }
.lrn-styles { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; }
.lrn-meta { grid-column: 1 / -1; font-size: .8rem; }
.lrn-chip { display: inline-flex; gap: 4px; align-items: center; font-size: .76rem; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); white-space: nowrap; }
.lrn-chip--off { background: transparent; border: 1px dashed var(--line); color: var(--muted); }
.lrn-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.lrn-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.lrn-table th { text-align: start; font-weight: 600; color: var(--muted); font-size: .78rem; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.lrn-table td { padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.lrn-table td:first-child { min-width: 180px; overflow-wrap: anywhere; }
.lrn-table tr:last-child td { border-bottom: 0; }
.lrn-table form { margin: 0; }
.lrn-conf { position: relative; display: inline-block; width: 74px; height: 18px; border-radius: 999px; background: var(--line); overflow: hidden; vertical-align: middle; }
.lrn-conf i { position: absolute; inset-block: 0; left: 0; }
.lrn-conf b { position: relative; display: block; text-align: center; font-size: .72rem; line-height: 18px; color: var(--text, inherit); mix-blend-mode: normal; }
.lrn-add { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px 14px; }
.lrn-add .field__input:first-of-type { flex: 1 1 220px; }
@media (max-width: 560px) {
    .lrn-skill > summary { grid-template-columns: minmax(0, 1fr) auto; }
    .lrn-meter { grid-column: 1 / -1; grid-row: 2; }
    .lrn-item__do { width: 100%; }
    .lrn-item__do .lrn-select { flex: 1 1 100%; }
    .lrn-skill .lrn-table thead { display: none; }
    .lrn-skill .lrn-table tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
    .lrn-skill .lrn-table td { border: 0; padding: 0; }
    .lrn-skill .lrn-table td:first-child { flex: 1 1 100%; min-width: 0; font-weight: 600; }
    .lrn-skill .lrn-table td:nth-child(3) { font-size: .78rem; }
    .lrn-skill .lrn-table td:nth-child(5)::after { content: "×"; color: var(--muted); }
    .lrn-skill .lrn-table td:last-child { margin-inline-start: auto; }
}

/* 1.59.0 – today's occasion under the home greeting (Friday, Ramadan, Eid, birthdays…) */
.brief__season { margin: 2px auto 10px; padding: 6px 14px; width: fit-content; max-width: 100%; border-radius: 999px; background: var(--accent-soft); color: var(--text, inherit); font-weight: 600; font-size: .95rem; text-align: center; }

/* =====================================================================
   1.60.0 – Country Intelligence & Crisis Early Warning (admin/bi.php)
   ===================================================================== */
.cbi-cover__logos { display: flex; align-items: center; justify-content: center; gap: 18px; margin-bottom: 10px; }
.cbi-cover__ruti { height: 46px; width: auto; max-width: 180px; }
.cbi-bar { display: grid; gap: 10px; margin: var(--space-3) 0; }
.cbi-country { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: var(--space-3) 0 0; }
.cbi-country .field__label { margin: 0; font-weight: 600; }
.cbi-country select { width: auto; min-width: 240px; max-width: 100%; font-size: 15px; }
.cbi-empty-country { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: var(--space-3) 0; padding: 14px 16px;
    border: 1px dashed var(--color-border, rgba(127,127,127,.4)); border-radius: 14px; background: var(--color-surface-2, rgba(127,127,127,.06)); }
.cbi-empty-country p { margin: 0; }
.cbi-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.cbi-tabs::-webkit-scrollbar { display: none; }
.cbi-tabs a { flex: 0 0 auto; white-space: nowrap; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); color: inherit; text-decoration: none; font-weight: 600; font-size: .88rem; }
.cbi-tabs a.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.cbi-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cbi-actions form { display: contents; }
.cbi-section { margin-top: var(--space-4); }
.cbi-section__title { font-size: var(--fs-lg, 1.3rem); font-weight: 900; margin: 0 0 6px; }
.cbi-radar { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: var(--space-3) 0; }
.cbi-risk { display: grid; gap: 4px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: inherit; text-decoration: none; min-height: 112px; align-content: start; }
.cbi-risk__icon { font-size: 1.4rem; }
.cbi-risk__level { font-size: .8rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; width: fit-content; background: var(--ok-soft); color: var(--ok); }
.cbi-risk small { font-size: .78rem; color: var(--muted); line-height: 1.4; }
.cbi-risk--watch { border-color: #EAB308; }
.cbi-risk--watch .cbi-risk__level { background: rgba(234, 179, 8, .15); color: #CA8A04; }
.cbi-risk--warning { border-color: var(--warn); }
.cbi-risk--warning .cbi-risk__level { background: var(--warn-soft); color: var(--warn); }
.cbi-risk--critical { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger) inset; }
.cbi-risk--critical .cbi-risk__level { background: var(--danger-soft); color: var(--danger); }
.cbi-alerts { display: grid; gap: 10px; }
.cbi-alert { border: 1px solid var(--line); border-inline-start: 5px solid #EAB308; border-radius: 14px; padding: 12px 14px; background: var(--surface); break-inside: avoid; }
.cbi-alert--warning { border-inline-start-color: var(--warn); }
.cbi-alert--critical { border-inline-start-color: var(--danger); }
.cbi-alert header { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.cbi-alert header small { flex-basis: 100%; }
.cbi-alert__level { font-size: .75rem; font-weight: 800; padding: 1px 8px; border-radius: 999px; background: rgba(234, 179, 8, .15); color: #CA8A04; }
.cbi-alert--warning .cbi-alert__level { background: var(--warn-soft); color: var(--warn); }
.cbi-alert--critical .cbi-alert__level { background: var(--danger-soft); color: var(--danger); }
.cbi-alert p { margin: 6px 0; line-height: 1.6; }
.cbi-alert details summary { cursor: pointer; font-weight: 700; font-size: .88rem; }
.cbi-alert ol { margin: 6px 0 0; padding-inline-start: 20px; line-height: 1.7; font-size: .9rem; }
.cbi-alert__do { display: flex; gap: 6px; margin-top: 8px; }
.cbi-src { font-size: .75rem; color: var(--muted); margin: 6px 0 0; line-height: 1.5; overflow-wrap: anywhere; }
.cbi-src a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.cbi-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 8px 0; }
.cbi-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.cbi-table th { text-align: start; font-size: .76rem; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.cbi-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.cbi-table a { color: var(--accent); }
.cbi-note { font-size: .8rem; }
.cbi-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--space-3); margin: var(--space-3) 0; }
.cbi-form { display: grid; gap: 8px; align-content: start; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.cbi-form h3 { margin: 0; }
.cbi-form p { margin: 0; font-size: .85rem; }
.cbi-form__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.cbi-form__grid label { display: grid; gap: 2px; }
.cbi-form__row { display: flex; gap: 6px; flex-wrap: wrap; }
.cbi-method { line-height: 1.8; font-size: .9rem; color: var(--muted); padding-inline-start: 20px; }
.ins-card__chart--tall { height: 380px !important; }
.is-up { color: var(--danger); } .is-down { color: var(--ok); }
.cbi-print-head { display: none; }
@media (max-width: 560px) {
    .cbi-radar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ins-grid { grid-template-columns: minmax(0, 1fr); }
}

/* The branded report (Save as PDF): BAST + RUTI on every page */
@media print {
    body.page-cbi { background: #fff !important; color: #0B1120 !important; }
    body.page-cbi .app-header, body.page-cbi .tabbar, body.page-cbi .cbi-bar, body.page-cbi .ruti-orb, body.page-cbi #ruti-orb, body.page-cbi .drawer,
    body.page-cbi .adm-bar, body.page-cbi .adm-menu, body.page-cbi .alerts, body.page-cbi .flash { display: none !important; }
    body.page-cbi .cbi-print-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px;
        padding: 0 0 6px; border-bottom: 2px solid #C44A27; background: #fff; font-size: 9pt; color: #334155; }
    body.page-cbi .cbi-print-head img { height: 22px; width: auto; }
    body.page-cbi .cbi-print-head img:first-child { border-radius: 4px; }
    body.page-cbi .cbi-cover { min-height: 80vh; display: grid; align-content: center; text-align: center; page-break-after: always; }
    body.page-cbi .cbi-cover__ruti { height: 70px; max-width: 260px; }
    body.page-cbi .cbi-cover h1 { font-size: 30px; color: #0B1120; }
    body.page-cbi .cbi-cover, body.page-cbi .cbi-cover h1, body.page-cbi .cbi-cover p { text-align: center !important; justify-items: center; }
    body.page-cbi .cbi-section { page-break-before: always; }
    body.page-cbi .cbi-section:first-of-type { page-break-before: auto; }
    body.page-cbi .ins-card, body.page-cbi .ins-kpi, body.page-cbi .cbi-risk, body.page-cbi .cbi-alert, body.page-cbi .cbi-form { background: #fff !important; border-color: #CBD5E1 !important; break-inside: avoid; color: #0B1120; }
    body.page-cbi .ins-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body.page-cbi .ins-card--wide { grid-column: 1 / -1; }
    body.page-cbi .cbi-src, body.page-cbi .ins-section__lead, body.page-cbi .muted { color: #475569 !important; }
    body.page-cbi .cbi-table td, body.page-cbi .cbi-table th { border-color: #E2E8F0; color: #0B1120; }
}

.page-cbi .ins-kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.page-cbi .ins-kpi strong { font-size: clamp(1.15rem, 1.7vw, 1.55rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 1.61.0 – one household: quick links under each child, link-your-spouse hint */
/* 1.62.0: the child's quick links live INSIDE the child's card (they used to float under it) */
.kid-card { border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); overflow: hidden; transition: border-color .2s; }
.kid-card:hover { border-color: var(--accent); }
.kid-card > .member { background: transparent; border: 0; border-radius: 0; }
.kid-links { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px var(--space-4) 12px; margin: 0; border-top: 1px solid var(--line); }
.kid-links .chip { font-size: .8rem; padding: 4px 10px; }
.household-hint { display: grid; gap: 8px; margin: var(--space-3) 0; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); }
.household-hint p { margin: 0; line-height: 1.6; }

/* 1.62.0: food delivery bought outside RUTI, highlighted in Spending */
.outside-card { display: flex; align-items: center; gap: 12px; margin: var(--space-3) 0; padding: 12px 14px; border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); }
.outside-card__icon { font-size: 1.6rem; }
.outside-card strong { display: block; }
.outside-card small { color: var(--muted, inherit); opacity: .85; line-height: 1.5; }

/* 1.62.0: Country BI – add a country, websites as sources, news watch */
.cbi-add-country { margin: 8px 0 0; }
.cbi-add-country > summary { cursor: pointer; font-weight: 600; color: var(--accent); display: inline-block; padding: 4px 0; }
.cbi-add-country .cbi-form { margin-top: 10px; }
.cbi-remove-country { margin-top: 8px; }
.cbi-web { margin: var(--space-4) 0; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
.cbi-web h3 { margin: 0 0 6px; }
.cbi-web__btns { display: flex; gap: 6px; flex-wrap: wrap; }
.cbi-web__btns form { margin: 0; }
.cbi-web__add { margin-top: 12px; }
.cbi-web__preview { margin-top: 12px; display: grid; gap: 10px; }
.cbi-web__table { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.cbi-web__table > summary { cursor: pointer; font-weight: 600; }
.cbi-web__new { border: 1px dashed var(--line); border-radius: 12px; padding: 8px 12px; margin: 8px 0; }
.cbi-table--mini th, .cbi-table--mini td { font-size: .8rem; padding: 4px 8px; white-space: nowrap; }
.cbi-form__wide { grid-column: 1 / -1; }
.cbi-news { list-style: none; margin: 8px 0 16px; padding: 0; display: grid; gap: 8px; }
.cbi-news__item { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); border-inline-start-width: 4px; }
.cbi-news__item--warning { border-inline-start-color: #F97316; }
.cbi-news__item--watch { border-inline-start-color: #EAB308; }
.cbi-news__level { font-size: .75rem; font-weight: 700; opacity: .8; }
.cbi-news__item a { font-weight: 600; color: inherit; }

/* 1.62.0: any file, links found on a page */
.cbi-web h4 { margin: 0 0 4px; }
.cbi-web__meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: .9rem; }
.cbi-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.cbi-links li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.cbi-links li a { flex: 1 1 260px; font-size: .85rem; word-break: break-all; }
.cbi-links li form { margin: 0; }
.cbi-keep { display: inline-flex; gap: 6px; align-items: center; font-size: .85rem; }
.cbi-form__row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* 1.62.0: findings worked out from the data */
.cbi-insights { margin: 12px 0 16px; padding: 14px 16px; border-radius: 16px; background: color-mix(in srgb, var(--accent) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); }
.cbi-insights h3 { margin: 0 0 8px; font-size: 1rem; }
.cbi-insights ul { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; line-height: 1.7; }
@media print { .cbi-insights { break-inside: avoid; background: #fff; } }

/* 1.62.0: RUTI Reader progress + save all */
.reader-progress { margin-top: 10px; display: grid; gap: 6px; }
.reader-progress__bar { height: 8px; border-radius: 99px; background: rgba(148, 163, 184, .2); overflow: hidden; }
.reader-progress__bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .3s ease; }
.reader-progress__text { margin: 0; font-size: .9rem; }
.reader-progress.is-error .reader-progress__text { color: #EF4444; }
.cbi-scroll--tall { max-height: 360px; overflow: auto; }
.cbi-saveall { padding: 14px 16px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); display: grid; gap: 8px; }
.cbi-saveall h4 { margin: 0; }
.cbi-saveall__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 260px; overflow: auto; }
.cbi-saveall__list label { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }

/* 1.62.0 – © BAST copyright footer: only on issued (printed / PDF) reports – never on RUTI's screens.
   Every page: "© BAST · RUTI" + page n / N in the page margin; end of the report: the colophon with BAST's logo. */
.rpt-copy { display: none; }
@media print {
    :root, html { background: #fff !important; color-scheme: light !important; }
    .rpt-copy { display: flex !important; align-items: center; justify-content: center; gap: 10px; margin: 8mm auto 0; padding-top: 3mm; border-top: 0.6pt solid #CBD5E1;
        color: #475569 !important; font: 500 8pt/1.4 system-ui, sans-serif; text-align: center; break-inside: avoid; max-width: 180mm; }
    .rpt-copy img { height: 9mm; width: auto; border-radius: 2mm; }
}

/* =====================================================================
   1.62.0 – Decision Lab (BI → 🧭)
   ===================================================================== */
.dl-brief { margin: 14px 0 18px; padding: 16px 18px; border-radius: 18px; border: 1px solid var(--line, rgba(148,163,184,.25));
    background: linear-gradient(135deg, rgba(18,136,190,.12), rgba(196,74,39,.08)); }
.dl-brief h3 { margin: 0 0 10px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.dl-brief h3 small { font-weight: 500; font-size: 12px; }
.dl-brief ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: dlb; }
.dl-brief__item { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; padding: 10px 12px; border-radius: 12px; background: var(--surface, rgba(15,23,42,.35));
    border-inline-start: 4px solid #64748B; }
.dl-brief__item > span { font-size: 20px; line-height: 1.2; }
.dl-brief__item p { margin: 0; line-height: 1.6; }
.dl-brief__item--red { border-inline-start-color: #DC2626; }
.dl-brief__item--amber { border-inline-start-color: #D97706; }
.dl-brief__item--green { border-inline-start-color: #16A34A; }
.dl-brief__item--blue { border-inline-start-color: #1288BE; }
.dl-pressure { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-bottom: 18px; }
.dl-pressure__item { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; padding: 12px 14px 16px; border-radius: 14px; text-decoration: none; color: inherit;
    background: var(--surface, rgba(15,23,42,.35)); border: 1px solid var(--line, rgba(148,163,184,.25)); overflow: hidden; }
.dl-pressure__item b { font-size: 20px; font-variant-numeric: tabular-nums; }
.dl-pressure__item small { grid-column: 1 / -1; color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.dl-pressure__item i { position: absolute; inset-inline-start: 0; bottom: 0; height: 4px; width: calc(var(--v) * 1%); background: #16A34A; border-radius: 0 4px 4px 0; }
.dl-pressure__item--elevated i { background: #D97706; }
.dl-pressure__item--high i { background: #DC2626; }
.dl-pressure__item--high { border-color: rgba(220,38,38,.45); }
.dl-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin: 6px 0 20px; }
.dl-tool { padding: 16px; border-radius: 16px; background: var(--surface, rgba(15,23,42,.35)); border: 1px solid var(--line, rgba(148,163,184,.25)); display: grid; gap: 8px; align-content: start; min-width: 0; }
.dl-tool--wide { grid-column: 1 / -1; }
.dl-tool h3 { margin: 0; }
.dl-tool p.muted { margin: 0; font-size: 13px; }
.dl-tool input[type=range] { width: 100%; accent-color: #1288BE; }
.dl-tool output { font-weight: 700; margin-inline-start: 6px; }
.dl-result { display: grid; gap: 8px; }
.dl-result p { margin: 0; font-weight: 600; line-height: 1.6; }
.dl-result p.is-gap { color: #F59E0B; }
.dl-result p.is-ok { color: #22C55E; }
.dl-result .dl-cost { color: inherit; font-size: 15px; }
.dl-meter { position: relative; height: 14px; border-radius: 99px; background: rgba(148,163,184,.18); }
.dl-meter__zero { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: rgba(148,163,184,.6); }
.dl-meter__band { position: absolute; top: 3px; bottom: 3px; background: rgba(18,136,190,.35); border-radius: 99px; }
.dl-meter__dot { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #C44A27; box-shadow: 0 0 0 3px rgba(196,74,39,.25); transition: left .2s ease; }
.dl-mini { color: var(--muted); min-height: 150px; }
.dl-planner__pick { display: flex; flex-wrap: wrap; gap: 6px; }
.dl-planner__form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.dl-planner__form label[hidden] { display: none; }
.dl-plan-table td, .dl-plan-table th { white-space: nowrap; }
.dl-news { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.dl-news li { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--surface, rgba(15,23,42,.35)); }
.dl-news small { color: var(--muted); }
@media (max-width: 560px) {
    .dl-tools { grid-template-columns: minmax(0, 1fr); }
    .dl-brief { padding: 12px; }
}
@media print {
    body.page-cbi .dl-brief, body.page-cbi .dl-tool, body.page-cbi .dl-pressure__item, body.page-cbi .dl-brief__item, body.page-cbi .dl-news li { background: #fff !important; color: #0B1120; border-color: #CBD5E1; break-inside: avoid; }
    body.page-cbi .dl-tool input[type=range], body.page-cbi .dl-planner__pick, body.page-cbi .dl-tool select { display: none; }
    body.page-cbi .dl-tool .field__input { background: #fff !important; color: #0B1120 !important; border-color: #CBD5E1 !important; }
    body.page-cbi .dl-pressure__item.is-zero { display: none; }
    body.page-cbi .dl-result p.is-gap { color: #B45309; }
    body.page-cbi .dl-result p.is-ok { color: #15803D; }
}

/* 1.63.0 – the day's mood on the home brief, children's behaviour week */
.brief__mood { display: inline-flex; align-items: center; gap: 8px; margin: 6px auto 0; padding: 6px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
    background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.brief__mood--tired, .brief__mood--sad, .brief__mood--lonely { background: rgba(167,139,250,.14); border-color: rgba(167,139,250,.35); }
.brief__mood--stressed, .brief__mood--angry, .brief__mood--worried { background: rgba(251,146,60,.13); border-color: rgba(251,146,60,.35); }
.brief__mood--happy { background: rgba(34,197,94,.13); border-color: rgba(34,197,94,.35); }
.kid-behaviour__row { display: flex; flex-wrap: wrap; gap: 8px; }
.kid-behaviour__row span { padding: 8px 12px; border-radius: 12px; background: var(--surface-2); }
.kid-behaviour__good b { color: #EAB308; }

/* 1.64.0 – the one button that matters in an emergency */
.action-btn--danger { background: #DC2626; border-color: #DC2626; color: #fff; font-weight: 800; box-shadow: 0 6px 18px rgba(220,38,38,.35); }
.action-btn--danger:hover, .action-btn--danger:focus-visible { background: #B91C1C; border-color: #B91C1C; }

/* =====================================================================
   1.65.0 – Body: height, InBody, healthy ranges
   ===================================================================== */
.body-head { display: grid; grid-template-columns: 1fr minmax(200px, 280px); gap: 14px; align-items: end; }
.body-head h2 { margin: 0; }
.body-head p { margin: 4px 0 0; }
.body-height__row { display: flex; gap: 8px; }
.body-height__row .field__input { max-width: 140px; }
.body-height__ask { color: var(--accent); }
.body-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.body-card { display: grid; gap: 6px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.body-card__label { font-size: 13px; color: var(--muted); }
.body-card strong { font-size: 24px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.body-card strong small { font-size: 13px; font-weight: 600; color: var(--muted); margin-inline-start: 2px; }
.body-card > small { font-size: 12px; line-height: 1.4; }
.body-bar { position: relative; height: 8px; border-radius: 99px; background: rgba(148,163,184,.22); margin: 2px 0; }
.body-bar__ok { position: absolute; top: 0; bottom: 0; background: rgba(34,197,94,.45); border-radius: 99px; }
.body-bar__dot { position: absolute; top: 50%; width: 14px; height: 14px; margin-top: -7px; margin-inline-start: -7px; border-radius: 50%; background: #16A34A; border: 2px solid var(--surface, #fff); box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.body-bar--high .body-bar__dot, .body-bar--veryhigh .body-bar__dot { background: #EA580C; }
.body-bar--low .body-bar__dot { background: #2563EB; }
.body-energy { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.body-energy h3 { margin: 0 0 8px; font-size: 15px; }
.body-energy__row { display: flex; flex-wrap: wrap; gap: 8px; }
.body-energy__row span { padding: 6px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; }
.body-energy__row b { font-variant-numeric: tabular-nums; }
.body-say { display: grid; grid-template-columns: 26px 1fr; gap: 8px; margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.body-say p { margin: 0 0 6px; line-height: 1.6; }
.body-say p:last-child { margin-bottom: 0; }
.body-trends { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.body-trend { padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.body-trend h3 { margin: 0 0 6px; font-size: 14px; display: flex; justify-content: space-between; }
.body-trend h3 small { color: var(--muted); }
.body-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.body-table th, .body-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: start; white-space: nowrap; }
.body-table th { color: var(--muted); font-weight: 600; font-size: 12px; }
.profile-body { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.profile-body span { padding: 6px 12px; border-radius: 10px; background: var(--surface-2); }
@media (max-width: 560px) {
    .body-head { grid-template-columns: 1fr; }
    .body-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.body-card--empty { grid-column: span 2; align-content: start; }
.body-card--empty p { margin: 0; line-height: 1.6; font-size: 14px; }
.body-card--empty .btn { justify-self: start; }

/* 1.66.0 – decision scenarios + the global source library */
.sc-form { display: grid; gap: 12px; padding: 16px; border-radius: 16px; background: var(--surface, rgba(15,23,42,.35)); border: 1px solid var(--line, rgba(148,163,184,.25)); margin-block: 12px 18px; }
.sc-more summary { cursor: pointer; font-weight: 700; }
.sc-more[open] { display: grid; gap: 8px; }
.sc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-block: 14px; }
.sc-card { display: grid; gap: 2px; padding: 14px; border-radius: 16px; border: 1px solid var(--line, rgba(148,163,184,.25)); background: var(--surface, rgba(15,23,42,.35)); border-top: 4px solid #64748B; }
.sc-card strong { font-size: 1.6rem; line-height: 1.2; }
.sc-card small { line-height: 1.4; }
.sc-card--best { border-top-color: #16A34A; }
.sc-card--base { border-top-color: #2563EB; }
.sc-card--worst { border-top-color: #DC2626; }
.sc-card--opt { border-top-color: #F59E0B; box-shadow: 0 0 0 2px rgba(245,158,11,.25); }
.sc-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-block: 8px; }
.sc-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: .82rem; white-space: nowrap; background: rgba(148,163,184,.15); }
.sc-pill--live { background: rgba(22,163,74,.16); }
.sc-pill--open { background: rgba(34,197,94,.12); }
.sc-pill--limited, .sc-pill--regional { background: rgba(245,158,11,.14); }
.sc-pill--key, .sc-pill--unverified { background: rgba(220,38,38,.14); }
.sc-lib { margin-block: 6px; }
.sc-lib summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
@media print { .sc-card { break-inside: avoid; } .sc-lib { break-inside: auto; } }
@media print {
    body.page-cbi .cbi-scroll { overflow: visible; }
    body.page-cbi .cbi-table th { white-space: normal; }
    body.page-cbi .cbi-table th, body.page-cbi .cbi-table td { padding: 4px 6px; font-size: .72rem; }
}
/* 1.66.1 – data refresh in steps */
.cbi-progress { display: grid; gap: 8px; padding: 12px 16px; margin-block: 10px; border-radius: 14px; border: 1px solid var(--line, rgba(148,163,184,.25)); background: rgba(37,99,235,.10); }
.cbi-progress p { margin: 0; }
.cbi-progress progress { width: 100%; height: 8px; accent-color: #2563EB; }
.cbi-progress .btn { justify-self: start; }
/* 1.67.0 – scenario sector picker */
.sc-cat { display: grid; gap: 6px; max-width: 520px; margin-block: 12px 4px; }

/* 1.68.0 – Governmental Services (shown only when RUTI Gov turns it on) */
.app-icon--gov    { --g: linear-gradient(150deg, #F6D77A 0%, #CD990D 55%, #8A6406 100%); }
.govapp-ask { display: grid; gap: 8px; margin-bottom: var(--space-3); }
.govapp-ask__row { display: flex; gap: 8px; } .govapp-ask__row .field__input { flex: 1; }
.govapp-ans { line-height: 1.9; margin-bottom: var(--space-3); } .govapp-ans p { margin: 0 0 4px; } .govapp-ans .btn { margin: 8px 0; }
.govapp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--space-3); }
.govapp-ev { margin-bottom: 8px; } .govapp-ev summary { cursor: pointer; list-style: none; padding: 4px 0; } .govapp-ev ol { padding-inline-start: 20px; line-height: 1.8; }
.govapp-ev li small { display: block; color: var(--muted); } .govapp-ev p { line-height: 1.8; margin: 6px 0; }
.gmode { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.gmode--online { background: rgba(34, 197, 94, .16); color: #22C55E; } .gmode--partial { background: rgba(245, 158, 11, .16); color: #F59E0B; } .gmode--inperson { background: rgba(244, 63, 94, .16); color: #F43F5E; }
.govapp-help { text-align: center; margin: var(--space-4) 0; }

/* =====================================================================
   1.69.0 – brief parts, mood, first steps, confirmation cards, motion picked from the references
   (every animation is skipped when motion is off: html.m-off or the device asks for less motion)
   ===================================================================== */
.brief__part + .brief__part { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.brief__part-title { font-size: 13.5px; font-weight: 800; color: var(--accent, #E0A82E); margin: 0 0 4px; display: flex; gap: 6px; align-items: center; }
.brief__part p { margin: 0 0 4px; line-height: 1.75; }
a.brief__mood { text-decoration: none; color: inherit; display: inline-flex; gap: 6px; align-items: center; }

/* once-a-day mood question on the home brief */
.brief__askmood { margin: 10px auto 4px; padding: 10px 12px; border-radius: 18px; background: var(--surface-2, rgba(255,255,255,.04)); border: 1px solid var(--line); max-width: 520px; text-align: center; }
.brief__askmood p { margin: 0 0 8px; font-weight: 700; }
.brief__askmood-faces { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.brief__face { font-size: 26px; line-height: 1; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface, transparent); cursor: pointer; transition: transform .18s ease, border-color .18s ease; }
.brief__face:hover, .brief__face:focus-visible { transform: scale(1.12); border-color: var(--accent, #E0A82E); }
.brief__askmood-cal { display: inline-block; margin-top: 8px; font-size: 13px; color: var(--muted); }

/* mood calendar */
.mood-title-ico { font-size: 28px; }
.mood-today { text-align: center; margin-bottom: var(--space-3); }
.mood-today__q { font-size: 18px; margin: 0 0 12px; }
.mood-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(74px, 1fr)); gap: 8px; }
.mood-pick__btn { display: grid; gap: 4px; justify-items: center; padding: 10px 4px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2, transparent); color: inherit; font: inherit; cursor: pointer; transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.mood-pick__btn span { font-size: 30px; line-height: 1; } .mood-pick__btn small { font-size: 12px; color: var(--muted); }
.mood-pick__btn:hover { transform: translateY(-2px); } .mood-pick__btn.is-on { border-color: var(--accent, #E0A82E); background: rgba(224,168,46,.12); }
.mood-today__music { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.mood-cal { padding: 12px; }
.mood-cal__week, .mood-cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.mood-cal__week span { text-align: center; font-size: 12px; color: var(--muted); font-weight: 700; padding-bottom: 6px; }
.mood-cal__grid { list-style: none; margin: 0; padding: 0; }
.mood-cal__day { aspect-ratio: 1; border-radius: 14px; background: var(--surface-2, rgba(255,255,255,.03)); border: 1px solid var(--line); display: grid; place-items: center; position: relative; }
.mood-cal__face { font-size: clamp(18px, 5vw, 28px); line-height: 1; }
.mood-cal__n { position: absolute; inset-block-start: 3px; inset-inline-start: 6px; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mood-cal__day.is-today { border-color: var(--accent, #E0A82E); box-shadow: 0 0 0 2px rgba(224,168,46,.25); }
.mood-cal__day.is-future { opacity: .35; }
.mood-cal__pad { visibility: hidden; }
.mood-cal__day--happy { background: rgba(110,153,14,.14); } .mood-cal__day--sad, .mood-cal__day--lonely { background: rgba(15,137,194,.14); }
.mood-cal__day--stressed, .mood-cal__day--angry { background: rgba(195,73,39,.14); } .mood-cal__day--tired, .mood-cal__day--worried, .mood-cal__day--pain { background: rgba(205,153,13,.14); }
.mood-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mood-bars li { display: grid; grid-template-columns: 28px minmax(90px, 30%) 1fr auto; gap: 8px; align-items: center; }
.mood-bars li > span:first-child { font-size: 22px; } .mood-bars__bar { display: block; height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; }
.mood-bars__bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #C34927, #CD990D, #6E990E, #0F89C2); }
.mood-bars__n { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mood-sum__note { margin-top: 12px; line-height: 1.8; }

/* the confirmation card in the chat (pocket money for several children) */
.card--confirm { border: 1px solid var(--accent, #E0A82E); }
.card--confirm .card__row.is-strong { border-top: 1px dashed var(--line); padding-top: 6px; }

/* password: the rules tick themselves as you type; the two passwords match */
.pw-rules { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.pw-rules li { display: flex; gap: 8px; align-items: center; transition: color .2s ease; }
.pw-rules li i { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line); display: inline-grid; place-items: center; flex: none; transition: background .25s ease, border-color .25s ease, transform .25s ease; }
.pw-rules li i::after { content: ''; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); margin-top: -2px; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.pw-rules li.is-ok { color: var(--text); } .pw-rules li.is-ok i { background: var(--ok, #22C55E); border-color: var(--ok, #22C55E); transform: scale(1.06); }
.pw-rules li.is-ok i::after { transform: rotate(45deg) scale(1); }
.pw-rules li.is-optional:not(.is-ok) { opacity: .7; }
.pw-match { font-size: 13px; margin-top: 6px; min-height: 18px; } .pw-match.is-ok { color: var(--ok, #22C55E); } .pw-match.is-bad { color: var(--danger, #F43F5E); }

html:not(.m-off) .mood-cal__day.has-mood .mood-cal__face { animation: moodPop .5s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: calc(var(--i, 0) * 28ms); }
html:not(.m-off) .mood-pick__btn, html:not(.m-off) .brief__face { animation: moodRise .45s ease both; animation-delay: calc(var(--i, 0) * 50ms); }
html:not(.m-off) .mood-bars__bar > i { animation: moodGrow .9s ease both; transform-origin: inline-start; }
html:not(.m-off) .brief__part { animation: moodRise .45s ease both; }
html:not(.m-off) .brief__part:nth-child(2) { animation-delay: .06s; } html:not(.m-off) .brief__part:nth-child(3) { animation-delay: .12s; }
html:not(.m-off) .brief__part:nth-child(4) { animation-delay: .18s; } html:not(.m-off) .brief__part:nth-child(5) { animation-delay: .24s; }
/* the RUTI mark greets you – a calm float, a happy hop on a good day */
html:not(.m-off) .brief__logo { animation: rutiFloat 5s ease-in-out infinite; }
html:not(.m-off) .brief:has(.brief__mood--happy) .brief__logo { animation: rutiHop 2.6s ease-in-out infinite; }
html:not(.m-off) .brief:has(.brief__mood--sad, .brief__mood--tired, .brief__mood--lonely) .brief__logo { animation: rutiFloat 7s ease-in-out infinite; }
/* «Check your email»: the envelope drops in and the flap waves */
html:not(.m-off) .auth__icon--mail svg { animation: mailDrop .7s cubic-bezier(.3, 1.4, .5, 1) both, mailWiggle 2.4s ease-in-out .8s infinite; transform-origin: 50% 80%; }
/* success messages on the sign-in pages get a check that draws itself */
.alert--success.has-check { display: flex; gap: 10px; align-items: center; }
.alert--success .ok-check { width: 26px; height: 26px; flex: none; }
.alert--success .ok-check circle { fill: none; stroke: var(--ok, #22C55E); stroke-width: 2.5; }
.alert--success .ok-check path { fill: none; stroke: var(--ok, #22C55E); stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
html:not(.m-off) .alert--success .ok-check circle { stroke-dasharray: 76; stroke-dashoffset: 76; animation: drawLine .5s ease forwards; }
html:not(.m-off) .alert--success .ok-check path { stroke-dasharray: 22; stroke-dashoffset: 22; animation: drawLine .35s ease .45s forwards; }
@keyframes moodPop { from { opacity: 0; transform: scale(.3) rotate(-12deg); } to { opacity: 1; transform: none; } }
@keyframes moodRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes moodGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes rutiFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes rutiHop { 0%, 70%, 100% { transform: translateY(0) rotate(0); } 78% { transform: translateY(-7px) rotate(-2deg); } 86% { transform: translateY(0) rotate(1deg); } }
@keyframes mailDrop { from { opacity: 0; transform: translateY(-24px) scale(.7); } to { opacity: 1; transform: none; } }
@keyframes mailWiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-8deg); } 90% { transform: rotate(6deg); } 95% { transform: rotate(-3deg); } }
@keyframes drawLine { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
    .mood-cal__face, .mood-pick__btn, .brief__face, .mood-bars__bar > i, .brief__part, .brief__logo, .auth__icon--mail svg { animation: none !important; }
}

/* RUTI's mood faces (line icons, tinted per mood) */
.mface { width: 1em; height: 1em; display: block; }
.mface--happy { color: #8BC34A; } .mface--tired { color: #E0A82E; } .mface--stressed { color: #F0803C; } .mface--sad { color: #38BDF8; }
.mface--worried { color: #F5C451; } .mface--angry { color: #F43F5E; } .mface--lonely { color: #A78BFA; } .mface--pain { color: #E36C4A; }
.mood-pick__btn .mface { font-size: 34px; } .brief__face .mface { font-size: 30px; margin: auto; } .mood-title-ico .mface { font-size: 30px; }
.mood-cal__face .mface { font-size: clamp(16px, 5vw, 26px); }
.mood-cal__day.has-mood { padding-top: 10px; } .mood-bars__face .mface { font-size: 24px; }
.brief__face { display: grid; place-items: center; }

/* 1.69.0: in Arabic, a left-to-right cell (numbers, codes, «<20») keeps its column's alignment – it used to drift to the
   left, away from its heading, so figures looked like they sat under the wrong column */
html[dir="rtl"] td[dir="ltr"], html[dir="rtl"] th[dir="ltr"] { text-align: right; }
html[dir="rtl"] td[dir="ltr"].is-center, html[dir="rtl"] th[dir="ltr"].is-center { text-align: center; }

/* 1.71.0: a live government alert on the home screen */
.ga-banner { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 16px; margin: 0 0 12px; background: linear-gradient(135deg, #DC2626, #EA580C); color: #fff; text-decoration: none; box-shadow: 0 10px 24px rgba(220, 38, 38, .3); }
.ga-banner b { display: block; font-size: 14.5px; } .ga-banner small { color: #FFE4E6; font-size: 12.5px; } .ga-banner__ic { font-size: 24px; } .ga-banner__go { margin-inline-start: auto; font-weight: 900; }
.ga-banner__ic svg, .ga-card h2 svg { width: 24px; height: 24px; flex: none; } .ga-rel summary svg { width: 18px; height: 18px; vertical-align: -3px; }

/* 1.72.0 – the live RUTI logo (Home and the loading screen): a silent video drawn on a canvas whose black is made transparent.
   It plays, rests 5 s on the glowing mark, and plays again. The video itself stays invisible. */
.ruti-live { position: relative; display: block; aspect-ratio: 640 / 334; }
.ruti-live canvas { display: block; width: 100%; height: 100%; }
.ruti-live video { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; inset-inline-start: 0; top: 0; }
.brief__live { width: 176px; margin: var(--space-1) 0 var(--space-3); pointer-events: none; }
:root[data-theme="light"] .brief__live canvas { filter: drop-shadow(0 1px 1px rgba(15, 23, 42, .25)); }
