/* ═══════════════════════════════════════════════════════════════
   HPPN.ING DESIGN SYSTEM
   "Retro concert poster / record sleeve" aesthetic
   Source of truth for all pages. Import this everywhere.
═══════════════════════════════════════════════════════════════ */

/* ─── TOKENS ─── */
:root {
    /* Core palette */
    --bg: rgba(238, 170, 137, 1);          /* warm terracotta page background */
    --paper: rgba(255, 255, 245, 1);        /* cream card/surface color */
    --ink: rgba(26, 46, 53, 1);             /* deep navy — text, borders, outlines */
    --accent: #FF7E49;                       /* orange — primary action */
    --accent-light: #F28B4C;                 /* lighter orange hover */
    --accent2: #58C878;                      /* green — secondary action */
    --teal: #3D6B7D;                         /* muted teal */
    --teal-light: #5A8A9C;

    /* Semantic aliases (backward compat) */
    --bg-warm: var(--bg);
    --surface-cream: var(--paper);
    --bg-cream: var(--paper);
    --ink-navy: var(--ink);
    --orange: var(--accent);
    --orange-light: var(--accent-light);
    --green: var(--accent2);
    --coral: var(--bg);
    --text-dark: var(--ink);
    --text-muted: #5a6b73;
    --border-dark: var(--ink);
    --teal-dark: var(--ink);

    /* Borders & Shapes */
    --border: 2.5px;                         /* thick navy outlines everywhere */
    --border-thick: 2.5px;
    --radius: 20px;                          /* large rounded corners */
    --radius-lg: 20px;
    --radius-pill: 50px;                     /* pill buttons */

    /* Shadows */
    --shadow: 2px 2px 0 var(--ink);          /* standard offset shadow */
    --shadow-hover: 3px 3px 0 var(--ink);    /* lift on hover */
    --card-shadow: 2px 2px 0 var(--ink);

    /* Safe-area insets — single source of truth for notch/home-indicator */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);

    /* Spacing */
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 40px;
    --space-xl: 56px;
    --pad-card: 12px;
    --gap-rail: 12px;
    --pad-page: 20px;
    --bottom-nav-h: 56px;                    /* visual height of bottom nav (excluding safe-area) */
    --bottom-nav-gap: 12px;                  /* space between the tray and the iOS home indicator */
    --bottom-nav-clearance: calc(var(--bottom-nav-h) + var(--safe-bottom) + var(--bottom-nav-gap));

    /* Typography */
    --font-serif: 'Libre Baskerville', serif;
    --font-sans: 'DM Sans', sans-serif;
    --font-display: 'Fraunces', serif;
}

/* ─── RESET ─── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

button, a {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

html, body {
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-x: none;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text-dark);
    min-height: -webkit-fill-available;
    min-height: 100dvh;
}

@media (min-width: 768px) {
    body {
        padding-bottom: 40px;
    }
}

/* ─── BACKGROUND PATTERN (noise texture) ─── */
.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    background: var(--bg);
}

.bg-pattern::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

/* ─── SITE HEADER ─── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
    padding: max(14px, env(safe-area-inset-top, 14px)) var(--pad-page) 14px;
    border-bottom: var(--border) solid var(--ink);
}

.site-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.site-header .header-logo {
    font-family: var(--font-serif);
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--ink);
    text-decoration: none;
    flex-shrink: 0;
    letter-spacing: -0.02em;
    margin-right: 4px;
    transition: transform 0.15s;
}

@media (max-width: 767px) {
    .site-header .header-logo {
        display: none;
    }
}

.site-header .header-logo:hover {
    transform: scale(1.04);
}

/* Mobile action buttons (scanner/shazam) */
.header-mobile-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .header-mobile-actions {
        display: none;
    }
}

.header-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--paper);
    border: var(--border) solid var(--ink);
    border-radius: var(--radius-pill);
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--ink);
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: transform 0.12s, box-shadow 0.12s;
}

.header-action-btn:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

.header-action-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* City dropdown */
.city-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--paper);
    border: var(--border) solid var(--ink);
    border-radius: var(--radius-pill);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform 0.12s, box-shadow 0.12s;
}

.city-dropdown-btn:hover {
    transform: translate(-1px, -1px);
    box-shadow: var(--shadow-hover);
}

