/* ==========================================================================
   Bitkub Bot — iOS 18 / 26 Liquid Glass Design System
   Responsive Desktop Shell + Native iOS Mobile App Experience
   ========================================================================== */

:root {
    /* Apple / Fintech System Palette — Light Mode */
    --ios-blue: #0071e3;
    --ios-blue-hover: #005bb5;
    --ios-indigo: #5856d6;
    --ios-purple: #8944ab;
    --ios-green: #16a34a;
    --ios-teal: #0d9488;
    --ios-orange: #ea580c;
    --ios-red: #dc2626;
    --ios-yellow: #ca8a04;

    /* Typography */
    --ios-font: 'Prompt', -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;

    /* Surfaces & Elevated Cards — Crisp Light */
    --ios-bg: #F5F6F8;
    --ios-text: #0F172A;
    --ios-text-secondary: #475569;
    --ios-text-tertiary: #94A3B8;

    --ios-glass-bg: #FFFFFF;
    --ios-glass-bg-strong: rgba(255, 255, 255, 0.88);
    --ios-glass-bg-subtle: #F8FAFC;
    --ios-glass-border: rgba(15, 23, 42, 0.07);
    --ios-glass-stroke: rgba(15, 23, 42, 0.08);
    --ios-glass-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px -4px rgba(15, 23, 42, 0.06);
    --ios-glass-shadow-hover: 0 2px 6px rgba(15, 23, 42, 0.05), 0 12px 28px -8px rgba(15, 23, 42, 0.10);

    --ios-input-bg: #FFFFFF;
    --ios-input-border: rgba(15, 23, 42, 0.12);
    --ios-separator: rgba(15, 23, 42, 0.07);
    --ios-pill-bg: rgba(15, 23, 42, 0.045);
    --ios-segmented-bg: rgba(15, 23, 42, 0.055);
    --ios-segmented-active: #FFFFFF;

    /* Subtle Ambient Top Tint — Light (No loud neon) */
    --mesh-1: rgba(0, 113, 227, 0.045);
    --mesh-2: rgba(15, 23, 42, 0.02);

    /* Layout Tokens */
    --sidebar-width: 244px;
    --navbar-height: 56px;
    --mobile-header-height: 54px;
    --tabbar-height: 64px;
    --ios-radius-sm: 10px;
    --ios-radius-md: 14px;
    --ios-radius-lg: 18px;
    --ios-radius-xl: 24px;

    /* Bootstrap 5 Sync */
    --bs-body-bg: var(--ios-bg);
    --bs-body-color: var(--ios-text);
    --bs-primary: var(--ios-blue);
    --bs-primary-rgb: 0, 113, 227;
    --bs-success: var(--ios-green);
    --bs-danger: var(--ios-red);
    --bs-warning: var(--ios-orange);
    --bs-border-color: var(--ios-separator);
}

[data-bs-theme="dark"] {
    /* Apple / Fintech System Palette — Obsidian Dark Mode */
    --ios-blue: #2997ff;
    --ios-blue-hover: #52acff;
    --ios-indigo: #7c7aff;
    --ios-purple: #bf5af2;
    --ios-green: #30d158;
    --ios-teal: #2dd4bf;
    --ios-orange: #ff9f0a;
    --ios-red: #ff453a;
    --ios-yellow: #ffd60a;

    /* Surfaces & Elevated Cards — Obsidian Dark */
    --ios-bg: #0B0D12;
    --ios-text: #F3F4F6;
    --ios-text-secondary: #9CA3AF;
    --ios-text-tertiary: #6B7280;

    --ios-glass-bg: #151821;
    --ios-glass-bg-strong: rgba(21, 24, 33, 0.88);
    --ios-glass-bg-subtle: rgba(255, 255, 255, 0.03);
    --ios-glass-border: rgba(255, 255, 255, 0.08);
    --ios-glass-stroke: rgba(255, 255, 255, 0.08);
    --ios-glass-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px -6px rgba(0, 0, 0, 0.45);
    --ios-glass-shadow-hover: 0 2px 8px rgba(0, 0, 0, 0.45), 0 16px 36px -8px rgba(0, 0, 0, 0.58);

    --ios-input-bg: #0F1219;
    --ios-input-border: rgba(255, 255, 255, 0.11);
    --ios-separator: rgba(255, 255, 255, 0.075);
    --ios-pill-bg: rgba(255, 255, 255, 0.06);
    --ios-segmented-bg: rgba(255, 255, 255, 0.055);
    --ios-segmented-active: rgba(255, 255, 255, 0.12);

    /* Subtle Ambient Top Tint — Dark */
    --mesh-1: rgba(41, 151, 255, 0.06);
    --mesh-2: rgba(255, 255, 255, 0.02);

    /* Bootstrap 5 Sync */
    --bs-body-bg: var(--ios-bg);
    --bs-body-color: var(--ios-text);
    --bs-heading-color: #F9FAFB;
    --bs-primary: var(--ios-blue);
    --bs-primary-rgb: 41, 151, 255;
    --bs-border-color: var(--ios-separator);
}

/* ==========================================================================
   Base Reset & Ambient Mesh Background
   ========================================================================== */

html {
    overflow-x: clip;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--ios-font);
    background-color: var(--ios-bg);
    background-image:
        radial-gradient(ellipse 80% 42% at 50% -10%, var(--mesh-1) 0%, transparent 68%),
        radial-gradient(ellipse 50% 35% at 95% 10%, var(--mesh-2) 0%, transparent 60%);
    background-attachment: fixed;
    color: var(--ios-text);
    margin: 0;
    padding: 0;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.24s ease, color 0.24s ease;
}

/* Tabular numerals for prices, balances, tables, KPIs */
.tabular-nums,
.ios-num,
.kpi-value,
.kpi-delta,
table td,
table th {
    font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   iOS Liquid Glass Core Components (Shared with @app-views)
   ========================================================================== */

.ios-glass {
    background: var(--ios-glass-bg);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--ios-glass-border);
    box-shadow: var(--ios-glass-shadow);
}

.ios-card {
    background: var(--ios-glass-bg);
    border: 1px solid var(--ios-glass-border);
    border-radius: var(--ios-radius-lg);
    box-shadow: var(--ios-glass-shadow);
    padding: 1.25rem;
    position: relative;
    transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

.ios-card.ios-card-hover:hover,
.ios-card.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--ios-glass-shadow-hover);
}

.ios-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--ios-separator);
}

.ios-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ios-text-secondary);
    margin: 0 0 0.75rem 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* iOS Grouped Inset List */
.ios-list-group {
    background: var(--ios-glass-bg);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--ios-glass-border);
    border-radius: var(--ios-radius-md);
    box-shadow: var(--ios-glass-shadow);
    overflow: hidden;
}

.ios-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.9rem 1.15rem;
    border-bottom: 1px solid var(--ios-separator);
    transition: background-color 0.16s ease;
    color: var(--ios-text);
    text-decoration: none;
}

.ios-list-item:last-child {
    border-bottom: none;
}

.ios-list-item:hover {
    background: var(--ios-glass-bg-subtle);
}

/* iOS Pills */
.ios-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.32rem 0.78rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    background: var(--ios-pill-bg);
    color: var(--ios-text);
    border: 1px solid var(--ios-glass-stroke);
    white-space: nowrap;
    transition: all 0.18s ease;
    text-decoration: none;
}

button.ios-pill,
a.ios-pill {
    cursor: pointer;
}

