/* Receptenboek - mobile first design system. Colours match RecipeBookTheme. */
:root {
    --rb-bg: #FBF6EE;
    --rb-surface: #FFFFFF;
    --rb-text: #2B211B;
    --rb-muted: #6F5F53;
    --rb-border: #EADFD0;
    --rb-chip: #F3E6D6;
    --rb-primary: #B5472B;
    --rb-primary-dark: #8A3620;
    --rb-green: #4F7556;
    --rb-gold: #D9A441;
    --rb-heading: 'Fraunces', Georgia, serif;
    --rb-nav-height: 76px;
}

html, body {
    margin: 0;
    background: var(--rb-bg);
    color: var(--rb-text);
    font-family: 'DM Sans', Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

h1:focus { outline: none; }

/* Mud inputs grow to fill a flex column by default, which stretches forms on a phone. */
.mud-stack > .mud-input-control { flex-grow: 0; }

.rb-boot { padding: 40px 20px; color: var(--rb-muted); text-align: center; }
.rb-loading { min-height: 60vh; }

/* ---------- Shell ---------- */
.rb-shell.mud-container {
    min-height: 100dvh;
    padding: 0;
    background: var(--rb-bg);
    position: relative;
}
.rb-shell--with-nav.mud-container {
    padding-bottom: calc(var(--rb-nav-height) + 16px + env(safe-area-inset-bottom));
}
.rb-shell--with-action-bar.mud-container {
    padding-bottom: calc(110px + env(safe-area-inset-bottom));
}

.rb-page { padding: 20px 20px 0; }
.rb-page--flush { padding-top: 0; }
.rb-section { padding: 0 20px; }
.rb-muted, .mud-typography.rb-muted { color: var(--rb-muted); }

.rb-title.mud-typography { font-size: 30px; line-height: 1.1; letter-spacing: -0.5px; margin: 0; }
.rb-h2.mud-typography { font-size: 19px; margin: 0; }
.rb-caption { font-size: 13px; color: var(--rb-muted); }

.rb-section-heading {
    padding: 22px 20px 8px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

/* ---------- Cards and rows ---------- */
.rb-card.mud-paper {
    background: var(--rb-surface);
    border: 1px solid var(--rb-border);
    border-radius: 16px;
    box-shadow: none;
}
.rb-card--padded.mud-paper { padding: 16px; }

.rb-row-card.mud-paper {
    background: var(--rb-surface);
    border: 1px solid var(--rb-border);
    border-radius: 16px;
    padding: 12px 14px;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    box-shadow: none;
    text-decoration: none;
    color: inherit;
}
.rb-row-card__title { font-weight: 700; font-size: 16px; }
.rb-row-card__sub { font-size: 13px; color: var(--rb-muted); margin-top: 2px; }

.rb-list { display: flex; flex-direction: column; gap: 8px; padding: 0 20px; }

/* ---------- Buttons, chips, inputs ---------- */
.rb-btn.mud-button-root {
    height: 48px;
    border-radius: 14px;
    text-transform: none;
    font-weight: 700;
    font-size: 15px;
    box-shadow: none;
}
.rb-btn--large.mud-button-root { height: 52px; font-size: 16px; }
.rb-btn--cook.mud-button-root { height: 60px; border-radius: 16px; font-size: 18px; }
.rb-btn--outlined.mud-button-root { border: 1.5px solid var(--rb-primary); color: var(--rb-primary-dark); background: #fff; }
.rb-btn--ghost.mud-button-root { border: 1px solid var(--rb-border); color: var(--rb-text); background: #fff; font-weight: 500; }

.rb-icon-btn.mud-icon-button { width: 44px; height: 44px; }
.rb-icon-btn--circle.mud-icon-button {
    border: 1px solid var(--rb-border);
    background: #fff;
    border-radius: 50%;
}

.rb-chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 20px 0; scrollbar-width: none; }
.rb-chips::-webkit-scrollbar { display: none; }
.rb-chip.mud-chip {
    height: 36px;
    border-radius: 18px;
    padding: 0 16px;
    margin: 0;
    background: var(--rb-chip);
    color: var(--rb-text);
    font-size: 14px;
    flex: none;
}
.rb-chip--active.mud-chip {
    background: var(--rb-primary);
    color: #fff;
    font-weight: 500;
}
.rb-tag.mud-chip {
    height: auto;
    padding: 4px 10px;
    border-radius: 12px;
    background: var(--rb-chip);
    color: #6B2C1B;
    font-size: 12px;
    font-weight: 500;
    margin: 0;
}

.rb-search .mud-input-control { margin: 0; }
.rb-search .mud-input-outlined-border { border-color: var(--rb-border); }
.rb-search .mud-input { background: #fff; border-radius: 14px; }

.rb-avatar.mud-avatar {
    width: 44px;
    height: 44px;
    background: var(--rb-chip);
    color: var(--rb-primary-dark);
    font-weight: 700;
}

.rb-fab.mud-fab {
    position: fixed;
    right: max(20px, calc(50% - 280px));
    bottom: calc(var(--rb-nav-height) + 16px + env(safe-area-inset-bottom));
    width: 56px;
    height: 56px;
    border-radius: 18px;
    box-shadow: 0 6px 16px rgba(181, 71, 43, 0.35);
    z-index: 1000;
}

/* ---------- Bottom navigation and action bars ---------- */
.rb-bottom-nav.mud-paper {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    background: #fff;
    border-top: 1px solid var(--rb-border);
    padding-bottom: env(safe-area-inset-bottom);
}
.rb-bottom-nav__row { height: var(--rb-nav-height); padding: 0 8px 6px; }
.rb-nav-item.mud-link {
    width: 82px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 12px;
    font-weight: 500;
    color: var(--rb-muted) !important;
}
.rb-nav-item .mud-icon-root { color: inherit; }
.rb-nav-item--active.mud-link {
    background: var(--rb-chip);
    color: var(--rb-primary-dark) !important;
    font-weight: 700;
}

.rb-action-bar.mud-paper {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    background: #fff;
    border-top: 1px solid var(--rb-border);
    padding: 12px 20px calc(16px + env(safe-area-inset-bottom));
}
.rb-action-bar--above-nav.mud-paper { bottom: calc(var(--rb-nav-height) + env(safe-area-inset-bottom)); background: var(--rb-bg); border-top: 0; padding: 10px 20px; }

/* ---------- Progress segments ---------- */
.rb-segments { display: flex; gap: 4px; }
.rb-segment { flex: 1; height: 6px; border-radius: 3px; background: var(--rb-border); }
.rb-segment--done { background: var(--rb-primary); }
.rb-progress.mud-progress-linear { height: 6px; border-radius: 3px; background: var(--rb-border); }

/* ---------- Segmented control (ingredients / steps) ---------- */
.rb-segmented {
    margin: 16px 20px 0;
    height: 48px;
    background: var(--rb-chip);
    border-radius: 14px;
    padding: 4px;
    display: flex;
}
.rb-segmented__item.mud-button-root {
    flex: 1;
    height: 40px;
    border-radius: 10px;
    text-transform: none;
    font-size: 15px;
    font-weight: 500;
    color: var(--rb-muted);
}
.rb-segmented__item--active.mud-button-root {
    background: #fff;
    color: var(--rb-primary-dark);
    font-weight: 700;
}

/* ---------- Ready-to-cook card ---------- */
.rb-ready.mud-paper {
    background: var(--rb-green);
    color: #fff;
    border-radius: 18px;
    padding: 16px;
    box-shadow: none;
}
.rb-ready__label { font-size: 12px; font-weight: 500; letter-spacing: 0.4px; display: flex; align-items: center; gap: 6px; }
.rb-ready__title.mud-typography { font-family: var(--rb-heading); font-weight: 600; font-size: 22px; margin-top: 6px; color: #fff; }
.rb-ready__sub { font-size: 13px; margin-top: 2px; opacity: 0.95; }
.rb-ready .rb-btn--light.mud-button-root { background: #fff; color: #2F4F35; }
.rb-ready .rb-btn--light-outline.mud-button-root { border: 1.5px solid #fff; color: #fff; font-weight: 500; font-size: 14px; }

/* ---------- Recipe page ---------- */
.rb-amount-row { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--rb-border); }
.rb-amount-row:last-child { border-bottom: 0; }
.rb-amount { min-width: 64px; font-weight: 700; flex: none; white-space: nowrap; }
.rb-servings-value { width: 32px; text-align: center; font-size: 20px; font-weight: 700; }

.rb-step { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rb-border); line-height: 1.5; }
.rb-step:last-child { border-bottom: 0; }
.rb-step__number {
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: 14px;
    background: var(--rb-chip);
    color: var(--rb-primary-dark);
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Cook mode ---------- */
.rb-timer-card.mud-paper {
    margin: 14px 20px 0;
    background: var(--rb-green);
    color: #fff;
    border-radius: 16px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: none;
}
.rb-timer-card__name { font-size: 12px; font-weight: 500; }
.rb-timer-card__time { font-size: 26px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.rb-step-card.mud-paper {
    margin: 16px 20px 0;
    background: #fff;
    border: 1px solid var(--rb-border);
    border-radius: 20px;
    padding: 24px 20px;
    min-height: 230px;
    box-shadow: none;
}
.rb-step-card__text { font-size: 26px; line-height: 1.35; font-weight: 500; letter-spacing: -0.2px; }
.rb-step-card__text b { color: var(--rb-primary); }
.rb-next-hint { margin: 12px 24px 0; font-size: 14px; color: var(--rb-muted); line-height: 1.4; }

/* ---------- Planner ---------- */
.rb-week-nav.mud-paper {
    margin: 12px 20px 0;
    height: 52px;
    background: #fff;
    border: 1px solid var(--rb-border);
    border-radius: 16px;
    display: flex;
    align-items: center;
    padding: 0 4px;
    box-shadow: none;
}
.rb-day.mud-paper {
    height: 64px;
    background: #fff;
    border: 1px solid var(--rb-border);
    border-radius: 16px;
    padding: 0 8px 0 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: none;
}
.rb-day--today.mud-paper { border: 1.5px solid var(--rb-primary); }
.rb-day--empty.mud-paper { background: transparent; border: 1.5px dashed #D9C7B2; }
.rb-day__date {
    width: 44px;
    text-align: center;
    background: var(--rb-chip);
    color: #6B2C1B;
    border-radius: 12px;
    padding: 4px 0;
    flex: none;
}
.rb-day--today .rb-day__date { background: var(--rb-primary); color: #fff; }
.rb-day__name { font-size: 11px; font-weight: 500; }
.rb-day__number { font-size: 18px; font-weight: 700; line-height: 1.1; }
.rb-day__title { flex: 1; min-width: 0; font-weight: 700; font-size: 15px; cursor: pointer; }
.rb-persons-btn.mud-button-root {
    height: 44px;
    padding: 0 10px;
    border-radius: 12px;
    border: 1px solid var(--rb-border);
    background: var(--rb-bg);
    color: var(--rb-text);
    font-size: 14px;
    font-weight: 700;
    min-width: 0;
}
.rb-pick-btn.mud-button-root {
    flex: 1;
    justify-content: flex-start;
    height: 44px;
    font-size: 15px;
    font-weight: 500;
    color: var(--rb-primary-dark);
}

/* ---------- Shopping list ---------- */
.rb-checklist.mud-paper {
    margin: 8px 20px 0;
    background: #fff;
    border: 1px solid var(--rb-border);
    border-radius: 16px;
    padding: 0 14px;
    box-shadow: none;
}
.rb-checklist--done.mud-paper { background: #F6EEE2; }
.rb-check-row { display: flex; align-items: center; gap: 12px; min-height: 52px; border-bottom: 1px solid var(--rb-border); cursor: pointer; }
.rb-check-row:last-child { border-bottom: 0; }
.rb-check-box {
    width: 26px;
    height: 26px;
    border: 2px solid var(--rb-primary);
    border-radius: 8px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.rb-check-box--checked { background: var(--rb-green); border-color: var(--rb-green); }
.rb-check-name { flex: 1; font-size: 16px; font-weight: 500; }
.rb-check-amount { font-size: 14px; color: var(--rb-muted); }
.rb-check-row--done { min-height: 48px; }
.rb-check-row--done .rb-check-name { font-size: 15px; color: var(--rb-muted); text-decoration: line-through; font-weight: 400; }
.rb-check-row--done .rb-check-amount { font-size: 13px; }

/* ---------- Wizard / editors ---------- */
.rb-wizard-heading.mud-typography { font-size: 28px; margin: 4px 0 0; letter-spacing: -0.5px; }
.rb-field-row { display: flex; gap: 8px; align-items: flex-start; }
.rb-field-row .rb-qty { width: 64px; flex: none; }
.rb-field-row .rb-unit { width: 84px; flex: none; }
.rb-field-row .rb-name { flex: 1; min-width: 0; }

/* ---------- Login ---------- */
.rb-login { min-height: 100dvh; justify-content: center; padding: 24px 24px 48px; }
.rb-login__title.mud-typography { font-size: 36px; letter-spacing: -0.5px; }

/* ---------- Misc ---------- */
#blazor-error-ui {
    background: #fff3cd;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 2000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

/* ---------- Spacers and small helpers ---------- */
.rb-bottom-spacer { height: calc(100px + env(safe-area-inset-bottom)); }
.rb-bottom-spacer--tall { height: calc(170px + env(safe-area-inset-bottom)); }
.rb-check-name--done { color: var(--rb-muted); text-decoration: line-through; }
.mx-5 { margin-left: 20px; margin-right: 20px; }

/* Compact ingredient rows in the wizard */
.rb-field-row .rb-qty { width: 60px; }
.rb-field-row > .mud-select { flex: none; width: 76px; }
.rb-field-row .rb-unit { width: 76px; }
.rb-field-row .rb-name { flex: 1 1 0; min-width: 0; }
.rb-field-row .rb-name .mud-select { width: 100%; }
.rb-field-row .mud-input-control { margin-top: 0; }
.rb-field-row .rb-name .mud-input-control { width: 100%; }
.rb-field-row .mud-select .mud-input-slot { padding-right: 24px; }
