/* ==========================================
   UTK 揪團點餐 — 前台 PWA 樣式
   iOS Style · Mobile First
   ========================================== */

:root {
    --primary: #007AFF;
    --primary-dark: #0062CC;
    --primary-light: #EBF3FF;
    --primary-lighter: #A8D0FF;
    --line-green: #06C755;
    --success: #34C759;
    --warning: #FF9500;
    --danger: #FF3B30;
    --bg: #F2F2F7;
    --white: #ffffff;
    --text: #1C1C1E;
    --text-secondary: #8E8E93;
    --text-light: #8E8E93;
    --text-muted: #AEAEB2;
    --border: #D1D1D6;
    --separator: #C6C6C8;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.1);
    --glass-bg: rgba(255,255,255,0.72);
    --glass-blur: blur(20px);
    --transition: 0.2s ease;
    --front-shell-max: 1280px;
    --front-shell-gutter: 24px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Noto Sans TC', 'Helvetica Neue', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(168, 208, 255, 0.24), transparent 30%),
        linear-gradient(180deg, #f7fbff 0%, var(--bg) 28%, #eef4fb 100%);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100dvh;
}

.desktop-topbar {
    display: none;
}

/* === App Container === */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100dvh;
    background: var(--bg);
    position: relative;
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 769px) {
    .app-container {
        max-width: 640px;
        box-shadow: 0 0 40px rgba(0,0,0,0.08);
    }
}

@media (min-width: 1024px) {
    .app-container {
        max-width: 768px;
    }
}

/* === Bottom Nav (iOS Tab Bar) === */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    display: flex;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-top: 0.5px solid var(--separator);
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav.auth-hidden {
    display: none !important;
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 0 4px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.65rem;
    font-weight: 500;
    transition: color var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item.active {
    color: var(--primary);
}

.bottom-nav-item:active {
    opacity: 0.6;
}

.nav-icon { font-size: 1.4rem; line-height: 1; }
.nav-label { margin-top: 1px; letter-spacing: 0.02em; }

.nav-profile-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    box-shadow: inset 0 0 0 1px rgba(0, 122, 255, 0.14);
    position: relative;
    isolation: isolate;
    flex: 0 0 28px;
    line-height: 0;
    font-size: 0;
}

.nav-profile-avatar-img,
.desktop-profile-avatar-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    z-index: 1;
}

.nav-profile-avatar-fallback,
.desktop-profile-avatar-fallback {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
    z-index: 0;
}

/* === Login Screen === */
.login-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80dvh;
    padding: 2rem;
    text-align: center;
    background: var(--white);
}

.login-hero { margin-bottom: 3rem; }
.login-logo {
    width: 120px;
    height: 120px;
    border-radius: 24px;
    object-fit: cover;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-lg);
}
.login-icon { font-size: 4rem; margin-bottom: 1rem; }
.login-title { font-size: 2rem; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }
.login-subtitle { color: var(--text-secondary); margin-top: 0.5rem; font-size: 0.95rem; }

.btn-line-login {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 14px 32px;
    background: var(--line-green);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.btn-line-login:active { transform: scale(0.97); opacity: 0.9; }

/* === Hero Banner === */
.hero-banner {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 2.5rem 1.5rem 3rem;
    text-align: center;
    border-radius: 0 0 28px 28px;
}

.hero-logo {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    object-fit: cover;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.hero-icon { font-size: 3rem; }
.hero-title { font-size: 1.6rem; font-weight: 800; margin-top: 0.5rem; letter-spacing: -0.02em; }
.hero-subtitle { font-size: 0.9rem; opacity: 0.8; margin-top: 0.3rem; }

/* === Action Cards === */
.action-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 1rem;
    margin-top: -24px;
}

.action-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.2rem;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow);
    transition: transform var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.action-card:active { transform: scale(0.97); }
.action-icon { font-size: 2rem; }
.action-title { font-size: 1rem; font-weight: 700; margin-top: 0.5rem; }
.action-desc { font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.3rem; }

/* === Section === */
.section { padding: 1rem; }
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* === iOS Grouped List === */
.ios-group {
    background: var(--white);
    border-radius: var(--radius);
    margin: 0 1rem 1rem;
    overflow: hidden;
}

.ios-group-header {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.5rem 1rem 0.4rem;
}

.ios-group-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text);
    border-bottom: 0.5px solid var(--separator);
    transition: background var(--transition);
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

.ios-group-item:last-child { border-bottom: none; }
.ios-group-item:active { background: var(--bg); }
.ios-group-icon { font-size: 1.4rem; margin-right: 12px; width: 32px; text-align: center; }
.ios-group-text { flex: 1; font-weight: 500; font-size: 0.95rem; }
.ios-group-detail { color: var(--text-secondary); font-size: 0.85rem; margin-right: 6px; }
.ios-group-arrow { color: var(--text-muted); font-size: 0.9rem; }

/* === List Item === */
.list-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--white);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    margin-bottom: 8px;
    transition: background var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.list-item:active { background: #E5E5EA; }
.list-icon { font-size: 1.5rem; margin-right: 12px; }
.list-text { flex: 1; font-weight: 500; }
.list-meta { font-size: 0.75rem; color: var(--text-secondary); margin-right: 8px; }
.list-arrow { color: var(--text-muted); font-size: 1.2rem; }

/* === Page Header (iOS Nav Bar) === */
.page-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 0.5px solid var(--separator);
    position: sticky;
    top: 0;
    z-index: 50;
}

.back-btn {
    text-decoration: none;
    color: var(--primary);
    font-weight: 500;
    margin-right: 1rem;
    font-size: 1rem;
    -webkit-tap-highlight-color: transparent;
}

.page-title { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; }

/* === Floating Back Button (左下角浮動返回，與右下角動作按鈕對稱) === */
.floating-back-btn {
    position: fixed;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px) + 12px);
    left: 16px;
    z-index: 99;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--white);
    border: 0.5px solid var(--border);
    color: var(--primary);
    display: none; /* 由 JS 控制顯示 */
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: var(--shadow);
    font-size: 1.4rem;
    font-weight: 500;
    transition: transform var(--transition), box-shadow var(--transition);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.floating-back-btn:active {
    transform: scale(0.92);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.home-dashboard,
.create-order-page,
.profile-page-shell,
.order-detail-page,
.front-store-editor {
    width: 100%;
}

/* === Form (iOS Style) === */
.form-group { margin-bottom: 1rem; padding: 0 1rem; }
.form-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.02em; }

.input-field {
    width: 100%;
    padding: 11px 14px;
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    font-family: inherit;
    background: var(--white);
    color: var(--text);
}

.input-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

select.input-field { appearance: auto; }
textarea.input-field { resize: vertical; }

/* === Buttons (iOS Style) === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:active { background: var(--primary-dark); }
.btn-secondary { background: rgba(0,122,255,0.1); color: var(--primary); }
.btn-danger { background: var(--danger); color: white; }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-block { display: flex; width: 100%; margin-bottom: 0.5rem; }
.btn-small { font-size: 0.8rem; padding: 6px 14px; border-radius: 8px; background: rgba(0,122,255,0.1); color: var(--primary); border: none; cursor: pointer; font-weight: 600; -webkit-tap-highlight-color: transparent; }

/* === Store Grid (Order Create) === */
.store-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 0 1rem;
    max-height: 50vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.store-grid::-webkit-scrollbar { width: 3px; }
.store-grid::-webkit-scrollbar-track { background: transparent; }
.store-grid::-webkit-scrollbar-thumb { background: var(--separator); border-radius: 3px; }

