/* ============================================
   ALTINBUFIYATA — Premium Design System v6.0
   Hero Cards + Categorized Market Board
   Mobile-First Design
   ============================================ */

/* --- CSS Variables --- */
:root {
    --bg-primary: #07070d;
    --bg-secondary: #0e0e18;
    --bg-card: #12121f;
    --bg-card-hover: #1a1a2e;
    --bg-glass: rgba(18, 18, 31, 0.7);
    --bg-surface: #1A1A24;
    --border: rgba(212, 168, 83, 0.12);
    --border-hover: rgba(212, 168, 83, 0.3);
    --border-bright: rgba(212, 168, 83, 0.4);

    --gold-primary: #d4a853;
    --gold-light: #f0d48a;
    --gold-dark: #a07830;
    --gold-glow: rgba(212, 168, 83, 0.15);
    --gold-gradient: linear-gradient(135deg, #d4a853, #f0d48a, #d4a853);
    --accent: #d4a853;
    --accent-glow: rgba(212, 168, 83, 0.15);

    --text-primary: #f0ece4;
    --text-secondary: #9a968e;
    --text-muted: #5c5952;

    --green: #34d399;
    --green-bg: rgba(52, 211, 153, 0.1);
    --red: #f87171;
    --red-bg: rgba(248, 113, 113, 0.1);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius: 16px;

    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-gold: 0 0 30px rgba(212, 168, 83, 0.08);
    --blur: blur(12px);

    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Outfit', sans-serif;
}

/* --- Light Theme (Warm Premium) --- */
html:not(.theme-dark) {
    --bg-primary: #FAF8F4;
    --bg-secondary: #F4F1EB;
    --bg-card: #FEFCF9;
    --bg-card-hover: #F7F4EE;
    --bg-glass: rgba(254, 252, 249, 0.88);
    --bg-surface: #F2EFE9;
    --border: rgba(160, 120, 48, 0.12);
    --border-hover: rgba(160, 120, 48, 0.25);
    --border-bright: rgba(160, 120, 48, 0.4);
    --gold-primary: #a07830;
    --gold-light: #c4982c;
    --gold-dark: #7a5a1e;
    --gold-glow: rgba(160, 120, 48, 0.1);
    --gold-gradient: linear-gradient(135deg, #a07830, #c4982c, #a07830);
    --accent: #a07830;
    --accent-glow: rgba(160, 120, 48, 0.1);
    --text-primary: #1C1710;
    --text-secondary: #5C5347;
    --text-muted: #9C9488;
    --green: #0d7a4f;
    --green-bg: rgba(13, 122, 79, 0.08);
    --red: #c42b2b;
    --red-bg: rgba(196, 43, 43, 0.08);
    --shadow: 0 4px 24px rgba(80, 60, 20, 0.06);
    --shadow-gold: 0 0 20px rgba(160, 120, 48, 0.05);
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0; padding: 0; box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
section, .status-bar, .two-col-grid { scroll-margin-top: 80px; }

/* Remove number input spinners */
input[type="number"]::-webkit-inner-spin-button, 
input[type="number"]::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}
input[type="number"] { -moz-appearance: textfield; }

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Ambient gold glow background */
.theme-dark body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background:
        radial-gradient(ellipse 600px 400px at 20% 10%, rgba(212, 168, 83, 0.04), transparent),
        radial-gradient(ellipse 500px 300px at 80% 60%, rgba(212, 168, 83, 0.03), transparent);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

a { color: var(--gold-primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--gold-light); }

h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 700; }

/* --- Header --- */
.header {
    position: sticky; top: 0; z-index: 1000;
    background: var(--bg-glass);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--border);
    height: 64px;
    display: flex; align-items: center;
}
.header-inner {
    display: flex; align-items: center;
    justify-content: space-between; width: 100%;
    gap: 12px;
}
.logo {
    display: flex; align-items: center; gap: 3px;
    font-size: 1.25rem; font-weight: 800;
    color: var(--text-primary); text-decoration: none;
    font-family: var(--font-heading);
    letter-spacing: 0;
    min-width: 0;
    white-space: nowrap;
}
.logo-mark {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    margin-right: 5px;
}
.logo:hover { color: var(--text-primary); }
.gold-text {
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.nav { display: flex; align-items: center; gap: 28px; }
.nav-link {
    color: var(--text-secondary);
    font-size: 0.88rem; font-weight: 500;
    position: relative; padding: 6px 0;
    text-decoration: none; transition: var(--transition);
}
.nav-link::after {
    content: ''; position: absolute;
    bottom: -2px; left: 0;
    width: 0; height: 2px;
    background: var(--gold-primary);
    transition: var(--transition);
}
.nav-link:hover, .nav-link.active { color: var(--text-primary); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

.header-actions {
    display: flex; align-items: center; gap: 8px;
}
.theme-toggle-btn {
    background: transparent; border: none;
    color: var(--text-secondary);
    width: 38px; height: 38px; border-radius: 50%;
    cursor: pointer; display: flex;
    align-items: center; justify-content: center;
    font-size: 1.15rem; transition: var(--transition);
}
.theme-toggle-btn:hover {
    color: var(--gold-primary);
    background: rgba(212, 168, 83, 0.08);
}
.mobile-menu-btn {
    display: none; background: transparent;
    border: none; color: var(--text-primary);
    width: 38px; height: 38px; cursor: pointer;
    align-items: center; justify-content: center;
    font-size: 1.4rem;
    border-radius: 50%;
    transition: var(--transition);
}
.mobile-menu-btn:hover,
.mobile-menu-btn:focus-visible {
    color: var(--gold-primary);
    background: rgba(212, 168, 83, 0.08);
    outline: none;
}

/* Mobile nav overlay */
.mobile-nav-overlay {
    display: none; position: fixed;
    top: 64px; left: 0; right: 0; bottom: 0;
    background: var(--bg-glass);
    backdrop-filter: var(--blur);
    z-index: 999; padding: 32px 24px;
    flex-direction: column; gap: 24px;
}
.mobile-nav-overlay.active { display: flex; }
.mobile-nav-overlay .nav-link {
    font-size: 1.1rem; font-weight: 600;
    padding: 14px 0; border-bottom: 1px solid var(--border);
}
body.is-mobile-nav-open {
    overflow: hidden;
    overscroll-behavior: contain;
}

/* --- SEO Intro --- */
.seo-intro {
    padding: 18px 0 2px;
    max-width: 760px;
}
.seo-intro h1 {
    margin: 0 0 5px;
    font-size: 1.24rem;
    line-height: 1.22;
    color: var(--text-primary);
    letter-spacing: 0;
}
.seo-intro p {
    margin: 0;
    max-width: 690px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* --- Status Bar --- */
.status-bar {
    display: flex; justify-content: space-between;
    align-items: center; padding: 20px 0 16px;
    flex-wrap: wrap; gap: 12px 16px;
}
.market-status-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    flex: 1 1 auto;
    gap: 8px;
}
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(14, 165, 233, 0.1); color: #0ea5e9;
    font-size: 0.75rem; font-weight: 600;
    padding: 5px 14px; border-radius: 100px;
    border: 1px solid rgba(14, 165, 233, 0.2);
}
.market-status-badge.is-open {
    background: var(--green-bg);
    border-color: rgba(52, 211, 153, 0.2);
    color: var(--green);
}
.market-status-badge.is-closed {
    background: var(--red-bg);
    border-color: rgba(248, 113, 113, 0.18);
    color: var(--red);
}
.market-status-badge.is-paused {
    background: rgba(212, 168, 83, 0.08);
    border-color: rgba(212, 168, 83, 0.2);
    color: var(--gold-primary);
}
.global-market-badge {
    background: var(--green-bg);
    border-color: rgba(52, 211, 153, 0.2);
    color: var(--green);
}
.market-status-badge.is-open .pulse-dot { background: var(--green); }
.market-status-badge.is-closed .pulse-dot { background: var(--red); }
.market-status-badge.is-paused .pulse-dot { background: var(--gold-primary); }
.global-market-badge .pulse-dot { background: var(--green); }
.pulse-dot {
    width: 7px; height: 7px; background: #0ea5e9;
    border-radius: 50%; animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.4); }
}
.last-update {
    color: var(--text-muted); font-size: 0.72rem;
    display: flex; align-items: center; gap: 10px;
    margin-left: auto;
}
#last-updated-time {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.auto-refresh-badge {
    background: rgba(212, 168, 83, 0.08);
    color: var(--gold-primary);
    padding: 3px 10px; border-radius: 100px;
    font-size: 0.68rem; font-weight: 600;
}

