:root {
  --navy: #071a36;
  --navy-2: #0d2b52;
  --blue: #2f73ff;
  --blue-soft: #e8f0ff;
  --ink: #132238;
  --muted: #6f7c8f;
  --paper: #f3f6fa;
  --panel: #ffffff;
  --line: #dfe6ef;
  --green: #16825d;
  --green-soft: #e6f5ef;
  --red: #c23e52;
  --shadow: 0 12px 32px rgba(7, 26, 54, .07);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
[hidden] { display: none !important; }
.auth-loading { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 10px; color: white; background: var(--navy); }
.auth-loading img { width: 58px; height: 58px; border-radius: 15px; box-shadow: 0 16px 36px rgba(0,0,0,.22); }
.auth-loading span { margin-top: 3px; font-size: 20px; font-weight: 800; }
.auth-loading p { margin: 0; color: #9fb2cc; font-size: 10px; }
.auth-loading-spinner { width: 22px; height: 22px; margin-top: 8px; border: 2px solid rgba(255,255,255,.2); border-top-color: white; border-radius: 50%; animation: auth-spin .75s linear infinite; }
@keyframes auth-spin { to { transform: rotate(360deg); } }
button, input, select { font: inherit; }
button { color: inherit; }
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 26px 18px 20px; display: flex; flex-direction: column; color: #fff; background: var(--navy); }
.brand { display: flex; align-items: center; gap: 11px; color: #fff; text-decoration: none; font-weight: 760; font-size: 20px; letter-spacing: -.02em; margin: 0 9px 36px; }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.sidebar nav { display: grid; gap: 5px; }
.nav-item { width: 100%; display: grid; grid-template-columns: 25px 1fr auto; align-items: center; gap: 10px; border: 0; background: transparent; border-radius: 10px; padding: 11px 12px; text-align: left; cursor: pointer; font-weight: 650; color: #9eb0c9; }
.nav-item svg, .mobile-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(255,255,255,.1); }
.nav-item b { min-width: 21px; padding: 2px 6px; text-align: center; border-radius: 999px; background: rgba(255,255,255,.1); font-size: 10px; }
.sidebar-plan { margin-top: auto; padding: 16px 12px; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; background: rgba(255,255,255,.05); }
.plan-badge { color: #85abff; font-size: 9px; font-weight: 850; letter-spacing: .14em; }
.sidebar-plan strong { display: block; margin: 9px 0 10px; font-size: 12px; }
.usage-track { height: 4px; border-radius: 4px; background: rgba(255,255,255,.12); overflow: hidden; }
.usage-track i { display: block; width: 0; height: 100%; background: var(--blue); transition: width .3s; }
.text-button { border: 0; padding: 12px 0 0; color: #b9caff; background: transparent; cursor: pointer; font-size: 11px; font-weight: 700; }
.settings-link { margin-top: 8px; }
main { min-width: 0; padding: 0 42px 58px; }
.topbar { min-height: 112px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 31px; line-height: 1.1; letter-spacing: -.035em; margin-bottom: 0; }
h2 { font-size: 21px; line-height: 1.2; letter-spacing: -.025em; margin-bottom: 0; }
h3 { font-size: 16px; }
.eyebrow { color: var(--blue); font-size: 9px; font-weight: 850; letter-spacing: .16em; margin-bottom: 7px; }
.top-actions, .button-row { display: flex; gap: 10px; align-items: center; }
.button, .icon-button { border: 1px solid var(--line); border-radius: 9px; background: var(--panel); min-height: 40px; padding: 0 15px; font-weight: 720; font-size: 12px; cursor: pointer; transition: .18s; }
.button:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.button.primary { background: var(--blue); border-color: var(--blue); color: white; }
.button.light { background: white; color: var(--navy); border-color: white; }
.button.compact { min-height: 34px; padding: 0 11px; }
.avatar { width: 38px; height: 38px; border: 0; border-radius: 50%; color: white; background: var(--navy); font-weight: 800; }
.profile-bar { display: flex; align-items: center; padding: 13px 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); box-shadow: 0 5px 18px rgba(7,26,54,.035); }
.site-avatar { display: grid; place-items: center; width: 39px; height: 39px; margin-right: 12px; border-radius: 10px; color: white; background: var(--navy-2); font-weight: 800; }
.profile-bar label, dialog label { display: grid; gap: 7px; font-size: 10px; color: var(--muted); font-weight: 700; }
.profile-bar select { border: 0; padding: 0; background: transparent; color: var(--ink); font-weight: 780; outline: none; }
.profile-domain { display: inline-block; font-size: 10px; color: var(--muted); margin-left: 7px; }
.icon-button { margin-left: auto; border: 0; min-height: 30px; padding: 0 8px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0; }
.stat { min-height: 112px; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
.stat-label { color: var(--muted); font-size: 10px; font-weight: 720; }
.stat-value { display: block; font-size: 29px; line-height: 1; letter-spacing: -.04em; margin: 18px 0 6px; }
.stat-note { font-size: 10px; color: var(--muted); }
.positive { color: var(--green); }
.negative { color: var(--red); }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 18px; min-width: 0; }
.content-grid > * { min-width: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 13px; padding: 21px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 20px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; padding: 10px 9px; border-bottom: 1px solid var(--line); }
td { padding: 14px 9px; border-bottom: 1px solid #edf1f5; font-size: 12px; }
tr:last-child td { border-bottom: 0; }
.keyword-name { display: block; font-weight: 760; max-width: 240px; }
.keyword-url { display: block; max-width: 220px; font-size: 9px; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.market { color: var(--muted); text-transform: uppercase; font-size: 10px; font-weight: 750; }
.rank { display: inline-grid; place-items: center; min-width: 31px; height: 31px; padding: 0 6px; border-radius: 8px; background: var(--blue-soft); color: #1553cf; font-weight: 820; }
.rank.missing { background: #edf0f4; color: var(--muted); }
.row-action { border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 17px; }
.status-pill { display: inline-block; border-radius: 999px; padding: 6px 9px; background: var(--blue-soft); color: #1553cf; font-size: 9px; font-weight: 750; }
.chart { height: 238px; display: flex; align-items: center; justify-content: center; }
.chart.large { height: 300px; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart-grid { stroke: #e8edf4; stroke-width: 1; }
.chart-line { fill: none; stroke: var(--blue); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { fill: url(#area); }
.chart-foot { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; border-top: 1px solid var(--line); padding-top: 10px; }
.panel-link { margin-top: 12px; border: 0; background: transparent; padding: 0; color: var(--blue); font-size: 11px; font-weight: 740; cursor: pointer; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state h3 { color: var(--ink); margin-bottom: 7px; }
.empty-state p { font-size: 12px; }
.empty-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); margin: 0 auto 15px; font-size: 23px; }
.view { display: none; }
.view.active { display: block; animation: view-in .2s ease-out; }
@keyframes view-in { from { opacity: 0; transform: translateY(4px); } }
.sponsor-slot { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 12px 16px; border: 1px dashed #c8d2df; border-radius: 10px; color: var(--muted); background: rgba(255,255,255,.5); }
.sponsor-slot span { font-size: 8px; font-weight: 850; letter-spacing: .15em; }
.sponsor-slot p { margin: 0; font-size: 10px; }
.sponsor-slot button { margin-left: auto; border: 0; background: transparent; color: var(--blue); font-size: 10px; font-weight: 750; cursor: pointer; }
.section-toolbar { display: flex; gap: 10px; margin-bottom: 14px; }
.search-box { flex: 1; display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--ink); }
.filter-select { min-height: 42px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); font-size: 11px; font-weight: 700; }
.keywords-panel { min-height: 460px; }
.limit-copy { color: var(--muted); font-size: 10px; }
.history-hero { display: flex; justify-content: space-between; align-items: end; margin-bottom: 18px; padding: 25px 27px; border-radius: 14px; color: white; background: var(--navy); }
.history-hero .eyebrow { color: #86adff; }
.history-hero h2 { font-size: 26px; }
.history-hero p:last-child { margin: 9px 0 0; color: #aebdd2; font-size: 12px; }
.history-chart-panel { margin-bottom: 16px; }
.history-legend { color: var(--muted); font-size: 10px; }
.history-legend i { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; background: var(--blue); }
.history-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.history-card { padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.history-card header { display: flex; justify-content: space-between; gap: 10px; }
.history-card strong { font-size: 12px; }
.history-card .rank-big { display: block; margin: 22px 0 6px; font-size: 28px; font-weight: 820; letter-spacing: -.05em; }
.history-card small { color: var(--muted); font-size: 9px; }
.history-card .mini-line { height: 3px; margin-top: 15px; border-radius: 3px; background: linear-gradient(90deg, var(--blue), #a9c3ff); }
.profiles-head { display: flex; justify-content: space-between; align-items: center; gap: 30px; margin-bottom: 20px; }
.profiles-head .muted { margin-bottom: 0; }
.profile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.profile-card { position: relative; min-height: 190px; padding: 20px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.profile-card.active { border-color: #9ab9ff; box-shadow: 0 0 0 2px var(--blue-soft); }
.profile-card .site-avatar { margin-bottom: 20px; }
.profile-card h3 { margin-bottom: 5px; }
.profile-card p { color: var(--muted); font-size: 10px; }
.profile-card dl { display: flex; gap: 25px; margin: 23px 0 0; }
.profile-card dt { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.profile-card dd { margin: 3px 0 0; font-weight: 800; font-size: 14px; }
.profile-card .card-menu { position: absolute; right: 14px; top: 14px; border: 0; background: transparent; cursor: pointer; }
.profile-add-card { display: grid; place-items: center; min-height: 190px; border: 1px dashed #b8c4d3; border-radius: 13px; background: transparent; color: var(--muted); cursor: pointer; }
.profile-add-card i { display: grid; place-items: center; width: 42px; height: 42px; margin: 0 auto 10px; border-radius: 50%; color: var(--blue); background: var(--blue-soft); font-style: normal; font-size: 20px; }
.profile-add-card strong { font-size: 12px; }
.pro-callout { display: flex; align-items: center; gap: 18px; padding: 25px; border-radius: 14px; color: white; background: linear-gradient(115deg, var(--navy), #0e3471); }
.pro-callout .pro-icon img { width: 54px; height: 54px; border-radius: 13px; }
.pro-callout span { color: #8fb2ff; font-size: 9px; font-weight: 850; letter-spacing: .15em; }
.pro-callout h2 { margin-top: 5px; }
.pro-callout p { margin: 7px 0 0; color: #b5c5db; font-size: 11px; }
.pro-callout .button { margin-left: auto; flex: 0 0 auto; }
.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.settings-grid .panel { min-height: 210px; }
.setting-toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.setting-toggle span { min-width: 0; }
.setting-toggle strong, .setting-toggle small { display: block; }
.setting-toggle strong { font-size: 11px; }
.setting-toggle small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.setting-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.setting-toggle i { position: relative; flex: 0 0 auto; width: 40px; height: 23px; border-radius: 999px; background: #cbd4df; transition: .2s; }
.setting-toggle i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 17px; height: 17px; border-radius: 50%; background: white; box-shadow: 0 2px 5px rgba(7,26,54,.2); transition: .2s; }
.setting-toggle input:checked + i { background: var(--blue); }
.setting-toggle input:checked + i::after { transform: translateX(17px); }
.setting-toggle input:focus-visible + i { outline: 3px solid var(--blue-soft); outline-offset: 2px; }
.muted { color: var(--muted); font-size: 12px; line-height: 1.65; margin: 14px 0 23px; }
dialog { width: min(480px, calc(100% - 28px)); border: 1px solid var(--line); border-radius: 16px; background: var(--panel); padding: 24px; color: var(--ink); box-shadow: 0 24px 80px rgba(7,26,54,.28); }
dialog::backdrop { background: rgba(5,18,37,.7); backdrop-filter: blur(4px); }
.dialog-head { display: flex; justify-content: space-between; margin-bottom: 22px; }
.close { border: 0; background: transparent; font-size: 27px; cursor: pointer; }
dialog form { display: grid; gap: 17px; }
dialog input, dialog select { width: 100%; border: 1px solid var(--line); background: #f8fafc; border-radius: 9px; padding: 11px 12px; font-weight: 600; color: var(--ink); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 6px; }
.form-error { min-height: 16px; margin: 0; color: var(--red); font-size: 11px; }
.upgrade-dialog { width: min(720px, calc(100% - 28px)); padding: 35px 40px 30px; text-align: center; }
.upgrade-close { position: absolute; right: 20px; top: 16px; }
.upgrade-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 20px; color: var(--blue); font-size: 10px; font-weight: 850; letter-spacing: .15em; }
.upgrade-brand img { width: 38px; height: 38px; border-radius: 10px; }
.upgrade-dialog > h2 { font-size: 29px; }
.upgrade-dialog > p { max-width: 520px; margin: 12px auto 24px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.upgrade-dialog ul { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 22px; max-width: 590px; margin: 0 auto 25px; padding: 0; text-align: left; list-style: none; }
.upgrade-dialog li { display: flex; gap: 10px; }
.upgrade-dialog li i { display: grid; place-items: center; flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; color: var(--blue); background: var(--blue-soft); font-style: normal; font-size: 11px; }
.upgrade-dialog li strong, .upgrade-dialog li small { display: block; }
.upgrade-dialog li strong { font-size: 11px; }
.upgrade-dialog li small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.plans button { position: relative; display: grid; gap: 5px; min-height: 68px; place-content: center; border: 1px solid var(--line); border-radius: 10px; background: white; cursor: pointer; }
.plans button.selected { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-soft); }
.plans strong { font-size: 11px; }
.plans span { color: var(--blue); font-size: 15px; font-weight: 800; }
.plans em { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); border-radius: 999px; padding: 3px 7px; color: white; background: var(--blue); font-size: 7px; font-style: normal; font-weight: 850; white-space: nowrap; }
.upgrade-cta { width: 100%; margin-top: 14px; }
.upgrade-note { display: block; margin-top: 10px; color: var(--muted); font-size: 8px; }
.toast { position: fixed; z-index: 20; right: 22px; bottom: 22px; max-width: 360px; background: var(--navy); color: white; padding: 13px 16px; border-radius: 10px; font-size: 11px; opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
.file-button { display: inline-flex; align-items: center; }
.file-button input { display: none; }
.mobile-nav { display: none; }
.auth-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, .85fr) 1.15fr; grid-template-rows: auto 1fr; padding: 30px 42px; color: white; background: var(--navy); }
.auth-brand { grid-column: 1 / -1; display: flex; align-items: center; gap: 11px; font-size: 20px; font-weight: 800; }
.auth-brand img { width: 38px; height: 38px; border-radius: 10px; }
.auth-public-nav { display: flex; gap: 22px; margin-left: auto; }
.auth-public-nav a { color: #aebdd0; font-size: 10px; font-weight: 700; text-decoration: none; }
.auth-public-nav a:hover { color: white; }
.auth-card { align-self: center; width: min(430px, 100%); padding: 34px; border-radius: 18px; color: var(--ink); background: white; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.auth-card h1 { font-size: 28px; }
.auth-intro { margin: 9px 0 24px; color: var(--muted); font-size: 12px; }
.google-button { width: 100%; min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--line); border-radius: 9px; background: white; font-size: 12px; font-weight: 750; cursor: pointer; }
.google-button svg { width: 18px; height: 18px; }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 19px 0; color: #95a0af; font-size: 9px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-card form { display: grid; gap: 14px; }
.auth-card label { display: grid; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 720; }
.auth-card input { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 12px; color: var(--ink); background: #f8fafc; outline: none; }
.auth-card input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.auth-submit { width: 100%; margin-top: 3px; }
.auth-error { min-height: 16px; margin: 10px 0 0; }
.auth-switch { width: 100%; margin-top: 7px; border: 0; color: var(--blue); background: transparent; font-size: 10px; font-weight: 750; cursor: pointer; }
.auth-legal { margin: 20px 0 0; color: #97a1af; text-align: center; font-size: 8px; }
.auth-aside { align-self: center; max-width: 520px; margin-left: 10vw; }
.auth-aside blockquote { margin: 0; font-size: clamp(32px, 4vw, 54px); line-height: 1.08; font-weight: 780; letter-spacing: -.045em; }
.auth-aside-lead { margin: 18px 0 0; color: #9fb2cc; font-size: 13px; }
.auth-seo-copy { max-width: 500px; margin-top: 38px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.12); }
.auth-seo-copy h2 { margin: 0 0 9px; color: white; font-size: 15px; letter-spacing: -.01em; }
.auth-seo-copy p { margin: 0; color: #9fb2cc; font-size: 10px; line-height: 1.65; }
.auth-seo-copy ul { display: flex; flex-wrap: wrap; gap: 7px; margin: 15px 0 0; padding: 0; list-style: none; }
.auth-seo-copy li { padding: 7px 9px; border: 1px solid rgba(255,255,255,.13); border-radius: 999px; color: #c5d2e3; background: rgba(255,255,255,.05); font-size: 8px; font-weight: 700; }
.admin-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 26px; border-radius: 14px; color: white; background: var(--navy); }
.admin-hero .eyebrow { color: #8eb2ff; }
.admin-hero p:last-child { margin: 8px 0 0; color: #b7c5d8; font-size: 11px; }
.admin-stats { grid-template-columns: repeat(4, 1fr); }
.admin-search { width: min(280px, 40vw); flex: initial; }
.plan-chip { display: inline-block; padding: 5px 8px; border-radius: 999px; color: #546174; background: #edf1f5; font-size: 8px; font-weight: 850; text-transform: uppercase; }
.plan-chip.pro { color: #1553cf; background: var(--blue-soft); }
.plan-chip.owner { color: white; background: var(--navy); }
.admin-plan-button { display: inline-flex; align-items: center; justify-content: center; justify-self: end; width: auto; min-width: 92px; min-height: 32px; margin-left: auto; padding: 0 11px; border-radius: 8px; font-size: 10px; white-space: nowrap; }
.admin-plan-button:disabled { opacity: .5; cursor: wait; }
.admin-user-list { display: grid; grid-template-columns: 1fr; }
.admin-user-card { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, .8fr) 110px; align-items: center; gap: 18px; min-width: 0; padding: 13px 4px; border-bottom: 1px solid var(--line); }
.admin-user-card:last-child { border-bottom: 0; }
.admin-user-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.admin-user-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.admin-user-identity strong, .admin-user-identity small { display: block; overflow: hidden; text-overflow: ellipsis; }
.admin-user-identity .mini-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 31px; height: 31px; border-radius: 9px; color: white; background: var(--navy-2); font-size: 10px; font-weight: 800; }
.admin-user-identity strong { max-width: 190px; font-size: 12px; line-height: 1.2; }
.admin-user-identity small { max-width: 190px; margin-top: 3px; color: var(--muted); font-size: 8px; }
.admin-card-plan { display: grid; justify-items: end; gap: 4px; }
.admin-card-plan small { color: var(--green); font-size: 7px; font-weight: 750; }
.admin-card-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.admin-user-field { min-width: 0; }
.admin-user-field > span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 7px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.admin-user-field > strong { font-size: 10px; }
.admin-user-field > small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }
.admin-stripe-link { display: inline-block; margin-top: 4px; color: var(--blue); font-size: 8px; font-weight: 750; text-decoration: none; }
.admin-user-tracking { min-height: 0; }
.admin-user-tracking .tracking-summary { gap: 2px; }
.admin-user-tracking .tracking-summary strong { font-size: 9px; }
.admin-user-tracking .tracking-summary small { font-size: 8px; }
.admin-action-spacer { display: block; width: 110px; }
.user-cell { display: flex; align-items: center; gap: 9px; }
.user-cell .mini-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 29px; height: 29px; border-radius: 8px; color: white; background: var(--navy-2); font-size: 10px; font-weight: 800; }
.user-cell strong, .user-cell small { display: block; }
.user-cell strong { font-size: 11px; }
.user-cell small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.account-dialog { width: min(370px, calc(100% - 28px)); }
.account-close { position: absolute; right: 16px; top: 12px; }
.account-identity { display: flex; align-items: center; gap: 12px; padding-right: 25px; }
.avatar.large { display: grid; place-items: center; flex: 0 0 auto; width: 44px; height: 44px; }
.account-identity strong, .account-identity small { display: block; }
.account-identity small { max-width: 230px; margin-top: 3px; color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; }
.tracking-summary { display: grid; gap: 3px; min-width: 150px; }
.tracking-summary strong { font-size: 10px; }
.tracking-summary small { max-width: 230px; color: var(--muted); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-plan { margin: 21px 0 13px; padding: 15px; border-radius: 10px; background: var(--blue-soft); }
.account-plan span { color: var(--blue); font-size: 9px; font-weight: 850; letter-spacing: .1em; }
.account-plan p { margin: 6px 0 0; color: #52657f; font-size: 10px; }
.billing-summary { display: grid; gap: 4px; margin: -4px 0 13px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.billing-summary strong { font-size: 10px; }
.billing-summary small { color: var(--muted); font-size: 9px; line-height: 1.45; }
.account-dialog > .button { width: 100%; margin-top: 8px; }
@media (max-width: 1000px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
  .history-list, .profile-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-user-card { grid-template-columns: 1fr 1fr; }
}
.legal-page { min-height: 100vh; color: var(--ink); background: #f3f6fa; }
.legal-page > header { display: flex; align-items: center; justify-content: space-between; max-width: 900px; margin: auto; padding: 22px; }
.legal-page > header a { display: flex; align-items: center; gap: 9px; color: var(--navy); font-weight: 800; text-decoration: none; }
.legal-page > header img { width: 32px; height: 32px; border-radius: 8px; }
.legal-page main { max-width: 850px; margin: 0 auto 60px; padding: 40px clamp(20px,5vw,70px); border: 1px solid var(--line); border-radius: 18px; background: white; }
.legal-page h1 { margin: 8px 0; font-size: clamp(30px,5vw,48px); }
.legal-page nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0; }
.legal-page nav a { padding: 8px 11px; border-radius: 8px; color: var(--blue); background: var(--blue-soft); font-size: 10px; font-weight: 750; text-decoration: none; }
.legal-page section { padding: 24px 0; border-top: 1px solid var(--line); scroll-margin-top: 20px; }
.legal-page section h2 { font-size: 20px; }
.legal-page section p, .legal-updated { color: var(--muted); font-size: 11px; line-height: 1.75; }
.auth-legal a { color: inherit; }
@media (max-width: 720px) {
  html, body { width: 100%; max-width: 100%; overflow-x: hidden; overscroll-behavior-x: none; }
  body { background: #f6f8fb; }
  .shell { display: block; }
  .sidebar { display: none; }
  main { width: 100%; max-width: 100%; overflow-x: hidden; padding: 0 14px calc(92px + env(safe-area-inset-bottom)); }
  .topbar { position: sticky; z-index: 4; top: 0; min-height: 82px; margin: 0 -14px 12px; padding: env(safe-area-inset-top) 14px 0; background: rgba(246,248,251,.93); backdrop-filter: blur(12px); }
  .topbar h1 { font-size: 25px; }
  .topbar .eyebrow, .desktop-only { display: none; }
  .topbar .avatar { display: grid; place-items: center; width: 35px; height: 35px; }
  .top-actions .button { min-height: 36px; padding: 0 12px; }
  .profile-bar { padding: 11px 12px; }
  .site-avatar { width: 36px; height: 36px; }
  #overviewView.active { display: flex; flex-direction: column; min-width: 0; }
  #overviewView .profile-bar { order: 1; }
  #overviewView .content-grid { display: contents; }
  #overviewView .rank-panel { order: 2; margin-top: 18px; }
  #overviewView .stats { order: 3; }
  #overviewView .trend-panel { order: 4; }
  #overviewView .sponsor-slot { order: 5; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .stat { padding: 14px; min-height: 98px; }
  .stat-value { font-size: 25px; margin: 15px 0 5px; }
  .content-grid, .settings-grid, .history-list, .profile-grid { grid-template-columns: minmax(0, 1fr); }
  .panel { width: 100%; min-width: 0; max-width: 100%; padding: 16px; border-radius: 12px; overflow: hidden; }
  .rank-panel { order: 1; }
  .trend-panel { order: 2; }
  .chart { height: 205px; }
  .chart, .chart svg { min-width: 0; max-width: 100%; overflow: hidden; }
  .chart.large { height: 230px; }
  .sponsor-slot { align-items: flex-start; flex-wrap: wrap; }
  .sponsor-slot button { margin-left: 0; }
  .section-toolbar { position: sticky; z-index: 2; top: 81px; min-width: 0; padding: 4px 0 10px; background: #f6f8fb; }
  .section-toolbar .search-box { min-width: 0; }
  .filter-select { width: 132px; max-width: 38%; flex: 0 0 auto; padding: 0 8px; }
  .keywords-panel { min-height: auto; }
  .keywords-panel .table-wrap { width: 100%; overflow-x: hidden; }
  .keywords-panel table, .keywords-panel tbody { display: block; width: 100%; }
  .keywords-panel thead { display: none; }
  .keywords-panel tbody { display: grid; gap: 9px; }
  .keywords-panel tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(70px, auto) auto; align-items: center; gap: 8px; width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfe; }
  .keywords-panel td { min-width: 0; padding: 0; border: 0; }
  .keywords-panel td:first-child { grid-column: 1 / -1; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
  .keywords-panel td:nth-child(2), .keywords-panel td:nth-child(4) { display: none; }
  .keywords-panel td:nth-child(3)::before, .keywords-panel td:nth-child(5)::before { display: block; margin-bottom: 4px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
  .keywords-panel td:nth-child(3)::before { content: "Current"; }
  .keywords-panel td:nth-child(5)::before { content: "Movement"; }
  .keywords-panel td:last-child { justify-self: end; white-space: nowrap; }
  .keywords-panel .keyword-name, .keywords-panel .keyword-url { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .rank-panel th:nth-child(4), .rank-panel td:nth-child(4) { display: none; }
  .rank-panel table { table-layout: fixed; }
  .rank-panel th:first-child, .rank-panel td:first-child { width: 46%; }
  .rank-panel th:nth-child(2), .rank-panel td:nth-child(2) { width: 18%; }
  .rank-panel th:nth-child(3), .rank-panel td:nth-child(3) { width: 22%; }
  .rank-panel th:last-child, .rank-panel td:last-child { width: 14%; padding-left: 2px; padding-right: 2px; }
  .history-hero { display: block; padding: 21px; }
  .history-hero h2 { font-size: 23px; }
  .history-hero .filter-select { margin-top: 18px; color: white; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); }
  .profiles-head { align-items: flex-end; }
  .profiles-head h2 { font-size: 19px; }
  .profiles-head .muted { display: none; }
  .profiles-head .button { flex: 0 0 auto; padding: 0 11px; }
  .profile-card, .profile-add-card { min-height: 160px; }
  .pro-callout { display: grid; grid-template-columns: 54px 1fr; padding: 20px; }
  .pro-callout .button { grid-column: 1 / -1; width: 100%; margin: 4px 0 0; }
  .button-row { flex-wrap: wrap; }
  .mobile-nav { position: fixed; z-index: 10; left: 10px; right: 10px; bottom: calc(8px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(4, 1fr); min-height: 64px; padding: 6px; border: 1px solid rgba(255,255,255,.1); border-radius: 18px; color: #9fb0c8; background: rgba(7,26,54,.97); box-shadow: 0 14px 40px rgba(7,26,54,.3); backdrop-filter: blur(18px); }
  .mobile-nav button { display: grid; place-items: center; gap: 2px; border: 0; border-radius: 12px; color: inherit; background: transparent; font-size: 8px; font-weight: 700; }
  .mobile-nav button.active { color: white; background: rgba(255,255,255,.1); }
  .mobile-nav svg { width: 19px; height: 19px; }
  dialog { margin-bottom: max(16px, env(safe-area-inset-bottom)); padding: 21px; border-radius: 18px; }
  dialog:not(.upgrade-dialog) { width: calc(100% - 20px); }
  dialog input, dialog select { min-height: 46px; font-size: 16px; touch-action: manipulation; -webkit-user-select: text; user-select: text; }
  #profileDialog { max-height: calc(100dvh - 20px); overflow-y: auto; }
  .upgrade-dialog { width: 100%; max-width: none; min-height: 91vh; margin: auto 0 0; padding: 28px 20px calc(25px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; }
  .upgrade-dialog > h2 { font-size: 25px; }
  .upgrade-dialog ul { grid-template-columns: 1fr; gap: 11px; }
  .plans { gap: 6px; }
  .plans button { min-height: 65px; }
  .toast { left: 14px; right: 14px; bottom: calc(88px + env(safe-area-inset-bottom)); max-width: none; text-align: center; }
  .auth-screen { display: block; padding: calc(22px + env(safe-area-inset-top)) 16px 25px; }
  .auth-brand { margin-bottom: 30px; }
  .auth-public-nav { gap: 13px; }
  .auth-public-nav a { font-size: 9px; }
  .auth-card { width: 100%; padding: 25px 20px; }
  .auth-card h1 { font-size: 25px; }
  .auth-aside { display: block; max-width: none; margin: 34px 4px 0; padding: 27px 2px 5px; border-top: 1px solid rgba(255,255,255,.12); }
  .auth-aside blockquote { font-size: 30px; }
  .auth-aside-lead { margin: 14px 0 0; font-size: 11px; }
  .auth-seo-copy { margin-top: 24px; padding-top: 19px; }
  .auth-seo-copy h2 { font-size: 14px; }
  .auth-seo-copy p { font-size: 10px; }
  .admin-hero { display: block; padding: 21px; }
  .admin-hero .button { margin-top: 17px; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-search { width: 100%; max-width: none; }
  #adminView .admin-user-card { display: grid; grid-template-columns: 1fr; gap: 13px; padding: 15px 0; }
  #adminView .admin-user-card-head { align-items: center; }
  #adminView .admin-card-meta { grid-template-columns: 1fr 1fr; }
  #adminView .admin-card-meta .admin-user-field:first-child { grid-column: 1 / -1; }
  #adminView .admin-plan-button { justify-self: start; margin-left: 0; }
  #adminView .admin-action-spacer { display: none; }
}