.store-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition);
    position: relative;
    -webkit-tap-highlight-color: transparent;
    box-shadow: var(--shadow);
}

.store-card:active { transform: scale(0.97); }
.store-card.selected { border-color: var(--primary); background: var(--primary-light); }
.store-icon { font-size: 2rem; }
.store-name { font-size: 0.9rem; font-weight: 600; margin-top: 0.3rem; }
.store-meta { font-size: 0.72rem; color: var(--text-secondary); margin-top: 2px; }
.store-check { position: absolute; top: 8px; right: 8px; color: var(--primary); font-weight: 700; }
.store-card-img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 6px;
}
.store-edit-btn {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(0,0,0,0.4);
    color: white;
    border: none;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition);
    -webkit-tap-highlight-color: transparent;
}
.store-card:hover .store-edit-btn,
.store-card:active .store-edit-btn { opacity: 1; }

.search-box { padding: 0 1rem 0.8rem; }

/* === Step === */
.step { padding: 1rem 0; }
.step-header { display: flex; align-items: center; gap: 0.8rem; padding: 0 1rem; margin-bottom: 1rem; }
.step-num { width: 30px; height: 30px; background: var(--primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; font-weight: 700; }
.step-title { font-size: 1.1rem; font-weight: 700; }

/* === Result === */
.result-card {
    background: var(--primary-light);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    margin: 0 1rem 1rem;
}

.result-store { font-size: 1.5rem; font-weight: 700; }
.result-code { font-size: 2.5rem; font-weight: 800; letter-spacing: 0.2em; color: var(--primary); margin: 0.5rem 0; }
.result-url { font-size: 0.75rem; color: var(--text-secondary); word-break: break-all; }

.action-btns { padding: 0 1rem; }

/* === Menu Preview Modal === */
.menu-preview-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.menu-preview-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.menu-preview-content {
    background: var(--white);
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: 480px;
    max-height: 75dvh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    -webkit-overflow-scrolling: touch;
}

.menu-preview-overlay.show .menu-preview-content {
    transform: translateY(0);
}

.menu-preview-handle {
    width: 36px;
    height: 5px;
    background: var(--separator);
    border-radius: 3px;
    margin: 8px auto;
}

.menu-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 12px;
    border-bottom: 0.5px solid var(--separator);
}

.menu-preview-header h3 { font-size: 1.1rem; font-weight: 700; }

.menu-preview-actions {
    display: flex;
    gap: 8px;
}

.menu-preview-body { padding: 0 16px 16px; }

.menu-preview-img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin: 12px 0;
}

.menu-preview-category {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    padding: 10px 0 6px;
    border-bottom: 0.5px solid var(--separator);
}

.menu-preview-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 0.5px solid rgba(0,0,0,0.04);
}

.menu-preview-item:last-child { border-bottom: none; }
.menu-preview-item-left { display: flex; align-items: center; gap: 8px; }
.menu-preview-item-emoji { font-size: 1.1rem; }
.menu-preview-item-name { font-weight: 500; font-size: 0.9rem; }
.menu-preview-item-price { font-weight: 600; color: var(--primary); font-size: 0.9rem; }

/* === Order Detail === */
.order-header {
    padding: 1rem;
    background: var(--white);
    border-bottom: 0.5px solid var(--separator);
}

.order-store { display: flex; align-items: center; gap: 0.5rem; }
.order-store-icon { font-size: 1.5rem; }
.order-store-name { font-size: 1.2rem; font-weight: 700; flex: 1; }
.order-status { font-size: 0.72rem; padding: 4px 10px; border-radius: 6px; font-weight: 600; }
.order-status.open { background: rgba(52,199,89,0.12); color: #248A3D; }
.order-status.closed { background: rgba(255,59,48,0.1); color: #D70015; }

.order-meta { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.5rem; display: flex; justify-content: space-between; }
.order-countdown { color: var(--warning); font-weight: 600; }
.order-memo { font-size: 0.8rem; color: var(--text); background: rgba(255,149,0,0.08); padding: 8px 12px; border-radius: 8px; margin-top: 0.5rem; }

/* === Tabs (iOS Segmented) === */
.tabs {
    display: flex;
    border-bottom: 0.5px solid var(--separator);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    position: sticky;
    top: 0;
    z-index: 40;
}

.tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px;
    border: none;
    background: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.tab-icon {
    font-size: 1.02rem;
    line-height: 1;
    flex-shrink: 0;
}

.tab-text {
    white-space: nowrap;
    line-height: 1.2;
}

.tab.active { color: var(--primary); }
.tab.active::after {
    content: '';
    position: absolute;
    bottom: -0.5px;
    left: 20%;
    right: 20%;
    height: 2.5px;
    background: var(--primary);
    border-radius: 3px;
}

.tab-badge {
    background: var(--danger);
    color: white;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 2px;
    font-weight: 700;
    flex-shrink: 0;
}

.tab-content { padding: 1rem; }

/* === Category Tabs === */
.category-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
}

.category-tabs::-webkit-scrollbar { display: none; }

.cat-tab {
    padding: 8px 18px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--white);
    font-size: 0.88rem;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    transition: all var(--transition);
    min-height: 44px;
    display: flex;
    align-items: center;
}

.cat-tab:active { transform: scale(0.97); }
.cat-tab.active { background: var(--primary); color: white; border-color: var(--primary); }

/* === Menu Item === */
.menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 4px;
    border-bottom: 0.5px solid rgba(0,0,0,0.06);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    min-height: 56px;
}

.menu-item-left { display: flex; align-items: center; gap: 10px; flex: 1; }
.menu-item-emoji { font-size: 1.5rem; }
.menu-item-name { font-weight: 600; }
.menu-item-desc { font-size: 0.75rem; color: var(--text-secondary); }
.menu-item-right { display: flex; align-items: center; gap: 10px; }
.menu-item-price { font-weight: 700; color: var(--primary); }

.btn-add {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.btn-add:active { transform: scale(0.9); }

/* === Cart Bar === */
.cart-bar {
    position: fixed;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 2rem);
    max-width: 448px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 90;
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.35);
}

.cart-bar-info { font-size: 0.85rem; }
.cart-bar-count { display: block; font-size: 0.75rem; opacity: 0.8; }
.cart-bar-total { font-size: 1.1rem; font-weight: 700; }

.cart-bar .btn {
    background: white;
    color: var(--primary);
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* === Cart Item === */
.cart-item {
    display: block;
    padding: 14px;
    margin-bottom: 10px;
    border: 1px solid rgba(0, 122, 255, 0.08);
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    transition: background 0.15s, transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 8px 18px rgba(26, 115, 184, 0.06);
}

.cart-item:active {
    background: #f2f7ff;
    transform: scale(0.992);
}

.cart-item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.cart-item-title-wrap {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.cart-item-info { display: flex; align-items: center; gap: 8px; }
.cart-item-emoji {
    flex-shrink: 0;
    font-size: 1.5rem;
    line-height: 1;
}

.cart-item-copy {
    min-width: 0;
    flex: 1;
}

.cart-item-name {
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1.35;
    color: var(--text);
}

.cart-item-customization,
.cart-item-note-line,
.cart-item-note {
    margin-top: 6px;
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

.cart-item-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(142, 142, 147, 0.28);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
}

.cart-item-price-block {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cart-item-line-total {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}

.cart-item-qty {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.cart-item-edit-label {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-light);
    white-space: nowrap;
}

.cart-item-remove {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 59, 48, 0.08);
    font-size: 0.92rem;
}

.btn-remove { background: none; border: none; color: var(--danger); font-size: 1rem; cursor: pointer; }

/* === Cart Dirty Banner === */
.cart-dirty-banner {
    position: fixed;
    bottom: calc(120px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 2rem);
    max-width: 448px;
    background: #FFF3CD;
    color: #856404;
    border: 1px solid #FFEAA7;
    border-radius: var(--radius);
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
    z-index: 89;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    animation: dirtyPulse 2s ease-in-out infinite;
}

@keyframes dirtyPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* === Stats === */
.stat-cards, .order-stats { display: flex; gap: 8px; margin-bottom: 1rem; }
.stat-card {
    flex: 1;
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: center;
    box-shadow: var(--shadow);
}
.stat-value { font-size: 1.3rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 0.7rem; color: var(--text-secondary); margin-top: 2px; }

.order-section-title {
    margin: 0 0 0.9rem;
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.01em;
}

/* === User Order Card === */
.user-order-card {
    background: var(--white);
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 122, 255, 0.06);
}

.user-order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    font-weight: 700;
    margin-bottom: 10px;
}

