:root {
    --ink: #122033;
    --ink-soft: #1c3348;
    --paper: #eef3f8;
    --cream: #f7fafc;
    --accent: #0c7c74;
    --accent-deep: #095e58;
    --accent-soft: #d9f3f0;
    --line: rgba(18, 32, 51, 0.12);
    --text: #173049;
    --muted: #5c6e80;
    --danger: #b42318;
    --ok: #0f7a4b;
    --shadow: 0 18px 50px rgba(18, 32, 51, 0.08);
    --radius: 22px;
    --font: "Outfit", sans-serif;
    --display: "Barlow Condensed", sans-serif;
    --sidebar: 248px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: light; }
body {
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background:
        radial-gradient(900px 420px at 8% -10%, rgba(12, 124, 116, 0.14), transparent 46%),
        radial-gradient(800px 480px at 100% 0%, rgba(18, 32, 51, 0.05), transparent 42%),
        linear-gradient(180deg, var(--cream) 0%, var(--paper) 55%, #e7eef5 100%);
    color: var(--text);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 380;
    line-height: 1.55;
}
body > main { flex: 1; }
.page-app { display: block; }
img { max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
.sr-only, .skip-link {
    position: absolute;
    left: -999px;
    top: 0;
}
.skip-link:focus {
    left: 16px;
    top: 16px;
    background: var(--ink);
    color: var(--cream);
    padding: 8px 12px;
    z-index: 30;
}
.wrap {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}
.site-header, .topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(16px);
    background: rgba(247, 250, 252, 0.86);
    border-bottom: 1px solid var(--line);
}
.header-inner, .footer-inner, .hero-grid {
    display: grid;
    gap: 24px;
}
.header-inner {
    grid-template-columns: 1fr auto;
    align-items: center;
    min-height: 76px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-family: var(--display);
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0;
    color: var(--ink);
}
.brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--ink);
    color: #7dfff4;
    flex: none;
}
.brand-tld { color: var(--accent); }
.site-nav {
    display: flex;
    align-items: center;
    gap: 18px;
}
.site-nav a, .side-nav a, .account-menu-panel a, .footer-links a {
    text-decoration: none;
}
.site-nav a {
    color: var(--ink-soft);
    font-weight: 460;
}
.nav-cta, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 999px;
    padding: 11px 18px;
    background: var(--ink);
    color: var(--cream);
    text-decoration: none;
    cursor: pointer;
    font-weight: 560;
}
.site-nav a.nav-cta { background: var(--ink); color: var(--cream); }
.site-nav a.nav-cta:hover { background: var(--ink-soft); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-deep); }
.btn-ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line);
}
.site-nav a.nav-ghost {
    background: none;
    border: 0;
    padding: 0;
    color: var(--ink-soft);
}
.nav-name, .account-name {
    color: var(--ink);
    font-weight: 560;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nav-toggle {
    display: none;
    border: 0;
    background: transparent;
    font-size: 22px;
    color: var(--ink);
    cursor: pointer;
}
.flash-stack { display: grid; gap: 10px; margin: 16px auto 0; }
.app-content .flash-stack { margin: 0 0 16px; }
.flash {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 14px;
    background: #e7f6ee;
    color: var(--ok);
}
.flash-error { background: #fde8e6; color: var(--danger); }
.hero { padding: 72px 0 48px; }
.hero-grid { grid-template-columns: 1.15fr 0.85fr; align-items: center; }
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-deep);
    font-weight: 560;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 11px;
    margin: 0 0 12px;
}
h1, h2, h3 {
    font-family: var(--display);
    letter-spacing: 0.01em;
    line-height: 0.98;
    margin: 0 0 12px;
    font-weight: 800;
}
h1 { font-size: clamp(46px, 7vw, 76px); }
h2 { font-size: clamp(28px, 4vw, 40px); }
h3 { font-size: 22px; }
.auth-shell h1 { font-size: clamp(36px, 5vw, 52px); }
.lede, .muted { color: var(--muted); }
.lede { font-size: 16px; max-width: 46ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero-card, .card, .panel {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}
.hero-card {
    animation: rise 0.7s ease both;
}
.spark {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 140px;
    margin: 22px 0 16px;
}
.spark span {
    flex: 1;
    height: var(--h);
    border-radius: 10px 10px 4px 4px;
    background: linear-gradient(180deg, #14b8a6, var(--accent));
    transform-origin: bottom;
    animation: grow 0.9s ease both;
}
.spark span:nth-child(2) { animation-delay: 0.05s; }
.spark span:nth-child(3) { animation-delay: 0.1s; }
.spark span:nth-child(4) { animation-delay: 0.15s; }
.spark span:nth-child(5) { animation-delay: 0.2s; }
.spark span:nth-child(6) { animation-delay: 0.25s; }
.spark span:nth-child(7) { animation-delay: 0.3s; }
@keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}
@keyframes grow {
    from { transform: scaleY(0.2); opacity: 0.4; }
    to { transform: none; opacity: 1; }
}
.section { padding: 28px 0 72px; }
.auth-shell {
    width: min(520px, calc(100% - 32px));
    margin: 48px auto 72px;
}
.form-grid { display: grid; gap: 14px; }
label, .field { font-weight: 460; display: grid; gap: 6px; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    border-radius: 14px;
    padding: 12px 14px;
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible, summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.help { font-size: 11px; color: var(--muted); font-weight: 380; }
input.is-locked { background: #e7eef3; color: #3e5163; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.key-box { display: flex; gap: 8px; align-items: flex-start; }
.key-box input, .key-box textarea { flex: 1; resize: vertical; }
.icon-btn {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-deep);
    cursor: pointer;
    flex: none;
}
.notice {
    padding: 12px 14px;
    border-radius: 14px;
    background: #fff4d6;
    color: #7a4d00;
    margin-bottom: 14px;
}
.empty {
    padding: 28px;
    text-align: center;
    color: var(--muted);
    border: 1px dashed var(--line);
    border-radius: 18px;
}
.site-footer {
    border-top: 1px solid var(--line);
    padding: 36px 0 48px;
    margin-top: 40px;
}
.footer-inner { grid-template-columns: 1.4fr 1fr; }
.footer-links { display: grid; gap: 8px; align-content: start; }
.footer-links a { color: var(--muted); }
.footer-copy, .geo-attribution { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.geo-attribution { margin: 0; }
.geo-attribution a { color: var(--accent-deep); }
.data-table-wrap { overflow: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}
.data-table th, .data-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.data-table th { font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar) 1fr;
    min-height: 100vh;
    background: var(--cream);
}
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 22px 16px;
    background: #fff;
    border-right: 1px solid var(--line);
}
.property-switch {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--cream);
}
.property-switch .eyebrow { margin-bottom: 6px; }
.property-switch-empty { margin: 0; color: var(--muted); font-weight: 460; }
.property-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.property-list a, .property-add {
    display: block;
    color: var(--ink-soft);
    text-decoration: none;
    font-weight: 560;
}
.property-list a.is-current { color: var(--accent-deep); }
.property-add { margin-top: 8px; color: var(--accent-deep); font-size: 13px; }
.side-nav { display: grid; gap: 6px; overflow: auto; min-height: 0; }
.side-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--ink-soft);
    font-weight: 460;
}
.side-nav a.is-active {
    background: var(--ink);
    color: var(--cream);
}
.app-main { min-width: 0; }
.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 72px;
    padding: 0 28px;
}
.topbar-title {
    margin: 0;
    font-family: var(--display);
    font-weight: 800;
    font-size: 22px;
    flex: 1;
}
.app-content { padding: 28px; }
.sidebar-backdrop { display: none; }
.account-menu { position: relative; }
.account-menu summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}
.account-menu summary::-webkit-details-marker { display: none; }
.account-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    color: var(--accent-deep);
    font-weight: 650;
}
.account-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    min-width: 190px;
    padding: 8px;
    box-shadow: var(--shadow);
    display: grid;
    z-index: 12;
}
.account-menu-panel a {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--ink);
}
.account-menu-panel a:hover { background: var(--paper); }

