/* Aidelnicek — M1 CSS základ */

:root {
    --color-primary: #2d6a4f;
    --color-primary-light: #40916c;
    --color-primary-dark: #1b4332;
    --color-text: #212529;
    --color-text-muted: #6c757d;
    --color-bg: #f8f9fa;
    --color-white: #ffffff;
    --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --spacing: 1rem;
    --radius: 0.5rem;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.5;
    color: var(--color-text);
    background: var(--color-bg);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing);
}

/* Header */
.site-header {
    background: var(--color-primary);
    color: var(--color-white);
    padding: var(--spacing) 0;
    box-shadow: var(--shadow);
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    line-height: 0;
    text-decoration: none;
}

.logo__img {
    display: block;
    height: 2.25rem;
    width: auto;
    max-width: min(12.5rem, 55vw);
    object-fit: contain;
    object-position: left center;
}

.logo:hover .logo__img {
    opacity: 0.92;
}

.landing-title {
    margin: 0 0 1rem;
    line-height: 0;
}

.landing-title__img {
    display: block;
    height: 3rem;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    object-position: left center;
}

.main-nav {
    display: flex;
    gap: 1.5rem;
}

.main-nav a {
    color: var(--color-white);
    text-decoration: none;
}

.main-nav a:hover {
    text-decoration: underline;
}

/* Main content */
.site-main {
    flex: 1;
    padding: 2rem 0;
}

/* Footer */
.site-footer {
    background: var(--color-primary-dark);
    color: var(--color-white);
    padding: var(--spacing) 0;
    text-align: center;
}

.site-footer p {
    margin: 0;
    font-size: 0.875rem;
}

.site-footer__version {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    opacity: 0.85;
}

/* Dashboard */
.dashboard h1 {
    margin-top: 0;
    color: var(--color-primary-dark);
}

.dashboard .lead {
    font-size: 1.25rem;
    color: var(--color-text-muted);
}

/* Auth forms */
.auth-form {
    max-width: 400px;
    margin: 2rem auto;
}

.auth-form h1 {
    margin-top: 0;
    color: var(--color-primary-dark);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: var(--radius);
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.25);
}

.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 1rem;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

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

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

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.alert-success {
    background: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

.alert-error {
    background: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
    list-style: none;
    padding-left: 1rem;
}

.alert-error li {
    margin: 0.25rem 0;
}

.form-error {
    display: block;
    color: #842029;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-help {
    display: block;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Profile form */
.profile-form {
    max-width: 500px;
}

.profile-form .form-group select,
.profile-form .form-group textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
}

.profile-form .form-group input:disabled {
    background: #e9ecef;
    cursor: not-allowed;
}

.profile-form h2 {
    margin: 2rem 0 1rem;
    font-size: 1.25rem;
    color: var(--color-primary-dark);
}

.password-change-form {
    margin-top: 0.5rem;
}

/* Password toggle */
.password-toggle {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.password-toggle input {
    flex: 1;
}

.password-toggle-btn {
    padding: 0.5rem 0.75rem;
    background: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1rem;
}

.password-toggle-btn:hover {
    background: #dee2e6;
}

.form-group-checkbox label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.form-group-checkbox input[type="checkbox"] {
    width: auto;
}

/* Nav */
.nav-user {
    color: rgba(255, 255, 255, 0.9);
}

.nav-llm-jobs {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.12rem 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    color: var(--color-white);
    font-size: 0.82rem;
    background: rgba(255, 255, 255, 0.08);
}

.nav-llm-jobs__count {
    display: inline-block;
    min-width: 1.4rem;
    text-align: center;
    font-weight: 700;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.25);
    padding: 0.02rem 0.35rem;
    line-height: 1.2;
}

.nav-llm-jobs.is-active {
    border-color: rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.2);
}

.nav-logout {
    display: inline;
}

.btn-link {
    background: none;
    border: none;
    color: var(--color-white);
    text-decoration: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
}

.btn-link:hover {
    text-decoration: underline;
}

/* ── M3: Jídelníček ──────────────────────────────────────────────────────── */

/* Buttons — secondary + small variants */
.btn-secondary {
    background: #e9ecef;
    color: var(--color-text);
    border: 1px solid #dee2e6;
}
.btn-secondary:hover {
    background: #dee2e6;
}
.btn-sm {
    padding: 0.3rem 0.75rem;
    font-size: 0.875rem;
}