.city-dropdown-btn svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.city-dropdown-btn .city-name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Search bar */
.header-search {
    flex: 1;
    min-width: 180px;
    max-width: 360px;
    position: relative;
}

.header-search input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    background: var(--paper);
    border: var(--border) solid var(--ink);
    border-radius: var(--radius-pill);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--ink);
    box-shadow: var(--shadow);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.header-search input:focus {
    border-color: var(--teal);
    box-shadow: 2px 2px 0 var(--teal);
}

.header-search input::placeholder {
    color: var(--text-muted);
}

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

@media (max-width: 767px) {
    .site-header-inner {
        display: grid;
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
        grid-template-areas:
            "location actions"
            "search search";
        gap: 8px;
        align-items: center;
    }

    .city-dropdown-btn {
        grid-area: location;
        width: 100%;
        min-width: 0;
        padding: 8px 10px;
        gap: 6px;
    }

    .city-dropdown-btn .city-name {
        max-width: none;
        min-width: 0;
    }

    .header-mobile-actions {
        grid-area: actions;
        width: 100%;
        min-width: 0;
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 6px;
    }

    .header-action-btn {
        width: 100%;
        min-width: 0;
        justify-content: center;
        white-space: nowrap;
        padding: 8px 8px;
        gap: 4px;
        font-size: 0.7rem;
    }

    .header-action-btn svg {
        width: 14px;
        height: 14px;
    }

    .header-search {
        grid-area: search;
        min-width: 0;
        max-width: none;
        width: 100%;
    }
}

/* Desktop nav pills */
.desktop-nav {
    display: none;
    align-items: center;
    gap: 3px;
    margin-left: auto;
}

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

.desktop-nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: var(--radius-pill);
    transition: all 0.15s;
    border: var(--border) solid var(--ink);
    background: var(--paper);
    box-shadow: var(--shadow);
}

.desktop-nav-item svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.desktop-nav-item:hover {
    transform: translate(-1px, -1px);
    box-shadow: var(--shadow-hover);
}

.desktop-nav-item.active {
    background: var(--accent);
    color: white;
    border-color: var(--ink);
}

.desktop-nav-item.active svg {
    stroke: white;
    stroke-width: 2.5;
}

/* ─── BOTTOM NAV (mobile) ─── */
/* Floating cream paper tray — matches card/paper aesthetic */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    padding: 0 16px calc(var(--safe-bottom) + var(--bottom-nav-gap));
}

@media (min-width: 768px) {
    .bottom-nav {
        display: none;
    }
}

.bottom-nav-inner {
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    gap: 4px;
    max-width: 500px;
    margin: 0 auto;
    min-height: var(--bottom-nav-h);
    padding: 4px 14px;
    background: var(--paper);
    border: var(--border) solid var(--ink);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.bottom-nav-item {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 3px;
    flex: 1;
    min-height: 0;
    padding: 4px 8px;
    margin: 0;
    text-decoration: none;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    transition: color 0.2s ease, background 0.15s ease, transform 0.12s ease;
    border-radius: 12px;
    position: relative;
}

.bottom-nav-item svg {
    width: 22px;
    height: 22px;
    display: block;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    flex-shrink: 0;
}

.bottom-nav-item span {
    display: block;
    font-size: 0.75rem;
    line-height: 1.1;
    margin: 0;
}

.bottom-nav-item.active {
    color: var(--accent);
}

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    background: rgba(255, 126, 73, 0.2);
    border-radius: var(--radius-pill);
    z-index: -1;
}

.bottom-nav-item.active svg {
    color: var(--accent);
}

.bottom-nav-item:not(.active) svg {
    color: var(--ink);
}

.bottom-nav-item:hover:not(.active) {
    color: var(--ink);
}

.bottom-nav-item:active {
    transform: scale(0.96);
}

/* ─── BOTTOM SPACER (mobile clearance for fixed nav) ─── */
.bottom-spacer {
    height: var(--bottom-nav-clearance);
    flex-shrink: 0;
    pointer-events: none;
}

@media (min-width: 768px) {
    .bottom-spacer {
        display: none;
    }
}

/* ─── CITY PICKER MODAL ─── */
.city-picker-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 2100;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.2s ease;
}

