/* ============================
   The Cork - Wine Cellar App
   iOS Human Interface Guidelines
   Redesign
   ============================ */

:root {
    /* System-inspired colors */
    --system-blue: #007AFF;
    --system-red: #FF3B30;
    --system-green: #34C759;
    --system-orange: #FF9500;

    /* Wine accent colors */
    --wine-primary: #722F37;
    --wine-secondary: #8B4553;
    --wine-tertiary: #A65D6A;

    /* Backgrounds - iOS style */
    --bg-primary: #F2F2F7;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F2F2F7;
    --bg-grouped: #FFFFFF;

    /* Text colors - iOS standard */
    --label-primary: #000000;
    --label-secondary: #3C3C43;
    --label-tertiary: #3C3C4399;
    --label-quaternary: #3C3C434D;

    /* Separators */
    --separator: #3C3C4349;
    --separator-opaque: #C6C6C8;

    /* Wine type colors */
    --red-wine: #722F37;
    --white-wine: #E8D5A0;
    --rose-wine: #E8B4B8;
    --sparkling-wine: #F5E6C8;
    --dessert-wine: #C4956A;

    /* iOS Typography scale */
    --font-large-title: 34px;
    --font-title1: 28px;
    --font-title2: 22px;
    --font-title3: 20px;
    --font-headline: 17px;
    --font-body: 17px;
    --font-callout: 16px;
    --font-subhead: 15px;
    --font-footnote: 13px;
    --font-caption1: 12px;
    --font-caption2: 11px;

    /* Spacing - 8pt grid */
    --space-4: 4px;
    --space-8: 8px;
    --space-12: 12px;
    --space-16: 16px;
    --space-20: 20px;
    --space-24: 24px;
    --space-32: 32px;
    --space-44: 44px;

    /* iOS corner radii */
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-card: 12px;
    --radius-modal: 12px;

    /* System fonts */
    --font-system: 'Space Grotesk', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

    /* Shadows - iOS style */
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-elevated: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-modal: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-system);
    background: var(--bg-primary);
    color: var(--label-primary);
    line-height: 1.47;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

#app {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* ============================
   Navigation Bar (Header)
   iOS: 44pt content + safe area
   ============================ */

.header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: rgba(242, 242, 247, 0.94);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 0.5px solid var(--separator);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 44px;
    padding: 0 var(--space-16);
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 44px;
}

.logo-icon {
    height: 29px;
    width: auto;
}

.logo-icon path {
    fill: #1A1A1A;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 700;
    font-size: 25px;
    letter-spacing: -0.5px;
    color: #1A1A1A;
    line-height: 1;
}

.logo-title em {
    font-style: normal;
    font-weight: 300;
    color: #722F37;
}

.logo-subtitle {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: 5.4px;
    letter-spacing: 2.7px;
    text-transform: uppercase;
    color: #8A8278;
    margin-top: -1px;
}

.header-stats {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 500;
    color: var(--label-secondary);
    background: rgba(60, 60, 67, 0.08);
    padding: 4px 10px;
    border-radius: 100px;
    white-space: nowrap;
}

/* Sync Status Icon (inside header-stats) */
.sync-icon {
    display: flex;
    align-items: center;
    line-height: 0;
}

.sync-icon svg {
    display: block;
}

.sync-icon.status-local {
    color: var(--label-quaternary);
}

.sync-icon.status-connecting,
.sync-icon.status-syncing {
    color: var(--system-orange);
    animation: pulse-sync 1.2s ease-in-out infinite;
}

.sync-icon.status-synced {
    color: var(--system-green);
}

.sync-icon.status-error {
    color: var(--system-red);
}

.sync-icon.status-disconnected {
    color: var(--label-quaternary);
}

@keyframes pulse-sync {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Header right-side action buttons */
.header-actions {
    display: flex;
    align-items: center;
}

/* Header Icon Buttons - 44pt touch target */
.header-icon-btn {
    width: 36px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--wine-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-icon-btn svg {
    width: 22px;
    height: 22px;
}

.header-icon-btn:active {
    opacity: 0.6;
}

.header-icon-btn.active {
    color: var(--wine-primary);
    background: rgba(114, 47, 55, 0.12);
    border-radius: 8px;
}

.header-icon-btn.active svg {
    fill: var(--wine-primary);
    stroke: var(--wine-primary);
}

/* Legacy support */
.settings-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--wine-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.settings-btn svg {
    width: 24px;
    height: 24px;
}

.settings-btn:active {
    opacity: 0.6;
}

/* ============================
   Main Content
   ============================ */

.main-content {
    flex: 1;
    padding: var(--space-16);
    padding-bottom: 100px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

/* ============================
   Search Bar - iOS Style
   ============================ */

/* ============================
   Filter Bar (Sticky)
   ============================ */

.filter-bar {
    position: sticky;
    top: 44px;
    z-index: 100;
    background: var(--bg-primary);
    padding: var(--space-12) 0 var(--space-8) 0;
    margin-bottom: var(--space-8);
    border-bottom: 1px solid var(--separator);
}

.filter-bar.hidden {
    display: none;
}

.search-action-btn {
    position: absolute;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--label-tertiary);
    transition: all 0.2s ease;
    padding: 0;
}

.search-action-btn:hover {
    background: rgba(118, 118, 128, 0.12);
    color: var(--label-primary);
}

.search-action-btn.active {
    color: var(--wine-primary);
}

.search-action-btn svg {
    width: 16px;
    height: 16px;
}

/* ============================
   Filter Row — Dropdown Buttons
   ============================ */

.filter-row {
    display: flex;
    gap: 8px;
    margin-top: var(--space-8);
}

.filter-dropdown {
    position: relative;
    flex: 1;
    min-width: 0;
}

.filter-dropdown-btn {
    width: 100%;
    padding: 9px 10px;
    border-radius: 10px;
    border: 1.5px solid var(--separator-opaque);
    background: var(--bg-secondary);
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font-system);
    color: var(--label-tertiary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-dropdown-btn.has-value {
    border-color: var(--wine-primary);
    background: rgba(114, 47, 55, 0.06);
    color: var(--wine-primary);
    font-weight: 600;
}

.filter-dropdown-label {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.filter-dropdown-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.filter-dropdown-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.filter-dropdown-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.filter-dropdown-clear {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(60, 60, 67, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--bg-secondary);
}

.filter-dropdown-clear.hidden {
    display: none;
}

.filter-dropdown-clear svg {
    width: 8px;
    height: 8px;
}

.filter-dropdown-chevron {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}

.filter-dropdown.open .filter-dropdown-chevron {
    transform: rotate(180deg);
}

/* Dropdown menu */
.filter-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    min-width: 140px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--separator-opaque);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    z-index: 150;
    overflow: hidden;
    animation: dropdownIn 0.18s ease;
    max-height: 260px;
    overflow-y: auto;
}

.filter-dropdown-menu.hidden {
    display: none;
}

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

.filter-dropdown-option {
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 13px;
    font-family: var(--font-system);
    color: var(--label-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.15s ease;
}

.filter-dropdown-option:hover {
    background: var(--bg-tertiary);
}

.filter-dropdown-option.selected {
    background: rgba(114, 47, 55, 0.06);
    color: var(--wine-primary);
    font-weight: 600;
}

.filter-dropdown-option.selected::after {
    content: '';
    width: 16px;
    height: 16px;
    background: var(--wine-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E");
    background-size: 10px;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

.filter-opt-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Type color dots */
.filter-type-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-red { background: var(--red-wine); }
.dot-white { background: var(--white-wine); border: 1px solid #D4C08C; }
.dot-rosé { background: var(--rose-wine); }
.dot-sparkling { background: var(--sparkling-wine); border: 1px solid #D4C9A8; }
.dot-dessert { background: var(--dessert-wine); }
.dot-orange { background: #E07B39; }

/* Drinking window dots */
.filter-window-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ============================
   Advanced Filter Button
   ============================ */

.advanced-filter-btn {
    padding: 9px 11px;
    border-radius: 10px;
    border: 1.5px solid var(--separator-opaque);
    background: var(--bg-secondary);
    color: var(--label-tertiary);
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.advanced-filter-btn.has-value {
    border-color: var(--wine-primary);
    background: rgba(114, 47, 55, 0.06);
    color: var(--wine-primary);
}

.advanced-filter-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--wine-primary);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-system);
}

.advanced-filter-badge.hidden {
    display: none;
}

/* ============================
   Active Filter Bar
   ============================ */

.active-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    margin-top: var(--space-8);
    background: rgba(114, 47, 55, 0.06);
    border-radius: 10px;
    animation: filterBarIn 0.2s ease;
    gap: 8px;
}

.active-filter-bar.hidden {
    display: none;
}

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

.active-filter-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.active-filter-count {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--wine-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: var(--font-system);
}

.active-filter-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    min-width: 0;
}

.active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-system);
    white-space: nowrap;
    cursor: pointer;
    transition: opacity 0.15s;
}

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

.active-filter-tag svg {
    width: 8px;
    height: 8px;
    opacity: 0.6;
}

/* Tag color variants */
.active-filter-tag.tag-type {
    background: rgba(114, 47, 55, 0.1);
    color: var(--wine-primary);
}

.active-filter-tag.tag-grape {
    background: rgba(60, 60, 67, 0.08);
    color: var(--label-primary);
}

.active-filter-tag.tag-window {
    background: rgba(74, 122, 63, 0.1);
    color: #3D6B34;
}

.active-filter-tag.tag-advanced {
    background: rgba(60, 60, 67, 0.08);
    color: var(--label-secondary);
}

.active-filter-clear {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: none;
    background: transparent;
    color: var(--label-tertiary);
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font-system);
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 8px;
    transition: all 0.15s;
}

.active-filter-clear:active {
    background: rgba(60, 60, 67, 0.08);
}

.active-filter-clear svg {
    width: 8px;
    height: 8px;
}

/* ============================
   Advanced Filter Panel
   ============================ */

.advanced-filter-panel {
    max-height: 85vh;
    max-height: 85dvh;
    display: flex;
    flex-direction: column;
}

.advanced-filter-panel .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-8) var(--space-16) var(--space-16);
}