.user-order-card-participant {
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247,250,255,0.98));
}

.user-order-header-spacious {
    margin-bottom: 12px;
}

.user-order-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.user-order-identity-copy {
    min-width: 0;
    flex: 1;
}

.user-order-name-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.user-order-name {
    font-size: 0.96rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.3;
}

.user-order-header-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.user-order-total { color: var(--primary); font-size: 0.94rem; }

.user-order-items {
    display: grid;
    gap: 10px;
}

.user-order-item { font-size: 0.85rem; color: var(--text-secondary); padding: 4px 0; line-height: 1.5; }
.user-order-item small { color: var(--text-light); }

.user-order-item-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 0;
    border-top: 1px solid rgba(198, 198, 200, 0.7);
}

.user-order-item-row:first-child {
    border-top: none;
    padding-top: 0;
}

.user-order-item-copy {
    min-width: 0;
}

.user-order-item-mainline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.user-order-item-name-wrap {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.user-order-item-name {
    font-size: 0.94rem;
    font-weight: 700;
    color: var(--text);
}

.user-order-item-pricing {
    flex-shrink: 0;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.user-order-item-detail,
.user-order-item-note-block,
.user-order-note-block {
    margin-top: 6px;
    font-size: 0.81rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

.user-order-item-detail,
.user-order-item-note-block {
    padding-left: 2px;
}

.user-order-note-block {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(0, 122, 255, 0.06);
    color: #4f5965;
}

.order-follow-btn {
    align-self: flex-start;
    min-height: 38px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(0,122,255,0.22);
    background: rgba(0,122,255,0.08);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.order-follow-btn-icon {
    line-height: 1;
    font-size: 0.92rem;
}

.order-follow-unavailable {
    font-size: 0.75rem;
    color: var(--text-light);
}

.store-history-section {
    margin-bottom: 1rem;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.store-history-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: none;
    background: transparent;
    padding: 14px 16px;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.store-history-toggle-main {
    min-width: 0;
    flex: 1;
}

.store-history-eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.02em;
}

.store-history-toggle-title-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}

.store-history-toggle-title-row strong {
    font-size: 0.96rem;
    line-height: 1.3;
}

.store-history-toggle-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.store-history-toggle-icon {
    flex-shrink: 0;
    color: var(--text-light);
    transition: transform 0.2s ease;
}

.store-history-section.is-open .store-history-toggle-icon {
    transform: rotate(180deg);
}

.store-history-content {
    padding: 0 16px 16px;
}

.store-history-loading {
    padding-top: 2px;
    font-size: 0.84rem;
    color: var(--text-secondary);
}

.store-history-list {
    display: grid;
    gap: 10px;
}

.store-history-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 0;
    border-top: 1px solid var(--separator);
}

.store-history-item:first-child {
    border-top: none;
    padding-top: 0;
}

.store-history-item.is-disabled {
    opacity: 0.72;
}

.store-history-item-main {
    min-width: 0;
}

.store-history-item-name-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.store-history-item-emoji {
    flex-shrink: 0;
    font-size: 1.5rem;
    line-height: 1;
}

.store-history-item-name {
    font-size: 0.94rem;
    font-weight: 700;
    color: var(--text);
}

.store-history-item-meta {
    margin-top: 4px;
    font-size: 0.76rem;
    color: var(--text-secondary);
}

.store-history-item-note {
    margin-top: 4px;
    font-size: 0.82rem;
    color: var(--text-light);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.store-history-item-side {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.store-history-item-qty {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.store-history-reorder-btn {
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(52,199,89,0.24);
    background: rgba(52,199,89,0.12);
    color: #248A3D;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.store-history-unavailable {
    font-size: 0.76rem;
    color: var(--text-light);
}

/* === Paid Badge === */
.paid-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
    white-space: nowrap;
}
.paid-badge.paid { background: rgba(52,199,89,0.12); color: #248A3D; }
.paid-badge.unpaid { background: rgba(255,149,0,0.12); color: #C93400; }

/* === Payment Confirm List (Creator) === */
.payment-confirm-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: var(--white);
    border-radius: 10px;
    margin-bottom: 6px;
    border: 1px solid rgba(52, 199, 89, 0.08);
    box-shadow: 0 6px 16px rgba(28, 61, 90, 0.04);
    cursor: pointer;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.payment-confirm-item:active { background: var(--bg); }
.payment-confirm-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.payment-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    accent-color: var(--success);
    cursor: pointer;
    flex-shrink: 0;
}
.payment-user-name { font-weight: 600; font-size: 0.9rem; }
.payment-amount { font-weight: 700; color: var(--primary); font-size: 0.9rem; }

/* === Order Card (My Orders) === */
.order-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--white);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow);
    margin-bottom: 10px;
    transition: all var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.order-card:active { transform: scale(0.98); background: #F8F8FA; }

.order-card-left { display: flex; align-items: center; gap: 12px; }
.order-card-icon { font-size: 1.5rem; }
.order-card-name { font-weight: 700; font-size: 0.95rem; }
.order-card-meta { font-size: 0.72rem; color: var(--text-secondary); margin-top: 1px; }
.order-card-status { font-size: 0.75rem; padding: 5px 12px; border-radius: 8px; font-weight: 700; letter-spacing: 0.3px; }
.order-card-status.open { background: rgba(52,199,89,0.15); color: #248A3D; }
.order-card-status.closed { background: rgba(255,149,0,0.15); color: #C93400; }
.order-card-status.completed { background: rgba(0,122,255,0.12); color: #007AFF; }

/* === Modal (iOS Action Sheet) === */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--white);
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: 480px;
    max-height: 85dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    padding-bottom: env(safe-area-inset-bottom);
}

.modal-overlay.show .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.2rem;
    border-bottom: 0.5px solid var(--separator);
}

.modal-header h3 { font-size: 1.1rem; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--text-secondary); -webkit-tap-highlight-color: transparent; min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
.modal-body { padding: 1rem 1.2rem; }
.modal-footer { padding: 0.8rem 1.2rem; display: flex; gap: 8px; }
.modal-item-price { font-size: 1.3rem; font-weight: 700; color: var(--primary); margin-bottom: 1rem; }

/* === Qty Control === */
.qty-control {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.qty-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--white);
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.qty-value { font-size: 1.3rem; font-weight: 700; min-width: 30px; text-align: center; }

/* === Option Chips (客製化選項) === */
.option-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.option-chip {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: var(--white);
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.option-chip.selected { border-color: var(--primary); background: var(--primary-light); color: var(--primary); font-weight: 600; }

.order-for-tag {
    display: inline-block;
    font-size: 11px;
    background: #e8f0fe;
    color: #1a73e8;
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: 6px;
    vertical-align: middle;
}

/* === Emoji Picker === */
.emoji-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.emoji-btn {
    width: 44px;
    height: 44px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
}
.emoji-btn.selected { border-color: var(--primary); background: var(--primary-light); }

/* === Store Create === */
.store-create-page { padding: 1rem; }

.category-block {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.category-header { display: flex; gap: 8px; margin-bottom: 0.8rem; }
.category-header .input-field { flex: 1; }
.btn-remove-cat { background: none; border: none; color: var(--danger); font-size: 1.1rem; cursor: pointer; }

.item-row { display: flex; gap: 8px; margin-bottom: 6px; }
.item-name { flex: 2; }
.item-price { flex: 1; }
.btn-remove-item { background: none; border: none; color: var(--danger); font-size: 1rem; cursor: pointer; }

.btn-add-item { margin-top: 0.5rem; }

/* === Upload Area === */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition);
    margin: 0 1rem;
    -webkit-tap-highlight-color: transparent;
}

.upload-area:active { border-color: var(--primary); background: rgba(0,122,255,0.03); }
.upload-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.upload-text { font-weight: 600; }
.upload-hint { font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.3rem; }
.upload-note {
    margin: 0.75rem 1rem 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.uploaded-menu-list {
    margin: 0.75rem 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.uploaded-menu-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--white);
    border: 1px solid rgba(0, 122, 255, 0.14);
    box-shadow: 0 4px 12px rgba(26, 115, 184, 0.08);
}
.uploaded-menu-main {
    min-width: 0;
}
.uploaded-menu-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    word-break: break-word;
}
.uploaded-menu-meta {
    margin-top: 3px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.uploaded-menu-state {
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(0,122,255,0.1);
    padding: 4px 8px;
    border-radius: 999px;
}

.ocr-mode-option {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.ocr-mode-option span {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.45;
}
.ocr-mode-option:hover {
    border-color: rgba(0, 122, 255, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(26, 115, 184, 0.08);
}

/* === OCR 人工審核提示 === */
.ocr-review-banner {
    margin: 0.5rem 1rem 0;
    padding: 0.6rem 1rem;
    border-radius: var(--radius);
    background: #fff8e1;
    border: 1px solid #ffc107;
    color: #7a5c00;
    font-size: 0.85rem;
    font-weight: 500;
}
.ocr-uncertain {
    border-color: #ffc107 !important;
    background-color: #fff8e1 !important;
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.25) !important;
}
.item-row.menu-item-new .input-field {
    border-color: rgba(52, 199, 89, 0.45);
    background: rgba(52, 199, 89, 0.08);
}
.item-row.menu-item-updated .input-field {
    border-color: rgba(10, 132, 255, 0.45);
    background: rgba(10, 132, 255, 0.07);
}
.item-change-pill {
    flex-shrink: 0;
    align-self: center;
    font-size: 0.68rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 4px 7px;
    line-height: 1;
}
.item-change-pill-new {
    color: #1f7a38;
    background: rgba(52, 199, 89, 0.16);
}
.item-change-pill-updated {
    color: #0a63c4;
    background: rgba(10, 132, 255, 0.15);
}

/* === Profile (iOS Style) === */
.profile-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--white);
    margin: 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.profile-avatar { width: 60px; height: 60px; border-radius: 50%; border: 2px solid var(--primary-lighter); object-fit: cover; }
.profile-name { font-size: 1.15rem; font-weight: 700; color: var(--text); }
.profile-name-row { display: flex; align-items: center; gap: 6px; }
.btn-edit-name { background: none; border: none; cursor: pointer; font-size: 0.9rem; padding: 2px 4px; opacity: 0.6; }
.btn-edit-name:hover { opacity: 1; }
.profile-edit-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.profile-edit-row .input-field { flex: 1; padding: 4px 8px; font-size: 0.9rem; }
.profile-edit-row .btn-small { padding: 4px 10px; font-size: 0.8rem; }
.profile-subtitle { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; }

/* === Toast === */
.toast-container {
    position: fixed;
    top: env(safe-area-inset-top, 20px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    max-width: 400px;
    width: calc(100% - 2rem);
    pointer-events: none;
    padding-top: 8px;
}

.toast-container .toast {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 8px;
    text-align: center;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: auto;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.toast-container .toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success { background: rgba(52,199,89,0.15); color: #248A3D; }
.toast-error { background: rgba(255,59,48,0.15); color: #D70015; }
.toast-warning { background: rgba(255,149,0,0.15); color: #C93400; }
.toast-info { background: rgba(0,122,255,0.15); color: #0040DD; }

/* === Loading === */
.loading-screen { display: flex; align-items: center; justify-content: center; min-height: 40dvh; }
.loading-spinner { text-align: center; color: var(--text-light); padding: 2rem; }
.text-muted { color: var(--text-light); }
.text-center { text-align: center; }

/* === Close Summary === */
.summary-card {
    margin: 1rem auto 0;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    max-width: 1040px;
}

.summary-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.25rem 1rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.summary-icon { font-size: 1.8rem; }
.summary-title {
    font-size: 1.22rem;
    font-weight: 800;
    line-height: 1.35;
}

.summary-stats { padding: 1rem 1.25rem; }
.summary-items { padding: 0 1.25rem 0.75rem; }
.summary-users { padding: 0 1.25rem 1.25rem; }

.summary-section-title {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
}

.summary-note {
    margin-top: 8px;
    font-size: 0.88rem;
    color: var(--text-light);
    line-height: 1.45;
}

.summary-user-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,251,255,0.98));
}

.summary-user-header {
    align-items: center;
}

.summary-user-items {
    gap: 0;
}

.summary-user-item-line {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 7px 0;
    border-top: 1px dashed rgba(198, 198, 200, 0.72);
}

.summary-user-item-line:first-child {
    border-top: none;
    padding-top: 0;
}

.summary-user-item-bullet {
    flex-shrink: 0;
    color: var(--primary);
    font-size: 0.95rem;
    line-height: 1.45;
}

.summary-user-item-text {
    min-width: 0;
    font-size: 0.84rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

.summary-user-note-block {
    margin-top: 8px;
    background: rgba(255, 149, 0, 0.09);
    color: #725433;
}

.summary-share-modal-content {
    max-width: 560px;
}

.summary-share-intro {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.summary-share-option-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.summary-share-option {
    width: 100%;
    border: 1px solid rgba(0, 122, 255, 0.12);
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    padding: 14px 16px;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.summary-share-option.is-selected {
    border-color: rgba(0, 122, 255, 0.38);
    box-shadow: 0 10px 22px rgba(26, 115, 184, 0.1);
    transform: translateY(-1px);
}

.summary-share-option:hover,
.summary-share-option:focus-visible {
    border-color: rgba(0, 122, 255, 0.26);
    box-shadow: 0 10px 22px rgba(26, 115, 184, 0.08);
    outline: none;
}

.summary-share-option-title {
    display: block;
    font-size: 0.94rem;
    font-weight: 800;
    color: var(--text);
}

.summary-share-option-desc {
    display: block;
    margin-top: 4px;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.summary-share-preview-shell {
    margin-top: 16px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(0, 122, 255, 0.05);
    border: 1px solid rgba(0, 122, 255, 0.08);
}

.summary-share-preview-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.02em;
}

.summary-share-preview {
    margin-top: 8px;
    font-family: inherit;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text);
}

.summary-share-footer {
    padding-top: 0;
}

.summary-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    padding: 1rem;
    max-width: 1040px;
    margin: 0 auto 1rem;
}

.summary-actions .btn,
.summary-actions .summary-completed-badge {
    min-height: 48px;
}

.summary-completed-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    background: rgba(52,199,89,0.12);
    color: #248A3D;
    border-radius: 8px;
    font-weight: 700;
    text-align: center;
}

/* === LINE Share Button === */
.btn-line-share {
    background: #06C755;
    color: white;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}
.btn-line-share:active { transform: scale(0.97); background: #05b34c; }

/* === Active Order Cards (Home) === */
.active-order-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--white);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow);
    margin-bottom: 8px;
    border-left: 4px solid var(--primary);
    transition: all var(--transition);
    -webkit-tap-highlight-color: transparent;
}
.active-order-card:active { transform: scale(0.98); }
.active-order-left { display: flex; align-items: center; gap: 10px; }
.active-order-icon { font-size: 1.5rem; }
.active-order-name { font-weight: 700; font-size: 0.95rem; }
.active-order-meta { font-size: 0.72rem; color: var(--text-secondary); margin-top: 2px; }
.active-order-right { flex-shrink: 0; }
.active-order-role {
    font-size: 0.68rem;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 600;
    white-space: nowrap;
}
.active-order-role.creator { background: rgba(0,122,255,0.12); color: var(--primary); }
.active-order-role.participant { background: rgba(52,199,89,0.12); color: #248A3D; }

/* === Nav Badge (bottom nav) === */
.bottom-nav-item { position: relative; }
.nav-dot {
    position: absolute;
    top: 4px;
    right: calc(50% - 16px);
    width: 8px;
    height: 8px;
    background: #FF3B30;
    border-radius: 50%;
    border: 1.5px solid white;
}

/* === Unpaid Alert Badge (MyOrders) === */
.unpaid-alert-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255, 59, 48, 0.12);
    color: #FF3B30;
    font-weight: 600;
    margin-top: 4px;
}

/* === Sort Toggle Button === */
.btn-sort-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition);
    -webkit-tap-highlight-color: transparent;
}
.btn-sort-toggle:hover { background: var(--bg-secondary); }
.btn-sort-toggle:active { transform: scale(0.97); }

/* === Completed Order Status (Detail page) === */
.order-status.completed { background: rgba(0,122,255,0.12); color: #007AFF; }

/* === Clickable Paid Badge === */
.paid-badge.clickable {
    cursor: pointer;
    transition: opacity 0.2s;
}
.paid-badge.clickable:hover { opacity: 0.7; }

/* === Searchable Select (Store picker) === */
.searchable-select { position: relative; }
.searchable-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    max-height: 280px;
    overflow-y: auto;
    z-index: 60;
    box-shadow: var(--shadow-lg);
    -webkit-overflow-scrolling: touch;
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 0.5px solid rgba(0,0,0,0.04);
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover, .dropdown-item:active { background: var(--primary-light); }
.dropdown-item-icon { font-size: 1.5rem; flex-shrink: 0; }
.dropdown-item-info { flex: 1; min-width: 0; }
.dropdown-item-name { font-weight: 600; font-size: 0.9rem; }
.dropdown-item-meta { font-size: 0.72rem; color: var(--text-secondary); }
.dropdown-empty { padding: 1rem; text-align: center; color: var(--text-secondary); font-size: 0.85rem; }

/* === Selected Store Preview === */
.selected-store-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    margin: 0 1rem;
    border: 2px solid var(--primary);
}
.selected-store-info { display: flex; align-items: center; gap: 10px; }
.selected-store-icon { font-size: 1.5rem; }
.selected-store-name { font-weight: 700; font-size: 0.95rem; }
.selected-store-meta { font-size: 0.72rem; color: var(--text-secondary); }
.selected-store-actions { display: flex; gap: 6px; }

/* === Frequent Stores === */
.frequent-stores-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.store-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    -webkit-tap-highlight-color: transparent;
}
.store-badge:hover, .store-badge:active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

/* 手機版顯示 badges, 隱藏 grid */
.frequent-stores-grid { display: none; }

/* 電腦版隱藏 badges, 顯示 grid */
@media (min-width: 768px) {
    .frequent-stores-badges { display: none; }
    .frequent-stores-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
}

.store-card-large {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition);
    box-shadow: var(--shadow);
    -webkit-tap-highlight-color: transparent;
}
.store-card-large:hover, .store-card-large:active {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: scale(0.97);
}

