:root {
    --bg: #fafbfc;
    --fg: #0f172a;
    --dim: #64748b;
    --border: rgba(226, 232, 240, 0.85);
    --border-hover: rgba(203, 213, 225, 0.95);
    --surface: rgba(255, 255, 255, 0.86);
    --surface-elevated: rgba(255, 255, 255, 0.95);
    --green: #10b981;
    --red: #ef4444;
    --primary-teal: #0f172a;
    --primary-cobalt: #0f172a;
    --primary-teal-hover: #000000;
    --primary-cobalt-hover: #1e293b;
    --font: 'Inter', -apple-system, sans-serif;
    --font-display: 'Outfit', sans-serif;
    --radius: 9999px;
    --radius-card: 20px;
    --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05), 0 2px 8px -1px rgba(0, 0, 0, 0.02);
    --shadow-hover: 0 18px 40px -10px rgba(0, 0, 0, 0.08);
    
    /* Button fill text colors */
    --btn-fill-text: #ffffff;
    --btn-fill-text-hover: #ffffff;
    
    /* Dynamic globe rendering styles */
    --globe-water: #e0f2fe;
    --globe-land: #ffffff;
    --globe-grid: rgba(14, 165, 233, 0.04);
    --globe-stroke: #bae6fd;
    
    /* D3 Heatmap */
    --heatmap-empty: #e2e8f0;
    
    /* Professional Status Badges */
    --badge-bg: rgba(16, 185, 129, 0.08);
    --badge-border: rgba(16, 185, 129, 0.2);
    --badge-fg: #10b981;
    
    /* Warning and Security Banner/Cards */
    --warning-bg: rgba(254, 243, 199, 0.7);
    --warning-fg: #b45309;
    --warning-border: rgba(253, 230, 138, 0.8);
    
    --danger-bg: rgba(254, 242, 242, 0.7);
    --danger-fg: #dc2626;
    --danger-border: rgba(254, 226, 226, 0.8);
}

[data-theme="dark"] {
    --bg: #000000;
    --fg: #f8fafc;
    --dim: #8e9cae;
    --border: #1a1a1a;
    --surface: rgba(14, 18, 28, 0.85);
    --surface-elevated: rgba(22, 28, 44, 0.94);
    --primary-cobalt: #f8fafc;
    --primary-cobalt-hover: #cbd5e1;
    
    --btn-fill-text: #000000;
    --btn-fill-text-hover: #000000;
    
    --globe-water: #000000;
    --globe-land: #141414;
    --globe-grid: rgba(255, 255, 255, 0.02);
    --globe-stroke: rgba(255, 255, 255, 0.06);
    
    --heatmap-empty: #141414;
    
    --badge-bg: #052e16;
    --badge-border: #14532d;
    --badge-fg: #4ade80;
    
    --warning-bg: #1c1502;
    --warning-fg: #fbbf24;
    --warning-border: #453003;
    
    --danger-bg: #180404;
    --danger-fg: #ef4444;
    --danger-border: #3f0707;
}

/* Global Theme Transition */
html.theme-transition,
html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
    transition: background 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, fill 0.3s ease, stroke 0.3s ease !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    background: var(--bg);
    background-image: radial-gradient(750px circle at 50% 25%, rgba(226, 232, 240, 0.75), transparent 75%);
    background-attachment: fixed;
    color: var(--fg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dim);
}

#app {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

.view {
    display: none;
    min-height: 100vh;
}

.view.active {
    display: block;
}

.hidden {
    display: none !important;
}

#dashboard .top-bar {
    top: 38px;
}