.city-picker-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.city-picker-modal {
    background: var(--paper);
    border: var(--border) solid var(--ink);
    border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: 0 -4px 0px var(--ink);
    width: 100%;
    max-width: 100%;
    max-height: 85vh;
    transform: translateY(100%);
    transition: transform 0.2s ease;
    padding-bottom: env(safe-area-inset-bottom);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .city-picker-overlay { align-items: center; }
    .city-picker-modal { max-width: 500px; border-radius: var(--radius); max-height: 70vh; }
}

.city-picker-overlay.open .city-picker-modal {
    transform: translateY(0);
}

.city-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--teal);
    color: var(--paper);
    border-bottom: var(--border) solid var(--ink);
    flex-shrink: 0;
}

.city-picker-title {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 700;
}

.city-picker-close {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    color: var(--paper);
}

.city-picker-close:hover {
    background: rgba(255,255,255,0.3);
}

.city-picker-close svg {
    width: 20px;
    height: 20px;
}

.city-picker-search-wrap {
    padding: 12px 20px;
    border-bottom: 2px solid var(--bg);
    flex-shrink: 0;
}

.city-picker-search-wrap input {
    width: 100%;
    padding: 12px 16px;
    background: white;
    border: var(--border) solid var(--ink);
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--text-dark);
    outline: none;
    box-sizing: border-box;
}

.city-picker-search-wrap input:focus {
    border-color: var(--teal);
}

.city-picker-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 20px 20px;
}

.city-picker-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: white;
    border: var(--border) solid var(--ink);
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.city-picker-option:hover,
.city-picker-option:active {
    border-color: var(--teal);
    background: var(--bg);
}

.city-picker-option.active {
    border-color: var(--teal);
    background: rgba(61,107,125,0.1);
}

.city-picker-option .metro-name {
    font-weight: 600;
    color: var(--text-dark);
}

.city-picker-option .metro-cities {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.city-picker-option .check-icon {
    color: var(--teal);
    display: none;
    flex-shrink: 0;
}

.city-picker-option.active .check-icon {
    display: block;
}

/* ─── PILL BUTTONS ─── */
.pill-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: var(--radius-pill);
    border: var(--border) solid var(--ink);
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform 0.12s, box-shadow 0.12s;
    text-decoration: none;
    white-space: nowrap;
}

.pill-btn:hover {
    transform: translate(-1px, -1px);
    box-shadow: var(--shadow-hover);
}

.pill-btn:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

.pill-btn svg {
    width: 14px;
    height: 14px;
}

/* Pill variants */
.pill-btn--primary {
    background: var(--accent);
    color: white;
}

.pill-btn--secondary {
    background: var(--accent2);
    color: white;
}

.pill-btn--outline {
    background: var(--paper);
    color: var(--ink);
}

.pill-btn--teal {
    background: var(--teal);
    color: var(--paper);
}

.pill-btn--spotify {
    background: #1DB954;
    color: white;
}

/* ─── SECTION HEADER ─── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 12px;
    gap: 12px;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.section-subtitle {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

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

/* ─── CARDS ─── */
.ds-card {
    background: var(--paper);
    border: var(--border) solid var(--ink);
    border-radius: var(--radius);
    padding: var(--space-md);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.ds-card--hover {
    transition: transform 0.15s, box-shadow 0.15s;
    cursor: pointer;
}

.ds-card--hover:hover {
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 var(--ink);
}

.ds-card--hover:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

/* ─── RANK BADGE ─── */
.rank-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 22px;
    height: 22px;
    background: var(--paper);
    border: var(--border) solid var(--ink);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-sans);
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--ink);
    z-index: 3;
    box-shadow: 1px 1px 0 var(--ink);
}

/* ─── TAG PILLS ─── */
.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-family: var(--font-sans);
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: var(--radius-pill);
    border: 1px solid var(--ink);
    background: rgba(61,107,125,0.12);
    color: var(--ink);
}

.tag-pill--accent {
    background: var(--accent);
    color: white;
    border-color: var(--ink);
    box-shadow: 1px 1px 0 var(--ink);
}

/* ─── INPUTS ─── */
.ds-input {
    width: 100%;
    padding: 12px 16px;
    background: white;
    border: var(--border) solid var(--ink);
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--text-dark);
    outline: none;
}

.ds-input:focus {
    border-color: var(--teal);
}

.ds-input::placeholder {
    color: var(--text-muted);
}