/* Badge */
.badge-current {
    display: inline-block;
    background: var(--color-primary-light);
    color: var(--color-white);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 1rem;
    vertical-align: middle;
    margin-left: 0.5rem;
}

/* ── Plan nav (day strip) ─────────────────────────────────────────────────── */
.plan-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.plan-nav__days {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.plan-nav__day {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--color-text);
    font-size: 0.8rem;
    border: 1px solid transparent;
    transition: background 0.15s;
}
.plan-nav__day:hover {
    background: #e9ecef;
}
.plan-nav__day.is-today {
    border-color: var(--color-primary-light);
    color: var(--color-primary-dark);
    font-weight: 600;
}
.plan-nav__day.is-active {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}
.plan-nav__day.is-active:hover {
    background: var(--color-primary-light);
}
.plan-nav__day-short {
    font-weight: 700;
}
.plan-nav__day-date {
    font-size: 0.7rem;
    opacity: 0.85;
}

.plan-nav__week-link {
    color: var(--color-primary);
    font-size: 0.875rem;
    white-space: nowrap;
}

.plan-nav__week-step {
    flex-shrink: 0;
    min-width: 2.25rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* ── Plan heading ─────────────────────────────────────────────────────────── */
.plan-heading {
    margin: 0 0 1.25rem;
    color: var(--color-primary-dark);
    font-size: 1.5rem;
}
.plan-heading__date {
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-text-muted);
    margin-left: 0.5rem;
}

.day-plan__header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.plan-share-actions,
.plan-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

/* ── Meal cards ───────────────────────────────────────────────────────────── */
.meal-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.meal-card {
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.meal-card__header {
    background: var(--color-primary-dark);
    color: var(--color-white);
    font-weight: 600;
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
}

.meal-card__header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
}

.meal-card__swap-wrap {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.meal-card__header .meal-card__swap-btn {
    background: rgba(255, 255, 255, 0.2);
    color: var(--color-white);
    border-color: rgba(255, 255, 255, 0.5);
}

.meal-card__header .meal-card__swap-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.7);
}

.meal-alternatives {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0;
    align-items: start;
}

@media (max-width: 600px) {
    .meal-alternatives {
        grid-template-columns: 1fr;
    }

    .meal-card__header-row {
        flex-direction: column;
        align-items: flex-start;
    }

}

/* ── Collapsed variant / expand button ────────────────────────────────────── */
.alt-option--collapsed.meal-slot-collapsed {
    padding: 0.5rem 1rem;
    border: 1px dashed #dee2e6;
    background: #f8f9fa;
}

.alt-expand-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    padding: 0.4rem 0;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.alt-expand-btn:hover {
    color: var(--color-primary);
}

.alt-expand-btn__icon {
    transition: transform 0.2s;
}

.alt-option--collapsed[data-collapsed="false"] .alt-expand-btn__icon {
    transform: rotate(180deg);
}

.alt-option__collapsed-content {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e9ecef;
}

.alt-option__collapsed-inner {
    padding: 0.5rem 0;
}

.alt-ingredients__more {
    font-style: italic;
    list-style: none;
}

/* ── Compact day plan overview (no inline detail, links to meal detail) ───── */
.meal-cards--compact .meal-alternatives--compact {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 0.5rem 0;
}

.meal-slot-summary {
    padding: 0.5rem 1rem;
}

.meal-slot-summary__link {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 0.25rem 0;
}

.meal-slot-summary__link:hover {
    color: var(--color-primary);
}

.meal-slot-summary .eaten-mark {
    margin-left: 0.35rem;
    color: var(--color-text-muted);
}

/* ── Meal detail (dedicated view for single meal slot) ──────────────────────── */
.meal-detail {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.meal-detail__header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.meal-detail__back {
    display: inline-block;
}

.meal-detail__heading {
    margin: 0;
}

.meal-detail__heading.plan-heading {
    font-size: 1.5rem;
}

.meal-detail__date {
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-text-muted);
    margin-left: 0.5rem;
}

