/* Quiet monochrome theme. Data and report structure are unchanged. */
:root {
  --bg: #eeeef0;
  --paper: #fff;
  --ink: #242428;
  --muted: #686870;
  --line: #e0e0e4;
  --light: #f4f4f6;
  --blue: #df8173;
  --teal: #f0c7aa;
  --accent: #de685d;
  --red: #b44038;
  --radius: 14px;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
body { background: var(--bg); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select { transition: background-color .15s, border-color .15s, box-shadow .15s; }
button:hover { filter: none; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
input, select { color: var(--ink); accent-color: var(--accent); }
.technical-shell { max-width: 1440px; margin: 24px auto; padding: 0 36px 24px; background: #f8f8f9; border: 1px solid #fff; border-radius: 22px; box-shadow: 0 8px 32px #24242806; }
.topbar { min-height: 80px; padding: 18px 0; gap: 20px; }
.brand { font-size: 17px; letter-spacing: -.6px; gap: 10px; }
.brand-icon { width: 35px; height: 35px; border-radius: 10px; background: #2d2d32; font-weight: 650; box-shadow: inset 0 1px 0 #ffffff24; }
.brand small { margin-top: 3px; font-family: var(--mono); font-size: 8px; font-weight: 400; letter-spacing: 1.2px; }
.tools { gap: 8px; }
.tools .updated { font-family: var(--mono); font-size: 9px; max-width: 175px; line-height: 1.6; }
#account-name { font-size: 11px; color: var(--muted); padding: 0 5px; }
.btn { border: 1px solid #dcdce0; background: white; border-radius: 9px; padding: 9px 14px; font-size: 12px; font-weight: 500; box-shadow: 0 1px 2px #24242805; }
.btn:hover { background: #f0f0f3; border-color: #bfbfc7; }
.btn.primary, #admin-open { background: #2d2d32; color: #fff; border-color: #2d2d32; box-shadow: inset 0 1px 0 #ffffff16, 0 2px 3px #2424280a; }
.btn.primary:hover, #admin-open:hover { background: #424249; }
#logout { border-color: transparent; background: transparent; box-shadow: none; color: var(--muted); }
#logout:hover { color: var(--ink); background: #eeeef1; }
.heading { padding: 38px 0 28px; }
.eyebrow { display: flex; align-items: center; gap: 8px; font: 10px/1.5 var(--mono); letter-spacing: 1.7px; color: var(--muted); }
.heading .eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
h1 { font-size: clamp(32px, 3.5vw, 48px); line-height: 1.1; font-weight: 750; letter-spacing: -1.8px; max-width: 800px; margin: 13px 0 12px; }
.heading p { font-size: 13px; }
.period { background: transparent; font: 10px/1.5 var(--mono); color: var(--muted); border: 1px solid var(--line); padding: 8px 12px; border-radius: 7px; }
.filter-panel { background: #f0f0f2; border: 1px solid #e7e7eb; border-radius: 12px; padding: 4px 16px 12px; }
.filters { gap: 14px; }
.filters label { font-size: 10px; font-weight: 500; color: #62626c; }
.filters select, .filters input { border-color: #dedee3; background: #fff; border-radius: 8px; min-height: 38px; padding: 9px 11px; box-shadow: 0 1px 2px #24242804; }
.filters select:hover, .filters input:hover { border-color: #bcbcc5; }
#reset { min-height: 38px; background: transparent; border-color: #d6d6dc; box-shadow: none; }
.more-filters summary { font-size: 11px; padding-top: 8px; width: fit-content; }
.more-filters[open] summary { color: var(--ink); }
.scope { margin: 13px 0 22px; font-size: 10px; align-items: baseline; }
.scope strong { font-weight: 500; font-family: var(--mono); }
.scope>span { color: #72727c; }
.view-tools { gap: 18px; margin: 0 0 30px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-nav { gap: 4px; }
.section-nav button { font-size: 12px; border-radius: 7px; padding: 8px 12px; color: var(--muted); }
.section-nav button:hover { color: var(--ink); background: #ececef; }
.section-nav button[aria-current=true] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px #24242812; }
.section-nav button[aria-current=true]::before { content: ""; display: inline-block; width: 5px; height: 5px; margin: 0 7px 2px 0; border-radius: 50%; background: var(--accent); }
.segments { background: #eaeaec; padding: 3px; border: 1px solid #e6e6e9; border-radius: 9px; gap: 2px; }
.segments button { padding: 7px 12px; border-radius: 6px; font-size: 11px; }
.segments button.active { box-shadow: 0 1px 4px #24242815; }
.report-page { margin-bottom: 40px; scroll-margin-top: 24px; }
.page-heading { align-items: center; margin-bottom: 16px; }
.page-heading h2 { font-size: 22px; font-weight: 650; letter-spacing: -.7px; }
.page-heading p { font-size: 11px; margin-top: 5px; }
.page-number { background: transparent; border: 0; padding: 0 0 0 12px; border-left: 1px solid #d6d6db; border-radius: 0; font: 10px var(--mono); color: #82828c; }
.page-legend { font: 10px var(--mono); gap: 12px; }
.direction-dot { width: 7px; height: 7px; border-radius: 2px; }
.metrics { grid-template-columns: repeat(3,minmax(0,1fr)); border: 0; background: transparent; gap: 16px; border-radius: 0; margin-bottom: 18px; overflow: visible; }
.metric, .metric:last-child { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 22px 24px; position: relative; }
.metric::after { content: ""; position: absolute; top: 24px; right: 24px; width: 6px; height: 6px; background: #d1d1d7; border-radius: 50%; }
.metric:first-child::after { background: var(--accent); }
.metric-label { text-transform: uppercase; letter-spacing: 1.3px; font: 10px var(--mono); color: var(--muted); }
.metric-value { font: 400 36px/1.15 var(--mono); letter-spacing: -2.5px; font-variant-numeric: tabular-nums; color: var(--ink); margin: 16px 0 5px; }
.metric-foot { font-size: 11px; min-height: 17px; }
.page-grid { gap: 18px; }
.panel { padding: 24px; border-radius: 14px; border-color: var(--line); box-shadow: 0 2px 3px #24242802; }
.panel-head { margin-bottom: 18px; }
.panel-head h3 { font-size: 15px; letter-spacing: -.25px; font-weight: 600; }
.panel-head p { font-size: 11px; color: #72727b; }
.chart-grid { stroke: #e7e7eb; stroke-dasharray: 2 5; }
.chart-number { font-family: var(--mono); font-weight: 500; }
.chart-tick { font-family: var(--mono); }
.chart-hit:hover .hit-bg, .chart-hit:focus .hit-bg { fill: transparent; stroke: none; }
.chart-hit:focus-visible { outline-color: var(--accent); }
.chart-key { gap: 10px 18px; margin: 14px 0 2px; }
.chart-key i { border: 1px solid #24242818; }
.chart-key b { font-family: var(--mono); font-weight: 500; }
.stack-caption { font-family: var(--mono); font-weight: 500; }
.matrix-controls, .rank-controls { padding: 12px 0 16px; border-bottom: 1px solid #eeeef1; margin: 0 0 18px; }
.matrix-controls label, .rank-controls label { font-size: 11px; }
.matrix-controls select, .rank-controls select, .rank-controls input { background: #f8f8f9; border-color: var(--line); border-radius: 7px; min-height: 34px; font-size: 11px; }
.heatmap { border-spacing: 5px; }
.heatmap td { background: #f1f1f4; border-radius: 5px; }
.heatmap button { font-family: var(--mono); font-weight: 400; }
.heatmap button:hover, .heatmap button:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.heatmap .zero { color: #94949d; }
.heat-scale { margin: 16px 5px; font-size: 10px; }
.heat-scale .gradient { background: linear-gradient(90deg,#fcf2ef,#efc2ad,#e49589); }
.relation-insights { gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.relation-insight { background: #f7f7f9; border: 0; border-radius: 8px; padding: 14px; font-size: 10px; }
.relation-insight strong { font: 400 24px/1.3 var(--mono); letter-spacing: -1px; }
footer { padding-top: 0; border-top: 1px solid var(--line); padding-top: 20px; font-family: var(--mono); }
.dialog { border: 1px solid #dcdce0; border-radius: 18px; box-shadow: 0 24px 100px #24242835; background: #fff; }
.dialog::backdrop { background: #24242866; backdrop-filter: blur(5px); }
.dialog-head { padding: 22px 28px; background: #fafafb; }
.dialog-head h2 { font-size: 21px; font-weight: 650; letter-spacing: -.6px; }
.dialog-head .small { font-family: var(--mono); font-size: 10px; margin-bottom: 0; }
.dialog-head .btn { width: 34px; height: 34px; padding: 0; flex-shrink: 0; }
.dialog-body { padding: 6px 28px 24px; }
.topic-item { padding: 24px 0; }
.topic-item h3 { font-size: 15px; line-height: 1.55; font-weight: 600; letter-spacing: -.15px; }
.case-summary { gap: 6px; margin: 12px 0; }
.case-summary span { background: #f0f0f3; border-radius: 5px; padding: 3px 7px; font-size: 10px; }
.case-summary span:first-child { font-family: var(--mono); color: var(--ink); }
.case-action { background: #f6f6f8; border-radius: 8px; padding: 14px; margin-top: 16px; font-size: 12px; line-height: 1.65; }
.case-action strong { display: inline-block; margin-bottom: 3px; font-weight: 600; }
.tabs button { font-size: 12px; font-weight: 500; }
.tabs button[aria-selected=true] { border-bottom-color: var(--accent); }
.data-table th { background: #f5f5f7; font-family: var(--mono); font-weight: 400; font-size: 9px; }
.data-table td { border-bottom-color: var(--line); }
.tag, .tag.teal, .tag.blue { color: #45454e; background: #ededf1; }
.upload-box { background: #f7f7f9; border-color: #bfbfc8; }
.import-stats { background: #f1f1f4; }
.import-stats strong { font-family: var(--mono); font-weight: 400; }
.confirm-box { background: #f4f4f6; border-color: #c8c8d0; }
.success { background: #eff3f0; color: #3c5844; }
.form-error, .error { background: #fff2f0; color: #a43c32; border-color: #efc3bd; }
.notice { background: #f7f3ec; color: #706047; border-color: #e4dbca; }
.login-page { background: #eeeef0; }
.login-card { background: #fafafb; box-shadow: 0 12px 60px #2424280a; padding: 40px; border-color: #fff; border-radius: 18px; }
.login-card h1 { font-size: 34px; letter-spacing: -1.3px; }
.login-card .brand { margin-bottom: 44px; }
.login-card input, .manage input { border-color: #dcdce2; }
@media(min-width:1500px) { .technical-shell { margin: 32px auto; } }
@media(max-width:1100px) {
  .technical-shell { margin: 12px; padding: 0 24px 24px; }
  .tools .updated { display: none; }
  .view-tools { align-items: flex-start; }
  .section-nav { gap: 3px; }
  .section-nav button { padding: 8px 10px; }
}
@media(max-width:760px) {
  .technical-shell { margin: 8px; border-radius: 16px; padding: 0 20px 20px; }
  .topbar { flex-wrap: wrap; padding: 16px 0; min-height: auto; }
  .tools { gap: 5px; }
  #account-name { font-size: 10px; }
  .heading { padding: 28px 0 22px; }
  h1, .heading h1 { font-size: 34px; letter-spacing: -1.2px; }
  .heading { align-items: flex-start; }
  .period { font-size: 9px; padding: 6px 8px; }
  .view-tools { display: block; padding: 10px 0; }
  .view-tools>.segments { margin-top: 10px; width: max-content; }
  .page-heading h2 { font-size: 20px; }
  .page-legend { gap: 8px; }
  .metric, .metric:last-child { padding: 18px; }
  .metric-value { font-size: 30px; letter-spacing: -1.8px; }
  .metric::after { top: 20px; right: 18px; }
  .scope { display: block; }
  .scope>span { display: block; margin-top: 5px; }
  .panel { padding: 20px 16px; }
  .relation-insights { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media(max-width:650px) {
  body:not(.pdf-mode) .metrics { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
  .metric, .metric:last-child { border: 1px solid var(--line); padding: 16px 12px; }
  .metric-label { font-size: 9px; min-height: 0; letter-spacing: .5px; }
  .metric-value { font-size: 28px; }
  .metric-foot { font-size: 9px; }
  .metric::after { display: none; }
  .panel { overflow-x: auto; }
  .chart-svg { min-width: 620px; }
  .chart-svg.client-rank { min-width: 940px; }
  .page-heading { align-items: flex-start; gap: 10px; }
  .page-legend { font-size: 9px; }
  .page-number { display: none; }
  .rank-controls { justify-content: flex-start; gap: 10px; }
  .rank-controls label { flex-wrap: wrap; gap: 5px; }
  .dialog-head, .dialog-body { padding-left: 20px; padding-right: 20px; }
  .login-card { padding: 28px; }
}
@media(max-width:420px) {
  .technical-shell { margin: 0; border: 0; border-radius: 0; padding: 0 16px 20px; }
  .topbar { gap: 14px; }
  .tools { width: 100%; justify-content: space-between; }
  h1, .heading h1 { font-size: 31px; }
  .heading p { font-size: 12px; }
  .filters { gap: 10px; }
  .filter-panel { padding: 2px 12px 10px; }
  .filters label { min-width: 125px; }
  .section-nav { gap: 2px; }
  .section-nav button { font-size: 11px; padding: 8px; }
  .page-heading h2 { font-size: 18px; }
  .page-legend { gap: 5px; }
  .metric-value { font-size: 26px; }
}
@media(prefers-reduced-motion:reduce) { *, *::before, *::after { transition: none!important; animation: none!important; scroll-behavior: auto!important; } }

/* Compact report chrome and consistent native select controls. */
.topbar { justify-content: flex-end; min-height: 64px; padding: 14px 0; }
.heading { padding: 24px 0; }
.heading h1 { margin-top: 0; }
.view-tools { margin-top: 20px; }
.login-card .eyebrow { display: none; }
.filters select, .matrix-controls select, .rank-controls select, .manage select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='m3.5 5.25 3.5 3.5 3.5-3.5' fill='none' stroke='%23686870' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  text-overflow: ellipsis;
}
.chart-hit:hover .hit-bg, .chart-hit:focus .hit-bg { fill: transparent; stroke: none; }
.heatmap button:hover { box-shadow: none; background: #ffffff26; }
.heatmap button:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.ranking-row { cursor: default; }
.ranking-row .hit-bg { fill: transparent; }
@media(max-width:760px) { .heading { padding: 24px 0 20px; } }

/* Direction colors are distinct from company groups. */
.direction-dot.ru { background: #649b92; }
.direction-dot.int { background: #9e91b5; }
.heading h1 { font-size: 32px; letter-spacing: -1px; }
.chart-hit:hover .hit-bg { fill: transparent; stroke: none; }
.chart-hit:not(:focus-visible) { outline: none; }
.heatmap button:not(:focus-visible):hover { box-shadow: none; outline: none; }
@media(max-width:650px) { .heading h1 { font-size: 28px; letter-spacing: -.8px; } }

/* Larger chart rows with clear gaps; no pointer hover frame or fill. */
.chart-label { font-size: 13px; }
.chart-number { font-size: 15px; }
.chart-tick { font-size: 11px; }
.client-rank .chart-label { font-size: 13px; }
.chart-hit, .chart-hit:hover, .chart-hit:focus, .chart-hit:focus-visible {
  outline: none; box-shadow: none;
}
.chart-hit .hit-bg, .chart-hit:hover .hit-bg, .chart-hit:focus .hit-bg {
  fill: transparent; stroke: none;
}
.chart-hit:focus-visible .chart-label { text-decoration: underline; }

/* Regular-weight typography and native font smoothing. */
body {
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
}
h1, h2, h3, h4, strong, b,
.heading h1, .page-heading h2, .panel-head h3, .dialog-head h2,
.topic-item h3, .btn, .filters label, .section-nav button,
.chart-label, .chart-number, .chart-key b, .stack-caption,
.heatmap th, .heatmap tbody th, .metric-label, .metric-value {
  font-weight: 400;
}

/* Subtle feedback on clickable chart bars, without a row frame. */
.chart-hit > rect:not(.hit-bg) { transition: opacity .15s ease; }
@media (hover: hover) {
  .chart-hit:hover > rect:not(.hit-bg) { opacity: .75; }
}
@media (prefers-reduced-motion: reduce) {
  .chart-hit > rect:not(.hit-bg) { transition: none; }
}

/* Quieter summary figures and main heading. */
.metric-value { font-size: 24px; letter-spacing: -.6px; }
.heading h1 { font-size: 22px; letter-spacing: -.4px; }
@media(max-width:650px) {
  .metric-value { font-size: 22px; letter-spacing: -.5px; }
  .heading h1 { font-size: 20px; }
}

/* Minimal sign-in form with a white action. */
.login-card form { margin-top: 0; }
.login-card button { margin-bottom: 0; }
.login-card .btn.primary {
  background: #fff;
  border-color: #dcdce0;
  color: #242428;
  box-shadow: none;
}
.login-card .btn.primary:hover { background: #f5f5f7; border-color: #dcdce0; }
