/* Surfaces displayed over the atlas. */
.command-panel,
#dialog {
  --ink: #edf5f4;
  --muted: #aebfc4;
  --border: #314957;
  --panel: #122a38;
  --panel-inset: #0c212e;
  --panel-rule: #304755;
  --mint: #91dec1;
  --green: #94dabe;
  --sand: #edcf96;
  color: var(--ink);
  color-scheme: dark;
}

.command-panel-body {
  scrollbar-color: #496473 #132835;
  overscroll-behavior: contain;
}

:is(.command-panel, #dialog) :is(.panel, .metric) {
  background: var(--panel);
  border-color: var(--panel-rule);
  border-radius: 12px;
  box-shadow: 0 2px 7px #080f1640;
}

.command-panel :is(.section-heading h2, .panel-heading h3, .catalog-card h3, .trade-hero h2) {
  color: var(--ink);
}

.command-panel .section-heading > span {
  color: var(--muted);
  font-size: 0.83rem;
}

.command-panel .section-panel .panel-heading {
  border-bottom-color: var(--panel-rule);
}

.command-panel .catalog-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 12px;
}

.command-panel .catalog-card {
  padding: 15px;
}

.command-panel .catalog-card h3 {
  overflow-wrap: anywhere;
}

.command-panel .catalog-card p {
  margin-bottom: 16px;
}

.command-panel .catalog-data {
  padding-block: 8px 2px;
  border-top: 1px solid var(--panel-rule);
}

.command-panel .catalog-data strong {
  color: var(--sand);
  font-variant-numeric: tabular-nums;
  white-space: normal;
}

.command-panel .appointment-form select {
  min-width: 0;
  text-overflow: ellipsis;
}

.command-panel .detail-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
}

.command-panel .metrics {
  grid-template-columns: repeat(auto-fit, minmax(min(43%, 142px), 1fr));
  gap: 9px;
}

.command-panel .metric {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: center;
  align-items: center;
  column-gap: 8px;
  min-height: 92px;
  padding: 11px;
}

.command-panel .metric .iconbox {
  grid-row: span 2;
  width: 29px;
  height: 29px;
}

.command-panel .metric .iconbox svg {
  width: 17px;
  height: 17px;
}

.command-panel .metric-label {
  color: var(--muted);
  align-self: end;
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.2;
}

.command-panel .metric > strong {
  margin: 3px 0 0;
  font-size: clamp(0.98rem, 1.48vw, 1.4rem);
  line-height: 1.14;
  white-space: normal;
}

.command-panel .metric-note {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.74rem;
}