.adv-filter-subtitle {
    font-size: 12px;
    color: var(--label-tertiary);
    margin: 2px 0 0;
    font-weight: 400;
}

.adv-filter-section {
    margin-bottom: 22px;
}

.adv-filter-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--label-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
}

.adv-chip-wrap {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.adv-chip {
    padding: 7px 14px;
    border-radius: 20px;
    border: 1.5px solid var(--separator-opaque);
    background: transparent;
    color: var(--label-secondary);
    font-size: 12px;
    font-family: var(--font-system);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.adv-chip:active {
    transform: scale(0.96);
}

.adv-chip.active {
    border-color: transparent;
    background: var(--label-primary);
    color: #fff;
    font-weight: 600;
}

.adv-filter-footer {
    display: flex;
    gap: 10px;
    padding: var(--space-12) var(--space-16);
    border-top: 1px solid var(--separator);
    background: var(--bg-secondary);
}

.adv-filter-reset {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    border: 1.5px solid var(--separator-opaque);
    background: transparent;
    color: var(--label-primary);
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-system);
    cursor: pointer;
    transition: all 0.15s;
}

.adv-filter-reset:active {
    background: var(--bg-tertiary);
}

.adv-filter-apply {
    flex: 2;
    padding: 12px;
    border-radius: 12px;
    border: none;
    background: var(--wine-primary);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-system);
    cursor: pointer;
    transition: all 0.15s;
}

.adv-filter-apply:active {
    opacity: 0.85;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    width: 18px;
    height: 18px;
    color: var(--label-tertiary);
    pointer-events: none;
}

.search-input {
    width: 100%;
    height: 36px;
    padding: 0 36px 0 36px;
    border: none;
    border-radius: 10px;
    font-size: var(--font-body);
    font-family: var(--font-system);
    color: var(--label-primary);
    background: rgba(118, 118, 128, 0.12);
    -webkit-appearance: none;
}

.search-input:focus {
    outline: none;
}

.search-input::placeholder {
    color: var(--label-tertiary);
}

.clear-search-btn {
    position: absolute;
    right: 8px;
    width: 20px;
    height: 20px;
    border: none;
    background: rgba(60, 60, 67, 0.3);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.clear-search-btn svg {
    width: 12px;
    height: 12px;
}

.clear-search-btn.hidden {
    display: none;
}

.search-results {
    margin-top: var(--space-8);
    padding: 0 var(--space-4);
    font-size: var(--font-footnote);
    color: var(--label-secondary);
}

.search-results.hidden {
    display: none;
}

/* No Results State */
.no-results {
    text-align: center;
    padding: var(--space-44) var(--space-24);
    color: var(--label-tertiary);
}

.no-results svg {
    width: 44px;
    height: 44px;
    margin-bottom: var(--space-12);
    opacity: 0.4;
}

.no-results p {
    font-size: var(--font-subhead);
}

/* Search Highlight */
.wine-card-name mark,
.wine-card-producer mark,
.wine-card-meta mark {
    background: rgba(114, 47, 55, 0.2);
    color: var(--wine-primary);
    padding: 0 2px;
    border-radius: 2px;
}

/* ============================
   Empty State
   ============================ */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-44) var(--space-24);
    min-height: 60vh;
}

.empty-illustration {
    margin-bottom: var(--space-24);
}

.empty-stacked-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.empty-illustration .empty-logo {
    width: auto;
    height: 140px;
    opacity: 0.15;
}

.empty-logo-title {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 700;
    font-size: 32px;
    letter-spacing: -0.5px;
    text-transform: uppercase;
    color: var(--label-primary);
    opacity: 0.15;
}

.empty-logo-tagline {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: 10px;
    letter-spacing: 3.6px;
    text-transform: uppercase;
    color: var(--label-secondary);
    opacity: 0.12;
}

.empty-state h2 {
    font-size: var(--font-title2);
    font-weight: 700;
    color: var(--label-primary);
    margin-bottom: var(--space-8);
    letter-spacing: -0.4px;
}

.empty-state p {
    color: var(--label-secondary);
    font-size: var(--font-body);
}

.empty-state.hidden {
    display: none;
}

/* ============================
   Wine List - iOS Table Style
   ============================ */

.wine-list {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border-radius: var(--radius-card);
    overflow: hidden;
}

.wine-card {
    background: var(--bg-secondary);
    padding: var(--space-12) var(--space-16);
    display: flex;
    gap: var(--space-12);
    cursor: pointer;
    position: relative;
    min-height: 88px;
    align-items: center;
}

.wine-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 94px;
    right: 0;
    height: 0.5px;
    background: var(--separator);
}

.wine-card:last-child::after {
    display: none;
}

.wine-card:active {
    background: rgba(60, 60, 67, 0.06);
}

.wine-card-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.image-transition-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #ffffff;
    opacity: 0;
    transition: opacity 0.8s ease;
}
.image-transition-overlay.visible {
    opacity: 1;
}

.wine-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #ffffff;
}

.wine-card-image .placeholder-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.6);
}