.meal-detail__content {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

.meal-detail__content > * {
    flex: 1 1 320px;
    min-width: 0;
}

.meal-detail__card {
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem 1.25rem;
}

.meal-detail__primary .meal-detail__card {
    border: 2px solid var(--color-primary);
}

.meal-detail__secondary .meal-detail__card {
    border: 1px dashed #dee2e6;
    background: #f8f9fa;
}

/* ── Meal slot detail (chosen meal + others + aggregated) ─────────────────── */
.meal-slot-detail__sections {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.75rem;
}

.meal-slot-detail__heading {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 0.35rem;
}

.meal-slot-detail__other-variant {
    margin-bottom: 0.5rem;
}

.meal-slot-detail__other-user {
    font-weight: 600;
    color: var(--color-primary-dark);
}

.meal-slot-detail__other-meal {
    margin-left: 0.35rem;
}

.alt-ingredients--compact {
    margin-top: 0.25rem;
    margin-left: 0.5rem;
}

.meal-slot-summary__ingredients {
    margin-top: 0.35rem;
    margin-left: 0;
}

.meal-slot-detail__aggregated ul {
    font-weight: 500;
}

/* ── Alternative option ───────────────────────────────────────────────────── */
.alt-option {
    padding: 0.85rem 1rem;
    border: 2px solid transparent;
    border-radius: 0;
    transition: background 0.15s, border-color 0.15s;
    position: relative;
}

.alt-option + .alt-option {
    border-left: 1px solid #e9ecef;
}

@media (max-width: 600px) {
    .alt-option + .alt-option {
        border-left: none;
        border-top: 1px solid #e9ecef;
    }
}

.alt-option.is-chosen {
    background: #d1fae5;
    border-color: var(--color-primary);
}

.alt-option.is-eaten .alt-name {
    text-decoration: line-through;
    color: var(--color-text-muted);
}

.alt-option__header {
    margin-bottom: 0.35rem;
}

.alt-choose-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
}

.alt-choose-actions--chosen .alt-choose-btn--me {
    opacity: 0.9;
}

.alt-choose-btn {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    font-size: 1rem;
    color: inherit;
}

.alt-choose-btn.btn {
    display: inline-block;
    width: auto;
    text-align: center;
    padding: 0.25rem 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.3rem;
    background: var(--color-surface);
    font-size: 0.8rem;
}

.alt-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    background: #e9ecef;
    color: var(--color-text-muted);
    padding: 0.1rem 0.4rem;
    border-radius: 0.3rem;
    margin-bottom: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.is-chosen .alt-badge {
    background: var(--color-primary);
    color: var(--color-white);
}

