@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root { color-scheme: dark; --ink: #f3f1fa; --muted: #aaa6bc; --line: #ffffff12; --accent: #b6a0ff; }
* { box-sizing: border-box; }
.analytics-report-page { min-height: 100vh; margin: 0; color: var(--ink); background: radial-gradient(ellipse at 10% 0%, #32204c45, transparent 45%), #0b0c12; font-family: 'Manrope', system-ui, -apple-system, sans-serif; font-size: 14px; -webkit-font-smoothing: antialiased; }
.analytics-report { width: min(1280px, calc(100% - 80px)); margin: 0 auto; padding: 56px 0 72px; }
.analytics-gate { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at 50% 25%, #51318038, transparent 60%), #0b0c12; overflow-y: auto; }
[hidden] { display: none !important; }
.analytics-access { display: flex; flex-direction: column; align-items: stretch; gap: 16px; width: min(440px, 100%); padding: 40px; background: #14141de8; border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 24px 90px #0005; }
.analytics-brand { margin-bottom: 22px; color: white; text-decoration: none; font-size: 27px; font-weight: 800; letter-spacing: -.06em; }
.analytics-brand span { color: var(--accent); }
.analytics-access h1 { font-size: 30px; line-height: 1.2; margin: 0; letter-spacing: -.045em; }
.analytics-access p { margin: 0 0 10px; color: var(--muted); font-size: 13px; line-height: 1.8; }
input, select, button { font: inherit; }
.analytics-access input { width: 100%; height: 52px; padding: 0 16px; color: var(--ink); background: #0e0f17; border: 1px solid #ffffff20; border-radius: 12px; }
.analytics-access button, .analytics-report-toolbar button { min-height: 44px; padding: 0 20px; color: #171026; background: #b9a1ff; border: 1px solid transparent; border-radius: 10px; font-size: 13px; font-weight: 800; cursor: pointer; transition: background .15s, border-color .15s; }
.analytics-access button { min-height: 52px; }
.analytics-access button:hover, .analytics-report-toolbar button:hover { background: #ccbaff; }
.analytics-access button:disabled, .analytics-report-toolbar button:disabled { opacity: .55; cursor: wait; }
:where(input, select, button, a):focus-visible { outline: 2px solid #c8b5ff; outline-offset: 4px; }
.analytics-status { color: var(--muted); font-size: 12px; line-height: 1.6; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.analytics-report-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.analytics-eyebrow { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .15em; }
.analytics-report-head h1 { margin: 12px 0 8px; font-size: clamp(30px, 4vw, 44px); font-weight: 800; letter-spacing: -.055em; line-height: 1.15; }
.analytics-report-head p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.analytics-back-link { padding: 11px 16px; border: 1px solid var(--line); border-radius: 10px; color: #ccc6dc; text-decoration: none; white-space: nowrap; font-size: 12px; }
.analytics-back-link:hover { border-color: #b6a0ff60; color: white; }
.analytics-report-toolbar { display: flex; align-items: center; gap: 10px; padding: 16px 0; margin-bottom: 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.analytics-period-label { margin-right: 6px; color: var(--muted); font-size: 12px; }
.analytics-report-toolbar select { height: 44px; min-width: 156px; padding: 0 14px; color: var(--ink); background: #171822; border: 1px solid #ffffff18; border-radius: 10px; font-size: 13px; }
.analytics-report-toolbar .analytics-logout { color: var(--muted); background: transparent; border-color: var(--line); }
.analytics-report-toolbar .analytics-logout:hover { color: white; background: #ffffff08; }
.analytics-report-toolbar .analytics-status { margin-left: auto; }
.analytics-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.analytics-kpi { position: relative; padding: 24px; background: linear-gradient(135deg, #1b1b28, #15161f); border: 1px solid var(--line); border-radius: 16px; min-width: 0; }
.analytics-kpi:first-child { background: linear-gradient(135deg, #322547, #1c192a); border-color: #b6a0ff40; }
.analytics-kpi span { display: block; color: #b9b4c9; font-size: 12px; font-weight: 600; }
.analytics-kpi strong { display: block; margin-top: 14px; font-size: clamp(24px, 2.6vw, 34px); font-weight: 800; line-height: 1.25; letter-spacing: -.055em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.analytics-card { padding: 28px; margin-bottom: 20px; min-width: 0; background: #15161f; border: 1px solid var(--line); border-radius: 18px; }
.analytics-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.analytics-card-heading h2 { margin: 8px 0 0; font-size: 18px; font-weight: 700; letter-spacing: -.035em; }
.analytics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.analytics-card-wide { grid-column: 1 / -1; }
.analytics-table-wrap { overflow-x: auto; }
.analytics-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; line-height: 1.55; font-variant-numeric: tabular-nums; }
.analytics-table th { padding: 0 12px 14px; color: #9993ac; font-size: 10px; font-weight: 700; letter-spacing: .06em; }
.analytics-table td { padding: 15px 12px; color: #ded9eb; border-top: 1px solid var(--line); vertical-align: top; }
.analytics-table th:first-child, .analytics-table td:first-child { padding-left: 0; }
.analytics-table td:last-child, .analytics-table th:last-child { text-align: right; white-space: nowrap; padding-right: 0; }
.analytics-table tbody tr:hover { background: #ffffff03; }
.analytics-table small { display: block; margin-top: 4px; color: #9993ac; font-size: 11px; }
.analytics-table strong { font-weight: 600; }
.analytics-empty { padding: 32px 8px; color: var(--muted); font-size: 13px; }
.analytics-daily { display: flex; align-items: flex-end; gap: 8px; min-height: 190px; overflow-x: auto; padding: 12px 0 8px; background: repeating-linear-gradient(to top, transparent 0, transparent 47px, #ffffff05 47px, #ffffff05 48px); }
.analytics-day { display: flex; flex: 1 0 30px; flex-direction: column; align-items: center; gap: 8px; min-width: 40px; height: 180px; justify-content: flex-end; }
.analytics-day strong { color: #ddd6ef; font-size: 11px; font-weight: 600; }
.analytics-day i { width: min(100%, 24px); min-height: 3px; background: linear-gradient(180deg, #c7b1ff, #8862de); border-radius: 5px 5px 2px 2px; }
.analytics-day:hover i { background: #d6c5ff; }
.analytics-day small { color: #a59cb9; font-size: 10px; white-space: nowrap; }
.analytics-report-note { margin: 16px 0 28px; color: #9c96ac; font-size: 11px; line-height: 1.8; max-width: 1000px; }
@media (max-width: 1000px) { .analytics-report { width: calc(100% - 40px); } .analytics-kpi { padding: 20px; } .analytics-card { padding: 22px; } }
@media (max-width: 760px) { .analytics-report { width: calc(100% - 32px); padding-top: 28px; } .analytics-report-head { align-items: flex-start; flex-direction: column; gap: 20px; } .analytics-report-toolbar { flex-wrap: wrap; } .analytics-period-label { flex-basis: 100%; } .analytics-report-toolbar select { flex: 1; min-width: 120px; } .analytics-report-toolbar .analytics-status { flex-basis: 100%; margin: 4px 0 0; } .analytics-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } .analytics-kpi { padding: 18px; } .analytics-grid { grid-template-columns: 1fr; } .analytics-access { padding: 28px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.analytics-icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.analytics-icon { display: inline-block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.analytics-access button, .analytics-report-toolbar button, .analytics-back-link, .analytics-period-label { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.analytics-period-label { justify-content: flex-start; }
.analytics-gate-badge { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .15em; }
.analytics-gate-badge .analytics-icon { width: 15px; height: 15px; }
.analytics-kpi-icon { display: block; margin-bottom: 16px; color: var(--accent); width: 21px; height: 21px; }
.analytics-kpi:first-child .analytics-kpi-icon { color: #d5c7ff; }
.analytics-card-heading { justify-content: flex-start; align-items: center; gap: 14px; }
.analytics-section-icon { display: grid; place-items: center; width: 42px; height: 42px; background: #b6a0ff0c; border: 1px solid #b6a0ff18; border-radius: 12px; color: var(--accent); flex-shrink: 0; }
.analytics-section-icon .analytics-icon { width: 20px; height: 20px; }
.analytics-kpis { margin-bottom: 24px; }
.analytics-kpis:has(> .analytics-kpi:nth-child(5):last-child) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1000px) { .analytics-kpis:has(> .analytics-kpi:nth-child(5):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .analytics-kpis:has(> .analytics-kpi:nth-child(5):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.analytics-access { width: min(340px, 100%); padding: 28px; }
.analytics-gate-mark { display: grid; place-items: center; width: 42px; height: 42px; margin: 0 auto 8px; color: var(--accent); border: 1px solid #b6a0ff20; background: #b6a0ff08; border-radius: 14px; }
.analytics-selected-day { margin: 0 0 16px; color: #d4c4ff; font-size: 14px; font-weight: 700; }
.analytics-chart-hint { color: var(--muted); font-size: 11px; margin: -8px 0 16px; }
.analytics-daily { overflow: visible; gap: 2px; height: 200px; min-height: 200px; padding: 8px 0 0; }
.analytics-day { position: relative; flex: 1 1 0; min-width: 0; height: 188px; padding: 0 0 28px; gap: 6px; border: 0; border-radius: 4px; background: transparent; color: inherit; cursor: pointer; }
.analytics-day i { width: 90%; max-width: 24px; border-radius: 3px 3px 1px 1px; flex-shrink: 0; }
.analytics-day strong { display: none; }
.analytics-day.has-value strong { display: block; }
.analytics-day .analytics-day-label { display: none; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); font-size: 10px; }
.analytics-day.has-label .analytics-day-label { display: block; }
.analytics-day:first-child .analytics-day-label { left: 0; transform: none; }
.analytics-day:last-child .analytics-day-label { left: auto; right: 0; transform: none; }
.analytics-day:hover, .analytics-day[aria-pressed="true"] { background: #b6a0ff12; }
.analytics-day[aria-pressed="true"] i { background: #e3d8ff; box-shadow: 0 0 12px #b6a0ff35; }
.analytics-day:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.analytics-account-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 0;border-bottom:1px solid #25252a}.analytics-account-row strong{overflow-wrap:anywhere}.analytics-account-row p{margin:7px 0;overflow-wrap:anywhere}.analytics-account-row button{border:1px solid #38383e;background:#202024;color:#fff;border-radius:10px;padding:10px 15px;cursor:pointer}.analytics-account-row>div{min-width:0}#analytics-account-detail h3{margin-top:26px}@media(max-width:600px){.analytics-account-row{align-items:flex-start;flex-direction:column}}

/* Report tabs and social media panel */
.analytics-tabs { display: flex; gap: 6px; margin: 0 0 22px; padding: 4px; width: fit-content; max-width: 100%; background: #14141de8; border: 1px solid var(--line); border-radius: 12px; }
.analytics-tab { min-height: 38px; padding: 0 18px; color: var(--muted); background: transparent; border: 0; border-radius: 9px; font-size: 13px; font-weight: 700; cursor: pointer; }
.analytics-tab:hover { color: var(--ink); }
.analytics-tab[aria-selected="true"] { color: #171026; background: #b9a1ff; }
.analytics-day.is-static { cursor: default; }
.analytics-social-post { display: flex; flex-direction: column; gap: 3px; min-width: 220px; max-width: 420px; }
.analytics-social-post a { color: var(--ink); text-decoration: none; font-weight: 600; line-height: 1.4; }
.analytics-social-post a:hover { color: var(--accent); text-decoration: underline; }
.analytics-social-post small { color: var(--muted); font-size: 11px; }
#analytics-social .analytics-card + .analytics-card { margin-top: 18px; }