.wine-card-image .placeholder-image.red { background: linear-gradient(135deg, var(--red-wine), #4a1c22); }
.wine-card-image .placeholder-image.white { background: linear-gradient(135deg, var(--white-wine), #c9bc6a); }
.wine-card-image .placeholder-image.rosé { background: linear-gradient(135deg, var(--rose-wine), #d98a91); }
.wine-card-image .placeholder-image.sparkling { background: linear-gradient(135deg, var(--sparkling-wine), #e8d5a3); }
.wine-card-image .placeholder-image.dessert { background: linear-gradient(135deg, var(--dessert-wine), #a67844); }

.wine-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.wine-card-name {
    font-size: var(--font-body);
    font-weight: 600;
    color: var(--label-primary);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: -0.4px;
}

.wine-card-producer {
    font-size: var(--font-subhead);
    font-weight: 400;
    color: var(--wine-primary);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wine-card-meta {
    font-size: var(--font-footnote);
    color: var(--label-secondary);
}

.wine-type-tag {
    font-size: var(--font-caption2);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 3px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}

.wine-type-tag.red { background: rgba(114, 47, 55, 0.12); color: var(--red-wine); }
.wine-type-tag.white { background: rgba(200, 180, 100, 0.25); color: #7a6f2e; }
.wine-type-tag.rosé { background: rgba(232, 180, 184, 0.35); color: #9e5a60; }
.wine-type-tag.sparkling { background: rgba(245, 230, 200, 0.5); color: #8a7645; }
.wine-type-tag.dessert { background: rgba(196, 149, 106, 0.25); color: #8b6239; }


.wine-quantity {
    font-size: var(--font-footnote);
    color: var(--label-secondary);
}

/* Disclosure indicator */
.wine-card::before {
    content: '';
    position: absolute;
    right: var(--space-16);
    width: 8px;
    height: 13px;
    background-image: url("data:image/svg+xml,%3Csvg width='8' height='13' viewBox='0 0 8 13' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6.5 6.5L1 12' stroke='%23C7C7CC' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* ============================
   FAB (Floating Action Button)
   iOS style
   ============================ */

.fab {
    position: fixed;
    bottom: calc(70px + var(--space-16));
    right: var(--space-24);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--wine-primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(114, 47, 55, 0.4);
    transition: transform 0.2s ease;
    z-index: 90;
}

.fab svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.5;
}

.fab:active {
    transform: scale(0.94);
}

/* Wine Card Enriching Indicator */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.wine-enriching-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--font-caption2);
    color: var(--wine-secondary);
    font-weight: 500;
}

.enriching-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 1.5px solid var(--separator-opaque);
    border-top-color: var(--wine-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ============================
   Modal Sheets - iOS Style
   ============================ */

.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-top: env(safe-area-inset-top, 0px);
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-modal) var(--radius-modal) 0 0;
    width: 100%;
    max-width: 500px;
    max-height: calc(100vh - 20px - env(safe-area-inset-top, 0px));
    max-height: calc(100dvh - 20px - env(safe-area-inset-top, 0px));
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

.modal.active .modal-content {
    transform: translateY(0);
}

/* Modal handle indicator */
.modal-content::before {
    content: '';
    display: block;
    width: 36px;
    height: 5px;
    background: rgba(60, 60, 67, 0.3);
    border-radius: 2.5px;
    margin: 6px auto var(--space-8);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-8) var(--space-16) var(--space-12);
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 10;
}

.modal-header h2 {
    font-size: var(--font-headline);
    font-weight: 600;
    letter-spacing: -0.4px;
}

.close-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(60, 60, 67, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--label-secondary);
}

.close-btn svg {
    width: 14px;
    height: 14px;
    stroke-width: 2.5;
}

.close-btn:active {
    background: rgba(60, 60, 67, 0.2);
}

.modal-body {
    padding: var(--space-16);
}

/* ============================
   Settings Modal
   ============================ */

.settings-modal .modal-body {
    padding: 0 var(--space-16) var(--space-24);
}

.settings-section {
    margin-bottom: var(--space-32);
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section h3 {
    font-size: var(--font-footnote);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--label-secondary);
    margin-bottom: var(--space-8);
    padding: 0 var(--space-4);
}

.settings-description {
    font-size: var(--font-subhead);
    color: var(--label-secondary);
    line-height: 1.4;
    margin-bottom: var(--space-12);
    padding: 0 var(--space-4);
}

.settings-description a {
    color: var(--system-blue);
    text-decoration: none;
}

.api-key-status {
    margin-bottom: var(--space-12);
    padding: var(--space-12) var(--space-16);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: var(--font-subhead);
}

.status-connected {
    color: var(--system-green);
    font-weight: 500;
}

.status-disconnected {
    color: var(--label-tertiary);
}

.api-key-input-group {
    display: flex;
    gap: var(--space-8);
    margin-bottom: var(--space-12);
}

.api-key-input {
    flex: 1;
    height: 44px;
    padding: 0 var(--space-12);
    border: 1px solid var(--separator-opaque);
    border-radius: var(--radius-md);
    font-size: var(--font-body);
    font-family: ui-monospace, monospace;
    background: var(--bg-secondary);
}

.api-key-input:focus {
    outline: none;
    border-color: var(--wine-primary);
}

.save-key-btn {
    height: 44px;
    padding: 0 var(--space-20);
    border: none;
    border-radius: var(--radius-md);
    background: var(--wine-primary);
    color: white;
    font-size: var(--font-body);
    font-weight: 600;
    cursor: pointer;
}

.save-key-btn:active {
    opacity: 0.8;
}

/* Google Sign-In Button */
.google-sign-in-btn {
    width: 100%;
    height: 50px;
    border: 1px solid var(--separator-opaque);
    border-radius: var(--radius-md);
    background: white;
    color: var(--label-primary);
    font-size: var(--font-body);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-12);
    margin-bottom: var(--space-12);
    transition: background 0.2s;
}

.google-sign-in-btn:hover {
    background: var(--bg-tertiary);
}

.google-sign-in-btn:active {
    background: rgba(60, 60, 67, 0.1);
}

.clear-key-btn {
    width: 100%;
    height: 44px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    color: var(--label-secondary);
    font-size: var(--font-body);
    cursor: pointer;
}

.clear-key-btn:active {
    background: rgba(60, 60, 67, 0.12);
}

/* ============================
   Destination Tiles (Add Wine)
   ============================ */

.add-step.hidden {
    display: none;
}

.destination-tiles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: var(--space-8) 0 var(--space-16);
}

.destination-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 32px 16px;
    border: 2px solid var(--separator-opaque);
    border-radius: 16px;
    background: var(--bg-secondary);
    min-height: 160px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.destination-tile:active {
    transform: scale(0.97);
    border-color: var(--wine-primary);
    background: rgba(114, 47, 55, 0.06);
}

.destination-tile svg {
    width: 48px;
    height: 48px;
    color: var(--wine-primary);
}

.tile-label {
    font-size: var(--font-title3);
    font-weight: 600;
    color: var(--label-primary);
}

.tile-hint {
    font-size: var(--font-footnote);
    color: var(--label-secondary);
}

/* ============================
   Upload Section
   ============================ */

.upload-section {
    margin-bottom: var(--space-20);
}

.image-preview {
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: var(--radius-lg);
    border: 2px dashed var(--separator-opaque);
    overflow: hidden;
    position: relative;
    background: var(--bg-tertiary);
    cursor: pointer;
}

.image-preview:active {
    border-color: var(--wine-tertiary);
}

.image-preview.has-image {
    border-style: solid;
    border-color: transparent;
}

.upload-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-8);
    color: var(--label-tertiary);
}

.upload-placeholder svg {
    width: 44px;
    height: 44px;
    opacity: 0.5;
}

.upload-placeholder span {
    font-size: var(--font-subhead);
}

.image-preview.has-image .upload-placeholder {
    display: none;
}

#previewImg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
}

.image-preview.has-image #previewImg {
    display: block;
}

.upload-buttons {
    display: flex;
    gap: var(--space-12);
    margin-top: var(--space-12);
}

.upload-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-8);
    height: 44px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--bg-tertiary);
    color: var(--label-primary);
    font-size: var(--font-body);
    font-weight: 500;
    cursor: pointer;
}

.upload-btn svg {
    width: 20px;
    height: 20px;
}

.upload-btn:active {
    background: rgba(60, 60, 67, 0.12);
}

/* ============================
   Scanning Indicator
   ============================ */

.scanning-indicator {
    padding: var(--space-20);
    text-align: center;
    margin-bottom: var(--space-16);
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
}

.scanning-indicator.hidden {
    display: none;
}

.scanning-animation {
    width: 100%;
    height: 3px;
    background: rgba(60, 60, 67, 0.1);
    border-radius: 1.5px;
    overflow: hidden;
    margin-bottom: var(--space-12);
}

.scan-line {
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--wine-primary), transparent);
    animation: scan 1.5s ease-in-out infinite;
}

@keyframes scan {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

.scanning-indicator p {
    font-size: var(--font-subhead);
    color: var(--label-secondary);
}

/* ============================
   Wine Form - iOS Style
   ============================ */

.wine-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-20);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.form-group label {
    font-size: var(--font-footnote);
    font-weight: 500;
    color: var(--label-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding-left: var(--space-4);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    height: 44px;
    padding: 0 var(--space-12);
    border: 1px solid var(--separator-opaque);
    border-radius: var(--radius-md);
    font-size: var(--font-body);
    font-family: var(--font-system);
    color: var(--label-primary);
    background: var(--bg-secondary);
    -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--wine-primary);
}

.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%233C3C43' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.form-group textarea {
    height: auto;
    min-height: 88px;
    padding: var(--space-12);
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
}

/* Characteristics Section */
.characteristics-section {
    background: var(--bg-tertiary);
    padding: var(--space-16);
    border-radius: var(--radius-lg);
    margin: var(--space-4) 0;
}

.characteristics-section h3 {
    font-size: var(--font-footnote);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--label-secondary);
    margin-bottom: var(--space-16);
}

.characteristic-slider {
    margin-bottom: var(--space-20);
}

.characteristic-slider:last-child {
    margin-bottom: 0;
}

.characteristic-slider label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-subhead);
    font-weight: 500;
    color: var(--label-primary);
    margin-bottom: var(--space-8);
    text-transform: none;
    letter-spacing: 0;
    padding: 0;
}

.char-value {
    background: var(--wine-primary);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-caption1);
    font-weight: 600;
}

.characteristic-slider input[type="range"] {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: rgba(60, 60, 67, 0.12);
    -webkit-appearance: none;
    margin-bottom: var(--space-4);
}

.characteristic-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-caption2);
    color: var(--label-tertiary);
}

/* Quantity Control */
.quantity-control {
    display: flex;
    align-items: center;
    height: 44px;
    border: 1px solid var(--separator-opaque);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.quantity-control input {
    width: 50px;
    text-align: center;
    border: none !important;
    height: 42px !important;
    padding: 0 !important;
    font-weight: 600;
    -moz-appearance: textfield;
}

.quantity-control input::-webkit-outer-spin-button,
.quantity-control input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.qty-btn {
    width: 44px;
    height: 42px;
    border: none;
    background: var(--bg-tertiary);
    color: var(--wine-primary);
    font-size: 1.5rem;
    font-weight: 400;
    cursor: pointer;
}

.qty-btn:active {
    background: rgba(60, 60, 67, 0.12);
}

/* Submit Button - iOS style */
.submit-btn {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--wine-primary);
    color: white;
    font-size: var(--font-body);
    font-weight: 600;
    cursor: pointer;
    margin-top: var(--space-8);
}

.submit-btn:active {
    opacity: 0.8;
}

/* ============================
   Detail Modal
   ============================ */

/* Detail Modal — Proposal 1: Vineyard Watercolor */
.detail-modal {
    display: flex;
    flex-direction: column;
    font-family: var(--font-system);
}

.detail-modal::before {
    display: none;
}

.detail-close {
    position: absolute;
    top: var(--space-12);
    right: var(--space-12);
    z-index: 20;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
}

.detail-share-btn {
    position: absolute;
    top: var(--space-12);
    right: calc(var(--space-12) + 48px);
    z-index: 20;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}
