/* === 液態玻璃動畫變數 === */
@property --angle-1 {
    syntax: "<angle>";
    inherits: false;
    initial-value: -75deg;
}

@property --angle-2 {
    syntax: "<angle>";
    inherits: false;
    initial-value: -45deg;
}

:root {
    /* 🌙 Dark Mode - 科技黑 */
    --color-background: #0F0F1B;
    --color-text-primary: #ffffff;
    --color-text-secondary: rgba(255, 255, 255, 0.7);
    --color-glass-bg: rgba(255, 255, 255, 0.03);
    --color-glass-border: rgba(255, 255, 255, 0.1);
    --color-glass-hover: rgba(255, 255, 255, 0.08);
    --color-input-bg: rgba(0, 0, 0, 0.4);
    --color-accent: #a7a7d1;
    --color-accent-hover: rgba(167, 167, 209, 0.2);
    --color-heart: #ff4757;

    /* 液態按鈕專屬變數 */
    --color-button-shadow-1: rgba(0, 0, 0, 0.05);
    --color-button-shadow-2: rgba(255, 255, 255, 0.5);
    --color-button-shadow-3: rgba(0, 0, 0, 0.2);
    --color-button-shadow-4: rgba(255, 255, 255, 0.2);
    --anim--hover-time: 400ms;
    --anim--hover-ease: cubic-bezier(0.25, 1, 0.5, 1);

    --sidebar-width: 260px;
}

body.light-mode {
    /* ☕ Light Mode - 溫暖拿鐵 */
    --color-background: #F7F4EF;
    --color-text-primary: #3E2723;
    --color-text-secondary: #795C54;
    --color-glass-bg: rgba(255, 255, 255, 0.6);
    --color-glass-border: rgba(111, 78, 55, 0.15);
    --color-glass-hover: rgba(255, 255, 255, 0.9);
    --color-input-bg: rgba(255, 255, 255, 0.8);
    --color-accent: #6F4E37;
    --color-accent-hover: rgba(111, 78, 55, 0.1);
    --color-heart: #D84315;

    /* 液態按鈕淺色變數 */
    --color-button-shadow-1: rgba(255, 255, 255, 0.8);
    --color-button-shadow-2: rgba(0, 0, 0, 0.1);
    --color-button-shadow-3: rgba(0, 0, 0, 0.05);
    --color-button-shadow-4: rgba(255, 255, 255, 0.5);
}

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

html,
body {
    min-height: 100%;
    overflow: hidden;
    font-family: "Inter", "Noto Sans TC", sans-serif;
}

body {
    min-height: 100dvh;
    background-color: var(--color-background);
    background-image: url('https://github.com/chunsheng612/FunFun.AI-Website/blob/main/ai-tools-bg-black.png?raw=true');
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    color: var(--color-text-primary);
    transition: background-color 0.5s ease, color 0.5s ease, background-image 0.5s ease;
}

body.light-mode {
    background-image: url('https://github.com/chunsheng612/FunFun.AI-Website/blob/main/ai-tools-bg-light.png?raw=true');
}

#tsparticles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* === Animations === */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(25px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heartBounce {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.35);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* === App Layout === */
.app-container {
    display: flex;
    height: 100dvh;
    width: 100vw;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.glass-panel {
    background-color: var(--color-glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--color-glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    margin: 16px 0 16px 16px;
    border-radius: 20px;
    overflow-y: auto;
    padding: 24px 12px;
    transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), margin 0.4s ease, opacity 0.3s ease;
    z-index: 100;
    scrollbar-width: none;
}

.sidebar::-webkit-scrollbar {
    display: none;
}

.sidebar.collapsed-desktop {
    width: 0;
    margin: 0;
    padding: 0;
    opacity: 0;
    border: none;
    pointer-events: none;
}

body.sidebar-closed .sidebar {
    width: 0;
    margin: 0;
    padding: 0;
    opacity: 0;
    border: none;
    pointer-events: none;
}

body:not(.sidebar-closed) .sidebar {
    opacity: 1;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 10px 18px;
    border-bottom: 1px solid var(--color-glass-border);
    margin-bottom: 10px;
}

.sidebar-brand strong,
.sidebar-brand span {
    display: block;
}

.sidebar-brand strong {
    color: var(--color-text-primary);
    font-size: 1rem;
}

.sidebar-brand span {
    margin-top: 3px;
    color: var(--color-text-secondary);
    font-size: 0.78rem;
}

.nav-section-title {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    margin: 16px 0 8px 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    text-align: left;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    margin-bottom: 4px;
}

.nav-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.2s;
}

.nav-btn:hover {
    background: var(--color-glass-hover);
    color: var(--color-text-primary);
    transform: translateX(4px);
}

.nav-btn.active {
    background: var(--color-accent);
    color: #fff;
    font-weight: 600;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body.light-mode .nav-btn.active {
    color: #fff;
}

/* --- Main Content Area --- */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: visible;
}

/* --- Topbar --- */
.topbar {
    height: 68px;
    min-height: 68px;
    margin: 16px 16px 0 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    gap: 24px;
    flex-shrink: 0;
    position: relative;
    z-index: 30;
    overflow: visible;
}

.brand-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hamburger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--color-text-primary);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: all 0.2s;
    margin-left: -4px;
}

.hamburger-btn:hover {
    background: var(--color-accent-hover);
}