button.ios-pill:hover,
a.ios-pill:hover {
    transform: translateY(-1px);
    background: rgba(var(--bs-primary-rgb), 0.14);
    color: var(--ios-blue);
    border-color: rgba(var(--bs-primary-rgb), 0.28);
}

.ios-pill.active,
.ios-pill-primary {
    background: rgba(var(--bs-primary-rgb), 0.16);
    color: var(--ios-blue);
    border-color: rgba(var(--bs-primary-rgb), 0.3);
}

.ios-pill-success {
    background: rgba(52, 199, 89, 0.15);
    color: var(--ios-green);
    border-color: rgba(52, 199, 89, 0.28);
}

.ios-pill-danger {
    background: rgba(255, 59, 48, 0.14);
    color: var(--ios-red);
    border-color: rgba(255, 59, 48, 0.26);
}

.ios-pill-warning {
    background: rgba(255, 149, 0, 0.15);
    color: var(--ios-orange);
    border-color: rgba(255, 149, 0, 0.28);
}

/* Risk Level Badges */
.ios-badge-low,
.ios-badge-medium,
.ios-badge-high {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.26rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.ios-badge-low {
    background: rgba(52, 199, 89, 0.16);
    color: #16a34a;
    border: 1px solid rgba(52, 199, 89, 0.32);
}

[data-bs-theme="dark"] .ios-badge-low {
    background: rgba(48, 209, 88, 0.18);
    color: #4ade80;
    border-color: rgba(48, 209, 88, 0.35);
}

.ios-badge-medium {
    background: rgba(255, 149, 0, 0.16);
    color: #d97706;
    border: 1px solid rgba(255, 149, 0, 0.34);
}

[data-bs-theme="dark"] .ios-badge-medium {
    background: rgba(255, 159, 10, 0.18);
    color: #fbbf24;
    border-color: rgba(255, 159, 10, 0.35);
}

.ios-badge-high {
    background: rgba(255, 59, 48, 0.15);
    color: #dc2626;
    border: 1px solid rgba(255, 59, 48, 0.32);
}

[data-bs-theme="dark"] .ios-badge-high {
    background: rgba(255, 69, 58, 0.2);
    color: #fb7185;
    border-color: rgba(255, 69, 58, 0.38);
}

/* iOS Segmented Control */
.ios-segmented {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px;
    border-radius: 14px;
    background: var(--ios-segmented-bg);
    border: 1px solid var(--ios-glass-stroke);
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}

.ios-segmented::-webkit-scrollbar {
    display: none;
}

.ios-segmented > button,
.ios-segmented > a,
.ios-segmented > label,
.ios-segmented .nav-link,
.ios-segmented-btn {
    flex: 1 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.48rem 0.95rem;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--ios-text-secondary);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.ios-segmented > button.active,
.ios-segmented > a.active,
.ios-segmented > label.active,
.ios-segmented .nav-link.active,
.ios-segmented-btn.active {
    background: var(--ios-segmented-active) !important;
    color: var(--ios-text) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
}

/* iOS Buttons */
.ios-btn-primary,
.ios-btn-secondary,
.ios-btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.68rem 1.25rem;
    min-height: 44px;
    border-radius: 14px;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
}

.ios-btn-primary:active,
.ios-btn-secondary:active,
.ios-btn-danger:active {
    transform: scale(0.975);
}

.ios-btn-primary {
    background: linear-gradient(180deg, var(--ios-blue) 0%, var(--ios-blue-hover) 100%);
    color: #ffffff;
    box-shadow: 0 6px 18px -4px rgba(0, 122, 255, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.ios-btn-primary:hover {
    color: #ffffff;
    filter: brightness(1.06);
    box-shadow: 0 10px 24px -4px rgba(0, 122, 255, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.ios-btn-secondary {
    background: var(--ios-glass-bg-strong);
    color: var(--ios-text);
    border-color: var(--ios-input-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.ios-btn-secondary:hover {
    color: var(--ios-blue);
    border-color: rgba(var(--bs-primary-rgb), 0.35);
    background: var(--ios-glass-bg);
}

.ios-btn-danger {
    background: rgba(255, 59, 48, 0.13);
    color: var(--ios-red);
    border-color: rgba(255, 59, 48, 0.24);
}

.ios-btn-danger:hover {
    background: var(--ios-red);
    color: #ffffff;
    box-shadow: 0 8px 20px -4px rgba(255, 59, 48, 0.45);
}

.ios-btn-sm {
    padding: 0.42rem 0.85rem;
    min-height: 34px;
    border-radius: 10px;
    font-size: 0.82rem;
}

/* iOS Form Controls */
.ios-input,
.ios-select {
    display: block;
    width: 100%;
    min-height: 46px;
    padding: 0.65rem 0.95rem;
    font-family: var(--ios-font);
    font-size: 0.94rem;
    font-weight: 500;
    color: var(--ios-text);
    background: var(--ios-input-bg);
    border: 1px solid var(--ios-input-border);
    border-radius: 13px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.ios-input::placeholder {
    color: var(--ios-text-tertiary);
}

.ios-input:focus,
.ios-select:focus {
    border-color: var(--ios-blue);
    box-shadow: 0 0 0 4px rgba(var(--bs-primary-rgb), 0.18);
    background: var(--ios-glass-bg-strong);
}

.ios-select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2.4rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a94a6' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 16px;
}

[data-bs-theme="dark"] .ios-select option {
    background-color: #162033;
    color: #f8fafc;
}

/* iOS Switch Toggle (supports both <input class="ios-toggle"> and <label class="ios-toggle"><input><span>) */
input[type="checkbox"].ios-toggle {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    width: 50px;
    height: 30px;
    border-radius: 999px;
    background: rgba(120, 120, 128, 0.32);
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.24s ease;
    vertical-align: middle;
}

input[type="checkbox"].ios-toggle::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

input[type="checkbox"].ios-toggle:checked {
    background: var(--ios-green);
}

input[type="checkbox"].ios-toggle:checked::after {
    transform: translateX(20px);
}

label.ios-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 30px;
    flex-shrink: 0;
    cursor: pointer;
}

label.ios-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

label.ios-toggle .ios-toggle-slider {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: rgba(120, 120, 128, 0.32);
    transition: background-color 0.24s ease;
}

label.ios-toggle .ios-toggle-slider::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

label.ios-toggle input:checked + .ios-toggle-slider {
    background: var(--ios-green);
}

label.ios-toggle input:checked + .ios-toggle-slider::before {
    transform: translateX(20px);
}

/* KPI Grid & Chart Card */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

@media (min-width: 992px) {
    .kpi-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1.15rem;
    }
}

.kpi-card {
    background: var(--ios-glass-bg);
    border: 1px solid var(--ios-glass-border);
    border-radius: var(--ios-radius-md);
    box-shadow: var(--ios-glass-shadow);
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.kpi-label {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--ios-text-secondary);
    letter-spacing: 0.02em;
}

.kpi-value {
    font-size: clamp(1.15rem, 2.2vw, 1.55rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--ios-text);
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-delta {
    font-size: 0.76rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.chart-card {
    background: var(--ios-glass-bg);
    border: 1px solid var(--ios-glass-border);
    border-radius: var(--ios-radius-lg);
    box-shadow: var(--ios-glass-shadow);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.chart-canvas-wrap {
    position: relative;
    width: 100%;
    min-height: 250px;
    flex: 1 1 auto;
}

.chart-center-label {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    text-align: center;
}

/* ==========================================================================
   Desktop App Shell (>= 768px)
   ========================================================================== */

.ios-desktop-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    z-index: 1030;
    background: var(--ios-glass-bg-strong);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-bottom: 1px solid var(--ios-separator);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    transition: background-color 0.24s ease;
}

.nav-breadcrumb-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.26rem 0.72rem;
    border-radius: 999px;
    background: var(--ios-pill-bg);
    border: 1px solid var(--ios-glass-stroke);
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--ios-text-secondary);
    white-space: nowrap;
}

.nav-breadcrumb-pill .nav-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ios-green);
    flex-shrink: 0;
}

.nav-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--ios-glass-stroke);
    background: transparent;
    color: var(--ios-text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.16s ease;
    padding: 0;
}

.nav-icon-btn:hover {
    background: var(--ios-pill-bg);
    color: var(--ios-text);
}

.nav-icon-btn-danger:hover {
    background: rgba(220, 38, 38, 0.10);
    color: var(--ios-red);
    border-color: rgba(220, 38, 38, 0.22);
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: var(--ios-text);
}

.brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--ios-blue) 0%, var(--ios-indigo) 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 6px 16px -4px rgba(0, 122, 255, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.brand-title {
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--ios-text);
}