.detail-share-btn svg {
    width: 18px;
    height: 18px;
    stroke: #722F37;
}

/* Hero Section */
.detail-hero {
    position: relative;
    height: 340px;
    min-height: 340px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: var(--radius-modal) var(--radius-modal) 0 0;
}

.detail-hero-content {
    width: 100%;
    height: 100%;
}

.detail-hero-content img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 16px;
    background: transparent;
}

/* Vineyard fallback landscape */
.detail-hero-content .vineyard-landscape {
    width: 100%;
    height: 100%;
}

/* Generic bottle layered hero (regular accounts) */
.detail-hero-layered {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10%;
    background: transparent;
    overflow: hidden;
}
.detail-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    transform: scale(2.2);
    opacity: 0.25;
    -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
    padding: 0 !important;
    background: none !important;
}
.detail-hero-generic {
    position: relative;
    z-index: 1;
    height: 100%;
    max-width: 55%;
    object-fit: contain;
    padding: 4px 0 0 0 !important;
    background: none !important;
}

/* Layered wine card (user photo bg + generic bottle) */
.wine-card-layered {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    overflow: hidden;
    border-radius: var(--radius-sm);
}
.wine-card-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    transform: scale(2.2);
    opacity: 0.25;
    padding: 0 !important;
    background: none !important;
}
.wine-card-layered .generic-bottle {
    position: relative;
    z-index: 1;
    max-height: 96%;
    max-width: 85%;
    object-fit: contain;
    padding: 0 !important;
    background: none !important;
}

/* Generic bottle in list card (without user photo) */
.wine-card-image .generic-bottle {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

/* Cork Score styling */
.cork-score .detail-expert-source {
    font-weight: 600;
    color: var(--wine-primary);
}

/* Admin PRO panel */
.admin-pro-controls {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.admin-pro-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e0d8d0;
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--font-body);
}
.admin-pro-btn {
    padding: 8px 16px;
    background: var(--wine-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.admin-pro-result {
    margin-top: 8px;
    font-size: 13px;
    color: var(--label-secondary);
}

.detail-hero-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 24px 20px;
    background: linear-gradient(to top, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.7) 60%, rgba(255,255,255,0) 100%);
    z-index: 15;
}

.detail-type-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(180,40,40,0.12);
    color: #9b2226;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border-radius: 20px;
    margin-bottom: 8px;
}

.detail-wine-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: #2c1810;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.detail-wine-producer {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 15px;
    color: #7a5c3e;
    margin-top: 4px;
    letter-spacing: -0.01em;
}

.detail-wine-region {
    font-size: 13px;
    color: #9a8a78;
    margin-top: 2px;
}

/* Content Area */
.detail-content {
    padding: 20px 24px 24px;
}

/* Facts Row */
.detail-facts-row {
    display: flex;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid #f0ece7;
}

.detail-fact {
    text-align: center;
    flex: 1;
}

.detail-fact + .detail-fact {
    border-left: 1px solid #f0ece7;
}

.detail-fact-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #b5a898;
    margin-bottom: 4px;
}

.detail-fact-value {
    font-size: 16px;
    font-weight: 600;
    color: #2c1810;
}

/* Drink Window */
/* Drinking Window — Dot Timeline */
.detail-drink-window-card {
    padding: 16px 0;
    border-bottom: 1px solid #f0ece7;
}

.dw-card-label {
    font-family: 'Outfit', sans-serif;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #b5a898;
    margin-bottom: 12px;
}

.dw-timeline-container {
    position: relative;
}

.dw-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.dw-status {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 12px;
}
.dw-status.dw-too-young   { color: #8A8278; background: rgba(138,130,120, 0.08); }
.dw-status.dw-opening     { color: #8B7444; background: rgba(201,169,110, 0.1); }
.dw-status.dw-ready { color: #8B7444; background: rgba(201,169,110, 0.12); }
.dw-status.dw-peak        { color: #722F37; background: rgba(114,47,55, 0.08); }
.dw-status.dw-past-peak   { color: #9B4049; background: rgba(155,64,73, 0.08); }
.dw-status.dw-drink-soon  { color: #9B4049; background: rgba(155,64,73, 0.1); }
.dw-status.dw-decline     { color: #8A8278; background: rgba(138,130,120, 0.08); }

.dw-hint {
    font-family: ui-monospace, monospace;
    font-size: 11px;
    color: rgba(92,86,78, 0.5);
}

/* Timeline track */
.dw-track {
    position: relative;
    height: 38px;
    margin: 0 6px 22px;
}
.dw-track::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(201,169,110, 0.15);
    transform: translateY(-50%);
}

/* Best range band */
.dw-best {
    position: absolute;
    top: 50%;
    height: 7px;
    border-radius: 3.5px;
    background: rgba(201,169,110, 0.1);
    transform: translateY(-50%);
}

/* Peak range band */
.dw-peak-band {
    position: absolute;
    top: 50%;
    height: 11px;
    border-radius: 5.5px;
    background: linear-gradient(90deg, rgba(201,169,110, 0.2), rgba(201,169,110, 0.35), rgba(201,169,110, 0.2));
    transform: translateY(-50%);
}

/* Milestone dots */
.dw-dot {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
}
.dw-dot::before {
    content: '';
    display: block;
    border-radius: 50%;
}
.dw-dot.minor::before {
    width: 5px;
    height: 5px;
    background: rgba(138,130,120, 0.3);
}
.dw-dot.pk::before {
    width: 7px;
    height: 7px;
    background: #c9a96e;
    box-shadow: 0 0 8px rgba(201,169,110, 0.15);
}
.dw-dot-year {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    font-family: ui-monospace, monospace;
    font-size: 9px;
    color: rgba(92,86,78, 0.4);
    white-space: nowrap;
}
.dw-dot.pk .dw-dot-year {
    color: #8B7444;
    opacity: 0.6;
}

/* NOW diamond marker */
.dw-now {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
}
.dw-diamond {
    width: 8px;
    height: 8px;
    background: #722F37;
    border: 1.5px solid #9B4049;
    transform: rotate(45deg);
    box-shadow: 0 0 10px rgba(114,47,55, 0.2);
}
.dw-stem {
    width: 1px;
    height: 18px;
    background: linear-gradient(to bottom, #9B4049, transparent);
    margin-top: 2px;
}

/* Phase labels removed — years shown under dots */

.dw-no-data {
    font-size: 13px;
    color: #b5a898;
}

/* Store section */
.detail-store-section {
    padding: 14px 0;
    border-bottom: 1px solid #f0ece7;
}
.detail-store-display {
    display: flex;
    align-items: center;
    gap: var(--space-8);
}
.detail-store-display .store-icon {
    display: flex;
    align-items: center;
}
.detail-store-name {
    font-size: 14px;
    color: #2c1810;
    font-weight: 500;
    flex: 1;
}
.detail-store-edit {
    background: none;
    border: none;
    font-size: 16px;
    color: #b5a898;
    cursor: pointer;
    padding: 4px 8px;
}

/* Store popup modal */
.store-modal {
    text-align: center;
    padding: 24px 20px;
}
.store-modal-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #2c1810;
    margin-bottom: 16px;
}
.store-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-bottom: 12px;
    padding-bottom: 2px;
}
.store-chips::-webkit-scrollbar {
    display: none;
}
.store-chip {
    padding: 8px 16px;
    border-radius: 100px;
    border: 1px solid #e8e0d8;
    background: #faf8f5;
    font-size: 14px;
    font-weight: 500;
    color: #5c564e;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}
.store-chip:active {
    background: rgba(114,47,55, 0.08);
    border-color: #722F37;
    color: #722F37;
}
.store-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.store-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #e8e0d8;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: #faf8f5;
    outline: none;
}
.store-input:focus {
    border-color: #722F37;
}
.store-save-btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    background: #722F37;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.store-discard-btn {
    display: block;
    width: 100%;
    background: none;
    border: 1px solid #e8e0d8;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: #8A8278;
    cursor: pointer;
    padding: 12px 16px;
    margin-top: 4px;
}

/* Expert Ratings */
.detail-expert-section {
    padding: 16px 0;
    border-bottom: 1px solid #f0ece7;
}

.detail-expert-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #b5a898;
    margin-bottom: 10px;
}

.detail-expert-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}

.detail-expert-source {
    font-size: 13px;
    color: #6b5a4e;
}

.detail-expert-score {
    font-size: 14px;
    font-weight: 600;
    color: var(--wine-primary);
}

/* Profile Bars */
.detail-profile-section {
    padding: 16px 0;
    border-bottom: 1px solid #f0ece7;
}

.detail-profile-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #b5a898;
    margin-bottom: 14px;
}

.detail-profile-bar {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.detail-profile-bar:last-child {
    margin-bottom: 0;
}

.detail-bar-label {
    width: 70px;
    font-size: 13px;
    color: #6b5a4e;
}

.detail-bar-track {
    flex: 1;
    height: 6px;
    background: #f0ece7;
    border-radius: 3px;
    overflow: hidden;
}

.detail-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

.detail-bar-fill.boldness { background: linear-gradient(90deg, #c45a3c, #9b2226); }
.detail-bar-fill.tannins { background: linear-gradient(90deg, #c45a3c, #9b2226); }
.detail-bar-fill.acidity { background: linear-gradient(90deg, #dbb978, #c49a3c); }

/* Notes */
.detail-notes-section {
    padding: 16px 0;
    border-bottom: 1px solid #f0ece7;
}

.detail-notes-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #b5a898;
    margin-bottom: 8px;
}

.detail-notes-text {
    font-size: 14px;
    line-height: 1.6;
    color: #5a4a3e;
}

/* Enrichment Log (admin only) */
.detail-enrichment-section {
    padding: 12px 0;
    border-bottom: 1px solid #f0ece7;
}

.detail-enrichment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 4px 0;
}

.detail-enrichment-header .detail-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #b5a898;
}

.enrichment-toggle-icon {
    font-size: 8px;
    color: #b5a898;
}

.enrichment-log-content {
    padding-top: 4px;
}

.enrichment-log-time {
    font-size: 11px;
    color: #b5a898;
    margin-bottom: 6px;
}

.enrichment-log-section {
    padding: 6px 0;
    border-bottom: 1px solid #f5f0eb;
}

.enrichment-log-section:last-child {
    border-bottom: none;
}

.enrichment-log-section-header {
    font-size: 12px;
    font-weight: 600;
    color: #5a4a3e;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 2px;
}

.enrichment-log-dur {
    font-family: 'Space Grotesk', monospace;
    font-size: 11px;
    font-weight: 400;
    color: #b5a898;
}

.enrichment-log-detail {
    font-size: 11px;
    color: #8a7a6e;
    font-family: 'Space Grotesk', monospace;
    line-height: 1.5;
    padding-left: 0;
}

.enrichment-log-warn {
    color: #c4956a;
}

/* Cellar Count */
.detail-cellar-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #b5a898;
    text-align: center;
    margin: 20px 0 8px;
}

.detail-cellar-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 0 0 8px;
}

.detail-cellar-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid #ddd5cb;
    background: #fff;
    font-size: 20px;
    color: #6b5a4e;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.detail-cellar-btn:hover {
    background: #f5f0eb;
    border-color: #b5a898;
}

.detail-cellar-count {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 36px;
    font-weight: 700;
    color: #2c1810;
    text-align: center;
}

.detail-cellar-unit {
    font-size: 13px;
    color: #9a8a78;
    text-align: center;
    margin-top: -2px;
}

/* Action Buttons */
.detail-actions {
    display: flex;
    gap: 8px;
    padding: 16px 0 0;
}

.detail-action-btn {
    flex: 1;
    padding: 12px;
    border-radius: 14px;
    border: none;
    font-family: var(--font-system);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.detail-action-btn:hover {
    transform: translateY(-1px);
}

.detail-btn-report {
    background: #f5f0eb;
    color: #6b5a4e;
}

.detail-btn-edit {
    background: #2c1810;
    color: #fff;
}

.detail-btn-delete {
    background: #fef0ef;
    color: #c0392b;
}

/* ============================
   Delete Modal - iOS Alert Style
   ============================ */

.delete-modal {
    border-radius: 14px;
    margin: var(--space-16);
    padding: var(--space-20);
    text-align: center;
    max-width: 270px;
}

.delete-modal::before {
    display: none;
}

.delete-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto var(--space-16);
    color: var(--system-red);
}

.delete-icon svg {
    width: 100%;
    height: 100%;
}

.delete-modal h3 {
    font-size: var(--font-headline);
    font-weight: 600;
    margin-bottom: var(--space-8);
    letter-spacing: -0.4px;
}

.delete-modal p {
    font-size: var(--font-footnote);
    color: var(--label-secondary);
    margin-bottom: var(--space-20);
    line-height: 1.4;
}

.delete-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
}

.cancel-btn {
    height: 44px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    color: var(--system-blue);
    font-size: var(--font-body);
    font-weight: 600;
    cursor: pointer;
}

.cancel-btn:active {
    background: rgba(60, 60, 67, 0.12);
}

.confirm-delete-btn {
    height: 44px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--system-red);
    color: white;
    font-size: var(--font-body);
    font-weight: 600;
    cursor: pointer;
}

