:root {
  color-scheme: light;
  --ink: #1d2430;
  --muted: #667085;
  --line: #d7dce3;
  --soft: #f4f6f8;
  --panel: #ffffff;
  --blue: #2666a3;
  --green: #22746b;
  --red: #bf4c45;
  --amber: #b86b18;
  --sky: #e8f2ff;
  --shadow: 0 18px 40px rgba(27, 36, 48, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #eef2f5;
  /* Guard against sub-pixel / safe-area horizontal overflow in the iOS PWA.
     Intentional horizontal scrollers (chart, tables, range buttons) are nested
     with their own overflow-x, so this only clips stray page-level overflow. */
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100dvh;
  max-width: 100%;
  background: #eef2f5;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overscroll-behavior-y: contain;
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding:
    calc(24px + env(safe-area-inset-top))
    calc(24px + env(safe-area-inset-right))
    calc(24px + env(safe-area-inset-bottom))
    calc(24px + env(safe-area-inset-left));
}

.pull-refresh {
  position: fixed;
  z-index: 20;
  top: calc(6px + env(safe-area-inset-top));
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid rgba(29, 36, 48, 0.12);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  box-shadow: 0 12px 30px rgba(29, 36, 48, 0.16);
  pointer-events: none;
  transform: translate3d(-50%, 0, 0);
  transition: transform 160ms ease, opacity 160ms ease;
}

.pull-refresh[hidden] {
  display: none;
}

.pull-refresh strong {
  font-size: 12px;
  line-height: 1;
}

.pull-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #d7e3ef;
  border-top-color: var(--blue);
  border-radius: 999px;
}