.hamburger-btn svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    fill: none;
}

.brand-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    transition: transform 0.3s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.brand-area:hover .brand-avatar {
    transform: scale(1.05) rotate(-2deg);
}

.brand-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text-primary);
    letter-spacing: 0.5px;
}

/* Search Area */
.search-container {
    flex: 1;
    max-width: 400px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--color-text-secondary);
    pointer-events: none;
}

#search-input {
    width: 100%;
    background: var(--color-input-bg);
    border: 1px solid var(--color-glass-border);
    border-radius: 99px;
    padding: 10px 36px 10px 40px;
    color: var(--color-text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    font-family: inherit;
}

#search-input:focus {
    border-color: var(--color-accent);
    width: 105%;
    box-shadow: 0 0 0 3px var(--color-accent-hover);
}

#search-input::placeholder {
    color: var(--color-text-secondary);
    opacity: 0.7;
}

.clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    display: none;
    padding: 4px;
    font-size: 14px;
    transition: transform 0.2s;
}

.clear-btn:hover {
    color: var(--color-text-primary);
    transform: translateY(-50%) scale(1.2);
}

.mobile-search-btn,
.mobile-search-back {
    display: none;
    background: transparent;
    border: none;
    color: var(--color-text-primary);
    cursor: pointer;
    padding: 8px;
}

.mobile-search-btn svg,
.mobile-search-back svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 登入按鈕 (Firebase) */
.auth-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    background: var(--color-input-bg);
    border: 1px solid var(--color-glass-border);
    padding: 6px 14px;
    border-radius: 99px;
    color: var(--color-text-primary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    backdrop-filter: blur(12px);
}

.auth-btn:hover {
    background: var(--color-accent-hover);
    border-color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.auth-btn img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: none;
    object-fit: cover;
}

.auth-btn span {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

.sidebar-auth {
    justify-content: center;
    width: calc(100% - 8px);
    margin: 4px;
    padding: 11px 14px;
}

.icon-btn {
    background: var(--color-input-bg);
    border: 1px solid var(--color-glass-border);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-primary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.icon-btn:hover {
    background: var(--color-accent-hover);
    border-color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.icon-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* --- Content Area --- */
.content-area {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 24px 16px;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
}

.content-area::-webkit-scrollbar {
    width: 6px;
}

.content-area::-webkit-scrollbar-track {
    background: transparent;
}

.content-area::-webkit-scrollbar-thumb {
    background: var(--color-glass-border);
    border-radius: 3px;
}

.section-header {
    margin-bottom: 24px;
    padding-left: 4px;
}

.section-title {
    font-size: 1.35rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-text-primary);
}

.section-title svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

/* --- Tool Grid & Cards --- */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 20px;
    padding-bottom: 20px;
    flex: 1;
    align-content: start;
}

.tool-card {
    background: var(--color-glass-bg);
    border: 1px solid var(--color-glass-border);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease;
    opacity: 0;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.tool-card.hidden {
    display: none !important;
}

.tool-card:hover {
    border-color: var(--color-accent);
    background: var(--color-glass-hover);
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding-right: 28px;
}

.card-icon {
    color: var(--color-accent);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-input-bg);
    padding: 8px;
    border-radius: 12px;
    border: 1px solid var(--color-glass-border);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.card-icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.tool-card:hover .card-icon {
    transform: scale(1.1) rotate(-3deg);
}

.tool-name {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.35;
    margin-top: 2px;
    color: var(--color-text-primary);
}

.tool-description {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: auto;
    min-height: 2.8rem;
}

/* Heart Favorite Button */
.fav-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-text-secondary);
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.4;
    z-index: 10;
}

.tool-card:hover .fav-btn {
    opacity: 1;
}

.fav-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    transition: all 0.2s;
}

.fav-btn:hover {
    color: var(--color-heart);
    background: rgba(255, 71, 87, 0.1);
}

.fav-btn.active {
    color: var(--color-heart);
    opacity: 1;
}

.fav-btn.active svg {
    fill: currentColor;
    stroke: currentColor;
    animation: heartBounce 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* === 🏆 完美回歸：液態玻璃按鈕 (強制置左、不拉長) === */
.card-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
    justify-content: flex-start;
}

.button-wrap {
    flex: 0 0 calc(50% - 5px);
    min-width: 0;
    position: relative;
    z-index: 2;
    border-radius: 999vw;
    background: transparent;
    pointer-events: none;
}