.confirm-delete-btn:active {
    opacity: 0.8;
}

/* ============================
   Toast Notification - iOS style
   ============================ */

.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    color: white;
    padding: var(--space-12) var(--space-20);
    border-radius: 100px;
    font-size: var(--font-subhead);
    font-weight: 500;
    box-shadow: var(--shadow-elevated);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    z-index: 1100;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ============================
   Utilities
   ============================ */

.hidden {
    display: none !important;
}

/* ============================
   Desktop Enhancements
   ============================ */

@media (min-width: 600px) {
    .modal-content {
        border-radius: var(--radius-modal);
        margin: auto;
        max-height: 85vh;
    }

    .delete-modal {
        margin: auto;
    }

    .wine-card:hover {
        background: rgba(60, 60, 67, 0.03);
    }

    .fab:hover {
        transform: scale(1.05);
    }
}

/* ============================
   Safe Area (iOS)
   ============================ */

@supports (padding: max(0px)) {
    .header {
        padding-top: env(safe-area-inset-top);
    }

    .filter-bar {
        top: calc(44px + env(safe-area-inset-top));
    }

    .fab {
        bottom: max(calc(70px + var(--space-16)), calc(env(safe-area-inset-bottom) + 70px + var(--space-16)));
    }

    .main-content {
        padding-bottom: max(140px, calc(env(safe-area-inset-bottom) + 140px));
    }
}

/* ============================
   Archive Modal Styles
   ============================ */

.archive-modal {
    max-height: 85vh;
}

.archive-wine-name {
    font-size: var(--font-title3);
    font-weight: 600;
    color: var(--wine-primary);
    text-align: center;
    margin-bottom: var(--space-24);
    padding: var(--space-12);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.archive-section {
    margin-bottom: var(--space-24);
}

.archive-section label {
    display: block;
    font-size: var(--font-subhead);
    font-weight: 500;
    color: var(--label-primary);
    margin-bottom: var(--space-12);
    text-align: center;
}

/* Rating Slider — drinking window stijl */
.detail-rating-card {
    padding: 16px 0;
    border-bottom: 1px solid #f0ece7;
}
.rating-card-label {
    font-family: 'Outfit', sans-serif;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #b5a898;
    margin-bottom: 12px;
}
.rating-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.rating-badge {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 12px;
    color: #8A8278;
    background: rgba(138,130,120, 0.08);
}
.rating-badge.good      { color: #8B7444; background: rgba(201,169,110, 0.12); }
.rating-badge.very-good { color: #722F37; background: rgba(114,47,55, 0.08); }
.rating-badge.excellent { color: #722F37; background: rgba(114,47,55, 0.12); }

.rating-value {
    font-family: ui-monospace, monospace;
    font-size: 14px;
    font-weight: 600;
    color: #c9a96e;
}
.rating-value .star-icon {
    color: #FFD700;
}

.rating-track-wrapper {
    position: relative;
    padding-bottom: 20px;
}
.rating-track {
    position: relative;
    height: 38px;
    margin: 0 6px;
}
.rating-track::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 1.5px;
    background: rgba(201,169,110, 0.15);
    transform: translateY(-50%);
}
.rating-fill {
    position: absolute;
    top: 50%;
    left: 0;
    height: 3px;
    border-radius: 1.5px;
    background: linear-gradient(90deg, rgba(201,169,110, 0.3), rgba(201,169,110, 0.5));
    transform: translateY(-50%);
    width: 0%;
    transition: width 0.05s;
}
.rating-thumb {
    position: absolute;
    top: 50%;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #722F37;
    border: 2px solid #9B4049;
    box-shadow: 0 0 10px rgba(114,47,55, 0.2);
    transform: translate(-50%, -50%);
    left: 0%;
    transition: left 0.05s;
    pointer-events: none;
    z-index: 1;
}

.rating-markers {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    pointer-events: none;
}
.rating-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
}
.rating-marker::before {
    content: '';
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(138,130,120, 0.3);
}
.rating-marker span {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    font-family: ui-monospace, monospace;
    font-size: 9px;
    color: rgba(92,86,78, 0.4);
}

.rating-range-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 38px;
    opacity: 0;
    cursor: pointer;
    margin: 0;
    -webkit-appearance: none;
    z-index: 2;
}

/* Rebuy Options */
.rebuy-options {
    display: flex;
    gap: var(--space-12);
    justify-content: center;
}

.rebuy-btn {
    flex: 1;
    max-width: 100px;
    padding: var(--space-16) var(--space-12);
    border: 2px solid var(--separator-opaque);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-8);
    transition: border-color 0.2s, background 0.2s;
}

.rebuy-btn .rebuy-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.rebuy-btn span:last-child {
    font-size: var(--font-caption1);
    font-weight: 500;
    color: var(--label-secondary);
}

.rebuy-btn:active {
    background: var(--bg-tertiary);
}

.rebuy-btn.active {
    border-color: var(--wine-primary);
    background: rgba(114, 47, 55, 0.08);
}