.pull-refresh.ready .pull-spinner,
.is-refreshing .pull-spinner {
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.topbar,
.toolbar,
.latest-reading,
.day-comparison,
.workbench,
.annual-panel,
.setup-band {
  width: 100%;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 34px;
  line-height: 1.1;
}

h2 {
  font-size: 18px;
  line-height: 1.2;
}

.status-strip,
.toolbar,
.year-toggles,
.chart-legend,
.range-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.button,
.pill {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  background: var(--blue);
  color: #ffffff;
  border-color: var(--blue);
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.button[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

.pill.ok {
  color: #ffffff;
  background: var(--green);
  border-color: var(--green);
}

.pill.warn {
  color: #ffffff;
  background: var(--amber);
  border-color: var(--amber);
}

.setup-band {
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid #e3c07f;
  border-radius: 8px;
  background: #fff8e8;
}

.setup-band div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toolbar {
  align-items: flex-end;
  margin-bottom: 16px;
  padding: 14px;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.latest-reading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  border: 1px solid rgba(38, 102, 163, 0.14);
  border-radius: 8px;
  padding: 18px 20px;
  background:
    linear-gradient(135deg, rgba(232, 242, 255, 0.94), rgba(255, 255, 255, 0.98) 58%),
    var(--panel);
  box-shadow: var(--shadow);
}

.latest-reading-headline {
  display: grid;
  gap: 4px;
}

.yesterday-reading-card {
  display: grid;
  gap: 4px;
  min-width: 178px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.78);
}

.yesterday-reading-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.latest-reading .yesterday-reading-card strong {
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
}

.yesterday-reading-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.trend-phrase {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 60px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 14px 22px;
  background: rgba(255, 255, 255, 0.78);
  font-size: 22px;
  font-weight: 750;
  letter-spacing: 0.01em;
  text-align: center;
  text-transform: none;
  -webkit-text-size-adjust: 100%;
  transition: color 0.3s, background 0.3s, border-color 0.3s;
}

.trend-phrase[hidden] {
  display: none !important;
}

.trend-phrase[data-tone="hot"] {
  color: #c03a1a;
  border-color: rgba(209, 62, 29, 0.35);
  background: rgba(209, 62, 29, 0.08);
}

.trend-phrase[data-tone="warm"] {
  color: #b86b18;
  border-color: rgba(184, 107, 24, 0.35);
  background: rgba(208, 122, 19, 0.08);
}

.trend-phrase[data-tone="neutral"] {
  color: var(--muted);
  border-color: var(--line);
  background: rgba(100, 116, 139, 0.06);
}

.trend-phrase[data-tone="cool"] {
  color: #2b7eb5;
  border-color: rgba(43, 126, 181, 0.35);
  background: rgba(43, 126, 181, 0.08);
}

.trend-phrase[data-tone="cold"] {
  color: #2166ac;
  border-color: rgba(33, 102, 172, 0.35);
  background: rgba(33, 102, 172, 0.1);
}

.reading-history {
  display: grid;
  flex: 1;
  gap: 8px;
  justify-items: center;
}

.reading-history[hidden] {
  display: none;
}

.reading-history h2 {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-align: center;
  text-transform: uppercase;
}

.reading-timeline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.reading-chip {
  display: grid;
  gap: 3px;
  justify-items: center;
  min-width: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.72);
}

.reading-chip-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.reading-chip-value {
  color: var(--ink);
  font-size: 20px;
  font-weight: 750;
  line-height: 1;
}

.reading-chip.is-now {
  border-color: rgba(31, 111, 235, 0.55);
  background: linear-gradient(135deg, rgba(31, 111, 235, 0.12), rgba(31, 111, 235, 0.04));
  box-shadow: 0 1px 8px rgba(31, 111, 235, 0.18);
}

.reading-chip.is-now .reading-chip-label {
  color: var(--accent, #1f6feb);
}

.reading-chip.is-now .reading-chip-value {
  font-size: 24px;
  font-weight: 850;
}

.latest-reading-headline > span:first-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.latest-reading strong {
  color: var(--ink);
  font-size: 42px;
  line-height: 1;
}

.latest-reading-value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.trend-arrow {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  color: var(--muted);
  transition: color 0.3s;
}

.trend-arrow[hidden] {
  display: none !important;
}

.trend-arrow[data-direction="rising"] {
  color: #c03a1a;
}

.trend-arrow[data-direction="falling"] {
  color: #2166ac;
}

.trend-arrow[data-direction="steady"] {
  color: var(--muted);
}

.latest-reading time {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  text-align: right;
}

.day-comparison {
  margin-bottom: 16px;
  border: 1px solid rgba(34, 116, 107, 0.16);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.comparison-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.comparison-head div {
  display: grid;
  gap: 4px;
}

.comparison-head span,
.comparison-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.comparison-head strong {
  font-size: 20px;
  line-height: 1.15;
}

.comparison-head small,
.comparison-grid small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.comparison-grid article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.comparison-grid strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.comparison-grid small {
  display: block;
  margin-top: 8px;
}

label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select {
  min-height: 38px;
  min-width: 120px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  grid-template-rows: auto 1fr;
  gap: 16px;
  align-items: start;
}

.chart-panel {
  grid-column: 1;
  grid-row: 1;
}

.milestones-panel {
  grid-column: 1;
  grid-row: 2;
}

.insights-panel {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.chart-panel,
.milestones-panel,
.insights-panel,
.annual-panel {
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.section-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.section-head.compact {
  display: block;
}

.year-toggles label {
  display: inline-flex;
  grid-auto-flow: column;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font-size: 13px;
  text-transform: none;
}

.year-toggles input {
  min-width: 0;
  min-height: 0;
}

.compare-controls {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.compare-controls > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.chart-legend {
  min-height: 42px;
  padding: 10px 16px 0;
}

.chart-period {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin: 8px 16px 0;
  border: 1px solid #dce4ed;
  border-radius: 6px;
  padding: 6px 10px;
  background: #f8fbff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.chart-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px 0;
  flex-wrap: wrap;
}

.range-buttons {
  gap: 6px;
}

.period-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.range-buttons button,
.period-nav button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.period-nav button {
  width: 38px;
  padding: 6px;
  font-size: 20px;
  line-height: 1;
}

.range-buttons button[aria-pressed="true"] {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
}

.period-nav button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.legend-item,
.legend-range {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.legend-range {
  color: var(--muted);
}

.legend-item-empty {
  color: var(--muted);
  opacity: 0.75;
}

.legend-swatch {
  width: 18px;
  height: 3px;
  border-radius: 999px;
}

.chart-wrap {
  position: relative;
  height: 500px;
  margin: 8px 14px 16px;
  overflow: hidden;
  border: 1px solid #e2e8ef;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(232, 242, 255, 0.7), rgba(255, 255, 255, 0) 34%),
    #ffffff;
}

.chart-scroller {
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-color: #a8b4c4 #eef2f6;
  scrollbar-width: thin;
}

.chart-scroller::-webkit-scrollbar {
  height: 10px;
}

.chart-scroller::-webkit-scrollbar-track {
  background: #eef2f6;
}

.chart-scroller::-webkit-scrollbar-thumb {
  border: 2px solid #eef2f6;
  border-radius: 999px;
  background: #a8b4c4;
}

#temperatureChart {
  display: block;
  min-width: 100%;
  height: 100%;
  touch-action: pan-x;
}

.axis {
  stroke: #9aa5b1;
  stroke-width: 1;
}

.grid {
  stroke: #e7edf4;
  stroke-width: 1;
}

.chart-label {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  filter: drop-shadow(0 6px 7px rgba(31, 111, 235, 0.12));
}

.line-fill {
  opacity: 0.95;
  pointer-events: none;
}

.line.muted {
  stroke-width: 2;
  opacity: 0.6;
  filter: none;
}

.chart-cursor {
  pointer-events: none;
}

.cursor-line {
  stroke: #1d2430;
  stroke-dasharray: 4 5;
  stroke-opacity: 0.32;
  stroke-width: 1.3;
}

.cursor-dot {
  stroke: #ffffff;
  stroke-width: 2;
  filter: drop-shadow(0 3px 5px rgba(29, 36, 48, 0.25));
}

.chart-tooltip {
  position: absolute;
  z-index: 2;
  min-width: 180px;
  max-width: min(280px, calc(100% - 20px));
  border: 1px solid rgba(29, 36, 48, 0.12);
  border-radius: 8px;
  padding: 10px 11px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  box-shadow: 0 14px 34px rgba(29, 36, 48, 0.18);
  pointer-events: none;
}

.chart-tooltip strong {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
}

.chart-tooltip div {
  display: grid;
  gap: 4px;
}

.chart-tooltip span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.chart-tooltip i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.chart-tooltip b {
  color: var(--ink);
  font-size: 13px;
  white-space: nowrap;
}

.insight-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.insight {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.insight span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.insight strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}

.insight small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

/* --- Milestones & streaks --- */
.milestone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  padding: 16px;
}

.milestone {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 14px 14px 18px;
  background: var(--panel);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.milestone::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent, var(--muted));
}

.milestone:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent, var(--muted)) 45%, var(--line));
  box-shadow: 0 12px 24px rgba(27, 36, 48, 0.1);
}

.milestone-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 18px;
  line-height: 1;
  background: color-mix(in srgb, var(--accent, var(--muted)) 14%, transparent);
}

