:root {
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --accent: #d4af37;
    --accent-dim: rgba(212, 175, 55, 0.15);
    --accent-border: rgba(212, 175, 55, 0.3);
    --bg-dark: #080f0b;
    --card-hover-border: rgba(212, 175, 55, 0.4);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    scrollbar-width: none;
}
*::-webkit-scrollbar { display: none; }

html, body {
    background: #080f0b;
    overscroll-behavior-y: none;
    -webkit-overflow-scrolling: touch;
}

body {
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

.glass-background {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(212, 175, 55, 0.06) 0%, transparent 50%);
    z-index: -1;
    animation: drift 60s infinite linear;
}

@keyframes drift {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.brand-watermark {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    width: 15vmin;
    height: 15vmin;
    background: url('cocktails-today-logo.png') center/contain no-repeat;
    opacity: 0.004;
    filter: blur(1px);
    z-index: 0;
    pointer-events: none;
}

.app-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.5rem;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* ========== HEADER ========== */
.glass-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    margin-bottom: 1rem;
    box-shadow: var(--glass-shadow);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    position: relative;
}
.header-left h1 {
    position: relative;
    font-family: 'DM Sans', sans-serif;
    font-size: 2.4rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--accent);
    z-index: 1;
}
.header-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 280px;
    height: auto;
    opacity: 0.12;
    filter: blur(6px);
    pointer-events: none;
}
.brand-logo {
    height: 56px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.3));
}

.controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.search-wrapper { position: relative; }
.search-input {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    color: white;
    font-size: 0.9rem;
    width: 200px;
    outline: none;
    transition: border 0.3s, width 0.3s;
}
.search-input:focus {
    border-color: var(--accent);
    width: 260px;
}
.search-input::placeholder { color: var(--text-secondary); }

.unit-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.switch {
    position: relative;
    display: inline-block;
    width: 64px;
    height: 30px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    transition: .4s;
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
}
.slider-text {
    font-size: 0.7rem;
    font-weight: bold;
    color: var(--text-secondary);
    z-index: 1;
}
.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 28px;
    left: 3px;
    bottom: 3px;
    background-color: var(--accent);
    transition: .4s;
    z-index: 0;
}
input:checked + .slider:before { transform: translateX(28px); }
input:checked + .slider .slider-text.oz { color: var(--text-secondary); }
input:not(:checked) + .slider .slider-text.ml { color: var(--text-secondary); }
input:checked + .slider .slider-text.ml { color: #000; }
input:not(:checked) + .slider .slider-text.oz { color: #000; }
.slider.round { border-radius: 30px; }
.slider.round:before { border-radius: 30px; }

.icon-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}
.icon-btn:hover {
    background: var(--accent-dim);
    border-color: var(--accent);
}

/* ========== CATEGORY TABS ========== */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
    padding-bottom: 0.25rem;
}

.tab-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.3s;
    backdrop-filter: blur(8px);
}
.tab-btn:hover { border-color: var(--accent); color: white; }
.tab-btn.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

/* ========== FILTER BAR ========== */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
}
.filter-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.filter-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-right: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.chip {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 0.3rem 0.7rem;
    border-radius: 14px;
    cursor: pointer;
    font-size: 0.78rem;
    transition: all 0.25s;
}
.chip:hover { border-color: var(--accent); color: white; }
.chip.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

/* ========== INGREDIENT SELECTOR ========== */
.ingredient-selector {
    margin-bottom: 1rem;
}
.ingredient-panel {
    padding: 1.5rem;
}
.ingredient-panel h3 {
    font-size: 1rem;
    font-weight: 400;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}
.ingredient-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
    max-height: 200px;
    overflow-y: auto;
}
.ingredient-chip {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-secondary);
    padding: 0.35rem 0.75rem;
    border-radius: 14px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.25s;
}
.ingredient-chip:hover { border-color: rgba(255, 255, 255, 0.4); color: white; }
.ingredient-chip.selected {
    background: rgba(76, 175, 80, 0.2);
    border-color: #4caf50;
    color: #4caf50;
}
.ingredient-actions {
    display: flex;
    gap: 0.75rem;
}
.btn-primary {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
}
.btn-primary:hover { filter: brightness(1.15); }
.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}
.btn-secondary:hover { border-color: white; color: white; }

/* ========== MAIN LAYOUT ========== */
.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    position: relative;
}
.main-content.chat-open {
    grid-template-columns: 1fr 380px;
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
    gap: 1.25rem;
    max-width: 100%;
    overflow: hidden;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ========== RECIPE CARDS ========== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.recipe-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
    border-color: var(--card-hover-border);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--glass-border);
}
.card-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.card-header h2 {
    font-weight: 400;
    font-size: 1.3rem;
}
.card-actions {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.spirit-badge {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.technique-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    white-space: nowrap;
}
.glass-type {
    background: var(--accent-dim);
    padding: 0.3rem 0.6rem;
    border-radius: 14px;
    font-size: 0.75rem;
    color: var(--accent);
    border: 1px solid var(--accent-border);
    white-space: nowrap;
}
.category-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    opacity: 0.7;
}

.fav-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    line-height: 1;
    transition: transform 0.2s;
    filter: grayscale(1) opacity(0.4);
}
.fav-btn:hover { transform: scale(1.2); filter: none; }
.fav-btn.active { filter: none; }

.print-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    line-height: 1;
    filter: grayscale(1) opacity(0.4);
    transition: filter 0.2s;
}
.print-btn:hover { filter: none; }

.match-score {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-weight: 600;
}
.match-full { background: rgba(76, 175, 80, 0.25); color: #4caf50; }
.match-partial { background: rgba(255, 193, 7, 0.25); color: #ffc107; }
.match-low { background: rgba(255, 87, 34, 0.25); color: #ff5722; }

.missing-ingredients {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}
.missing-ingredients strong { color: #ff9800; }

/* Ingredients */
.ingredients { margin-bottom: 1rem; padding: 0 0.25rem; }
.ingredients h3, .build-steps h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
}
.ingredients ul { list-style: none; }
.ingredients li {
    padding: 0.3rem 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.07);
    font-size: 0.9rem;
}
.ingredients .amount {
    color: var(--accent);
    font-weight: bold;
    margin-right: 0.4rem;
    display: inline-block;
    min-width: 55px;
}

/* Timeline */
.build-steps { padding: 0 0.25rem; }
.timeline {
    position: relative;
    padding-left: 2rem;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent) 0%, rgba(212, 175, 55, 0) 100%);
}
.timeline-item {
    position: relative;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
}
.timeline-item:last-child { margin-bottom: 0; }
.timeline-item .icon {
    position: absolute;
    left: -1.5rem;
    background: #1a1a2e;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    border: 1px solid var(--accent);
    transform: translateX(-50%);
    z-index: 1;
}
.timeline-item p {
    font-size: 0.88rem;
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.15);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    width: 100%;
    margin-left: 0.5rem;
    border: 1px solid transparent;
    transition: border 0.3s ease;
}
.timeline-item:hover p {
    border-color: rgba(212, 175, 55, 0.2);
}

/* ========== CHAT PANEL ========== */
.chat-panel {
    display: none;
    flex-direction: column;
    height: calc(100vh - 220px);
    position: sticky;
    top: 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1rem;
}
.chat-panel.open {
    display: flex;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
}
.chat-header h2 {
    font-size: 1.1rem;
    font-weight: 400;
}
.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.icon-btn-sm {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.2rem;
    transition: color 0.3s;
}
.icon-btn-sm:hover { color: white; }

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #4caf50;
    border-radius: 50%;
    box-shadow: 0 0 8px #4caf50;
}

.chat-box {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-right: 0.4rem;
    margin-bottom: 0.5rem;
}
.chat-box::-webkit-scrollbar { width: 5px; }
.chat-box::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.03); }
.chat-box::-webkit-scrollbar-thumb { background: rgba(212, 175, 55, 0.25); border-radius: 10px; }

.message {
    padding: 0.7rem 0.9rem;
    border-radius: 12px;
    max-width: 90%;
    font-size: 0.9rem;
    line-height: 1.5;
}
.message p { margin-bottom: 0.4rem; }
.message p:last-child { margin-bottom: 0; }
.message ul, .message ol { margin: 0.3rem 0 0.3rem 1.2rem; }
.message li { margin-bottom: 0.2rem; }
.message strong { color: var(--accent); }
.message code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-size: 0.85rem;
}

.agent-message {
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.15);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}
.user-message {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}
.quick-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 0.3rem 0.7rem;
    border-radius: 14px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.25s;
}
.quick-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.chat-input-area {
    display: flex;
    gap: 0.4rem;
}
#chatInput {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
    color: white;
    outline: none;
    font-size: 0.9rem;
    transition: border 0.3s;
}
#chatInput:focus { border-color: var(--accent); }
#sendBtn {
    background: rgba(212, 175, 55, 0.2);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 0 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}
#sendBtn:hover { background: var(--accent); color: #000; }

/* Typing indicator */
.typing-dots { display: inline-flex; gap: 4px; padding: 0.3rem 0; }
.typing-dots span {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: bounce 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* ========== PRINT ========== */
.print-card { display: none; }
@media print {
    body { background: white !important; color: black !important; }
    .glass-background, .glass-header, .category-tabs, .filter-bar,
    .ingredient-selector, .chat-panel, .quick-actions { display: none !important; }
    .recipe-grid { display: block !important; }
    .recipe-card { display: none !important; }
    .recipe-card.printing {
        display: block !important;
        break-inside: avoid;
        border: 1px solid #ccc;
        background: white !important;
        color: black !important;
        backdrop-filter: none !important;
        box-shadow: none !important;
    }
    .recipe-card.printing .amount { color: #8B6914 !important; }
    .recipe-card.printing .timeline-item p { background: #f5f5f5 !important; color: black !important; }
    .recipe-card.printing .fav-btn, .recipe-card.printing .print-btn { display: none !important; }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .app-container { padding: 1rem; }
    .glass-header { flex-wrap: wrap; gap: 0.75rem; }
    .search-input { width: 150px; }
    .search-input:focus { width: 180px; }
    .main-content.chat-open { grid-template-columns: 1fr; }
    .chat-panel {
        position: fixed;
        top: 0; right: 0;
        width: 100%;
        max-width: 400px;
        height: 100vh;
        border-radius: 16px 0 0 16px;
        z-index: 1000;
        box-shadow: -4px 0 30px rgba(0, 0, 0, 0.5);
        background: var(--glass-bg);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
    .recipe-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 600px) {
    .header-left h1 { font-size: 1.2rem; }
    .category-tabs { gap: 0.3rem; }
    .tab-btn { padding: 0.4rem 0.8rem; font-size: 0.78rem; }
    .filter-bar { flex-direction: column; gap: 0.5rem; }
    .recipe-grid { grid-template-columns: 1fr; }
    .unit-label { display: none; }
    .carousel-3d-card { flex: 0 0 260px; min-width: 260px; max-width: 260px; }
    .special-create { flex-direction: column; }
    .modal-content { margin: 0.5rem; max-height: 95vh; }
}

/* ========== COMBINED LAYOUT ========== */
.recipe-grid-combined {
    display: block;
    min-width: 0;
    overflow: visible;
}

/* ========== 3D CAROUSEL ========== */
.carousel-3d-strip {
    display: flex;
    flex-wrap: nowrap;
    gap: 1.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    padding: 1.5rem 2rem 1.5rem;
    margin-bottom: 2rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 55, 0.3) transparent;
}
.carousel-3d-strip::-webkit-scrollbar { height: 6px; }
.carousel-3d-strip::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 3px;
}
.carousel-3d-strip::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.3);
    border-radius: 3px;
}
.carousel-3d-strip::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.5);
}
.carousel-3d-card {
    flex: 0 0 340px;
    min-width: 340px;
    max-width: 340px;
    scroll-snap-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    transform: scale(0.96);
}
.carousel-3d-card:hover {
    transform: scale(1.0);
    box-shadow: 0 10px 40px rgba(212, 175, 55, 0.15), 0 0 0 1px rgba(212, 175, 55, 0.1);
    z-index: 2;
}