.rebuy-btn.active span:last-child {
    color: var(--wine-primary);
    font-weight: 600;
}

.archive-section textarea {
    width: 100%;
    min-height: 60px;
    padding: var(--space-12);
    border: 1px solid var(--separator-opaque);
    border-radius: var(--radius-md);
    font-size: var(--font-body);
    font-family: var(--font-system);
    resize: vertical;
}

.archive-section textarea:focus {
    outline: none;
    border-color: var(--wine-primary);
}

/* Archive Actions */
.archive-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-12);
    margin-top: var(--space-8);
}

.skip-archive-btn {
    height: 44px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    color: var(--label-secondary);
    font-size: var(--font-body);
    cursor: pointer;
}

.skip-archive-btn:active {
    background: rgba(60, 60, 67, 0.12);
}

.confirm-archive-btn {
    height: 50px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--wine-primary);
    color: white;
    font-size: var(--font-body);
    font-weight: 600;
    cursor: pointer;
}

.confirm-archive-btn:active {
    opacity: 0.8;
}

/* ============================
   Year Input Modal
   ============================ */

.year-modal {
    max-width: 340px;
    padding: 24px;
}

.year-picker-header {
    text-align: center;
    margin-bottom: 20px;
}

.year-picker-header h2 {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 600;
    color: var(--label-primary);
}

.year-picker-header p {
    margin: 0;
    font-size: 14px;
    color: var(--label-secondary);
}

.year-picker-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.year-pick-btn {
    height: 44px;
    border: 1px solid var(--separator-opaque);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--label-primary);
    font-size: 16px;
    font-weight: 500;
    font-family: var(--font-system);
    cursor: pointer;
    transition: all 0.15s ease;
}

.year-pick-btn:hover {
    background: var(--bg-tertiary);
}

.year-pick-btn:active {
    background: var(--wine-primary);
    color: white;
    border-color: var(--wine-primary);
}

.year-pick-nv,
.year-pick-other {
    grid-column: 1 / -1;
    background: var(--bg-tertiary);
    color: var(--label-secondary);
    font-size: 14px;
}

.year-pick-skip {
    display: block;
    width: 100%;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--label-tertiary);
    font-size: 14px;
    font-family: var(--font-system);
    cursor: pointer;
}

.year-pick-skip:hover {
    color: var(--label-secondary);
}

.year-custom-input {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
}

.year-custom-field {
    flex: 1;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--wine-primary);
    border-radius: 10px;
    font-size: 16px;
    font-family: var(--font-system);
    color: var(--label-primary);
    background: var(--bg-secondary);
    -webkit-appearance: none;
    outline: none;
}

.year-pick-confirm {
    background: var(--wine-primary) !important;
    color: white !important;
    border-color: var(--wine-primary) !important;
    font-weight: 600;
    padding: 0 20px;
}

/* ============================
   Image Picker Modal
   ============================ */
.image-picker-modal {
    max-width: 400px;
    padding: 24px;
}

.image-picker-header {
    text-align: center;
    margin-bottom: 20px;
}

.image-picker-header h2 {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 600;
    color: var(--label-primary);
}

.image-picker-header p {
    margin: 0;
    font-size: 14px;
    color: var(--label-secondary);
}

.image-picker-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.image-picker-item {
    aspect-ratio: 3 / 4;
    border: 2px solid var(--separator-opaque);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.15s ease;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-picker-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.image-picker-item:active {
    transform: scale(0.96);
    border-color: #c9a96e;
}

.image-picker-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px 0;
    color: var(--label-secondary);
    font-size: 14px;
}

.image-picker-loading .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--separator-opaque);
    border-top-color: var(--wine-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.image-picker-empty {
    text-align: center;
    padding: 40px 0;
    color: var(--label-tertiary);
    font-size: 14px;
}

.image-picker-skip {
    display: block;
    width: 100%;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--label-tertiary);
    font-size: 14px;
    font-family: var(--font-system);
    cursor: pointer;
}

.image-picker-skip:hover {
    color: var(--label-secondary);
}

/* Missing year badge on wine card */
.wine-year-missing-tag {
    font-size: 11px;
    font-weight: 500;
    color: var(--wine-primary);
    background: rgba(180, 40, 40, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 0.2px;
}

/* ============================
   Archive List Modal Styles
   ============================ */

.archive-list-modal {
    max-height: calc(85vh - env(safe-area-inset-top, 0px));
    max-height: calc(85dvh - env(safe-area-inset-top, 0px));
}

.archive-search-container {
    margin-bottom: 0;
}

.archive-stats {
    padding: var(--space-8) 0;
    font-size: var(--font-footnote);
    color: var(--label-secondary);
    border-bottom: 0.5px solid var(--separator);
    margin-bottom: var(--space-12);
}

/* Archive Empty State */
.archive-empty-state {
    text-align: center;
    padding: var(--space-44) var(--space-24);
}

.archive-empty-state.hidden {
    display: none;
}

.archive-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-16);
}

.archive-empty-state p {
    font-size: var(--font-body);
    font-weight: 600;
    color: var(--label-primary);
    margin-bottom: var(--space-8);
}

.archive-empty-hint {
    font-size: var(--font-footnote);
    color: var(--label-tertiary);
}

/* Archive List */
.archive-list {
    display: flex;
    flex-direction: column;
}

.archive-card {
    padding: var(--space-12) 0;
    display: flex;
    gap: var(--space-12);
    cursor: pointer;
    position: relative;
    align-items: center;
    border-bottom: 0.5px solid var(--separator);
}

.archive-card:last-child {
    border-bottom: none;
}

.archive-card:active {
    background: rgba(60, 60, 67, 0.06);
    margin: 0 calc(-1 * var(--space-16));
    padding: var(--space-12) var(--space-16);
}

.archive-card-image {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.archive-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #ffffff;
}

.archive-card-image .placeholder-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.6);
}

.archive-card-info {
    flex: 1;
    min-width: 0;
}

.archive-card-name {
    font-size: var(--font-subhead);
    font-weight: 600;
    color: var(--label-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.archive-card-producer {
    font-size: var(--font-footnote);
    color: var(--wine-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.archive-card-meta {
    display: flex;
    align-items: center;
    gap: var(--space-8);
}

.archive-card-stars {
    color: #FFD700;
    font-size: var(--font-caption1);
    letter-spacing: -1px;
}

.archive-card-rebuy {
    font-size: var(--font-caption2);
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(114, 47, 55, 0.1);
    color: var(--wine-primary);
}

.archive-card-rebuy.yes {
    background: rgba(52, 199, 89, 0.15);
    color: var(--system-green);
}

.archive-card-rebuy.maybe {
    background: rgba(255, 149, 0, 0.15);
    color: var(--system-orange);
}

.archive-card-rebuy.no {
    background: rgba(255, 59, 48, 0.1);
    color: var(--system-red);
}

/* Archive Detail Additions */
.archive-rating-display {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: var(--space-16);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-20);
}

.rating-stars {
    font-size: 14px;
    color: #FFD700;
    display: flex;
    align-items: center;
}

.rating-stars .empty {
    color: var(--separator-opaque);
}

.rebuy-badge {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
}

.archive-store-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--label-secondary);
}

.rebuy-badge.yes {
    background: rgba(52, 199, 89, 0.15);
    color: var(--system-green);
}

.rebuy-badge.maybe {
    background: rgba(255, 149, 0, 0.15);
    color: var(--system-orange);
}

.rebuy-badge.no {
    background: rgba(255, 59, 48, 0.15);
    color: var(--system-red);
}

.archive-review {
    background: rgba(114, 47, 55, 0.06);
    border-left: 3px solid var(--wine-primary);
    padding-left: 16px;
    padding-right: 16px;
    border-radius: var(--radius-sm);
    margin-top: var(--space-4);
}

.archive-date {
    display: block;
    margin-top: var(--space-8);
    font-size: var(--font-caption2);
    color: var(--label-tertiary);
}

/* Restore Button */
.restore-btn {
    background: rgba(52, 199, 89, 0.1);
    border: none;
    color: var(--system-green);
}

.restore-btn:active {
    background: rgba(52, 199, 89, 0.2);
}

/* ============================
   Login Screen
   ============================ */

.login-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-screen.hidden {
    display: none;
}

.login-content {
    text-align: center;
    padding: var(--space-32);
    max-width: 360px;
}

.login-stacked-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: var(--space-24);
}

.login-logo {
    width: auto;
    height: 80px;
}

.login-logo-title {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 700;
    font-size: 28px;
    letter-spacing: -0.5px;
    text-transform: uppercase;
    color: var(--label-primary);
}

.login-logo-tagline {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: 10px;
    letter-spacing: 3.6px;
    text-transform: uppercase;
    color: var(--label-secondary);
    opacity: 0.55;
}

.login-content h1 {
    font-size: var(--font-title2);
    font-weight: 700;
    color: var(--label-primary);
    margin-bottom: var(--space-12);
    letter-spacing: -0.4px;
}

.login-content p {
    font-size: var(--font-body);
    color: var(--label-secondary);
    line-height: 1.5;
    margin-bottom: var(--space-32);
}