.milestone-body {
  min-width: 0;
}

.milestone-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.milestone-value {
  display: block;
  margin-top: 3px;
  font-size: 22px;
  line-height: 1.1;
  color: var(--ink);
}

.milestone-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.milestone.warm {
  --accent: var(--red);
}

.milestone.cool {
  --accent: var(--blue);
}

.milestone.green {
  --accent: var(--green);
}

.annual-panel {
  margin-top: 16px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

/* --- Climate almanac --- */
.stripes-panel,
.on-this-day,
.season-panel,
.calendar-panel {
  width: 100%;
  margin-bottom: 16px;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

#warmingStripes {
  display: block;
  width: calc(100% - 32px);
  height: 52px;
  margin: 0 16px 16px;
  border-radius: 6px;
  overflow: hidden;
}

.onthisday-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding: 14px;
}

.insight.highlight {
  border-color: var(--red);
  background: rgba(191, 76, 69, 0.08);
}

.insight.highlight strong {
  color: var(--red);
}

.season-panel td:not(:first-child) {
  font-weight: 700;
  text-align: center;
}

.climatology-band {
  stroke: none;
}

.climatology-band.outer {
  fill: rgba(96, 112, 132, 0.12);
}

.climatology-band.inner {
  fill: rgba(96, 112, 132, 0.2);
}