.brand-sub {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ios-blue);
    display: block;
    line-height: 1;
}

.theme-toggle-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--ios-glass-stroke);
    background: var(--ios-pill-bg);
    color: var(--ios-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.theme-toggle-btn:hover {
    background: rgba(var(--bs-primary-rgb), 0.14);
    color: var(--ios-blue);
    border-color: rgba(var(--bs-primary-rgb), 0.28);
}

.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.24rem 0.7rem 0.24rem 0.3rem;
    border-radius: 999px;
    background: var(--ios-pill-bg);
    border: 1px solid var(--ios-glass-stroke);
    color: var(--ios-text);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.16s ease;
    max-width: 170px;
}

.user-pill:hover {
    background: rgba(var(--bs-primary-rgb), 0.10);
    border-color: rgba(var(--bs-primary-rgb), 0.24);
    color: var(--ios-blue);
}

.user-avatar-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--ios-blue);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
}

/* Desktop Sidebar (>= 992px) — Apple / macOS Grouped Navigation */
.ios-sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    z-index: 1010;
    background: var(--ios-glass-bg);
    border-right: 1px solid var(--ios-separator);
    padding: 0.85rem 0.75rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    overflow-y: auto;
    scrollbar-width: thin;
}

.ios-sidebar-group-label {
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ios-text-tertiary);
    padding: 0.65rem 0.65rem 0.3rem;
    margin: 0;
}

.ios-sidebar-group-label:first-child {
    padding-top: 0.25rem;
}

.ios-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.56rem 0.72rem;
    border-radius: 10px;
    color: var(--ios-text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.ios-sidebar-link svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    opacity: 0.82;
}

.ios-sidebar-link:hover {
    color: var(--ios-text);
    background: var(--ios-pill-bg);
}

.ios-sidebar-link.active {
    color: var(--ios-blue);
    font-weight: 600;
    background: rgba(var(--bs-primary-rgb), 0.10);
}

.ios-sidebar-link.active svg {
    opacity: 1;
}

.ios-sidebar-profile {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.62rem 0.7rem;
    border-radius: 12px;
    background: var(--ios-glass-bg-subtle);
    border: 1px solid var(--ios-separator);
    text-decoration: none;
    color: var(--ios-text);
    transition: border-color 0.16s ease, background-color 0.16s ease;
}

.ios-sidebar-profile:hover {
    border-color: rgba(var(--bs-primary-rgb), 0.3);
    background: rgba(var(--bs-primary-rgb), 0.05);
    color: var(--ios-text);
}

.ios-sidebar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-transform: uppercase;
}

/* Tablet Top Nav Pills (768px - 991px) */
.ios-tablet-nav {
    display: none;
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .ios-tablet-nav {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        margin-left: 1.25rem;
    }
}

/* Main Content Wrapper */
.main-content-wrapper {
    margin-top: var(--navbar-height);
    padding: 1.5rem 0 3.5rem;
    min-height: calc(100vh - var(--navbar-height));
    transition: margin-left 0.25s ease;
}

@media (min-width: 992px) {
    .main-content-wrapper.has-sidebar {
        margin-left: var(--sidebar-width);
    }
}

/* ==========================================================================
   Native iOS Mobile Experience (< 768px)
   ========================================================================== */

.ios-mobile-header {
    display: none;
}

.ios-tab-bar {
    display: none;
}

@media (max-width: 767.98px) {
    .ios-desktop-navbar {
        display: none !important;
    }

    .ios-sidebar {
        display: none !important;
    }

    /* Sticky Translucent iOS Top App Bar */
    .ios-mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1040;
        min-height: calc(var(--mobile-header-height) + env(safe-area-inset-top, 0px));
        padding: calc(0.5rem + env(safe-area-inset-top, 0px)) 1rem 0.5rem;
        background: var(--ios-glass-bg-strong);
        backdrop-filter: blur(26px) saturate(190%);
        -webkit-backdrop-filter: blur(26px) saturate(190%);
        border-bottom: 1px solid var(--ios-separator);
    }

    .ios-mobile-title {
        font-size: 1.08rem;
        font-weight: 700;
        letter-spacing: -0.02em;
        color: var(--ios-text);
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .main-content-wrapper {
        margin-top: calc(var(--mobile-header-height) + env(safe-area-inset-top, 0px));
        margin-left: 0 !important;
        padding: 1rem 0 calc(var(--tabbar-height) + env(safe-area-inset-bottom, 0px) + 2.25rem);
    }

    .auth-layout {
        padding-top: calc(var(--mobile-header-height) + env(safe-area-inset-top, 0px) + 0.5rem) !important;
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 2rem) !important;
    }

    /* Floating Frosted-Glass Bottom Tab Bar (5 tabs, Fold 7 safe) */
    .ios-tab-bar {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        align-items: center;
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: max(10px, env(safe-area-inset-bottom, 10px));
        z-index: 1050;
        height: 60px;
        padding: 4px;
        border-radius: 22px;
        background: var(--ios-glass-bg-strong);
        backdrop-filter: blur(24px) saturate(180%);
        -webkit-backdrop-filter: blur(24px) saturate(180%);
        border: 1px solid var(--ios-glass-border);
        box-shadow: 0 10px 30px -6px rgba(0, 0, 0, 0.18);
    }

    .ios-tab-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        height: 100%;
        min-width: 0;
        padding: 0 2px;
        border-radius: 17px;
        color: var(--ios-text-secondary);
        text-decoration: none;
        font-size: 0.64rem;
        font-weight: 600;
        letter-spacing: -0.01em;
        transition: all 0.18s ease;
        position: relative;
        overflow: hidden;
        -webkit-tap-highlight-color: transparent;
    }

    .ios-tab-item span {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ios-tab-item svg {
        width: 22px;
        height: 22px;
        transition: transform 0.2s ease;
    }

    .ios-tab-item.active {
        color: var(--ios-blue);
        background: rgba(var(--bs-primary-rgb), 0.14);
        box-shadow: inset 0 0 0 1px rgba(var(--bs-primary-rgb), 0.2);
    }

    .ios-tab-item.active svg {
        transform: scale(1.06);
    }

    .ios-tab-item:active {
        transform: scale(0.94);
    }

    #btn-back-to-top {
        bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom, 12px) + 16px) !important;
        right: 14px !important;
        width: 44px !important;
        height: 44px !important;
    }
}