.top-bar {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 48px);
    max-width: 960px;
    height: 56px;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border: 1px solid rgba(229, 231, 235, 0.85);
    border-radius: 9999px;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05), 0 2px 6px -1px rgba(0, 0, 0, 0.02);
    z-index: 1000;
    display: flex;
    align-items: center;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.top-bar:hover {
    border-color: rgba(209, 213, 219, 0.95);
    box-shadow: 0 8px 30px -4px rgba(0, 0, 0, 0.08), 0 4px 10px -2px rgba(0, 0, 0, 0.03);
    background: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .top-bar {
    background: rgba(15, 17, 23, 0.82);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .top-bar:hover {
    background: rgba(20, 24, 33, 0.9);
    border-color: rgba(255, 255, 255, 0.15);
}

.bar-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 0 22px;
}

.nav-back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: #94a3b8;
    text-decoration: none;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-back-link:hover {
    color: #0f172a !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    transform: translateX(-2px);
}

[data-theme="dark"] .nav-back-link:hover {
    color: #f8fafc !important;
}

.wordmark {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: #111827;
    text-decoration: none;
    text-transform: uppercase;
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    cursor: pointer !important;
}

[data-theme="dark"] .wordmark {
    color: #f8fafc;
}

.wordmark .subbrand-text {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    letter-spacing: 0.02em;
    text-transform: none;
}

[data-theme="dark"] .wordmark .subbrand-text {
    color: #94a3b8;
}

.bar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
    text-decoration: none;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 6px 12px;
    border-radius: 9999px;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
}

.nav-link:hover {
    color: #111827;
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .nav-link {
    color: #94a3b8;
}

[data-theme="dark"] .nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
}

.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 3px 12px 3px 4px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(229, 231, 235, 0.85);
    border-radius: 9999px;
}

.user-pill .avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.user-pill .username-label {
    font-size: 12px;
    font-weight: 700;
    color: #111827;
    letter-spacing: 0.02em;
}

[data-theme="dark"] .user-pill {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .user-pill .username-label {
    color: #f8fafc;
}

.top-bar .btn-fill {
    background: #111827;
    color: #ffffff;
    padding: 6px 16px;
    border-radius: 9999px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.top-bar .btn-fill:hover {
    background: #000000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

[data-theme="dark"] .top-bar .btn-fill {
    background: #ffffff;
    color: #000000;
}

[data-theme="dark"] .top-bar .btn-fill:hover {
    background: #f1f5f9;
}

.btn-fill {
    padding: 10px 22px;
    background: #0f172a;
    color: #ffffff;
    border: 1px solid transparent;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-display);
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-fill:hover {
    background: #000000;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.btn-fill:active {
    transform: translateY(0);
}

.btn-ghost {
    padding: 10px 22px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-display);
    cursor: pointer;
    color: var(--fg);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-ghost:hover {
    background: #ffffff;
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.btn-ghost:active {
    transform: translateY(0);
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero {
    padding: 120px 24px 80px;
    text-align: center;
}

.hero-inner {
    max-width: 700px;
    margin: 0 auto;
}

.tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--green);
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 4px 12px;
    border-radius: 50px;
    margin-bottom: 24px;
}

.hero-eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--dim);
    margin-bottom: 16px;
}

/* macOS Window Frame for Demo */
.macos-window {
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg);
    box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

[data-theme="dark"] .macos-window {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 35px 80px -15px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.macos-titlebar {
    height: 42px;
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
}

.macos-traffic-lights {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 60px;
}

.macos-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.15);
}

.macos-dot.close {
    background: #ff5f57;
}

.macos-dot.minimize {
    background: #febc2e;
}

.macos-dot.zoom {
    background: #28c840;
}

.macos-url-bar {
    flex: 1;
    display: flex;
    justify-content: center;
}

.macos-url-pill {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 16px;
    font-size: 12px;
    color: var(--dim);
    font-family: var(--font);
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    max-width: 320px;
    justify-content: center;
    font-weight: 500;
}

.macos-url-pill svg {
    opacity: 0.65;
}

.macos-content {
    height: 750px;
    background: var(--bg);
    overflow: hidden;
}

.macos-content iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

h1 {
    font-size: 60px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 24px;
    color: var(--fg);
}

.lead {
    font-size: 18px;
    color: var(--dim);
    line-height: 1.65;
    margin-bottom: 40px;
}

.hero-cta {
    display: flex;
    justify-content: center;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px 100px;
}

.card {
    padding: 32px;
    background: var(--surface);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.card-icon {
    font-size: 14px;
    font-weight: 600;
    color: var(--green);
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 24px;
}

.card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}

.card p {
    font-size: 14px;
    color: var(--dim);
    line-height: 1.6;
}

.guide-section {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px 120px;
}

.guide-section h2 {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 48px;
}

