:root {
  --background: #fafafa;
  --surface: #fff;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #2563eb;
  --primary-light: #e9effd;
  --primary-hover: #1d4ed8;
  --chart-1: #2563eb;
  --chart-2: #1e40af;
  --chart-3: #60a5fa;
  --chart-4: #bfdbfe;
  --hover: #f9fafb;
  --radius: 12px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  font-size: 16px;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 110px; }
body { margin: 0; background: var(--background); line-height: 1.5; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button, select, summary { cursor: pointer; }
button, a, input, select, summary, [tabindex="0"] { outline-offset: 4px; }
:focus-visible { outline: 2px solid var(--primary); }
a { color: var(--primary); text-underline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.8rem, 2.4vw, 2.35rem); line-height: 1.18; letter-spacing: -.045em; font-weight: 750; }
h2 { font-size: 1.06rem; line-height: 1.4; letter-spacing: -.018em; font-weight: 700; }
.sidebar { width: 196px; position: fixed; inset: 0 auto 0 0; z-index: 30; background: white; border-right: 1px solid var(--line); padding: 30px 12px; display: flex; flex-direction: column; }
.sidebar-close { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 1.4rem; }
.sidebar-close:hover { background: var(--primary-light); color: var(--primary); }
.menu-toolbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; margin: -10px 0 18px; background: var(--background); border-bottom: 1px solid var(--line); }
.menu-toggle { display: inline-flex; align-items: center; gap: 8px; }
.brand { display: grid; padding: 0 16px 37px; color: var(--ink); text-decoration: none; line-height: 1; width: fit-content; }
.brand strong { font-size: 1.75rem; letter-spacing: -.07em; font-weight: 850; }
.brand span { font-size: .78rem; letter-spacing: .16em; font-weight: 650; margin-top: 7px; }
.sidebar nav { display: grid; gap: 8px; }
.nav-link { text-decoration: none; padding: 11px 15px; border-radius: 8px; color: #4b5563; font-size: .9rem; }
.nav-link:hover { background: var(--hover); }
.nav-link.active { color: var(--primary); background: var(--primary-light); font-weight: 650; box-shadow: 0 1px 3px #11182712; }
.sidebar-note { margin: auto 16px 0; padding-top: 32px; font-size: .76rem; color: var(--muted); line-height: 1.8; }
.sidebar-note strong { font-weight: 550; }
main { margin-left: 0; padding: 33px 32px 0; max-width: 2100px; }
.sidebar-open main { margin-left: 196px; }
.page-header { margin-bottom: 27px; display: flex; justify-content: space-between; gap: 24px; align-items: start; }
.subtitle { margin-top: 8px; color: var(--muted); font-size: .97rem; }
.header-actions { text-align: right; flex-shrink: 0; }
.actions-row { display: flex; gap: 12px; align-items: center; justify-content: end; }
.period { position: relative; display: grid; white-space: nowrap; text-align: left; }
.period-trigger { display: flex; align-items: center; gap: 13px; min-height: 68px; padding: 10px 15px; border: 1px solid #c9dbfb; border-radius: 12px; background: #eff6ff; color: var(--primary-hover); text-align: left; box-shadow: 0 1px 2px #2563eb08; transition: border-color .15s, box-shadow .15s; }
.period-trigger:hover, .period-trigger[aria-expanded="true"] { border-color: #93b8f7; box-shadow: 0 0 0 3px #2563eb0a; }
.period-trigger:disabled { cursor: wait; opacity: .65; }
.period-calendar { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #dbeafe; border-radius: 9px; background: white; color: var(--primary); }
.period svg, .passcode-dialog svg, .import-header svg, .import-upload svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.period-copy { display: grid; gap: 2px; }
#period-value { font-size: 1.19rem; font-weight: 750; letter-spacing: -.025em; line-height: 1.4; }
.period .period-chevron { width: 18px; height: 18px; margin-left: 12px; color: #6484b5; transition: transform .15s; }
.period-trigger[aria-expanded="true"] .period-chevron { transform: rotate(180deg); }
.period-panel { position: absolute; top: calc(100% + 9px); right: 0; width: 310px; max-width: calc(100vw - 32px); padding: 7px; background: white; border: 1px solid #dce4f0; border-radius: 13px; box-shadow: 0 12px 36px #172b4d21, 0 2px 5px #172b4d08; z-index: 15; }
.period-panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 12px; color: #6b7280; font-size: .75rem; font-weight: 550; }
#period-count { color: #94a3b8; font-variant-numeric: tabular-nums; }
#period-options { display: grid; gap: 4px; max-height: 320px; overflow-y: auto; padding: 2px; }
.period-option { display: flex; align-items: center; gap: 11px; width: 100%; padding: 12px; border: 0; border-radius: 8px; background: white; color: #475569; text-align: left; }
.period-option svg { width: 19px; height: 19px; color: #94a3b8; }
.period-option-label { font-size: .9rem; font-weight: 550; }
.period-option:hover { background: #f8fafc; }
.period-option[aria-selected="true"] { background: #eff6ff; color: var(--primary-hover); }
.period-option[aria-selected="true"] svg { color: var(--primary); }
.period-option .period-check { width: 18px; height: 18px; margin-left: auto; }
.period-caption { color: #4b658d; font-size: .69rem; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; }
.period strong { color: #1d4ed8; font-size: 1.35rem; font-weight: 750; letter-spacing: -.025em; line-height: 1.3; }
.button { background: white; border: 1px solid #e5e7eb; border-radius: 7px; padding: 10px 15px; color: var(--ink); font-size: .88rem; font-weight: 550; min-height: 42px; }
.button:hover { background: #eff6ff; border-color: #bfdbfe; }
.button.primary { background: var(--primary); border-color: var(--primary); color: white; box-shadow: 0 4px 10px #2563eb1f; }
.button.primary:hover { background: var(--primary-hover); }
.button.compact { padding: 6px 13px; min-height: 34px; font-size: .82rem; }
.button:disabled { opacity: .38; cursor: default; background: white; border-color: var(--line); }
.metadata { margin-top: 10px; color: var(--muted); font-size: .8rem; }
.notice { padding: 15px 18px; background: #fff6e5; border: 1px solid #efd7a6; border-radius: 8px; margin: 18px 0; color: #6e4a0a; }
.metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 23px 0; margin-bottom: 23px; }
.metric { padding: 0 23px; border-right: 1px solid var(--line); }
.metric:last-child { border: 0; }
.metric h2 { font-size: .9rem; letter-spacing: 0; font-weight: 600; }
.metric strong { display: block; font-size: 2.35rem; font-weight: 650; line-height: 1.2; letter-spacing: -.055em; margin: 14px 0 10px; font-variant-numeric: tabular-nums; }
.metric p { font-size: .77rem; color: var(--muted); }
.panel { background: white; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 2px #11182706; }
.chart-grid { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(0,1fr); gap: 22px; margin-bottom: 24px; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 22px 16px; }
.panel-heading p { font-size: .82rem; color: var(--muted); margin-top: 5px; }
.small-label { font-size: .76rem; color: var(--muted); }
.ranking-chart { padding: 4px 22px 8px; display: grid; gap: 13px; }
.bar-row { display: grid; grid-template-columns: minmax(155px,195px) minmax(50px,1fr) 35px; gap: 10px; border: none; background: transparent; padding: 0; align-items: center; width: 100%; color: var(--ink); text-align: left; }
.bar-label { font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 19px; background: #eff6ff; border-radius: 3px; overflow: hidden; }
.bar-fill { display: block; width: var(--width); height: 100%; background: #60a5fa; border-radius: 3px; transition: width .25s ease; }
.bar-row:first-child .bar-fill { background: var(--primary); }
.bar-row:hover .bar-label { color: var(--primary); text-decoration: underline; }
.bar-number { font-size: .8rem; text-align: right; font-variant-numeric: tabular-nums; }
.chart-footnote { padding: 9px 22px 18px; color: var(--muted); font-size: .74rem; }
.composition-content { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 4px 20px 24px; }
.donut { width: 150px; height: 150px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: var(--line); }
.donut > div { display: flex; flex-direction: column; justify-content: center; align-items: center; border-radius: 50%; background: white; width: 108px; height: 108px; }
.donut strong { font-size: 1.8rem; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.donut span { font-size: .75rem; color: var(--muted); margin-top: 5px; }
.legend { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; row-gap: 14px; padding: 0; margin: 0; width: 100%; max-width: 340px; }
.legend li { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 6px; font-size: .8rem; }
.legend .swatch { width: 9px; height: 9px; border-radius: 2px; }
.legend strong { font-variant-numeric: tabular-nums; font-weight: 600; }
.performance-panel { scroll-margin-top: 20px; }
.table-toolbar { align-items: start; flex-wrap: wrap; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.sort-control { display: flex; align-items: center; gap: 9px; border-left: 1px solid var(--line); margin-left: 3px; padding-left: 13px; max-width: 100%; }
.sort-control label { color: var(--muted); font-size: .82rem; font-weight: 600; white-space: nowrap; }
input[type=search], select { background-color: white; border: 1px solid #e5e7eb; color: var(--ink); border-radius: 6px; padding: 8px 11px; font-size: .82rem; min-height: 38px; max-width: 100%; }
input[type=search] { width: 220px; }
input::placeholder { color: #9ca3af; }
select { appearance: none; padding-right: 28px; background-image: linear-gradient(45deg,transparent 50%,#6b7280 50%),linear-gradient(135deg,#6b7280 50%,transparent 50%); background-position: calc(100% - 13px) 50%,calc(100% - 9px) 50%; background-size: 4px 4px; background-repeat: no-repeat; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; font-variant-numeric: tabular-nums; }
th, td { padding: 12px 16px; border-bottom: 1px solid #f1f3f5; text-align: left; white-space: nowrap; }
th { font-size: .75rem; font-weight: 650; background: #f9fafb; color: #6b7280; }
th:first-child, td:first-child { padding-left: 22px; }
.performance-table td:not(:first-child), .performance-table th:not(:first-child) { text-align: right; }
.performance-table th { white-space: normal; }
tbody tr:hover { background: #f8faff; }
tbody tr:last-child td { border-bottom: 0; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: #eff6ff; color: var(--primary); display: grid; place-items: center; font-size: .68rem; font-weight: 650; flex-shrink: 0; }
.numeric-highlight { color: var(--primary); font-weight: 650; }
.money-cell { font-weight: 600; }
.kpi-empty { color: #94a3b8; font-size: .77rem; font-weight: 450; }
.kpi-notice { margin: 0 22px 16px; padding: 10px 13px; border: 1px solid #bfdbfe; border-radius: 7px; background: #eff6ff; color: #46628f; font-size: .8rem; line-height: 1.7; }
.zero { color: #9ca3af; }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: .76rem; }
.pagination > div { display: flex; gap: 7px; }
.section-heading { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 17px; }
.section-heading h2 { font-size: 1.6rem; letter-spacing: -.04em; }
.section-heading p { font-size: .82rem; color: var(--muted); margin-top: 5px; }
.raw-section { margin-top: 22px; }
.tabs { display: flex; gap: 12px; border-bottom: 1px solid var(--line); padding: 0 20px; overflow-x: auto; }
.tab { border: 0; border-bottom: 2px solid transparent; padding: 16px 11px 13px; background: transparent; color: var(--muted); font-size: .9rem; white-space: nowrap; }
.tab span { display: inline-block; font-size: .73rem; margin-left: 5px; color: var(--muted); }
.tab.active { border-bottom-color: var(--primary); color: var(--primary); font-weight: 650; }
.raw-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 17px 22px 10px; }
.raw-toolbar input { width: 260px; }
.page-size { display: flex; align-items: center; gap: 9px; white-space: nowrap; color: var(--muted); font-size: .78rem; }
.account-filter { display: flex; align-items: center; gap: 7px; border-radius: 5px; padding: 4px 8px; color: var(--primary); background: #eff6ff; font-size: .78rem; max-width: 100%; overflow-wrap: anywhere; }
.account-filter button { color: var(--primary); border: 0; background: transparent; padding: 0 3px; font-size: 1.15rem; }
.raw-explanation { padding: 0 22px 16px; color: var(--muted); font-size: .77rem; max-width: 1000px; }
.raw-scroll { max-height: 540px; overflow-y: auto; }
.raw-scroll th { position: sticky; top: 0; z-index: 1; }
.raw-scroll td { font-size: .8rem; }
.total-row { background: #eff6ff; font-weight: 650; }
.null { color: #9ca3af; font-style: italic; }
.empty-cell { text-align: center !important; color: var(--muted); padding: 35px 22px !important; white-space: normal; }
.empty-chart { padding: 50px 10px; color: var(--muted); text-align: center; font-size: .87rem; }
.definitions { margin-top: 26px; }
details { border-top: 1px solid var(--line); }
summary { padding: 18px 0; font-size: .88rem; font-weight: 600; }
.definition-content { padding-bottom: 20px; max-width: 1050px; display: grid; gap: 11px; color: var(--muted); font-size: .85rem; line-height: 1.75; }
.definition-content strong { color: #4b5563; }
.sql-toolbar { display: flex; flex-wrap: wrap; gap: 15px; align-items: center; font-size: .78rem; margin: 0 0 15px; }
.sql-toolbar span { color: var(--muted); overflow-wrap: anywhere; }
pre { font: .78rem/1.7 "SFMono-Regular", Consolas, monospace; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 20px; max-height: 440px; overflow: auto; }
footer { padding: 24px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .72rem; display: flex; justify-content: space-between; gap: 15px; flex-wrap: wrap; }
.toast { position: fixed; right: 24px; bottom: 24px; padding: 12px 18px; border-radius: 8px; box-shadow: 0 6px 25px #11182726; background: var(--ink); color: white; z-index: 10; max-width: calc(100vw - 48px); font-size: .85rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; left: 16px; top: -70px; background: white; padding: 12px; z-index: 20; }
.skip-link:focus { top: 15px; }
@media (min-width: 1600px) { main { padding: 35px 42px 0; } .metric strong { font-size: 2.6rem; } }
@media (max-width: 1150px) {
  .sidebar { width: 174px; }
  main { padding: 26px 22px 0; }
  .sidebar-open main { margin-left: 174px; }
  .page-header { flex-direction: column; gap: 18px; }
  .header-actions { display: flex; align-items: center; gap: 16px; text-align: left; width: 100%; justify-content: space-between; }
  .metadata { margin: 0; }
  .chart-grid { grid-template-columns: 1.35fr 1fr; gap: 16px; }
  .composition-content { gap: 20px; }
  .donut { width: 145px; height: 145px; }
  .donut > div { width: 102px; height: 102px; }
  .metric { padding: 0 17px; }
  .metric h2 { min-height: 38px; }
  .metric strong { font-size: 2rem; margin-top: 8px; }
}
@media (max-width: 800px) {
  .sidebar { width: 196px; box-shadow: 8px 0 24px #1118271a; }
  .sidebar-open main { margin-left: 0; }
  .nav-link { white-space: nowrap; padding: 8px 10px; font-size: .82rem; }
  .sidebar-note { display: none; }
  main { margin-left: 0; padding: 25px 20px 0; }
  .chart-grid { grid-template-columns: 1fr; }
  .composition-content { min-height: 230px; flex-direction: row; gap: 36px; }
  .legend { max-width: 400px; }
  .header-actions { display: block; }
  .actions-row { justify-content: start; flex-wrap: wrap; }
  .metadata { margin-top: 10px; font-size: .76rem; overflow-wrap: anywhere; }
  .snapshot-line { align-items: start; font-size: .74rem; }
}
@media (max-width: 520px) {
  main { padding: 22px 14px 0; }
  .sidebar { padding-left: 14px; padding-right: 14px; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 0; }
  .metric { padding: 19px 16px; }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .metric h2 { font-size: .8rem; min-height: auto; }
  .metric strong { font-size: 2rem; margin: 10px 0 6px; }
  .metric p { font-size: .7rem; }
  .panel-heading { padding: 18px 16px 14px; }
  .ranking-chart { padding-left: 16px; padding-right: 16px; }
  .bar-row { grid-template-columns: 150px minmax(25px,1fr) 28px; }
  .bar-label { font-size: .72rem; }
  .composition-content { padding: 6px 16px 22px; gap: 22px; flex-direction: column; }
  .legend { max-width: 340px; }
  .legend li { font-size: .74rem; gap: 6px; }
  .donut { width: 128px; height: 128px; }
  .donut > div { width: 92px; height: 92px; }
  .donut strong { font-size: 1.55rem; }
  .filters { width: 100%; }
  .sort-control { flex-direction: column; align-items: stretch; width: 100%; gap: 6px; border-left: 0; margin-left: 0; padding-left: 0; }
  input[type=search], .filters select { width: 100%; }
  .section-heading { align-items: start; flex-direction: column; }
  .raw-toolbar { padding: 16px; flex-wrap: wrap; }
  .raw-toolbar input { width: 100%; }
  .tabs { padding: 0 8px; gap: 4px; }
  .tab { font-size: .8rem; padding-left: 8px; padding-right: 8px; }
  .raw-explanation { padding: 0 16px 14px; }
  .pagination { padding: 13px 16px; font-size: .72rem; gap: 8px; }
  .button.compact { padding: 5px 11px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .bar-fill { transition: none; } }
.participation { display: grid; grid-template-columns: 220px minmax(120px, 1fr) auto; align-items: center; gap: 28px; padding: 3px 3px 26px; }
.participation-title { display: flex; align-items: center; gap: 13px; font-size: .85rem; color: var(--muted); }
.participation-title strong { font-size: 1.1rem; letter-spacing: -.02em; color: var(--primary); }
.participation-detail { max-width: 420px; }
.participation-detail p { margin-top: 6px; color: var(--muted); font-size: .76rem; }
.participation-track { height: 6px; border-radius: 4px; background: #dbeafe; overflow: hidden; }
.participation-track span { display: block; height: 100%; background: var(--primary); border-radius: inherit; width: 0; }
.text-button { background: transparent; border: 0; color: var(--primary); font-size: .8rem; padding: 7px 0; text-align: left; text-decoration: underline; text-underline-offset: 4px; }
.account-person { display: flex; align-items: center; gap: 10px; }
.account-identity { display: grid; gap: 2px; line-height: 1.4; }
.account-name { font-size: .88rem; font-weight: 600; }
.account-email { font-size: .73rem; color: var(--muted); }
.footer-actions { display: flex; align-items: center; gap: 24px; }
.review-launcher { padding: 0; border: 0; background: transparent; color: var(--muted); font-size: .74rem; text-decoration: underline; text-underline-offset: 4px; }
.review-launcher:hover { color: var(--primary); }
#import-dialog { width: min(1120px, calc(100vw - 48px)); max-height: calc(100dvh - 56px); padding: 0; border: 1px solid #dce4f0; border-radius: 17px; color: var(--ink); background: white; box-shadow: 0 24px 90px #0f172a33; }
#import-dialog::backdrop, #passcode-dialog::backdrop { background: #0f172a66; backdrop-filter: blur(4px); }
body:has(#import-dialog[open], #passcode-dialog[open]) { overflow: hidden; }
.review-header { display: flex; justify-content: space-between; align-items: start; gap: 24px; padding: 23px 28px; position: sticky; top: 0; background: white; z-index: 3; border-bottom: 1px solid var(--line); }
.review-header h2 { font-size: 1.3rem; }
.review-header .metadata { margin-top: 4px; text-align: left; font-size: .76rem; }
.review-content { padding: 20px 28px 25px; }
.review-actions { display: flex; justify-content: space-between; align-items: center; gap: 18px; font-size: .84rem; color: var(--muted); }
.review-content .section-heading h2 { font-size: 1.2rem; }
.review-content .raw-toolbar .filters { flex: 1; }
.review-content .raw-toolbar input { width: 225px; }
.review-content .raw-scroll { max-height: 430px; }
@media (max-width: 1150px) {
  .participation { grid-template-columns: 1fr 1fr; gap: 12px 24px; }
  .participation .text-button { grid-column: 1 / -1; padding: 0; }
}
@media (max-width: 800px) {
  .participation { grid-template-columns: 1fr; gap: 11px; }
  .participation-detail { max-width: none; }
  .participation-title { justify-content: space-between; }
  .legend { grid-template-columns: 1fr; max-width: 210px; }
}
@media (max-width: 520px) {
  .page-header { margin-bottom: 22px; }
  .legend { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 340px; }
  #import-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 24px); border-radius: 9px; }
  .review-header { padding: 16px; gap: 10px; }
  .review-header .metadata { overflow-wrap: anywhere; }
  .review-header > div { min-width: 0; }
  .review-content { padding: 16px 10px; }
  .review-actions { flex-direction: column; align-items: start; }
  .review-content .raw-toolbar input { width: 100%; }
  .footer-actions { gap: 16px; flex-wrap: wrap; }
}


.column-heading { display: inline-flex; align-items: center; gap: 7px; }
.column-help { width: 18px; height: 18px; padding: 0; border: 1px solid #cbd5e1; border-radius: 50%; display: inline-grid; place-items: center; flex-shrink: 0; background: white; color: #64748b; font-size: .68rem; font-weight: 650; line-height: 1; }
.column-help:hover, .column-help[aria-expanded="true"] { color: var(--primary); border-color: var(--primary); background: #eff6ff; }
.column-help-popover { position: fixed; inset: auto; margin: 0; width: min(350px, calc(100vw - 32px)); padding: 20px; border: 1px solid #dbe4f3; border-radius: 12px; background: white; color: var(--ink); box-shadow: 0 8px 32px #172b4d26; }
.column-help-popover h3 { font-size: .96rem; margin: 0 0 9px; line-height: 1.4; }
.column-help-popover > p { color: #4b5563; font-size: .85rem; line-height: 1.7; }
.column-help-example { margin-top: 14px; padding: 12px; background: #eff6ff; border-radius: 7px; font-size: .8rem; line-height: 1.65; }
.column-help-example > span { display: block; font-weight: 650; color: var(--primary); margin-bottom: 3px; }
.methodology { background: white; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.methodology > summary { padding: 20px 23px; display: flex; align-items: center; gap: 14px; list-style: none; }
.methodology > summary::-webkit-details-marker { display: none; }
.methodology-icon { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; background: #eff6ff; color: var(--primary); border-radius: 8px; font-size: 1rem; font-weight: 650; }
.methodology-heading { display: grid; gap: 4px; }
.methodology-heading strong { font-size: .96rem; font-weight: 650; }
.methodology-heading > span { font-size: .8rem; color: var(--muted); font-weight: 400; }
.methodology-toggle { width: 8px; height: 8px; border-right: 1.5px solid #6b7280; border-bottom: 1.5px solid #6b7280; transform: rotate(45deg); margin: 0 4px 4px auto; flex-shrink: 0; }
.methodology[open] .methodology-toggle { transform: rotate(225deg); margin-bottom: -4px; }
.methodology-content { border-top: 1px solid var(--line); padding: 23px; }
.methodology-scope { border-left: 3px solid var(--primary); padding: 2px 0 2px 15px; margin-bottom: 24px; }
.methodology-scope strong { font-size: .86rem; font-weight: 650; }
.methodology-scope p { font-size: .83rem; color: #4b5563; line-height: 1.75; margin-top: 5px; max-width: 1000px; }
.methodology-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 34px; }
.methodology-grid article { border-top: 1px solid #edf0f5; padding: 19px 0; }
.methodology-grid h3 { margin: 0 0 9px; font-size: .9rem; font-weight: 650; color: var(--ink); }
.methodology-grid p { font-size: .83rem; line-height: 1.8; color: #4b5563; }
.methodology-grid p + p { margin-top: 8px; }
.methodology-grid .methodology-example { color: #46628f; background: #f4f8ff; border-radius: 6px; padding: 9px 12px; font-size: .8rem; }
.methodology-note { background: #f9fafb; border-radius: 8px; padding: 15px 17px; margin-top: 4px; }
.methodology-note strong { font-size: .82rem; }
.methodology-note p { color: #6b7280; font-size: .8rem; line-height: 1.75; margin-top: 4px; }
@media (max-width: 650px) {
  .methodology > summary { padding: 18px 16px; gap: 11px; }
  .methodology-content { padding: 18px 16px; }
  .methodology-grid { grid-template-columns: 1fr; }
  .methodology-heading > span { font-size: .76rem; }
  .column-help { width: 22px; height: 22px; font-size: .75rem; }
}


.composition { display: flex; flex-direction: column; }
.composition-content { flex: 1; }

.legend { grid-template-columns: 1fr; max-width: 290px; row-gap: 13px; }
.legend-label { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.legend .chart-help { width: 20px; height: 20px; font-size: .7rem; }


.print-only { display: none; }
.performance-print-page { display: contents; }
/* Reserve space inside the content so browser-generated headers and footers have no page margin. */
@page { size: A4 landscape; margin: 0 12mm; }
@media print {
  html { font-size: 11pt; scroll-padding-top: 0; }
  body { background: white; line-height: 1.4; }
  body:has(#import-dialog[open]) { overflow: visible; }
  .sidebar, .menu-toggle, .skip-link, .filters, .pagination, .chart-footnote,
  .definitions, .review-launcher, #import-dialog, .toast, .text-button,
  .column-help, #column-help-popover, .avatar, footer { display: none !important; }
  .print-only { display: block; }
  main, .sidebar-open main { margin: 0; padding: 12mm 0 0; max-width: none; }
  .menu-toolbar { position: static; margin: 0 0 4mm; padding: 0 0 3mm; background: white; border-bottom: 2px solid var(--primary); }
  .print-brand { color: var(--primary); font-size: 11pt; font-weight: 750; letter-spacing: -.02em; }
  .period { background: none; border: 0; padding: 0; gap: 1mm; text-align: right; }
  .period-caption { font-size: 7pt; }
  .period strong { font-size: 14pt; }
  .page-header { flex-direction: row; align-items: end; gap: 8mm; margin-bottom: 5mm; }
  h1 { font-size: 21pt; line-height: 1.15; }
  h2 { font-size: 11pt; }
  .subtitle { font-size: 9pt; margin-top: 2mm; }
  .header-actions { display: block; width: auto; text-align: right; }
  .metadata { margin: 0; font-size: 8pt; }
  .metrics { grid-template-columns: repeat(4,minmax(0,1fr)); margin-bottom: 4mm; padding: 4mm 0; break-inside: avoid; border-radius: 2mm; }
  .metric { padding: 0 5mm; }
  .metric h2 { font-size: 9pt; min-height: 0; }
  .metric strong { font-size: 25pt; margin: 2mm 0 1mm; }
  .metric p { font-size: 8pt; }
  .participation { display: grid; grid-template-columns: 63mm 1fr; align-items: center; gap: 6mm; padding: 0 0 5mm; break-inside: avoid; }
  .participation-title { font-size: 9pt; gap: 3mm; }
  .participation-title strong { font-size: 12pt; }
  .participation-detail { max-width: none; }
  .participation-detail p { font-size: 8pt; margin-top: 1.5mm; }
  .participation-track { height: 1.5mm; }
  .panel { box-shadow: none; border-radius: 2mm; overflow: visible; }
  .chart-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 5mm; margin: 0; break-inside: avoid; }
  .panel-heading { padding: 4mm 5mm 3mm; gap: 4mm; }
  .panel-heading p { font-size: 8pt; margin-top: 1mm; }
  .small-label { font-size: 8pt; }
  .ranking-chart { padding: 0 5mm 4mm; gap: 1.8mm; }
  .bar-row { grid-template-columns: 28mm minmax(20mm,1fr) 9mm; gap: 3mm; break-inside: avoid; }
  .bar-label, .bar-number { font-size: 9pt; }
  .bar-label { overflow: visible; text-overflow: clip; }
  .bar-track { height: 4mm; }
  .bar-fill { transition: none; }
  .composition-content { flex-direction: row; min-height: 0; gap: 5mm; padding: 4mm; }
  .donut { width: 30mm; height: 30mm; }
  .donut > div { width: 22mm; height: 22mm; }
  .donut strong { font-size: 19pt; }
  .donut span { font-size: 7pt; }
  .legend { flex: 1; grid-template-columns: 1fr; max-width: none; gap: 3mm; }
  .legend li { font-size: 8pt; gap: 2mm; }
  .legend-label { gap: 0; }
  .legend .swatch { width: 2mm; height: 2mm; }
  .performance-print-page { display: block; break-before: page; padding: 12mm 0; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
  .performance-panel { break-inside: auto; margin: 0; scroll-margin-top: 0; }
  .performance-panel .panel-heading { align-items: center; flex-wrap: nowrap; border-bottom: 1px solid var(--line); padding: 4mm 4mm 3mm; }
  .print-table-period { color: var(--primary); font-size: 11pt; font-weight: 650; white-space: nowrap; }
  #print-filter-summary { color: var(--ink); font-size: 8pt; margin-top: 2mm; }
  .table-scroll { overflow: visible; }
  .performance-table { table-layout: fixed; font-size: 9pt; }
  .performance-table th, .performance-table td { white-space: normal; padding: 2.5mm 2mm; line-height: 1.4; }
  .performance-table th { font-size: 8pt; color: #374151; background: #f3f6fb; }
  .performance-table th:first-child { width: 14%; }
  .performance-table th:nth-last-child(-n+3) { width: 11%; }
  .performance-table td:first-child, .performance-table th:first-child { padding-left: 4mm; }
  .column-heading { display: inline; }
  .account-name { font-size: 9pt; overflow-wrap: anywhere; }
  .account-person { display: block; }
  .zero { color: #6b7280; }
  .money-cell { white-space: nowrap !important; }
  thead { display: table-header-group; }
  tr { break-inside: avoid; }
  .bar-fill, .donut, .swatch, .participation-track, .participation-track span, .metrics, th { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

.review-header > div > p { color: var(--muted); font-size: .85rem; margin-top: 5px; }
.form-message { font-size: .82rem; line-height: 1.7; color: #64748b; margin-top: 18px; overflow-wrap: anywhere; scroll-margin-block: 120px 140px; }
.form-error { color: #b91c1c; background: #fef2f2; padding: 12px 15px; border-radius: 8px; }
.form-success { color: #15803d; background: #f0fdf4; padding: 12px 15px; border-radius: 8px; }
.form-message:empty { display: none; }
.dialog-close { display: grid; place-items: center; width: 34px; height: 34px; padding: 6px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #94a3b8; flex-shrink: 0; }
.dialog-close svg { width: 20px; height: 20px; }
.dialog-close:hover { color: var(--ink); background: #f1f5f9; }
.dialog-close:disabled { opacity: .4; cursor: default; }
.import-header { align-items: center; padding: 24px 28px; gap: 18px; }
.import-heading { display: flex; align-items: center; gap: 14px; min-width: 0; }
.import-heading-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: #eff6ff; border: 1px solid #dbeafe; color: var(--primary); flex-shrink: 0; }
.import-heading h2 { font-size: 1.2rem; letter-spacing: -.025em; }
.import-heading p { color: #64748b; font-size: .82rem; margin-top: 4px; }
.import-content { padding: 23px 28px 25px; }
.import-steps { display: flex; justify-content: center; gap: 28px; list-style: none; margin: 0 0 24px; padding: 0; }
.import-steps li { display: flex; align-items: center; gap: 8px; color: #64748b; font-size: .76rem; font-weight: 550; }
.import-steps li + li::before { content: ""; width: 24px; height: 1px; background: #dbe4f0; margin-right: 12px; }
.import-steps li > span { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid #dbeafe; background: #eff6ff; color: var(--primary); border-radius: 50%; font-size: .7rem; font-weight: 650; }
.import-period-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 18px 20px; background: #f7faff; border: 1px solid #e3ecfa; border-radius: 10px; margin-bottom: 26px; }
.import-period-row h3, .import-section-heading h3 { margin: 0; font-size: .9rem; font-weight: 650; }
.import-period-row p { color: #64748b; font-size: .78rem; margin-top: 5px; }
.import-period-row label { display: grid; gap: 5px; color: #64748b; font-size: .72rem; font-weight: 550; }
.import-period-field { display: grid; gap: 5px; }
.import-period-selects { display: flex; gap: 10px; flex-shrink: 0; }
.import-period-row select { min-width: 110px; border: 1px solid #cddcf2; border-radius: 7px; padding: 8px 30px 8px 10px; background-color: white; color: var(--ink); font-size: .88rem; font-weight: 600; }
.import-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.import-section-heading > span { font-size: .73rem; color: #94a3b8; }
.import-instructions { font-size: .8rem; color: #64748b; line-height: 1.8; margin: 7px 0 18px; max-width: 900px; }
.import-queries { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 14px; }
.import-card { min-width: 0; border: 1px solid #e2e8f0; border-radius: 11px; padding: 18px; background: white; transition: border-color .15s; }
.import-card.has-file { border-color: #93b8f7; }
.import-card-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.import-card-number { font-size: .76rem; font-weight: 700; color: #7294ca; font-variant-numeric: tabular-nums; }
.import-file-status { color: #94a3b8; font-size: .69rem; }
.has-file .import-file-status { color: #15803d; }
.import-card h3 { font-size: .91rem; margin: 0 0 5px; letter-spacing: -.015em; }
.import-card-description { font-size: .75rem; line-height: 1.7; color: #64748b; min-height: 2.55em; }
.import-sql { border: 0; margin: 12px 0 16px; }
.import-sql summary { padding: 0; color: var(--primary); font-size: .76rem; font-weight: 550; }
.query-toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.import-sql[open] .query-toolbar { margin-top: 13px; gap: 6px; }
.query-toolbar .button { font-size: .71rem; padding: 5px 9px; }
.import-sql pre { max-height: 210px; margin: 10px 0 0; font-size: .67rem; background: #f8fafc; padding: 12px; }
.import-upload { position: relative; display: flex; align-items: center; gap: 11px; padding: 16px 12px; min-height: 83px; border: 1px dashed #cad7eb; border-radius: 8px; background: #f8faff; cursor: pointer; }
.import-upload:hover { border-color: #93b8f7; background: #eff6ff; }
.import-upload:focus-within { outline: 2px solid var(--primary); outline-offset: 3px; }
.import-upload svg { width: 21px; height: 21px; color: var(--primary); }
.upload-copy { display: grid; min-width: 0; gap: 3px; }
.upload-title { color: var(--primary-hover); font-size: .77rem; font-weight: 600; }
.upload-filename { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .68rem; color: #8291a6; }
.has-file .upload-filename { color: #475569; }
.upload-size { font-size: .65rem; color: #94a3b8; }
.upload-size:empty { display: none; }
.import-file { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.import-file:disabled { cursor: wait; }
.import-footer { position: sticky; bottom: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 28px; background: white; border-top: 1px solid #e2e8f0; }
.import-footer strong { font-size: .78rem; font-weight: 600; }
.import-footer p { color: #94a3b8; font-size: .71rem; margin-top: 3px; }
.import-submit-row { display: flex; justify-content: end; gap: 10px; }
.import-submit-row .button { font-size: .8rem; }
.button.primary:disabled { background: #e2e8f0; color: #94a3b8; border-color: #e2e8f0; box-shadow: none; opacity: 1; }
#passcode-dialog { position: fixed; width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 32px; border: 1px solid #dce4f0; border-radius: 17px; background: white; color: var(--ink); box-shadow: 0 24px 90px #0f172a33; }
.passcode-dialog .dialog-close { position: absolute; right: 14px; top: 14px; }
.passcode-icon { display: grid; place-items: center; width: 50px; height: 50px; margin-bottom: 22px; border: 1px solid #dbeafe; border-radius: 13px; background: #eff6ff; color: var(--primary); }
.passcode-icon svg { width: 25px; height: 25px; }
.passcode-dialog h2 { font-size: 1.22rem; letter-spacing: -.025em; }
.passcode-dialog > p { margin-top: 8px; color: #64748b; font-size: .85rem; line-height: 1.7; }
#passcode-form { margin-top: 25px; }
#passcode-form > label { display: block; font-size: .8rem; font-weight: 600; margin-bottom: 8px; }
.passcode-input-wrap { position: relative; }
#import-passcode { width: 100%; min-height: 46px; padding: 10px 64px 10px 13px; border: 1px solid #cbd5e1; border-radius: 8px; background: white; color: var(--ink); font-size: .88rem; }
#import-passcode:focus { border-color: var(--primary); outline: 3px solid #2563eb12; outline-offset: 0; }
#import-passcode[aria-invalid="true"] { border-color: #ef4444; }
#toggle-passcode { position: absolute; right: 5px; top: 5px; height: 36px; padding: 0 10px; border: 0; border-radius: 5px; background: transparent; color: #64748b; font-size: .75rem; font-weight: 550; }
#toggle-passcode:hover { background: #f1f5f9; color: var(--primary); }
.passcode-error { color: #b91c1c; font-size: .77rem; margin-top: 9px; line-height: 1.6; }
.passcode-actions { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; margin-top: 26px; }
.passcode-actions .button { font-size: .83rem; min-height: 43px; }
.passcode-actions .primary span { margin-left: 8px; }
@media (max-width: 850px) {
  .import-queries { grid-template-columns: 1fr; }
  .import-card-description { min-height: 0; }
  .import-card-heading { margin-bottom: 9px; }
  .import-steps { gap: 16px; }
  .import-steps li + li::before { display: none; }
}
@media (max-width: 520px) {
  .period-trigger { min-height: 62px; gap: 9px; padding: 9px 12px; border-radius: 10px; }
  .period-calendar { width: 31px; height: 31px; border-radius: 7px; }
  .period-calendar svg { width: 18px; height: 18px; }
  #period-value { font-size: 1.05rem; }
  .period-caption { font-size: .61rem; }
  .period .period-chevron { margin-left: 1px; width: 16px; }
  .import-header { padding: 18px; gap: 10px; align-items: start; }
  .import-heading { gap: 10px; }
  .import-heading-icon { width: 36px; height: 36px; border-radius: 9px; }
  .import-heading h2 { font-size: 1.02rem; }
  .import-heading p { font-size: .74rem; }
  .import-content { padding: 18px; }
  .import-steps { justify-content: space-between; gap: 8px; margin-bottom: 20px; }
  .import-steps li { flex-direction: column; gap: 6px; font-size: .59rem; text-align: center; }
  .import-period-row { align-items: start; flex-direction: column; gap: 8px; }
  .import-period-row { padding: 15px; margin-bottom: 22px; }
  .import-period-selects { width: 100%; }
  .import-period-field { flex: 1; min-width: 0; }
  .import-period-row select { width: 100%; min-width: 0; }
  .import-period-row label { margin-top: 7px; }
  .import-section-heading { align-items: start; flex-direction: column; gap: 4px; }
  .import-footer { padding: 15px 18px; flex-wrap: wrap; gap: 12px; }
  .import-footer > div:first-child { display: flex; justify-content: space-between; align-items: center; width: 100%; gap: 10px; }
  .import-footer strong { font-size: .69rem; white-space: nowrap; }
  .import-footer p { font-size: .6rem; margin: 0; text-align: right; }
  .import-submit-row { width: 100%; }
  .import-submit-row .primary { flex: 1; }
  #passcode-dialog { padding: 27px 24px; }
}
@media (prefers-reduced-motion: reduce) { .period-trigger, .period-chevron, .import-card { transition: none; } }
@media print {
  .period-trigger, .period-panel, #passcode-dialog { display: none !important; }
  body:has(#import-dialog[open], #passcode-dialog[open]) { overflow: visible; }
}
