:root {
    --paper: #f6f5f1;
    --ink: #1f1e1a;
    --mute: #6b6a63;
    --card: #fff;
    --line: #e2e0d8;
    --ember: #c9622b;
    --ember-soft: #f3ddc9;
}

* {
    box-sizing: border-box;
}

[x-cloak] {
    display: none !important;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--paper);
    color: var(--ink);
    padding-bottom: calc(56px + env(safe-area-inset-bottom));
}

main {
    padding: 12px;
    max-width: 480px;
    margin: 0 auto;
}

h1 {
    font-size: 1.4rem;
    margin: 8px 4px 16px;
}

@media (min-width: 600px) {
    main {
        max-width: 640px;
    }
}

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    display: flex;
    background: #fff;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.1);
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav__item {
    flex: 1;
    text-align: center;
    padding: 14px 4px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: #a8a496;
}

.bottom-nav__item--active {
    color: #1f1e1a;
}

/* User menu */

.user-menu {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top));
    right: 12px;
    /* above the detail top bars (12), below the ingredient modal (100) */
    z-index: 20;
}

.user-menu__button {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
    cursor: pointer;
}

.user-menu__button:focus-visible {
    outline: 3px solid rgba(201, 98, 43, 0.35);
    outline-offset: 2px;
}

.user-menu__panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    padding: 12px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 16px 40px -16px rgba(31, 30, 26, 0.35);
}

.user-menu__label {
    margin: 0 4px;
    font-size: 0.75rem;
    color: var(--mute);
}

.user-menu__name {
    margin: 2px 4px 10px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu__logout {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 10px;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: left;
    color: #9a3f12;
    background: var(--paper);
    cursor: pointer;
}

.user-menu__logout:hover,
.user-menu__logout:focus-visible {
    background: var(--ember-soft);
    outline: none;
}

/* Login */

.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
    background:
        radial-gradient(circle at 15% 0%, var(--ember-soft) 0, transparent 45%),
        radial-gradient(circle at 100% 100%, #ece6d8 0, transparent 50%),
        var(--paper);
}

.login {
    width: 100%;
    max-width: 380px;
    padding: 0;
    animation: login-rise 0.4s ease-out both;
}

@keyframes login-rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .login { animation: none; }
}

.login__brand {
    text-align: center;
    margin-bottom: 28px;
}

.login__logo {
    display: block;
    margin: 0 auto 14px;
    border-radius: 18px;
    box-shadow: 0 10px 24px -8px rgba(201, 98, 43, 0.55);
}

.login__title {
    margin: 0;
    font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
    font-size: 2.2rem;
    letter-spacing: -0.02em;
}

.login__tagline {
    margin: 6px 0 0;
    font-size: 0.95rem;
    color: var(--mute);
}

.login-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px 20px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 16px 40px -20px rgba(31, 30, 26, 0.25);
}

.login-card__alert {
    margin: 0;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    color: var(--ink);
    background: var(--paper);
}

.login-card__alert--error {
    color: #9a3f12;
    background: var(--ember-soft);
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-field__label {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--mute);
}

.login-field__wrap {
    position: relative;
}

.login-field__input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    /* 16px keeps iOS Safari from zooming in on focus */
    font-size: 1rem;
    color: var(--ink);
    background: var(--paper);
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.login-field__input:focus {
    outline: none;
    border-color: var(--ember);
    background: var(--card);
    box-shadow: 0 0 0 4px rgba(201, 98, 43, 0.15);
}

.login-field__input--with-toggle {
    padding-right: 64px;
}

.login-field__toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    padding: 6px 10px;
    border: none;
    border-radius: 8px;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--mute);
    background: transparent;
    cursor: pointer;
}

.login-field__toggle:hover,
.login-field__toggle:focus-visible {
    color: var(--ink);
    background: var(--line);
    outline: none;
}

.login-card__submit {
    margin-top: 4px;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(180deg, #d4703a, var(--ember));
    box-shadow: 0 8px 18px -8px rgba(201, 98, 43, 0.7);
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.15s, opacity 0.15s;
}

.login-card__submit:hover {
    box-shadow: 0 10px 22px -8px rgba(201, 98, 43, 0.8);
}

.login-card__submit:active {
    transform: translateY(1px);
}

.login-card__submit:focus-visible {
    outline: 3px solid rgba(201, 98, 43, 0.35);
    outline-offset: 2px;
}

.login-card__submit:disabled {
    opacity: 0.7;
    cursor: progress;
}

/* Recipe list */

.top-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--paper);
    padding-top: 12px;
    margin-top: -12px;
}

.search-input {
    display: block;
    width: 100%;
    margin: 0 0 12px;
    padding: 10px 14px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.search-input:focus {
    outline: 2px solid #a8a496;
}

.recipe-list__empty,
.recipe-list__loader {
    text-align: center;
    padding: 24px 12px;
    color: #6b6a63;
}

.recipe-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recipe-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #fff;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.recipe-card__row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.recipe-card__image {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: #e2e0d8;
}

.variant-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    min-width: 0;
    flex: 1;
}

