

/* =========================
THEMES
========================= */

body.theme-cyber {
    --bg-main: #18191c;
    --bg-panel: transparent;
}

body.theme-cyber {
    --done-slider-bg: #333;

    --done-slider-checked-bg:
        rgba(0,229,255,0.18);
}

/* =========================
RESET & VARIABLES
========================= */
* { box-sizing: border-box; }

:root {

    /* Fonts */
    --font-body: 'Rajdhani', sans-serif;
    --font-heading: 'Orbitron', sans-serif;

    /* =========================
       BACKGROUNDS
    ========================= */

    --bg-main: #18191c;
    --bg-panel: #111214;

    /* =========================
       TEXT COLORS
    ========================= */

    --text-body: #e4edf2;
    --text-heading: #ffffff;

    --text-box: #b8f7ff;

    --text-muted: rgba(170, 240, 230, 0.52);

    /* =========================
       ACCENTS
    ========================= */

    /* MAIN CYAN */
    --accent-primary: #00e5ff;

    /* MINT ACCENT */
    --accent-secondary: #44ffcc;

    /* DANGER */
    --accent-danger: #ff4d6d;

    /* =========================
       SHADOWS
    ========================= */

    /* CYAN GLOW */
    --shadow-primary:
        0 0 8px rgba(0,229,255,0.22);

    /* MINT GLOW */
    --shadow-secondary:
        0 0 4px rgba(68,255,204,0.14);

    /* =========================
       SHOPPING
    ========================= */

    --done-slider-bg: #333;
}

/* =========================
THEMES
========================= */

body.theme-cyber {
    --bg-main: #18191c;
    --bg-panel: transparent;
}

body.theme-cyber {

    --done-slider-bg: #333;

    --done-slider-checked-bg:
        rgba(68,255,204,0.16);
}
    /* =========================
    BODY / APP
    ========================= */