.guide-section .tag {
    margin-bottom: 16px;
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 48px;
}

.step {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
}

.step-num {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--green);
    color: var(--bg);
    font-size: 16px;
    font-weight: 700;
    border: 2px solid var(--green);
}

.step-body h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.step-body p {
    font-size: 15px;
    color: var(--dim);
    line-height: 1.6;
}

.code-preview {
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    overflow: hidden;
}

.code-preview-head {
    padding: 12px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
    color: var(--fg);
}

.code-preview pre {
    padding: 24px;
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    overflow-x: auto;
    background: var(--surface);
}

.content {
    max-width: 1120px;
    margin: 0 auto;
    padding: 100px 24px 60px;
}

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

.content-header h2 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.sub {
    font-size: 15px;
    color: var(--dim);
    margin-top: 6px;
}

.dash-content {
    max-width: 1200px !important;
    margin: 0 auto;
    padding: 128px 24px 80px;
}


.dash-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 32px;
}

.dash-hero-left h1 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
}

.dash-hero-right {
    display: flex;
    gap: 16px;
}

.dash-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 32px;
    align-items: start;
    width: 100%;
    box-sizing: border-box;
}

.dash-main {
    min-width: 0;
    width: 100%;
}

.dash-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
    width: 100%;
}

.side-card {
    background: var(--surface);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 4px 18px -2px rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
    width: 100%;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.side-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.side-card h3 {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fg);
    margin: 0 0 10px 0;
}

.side-card p {
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--dim);
    margin: 0;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 24px;
}

.proj-card {
    background: var(--surface);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    min-height: 220px;
    box-sizing: border-box;
    box-shadow: 0 4px 18px -2px rgba(0, 0, 0, 0.04), 0 2px 6px -1px rgba(0, 0, 0, 0.02);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.proj-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -4px rgba(0, 0, 0, 0.08);
}

.proj-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.proj-card-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--fg);
    margin: 0;
}

.proj-card-id {
    font-size: 11.5px;
    color: var(--dim);
    font-family: 'JetBrains Mono', monospace;
    display: inline-block;
    margin-top: 4px;
    background: rgba(0, 0, 0, 0.03);
    padding: 2px 7px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

[data-theme="dark"] .proj-card-id {
    background: rgba(255, 255, 255, 0.04);
}

.status-badge {
    font-size: 11px;
    font-weight: 700;
    color: #16a34a;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}

[data-theme="dark"] .status-badge {
    color: #4ade80;
    background: none !important;
    border: none !important;
}

.status-badge::before {
    display: none !important;
}

.proj-card-desc {
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--dim);
    margin: 0 0 20px 0;
    flex-grow: 1;
}

.proj-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
    margin-top: auto;
    flex-wrap: wrap;
}