/* ==========================================================================
   iOS Landing Page & Auth (login.html, register.html, error.html)
   ========================================================================== */

.auth-layout {
    width: 100%;
    min-height: 100vh;
    padding-top: calc(var(--navbar-height) + 1.5rem);
    padding-bottom: 3rem;
    display: flex;
    align-items: center;
}

.landing-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
}

@media (min-width: 992px) {
    .landing-grid {
        grid-template-columns: 1.15fr 0.85fr;
        gap: 3rem;
    }
}

.landing-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.38rem 0.9rem;
    border-radius: 999px;
    background: var(--ios-glass-bg);
    border: 1px solid var(--ios-glass-border);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ios-blue);
    margin-bottom: 1.15rem;
}

.landing-eyebrow .pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ios-green);
    box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.24);
}

.landing-headline {
    font-size: clamp(2rem, 4.2vw, 3.3rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.08;
    color: var(--ios-text);
    margin-bottom: 1rem;
}

.landing-headline .accent-gradient {
    background: linear-gradient(135deg, var(--ios-blue) 0%, var(--ios-indigo) 55%, var(--ios-teal) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.landing-subtitle {
    font-size: 1.02rem;
    line-height: 1.6;
    color: var(--ios-text-secondary);
    max-width: 560px;
    margin-bottom: 1.75rem;
}

.strategy-showcase-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 0.9rem;
}

@media (min-width: 576px) {
    .strategy-showcase-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.showcase-card {
    background: var(--ios-glass-bg);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    border: 1px solid var(--ios-glass-border);
    border-radius: 20px;
    padding: 1.1rem 1.15rem;
    box-shadow: var(--ios-glass-shadow);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.showcase-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--ios-glass-shadow-hover);
}

.showcase-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.65rem;
}

.showcase-card h6 {
    font-size: 0.94rem;
    font-weight: 700;
    color: var(--ios-text);
    margin-bottom: 0.3rem;
}

.showcase-card p {
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--ios-text-secondary);
    margin-bottom: 0;
}

.auth-glass-card {
    background: var(--ios-glass-bg);
    border: 1px solid var(--ios-glass-border);
    border-radius: var(--ios-radius-xl);
    box-shadow: var(--ios-glass-shadow-hover);
    padding: 1.85rem;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

@media (max-width: 575.98px) {
    .auth-glass-card {
        padding: 1.5rem 1.25rem;
        border-radius: 24px;
    }
}

.auth-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--ios-blue), var(--ios-indigo));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.15rem;
    color: #fff;
    box-shadow: 0 12px 24px -6px rgba(0, 122, 255, 0.45);
}

.ios-input-group {
    position: relative;
}

.ios-input-group .ios-input {
    padding-left: 2.75rem;
}

.ios-input-group .ios-input-icon {
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ios-text-tertiary);
    pointer-events: none;
    display: inline-flex;
}

.ios-input-group .ios-password-toggle {
    position: absolute;
    right: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: var(--ios-text-tertiary);
    padding: 0.35rem;
    border-radius: 8px;
    cursor: pointer;
}

.ios-input-group .ios-password-toggle:hover {
    color: var(--ios-text);
}

/* ==========================================================================
   Flash Alerts & Toasts
   ========================================================================== */

.ios-alert {
    background: var(--ios-glass-bg-strong);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    border: 1px solid var(--ios-glass-border);
    border-radius: 16px;
    box-shadow: var(--ios-glass-shadow);
    color: var(--ios-text);
    padding: 0.9rem 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.ios-alert-success { border-left: 4px solid var(--ios-green); }
.ios-alert-danger  { border-left: 4px solid var(--ios-red); }
.ios-alert-warning { border-left: 4px solid var(--ios-orange); }
.ios-alert-info    { border-left: 4px solid var(--ios-blue); }

#ios-toast-container {
    position: fixed;
    top: calc(var(--navbar-height) + 14px);
    right: 16px;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: 340px;
    pointer-events: none;
}

@media (max-width: 767.98px) {
    #ios-toast-container {
        top: calc(var(--mobile-header-height) + env(safe-area-inset-top, 0px) + 10px);
        left: 12px;
        right: 12px;
        max-width: none;
    }
}