/* ========== DETAIL MODAL ========== */
.detail-modal-content {
    max-width: 540px;
    width: 90vw;
}
.detail-photo {
    position: relative;
    margin: 0 1.25rem 0.75rem;
    border-radius: 10px;
    overflow: hidden;
}
.detail-photo img {
    width: 100%;
    max-height: 240px;
    object-fit: cover;
    display: block;
    border-radius: 10px;
}
.detail-photo-actions {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.35rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.detail-photo-actions .btn-sm { font-size: 0.72rem; }
.detail-photo:hover .detail-photo-actions { opacity: 1; }
.detail-remove-photo { color: #e57373 !important; border-color: rgba(229,115,115,0.3) !important; }
.detail-photo-empty {
    margin: 0 1.25rem 0.5rem;
    text-align: center;
}
.detail-photo-empty .detail-add-photo {
    opacity: 0.4;
    font-size: 0.75rem;
    transition: opacity 0.2s;
}
.detail-photo-empty .detail-add-photo:hover { opacity: 0.8; }
.detail-modal-body {
    padding: 0 1.25rem 1.25rem;
    max-height: 75vh;
    overflow-y: auto;
}
.modal-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.fork-btn {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--accent-border);
    color: var(--accent);
    cursor: pointer;
    border-radius: 8px;
    font-size: 0.8rem;
    padding: 0.3rem 0.7rem;
    transition: all 0.25s;
}
.fork-btn:hover {
    background: var(--accent);
    color: #000;
}

/* ========== CAROUSEL GRAB CURSOR ========== */
.carousel-3d-strip {
    cursor: grab;
}
.carousel-3d-strip:active {
    cursor: grabbing;
}

/* ========== SETTINGS ========== */
.settings-modal {
    max-width: 520px;
    width: 92vw;
}
.settings-body {
    padding: 0 1.25rem 1.25rem;
    max-height: 75vh;
    overflow-y: auto;
}
.settings-section {
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.settings-heading {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.settings-hint {
    font-size: 0.78rem;
    color: var(--text-secondary);
    opacity: 0.7;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}
.settings-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.4rem;
}
.api-key-row {
    margin-bottom: 0.6rem;
}
.api-key-label {
    font-size: 0.82rem;
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 500;
}
.api-key-input {
    font-family: monospace;
    font-size: 0.82rem;
    letter-spacing: 0.3px;
}
.api-key-toggle {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--glass-border) !important;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.3rem 0.5rem;
}
.settings-model-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.model-opt {
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s;
}
.model-opt:hover:not(:disabled) {
    border-color: var(--accent-border);
    color: var(--text-primary);
}
.model-opt.active {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--accent);
    color: var(--accent);
}
.model-opt.disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.settings-bg-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.settings-bg-options .bg-opt {
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s;
}
.settings-bg-options .bg-opt:hover {
    border-color: var(--accent-border);
    color: var(--text-primary);
}
.settings-bg-options .bg-opt.active {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--accent);
    color: var(--accent);
}

/* ========== PHOTO LIGHTBOX ========== */
.photo-lightbox {
    z-index: 3000;
}
.photo-lightbox-inner {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.photo-lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    object-fit: contain;
}
.photo-lightbox-title {
    color: var(--accent);
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    text-align: center;
}
.photo-lightbox-close {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(8px);
}
.photo-btn {
    background: none; border: none; cursor: pointer;
    font-size: 1rem; padding: 0.15rem 0.3rem;
    transition: transform 0.2s;
    color: var(--text-secondary);
}
.photo-btn:hover { transform: scale(1.2); }

/* ========== CARD PHOTO ========== */
.card-photo {
    width: 100%; height: 140px;
    background-size: cover; background-position: center;
    border-radius: 12px 12px 0 0;
}
.card-photo-full {
    width: 100%; height: 180px;
    background-size: cover; background-position: center;
    border-radius: 12px 12px 0 0;
    margin: -1.5rem -1.5rem 1rem -1.5rem;
    width: calc(100% + 3rem);
}

/* ========== PRACTICE TIMER ========== */
.timer-btn {
    background: none; border: none; cursor: pointer;
    font-size: 1rem; padding: 0.15rem 0.3rem;
    transition: transform 0.2s;
}
.timer-btn:hover { transform: scale(1.2); }
.timer-bar {
    display: flex; align-items: center; gap: 0.75rem;
    margin-top: 0.75rem; padding: 0.5rem 0.75rem;
    background: rgba(212, 175, 55, 0.06);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 8px;
}
.timer-display {
    font-family: 'Courier New', monospace;
    font-size: 1.3rem; color: var(--accent);
    min-width: 90px;
}
.timer-big {
    font-family: 'Courier New', monospace;
    font-size: 3rem; color: var(--accent);
    margin: 1.5rem 0 0.75rem;
}
.timer-stats {
    font-size: 0.8rem; color: var(--text-secondary);
    margin-bottom: 1rem;
}
.timer-modal-body { padding: 0 1rem 1.5rem; }
.timer-modal-actions { display: flex; gap: 0.75rem; justify-content: center; }
/* ===== PRACTICE TIMER MODAL ===== */
.modal-content.timer-practice-modal {
    max-width: 700px; width: 95vw; overflow-y: auto; padding: 1.5rem;
    max-height: 95vh; display: flex; flex-direction: column;
    backdrop-filter: none; -webkit-backdrop-filter: none;
    background: rgba(15, 12, 41, 0.95);
}
.timer-practice-controls {
    text-align: center; padding: 0 1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 1rem; overflow: visible;
}

/* Ring + Particle Canvas */
.timer-ring-wrap {
    position: relative; width: 240px; height: 240px; margin: 0 auto 0.75rem;
    overflow: visible;
}
.timer-particles {
    position: absolute; inset: -50px; width: calc(100% + 100px); height: calc(100% + 100px);
    pointer-events: none; z-index: 2;
}
.timer-ring {
    position: absolute; inset: 0; width: 100%; height: 100%;
    transform: rotate(-90deg); z-index: 1;
    overflow: visible;
}
.timer-ring-bg {
    fill: none; stroke: rgba(255,255,255,0.07); stroke-width: 8;
}
.timer-ring-progress {
    fill: none; stroke: var(--accent); stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.15s linear;
    filter: drop-shadow(0 0 8px rgba(212,175,55,0.6)) drop-shadow(0 0 20px rgba(212,175,55,0.25));
}
.timer-running .timer-ring-progress {
    animation: timer-glow 2s ease-in-out infinite;
}
.timer-done .timer-ring-progress {
    stroke: #4caf50;
    filter: drop-shadow(0 0 10px rgba(76,175,80,0.8)) drop-shadow(0 0 25px rgba(76,175,80,0.35));
}
@keyframes timer-glow {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(212,175,55,0.6)) drop-shadow(0 0 20px rgba(212,175,55,0.25)); }
    50% { filter: drop-shadow(0 0 14px rgba(212,175,55,0.9)) drop-shadow(0 0 30px rgba(212,175,55,0.35)); }
}
.timer-ring-inner {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; z-index: 3;
}
.timer-ring-inner .timer-big {
    font-family: 'Courier New', monospace;
    font-size: 2.2rem; color: var(--accent);
    margin: 0; line-height: 1.2;
    transition: color 0.3s;
}
.timer-done .timer-ring-inner .timer-big { color: #4caf50; }
.timer-label {
    font-size: 0.8rem; color: var(--text-secondary);
    margin-top: 0.2rem; max-width: 160px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Stats row */
.timer-stats-row {
    display: flex; justify-content: center; gap: 1.5rem;
    margin-bottom: 1rem;
}
.timer-stat-box {
    display: flex; flex-direction: column; align-items: center;
}
.timer-stat-val {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem; color: #fff; font-weight: 600;
}
.timer-stat-lbl {
    font-size: 0.7rem; color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.15rem;
}

/* Start / Stop buttons */
.timer-start-btn {
    background: var(--accent); color: #000; border: none;
    padding: 0.7rem 2rem; border-radius: 50px; cursor: pointer;
    font-weight: 700; font-size: 1rem;
    transition: all 0.3s; letter-spacing: 0.02em;
}
.timer-start-btn:hover { filter: brightness(1.15); transform: scale(1.05); }
.timer-stop-btn {
    background: rgba(244,67,54,0.85); color: #fff; border: none;
    padding: 0.7rem 2rem; border-radius: 50px; cursor: pointer;
    font-weight: 700; font-size: 1rem;
    transition: all 0.3s; letter-spacing: 0.02em;
    animation: timer-pulse 1.5s ease-in-out infinite;
}
.timer-stop-btn:hover { filter: brightness(1.15); }
@keyframes timer-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(244,67,54,0.4); }
    50% { box-shadow: 0 0 0 10px rgba(244,67,54,0); }
}

/* Recipe section */
.timer-practice-recipe {
    max-height: 45vh; overflow-y: auto;
    background: rgba(255,255,255,0.03); border-radius: 12px;
    padding: 1rem; margin: 0 0 0.5rem;
    border: 1px solid rgba(255,255,255,0.06);
}
.timer-practice-recipe .card-actions { display: none; }
.timer-practice-recipe .timer-bar { display: none !important; }
.timer-practice-recipe .card-stats { display: none; }
.timer-practice-recipe .category-label { display: none; }
.timer-practice-recipe .card-photo-full { display: none; }
.card-stats {
    display: flex; gap: 1rem; margin-top: 0.5rem;
    font-size: 0.78rem; color: var(--text-secondary);
    padding: 0.3rem 0; border-top: 1px solid rgba(255,255,255,0.06);
}