body {

    margin: 0;

    background-color: var(--bg-main);

    background-image:
        radial-gradient(
            circle,
            rgba(255,255,255,0.022) 1px,
            transparent 1px
        );

    background-size: 3px 3px;

    color: var(--text-body);

    font-family: var(--font-body);
}

    .app {
        max-width: 900px;
        margin: 40px auto;
        padding: 20px;
    }

    /* =========================
    HEADINGS
    ========================= */
    h1, h2, h3 {
        color: var(--text-heading);
        font-family: var(--font-heading);
        text-align: center;
        letter-spacing: 1px;
        text-shadow:
            0 0 2px var(--accent-secondary),
            0 0 2px var(--accent-primary);
    }

    h1, h2 {
        color: #121212
    }

 

    h3::after {
    content: "";
    display: block;
    width: 52px;
    height: 2px;
    margin: 10px auto 0;
    background: linear-gradient(
        90deg,
        var(--accent-secondary),
        rgba(255,255,255,0.04)
    );
}
    /* =========================
    INPUTS / TEXTAREA / SELECT
    ========================= */
    input,
    textarea,
    select {
        width: 100%;
        padding: 10px;
        margin: 6px 0 14px;
        background: var(--bg-panel);
        color: var(--accent-primary);
        border: 1px solid var(--accent-secondary);
        border-radius: 6px;
        font-family: var(--font-body);
        font-size: 16px;
        box-shadow: var(--shadow-secondary);
    }

    input:focus,
    textarea:focus,
    select:focus {
        outline: none;
        border-color: var(--accent-primary);
        box-shadow: var(--shadow-primary);
    }

    input::placeholder,
    textarea::placeholder {
        color: var(--text-muted);
        font-weight: 400;
    }

    /* =========================
    BUTTONS
    ========================= */
    button {
        padding: 10px 18px;
        border-radius: 6px;
        border: none;
        cursor: pointer;
        font-family: var(--font-heading);
        font-weight: bold;
        transition: box-shadow 0.3s ease, background 0.3s ease, color 0.3s ease;
    }

    button.primary {
        background: linear-gradient(90deg, var(--accent-secondary), var(--accent-primary));
        color: #111;
    }

    button.secondary {
        background: transparent;
        border: 1px solid var(--accent-primary);
        color: var(--accent-primary);
    }

    button.danger {
        background: transparent;
        border: 1px solid var(--accent-danger);
        color: var(--accent-danger);
    }

    button:hover {
        box-shadow: var(--shadow-primary), var(--shadow-secondary);
    }

    button.danger:hover {
        box-shadow: 0 0 10px var(--accent-danger);
    }
    button.nav-tab {
        
    border: 1px solid transparent;
    
    }

    button.nav-tab:hover {
    box-shadow: 0 0 10px var(--accent-secondary);
    /*border: 1px solid var(--accent-secondary); */
    border: 1px solid transparent;

    color: var(--accent-primary);
    }

   

    /* =========================
    CONTROLS
    ========================= */
    .controls {
        display: block;
        width: 100%;
    }

    .controls input,
    .controls button {
        width: 100%;
    }

    #add-recipe-btn {
        width: 100%;
        margin-top: 10px;
    }

    /* =========================
    COLLAPSIBLE
    ========================= */
    .collapsible {
        background: var(--bg-panel);
        border: 1px solid var(--accent-secondary);
        color: var(--accent-primary);
        padding: 12px;
        font-size: 18px;
        border-radius: 8px;
        box-shadow: var(--shadow-secondary);
    }

    .collapsible::after { content: "+"; float: right; }
    .collapsible.active::after { content: "−"; }

    .content {
        display: none;
        margin-top: 15px;
        padding: 15px;
        background: var(--bg-panel);
        border-radius: 10px;
        border: 2px solid var(--accent-primary);
    }

    /* =========================
    DIVIDER
    ========================= */
    .divider {
        width: 100%;
        height: 1px;
        margin: 40px 0;
        background: linear-gradient(
            90deg,
            transparent,
            var(--accent-primary),
            var(--accent-secondary),
            transparent
        );
    }

    /* =========================
    RECIPE BOX
    ========================= */
   .recipe-box {
        padding: 18px;
        margin-bottom: 20px;
        border-radius: 12px;
        border: 1px solid var(--accent-primary);
        background: var(--bg-panel);
        color: var(--text-box);
        box-shadow: var(--shadow-primary), var(--shadow-secondary);
    }

 
.recipe-body {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.recipe-text {
    flex: 1;
}

.recipe-image-wrap {
    width: 190px;
    flex-shrink: 0;
}


.recipe-image {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: var(--shadow-image);
}





    .recipe-box h3 {
        color: #fff;

         
    }

    .recipe-box button {
        margin-top: 10px;
    }

    /* =========================
    INGREDIENTS
    ========================= */
    .ingredients-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-top: 10px;
    }

    .ingredient {
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 16px;
        line-height: 1.3;
        color: var(--text-box);
    }

    .ingredient input[type="checkbox"] {
        margin: 0;
        flex-shrink: 0;
        width: 16px;
        height: 16px;
    }

    .ingredient span {
        flex: 1;
        text-align: left;
    }

    /* =========================
    RECIPE ACTIONS
    ========================= */
    .recipe-actions {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-top: 8px;
        flex-wrap: nowrap; /*  kluczowe */
    }

    .visibility-switch .labels {
        display: flex;
        gap: 4px;
    }
    /* =========================
    VISIBILITY SWITCH
    ========================= */
    .visibility-switch {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        white-space: nowrap;
    }

    .visibility-switch .labels span {
        font-weight: 600;
        opacity: 0.3;
        color: var(--text-muted);
        transition: opacity 0.2s ease, color 0.2s ease;
    }

    .visibility-switch.disabled {
        opacity: 0.4;
        pointer-events: none;
    }

    .visibility-switch input {
        display: none;
    }

    /* slider */
    .visibility-switch .slider {
        position: relative;
        width: 52px;
        height: 26px;
        background: var(--bg-panel);
        border: 1px solid var(--accent-primary);
        border-radius: 20px;
        transition: background 0.3s ease;
    }

    .visibility-switch .slider::before {
        content: "";
        position: absolute;
        top: 3px;
        left: 3px;
        width: 18px;
        height: 18px;
        background: var(--accent-primary);
        border-radius: 50%;
        transition: transform 0.3s ease, background 0.3s ease;
    }

    /* checked */
    .visibility-switch input:checked + .slider::before {
        transform: translateX(24px);
        background: var(--accent-secondary);
    }

    /* labels */
    .visibility-switch .labels span {
        font-weight: 600;
        opacity: 0.4;
        transition: opacity 0.2s ease, color 0.2s ease;
    }



    .visibility-switch input:not(:checked) ~ .labels .private {
        opacity: 1;
        color: var(--accent-primary);
    }


    .visibility-switch input:checked ~ .labels .public {
        opacity: 1;
        color: var(--accent-secondary);
    }

    /* =========================
    MODALS
    ========================= */
    :root {
        --z-modal: 100;
        --z-toast: 200;
    }

    .modal {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(10,10,10,0.95);
        padding: 60px 20px;
        z-index: var(--z-modal);
    }