.proj-card-btns {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.btn-proj-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 15px !important;
    border-radius: 9999px;
    font-size: 11.5px !important;
    font-weight: 700;
    letter-spacing: 0.03em;
    white-space: nowrap !important;
    text-decoration: none;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-proj-action.btn-fill {
    background: #111827;
    color: #ffffff;
    border: 1px solid transparent;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.btn-proj-action.btn-fill:hover {
    background: #000000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}

[data-theme="dark"] .btn-proj-action.btn-fill {
    background: #ffffff;
    color: #000000;
}

[data-theme="dark"] .btn-proj-action.btn-fill:hover {
    background: #f1f5f9;
}

.btn-proj-action.btn-ghost {
    background: rgba(255, 255, 255, 0.85);
    color: var(--fg);
    border: 1px solid var(--border);
}

.btn-proj-action.btn-ghost:hover {
    background: #ffffff;
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

[data-theme="dark"] .btn-proj-action.btn-ghost {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
    color: #f8fafc;
}

[data-theme="dark"] .btn-proj-action.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-proj-action svg {
    flex-shrink: 0;
}

.proj-card-tools {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.btn-tool {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--dim);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.btn-tool:hover {
    color: var(--fg);
    background: rgba(0, 0, 0, 0.05);
    border-color: var(--border);
}

[data-theme="dark"] .btn-tool:hover {
    background: rgba(255, 255, 255, 0.06);
}

.btn-tool.text-red:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
}

.empty-state {
    text-align: center;
    padding: 64px 32px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-card);
    background: var(--surface);
}

.empty-icon {
    font-size: 40px;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 10px 0;
}

.empty-state p {
    font-size: 14px;
    color: var(--dim);
    margin: 0 0 24px 0;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.username-label {
    font-size: 12.5px;
    font-weight: 700;
    color: #111827;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

[data-theme="dark"] .username-label {
    color: #f8fafc;
}

.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(229, 231, 235, 0.9);
    object-fit: cover;
}

[data-theme="dark"] .avatar {
    border-color: rgba(255, 255, 255, 0.15);
}


.overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 2500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-y: auto;
}

.overlay.active {
    display: flex;
}

.dialog {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(28px) saturate(190%);
    -webkit-backdrop-filter: blur(28px) saturate(190%);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 28px 32px;
    margin: auto;
    box-sizing: border-box;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
    animation: slideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .dialog {
    background: rgba(14, 18, 28, 0.9);
    backdrop-filter: blur(28px) saturate(190%);
    -webkit-backdrop-filter: blur(28px) saturate(190%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

#dlg-script, #dlg-guide {
    max-width: 660px;
}

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

.dialog-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 16px;
}

.dialog-title-group {
    flex: 1;
}

.dialog-title-group h3, .dialog-head h3 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin: 0 0 4px 0;
    color: var(--fg);
}

.dialog-sub {
    font-size: 13.5px;
    color: var(--dim);
    margin: 0;
    line-height: 1.45;
}

.close-dlg {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--dim);
    line-height: 1;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}

.close-dlg:hover {
    color: var(--fg);
    background: var(--hover);
}

.dialog-desc {
    font-size: 14px;
    color: var(--dim);
    margin-bottom: 20px;
    line-height: 1.6;
}

.field {
    margin-bottom: 20px;
}

.field label {
    display: block;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--fg);
    margin-bottom: 8px;
}

.field input {
    width: 100%;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    color: var(--fg);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus {
    outline: none;
    border-color: var(--primary-cobalt);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1);
}

/* Modern Clean White Code Box */
.code-box {
    background: #ffffff !important;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 18px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
}

.code-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: #f1f5f9 !important;
    border-bottom: 1px solid #e2e8f0;
}

.code-box-title {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #475569 !important;
    font-family: 'JetBrains Mono', monospace;
}

.code-box .copy-btn {
    background: #0f172a !important;
    color: #ffffff !important;
    border: 1px solid #0f172a;
    font-weight: 600;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
    transition: all 0.15s ease;
}

.code-box .copy-btn:hover {
    background: #1e293b !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
}

.code-pre {
    margin: 0;
    padding: 18px 20px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 13px;
    line-height: 1.68;
    overflow-x: auto;
    white-space: pre;
    color: #0f172a !important;
    background: #ffffff !important;
    border: none;
    font-weight: 500;
}

.modal-sec-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(245, 158, 11, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(245, 158, 11, 0.28);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--fg);
    font-size: 12.5px;
    line-height: 1.5;
}

.sec-notice-icon {
    flex-shrink: 0;
    color: #f59e0b;
    margin-top: 1px;
}

.sec-notice-content strong {
    color: #f59e0b;
    font-weight: 700;
    margin-right: 4px;
}

.sec-notice-content span {
    color: var(--dim);
}

/* Compact Setup Guide Steps */
.steps-compact {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.step-compact {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 14px 18px;
    background: var(--surface);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.step-compact:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
    background: var(--surface-elevated);
}

.step-compact .step-num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--green, #10b981);
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.step-compact .step-body h4 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 3px 0;
    color: var(--fg);
}

.step-compact .step-body p {
    font-size: 13px;
    color: var(--dim);
    line-height: 1.45;
    margin: 0;
}

.code-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: var(--radius-card);
    position: relative;
}

pre {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 13px;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre;
    margin-bottom: 12px;
    color: var(--fg);
}