/* ========== TODAY'S SPECIAL ========== */
.todays-special-section { margin-bottom: 1rem; }
.special-card {
    border: 1px solid rgba(212, 175, 55, 0.25);
    background: rgba(212, 175, 55, 0.04);
    position: relative;
    overflow: hidden;
}
.special-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(212, 175, 55, 0.06) 0%, transparent 50%);
    pointer-events: none;
}
.special-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.special-header h2 {
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--accent);
}
.special-empty p {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}
.special-create {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}
.special-input {
    flex: 1;
    min-width: 200px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
    outline: none;
    transition: border 0.3s;
}
.special-input:focus { border-color: var(--accent); }
.special-filled { position: relative; z-index: 1; }

/* ========== CUSTOM BADGE / ORIGIN LABELS ========== */
.custom-badge {
    display: inline-block;
    font-size: 0.78rem;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    background: rgba(156, 39, 176, 0.15);
    border: 1px solid rgba(156, 39, 176, 0.3);
    color: #ce93d8;
}
.custom-badge.origin-classic {
    background: rgba(255, 193, 7, 0.12);
    border-color: rgba(255, 193, 7, 0.35);
    color: #ffd54f;
}
.custom-badge.origin-agent {
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.12), rgba(212, 175, 55, 0.12));
    border-color: rgba(212, 175, 55, 0.3);
    color: #e0c060;
}
.custom-badge.origin-forked {
    background: rgba(255, 152, 0, 0.12);
    border-color: rgba(255, 152, 0, 0.35);
    color: #ffb74d;
}
.custom-badge.origin-user {
    background: rgba(76, 175, 80, 0.12);
    border-color: rgba(76, 175, 80, 0.35);
    color: #81c784;
}
.ref-notes {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.3rem;
    opacity: 0.8;
}

/* ========== NEWS CHOICE POPUP ========== */
.news-choice-popup {
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    animation: popupFadeIn 0.15s ease-out;
}
@keyframes popupFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== CLOUD SYNC ========== */
.sync-status {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.sync-badge {
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    display: inline-block;
}
.sync-badge.connected {
    background: rgba(76, 175, 80, 0.12);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #81c784;
}
.sync-login-form input {
    width: 100%;
}

/* ========== MODAL ========== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-content {
    max-width: 620px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--glass-border);
}
.modal-header h2 { font-weight: 400; font-size: 1.2rem; }

/* ========== FORM ========== */
.custom-form { display: flex; flex-direction: column; gap: 0.75rem; }
.form-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 140px; }
.form-group { display: flex; flex-direction: column; gap: 0.3rem; }
.form-group label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.form-group input, .form-group select, .form-group textarea {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 0.7rem;
    border-radius: 6px;
    color: white;
    font-size: 0.9rem;
    outline: none;
    transition: border 0.3s;
    font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--accent);
}
.form-group select { cursor: pointer; }
.form-group select option { background: #1a1a2e; color: white; }
.form-group textarea { resize: vertical; }
.photo-upload-input {
    background: rgba(0, 0, 0, 0.2) !important;
    border: 2px dashed var(--glass-border) !important;
    border-radius: 8px !important;
    padding: 0.75rem !important;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: border-color 0.3s;
}
.photo-upload-input:hover { border-color: var(--accent) !important; }
.photo-upload-input::file-selector-button {
    background: var(--accent-dim);
    border: 1px solid var(--accent-border);
    color: var(--accent);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    margin-right: 0.75rem;
    transition: all 0.2s;
}
.photo-upload-input::file-selector-button:hover {
    background: rgba(212, 175, 55, 0.25);
}
.form-actions { display: flex; gap: 0.75rem; margin-top: 0.5rem; }

.btn-sm {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-secondary);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.25s;
}
.btn-sm:hover { border-color: var(--accent); color: var(--accent); }

.ingredient-row {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    margin-bottom: 0.3rem;
}
.ingredient-row input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    color: white;
    font-size: 0.85rem;
    outline: none;
}
.ingredient-row input:first-child { flex: 1; }
.ingredient-row input:focus { border-color: var(--accent); }
.ing-remove {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    padding: 0 0.3rem;
    transition: color 0.2s;
}
.ing-remove:hover { color: #f44336; }

/* ========== FAB CARD (Create New) ========== */
.fab-card {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    min-height: 200px;
    border: 2px dashed rgba(255, 255, 255, 0.15);
    background: transparent;
    transition: all 0.3s;
}
.fab-card:hover {
    border-color: var(--accent);
    background: rgba(212, 175, 55, 0.05);
}
.fab-content { text-align: center; color: var(--text-secondary); }
.fab-icon { font-size: 2.5rem; display: block; margin-bottom: 0.5rem; color: var(--accent); }
.fab-content p { font-size: 0.9rem; }

/* ========== GRAPH ========== */
.graph-container {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.3);
    position: relative;
    display: flex;
    flex-direction: column;
}
.graph-container #graphCanvas {
    overflow: hidden;
    flex: 1;
    min-height: 0;
    position: relative;
    z-index: 1;
}
#graphCanvas { width: 100%; }
#graphCanvas canvas { display: block; }
.graph-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid var(--glass-border);
    border-radius: 16px 16px 0 0;
    flex-wrap: wrap;
    position: relative;
    z-index: 10;
}
.graph-toolbar .search-input {
    max-width: 260px;
    flex-shrink: 0;
}
.graph-legend {
    display: none;
}
/* Graph filter bar — collapses to zero height in flow, overlay positioned via JS */
.graph-filter-bar {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    position: absolute;
    z-index: 20;
    max-height: 60vh;
    overflow-y: auto;
}
.graph-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.65);
    font-size: 0.68rem;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
    white-space: nowrap;
}
.graph-filter-chip:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.18);
    color: rgba(255,255,255,0.85);
}
.graph-filter-chip.filtered-out {
    opacity: 0.3;
    text-decoration: line-through;
    background: transparent;
    border-color: rgba(255,255,255,0.04);
}
.gf-dot {
    display: inline-block;
    width: 7px; height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ========== VIEW TOGGLE ========== */
.view-toggle { font-size: 1.1rem; font-weight: bold; }

/* ========== MENU BUILDER ========== */
#menuContainer { padding: 0 0.5rem; }
.menu-item {
    padding: 1rem;
    margin-bottom: 0.75rem;
}
.menu-item-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}
.menu-item-header h3 {
    font-weight: 400;
    font-size: 1.05rem;
    color: var(--text-primary);
    margin: 0;
}
.menu-cocktail-list {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.menu-picker {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    max-height: 280px;
    overflow-y: auto;
    padding: 0.5rem 0;
}
.menu-picker .chip {
    font-size: 0.78rem;
    padding: 0.25rem 0.6rem;
}

/* ========== FLASHCARDS (QUIZ MODE) ========== */
#flashcardContainer { padding: 0 0.5rem; }
.flashcard-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 200px;
}
.flashcard {
    width: 100%;
    max-width: 520px;
}
.fc-quiz-card {
    padding: 1.5rem !important;
}
.fc-question {
    margin: 1.5rem 0 1rem;
    padding: 0.75rem 1rem;
    background: rgba(212, 175, 55, 0.06);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 8px;
    text-align: center;
}
.fc-q-label {
    font-size: 1.05rem;
    color: var(--accent);
}
.fc-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.fc-option {
    padding: 0.7rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s;
    text-align: left;
}
.fc-option:hover:not(:disabled) {
    background: rgba(212, 175, 55, 0.08);
    border-color: var(--accent-border);
}
.fc-option:disabled { cursor: default; opacity: 0.7; }
.fc-opt-correct {
    background: rgba(76, 175, 80, 0.15) !important;
    border-color: #4caf50 !important;
    color: #81c784 !important;
    opacity: 1 !important;
}
.fc-opt-wrong {
    background: rgba(244, 67, 54, 0.15) !important;
    border-color: #f44336 !important;
    color: #ef9a9a !important;
    opacity: 1 !important;
}
.fc-answer-card {
    margin-top: 1rem;
    width: 100%;
    animation: slideUp 0.4s ease;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.fc-result {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 0.5rem;
    border-radius: 8px;
}
.fc-result-correct {
    background: rgba(76, 175, 80, 0.1);
    color: #81c784;
}
.fc-result-wrong {
    background: rgba(244, 67, 54, 0.1);
    color: #ef9a9a;
}
.fc-controls {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1rem;
}
.fc-counter {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-right: 1rem;
}
.fc-score {
    font-size: 0.85rem;
    color: var(--accent);
}
.fc-done {
    text-align: center;
    padding: 3rem 2rem;
}
.fc-done h2 {
    font-weight: 400;
    color: var(--accent);
    margin-bottom: 0.5rem;
}
.fc-done p { color: var(--text-secondary); }

.graph-tooltip {
    position: absolute;
    z-index: 100;
    pointer-events: none;
    max-width: 340px;
    transition: opacity 0.12s;
}
.graph-hover-card {
    max-width: 340px;
    max-height: 480px;
    overflow-y: auto;
    font-size: 0.85rem;
    transform: scale(0.92);
    transform-origin: top left;
    background: rgba(0, 0, 0, 0.88) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7), 0 0 1px rgba(212,175,55,0.2) !important;
}
.graph-hover-card .card-actions { display: none; }
.graph-hover-card .timer-bar { display: none !important; }
.gtt-card {
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 1px rgba(212,175,55,0.15);
}
.gtt-card .gtt-photo {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.6rem;
}
.gtt-title {
    font-size: 1.05rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.2rem;
}
.gtt-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}
.gtt-ings {
    list-style: none;
    padding: 0;
    margin: 0.35rem 0 0;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.75);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.1rem 0.6rem;
}
.gtt-ings li { padding: 0.12rem 0; }
.gtt-ings li .gtt-amt { color: var(--accent); font-weight: 500; margin-right: 0.2rem; }
.gtt-garnish {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 0.35rem;
    font-style: italic;
}
.gtt-steps {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.5);
    margin-top: 0.4rem;
    padding-top: 0.35rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    line-height: 1.5;
}
.gtt-steps span { margin-right: 0.15rem; }
.gtt-desc {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0.4rem 0 0;
    line-height: 1.4;
}
.gtt-list {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.3rem;
}
.gtt-header { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.gtt-fav { font-size: 0.7rem; }
.gtt-family { font-size: 0.75rem; margin-bottom: 0.3rem; font-weight: 500; }
.gtt-stats { font-size: 0.72rem; color: rgba(255,255,255,0.5); margin-top: 0.35rem; padding-top: 0.3rem; border-top: 1px solid rgba(255,255,255,0.06); }
.gtt-stats.unpracticed { color: rgba(255,255,255,0.3); font-style: italic; }
.gtt-click-hint { font-size: 0.65rem; color: rgba(255,255,255,0.3); text-align: center; margin-top: 0.4rem; }

/* ========== MENU DISPLAY ========== */
.menu-display {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid rgba(212, 175, 55, 0.12);
    margin-top: 0.5rem;
}
.menu-drink {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: background 0.2s;
}
.menu-drink:hover {
    background: rgba(212, 175, 55, 0.04);
}
.menu-drink-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
}
.menu-drink-name {
    font-size: 1rem;
    color: var(--accent);
    font-weight: 400;
}
.menu-drink-tech {
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.menu-drink-ings {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.2rem;
    line-height: 1.5;
}
.menu-drink-garnish {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 0.15rem;
}
.menu-header-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
    .carousel-3d-card { flex: 0 0 310px; min-width: 310px; max-width: 310px; }
}
/* ========== BARTENDER NOTES ========== */
.notes-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 0.5rem 4rem;
}
.notes-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(212,175,55,0.08);
}
.notes-header-text h2 {
    font-size: 1.6rem;
    font-weight: 300;
    letter-spacing: 0.04em;
    color: rgba(255,255,255,0.92);
    margin: 0 0 0.3rem;
}
.notes-header-text p {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.3);
    font-weight: 300;
    letter-spacing: 0.02em;
    margin: 0;
}
.notes-new-btn {
    background: transparent;
    border: 1px solid rgba(212,175,55,0.25);
    color: var(--accent);
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.notes-new-btn:hover {
    background: rgba(212,175,55,0.08);
    border-color: rgba(212,175,55,0.4);
    box-shadow: 0 0 20px rgba(212,175,55,0.06);
}
.notes-search {
    position: relative;
    margin-bottom: 1.5rem;
}
.notes-search input {
    width: 100%;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 0.7rem 1rem 0.7rem 2.4rem;
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.3s, background 0.3s;
}
.notes-search input:focus {
    border-color: var(--accent-border);
    background: rgba(255,255,255,0.05);
}
.notes-search::before {
    content: '⌕';
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: rgba(255,255,255,0.2);
    pointer-events: none;
}
.notes-search input::placeholder { color: rgba(255,255,255,0.2); }
.notes-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: rgba(255,255,255,0.2);
}
.notes-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
    display: block;
}
.notes-empty-title {
    font-size: 1.1rem;
    font-weight: 300;
    color: rgba(255,255,255,0.35);
    margin-bottom: 0.4rem;
}
.notes-empty-sub {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.18);
    font-weight: 300;
}
.notes-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.note-card {
    position: relative;
    padding: 1.25rem 1.5rem;
    background: var(--glass-bg);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}
