:root {
    --bg-primary: #09090b;
    --bg-secondary: #111113;
    --bg-card: #18181b;
    --bg-card-hover: #1f1f23;
    --bg-elevated: #27272a;
    --accent: #1cc5b0;
    --accent-dim: rgba(28, 197, 176, 0.12);
    --accent-hover: #2ee0c8;
    --accent-glow: rgba(28, 197, 176, 0.25);
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #52525b;
    --border: #27272a;
    --border-subtle: #1e1e22;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #1cc5b0;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; }

/* ─── Layout ─── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ─── Navigation ─── */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: transparent;
    padding: 0 24px;
    transition: all 0.3s;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.navbar.scrolled {
    background: rgba(9, 9, 11, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-subtle);
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
    transition: height 0.3s;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.logo img {
    height: 32px;
    width: auto;
    display: block;
    max-width: 160px;
}

.nav-links {
    display: flex;
    gap: 40px;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
    letter-spacing: -0.01em;
}
.nav-links a:hover { color: var(--text-primary); }

.nav-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 12px;
    margin-right: -12px;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}
.mobile-menu-btn span {
    width: 22px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: 0.2s;
}

/* Menu overlay */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 40;
    opacity: 0;
    transition: opacity 0.3s;
}
.nav-overlay.active {
    display: block;
    opacity: 1;
}

.nav-mobile-cta { display: none; }

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: var(--font);
    white-space: normal;
    text-align: center;
    line-height: 1.4;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-primary);
}
.btn-primary:hover {
    background: var(--accent-hover);
    color: var(--bg-primary);
    transform: translateY(-1px);
    box-shadow: 0 8px 32px var(--accent-glow);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    border-color: var(--text-muted);
    background: var(--bg-card);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
}
.btn-ghost:hover {
    color: var(--text-primary);
}

.btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.25);
}
.btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 0.95rem; }

/* ─── Hero ─── */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: 72px;
}

.hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

#hero-map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hero-map-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 70% at 50% 40%, rgba(10, 10, 10, 0.55), rgba(10, 10, 10, 0.92));
    pointer-events: none;
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(28, 197, 176, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(28, 197, 176, 0.03) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black, transparent);
}

.hero-glow {
    position: absolute;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: min(800px, 100vw);
    height: 600px;
    background: radial-gradient(ellipse, var(--accent-dim), transparent 70%);
    filter: blur(80px);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: var(--accent-dim);
    border: 1px solid rgba(28, 197, 176, 0.2);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 32px;
}

.badge-dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s ease infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.hero h1 {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -2.5px;
    margin-bottom: 24px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent), #00e5ff, var(--accent));
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 4s ease infinite;
}

@keyframes shimmer {
    0% { background-position: 0% center; }
    50% { background-position: 100% center; }
    100% { background-position: 0% center; }
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Hero code block */
.hero-code {
    margin-top: 56px;
    text-align: left;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.code-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.code-dots {
    display: flex;
    gap: 6px;
}
.code-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bg-elevated);
}

.code-filename {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.hero-code pre,
.api-response pre {
    padding: 20px;
    overflow-x: auto;
    margin: 0;
    -webkit-overflow-scrolling: touch;
}

.hero-code pre::-webkit-scrollbar,
.api-response pre::-webkit-scrollbar {
    height: 6px;
}

.hero-code pre::-webkit-scrollbar-thumb,
.api-response pre::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.hero-code code,
.api-response code {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.kw { color: #c792ea; }
.fn { color: #82aaff; }
.str { color: var(--accent); }
.num { color: #f78c6c; }
.cmt { color: var(--text-muted); font-style: italic; }

/* ─── Metrics Bar ─── */
.metrics-bar {
    padding: 48px 0;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-secondary);
}

.metrics-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 48px;
}

.metric { text-align: center; }

.metric-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--text-primary);
}

.metric-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-divider {
    width: 1px;
    height: 40px;
    background: var(--border);
}

/* ─── Section Headers ─── */
.section-header {
    margin-bottom: 64px;
    max-width: 540px;
}

.section-header.center {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.section-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 2.75rem;
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1.15;
    margin-bottom: 16px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.7;
}

/* ─── Platform Grid ─── */
.platform {
    padding: 120px 0;
}

.platform-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.platform-card {
    background: var(--bg-primary);
    padding: 40px;
    transition: background 0.3s;
}

.platform-card:hover {
    background: var(--bg-card);
}

.card-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-dim);
    border-radius: var(--radius-sm);
    color: var(--accent);
    margin-bottom: 20px;
}