/* === Store Info (Order Detail) === */
.order-store-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 6px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.order-store-info a {
    color: var(--primary);
    text-decoration: none;
}
.order-store-info a:hover { text-decoration: underline; }

/* === Item Filter (Create Order) === */
.item-filter-list {
    max-height: 400px;
    overflow-y: auto;
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    -webkit-overflow-scrolling: touch;
}
.item-filter-category {
    padding: 8px 12px;
    background: var(--bg-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    border-bottom: 0.5px solid rgba(0,0,0,0.04);
    position: sticky;
    top: 0;
    z-index: 1;
}
.item-filter-category:hover { background: #e8e8e8; }
.cat-arrow { font-size: 0.65rem; color: var(--text-secondary); }
.cat-count-badge {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    padding: 1px 6px;
    border-radius: 8px;
}
.btn-tiny {
    font-size: 0.65rem;
    padding: 1px 6px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--white);
    color: var(--text-secondary);
    cursor: pointer;
}
.btn-tiny:hover { background: var(--bg-secondary); }
.item-filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 0.5px solid rgba(0,0,0,0.04);
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.item-filter-row:last-child { border-bottom: none; }
.item-filter-row:active { background: var(--primary-light); }
.item-filter-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: var(--primary);
}
.item-filter-emoji { font-size: 1.1rem; flex-shrink: 0; }
.item-filter-name { flex: 1; font-size: 0.88rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-filter-price { font-size: 0.78rem; color: var(--text-secondary); flex-shrink: 0; }

/* === Customization Config Toggle === */
.cust-config-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    background: var(--white);
    transition: background 0.15s;
}
.cust-config-row:active { background: var(--primary-light); }
.cust-config-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: var(--primary);
}
.cust-config-info { flex: 1; }
.cust-config-label { font-size: 0.88rem; font-weight: 600; }
.cust-config-desc { font-size: 0.72rem; color: var(--text-secondary); margin-top: 2px; }