.ios-toast {
    pointer-events: auto;
    background: var(--ios-glass-bg-strong);
    backdrop-filter: blur(26px) saturate(190%);
    -webkit-backdrop-filter: blur(26px) saturate(190%);
    border: 1px solid var(--ios-glass-border);
    border-radius: 16px;
    padding: 0.8rem 1rem;
    box-shadow: var(--ios-glass-shadow-hover);
    color: var(--ios-text);
    font-size: 0.88rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    animation: iosSlideIn 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes iosSlideIn {
    from { opacity: 0; transform: translateY(-10px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================================================
   Backward Compatibility & Bootstrap / Select2 / Table Polish
   ========================================================================== */

.modern-card {
    background: var(--ios-glass-bg);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--ios-glass-border);
    border-radius: var(--ios-radius-lg);
    box-shadow: var(--ios-glass-shadow);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.card-header-clean {
    padding: 1.15rem 1.35rem;
    border-bottom: 1px solid var(--ios-separator);
    background: transparent;
}

.card-body-clean {
    padding: 1.35rem;
    flex-grow: 1;
}

.bg-primary-soft { background-color: rgba(var(--bs-primary-rgb), 0.14) !important; }
.bg-success-soft { background-color: rgba(52, 199, 89, 0.14) !important; }
.bg-danger-soft  { background-color: rgba(255, 59, 48, 0.14) !important; }
.bg-warning-soft { background-color: rgba(255, 149, 0, 0.15) !important; }

.btn-danger-soft {
    background-color: rgba(255, 59, 48, 0.13);
    color: var(--ios-red);
    border: 1px solid rgba(255, 59, 48, 0.22);
    transition: all 0.2s ease;
}

.btn-danger-soft:hover {
    background-color: var(--ios-red);
    color: #ffffff;
}

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.ls-tight { letter-spacing: -0.025em; }
.ls-1 { letter-spacing: 0.05em; }
.fw-medium { font-weight: 500; }

/* Tables */
.table-clean {
    margin-bottom: 0;
    color: var(--ios-text);
}

.table-clean th {
    background: var(--ios-glass-bg-subtle);
    font-weight: 600;
    color: var(--ios-text-secondary);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--ios-separator);
    padding: 0.75rem 0.9rem;
    white-space: nowrap;
}

.table-clean td {
    border-bottom: 1px solid var(--ios-separator);
    color: var(--ios-text);
    padding: 0.8rem 0.9rem;
    vertical-align: middle;
}

.table-clean tr:last-child td {
    border-bottom: none;
}

.table-responsive {
    border-radius: 14px;
    -webkit-overflow-scrolling: touch;
}

/* Dark Mode Bootstrap Fixes */
[data-bs-theme="dark"] .bg-light,
[data-bs-theme="dark"] .bg-white {
    background-color: rgba(255, 255, 255, 0.04) !important;
    color: var(--ios-text) !important;
    border-color: var(--ios-separator) !important;
}

[data-bs-theme="dark"] .text-dark {
    color: var(--ios-text) !important;
}

[data-bs-theme="dark"] .text-secondary,
[data-bs-theme="dark"] .text-muted {
    color: var(--ios-text-secondary) !important;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .input-group-text {
    background-color: var(--ios-input-bg);
    border-color: var(--ios-input-border);
    color: var(--ios-text);
}

[data-bs-theme="dark"] .modal-content {
    background: var(--ios-glass-bg-strong);
    backdrop-filter: blur(28px) saturate(190%);
    -webkit-backdrop-filter: blur(28px) saturate(190%);
    border: 1px solid var(--ios-glass-border);
    border-radius: 24px;
    color: var(--ios-text);
}

.modal-content {
    border-radius: 24px;
    border: 1px solid var(--ios-glass-border);
    background: var(--ios-glass-bg-strong);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
}

/* Select2 Liquid Glass Support */
.select2-container--bootstrap-5 .select2-selection {
    min-height: 46px !important;
    border-radius: 13px !important;
    background-color: var(--ios-input-bg) !important;
    border-color: var(--ios-input-border) !important;
    color: var(--ios-text) !important;
    display: flex !important;
    align-items: center !important;
}

[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    color: var(--ios-text) !important;
}

[data-bs-theme="dark"] .select2-dropdown {
    background-color: #151e30 !important;
    border-color: var(--ios-glass-border) !important;
    border-radius: 14px !important;
    color: var(--ios-text) !important;
}

[data-bs-theme="dark"] .select2-results__option {
    color: var(--ios-text) !important;
    background-color: #151e30;
}

[data-bs-theme="dark"] .select2-results__option--highlighted {
    background-color: var(--ios-blue) !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .select2-search__field {
    background-color: #0b1120 !important;
    color: var(--ios-text) !important;
    border-color: var(--ios-input-border) !important;
    border-radius: 10px !important;
}

/* ==========================================================================
   iOS Language Switcher Pill (TH | EN)
   ========================================================================== */

.ios-lang-switch {
    display: inline-flex;
    align-items: center;
    padding: 3px;
    border-radius: 12px;
    background: var(--ios-pill-bg);
    border: 1px solid var(--ios-glass-stroke);
    gap: 2px;
    flex-shrink: 0;
}

.ios-lang-switch button {
    border: none;
    background: transparent;
    color: var(--ios-text-secondary);
    font-family: var(--ios-font);
    font-size: 0.74rem;
    font-weight: 700;
    padding: 0.28rem 0.56rem;
    border-radius: 9px;
    cursor: pointer;
    line-height: 1.2;
    transition: all 0.18s ease;
}

.ios-lang-switch button.active {
    background: var(--ios-segmented-active);
    color: var(--ios-blue);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Modern iOS Liquid Glass Coin Picker (coin_picker.js)
   ========================================================================== */

.coin-picker {
    position: relative;
    width: 100%;
}

.coin-picker-native {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 1px !important;
    height: 1px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.coin-picker-trigger {
    width: 100%;
    min-height: 48px;
    padding: 0.48rem 0.85rem;
    border-radius: 14px;
    border: 1px solid var(--ios-input-border);
    background: var(--ios-input-bg);
    color: var(--ios-text);
    font-family: var(--ios-font);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.coin-picker.open .coin-picker-trigger,
.coin-picker-trigger:focus-visible {
    border-color: var(--ios-blue);
    box-shadow: 0 0 0 4px rgba(var(--bs-primary-rgb), 0.16);
    background: var(--ios-glass-bg-strong);
    outline: none;
}

.coin-picker-chevron {
    color: var(--ios-text-tertiary);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.coin-picker.open .coin-picker-chevron {
    transform: rotate(180deg);
    color: var(--ios-blue);
}

.coin-picker-selected {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.coin-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    flex-shrink: 0;
    box-shadow: 0 4px 10px -2px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.coin-picker-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
}

.coin-symbol {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--ios-text);
    white-space: nowrap;
}

.coin-name {
    font-size: 0.72rem;
    color: var(--ios-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.coin-picker-price {
    font-size: 0.76rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: var(--ios-pill-bg);
    color: var(--ios-text);
    border: 1px solid var(--ios-glass-stroke);
    white-space: nowrap;
}

.coin-picker-placeholder {
    color: var(--ios-text-tertiary);
    font-size: 0.9rem;
}

.coin-picker-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 1065;
    border-radius: 18px;
    background: var(--ios-glass-bg-strong);
    backdrop-filter: blur(28px) saturate(190%);
    -webkit-backdrop-filter: blur(28px) saturate(190%);
    border: 1px solid var(--ios-glass-border);
    box-shadow: var(--ios-glass-shadow-hover);
    padding: 0.5rem;
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.coin-picker.open .coin-picker-dropdown {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.coin-picker-search-wrap {
    padding: 0.2rem 0.2rem 0.45rem;
}

.coin-picker-search {
    width: 100%;
    padding: 0.5rem 0.8rem;
    border-radius: 11px;
    border: 1px solid var(--ios-input-border);
    background: var(--ios-input-bg);
    color: var(--ios-text);
    font-family: var(--ios-font);
    font-size: 0.86rem;
    outline: none;
}

.coin-picker-search:focus {
    border-color: var(--ios-blue);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.16);
}

.coin-picker-list {
    max-height: 260px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.coin-picker-option {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--ios-text);
    padding: 0.5rem 0.65rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    cursor: pointer;
    text-align: left;
    font-family: var(--ios-font);
    transition: background-color 0.14s ease;
}

.coin-picker-option:hover {
    background: var(--ios-pill-bg);
}

.coin-picker-option.active {
    background: rgba(var(--bs-primary-rgb), 0.15);
    box-shadow: inset 0 0 0 1px rgba(var(--bs-primary-rgb), 0.28);
}

.coin-picker-empty {
    padding: 1rem;
    text-align: center;
    font-size: 0.84rem;
    color: var(--ios-text-secondary);
}

/* ==========================================================================
   Animated Strategy Guide Modal (strategy_guide.js)
   ========================================================================== */

.sg-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1080;
    background: rgba(7, 11, 20, 0.58);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.sg-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.sg-dialog {
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    border-radius: 26px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(14px) scale(0.97);
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.sg-backdrop.open .sg-dialog {
    transform: translateY(0) scale(1);
}

.sg-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.35rem 0.75rem;
}

.sg-eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ios-blue);
    display: block;
}

.sg-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ios-text);
    margin: 0.15rem 0 0;
}

.sg-close-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--ios-glass-stroke);
    background: var(--ios-pill-bg);
    color: var(--ios-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.sg-tabs {
    display: flex;
    gap: 0.35rem;
    padding: 0 1.35rem 0.75rem;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--ios-separator);
}

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

.sg-tab {
    border: 1px solid var(--ios-glass-stroke);
    background: var(--ios-pill-bg);
    color: var(--ios-text-secondary);
    font-family: var(--ios-font);
    font-size: 0.74rem;
    font-weight: 600;
    padding: 0.32rem 0.7rem;
    border-radius: 999px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.16s ease;
}

.sg-tab.active {
    background: var(--ios-blue);
    color: #ffffff;
    border-color: var(--ios-blue);
}

.sg-body {
    padding: 1rem 1.35rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.sg-stage {
    border-radius: 18px;
    background: var(--ios-glass-bg-subtle);
    border: 1px solid var(--ios-separator);
    padding: 0.65rem;
    overflow: hidden;
}

.sg-svg {
    width: 100%;
    height: auto;
    max-height: 185px;
    display: block;
}

.sg-grid-lines line {
    stroke: var(--ios-separator);
    stroke-width: 1;
}

.sg-label {
    fill: var(--ios-text-secondary);
    font-size: 10px;
    font-weight: 700;
    font-family: var(--ios-font);
}

.sg-label-green { fill: var(--ios-green); font-size: 10px; font-weight: 700; font-family: var(--ios-font); }
.sg-label-red   { fill: var(--ios-red); font-size: 10px; font-weight: 700; font-family: var(--ios-font); }
.sg-label-amber { fill: var(--ios-orange); font-size: 10px; font-weight: 700; font-family: var(--ios-font); }

/* SVG Keyframe Animations */
.sg-draw-line {
    stroke-dasharray: 620;
    stroke-dashoffset: 620;
    animation: sgDraw 2.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes sgDraw {
    to { stroke-dashoffset: 0; }
}

.sg-pulse-dot {
    transform-box: fill-box;
    transform-origin: center;
    animation: sgPulseDot 1.8s ease-in-out infinite;
}

@keyframes sgPulseDot {
    0%, 100% { transform: scale(1); opacity: 0.95; }
    50% { transform: scale(1.38); opacity: 1; }
}

.sg-pulse-ring {
    transform-box: fill-box;
    transform-origin: center;
    animation: sgPulseRing 2s ease-out infinite;
}

@keyframes sgPulseRing {
    0% { transform: scale(0.75); opacity: 0.85; }
    100% { transform: scale(1.55); opacity: 0; }
}

.sg-rebal-bar-1 {
    transform-box: fill-box;
    transform-origin: bottom;
    animation: sgRebalDown 2.8s ease-in-out infinite alternate;
}

.sg-rebal-bar-2 {
    transform-box: fill-box;
    transform-origin: bottom;
    animation: sgRebalUp 2.8s ease-in-out infinite alternate;
}

@keyframes sgRebalDown {
    0% { transform: scaleY(1.12); }
    100% { transform: scaleY(0.80); }
}

@keyframes sgRebalUp {
    0% { transform: scaleY(0.85); }
    100% { transform: scaleY(1.32); }
}

.sg-flow-arrow {
    animation: sgDashFlow 1.4s linear infinite;
}

@keyframes sgDashFlow {
    to { stroke-dashoffset: -16; }
}

.sg-candle {
    transform-box: fill-box;
    transform-origin: bottom;
    animation: sgCandlePop 1.6s ease-in-out infinite alternate;
}

@keyframes sgCandlePop {
    0% { transform: scaleY(0.85); opacity: 0.8; }
    100% { transform: scaleY(1.08); opacity: 1; }
}

.sg-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

@media (max-width: 575.98px) {
    .sg-info-grid {
        grid-template-columns: 1fr;
    }
}

.sg-info-box {
    background: var(--ios-glass-bg-subtle);
    border: 1px solid var(--ios-separator);
    border-radius: 14px;
    padding: 0.75rem 0.9rem;
}

.sg-info-full {
    grid-column: 1 / -1;
}

.sg-info-pro {
    border-left: 3px solid var(--ios-green);
}

.sg-info-risk {
    border-left: 3px solid var(--ios-orange);
}

.sg-info-box h6 {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--ios-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.28rem;
}

.sg-info-box p {
    font-size: 0.84rem;
    line-height: 1.5;
    color: var(--ios-text);
    margin: 0;
}

.sg-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
    padding: 0.85rem 1.35rem;
    border-top: 1px solid var(--ios-separator);
    flex-wrap: wrap;
}

/* ==========================================================================
   Phase 3 SaaS, AI, PnL, Pricing, QR, Radar & Admin Utilities
   ========================================================================== */

.pnl-positive {
    color: var(--ios-green) !important;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.pnl-negative {
    color: var(--ios-red) !important;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.pnl-neutral {
    color: var(--ios-text-secondary) !important;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.ai-glow-card {
    background: var(--ios-glass-bg);
    backdrop-filter: blur(26px) saturate(190%);
    -webkit-backdrop-filter: blur(26px) saturate(190%);
    border: 1px solid rgba(0, 122, 255, 0.34);
    border-radius: var(--ios-radius-lg);
    box-shadow: 0 16px 40px -12px rgba(0, 122, 255, 0.22), inset 0 1px 0 rgba(100, 255, 218, 0.32);
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
}

.ai-glow-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #5E5CE6 0%, #007AFF 50%, #00D4FF 100%);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1.15rem;
    align-items: stretch;
}

@media (min-width: 768px) {
    .pricing-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.35rem;
    }
}

.pricing-card {
    background: var(--ios-glass-bg);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--ios-glass-border);
    border-radius: var(--ios-radius-lg);
    box-shadow: var(--ios-glass-shadow);
    padding: 1.5rem 1.35rem;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.pricing-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--ios-glass-shadow-hover);
}

.pricing-card-featured {
    border: 1.5px solid rgba(0, 122, 255, 0.55);
    box-shadow: 0 20px 46px -12px rgba(0, 122, 255, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    background: var(--ios-glass-bg-strong);
}

.qr-box {
    background: #ffffff;
    padding: 1rem;
    border-radius: 20px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
    border: 1px solid rgba(15, 23, 42, 0.08);
    max-width: 100%;
}

.qr-box img,
.qr-box canvas,
.qr-box svg {
    display: block;
    max-width: 220px;
    width: 100%;
    height: auto;
}

.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .admin-stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1rem;
    }
}

@media (min-width: 1200px) {
    .admin-stat-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

.compact-metric-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--ios-separator);
    font-size: 0.86rem;
    min-width: 0;
}

.compact-metric-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.radar-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.75rem;
    border-radius: 14px;
    background: var(--ios-glass-bg-strong);
    border: 1px solid var(--ios-glass-border);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ios-text);
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.16s ease, border-color 0.16s ease;
}

.radar-chip:hover {
    transform: translateY(-1px);
    border-color: rgba(var(--bs-primary-rgb), 0.4);
}

.plan-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.24rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.16), rgba(0, 212, 255, 0.14));
    color: var(--ios-blue);
    border: 1px solid rgba(0, 122, 255, 0.3);
    text-decoration: none;
    white-space: nowrap;
}