.button-wrap button {
    --border-width: 2px;
    all: unset;
    cursor: pointer;
    position: relative;
    pointer-events: auto;
    z-index: 3;
    background: linear-gradient(-75deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    border-radius: 999vw;
    box-shadow: inset 0 0.125em 0.125em var(--color-button-shadow-1), inset 0 -0.125em 0.125em var(--color-button-shadow-2), 0 0.25em 0.125em -0.125em var(--color-button-shadow-3), 0 0 0.1em 0.25em inset var(--color-button-shadow-4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: transform var(--anim--hover-time) var(--anim--hover-ease);
    display: flex;
    justify-content: center;
    width: 100%;
    height: 100%;
}

body.light-mode .button-wrap button {
    background: linear-gradient(-75deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.02));
}

.button-wrap button:hover {
    transform: scale(0.97);
}

.button-wrap button:active {
    transform: scale(0.94);
    background: linear-gradient(-75deg, rgba(150, 120, 255, 0.1), rgba(180, 150, 255, 0.3), rgba(150, 120, 255, 0.1));
}

.button-wrap button span {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 0.85rem;
    line-height: 1.25;
    color: var(--color-text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    padding: 0.7em 0.8em;
    width: 100%;
    text-align: center;
    white-space: normal;
    word-break: keep-all;
}

body.light-mode .button-wrap button span {
    text-shadow: none;
    font-weight: 600;
}

.button-wrap button span::after {
    content: "";
    display: block;
    position: absolute;
    z-index: 1;
    width: calc(100% - var(--border-width));
    height: calc(100% - var(--border-width));
    top: calc(0% + var(--border-width) / 2);
    left: calc(0% + var(--border-width) / 2);
    box-sizing: border-box;
    border-radius: 999vw;
    overflow: clip;
    background: linear-gradient(var(--angle-2), rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.4) 40% 50%, rgba(255, 255, 255, 0) 55%);
    mix-blend-mode: screen;
    pointer-events: none;
    background-size: 200% 200%;
    background-position: 0% 50%;
    transition: background-position calc(var(--anim--hover-time) * 1.25) var(--anim--hover-ease), --angle-2 calc(var(--anim--hover-time) * 1.25) var(--anim--hover-ease);
}

body.light-mode .button-wrap button span::after {
    mix-blend-mode: normal;
    background: linear-gradient(var(--angle-2), rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.6) 40% 50%, rgba(255, 255, 255, 0) 55%);
}

.button-wrap button:hover span::after {
    background-position: 25% 50%;
}

.button-wrap button::after {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 0;
    border-radius: 999vw;
    width: calc(100% + var(--border-width));
    height: calc(100% + var(--border-width));
    top: calc(0% - var(--border-width) / 2);
    left: calc(0% - var(--border-width) / 2);
    padding: var(--border-width);
    box-sizing: border-box;
    background: conic-gradient(from var(--angle-1) at 50% 50%, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0) 5% 40%, rgba(0, 0, 0, 0.5) 50%, rgba(0, 0, 0, 0) 60% 95%, rgba(0, 0, 0, 0.5)), linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5));
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    transition: all var(--anim--hover-time) var(--anim--hover-ease), --angle-1 500ms ease;
    box-shadow: inset 0 0 0 calc(var(--border-width) / 2) rgba(255, 255, 255, 0.5);
}

body.light-mode .button-wrap button::after {
    background: conic-gradient(from var(--angle-1) at 50% 50%, rgba(111, 78, 55, 0.2), rgba(0, 0, 0, 0) 5% 40%, rgba(111, 78, 55, 0.2) 50%, rgba(0, 0, 0, 0) 60% 95%, rgba(111, 78, 55, 0.2)), linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1));
    box-shadow: inset 0 0 0 calc(var(--border-width) / 2) rgba(111, 78, 55, 0.2);
}

.button-wrap button:hover::after {
    --angle-1: -125deg;
}

/* --- Footer Info Area --- */
.main-footer {
    margin-top: 32px;
    padding: 24px;
    border-top: 1px solid var(--color-glass-border);
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-radius: 20px;
    margin-bottom: 20px;
    animation: fadeIn 1s ease forwards;
}

.footer-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.footer-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
    stroke: var(--color-text-primary);
    fill: none;
    stroke-width: 2;
}

.footer-link {
    color: var(--color-text-primary);
    text-decoration: underline;
    text-decoration-color: var(--color-glass-border);
    transition: all 0.2s;
}

.footer-link:hover {
    text-decoration-color: var(--color-accent);
    color: var(--color-accent);
}

/* --- Mobile Responsive --- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 95;
    opacity: 0;
    transition: opacity 0.3s;
}

@media (max-width: 900px) {
    .brand-title {
        display: none;
    }
}

@media (max-width: 768px) {
    body.sidebar-closed .sidebar {
        width: 260px;
        margin: 12px;
        padding: 24px 12px;
        opacity: 1;
        border: 1px solid var(--color-glass-border);
        pointer-events: auto;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: calc(100vh - 24px);
        transform: translateX(-120%);
        margin: 12px;
        width: 260px;
        background: var(--color-background);
        border: 1px solid var(--color-glass-border);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }

    .topbar {
        margin: 12px;
        height: 60px;
        min-height: 60px;
        padding: 0 16px;
        gap: 12px;
    }

    .search-container {
        display: none;
        position: absolute;
        inset: 0;
        padding: 0 16px;
        background: var(--color-background);
        border-radius: 20px;
        border: 1px solid var(--color-glass-border);
        z-index: 10;
        align-items: center;
        gap: 10px;
    }

    .search-container.mobile-active {
        display: flex;
        animation: fadeIn 0.2s ease;
    }

    .search-container .search-icon {
        left: 44px;
    }

    #search-input {
        padding-left: 36px;
        background: transparent;
        border: none;
        box-shadow: none !important;
    }

    .mobile-search-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-left: auto;
        background: transparent;
        border: none;
        color: var(--color-text-primary);
        cursor: pointer;
        padding: 8px;
    }

    .mobile-search-back {
        display: block;
        padding: 4px;
        flex-shrink: 0;
        background: transparent;
        border: none;
        color: var(--color-text-primary);
        cursor: pointer;
    }

    .mobile-search-btn svg,
    .mobile-search-back svg {
        width: 22px;
        height: 22px;
        stroke: currentColor;
        fill: none;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .clear-btn {
        right: 16px;
    }

    .content-area {
        padding: 16px 12px;
    }

    .tool-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* === Workshop Booking Prototype === */
