* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #FAF9F6;
    color: #000;
    line-height: 1.5;
}

/* ===========================================
   3-Column App Layout
   =========================================== */

.app-layout {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

/* Desktop: 3-column layout */
@media (min-width: 768px) {
    .app-layout {
        grid-template-columns: 260px minmax(280px, 1fr) minmax(320px, 1fr);
        grid-template-rows: 1fr;
    }

    .app-header {
        display: none !important; /* Header integrated into panels on desktop */
    }

    .sidebar {
        grid-column: 1;
        grid-row: 1;
    }

    .list-panel {
        grid-column: 2;
        grid-row: 1;
    }

    .detail-panel {
        grid-column: 3;
        grid-row: 1;
    }
}

/* Large desktop: slightly wider sidebar */
@media (min-width: 1200px) {
    .app-layout {
        grid-template-columns: 300px minmax(300px, 1fr) minmax(400px, 2fr);
    }
}

/* --- Mobile Header --- */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #FAF9F6;
    position: sticky;
    top: 0;
    z-index: 100;
}

@media (prefers-color-scheme: dark) {
    .app-header {
        background: #1e1e1e;
        border-bottom-color: #2e2e2e;
    }
}

.app-header-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.app-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.mobile-filter-toggle {
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.mobile-filter-toggle:active {
    background: #e8e8e8;
}

@media (prefers-color-scheme: dark) {
    .mobile-filter-toggle:active {
        background: #2e2e2e;
    }
}

/* --- Sidebar (Left Column) --- */
.sidebar {
    display: none; /* Hidden on mobile by default */
    flex-direction: column;
    background: #FAF9F6;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
    height: 100vh;
    position: sticky;
    top: 0;
}

@media (min-width: 768px) {
    .sidebar {
        display: flex;
    }
}

@media (prefers-color-scheme: dark) {
    .sidebar {
        background: #1e1e1e;
        border-right-color: #2e2e2e;
    }
}

.sidebar-content {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

/* Mobile sidebar overlay */
.sidebar.mobile-open {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px;
    z-index: 1000;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
}

.sidebar-backdrop.visible {
    display: block;
}

/* Mobile sidebar header */
.sidebar-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.sidebar.mobile-open .sidebar-header {
    display: flex;
}

@media (prefers-color-scheme: dark) {
    .sidebar-header {
        border-bottom-color: #2e2e2e;
    }
}

.sidebar-close {
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

/* --- List Panel (Middle Column) --- */
.list-panel {
    display: flex;
    flex-direction: column;
    background: #FAF9F6;
    overflow: hidden;
    height: 100vh;
}

@media (max-width: 767px) {
    .list-panel {
        height: calc(100vh - 65px); /* Account for mobile header */
    }
}

@media (prefers-color-scheme: dark) {
    .list-panel {
        background: #1e1e1e;
    }
}

.list-panel-header {
    display: none; /* Hidden by default, shown when viewing a menu */
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.list-panel-header.visible {
    display: flex;
}

/* Always hide on mobile (app-header shows title instead) */
@media (max-width: 767px) {
    .list-panel-header.visible {
        display: none;
    }
}

@media (prefers-color-scheme: dark) {
    .list-panel-header {
        border-bottom-color: #2e2e2e;
    }
}

.list-panel-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.list-panel-actions {
    display: flex;
    gap: 8px;
}

.list-panel-description {
    padding: 0 20px 16px 20px;
    font-size: 14px;
    color: #666;
    border-bottom: 1px solid #e0e0e0;
}

@media (prefers-color-scheme: dark) {
    .list-panel-description {
        color: #999;
        border-bottom-color: #2e2e2e;
    }
}

.list-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px;
}

/* --- Detail Panel (Right Column) --- */
.detail-panel {
    display: none; /* Hidden on mobile by default */
    flex-direction: column;
    background: #FAF9F6;
    border-left: 1px solid #e0e0e0;
    overflow: hidden;
    height: 100vh;
}

@media (min-width: 768px) {
    .detail-panel {
        display: flex !important;
    }
}

@media (prefers-color-scheme: dark) {
    .detail-panel {
        background: #1e1e1e;
        border-left-color: #2e2e2e;
    }
}

.detail-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

@media (prefers-color-scheme: dark) {
    .detail-panel-header {
        border-bottom-color: #2e2e2e;
    }
}

.detail-panel-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-panel-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.detail-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.detail-panel-empty {
    text-align: center;
    color: #999;
    padding: 40px;
}

/* Mobile detail overlay */
.detail-panel.mobile-open {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
}

/* On desktop, reset mobile-open overlay to normal grid positioning */
@media (min-width: 768px) {
    .detail-panel.mobile-open {
        position: static;
        z-index: auto;
    }
}

/* --- Shared Button Styles --- */
.btn-icon {
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #666;
}

.btn-icon:hover {
    background: #e8e8e8;
}

@media (prefers-color-scheme: dark) {
    .btn-icon {
        color: #999;
    }

    .btn-icon:hover {
        background: #2e2e2e;
    }
}

.btn-primary {
    padding: 8px 16px;
    font-size: 14px;
    background: #000;
    color: #FAF9F6;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    min-height: 36px;
    white-space: nowrap;
}

.btn-primary:hover {
    opacity: 0.8;
}

@media (prefers-color-scheme: dark) {
    .btn-primary {
        background: #FAF9F6;
        color: #000;
    }
}

.btn-secondary {
    padding: 8px 16px;
    font-size: 14px;
    background: #e8e8e8;
    color: #000;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    min-height: 36px;
}

@media (prefers-color-scheme: dark) {
    .btn-secondary {
        background: #2e2e2e;
        color: #FAF9F6;
    }
}

/* ===========================================
   Sidebar Components
   =========================================== */

/* Sidebar title */
.sidebar-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.sidebar-title-text {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    cursor: pointer;
}

.sidebar-title-text:hover {
    opacity: 0.7;
}

/* Hide close button on desktop */
@media (min-width: 768px) {
    .sidebar-title .sidebar-close {
        display: none;
    }
}

/* Search in sidebar */
.sidebar-search {
    margin-bottom: 20px;
}

.sidebar-search .search-box {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 8px;
}

/* Collapsible filter sections */
.filter-section-collapsible {
    margin-bottom: 16px;
}

.filter-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 8px 0;
    user-select: none;
}

.filter-section-header:hover {
    opacity: 0.7;
}

.filter-section-title {
    font-size: 14px;
    font-weight: 600;
}

.filter-section-toggle {
    font-size: 12px;
    color: #666;
    transition: transform 0.2s;
}

.filter-section-collapsible.collapsed .filter-section-toggle {
    transform: rotate(-90deg);
}

.filter-section-content {
    padding-top: 8px;
}

.filter-section-collapsible.collapsed .filter-section-content {
    display: none;
}

/* Sidebar divider */
.sidebar-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 20px 0;
}

@media (prefers-color-scheme: dark) {
    .sidebar-divider {
        background: #2e2e2e;
    }
}

/* Menus section in sidebar */
.sidebar-menus-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.sidebar-menus-title {
    font-size: 14px;
    font-weight: 600;
}

.sidebar-menus-add {
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: #666;
}

.sidebar-menus-add:hover {
    background: #e8e8e8;
}

@media (prefers-color-scheme: dark) {
    .sidebar-menus-add {
        color: #999;
    }

    .sidebar-menus-add:hover {
        background: #2e2e2e;
    }
}

.sidebar-menu-list {
    list-style: none;
}

.sidebar-menu-item {
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 2px;
}

.sidebar-menu-item:hover {
    background: #e8e8e8;
}

.sidebar-menu-item.active {
    background: #e8e8e8;
    font-weight: 600;
}

@media (prefers-color-scheme: dark) {
    .sidebar-menu-item:hover,
    .sidebar-menu-item.active {
        background: #2e2e2e;
    }
}

/* ===========================================
   List Items
   =========================================== */

.list-item {
    padding: 14px 0;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.list-item:hover {
    background: #f5f5f5;
    margin: 0 -20px;
    padding-left: 20px;
    padding-right: 20px;
}

.list-item.active {
    background: #e8e8e8;
    margin: 0 -20px;
    padding-left: 20px;
    padding-right: 20px;
}

@media (prefers-color-scheme: dark) {
    .list-item {
        border-bottom-color: #2e2e2e;
    }

    .list-item:hover {
        background: #252525;
    }

    .list-item.active {
        background: #2e2e2e;
    }
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-name {
    font-size: 16px;
    margin-bottom: 2px;
}

.list-item-meta {
    font-size: 13px;
    color: #666;
}

@media (prefers-color-scheme: dark) {
    .list-item-meta {
        color: #999;
    }
}

/* Checkbox list items (for menu editing) */
.list-item-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
}

.list-item-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.list-item-controls {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}

.list-item:hover .list-item-controls,
.list-item.in-menu .list-item-controls {
    opacity: 1;
}

.list-item-control-btn {
    width: 28px;
    height: 28px;
    background: #e0e0e0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.list-item-control-btn:hover {
    background: #ccc;
}

.list-item-control-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

@media (prefers-color-scheme: dark) {
    .list-item-control-btn {
        background: #3e3e3e;
        color: #FAF9F6;
    }

    .list-item-control-btn:hover {
        background: #4e4e4e;
    }
}

/* ===========================================
   Legacy Styles (keeping for compatibility)
   =========================================== */

.main-view, .menu-view {
    max-width: 600px;
}

@media (prefers-color-scheme: dark) {
    body {
        background: #1e1e1e !important;
        color: #FAF9F6;
    }

    input[type="text"] {
        background: #2e2e2e !important;
        color: #FAF9F6;
        border-color: #0e0e0e;
    }

    .filter-btn, .experience-btn {
        background: #2e2e2e !important;
        color: #FAF9F6;
    }

    .filter-btn.active , .experience-btn.active, input[type="text"]:active, input[type="text"]:focus-within {
        background: #060606 !important;
        color: #FAF9F6;
    }

    .drink-item {
        border-bottom-color: #2e2e2e !important;
    }

    .detail-view {
        background: #1E1E1E !important;
    }

    .close-btn {
        color: #5E5E5C !important;
    }
}

.header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    width: 100%;
    max-width: 100%;
    position: sticky;
    top: 0;
    background: #FAF9F6;
    z-index: 1100;
    padding: 20px 0 0 0;
}

@media (prefers-color-scheme: dark) {
    .header-nav {
        background: #1e1e1e;
    }
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-toggle {
    font-size: 28px;
    margin: 0;
    cursor: pointer;
    color: #999;
    text-decoration: none;
    transition: color 0.2s;
}

.nav-toggle:hover {
    color: #666;
}

.nav-toggle.active {
    color: #000;
}

@media (prefers-color-scheme: dark) {
    .nav-toggle {
        color: #666;
    }

    .nav-toggle:hover {
        color: #999;
    }

    .nav-toggle.active {
        color: #FAF9F6;
    }
}

.nav-divider {
    font-size: 28px;
    color: #ccc;
    user-select: none;
}

@media (prefers-color-scheme: dark) {
    .nav-divider {
        color: #444;
    }
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-btn {
    padding: 8px 16px;
    font-size: 14px;
    background: #000;
    color: #FAF9F6;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    font-family: inherit;
    min-height: 32px;
    white-space: nowrap;
}

.header-btn:hover {
    opacity: 0.8;
}

.header-btn.secondary {
    background: #e8e8e8;
    color: #000;
}

@media (prefers-color-scheme: dark) {
    .header-btn {
        background: #FAF9F6;
        color: #000;
    }

    .header-btn.secondary {
        background: #2e2e2e;
        color: #FAF9F6;
    }
}

.header-close-btn {
    width: 32px;
    height: 32px;
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (prefers-color-scheme: dark) {
    .header-close-btn {
        color: #999;
    }
}

h1, h2 {
    font-size: 28px;
    margin-bottom: 20px;
}

.search-container {
    position: relative;
    margin-bottom: 20px;
}

.search-box {
    width: 100%;
    padding: 12px 40px 12px 12px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 8px;
}

.search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.search-clear.visible {
    display: flex;
}

.search-clear:hover {
    color: #666;
}

@media (prefers-color-scheme: dark) {
    .search-clear {
        color: #FAF9F6;
    }

    .search-clear:hover {
        color: #999;
    }
}

.filter-section {
    margin-bottom: 24px;
}

.filter-label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-btn {
    padding: 8px 16px;
    font-size: 14px;
    background: #e8e8e8;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    min-height: 44px;
    transition: background 0.2s;
}

.filter-btn:active {
    opacity: 0.7;
}

.filter-btn.active {
    background: #333;
    color: #fff;
}

@media (prefers-color-scheme: dark) {
    .filter-btn {
        background: #171717;
        color: #FAF9F6;
    }

    .filter-btn.active {
        background: #060606;
        color: #FAF9F6;
    }
}

.experience-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    max-width: 400px;
}

.experience-btn {
    padding: 12px 8px;
    font-size: 14px;
    background: #e8e8e8;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    min-height: 60px;
    transition: background 0.2s;
    text-align: center;
}

.experience-btn:active {
    opacity: 0.7;
}

.experience-btn.active {
    background: #333;
    color: #fff;
}

@media (prefers-color-scheme: dark) {
    .experience-btn {
        background: #171717;
        color: #FAF9F6;
    }

    .experience-btn.active {
        background: #060606;
        color: #FAF9F6;
    }
}

.active-filters {
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
    height:20px;
}

@media (prefers-color-scheme: dark) {
    .active-filters {
        color: #FAF9F6;
    }
}

.clear-filters {
    margin-left: 8px;
    padding: 4px 12px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

@media (prefers-color-scheme: dark) {
    .clear-filters {
        background: #060606;
        color: #FAF9F6;
    }
}

.drinks-list {
    margin-top: 24px;
}

.drink-item {
    padding: 16px 0;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    font-size: 18px;
    min-height: 44px;
    display: flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.drink-item:active {
    opacity: 0.6;
}

.drink-item:visited {
    color: inherit;
}

.no-results {
    padding: 40px 0;
    text-align: center;
    color: #999;
}

/* Legacy detail-view - hidden, using new 3-column layout instead */
.detail-view {
    display: none !important;
}

.detail-header {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 12px;
    z-index: 1001;
}

.detail-edit-btn {
    height: 44px;
    padding: 0 20px;
    font-size: 16px;
    background: #000;
    color: #FAF9F6;
    border: none;
    border-radius: 22px;
    cursor: pointer;
    font-family: inherit;
}

.detail-edit-btn:hover {
    opacity: 0.8;
}

@media (prefers-color-scheme: dark) {
    .detail-edit-btn {
        background: #FAF9F6;
        color: #000;
    }
}

.close-btn {
    width: 44px;
    height: 44px;
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    color: #000;
}

.detail-content {
    max-width: 600px;
    padding-top: 20px;
}

.detail-title {
    font-size: 28px;
    margin-bottom: 8px;
}

.detail-meta {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

@media (prefers-color-scheme: dark) {
    .detail-meta {
        color: #FAF9F6;
    }
}

.detail-section {
    margin-bottom: 24px;
}

.detail-section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.detail-section-content {
    font-size: 16px;
    line-height: 1.6;
}

/* Recipe formatting - measurements and ingredients */
.recipe-measurement {
    font-weight: 600;
    color: #c41e3a;
}

.recipe-ingredient {
    font-weight: 600;
}

@media (prefers-color-scheme: dark) {
    .recipe-measurement {
        color: #ff6b6b;
    }
}

.quadrant-canvas {
    width: 220px;
    height: 220px;
    display: block;
}

#filter-canvas {
    cursor: pointer;
}

.experience-grid-layout {
    display: inline-grid;
    grid-template-columns: auto 220px auto;
    grid-template-rows: auto auto auto;
    gap: 0;
    margin-top: 12px;
}

/* Smaller canvas in sidebar */
.sidebar .experience-grid-layout {
    grid-template-columns: auto 160px auto;
}

.sidebar .quadrant-canvas {
    width: 160px !important;
    height: 160px !important;
}

.sidebar .experience-grid-layout .label-top,
.sidebar .experience-grid-layout .label-bottom {
    width: 160px;
}

/* Filter buttons in sidebar */
.sidebar .filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sidebar .filter-btn {
    padding: 6px 12px;
    font-size: 13px;
    min-height: 32px;
}

.sidebar .experience-grid-layout .label {
    font-size: 12px;
}

.experience-grid-layout .label {
    font-size: 16px;
}

.experience-grid-layout .label-top {
    grid-column: 2;
    grid-row: 1;
    text-align: center;
    padding-bottom: 4px;
    width: 220px;
}

.experience-grid-layout .label-left {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    padding-right: 4px;
}

.experience-grid-layout .canvas-cell {
    grid-column: 2;
    grid-row: 2;
}

.experience-grid-layout .label-right {
    grid-column: 3;
    grid-row: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    writing-mode: vertical-rl;
    padding-left: 4px;
}

.experience-grid-layout .label-bottom {
    grid-column: 2;
    grid-row: 3;
    text-align: center;
    padding-top: 4px;
    width: 220px;
}

@media (prefers-color-scheme: dark) {
    .experience-grid-layout .label {
        color: #FAF9F6;
    }
}

/* Add/Edit Form Styles */
.form-view {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #FAF9F6;
    padding: 88px 20px 20px 20px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.form-view.active {
    display: block;
}

@media (prefers-color-scheme: dark) {
    .form-view {
        background: #1e1e1e;
    }
}

.form-container {
    max-width: 600px;
}

.form-title {
    font-size: 28px;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: inherit;
    background: #fff;
    color: #000;
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #333;
}

@media (prefers-color-scheme: dark) {
    .form-input,
    .form-textarea,
    .form-select {
        background: #2e2e2e;
        color: #FAF9F6;
        border-color: #0e0e0e;
    }

    .form-input:focus,
    .form-textarea:focus,
    .form-select:focus {
        border-color: #FAF9F6;
    }
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

.btn {
    flex: 1;
    padding: 14px;
    font-size: 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    min-height: 44px;
}

.btn-primary {
    background: #333;
    color: #fff;
}

.btn-secondary {
    background: #e8e8e8;
    color: #000;
}

.btn:active {
    opacity: 0.8;
}

@media (prefers-color-scheme: dark) {
    .btn-primary {
        background: #FAF9F6;
        color: #1e1e1e;
    }

    .btn-secondary {
        background: #2e2e2e;
        color: #FAF9F6;
    }
}

.form-hint {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

@media (prefers-color-scheme: dark) {
    .form-hint {
        color: #999;
    }
}

/* Checkbox/Radio grid */
.checkbox-grid,
.radio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.checkbox-label,
.radio-label {
    display: flex;
    align-items: center;
    font-size: 14px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.checkbox-label:hover,
.radio-label:hover {
    background: #f0f0f0;
}

.checkbox-label input,
.radio-label input[type="radio"],
.radio-label input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

@media (prefers-color-scheme: dark) {
    .checkbox-label:hover,
    .radio-label:hover {
        background: #2e2e2e;
    }
}

/* Custom input with radio */
.radio-custom {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px;
    align-items: center;
}

.radio-custom input[type="text"] {
    padding: 8px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    color: #000;
}

.radio-custom input[type="text"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (prefers-color-scheme: dark) {
    .radio-custom input[type="text"] {
        background: #2e2e2e;
        color: #FAF9F6;
        border-color: #0e0e0e;
    }
}

/* Experience grid selector */
.experience-selector {
    display: grid;
    grid-template-columns: auto 220px auto;
    grid-template-rows: auto auto auto;
    gap: 0;
    margin-top: 12px;
    justify-items: start;
}

.exp-label {
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
}

@media (prefers-color-scheme: dark) {
    .exp-label {
        color: #FAF9F6;
    }
}

.exp-label-top {
    grid-column: 2;
    grid-row: 1;
    text-align: center;
    padding-bottom: 4px;
    width: 220px;
}

.exp-label-left {
    grid-column: 1;
    grid-row: 2;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    padding-right: 4px;
}

.exp-label-right {
    grid-column: 3;
    grid-row: 2;
    writing-mode: vertical-rl;
    padding-left: 4px;
}

.exp-label-bottom {
    grid-column: 2;
    grid-row: 3;
    text-align: center;
    padding-top: 4px;
    width: 220px;
}

.exp-grid {
    grid-column: 2;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(11, 1fr);
    grid-template-rows: repeat(11, 1fr);
    gap: 1px;
    background: #ddd;
    border: 2px solid #000;
    width: 220px;
    height: 220px;
}

@media (prefers-color-scheme: dark) {
    .exp-grid {
        background: #333;
        border-color: #5E5E5C;
    }
}

.exp-cell {
    background: #fff;
    cursor: pointer;
    position: relative;
    transition: background 0.15s;
}

.exp-cell:hover:not(.axis-v):not(.axis-h):not(.axis-center) {
    background: #f5f5f5;
}

.exp-cell.selected {
    background: #000;
}

@media (prefers-color-scheme: dark) {
    .exp-cell {
        background: #1a1a1a;
    }

    .exp-cell:hover:not(.axis-v):not(.axis-h):not(.axis-center) {
        background: #2a2a2a;
    }

    .exp-cell.selected {
        background: #FAF9F6;
    }
}

/* Axis lines - styled to match canvas */
.exp-cell.axis-v {
    background: #e8e8e8;
}

.exp-cell.axis-h {
    background: #e8e8e8;
}

.exp-cell.axis-center {
    background: #5E5E5C;
}

@media (prefers-color-scheme: dark) {
    .exp-cell.axis-v {
        background: #2a2a2a;
    }

    .exp-cell.axis-h {
        background: #2a2a2a;
    }

    .exp-cell.axis-center {
        background: #5E5E5C;
    }
}

/* Menu Styles */
.menu-view {
    max-width: 600px;
    display: none;
}

.menu-view.active {
    display: block;
}

.create-menu-btn {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    background: #000;
    color: #FAF9F6;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    margin-bottom: 20px;
    min-height: 44px;
}

.create-menu-btn:hover {
    opacity: 0.8;
}

@media (prefers-color-scheme: dark) {
    .create-menu-btn {
        background: #FAF9F6;
        color: #000;
    }
}

.menu-detail-view {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #FAF9F6;
    padding: 88px 20px 20px 20px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.menu-detail-view.active {
    display: block;
}

@media (prefers-color-scheme: dark) {
    .menu-detail-view {
        background: #1E1E1E;
    }
}

.menu-detail-content {
    max-width: 600px;
    padding-top: 20px;
}

.menu-detail-header {
    margin-bottom: 30px;
}

.menu-detail-title {
    font-size: 28px;
    margin-bottom: 8px;
}

.menu-cocktail-item {
    padding: 16px 0;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.menu-cocktail-info {
    flex: 1;
    cursor: pointer;
}

.menu-cocktail-info:active {
    opacity: 0.6;
}

.menu-cocktail-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.menu-cocktail-meta {
    font-size: 14px;
    color: #666;
}

.menu-cocktail-controls {
    display: flex;
    gap: 8px;
}

.reorder-btn, .remove-btn {
    width: 32px;
    height: 32px;
    font-size: 16px;
    background: #e0e0e0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reorder-btn:hover, .remove-btn:hover {
    background: #ccc;
}

.reorder-btn:active, .remove-btn:active {
    opacity: 0.6;
}

@media (prefers-color-scheme: dark) {
    .menu-cocktail-item {
        border-bottom-color: #2e2e2e;
    }

    .reorder-btn, .remove-btn {
        background: #3e3e3e;
        color: #FAF9F6;
    }

    .reorder-btn:hover, .remove-btn:hover {
        background: #4e4e4e;
    }
}

.add-cocktail-btn, .save-menu-btn, .delete-menu-btn {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    background: #000;
    color: #FAF9F6;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    margin-top: 20px;
    min-height: 44px;
}

.add-cocktail-btn:hover, .save-menu-btn:hover {
    opacity: 0.8;
}

.delete-menu-btn {
    background: #dc3545;
}

.delete-menu-btn:hover {
    background: #c82333;
}

@media (prefers-color-scheme: dark) {
    .add-cocktail-btn, .save-menu-btn {
        background: #FAF9F6;
        color: #000;
    }
}

.cocktail-selector {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #FAF9F6;
    padding: 20px;
    overflow-y: auto;
    z-index: 1100;
    display: none;
}

.cocktail-selector.active {
    display: block;
}

@media (prefers-color-scheme: dark) {
    .cocktail-selector {
        background: #1E1E1E;
    }
}

.cocktail-selector .header-nav,
.cocktail-selector .search-container,
.cocktail-selector .active-filters,
.cocktail-selector .filter-section,
.cocktail-selector .cocktail-selector-list {
    max-width: 600px;
}

.selector-item {
    padding: 16px 0;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.selector-item:active {
    opacity: 0.6;
}

.selector-item-info {
    flex: 1;
}

.selector-item-name {
    font-size: 18px;
    margin-bottom: 2px;
}

.selector-item.selected .selector-item-name {
    font-weight: 600;
}

.selector-item-meta {
    font-size: 14px;
    color: #666;
}

.selector-checkmark {
    font-size: 20px;
    margin-left: 12px;
}

@media (prefers-color-scheme: dark) {
    .selector-item {
        border-bottom-color: #2e2e2e;
    }
}

.menu-form {
    max-width: 600px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-input, .form-textarea {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: inherit;
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

@media (prefers-color-scheme: dark) {
    .form-input, .form-textarea {
        background: #2e2e2e;
        color: #FAF9F6;
        border-color: #3e3e3e;
    }
}