.platform-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.platform-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
}

/* ─── API Showcase ─── */
.api-showcase {
    padding: 120px 0;
    background: var(--bg-secondary);
}

.api-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    width: fit-content;
    margin-bottom: 32px;
}

.api-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.2s;
}

.api-tab:hover { color: var(--text-primary); }

.api-tab.active {
    background: var(--bg-elevated);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.api-panel {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.api-panel.active { display: grid; }

.api-info {
    padding: 40px 0;
}

.api-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.api-info p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.7;
}

.api-endpoint {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow-x: auto;
}

.method {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.method.get { background: rgba(28, 197, 176, 0.15); color: var(--accent); }
.method.post { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }

.api-endpoint code {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.api-response {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

/* ─── Pricing ─── */
.pricing {
    padding: 120px 0;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    max-width: 1200px;
    margin: 0 auto;
}

.price-card {
    background: var(--bg-primary);
    padding: 48px 28px;
    position: relative;
    transition: background 0.3s;
    display: flex;
    flex-direction: column;
}

.price-card .btn {
    margin-top: auto;
    white-space: nowrap;
}

.price-card:hover {
    background: var(--bg-card);
}

.price-card.featured {
    background: var(--bg-card);
}

.price-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--accent-dim);
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.price-tier {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.price-amount {
    font-size: 3.5rem;
    font-weight: 900;
    letter-spacing: -2px;
    line-height: 1;
    margin-bottom: 4px;
}

.price-amount .currency {
    font-size: 1.5rem;
    font-weight: 600;
    vertical-align: top;
    position: relative;
    top: 8px;
    margin-right: 2px;
    color: var(--text-muted);
}

.price-amount .period {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0;
}

.price-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 32px;
    margin-top: 8px;
}

.price-features {
    list-style: none;
    margin-bottom: 32px;
    flex: 1;
}

.price-features li {
    padding: 7px 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.price-features li::before {
    content: '';
    width: 16px;
    height: 16px;
    background: var(--accent-dim);
    border-radius: 50%;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M2 5l2.5 2.5L8 3' stroke='%231cc5b0' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

/* ─── CTA ─── */
.cta {
    padding: 120px 0;
    background: var(--bg-secondary);
}

.cta-inner {
    text-align: center;
    max-width: 560px;
    margin: 0 auto;
}

.cta-inner h2 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1.5px;
    margin-bottom: 16px;
}

.cta-inner p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 32px;
}

/* ─── Footer ─── */
.footer {
    padding: 80px 0 40px;
    border-top: 1px solid var(--border-subtle);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 64px;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 16px;
    max-width: 260px;
    line-height: 1.6;
}

.footer-col h4 {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.footer-col a {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 4px 0;
    transition: color 0.2s;
}
.footer-col a:hover { color: var(--text-primary); }

.footer-bottom {
    padding-top: 32px;
    border-top: 1px solid var(--border-subtle);
    text-align: center;
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ════════════════════════════════════════════════
   DASHBOARD LAYOUT — Topbar / Sidebar / Body
   ════════════════════════════════════════════════ */

/* ─── Topbar ─── */
.dash-topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 200;
}

.dash-topbar .logo img { height: 26px; }

.dash-topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.dash-user-name {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ─── Hamburger ─── */
.dash-hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.dash-hamburger span {
    width: 20px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: 0.2s;
}

/* ─── Sidebar ─── */
.dash-sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: 240px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 16px 12px;
    z-index: 150;
}

.sidebar-nav { list-style: none; }

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.sidebar-nav li a:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.sidebar-nav li a.active {
    background: var(--bg-card);
    color: var(--text-primary);
    border-left-color: var(--accent);
}

.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 10px 14px;
}

.sidebar-logout { margin-top: auto; }

/* ─── Body / Main Content ─── */
.dash-body {
    margin-top: 56px;
    margin-left: 240px;
    padding: 24px 28px;
    min-height: calc(100vh - 56px);
}

/* ─── Map Preview ─── */
.map-container {
    position: relative;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    background: var(--bg-secondary);
}
.map-canvas {
    width: 100%;
    height: clamp(400px, 60vh, 700px);
}
.map-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px 3px 5px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 4px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Inter', -apple-system, sans-serif;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.2px;
    line-height: 1;
    z-index: 5;
    transition: background 0.2s;
}
.map-badge:hover {
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
}
.map-badge svg {
    color: #1cc5b0;
    flex-shrink: 0;
}
/* popup */
.tn-popup .maplibregl-popup-content {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 0.875rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.45);
    max-width: 240px;
}
.tn-popup .maplibregl-popup-content strong {
    color: var(--text-primary);
    font-weight: 700;
    display: block;
    margin-bottom: 4px;
}
.tn-popup .maplibregl-popup-content span {
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 500;
    text-transform: capitalize;
}
.tn-popup .maplibregl-popup-tip {
    border-top-color: var(--bg-card);
    border-bottom-color: var(--bg-card);
}
.tn-popup .maplibregl-popup-close-button {
    color: var(--text-muted);
    font-size: 18px;
    padding: 2px 6px;
}
.tn-popup .maplibregl-popup-close-button:hover { color: var(--text-primary); }
/* hover tooltip */
.tn-hover .maplibregl-popup-content {
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    white-space: nowrap;
}
.tn-hover .maplibregl-popup-tip {
    border-top-color: rgba(0, 0, 0, 0.75);
}

/* ─── Mobile overlay ─── */
.dash-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 140;
}