/* === Customization Option Editor (Store Create/Edit) === */
.cust-option-block {
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
    margin-bottom: 8px;
    background: var(--white);
}
.cust-option-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}
.cust-option-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 4px;
}
.cust-choice-row {
    display: flex;
    align-items: center;
    gap: 4px;
}
.cust-choice-input {
    width: 90px;
    padding: 4px 8px !important;
}


.summary-table {
    background: var(--bg);
    border-radius: 12px;
    padding: 10px 14px;
}

.summary-item-group {
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    margin-bottom: 8px;
}
.summary-item-group:last-child { border-bottom: none; margin-bottom: 0; }

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    padding: 8px 0;
    font-size: 0.95rem;
    line-height: 1.45;
}

.summary-row-main { font-weight: 600; }

.summary-row span:first-child { flex: 2; min-width: 0; }
.summary-row span:nth-child(2) { flex: 1; text-align: center; color: var(--text-light); }
.summary-row span:last-child { flex: 1; text-align: right; font-weight: 700; color: var(--primary); }

.summary-item-details {
    padding-left: 18px;
}

.summary-detail-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 0;
    font-size: 0.86rem;
    color: var(--text-secondary);
    line-height: 1.45;
}
.summary-detail-row span:first-child { flex: 2; min-width: 0; }
.summary-detail-row span:nth-child(2) { flex: 1; text-align: center; }
.summary-detail-row span:last-child { flex: 1; text-align: right; color: var(--text-secondary); }

