:root {
  --bg: #f5f5f7;
  --panel: #fff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --accent: #0071e3;
  --accent-soft: #edf5ff;
  --border: #e7e7ec;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --shadow: 0 2px 8px #1d1d1f04, 0 12px 32px #1d1d1f03;
}
* { box-sizing: border-box; }
body { margin: 0; background: #ebebee; color: var(--text); font: 14px var(--font); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { border: 0; background: none; transition: background .2s, color .2s, box-shadow .25s, transform .3s var(--ease); }
button:disabled { cursor: not-allowed; opacity: .4; }
button:active:not(:disabled) { transform: scale(.98); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #0071e36b; outline-offset: 3px; }
input, select { min-width: 0; }
button svg, svg.muted-icon, .select-field svg, .search-field svg, .privacy-mark svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, p { margin: 0; }
h2 { font-size: 16px; font-weight: 600; letter-spacing: -.4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip-link { position: fixed; top: -80px; left: 24px; z-index: 50; background: var(--text); color: white; padding: 14px; border-radius: 12px; }
.skip-link:focus { top: 12px; }

/* A quiet, native-feeling frame: silver navigation and a porcelain workspace. */
.app-shell { display: flex; min-height: calc(100vh - 40px); max-width: 1680px; margin: 20px auto; width: calc(100% - 40px); background: #f0f0f3; border: 1px solid #ffffffd9; border-radius: 24px; box-shadow: 0 24px 70px #2424330d, 0 2px 6px #24243303; }
.sidebar { width: 212px; flex-shrink: 0; position: sticky; top: 21px; height: calc(100vh - 42px); min-height: 570px; display: flex; flex-direction: column; padding: 30px 16px 14px; }
.brand { display: flex; gap: 10px; align-items: center; margin: 0 8px 38px; font-size: 19px; font-weight: 650; letter-spacing: -.7px; }
.brand small { display: block; font-size: 10px; color: var(--muted); font-weight: 400; letter-spacing: 0; margin-top: 5px; }
.brand-mark { display: block; width: 36px; height: 36px; border-radius: 10px; box-shadow: 0 2px 6px #2424330b; flex-shrink: 0; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px; margin-bottom: 5px; text-align: left; color: #66666d; border-radius: 10px; font-size: 12px; }
.nav-item.active { color: var(--text); font-weight: 600; background: #ffffffd9; box-shadow: 0 1px 3px #00000006, 0 4px 10px #00000003; }
.nav-item.active svg { color: var(--accent); }
.nav-item svg { width: 17px; height: 17px; }
.nav-dot { display: none; }
.nav-count { margin-left: auto; padding: 2px 6px; font-size: 10px; color: #8a8a90; font-variant-numeric: tabular-nums; }
.nav-label { font-size: 10px; color: #85858c; margin: 0 12px 12px; }
.source-nav { margin-top: 30px; padding-top: 23px; border-top: 1px solid #dedee5; }
#sourceNav { max-height: 245px; overflow: auto; }
.source-nav-item { display: flex; width: 100%; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 9px; font-size: 11px; text-align: left; color: #66666c; }
.source-nav-item > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-nav-item.active { background: #e4e8ee; color: var(--text); }
.source-badge { display: grid; place-items: center; width: 25px; height: 25px; flex-shrink: 0; border-radius: 7px; background: #fff; color: #83838b; font-size: 12px; box-shadow: 0 1px 3px #00000006; }
.source-check { margin-left: auto; color: var(--accent); font-size: 10px; }
.sidebar-bottom { margin-top: auto; padding-top: 32px; }
.privacy-card { padding: 12px 10px; }
.privacy-mark { color: #9999a0; margin-bottom: 8px; }
.sidebar-bottom strong { font-size: 10px; font-weight: 500; color: #73737b; }
.sidebar-bottom p { font-size: 10px; color: #929299; line-height: 1.8; margin: 7px 0 11px; }
.text-button { padding: 0; color: var(--accent); font-size: 11px; display: inline-flex; align-items: center; gap: 6px; }
.sidebar-bottom .text-button { font-size: 10px; }
.workspace-label { padding: 20px 10px 0; font-size: 9px; color: #9b9ba1; display: flex; gap: 7px; align-items: center; }
.status-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #30a46c; flex-shrink: 0; }
.workspace { min-width: 0; flex: 1; background: var(--bg); border-left: 1px solid #e4e4ea; border-radius: 0 23px 23px 0; }
.topbar { height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 30px; }
.breadcrumb { font-size: 10px; color: #8e8e94; display: flex; gap: 10px; }
.breadcrumb strong { font-weight: 500; color: #626269; }
.topbar-right { display: flex; align-items: center; gap: 13px; font-size: 10px; color: #8e8e94; }
.avatar { border: 1px solid #e1e1e6; border-radius: 50%; background: #fcfcfd; color: #81818a; font-size: 10px; width: 25px; height: 25px; display: grid; place-items: center; }
main { max-width: 1320px; margin: auto; padding: 18px 30px 24px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 28px; }
h1 { font-size: 36px; font-weight: 650; letter-spacing: -1.5px; line-height: 1.2; }
.page-heading p { color: #86868b; font-size: 12px; margin-top: 11px; line-height: 1.7; }
.page-actions { display: flex; gap: 8px; flex-shrink: 0; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: #fff; border: 1px solid #e3e3e8; border-radius: 18px; min-height: 35px; padding: 8px 14px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.button svg { width: 14px; height: 14px; }
.button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.button.primary:hover:not(:disabled) { background: #0077ed; box-shadow: 0 4px 12px #0071e31a; }

/* One compact toolbar; segmented dates and quiet outlined filters. */
.filter-panel { background: #ffffffb3; border: 1px solid #fff; border-radius: 16px; margin-bottom: 28px; }
.filter-top { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.presets { display: flex; gap: 2px; padding: 3px; background: #efeff2; border-radius: 10px; }
.presets button { font-size: 11px; padding: 7px 12px; color: #7c7c83; border-radius: 7px; white-space: nowrap; }
.presets button.active { color: #27272d; background: #fff; font-weight: 500; box-shadow: 0 1px 3px #0000000d, 0 2px 6px #00000005; }
.date-range { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 11px; color: #a0a0a6; }
.date-range input { border: 0; background: transparent; font-size: 11px; color: #64646d; max-width: 120px; padding: 6px 0; }
.compact { min-height: 27px; padding: 5px 11px; font-size: 10px; }
.refresh-button { color: #777780; display: grid; place-items: center; background: transparent; width: 30px; height: 30px; padding: 6px; border-radius: 50%; flex-shrink: 0; }
.filter-bottom { display: flex; align-items: center; gap: 12px; padding: 10px 15px; border-top: 1px solid #f0f0f3; }
.filter-caption { font-size: 10px; color: #9999a1; margin-right: 5px; white-space: nowrap; }
.select-field { display: flex; align-items: center; gap: 7px; min-width: 0; }
.select-field svg { width: 13px; height: 13px; color: #8c8c94; }
select { border: 1px solid #e5e5ea; border-radius: 8px; background: #fff; padding: 7px 22px 7px 10px; font-size: 11px; max-width: 220px; min-height: 31px; }
.select-field select { border: 0; padding-left: 0; max-width: 160px; background: transparent; }
.model-filter select { max-width: 205px; }
.reset-button { font-size: 10px; border-left: 1px solid #e3e3e8; padding-left: 15px; white-space: nowrap; }
.filter-summary { margin-left: auto; color: #96969d; font-size: 10px; white-space: nowrap; }
.field-error { color: #b84242; font-size: 12px; padding: 0 18px 14px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.section-heading h2 { font-size: 13px; font-weight: 600; color: #585860; }
.section-heading > span { font-size: 10px; color: #8c8c94; }

/* Total usage leads; secondary metrics share a quieter surface. */
.cards { display: grid; grid-template-columns: 1.35fr repeat(3, minmax(0, 1fr)); gap: 12px; }
.card { --ink: #7d7d86; min-width: 0; padding: 22px; border: 1px solid #ffffff; border-radius: 20px; background: #fff; box-shadow: var(--shadow); transition: transform .4s var(--ease), box-shadow .4s var(--ease); }
.card.featured { --ink: #0071e3; background: linear-gradient(145deg, #eaf2fe, #fafdff 75%); }
.card-input { --ink: #b5804c; }
.card-cached { --ink: #298c78; }
.card-output { --ink: #8e70bd; }
.card-label { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 11px; font-weight: 500; color: #787880; }
.featured .card-label { color: #4c719d; }
.card-icon { display: grid; place-items: center; width: 24px; height: 24px; color: var(--ink); border-radius: 8px; flex-shrink: 0; background: #f7f7fa; }
.featured .card-icon { background: #ffffffb3; }
.card-label svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.card-value { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px; margin: 20px 0 15px; font-size: clamp(27px, 2.5vw, 38px); font-weight: 600; line-height: 1; letter-spacing: -1.5px; font-variant-numeric: tabular-nums; }
.featured .card-value { font-size: clamp(31px, 3vw, 46px); letter-spacing: -1.9px; }
.card-value small { font-size: 9px; letter-spacing: 0; font-weight: 400; color: #9999a0; }
.card-bottom { display: flex; align-items: center; gap: 6px; font-size: 9px; color: #92929a; flex-wrap: wrap; }
.delta { font-size: 9px; color: #508b71; background: #f0f7f3; padding: 3px 5px; border-radius: 5px; }
.card-composition { margin-top: 20px; }
.card-note { display: flex; justify-content: space-between; align-items: center; gap: 5px; font-size: 9px; color: #96969d; margin-bottom: 9px; }
.card-note strong { font-weight: 500; }
.card-track { display: flex; gap: 2px; height: 3px; background: #efeff3; border-radius: 5px; overflow: hidden; }
.card-track i { display: block; height: 100%; background: var(--ink); border-radius: 5px; }
.card-track .segment-input { background: #c79f76; }
.card-track .segment-cached { background: #54a994; }
.card-track .segment-output { background: #ac95ce; }
.insight-strip { display: flex; align-items: center; gap: 18px; font-size: 10px; color: #96969d; padding: 20px 2px 26px; flex-wrap: wrap; }
.insight-strip strong { color: #56565f; font-weight: 550; margin: 0 4px; font-variant-numeric: tabular-nums; }
.insight-separator { height: 10px; border-left: 1px solid #dedee5; }
.analytics-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr); gap: 16px; margin-bottom: 20px; align-items: stretch; }
.panel { background: #fff; border: 1px solid #e9e9ee; border-radius: 20px; min-width: 0; box-shadow: var(--shadow); }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 24px; }
.panel-heading h2 { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 9px; }
.panel-heading p { font-size: 10px; color: #96969d; margin-top: 8px; line-height: 1.6; }
.small-tag { font-size: 8px; letter-spacing: .8px; background: #f4f4f7; padding: 4px 6px; color: #95959e; font-weight: 500; border-radius: 5px; }
.muted-icon { color: #b0b0b7; }
.chart-controls { display: flex; gap: 5px; }
.chart-controls select { font-size: 10px; padding: 6px 17px 6px 9px; max-width: 95px; background: #fafafc; border-color: #ededf1; }
.canvas-wrap { height: 245px; position: relative; margin: 12px 24px 0 16px; }
.chart-legend { display: flex; justify-content: center; gap: 12px; padding: 18px 24px 24px; flex-wrap: wrap; font-size: 9px; color: #8a8a93; }
.legend-item { display: flex; align-items: center; gap: 5px; max-width: 190px; }
.legend-item span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.color-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.donut-wrap { width: 140px; height: 140px; position: relative; margin: 0 auto 16px; }
.donut-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; pointer-events: none; }
.donut-label strong { font-size: 32px; font-weight: 500; letter-spacing: -1.2px; }
.donut-label span { font-size: 9px; color: #9999a0; margin-top: 5px; }
.model-ranking { padding: 0 24px 20px; max-height: 162px; overflow: auto; }
.ranking-row { display: flex; align-items: center; gap: 7px; width: 100%; padding: 8px 0; font-size: 10px; text-align: left; border-radius: 5px; }
.ranking-row .model-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranking-row strong { font-weight: 550; font-variant-numeric: tabular-nums; }
.ranking-row .percent { color: #9999a0; width: 35px; text-align: right; font-size: 9px; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; background: #ffffffde; color: var(--muted); font-size: 12px; }
.empty-ranking { font-size: 11px; color: var(--muted); text-align: center; padding: 20px; }

/* A single date retains its own composition and source-contribution view. */
.daily-usage { margin: 0 24px 24px; }
.daily-headline { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; padding: 0 0 20px; }
.daily-eyebrow { font-size: 8px; letter-spacing: 1.5px; color: #9696a0; font-weight: 500; }
.daily-headline h3 { font-size: 21px; font-weight: 600; margin: 8px 0 0; letter-spacing: -.7px; }
.daily-count { font-size: 10px; color: #9999a0; white-space: nowrap; }
.daily-composition { display: flex; height: 12px; gap: 3px; border-radius: 6px; overflow: hidden; background: #eeeeF2; }
.daily-segment { display: block; flex-shrink: 1; background: var(--part-color); }
.daily-input { --part-color: #c59b70; }
.daily-cached { --part-color: #54a994; }
.daily-output { --part-color: #a58bc7; }
.daily-parts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 20px 0 24px; gap: 16px; }
.daily-part + .daily-part { border-left: 1px solid #eeeef2; padding-left: 16px; }
.daily-part-label { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; font-size: 10px; color: #8a8a93; }
.daily-part-label i { width: 5px; height: 5px; border-radius: 50%; background: var(--part-color); }
.daily-part-label small { font-size: 9px; margin-left: auto; color: #9999a0; }
.daily-part strong { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; font-size: clamp(19px, 1.9vw, 28px); font-weight: 550; letter-spacing: -.8px; margin: 11px 0 7px; font-variant-numeric: tabular-nums; }
.daily-part strong small { font-size: 8px; letter-spacing: 0; font-weight: 400; color: #9999a0; }
.daily-note { font-size: 9px; color: #9999a0; line-height: 1.6; }
.daily-sources-heading { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #eeeef2; padding-top: 18px; margin-bottom: 8px; }
.daily-sources-heading h3 { font-size: 11px; margin: 0; font-weight: 550; }
.daily-sources-heading > span { font-size: 9px; color: #9999a0; }
.daily-sources { max-height: 140px; overflow: auto; }
.daily-source { display: grid; grid-template-columns: minmax(95px, 1fr) minmax(25px, 1fr) 65px 38px; align-items: center; gap: 10px; width: 100%; padding: 9px 0; font-size: 10px; text-align: right; color: #96969f; border-radius: 6px; }
.daily-source-name { display: flex; gap: 7px; align-items: center; min-width: 0; text-align: left; color: #62626b; }
.daily-source-name > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.daily-source-name .brand-logo { width: 19px; height: 19px; }
.daily-source-track { display: block; height: 4px; border-radius: 3px; background: #efeff3; overflow: hidden; }
.daily-source-track i { display: block; height: 100%; border-radius: inherit; background: #8db3df; }
.daily-source strong { font-weight: 550; color: #52525d; }
.daily-no-usage { padding: 16px; color: var(--muted); font-size: 11px; border: 1px dashed #d8d8e2; border-radius: 10px; }

.detail-tools { display: flex; gap: 8px; align-items: center; }
.search-field { display: flex; align-items: center; gap: 7px; padding: 8px 10px; background: #fafafc; border: 1px solid #ededf2; border-radius: 9px; }
.search-field:focus-within { border-color: #8fbae8; box-shadow: 0 0 0 3px #0071e30a; }
.search-field svg { width: 14px; height: 14px; color: #a0a0aa; }
.search-field input { font-size: 10px; border: 0; background: transparent; width: 175px; outline: none; }
.search-field input::placeholder { color: #aaaab2; }
.table-wrap { overflow: auto; margin: 0 14px; }
table { width: 100%; border-collapse: collapse; font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 13px 14px; border-bottom: 1px solid #f0f0f4; }
th { background: #f8f8fa; color: #9999a1; font-weight: 400; font-size: 10px; padding-top: 11px; padding-bottom: 11px; border-bottom: 0; }
th:first-child { border-radius: 9px 0 0 9px; }
th:last-child { border-radius: 0 9px 9px 0; }
th:first-child, td:first-child { text-align: left; }
th button { font-size: inherit; color: inherit; padding: 0; display: inline-flex; gap: 6px; align-items: center; }
th[aria-sort]:not([aria-sort=none]) { color: #74747e; }
th button span { font-size: 10px; color: #b6b6bd; }
td { color: #777780; }
tbody tr { transition: background .2s; }
tbody tr:hover { background: #fafafd; }
tbody tr:last-child td { border-bottom: 0; }
.name-cell { display: flex; gap: 9px; align-items: center; color: #4a4a54; font-weight: 500; }
.row-link { font-size: 11px; color: #4a4a54; padding: 0; text-align: left; }
.row-link:hover { color: var(--accent); }
.model-avatar { width: 28px; height: 28px; border-radius: 8px; display: inline-grid; place-items: center; font-size: 11px; background: #fff; border: 1px solid #ededf2; color: #95959f; font-weight: 500; flex-shrink: 0; }
.total-cell { font-weight: 550; color: #43434e; }
.share-cell { display: flex; align-items: center; justify-content: flex-end; gap: 8px; font-size: 10px; color: #96969f; }
.mini-track { width: 38px; height: 3px; background: #f0f0f5; border-radius: 4px; overflow: hidden; }
.mini-track i { height: 100%; display: block; background: #93b5df; border-radius: 4px; }
.table-footer { display: flex; align-items: center; justify-content: space-between; padding: 17px 24px; color: #96969f; font-size: 10px; gap: 15px; }
.pagination { display: flex; align-items: center; gap: 10px; }
.pagination select { font-size: 10px; border: 0; padding: 5px 7px; min-height: 28px; background: transparent; }
.page-button { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; background: #f5f5f8; color: #8b8b95; font-size: 12px; }
#pageLabel { color: #74747e; font-size: 10px; padding: 5px; font-variant-numeric: tabular-nums; }
.empty-table { text-align: center !important; padding: 45px 20px; color: #96969f; }
.empty-table strong { display: block; color: #5c5c67; font-size: 14px; margin-bottom: 10px; }
.empty-table button { margin: 15px auto 0; }
.brand-logo { display: block; width: 20px; height: 20px; object-fit: contain; flex-shrink: 0; }
.ranking-row > .brand-logo { width: 18px; height: 18px; }
.legend-item > .brand-logo { width: 13px; height: 13px; }
.model-identity { display: inline-flex; align-items: center; gap: 8px; }
.model-identity .brand-logo { width: 18px; height: 18px; }

.device-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.device-card { padding: 24px; }
.device-card h3 { font-size: 17px; font-weight: 600; margin: 22px 0 8px; overflow-wrap: anywhere; letter-spacing: -.4px; }
.device-card p { font-size: 11px; color: #9999a0; margin-bottom: 24px; }
.device-card dl { display: grid; grid-template-columns: 1fr auto; gap: 13px; font-size: 11px; line-height: 1.5; }
.device-card dt { color: #9999a0; }
.device-card dd { margin: 0; text-align: right; }
.device-card .button { width: 100%; margin-top: 20px; }
.device-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.device-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: #f4f6fa; color: #7c94b6; }
.device-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.sync-badge { font-size: 9px; padding: 5px 8px; border-radius: 7px; background: #f5f5f7; color: #9999a0; }
.sync-badge.recent { background: #f0f7f2; color: #618974; }
footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 25px; padding: 0 2px 5px; color: #a0a0a8; font-size: 9px; }
footer > span { display: flex; gap: 7px; align-items: center; }
footer .status-dot { width: 4px; height: 4px; }
footer .text-button { font-size: 9px; color: #96969f; }
footer svg { width: 11px !important; height: 11px !important; }
.loading-state { height: 320px; display: flex; justify-content: center; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #dcdcE3; border-top-color: #8b8b95; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.notice { display: flex; gap: 20px; align-items: center; justify-content: space-between; border: 1px solid #f0dadd; background: #fff6f6; padding: 22px; border-radius: 16px; margin-bottom: 24px; color: #a54f5b; }
.notice strong { font-size: 14px; }
.notice p { font-size: 12px; margin-top: 8px; }
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); background: #2c2c30e8; color: #fff; backdrop-filter: blur(16px); box-shadow: 0 4px 24px #0000000f; padding: 12px 20px; border-radius: 12px; z-index: 60; font-size: 12px; max-width: 90vw; animation: toast-in .3s var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
dialog { border: 1px solid #ffffffd9; border-radius: 22px; padding: 28px; width: min(540px, calc(100% - 32px)); max-height: 85vh; color: var(--text); box-shadow: 0 30px 100px #0000001f; animation: dialog-in .25s var(--ease); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
dialog::backdrop { background: #1d1d1f29; backdrop-filter: blur(6px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
dialog dt { font-size: 13px; font-weight: 600; margin-top: 18px; }
dialog dd { font-size: 12px; color: #86868b; line-height: 1.9; margin: 7px 0 0; }
dialog > .button { margin-top: 16px; width: 100%; }
#content { transition: opacity .18s; }
#content.is-updating { opacity: .45; pointer-events: none; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px #1d1d1f06, 0 16px 36px #1d1d1f04; }
  .nav-item:not(.active):hover, .source-nav-item:not(.active):hover { background: #e8e8ee; }
  .refresh-button:hover, .ranking-row:hover, .daily-source:hover { background: #f6f6f9; }
}

@media (min-width: 1600px) {
  main { padding: 22px 40px 28px; }
  .topbar { padding-left: 40px; padding-right: 40px; }
  .card { padding: 25px; }
  .canvas-wrap { height: 280px; }
}
@media (max-width: 1200px) {
  .app-shell { width: calc(100% - 24px); margin: 12px; min-height: calc(100vh - 24px); }
  .sidebar { width: 184px; padding: 28px 12px 12px; top: 13px; height: calc(100vh - 26px); }
  main { padding: 16px 22px 22px; }
  .topbar { padding-left: 22px; padding-right: 22px; }
  .cards { gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .card { padding: 18px; }
  .card-value { font-size: 28px; }
  .featured .card-value { font-size: 32px; }
  .filter-top { flex-wrap: wrap; }
  .date-range { margin-left: 0; }
  .refresh-button { margin-left: auto; }
  .filter-summary { display: none; }
  .panel-heading { padding: 22px 20px; }
  .trend-panel .panel-heading { flex-wrap: wrap; }
  .chart-controls { flex-wrap: wrap; }
  .analytics-grid { grid-template-columns: minmax(0, 1.5fr) minmax(245px, 1fr); }
  .daily-usage { margin-left: 20px; margin-right: 20px; }
  .daily-headline { flex-wrap: wrap; }
  .daily-parts { gap: 10px; }
  .daily-part + .daily-part { padding-left: 10px; }
  .daily-source { grid-template-columns: minmax(80px, 1fr) 55px 34px; gap: 8px; }
  .daily-source-track { display: none; }
  .detail-panel .panel-heading { flex-wrap: wrap; }
  .detail-tools { width: 100%; }
  .search-field { flex: 1; }
  .search-field input { width: 100%; }
  .device-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-value, .featured .card-value { font-size: 34px; }
  .select-field select { max-width: 120px; }
  .model-filter select { max-width: 150px; }
  .analytics-grid { grid-template-columns: 1fr; }
  .distribution-panel { display: grid; grid-template-columns: 160px minmax(0, 1fr); padding-bottom: 22px; }
  .distribution-panel .panel-heading { grid-column: 1 / -1; }
  .donut-wrap { width: 130px; height: 130px; margin: 0 auto; }
  .model-ranking { padding: 0 24px 0 8px; max-height: 150px; align-self: center; }
  .daily-source { grid-template-columns: minmax(95px, 1fr) minmax(25px, 1fr) 65px 38px; }
  .daily-source-track { display: block; }
  .insight-strip { gap: 10px 15px; }
  .insight-separator { display: none; }
}
@media (max-width: 760px) {
  body { background: var(--bg); }
  .app-shell { display: block; margin: 0; width: 100%; border: 0; border-radius: 0; box-shadow: none; background: var(--bg); }
  .sidebar { position: static; width: auto; height: auto; min-height: 0; padding: 22px 18px 13px; background: #f0f0f3; border-bottom: 1px solid #e5e5eb; }
  .brand { margin: 0 2px 20px; font-size: 20px; }
  .brand-mark { width: 33px; height: 33px; }
  .brand small { font-size: 9px; }
  .source-nav, .sidebar-bottom { display: none; }
  .sidebar nav { display: flex; gap: 5px; }
  .nav-item { width: auto; flex: 1; justify-content: center; font-size: 11px; padding: 10px 7px; border-radius: 9px; margin: 0; gap: 7px; white-space: nowrap; }
  .nav-count { display: none; }
  .workspace { border: 0; border-radius: 0; }
  .topbar { height: 43px; padding: 0 20px; }
  .topbar-right { font-size: 9px; gap: 8px; }
  .avatar { width: 23px; height: 23px; font-size: 9px; }
  .breadcrumb { font-size: 9px; gap: 8px; }
  main { padding: 20px 16px; }
  h1 { font-size: 32px; }
  .page-heading { align-items: flex-start; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
  .page-heading p { font-size: 11px; margin-top: 9px; }
  .page-actions { gap: 7px; }
  .page-actions .button { min-height: 32px; font-size: 10px; padding: 7px 12px; }
  .filter-panel { margin-bottom: 24px; border-radius: 14px; }
  .filter-top { padding: 10px; gap: 7px; }
  .presets { flex: 1; }
  .presets button { flex: 1; padding: 7px 8px; font-size: 10px; }
  .date-range { order: 3; width: 100%; justify-content: space-between; border-top: 1px solid #eeeef3; padding-top: 8px; }
  .date-range input { max-width: 119px; }
  .filter-bottom { flex-wrap: wrap; padding: 10px 12px; gap: 8px 12px; }
  .filter-caption { display: none; }
  .select-field select { max-width: 135px; }
  .reset-button { margin-left: auto; }
  .cards { gap: 10px; }
  .card { padding: 18px 16px; border-radius: 17px; }
  .card-label { font-size: 10px; }
  .card-icon { width: 22px; height: 22px; }
  .card-value, .featured .card-value { font-size: 30px; margin: 18px 0 13px; letter-spacing: -1.3px; }
  .card-value small { font-size: 8px; }
  .card-bottom { font-size: 8px; gap: 5px; }
  .card-composition { margin-top: 18px; }
  .card-note { font-size: 8px; }
  .insight-strip { font-size: 9px; gap: 10px 14px; padding: 18px 2px 24px; }
  .analytics-grid { gap: 16px; }
  .panel { border-radius: 17px; }
  .panel-heading { padding: 22px 18px; }
  .panel-heading h2 { font-size: 13px; }
  .chart-controls { gap: 4px; }
  .chart-controls select { max-width: 90px; font-size: 10px; }
  .canvas-wrap { height: 220px; margin-left: 8px; margin-right: 16px; }
  .chart-legend { padding: 16px 18px 20px; }
  .daily-usage { margin: 0 18px 22px; }
  .daily-headline h3 { font-size: 19px; }
  .daily-parts { gap: 8px; }
  .daily-part + .daily-part { padding-left: 8px; }
  .daily-part strong { font-size: 21px; }
  .daily-part-label { font-size: 9px; }
  .daily-part-label small { font-size: 8px; }
  .daily-note { font-size: 8px; }
  .daily-source { grid-template-columns: minmax(80px, 1fr) minmax(16px, .7fr) 58px 35px; gap: 7px; }
  .distribution-panel { grid-template-columns: 135px minmax(0, 1fr); }
  .donut-wrap { width: 115px; height: 115px; }
  .model-ranking { padding: 0 14px 0 3px; max-height: 155px; }
  .ranking-row { gap: 5px; font-size: 9px; }
  .ranking-row > .brand-logo { width: 16px; height: 16px; }
  .ranking-row .percent { width: 30px; font-size: 8px; }
  .detail-tools { flex-wrap: wrap; }
  .search-field { min-width: 150px; }
  .table-wrap { margin: 0 10px; }
  .table-footer { padding: 16px; flex-wrap: wrap; }
  .pagination { margin-left: auto; gap: 8px; }
  .device-grid { grid-template-columns: 1fr; }
  footer { align-items: flex-start; flex-wrap: wrap; font-size: 8px; margin-top: 22px; }
  footer .text-button { font-size: 8px; }
  .section-heading > span { font-size: 9px; }
}
@media (max-width: 370px) {
  main { padding-left: 12px; padding-right: 12px; }
  .sidebar { padding-left: 12px; padding-right: 12px; }
  .nav-item { font-size: 10px; gap: 5px; padding: 10px 6px; }
  .presets button { padding-left: 6px; padding-right: 6px; }
  .card { padding: 15px 12px; }
  .card-value, .featured .card-value { font-size: 26px; }
  .date-range { gap: 5px; }
  .date-range input { max-width: 105px; font-size: 10px; }
  .daily-source { grid-template-columns: minmax(80px, 1fr) 52px 33px; gap: 6px; }
  .daily-source-track { display: none; }
  .daily-part strong { font-size: 18px; }
  .daily-part-label small { margin-left: 0; }
  .distribution-panel { grid-template-columns: 118px minmax(0, 1fr); }
  .donut-wrap { width: 100px; height: 100px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