.dash-overlay.open { display: block; }

/* ─── Stats ─── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.stat-card .label {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.stat-card .value {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.stat-card .value.accent { color: var(--accent); }

/* ─── Usage bar ─── */
.usage-bar {
    background: var(--bg-secondary);
    border-radius: 20px;
    height: 10px;
    overflow: hidden;
    margin: 8px 0;
}

.usage-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #00f0c0);
    border-radius: 20px;
    transition: width 0.5s ease;
}

.usage-bar-fill.warning { background: linear-gradient(90deg, var(--warning), #ffcc00); }
.usage-bar-fill.danger { background: linear-gradient(90deg, var(--danger), #ff6688); }

/* ─── API Keys table ─── */
.keys-table {
    width: 100%;
    border-collapse: collapse;
}

.keys-table th {
    text-align: left;
    padding: 12px 16px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border);
}

.keys-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.key-value {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    background: var(--bg-secondary);
    padding: 4px 12px;
    border-radius: 6px;
    color: var(--accent);
}

.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-active { background: rgba(0, 212, 170, 0.15); color: var(--accent); }
.badge-inactive { background: rgba(255, 68, 102, 0.15); color: var(--danger); }

/* ─── Forms ─── */
.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font);
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(28, 197, 176, 0.15);
}

.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    max-width: 440px;
    margin: 0 auto;
}

/* ─── Modal ─── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    min-width: min(400px, 92vw);
    max-width: 92vw;
}

.modal h3 { margin-bottom: 20px; }

/* ─── Toast notifications ─── */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 300;
    animation: toastIn 0.3s ease;
}

@keyframes toastIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.toast-success { background: var(--accent); color: var(--bg-primary); }
.toast-error { background: var(--danger); color: white; }