.alt-name {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.alt-desc {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin: 0 0 0.4rem;
    line-height: 1.4;
}

.alt-ingredients {
    list-style: none;
    padding: 0;
    margin: 0 0 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.alt-ingredients li {
    font-size: 0.75rem;
    background: #f1f3f5;
    padding: 0.1rem 0.4rem;
    border-radius: 0.3rem;
    color: var(--color-text-muted);
}

.alt-household-pref {
    margin: 0 0 0.45rem;
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

.alt-household-pref__label {
    margin-right: 0.35rem;
    font-weight: 600;
}

.alt-household-pref__users {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.alt-household-pref__user {
    display: inline-block;
    background: #eef2f7;
    border-radius: 999px;
    padding: 0.08rem 0.42rem;
    color: #4b5563;
}

/* ── Meal recipe panel ─────────────────────────────────────────────────────── */
.meal-recipe-btn {
    margin-top: 0.35rem;
}

.meal-recipe-panel {
    margin-top: 0.5rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 0.6rem 0.75rem;
}

.meal-recipe-meta {
    margin: 0 0 0.35rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.meal-recipe-text {
    margin: 0;
    white-space: pre-wrap;
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--color-text);
}

.meal-recipe-open-tab {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--color-primary);
}

.meal-recipe-open-tab:hover {
    text-decoration: underline;
}

/* ── Recipe view (standalone page) ────────────────────────────────────────── */
.recipe-view {
    max-width: 720px;
}

.recipe-view__title {
    margin: 0 0 0.75rem;
    font-size: 1.5rem;
}

.recipe-view__back {
    margin-bottom: 1rem;
}

.recipe-view__text {
    margin: 1rem 0 0;
    white-space: pre-wrap;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.55;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: var(--radius);
}

.is-shared-page .site-header .container {
    align-items: center;
}

.shared-page-badge {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: var(--color-white);
    font-size: 0.85rem;
    font-weight: 600;
}

.shared-plan {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.shared-plan__hero {
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.shared-plan__eyebrow {
    margin: 0 0 0.4rem;
    color: var(--color-primary);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.shared-plan__meta,
.shared-plan__expires {
    margin: 0.35rem 0 0;
    color: var(--color-text-muted);
}

.shared-plan__separator {
    margin: 0 0.4rem;
}

.shared-plan__actions,
.shared-plan__footer {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.meal-card--shared .meal-card__shared-body {
    padding: 1rem;
}

.meal-card__shared-title {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    color: var(--color-primary-dark);
}

.week-table--shared .week-table__cell-link--shared {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.week-table__recipe-link {
    color: var(--color-primary);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
}

.week-table__recipe-link:hover {
    text-decoration: underline;
}

/* ── Eaten checkbox ───────────────────────────────────────────────────────── */
.eaten-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-primary-dark);
    font-weight: 500;
    user-select: none;
}

.eaten-checkbox__input {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.eaten-mark {
    color: var(--color-primary);
    font-weight: 700;
    margin-left: 0.25rem;
}

/* ── Week plan ────────────────────────────────────────────────────────────── */
.week-plan__header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.week-plan__header .plan-heading {
    margin: 0;
    flex: 1;
}

.week-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.week-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    min-width: 560px;
}

.week-table th,
.week-table td {
    padding: 0.5rem 0.6rem;
    border: 1px solid #e9ecef;
    vertical-align: middle;
}

.week-table thead th {
    background: var(--color-primary-dark);
    color: var(--color-white);
    text-align: center;
    font-weight: 600;
}

.week-table thead th.today {
    background: var(--color-primary-light);
}

.week-table__meal-col {
    width: 120px;
}

.week-table__meal-label {
    background: #f8f9fa;
    font-weight: 600;
    color: var(--color-primary-dark);
    white-space: nowrap;
}

.week-table tbody td {
    text-align: center;
}

.week-table tbody td.today {
    background: #f0fdf4;
}

.week-table__day-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    color: inherit;
    text-decoration: none;
}
.week-table__day-link:hover {
    text-decoration: underline;
}
.week-table__day-short {
    font-weight: 700;
}
.week-table__day-date {
    font-size: 0.7rem;
    opacity: 0.8;
}

.week-table__cell-link {
    display: block;
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.8rem;
    line-height: 1.3;
}
.week-table__cell-link:hover {
    color: var(--color-primary);
    text-decoration: underline;
}
.week-table__cell-link.is-eaten {
    text-decoration: line-through;
    color: var(--color-text-muted);
}

.week-table__empty {
    color: #adb5bd;
}

.week-plan__footer {
    margin-top: 1.25rem;
    display: flex;
    gap: 0.75rem;
}

/* ── Dashboard meal list ──────────────────────────────────────────────────── */
.dashboard-today {
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.dashboard-today__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.dashboard-today__header h2 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--color-primary-dark);
}

.dashboard-today__day {
    font-weight: 400;
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.dashboard-meal-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.dashboard-meal-list__item {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.95rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid #f1f3f5;
}

.dashboard-meal-list__item:last-child {
    border-bottom: none;
}

.dashboard-meal-list__item.is-eaten .dashboard-meal-list__name {
    text-decoration: line-through;
    color: var(--color-text-muted);
}

.dashboard-meal-list__type {
    min-width: 150px;
    font-weight: 600;
    color: var(--color-primary-dark);
    font-size: 0.875rem;
}

.dashboard-meal-list__name {
    flex: 1;
    color: var(--color-text);
}

.dashboard-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ── M4: Nákupní seznam ───────────────────────────────────────────────────── */

/* Dashboard shopping widget */
.dashboard-shopping {
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    margin-top: 1.5rem;
}

.dashboard-shopping__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.dashboard-shopping__header h2 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--color-primary-dark);
}

.dashboard-shopping__count {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.dashboard-shopping__count strong {
    color: var(--color-primary-dark);
    font-size: 1.15rem;
}

/* Shopping page header */
.shopping-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.shopping-header__title h1 {
    margin: 0 0 0.25rem;
    color: var(--color-primary-dark);
}

.shopping-week-label {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.shopping-export-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.shopping-header__actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    padding-top: 0.25rem;
}

/* Progress bar */
.shopping-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.shopping-progress__bar {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.shopping-progress__fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.shopping-progress__label {
    white-space: nowrap;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    min-width: 110px;
    text-align: right;
}

/* Filter tabs */
.shopping-filter {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 1.25rem;
}

.shopping-filter__tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--color-text-muted);
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
    font-family: inherit;
}

.shopping-filter__tab:hover {
    color: var(--color-text);
}

.shopping-filter__tab.is-active {
    color: var(--color-primary-dark);
    border-bottom-color: var(--color-primary);
    font-weight: 600;
}

/* Category heading */
.shopping-category {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    margin: 1.25rem 0 0.4rem;
}

.shopping-category-group:first-child .shopping-category {
    margin-top: 0;
}

/* Shopping list */
.shopping-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Shopping item */
.shopping-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid #f1f3f5;
}

.shopping-item:last-child {
    border-bottom: none;
}

.shopping-item__check {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #ced4da;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s, border-color 0.15s;
}

.shopping-item__check:hover {
    border-color: var(--color-primary);
}

.shopping-item.is-purchased .shopping-item__check {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.check-icon {
    width: 13px;
    height: 13px;
    stroke: var(--color-white);
    opacity: 0;
    transition: opacity 0.15s;
}

.shopping-item.is-purchased .check-icon {
    opacity: 1;
}

.shopping-item__name {
    flex: 1;
    font-size: 0.95rem;
    transition: color 0.15s, text-decoration 0.15s;
}

.shopping-item.is-purchased .shopping-item__name {
    text-decoration: line-through;
    color: #adb5bd;
}

.shopping-item__qty {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.shopping-item__remove {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #adb5bd;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.15rem;
    opacity: 0;
    transition: color 0.15s, opacity 0.15s;
}

.shopping-item:hover .shopping-item__remove {
    opacity: 1;
}

.shopping-item__remove:hover {
    color: #dc3545;
}

/* Touch devices: always show remove button */
@media (hover: none) {
    .shopping-item__remove {
        opacity: 1;
    }
}

/* Add item form */
.shopping-add-form {
    margin-top: 2rem;
    border-top: 1px solid #e9ecef;
    padding-top: 1.25rem;
}

.shopping-add-form h2 {
    font-size: 1rem;
    color: var(--color-primary-dark);
    margin: 0 0 0.75rem;
}

.shopping-add-form__inner {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.shopping-add-input {
    flex: 2;
    min-width: 140px;
    height: 36px;
    padding: 0 0.65rem;
    border: 1px solid #dee2e6;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
}

.shopping-add-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.2);
}

.shopping-add-qty {
    width: 90px;
    height: 36px;
    padding: 0 0.65rem;
    border: 1px solid #dee2e6;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
}

.shopping-add-qty:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.2);
}

.shopping-add-unit {
    width: 90px;
    height: 36px;
    padding: 0 0.65rem;
    border: 1px solid #dee2e6;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
}

.shopping-add-unit:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.2);
}

