/* Shared rules stay in public/global.css; route-specific rules live in this page CSS. */
.ahr-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(108px, auto);
  gap: clamp(18px, 2.8vw, 42px);
  align-items: start;
  min-height: auto;
  margin: clamp(18px, 2vw, 28px) 0 12px;
  padding: 0 0 4px;
  background: transparent;
}

.ahr-hero-copy {
  min-width: 0;
  padding-top: 6px;
}

.ahr-hero-copy > .page-eyebrow {
  margin-bottom: 8px;
}

.ahr-hero .page-h1 {
  max-width: 860px;
  margin: 0 0 10px;
}

.ahr-hero p:last-child {
  max-width: 820px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.ahr-current-card {
  --ahr-card-border: rgba(133, 150, 156, 0.22);
  --ahr-card-accent: var(--teal-deep);
  --ahr-card-bg: rgba(255, 255, 255, 0.86);
  --ahr-card-glow: rgba(18, 63, 77, 0.06);
  --ahr-card-sheen: rgba(255, 255, 255, 0.34);
  display: inline-grid;
  position: relative;
  justify-self: end;
  width: max-content;
  min-width: 0;
  max-width: min(240px, 42vw);
  margin-top: 0;
  overflow: hidden;
  border: 1px solid var(--ahr-card-border);
  border-radius: 10px;
  background:
    radial-gradient(circle at 18% 0%, var(--ahr-card-sheen), transparent 44%),
    linear-gradient(145deg, var(--ahr-card-bg), rgba(255, 255, 255, 0.9) 68%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
  text-align: center;
}

.ahr-current-card.zone-bottom {
  --ahr-card-border: rgba(0, 138, 69, 0.32);
  --ahr-card-accent: var(--green);
  --ahr-card-bg: rgba(0, 138, 69, 0.12);
  --ahr-card-glow: rgba(0, 138, 69, 0.12);
  --ahr-card-sheen: rgba(0, 138, 69, 0.18);
}

.ahr-current-card.zone-dca {
  --ahr-card-border: rgba(35, 95, 115, 0.28);
  --ahr-card-accent: var(--teal);
  --ahr-card-bg: rgba(113, 197, 232, 0.2);
  --ahr-card-glow: rgba(35, 95, 115, 0.1);
  --ahr-card-sheen: rgba(113, 197, 232, 0.28);
}

.ahr-current-card.zone-neutral {
  --ahr-card-border: rgba(110, 116, 119, 0.22);
  --ahr-card-accent: var(--muted);
  --ahr-card-bg: rgba(227, 231, 230, 0.72);
  --ahr-card-glow: rgba(110, 116, 119, 0.08);
  --ahr-card-sheen: rgba(255, 255, 255, 0.42);
}

.ahr-current-card.zone-hot {
  --ahr-card-border: rgba(138, 98, 0, 0.32);
  --ahr-card-accent: var(--amber);
  --ahr-card-bg: rgba(138, 98, 0, 0.14);
  --ahr-card-glow: rgba(138, 98, 0, 0.12);
  --ahr-card-sheen: rgba(255, 198, 64, 0.24);
}

.ahr-current-card em {
  display: block;
  position: relative;
  padding: 12px 16px 14px;
  color: var(--ahr-card-accent);
  font-size: clamp(13px, 1.16vw, 16px);
  font-weight: 650;
  font-style: normal;
  line-height: 1.16;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}

.ahr-current-card strong {
  display: block;
  padding: 15px 16px 12px;
  color: var(--ahr-card-accent);
  font-size: clamp(29px, 2.95vw, 38px);
  font-weight: 590;
  line-height: 1.05;
}

.ahr-current-card em::before {
  content: "";
  position: absolute;
  top: 0;
  right: 16px;
  left: 16px;
  height: 1px;
  background: var(--ahr-card-border);
}

.ahr-dashboard {
  padding-top: 10px;
}

.ahr-toolbar {
  display: flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  gap: 4px;
  margin-bottom: 14px;
  padding: 5px;
  border: 1px solid rgb(241, 244, 245);
  border-radius: 10px;
  background: rgba(229, 229, 229, 0.34);
  box-shadow: none;
  overflow: auto;
}

.ahr-toolbar span,
.ahr-toolbar button {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.ahr-toolbar span {
  color: var(--muted);
  background: transparent;
}

.ahr-toolbar button:hover,
.ahr-toolbar button.is-active {
  color: var(--ink);
  background: rgb(229, 229, 229);
}

.ahr-toolbar button.is-active {
  color: #fff;
  border-color: var(--button-bg);
  background: var(--button-bg);
  box-shadow: none;
}

.ahr-chart-shell {
  position: relative;
  width: 100%;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(133, 150, 156, 0.22);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15, 39, 48, 0.045);
  overflow: hidden;
}

.ahr-chart-shell > .ahr-legend {
  order: 1;
}

.ahr-chart-shell > .ahr-chart {
  order: 2;
}

.ahr-chart-shell > .ahr-zone-strip {
  order: 3;
}

.ahr-chart-shell > .ahr-range-selector {
  order: 4;
}

.ahr-chart {
  width: 100%;
  height: min(52vh, 520px);
  min-height: 370px;
}

.ahr-zone-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-bottom: 0;
  background: #fff;
  color: var(--body);
  font-size: 12px;
  font-weight: 650;
}

.ahr-zone-strip > span {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 8px 10px;
  overflow: hidden;
  border: 0;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ahr-zone-strip b,
.ahr-zone-strip em {
  min-width: 0;
  overflow: hidden;
  font: inherit;
  text-overflow: ellipsis;
}

.ahr-zone-strip b {
  flex: 0 0 auto;
}

.ahr-zone-strip em {
  font-style: normal;
}

.ahr-zone-strip .zone-bottom {
  background: rgba(0, 138, 69, 0.16);
}

.ahr-zone-strip .zone-dca {
  background: rgba(113, 197, 232, 0.2);
}

.ahr-zone-strip .zone-neutral {
  background: rgba(227, 231, 230, 0.92);
}

.ahr-zone-strip .zone-hot {
  background: rgba(138, 98, 0, 0.16);
}

.ahr-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  padding: 12px 14px 10px;
  border-bottom: 0;
  background: #fff;
  color: var(--quiet);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.ahr-legend span {
  display: flex;
  min-height: auto;
  align-items: center;
  gap: 6px;
  padding: 0;
  background: transparent;
  white-space: nowrap;
}

.ahr-legend b {
  color: var(--ink);
  font-weight: 700;
}

.ahr-legend i {
  display: inline-block;
  width: 18px;
  height: 0;
  border-top: 2px solid var(--teal);
}

.ahr-legend .ahr-line-price {
  border-color: var(--red);
}

.ahr-legend .ahr-line-average {
  border-color: var(--amber);
  border-top-style: dashed;
}

.ahr-range-selector {
  background: #fff;
}

.ahr-range-selector canvas {
  border-bottom-right-radius: 8px;
  border-bottom-left-radius: 8px;
}

.ahr-range-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  padding: 9px 14px;
  background: rgba(248, 250, 249, 0.84);
  color: var(--quiet);
  font-size: 12px;
  font-weight: 650;
}

.ahr-range-head strong,
.ahr-range-head span {
  display: inline-flex;
  min-height: auto;
  align-items: center;
  gap: 6px;
  padding: 0;
  background: transparent;
}

.ahr-range-head strong,
.ahr-range-head em {
  color: var(--ink);
  font-style: normal;
}

.ahr-range-selector canvas {
  display: block;
  width: 100%;
  height: 112px;
  cursor: ew-resize;
  touch-action: none;
}

.ahr-data-panel {
  margin: 34px 0 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line-strong);
}