.google-sign-in-btn.large {
    width: 100%;
    height: 56px;
    font-size: var(--font-body);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ============================
   Email Authentication Form
   ============================ */

.email-auth-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--space-12);
    margin-bottom: var(--space-12);
}

.email-auth-form .form-group {
    margin: 0;
}

.auth-input {
    width: 100%;
    height: 50px;
    padding: 0 var(--space-16);
    border: 1px solid var(--separator-opaque);
    border-radius: var(--radius-md);
    font-size: var(--font-body);
    font-family: var(--font-system);
    color: var(--label-primary);
    background: var(--bg-secondary);
    -webkit-appearance: none;
}

.auth-input:focus {
    outline: none;
    border-color: var(--wine-primary);
}

.auth-input::placeholder {
    color: var(--label-tertiary);
}

.email-sign-in-btn {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--wine-primary);
    color: white;
    font-size: var(--font-body);
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.email-sign-in-btn:active {
    opacity: 0.8;
}

.toggle-auth-btn {
    width: 100%;
    padding: var(--space-8);
    border: none;
    background: transparent;
    color: var(--label-secondary);
    font-size: var(--font-subhead);
    cursor: pointer;
}

.toggle-auth-btn span {
    color: var(--wine-primary);
    font-weight: 600;
}

.forgot-password-btn {
    width: 100%;
    padding: var(--space-4);
    border: none;
    background: transparent;
    color: var(--label-tertiary);
    font-size: var(--font-footnote);
    cursor: pointer;
    margin-bottom: var(--space-8);
}

.forgot-password-btn:hover {
    color: var(--wine-primary);
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: var(--space-16) 0;
    width: 100%;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--separator-opaque);
}

.auth-divider span {
    padding: 0 var(--space-16);
    color: var(--label-tertiary);
    font-size: var(--font-footnote);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================
   Email Verification Screen
   ============================ */
.verify-content {
    text-align: center;
    padding: 48px 32px;
    max-width: 360px;
}

.verify-icon {
    width: 72px;
    height: 72px;
    background: rgba(114, 47, 55, 0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.verify-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--label-primary);
    margin-bottom: 12px;
}

.verify-text {
    font-size: 15px;
    color: var(--label-secondary);
    margin-bottom: 4px;
    line-height: 1.4;
}

.verify-email {
    font-size: 15px;
    font-weight: 600;
    color: var(--label-primary);
    margin-bottom: 12px;
    word-break: break-all;
}

.verify-hint {
    font-size: 13px;
    color: var(--label-tertiary);
    margin-bottom: 32px;
    line-height: 1.5;
}

.verify-btn-primary {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 12px;
    background: var(--wine-primary);
    color: white;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Space Grotesk', sans-serif;
    cursor: pointer;
    margin-bottom: 16px;
}

.verify-btn-primary:active {
    opacity: 0.8;
}

.verify-btn-link {
    display: block;
    width: 100%;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--wine-primary);
    font-size: 15px;
    font-weight: 600;
    font-family: 'Space Grotesk', sans-serif;
    cursor: pointer;
}

.verify-btn-signout {
    display: block;
    width: 100%;
    padding: 8px;
    border: none;
    background: transparent;
    color: var(--label-tertiary);
    font-size: 13px;
    font-family: 'Space Grotesk', sans-serif;
    cursor: pointer;
    margin-top: 8px;
}

/* ============================
   Swipe-to-Delete / Swipe-to-Archive
   iOS-style swipe gestures
   ============================ */

.swipe-container {
    position: relative;
    overflow: hidden;
    background: var(--bg-secondary);
}

/* Separator line moves to container (not card) so it doesn't swipe */
.swipe-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 94px;
    right: 0;
    height: 0.5px;
    background: var(--separator);
    z-index: 5;
}

.swipe-container:last-child::after {
    display: none;
}

/* Remove separator from cards when inside swipe container */
.swipe-container .wine-card::after,
.swipe-container .archive-card::after {
    display: none;
}

/* The swipeable content (the card itself) */
.swipe-content {
    position: relative;
    z-index: 2;
    background: var(--bg-secondary);
    will-change: transform;
    touch-action: pan-y;
}

.swipe-content.swipe-transitioning {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Action button behind the card */
.swipe-action {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--font-subhead);
    font-weight: 600;
    z-index: 1;
}

.swipe-action--archive {
    background: var(--wine-primary);
}

.swipe-action--delete {
    background: var(--system-red);
}

.swipe-action-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
}

.swipe-action-content svg {
    width: 22px;
    height: 22px;
}

.swipe-action-content span {
    font-size: var(--font-caption1);
}

/* Collapse animation when item is deleted/archived */
.swipe-collapsing {
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    opacity: 0;
}

/* Prevent text selection during swipe */
.swipe-container.swiping {
    user-select: none;
    -webkit-user-select: none;
}

/* Adjust wine card when inside swipe container - remove disclosure indicator */
.swipe-container .wine-card::before {
    display: none;
}

/* Archive card in swipe container */
.swipe-container .archive-card {
    padding: var(--space-12) var(--space-16);
    border-bottom: none;
}

.swipe-container .archive-card:active {
    margin: 0;
    padding: var(--space-12) var(--space-16);
}

/* ============================
   Sort Bar
   ============================ */

/* Old sort-bar styles removed - now using filter-bar */

/* ============================
   Drink Window Form
   ============================ */

.drink-window-row {
    display: flex;
    align-items: center;
    gap: var(--space-8);
}

.drink-window-row input {
    flex: 1;
    height: 44px;
    padding: 0 var(--space-12);
    border: 1px solid var(--separator-opaque);
    border-radius: var(--radius-md);
    font-size: var(--font-body);
    font-family: var(--font-system);
    color: var(--label-primary);
    background: var(--bg-secondary);
    -webkit-appearance: none;
    text-align: center;
}

.drink-window-row input:focus {
    outline: none;
    border-color: var(--wine-primary);
}

.drink-window-separator {
    color: var(--label-tertiary);
    font-size: var(--font-body);
}

/* ============================
   Drink Window Display (Wine Card)
   ============================ */

.wine-card-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: var(--space-4);
}

.wine-card-footer-right {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    white-space: nowrap;
}

.wine-quantity-badge {
    font-size: var(--font-caption2);
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(114, 47, 55, 0.12);
    color: var(--wine-primary);
}

.wine-price-tag {
    font-size: var(--font-caption2);
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(0, 122, 255, 0.12);
    color: var(--system-blue);
}