.note-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212,175,55,0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}
.note-card:hover {
    background: rgba(255,255,255,0.035);
    border-color: rgba(212,175,55,0.12);
    transform: translateY(-1px);
}
.note-card:hover::before { opacity: 1; }
.note-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.6rem;
    gap: 1rem;
}
.note-card-title {
    font-size: 0.95rem;
    font-weight: 400;
    color: rgba(255,255,255,0.88);
    letter-spacing: 0.01em;
    line-height: 1.3;
}
.note-card-date {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.2);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    padding-top: 0.15rem;
}
.note-card-body {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.35);
    line-height: 1.6;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.note-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.6rem;
}
.note-tag {
    font-size: 0.65rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    background: rgba(212,175,55,0.06);
    color: rgba(212,175,55,0.7);
    border: 1px solid rgba(212,175,55,0.08);
    letter-spacing: 0.02em;
    font-weight: 400;
    transition: all 0.2s;
}
.note-card:hover .note-tag {
    background: rgba(212,175,55,0.1);
    border-color: rgba(212,175,55,0.15);
}
.note-card-actions {
    display: flex;
    gap: 0.4rem;
    opacity: 0;
    transition: opacity 0.25s ease;
    justify-content: flex-end;
}
.note-card:hover .note-card-actions { opacity: 1; }
.note-action-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.4);
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.01em;
}
.note-action-btn:hover {
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.7);
    border-color: rgba(255,255,255,0.12);
}
.note-action-btn.delete:hover {
    background: rgba(229,115,115,0.08);
    color: #e57373;
    border-color: rgba(229,115,115,0.2);
}

/* Note Editor Modal */
.note-editor-modal {
    max-width: 620px;
    width: 95%;
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(60px) saturate(1.2);
    -webkit-backdrop-filter: blur(60px) saturate(1.2);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05);
}
.note-editor-header {
    padding: 1.5rem 1.75rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.note-editor-header h2 {
    font-size: 1.1rem;
    font-weight: 300;
    color: rgba(255,255,255,0.75);
    letter-spacing: 0.03em;
}
.note-editor-close {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.25);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s;
    line-height: 1;
}
.note-editor-close:hover { color: rgba(255,255,255,0.6); }
.note-editor-body {
    padding: 1.25rem 1.75rem 1.75rem;
}
.note-field {
    margin-bottom: 1.25rem;
}
.note-field-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.2);
    margin-bottom: 0.5rem;
    font-weight: 400;
}
.note-title-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 0.6rem 0;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 0.01em;
    outline: none;
    transition: border-color 0.3s;
}
.note-title-input:focus { border-color: var(--accent-border); }
.note-title-input::placeholder { color: rgba(255,255,255,0.18); }
.note-body-input {
    width: 100%;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 1rem;
    color: var(--text-primary);
    font-size: 0.88rem;
    line-height: 1.7;
    resize: vertical;
    min-height: 180px;
    outline: none;
    transition: border-color 0.3s, background 0.3s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.note-body-input:focus {
    border-color: rgba(212,175,55,0.18);
    background: rgba(255,255,255,0.04);
}
.note-body-input::placeholder { color: rgba(255,255,255,0.15); }
.note-tags-preview {
    min-height: 28px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}
.note-tags-preview .note-tag {
    animation: noteTagIn 0.25s ease;
}
@keyframes noteTagIn {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}
.note-tags-empty {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.12);
    font-style: italic;
    font-weight: 300;
}
.note-save-btn {
    width: 100%;
    padding: 0.75rem;
    background: rgba(212,175,55,0.08);
    border: 1px solid rgba(212,175,55,0.2);
    border-radius: 10px;
    color: var(--accent);
    font-size: 0.88rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}
.note-save-btn:hover {
    background: rgba(212,175,55,0.14);
    border-color: rgba(212,175,55,0.35);
    box-shadow: 0 0 30px rgba(212,175,55,0.06);
}

/* Note AI Insight */
.note-insight-wrapper {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.04);
}
.note-insight-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.3);
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.02em;
    margin-bottom: 0.5rem;
}
.note-insight-toggle:hover {
    color: rgba(255,255,255,0.5);
    border-color: rgba(255,255,255,0.1);
}
.note-insight-toggle.active {
    color: rgba(212,175,55,0.6);
    border-color: rgba(212,175,55,0.15);
}
.note-insight-body {
    opacity: 0.45;
    font-size: 0.8rem;
    line-height: 1.65;
    color: rgba(255,255,255,0.5);
    padding: 0.5rem 0.75rem;
    background: rgba(255,255,255,0.015);
    border-radius: 8px;
    border-left: 2px solid rgba(212,175,55,0.15);
    transition: opacity 0.3s;
}
.note-insight-body:hover { opacity: 0.7; }
.note-insight-loading {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.2);
    font-style: italic;
    padding: 0.5rem 0;
}

/* (filter styles are in .graph-filter-bar section above) */

/* Graph back button — hidden on desktop, shown on mobile fullscreen */
.graph-back-btn {
    display: none;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
    width: 32px; height: 32px;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.graph-back-btn:hover { color: var(--accent); border-color: rgba(212,175,55,0.2); }

/* Graph physics settings panel */
.graph-physics-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
    width: 32px; height: 32px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}
.graph-physics-btn:hover {
    background: rgba(255,255,255,0.08);
    color: var(--accent);
    border-color: rgba(212,175,55,0.2);
}
.graph-physics-btn.active {
    color: var(--accent);
    border-color: rgba(212,175,55,0.3);
    background: rgba(212,175,55,0.08);
}
.graph-physics-panel {
    position: absolute;
    top: 48px;
    right: 0;
    width: 280px;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    z-index: 100;
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
    display: none;
}
.graph-physics-panel.open { display: block; }
.graph-physics-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.3);
    margin-bottom: 0.85rem;
    font-weight: 400;
}
.gp-slider-group {
    margin-bottom: 0.85rem;
}
.gp-slider-group:last-child { margin-bottom: 0; }
.gp-slider-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.3rem;
}
.gp-slider-name {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.55);
    font-weight: 400;
}
.gp-slider-value {
    font-size: 0.68rem;
    color: rgba(212,175,55,0.6);
    font-variant-numeric: tabular-nums;
    min-width: 2.5em;
    text-align: right;
}
.gp-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}
.gp-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid rgba(0,0,0,0.3);
    cursor: pointer;
    transition: box-shadow 0.2s;
}
.gp-slider::-webkit-slider-thumb:hover {
    box-shadow: 0 0 8px rgba(212,175,55,0.3);
}
.gp-slider::-moz-range-thumb {
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid rgba(0,0,0,0.3);
    cursor: pointer;
}
.gp-reset-btn {
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.4rem;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.3);
    border-radius: 6px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.02em;
}
.gp-reset-btn:hover {
    color: rgba(255,255,255,0.6);
    border-color: rgba(255,255,255,0.12);
}

/* Graph inline chat — floating overlay panel (right side) */
.graph-chat-bar {
    display: flex;
    flex-direction: column;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    z-index: 25;
    position: absolute;
    top: 56px;
    right: 8px;
    width: 320px;
    max-height: calc(100% - 70px);
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.graph-chat-bar.gc-collapsed {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}
.gc-toggle-btn {
    position: absolute;
    top: 56px;
    right: 8px;
    z-index: 26;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 0.35rem 0.55rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}
.gc-toggle-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
}
.gc-toggle-btn.gc-open { opacity: 0; pointer-events: none; }
.gc-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.72rem;
    color: var(--text-secondary);
    letter-spacing: 0.03em;
}
.gc-chat-header span { opacity: 0.7; }
.gc-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0 0.2rem;
    line-height: 1;
    opacity: 0.5;
    transition: opacity 0.2s;
}
.gc-close-btn:hover { opacity: 1; color: var(--accent); }
.graph-chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem 0.6rem;
    max-height: 280px;
    min-height: 0;
    display: none;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.75rem;
    line-height: 1.5;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.graph-chat-messages.has-messages { display: flex; }
