:root {
    --bg: #0f1115;
    --paper: #f6f1e3;
    --paper2: #f0e7d5;
    --ink: #1b1f2a;
    --muted: #5a657a;
    --accent: #7c3aed;
    --shadow: 0 18px 50px rgba(0, 0, 0, .35);
    --radius: 18px;
    --gap: 14px;
    --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
}

body {
    margin: 0;
    background: radial-gradient(1200px 700px at 20% 20%, rgba(124, 58, 237, .25), transparent 55%),
        radial-gradient(900px 600px at 80% 70%, rgba(34, 197, 94, .12), transparent 60%),
        var(--bg);
    color: #e8e8ee;
    font-family: var(--sans);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.app {
    width: min(1650px, 100%);
    display: grid;
    grid-template-columns: 440px 1fr;
    gap: 18px;
}

.panel {
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.left {
    display: flex;
    flex-direction: column;
    min-height: 640px;
}

.left header {
    padding: 16px 16px 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.brand {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.brand h1 {
    font-size: 16px;
    margin: 0;
    letter-spacing: .2px;
}

.chip {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .14);
    color: rgba(255, 255, 255, .85);
    background: rgba(255, 255, 255, .06);
    font-family: var(--mono);
}

.searchRow {
    display: flex;
    gap: 10px;
}

input[type="search"] {
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(0, 0, 0, .18);
    color: #fff;
    outline: none;
}

.list {
    padding: 10px;
    overflow: auto;
    flex: 1;
}

.recipeBtn {
    width: 100%;
    text-align: left;
    padding: 12px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .03);
    color: rgba(255, 255, 255, .92);
    cursor: pointer;
    display: grid;
    gap: 4px;
    margin-bottom: 10px;
    transition: transform .08s ease, background .15s ease, border-color .15s ease;
}

.recipeBtn:hover {
    background: rgba(255, 255, 255, .07);
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, .14);
}

.recipeBtn[aria-current="true"] {
    background: rgba(124, 58, 237, .18);
    border-color: rgba(124, 58, 237, .35);
}

.recipeTitle {
    font-weight: 650;
    font-size: 14px;
    letter-spacing: .2px;
}

.recipeMeta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    color: rgba(255, 255, 255, .68);
    font-size: 12px;
}

.tag {
    font-family: var(--mono);
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(0, 0, 0, .18);
}

.right {
    padding: 0;
    min-height: 640px;
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.bookTop {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.bookTop .title {
    display: grid;
    gap: 2px;
}

.bookTop h2 {
    margin: 0;
    font-size: 16px;
    letter-spacing: .2px;
}

.bookTop .sub {
    margin: 0;
    font-size: 12px;
    color: rgba(255, 255, 255, .72);
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.btn,
#glowna {
    height: 50px;
    /* Zmniejszona, zgrabniejsza wysokość */
    padding: 0 20px;
    /* Odstępy po bokach */
    margin: 0;
    /* USUNIĘTO MARGINES: dzięki temu stoją w równej linii */
    border-radius: 15px;
    /* Identyczne zaokrąglenie */

    /* Wymuszamy wyśrodkowanie zawartości na środku */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;

    font-family: inherit;
    font-size: 14px;
    /* Ujednolicony rozmiar tekstu */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#glowna {
    background-color: #6d28d9; /* Wypełniony fioletowy kolor */
    border: 1px solid rgba(124, 58, 237, 0.5);
    color: #ffffff;
}

#glowna:hover {
    border-color: #8b5cf6;
    background-color: #7c3aed; /* Lekko jaśniejszy przy najechaniu */
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* --- UKŁAD TEKSTÓW W #GLOWNA (Bez zmian) --- */
#glowna strong {
    display: block;
    font-size: 16px;
    margin-bottom: 2px;
    color: #ffffff;
}

#glowna span {
    display: block;
    font-size: 11px;
    opacity: 0.7;
    color: #ffffff;
}

/* --- STYLE TYLKO DLA ZWYKŁYCH PRZYCISKÓW (.btn) --- */
.btn {
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .06);
    color: rgba(255, 255, 255, .9);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.btn.primary {
    border-color: rgba(124, 58, 237, .45);
    background: rgba(124, 58, 237, .22);
}

.btn.violet {
    border-color: rgb(124, 58, 237);
    background: rgba(105, 0, 196, 0.76);
}

.btn.green {
    border-color: rgb(248, 204, 11);
    background: rgba(248, 204, 11, 0.55);
}

.btn.pink {
    border-color: rgb(237, 58, 234);
    background: rgba(237, 58, 237, 0.66);
}