.variant-carousel::-webkit-scrollbar {
    display: none;
}

.variant-carousel__slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
    width: 100%;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.variant-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.variant-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #e2e0d8;
}

.variant-dot--active {
    background: #1f1e1a;
}

.variant-carousel__slide:active {
    opacity: 0.7;
}

.variant-carousel__name {
    margin: 0 0 4px;
    font-size: 0.9rem;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.variant-carousel__kcal {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1f1e1a;
}

.variant-carousel__diet-kcal {
    margin: 2px 0 0;
    font-size: 0.8rem;
    color: #a8a496;
}

@media (min-width: 600px) {
    .recipe-card__image {
        width: 88px;
        height: 88px;
    }
}

/* Recipe detail */

.recipe-detail {
    padding: 0;
    max-width: none;
}

@media (min-width: 600px) {
    .recipe-detail {
        max-width: 640px;
        margin-left: auto;
        margin-right: auto;
    }
}

.detail-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 12;
    display: flex;
    align-items: center;
    gap: 10px;
    /* right side leaves room for the fixed user menu button */
    padding: calc(8px + env(safe-area-inset-top)) 56px 20px 10px;
    background: linear-gradient(to bottom, var(--paper) 0%, var(--paper) 62%, rgba(246, 245, 241, 0.82) 82%, rgba(246, 245, 241, 0) 100%);
}

.detail-topbar__back,
.detail-topbar__edit {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: none;
    border-radius: 10px;
    background: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.detail-topbar__back {
    color: var(--ink);
}

.detail-topbar__edit {
    color: var(--ember);
}

.detail-topbar__title {
    margin: 0;
    flex: 1;
    min-width: 0;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-circle {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top));
    z-index: 11;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: var(--ink);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.detail-circle--back {
    left: 12px;
}

.detail-circle--edit {
    right: 56px;
    color: var(--ember);
}

.recipe-hero__image {
    display: block;
    width: 100%;
    height: 300px;
    object-fit: cover;
    background: var(--line);
}

.recipe-sheet {
    position: relative;
    background: var(--paper);
    border-radius: 28px 28px 0 0;
    margin-top: -40px;
    padding: 30px 18px 24px;
    box-shadow: 0 -2px 14px rgba(31, 30, 26, 0.06);
}

.detail-sheet__title {
    margin: 0 0 10px;
    font-size: 1.6rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
    font-weight: 700;
    text-align: center;
    text-wrap: balance;
}

.detail-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 0 20px;
    font-size: 0.78rem;
    color: #a8a496;
}

.recipe-detail h2 {
    font-size: 1rem;
    margin: 24px 0 8px;
}

.detail-summary {
    background: var(--card);
    border-radius: 20px;
    padding: 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.detail-summary__row {
    display: flex;
    align-items: center;
    gap: 18px;
}

.kcal-ring {
    position: relative;
    flex-shrink: 0;
    width: 92px;
    height: 92px;
}

.kcal-ring__svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.kcal-ring__track,
.kcal-ring__fill {
    fill: none;
    stroke-width: 9;
}

.kcal-ring__track {
    stroke: var(--line);
}

.kcal-ring__fill {
    stroke: var(--ember);
    stroke-linecap: round;
    stroke-dasharray: 264;
    stroke-dashoffset: calc(264 - (264 * var(--percent, 0) / 100));
}

.kcal-ring__label {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
}

.kcal-ring__value {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
}

.kcal-ring__unit {
    font-size: 0.65rem;
    color: var(--mute);
}

.detail-summary__macros {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.detail-summary__macro-row {
    display: grid;
    grid-template-columns: 46px 1fr 74px;
    align-items: center;
    gap: 8px;
}

.detail-summary__macro-label {
    font-size: 0.75rem;
    color: var(--mute);
}

.detail-summary__macro-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--ember);
}

.detail-summary__macro-value {
    text-align: right;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.8rem;
    font-weight: 700;
}

.detail-summary__caption {
    margin: 15px 0 0;
    font-size: 0.78rem;
    color: #a8a496;
    text-align: center;
}