#toasts {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    padding: 12px 24px;
    background: var(--surface);
    color: var(--fg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.err {
    background: var(--red);
    color: var(--bg);
    border-color: var(--red);
}

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

@keyframes globeFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes globeFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

.pub-bar {
    border-bottom: 1px solid var(--border);
}

.pub-content {
    max-width: 1120px;
    margin: 0 auto;
    padding: 108px 24px 80px;
}

body.in-iframe .top-bar,
body.in-iframe .pub-bar {
    display: none !important;
}

body.in-iframe .pub-content {
    padding: 20px 20px 20px !important;
}

body.in-iframe .pub-hero {
    padding: 16px 0 16px !important;
    margin-bottom: 20px !important;
}

body.in-iframe .pub-footer {
    margin-top: 14px !important;
    padding: 12px 0 8px !important;
}

.pub-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 16px 0 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 28px;
}

.pub-hero-left {
    max-width: 600px;
}

.pub-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.pub-badge:empty,
body.is-demo #stats-status {
    display: none !important;
}

.pub-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #16a34a;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    line-height: 1;
}

[data-theme="dark"] .pub-badge {
    color: #4ade80;
    background: none !important;
    border: none !important;
}

.pub-badge::before {
    display: none !important;
}

.pub-badge.inactive {
    color: #ef4444;
    background: none !important;
    border: none !important;
}

.pub-badge.inactive::before {
    display: none !important;
}

.pub-created {
    font-size: 13px;
    color: var(--dim);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}

.pub-created::before {
    content: '•';
    margin: 0 8px 0 2px;
    opacity: 0.45;
}

.pub-title {
    font-size: 44px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 12px;
}

.pub-desc {
    font-size: 16px;
    color: var(--dim);
    line-height: 1.6;
    margin-bottom: 12px;
}

.pub-creator {
    font-size: 13px;
    color: var(--dim);
    font-weight: 600;
}

.pub-creator span {
    color: var(--fg);
    font-weight: 800;
}

.pub-hero-right {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.pub-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--fg);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.15s, background-color 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.pub-action-btn:hover {
    background: var(--bg);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.pub-action-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pub-action-btn.ghost {
    background: var(--surface);
    color: var(--fg);
}

.bento {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    overflow: visible;
    margin-bottom: 48px;
}

.bento-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    text-align: left;
    gap: 8px;
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    transition: border-color 0.15s, background-color 0.15s;
}

.bento-card:hover {
    border-color: var(--dim);
}

.bento-card.hero-card {
    grid-column: span 2;
    padding: 36px;
}

.bento-card.hero-card .bento-num {
    font-size: 52px;
}

.bento-num {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.bento-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.panel {
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    overflow: hidden;
    margin-bottom: 24px;
    background: var(--surface);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.04);
}

.panel.full {
    width: 100%;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 24px 24px 0;
}

.panel-head h3 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.panel-sub {
    font-size: 12px;
    color: var(--dim);
    font-weight: 600;
    margin-top: 4px;
}

.panel-body {
    padding: 24px;
    overflow-x: auto;
    max-width: 100%;
    min-height: 160px;
}

.panel-body svg {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

.panel-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.panel-row .panel {
    margin-bottom: 0;
}

.pub-footer {
    text-align: center;
    padding: 16px 0 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dim);
    border-top: 1px solid var(--border);
    margin-top: 20px;
}

.milestone-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ms-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ms-title {
    font-size: 15px;
    color: var(--dim);
}

.ms-title strong {
    color: var(--fg);
    font-weight: 700;
}

.ms-pct {
    font-size: 18px;
    font-weight: 700;
    color: var(--fg);
}

.ms-track {
    width: 100%;
    height: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 100px;
    overflow: hidden;
}

.ms-fill {
    height: 100%;
    background: var(--green);
    border-radius: 100px;
    transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.ms-footer {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 800;
    color: var(--dim);
    font-variant-numeric: tabular-nums;
}

.chart-section {
    margin-bottom: 24px;
}

.chart-section.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.chart-section.three-col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.chart-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 24px;
    background: var(--surface);
}

.chart-card.full {
    width: 100%;
}

.chart-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 24px;
}

.chart-head h3 {
    font-size: 16px;
    font-weight: 700;
}

.chart-sub {
    font-size: 12px;
    color: var(--dim);
    font-weight: 600;
}

.chart-body {
    overflow-x: auto;
    max-width: 100%;
    min-height: 200px;
}