.graph-chat-messages .gc-msg {
    padding: 0.3rem 0.55rem;
    border-radius: 8px;
    max-width: 90%;
    word-wrap: break-word;
}
.graph-chat-messages .gc-user {
    align-self: flex-end;
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    color: var(--text-primary);
    border: 1px solid color-mix(in srgb, var(--accent) 15%, transparent);
}
.graph-chat-messages .gc-agent {
    align-self: flex-start;
    background: var(--glass-bg);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}
.graph-chat-input-row {
    display: flex;
    gap: 0.3rem;
    padding: 0.4rem 0.6rem;
    align-items: center;
    border-top: 1px solid var(--glass-border);
}
.graph-chat-input {
    flex: 1;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.4rem 0.55rem;
    color: var(--text-primary);
    font-size: 0.78rem;
    outline: none;
    transition: border-color 0.2s;
    min-width: 0;
}
.graph-chat-input:focus { border-color: var(--accent); }
.graph-chat-input::placeholder { color: var(--text-secondary); }
.graph-chat-send {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
    color: var(--accent);
    border-radius: 8px;
    padding: 0.35rem 0.55rem;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.graph-chat-send:hover {
    background: color-mix(in srgb, var(--accent) 20%, transparent);
    border-color: var(--accent);
}

/* Inline mic button inside inputs */
.mic-input-wrap {
    position: relative;
    display: flex;
    flex: 1;
    min-width: 0;
}
.mic-input-wrap input,
.mic-input-wrap textarea {
    width: 100%;
}
.mic-btn-inline {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.25);
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
    z-index: 2;
    line-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mic-btn-inline svg { display: block; }
.mic-btn-inline:hover { color: rgba(255,255,255,0.5); }
.mic-btn-inline.recording {
    color: #e57373;
    animation: mic-pulse 1s ease-in-out infinite;
}
@keyframes mic-pulse {
    0%, 100% { filter: drop-shadow(0 0 0 rgba(229,115,115,0)); }
    50% { filter: drop-shadow(0 0 6px rgba(229,115,115,0.6)); }
}

@media (max-width: 600px) {
    .carousel-3d-card { flex: 0 0 280px; min-width: 280px; max-width: 280px; }
    .carousel-3d-strip { padding: 0.75rem 1rem 1rem; gap: 1rem; }
    .graph-toolbar { flex-direction: row; flex-wrap: nowrap; gap: 0.5rem; }
    .graph-toolbar .search-input { max-width: none; flex: 1; min-width: 0; width: auto; }
    .fc-quiz-card { padding: 1rem !important; }
    .menu-drink-header { flex-direction: column; gap: 0.2rem; }
    .md-layout { grid-template-columns: 1fr !important; }
    .md-preview-wrap { max-height: none !important; }
}

/* ========== CHAT RECIPE CARD (in-chat styled card) ========== */
.chat-recipe-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.8rem;
    margin-top: 0.25rem;
}
.chat-recipe-card .card-header { margin-bottom: 0.5rem; }
.chat-recipe-card .card-title-row { display: flex; align-items: center; gap: 0.5rem; }
.chat-recipe-card h2 { font-size: 1rem; font-weight: 600; color: var(--accent); }
.chat-recipe-card .card-meta-row { display: flex; gap: 0.5rem; margin-bottom: 0.6rem; flex-wrap: wrap; }
.chat-recipe-card .ingredients h3,
.chat-recipe-card .build-steps h3 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); margin-bottom: 0.3rem; }
.chat-recipe-card .ingredients ul { list-style: none; padding: 0; margin: 0 0 0.5rem 0; }
.chat-recipe-card .ingredients li { font-size: 0.82rem; padding: 0.15rem 0; color: var(--text-primary); }
.chat-recipe-card .ingredients .amount { color: var(--accent); font-weight: 600; margin-right: 0.3rem; }
.chat-recipe-card .timeline-item { display: flex; gap: 0.4rem; align-items: flex-start; margin-bottom: 0.25rem; font-size: 0.82rem; }
.chat-recipe-card .timeline-item .icon { flex-shrink: 0; }
.chat-recipe-card .chat-set-special { transition: all 0.3s; }
.chat-recipe-card .chat-set-special:disabled { opacity: 0.6; cursor: default; background: #4caf50; color: white; border-color: #4caf50; }

/* ============================================================
   MOBILE-FIRST RESPONSIVE ENHANCEMENTS
   Additive rules only — nothing above is overwritten.
   ============================================================ */

/* --- 480px and below: phones in portrait --- */
@media (max-width: 480px) {

    /* --- Global spacing --- */
    .app-container { padding: 0.5rem; }

    /* --- Header: stack vertically on very small screens --- */
    .glass-header {
        flex-direction: column;
        align-items: stretch;
        padding: 0.6rem 0.8rem;
        gap: 0.5rem;
        border-radius: 10px;
        margin-bottom: 0.6rem;
    }
    .header-left { text-align: center; }
    .header-left h1 { font-size: 1.05rem; letter-spacing: 1px; }
    .controls {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* --- Search: full-width --- */
    .search-wrapper { width: 100%; }
    .search-input { width: 100% !important; font-size: 0.95rem; padding: 0.55rem 0.9rem; }
    .search-input:focus { width: 100% !important; }

    /* --- Touch targets: min 44px for tappability --- */
    .icon-btn { width: 40px; height: 40px; font-size: 1.1rem; }
    .switch { width: 58px; height: 28px; }
    .tab-btn { padding: 0.45rem 0.9rem; font-size: 0.8rem; min-height: 36px; }
    .chip { padding: 0.35rem 0.65rem; font-size: 0.76rem; min-height: 32px; display: inline-flex; align-items: center; }
    .ingredient-chip { padding: 0.4rem 0.7rem; font-size: 0.8rem; min-height: 34px; display: inline-flex; align-items: center; }

    /* --- Category tabs: wrap on smaller screens --- */
    .category-tabs { gap: 0.3rem; padding-bottom: 0.35rem; }

    /* --- Filter bar: stack vertically, full width --- */
    .filter-bar {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.5rem 0.6rem;
        border-radius: 8px;
    }
    .filter-group { flex-wrap: wrap; gap: 0.3rem; }

    /* --- Recipe cards: single column, compact vertical --- */
    .recipe-grid { gap: 0.6rem; padding: 0; }
    .recipe-card { border-radius: 10px; padding: 0.8rem; }
    .glass-card { padding: 0.8rem; }

    /* --- Card content: tighter spacing --- */
    .card-header { margin-bottom: 0.5rem; padding-bottom: 0.4rem; }
    .card-header h2 { font-size: 1.05rem; }
    .recipe-card h3 { font-size: 0.9rem; }
    .card-meta { font-size: 0.72rem; }
    .category-label { margin-bottom: 0.3rem; font-size: 0.65rem; }

    /* --- Ingredients: compact --- */
    .ingredients { margin-bottom: 0.5rem; }
    .ingredients h3, .build-steps h3 { margin-bottom: 0.3rem; font-size: 0.72rem; }
    .ingredients li { padding: 0.15rem 0; font-size: 0.82rem; }
    .ingredients .amount { min-width: 45px; font-size: 0.82rem; }

    /* --- Timeline: compact steps --- */
    .timeline { padding-left: 1.5rem; }
    .timeline-item { margin-bottom: 0.3rem; }
    .timeline-item .icon { width: 20px; height: 20px; font-size: 0.6rem; left: -1.2rem; }
    .timeline-item p { padding: 0.25rem 0.5rem; font-size: 0.8rem; }

    /* --- Card actions row --- */
    .card-actions { gap: 0.25rem; }
    .fav-btn { font-size: 1rem; }
    .technique-badge { font-size: 0.65rem; padding: 0.15rem 0.4rem; }
    .glass-type { font-size: 0.68rem; padding: 0.2rem 0.45rem; }

    /* --- Buttons: bigger tap area --- */
    .btn-primary, .btn-secondary { padding: 0.65rem 1.2rem; font-size: 0.88rem; min-height: 42px; }
    .btn-sm { padding: 0.4rem 0.8rem; font-size: 0.78rem; min-height: 34px; }

    /* --- Ingredient selector --- */
    .ingredient-panel { padding: 0.8rem; }
    .ingredient-chips { max-height: 150px; gap: 0.35rem; }

    /* --- Modals: near full-screen --- */
    .modal-content {
        margin: 0.25rem;
        max-height: 97vh;
        border-radius: 10px;
        padding: 0.8rem;
    }
    .modal-content h2 { font-size: 1.1rem; }

    /* --- Chat panel: full-screen overlay --- */
    .chat-panel.open {
        max-width: 100%;
        border-radius: 0;
    }
    .chat-input-row { gap: 0.4rem; }
    .chat-input-row input { font-size: 0.9rem; padding: 0.6rem 0.8rem; }
    .chat-input-row button { padding: 0.6rem 1rem; font-size: 0.85rem; min-height: 42px; }

    /* --- Graph container: fill viewport, tight border --- */
    .graph-container { border-radius: 8px; margin: 0 -0.25rem; }

    /* --- Graph toolbar: compact, single row --- */
    .graph-toolbar {
        padding: 0.4rem 0.5rem;
        gap: 0.4rem;
        flex-wrap: nowrap;
    }
    .graph-toolbar .search-input {
        max-width: none;
        flex: 1;
        min-width: 0;
        font-size: 0.85rem;
        padding: 0.45rem 0.7rem;
    }

    /* --- Graph physics button: touch-friendly --- */
    .graph-physics-btn { min-width: 38px; min-height: 38px; font-size: 1.1rem; }

    /* --- Graph physics panel: fit on mobile --- */
    .graph-physics-panel {
        width: calc(100vw - 32px);
        max-width: 280px;
        right: 4px;
        top: 44px;
        padding: 0.75rem 0.9rem;
    }
    .gp-slider-group { margin-bottom: 0.6rem; }
    .gp-slider::-webkit-slider-thumb { width: 18px; height: 18px; }
    .gp-slider::-moz-range-thumb { width: 18px; height: 18px; }

    /* --- Graph filter bar: horizontal scroll overlay --- */
    .graph-filter-bar {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0.3rem;
        padding: 0.35rem 0.5rem;
        max-height: none;
        max-width: calc(100% - 16px);
    }
    .graph-filter-bar::-webkit-scrollbar { display: none; }
    .graph-filter-chip { flex-shrink: 0; font-size: 0.65rem; padding: 0.2rem 0.5rem; min-height: 28px; }

    /* --- Graph tooltip: constrain to screen --- */
    .graph-tooltip { max-width: calc(100vw - 32px); }
    .graph-hover-card { max-width: calc(100vw - 32px); max-height: 50vh; transform: scale(0.85); }
    .gtt-card { padding: 0.6rem 0.75rem; }

    /* --- Graph chat toggle button --- */
    .gc-toggle-btn { top: 46px; right: 6px; width: 36px; height: 36px; font-size: 1rem; }

    /* --- Graph chat bar: full width on phones --- */
    .graph-chat-bar {
        width: calc(100% - 12px);
        right: 6px;
        left: 6px;
        max-height: 50%;
        border-radius: 10px;
    }
    .gc-chat-header { padding: 0.35rem 0.5rem; font-size: 0.8rem; }
    .graph-chat-messages .gc-msg { font-size: 0.82rem; padding: 0.25rem 0.45rem; }
    .graph-chat-input-row { gap: 0.3rem; padding: 0.3rem 0.5rem; }
    .graph-chat-input { font-size: 0.85rem; padding: 0.45rem 0.6rem; }
    .graph-chat-send { padding: 0.45rem 0.7rem; font-size: 0.8rem; min-height: 38px; }

    /* --- Carousel: tighter on phones --- */
    .carousel-3d-card { flex: 0 0 260px; min-width: 260px; max-width: 260px; }
    .carousel-3d-strip { padding: 0.5rem 0.5rem 0.75rem; gap: 0.75rem; }

    /* --- Today's special --- */
    .special-create { flex-direction: column; gap: 0.5rem; }

    /* --- Quick action buttons --- */
    .quick-actions { flex-wrap: wrap; gap: 0.35rem; }
    .quick-btn { font-size: 0.72rem; padding: 0.35rem 0.55rem; }

    /* --- Flashcard quiz --- */
    .fc-quiz-card { padding: 0.75rem !important; border-radius: 10px !important; }

    /* --- Menu builder --- */
    .menu-card { border-radius: 10px; }

    /* --- Bartender notes --- */
    .note-card { border-radius: 10px; padding: 0.8rem; }

    /* --- Print/Share row --- */
    .card-actions { flex-wrap: wrap; gap: 0.3rem; }

    /* --- Settings overlay --- */
    .settings-overlay .modal-content { padding: 0.6rem; }
}

/* --- Graph fullscreen mode on mobile --- */
@media (max-width: 480px) {
    body.graph-fullscreen .glass-header {
        border-radius: 0;
        padding: 0.4rem 0.6rem;
        margin-bottom: 0;
    }
    body.graph-fullscreen .header-left h1 { font-size: 0.9rem; }
    body.graph-fullscreen .search-wrapper { display: none; }
    body.graph-fullscreen .category-tabs { display: none; }
    body.graph-fullscreen #todaysSpecialSection { display: none !important; }
    body.graph-fullscreen .filter-bar { display: none !important; }
    body.graph-fullscreen .ingredient-selector { display: none; }
    body.graph-fullscreen .app-container { padding: 0; max-width: 100%; }
    body.graph-fullscreen .graph-back-btn { display: inline-flex; min-width: 38px; min-height: 38px; }
    body.graph-fullscreen .graph-container {
        border-radius: 0;
        border: none;
        margin: 0;
        height: calc(100vh - 48px) !important;
    }
}

/* --- 360px and below: very small phones --- */
@media (max-width: 360px) {
    .header-left h1 { font-size: 0.95rem; }
    .tab-btn { padding: 0.35rem 0.65rem; font-size: 0.72rem; }
    .carousel-3d-card { flex: 0 0 240px; min-width: 240px; max-width: 240px; }
    .graph-chat-bar { max-height: 40%; }
    .graph-toolbar { padding: 0.3rem 0.4rem; gap: 0.3rem; }
    .graph-hover-card { transform: scale(0.78); }
    .modal-content { margin: 0; border-radius: 0; max-height: 100vh; }
}

/* --- Safe area insets for notched phones --- */
@supports (padding-top: env(safe-area-inset-top)) {
    @media (max-width: 480px) {
        .app-container {
            padding-top: calc(0.5rem + env(safe-area-inset-top));
            padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
            padding-left: calc(0.5rem + env(safe-area-inset-left));
            padding-right: calc(0.5rem + env(safe-area-inset-right));
        }
        .chat-panel.open {
            padding-bottom: env(safe-area-inset-bottom);
        }
    }
}

/* ========== AUTH MODAL ========== */
.auth-modal-content {
    max-width: 400px;
    width: 90vw;
}
.auth-form .form-group { margin-bottom: 1rem; }
.auth-form input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
    font-size: 0.95rem;
}
.auth-form input:focus {
    border-color: var(--accent);
    outline: none;
}
.auth-error {
    color: #e57373;
    font-size: 0.85rem;
    padding: 0.5rem;
    border-radius: 6px;
    background: rgba(229,115,115,0.1);
    margin-bottom: 0.75rem;
}
.auth-btn {
    position: relative;
    flex-shrink: 0;
}
.auth-btn.logged-in {
    color: var(--accent);
}
.auth-user-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    color: var(--accent);
    padding: 0.15rem 0.45rem;
    border-radius: 10px;
    background: var(--accent-dim);
    border: 1px solid var(--accent-border);
    cursor: pointer;
    white-space: nowrap;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.auth-user-badge:hover { background: rgba(212,175,55,0.25); }

/* ========== NEWS CARDS ========== */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    padding: 0.5rem 0;
}
.news-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    backdrop-filter: blur(12px);
}
.news-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-border);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.news-card-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}
.news-card-image-placeholder {
    width: 100%;
    height: 160px;
    background: linear-gradient(135deg, rgba(212,175,55,0.1), rgba(79,195,247,0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    opacity: 0.5;
}
.news-card-body {
    padding: 1rem;
}
.news-card-body h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
    line-height: 1.3;
}
.news-card-body p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 0.72rem;
    color: var(--text-secondary);
}
.news-source-badge {
    background: var(--accent-dim);
    color: var(--accent);
    padding: 0.15rem 0.5rem;
    border-radius: 8px;
    font-weight: 500;
}
.news-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}
.news-empty p { margin-bottom: 1rem; }