/* ─── CONTENT SHELL ─── */
.app-shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--pad-page) 0 60px;
}

@media (max-width: 767px) {
    .app-shell {
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* Narrower shell for detail / form pages */
.app-shell--narrow {
    max-width: 700px;
}

/* ─── TABS (folder style) ─── */
.ds-tabs {
    display: flex;
    align-items: flex-end;
    border-bottom: 3px solid var(--ink);
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.ds-tabs::-webkit-scrollbar {
    display: none;
}

.ds-tab {
    flex: 1;
    min-width: max-content;
    padding: 10px 24px;
    border: var(--border) solid var(--ink);
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    background: var(--bg);
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    position: relative;
    margin-right: -1px;
    text-align: center;
}

.ds-tab:hover:not(.active) {
    background: #EDE5D4;
    color: var(--text-dark);
}

.ds-tab.active {
    background: var(--paper);
    color: var(--ink);
    font-weight: 700;
    z-index: 2;
    margin-bottom: -3px;
    padding-bottom: 13px;
    border-color: var(--ink);
}

/* ─── PILL TABS (segmented control style) ─── */
.ds-pill-tabs {
    display: flex;
    background: var(--paper);
    border: var(--border) solid var(--ink);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.ds-pill-tab {
    flex: 1;
    padding: 14px 16px;
    background: transparent;
    border: none;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ds-pill-tab + .ds-pill-tab {
    border-left: 2px solid var(--ink);
}

.ds-pill-tab.active {
    background: var(--accent);
    color: white;
}

.ds-pill-tab:not(.active):hover {
    background: var(--bg);
}

.ds-pill-tab .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 11px;
    font-size: 0.72rem;
    font-weight: 700;
}

.ds-pill-tab.active .badge {
    background: rgba(255,255,255,0.25);
    color: white;
}

.ds-pill-tab:not(.active) .badge {
    background: rgba(0,0,0,0.1);
    color: var(--text-muted);
}

/* ─── FILTER PILLS (inline filter row) ─── */
.filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-pill {
    padding: 10px 16px;
    font-size: 0.85rem;
    font-family: var(--font-sans);
    font-weight: 600;
    border-radius: var(--radius-pill);
    border: var(--border) solid var(--ink);
    background: var(--paper);
    color: var(--text-dark);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow);
    text-decoration: none;
    transition: transform 0.12s, box-shadow 0.12s;
}

.filter-pill:hover {
    transform: translate(-1px, -1px);
    box-shadow: var(--shadow-hover);
}

.filter-pill:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

.filter-pill.active,
.filter-pill.primary {
    background: var(--accent);
    color: white;
}

.filter-pill svg {
    width: 16px;
    height: 16px;
}

/* ─── DASHED DIVIDER ─── */
.divider-dashed {
    height: 0;
    border: none;
    border-top: 2px dashed var(--teal-light);
    margin: 16px 0;
}

/* ─── EMPTY STATE ─── */
.ds-empty {
    text-align: center;
    padding: 60px 20px;
    background: var(--paper);
    border: var(--border) solid var(--ink);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.ds-empty-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
}

.ds-empty-title {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.ds-empty-text {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.5;
}

/* ─── MODALS (general) ─── */
.ds-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.ds-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.ds-modal {
    background: var(--paper);
    border: var(--border) solid var(--ink);
    border-radius: var(--radius) var(--radius) 0 0;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    transform: translateY(100%);
    transition: transform 0.2s ease;
    display: flex;
    flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom);
}

.ds-modal-overlay.open .ds-modal {
    transform: translateY(0);
}

@media (min-width: 768px) {
    .ds-modal-overlay { align-items: center; }
    .ds-modal { border-radius: var(--radius); max-height: 70vh; }
}

.ds-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--teal);
    color: white;
    border-bottom: var(--border) solid var(--ink);
    border-radius: calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0 0;
}

.ds-modal-title {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 700;
}

.ds-modal-close {
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
}

.ds-modal-close svg {
    width: 18px;
    height: 18px;
}

.ds-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    min-height: 150px;
}

/* ─── SKELETON LOADING ─── */
@keyframes ds-skeleton-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.7; }
}

.ds-skeleton {
    background: var(--bg);
    border-radius: 6px;
    animation: ds-skeleton-pulse 1.2s ease-in-out infinite;
}