[hidden] {
    display: none !important;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-weight: 800;
    color: var(--color-text-primary);
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.55), transparent 30%),
        linear-gradient(135deg, rgba(167, 167, 209, 0.55), rgba(255, 255, 255, 0.08));
    border: 1px solid var(--color-glass-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 8px 22px rgba(0, 0, 0, 0.18);
}

.brand-kicker {
    margin-top: 2px;
    color: var(--color-text-secondary);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hero-panel {
    position: relative;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px;
    margin-bottom: 26px;
    border-radius: 28px;
    animation: fadeSlideUp 0.55s ease forwards;
}

.hero-panel::before {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    right: -90px;
    top: -130px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(167, 167, 209, 0.28), transparent 64%);
    pointer-events: none;
}

.hero-panel h2 {
    max-width: 780px;
    margin: 6px 0 10px;
    font-size: clamp(1.75rem, 4vw, 3.6rem);
    line-height: 1.06;
    letter-spacing: -0.04em;
}

.hero-panel p {
    max-width: 720px;
    color: var(--color-text-secondary);
    line-height: 1.75;
}

.eyebrow {
    color: var(--color-accent);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(88px, 1fr));
    align-self: center;
    gap: 10px;
    width: min(460px, 42vw);
    min-width: 300px;
    position: relative;
    z-index: 1;
}

.hero-metrics div {
    padding: 16px;
    border-radius: 18px;
    background: var(--color-input-bg);
    border: 1px solid var(--color-glass-border);
    backdrop-filter: blur(10px);
}

.hero-metrics strong {
    display: block;
    color: var(--color-text-primary);
    font-size: 1.75rem;
    line-height: 1;
}

.hero-metrics span {
    display: block;
    margin-top: 8px;
    color: var(--color-text-secondary);
    font-size: 0.82rem;
}

.booking-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 430px);
    align-items: start;
    gap: 20px;
}

.calendar-only-layout {
    grid-template-columns: minmax(0, 1fr);
}

.reservation-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.reservation-panel {
    max-width: 960px;
    margin: 0 auto;
}

.calendar-panel {
    border-radius: 24px;
    padding: 22px;
    overflow: visible;
}

.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.calendar-toolbar h3 {
    margin-top: 6px;
    color: var(--color-text-primary);
    font-size: clamp(1.35rem, 2.4vw, 2rem);
    letter-spacing: -0.03em;
}

.calendar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.calendar-weekdays,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.calendar-weekdays {
    margin-bottom: 8px;
}

.calendar-weekdays span {
    color: var(--color-text-secondary);
    font-size: 0.78rem;
    font-weight: 900;
    text-align: center;
}

.calendar-day {
    position: relative;
    display: grid;
    align-content: space-between;
    min-height: 104px;
    padding: 11px;
    border: 1px solid var(--color-glass-border);
    border-radius: 18px;
    background: var(--color-input-bg);
    color: var(--color-text-primary);
    cursor: pointer;
    text-align: left;
    transition: all 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}

.calendar-day.empty {
    border-color: transparent;
    background: transparent;
    pointer-events: none;
}

.calendar-day:disabled {
    cursor: default;
    opacity: 0.42;
}

.calendar-day.has-slots {
    opacity: 1;
}

.calendar-day.has-open {
    background:
        radial-gradient(circle at 20% 15%, rgba(32, 201, 151, 0.24), transparent 38%),
        var(--color-input-bg);
}

.calendar-day:hover:not(:disabled),
.calendar-day.selected {
    border-color: var(--color-accent);
    background: var(--color-accent-hover);
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.1);
}

.calendar-day-number {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 12px;
    color: var(--color-text-primary);
    background: var(--color-glass-bg);
    border: 1px solid var(--color-glass-border);
    font-size: 0.92rem;
    font-weight: 900;
}

.calendar-day-status {
    min-height: 18px;
    color: var(--color-text-secondary);
    font-size: 0.76rem;
    font-weight: 900;
}

.calendar-dots {
    display: flex;
    gap: 5px;
    min-height: 8px;
}

.calendar-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.calendar-dots .open {
    background: #20c997;
}

.calendar-dots .pending {
    background: #f59e0b;
}

.calendar-dots .closed {
    background: #ff4757;
}

.day-slots {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--color-glass-border);
}

.day-slots-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.day-slots-header h4 {
    margin-top: 5px;
    color: var(--color-text-primary);
    font-size: 1.12rem;
}

.day-slots-header span {
    color: var(--color-text-secondary);
    font-size: 0.82rem;
    font-weight: 900;
}

.slot-list {
    display: grid;
    gap: 10px;
}

.slot-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px;
    border: 1px solid var(--color-glass-border);
    border-radius: 18px;
    background: var(--color-input-bg);
}

.slot-row .ghost-action {
    min-height: 42px;
    flex-shrink: 0;
}

.slot-row .ghost-action:disabled,
.admin-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.slot-row.selected {
    border-color: var(--color-accent);
    background: var(--color-accent-hover);
}

.slot-row strong,
.slot-row span {
    display: block;
}

.slot-row strong {
    color: var(--color-text-primary);
    font-size: 1rem;
}