/* ===========================
   HERO CARDS — Horizontal Scroll
   =========================== */
.hero-scroll-wrapper {
    margin-bottom: 32px;
    overflow: visible;
}
.hero-cards-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    scrollbar-width: none; /* Firefox */
}
.hero-cards-track::-webkit-scrollbar { display: none; }

@media (min-width: 1140px) {
    .hero-cards-track {
        justify-content: center;
    }
}

.hero-card {
    flex: 0 0 260px;
    scroll-snap-align: start;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.22s ease, box-shadow 0.28s ease, transform 0.28s ease, background 0.22s ease;
    min-height: 150px;
}
.hero-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gold-gradient);
    opacity: 0;
    transition: var(--transition);
}
.hero-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(212, 168, 83, 0.1);
}
.hero-card:hover::before { opacity: 1; }
.hero-card.active {
    border-color: var(--gold-primary);
    box-shadow: 0 0 24px rgba(212, 168, 83, 0.12);
}
.hero-card.active::before { opacity: 1; }

.hero-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}
.hero-card-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-transform: uppercase;
}
.hero-card-change {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 0.75rem; font-weight: 700;
    padding: 3px 10px; border-radius: 100px;
}
.hero-card-change.up { background: var(--green-bg); color: var(--green); }
.hero-card-change.down { background: var(--red-bg); color: var(--red); }
.hero-card-change.neutral { color: var(--text-muted); }