.ahr-data-panel .panel-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 650;
  line-height: 1.35;
}

.ahr-table-wrap {
  overflow-x: auto;
  margin-top: 16px;
  background: #fff;
}

.ahr-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.ahr-table th,
.ahr-table td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

.ahr-table th:first-child,
.ahr-table td:first-child {
  text-align: left;
}

.ahr-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--quiet);
  background: #fff;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.ahr-table td {
  color: var(--muted);
}

.ahr-table td:nth-child(2) {
  font-weight: 700;
}

.ahr-value {
  display: inline-flex;
  min-width: 62px;
  justify-content: center;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.ahr-value.zone-bottom {
  border-color: rgba(0, 138, 69, 0.32);
  color: var(--green);
  background: rgba(0, 138, 69, 0.12);
}

.ahr-value.zone-dca {
  border-color: rgba(35, 95, 115, 0.28);
  color: var(--teal);
  background: rgba(113, 197, 232, 0.2);
}

.ahr-value.zone-neutral {
  border-color: rgba(110, 116, 119, 0.22);
  color: var(--muted);
  background: rgba(227, 231, 230, 0.72);
}

.ahr-value.zone-hot {
  border-color: rgba(138, 98, 0, 0.32);
  color: var(--amber);
  background: rgba(138, 98, 0, 0.14);
}

.ahr-table tbody tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 680px) {

  .ahr-hero {
    margin-inline: -12px;
    padding-inline: 12px;
  }

  .ahr-hero {
    grid-template-columns: minmax(0, 1fr) minmax(96px, auto);
    gap: 14px;
    min-height: auto;
    margin-top: 16px;
    margin-bottom: 2px;
    padding-top: 0;
    padding-bottom: 0;
  }

  .ahr-hero-copy {
    padding-top: 0;
  }

  .ahr-hero .page-h1 {
    margin-bottom: 8px;
  }

  .ahr-hero .page-eyebrow {
    margin-bottom: 8px;
  }

  .ahr-hero p:last-child {
    max-width: 100%;
    font-size: 13px;
    line-height: 1.42;
  }

  .ahr-current-card {
    justify-self: end;
    max-width: 40vw;
    margin-top: 0;
  }

  .ahr-current-card strong {
    padding: 12px 12px 10px;
    font-size: clamp(25px, 8vw, 34px);
  }

  .ahr-current-card em {
    padding: 10px 12px 12px;
    overflow: hidden;
    font-size: clamp(11px, 3.2vw, 13px);
    text-overflow: ellipsis;
  }

  .ahr-current-card em::before {
    right: 12px;
    left: 12px;
  }

  .ahr-toolbar {
    display: grid;
    grid-template-columns: max-content repeat(4, max-content);
    align-items: stretch;
    gap: 3px;
    margin-bottom: 12px;
    padding: 4px;
  }

  .ahr-toolbar span,
.ahr-toolbar button {
    width: auto;
    min-width: 0;
    min-height: 30px;
    align-items: center;
    justify-content: center;
    padding: 5px 4px;
    overflow: hidden;
    font-size: clamp(10px, 2.8vw, 12px);
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ahr-toolbar span {
    padding-right: 10px;
    padding-left: 10px;
  }

  .ahr-toolbar button {
    padding-right: 12px;
    padding-left: 12px;
  }

  .ahr-zone-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    margin: 0;
    padding: 0;
    border-bottom: 0;
    background: #fff;
    font-size: clamp(10.5px, 2.8vw, 12px);
  }

  .ahr-zone-strip > span {
    display: flex;
    min-height: 28px;
    align-items: center;
    align-content: center;
    justify-content: center;
    gap: 4px;
    padding: 0 6px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    line-height: 1.18;
    text-align: center;
    text-overflow: clip;
    white-space: nowrap;
  }

  .ahr-zone-strip b,
.ahr-zone-strip em {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .ahr-zone-strip b {
    flex: 0 0 auto;
    color: var(--ink);
    font-size: clamp(10px, 2.55vw, 11px);
    font-weight: 750;
  }

  .ahr-zone-strip em {
    flex: 0 1 auto;
    color: var(--body);
    font-weight: 650;
  }

  .ahr-data-panel {
    margin-top: 28px;
    padding-top: 16px;
  }

  .ahr-data-panel .panel-heading h2 {
    font-size: 17px;
  }

  .ahr-table-wrap {
    margin-top: 14px;
    padding-bottom: 2px;
  }

  .ahr-table {
    min-width: 100%;
    table-layout: fixed;
    font-size: 13px;
  }

  .ahr-table th,
.ahr-table td {
    padding: 11px 6px;
  }

  .ahr-table th {
    font-size: 12px;
    line-height: 1.25;
    white-space: normal;
  }
}

@media (max-width: 760px) {

  .ahr-chart-shell {
    width: 100vw;
    max-width: 100vw;
    margin-right: calc(50% - 50vw);
    margin-left: calc(50% - 50vw);
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .ahr-chart {
    border-radius: 0;
  }

  .ahr-range-selector canvas {
    border-bottom-right-radius: 0;
    border-bottom-left-radius: 0;
  }
}