.pricing-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.15rem;
    padding: 0.75rem 0.95rem;
    border-radius: 18px;
    background: var(--ios-glass-bg);
    border: 1px solid var(--ios-glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.ios-tab-bar.ios-tab-bar-5 {
    grid-template-columns: repeat(5, 1fr);
}

/* ==========================================================================
   Galaxy Z Fold 7 Cover Screen & Ultra-Narrow Mobile (<= 380px, e.g. 344px)
   ========================================================================== */

@media (max-width: 380px) {
    html,
    body {
        overflow-x: hidden;
        max-width: 100vw;
    }

    .container-xxl,
    .container,
    .container-fluid {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .ios-card,
    .chart-card,
    .ai-glow-card,
    .pricing-card,
    .modern-card {
        padding: 12px !important;
        border-radius: 18px !important;
        max-width: 100%;
    }

    .kpi-grid,
    .admin-stat-grid {
        gap: 0.55rem !important;
    }

    .kpi-card {
        padding: 0.75rem 0.8rem !important;
        border-radius: 14px !important;
    }

    .kpi-value {
        font-size: 1.05rem !important;
    }

    .kpi-label {
        font-size: 0.7rem !important;
    }

    .landing-headline {
        font-size: clamp(1.45rem, 6.5vw, 2.2rem) !important;
    }

    .landing-subtitle {
        font-size: 0.88rem !important;
        margin-bottom: 1.1rem !important;
    }

    .ios-mobile-header {
        min-height: calc(52px + env(safe-area-inset-top, 0px));
        padding: calc(0.4rem + env(safe-area-inset-top, 0px)) 10px 0.4rem;
    }

    .ios-mobile-title {
        font-size: 0.94rem;
    }

    .ios-lang-switch button {
        font-size: 0.68rem;
        padding: 0.22rem 0.42rem;
    }

    .ios-tab-bar {
        left: 8px;
        right: 8px;
        height: 56px;
        padding: 4px;
        border-radius: 22px;
    }

    .ios-tab-item {
        font-size: 0.6rem;
        gap: 2px;
        border-radius: 16px;
    }

    .ios-tab-item svg {
        width: 19px;
        height: 19px;
    }

    .ios-pill {
        font-size: 0.72rem;
        padding: 0.26rem 0.58rem;
    }

    .ios-btn-primary,
    .ios-btn-secondary,
    .ios-btn-danger {
        padding: 0.55rem 0.9rem;
        font-size: 0.84rem;
        min-height: 40px;
    }

    .coin-picker-trigger {
        padding: 0.42rem 0.65rem;
        min-height: 44px;
    }

    .coin-badge {
        width: 28px;
        height: 28px;
        font-size: 0.62rem;
    }

    .coin-picker-price {
        font-size: 0.68rem;
        padding: 0.16rem 0.42rem;
    }
}


/* ==========================================================================
   Backtest & Forward Test Strategy Lab Modal (backtest_modal.js)
   ========================================================================== */
.bt-lab-content {
    border-radius: 26px !important;
    background: var(--ios-glass-bg-strong) !important;
    backdrop-filter: blur(28px) saturate(190%);
    -webkit-backdrop-filter: blur(28px) saturate(190%);
    border: 1px solid var(--ios-glass-border) !important;
    box-shadow: 0 28px 60px -16px rgba(0, 0, 0, 0.32) !important;
    overflow: hidden;
}

.bt-lab-header {
    padding: 1.1rem 1.35rem 0.75rem;
    border-bottom: 1px solid var(--ios-separator);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.bt-lab-tabs {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px;
    border-radius: 14px;
    background: var(--ios-segmented-bg);
    border: 1px solid var(--ios-glass-stroke);
    max-width: 100%;
    overflow-x: auto;
}

.bt-lab-tabs button {
    border: 0;
    background: transparent;
    color: var(--ios-text-secondary);
    font-family: var(--ios-font);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.42rem 0.85rem;
    border-radius: 10px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.18s ease;
}

.bt-lab-tabs button.active {
    background: var(--ios-segmented-active);
    color: var(--ios-blue);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.bt-lab-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 18px;
    background: var(--ios-pill-bg);
    border: 1px solid var(--ios-glass-stroke);
    margin-bottom: 1rem;
}

.bt-period-pill {
    border: 1px solid var(--ios-glass-stroke);
    background: transparent;
    color: var(--ios-text-secondary);
    font-size: 0.74rem;
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.16s ease;
}

.bt-period-pill.active {
    background: var(--ios-blue);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.28);
}

.bt-param-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.22rem 0.55rem;
    border-radius: 12px;
    background: var(--ios-input-bg);
    border: 1px solid var(--ios-input-border);
    font-size: 0.74rem;
}

.bt-param-chip input {
    border: 0;
    background: transparent;
    color: var(--ios-text);
    font-family: var(--ios-font);
    font-weight: 600;
    font-size: 0.78rem;
    outline: none;
    text-align: right;
}

.bt-hero-verdict {
    padding: 1rem 1.2rem;
    border-radius: 20px;
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
}

.bt-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.bt-kpi-tile {
    padding: 0.78rem 0.85rem;
    border-radius: 16px;
    background: var(--ios-glass-bg);
    border: 1px solid var(--ios-glass-stroke);
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.bt-kpi-tile .bt-k-label {
    font-size: 0.68rem;
    color: var(--ios-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bt-kpi-tile .bt-k-val {
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.25;
}

.bt-kpi-tile .bt-k-sub {
    font-size: 0.68rem;
    color: var(--ios-text-tertiary);
}

.bt-chart-box {
    height: 260px;
    position: relative;
}

.bt-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ios-green);
    display: inline-block;
    animation: btPulse 1.6s infinite;
}

@keyframes btPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(1.3); }
}