/* ─── Touch Device Optimizations ─── */
@media (hover: none) and (pointer: coarse) {
    /* Improve touch targets */
    .btn, a { min-height: 44px; }
    
    /* Remove hover effects on touch devices */
    .platform-card:hover,
    .price-card:hover,
    .api-tab:hover {
        transform: none;
    }
    
    /* Improve scrolling */
    * {
        -webkit-overflow-scrolling: touch;
    }
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
    .platform-grid { grid-template-columns: repeat(2, 1fr); }
    .pricing-grid { grid-template-columns: 1fr; max-width: 480px; }
    .api-panel { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
    .platform, .api-showcase, .pricing, .cta { padding: 80px 0; }
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; letter-spacing: -1.5px; }
    .hero-subtitle { font-size: 1rem; }
    .section-header h2 { font-size: 1.875rem; }
    .section-header { margin-bottom: 40px; }
    .cta-inner h2 { font-size: 2rem; }

    .nav-links, .nav-actions { display: none; }
    .nav-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border);
        padding: 24px;
        gap: 20px;
        z-index: 50;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    .nav-links.open a {
        padding: 8px 0;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    .nav-links.open .nav-mobile-cta {
        display: flex;
        gap: 12px;
        padding-top: 12px;
        border-top: 1px solid var(--border-subtle);
        flex-wrap: wrap;
    }
    .nav-links.open .nav-mobile-cta .btn {
        flex: 1;
        justify-content: center;
        min-width: 120px;
    }
    .mobile-menu-btn { display: flex; }

    .platform-grid { grid-template-columns: 1fr; }
    .platform-card { padding: 28px 24px; }
    .metrics-grid { flex-direction: column; gap: 24px; }
    .metric-divider { width: 40px; height: 1px; }
    .platform, .api-showcase, .pricing, .cta { padding: 72px 0; }
    .footer { padding: 60px 0 32px; }

    .pricing-grid { max-width: 100%; }
    .price-card { padding: 36px 24px; }

    .api-tabs { 
        overflow-x: auto; 
        flex-wrap: nowrap; 
        padding-bottom: 0; 
        -webkit-overflow-scrolling: touch; 
        scrollbar-width: thin;
    }
    .api-tab { white-space: nowrap; flex-shrink: 0; }
    .api-endpoint { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .api-endpoint code { white-space: nowrap; }

    /* Tables responsive */
    table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
    
    .sidebar { display: none; }
    .dash-body { margin-left: 0; padding: 20px 16px; }
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }

    /* Dashboard mobile: show hamburger, hide logout btn, slide sidebar */
    .dash-hamburger { display: flex; }
    .dash-logout-btn { display: none; }

    .dash-sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }
    .dash-sidebar.open {
        transform: translateX(0);
    }

    .keys-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .form-card { padding: 28px 24px; }
    .hero-code { margin-top: 40px; }
    
    /* Better button wrapping on mobile */
    .btn { white-space: normal; text-align: center; }
}

/* ─── Tablet Portrait & Large Phones ─── */
@media (min-width: 481px) and (max-width: 768px) {
    .hero h1 { font-size: 2.8rem; }
    .hero-subtitle { font-size: 1.1rem; }
    .container { padding: 0 20px; }
    .platform-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .hero { padding-top: 100px; padding-bottom: 80px; }
}

@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .hero h1 { font-size: 2rem; letter-spacing: -1px; line-height: 1.1; }
    .hero-subtitle { font-size: 0.95rem; line-height: 1.6; }
    .section-header h2 { font-size: 1.625rem; }
    .cta-inner h2 { font-size: 1.75rem; line-height: 1.2; }
    .price-amount { font-size: 2.75rem; letter-spacing: -1.5px; }
    .form-card { padding: 24px 20px; }
    .hero-code pre, .api-response pre { padding: 16px; font-size: 0.75rem; }
    .hero-code code, .api-response code { font-size: 0.75rem; line-height: 1.6; }
    .logo img { max-width: 120px; }
    .navbar-inner { height: 60px; }
    .navbar { padding: 0 12px; }
    .nav-links.open { top: 60px; }
    .hero { padding-top: 60px; padding-bottom: 60px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
    .pricing-grid { grid-template-columns: 1fr !important; }
    
    /* Better spacing for form inputs */
    .form-input, .form-textarea { font-size: 16px; /* Prevents zoom on iOS */ }
    
    /* Better touch targets */
    .btn { min-height: 44px; padding: 12px 20px; }
    
    /* Hero glow smaller on very small screens */
    .hero-glow { width: min(600px, 100vw); height: 400px; }
    
    /* Better metric display */
    .metric h3 { font-size: 2rem; }
    .metric p { font-size: 0.875rem; }
}