.modal.open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;

    margin: auto;
    background: var(--bg-panel);
    padding: 25px;
    border-radius: 12px;
    border: 2px solid var(--accent-primary);
    box-shadow: var(--shadow-secondary), var(--shadow-primary);
    color: var(--text-body);
}
body.modal-open {
    overflow: hidden;
}


    .modal-content img,
    .modal-content .recipe-image-preview {
    max-width: 100%;
    max-height: 260px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
    margin: 10px auto;
    box-shadow: var(--shadow-secondary);
}
    .close {
        float: right;
        font-size: 28px;
        cursor: pointer;
        color: var(--accent-secondary);
    }




    /* =========================
    CYBER CHECKBOX
    ========================= */

    body.theme-cyber .ingredient input[type="checkbox"] {
        appearance: none;
        -webkit-appearance: none;
        transform: scale(0.8);
        border-radius: 4px;
        border: 1px solid var(--accent-primary);
        background: var(--bg-panel);
        cursor: pointer;
        position: relative;
        box-shadow: 0 0 6px rgba(0,255,255,0.4);
        transition: all 0.2s ease;
    }



    /* checked background */

    body.theme-cyber .ingredient input[type="checkbox"]:checked {
        background: var(--accent-primary);
        box-shadow:
            0 0 5px var(--accent-primary),
    }

    /* checkmark */

    body.theme-cyber .ingredient input[type="checkbox"]:checked::after {
        content: "✓";
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;

        font-size: 32px;
        font-weight: 900;
        line-height: 1;

        color: #111;
    } 
    /* =========================
    TOASTS
    ========================= */
    .toast {
        position: fixed;
        bottom: 30px;
        right: 30px;
        min-width: 240px;
        padding: 14px 22px;
        border-radius: 10px;
        background: rgba(18,18,18,0.95);
        border: 1px solid var(--accent-primary);
        color: var(--accent-primary);
        box-shadow: var(--shadow-primary), var(--shadow-secondary);
        opacity: 0;
        pointer-events: none;
        transition: all 0.35s ease;
        z-index: var(--z-toast);
    }

    .toast.show {
        opacity: 1;
    }






    /* MODULE NAV */

    .module-nav {
        display: flex;
        gap: 10px;
    }

    .nav-tab {
        background: transparent;
        border: 1px solid var(--border-color);
        padding: 6px 14px;
        border-radius: 14px;
        cursor: pointer;
        color: var(--text-muted);
        transition: all 0.2s ease;
    }

    .nav-tab:hover {
        border-color: var(--accent-secondary);

    }

    .nav-tab.active {
        color:var(--accent-secondary);
        
    }


    /* SHOPPING LIST */

    .shopping-input {
        display: flex;
        gap: 10px;
        margin-bottom: 15px;
    }

    .shopping-input input {
        flex: 1;
    }

    .shopping-item {
        transition: transform 300ms ease, opacity 200ms ease;
        will-change: transform;
        display: flex;
        align-items: center;
        padding: 10px 14px;
        background: #121212;
        border-radius: 12px;
        margin-top: 8px;
        gap: 12px;

    }
    .shopping-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        border-bottom: 1px dashed var(--border-muted);
    }

    .qty-controls {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .qty-btn {
        min-width: 28px;
        height: 28px;
        border-radius: 6px;
        border: none;
        cursor: pointer;
        font-size: 16px;
        background: var(--accent-primary);
        color: #fff;
    }

    .qty-btn:hover {
        opacity: 0.85;
    }

    .qty {
        min-width: 20px;
        text-align: center;
        font-weight: 600;
    }

    .item-name {
        flex: 1;
    }

    .item-qty {
        min-width: 24px;
        text-align: center;
        font-weight: 600;
        color: var(--accent-primary);
    }

    .qty-controls {
        display: flex;
        gap: 6px;
    }

    .qty-btn {
        width: 26px;
        height: 26px;
        padding: 0;
        font-size: 16px;
        border-radius: 6px;
        background: transparent;
        border: 1px solid var(--accent-primary);
        color: var(--accent-primary);
    }

    .qty-btn:hover {
        background: var(--accent-primary);
        color: #111;
    }



    .shopping-item.done .qty-btn {
        pointer-events: none;
        opacity: 0.3;
    }

    .shopping-main {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .shopping-item.done {
        opacity: 0.45;
        background: var(--bg-muted);
    }

/* =========================
   DONE SWITCH (SHOPPING MODE)
   ========================= */

.done-switch {
    position: relative;
    width: 56px;
    height: 22px;
    flex-shrink: 0;
}

/* prawdziwy checkbox – ukryty wizualnie ale aktywny */
.done-switch input {
    position: absolute;
    inset: 0;
    opacity: 0;
    z-index: 2;
    cursor: pointer;
}

/* slider track */
.done-slider {
    position: absolute;
    inset: 0;
    background: var(--done-slider-bg);
    border-radius: 30px;
    transition: background 0.25s ease;
    z-index: 1;
}

/* knob */
.done-slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    top: 2px;
    left: 2px;
    background: var(--accent-primary);
    border-radius: 50%;
    transition: transform 0.25s ease, background 0.25s ease;
}

/* checked state */
.done-switch input:checked + .done-slider {
    background: var(--done-slider-checked-bg);
}

.done-switch input:checked + .done-slider::before {
    transform: translateX(34px);
    background: var(--accent-secondary);
}




.user-label {
    font-size: 0.85rem;
    opacity: 0.85;
    margin-right: 8px;
    white-space: nowrap;
}

.secondary.small {
    padding: 6px 10px;
    font-size: 0.8rem;
}

.user-badge {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #2fffd8;
    color: #2fffd8;
    font-family: var(--font-heading, Orbitron, sans-serif);
    font-size: 0.8rem;
    text-shadow: 0 0 4px rgba(47,255,216,0.4);
    box-shadow: 0 0 10px rgba(47,255,216,0.4);
    white-space: nowrap;
}





.item-qty.bump {
  animation: bump 0.25s ease;
}

@keyframes bump {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); color: var(--accent-secondary); }
  100% { transform: scale(1); }
}