@media (max-width: 991.98px) {
    .bt-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .bt-chart-box {
        height: 225px;
    }
}

@media (max-width: 575.98px) {
    .bt-lab-content {
        border-radius: 20px !important;
    }
    .bt-lab-header {
        padding: 0.85rem 0.9rem 0.65rem;
    }
    .bt-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }
    .bt-chart-box {
        height: 205px;
    }
}

@media (max-width: 380px) {
    .bt-lab-tabs button {
        font-size: 0.7rem;
        padding: 0.36rem 0.55rem;
    }
    .bt-lab-toolbar {
        padding: 0.6rem 0.65rem;
        gap: 0.5rem;
    }
    .bt-kpi-tile {
        padding: 0.6rem 0.65rem;
    }
    .bt-kpi-tile .bt-k-val {
        font-size: 0.9rem;
    }
}


/* ==========================================================================
   Native-App Zoom Lock & True 344px Galaxy Z Fold 7 Cover Screen Polish
   ========================================================================== */
html, body {
    touch-action: pan-y;
    overscroll-behavior-x: none;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overflow-x: clip;
    max-width: 100vw;
}

.ios-segmented {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.ios-segmented::-webkit-scrollbar {
    display: none;
}

.ios-mobile-header {
    gap: 0.45rem;
    max-width: 100vw;
    overflow: hidden;
}

.ios-mobile-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Prevent iOS Safari auto-zoom when tapping inputs */
@media (max-width: 767.98px) {
    input.ios-input,
    select.ios-select,
    textarea.ios-input,
    .form-control,
    .form-select {
        font-size: 16px !important;
    }
}

/* Galaxy Z Fold 7 Cover Screen (<= 380px, e.g. 344x882px) */
@media (max-width: 380px) {
    .ios-mobile-header {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    .ios-mobile-title {
        font-size: 0.92rem !important;
    }
    .ios-lang-switch button {
        padding: 3px 6px !important;
        font-size: 0.66rem !important;
    }
    .theme-toggle-btn {
        width: 30px !important;
        height: 30px !important;
    }
    .ios-segmented {
        padding: 3px !important;
        gap: 2px !important;
    }
    .ios-segmented button,
    .ios-segmented a,
    .ios-segmented-btn {
        font-size: 0.7rem !important;
        padding: 0.34rem 0.55rem !important;
        white-space: nowrap;
        flex: 0 0 auto;
    }
    .ios-card {
        border-radius: 16px !important;
    }
}

/* ==========================================================================
   Editorial Fintech Landing Page Preview Card (login.html / register.html)
   ========================================================================== */

.landing-preview-card {
    background: var(--ios-glass-bg);
    border: 1px solid var(--ios-glass-border);
    border-radius: 20px;
    box-shadow: var(--ios-glass-shadow);
    padding: 1.25rem;
    overflow: hidden;
}

.landing-preview-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.landing-preview-balance {
    font-size: clamp(1.35rem, 2.5vw, 1.8rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--ios-text);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.landing-sparkline-wrap {
    width: 100%;
    height: 76px;
    margin: 0.5rem 0 0.9rem;
    border-radius: 12px;
    background: var(--ios-glass-bg-subtle);
    border: 1px solid var(--ios-separator);
    padding: 0.35rem 0.5rem 0;
    overflow: hidden;
}

.landing-bot-rows {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.landing-bot-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    border-radius: 12px;
    background: var(--ios-glass-bg-subtle);
    border: 1px solid var(--ios-separator);
    font-size: 0.82rem;
    min-width: 0;
}

.landing-bot-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ios-green);
    flex-shrink: 0;
}

.landing-tier-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    background: var(--ios-glass-bg);
    border: 1px solid var(--ios-glass-border);
    box-shadow: var(--ios-glass-shadow);
}