/* === Profile Logout === */
.profile-logout {
    padding: 2rem 1rem;
    text-align: center;
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 11px 28px;
    background: rgba(255,59,48,0.08);
    color: var(--danger);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    transition: all var(--transition);
}

.btn-logout:active { transform: scale(0.97); }

/* ==========================================
   Skeleton Loading
   ========================================== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}
.skeleton-line { height: 16px; margin-bottom: 8px; }
.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }
.skeleton-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* === Cart item swipe-to-delete === */
.cart-item {
    position: relative;
    overflow: hidden;
}
.cart-item-delete {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 70px;
    background: var(--danger);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    transform: translateX(100%);
    transition: transform 0.2s;
}

/* ==========================================
   Home: Store Search + Browse + Horizontal Badges
   ========================================== */

/* --- Store bar (search + type tabs) --- */
.home-store-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.home-search-row {
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
}
.home-search-input {
    border-radius: 12px !important;
    padding: 10px 14px !important;
    padding-right: 38px !important;
    font-size: 0.9rem !important;
    background: var(--white) !important;
    flex: 1;
}
.home-search-clear {
    position: absolute;
    right: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: var(--border);
    color: var(--text-secondary);
    border-radius: 50%;
    font-size: 0.7rem;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition);
    -webkit-tap-highlight-color: transparent;
}
.home-search-clear:hover {
    background: var(--text-secondary);
    color: white;
}

/* --- Type filter tabs --- */
.home-store-type-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.home-store-type-tabs::-webkit-scrollbar { display: none; }
.home-type-tab {
    flex-shrink: 0;
    padding: 5px 14px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--white);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}