.user-badge.clickable {
    cursor: pointer;
    text-decoration: underline;
}


.image-preview-wrapper {
  position: relative;
  display: inline-block;
}

.recipe-image-preview {
  max-width: 100%;
  border-radius: 8px;
  transition: filter 0.3s ease;
}

.image-remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.6);
  color: white;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.image-preview-wrapper:hover .recipe-image-preview {
  filter: blur(2px) brightness(0.8);
}

.image-preview-wrapper:hover .image-remove-btn {
  opacity: 1;
}


.burger-item.danger {
  padding: 6px 10px;
  font-size: 0.8rem;
}


/* TOP BAR */

    .topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
        margin-bottom: 20px;
        position: relative;
    }

    .topbar-left {
        display: flex;
        align-items: center;
        gap: 20px;
    }

    .topbar-left h1 {
        margin: 0;
        font-size: 1.4rem;
    }
    .topbar-right {
        display: flex;
        align-items: center;
        gap: 10px;   /* odstęp user ↔ burger */
    }



/* === BURGER MENU === */


.burger-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;

    display: none;
    flex-direction: column;

    min-width: 180px;

    background-color: rgba(18,18,18,0.2);

    backdrop-filter: blur(6px);

    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--accent-secondary);


    box-shadow: var(--shadow-secondary), var(--shadow-primary);
    animation: burgerSlide .25s ease forwards;
    z-index: 999;
}