.chart-body svg {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

#heatmap {
    display: flex;
    justify-content: center;
}

#heatmap svg {
    max-width: 720px;
}

.hm-tip {
    position: fixed;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    line-height: 1.5;
    color: var(--fg);
    pointer-events: none;
    z-index: 2000;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.1s, transform 0.1s;
    transform: translateY(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.hm-tip.on {
    opacity: 1;
    transform: translateY(0);
}

.hm-tip strong {
    color: var(--primary-teal);
    font-size: 15px;
}

.ev-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

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

.ev-label {
    font-size: 14px;
    font-weight: 600;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ev-bar-wrap {
    flex: 2;
    height: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 100px;
    overflow: hidden;
}

.ev-bar {
    height: 100%;
    border-radius: 100px;
    background: var(--green);
    transition: width 0.4s ease;
}

.ev-count {
    font-size: 13px;
    color: var(--fg);
    font-weight: 600;
    min-width: 50px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.no-data {
    text-align: center;
    color: var(--dim);
    font-size: 14px;
    padding: 48px 0;
}

.map-wrap {
    position: relative;
    background: transparent;
    border-radius: var(--radius-card);
    padding: 0;
    max-width: 100%;
}

.globe-stage {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .globe-stage {
    box-shadow: 0 20px 50px -15px rgba(0, 0, 0, 0.6);
}

.globe-ambient-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, rgba(14, 165, 233, 0.03) 45%, transparent 70%);
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.globe-stage.is-flat .globe-ambient-glow {
    opacity: 0;
}

canvas#globe-canvas {
    display: block;
    cursor: grab;
    outline: none;
    max-width: 100%;
    border-radius: 14px;
}

.globe-hint-pill {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 600;
    color: var(--dim);
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 4px 12px;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Floating Zoom & Reset Map Controls */
.map-controls-floating {
    position: absolute;
    right: 14px;
    bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 10;
}

.map-control-btn {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    color: var(--fg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.15s ease;
}

.map-control-btn:hover {
    background: var(--fg);
    color: var(--bg);
    transform: scale(1.05);
}

/* Centered Projection Toggle in Panel Header */
#panel-globe .panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.panel-head-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.map-projection-toggle-btn {
    padding: 6px 16px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--surface-elevated);
    color: var(--fg);
    transition: all 0.2s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    font-family: var(--font);
}

.map-projection-toggle-btn:hover {
    background: var(--surface);
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.map-fs-btn {
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--fg);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--font);
}

.map-fs-btn:hover {
    background: var(--surface-elevated);
    border-color: var(--border-hover);
}

@media (max-width: 640px) {
    .panel-head-center {
        position: static;
        transform: none;
    }
    #panel-globe .panel-head {
        flex-wrap: wrap;
        gap: 12px;
    }
}

.map-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    font-size: 11px;
    color: var(--dim);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.map-swatch {
    width: 14px;
    height: 10px;
    border-radius: 2px;
}

.map-countries {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.map-cc {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--fg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    cursor: pointer;
    transition: all 0.15s ease;
}

.map-cc:hover {
    border-color: var(--green);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.12);
}

.map-cc-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.map-cc-count {
    color: var(--dim);
    font-weight: 700;
    margin-left: 6px;
    font-variant-numeric: tabular-nums;
}

.loyalty-stats {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.loyalty-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.loyalty-label {
    font-size: 13px;
    color: var(--fg);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.loyalty-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid var(--border);
}

.loyalty-val {
    font-size: 14px;
    font-weight: 600;
}

.map-controls {
    position: absolute;
    top: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
}

.map-controls button {
    width: 40px;
    height: 40px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--fg);
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, box-shadow 0.15s, background-color 0.15s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.map-controls button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    background: #fafafa;
}

.map-controls button:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

@media (max-width: 1060px) {
    .dash-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .dash-sidebar {
        max-width: 100%;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 40px;
    }

    .grid-3 {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 80px 24px 48px;
    }

    .dash-layout {
        grid-template-columns: 1fr;
    }

    .dash-hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .proj-card-actions {
        flex-wrap: wrap;
    }

    .pub-hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 28px;
        padding: 48px 0;
    }

    .pub-title {
        font-size: 32px;
    }

    .pub-content {
        padding: 0 16px 60px;
    }

    .bento {
        grid-template-columns: repeat(2, 1fr);
    }

    .bento-card.hero-card {
        grid-column: span 2;
    }

    .bento-card.hero-card .bento-num {
        font-size: 40px;
    }

    .bento-num {
        font-size: 26px;
    }

    .bento-card {
        padding: 24px;
    }

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

    .chart-section.two-col,
    .chart-section.three-col {
        grid-template-columns: 1fr;
    }

    .bar-inner {
        padding: 0 16px;
    }

    .content {
        padding: 32px 16px;
    }

    .chart-card {
        padding: 20px;
    }

    .chart-head {
        flex-direction: column;
        gap: 8px;
    }

    .wordmark {
        font-size: 18px;
    }

    .panel-body {
        padding: 20px;
    }

    .panel-head {
        padding: 20px 20px 0;
    }
}