.slot-row span {
    margin-top: 4px;
    color: var(--color-text-secondary);
    font-size: 0.82rem;
    line-height: 1.45;
}

.workshop-card {
    min-height: 260px;
}

.workshop-card.selected-card {
    border-color: var(--color-accent);
    background: var(--color-glass-hover);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
}

.card-meta {
    margin-top: 4px;
    color: var(--color-text-secondary);
    font-size: 0.82rem;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-row span,
.status-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    color: var(--color-text-secondary);
    background: var(--color-input-bg);
    border: 1px solid var(--color-glass-border);
    font-size: 0.78rem;
    font-weight: 700;
}

.status-dot.active {
    color: var(--color-heart);
    opacity: 1;
}

.ghost-action,
.secondary-btn,
.admin-actions button {
    border: 1px solid var(--color-glass-border);
    border-radius: 999px;
    background: var(--color-input-bg);
    color: var(--color-text-primary);
    cursor: pointer;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 10px 14px;
    transition: all 0.25s ease;
}

.ghost-action:hover,
.secondary-btn:hover,
.admin-actions button:hover {
    border-color: var(--color-accent);
    background: var(--color-accent-hover);
    transform: translateY(-2px);
}

.appointment-panel,
.admin-card {
    border-radius: 24px;
    padding: 22px;
}

.appointment-panel {
    position: sticky;
    top: 0;
}

.panel-heading {
    margin-bottom: 18px;
}

.panel-heading h3 {
    margin: 6px 0 8px;
    color: var(--color-text-primary);
    font-size: 1.28rem;
    line-height: 1.3;
}

.panel-heading p:not(.eyebrow) {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    line-height: 1.65;
}

.date-grid {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.date-card {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 76px;
    padding: 13px;
    border: 1px solid var(--color-glass-border);
    border-radius: 18px;
    background: var(--color-input-bg);
    color: var(--color-text-primary);
    cursor: pointer;
    text-align: left;
    transition: all 0.25s ease;
}

.date-card:hover:not(:disabled),
.date-card.selected {
    border-color: var(--color-accent);
    background: var(--color-accent-hover);
    transform: translateX(4px);
}

.date-card:disabled {
    cursor: not-allowed;
    opacity: 0.62;
}

.date-card .date-month {
    display: grid;
    place-items: center;
    height: 48px;
    border-radius: 14px;
    color: var(--color-text-primary);
    background:
        radial-gradient(circle at 25% 20%, rgba(255, 255, 255, 0.4), transparent 35%),
        var(--color-glass-bg);
    border: 1px solid var(--color-glass-border);
    font-size: 0.85rem;
    font-weight: 800;
}

.schedule-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
    margin-bottom: 0;
    align-content: start;
}

.schedule-card {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 12px;
    min-height: 190px;
    padding: 18px;
    opacity: 0;
    cursor: default;
    text-align: initial;
}

.schedule-card > button {
    all: unset;
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.schedule-card > button:disabled,
.schedule-card .ghost-action:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.schedule-card .date-main strong {
    display: block;
    margin-bottom: 7px;
    color: var(--color-text-primary);
    font-size: 1.05rem;
}

.schedule-card .date-main em {
    display: block;
    color: var(--color-text-secondary);
    font-style: normal;
    line-height: 1.45;
}

.schedule-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--color-glass-border);
}

.schedule-card-foot span {
    color: var(--color-text-secondary);
    font-size: 0.82rem;
    font-weight: 800;
}

.workshop-picker {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.workshop-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    width: 100%;
    padding: 13px;
    border: 1px solid var(--color-glass-border);
    border-radius: 18px;
    background: var(--color-input-bg);
    color: var(--color-text-primary);
    cursor: pointer;
    text-align: left;
    transition: all 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}

.workshop-option:hover,
.workshop-option.selected {
    border-color: var(--color-accent);
    background: var(--color-accent-hover);
    transform: translateX(4px);
}

.workshop-option .card-icon {
    margin-top: 1px;
}

.workshop-option strong,
.workshop-option em,
.workshop-option small {
    display: block;
}

.workshop-option strong {
    color: var(--color-text-primary);
    font-size: 0.96rem;
    line-height: 1.35;
}

.workshop-option em {
    margin-top: 4px;
    color: var(--color-accent);
    font-size: 0.78rem;
    font-style: normal;
    font-weight: 800;
}

.workshop-option small {
    margin-top: 7px;
    color: var(--color-text-secondary);
    font-size: 0.8rem;
    line-height: 1.5;
}

.date-card strong {
    display: block;
    margin-bottom: 3px;
    font-size: 0.96rem;
}

.date-card em {
    display: block;
    color: var(--color-text-secondary);
    font-size: 0.8rem;
    font-style: normal;
}

.date-card small {
    justify-self: end;
    padding: 5px 9px;
    border-radius: 999px;
    color: var(--color-text-primary);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--color-glass-border);
    font-size: 0.74rem;
    font-weight: 800;
}

.date-card.open small,
.status-pill.open {
    color: #b7ffd6;
    background: rgba(32, 201, 151, 0.14);
    border-color: rgba(32, 201, 151, 0.3);
}

.date-card.pending small,
.status-pill.pending,
.status-pill.confirmed {
    color: #ffe6a8;
    background: rgba(245, 158, 11, 0.16);
    border-color: rgba(245, 158, 11, 0.32);
}