.ingredient-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ingredient-list__item {
    background: var(--card);
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.ingredient-list__row {
    display: grid;
    grid-template-columns: 1fr auto 22px;
    align-items: center;
    gap: 10px;
    padding: 13px 14px;
}

.ingredient-list__row--toggle {
    cursor: pointer;
}

.ingredient-list__name {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ingredient-list__weight {
    flex-shrink: 0;
    color: var(--mute);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.8rem;
    white-space: nowrap;
}

.ingredient-list__alt-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a8a496;
    background: var(--paper);
    transition: transform 0.22s ease, background 0.2s ease, color 0.2s ease;
}

.ingredient-list__alt-icon--open {
    color: var(--ember);
    background: var(--ember-soft);
    transform: rotate(180deg);
}

.ingredient-list__alts {
    margin: 0 14px 14px;
    background: var(--paper);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.ingredient-list__alt-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.ingredient-list__alt-name {
    min-width: 0;
    font-size: 0.84rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ingredient-list__alt-weight {
    flex-shrink: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.78rem;
    color: #a8a496;
}

.instruction-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.instruction-list__item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--card);
    border-radius: 10px;
    padding: 10px 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.instruction-list__index {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--ember-soft);
    color: var(--ember);
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

.instruction-list__text {
    line-height: 1.4;
}

.macro-row {
    display: flex;
    gap: 10px;
    margin: 0 0 10px;
}

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

.macro__value {
    font-size: 1.25rem;
    font-weight: 700;
    white-space: nowrap;
}

.macro__label {
    font-size: 0.78rem;
    color: var(--mute);
    white-space: nowrap;
}

.ingredient-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(31, 30, 26, 0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 12px;
    z-index: 100;
}

.ingredient-modal {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: var(--card);
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
    padding: 20px;
}

.ingredient-modal h2 {
    margin: 0 0 16px;
    font-size: 1.15rem;
    padding-right: 24px;
}

.ingredient-modal .macro-row:last-of-type {
    margin-bottom: 0;
}

.ingredient-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    padding: 0;
    color: var(--mute);
    cursor: pointer;
    line-height: 0;
}

/* Recipe edit */

.edit-screen {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.edit-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: calc(-12px - env(safe-area-inset-top));
    /* right side leaves room for the fixed user menu button */
    padding: calc(12px + env(safe-area-inset-top)) 44px 18px 0;
    background: linear-gradient(to bottom, var(--paper) 0%, var(--paper) 62%, rgba(246, 245, 241, 0.82) 82%, rgba(246, 245, 241, 0) 100%);
}

.edit-header__back {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink);
}

.edit-header__back:hover {
    background: #ece9e1;
}

.edit-header__name {
    margin: 0;
    flex: 1;
    min-width: 0;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.edit-header__reset {
    flex-shrink: 0;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ember);
    text-decoration: none;
}

.edit-header__reset:hover {
    background: var(--ember-soft);
}

.edit-summary {
    width: 100%;
    background: var(--card);
    border-radius: 18px;
    padding: 16px 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.edit-summary__kcal-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.edit-summary__kcal {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 2.6rem;
    font-weight: 700;
    line-height: 0.9;
    letter-spacing: -0.03em;
}

.edit-summary__kcal-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-bottom: 3px;
}

.edit-summary__kcal-was {
    font-size: 0.75rem;
    color: var(--mute);
}

.edit-summary__kcal-delta {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--mute);
}

.edit-summary__macros {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-top: 16px;
}

.edit-summary__macro-row {
    display: grid;
    grid-template-columns: 52px 1fr 82px;
    align-items: center;
    gap: 10px;
}

.edit-summary__macro-label {
    font-size: 0.75rem;
    color: var(--mute);
}

.edit-summary__macro-value {
    text-align: right;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.8rem;
    font-weight: 700;
}

.stat-old {
    color: var(--mute);
    font-weight: 400;
    font-size: 0.8em;
}

.over {
    color: var(--ember);
}

.under {
    color: #3a7d44;
}

.edit-ingredients__label {
    margin: 0 0 8px;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #a8a496;
}

.ingredient-list__grid {
    display: grid;
    grid-template-columns: 1fr 64px 60px 12px 30px;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
}

.ingredient-list__delta {
    text-align: right;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.75rem;
    font-weight: 700;
}

.ingredient-list__item.htmx-request {
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 150ms ease;
}

.macro__bar-track {
    position: relative;
    margin-top: 6px;
    width: 100%;
    height: 4px;
    border-radius: 999px;
    background: var(--line);
}

.macro__bar-fill {
    height: 100%;
    border-radius: 999px;
    background: #3a7d44;
    transition: width 0.2s ease, background 0.2s ease;
}

.macro__bar-fill--over {
    background: var(--ember);
}

.macro__bar-marker {
    position: absolute;
    top: -2px;
    left: 50%;
    width: 2px;
    height: 8px;
    background: var(--mute);
    opacity: 0.5;
}

.ingredient-list__weight-input {
    width: 100%;
    padding: 7px 8px;
    border: none;
    border-radius: 8px;
    background: var(--paper);
    color: var(--ink);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.875rem;
    font-weight: 700;
    text-align: right;
}

.ingredient-list__weight-unit {
    color: var(--mute);
    font-size: 0.75rem;
}

.ingredient-list__toggle-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ember-soft);
    color: var(--ember);
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
}

.ingredient-list__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 12px 10px;
}

.ingredient-chip {
    border: none;
    border-radius: 999px;
    padding: 7px 12px;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    background: #f0eee7;
    color: var(--mute);
}

.ingredient-chip--active {
    background: var(--ink);
    color: var(--paper);
}

.ingredient-chip--disabled {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--mute);
    cursor: default;
    opacity: 0.6;
}

.edit-save-bar {
    position: sticky;
    bottom: calc(56px + env(safe-area-inset-bottom));
    background: var(--paper);
    padding: 10px 0 4px;
    margin-top: 4px;
    box-shadow: 0 -10px 20px rgba(246, 245, 241, 0.95);
}

.save-btn {
    display: block;
    width: 100%;
    margin: 0;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: var(--ember);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}