@media (max-width: 480px) {
    .bento {
        grid-template-columns: 1fr;
    }

    .bento-card.hero-card {
        grid-column: span 1;
    }
}

.report-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -45%);
    width: 90%;
    max-width: 800px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s;
    overflow: hidden;
}

.report-modal.active {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%);
}

.report-header {
    padding: 32px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.report-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.close-report {
    background: none;
    border: none;
    color: var(--fg);
    font-size: 32px;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
    font-weight: 600;
}

.close-report:hover {
    color: var(--dim);
}

.report-body {
    padding: 40px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

.slide-content {
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideIn {
    from {
        transform: translateX(24px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.report-footer {
    padding: 24px 40px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.carousel-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slide-indicator {
    display: flex;
    gap: 10px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.dot.active {
    background: var(--primary-teal);
    transform: scale(1.3);
}

.slide-text {
    margin-top: 32px;
    font-size: 16px;
    line-height: 1.7;
    color: var(--fg);
    background: var(--surface);
    padding: 28px;
    border-radius: var(--radius-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.report-metrics-large {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.report-modal.hidden {
    display: none;
}

.report-modal:not(.hidden) {
    display: flex;
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px;
    background: var(--surface);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.stat-num {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 2999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.drawer-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 600px) {
    .report-modal {
        width: 100%;
        height: 100%;
        border-radius: 0;
        top: 0;
        left: 0;
        transform: none;
        max-height: 100vh;
        display: flex;
        flex-direction: column;
    }

    .report-modal.active {
        transform: none;
    }

    .report-body {
        padding: 24px;
        flex: 1;
    }

    .report-header {
        padding: 24px;
    }

    .report-footer {
        padding: 20px;
    }

    .report-metrics-large {
        grid-template-columns: 1fr;
    }

    .slide-text {
        padding: 20px;
        font-size: 15px;
        margin-top: 24px;
    }

    #slide-chart {
        height: 180px !important;
    }
}

.slide-content>* {
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.slide-content>*:nth-child(2) {
    animation-delay: 0.1s;
}

.slide-content>*:nth-child(3) {
    animation-delay: 0.2s;
}

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

.anim-line {
    stroke-dasharray: 1800;
    stroke-dashoffset: 1800;
    animation: drawLine 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Activity Chart Enhancements */
.chart-wrap {
    position: relative;
    width: 100%;
}

.chart-wrap svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.chart-panel-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chart-stat-chip {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 4px 10px;
    background: var(--bg-hover, rgba(0, 0, 0, 0.03));
    border: 1px solid var(--border);
    border-radius: 9999px;
    font-size: 11px;
    color: var(--dim);
}

.chart-stat-chip strong {
    color: var(--fg);
    font-weight: 700;
}

.chart-range-picker {
    display: inline-flex;
    background: var(--bg-hover, rgba(0, 0, 0, 0.04));
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}

.chart-range-btn {
    border: none;
    background: transparent;
    color: var(--dim);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

.chart-range-btn:hover {
    color: var(--fg);
}

.chart-range-btn.active {
    background: var(--surface, #ffffff);
    color: var(--fg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Activity Chart Enhancements - Stock Tooltip & Hover */
.chart-tooltip-floating {
    position: absolute;
    pointer-events: none;
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 9px;
    padding: 8px 12px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(16, 185, 129, 0.25);
    color: #ffffff;
    font-family: Inter, -apple-system, sans-serif;
    transform: translate(-50%, -100%);
    margin-top: -12px;
    opacity: 0;
    transition: opacity 0.12s ease;
    white-space: nowrap;
    z-index: 25;
}

.chart-tooltip-floating.visible {
    opacity: 1;
}

.chart-tooltip-simple {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chart-tooltip-simple .chart-tooltip-date {
    font-size: 11px;
    font-weight: 500;
    color: #94a3b8;
}

.chart-tooltip-simple .chart-tooltip-val {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.chart-tooltip-simple .chart-tooltip-unit {
    font-size: 11.5px;
    font-weight: 500;
    color: #94a3b8;
}

.stock-tag {
    font-size: 9px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 9999px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.stock-tag.peak {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.stock-tag.low {
    background: rgba(148, 163, 184, 0.18);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.chart-tooltip-delta {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    line-height: 1.2;
}

.chart-tooltip-delta.positive {
    background: rgba(16, 185, 129, 0.22);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.chart-tooltip-delta.negative {
    background: rgba(239, 68, 68, 0.22);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.chart-tooltip-delta.neutral {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.stock-pulse-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: stockPulse 1.5s infinite;
}

@keyframes stockPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.anim-bar {
    transform-origin: bottom;
    animation: growBar 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes growBar {
    from {
        transform: scaleY(0);
    }
    to {
        transform: scaleY(1);
    }
}

.anim-donut {
    transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 768px) {
    .container {
        padding: 24px 16px;
    }

    .dash-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
    }

    .dash-header div:last-child {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .dash-header button {
        width: 100%;
        justify-content: center;
    }

    .project-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
        padding: 24px;
    }

    .proj-right {
        width: 100%;
        flex-wrap: wrap;
        gap: 10px;
    }

    .proj-right button {
        flex: 1;
        min-width: 80px;
        font-size: 13px;
        padding: 10px 16px;
    }
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.15s, background-color 0.15s;
}

.project-card:hover {
    border-color: var(--dim);
}

.project-title-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.project-title-row h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: var(--fg);
}


.project-id {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--dim);
    margin: 0;
}

.project-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.action-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 6px;
}

.btn-icon:hover {
    background: #fafafa;
    color: var(--fg);
}

.btn-icon.text-red:hover {
    color: var(--red);
    background: #fee2e2;
    border-color: var(--red);
}

.empty-state {
    padding: 80px 40px;
    text-align: center;
    background: var(--surface);
    border: 2px dashed var(--border);
    border-radius: var(--radius-card);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-state h3 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

.empty-state p {
    color: var(--dim);
    max-width: 340px;
    margin: 0 0 20px 0;
    line-height: 1.6;
}

@media (max-width: 900px) {
    .project-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 28px;
    }

    .project-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, 1fr) auto auto;
        gap: 12px;
    }

    .project-actions .btn-sm {
        justify-content: center;
        font-size: 12px;
    }

    .action-divider {
        display: none;
    }
}

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

    .project-actions .btn-icon {
        grid-row: 1;
        justify-self: end;
    }
}

.warning-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1001;
    background: rgba(254, 243, 199, 0.88);
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    color: #92400e;
    border-bottom: 1px solid rgba(253, 230, 138, 0.85);
    padding: 4px 14px;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.3;
    box-sizing: border-box;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .warning-banner {
    background: rgba(36, 24, 4, 0.85);
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    border-bottom-color: rgba(69, 48, 3, 0.9);
    color: #fbbf24;
}

.warning-banner-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.warning-banner-inner strong {
    font-weight: 800;
    color: #b45309;
    letter-spacing: 0.04em;
    margin-right: 6px;
}

[data-theme="dark"] .warning-banner-inner strong {
    color: #f59e0b;
}


.warning-card {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-card);
    padding: 22px 24px;
    box-sizing: border-box;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.warning-card:hover {
    border-color: rgba(239, 68, 68, 0.35);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.warning-card h3 {
    color: var(--red) !important;
    font-size: 11.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.warning-card p {
    color: var(--dim) !important;
    font-size: 13px;
    line-height: 1.6;
    margin: 0;
}