.home-type-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.home-type-tab:not(.active):hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* --- Store list (search results / browse) --- */
.home-store-list {
    margin-top: 8px;
    background: var(--white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    max-height: 320px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.home-search-item {
    display: flex;
    align-items: center;
    border-bottom: 0.5px solid var(--separator);
}
.home-search-item:last-child { border-bottom: none; }
.home-search-item-main {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 10px 12px;
    text-decoration: none;
    color: var(--text);
    gap: 10px;
    min-width: 0;
    transition: background var(--transition);
}
.home-search-item-main:active { background: var(--bg); }
.home-search-item-icon { font-size: 1.3rem; flex-shrink: 0; }
.home-search-item-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.home-search-item-name { font-weight: 500; font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-search-item-meta { font-size: 0.7rem; color: var(--text-secondary); margin-top: 1px; }
.home-search-item-edit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    flex-shrink: 0;
    text-decoration: none;
    font-size: 1rem;
    color: var(--text-secondary);
    transition: color var(--transition);
}
.home-search-item-edit:hover { color: var(--primary); }
.home-search-empty {
    padding: 20px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.home-search-loading {
    margin-top: 8px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: rgba(0, 122, 255, 0.06);
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 500;
}

/* --- Horizontal scroll badges (mobile: scroll, desktop: wrap) --- */
.home-store-scroll-section {
    padding-right: 0 !important;
}
.home-store-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-right: 1rem;
    padding-bottom: 4px;
}
.home-store-scroll::-webkit-scrollbar { display: none; }

@media (min-width: 768px) {
    .home-store-scroll-section {
        padding-right: 1rem !important;
    }
    .home-store-scroll {
        flex-wrap: wrap;
        overflow-x: visible;
        padding-right: 0;
    }
}

.home-store-chip {
    display: flex;
    align-items: stretch;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 20px;
    flex-shrink: 0;
    overflow: hidden;
    transition: all var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.home-store-chip:hover {
    border-color: var(--primary);
    box-shadow: 0 1px 6px rgba(0,122,255,0.12);
}
.home-store-chip-main {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 4px 7px 12px;
    text-decoration: none;
    color: var(--text);
    white-space: nowrap;
}
.home-store-chip-icon { font-size: 1rem; }
.home-store-chip-name { font-weight: 500; font-size: 0.82rem; max-width: 80px; overflow: hidden; text-overflow: ellipsis; }
.home-store-chip-edit {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    text-decoration: none;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-left: 1px solid var(--border);
    transition: background var(--transition), color var(--transition);
}
.home-store-chip-edit:hover {
    background: var(--primary-light);
    color: var(--primary);
}

@media (min-width: 1024px) {
    .desktop-topbar.auth-hidden {
        display: none !important;
    }

    .form-label {
        font-size: 0.86rem;
        margin-bottom: 8px;
    }

    .input-field {
        padding: 13px 16px;
        font-size: 1rem;
    }

    .btn,
    .btn-line-share {
        min-height: 48px;
        font-size: 1rem;
    }

    .btn-small {
        font-size: 0.84rem;
        padding: 8px 14px;
    }

    .section-title {
        font-size: 0.95rem;
    }

    .desktop-topbar {
        max-width: min(var(--front-shell-max), calc(100vw - 48px));
        margin: 18px auto 0;
        padding: 16px 22px;
        border-radius: 20px;
        border: 1px solid rgba(0, 122, 255, 0.08);
        background: rgba(255, 255, 255, 0.82);
        box-shadow: 0 12px 40px rgba(28, 61, 90, 0.08);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        position: sticky;
        top: 12px;
        z-index: 120;
    }

    .desktop-brand {
        display: inline-flex;
        align-items: center;
        gap: 0.75rem;
        color: var(--text);
        text-decoration: none;
        font-weight: 800;
        letter-spacing: -0.02em;
    }

    .desktop-brand-icon {
        width: 46px;
        height: 46px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 14px;
        background: linear-gradient(135deg, var(--primary), #5aa8ff);
        color: white;
        font-size: 1.35rem;
        box-shadow: 0 10px 20px rgba(0, 122, 255, 0.22);
    }

    .desktop-brand-text {
        font-size: 1.1rem;
    }

    .desktop-topnav {
        display: flex;
        align-items: center;
        gap: 0.4rem;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .desktop-toplink {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 46px;
        padding: 0 16px;
        border-radius: 12px;
        color: var(--text-secondary);
        text-decoration: none;
        font-size: 0.98rem;
        font-weight: 600;
        transition: background var(--transition), color var(--transition), transform var(--transition);
    }

    .desktop-toplink:hover {
        color: var(--primary);
        background: rgba(0, 122, 255, 0.08);
    }

    .desktop-toplink.active {
        color: var(--primary);
        background: var(--primary-light);
    }

    .desktop-toplink-profile {
        gap: 0.6rem;
        padding-left: 12px;
        white-space: nowrap;
    }

    .desktop-profile-avatar {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        overflow: hidden;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: var(--primary-light);
        box-shadow: inset 0 0 0 1px rgba(0, 122, 255, 0.12);
        flex-shrink: 0;
        position: relative;
        isolation: isolate;
        line-height: 0;
        font-size: 0;
    }

    .app-container {
        max-width: min(var(--front-shell-max), calc(100vw - 48px));
        margin: 20px auto 32px;
        min-height: auto;
        padding-bottom: 32px;
        background: transparent;
        box-shadow: none;
    }

    .bottom-nav {
        display: none;
    }

    .floating-back-btn {
        display: none !important;
    }

    .page-header {
        position: static;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-bottom: none;
        padding: 0 0 1rem;
    }

    .page-title {
        font-size: 1.7rem;
        color: #18344a;
        line-height: 1.2;
    }

    .back-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 42px;
        padding: 0 14px;
        border-radius: 12px;
        background: rgba(255,255,255,0.86);
        box-shadow: 0 6px 18px rgba(28, 61, 90, 0.08);
    }

    .login-screen {
        width: min(100%, 560px);
        min-height: auto;
        margin: 72px auto 32px;
        padding: 3rem;
        border-radius: 28px;
        box-shadow: 0 22px 48px rgba(28, 61, 90, 0.12);
        border: 1px solid rgba(0, 122, 255, 0.08);
    }

    .home-dashboard {
        display: flex;
        flex-direction: column;
        gap: 1.25rem;
    }

    .home-hero-layout {
        display: grid;
        grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr);
        gap: 1rem;
        align-items: stretch;
    }

    .home-hero-panel {
        min-height: 300px;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-end;
        text-align: left;
        border-radius: 28px;
        box-shadow: 0 24px 44px rgba(0, 122, 255, 0.18);
        padding: 2.4rem;
    }

    .home-hero-panel .hero-logo {
        width: 104px;
        height: 104px;
        border-radius: 24px;
        margin-bottom: 1rem;
    }

    .home-hero-panel .hero-title {
        font-size: 2.3rem;
    }

    .home-hero-panel .hero-subtitle {
        font-size: 1.08rem;
    }

    .home-action-panel {
        background: rgba(255,255,255,0.9);
        border-radius: 24px;
        padding: 1.1rem;
        box-shadow: 0 14px 32px rgba(28, 61, 90, 0.09);
        border: 1px solid rgba(0, 122, 255, 0.08);
    }

    .home-action-panel .action-cards {
        grid-template-columns: 1fr;
        padding: 0;
        margin-top: 0;
        height: 100%;
    }

    .home-action-panel .action-card {
        min-height: 140px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 1.35rem;
    }

    .home-action-panel .action-icon {
        font-size: 2.5rem;
    }

    .home-action-panel .action-title {
        font-size: 1.18rem;
    }

    .home-action-panel .action-desc {
        font-size: 0.88rem;
    }

    .home-content-grid {
        display: grid;
        grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.85fr);
        gap: 1rem;
        align-items: start;
    }

    .home-primary-column,
    .home-secondary-column {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .home-content-grid .section {
        padding: 1.25rem;
        background: rgba(255,255,255,0.92);
        border-radius: 22px;
        box-shadow: 0 14px 36px rgba(28, 61, 90, 0.08);
        border: 1px solid rgba(0, 122, 255, 0.06);
    }

    .home-content-grid .section-title {
        margin-bottom: 1rem;
        font-size: 0.95rem;
    }

    .home-search-input,
    .home-store-chip-name,
    .home-type-tab {
        font-size: 0.95rem;
    }

    .home-store-list {
        max-height: 480px;
    }

    .home-store-scroll-section {
        padding-right: 1.25rem !important;
    }

    .home-store-chip {
        border-radius: 18px;
    }

    .create-order-page,
    .profile-page-shell,
    .order-detail-page,
    .front-store-editor {
        max-width: 100%;
    }

    .create-order-workspace {
        display: grid;
        gap: 1rem;
    }

    .create-order-workspace.two-column {
        grid-template-columns: minmax(380px, 0.95fr) minmax(500px, 1.2fr);
        align-items: start;
        gap: 1.25rem;
    }

    .step-panel {
        background: rgba(255,255,255,0.92);
        border-radius: 22px;
        box-shadow: 0 14px 36px rgba(28, 61, 90, 0.08);
        border: 1px solid rgba(0, 122, 255, 0.06);
        padding: 1.45rem 0 1.3rem;
    }

    .create-order-workspace.two-column #step2 {
        position: sticky;
        top: 104px;
    }

    .step-header {
        margin-bottom: 1.25rem;
    }

    .step-num {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .step-title {
        font-size: 1.35rem;
    }

    .step-result-panel {
        margin-top: 1rem;
    }

    .selected-store-preview {
        align-items: flex-start;
        padding: 18px 20px;
    }

    .selected-store-name {
        font-size: 1.12rem;
    }

    .selected-store-meta {
        font-size: 0.8rem;
    }

    .selected-store-actions {
        flex-shrink: 0;
        align-self: center;
    }

    .frequent-stores-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
    }

    .store-card-large {
        padding: 1.35rem 1rem;
        min-height: 112px;
    }

    .store-card-large .store-icon {
        font-size: 2.2rem;
    }

    .store-card-large .store-name {
        font-size: 1rem;
        margin-top: 0.45rem;
    }

    .store-card-large .store-meta {
        font-size: 0.8rem;
    }

    .result-card {
        margin: 0 1.25rem 1.25rem;
        padding: 2rem;
    }

    .action-btns {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.75rem;
        padding: 0 1.25rem;
    }

    .action-btns .btn {
        margin-bottom: 0;
    }

    .front-store-editor {
        display: grid;
        grid-template-columns: repeat(12, minmax(0, 1fr));
        gap: 1rem;
        align-items: start;
        padding: 0;
    }

    .front-store-editor > .form-group {
        grid-column: span 6;
        background: rgba(255,255,255,0.94);
        border-radius: 20px;
        padding: 1rem 1.1rem;
        box-shadow: 0 14px 36px rgba(28, 61, 90, 0.08);
        border: 1px solid rgba(0, 122, 255, 0.06);
        margin-bottom: 0;
    }

    .front-store-editor > .section {
        grid-column: 1 / -1;
        background: rgba(255,255,255,0.94);
        border-radius: 22px;
        padding: 1.25rem;
        box-shadow: 0 14px 36px rgba(28, 61, 90, 0.08);
        border: 1px solid rgba(0, 122, 255, 0.06);
    }

    .front-store-editor .section-title {
        margin-bottom: 1rem;
    }

    .front-store-editor .upload-area,
    .front-store-editor .upload-note,
    .front-store-editor .uploaded-menu-list,
    .front-store-editor .ocr-review-banner {
        margin-left: 0;
        margin-right: 0;
    }

    .front-store-editor .category-block {
        background: #f7fbff;
        border: 1px solid rgba(0, 122, 255, 0.08);
    }

    .front-store-editor .item-row {
        align-items: center;
    }

    .store-editor-actions {
        grid-column: 1 / -1;
        margin-top: 0 !important;
        padding: 0;
    }

    .profile-page-shell {
        display: grid;
        grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
        gap: 1rem;
        align-items: start;
        padding-bottom: 1rem;
    }

    .profile-card,
    .profile-logout,
    .profile-bind-line > div {
        margin: 0;
        background: rgba(255,255,255,0.94);
        border-radius: 22px;
        box-shadow: 0 14px 36px rgba(28, 61, 90, 0.08);
        border: 1px solid rgba(0, 122, 255, 0.06);
    }

    .profile-card {
        padding: 2rem;
    }

    .profile-logout {
        padding: 1.5rem;
        text-align: left;
    }

    .btn-logout {
        width: 100%;
        justify-content: center;
    }

    .order-detail-page {
        padding-bottom: 7rem;
    }

    .order-header {
        margin: 0 0 1rem;
        padding: 1.35rem 1.5rem;
        border-radius: 22px;
        box-shadow: 0 14px 36px rgba(28, 61, 90, 0.08);
        border: 1px solid rgba(0, 122, 255, 0.06);
    }

    .order-store-icon {
        font-size: 2rem;
    }

    .order-store-name {
        font-size: 1.5rem;
    }

    .order-status {
        font-size: 0.82rem;
        padding: 6px 12px;
        border-radius: 999px;
    }

    .order-meta,
    .order-store-info,
    .order-memo {
        font-size: 0.92rem;
    }

    .tabs {
        position: static;
        margin-bottom: 1rem;
        border-radius: 18px;
        overflow: hidden;
        border: 1px solid rgba(0, 122, 255, 0.06);
        box-shadow: 0 10px 26px rgba(28, 61, 90, 0.06);
    }

    .tab {
        font-size: 1.08rem;
        font-weight: 700;
        gap: 10px;
        min-height: 60px;
        padding: 16px 22px;
    }

    .tab[data-tab="cart"] {
        flex: 1.12;
    }

    .tab-icon {
        font-size: 1.18rem;
    }

    .tab-text {
        letter-spacing: 0.01em;
    }

    .tab-badge {
        font-size: 0.68rem;
        padding: 3px 7px;
    }

    .tab-content {
        padding: 1.2rem 0 1rem;
    }

    .category-tabs {
        gap: 12px;
        padding-bottom: 0.9rem;
    }

    .cat-tab {
        min-height: 48px;
        padding: 10px 20px;
        font-size: 0.94rem;
    }

    .menu-item {
        padding: 18px 6px;
        min-height: 72px;
    }

    .menu-item-left {
        gap: 14px;
    }

    .menu-item-emoji {
        font-size: 1.9rem;
    }

    .menu-item-name {
        font-size: 1.02rem;
    }

    .menu-item-desc {
        font-size: 0.82rem;
    }

    .menu-item-price {
        font-size: 1.08rem;
    }

    .btn-add {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
    }

    .order-stats {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }

    #orderActions {
        padding: 1.25rem 0 0 !important;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 0.9rem;
        align-items: stretch;
    }

    #orderActions .btn-block {
        margin-bottom: 0;
        width: 100%;
    }

    .cart-bar {
        bottom: 28px;
        max-width: 720px;
        padding: 14px 18px;
    }

    .cart-bar-info {
        font-size: 0.96rem;
    }

    .cart-bar-count {
        font-size: 0.8rem;
    }

    .cart-bar-total {
        font-size: 1.24rem;
    }

    .cart-bar .btn {
        min-width: 170px;
    }

    .cart-dirty-banner {
        bottom: 102px;
        max-width: 720px;
    }

    .modal-content,
    .menu-preview-content {
        max-width: 720px;
        border-radius: 20px;
    }
}