.bookPageWrap {
    padding: 18px;
    overflow: auto;
}

.book {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.page {
    background: linear-gradient(180deg, var(--paper), var(--paper2));
    color: var(--ink);
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .25);
    border: 1px solid rgba(0, 0, 0, .08);
    position: relative;
    overflow: hidden;
    min-height: 520px;
    padding: 18px 18px 56px 18px;
}

.page:before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(700px 220px at 10% 10%, rgba(124, 58, 237, .10), transparent 60%);
    pointer-events: none;
}

.page h3 {
    margin: 0 0 10px 0;
    font-size: 18px; /* Wspólny, duży rozmiar tytułu */
    letter-spacing: .2px;
    position: relative;
    z-index: 1;
}

.page .small {
    font-size: 14px; /* Wspólny rozmiar opisu pod tytułem */
    color: var(--muted);
    position: relative;
    z-index: 1;
    margin-bottom: 10px;
}

.page ul,
.page ol {
    padding-left: 18px;
    margin: 10px 0 0 0;
    position: relative;
    z-index: 1;
}

.page li {
    margin: 4px 0;
    line-height: 1.35;
    font-size: 16px; /* Złoty środek czytelności dla składników i kroków */
}

/* Styl dla podtytułów wewnątrz listy składników */
.page li.ingredient-subtitle {
    list-style: none;
    margin-left: -18px;
    font-weight: 700;
    color: var(--accent);
    margin-top: 15px;
    font-size: 14px; /* Mniejsze, ale wielkimi literami dla podtytułów składników */
    text-transform: uppercase;
}

/* Styl dla wytłuszczonych tytułów kroków */
.page ol li strong {
    display: block;
    /* Tytuł nad opisem kroku */
    font-weight: 700;
    margin-bottom: 2px;
}

/* Styl dla nagłówków sekcji w krokach (np. Przygotowanie wywaru) */
.step-section-header {
    margin: 20px 0 10px 0;
    font-size: 16px; /* Wspólny rozmiar nagłówków w krokach */
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding-bottom: 4px;
    display: block;
}

/* Resetujemy marginesy list, aby nagłówki dobrze przylegały */
.page ol {
    margin-top: 5px;
    padding-left: 22px;
}

.page ol li {
    margin-bottom: 12px;
}

.pageFooter {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: rgba(27, 31, 42, .65);
    font-family: var(--mono);
    font-size: 14px;
    z-index: 1;
}

.pageNo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sep {
    height: 1px;
    background: rgba(0, 0, 0, .10);
    margin: 12px 0;
    position: relative;
    z-index: 1;
}

.bookBottom {
    padding: 14px 16px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.hint {
    color: rgba(255, 255, 255, .75);
    font-size: 12px;
}

.kbd {
    font-family: var(--mono);
    padding: 2px 6px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(0, 0, 0, .18);
}

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

    .book {
        grid-template-columns: 1fr;
    }

    .left {
        min-height: auto;
    }

    .page {
        min-height: 420px;
    }
}

/* --- STYLE INTERFEJSU (LISTA I ROZDZIAŁY) --- */
.chapter {
    margin-bottom: 10px;
}

.chapterHeader {
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: rgba(0, 0, 0, 0.14);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
}

.recipeBtn {
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    border-radius: 8px;
}

.recipeBtn[aria-current="true"] {
    background: #7c3aed;
    color: white;
    font-weight: bold;
}

/* --- STYLE TREŚCI PRZEPISU --- */
.ingredient-subtitle {
    list-style: none;
    margin-left: -18px;
    color: #7c3aed;
    margin-top: 10px;
    font-weight: bold;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.step-section-header {
    color: #7c3aed;
    text-transform: uppercase;
    font-size: 13px;
    font-weight: 700;
    margin-top: 20px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(124, 58, 237, 0.2);
    padding-bottom: 4px;
}

.step-desc {
    display: block;
    color: #5a657a;
    font-size: 0.95em;
    margin-top: 2px;
}

.page ol li strong {
    display: block;
    margin-bottom: 2px;
    color: #1b1f2a;
}

/* --- ZDJĘCIE POLAROID Z GŁĘBIĄ --- */
.recipe-image-wrap {
    width: calc(100% - 20px);
    margin: 10px auto 20px auto;
    height: 280px;
    overflow: hidden;
    border: 8px solid white;
    box-shadow: 5px 8px 15px rgba(0, 0, 0, 0.3);
    transform: rotate(-1deg);
    background: #eee;
    position: relative;
}

.recipe-image-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.recipe-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: contrast(1.2) saturate(1.1) brightness(0.9) sepia(0.1);
}