.rcc-data-services-page {
    --rcc-teal: var(--rcc-ds-primary-dark, #176b5c);
    --rcc-ink: var(--rcc-ds-ink, #172b36);
    --rcc-muted: var(--rcc-ds-muted, #667a75);
}

.rcc-reference-page main { color: var(--rcc-ink); background: #f4f7f6; }
.rcc-reference-page .page-hero { margin-bottom: 0; }
.rcc-reference-hero { height: 310px; min-height: 310px; }
.rcc-reference-hero--compact { height: 250px; min-height: 250px; }
.rcc-reference-browser,
.rcc-reference-records { padding: clamp(34px, 5vw, 66px) 0 clamp(70px, 8vw, 104px); }

.rcc-reference-breadcrumbs { display: flex; margin-bottom: 42px; color: var(--rcc-muted); font-size: .76rem; align-items: center; gap: 10px; }
.rcc-reference-breadcrumbs a { color: var(--rcc-teal); font-weight: 750; text-decoration: none; }
.rcc-reference-breadcrumbs strong { color: var(--rcc-ink); }

.rcc-reference-heading { display: grid; margin-bottom: 30px; grid-template-columns: minmax(0, 1fr) minmax(280px, .65fr); align-items: end; gap: 36px; }
.rcc-reference-heading h2 { margin: 0; font-size: clamp(1.85rem, 3vw, 2.65rem); line-height: 1.12; }
.rcc-reference-heading > p { max-width: 540px; margin: 0; color: var(--rcc-muted); line-height: 1.7; }

.rcc-reference-finder { display: grid; margin-bottom: 22px; padding: 22px; border: 1px solid #cfe0dc; border-radius: 14px; grid-template-columns: minmax(170px, .7fr) minmax(0, 1fr) minmax(0, 1.2fr) auto; grid-template-rows: auto auto; align-items: end; gap: 7px 14px; background: linear-gradient(115deg, #edf7f4, #fff 48%); box-shadow: 0 10px 28px rgba(16, 70, 62, .05); }
.rcc-reference-finder__intro { display: flex; min-width: 0; grid-column: 1; grid-row: 1 / 3; align-self: center; flex-direction: column; gap: 4px; }
.rcc-reference-finder__intro span { color: var(--rcc-teal); font-size: .65rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.rcc-reference-finder__intro strong { font-size: .88rem; line-height: 1.35; }
.rcc-reference-finder label { color: var(--rcc-ink); font-size: .68rem; font-weight: 850; text-transform: uppercase; }
.rcc-reference-finder > label:first-of-type { grid-column: 2; grid-row: 1; }
.rcc-reference-finder > label:last-of-type { grid-column: 3; grid-row: 1; }
.rcc-reference-finder__field { display: flex; min-width: 0; flex-direction: column; gap: 7px; }
.rcc-reference-finder__field input { width: 100%; min-height: 40px; padding: 0 12px; border: 1px solid #c5d7d2; border-radius: 8px; background: #fff; font: inherit; font-size: .76rem; }
.rcc-reference-finder__field input:disabled { color: #84928f; background: #f2f5f4; cursor: not-allowed; }
.rcc-reference-finder select { width: 100%; min-width: 0; min-height: 44px; padding: 0 38px 0 13px; border: 1px solid #c5d7d2; border-radius: 8px; color: var(--rcc-ink); background: #fff; font: inherit; font-size: .77rem; }
.rcc-reference-finder > select[data-country-select] { grid-column: 2; grid-row: 2; }
.rcc-reference-finder > select[data-station-select] { grid-column: 3; grid-row: 2; }
.rcc-reference-finder select:disabled { color: #84928f; background: #f2f5f4; cursor: not-allowed; }
.rcc-reference-finder button { min-height: 44px; padding: 0 18px; border: 0; border-radius: 8px; grid-column: 4; grid-row: 2; color: #fff; background: var(--rcc-teal); font-size: .73rem; font-weight: 850; cursor: pointer; white-space: nowrap; }
.rcc-reference-finder button:disabled { opacity: .45; cursor: not-allowed; }

.rcc-reference-finder--searchable { grid-template-rows: auto; align-items: end; gap: 18px; }
.rcc-reference-finder--searchable .rcc-reference-finder__intro { grid-column: 1; grid-row: auto; }
.rcc-reference-finder--searchable .rcc-reference-finder__field { align-self: auto; grid-row: auto; }
.rcc-reference-finder--searchable .rcc-reference-finder__field--country { grid-column: 2; }
.rcc-reference-finder--searchable .rcc-reference-finder__field--station { grid-column: 3; }
.rcc-reference-finder--searchable .rcc-reference-finder__field label { grid-column: auto; grid-row: auto; }
.rcc-reference-finder--searchable button { grid-column: 4; grid-row: auto; }
.rcc-reference-finder--searchable input:focus,
.rcc-reference-finder--searchable select:focus { border-color: var(--rcc-teal); box-shadow: 0 0 0 3px rgba(23, 107, 92, .12); outline: 0; }

.rcc-reference-search { margin-bottom: 30px; padding: 20px; border: 1px solid #dbe5e2; border-radius: 12px; background: #fff; }
.rcc-reference-search label { display: block; margin-bottom: 8px; color: var(--rcc-ink); font-size: .72rem; font-weight: 850; }
.rcc-reference-search > div { display: flex; gap: 8px; }
.rcc-reference-search input { width: min(100%, 560px); min-height: 44px; padding: 0 14px; border: 1px solid #cddad6; border-radius: 7px; background: #fbfcfc; }
.rcc-reference-search button,
.rcc-reference-search a { display: inline-flex; min-height: 44px; padding: 0 18px; border: 0; border-radius: 7px; color: #fff; background: var(--rcc-teal); font-size: .76rem; font-weight: 800; text-decoration: none; align-items: center; }
.rcc-reference-search a { color: var(--rcc-teal); background: #e8f2ef; }

.rcc-reference-country-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.rcc-reference-country-card { display: grid; min-height: 128px; padding: 22px; border: 1px solid #dbe5e2; border-radius: 14px; color: var(--rcc-ink); grid-template-columns: 48px 1fr auto; align-items: center; gap: 16px; background: #fff; text-decoration: none; transition: transform .2s ease, box-shadow .2s ease; }
.rcc-reference-country-card:hover { color: var(--rcc-ink); box-shadow: 0 14px 34px rgba(16, 70, 62, .1); transform: translateY(-3px); }
.rcc-reference-country-card__mark { display: grid; width: 46px; height: 46px; border-radius: 12px; color: #fff; background: linear-gradient(145deg, var(--rcc-teal), #17454d); place-items: center; font-size: .7rem; font-weight: 900; }
.rcc-reference-country-card h3 { margin: 0 0 6px; font-size: 1rem; }
.rcc-reference-country-card p { margin: 0; color: var(--rcc-muted); font-size: .72rem; }
.rcc-reference-country-card b { color: var(--rcc-teal); }

.rcc-reference-station-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.rcc-reference-station-card { display: flex; min-height: 210px; padding: 26px; border: 1px solid #dbe5e2; border-radius: 14px; color: var(--rcc-ink); flex-direction: column; background: #fff; text-decoration: none; transition: transform .2s ease, box-shadow .2s ease; }
.rcc-reference-station-card:hover { color: var(--rcc-ink); box-shadow: 0 14px 34px rgba(16, 70, 62, .1); transform: translateY(-3px); }
.rcc-reference-station-card__id { align-self: flex-start; margin-bottom: 28px; padding: 6px 9px; border-radius: 999px; color: var(--rcc-teal); background: #e9f3f0; font-size: .66rem; font-weight: 850; }
.rcc-reference-station-card h3 { margin: 0 0 9px; font-size: 1.12rem; }
.rcc-reference-station-card p { margin: 0; color: var(--rcc-muted); font-size: .76rem; }
.rcc-reference-station-card b { margin-top: auto; padding-top: 24px; color: var(--rcc-teal); font-size: .74rem; }
.rcc-reference-empty { padding: 46px; border: 1px dashed #c9d8d4; border-radius: 14px; background: #fff; grid-column: 1 / -1; text-align: center; }
.rcc-reference-empty h3 { margin: 0 0 8px; }
.rcc-reference-empty p { margin: 0; color: var(--rcc-muted); }

.rcc-reference-controls { display: grid; margin-bottom: 24px; padding: 20px; border: 1px solid #dbe5e2; border-radius: 14px; grid-template-columns: auto minmax(180px, 1fr) auto minmax(220px, 1fr) auto; align-items: center; gap: 10px 14px; background: #fff; }
.rcc-reference-controls label { color: var(--rcc-ink); font-size: .7rem; font-weight: 850; letter-spacing: .03em; text-transform: uppercase; }
.rcc-reference-controls select { width: 100%; min-height: 44px; padding: 0 38px 0 13px; border: 1px solid #cddad6; border-radius: 8px; color: var(--rcc-ink); background: #fbfcfc; font: inherit; font-size: .78rem; }
.rcc-reference-controls button { min-height: 44px; padding: 0 20px; border: 0; border-radius: 8px; color: #fff; background: var(--rcc-teal); font-size: .74rem; font-weight: 850; cursor: pointer; }

.rcc-reference-period { margin-top: 24px; border: 1px solid #dbe5e2; border-radius: 18px; overflow: hidden; background: #fff; box-shadow: 0 12px 34px rgba(16, 70, 62, .055); }
.rcc-reference-period > header { display: flex; padding: 26px 30px; border-bottom: 1px solid #e1e9e7; align-items: end; justify-content: space-between; gap: 20px; }
.rcc-reference-period > header span { color: var(--rcc-teal); font-size: .66rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.rcc-reference-period > header h3 { margin: 5px 0 0; font-size: 1.55rem; }
.rcc-reference-period > header p { margin: 0; color: var(--rcc-muted); font-size: .76rem; }
.rcc-reference-period__content { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .85fr); }

.rcc-reference-chart { display: grid; height: 500px; padding: 42px 28px 24px; border-right: 1px solid #e1e9e7; grid-template-columns: repeat(12, minmax(34px, 1fr)); align-items: end; gap: 10px; overflow-x: auto; }
.rcc-reference-chart__column { display: grid; height: 100%; min-width: 34px; grid-template-rows: 22px 1fr 20px; align-items: end; text-align: center; }
.rcc-reference-chart__value { color: var(--rcc-muted); font-size: .62rem; }
.rcc-reference-chart__column > div { display: flex; height: 100%; border-bottom: 1px solid #bdcfca; align-items: end; justify-content: center; background: linear-gradient(to top, rgba(16, 103, 91, .035) 1px, transparent 1px); background-size: 100% 25%; }
.rcc-reference-chart__column i { display: block; width: min(100%, 28px); min-height: 2px; border-radius: 4px 4px 0 0; background: linear-gradient(#3eac98, var(--rcc-teal)); }
.rcc-reference-chart__column b { padding-top: 7px; color: var(--rcc-ink); font-size: .64rem; }

.rcc-reference-table-wrap { overflow-x: auto; background: #fbfcfc; }
.rcc-reference-table { width: 100%; border-collapse: collapse; font-size: .76rem; }
.rcc-reference-table th,
.rcc-reference-table td { height: 40px; padding: 8px 18px; border-bottom: 1px solid #e7eeec; text-align: right; white-space: nowrap; }
.rcc-reference-table th:first-child { text-align: left; }
.rcc-reference-table thead th { color: var(--rcc-muted); background: #f7f9f8; font-size: .66rem; letter-spacing: .03em; text-transform: uppercase; }
.rcc-reference-table tbody tr:last-child th,
.rcc-reference-table tbody tr:last-child td { border-bottom: 0; }

@media (max-width: 900px) {
    .rcc-reference-country-grid,
    .rcc-reference-station-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rcc-reference-heading { grid-template-columns: 1fr; align-items: start; }
    .rcc-reference-finder { grid-template-columns: auto 1fr; }
    .rcc-reference-finder > * { grid-column: auto !important; grid-row: auto !important; }
    .rcc-reference-finder__intro { margin-bottom: 6px; grid-column: 1 / -1 !important; }
    .rcc-reference-finder button { grid-column: 2 !important; }
    .rcc-reference-finder--searchable { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
    .rcc-reference-finder--searchable .rcc-reference-finder__intro { grid-column: 1 / -1 !important; }
    .rcc-reference-finder--searchable button { grid-column: 2 !important; justify-self: end; }
    .rcc-reference-controls { grid-template-columns: auto 1fr; }
    .rcc-reference-controls button { grid-column: 2; }
    .rcc-reference-period__content { grid-template-columns: 1fr; }
    .rcc-reference-chart { height: 360px; border-right: 0; border-bottom: 1px solid #e1e9e7; }
}

@media (max-width: 560px) {
    .rcc-reference-country-grid,
    .rcc-reference-station-grid { grid-template-columns: 1fr; }
    .rcc-reference-search > div { flex-wrap: wrap; }
    .rcc-reference-search input { flex: 1 0 100%; }
    .rcc-reference-finder { grid-template-columns: 1fr; }
    .rcc-reference-finder__intro,
    .rcc-reference-finder button { grid-column: auto !important; }
    .rcc-reference-finder--searchable { grid-template-columns: 1fr; }
    .rcc-reference-finder--searchable button { width: 100%; justify-self: stretch; }
    .rcc-reference-controls { grid-template-columns: 1fr; }
    .rcc-reference-controls button { grid-column: auto; }
    .rcc-reference-period > header { align-items: start; flex-direction: column; }
    .rcc-reference-chart { height: 290px; }
}