.hero-card-price {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    margin-bottom: 10px;
    line-height: 1.1;
    overflow: hidden;
}
.hero-card-price span {
    display: inline-block;
    will-change: transform, opacity;
}
.hero-card-row {
    display: flex;
    gap: 16px;
}
.hero-card-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.hero-card-sub strong {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.88rem;
}

.skeleton-card {
    min-height: 150px;
}

/* ===========================
   CATEGORY TABS
   =========================== */
.category-tabs-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 4px;
}
.category-tabs-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    min-width: 0;
    flex: 1 1 auto;
}
.category-tabs-scroll::-webkit-scrollbar { display: none; }
.order-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex: 0 0 auto;
}

.cat-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    min-height: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.22s ease, background 0.22s ease, color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
    white-space: nowrap;
    flex-shrink: 0;
}
.cat-tab:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
    background: var(--bg-card-hover);
}
.cat-tab:focus-visible {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px var(--gold-glow);
}
.cat-tab.active {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    color: #0a0a0f;
    border-color: var(--gold-primary);
    box-shadow: 0 2px 12px rgba(212, 168, 83, 0.2);
}
.order-mode-btn,
.order-reset-btn {
    margin-left: 0;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
    flex: 0 0 auto;
}
.order-mode-btn {
    width: auto;
    min-width: 74px;
    padding: 0 14px;
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 800;
}
.order-reset-btn {
    margin-left: 0;
    width: 38px;
    font-size: 1rem;
}
.order-reset-btn:hover,
.order-reset-btn:focus-visible,
.order-mode-btn:hover,
.order-mode-btn:focus-visible,
.order-mode-btn.active {
    background: var(--bg-card-hover);
    border-color: var(--gold-primary);
    color: var(--gold-primary);
    outline: none;
}
.order-reset-btn:focus-visible,
.order-mode-btn:focus-visible {
    box-shadow: 0 0 0 3px var(--gold-glow);
}
.order-mode-btn.active {
    background: rgba(212, 168, 83, 0.12);
}
.order-reset-btn[hidden] {
    display: none;
}
.cat-tab-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
}

/* ===========================
   COMPACT MARKET TABLE
   =========================== */
.table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-x: auto;
    margin-bottom: 48px;
}
.compact-market-table { width: 100%; border-collapse: collapse; }
.compact-market-table th {
    background: var(--bg-surface);
    padding: 12px 20px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-align: left;
    position: sticky; top: 0; z-index: 10;
    border-bottom: 1px solid var(--border);
}
.compact-market-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
}
.compact-market-table tr:last-child td { border-bottom: none; }

.market-row {
    cursor: pointer;
    transition: background var(--transition);
}
.market-row:hover td { background: rgba(212, 168, 83, 0.06); }
.asset-cell-inner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.row-drag-handle {
    width: 28px;
    height: 28px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: grab;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
    touch-action: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}