.calendar-grid {
  display: grid;
  grid-template-columns: 34px repeat(31, minmax(14px, 1fr));
  gap: 2px;
  padding: 14px;
  overflow-x: auto;
}

.cal-month {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.cal-cell {
  aspect-ratio: 1 / 1;
  min-width: 12px;
  border-radius: 3px;
  background: var(--soft);
}

.cal-missing {
  background: repeating-linear-gradient(45deg, #eef1f4, #eef1f4 2px, #f7f9fb 2px, #f7f9fb 4px);
}

.cal-empty {
  background: transparent;
}

.calendar-scale {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.cal-gradient {
  display: inline-block;
  width: 120px;
  height: 10px;
  border-radius: 999px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  max-width: min(420px, calc(100vw - 40px));
  border-radius: 8px;
  padding: 12px 14px;
  background: #1f2937;
  color: #ffffff;
  box-shadow: var(--shadow);
}

@media (display-mode: standalone) {
  .topbar {
    margin-bottom: 14px;
  }

  .button,
  .pill,
  input,
  select {
    min-height: 42px;
  }
}

@media (max-width: 980px) {
  .app-shell {
    padding:
      calc(16px + env(safe-area-inset-top))
      calc(16px + env(safe-area-inset-right))
      calc(18px + env(safe-area-inset-bottom))
      calc(16px + env(safe-area-inset-left));
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .latest-reading {
    align-items: flex-start;
    flex-direction: column;
  }

  .trend-phrase {
    width: 100%;
    flex: none;
  }

  .yesterday-reading-card {
    width: 100%;
  }

  .comparison-head {
    flex-direction: column;
  }

  .comparison-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .latest-reading time {
    width: 100%;
    text-align: left;
  }

  .reading-timeline {
    width: 100%;
    justify-content: flex-start;
  }

  .workbench {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
  }

  .chart-panel,
  .milestones-panel,
  .insights-panel {
    grid-column: 1;
    grid-row: auto;
    min-width: 0;
  }

  .chart-wrap {
    height: 420px;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: 28px;
  }

  .status-strip {
    width: 100%;
  }

  .status-strip .button,
  .status-strip .pill {
    flex: 1 1 auto;
    justify-content: center;
    text-align: center;
  }

  .latest-reading strong {
    font-size: 34px;
  }

  .latest-reading,
  .day-comparison,
  .toolbar,
  .chart-panel,
  .milestones-panel,
  .insights-panel,
  .annual-panel {
    border-radius: 7px;
  }

  .comparison-grid {
    grid-template-columns: 1fr;
  }

  .toolbar {
    align-items: stretch;
  }

  .toolbar > * {
    flex: 1 1 100%;
  }

  .chart-legend,
  .chart-controls {
    padding-right: 12px;
    padding-left: 12px;
  }

  .chart-period {
    margin-right: 12px;
    margin-left: 12px;
  }

  .range-buttons {
    flex: 1 1 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .range-buttons::-webkit-scrollbar {
    display: none;
  }

  .range-buttons button {
    flex: 0 0 auto;
  }

  .period-nav {
    width: 100%;
    justify-content: flex-end;
    margin-left: 0;
  }

  .chart-wrap {
    height: 360px;
    margin-right: 10px;
    margin-left: 10px;
  }

  .section-head {
    flex-direction: column;
  }

  .compare-controls {
    width: 100%;
    justify-items: start;
  }
}