.shopping-add-cat {
    flex: 1.5;
    min-width: 130px;
    height: 36px;
    padding: 0 0.65rem;
    border: 1px solid #dee2e6;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--color-white);
}

.shopping-add-cat:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.2);
}

/* Empty state */
.shopping-empty {
    padding: 2rem 0 1rem;
    color: var(--color-text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.shopping-empty a {
    color: var(--color-primary);
}

/* Error page */
.error-page {
    text-align: center;
    padding: 3rem 0;
}

.error-page h1 {
    font-size: 4rem;
    color: var(--color-primary);
    margin: 0 0 0.5rem;
}

.error-page .btn {
    margin-top: 1rem;
    background: var(--color-primary);
    color: var(--color-white);
}

.week-plan__footer {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* ── Admin sekce ─────────────────────────────────────────────────────────────── */

.nav-admin {
    font-weight: 600;
    color: var(--color-white) !important;
}

.admin-dashboard h1 {
    margin-bottom: 1.5rem;
}

.admin-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.admin-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.admin-card h2 {
    font-size: 1.1rem;
    margin: 0;
}

.admin-card p {
    color: var(--color-text-muted, #666);
    font-size: 0.9rem;
    margin: 0;
    flex: 1;
}

.admin-card .btn {
    align-self: flex-start;
    margin-top: 0.5rem;
}

.info-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.3rem 1rem;
    font-size: 0.875rem;
    margin: 0;
}

.info-list dt {
    font-weight: 600;
    color: var(--color-text-muted, #666);
}

.info-list dd {
    margin: 0;
    word-break: break-all;
}

/* ── Admin — sdílené prvky ─────────────────────────────────────────────────── */

.admin-page-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.admin-page-header h1 {
    margin: 0;
    flex: 1;
}

.btn-sm {
    padding: 0.25rem 0.625rem;
    font-size: 0.85rem;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
    border-color: #dc3545;
}

.btn-danger:hover {
    background: #b02a37;
    border-color: #b02a37;
}

.inline-form {
    display: inline;
    margin: 0;
}

.text-muted {
    color: var(--color-text-muted, #6c757d);
}

.text-center {
    text-align: center;
}

/* ── Admin — prohlížeč tabulek ─────────────────────────────────────────────── */

.admin-table-browser {
    max-width: 100%;
}

.table-select-form {
    margin-bottom: 1.5rem;
}

.form-row--inline {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-row--inline .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 200px;
}

.table-meta {
    font-size: 0.9rem;
    color: var(--color-text-muted, #6c757d);
    margin-bottom: 0.75rem;
}

.table-container {
    overflow-x: auto;
    border: 1px solid var(--color-border, #dee2e6);
    border-radius: var(--radius);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th,
.data-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--color-border, #dee2e6);
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-table thead th {
    background: var(--color-bg, #f8f9fa);
    font-weight: 600;
    position: sticky;
    top: 0;
}

.data-table tbody tr:hover {
    background: #f0f4f8;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.col-actions {
    white-space: nowrap;
    width: 1%;
}

.col-actions .btn {
    margin-right: 0.25rem;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.pagination__info {
    font-size: 0.875rem;
    color: var(--color-text-muted, #6c757d);
}

/* ── Modální okno ──────────────────────────────────────────────────────────── */

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal[hidden] {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: var(--color-white);
    border-radius: var(--radius);
    padding: 1.5rem;
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.modal-content h2 {
    margin: 0 0 1rem;
    font-size: 1.1rem;
}

.edit-fields .form-group {
    margin-bottom: 0.75rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

/* ── Swap meal modal — výběr jídla k výměně ─────────────────────────────────── */

.swap-meal-modal__content {
    max-width: 480px;
}

.swap-meal-modal__title {
    margin: 0 0 0.25rem;
    font-size: 1.25rem;
}

.swap-meal-modal__subtitle {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.swap-meal-modal__scope {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.03);
    border-radius: var(--radius);
}

.swap-meal-modal__scope-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.swap-meal-modal__scope-label {
    font-size: 0.9rem;
    font-weight: 500;
}

.swap-meal-modal__scope-hint {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    line-height: 1.35;
}

.swap-meal-modal__list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 50vh;
    overflow-y: auto;
}

.swap-meal-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: var(--radius);
    background: var(--color-white);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.swap-meal-option:hover {
    border-color: var(--color-primary-light);
    background: rgba(45, 106, 79, 0.04);
}

.swap-meal-option__day {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-primary);
    background: rgba(45, 106, 79, 0.12);
    padding: 0.15rem 0.5rem;
    border-radius: 0.25rem;
    margin-bottom: 0.35rem;
}

.swap-meal-option__name {
    display: block;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.swap-meal-option__desc {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin: 0 0 0.5rem;
    line-height: 1.4;
}

.swap-meal-option__ingredients {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin: 0;
    padding-left: 1.25rem;
}

.swap-meal-option__ingredients li {
    margin-bottom: 0.15rem;
}

.meal-card__swap-btn {
    font-size: 0.85rem;
}

/* ── Admin — profil: řádek s výškou a váhou ─────────────────────────────────── */

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ── Admin — SQL konzole ───────────────────────────────────────────────────── */

.sql-console {
    max-width: 100%;
}

.sql-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    align-items: start;
}

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

.sql-textarea {
    width: 100%;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875rem;
    resize: vertical;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--color-border, #dee2e6);
    border-radius: var(--radius);
    background: #1e1e1e;
    color: #d4d4d4;
    line-height: 1.5;
}

.sql-textarea:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 1px;
}

.sql-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.sql-status {
    font-size: 0.875rem;
    color: var(--color-text-muted, #6c757d);
}

.sql-status--ok {
    color: #2d6a4f;
}

.sql-status--error {
    color: #dc3545;
}

.sql-results {
    margin-top: 1.25rem;
}

.sql-results-meta {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.sql-success {
    color: #2d6a4f;
    font-weight: 600;
}

.sql-error {
    color: #dc3545;
    font-weight: 600;
    word-break: break-all;
}

/* SQL sidebar — historie */

.sql-sidebar {
    background: var(--color-white);
    border: 1px solid var(--color-border, #dee2e6);
    border-radius: var(--radius);
    padding: 1rem;
}

.sql-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.sql-history-header h2 {
    font-size: 1rem;
    margin: 0;
}

.sql-history-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 480px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sql-history-empty {
    font-size: 0.875rem;
    color: var(--color-text-muted, #6c757d);
    padding: 0.25rem 0;
}

.sql-history-btn {
    width: 100%;
    text-align: left;
    background: none;
    border: 1px solid transparent;
    border-radius: calc(var(--radius) / 2);
    padding: 0.375rem 0.5rem;
    font-size: 0.8rem;
    font-family: 'Courier New', Courier, monospace;
    color: var(--color-text);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.sql-history-btn:hover {
    background: var(--color-bg, #f8f9fa);
    border-color: var(--color-border, #dee2e6);
}

/* ── LLM test ──────────────────────────────────────────────────────────────── */

.llm-test-page {
    max-width: 1100px;
}

.llm-test-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.llm-textarea {
    width: 100%;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: var(--radius);
    resize: vertical;
    line-height: 1.5;
    color: var(--color-text);
    background: var(--color-white);
    transition: border-color 0.15s;
}

.llm-textarea:focus {
    outline: none;
    border-color: var(--color-primary-light);
    box-shadow: 0 0 0 3px rgba(64, 145, 108, 0.15);
}

.llm-textarea--system {
    min-height: 130px;
}

.llm-textarea--user {
    min-height: 110px;
}

.llm-options-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.llm-options-row .form-group {
    flex: 1;
    min-width: 140px;
}

.llm-number-input {
    width: 100%;
}

.llm-test-toolbar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

.llm-response-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.llm-response-header h2 {
    margin: 0;
}

.llm-response-meta {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.llm-response-text {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875rem;
    background: #f6f8fa;
    border: 1px solid #e1e4e8;
    border-radius: var(--radius);
    padding: 1rem;
    margin: 0;
    max-height: 600px;
    overflow-y: auto;
    line-height: 1.6;
}

.required-mark {
    color: #dc3545;
}

/* ── LLM logy ──────────────────────────────────────────────────────────────── */

.llm-logs-page {
    max-width: 1400px;
}

.llm-logs-empty {
    margin-top: 1rem;
}

.alert-info {
    background: #e8f4fd;
    border: 1px solid #bee5fb;
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    color: #0c5460;
}

.llm-logs-selector {
    margin-bottom: 1.5rem;
}

.llm-logs-form-row {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.llm-logs-form-row .form-group {
    flex: 1;
    min-width: 200px;
    max-width: 320px;
    margin-bottom: 0;
}

.llm-logs-btn-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.1rem;
}

.llm-logs-results-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.llm-logs-results-header h2 {
    margin: 0;
}

.llm-logs-count {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.llm-logs-table {
    font-size: 0.8rem;
}

.llm-logs-table td {
    max-width: 280px;
    vertical-align: top;
    word-break: break-word;
}

.llm-logs-expand-btn {
    background: none;
    border: none;
    color: var(--color-primary-light);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0;
    text-decoration: underline;
}

.llm-logs-expand-btn:hover {
    color: var(--color-primary-dark);
}

.llm-status-badge {
    display: inline-block;
    padding: 0.2em 0.55em;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.llm-status-badge--ok {
    background: #d4edda;
    color: #155724;
}

.llm-status-badge--error {
    background: #f8d7da;
    color: #721c24;
}

.llm-logs-hint {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin: 0 0 0.5rem;
}

.llm-log-row {
    cursor: pointer;
    transition: background 0.1s;
}

.llm-log-row:hover {
    background: #f0f4ff;
}

.llm-log-row--active {
    background: #dce8ff !important;
    outline: 2px solid var(--color-primary-light);
    outline-offset: -2px;
}

.llm-cell-preview {
    color: var(--color-text-muted);
    font-style: italic;
    font-size: 0.78rem;
}

.llm-logs-detail {
    margin-top: 1.5rem;
    border: 1px solid var(--color-border, #dee2e6);
    border-radius: var(--radius);
    background: #fafbfc;
    padding: 1.25rem 1.5rem 1.5rem;
}

.llm-logs-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.llm-logs-detail-header h3 {
    margin: 0;
    font-size: 1rem;
}

.llm-logs-detail-id {
    color: var(--color-text-muted);
    font-weight: normal;
}

.llm-logs-detail-sections {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.llm-logs-detail-section h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin: 0 0 0.4rem;
}

.llm-logs-detail-code {
    margin: 0;
    padding: 0.75rem 1rem;
    background: #1e1e2e;
    color: #cdd6f4;
    border-radius: var(--radius);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.82rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
    max-height: 420px;
    overflow-y: auto;
}

/* ── Responsivní navigace ────────────────────────────────────────────────────── */

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: auto;
    flex-shrink: 0;
}

.nav-toggle__bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-white);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ── Responsivní breakpointy ────────────────────────────────────────────────── */

@media (max-width: 768px) {
    /* Day plan — nav days and week link full width on narrow screens */
    .plan-nav {
        flex-direction: column;
        align-items: stretch;
    }

    .plan-nav__days {
        width: 100%;
    }

    .plan-nav__day {
        flex: 1 1 0;
        min-width: 0;
    }

    .plan-nav__week-link {
        text-align: center;
        padding: 0.5rem 0;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
    }

    .plan-nav__week-step {
        align-self: center;
    }

    /* Hamburger button */
    .nav-toggle {
        display: flex;
    }

    /* Animate to X when open */
    .nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }
    .nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Header — logo + hamburger on first row, nav wraps below */
    .site-header .container {
        flex-wrap: wrap;
        align-items: center;
    }

    /* Nav hidden by default, shown with .is-open */
    .main-nav {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 0;
        padding: 0.5rem 0 0.75rem;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        margin-top: 0.5rem;
    }

    .main-nav.is-open {
        display: flex;
    }

    .main-nav a,
    .main-nav .btn-link {
        padding: 0.65rem 0;
        display: block;
        font-size: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .nav-user {
        display: block;
        padding: 0.65rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        font-weight: 500;
        font-size: 0.9rem;
        opacity: 0.75;
    }

    .nav-llm-jobs {
        width: 100%;
        justify-content: flex-start;
        border: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 0;
        background: none;
        padding: 0.65rem 0;
        font-size: 1rem;
    }

    .nav-logout {
        display: block;
    }

    /* Main content spacing */
    .site-main {
        padding: 1.25rem 0;
    }

    /* Typography scale */
    h1 {
        font-size: 1.5rem;
    }

    /* Dashboard meal list — wrap label above name */
    .dashboard-meal-list__type {
        min-width: unset;
        width: 100%;
        font-size: 0.8rem;
        margin-bottom: 0.05rem;
    }

    .dashboard-meal-list__item {
        flex-wrap: wrap;
        gap: 0.15rem;
    }

    /* Shopping header — stack vertically */
    .shopping-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .shopping-header__actions {
        padding-top: 0;
    }

    /* Shopping progress bar label */
    .shopping-progress {
        flex-wrap: wrap;
    }

    .shopping-progress__label {
        min-width: unset;
        width: 100%;
        text-align: left;
    }

    /* Shopping add form — stack inputs */
    .shopping-add-form__inner {
        flex-direction: column;
    }

    .shopping-add-input,
    .shopping-add-qty,
    .shopping-add-unit,
    .shopping-add-cat {
        width: 100%;
        flex: none;
        min-width: unset;
    }

    /* Week plan footer */
    .week-plan__footer {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Dashboard actions */
    .dashboard-actions {
        flex-direction: column;
    }

    .dashboard-actions .btn {
        width: 100%;
        text-align: center;
    }

    /* Auth form — full width with some margin */
    .auth-form {
        margin: 1rem auto;
    }
}

@media (max-width: 480px) {
    /* Reduce container horizontal padding */
    .container {
        padding: 0 0.75rem;
    }

    /* Smaller heading on tiny screens */
    h1 {
        font-size: 1.35rem;
    }

    /* Plan nav day buttons — smaller */
    .plan-nav__day {
        padding: 0.35rem 0.45rem;
        font-size: 0.75rem;
    }

    .plan-nav__day-date {
        font-size: 0.65rem;
    }
}