@media (max-width: 860px) {
    .hero-grid, .footer-inner { grid-template-columns: 1fr; }
    .nav-toggle { display: block; }
    .site-nav {
        display: none;
        position: absolute;
        inset: 76px 16px auto;
        background: var(--cream);
        border: 1px solid var(--line);
        border-radius: 18px;
        padding: 16px;
        flex-direction: column;
        align-items: flex-start;
    }
    .site-nav.is-open { display: flex; }
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        z-index: 25;
        width: min(var(--sidebar), calc(100% - 48px));
        transform: translateX(-105%);
        transition: transform 0.2s ease;
    }
    .sidebar.is-open { transform: none; }
    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(18, 32, 51, 0.28);
        z-index: 24;
    }
    .sidebar-backdrop[hidden] { display: none; }
    .topbar, .app-content { padding-left: 16px; padding-right: 16px; }
    .account-name { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .hero-card, .spark span { animation: none; }
}
.report-head, .chart-head, .report-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.report-head { margin-bottom: 18px; }
.report-toolbar { margin-bottom: 18px; align-items: center; }
.range-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.range-pills a, .compare-toggle {
    text-decoration: none;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 12px;
    color: var(--ink-soft);
    background: #fff;
}
.range-pills a.is-active, .compare-toggle.is-active {
    background: var(--ink);
    color: var(--cream);
    border-color: var(--ink);
}
.range-custom { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.range-custom label { font-size: 11px; color: var(--muted); }
.range-custom input { padding: 8px 10px; }
.metric-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}
.metric-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
}
.metric-card p { margin: 0; color: var(--muted); font-size: 12px; }
.metric-card strong {
    display: block;
    margin-top: 6px;
    font-family: var(--display);
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
}
.report-delta { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; }
.report-delta.is-up { color: var(--ok); }
.report-delta.is-down { color: var(--danger); }
.chart-block { margin-bottom: 22px; }
.report-chart { width: 100%; height: auto; display: block; }
.report-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.report-list h3 { margin-bottom: 10px; }
@media (max-width: 980px) {
    .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .report-columns { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.table-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 8px 0 12px; }
.table-tools form { display: flex; gap: 8px; align-items: center; }
.table-tools input[type="search"] { width: min(280px, 100%); padding: 8px 12px; }
.data-table th a { text-decoration: none; color: inherit; }
.pager { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.pager a { text-decoration: none; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line); }
.pager a.is-active { background: var(--ink); color: var(--cream); }
.sparkline { width: 80px; height: 24px; }
.country-map { width: 100%; max-width: 720px; height: auto; display: block; margin: 8px 0 12px; }
.report-panel h3 { margin-top: 22px; }