.command-panel .metric-note.up { color: #9ce7c0; }
.command-panel .metric-note.down { color: #ffc3a5; }

:is(.command-panel, #dialog) .iconbox.mint {
  color: #a3eed0;
  background: #224c48;
}

:is(.command-panel, #dialog) .iconbox.amber {
  color: #f3d699;
  background: #514337;
}

:is(.command-panel, #dialog) .iconbox.blue {
  color: #b2dded;
  background: #294b61;
}

:is(.command-panel, #dialog) .iconbox.violet {
  color: #d3c4fa;
  background: #41405c;
}

:is(.command-panel, #dialog) .badge {
  border: 1px solid transparent;
  font-size: 0.72rem;
}

:is(.command-panel, #dialog) .badge.neutral {
  background: #213d4b;
  border-color: #355261;
  color: #cbdee3;
}

:is(.command-panel, #dialog) .badge.mint {
  background: #23483e;
  border-color: #3b6957;
  color: #9fe1bc;
}

:is(.command-panel, #dialog) .badge.amber {
  background: #4e4131;
  border-color: #776348;
  color: #f2d398;
}

:is(.command-panel, #dialog) .button {
  min-height: 40px;
  border-radius: 8px;
  white-space: normal;
  text-wrap: balance;
}

:is(.command-panel, #dialog) .button.compact {
  min-height: 36px;
}

:is(.command-panel, #dialog) .button:is(.dark, .primary) {
  background: #9bddbd;
  border-color: #b4e9cc;
  color: #102e2a;
}

:is(.command-panel, #dialog) .button:is(.dark, .primary):hover:not(:disabled) {
  background: #b7f0d1;
  color: #0b2521;
}

:is(.command-panel, #dialog) .button.secondary {
  background: #213d4b;
  border-color: #44616e;
  color: #e6f0ef;
}

:is(.command-panel, #dialog) .button.secondary:hover:not(:disabled) {
  background: #2a4b5c;
  border-color: #83b2ac;
  color: #f5fbfa;
}

:is(.command-panel, #dialog) :is(select, .field input, textarea) {
  background: var(--panel-inset);
  border-color: #486371;
  color: var(--ink);
  min-height: 40px;
}

:is(.command-panel, #dialog) :is(input, textarea)::placeholder {
  color: #9eb2bb;
}

:is(.command-panel, #dialog) select {
  background:
    linear-gradient(45deg, transparent 50%, #b7cbce 50%) calc(100% - 15px) center / 5px 5px no-repeat,
    linear-gradient(135deg, #b7cbce 50%, transparent 50%) calc(100% - 10px) center / 5px 5px no-repeat,
    var(--panel-inset);
}

:is(.command-panel, #dialog) .range-field input {
  accent-color: var(--mint);
}

:is(.command-panel, #dialog) .range-field output {
  background: #263f44;
  border: 1px solid #406258;
  border-radius: 6px;
  color: var(--mint);
  padding: 2px 8px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

:is(.command-panel, #dialog) .range-field small {
  color: var(--muted);
}

:is(.command-panel, #dialog) :is(.lines div, .agreement, .candidate, th, td) {
  border-bottom-color: var(--panel-rule);
}

:is(.command-panel, #dialog) thead {
  background: #1e3b4a;
  color: #c5dadd;
}

:is(.command-panel, #dialog) tbody tr:nth-child(even) {
  background: #0e2431;
}

.command-panel .notice {
  background: #163947;
  border-color: #45636d;
  color: #d2e5e8;
}

.command-panel .country-tabs button {
  background: var(--panel-inset);
  border-color: #3e5a67;
  color: #dce9ea;
  min-height: 39px;
}

.command-panel .country-tabs button:hover {
  border-color: #89b4a8;
}

.command-panel .country-tabs button.current {
  background: #2d4e45;
  border-color: #76ae97;
  color: #c2efdb;
}

.command-panel .trade-hero {
  background: linear-gradient(120deg, #204247, #122a38 58%);
}

.command-panel .loan-summary {
  background: #102533;
  border: 1px solid #3b5963;
}

.command-panel .loan-summary strong {
  color: var(--sand);
}

:is(.command-panel, #dialog) .vote-row small {
  color: var(--muted);
}

:is(.command-panel, #dialog) .vote-track { background: #314954; }
:is(.command-panel, #dialog) .vote-track i { background: #8eacd4; }
:is(.command-panel, #dialog) .vote-row:first-child .vote-track i { background: #87d4b4; }
:is(.command-panel, #dialog) .vote-row:last-child:not(:first-child) .vote-track i { background: #d0ab74; }

.command-panel .chart-wrap {
  background: #edf3f5;
  border-radius: 8px;
  padding-top: 7px;
  margin-inline: 12px;
}

.command-panel .chart-key { color: #9fdbcb; }
.command-panel .agenda-item { border-top-color: var(--panel-rule); }
.command-panel .news-grid article { background: var(--panel-inset); }
:is(.command-panel, #dialog) :is(.news-grid, .news-list) small { color: var(--sand); }

#dialog {
  background: linear-gradient(155deg, #1b3844, #0e2331 65%);
  border: 1px solid #668079;
  border-top-color: #dbbc83;
  box-shadow: 0 24px 92px #020a10d4;
  scrollbar-color: #496473 #132835;
}

#dialog::backdrop {
  background: #071823bd;
}

#dialog .dialog-inner {
  padding: clamp(18px, 4vw, 28px);
}

#dialog .dialog-inner h2 {
  color: var(--sand);
}

#dialog .dialog-close {
  background: #223d4b;
  border: 1px solid #4a6571;
  color: #e1efef;
}

#dialog .dialog-close:hover {
  background: #315566;
}

#dialog .dialog-body > p {
  color: #c4d4d8;
}

#dialog .dialog-body > p strong {
  color: #f3f7f5;
}

#dialog .guide-list li::marker {
  color: var(--sand);
}

#dialog #design-form {
  background: var(--panel-inset);
  border: 1px solid var(--panel-rule);
  border-radius: 10px;
}

#dialog .final-score {
  background: #20493e;
  border: 1px solid #466e5c;
  color: #b2eacd;
}

/* Newsprint within the map's dispatch panel. */
.field-report {
  --report-ink: #162b30;
  --report-muted: #42565a;
  --report-accent: #32645a;
  background: #ece8d9;
  color: var(--report-ink);
  border: 1px solid #f1ede1;
  border-radius: 9px;
  padding: clamp(13px, 3.5vw, 25px);
  overflow: auto;
  overscroll-behavior: contain;
  color-scheme: light;
}

.field-report .report-masthead {
  display: grid;
  gap: 7px;
  border-block: 3px double var(--report-ink);
  padding: 10px 0 12px;
  text-align: center;
}

.field-report .report-kicker {
  color: var(--report-accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.field-report .report-headline {
  color: var(--report-ink);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.75rem, 4.4vw, 3.1rem);
  line-height: 0.99;
  font-weight: 700;
  letter-spacing: -0.05em;
  text-wrap: balance;
}

.field-report .report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 13px;
  margin-top: 14px;
}

.field-report .report-article {
  min-width: 0;
  margin: 0;
  padding: 11px;
  border: 1px solid #b8b6a5;
  border-top: 3px solid var(--report-accent);
  background: #f5f0e2;
  overflow-wrap: anywhere;
}

.field-report .report-article :is(time, small, .report-kicker) {
  color: #365f53;
  font-size: 0.72rem;
  font-weight: 800;
}

.field-report .report-article :is(h2, h3, h4) {
  margin-top: 4px;
  color: var(--report-ink);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.21rem;
  line-height: 1.15;
}

.field-report .report-article p,
.field-report .report-empty {
  color: var(--report-muted);
  font-size: 0.87rem;
  line-height: 1.55;
}

.field-report .report-article p {
  margin-top: 6px;
}

@media (max-width: 640px) {
  .command-panel .catalog-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 165px), 1fr));
  }

  .command-panel .section-heading {
    display: grid;
  }

  .command-panel .section-heading > span {
    text-align: left;
  }

  .command-panel .catalog-card {
    padding: 11px;
  }

  .command-panel .metric {
    padding: 8px;
  }

  :is(.command-panel, #dialog) :is(select, .field input, textarea) {
    font-size: 1rem;
  }

  :is(.command-panel, #dialog) .button.compact {
    min-height: 41px;
  }
}