/* przyciski w menu */
.burger-menu button {
    display: block;
    width: 100%;
    margin-bottom: 8px;
}

/* ostatni bez marginesu */
.burger-menu button:last-child {
    margin-bottom: 0;
}

.burger-menu.open {
    display: flex;
}


@keyframes burgerSlide{
  from{
    opacity:0;
    transform: translateY(-10px);
  }
  to{
    opacity:1;
    transform: translateY(0);
  }
}

.burger-menu::after{
    content:"";
    position:absolute;
    inset:0;
    background: linear-gradient(
      to bottom,
      rgba(0,255,255,0.04) 1px,
      transparent 2px
    );
    pointer-events:none;
}

input[type="file"] {
    width: 100%;
    padding: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);

    background: var(--bg-panel);
    border: 1px dashed var(--accent-secondary);
    border-radius: 8px;

    cursor: pointer;
}

/* hover */
input[type="file"]:hover {
    border-color: var(--accent-primary);
}

/* focus */
input[type="file"]:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,255,255,0.25);
}

/* filename text */
input[type="file"]::file-selector-button {
    background: transparent;
    border: none;
    color: var(--accent-primary);
    font-family: var(--font-body);
    font-weight: 600;
    padding: 6px 10px;
    margin-right: 10px;
    cursor: pointer;
}

.burger-btn {
  color: var(--accent-primary);
  transition: color .2s ease;
}

.burger-btn.active {
  border-color: var(--accent-secondary); /* dopasowanie borderu */
}