.wine-drink-status {
    font-size: var(--font-caption2);
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

.wine-drink-status.dw-peak        { background: rgba(114,47,55, 0.08); color: #722F37; }
.wine-drink-status.dw-ready { background: rgba(201,169,110, 0.12); color: #8B7444; }
.wine-drink-status.dw-drink-soon  { background: rgba(155,64,73, 0.1); color: #9B4049; }
.wine-drink-status.dw-past-peak   { background: rgba(155,64,73, 0.08); color: #9B4049; }
.wine-drink-status.dw-opening     { background: rgba(201,169,110, 0.1); color: #8B7444; }
.wine-drink-status.dw-too-young   { background: rgba(138,130,120, 0.08); color: #8A8278; }
.wine-drink-status.dw-decline     { background: rgba(138,130,120, 0.08); color: #8A8278; }

/* Drink Window styles moved to dot timeline section above (.dw-*) */

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .detail-actions {
        grid-template-columns: 1fr;
    }

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

}

/* ============================
   Upgrade Modal
   ============================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.upgrade-modal {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 32px 24px;
    max-width: 380px;
    width: 90%;
    margin: auto;
    text-align: center;
    position: relative;
}

.upgrade-modal h2 {
    font-family: 'Outfit', sans-serif;
    font-size: var(--font-title2);
    color: var(--wine-primary);
    margin-bottom: 8px;
}

.upgrade-modal p {
    color: var(--label-secondary);
    font-size: var(--font-subhead);
    margin-bottom: 12px;
}

.upgrade-options {
    display: flex;
    gap: 12px;
    margin: 20px 0;
}

.upgrade-option {
    flex: 1;
    background: var(--bg-tertiary);
    border-radius: 14px;
    padding: 20px 12px;
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.15s;
    cursor: pointer;
}

.upgrade-option:active {
    transform: scale(0.97);
}

.upgrade-option.featured {
    border-color: var(--wine-primary);
    background: linear-gradient(135deg, #f9f0f1, #fff);
}

.upgrade-option h3 {
    font-family: 'Outfit', sans-serif;
    font-size: var(--font-headline);
    color: var(--label-primary);
    margin-bottom: 6px;
}

.upgrade-price {
    font-family: 'Space Grotesk', sans-serif;
    font-size: var(--font-title3);
    font-weight: 700;
    color: var(--wine-primary);
    margin-bottom: 4px !important;
}

.upgrade-note {
    font-size: var(--font-caption1);
    color: var(--label-tertiary);
    margin-top: 8px;
    font-style: italic;
}

.upgrade-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--label-primary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.upgrade-close-btn:active {
    background: var(--separator-opaque);
}

.upgrade-restore {
    display: inline-block;
    margin-top: 12px;
    font-size: var(--font-caption1);
    color: var(--wine-primary);
    cursor: pointer;
    text-decoration: underline;
}

/* Photo Choice Modal (action sheet) */
.photo-choice-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary, #f2f2f7);
    border-radius: 16px 16px 0 0;
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10001;
}

.photo-choice-btn {
    padding: 16px;
    border: none;
    border-radius: 12px;
    background: var(--bg-primary, #fff);
    color: var(--wine-primary, #722F37);
    font-size: 17px;
    font-weight: 500;
    cursor: pointer;
    font-family: 'Space Grotesk', sans-serif;
}

.photo-choice-btn.cancel {
    color: var(--label-secondary, #666);
    margin-top: 4px;
}

/* ============================
   Bottom Tab Bar
   ============================ */
.bottom-tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-top: 0.5px solid var(--separator);
    display: flex;
    justify-content: space-around;
    padding: 6px 0 8px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    z-index: 100;
}

.tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: none;
    border: none;
    color: var(--label-tertiary);
    font-size: 10px;
    font-family: 'Space Grotesk', sans-serif;
    cursor: pointer;
    padding: 4px 20px;
    -webkit-tap-highlight-color: transparent;
}

.tab-btn svg {
    width: 22px;
    height: 22px;
}

.tab-btn.active {
    color: var(--wine-primary);
}

.tab-btn.active svg {
    stroke: var(--wine-primary);
    fill: var(--wine-primary);
}

/* ============================
   Settings: Account Card
   ============================ */
.settings-account-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.settings-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--wine-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    font-family: 'Space Grotesk', sans-serif;
    flex-shrink: 0;
}

.settings-account-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.settings-account-name {
    font-size: 17px;
    font-weight: 600;
    color: var(--label-primary);
    font-family: 'Space Grotesk', sans-serif;
}

.settings-account-email {
    font-size: 13px;
    color: var(--label-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-sync-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--label-tertiary);
    flex-shrink: 0;
}

.settings-sync-dot.synced {
    background: var(--system-green);
}

/* ============================
   Settings: Subscription Info
   ============================ */
.subscription-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.subscription-info .settings-description {
    margin-bottom: 0;
}

.subscription-tier-badge {
    background: var(--wine-primary);
    color: white;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Space Grotesk', sans-serif;
}

.settings-upgrade-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: var(--wine-primary);
    color: white;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Space Grotesk', sans-serif;
    cursor: pointer;
}

/* ============================
   Settings: Links List
   ============================ */
.settings-list {
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    color: var(--label-primary);
    text-decoration: none;
    font-size: 16px;
    border-bottom: 0.5px solid var(--separator);
}

.settings-row:last-child {
    border-bottom: none;
}

.settings-row svg {
    color: var(--label-tertiary);
    flex-shrink: 0;
}

/* ============================
   Settings: Sign Out + Footer
   ============================ */
.settings-signout-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    background: var(--bg-secondary);
    color: #FF3B30;
    font-size: 16px;
    font-weight: 500;
    font-family: 'Space Grotesk', sans-serif;
    cursor: pointer;
}

.settings-delete-account-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--label-tertiary);
    font-size: 14px;
    font-weight: 400;
    font-family: 'Space Grotesk', sans-serif;
    cursor: pointer;
    margin-top: 8px;
}

.settings-footer {
    text-align: center;
    font-size: 12px;
    color: var(--label-tertiary);
    margin-top: 24px;
    padding-bottom: 16px;
}

/* ============================
   Add to Home Screen Banner
   ============================ */
.a2hs-banner {
    position: fixed;
    bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    left: 12px;
    right: 12px;
    z-index: 9998;
    animation: a2hsSlideUp 0.4s ease-out;
}

.a2hs-content {
    background: var(--wine-primary);
    color: white;
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.a2hs-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-family: 'Space Grotesk', sans-serif;
}

.a2hs-text strong {
    font-size: 15px;
}

.a2hs-text span {
    font-size: 13px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.a2hs-text em {
    font-style: normal;
    font-weight: 600;
}

.a2hs-share-icon {
    display: inline-block;
    vertical-align: middle;
    stroke: white;
}

.a2hs-close {
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    opacity: 0.7;
    padding: 4px 8px;
    flex-shrink: 0;
}

.a2hs-arrow {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid var(--wine-primary);
    margin: 0 auto;
}

@keyframes a2hsSlideUp {
    from { transform: translateY(100px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ============================
   Admin Tier Select
   ============================ */
.admin-tier-select {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--separator-opaque);
    background: var(--bg-secondary);
    font-size: var(--font-subhead);
    font-family: 'Space Grotesk', sans-serif;
    color: var(--label-primary);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%233C3C43' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    min-width: 120px;
}

/* ============================
   Import Wine Modal
   ============================ */
.import-modal {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 0;
    max-width: 420px;
    width: 92%;
    margin: auto;
    position: relative;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.import-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 12px;
    border-bottom: 1px solid var(--separator-opaque);
}

.import-modal-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: var(--font-title2);
    color: var(--wine-primary);
    margin: 0;
}

.import-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.import-icon {
    text-align: center;
    margin-bottom: 16px;
    color: var(--wine-primary);
    opacity: 0.6;
}

.import-description {
    text-align: center;
    color: var(--label-primary);
    font-size: var(--font-body);
    margin-bottom: 20px;
}

.import-file-label {
    display: block;
    text-align: center;
    background: var(--wine-primary);
    color: white;
    padding: 14px 24px;
    border-radius: 12px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: var(--font-body);
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.import-file-label:active {
    opacity: 0.8;
}

.import-hint {
    text-align: center;
    color: var(--label-tertiary);
    font-size: var(--font-caption1);
    margin-top: 12px;
}

.import-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--separator-opaque);
    border-top-color: var(--wine-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}

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

.import-status {
    text-align: center;
    color: var(--label-secondary);
    font-size: var(--font-subhead);
}

.import-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.import-preview-header span {
    font-size: var(--font-subhead);
    color: var(--label-secondary);
    font-weight: 500;
}

.import-select-all {
    font-size: var(--font-caption1);
    color: var(--label-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.import-preview-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--separator-opaque);
    border-radius: 12px;
    margin-bottom: 16px;
}

.import-wine-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--separator-opaque);
}

.import-wine-item:last-child {
    border-bottom: none;
}

.import-wine-item:active {
    background: var(--bg-tertiary);
}

.import-wine-check {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    accent-color: var(--wine-primary);
}

.import-wine-info {
    flex: 1;
    min-width: 0;
}

.import-wine-name {
    display: block;
    font-size: var(--font-subhead);
    font-weight: 500;
    color: var(--label-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.import-wine-detail {
    display: block;
    font-size: var(--font-caption1);
    color: var(--label-tertiary);
}

.import-limit-warning {
    background: #FFF3CD;
    color: #856404;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: var(--font-caption1);
    margin-bottom: 12px;
}

.import-destination {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: var(--font-subhead);
    color: var(--label-secondary);
}

.import-destination select {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--separator-opaque);
    background: var(--bg-primary);
    font-size: var(--font-subhead);
    font-family: 'Space Grotesk', sans-serif;
    color: var(--label-primary);
}

.import-confirm-btn {
    width: 100%;
    padding: 14px;
    background: var(--wine-primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: var(--font-body);
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.import-confirm-btn:active {
    opacity: 0.8;
}

.import-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--separator-opaque);
    border-radius: 4px;
    overflow: hidden;
    margin: 16px 0;
}

.import-progress-fill {
    height: 100%;
    background: var(--wine-primary);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

.import-progress-detail {
    text-align: center;
    font-size: var(--font-caption1);
    color: var(--label-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.import-done-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #34C759;
    color: white;
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 12px auto 16px;
}

.import-done-text {
    text-align: center;
    font-size: var(--font-title3);
    font-weight: 600;
    color: var(--label-primary);
    margin-bottom: 4px;
}

.import-done-hint {
    text-align: center;
    font-size: var(--font-caption1);
    color: var(--label-tertiary);
    margin-bottom: 20px;
}

.load-more-container {
    text-align: center;
    padding: 16px 0 32px;
}

.load-more-btn {
    padding: 10px 24px;
    border-radius: 10px;
    border: 1px solid var(--separator-opaque);
    background: var(--bg-secondary);
    color: var(--label-secondary);
    font-family: 'Space Grotesk', sans-serif;
    font-size: var(--font-subhead);
    cursor: pointer;
}

.load-more-btn:active {
    background: var(--bg-tertiary);
}

.settings-import-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    background: var(--bg-primary);
    border: 1px solid var(--separator-opaque);
    border-radius: 12px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: var(--font-body);
    color: var(--wine-primary);
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.settings-import-btn:active {
    background: var(--bg-tertiary);
}

.settings-import-btn svg {
    color: var(--wine-primary);
}

.settings-danger-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    background: var(--bg-primary);
    border: 1px solid #FF3B30;
    border-radius: 12px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: var(--font-body);
    color: #FF3B30;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.settings-danger-btn:active {
    background: #FFF0F0;
}

.settings-danger-btn svg {
    color: #FF3B30;
}
