/* Client-facing layer, Oct 2026: readable type scale, web dropdowns,
   investment by line, reach coverage and best practices. */

/* ---------- Readability: the base type ran at 6–9px ---------- */
@media (min-width: 1101px) {
  body { zoom: 1.2; }
}
@media (min-width: 821px) and (max-width: 1100px) {
  body { zoom: 1.12; }
}

/* ---------- Native dropdown fallback (Windows renders a white list) ---------- */
select option, select optgroup { background: #0d1215; color: #e6ecee; }

/* ---------- Web dropdown ---------- */
.ui-select-native {
  position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important;
  pointer-events: none !important; opacity: 0 !important;
}
.ui-select { position: relative; min-width: 0; }
.ui-select-button {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; min-height: 22px; padding: 0; border: 0; background: transparent;
  color: #e3e9eb; font-size: 10px; font-weight: 500; text-align: left; cursor: pointer;
}
.ui-select-button:focus-visible { outline: 1px solid var(--amber); outline-offset: 3px; }
.ui-select-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-select-caret {
  flex: 0 0 auto; width: 7px; height: 7px; margin-top: -3px;
  border-right: 1.5px solid #8d999e; border-bottom: 1.5px solid #8d999e;
  transform: rotate(45deg); transition: transform .15s ease;
}
.ui-select.is-open .ui-select-caret { transform: rotate(-135deg); margin-top: 3px; border-color: var(--amber); }
.ui-select.is-disabled .ui-select-button { cursor: default; color: #5d686d; }
.ui-select-list {
  position: absolute; z-index: 60; top: calc(100% + 10px); left: -12px; right: -12px;
  min-width: 170px; max-height: 300px; overflow-y: auto; margin: 0; padding: 5px;
  list-style: none; background: #0b1012; border: 1px solid #2a383e; border-radius: 4px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, .55);
}
.ui-select-list[hidden] { display: none; }
.ui-select-list li {
  padding: 8px 10px; border-radius: 3px; color: #c9d2d5; font-size: 10px; line-height: 1.3;
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ui-select-list li.is-focused { background: #172126; color: #ffffff; }
.ui-select-list li[aria-selected="true"] { color: var(--amber); font-weight: 600; }
.ui-select-list li[aria-selected="true"]::before { content: "✓"; display: inline-block; width: 14px; }
.ui-select-list li[aria-selected="false"]::before { content: ""; display: inline-block; width: 14px; }
.ui-select-list li[aria-disabled="true"] { opacity: .4; cursor: default; }
.period-control .ui-select { min-width: 92px; }
.period-control .ui-select-list { left: -10px; right: auto; min-width: 140px; }
.global-filters label { overflow: visible !important; }
.global-filters { position: relative; z-index: 30 !important; }

/* Filter grid now holds Country, Platform, Line, Campaign, Retailer, OEM, Week */
@media (min-width: 1101px) {
  .global-filters { grid-template-columns: repeat(7, minmax(0, 1fr)) !important; }
}

/* ---------- Investment by line ---------- */
.line-mainstream { --line: #4fd7e8; }
.line-gaming { --line: #f5aa16; }
.line-ai { --line: #6bd7a5; }
.line-dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--line); vertical-align: 0; }
.lines-grid { grid-template-columns: 1fr; align-items: start; }
.line-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 9px; color: #9aa6ab; }
.line-legend span { display: inline-flex; align-items: center; }
.line-quarters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.line-quarter { padding: 12px 12px 10px; border: 1px solid #162024; border-radius: 4px; }
.line-quarter.is-current { border-color: rgba(245, 170, 22, .45); background: rgba(245, 170, 22, .03); }
.line-quarter-head { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 11px; }
.line-quarter-head span { color: #9aa6ab; font-variant-numeric: tabular-nums; }
.line-stack-row { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 8px; margin-top: 6px; }
.line-stack-row small { font-size: 8px; color: #6b777c; text-transform: uppercase; letter-spacing: .08em; }
.line-stack { display: flex; height: 20px; overflow: hidden; border-radius: 3px; background: #121a1d; }
.line-stack i { display: flex; align-items: center; justify-content: center; height: 100%; background: var(--line); min-width: 2px; }
.line-stack i span { font-size: 9px; font-style: normal; font-weight: 700; color: #041014; }
.line-stack.pending, .line-stack.empty { align-items: center; padding: 0 10px; font-size: 9px; color: #6f7c81; background: repeating-linear-gradient(135deg, #0e1417 0 6px, #11191c 6px 12px); }
.lines-table td, .lines-table th { font-size: 10px; }
.lines-table tr.is-active td { background: rgba(245, 170, 22, .05); }
.lines-table td:first-child { white-space: nowrap; }
.muted-cell { color: #6c787d; font-style: italic; }
.lines-note { margin: 0; padding: 12px 16px 14px; color: #8d999e; font-size: 9px; line-height: 1.6; }
.coverage-panel { margin-top: 9px; }
.coverage-panel .table-toolbar { align-items: center; }
.coverage-panel .table-toolbar h3 { margin: 4px 0 0; font-size: 14px; color: #e8edef; }
.coverage-panel .lines-note + .lines-note { padding-top: 0; }

/* ---------- Best practices ---------- */
.bp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.bp-card { display: flex; flex-direction: column; gap: 14px; }
.bp-card.is-current { border-color: rgba(245, 170, 22, .5); box-shadow: inset 0 2px 0 var(--amber); }
.bp-head { display: flex; justify-content: space-between; align-items: center; }
.bp-quarter { font-size: 22px; font-weight: 800; letter-spacing: -.04em; color: var(--amber); }
.bp-period { font-size: 9px; color: #7f8b90; text-transform: uppercase; letter-spacing: .1em; }
.bp-card h3 { margin: 0; font-size: 14px; line-height: 1.4; color: #eef2f3; letter-spacing: -.01em; }
.bp-metrics { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid #172126; border-bottom: 1px solid #172126; }
.bp-metrics div { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.bp-metrics strong { order: 2; font-size: 12px; color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bp-metrics span { font-size: 9px; color: #8b979c; }
.bp-list { margin: 0; padding-left: 18px; display: grid; gap: 12px; }
.bp-list li::marker { color: var(--amber); font-weight: 700; font-size: 10px; }
.bp-list strong { display: block; margin-bottom: 4px; font-size: 11px; color: #e6ecee; }
.bp-list p { margin: 0 0 3px; font-size: 10px; line-height: 1.55; color: #a3afb3; }
.bp-list b { color: #cfd7da; font-weight: 600; }
.bp-carry { margin-top: auto; padding: 10px 12px; border-left: 2px solid var(--amber); background: rgba(245, 170, 22, .05); font-size: 10px; line-height: 1.5; color: #d7dee0; }
.bp-carry span { display: block; margin-bottom: 3px; font-size: 8px; letter-spacing: .12em; text-transform: uppercase; color: var(--amber); }
.bp-source { padding-left: 2px; }

@media (max-width: 1250px) {
  .bp-grid { grid-template-columns: 1fr; }
  .lines-grid { grid-template-columns: 1fr; }
}

/* ---------- Mobile ---------- */
@media (max-width: 820px) {
  .global-filters { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .ui-select-button { font-size: 13px; min-height: 28px; }
  .ui-select-list li { font-size: 13px; padding: 11px 10px; }
  .ui-select-list { max-height: 55vh; }
  .global-filters label > span { font-size: 9px !important; }
  .global-filters input { font-size: 13px !important; }
  .bp-card h3 { font-size: 16px; }
  .bp-list p, .lines-note, .bp-carry { font-size: 12px; }
  .bp-list strong { font-size: 13px; }
  .bp-metrics span { font-size: 11px; }
  .bp-metrics strong { font-size: 13px; }
  .lines-table td, .lines-table th { font-size: 12px; }
  .line-legend { font-size: 11px; }
  .line-stack-row small { font-size: 10px; }
  .line-stack i span { font-size: 10px; }
  td { font-size: 11px !important; }
  th { font-size: 9px !important; }
}
@media (max-width: 560px) {
  .global-filters { grid-template-columns: 1fr 1fr !important; }
  .bp-metrics div { flex-direction: column; gap: 2px; }
  .bp-metrics strong { order: 0; }
}
.period-control .ui-select span.ui-select-value { display: inline-block !important; }
.period-control .ui-select span.ui-select-caret { display: inline-block !important; }
.period-control .ui-select-button { font-size: 10px; color: #e3e9eb; min-height: 28px; padding: 0 2px; }

/* Table and input legibility across the dashboard */
td { font-size: 10px; }
th { font-size: 8px; }
.global-filters input { font-size: 10px !important; color: #e3e9eb !important; }
.lines-table { min-width: 760px !important; }
@media (max-width: 1100px) { .line-quarters { grid-template-columns: 1fr; } }