/* ==========================================================================
   Social Trading Community & Facebook-Style Profile (.fb-* / .social-*)
   Shared with @social-ui (community.html & profile.html)
   ========================================================================== */

.fb-cover {
    position: relative;
    width: 100%;
    height: 196px;
    border-radius: 18px 18px 0 0;
    overflow: hidden;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 52%, #0284c7 100%);
}

.fb-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 45%, rgba(15, 23, 42, 0.36) 100%);
    pointer-events: none;
}

.fb-cover-ocean    { background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 55%, #0ea5e9 100%); }
.fb-cover-slate    { background: linear-gradient(135deg, #0f172a 0%, #334155 55%, #64748b 100%); }
.fb-cover-emerald  { background: linear-gradient(135deg, #064e3b 0%, #059669 55%, #10b981 100%); }
.fb-cover-sunset   { background: linear-gradient(135deg, #7c2d12 0%, #ea580c 52%, #f59e0b 100%); }
.fb-cover-midnight { background: linear-gradient(135deg, #090b12 0%, #1e1b4b 55%, #312e81 100%); }

.fb-profile-bar {
    background: var(--ios-glass-bg);
    border: 1px solid var(--ios-glass-border);
    border-radius: 18px;
    box-shadow: var(--ios-glass-shadow);
    overflow: hidden;
}

.fb-profile-body {
    padding: 0 1.35rem 1.25rem;
}

.fb-profile-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.85rem;
    margin-bottom: 0.85rem;
}

.fb-avatar-ring {
    width: 102px;
    height: 102px;
    border-radius: 50%;
    border: 4px solid var(--ios-glass-bg);
    box-shadow: 0 8px 22px -6px rgba(15, 23, 42, 0.28);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    margin-top: -51px;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    background: var(--ios-blue);
}

.fb-avatar-sm {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
    background: var(--ios-blue);
    text-decoration: none;
}

.fb-avatar-xs {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
    background: var(--ios-blue);
    text-decoration: none;
}

.fb-stats-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.6rem;
    padding-top: 0.9rem;
    margin-top: 0.9rem;
    border-top: 1px solid var(--ios-separator);
}

.fb-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.35rem;
    border-radius: 12px;
    background: var(--ios-glass-bg-subtle);
    border: 1px solid var(--ios-separator);
    text-align: center;
    min-width: 0;
}

.fb-stat-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ios-text);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.fb-stat-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--ios-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Social Composer Card */
.social-composer {
    background: var(--ios-glass-bg);
    border: 1px solid var(--ios-glass-border);
    border-radius: 18px;
    box-shadow: var(--ios-glass-shadow);
    padding: 1.1rem 1.2rem;
}

.social-composer-input {
    width: 100%;
    border: 1px solid var(--ios-separator);
    background: var(--ios-glass-bg-subtle);
    color: var(--ios-text);
    border-radius: 14px;
    padding: 0.75rem 0.95rem;
    font-family: var(--ios-font);
    font-size: 0.92rem;
    line-height: 1.5;
    resize: vertical;
    min-height: 78px;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.social-composer-input::placeholder {
    color: var(--ios-text-tertiary);
}

.social-composer-input:focus {
    border-color: var(--ios-blue);
    background: var(--ios-input-bg);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.14);
}

.social-composer-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    margin-top: 0.75rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--ios-separator);
}

/* Social Post Card */
.social-post-card {
    background: var(--ios-glass-bg);
    border: 1px solid var(--ios-glass-border);
    border-radius: 18px;
    box-shadow: var(--ios-glass-shadow);
    padding: 1.1rem 1.2rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    min-width: 0;
}

.social-post-card:hover {
    border-color: rgba(var(--bs-primary-rgb), 0.18);
}

.social-post-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem;
    margin-bottom: 0.7rem;
}

.social-post-body {
    font-size: 0.93rem;
    line-height: 1.6;
    color: var(--ios-text);
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    margin-bottom: 0.85rem;
}

.social-post-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.65rem;
}

/* Facebook-Style Reaction Bar & Picker */
.reaction-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--ios-separator);
    position: relative;
}

.reaction-picker-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.reaction-picker {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    z-index: 1055;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 8px;
    border-radius: 999px;
    background: var(--ios-glass-bg);
    border: 1px solid var(--ios-glass-border);
    box-shadow: 0 12px 32px -6px rgba(15, 23, 42, 0.24);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px) scale(0.95);
    transition: opacity 0.16s ease, transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.16s ease;
    max-width: calc(100vw - 32px);
}

.reaction-picker-wrap:hover .reaction-picker,
.reaction-picker-wrap:focus-within .reaction-picker,
.reaction-picker.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.reaction-emoji-btn {
    border: none;
    background: transparent;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 1.18rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.14s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.14s ease;
    padding: 0;
}

.reaction-emoji-btn:hover {
    transform: scale(1.28) translateY(-3px);
    background: var(--ios-pill-bg);
}

.reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.68rem;
    border-radius: 999px;
    border: 1px solid var(--ios-separator);
    background: var(--ios-glass-bg-subtle);
    color: var(--ios-text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.reaction-pill:hover {
    background: var(--ios-pill-bg);
    color: var(--ios-text);
}

.reaction-pill.active {
    background: rgba(var(--bs-primary-rgb), 0.12);
    border-color: rgba(var(--bs-primary-rgb), 0.32);
    color: var(--ios-blue);
}

/* Comments */
.comment-bubble {
    background: var(--ios-glass-bg-subtle);
    border: 1px solid var(--ios-separator);
    border-radius: 14px;
    padding: 0.55rem 0.8rem;
    font-size: 0.84rem;
    line-height: 1.45;
    color: var(--ios-text);
    word-break: break-word;
    overflow-wrap: anywhere;
    min-width: 0;
}

/* Trader Rank Row (Community Right Sidebar) */
.trader-rank-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.58rem 0;
    border-bottom: 1px solid var(--ios-separator);
    min-width: 0;
}

.trader-rank-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Mobile & Galaxy Z Fold 7 (<= 380px) Social & Profile Polish */
@media (max-width: 767.98px) {
    .fb-cover {
        height: 142px;
    }
    .fb-avatar-ring {
        width: 82px;
        height: 82px;
        font-size: 1.55rem;
        margin-top: -41px;
    }
    .fb-profile-body {
        padding: 0 1rem 1rem;
    }
    .fb-stats-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 380px) {
    .fb-cover {
        height: 116px;
        border-radius: 14px 14px 0 0;
    }
    .fb-avatar-ring {
        width: 70px;
        height: 70px;
        font-size: 1.35rem;
        margin-top: -35px;
        border-width: 3px;
    }
    .fb-profile-body {
        padding: 0 0.75rem 0.85rem;
    }
    .social-composer,
    .social-post-card {
        padding: 0.85rem;
        border-radius: 15px;
    }
    .reaction-emoji-btn {
        width: 30px;
        height: 30px;
        font-size: 1.05rem;
    }
    .reaction-pill {
        padding: 0.24rem 0.52rem;
        font-size: 0.72rem;
    }
    .landing-preview-card {
        padding: 0.9rem;
        border-radius: 16px;
    }
    .landing-tier-strip {
        padding: 0.65rem 0.75rem;
    }
}