.date-card.closed small,
.status-pill.closed,
.status-pill.cancelled {
    color: #ffc1c7;
    background: rgba(255, 71, 87, 0.14);
    border-color: rgba(255, 71, 87, 0.28);
}

.booking-form {
    display: grid;
    gap: 12px;
}

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

.booking-form label {
    display: grid;
    gap: 7px;
    color: var(--color-text-secondary);
    font-size: 0.82rem;
    font-weight: 800;
}

.booking-form input,
.booking-form select,
.booking-form textarea {
    width: 100%;
    border: 1px solid var(--color-glass-border);
    border-radius: 14px;
    outline: none;
    background: var(--color-input-bg);
    color: var(--color-text-primary);
    font: inherit;
    font-size: 0.92rem;
    padding: 12px 13px;
    transition: all 0.25s ease;
}

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

.booking-form input:focus,
.booking-form select:focus,
.booking-form textarea:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-hover);
}

.booking-form ::placeholder {
    color: var(--color-text-secondary);
    opacity: 0.75;
}

.form-status {
    min-height: 42px;
    padding: 11px 13px;
    border-radius: 15px;
    color: var(--color-text-secondary);
    background: var(--color-input-bg);
    border: 1px solid var(--color-glass-border);
    font-size: 0.86rem;
    line-height: 1.5;
}

.form-status.success {
    color: #b7ffd6;
    background: rgba(32, 201, 151, 0.14);
    border-color: rgba(32, 201, 151, 0.3);
}

.form-status.error {
    color: #ffc1c7;
    background: rgba(255, 71, 87, 0.14);
    border-color: rgba(255, 71, 87, 0.28);
}

.form-submit {
    flex-basis: 100%;
    width: 100%;
}

.auth-btn.is-admin {
    border-color: var(--color-accent);
    background: var(--color-accent-hover);
}