/* ========== NEWS SEARCH ========== */
.news-search-bar {
    position: relative;
    margin-bottom: 1.25rem;
}
.news-search-bar input {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 2.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s;
    backdrop-filter: blur(12px);
}
.news-search-bar input:focus {
    border-color: var(--accent-border);
}
.news-search-bar input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}
.news-search-bar::before {
    content: '⌕';
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: var(--text-secondary);
    pointer-events: none;
}

/* ========== EDITORIAL ARTICLES (Magazine Spread) ========== */
.news-editorials-section {
    margin-bottom: 2rem;
}
.editorial-article {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 2.5rem;
}

/* === Full-bleed Hero Image Header === */
.ed-hero {
    position: relative;
    height: 420px;
    background-size: cover;
    background-position: center;
}
@media (max-width: 600px) { .ed-hero { height: 320px; } }
.ed-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.15) 100%);
    display: flex;
    align-items: flex-end;
}
.ed-hero-content {
    padding: 2.5rem;
    max-width: 700px;
}
@media (max-width: 600px) { .ed-hero-content { padding: 1.5rem; } }
.ed-hero-title {
    font-size: 2.8rem;
    font-weight: 900;
    color: #fff;
    line-height: 1.05;
    margin: 0 0 0.75rem;
    letter-spacing: -0.04em;
    text-shadow: 0 2px 20px rgba(0,0,0,0.4);
}
@media (max-width: 600px) { .ed-hero-title { font-size: 1.8rem; } }
.ed-hero-subtitle {
    font-size: 0.92rem;
    color: rgba(255,255,255,0.75);
    line-height: 1.55;
    margin: 0 0 0.75rem;
    font-style: italic;
    max-width: 540px;
}
.ed-hero-byline {
    display: inline-block;
    font-size: 0.62rem;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
    padding-top: 0.6rem;
    border-top: 2px solid rgba(255,255,255,0.15);
}

/* Badge row (shared) */
.editorial-badge-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.editorial-badge {
    font-size: 0.58rem;
    font-weight: 800;
    padding: 0.3rem 0.8rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}
.editorial-badge.daily {
    background: #d4af37;
    color: #1a1a1a;
}
.editorial-badge.weekly {
    background: #d4af37;
    color: #1a1a1a;
}
.editorial-date {
    font-size: 0.72rem;
    font-weight: 400;
}

/* Hide old elements */
.editorial-header, .editorial-divider, .editorial-body-wrap,
.editorial-title, .editorial-subtitle, .editorial-byline { display: none; }

/* === Section blocks — alternating gold / dark === */
.ed-sections-wrap {
    display: flex;
    flex-direction: column;
}
.ed-section {
    padding: 0;
}