@media (max-width: 700px) {

    /* ===== RECIPE LAYOUT ===== */

    .recipe-body {
        flex-direction: column;
    }

    .recipe-image-wrap {
        width: 100%;
    }

    /* ===== TOPBAR ===== */

    .topbar {
        flex-direction: row;
        align-items: center;
    }

    main.app {
        margin-top: 10px;
    }

    #shopping-module.shopping-active {
        padding-top: 0;
    }

    /* chowamy zakładki */
    .module-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;

        width: 100%;
        padding: 10px;
        background: var(--bg-panel);
        border: 1px solid var(--accent-secondary);
        border-radius: 10px;
        box-shadow: var(--shadow-primary), var(--shadow-secondary);
        z-index: 50;
        animation: burgerSlide .25s ease forwards;
    }

    body.shopping-active .topbar {
        display: none;
    }

    body.shopping-active #shopping-title, 
    body.shopping-active #shopping-input-box {
        opacity: 0;
        pointer-events: none;
        max-height: 0;
        margin-top: 0;
        margin-bottom: 0;
        overflow: hidden;
    }

    /* kiedy aktywne */
    .module-nav.open {
        display: flex;
        margin-top: 10px;
        flex-direction: column;
        gap: 8px;
        background: rgba(0, 0, 0, 0.35);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        padding: 10px;
        border-radius: 12px;
    }

    .theme-scandi .module-nav.open {
        background: rgba(255, 255, 255, 0.65);
        border: 1px solid rgba(0, 0, 0, 0.08);
    }

    .topbar-left h1 {
        font-size: 1.15rem;
        padding: 4px 8px;
        border: 1px solid var(--accent-secondary);
        border-radius: 8px;
        white-space: nowrap;
        box-shadow: var(--shadow-secondary);
        line-height: 1.2;
        height: 32px;

        display: flex;
        align-items: center;
    }    

    .user-badge,
    .burger-btn {
        height: 32px;
        padding: 0 8px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .burger-btn {
        min-width: 32px;
    }

    .recipe-actions {
        flex-direction: column;
        width: 100%;
    }

    .recipe-actions button {
        width: 100%;
    }

    body {
        overflow-x: hidden;
    }

    body.shopping-active button {
        margin-left: auto;
        display: flex;
    }


    /* ===== SHOPPING LIST – MOBILE UX BOOST ===== */

    /* Większy wiersz */
    .shopping-item {
        padding: 14px 16px;
        font-size: 1.05rem;
    }

    /* Nazwa produktu */
    .item-name {
        font-size: 1.05rem;
    }

    /* Ilość */
    .item-qty {
        font-size: 1.15rem;
        min-width: 30px;
    }

    /* Przyciski + / - */
    .qty-btn {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }

    /* Done switch – wygodniejszy palcem */
    .done-switch {
        width: 64px;
        height: 26px;
    }

    .done-slider::before {
        width: 22px;
        height: 22px;
        top: 2px;
        left: 2px;
    }

    .done-switch input:checked + .done-slider::before {
        transform: translateX(38px);
    }

        .recipe-header {
        position: relative;
        display: block;
        padding-top: 10px;
    }

    .recipe-header h3 {
        text-align: center;
        padding: 0 48px; /* miejsce na badge */
        line-height: 1.25;
        word-break: break-word;
    }

    .recipe-header .recipe-badge {
        position: absolute;
        top: 0;
        right: 0;
        transform: scale(0.85);
        transform-origin: top right;
    }


}

.recipe-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin-bottom: 12px;
}

.recipe-header h3 {
    grid-column: 2;
    text-align: center;
    margin: 0;
}

.recipe-header .recipe-badge {
    grid-column: 3;
    justify-self: end;
}



.recipe-badge {

    font-size: 10px;

    letter-spacing: 0.08em;

    padding: 4px 10px;

    border-radius: 999px;

    white-space: nowrap;

    transform: translateY(-1px);

    border: 1px solid transparent;

    backdrop-filter: blur(4px);

    font-weight: 600;
}

/* PUBLIC */

.recipe-badge.mine.public {

    background:
        rgba(68,255,204,0.08);

    border-color:
        rgba(68,255,204,0.18);

    color:
        #7dffd9;
}

/* PRIVATE */

.recipe-badge.mine.private {

    background:
        rgba(255,255,255,0.03);

    border-color:
        rgba(255,255,255,0.08);

    color:
        rgba(220,230,240,0.72);
}

/* FOREIGN */

/* =========================
   RECIPE IMPORT FROM URL
   ========================= */

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

.recipe-actions #add-recipe-btn {
    flex: 1 1 220px;
}

.recipe-actions #open-import-url-btn {
    flex: 0 1 220px;
}

.import-draft-content {
    max-width: 720px;
}

.import-error {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--accent-danger, #b35b5b);
    color: var(--accent-danger, #b35b5b);
    background: rgba(179, 91, 91, 0.08);
    font-size: 0.85rem;
}

.import-loading {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted, var(--accent-secondary));
    font-size: 0.9rem;
}

.spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.25);
    border-top-color: var(--accent-primary);
    display: inline-block;
    animation: import-spin 0.8s linear infinite;
}

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

.import-btn-row {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.import-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    font-size: 0.9rem;
}

.import-structured-toggle {
    margin-top: 18px;
}

.import-section-title {
    margin-top: 22px;
    margin-bottom: 8px;
    font-size: 1rem;
}

.import-table-wrap {
    overflow-x: auto;
}

.ing-edit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.ing-edit-table th {
    text-align: left;
    padding: 6px 6px;
    border-bottom: 1px solid var(--accent-primary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--accent-secondary);
}

.ing-edit-table td {
    padding: 6px 6px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    vertical-align: middle;
}

.ing-edit-table input {
    width: 100%;
    min-width: 60px;
}

.ing-edit-table .ing-original-cell {
    font-family: monospace;
    font-size: 0.78rem;
    color: var(--text-muted, #9aa7b0);
    max-width: 160px;
    word-break: break-word;
}

.ing-edit-table .ing-remove-btn {
    cursor: pointer;
    color: var(--accent-danger, #b35b5b);
    background: none;
    border: none;
    font-size: 1rem;
}

.ing-review-pill {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}

.ing-review-pill.ok {
    background: rgba(68,255,204,0.12);
    color: var(--accent-secondary);
}

.ing-review-pill.review {
    background: rgba(255,180,84,0.15);
    color: #ffb454;
}

.import-warnings {
    margin: 10px 0;
}

.import-warnings:empty {
    display: none;
}

.import-warning-item {
    padding: 6px 10px;
    margin-bottom: 6px;
    border-radius: 6px;
    background: rgba(255,180,84,0.1);
    border: 1px solid rgba(255,180,84,0.35);
    color: #ffb454;
    font-size: 0.8rem;
}

.source-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-muted, #9aa7b0);
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 999px;
    padding: 4px 12px;
    margin: 6px 0 4px;
}

.source-chip:empty {
    display: none;
}

.recipe-badge.foreign {

    background:
        rgba(0, 229, 255, 0.05);

    border-color:
        rgba(0, 229, 255, 0.12);

    color:
        rgba(0, 229, 255, 0.72);
}
/* =========================
   PRZEŁĄCZNIK JĘZYKA INTERFEJSU
   Wygląd segmentowy (jeden spójny blok, bez przerw między opcjami) pochodzi
   z RC-owych dopracowań UI. Opcje są przyciskami w formularzu POST, nie
   linkami - zmiana języka zapisuje preferencję konta, więc nie może być
   nawigacją GET.
   ========================= */

.lang-switch {
    display: flex;
    gap: 0;
    align-items: center;
    border: 1px solid var(--accent-primary);
    border-radius: 6px;
    background: var(--bg-panel);
    box-shadow: var(--shadow-secondary);
    overflow: hidden;
}

.lang-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 30px;
    padding: 6px 10px;
    font-size: 0.8rem;
    font-family: var(--font-heading, Orbitron, sans-serif);
    color: var(--accent-primary);
    background: transparent;
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid transparent;
    border-radius: 0;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.lang-option.active {
    color: var(--accent-secondary);
    background: color-mix(in srgb, var(--accent-secondary) 10%, transparent);
    box-shadow: inset 0 -2px 0 var(--accent-secondary);
    font-weight: 700;
}

.lang-option:hover {
    color: var(--accent-secondary);
    background: color-mix(in srgb, var(--accent-primary) 8%, transparent);
}

.lang-option:focus-visible {
    outline: 2px solid var(--accent-secondary);
    outline-offset: 2px;
}

/* Podpis pod przełącznikiem: przełącznik dotyczy interfejsu, nie treści
   przepisów. Bez tego obietnica jest szersza niż funkcja. */
.lang-scope-note {
    margin: 4px 0 0;
    font-size: 0.7rem;
    opacity: 0.65;
    text-align: right;
}