.admin-nav.locked {
    opacity: 0.55;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.muted {
    margin-top: 8px;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
    gap: 20px;
}

.full-span {
    grid-column: 1 / -1;
}

.admin-date-list,
.booking-list,
.email-log {
    display: grid;
    gap: 12px;
}

.admin-calendar-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.compact-toolbar {
    margin: 10px 0 12px;
}

.compact-toolbar h3 {
    font-size: 1.2rem;
}

.admin-calendar-day {
    min-height: 150px;
    padding: 10px;
    border: 1px solid var(--color-glass-border);
    border-radius: 16px;
    background: var(--color-input-bg);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-calendar-day.empty {
    background: transparent;
    border-color: transparent;
}

.admin-calendar-day.has-slots {
    background:
        radial-gradient(circle at 18% 12%, rgba(32, 201, 151, 0.12), transparent 34%),
        var(--color-input-bg);
}

.admin-calendar-date {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.admin-calendar-date strong {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 10px;
    color: var(--color-text-primary);
    background: var(--color-glass-bg);
    border: 1px solid var(--color-glass-border);
}

.admin-calendar-date span,
.admin-empty-day {
    color: var(--color-text-secondary);
    font-size: 0.72rem;
    font-weight: 800;
}

.admin-slot-list {
    display: grid;
    gap: 8px;
}

.admin-slot {
    display: grid;
    gap: 8px;
    padding: 9px;
    border-radius: 13px;
    border: 1px solid var(--color-glass-border);
    background: var(--color-glass-bg);
}

.admin-slot.open {
    border-color: rgba(32, 201, 151, 0.28);
}

.admin-slot.pending {
    border-color: rgba(245, 158, 11, 0.28);
}

.admin-slot.closed {
    border-color: rgba(255, 71, 87, 0.24);
}

.admin-slot strong,
.admin-slot span {
    display: block;
}

.admin-slot strong {
    color: var(--color-text-primary);
    font-size: 0.82rem;
}

.admin-slot span {
    margin-top: 3px;
    color: var(--color-text-secondary);
    font-size: 0.72rem;
    line-height: 1.35;
}

.admin-slot .admin-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.admin-slot .admin-actions button {
    padding: 7px 8px;
    font-size: 0.72rem;
}

.admin-workshop-group {
    display: grid;
    gap: 10px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-glass-border);
}

.admin-workshop-group:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.admin-workshop-group h4 {
    color: var(--color-text-primary);
    font-size: 0.98rem;
}

.admin-date-row,
.booking-item,
.email-row {
    padding: 14px;
    border-radius: 18px;
    background: var(--color-input-bg);
    border: 1px solid var(--color-glass-border);
}

.admin-date-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 12px;
}

.admin-date-row strong,
.booking-item strong,
.email-row strong {
    display: block;
    color: var(--color-text-primary);
    margin-bottom: 5px;
}

.admin-date-row span,
.booking-item span,
.email-row span {
    color: var(--color-text-secondary);
    font-size: 0.83rem;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.booking-item {
    display: grid;
    gap: 9px;
}

.booking-item-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.booking-item p,
.email-row p {
    color: var(--color-text-secondary);
    font-size: 0.88rem;
    line-height: 1.55;
}

.booking-note {
    padding: 10px;
    border-radius: 12px;
    background: var(--color-glass-bg);
}

.email-row {
    display: grid;
    gap: 8px;
}

.empty-state {
    display: grid;
    place-items: center;
    min-height: 130px;
    padding: 22px;
    border: 1px dashed var(--color-glass-border);
    border-radius: 20px;
    color: var(--color-text-secondary);
    text-align: center;
}

.empty-state strong {
    color: var(--color-text-primary);
    margin-bottom: 8px;
}

body.light-mode .date-card.open small,
body.light-mode .status-pill.open,
body.light-mode .form-status.success {
    color: #19664a;
}

body.light-mode .date-card.pending small,
body.light-mode .status-pill.pending,
body.light-mode .status-pill.confirmed {
    color: #7c4a03;
}

body.light-mode .date-card.closed small,
body.light-mode .status-pill.closed,
body.light-mode .status-pill.cancelled,
body.light-mode .form-status.error {
    color: #8c1f2d;
}

@media (hover: none) {
    .calendar-day:hover:not(:disabled),
    .workshop-option:hover,
    .date-card:hover:not(:disabled),
    .ghost-action:hover,
    .secondary-btn:hover,
    .admin-actions button:hover {
        transform: none;
    }
}

@media (max-width: 1180px) {
    .booking-layout,
    .admin-grid {
        grid-template-columns: 1fr;
    }

    .appointment-panel {
        position: static;
    }

    .hero-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-metrics {
        min-width: 0;
        width: 100%;
    }

    .calendar-panel,
    .appointment-panel,
    .admin-card {
        padding: 20px;
    }
}

@media (max-width: 1024px) {
    html,
    body {
        overflow: hidden;
    }

    .content-area {
        padding: 20px 14px;
    }

    .hero-panel {
        margin-bottom: 20px;
    }

    .calendar-day {
        min-height: 96px;
        padding: 9px;
    }

    .admin-calendar-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .appointment-panel {
        position: static;
    }
}

@media (max-width: 900px) {
    .topbar {
        gap: 12px;
    }

    .search-container {
        max-width: 320px;
    }

    .hero-panel h2 {
        font-size: clamp(1.65rem, 6vw, 2.7rem);
    }

    .calendar-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .calendar-actions {
        width: 100%;
    }

    .calendar-actions .secondary-btn {
        flex: 1;
        min-width: 150px;
    }
}

@media (max-width: 768px) {
    .brand-kicker {
        display: none;
    }

    .hero-panel {
        padding: 22px;
        border-radius: 22px;
    }

    .hero-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .calendar-panel {
        padding: 16px;
    }

    .day-slots-header,
    .slot-row {
        align-items: stretch;
        flex-direction: column;
    }

    .calendar-actions {
        width: 100%;
    }

    .calendar-actions .secondary-btn {
        flex: 1;
    }

    .calendar-weekdays,
    .calendar-grid {
        gap: 5px;
    }

    .calendar-day {
        min-height: 74px;
        padding: 7px;
        border-radius: 13px;
    }

    .calendar-day-number {
        width: 26px;
        height: 26px;
        border-radius: 9px;
        font-size: 0.78rem;
    }

    .calendar-day-status {
        font-size: 0.64rem;
    }

    .slot-row .ghost-action {
        width: 100%;
    }

    .workshop-option {
        grid-template-columns: 42px minmax(0, 1fr);
        padding: 12px;
    }

    .workshop-option .card-icon {
        width: 42px;
        height: 42px;
    }

    .form-row,
    .admin-date-row {
        grid-template-columns: 1fr;
    }

    .admin-calendar-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .date-card {
        grid-template-columns: 64px minmax(0, 1fr);
    }

    .date-card small {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .admin-header,
    .booking-item-main {
        flex-direction: column;
    }

    .secondary-btn {
        width: 100%;
    }

    .reservation-header {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .app-container {
        width: 100%;
    }

    .topbar {
        margin: 10px;
        padding: 0 12px;
    }

    .brand-mark {
        width: 34px;
        height: 34px;
        border-radius: 12px;
    }

    .content-area {
        padding: 14px 10px;
    }

    .hero-panel {
        padding: 18px;
    }

    .hero-panel p {
        font-size: 0.92rem;
    }

    .hero-metrics {
        grid-template-columns: 1fr;
    }

    .hero-metrics div {
        padding: 13px;
    }

    .calendar-weekdays,
    .calendar-grid {
        gap: 4px;
    }

    .calendar-weekdays span {
        font-size: 0.7rem;
    }

    .calendar-day {
        min-height: 66px;
        padding: 6px;
        border-radius: 12px;
    }

    .calendar-day-number {
        width: 25px;
        height: 25px;
        font-size: 0.74rem;
    }

    .calendar-day-status {
        font-size: 0;
        min-height: 0;
    }

    .calendar-dots {
        gap: 4px;
        min-height: 6px;
    }

    .calendar-dots .dot {
        width: 6px;
        height: 6px;
    }

    .day-slots {
        margin-top: 14px;
        padding-top: 14px;
    }

    .appointment-panel,
    .calendar-panel,
    .admin-card {
        border-radius: 20px;
        padding: 14px;
    }

    .admin-calendar-grid {
        grid-template-columns: 1fr;
    }

    .booking-form input,
    .booking-form select,
    .booking-form textarea {
        min-height: 44px;
        font-size: 16px;
    }
}

@media (max-width: 420px) {
    .topbar-actions {
        gap: 4px;
    }

    .icon-btn {
        width: 36px;
        height: 36px;
    }

    .hero-panel h2 {
        font-size: 1.55rem;
    }

    .calendar-actions {
        display: grid;
        grid-template-columns: 40px 1fr 40px;
        gap: 6px;
    }

    .calendar-actions .icon-btn,
    .calendar-actions .secondary-btn {
        width: 100%;
        min-width: 0;
    }

    .calendar-actions .secondary-btn {
        padding-inline: 8px;
        font-size: 0.78rem;
    }

    .calendar-day {
        min-height: 58px;
        padding: 5px;
        border-radius: 10px;
    }

    .calendar-day-number {
        width: 23px;
        height: 23px;
        border-radius: 8px;
    }

    .calendar-dots .dot {
        width: 5px;
        height: 5px;
    }

    .workshop-option small {
        display: none;
    }
}

/* === Optimization Styles === */

/* --- RWD Booking Layout Layout Side-by-Side --- */
#selected-day-slots-panel {
    padding: 22px;
    border-radius: 24px;
    min-height: 480px;
    display: flex;
    flex-direction: column;
}

@media (max-width: 1180px) {
    #selected-day-slots-panel {
        min-height: auto;
    }
}

/* --- Admin Form Styles --- */
.admin-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    font-weight: 500;
    width: 100%;
}

.admin-form input[type="date"],
.admin-form input[type="text"],
.admin-form input[type="email"] {
    width: 100%;
    background: var(--color-input-bg);
    border: 1px solid var(--color-glass-border);
    border-radius: 12px;
    padding: 10px 14px;
    color: var(--color-text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    font-family: inherit;
}

.admin-form input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-hover);
}