@media (min-width: 1400px) {
    .desktop-topbar {
        padding: 18px 24px;
    }

    .home-hero-layout {
        grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.95fr);
    }

    .home-content-grid {
        grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.9fr);
    }

    .create-order-workspace.two-column {
        grid-template-columns: minmax(400px, 0.9fr) minmax(560px, 1.25fr);
    }
}

/* ==========================================
   RWD 響應式斷點
   ========================================== */

/* --- 平板 (768px+) --- */
@media (min-width: 768px) {
    .bottom-nav {
        max-width: 640px;
    }
    .cart-bar {
        max-width: 608px;
    }
    .store-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .action-cards {
        gap: 16px;
    }
    .action-card {
        padding: 1.5rem;
    }
    .action-icon { font-size: 2.5rem; }
    .action-title { font-size: 1.1rem; }
    .hero-banner {
        padding: 2.5rem;
    }
    .hero-title { font-size: 1.8rem; }
    .hero-subtitle { font-size: 1rem; }
    .modal-content {
        max-width: 640px;
    }
    .menu-preview-content {
        max-width: 640px;
    }
    .login-icon { font-size: 5rem; }
    .login-title { font-size: 2.2rem; }
    .result-code { font-size: 3rem; }
    .stat-card {
        padding: 16px;
    }
    .stat-value { font-size: 1.5rem; }
    .store-history-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* --- 桌面 (1024px+) --- */
@media (min-width: 1024px) {
    .bottom-nav {
        max-width: 768px;
    }
    .cart-bar {
        max-width: 736px;
    }
    .store-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .modal-overlay, .menu-preview-overlay {
        align-items: center;
    }
    .modal-content {
        border-radius: 16px;
        max-width: 520px;
        max-height: 70dvh;
    }
    .menu-preview-content {
        border-radius: 16px;
        max-width: 520px;
        max-height: 70dvh;
    }
    .store-history-section {
        border-radius: 18px;
    }
    .store-history-toggle {
        padding: 18px 20px;
        cursor: default;
    }
    .store-history-toggle-icon {
        display: none;
    }
    .store-history-content {
        padding: 0 20px 20px;
    }
    .store-history-item {
        padding: 14px 0;
    }
    .store-history-item-side {
        justify-content: flex-end;
    }
    .order-section-title {
        font-size: 1.08rem;
        margin-bottom: 1rem;
    }
    .cart-item {
        padding: 16px 18px;
        border-radius: 18px;
        margin-bottom: 12px;
    }
    .cart-item-title-wrap {
        gap: 14px;
    }
    .cart-item-emoji {
        font-size: 1.72rem;
    }
    .cart-item-name {
        font-size: 1.08rem;
    }
    .cart-item-customization,
    .cart-item-note-line,
    .cart-item-note {
        font-size: 0.88rem;
    }
    .cart-item-line-total {
        font-size: 1.18rem;
    }
    .cart-item-qty,
    .cart-item-edit-label {
        font-size: 0.82rem;
    }
    .user-order-card {
        padding: 16px 18px;
        border-radius: 18px;
    }
    .user-order-name {
        font-size: 1.02rem;
    }
    .user-order-item-row {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        gap: 16px;
    }
    .user-order-item-mainline {
        gap: 16px;
    }
    .user-order-item-name {
        font-size: 0.98rem;
    }
    .user-order-item-pricing {
        font-size: 0.88rem;
    }
    .user-order-item-detail,
    .user-order-item-note-block,
    .user-order-note-block {
        font-size: 0.86rem;
    }
    .order-follow-btn,
    .order-follow-unavailable {
        flex-shrink: 0;
        align-self: center;
    }
    .summary-share-modal-content {
        max-width: 620px;
    }
    .summary-share-option-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .summary-share-preview {
        font-size: 0.85rem;
        min-height: 200px;
    }
    .payment-confirm-item {
        padding: 14px 16px;
        border-radius: 12px;
    }
    .payment-user-name,
    .payment-amount {
        font-size: 0.94rem;
    }
    .summary-user-item-text {
        font-size: 0.88rem;
    }
    .summary-card {
        display: grid;
        grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
        border-radius: 18px;
        margin-top: 1.25rem;
    }
    .summary-header,
    .summary-stats {
        grid-column: 1 / -1;
    }
    .summary-header {
        padding: 1.5rem 1.6rem 1.1rem;
    }
    .summary-title {
        font-size: 1.4rem;
    }
    .summary-stats {
        padding: 1rem 1.6rem 1.25rem;
    }
    .summary-items,
    .summary-users {
        padding: 0 1.6rem 1.6rem;
    }
    .summary-items {
        border-right: 1px solid var(--separator);
    }
    .summary-users {
        padding-left: 1.4rem;
    }
    .summary-actions {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        padding: 1rem 0 1.5rem;
    }
    .summary-actions .btn,
    .summary-actions .summary-completed-badge {
        margin: 0;
    }
    .summary-users .user-order-card {
        padding: 14px 16px;
        margin-bottom: 10px;
    }
    .summary-users .user-order-header {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    .summary-users .user-order-item {
        font-size: 0.9rem;
    }
    .hero-banner {
        padding: 3rem;
        border-radius: 0 0 32px 32px;
    }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}