.row-drag-handle:hover,
.row-drag-handle:focus-visible {
    background: var(--bg-surface);
    border-color: var(--border);
    color: var(--gold-primary);
    outline: none;
}
.row-drag-handle:active {
    cursor: grabbing;
    transform: scale(0.96);
}
.compact-market-table tbody.is-reorder-mode .market-row {
    cursor: default;
}
.compact-market-table tbody.is-reorder-mode .row-drag-handle {
    display: inline-flex;
    background: var(--bg-surface);
    border-color: var(--border);
    color: var(--gold-primary);
}
.compact-market-table tbody.is-reordering .market-row:not(.is-row-dragging) td {
    transition: background 0.15s ease;
    opacity: 0.58;
}
.compact-market-table tbody.is-reordering .market-row.is-row-dragging td {
    background: linear-gradient(90deg, rgba(212, 168, 83, 0.26), rgba(212, 168, 83, 0.12));
    box-shadow: inset 0 1px 0 rgba(212, 168, 83, 0.45), inset 0 -1px 0 rgba(212, 168, 83, 0.45);
    color: var(--text-primary);
}
.compact-market-table tbody.is-reordering .market-row.is-row-dragging td:first-child {
    box-shadow: inset 5px 0 0 var(--gold-primary), inset 0 1px 0 rgba(212, 168, 83, 0.45), inset 0 -1px 0 rgba(212, 168, 83, 0.45);
}
.compact-market-table tbody.is-reordering .market-row.is-row-dragging .asset-name {
    color: var(--gold-light);
}
.compact-market-table tbody.is-reorder-mode .market-row.is-row-dragging .row-drag-handle {
    background: #111;
    border-color: var(--gold-light);
    color: var(--gold-light) !important;
    transform: scale(1.08);
    box-shadow: 0 0 0 4px rgba(212, 168, 83, 0.18), 0 8px 24px rgba(0, 0, 0, 0.28);
}
body.is-market-reordering {
    user-select: none;
    -webkit-user-select: none;
    overscroll-behavior: contain;
}
.market-row .asset-name {
    font-weight: 700; font-size: 0.9rem;
}
.market-row .asset-category-dot {
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    flex: 0 0 auto;
}
.dot-gold { background: var(--gold-primary); }
.dot-silver { background: #94a3b8; }
.dot-navy { background: #1d4ed8; }
.dot-currency { background: #60a5fa; }
.dot-commodity { background: #a78bfa; }
.dot-crypto { background: #f97316; }

.buy-cell { font-weight: 700; font-variant-numeric: tabular-nums; }
.sell-cell { font-weight: 700; font-variant-numeric: tabular-nums; }
.makas-cell { color: var(--text-muted); font-weight: 500; font-variant-numeric: tabular-nums; font-size: 0.82rem; }

.market-change {
    font-size: 0.78rem; font-weight: 600;
    padding: 3px 10px; border-radius: 100px;
    display: inline-flex; align-items: center; gap: 2px;
    white-space: nowrap;
}
.market-change.up { background: var(--green-bg); color: var(--green); }
.market-change.down { background: var(--red-bg); color: var(--red); }
.market-change.neutral { color: var(--text-muted); }

/* --- Bottom Drawer --- */
.drawer-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 999;
    opacity: 0; visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}
.drawer-overlay.active {
    opacity: 1; visibility: visible;
}
.bottom-drawer {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--bg-card);
    border-top-left-radius: 24px; border-top-right-radius: 24px;
    z-index: 1000; padding: 20px;
    height: 70vh;
    box-shadow: 0 -4px 30px rgba(0,0,0,0.15);
    transform: translateY(100%);
    transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex; flex-direction: column;
}
.bottom-drawer.active {
    transform: translateY(0);
}
.drawer-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px;
}
.drawer-close {
    background: var(--bg-surface); border: 1px solid var(--border);
    font-size: 1.2rem; color: var(--text-primary); cursor: pointer;
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.drawer-close:hover { background: var(--bg-card-hover); }
.drawer-close:focus-visible {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px var(--gold-glow);
}
.drawer-body {
    flex-grow: 1; position: relative;
}
.drawer-chart-state {
    height: 100%;
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.btn-load-more {
    width: 100%; padding: 14px; margin-top: 10px;
    background: var(--bg-surface); border: none; border-radius: 8px;
    color: var(--text-primary); font-weight: 600;
    cursor: pointer; transition: all 0.2s; font-family: var(--font-body);
}
.btn-load-more:hover { background: var(--bg-card-hover); color: var(--gold-primary); }

.btn-refresh-news {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    outline: none;
}
.btn-refresh-news:hover {
    border-color: var(--gold-primary);
    color: var(--gold-primary);
    background: var(--bg-card-hover);
}
.btn-refresh-news svg {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-refresh-news:hover svg {
    transform: rotate(180deg);
}
.btn-refresh-news:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.btn-refresh-news.spinning svg {
    animation: btnSpin 1s linear infinite;
}
@keyframes btnSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- Calculator --- */
.calculator-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px;
}
.calc-row {
    display: flex; gap: 16px; margin-bottom: 16px; align-items: flex-end;
}
.calc-row:last-child { margin-bottom: 0; }
.calc-group { display: flex; flex-direction: column; flex-grow: 1; }
.calc-group label {
    font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 6px; font-weight: 500;
}
.calc-group input, .calc-group select {
    background: var(--bg-surface); border: 1px solid var(--border);
    color: var(--text-primary); padding: 12px; border-radius: 8px;
    font-size: 1rem; font-family: var(--font-body); width: 100%;
}
.calc-group input:focus, .calc-group select:focus {
    outline: none; border-color: var(--gold-primary);
}
.calc-icon { font-size: 1.5rem; color: var(--gold-primary); padding-bottom: 10px; }

/* --- Custom Select --- */
.custom-select {
    position: relative; font-family: var(--font-body); width: 100%;
}
.select-selected {
    background: var(--bg-surface); border: 1px solid var(--border);
    color: var(--text-primary); padding: 12px 16px; border-radius: 8px;
    cursor: pointer; user-select: none;
    display: flex; justify-content: space-between; align-items: center;
}
.select-selected:after { content: "▼"; font-size: 0.7rem; color: var(--gold-primary); }
.select-items {
    position: absolute; background-color: var(--bg-card); border: 1px solid var(--border);
    top: 100%; left: 0; right: 0; z-index: 99; margin-top: 4px;
    border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    max-height: 250px; overflow-y: auto;
}
.select-hide { display: none; }
.select-items div {
    padding: 12px 16px; cursor: pointer; color: var(--text-primary);
    border-bottom: 1px solid var(--border); transition: background 0.2s;
}
.select-items div:last-child { border-bottom: none; }
.select-items div:hover { background-color: var(--bg-card-hover); color: var(--gold-primary); }

/* --- Alarm & Toast --- */
.alarm-btn {
    background: none; border: none; cursor: pointer; color: var(--text-muted); 
    font-size: 1.1rem; padding: 4px; border-radius: 4px; transition: all 0.2s;
    opacity: 0; pointer-events: none;
}
.alarm-btn:hover { color: var(--gold-primary); background: var(--gold-glow); }
.alarm-btn.active { color: var(--gold-primary); opacity: 1; pointer-events: auto; }
.market-row:hover .alarm-btn { opacity: 1; pointer-events: auto; }

/* --- Alarm Compact Panel --- */
.alarm-modal-backdrop {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6); z-index: 1999;
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    opacity: 0; visibility: hidden; transition: opacity 0.28s ease, visibility 0.28s ease;
}
.alarm-modal-backdrop.active { opacity: 1; visibility: visible; }

.alarm-selection-panel {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.95);
    background: var(--bg-card); z-index: 2000;
    display: flex; flex-direction: column; width: 90%; max-width: 440px; max-height: 85vh;
    border-radius: 20px; box-shadow: 0 20px 60px rgba(0,0,0,0.4); border: 1px solid var(--border);
    opacity: 0; visibility: hidden; transition: opacity 0.28s ease, visibility 0.28s ease, transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.alarm-selection-panel.active { transform: translate(-50%, -50%) scale(1); opacity: 1; visibility: visible; }
.alarm-panel-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.alarm-panel-body {
    flex-grow: 1; overflow-y: auto; padding: 0 24px 24px; margin-top: 10px;
}
.alarm-asset-list { display: flex; flex-direction: column; gap: 4px; }
.alarm-asset-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 0; border-bottom: 1px solid rgba(212, 168, 83, 0.08);
    cursor: pointer; transition: all 0.2s;
}
.alarm-asset-item:hover { color: var(--gold-primary); }
.alarm-asset-item.selected {
    color: var(--gold-primary); font-weight: 700; border-bottom-color: var(--gold-primary);
}
.alarm-asset-item-btn {
    background: var(--bg-surface); border: 1px solid var(--border);
    color: var(--text-secondary); padding: 6px 14px; border-radius: 100px;
    font-size: 0.75rem; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.alarm-asset-item.selected .alarm-asset-item-btn {
    background: var(--gold-gradient); color: #fff; border-color: transparent;
}
.alarm-setup-section {
    margin-top: 24px; background: var(--bg-surface); padding: 20px;
    border-radius: var(--radius-md); display: none;
}
.alarm-setup-section.active { display: block; animation: slideUpFade 0.3s forwards; }

/* Alarm Tabs */
.alarm-tabs {
    display: flex; border-bottom: 1px solid var(--border);
    padding: 0 24px;
}
.alarm-tab {
    flex: 1; padding: 14px 0; background: none; border: none;
    color: var(--text-muted); font-size: 0.85rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s; position: relative;
    font-family: var(--font-body);
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.alarm-tab:hover { color: var(--text-primary); }
.alarm-tab.active { color: var(--gold-primary); }
.alarm-tab.active::after {
    content: ''; position: absolute; bottom: -1px; left: 10%; right: 10%;
    height: 2px; background: var(--gold-primary); border-radius: 2px;
}
.alarm-count-badge {
    background: var(--gold-primary); color: #111; font-size: 0.65rem;
    padding: 2px 7px; border-radius: 100px; font-weight: 800; min-width: 18px;
    text-align: center; line-height: 1.3;
}
.alarm-tab-content { display: none; }
.alarm-tab-content.active { display: block; }

/* Active Alarm Cards */
.active-alarm-card {
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 16px;
    margin-bottom: 10px; transition: all 0.2s;
}
.active-alarm-card:hover { border-color: var(--gold-primary); }
.active-alarm-top {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 8px;
}
.active-alarm-label {
    font-weight: 700; font-size: 0.95rem; color: var(--text-primary);
}
.active-alarm-actions {
    display: flex; gap: 6px;
}
.active-alarm-actions button {
    background: none; border: 1px solid var(--border); border-radius: 8px;
    padding: 6px 10px; cursor: pointer; font-size: 0.8rem; transition: all 0.2s;
    color: var(--text-muted); font-family: var(--font-body);
}
.active-alarm-actions button:hover { border-color: var(--gold-primary); color: var(--gold-primary); }
.active-alarm-actions .alarm-delete-btn:hover { border-color: var(--red); color: var(--red); }
.active-alarm-detail {
    display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}
.active-alarm-tag {
    font-size: 0.78rem; padding: 4px 10px; border-radius: 100px;
    font-weight: 600;
}
.active-alarm-tag.up { background: var(--green-bg); color: var(--green); }
.active-alarm-tag.down { background: var(--red-bg); color: var(--red); }
.active-alarm-price {
    font-size: 0.9rem; font-weight: 700; color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}
.active-alarm-current {
    font-size: 0.75rem; color: var(--text-muted);
}
.active-alarms-empty {
    text-align: center; padding: 40px 20px; color: var(--text-muted);
}
.active-alarms-empty-icon {
    font-size: 2.5rem; margin-bottom: 12px; opacity: 0.4;
}
.active-alarms-empty p {
    font-size: 0.88rem; line-height: 1.5;
}

.toast-container {
    position: fixed; top: 20px; right: 20px; z-index: 9999;
    display: flex; flex-direction: column; gap: 10px; pointer-events: none;
    max-width: min(360px, calc(100vw - 32px));
}
.toast {
    background: var(--bg-card); border-left: 4px solid var(--gold-primary);
    padding: 16px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    color: var(--text-primary); font-size: 0.9rem; pointer-events: auto;
    animation: slideInRight 0.36s cubic-bezier(0.22, 1, 0.36, 1) forwards, fadeOut 0.38s ease 4.8s forwards;
}
@keyframes slideInRight { from { transform: translate3d(24px, 0, 0); opacity: 0; } to { transform: translate3d(0, 0, 0); opacity: 1; } }
@keyframes fadeOut { to { transform: translate3d(10px, 0, 0); opacity: 0; visibility: hidden; } }

/* --- Live Updates & Animations --- */
@keyframes flashUp {
    0% { background-color: rgba(34, 197, 94, 0.22); }
    32% { background-color: rgba(34, 197, 94, 0.12); }
    72% { background-color: rgba(34, 197, 94, 0.04); }
    100% { background-color: transparent; }
}
@keyframes flashDown {
    0% { background-color: rgba(239, 68, 68, 0.22); }
    32% { background-color: rgba(239, 68, 68, 0.12); }
    72% { background-color: rgba(239, 68, 68, 0.04); }
    100% { background-color: transparent; }
}
.flash-up { animation: flashUp 3s ease-out; }
.flash-down { animation: flashDown 3s ease-out; }

@keyframes priceSlideUp {
    0% { transform: translateY(14px) scale(0.985); opacity: 0; color: var(--green); }
    44% { opacity: 1; color: var(--green); }
    100% { transform: translateY(0); opacity: 1; color: var(--text-primary); }
}
@keyframes priceSlideDown {
    0% { transform: translateY(-14px) scale(0.985); opacity: 0; color: var(--red); }
    44% { opacity: 1; color: var(--red); }
    100% { transform: translateY(0); opacity: 1; color: var(--text-primary); }
}
.price-slide-up { animation: priceSlideUp 0.82s cubic-bezier(0.22, 1, 0.36, 1); }
.price-slide-down { animation: priceSlideDown 0.82s cubic-bezier(0.22, 1, 0.36, 1); }

.live-badge {
    color: var(--green);
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.2);
}
.pulse-dot-green {
    width: 8px; height: 8px; border-radius: 50%;
    background-color: var(--green);
    display: inline-block;
    animation: pulseGreen 1.5s infinite;
}
@keyframes pulseGreen {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}


/* ===========================
   MEDIA QUERIES 
   =========================== */
.section-header {
    border-left: 3px solid var(--gold-primary);
    padding-left: 16px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.section-title {
    font-size: 1.2rem;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.3px;
}
.chart-asset-badge {
    background: rgba(212, 168, 83, 0.1);
    color: var(--gold-primary);
    padding: 4px 14px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid rgba(212, 168, 83, 0.2);
    transition: var(--transition);
}
.chart-asset-badge:hover {
    background: rgba(212, 168, 83, 0.2);
}

/* ===========================
   TWO COLUMN GRID (Chart + News)
   =========================== */
.two-col-grid {
    display: grid;
    grid-template-columns: 5fr 2fr;
    gap: 24px;
    margin-bottom: 56px;
    align-items: stretch;
}
.chart-section {
    display: flex;
    flex-direction: column;
}
.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    flex-grow: 1;
    min-height: 480px;
    position: relative;
}

/* --- News Card Grid --- */
.news-section {
    margin-bottom: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}
.news-disclaimer {
    max-width: 860px;
    margin: -8px 0 20px 16px;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.55;
}
.news-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.news-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), 
                box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), 
                border-color 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
}
.news-card:hover {
    transform: translateY(-6px) scale(1.025);
    box-shadow: 0 16px 36px rgba(0,0,0,0.1), 0 2px 10px rgba(212, 168, 83, 0.05);
    border-color: var(--gold-primary);
}
.news-card-thumb {
    width: 100%; height: 180px;
    object-fit: cover;
    background: var(--bg-surface);
    display: block;
}
.news-card-thumb-placeholder {
    width: 100%; height: 180px;
    display: flex; align-items: center; justify-content: center;
    background: var(--gold-gradient);
    color: #fff; font-size: 2.5rem; font-weight: 800;
}
.news-card-body {
    padding: 16px;
    display: flex; flex-direction: column;
    flex-grow: 1;
}
.news-card-body h4 {
    margin: 0 0 12px 0;
    font-size: 0.92rem; line-height: 1.4;
    color: var(--text-primary);
    font-weight: 700;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-card-meta {
    margin-top: auto;
    display: flex; justify-content: space-between;
    align-items: center; font-size: 0.72rem;
    color: var(--text-muted);
}
.news-card-source {
    display: flex; align-items: center; gap: 6px;
}
.news-card-source img {
    width: 14px; height: 14px; border-radius: 2px;
}


/* ===========================
   ANIMATIONS & UTILITIES
   =========================== */
@keyframes priceUp {
    0% { background-color: transparent; }
    30% { background-color: rgba(52, 211, 153, 0.08); }
    100% { background-color: transparent; }
}
@keyframes priceDown {
    0% { background-color: transparent; }
    30% { background-color: rgba(248, 113, 113, 0.08); }
    100% { background-color: transparent; }
}
.price-flash-up { animation: priceUp 1.5s ease; }
.price-flash-down { animation: priceDown 1.5s ease; }

.skeleton {
    background: linear-gradient(90deg, var(--bg-surface) 25%, var(--border) 50%, var(--bg-surface) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
}
@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.stagger-item {
    opacity: 0; animation: fadeInUp 0.5s ease forwards;
}
.stagger-item:nth-child(1) { animation-delay: 0.05s; }
.stagger-item:nth-child(2) { animation-delay: 0.1s; }
.stagger-item:nth-child(3) { animation-delay: 0.15s; }
.stagger-item:nth-child(4) { animation-delay: 0.2s; }

.spinner {
    width: 28px; height: 28px;
    border: 3px solid var(--border);
    border-top-color: var(--gold-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    margin-top: 40px;
    padding: 32px 0;
}
.footer-inner {
    display: flex; justify-content: space-between;
    align-items: center; flex-wrap: wrap; gap: 16px;
}
.footer-copy {
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    font-size: 0.75rem;
    gap: 6px;
    text-align: right;
}
.footer-contact {
    appearance: none;
    background: transparent;
    border: 0;
    color: var(--text-primary);
    cursor: pointer;
    font-family: var(--font);
    font-size: 0.75rem;
    font-weight: 700;
    overflow-wrap: anywhere;
    padding: 0;
    text-decoration: none;
    transition: var(--transition);
}
.footer-contact:hover {
    color: var(--gold-primary);
}

/* Contact modal */
.contact-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2099;
    background: rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}
.contact-modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}
.contact-modal {
    position: fixed;
    right: max(24px, calc((100vw - 1240px) / 2 + 24px));
    bottom: 24px;
    z-index: 2100;
    width: min(420px, calc(100vw - 32px));
    max-height: min(680px, calc(100vh - 48px));
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px) scale(0.98);
    transition: opacity 0.28s ease, visibility 0.28s ease, transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.contact-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
.contact-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    padding: 20px 22px 16px;
    border-bottom: 1px solid var(--border);
}
.contact-kicker {
    color: var(--gold-primary);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.2;
    margin-bottom: 4px;
    text-transform: uppercase;
}
.contact-modal h3 {
    color: var(--text-primary);
    font-size: 1.35rem;
    line-height: 1.15;
}
.contact-modal-body {
    overflow-y: auto;
    padding: 18px 22px 22px;
}
.contact-intro {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.55;
    margin-bottom: 14px;
}
.contact-mail-link {
    display: inline-flex;
    max-width: 100%;
    color: var(--gold-primary);
    font-size: 0.92rem;
    font-weight: 800;
    margin-bottom: 18px;
    overflow-wrap: anywhere;
}
.contact-form {
    display: grid;
    gap: 10px;
}
.contact-form label {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 2px;
}
.contact-form input,
.contact-form textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-surface);
    color: var(--text-primary);
    font: inherit;
    font-size: 0.92rem;
    line-height: 1.45;
    outline: none;
    padding: 12px 13px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.contact-form textarea {
    min-height: 108px;
    resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px var(--gold-glow);
}
.contact-submit {
    width: 100%;
    min-height: 44px;
    border: 0;
    border-radius: 10px;
    background: var(--gold-gradient);
    color: #111;
    cursor: pointer;
    font-family: var(--font);
    font-size: 0.92rem;
    font-weight: 800;
    margin-top: 6px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.contact-submit:hover {
    box-shadow: 0 10px 24px rgba(212, 168, 83, 0.18);
    transform: translateY(-1px);
}
.contact-status {
    min-height: 18px;
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.4;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(212, 168, 83, 0.25); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(212, 168, 83, 0.4); }

/* ===========================
   RESPONSIVE
   =========================== */

/* Tablet */
@media (max-width: 1024px) {
    .hero-card { flex: 0 0 220px; padding: 20px; }
    .hero-card-price { font-size: 1.4rem; }
    .two-col-grid { grid-template-columns: 1fr; }
    .chart-container { min-height: 400px; }
    .news-card-grid { grid-template-columns: repeat(2, 1fr); }
    .gold-types-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile */
@media (max-width: 768px) {
    .container { padding: 0 16px; }
    .header { height: 56px; }
    .header-inner { gap: 8px; }
    .logo { font-size: 1.16rem; }
    .logo-mark {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
        margin-right: 4px;
    }
    .header-actions { gap: 6px; flex: 0 0 auto; }
    .theme-toggle-btn,
    .mobile-menu-btn {
        width: 36px;
        height: 36px;
    }
    .nav { display: none; }
    .mobile-menu-btn { display: flex; }
    .mobile-nav-overlay { top: 56px; padding: 24px 20px; gap: 18px; }

    .seo-intro { padding: 14px 0 0; max-width: 100%; }
    .seo-intro h1 { font-size: 1.04rem; line-height: 1.25; margin-bottom: 4px; }
    .seo-intro p { font-size: 0.82rem; line-height: 1.45; }

    .status-bar { padding: 14px 0 10px; gap: 8px 10px; align-items: flex-start; }
    .market-status-badges { width: 100%; gap: 6px; }
    .last-update { width: 100%; justify-content: flex-end; gap: 8px; margin-left: 0; }
    .hero-badge { font-size: 0.7rem; padding: 4px 10px; }

    .hero-scroll-wrapper { margin-bottom: 20px; }
    .hero-cards-track {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        overflow-x: visible;
    }
    .hero-card {
        flex: none;
        min-width: 0;
        min-height: auto;
        padding: 12px 14px;
        border-radius: 16px;
    }
    .hero-card-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 0.62rem; letter-spacing: 0.5px; }
    .hero-card-price { font-size: 1.15rem; margin-bottom: 6px; }
    .hero-card-change { font-size: 0.62rem; padding: 2px 6px; }
    .hero-card-top { margin-bottom: 8px; gap: 8px; }
    .hero-card-sub { font-size: 0.68rem; }
    .hero-card-row { gap: 8px; }

    .category-tabs-bar {
        display: block;
        margin-bottom: 12px;
        padding-bottom: 0;
    }
    .category-tabs-scroll {
        gap: 6px;
        margin-bottom: 8px;
        padding-bottom: 4px;
    }
    .order-tools {
        justify-content: flex-start;
        gap: 6px;
        margin-left: 0;
    }
    .cat-tab { padding: 8px 14px; font-size: 0.8rem; }
    .cat-tab-icon { width: 18px; height: 18px; }
    .order-mode-btn { min-width: 68px; height: 36px; padding: 0 12px; font-size: 0.76rem; }
    .order-reset-btn { width: 36px; height: 36px; }

    .compact-market-table td { padding: 12px 14px; font-size: 0.85rem; }
    .compact-market-table th { padding: 10px 14px; font-size: 0.65rem; }
    .row-drag-handle { width: 36px; height: 36px; font-size: 1.12rem; }
    .hide-mobile { display: none; }

    .section-title { font-size: 1.05rem; }
    .chart-container { min-height: 320px; }
    .news-card-grid { grid-template-columns: 1fr; }
    .news-card-thumb, .news-card-thumb-placeholder { height: 140px; }

    .gold-types-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .gold-card { padding: 14px; }
    .gold-name { font-size: 0.85rem; }
    .gold-price { font-size: 0.95rem; }

    th { padding: 10px 14px; font-size: 0.7rem; }
    td { padding: 12px 14px; font-size: 0.82rem; }
    .btn-visit { padding: 8px 14px; font-size: 0.75rem; width: 100%; justify-content: center; }

    .footer-inner { flex-direction: column; text-align: center; }
    .footer-copy { align-items: center; text-align: center; }
    .contact-modal {
        left: 12px;
        right: 12px;
        bottom: 12px;
        width: auto;
        max-height: calc(100dvh - 72px);
        border-radius: 16px;
    }
    .alarm-selection-panel {
        width: calc(100% - 24px);
        max-height: calc(100dvh - 24px);
        border-radius: 18px;
    }
    .alarm-panel-header {
        padding: 18px 18px 14px;
    }
    .alarm-tabs {
        padding: 0 18px;
    }
    .alarm-panel-body {
        padding: 0 18px 18px;
    }
    .toast-container {
        top: 68px;
        right: 12px;
        left: 12px;
        max-width: none;
    }
    .toast { padding: 14px; font-size: 0.85rem; }
}

@media (display-mode: standalone) and (max-width: 768px) {
    .header {
        height: calc(56px + env(safe-area-inset-top));
        padding-top: env(safe-area-inset-top);
    }
    .mobile-nav-overlay {
        top: calc(56px + env(safe-area-inset-top));
    }
    .toast-container {
        top: calc(68px + env(safe-area-inset-top));
    }
    .bottom-drawer,
    .contact-modal,
    .alarm-selection-panel {
        padding-bottom: max(18px, env(safe-area-inset-bottom));
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .alarm-btn { display: none !important; } /* Mobilde tamamen gizle, uzun basış kullanılacak */
    .calc-row { flex-direction: column; align-items: stretch; gap: 12px; }
    .calc-icon { display: none; }
    .hero-cards-track { gap: 6px; }
    .hero-card-price { font-size: 1.05rem; }
    .hero-card-sub { font-size: 0.62rem; }
    .hero-card { padding: 10px 12px; }
    .market-status-badge { padding: 4px 9px; font-size: 0.66rem; }
    .last-update { font-size: 0.68rem; }
    .auto-refresh-badge { padding: 3px 8px; }
    .cat-tab { padding: 8px 12px; min-height: 38px; }
    .order-mode-btn { min-width: 64px; height: 36px; }
    .order-reset-btn { width: 36px; height: 36px; }
    .gold-types-grid { grid-template-columns: 1fr 1fr; }
    .chart-container { min-height: 280px; }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .pulse-dot,
    .pulse-dot-green,
    .spinner,
    .skeleton,
    .btn-refresh-news.spinning svg {
        animation: none !important;
    }
}