/* --- Custom Checkbox Styling --- */
.checkbox-label {
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--color-glass-border);
    border-radius: 5px;
    outline: none;
    background-color: var(--color-input-bg);
    cursor: pointer;
    display: inline-grid;
    place-content: center;
    transition: all 0.25s ease;
    vertical-align: middle;
}

.checkbox-label input[type="checkbox"]:checked {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
}

.checkbox-label input[type="checkbox"]:checked::before {
    content: "";
    width: 10px;
    height: 6px;
    border-left: 2px solid white;
    border-bottom: 2px solid white;
    transform: rotate(-45deg) translate(0.5px, -1px);
    display: block;
}

/* --- Simulated Email Modal --- */
.email-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.email-modal {
    width: 100%;
    max-width: 680px;
    border-radius: 24px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    animation: fadeSlideUp 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    max-height: 90vh;
    overflow: hidden;
}

.email-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-glass-border);
    padding-bottom: 12px;
}

.email-modal-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.15rem;
}

.email-modal-icon {
    font-size: 1.5rem;
}

.close-modal-btn {
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.close-modal-btn:hover {
    color: var(--color-text-primary);
}

.email-modal-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding-right: 4px;
}

.email-modal-tip {
    font-size: 0.85rem;
    color: var(--color-accent);
    background: var(--color-accent-hover);
    padding: 10px 14px;
    border-radius: 10px;
    line-height: 1.4;
}

.email-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--color-glass-border);
    padding-bottom: 4px;
    margin-top: 5px;
}

.email-tab-btn {
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 10px 10px 0 0;
    transition: all 0.2s;
    position: relative;
}

.email-tab-btn:hover {
    color: var(--color-text-primary);
    background: var(--color-glass-hover);
}

.email-tab-btn.active {
    color: var(--color-text-primary);
    background: var(--color-glass-hover);
}

.email-tab-btn.active::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--color-accent);
    border-radius: 99px;
}

.email-tab-content {
    display: none;
    flex-direction: column;
    gap: 12px;
    border: 1px solid var(--color-glass-border);
    border-radius: 12px;
    padding: 16px;
    background: var(--color-input-bg);
}

.email-tab-content.active {
    display: flex;
}

.email-headers {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--color-glass-border);
    padding-bottom: 10px;
    color: var(--color-text-secondary);
}

.email-headers div {
    display: flex;
    gap: 4px;
}

.email-headers div strong {
    color: var(--color-text-primary);
    white-space: nowrap;
}

.email-body {
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
    color: var(--color-text-primary);
    max-height: 250px;
    overflow-y: auto;
    padding-top: 5px;
}

.email-modal-footer {
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid var(--color-glass-border);
    padding-top: 12px;
}

@media (max-width: 640px) {
    .email-modal {
        padding: 16px;
        border-radius: 20px;
    }
    .email-tab-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}

/* Firebase Auth Modals */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 15, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.auth-modal {
    width: 100%;
    max-width: 440px;
    padding: 30px;
    border-radius: 24px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    background: rgba(255, 255, 255, 0.03);
    animation: scaleUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.auth-modal h2 {
    font-size: 1.6rem;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #fff 0%, var(--color-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.auth-modal p {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

.auth-btn-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text-primary);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.auth-btn-google:hover {
    background: var(--color-text-primary);
    color: #0b0c10;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.15);
}

.auth-btn-google:active {
    transform: translateY(0);
}

/* Calendar Date Quick Actions */
.admin-calendar-date {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.admin-day-quick-actions {
    display: flex;
    gap: 4px;
    margin-top: 6px;
    width: 100%;
}

.admin-day-quick-actions .quick-btn {
    padding: 4px 8px;
    font-size: 0.75rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--color-text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    width: auto;
    font-weight: 600;
    flex: 1;
    text-align: center;
}

.admin-day-quick-actions .quick-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.admin-day-quick-actions .close-day-btn:hover {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.admin-day-quick-actions .open-day-btn:hover {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

