/* Base and shared controls */
*, *:before, *:after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { height: 100%; }
body { min-height: 100%; margin: 0; background: #111827; color: #e5e7eb; font: 14px/1.5 "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif; }
main, nav, aside, header, section, article { display: block; }
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: default; opacity: .47; }
a { color: #22d3ee; }
:focus { outline: 2px solid #22d3ee; outline-offset: 2px; }
.muted, .empty-table { color: #9ca3af; }
.mono, .journey-ip, .journey-time { font-family: Consolas, "Courier New", "Microsoft YaHei", monospace; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.skip-link { position: fixed; z-index: 40; top: -80px; left: 12px; padding: 8px 12px; background: #1f2937; border-radius: 6px; }
.skip-link:focus { top: 8px; }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.glyph { display: block; width: 18px; height: 18px; flex: 0 0 auto; }

.btn, .icon-btn, .link-button {
  display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent;
  border-radius: 8px; color: #e5e7eb; background: transparent; text-decoration: none; white-space: nowrap;
}
.btn { min-height: 35px; padding: 6px 12px; font-size: 13px; font-weight: 600; }
.btn .glyph, .btn [data-icon] { margin-right: 6px; }
.btn [data-icon] .glyph { margin: 0; }
.btn .glyph, .icon-btn .glyph { width: 16px; height: 16px; }
.btn-primary { color: #0b1220; background: #06b6d4; border-color: #06b6d4; }
.btn-primary:hover:not(:disabled) { background: #22d3ee; border-color: #22d3ee; }
.btn-quiet, .icon-btn { background: #263241; border-color: #334155; }
.btn-quiet:hover:not(:disabled), .icon-btn:hover:not(:disabled) { background: #2b3646; border-color: #64748b; }
.icon-btn { flex: 0 0 35px; width: 35px; height: 35px; padding: 0; color: #bac4d0; }
.link-button { color: #22d3ee; padding: 4px 0; font-size: 13px; font-weight: 600; }
.link-button:hover { text-decoration: underline; }
.link-button .glyph { width: 14px; height: 14px; margin-left: 5px; }
.btn-danger { color: #fca5a5; background: #40262f; border-color: #693642; }
.btn-danger:hover:not(:disabled) { background: #52303a; border-color: #a5505f; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }

/* Version list and page navigation */
.shell { min-height: 100vh; }
.version-panel, .nav-panel { position: fixed; top: 0; bottom: 0; overflow: auto; }
.version-panel { left: 0; z-index: 13; width: 240px; padding: 16px 10px; background: #0f172a; border-right: 2px solid #334155; }
.nav-panel { left: 240px; z-index: 12; width: 180px; background: #1f2937; border-right: 1px solid #334155; }
.version-header { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 11px; color: #9ca3af; }
.version-header h2 { font-size: 14px; font-weight: 650; }
.version-header h2 [data-icon] { vertical-align: -4px; margin-right: 3px; }
.version-count { font-size: 12px; }
.project-button {
  display: flex; align-items: center; width: 100%; min-height: 49px; margin: 3px 0;
  padding: 7px 10px 7px 9px; border: 0; border-left: 3px solid transparent; border-radius: 6px;
  background: transparent; color: #bac4d0; text-align: left;
}
.project-button:hover { background: #2b3646; color: #e5e7eb; }
.project-button.active, .project-button[aria-pressed="true"] { border-left-color: #06b6d4; border-radius: 0 6px 6px 0; background: #102b40; color: #22d3ee; }
.project-icon {
  display: block; flex: 0 0 27px; width: 27px; height: 27px; line-height: 27px; text-align: center;
  margin-right: 9px; background: #263241; color: #bac4d0; border-radius: 6px; font-size: 12px; font-weight: 700;
}
.project-button.active .project-icon { background: #193e54; color: #67e8f9; }
.project-text { display: block; flex: 1 1 auto; min-width: 0; }
.project-text strong, .project-text small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-text strong { font-size: 13px; line-height: 20px; font-weight: 650; }
.project-text small { color: #9ca3af; font-size: 11px; }
.project-state { flex: 0 0 6px; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: #64748b; }
.project-state.connected { background: #22c55e; }
.project-list > p { padding: 7px 6px; font-size: 13px; }
.add-version {
  display: flex; align-items: center; width: 100%; margin-top: 11px; padding: 11px 9px; background: transparent;
  border: 0; border-top: 1px solid #334155; text-align: left; font-size: 13px; color: #bac4d0;
}
.add-version [data-icon] { width: 27px; height: 27px; margin-right: 9px; border-radius: 6px; background: #143245; color: #22d3ee; }
.add-version:hover { color: #22d3ee; }
.brand { display: flex; align-items: center; min-height: 63px; padding: 13px 14px; border-bottom: 1px solid #334155; white-space: nowrap; }
.brand-mark { width: 27px; height: 27px; margin-right: 9px; border-radius: 6px; color: #111827; background: #06b6d4; }
.brand-mark .glyph { width: 20px; height: 20px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 14px; font-weight: 700; }
.brand small { color: #9ca3af; font-size: 11px; }
.nav { padding: 11px 9px; }
.nav button {
  position: relative; display: flex; align-items: center; width: 100%; min-height: 40px; padding: 7px 10px;
  margin: 2px 0; border: 0; border-radius: 7px; background: transparent; color: #bac4d0;
  text-align: left; font-size: 13px; white-space: nowrap;
}
.nav button [data-icon] { margin-right: 9px; }
.nav button:hover { background: #2b3646; color: #e5e7eb; }
.nav button.active, .nav button[aria-current="page"] { background: #173d4f; color: #22d3ee; font-weight: 650; }
.nav button.active:before { position: absolute; top: 8px; bottom: 8px; left: 0; width: 3px; content: ""; border-radius: 2px; background: #06b6d4; }
.nav-divider { height: 1px; margin: 12px 4px 8px; background: #334155; }
.nav-caption { padding: 0 8px 4px; color: #9ca3af; font-size: 12px; }
.publisher-nav-short { display: none; }

/* Header, account and report filters */
.main { display: flex; flex-direction: column; height: 100vh; min-width: 0; margin-left: 420px; }
.main:focus { outline: 0; }
.topbar { position: relative; z-index: 11; flex: 0 0 auto; padding: 10px 22px; background: #111827; border-bottom: 1px solid #334155; }
.topbar-row, .page-identity, .top-actions, .account-action, .filters, .filter-controls, .report-actions { display: flex; align-items: center; }
.topbar-row, .filters { justify-content: space-between; }
.page-identity, .identity-text { min-width: 0; }
.identity-text { margin-left: 10px; }
.title-line { display: flex; flex-wrap: wrap; align-items: center; }
.title-line h1 { max-width: 100%; font-size: 19px; line-height: 1.35; word-wrap: break-word; }
.project-toggle { display: none; margin-right: 6px; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; color: #9ca3af; font-size: 12px; }
.project-context { display: flex; min-width: 0; align-items: center; margin-left: 8px; padding-left: 8px; border-left: 1px solid #334155; }
.project-context .glyph { width: 13px; height: 13px; margin-right: 5px; }
#project-context { display: block; min-width: 0; max-width: 30vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-indicator, .badge, .journey-status {
  display: inline-block; padding: 2px 7px; background: #263241; color: #bac4d0;
  border: 1px solid #475569; border-radius: 6px; font-size: 12px; white-space: nowrap; line-height: 1.4;
}
.project-indicator { margin: 1px 0 1px 8px; }
.project-indicator:before { content: ""; display: inline-block; width: 5px; height: 5px; margin: 0 5px 2px 0; border-radius: 50%; background: currentColor; }
.project-indicator.connected, .badge.connected { color: #86efac; border-color: #336354; background: #213d3a; }
.top-actions { flex: 0 0 auto; margin-left: 10px; }
.guest-actions { display: flex; align-items: center; }
.guest-actions > button + button { margin-left: 8px; }
.page-actions, .code-actions, .dialog-actions { display: flex; align-items: center; flex-wrap: wrap; }
.page-actions > * + *, .code-actions > * + *, .dialog-actions > * + * { margin-left: 8px; }
.account { position: relative; margin-left: 10px; }
.account-action { max-width: 160px; min-height: 35px; padding: 3px 6px; border: 1px solid transparent; border-radius: 7px; background: transparent; font-size: 13px; font-weight: 600; }
.account-action:hover { border-color: #334155; background: #263241; }
.account-avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 24px;
  width: 24px; height: 24px; margin-right: 6px; background: #173d4f; color: #22d3ee; border-radius: 50%; font-size: 12px;
}
.account-avatar .glyph { width: 14px; height: 14px; }
#account-name { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-arrow .glyph { width: 12px; height: 12px; margin-left: 4px; }
.account-menu {
  position: absolute; top: 100%; right: 0; min-width: 135px; margin-top: 7px; padding: 4px;
  background: #1f2937; border: 1px solid #334155; border-radius: 7px; box-shadow: 0 8px 18px rgba(0, 0, 0, .24);
}
.account-menu button { display: flex; align-items: center; width: 100%; min-height: 34px; padding: 5px 8px; border: 0; border-radius: 5px; background: transparent; white-space: nowrap; text-align: left; }
.account-menu button:hover { background: #2b3646; }
.account-menu [data-icon] { margin-right: 7px; }
.filters { flex-wrap: wrap; margin-top: 9px; }
.filter-controls, .report-actions { flex-wrap: wrap; }
.filter-controls > *, .report-actions > * { margin-top: 3px; }
.filter-controls > * { margin-right: 8px; }
.report-actions { color: #9ca3af; font-size: 12px; }
.report-actions > * + * { margin-left: 7px; }
.segmented { display: flex; padding: 3px; background: #263241; border: 1px solid #334155; border-radius: 8px; }
.segmented button { min-height: 27px; padding: 3px 10px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #bac4d0; font-size: 13px; white-space: nowrap; }
.segmented button:hover { color: #e5e7eb; background: #2b3646; }
.segmented button.active, .segmented button[aria-pressed="true"] { color: #22d3ee; background: #1f2937; border-color: #475569; font-weight: 650; }
.select-control { position: relative; display: inline-flex; align-items: center; border: 1px solid #334155; border-radius: 8px; background: #263241; }
.select-control > [data-icon] { position: absolute; left: 8px; pointer-events: none; color: #bac4d0; }
.select-control > [data-icon]:last-child { display: none; }
.select-control .glyph { width: 14px; height: 14px; }
.select-control select { width: 100%; max-width: 195px; height: 33px; padding: 3px 7px 3px 25px; border: 0; border-radius: 7px; color: #e5e7eb; background: transparent; font-size: 13px; text-overflow: ellipsis; }
.select-control option { background: #263241; color: #e5e7eb; }
#report-status.is-error, #publisher-ranking-status.is-error { color: #fca5a5; }

/* Dashboard panels, trend and source selector */
.content { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 21px 22px 32px; }
#workspace { max-width: 1760px; margin: 0 auto; }
#workspace.report-loading { opacity: .72; }
.card { min-width: 0; overflow: hidden; background: #1f2937; border: 1px solid #334155; border-radius: 12px; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.metric-grid, .chart-grid { display: flex; flex-wrap: wrap; margin: -8px -8px 10px; }
.metric, .chart-grid > * { flex: 0 0 auto; min-width: 0; margin: 8px; }
.metric { width: calc(20% - 16px); min-height: 106px; padding: 13px 13px 12px; }
.metric-top { display: flex; align-items: center; }
.metric-top h2 { min-width: 0; color: #bac4d0; font-size: 13px; font-weight: 600; }
.metric-icon { width: 25px; height: 25px; flex: 0 0 25px; margin-right: 7px; border-radius: 6px; background: #173b4b; color: #22d3ee; }
.metric-icon .glyph { width: 15px; height: 15px; }
.metric-download .metric-icon { background: #253b5c; color: #93c5fd; }
.metric-launcher .metric-icon { background: #433451; color: #d8b4fe; }
.metric-visitors .metric-icon { background: #3e392c; color: #fde68a; }
.metric-entry-rate .metric-icon { background: #203f3a; color: #86efac; }
.metric-value { display: block; margin: 4px 0 2px; font-size: 27px; line-height: 1.25; font-weight: 700; font-variant-numeric: tabular-nums; word-wrap: break-word; }
.metric p { color: #9ca3af; font-size: 11px; }
.chart-grid > * { width: calc(50% - 16px); }
.trend-panel, .channel-panel { position: relative; min-height: 336px; padding: 16px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; min-width: 0; }
.panel-head > div:first-child { min-width: 0; }
.panel-head > * + * { margin-left: 10px; }
.panel-head h2, .panel-head h3 { font-size: 15px; line-height: 1.45; font-weight: 650; }
.panel-head p { margin-top: 4px; color: #9ca3af; font-size: 12px; }
.panel-glyph { padding: 3px; color: #9ca3af; }
#trend-project { margin-right: 6px; }
.chart-legend { display: flex; flex-wrap: wrap; margin: 10px 0 4px; color: #bac4d0; }
.chart-legend span { display: inline-flex; align-items: center; margin: 0 13px 3px 0; white-space: nowrap; font-size: 12px; }
.chart-legend i { width: 12px; height: 3px; margin-right: 5px; border-radius: 2px; background: #06b6d4; }
.chart-legend [data-chart-series="download"] i { background: #60a5fa; }
.chart-legend [data-chart-series="launcher"] i { background: #c084fc; }
.trend-stage { position: relative; height: 247px; }
#trend-chart, #channel-canvas { display: block; width: 100%; height: 100%; }
.chart-tooltip {
  position: absolute; z-index: 1; min-width: 116px; border: 1px solid #475569; border-radius: 8px; padding: 6px 10px;
  background: #111827; color: #bac4d0; box-shadow: 0 4px 12px rgba(0, 0, 0, .3); font-size: 12px; white-space: nowrap; pointer-events: none;
}
.chart-tooltip strong { display: block; margin-bottom: 3px; color: #e5e7eb; }
.chart-tooltip div { display: flex; justify-content: space-between; }
.chart-tooltip div > * + * { margin-left: 8px; }
.channel-stage { display: flex; align-items: center; justify-content: center; min-height: 198px; padding: 8px 0; }
.donut { position: relative; display: flex; align-items: center; justify-content: center; flex: 0 0 174px; width: 174px; height: 174px; }
#channel-canvas { position: absolute; top: 0; left: 0; }
.donut-inner {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 102px; height: 102px; text-align: center; pointer-events: none;
}
.donut-inner strong { font-size: 21px; line-height: 1.25; font-weight: 700; font-variant-numeric: tabular-nums; }
.donut-inner span { margin-top: 3px; color: #9ca3af; font-size: 11px; }
.channel-selection { flex: 0 1 193px; min-width: 0; margin-left: 12px; padding: 9px 11px 6px; background: #263241; border: 1px solid #475569; border-radius: 8px; }
.channel-selection-head { display: flex; align-items: center; justify-content: space-between; }
.channel-selection h3 { min-width: 0; color: #22d3ee; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.channel-selection .icon-btn { flex: 0 0 24px; width: 24px; height: 24px; margin-left: 3px; border-radius: 5px; }
.channel-selection .icon-btn .glyph { width: 13px; height: 13px; }
.channel-selection-values { margin: 4px 0; }
.channel-selection-values > div { display: flex; justify-content: space-between; padding: 3px 0; font-size: 12px; }
.channel-selection-values > div + div { border-top: 1px dashed #475569; }
.channel-selection-values dt { color: #bac4d0; }
.channel-selection-values dd { margin: 0 0 0 7px; font-weight: 650; }
.channel-selection .link-button { font-size: 12px; }
.channel-legend { display: flex; flex-wrap: wrap; margin: 0 -4px; }
.channel-row {
  display: flex; align-items: center; width: calc(50% - 8px); min-height: 24px; margin: 1px 4px; padding: 2px 5px;
  border: 1px solid transparent; border-radius: 5px; color: #bac4d0; background: transparent; font-size: 12px; text-align: left;
}
.channel-legend button:hover, .channel-row.active, .channel-row[aria-pressed="true"] { color: #e5e7eb; background: #2b3646; border-color: #475569; }
.channel-row i { flex: 0 0 7px; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; }
.channel-row span { display: block; flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-row strong { flex: 0 0 auto; margin-left: 5px; font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-empty { width: 100%; color: #9ca3af; margin: 3px 0; text-align: center; font-size: 12px; }

/* Journey table, source table and publisher ranking */
.view > .card + .card { margin-top: 16px; }
.table-panel .panel-head { align-items: center; padding: 15px 17px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 470px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
thead { background: #263241; }
th, td { padding: 10px 12px; text-align: right; vertical-align: middle; }
th { color: #bac4d0; font-size: 12px; font-weight: 650; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 17px; text-align: left; }
th:last-child, td:last-child { padding-right: 17px; }
tbody tr { border-top: 1px solid #334155; }
tbody tr:hover { background: #2b3646; }
.empty-table { padding: 24px 16px !important; text-align: center !important; }
.journey-table { min-width: 695px; }
.journey-table th, .journey-table td { text-align: left; }
.journey-table th:nth-child(1) { width: 16%; }
.journey-table th:nth-child(2) { width: 15%; }
.journey-table th:nth-child(n+3):nth-child(-n+5) { width: 14%; }
.journey-table td:first-child { word-wrap: break-word; }
.journey-table td { font-size: 13px; }
.journey-table time { white-space: nowrap; }
.journey-status { max-width: 100%; padding-right: 8px; padding-left: 8px; white-space: normal; }
.badge-website, .journey-status.blue { color: #93c5fd; background: #233954; border-color: #3a5378; }
.badge-download, .journey-status.warn { color: #fdba74; background: #3e332e; border-color: #694f37; }
.badge-launcher { color: #d8b4fe; background: #3c304a; border-color: #5a476c; }
.badge.ok, .journey-status.ok { color: #86efac; background: #213d3a; border-color: #336354; }
.event-page { color: #bac4d0; }
.source-cell { min-width: 0; }
.source-cell .link-button { white-space: normal; word-wrap: break-word; text-align: left; }
.source-mark { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #06b6d4; }
.source-mark[data-tone="1"] { background: #60a5fa; }
.source-mark[data-tone="2"] { background: #c084fc; }
.source-mark[data-tone="3"] { background: #fbbf24; }
.source-mark[data-tone="4"] { background: #22c55e; }
.source-mark[data-tone="5"] { background: #94a3b8; }
.pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 17px; border-top: 1px solid #334155; }
.pagination-meta { font-size: 12px; }
.pagination-actions { display: flex; align-items: center; }
.pagination-actions > * + * { margin-left: 8px; }
.pagination-actions .btn { min-height: 30px; }
.publisher-totals { display: flex; flex-wrap: wrap; margin: 0; }
.publisher-totals > div { flex: 0 0 25%; min-width: 0; padding: 15px 17px; }
.publisher-totals > div + div { border-left: 1px solid #334155; }
.publisher-totals dt { color: #bac4d0; font-size: 13px; }
.publisher-totals dd { margin: 4px 0 0; font-size: 25px; line-height: 1.3; font-weight: 700; font-variant-numeric: tabular-nums; word-wrap: break-word; }
.publisher-totals .publisher-period { padding-top: 4px; font-size: 16px; }
.publisher-entries dd, .publisher-entry-count { color: #22d3ee; font-weight: 700; }
.publisher-ranking-note { padding: 10px 17px; border-top: 1px solid #334155; color: #9ca3af; font-size: 12px; }
.publisher-ranking-table { table-layout: fixed; }
.publisher-ranking-table th:not(:first-child) { width: 17%; padding-top: 0; padding-bottom: 0; }
.publisher-ranking-table th button { display: inline-flex; align-items: center; min-height: 38px; padding: 0; border: 0; background: transparent; }
.publisher-ranking-table th button [data-icon] { margin-left: 4px; }
.publisher-ranking-table th button .glyph { width: 12px; height: 12px; }
.publisher-ranking-table th button:hover, .publisher-ranking-table th[aria-sort] button { color: #22d3ee; }
.publisher-ranking-table th:not([aria-sort]) button .glyph { opacity: .55; }
.publisher-ranking-table th[aria-sort="ascending"] .glyph { transform: rotate(180deg); }
.publisher-source { display: flex; align-items: baseline; }
.publisher-source > span:last-child { min-width: 0; word-wrap: break-word; }
.publisher-position { flex: 0 0 24px; color: #9ca3af; font-size: 12px; }

/* Script installation, settings and empty states */
.empty-state { padding: 48px 18px; text-align: center; }
.empty-state .guest-actions { justify-content: center; }
.empty-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; margin-bottom: 12px;
  background: #173d4f; color: #22d3ee; border: 1px solid #2b5871; border-radius: 10px;
}
.empty-icon .glyph { width: 25px; height: 25px; }
.empty-state h2 { font-size: 19px; }
.empty-state p { margin: 5px auto 15px; max-width: 400px; color: #9ca3af; }
.code-heading, .code-summary, .code-card, .settings-grid > .card { padding: 16px 17px; }
.code-heading { padding-top: 0; padding-left: 0; padding-right: 0; }
.code-heading h2 { font-size: 18px; }
.code-heading p, .code-summary p, .code-card p, .settings-grid p { margin-top: 5px; color: #9ca3af; }
.code-warning, .code-summary { margin-bottom: 14px; }
.code-summary h3, .settings-grid h3 { font-size: 15px; }
.code-grid { margin-bottom: 16px; }
.code-card + .code-card, .settings-grid > .card + .card { margin-top: 14px; }
.code-card .panel-head { align-items: center; }
.code-card .panel-head > div { display: flex; align-items: center; }
.code-symbol { margin-right: 8px; padding: 4px; }
.code-symbol .glyph { width: 16px; height: 16px; }
.code-address, .settings-details dd { word-wrap: break-word; }
.code-address .mono { margin-left: 5px; }
.code-display { margin: 10px 0; padding: 10px 12px; overflow: auto; background: #111827; color: #67e8f9; border: 1px solid #334155; border-radius: 7px; }
.code-display pre, .code-display code { margin: 0; font: 12px/1.65 Consolas, "Courier New", monospace; }
.settings-details { margin: 14px 0 0; }
.settings-details dt { color: #bac4d0; font-size: 13px; font-weight: 650; }
.settings-details dd { margin: 3px 0 9px; }
.settings-danger { border-color: #693642; }
.settings-danger .btn { margin-top: 10px; }

/* Dialogs, forms and feedback */
.dialog-overlay, .modal-backdrop {
  position: fixed; z-index: 30; top: 0; right: 0; bottom: 0; left: 0;
  display: flex; align-items: center; justify-content: center; padding: 12px; background: rgba(6, 12, 23, .74);
}
.dialog {
  width: 100%; max-width: 490px; max-height: 90vh; overflow: auto; padding: 0;
  background: #1f2937; color: #e5e7eb; border: 1px solid #475569; border-radius: 12px; box-shadow: 0 14px 36px rgba(0, 0, 0, .35);
}
dialog.dialog { width: 92%; width: calc(100% - 24px); }
dialog.dialog::backdrop { background: rgba(6, 12, 23, .74); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 15px 17px; border-bottom: 1px solid #334155; }
.dialog-head h2 { font-size: 18px; }
.dialog-head p { margin-top: 4px; }
.dialog-close { margin-left: 9px; }
.dialog-body { padding: 15px 17px; }
.dialog-actions { justify-content: flex-end; padding: 11px 17px; border-top: 1px solid #334155; }
.dialog-body .dialog-actions { margin: 10px -17px -15px; }
.dialog-switch { margin-right: auto; }
.field { display: block; min-width: 0; margin-bottom: 11px; }
.field > span:first-child { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 650; }
.field-optional { font-weight: 400; }
.form-row { display: flex; flex-wrap: wrap; margin: 0 -6px; }
.form-row > * { flex: 1 1 160px; margin-left: 6px; margin-right: 6px; }
.input, .dialog input:not([type="checkbox"]) { width: 100%; min-height: 37px; padding: 7px 9px; color: #e5e7eb; background: #111827; border: 1px solid #475569; border-radius: 7px; }
.input:-ms-input-placeholder { color: #9ca3af; }
.input::-webkit-input-placeholder { color: #9ca3af; }
.form-error, .is-error { color: #fca5a5; }
.form-error, .form-hint { margin-top: 7px; font-size: 12px; }
.toast-region { position: fixed; z-index: 40; right: 14px; bottom: 14px; max-width: 88%; max-width: calc(100% - 28px); pointer-events: none; }
.toast, .noscript {
  padding: 8px 12px; background: #1f2937; color: #e5e7eb; border: 1px solid #34748a;
  border-radius: 7px; box-shadow: 0 5px 15px rgba(0, 0, 0, .27); font-size: 13px;
}
.toast + .toast { margin-top: 6px; }
.toast.is-error { color: #fca5a5; border-color: #a5505f; }
.noscript { position: fixed; z-index: 40; right: 14px; bottom: 14px; left: 14px; }

/* Light theme uses concrete colors in IE11 as well as current browsers. */
[data-theme="light"] body, [data-theme="light"] .topbar { background: #f8fafc; color: #1e293b; }
[data-theme="light"] .version-panel { background: #f1f5f9; border-color: #d9e3ee; }
[data-theme="light"] .nav-panel, [data-theme="light"] .card, [data-theme="light"] .account-menu,
[data-theme="light"] .dialog, [data-theme="light"] .skip-link, [data-theme="light"] .toast, [data-theme="light"] .noscript {
  background: #fff; color: #1e293b; border-color: #d9e3ee;
}
[data-theme="light"] .card { box-shadow: 0 1px 3px rgba(15, 23, 42, .08); }
[data-theme="light"] .topbar, [data-theme="light"] .brand, [data-theme="light"] .add-version,
[data-theme="light"] .project-context, [data-theme="light"] tbody tr, [data-theme="light"] .pagination,
[data-theme="light"] .publisher-totals > div, [data-theme="light"] .publisher-ranking-note,
[data-theme="light"] .dialog-head, [data-theme="light"] .dialog-actions { border-color: #d9e3ee; }
[data-theme="light"] .nav-divider { background: #d9e3ee; }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: #d9e3ee; }
[data-theme="light"] :focus { outline-color: #0369a1; }
[data-theme="light"] a, [data-theme="light"] .link-button, [data-theme="light"] .publisher-entries dd,
[data-theme="light"] .publisher-entry-count, [data-theme="light"] .channel-selection h3,
[data-theme="light"] .publisher-ranking-table th button:hover, [data-theme="light"] .publisher-ranking-table th[aria-sort] button { color: #0369a1; }
[data-theme="light"] .muted, [data-theme="light"] .empty-table, [data-theme="light"] .version-header,
[data-theme="light"] .project-text small, [data-theme="light"] .brand small, [data-theme="light"] .nav-caption,
[data-theme="light"] .breadcrumb, [data-theme="light"] .report-actions, [data-theme="light"] .metric p,
[data-theme="light"] .panel-head p, [data-theme="light"] .panel-glyph, [data-theme="light"] .chart-empty,
[data-theme="light"] .donut-inner span, [data-theme="light"] .publisher-ranking-note, [data-theme="light"] .publisher-position,
[data-theme="light"] .empty-state p, [data-theme="light"] .code-heading p, [data-theme="light"] .code-summary p,
[data-theme="light"] .code-card p, [data-theme="light"] .settings-grid p { color: #64748b; }
[data-theme="light"] .metric-top h2, [data-theme="light"] .project-button, [data-theme="light"] .nav button,
[data-theme="light"] .chart-legend, [data-theme="light"] .channel-row, [data-theme="light"] .project-icon,
[data-theme="light"] .channel-selection-values dt, [data-theme="light"] .publisher-totals dt,
[data-theme="light"] .settings-details dt, [data-theme="light"] th, [data-theme="light"] .event-page,
[data-theme="light"] .add-version, [data-theme="light"] .badge, [data-theme="light"] .project-indicator,
[data-theme="light"] .journey-status { color: #475569; }
[data-theme="light"] .btn-primary, [data-theme="light"] .brand-mark { background: #0369a1; border-color: #0369a1; color: #fff; }
[data-theme="light"] .btn-primary:hover:not(:disabled) { background: #075985; border-color: #075985; }
[data-theme="light"] .btn-quiet, [data-theme="light"] .icon-btn, [data-theme="light"] .segmented,
[data-theme="light"] .select-control, [data-theme="light"] .select-control option, [data-theme="light"] thead,
[data-theme="light"] .project-icon, [data-theme="light"] .channel-selection, [data-theme="light"] .badge,
[data-theme="light"] .project-indicator, [data-theme="light"] .journey-status { background: #f1f5f9; border-color: #d9e3ee; }
[data-theme="light"] .btn-quiet, [data-theme="light"] .icon-btn, [data-theme="light"] .select-control select,
[data-theme="light"] .select-control option, [data-theme="light"] .select-control > [data-icon] { color: #334155; }
[data-theme="light"] .btn-quiet:hover:not(:disabled), [data-theme="light"] .icon-btn:hover:not(:disabled),
[data-theme="light"] .project-button:hover, [data-theme="light"] .nav button:hover, [data-theme="light"] tbody tr:hover,
[data-theme="light"] .account-menu button:hover, [data-theme="light"] .account-action:hover, [data-theme="light"] .channel-legend button:hover {
  color: #1e293b; background: #e9eff6; border-color: #cbd5e1;
}
[data-theme="light"] .project-button.active, [data-theme="light"] .project-button[aria-pressed="true"],
[data-theme="light"] .nav button.active, [data-theme="light"] .nav button[aria-current="page"],
[data-theme="light"] .channel-row.active, [data-theme="light"] .channel-row[aria-pressed="true"],
[data-theme="light"] .empty-icon, [data-theme="light"] .metric-icon, [data-theme="light"] .account-avatar,
[data-theme="light"] .add-version [data-icon] { color: #0369a1; background: #e0f2fe; border-color: #badcf0; }
[data-theme="light"] .project-button.active, [data-theme="light"] .project-button[aria-pressed="true"] { border-left-color: #0284c7; }
[data-theme="light"] .project-button.active .project-icon { color: #075985; background: #cdeafa; }
[data-theme="light"] .nav button.active:before, [data-theme="light"] .chart-legend i { background: #0284c7; }
[data-theme="light"] .segmented button { color: #475569; }
[data-theme="light"] .segmented button:hover { background: #e2e8f0; }
[data-theme="light"] .segmented button.active, [data-theme="light"] .segmented button[aria-pressed="true"] { color: #0369a1; background: #fff; border-color: #d9e3ee; }
[data-theme="light"] .metric-download .metric-icon { color: #1d4ed8; background: #dbeafe; }
[data-theme="light"] .metric-launcher .metric-icon { color: #6d28d9; background: #ede9fe; }
[data-theme="light"] .metric-visitors .metric-icon { color: #854d0e; background: #fef3c7; }
[data-theme="light"] .metric-entry-rate .metric-icon { color: #166534; background: #dcfce7; }
[data-theme="light"] .chart-legend [data-chart-series="download"] i { background: #2563eb; }
[data-theme="light"] .chart-legend [data-chart-series="launcher"] i { background: #7c3aed; }
[data-theme="light"] .chart-tooltip { background: #fff; border-color: #d9e3ee; color: #475569; box-shadow: 0 4px 12px rgba(15, 23, 42, .10); }
[data-theme="light"] .chart-tooltip strong { color: #1e293b; }
[data-theme="light"] .channel-selection-values > div { border-color: #d9e3ee; }
[data-theme="light"] .badge-website, [data-theme="light"] .journey-status.blue { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
[data-theme="light"] .badge-download, [data-theme="light"] .journey-status.warn { color: #9a3412; background: #fff7ed; border-color: #fed7aa; }
[data-theme="light"] .badge-launcher { color: #6d28d9; background: #f5f3ff; border-color: #ddd6fe; }
[data-theme="light"] .badge.ok, [data-theme="light"] .journey-status.ok,
[data-theme="light"] .project-indicator.connected, [data-theme="light"] .badge.connected { color: #166534; background: #f0fdf4; border-color: #bbf7d0; }
[data-theme="light"] .code-display { background: #f1f5f9; color: #075985; border-color: #d9e3ee; }
[data-theme="light"] .input, [data-theme="light"] .dialog input:not([type="checkbox"]) { color: #1e293b; background: #f8fafc; border-color: #94a3b8; }
[data-theme="light"] .input:-ms-input-placeholder { color: #64748b; }
[data-theme="light"] .input::-webkit-input-placeholder { color: #64748b; }
[data-theme="light"] .btn-danger, [data-theme="light"] .btn-danger:hover:not(:disabled) { color: #991b1b; background: #fef2f2; border-color: #fca5a5; }
[data-theme="light"] .settings-danger, [data-theme="light"] .toast.is-error { border-color: #fca5a5; }
[data-theme="light"] .form-error, [data-theme="light"] .is-error,
[data-theme="light"] #report-status.is-error, [data-theme="light"] #publisher-ranking-status.is-error { color: #991b1b; }

/* Keep narrow screens usable while preserving the desktop's two sidebars. */
@media (max-width: 1240px) {
  .version-panel { width: 190px; }
  .nav-panel { left: 190px; width: 164px; }
  .main { margin-left: 354px; }
  .metric { padding-right: 9px; padding-left: 9px; }
  .metric-icon { margin-right: 5px; }
  .channel-selection { margin-left: 6px; }
  .donut { flex-basis: 146px; width: 146px; height: 146px; }
}
@media (max-width: 1080px) {
  .metric { width: calc(33.333% - 16px); }
  .chart-grid > * { width: calc(100% - 16px); }
  .trend-panel, .channel-panel { min-height: 0; }
  .donut { flex-basis: 174px; width: 174px; height: 174px; }
  .channel-selection { margin-left: 13px; }
}
@media (max-width: 900px) {
  .version-panel { width: 175px; }
  .nav-panel { left: 175px; width: 60px; }
  .main { margin-left: 235px; }
  .brand { justify-content: center; padding: 12px 5px; }
  .brand-mark { margin-right: 0; }
  .brand > span + span, .nav-caption { display: none; }
  .nav { padding-left: 6px; padding-right: 6px; }
  .nav button { justify-content: center; padding-left: 5px; padding-right: 5px; }
  .nav button [data-icon] { margin-right: 0; }
  .nav button > span:not([data-icon]) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .topbar, .content { padding-left: 14px; padding-right: 14px; }
}
@media (max-width: 760px) {
  .version-panel { display: none; }
  .version-panel.is-open { display: block; top: 60px; width: 232px; box-shadow: 0 5px 24px rgba(0, 0, 0, .35); }
  .nav-panel { left: 0; }
  .main { margin-left: 60px; }
  .project-toggle { display: inline-flex; }
}
@media (max-width: 580px) {
  .nav-panel {
    top: auto; right: 0; bottom: 0; width: auto; height: 59px; overflow-x: auto; overflow-y: hidden;
    border-right: 0; border-top: 1px solid #334155;
  }
  .version-panel.is-open { top: 60px; bottom: 59px; }
  .nav-panel .brand, .nav-divider { display: none; }
  .nav { display: flex; align-items: center; justify-content: space-around; min-width: 317px; padding: 4px; }
  .nav button { flex: 1 1 48px; flex-direction: column; min-width: 48px; min-height: 46px; width: auto; margin: 1px 2px; padding: 4px 2px; font-size: 11px; white-space: nowrap; }
  .nav button [data-icon] { margin-bottom: 2px; }
  .nav button > span:not([data-icon]) { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .nav button .publisher-nav-short { display: inline; }
  .nav button .publisher-nav-label { display: none; }
  .nav button.active:before { top: 0; right: 33%; bottom: auto; left: 33%; width: auto; height: 2px; }
  .main { display: block; height: auto; margin-left: 0; padding-bottom: 59px; }
  .topbar { padding: 9px 11px; }
  .topbar-row { align-items: flex-start; flex-direction: column; }
  .top-actions { align-self: flex-end; max-width: 100%; margin: 5px 0 0; }
  .content { padding: 13px 11px 24px; overflow: visible; }
  .title-line h1 { font-size: 18px; }
  .filters { margin-top: 4px; }
  .segmented button { padding-right: 7px; padding-left: 7px; }
  .filter-controls > * { margin-right: 5px; }
  .metric-grid, .chart-grid { margin-right: -5px; margin-left: -5px; }
  .metric, .chart-grid > * { margin-right: 5px; margin-left: 5px; }
  .metric { width: calc(50% - 10px); min-height: 97px; }
  .chart-grid > * { width: calc(100% - 10px); }
  .trend-panel, .channel-panel { padding: 12px; }
  .trend-stage { height: 222px; }
  .channel-stage { min-height: 176px; }
  .donut { flex-basis: 142px; width: 142px; height: 142px; }
  .donut-inner strong { font-size: 19px; }
  .channel-selection { margin-left: 8px; padding-right: 7px; padding-left: 7px; }
  .table-panel .panel-head { padding: 11px 12px; }
  .publisher-totals > div { flex-basis: 50%; }
  .publisher-totals > div:nth-child(3) { border-left: 0; }
  .publisher-totals > div:nth-child(n+3) { border-top: 1px solid #334155; }
  .toast-region { bottom: 69px; }
}
@media (max-width: 365px) {
  .page-actions > * + * { margin-left: 5px; }
  .account { margin-left: 5px; }
  .account-avatar { display: none; }
  .account-action { max-width: 88px; }
  .channel-row { width: calc(100% - 8px); }
  .channel-stage { flex-wrap: wrap; }
  .channel-selection { flex-basis: 100%; margin: 3px 0 6px; }
}

/* Game dashboard layout supplied in the 3.0 prototype. */
.version-panel { box-shadow: 2px 0 8px rgba(0, 0, 0, .2); }
.version-header { padding: 0 6px 12px; letter-spacing: 1px; }
.version-header h2 { font-size: 18px; font-weight: 600; }
.project-button { min-height: 44px; margin: 2px 0; padding: 10px 16px; color: #9ca3af; }
.project-button.active, .project-button[aria-pressed="true"] { background: rgba(6, 182, 212, .14); color: #06b6d4; }
.project-icon, .project-button.active .project-icon { background: rgba(6, 182, 212, .13); color: #06b6d4; }
.project-text strong { font-weight: inherit; }
.add-version { min-height: 48px; margin-top: 12px; padding: 16px 16px 4px; border-radius: 0; }
.add-version [data-icon], [data-theme="light"] .add-version [data-icon] { width: 24px; height: 24px; background: rgba(239, 68, 68, .1); color: #ef4444; }
.add-version:hover { color: #ef4444; }
.brand { min-height: 61px; padding: 18px 16px; }
.brand-mark { width: 24px; height: 24px; margin-right: 10px; }
.brand strong { font-size: 15px; }
.nav { padding: 12px 10px; }
.nav button { min-height: 40px; margin: 0 0 2px; padding: 10px 12px; }
.nav button.active, .nav button[aria-current="page"] { background: rgba(6, 182, 212, .14); color: #06b6d4; }
.nav-caption { position: relative; padding: 16px 12px 6px; margin-top: 10px; font-weight: 600; letter-spacing: 1px; }
.nav-caption:before { position: absolute; top: 0; left: 12px; right: 12px; height: 1px; background: #334155; content: ""; }
.topbar { padding: 12px 25px; }
.topbar-row { justify-content: flex-start; flex-wrap: wrap; margin-top: -11px; }
.topbar-row > * { margin-top: 11px; }
.page-identity { flex-wrap: wrap; }
.theme-toggle { flex-basis: 36px; width: 36px; height: 36px; }
.identity-text { margin: 0 0 0 12px; }
.title-line h1 { font-size: 18px; line-height: 1.5; }
.conversion-note { margin-left: 12px; color: #9ca3af; font-size: 13px; }
.top-actions { margin-left: auto; }
.segmented { margin-left: 12px; border: 0; }
.segmented button { min-height: 31px; padding: 6px 12px; border: 0; }
.segmented button.active, .segmented button[aria-pressed="true"] { color: #06b6d4; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.content { padding: 22px; }
#workspace { max-width: none; }
#view-overview .table-panel { padding: 18px; }
#view-overview .table-panel .panel-head { padding: 0 0 12px; }
.kpi-grid { display: flex; flex-wrap: wrap; margin: -8px -8px 10px; }
.kpi { position: relative; flex: 1 0 calc(20% - 16px); width: calc(20% - 16px); min-height: 128px; margin: 8px; padding: 18px; overflow: visible; }
.kpi .label { display: flex; align-items: center; color: #9ca3af; font-size: 13px; font-weight: 400; }
.tooltip-icon { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 13px; width: 13px; height: 13px; margin-left: 8px; border: 1px solid currentColor; border-radius: 50%; font: 10px serif; cursor: help; }
.tooltip-icon:after { position: absolute; top: 18px; left: -20px; z-index: 3; display: none; width: 170px; padding: 6px 10px; border: 1px solid #475569; border-radius: 6px; background: #1f2937; color: #f8fafc; font: 12px/1.5 "Microsoft YaHei", sans-serif; box-shadow: 0 4px 6px rgba(0, 0, 0, .3); content: attr(data-tip); }
.tooltip-icon:hover:after, .tooltip-icon:focus:after { display: block; }
.kpi:last-child .tooltip-icon:after { left: auto; right: -20px; }
.kpi .value-row { display: flex; flex-wrap: wrap; align-items: baseline; row-gap: 10px; margin: 12px 0; }
.kpi .value { font-size: 26px; line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .yesterday { margin-left: 10px; color: #9ca3af; font-size: 12px; }
.kpi .meta { color: #9ca3af; font-size: 13px; }
.kpi .trend-up { color: #22c55e; }
.kpi .trend-down { color: #f87171; }
.trend-panel, .channel-panel { min-height: 352px; padding: 18px; }
.chart-grid .panel-head { margin-bottom: 12px; }
.panel-head small { margin-left: 4px; color: #9ca3af; font-size: 12px; font-weight: 400; }
.chart-legend { justify-content: center; margin: 0; min-height: 26px; }
.chart-legend button { display: inline-flex; align-items: center; padding: 0 5px; border: 0; color: inherit; background: transparent; white-space: nowrap; font-size: 12px; }
.chart-legend button[aria-pressed="false"] { opacity: .55; text-decoration: line-through; }
.chart-legend i { width: 11px; height: 11px; margin-right: 5px; border: 2px solid #06b6d4; border-radius: 50%; background: #fff; }
.chart-legend [data-chart-series="launcher"] i, [data-theme="light"] .chart-legend [data-chart-series="launcher"] i { border-color: #f97316; background: #fff; }
.chart-legend [data-chart-series="download"] i, [data-theme="light"] .chart-legend [data-chart-series="download"] i { border-color: #22c55e; background: #fff; }
[data-theme="light"] .chart-legend [data-chart-series="website"] i { background: #fff; }
.trend-stage { height: 254px; }
.channel-stage { position: relative; display: block; min-height: 0; padding: 0; }
.solid-pie { position: relative; width: 100%; height: 280px; }
.channel-legend { position: absolute; right: 0; bottom: 0; left: 0; justify-content: center; margin: 0; }
.channel-row { width: auto; max-width: 150px; min-height: 20px; margin: 0; padding: 1px 4px; }
.channel-row i { flex-basis: 10px; width: 10px; height: 10px; margin-right: 4px; }
.channel-row strong { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.channel-selection { position: absolute; top: 40%; right: 16px; transform: translateY(-50%); width: 200px; margin: 0; padding: 14px; border-color: #334155; box-shadow: 0 4px 20px rgba(0, 0, 0, .25); }
.channel-selection h3 { display: flex; align-items: center; color: #06b6d4; font-size: 14px; }
.channel-selection h3:before { flex: 0 0 3px; height: 14px; margin-right: 6px; border-radius: 2px; background: currentColor; content: ""; }
.channel-selection-values { margin: 9px 0 3px; }
.channel-selection-values > div { align-items: center; padding: 6px 0; font-size: 13px; }
.channel-selection-values dd { font-size: 14px; font-variant-numeric: tabular-nums; }
.channel-selection-values small { color: #9ca3af; font-weight: 400; }
.channel-selection .link-button { color: #9ca3af; font-weight: 400; }
table { table-layout: fixed; }
th, td { padding: 12px 14px; text-align: left; }
th { color: #9ca3af; font-size: 13px; }
th:first-child, td:first-child { padding-left: 24px; }
th:last-child, td:last-child { padding-right: 24px; }
.journey-table { min-width: 760px; }
.journey-table th:nth-child(n) { width: auto; }
.journey-table td { font-size: 14px; }
.journey-table .mono, .journey-table time { font-family: inherit; }
.journey-table time { white-space: normal; }
.journey-status { display: inline-block; padding: 2px 10px; border-radius: 8px; font-size: 13px; line-height: 1.4; }
.status-symbol { margin-right: 4px; }
.journey-status.ok { color: #22c55e; background: rgba(34, 197, 94, .08); border-color: rgba(34, 197, 94, .2); }
.journey-status.warn { color: #fb923c; background: rgba(249, 115, 22, .08); border-color: rgba(249, 115, 22, .2); }
.journey-status.blue { color: #93c5fd; background: rgba(59, 130, 246, .08); border-color: rgba(59, 130, 246, .2); }

/* Setup and per-version parameters */
.code-header-banner { padding: 16px 20px; border: 1px solid #334155; border-radius: 8px; background: #263241; }
.banner-top, .code-section-header, .settings-card-header { display: flex; justify-content: space-between; align-items: flex-start; }
.banner-top p, .banner-bottom p { font-size: 13px; }
.banner-top h2 { margin-bottom: 6px; color: #f87171; font-size: 16px; }
.banner-top button { flex: 0 0 auto; margin-left: 12px; }
.banner-bottom { margin-top: 12px; padding-top: 12px; border-top: 1px dashed #475569; }
.banner-bottom h3 { margin-bottom: 4px; font-size: 14px; }
.code-section-card { margin-top: 18px; padding: 20px; }
.code-section-header { margin-bottom: 12px; }
.code-section-title { display: flex; align-items: center; font-size: 16px; }
.code-section-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 24px; width: 24px; height: 24px; margin-right: 8px; border-radius: 6px; background: rgba(6, 182, 212, .14); color: #06b6d4; }
.code-section-icon .glyph { width: 14px; height: 14px; }
.code-section-desc { margin-bottom: 16px; font-size: 13px; overflow-wrap: break-word; }
.code-site { color: #22d3ee; }
span.code-site { margin-left: 8px; }
.code-box-with-btn { display: flex; align-items: stretch; overflow: hidden; border: 1px solid #334155; border-radius: 8px; background: #263241; }
.code-box-with-btn code { flex: 1 1 auto; min-width: 0; padding: 14px; font: 13px/1.5 Consolas, Monaco, monospace; word-break: break-all; }
.btn-copy-inline, .btn-download-inline { display: flex; align-items: center; justify-content: center; flex: 0 0 auto; min-height: 36px; padding: 0 17px; border: 0; background: #06b6d4; color: #0b1220; font-size: 13px; font-weight: 600; }
.btn-copy-inline:hover, .btn-download-inline:hover { background: #22d3ee; }
.btn-copy-inline .glyph { width: 14px; height: 14px; margin-right: 6px; }
.btn-download-inline { padding: 0 10px; border-left: 1px solid rgba(15, 23, 42, .22); }
.btn-download-inline .glyph { width: 15px; height: 15px; }
.settings-wrap { max-width: 1000px; }
.settings-card { margin-bottom: 18px; padding: 20px; }
.settings-card-header { align-items: center; margin-bottom: 16px; }
.settings-card-header h2 { font-size: 16px; font-weight: 600; }
.settings-btn-outline, .settings-btn-danger { padding: 6px 14px; border: 1px solid #334155; border-radius: 6px; background: transparent; font-size: 13px; white-space: nowrap; }
.settings-btn-outline:hover { background: #2b3646; }
.settings-btn-danger { padding: 8px 16px; color: #f87171; border-color: rgba(239, 68, 68, .3); background: rgba(239, 68, 68, .1); font-weight: 600; }
.settings-btn-danger:hover { background: rgba(239, 68, 68, .2); }
.settings-info-grid, .settings-info-grid dd { margin: 0; }
.settings-info-item, .setting-form-row { display: flex; align-items: center; }
.settings-info-item + .settings-info-item, .setting-form-row + .setting-form-row { margin-top: 12px; }
.settings-info-item dt, .setting-form-row > label { flex: 0 0 120px; width: 120px; }
.settings-info-item dd { min-width: 0; margin-left: 20px; overflow-wrap: break-word; word-wrap: break-word; }
.settings-info-item a { text-decoration: none; }
.settings-info-item a:hover { text-decoration: underline; }
.settings-desc { margin-bottom: 16px; font-size: 13px; }
.input-group { display: flex; flex: 1 1 auto; min-width: 0; max-width: 600px; border: 1px solid #334155; border-radius: 6px; background: #263241; }
.input-group input { flex: 1 1 0; min-width: 0; width: 100%; padding: 8px 12px; border: 0; border-radius: 6px; background: transparent; }
.input-group input[readonly] { color: #9ca3af; }
.input-group .group-btn { flex: 0 0 auto; padding: 0 12px; border: 0; border-left: 1px solid #334155; border-radius: 0 5px 5px 0; background: transparent; color: #22d3ee; font-size: 13px; font-weight: 600; white-space: nowrap; }
.input-group .group-btn:hover { background: #2b3646; }
.input-group .group-btn.btn-solid { background: #06b6d4; color: #0b1220; }
.share-clear { margin-left: 8px; }
.share-status { margin-top: 10px; font-size: 13px; }
.share-status:empty { display: none; }

[data-theme="light"] .conversion-note, [data-theme="light"] .kpi .label, [data-theme="light"] .kpi .meta .muted,
[data-theme="light"] .kpi .yesterday, [data-theme="light"] .panel-head small, [data-theme="light"] th,
[data-theme="light"] .channel-selection .link-button, [data-theme="light"] .channel-selection-values small,
[data-theme="light"] .input-group input[readonly] { color: #64748b; }
[data-theme="light"] .code-header-banner, [data-theme="light"] .code-box-with-btn, [data-theme="light"] .input-group { background: #f1f5f9; border-color: #e2e8f0; }
[data-theme="light"] .nav-caption:before { background: #e2e8f0; }
[data-theme="light"] .banner-bottom, [data-theme="light"] .input-group .group-btn, [data-theme="light"] .settings-btn-outline { border-color: #cbd5e1; }
[data-theme="light"] .code-site, [data-theme="light"] .input-group .group-btn { color: #0369a1; }
[data-theme="light"] .settings-btn-outline:hover, [data-theme="light"] .input-group .group-btn:hover { background: #e2e8f0; }
[data-theme="light"] .banner-top h2, [data-theme="light"] .kpi .trend-down, [data-theme="light"] .settings-btn-danger { color: #b91c1c; }
[data-theme="light"] .kpi .trend-up { color: #15803d; }

@media (min-width: 901px) {
  .topbar { z-index: 15; }
  .channel-selection { right: 30px; }
}
@media (min-width: 1201px) and (max-width: 1240px) {
  .version-panel { width: 240px; }
  .nav-panel { left: 240px; width: 180px; }
  .main { margin-left: 420px; }
}
@media (min-width: 901px) and (max-width: 1200px) {
  .version-panel { width: 180px; }
  .nav-panel { left: 180px; width: 180px; }
  .main { margin-left: 360px; }
}
@media (max-width: 1300px) {
  .kpi { padding-right: 13px; padding-left: 13px; }
  .chart-grid .channel-selection { right: 10px; width: 168px; }
}
@media (max-width: 1080px) {
  .kpi { flex: 0 0 auto; width: calc(50% - 16px); }
  .chart-grid .channel-selection { position: static; transform: none; width: 100%; margin-top: 10px; box-shadow: none; }
}
@media (max-width: 900px) {
  .brand { padding: 12px 5px; }
  .brand strong { display: none; }
  .nav { padding-right: 6px; padding-left: 6px; }
  .nav button { padding-right: 5px; padding-left: 5px; }
  .topbar, .content { padding-right: 14px; padding-left: 14px; }
  .conversion-note { display: none; }
}
@media (max-width: 720px) {
  .kpi { flex-basis: calc(100% - 16px); min-height: 108px; }
  .banner-top { display: block; }
  .banner-top button { margin: 10px 0 0; }
  .setting-form-row { flex-wrap: wrap; }
  .setting-form-row > label { flex-basis: 100%; margin-bottom: 5px; }
}
@media (max-width: 580px) {
  .nav { padding: 4px; }
  .nav button { min-height: 46px; padding: 4px 2px; }
  .topbar-row { display: flex; align-items: center; flex-direction: row; }
  .page-identity { flex: 1 0 100%; }
  .identity-text { flex: 1 0 100%; margin: 7px 0 0; }
  .top-actions { align-self: center; justify-content: space-between; width: 100%; margin-left: auto; }
  .page-actions { flex: 0 0 auto; flex-wrap: nowrap; }
  .account { min-width: 0; max-width: 160px; margin-left: 6px; }
  .account-action { min-width: 0; max-width: 100%; }
  .segmented { margin-left: 6px; }
  .segmented button { padding-right: 9px; padding-left: 9px; }
  .trend-panel, .channel-panel, #view-overview .table-panel { padding: 12px; }
  .code-box-with-btn { flex-wrap: wrap; }
  .code-box-with-btn code { flex-basis: 100%; }
  .btn-copy-inline { flex: 1 1 auto; }
}

/* Workbench transitions */
#workspace > .view:not([hidden]) {
  animation: view-enter 260ms cubic-bezier(.22, 1, .36, 1);
}
#workspace { transition: opacity 200ms cubic-bezier(.22, 1, .36, 1); }
#workspace.report-loading { transition-delay: 100ms; }
[data-report-motion], .channel-selection:not([hidden]) {
  animation: report-enter 300ms cubic-bezier(.22, 1, .36, 1);
}
.account-menu:not([hidden]) {
  transform-origin: top right;
  animation: popover-enter 220ms cubic-bezier(.22, 1, .36, 1);
}
.account-arrow { transition: transform 220ms cubic-bezier(.22, 1, .36, 1); }
.account-action[aria-expanded="true"] .account-arrow { transform: rotate(180deg); }
.chart-tooltip:not([hidden]) { animation: report-enter 150ms cubic-bezier(.22, 1, .36, 1); }
.dialog-overlay:not([hidden]) { animation: backdrop-enter 200ms cubic-bezier(.22, 1, .36, 1); }
.dialog-overlay:not([hidden]) > .dialog { animation: dialog-enter 280ms cubic-bezier(.22, 1, .36, 1); }
.toast {
  animation: toast-enter 220ms cubic-bezier(.22, 1, .36, 1),
    toast-exit 180ms cubic-bezier(.22, 1, .36, 1) 4220ms forwards;
}
.btn, .icon-btn, .project-button, .nav button, .segmented button, .account-action,
.account-menu button, .channel-legend button, .settings-btn-outline, .settings-btn-danger,
.btn-copy-inline, .btn-download-inline, .input-group .group-btn {
  transition: background-color 200ms cubic-bezier(.22, 1, .36, 1),
    border-color 200ms cubic-bezier(.22, 1, .36, 1), color 200ms cubic-bezier(.22, 1, .36, 1),
    opacity 200ms cubic-bezier(.22, 1, .36, 1);
}
.btn:active:not(:disabled), .icon-btn:active:not(:disabled),
.btn-copy-inline:active, .btn-download-inline:active { opacity: .78; }

@keyframes view-enter {
  from { opacity: .68; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes report-enter {
  from { opacity: .55; }
  to { opacity: 1; }
}
@keyframes popover-enter {
  from { opacity: .35; transform: translateY(-5px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes backdrop-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes dialog-enter {
  from { transform: translateY(10px) scale(.985); }
  to { transform: translateY(0) scale(1); }
}
@keyframes toast-enter {
  from { opacity: .35; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toast-exit {
  to { opacity: 0; transform: translateY(4px); }
}
@keyframes rail-enter {
  from { opacity: .65; transform: translateX(-22px); }
  to { opacity: 1; transform: translateX(0); }
}
@media (max-width: 760px) {
  .version-panel.is-open { animation: rail-enter 280ms cubic-bezier(.22, 1, .36, 1); }
}
@media (prefers-reduced-motion: reduce) {
  #workspace > .view:not([hidden]), [data-report-motion], .channel-selection:not([hidden]),
  .account-menu:not([hidden]), .chart-tooltip:not([hidden]), .dialog-overlay:not([hidden]),
  .dialog-overlay:not([hidden]) > .dialog, .toast, .version-panel.is-open { animation: none; }
  #workspace, #workspace.report-loading, .account-arrow, .btn, .icon-btn, .project-button,
  .nav button, .segmented button, .account-action, .account-menu button, .channel-legend button,
  .settings-btn-outline, .settings-btn-danger, .btn-copy-inline, .btn-download-inline,
  .input-group .group-btn { transition: none; }
}