/* Gold block — soft pale gold */
.ed-block-gold {
    background: rgba(191, 168, 94, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(212, 175, 55, 0.25);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    color: #1c1c14;
}
.ed-block-gold .ed-section-text { color: #2a2818; }
.ed-block-gold .ed-section-text strong {
    color: #000;
    font-size: 1.02em;
    letter-spacing: -0.01em;
}
.ed-block-gold .ed-section-title {
    color: #000;
    border-bottom-color: rgba(0,0,0,0.15);
}
.ed-block-gold .ed-section-text ul {
    background: rgba(0,0,0,0.06);
    border-left-color: rgba(0,0,0,0.2);
}
.ed-block-gold .ed-section-text ul li::before { background: #1a1a1a; }

/* Dark block — pale forest sage matching site palette */
.ed-block-dark {
    background: rgba(28, 43, 36, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    color: rgba(255,255,255,0.82);
}
.ed-block-dark .ed-section-text { color: rgba(255,255,255,0.78); }
.ed-block-dark .ed-section-text strong {
    color: #d4af37;
    font-size: 1.02em;
    letter-spacing: -0.01em;
}
.ed-block-dark .ed-section-title {
    color: #d4af37;
    border-bottom-color: rgba(212,175,55,0.3);
}
.ed-block-dark .ed-section-text ul {
    background: rgba(255,255,255,0.04);
    border-left-color: rgba(212,175,55,0.3);
}
.ed-block-dark .ed-section-text ul li::before { background: #d4af37; }

/* === Image + Text Grid === */
.ed-section-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 360px;
}
@media (max-width: 768px) {
    .ed-section-grid { grid-template-columns: 1fr; }
}
.ed-section-grid.ed-img-right {
    direction: rtl;
}
.ed-section-grid.ed-img-right > * {
    direction: ltr;
}

.ed-section-img {
    background-size: cover;
    background-position: center;
    min-height: 360px;
}
@media (max-width: 768px) {
    .ed-section-img { min-height: 220px; }
}

.ed-section-img {
    position: relative;
}
.ed-img-credit {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.7);
    background: rgba(0,0,0,0.5);
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    text-decoration: none;
    transition: opacity 0.2s;
    backdrop-filter: blur(4px);
}
.ed-img-credit:hover { opacity: 0.6; }
.ed-section-content {
    padding: 2rem 2.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
@media (max-width: 600px) {
    .ed-section-content { padding: 1.25rem; }
}

.ed-section-title {
    font-size: 1.7rem;
    font-weight: 900;
    margin: 0 0 1.25rem;
    padding-bottom: 0.7rem;
    border-bottom: 4px solid;
    letter-spacing: -0.03em;
    line-height: 1.1;
    text-transform: uppercase;
}

.ed-section-text {
    font-size: 0.92rem;
    line-height: 1.75;
}
.ed-section-text p {
    margin: 0 0 1.1rem;
}
.ed-section-text strong {
    font-weight: 800;
    display: inline;
    font-size: 1.02em;
    letter-spacing: -0.01em;
}
/* Brand/location names — bold accent, consistent treatment */
.ed-section-text .ed-brand {
    font-weight: 800;
    font-size: 1.02em;
    letter-spacing: -0.01em;
    display: inline;
}
.ed-block-gold .ed-brand { color: #1a1a0a; }
.ed-block-dark .ed-brand { color: #e8c94a; }
/* Dates — small caps pill */
.ed-section-text .ed-date {
    font-weight: 800;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: inline;
    padding: 0.1em 0.4em;
    border-radius: 3px;
}
.ed-block-gold .ed-date { background: rgba(0,0,0,0.08); color: #2a2010; }
.ed-block-dark .ed-date { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7); }
/* Lead sentence — massive stylized first sentence per section */
.ed-section-text .ed-lead {
    font-size: 1.35em;
    font-weight: 900;
    line-height: 1.25;
    letter-spacing: -0.03em;
    margin: 0 0 1rem;
    display: block;
}
.ed-block-gold .ed-lead { color: #000; }
.ed-block-dark .ed-lead { color: rgba(255,255,255,0.95); }
/* Source links — clickable references to original articles */
.ed-source-link {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 2px;
    transition: opacity 0.2s;
    cursor: pointer;
}
.ed-source-link:hover { opacity: 0.7; }
.ed-block-gold .ed-source-link { text-decoration-color: rgba(0,0,0,0.3); }
.ed-block-dark .ed-source-link { text-decoration-color: rgba(212,175,55,0.5); color: #e8c94a; }
.ed-section-text ul {
    list-style: none;
    padding: 0.6rem 0.9rem;
    margin: 0.6rem 0 1rem;
    border-left: 3px solid;
    border-radius: 0 6px 6px 0;
}
.ed-section-text ul li {
    position: relative;
    padding-left: 1.1rem;
    margin-bottom: 0.4rem;
    line-height: 1.65;
}
.ed-section-text ul li:last-child { margin-bottom: 0; }
.ed-section-text ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55rem;
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

/* === Intro section (no heading, full-width gold) === */
.ed-intro {
    padding: 2.25rem 2.5rem;
}
@media (max-width: 600px) { .ed-intro { padding: 1.25rem; } }
.ed-intro-text {
    font-size: 1.15rem;
    column-count: 1;
}
.ed-intro-text strong, .ed-intro-text .ed-brand, .ed-intro-text .ed-date {
    font-weight: 900;
    color: #000;
}
.ed-intro-text .ed-lead {
    font-size: 1.3em;
    font-weight: 900;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: #000;
    display: block;
    margin: 0 0 1rem;
    column-span: all;
}

/* === Cocktail Recipe Card Section === */
.ed-cocktail-section {
    border-top: 4px solid #d4af37;
}
.ed-cocktail-card {
    padding: 0;
}
.ed-cocktail-label {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #d4af37;
    background: rgba(212,175,55,0.1);
    padding: 0.3rem 0.7rem;
    border-radius: 3px;
    margin-bottom: 0.75rem;
}
.ed-cocktail-name {
    font-size: 1.8rem;
    font-weight: 900;
    color: #d4af37;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin: 0 0 1.25rem;
}
.ed-cocktail-card .ed-section-text ul {
    background: rgba(212,175,55,0.06);
    border-left-color: #d4af37;
    margin: 1rem 0;
}
.ed-cocktail-card .ed-section-text ul li::before {
    background: #d4af37;
}

/* === Collapse/Expand === */
.editorial-collapse-toggle {
    text-align: center;
    padding: 1rem 2rem;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.2s;
    position: relative;
    z-index: 2;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 0 0 18px 18px;
    backdrop-filter: blur(12px);
}
.editorial-collapse-toggle:hover {
    background: rgba(255,255,255,0.04);
}
.editorial-fade-mask {
    position: relative;
}
.editorial-fade-mask.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 160px;
    background: linear-gradient(to bottom, transparent, #1c2b24);
    pointer-events: none;
}

/* ========== Admin Edit Button ========== */
.ed-admin-edit-btn {
    margin-left: auto;
    background: rgba(212,175,55,0.2);
    border: 1px solid rgba(212,175,55,0.4);
    color: #d4af37;
    padding: 0.25rem 0.7rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}
.ed-admin-edit-btn:hover { background: rgba(212,175,55,0.35); border-color: #d4af37; }

/* ========== Editorial Editor Modal ========== */
.ed-editor-overlay {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center; padding: 1.5rem;
}
.ed-editor-modal {
    background: #141420; border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px; width: 100%; max-width: 860px; max-height: 90vh;
    display: flex; flex-direction: column;
    box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}
.ed-editor-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.25rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ed-editor-header h3 { margin: 0; font-size: 1rem; color: #fff; font-weight: 700; }
.ed-editor-header-actions { display: flex; gap: 0.5rem; }
.ed-editor-save-btn {
    background: #d4af37; color: #000; border: none; padding: 0.4rem 1rem;
    border-radius: 6px; font-size: 0.75rem; font-weight: 700; cursor: pointer;
}
.ed-editor-save-btn:hover { background: #e8c94a; }
.ed-editor-cancel-btn {
    background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.6); border: 1px solid rgba(255,255,255,0.1);
    padding: 0.4rem 1rem; border-radius: 6px; font-size: 0.75rem; font-weight: 600; cursor: pointer;
}
.ed-editor-cancel-btn:hover { background: rgba(255,255,255,0.1); }
.ed-editor-delete-btn {
    background: rgba(200,50,50,0.15); color: #e05555; border: 1px solid rgba(200,50,50,0.3);
    padding: 0.4rem 0.8rem; border-radius: 6px; font-size: 0.7rem; font-weight: 700; cursor: pointer;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.ed-editor-delete-btn:hover { background: rgba(200,50,50,0.3); border-color: #e05555; }
.ed-editor-body { padding: 1.25rem 1.5rem; overflow-y: auto; flex: 1; }
.ed-editor-fields { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.ed-editor-fields label {
    font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; color: rgba(255,255,255,0.5);
}
.ed-editor-fields input {
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px; padding: 0.5rem 0.75rem; color: #fff; font-size: 0.85rem;
}
.ed-editor-fields input:focus { outline: none; border-color: #d4af37; }
.ed-editor-toolbar {
    display: flex; gap: 0.25rem; padding: 0.5rem; margin-bottom: 0.5rem;
    background: rgba(255,255,255,0.03); border-radius: 8px; align-items: center;
}
.ed-editor-toolbar button {
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.7); padding: 0.3rem 0.6rem; border-radius: 4px;
    font-size: 0.75rem; font-weight: 700; cursor: pointer; transition: all 0.15s;
}
.ed-editor-toolbar button:hover { background: rgba(212,175,55,0.15); color: #d4af37; border-color: rgba(212,175,55,0.3); }
.ed-editor-toolbar-sep { width: 1px; height: 20px; background: rgba(255,255,255,0.08); margin: 0 0.3rem; }
.ed-editor-content-wrap { flex: 1; min-height: 350px; }
.ed-editor-textarea {
    width: 100%; min-height: 350px; max-height: 50vh;
    background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px; padding: 1rem; color: rgba(255,255,255,0.9);
    font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.82rem;
    line-height: 1.7; resize: vertical;
}
.ed-editor-textarea:focus { outline: none; border-color: rgba(212,175,55,0.4); }
.ed-editor-preview {
    background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px; padding: 1rem; min-height: 350px; max-height: 50vh; overflow-y: auto;
}
.ed-editor-footer {
    padding: 0.75rem 1.5rem; border-top: 1px solid rgba(255,255,255,0.06);
}
.ed-editor-status { font-size: 0.7rem; color: rgba(255,255,255,0.4); }
.ed-editor-mode-btn {
    background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.6); border: 1px solid rgba(255,255,255,0.1);
    padding: 0.4rem 0.8rem; border-radius: 6px; font-size: 0.7rem; font-weight: 700; cursor: pointer;
    text-transform: uppercase; letter-spacing: 0.06em;
}
.ed-editor-mode-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
/* Visual editor */
.ed-editor-visual { display: flex; flex-direction: column; gap: 0.75rem; max-height: 55vh; overflow-y: auto; }
.ed-ve-section { border-radius: 10px; padding: 1rem 1.25rem; position: relative; }
.ed-ve-section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 0.5rem; padding-bottom: 0.4rem; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.ed-ve-sec-label { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.5; }
.ed-ve-sec-actions { display: flex; gap: 0.3rem; }
.ed-ve-img-btn {
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.7); padding: 0.2rem 0.5rem; border-radius: 4px;
    font-size: 0.65rem; cursor: pointer; transition: all 0.15s;
}
.ed-ve-img-btn:hover { background: rgba(212,175,55,0.2); color: #d4af37; }
.ed-ve-img-row { margin-bottom: 0.75rem; }
.ed-ve-img-preview {
    width: 100%; height: 120px; border-radius: 6px;
    background-size: cover; background-position: center;
    background-color: rgba(0,0,0,0.3); position: relative;
    border: 1px solid rgba(255,255,255,0.06);
}
.ed-ve-img-url-hint {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: rgba(0,0,0,0.7); color: rgba(255,255,255,0.5);
    font-size: 0.55rem; padding: 0.2rem 0.5rem;
    border-radius: 0 0 6px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ed-ve-section [contenteditable="true"] {
    outline: none; cursor: text;
    border: 1px solid transparent; border-radius: 4px;
    padding: 0.3rem; transition: border-color 0.2s;
}
.ed-ve-section [contenteditable="true"]:focus { border-color: rgba(212,175,55,0.4); }
.ed-ve-section [contenteditable="true"]:hover { border-color: rgba(255,255,255,0.1); }
/* Toolbar extras */
.ed-tb-label { font-size: 0.6rem; font-weight: 700; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 0.06em; }
.ed-tb-select {
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8); padding: 0.25rem 0.4rem; border-radius: 4px;
    font-size: 0.7rem; cursor: pointer;
}
.ed-tb-color {
    width: 28px; height: 28px; border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px; cursor: pointer; padding: 0; background: transparent;
}

/* ========== INFINITE SCROLL ========== */
.news-load-more {
    text-align: center;
    padding: 2rem 0;
}
.news-load-more .loader-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
    margin: 0 3px;
    animation: newsLoaderBounce 1.4s ease-in-out infinite;
}
.news-load-more .loader-dots span:nth-child(2) { animation-delay: 0.16s; }
.news-load-more .loader-dots span:nth-child(3) { animation-delay: 0.32s; }
@keyframes newsLoaderBounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
    40% { transform: scale(1); opacity: 1; }
}
.news-end-marker {
    text-align: center;
    padding: 1.5rem 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* --- News Article Full View --- */
.news-article-modal {
    max-width: 720px;
    max-height: 90vh;
    overflow-y: auto;
}
.news-detail-hero {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 1rem;
}
.news-article-body {
    line-height: 1.7;
}
.news-article-content {
    color: var(--text-primary);
    font-size: 0.92rem;
}
.news-article-content h2,
.news-article-content h3 {
    color: var(--accent);
    margin: 1.2rem 0 0.5rem;
    font-size: 1.1rem;
}
.news-article-content p {
    margin-bottom: 0.8rem;
    line-height: 1.7;
}
.news-article-content ul,
.news-article-content ol {
    padding-left: 1.25rem;
    margin-bottom: 0.8rem;
}
.news-article-content li {
    margin-bottom: 0.35rem;
}
.news-article-content strong {
    color: var(--accent);
}
.news-article-content blockquote {
    border-left: 3px solid var(--accent-border);
    padding-left: 1rem;
    margin: 0.75rem 0;
    color: var(--text-secondary);
    font-style: italic;
}
.news-article-content a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.news-article-source {
    margin-top: 1.25rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--glass-border);
    font-size: 0.8rem;
}
.news-article-source a {
    color: var(--accent);
    text-decoration: none;
}
.news-article-source a:hover {
    text-decoration: underline;
}
.news-rewrite-area {
    text-align: center;
    padding: 1.5rem 0;
}
.news-article-raw p {
    color: var(--text-secondary);
    font-style: italic;
}

/* --- Research Follow-up Chat --- */
.research-thread {
    max-height: 60vh;
    overflow-y: auto;
    padding-bottom: 0.5rem;
}
.research-followup {
    position: sticky;
    bottom: 0;
    padding-top: 0.75rem;
    border-top: 1px solid var(--glass-border);
    background: var(--glass-bg);
}
.research-followup-input {
    display: flex;
    gap: 0.5rem;
}
.research-followup-field {
    flex: 1;
    padding: 0.6rem 0.8rem;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: var(--input-bg, rgba(255,255,255,0.05));
    color: var(--text-primary);
    font-size: 0.88rem;
    font-family: inherit;
    outline: none;
}
.research-followup-field:focus {
    border-color: var(--accent-border);
}
.research-followup-msg {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
}
.research-followup-msg.user {
    background: var(--accent-dim);
    border: 1px solid var(--accent-border);
    color: var(--accent);
    font-weight: 500;
    font-size: 0.9rem;
}
.research-followup-msg.assistant {
    background: transparent;
}
.research-followup-msg.assistant .research-content {
    margin-top: 0;
}
.research-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.research-result-header h3 {
    margin: 0;
    flex: 1;
}
.research-copy-btn {
    padding: 0.25rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--glass-border);
    background: rgba(255,255,255,0.06);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}
.research-copy-btn:hover {
    background: rgba(255,255,255,0.12);
    color: var(--text-primary);
    border-color: var(--accent-border);
}
.research-followup-msg.assistant .research-copy-btn {
    float: right;
    margin: 0 0 0.5rem 0.5rem;
}

/* --- Research History --- */
.research-history {
    margin-bottom: 1.25rem;
}
.research-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}
.research-history-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}
.research-history-count {
    font-size: 0.72rem;
    color: var(--text-muted, rgba(255,255,255,0.35));
    font-weight: 500;
}
.research-history-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    max-height: 340px;
    overflow-y: auto;
    padding-right: 0.25rem;
}
.research-history-grid::-webkit-scrollbar { width: 4px; }
.research-history-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }
@media (max-width: 500px) {
    .research-history-grid { grid-template-columns: 1fr; max-height: 260px; }
}
.research-history-card {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 0.65rem 0.8rem;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    text-align: left;
    font-family: inherit;
    transition: border-color 0.15s, background 0.15s;
}
.research-history-card:hover {
    border-color: var(--accent-border);
    background: rgba(255,255,255,0.06);
}
.research-history-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
    min-width: 0;
    cursor: pointer;
}
.research-history-delete {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-muted, rgba(255,255,255,0.3));
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    opacity: 0;
}
.research-history-card:hover .research-history-delete {
    opacity: 1;
}
.research-history-delete:hover {
    background: rgba(229,115,115,0.2);
    color: #e57373;
}
.research-history-query {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.research-history-preview {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.research-history-meta {
    font-size: 0.68rem;
    color: var(--text-muted, rgba(255,255,255,0.35));
    font-weight: 500;
}

/* ========== RESEARCH MODE ========== */
.research-panel {
    max-width: 700px;
    margin: 0 auto;
}
.research-input-area {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.research-input-area input {
    flex: 1;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
    font-size: 0.95rem;
}
.research-input-area input:focus {
    border-color: var(--accent);
    outline: none;
}
.research-input-area button {
    white-space: nowrap;
}
.research-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}
.research-chip {
    padding: 0.3rem 0.7rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}
.research-chip:hover {
    border-color: var(--accent-border);
    color: var(--accent);
    background: var(--accent-dim);
}
.research-result {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    backdrop-filter: blur(12px);
}
.research-result h3 {
    color: var(--accent);
    margin-bottom: 0.75rem;
    font-size: 1.05rem;
}
.research-result .research-content {
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 0.9rem;
}
.research-result .research-content h1,
.research-result .research-content h2,
.research-result .research-content h3,
.research-result .research-content h4 {
    color: var(--accent);
    margin: 0.75rem 0 0.4rem;
}
.research-result .research-content ul,
.research-result .research-content ol {
    padding-left: 1.25rem;
    margin: 0.5rem 0;
}
.research-result .research-content li {
    margin-bottom: 0.3rem;
}
.research-loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* ========== RESEARCH BUILD CARDS ========== */
.research-cards-section {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}
.research-cards-heading {
    color: var(--accent);
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.research-cards-heading::before { content: '\1F378'; }
.research-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}
.research-build-card {
    border: 1px solid var(--glass-border) !important;
    border-radius: 14px;
    padding: 1rem 1.25rem;
    background: var(--glass-bg);
    transition: border-color 0.2s, transform 0.15s;
    cursor: pointer;
}
.research-build-card:hover {
    border-color: var(--accent) !important;
    transform: translateY(-2px);
}
.research-build-card .category-label {
    color: var(--text-secondary);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.research-card-badge {
    display: inline-block;
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
    border-radius: 99px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.research-card-badge.in-collection {
    background: rgba(76,175,80,0.15);
    color: #4CAF50;
    border: 1px solid rgba(76,175,80,0.3);
}
.research-card-badge.new-suggestion {
    background: rgba(212,175,55,0.15);
    color: var(--accent);
    border: 1px solid rgba(212,175,55,0.3);
}
.research-build-card .card-header { margin-bottom: 0.75rem; }
.research-build-card h2 { font-size: 1.05rem; }
.research-build-card .ingredients ul { padding-left: 0; list-style: none; }
.research-build-card .ingredients li { padding: 0.2rem 0; font-size: 0.85rem; }
.research-build-card .ingredients .amount { color: var(--accent); font-weight: 600; margin-right: 0.4rem; }
.research-build-card .build-steps { margin-top: 0.75rem; }
.research-build-card .timeline-item { display: flex; align-items: flex-start; gap: 0.5rem; padding: 0.25rem 0; font-size: 0.85rem; }
.research-build-card .timeline-item .icon { flex-shrink: 0; }
.research-save-btn {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s;
}
.research-save-btn:disabled {
    opacity: 0.7;
    cursor: default;
}

/* ========== PWA INSTALL BANNER ========== */
.pwa-install-banner {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15,12,41,0.95);
    border: 1px solid var(--accent-border);
    border-radius: 12px;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 3000;
    backdrop-filter: blur(16px);
    font-size: 0.85rem;
    color: var(--text-primary);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.pwa-install-banner .btn-sm {
    background: var(--accent);
    color: #000;
    font-weight: 600;
}

/* ========== COMMUNITY VOTE BUTTON ========== */
.vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}
.vote-btn:hover, .vote-btn.voted {
    border-color: var(--accent-border);
    color: var(--accent);
    background: var(--accent-dim);
}
.vote-btn .vote-count {
    font-weight: 600;
}

/* ========== COMMUNITY TAB ========== */
.community-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.community-title {
    font-size: 1.2rem;
    color: var(--text-primary);
}
.community-sort {
    display: flex;
    gap: 0.3rem;
}
.community-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}
.community-card {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
    padding: 0;
}
.community-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-border);
}
.community-card-accent {
    height: 4px;
    width: 100%;
    opacity: 0.7;
}
.community-card-body {
    padding: 0.85rem 1rem;
}
.community-card-body h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}
.community-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}
.community-author {
    color: var(--accent);
    font-weight: 500;
}
.community-card-details {
    display: flex;
    gap: 0.4rem;
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}
.community-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.community-date {
    font-size: 0.68rem;
    color: var(--text-secondary);
}

/* ========== PUBLISH TOGGLE ========== */
.publish-toggle-group {
    border-top: 1px solid var(--glass-border);
    padding-top: 0.75rem;
    margin-top: 0.25rem;
}
.publish-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    flex-wrap: wrap;
}
.publish-toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}
.publish-toggle-label span:first-of-type {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}
.publish-hint {
    font-size: 0.72rem !important;
    color: var(--text-secondary) !important;
    font-weight: 400 !important;
    width: 100%;
    padding-left: 2rem;
}
