/* The page around the grid. The grid brings its own stylesheet. */

:root {
  --ink: #101828;
  --ink-soft: #475467;
  --line: #e4e7ec;
  --page: #f7f8fa;
  --panel: #ffffff;
  --accent: #123a6b;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--page);
  color: var(--ink);
  font: 14px/1.5 "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#app {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
  padding: 18px 20px 14px;
}

/* The masthead */

.head {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
}

.head h1 {
  color: var(--accent);
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin: 0 0 3px;
}

.lede {
  color: var(--ink-soft);
  margin: 0;
  max-width: 78ch;
}

.head-note {
  align-items: center;
  color: var(--ink-soft);
  display: flex;
  font-size: 12px;
  gap: 10px;
}

.pill {
  background: var(--accent);
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  text-transform: uppercase;
}

/* The tiles */

.kpi-strip {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 3fr) minmax(210px, 1fr);
  padding: 9px 11px;
}

.kpi-panel {
  min-width: 0;
}

/* A tile for a reading that is words rather than a number. */
.kpi-named {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 8px 12px;
}

.kpi-named-value {
  font-size: 19px;
  font-weight: 650;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-named-label {
  color: var(--ink-soft);
  font-size: 12px;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Tabs and panes */

.tabs-host {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 10px 12px 12px;
}

.tabs-host [role='tabpanel'] {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.tabs-host [role='tabpanel'] > * {
  flex: 1;
  min-height: 0;
}

.actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  order: 2;
  padding: 8px 0 2px;
}

.actions-label {
  color: var(--ink-soft);
  font-size: 12px;
  margin-right: 2px;
}

.action {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  padding: 4px 11px;
}

.action:hover {
  background: #eef2f7;
  border-color: #c7d2e0;
}

.action:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Charts */

.chart-wrap {
  display: grid;
  gap: 10px;
  height: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  min-height: 0;
  overflow: auto;
  padding-top: 6px;
}

.chart-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  min-height: 180px;
  overflow: hidden;
  padding: 4px;
}

.chart-box.tall {
  min-height: 0;
}

.chart-error {
  color: #b42318;
  font-size: 12px;
  padding: 10px;
}

.split {
  display: grid;
  gap: 12px;
  height: 100%;
  grid-template-columns: minmax(340px, 5fr) minmax(0, 7fr);
  min-height: 0;
  padding-top: 8px;
}

.grid-box,
.split > .chart-box {
  min-height: 0;
  overflow: hidden;
}

/* Waiting and failure */

.loading {
  margin: auto;
  max-width: 460px;
  text-align: center;
}

.loading h1 {
  color: var(--accent);
  font-size: 20px;
  margin: 0 0 8px;
}

.loading-message {
  color: var(--ink-soft);
  margin: 0 0 14px;
}

.loading-bar {
  background: var(--line);
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
}

.loading-fill {
  background: var(--accent);
  height: 100%;
  transition: width 0.2s ease;
  width: 0;
}

/* The licence line */

.foot {
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 12px;
  padding-top: 10px;
}

.foot p {
  margin: 0 0 2px;
}

.foot a {
  color: var(--accent);
}

.actions[hidden] {
  display: none;
}

/* Said when the saved copy is standing in for data that could not be fetched. */
.notice {
  background: #fdf3e3;
  border: 1px solid #f0d9a8;
  border-radius: 7px;
  color: #6b4d12;
  margin: 8px 0 0;
  padding: 6px 10px;
}
