@font-face {
  font-family: "IBM Plex Sans Thai";
  src: url("../IBM_Plex_Sans_Thai/IBMPlexSansThai-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans Thai";
  src: url("../IBM_Plex_Sans_Thai/IBMPlexSansThai-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans Thai";
  src: url("../IBM_Plex_Sans_Thai/IBMPlexSansThai-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #071b34;
  --navy: #0b2d5c;
  --blue: #1558a8;
  --sky: #8ed9ff;
  --sky-soft: #e7f7ff;
  --aqua: #18b5cc;
  --coral: #f06b4f;
  --gold: #f4bd45;
  --white: #ffffff;
  --muted: #496178;
  --line: #cfe4f3;
  --panel: rgba(255, 255, 255, 0.94);
  --shadow: 0 18px 42px rgba(7, 27, 52, 0.16);
  --radius: 8px;
  --header-height: 74px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #f5fbff;
  font-family: "IBM Plex Sans Thai", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid rgba(24, 181, 204, 0.42);
  outline-offset: 3px;
}

.container {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  padding: 10px clamp(18px, 4vw, 48px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(207, 228, 243, 0.95);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 700;
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  object-position: left center;
}

.brand-name {
  color: var(--ink);
  font-size: 1.16rem;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  position: relative;
  padding: 10px 14px;
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 600;
  transition: color 180ms ease, background 180ms ease;
}

.nav-link::after {
  position: absolute;
  right: 14px;
  bottom: 6px;
  left: 14px;
  height: 2px;
  content: "";
  background: var(--aqua);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 180ms ease;
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link.active {
  color: var(--blue);
  background: var(--sky-soft);
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

.menu-button {
  display: none;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.menu-button span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 3px auto;
  border-radius: 999px;
  background: var(--ink);
}

.culture-page {
  overflow-x: hidden;
  overflow-y: visible;
}

.culture-hero {
  position: relative;
  padding: 76px 0 54px;
  overflow: hidden;
  color: var(--white);
  background:
    linear-gradient(135deg, rgba(7, 27, 52, 0.88), rgba(21, 88, 168, 0.82)),
    repeating-conic-gradient(from 45deg, #0b2d5c 0% 25%, #65c8ff 0% 50%) 0 0 / 72px 72px;
}

.culture-hero::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.10) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.10) 1px, transparent 1px);
  background-size: 36px 36px;
}

.culture-hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 900px;
  margin-bottom: 14px;
  font-size: 5.7rem;
  line-height: 0.98;
  font-weight: 700;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 2.6rem;
  line-height: 1.15;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.2rem;
  line-height: 1.35;
}

.culture-subtitle {
  width: min(780px, 100%);
  margin-bottom: 22px;
  color: #e6f8ff;
  font-size: 1.18rem;
}

.source-credit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 46px;
  margin-bottom: 24px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.13);
  color: #f3fbff;
  font-weight: 600;
  backdrop-filter: blur(8px);
}

.source-credit img {
  width: 62px;
  height: auto;
  padding: 5px 7px;
  border-radius: 6px;
  background: #050b12;
}

.search-panel {
  position: relative;
  z-index: 5;
  width: min(760px, 100%);
}

.search-shell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 0 20px;
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 999px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.search-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--blue);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-shell input {
  width: 100%;
  min-width: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-size: 1.03rem;
  outline: none;
}

.search-shell input::placeholder {
  color: #6d8194;
}

.suggestions {
  position: absolute;
  right: 0;
  left: 0;
  top: calc(100% + 10px);
  display: none;
  max-height: 360px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
  text-align: left;
}

.suggestions.open {
  display: grid;
}

.suggestion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 0;
  border-radius: var(--radius);
  color: var(--ink);
  background: transparent;
  text-align: left;
  transition: background 160ms ease, transform 160ms ease;
}

.suggestion-item:hover,
.suggestion-item:focus-visible {
  background: var(--sky-soft);
  transform: translateY(-1px);
}

.suggestion-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.suggestion-main small {
  color: var(--muted);
}

.suggestion-type {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--blue);
  background: var(--sky-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.budget-overview {
  display: grid;
  gap: 20px;
  width: min(1180px, 100%);
  margin-top: 28px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: calc(var(--radius) + 4px);
  color: var(--ink);
  background: rgba(248, 252, 255, 0.96);
  box-shadow: 0 24px 56px rgba(4, 20, 43, 0.22);
  text-align: left;
}

.budget-overview-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
}

.budget-overview-heading h2 {
  color: var(--navy);
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1.25;
}

.budget-overview-heading > p {
  width: min(410px, 100%);
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.budget-overview-eyebrow {
  margin: 0 0 5px;
  color: #257a4f;
  font-size: 0.8rem;
  font-weight: 700;
}

.hero-metrics {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  width: 100%;
}

.hero-metrics > div {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  min-height: 0;
  padding: 10px 0 14px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: center;
  animation: metricCardIn 520ms cubic-bezier(0.2, 0.78, 0.2, 1) backwards;
}

.hero-metrics > div:nth-child(1) {
  animation-delay: 40ms;
}

.hero-metrics > div.primary::before {
  display: none;
}

.hero-metrics > div.primary > * {
  position: relative;
  z-index: auto;
}

.hero-metrics > div.primary {
  border: 0;
  background: transparent;
}

.hero-metrics > div > #metric-total {
  color: var(--blue);
  font-size: clamp(2.1rem, 4vw, 3.15rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.hero-metrics > div.primary > #metric-total {
  color: #1f6a45;
  text-shadow: 0 8px 22px rgba(31, 106, 69, 0.15);
}

.hero-metrics > div > small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.025em;
}

.metric-total-full {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 5px 9px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 700;
  line-height: 1.4;
}

.metric-total-full strong {
  color: var(--blue);
  font-size: 1.02rem;
}

.hero-metrics > div.primary.is-loaded > #metric-total {
  animation: metricNumberPop 600ms cubic-bezier(0.2, 0.78, 0.2, 1) backwards;
}

.hero-metrics > div.primary.is-loaded .metric-total-full {
  animation: metricExactSlide 460ms cubic-bezier(0.2, 0.78, 0.2, 1) 150ms backwards;
}

.agency-budget-section {
  display: grid;
  gap: 12px;
  padding-top: 2px;
}

.agency-budget-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.agency-budget-heading-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.agency-budget-heading h3 {
  margin: 0;
  color: var(--navy);
  font-size: 1.06rem;
}

.agency-budget-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.agency-budget-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 0;
  border: 0;
  color: #74869a;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: color 160ms ease, transform 160ms ease;
}

.agency-budget-toggle-icon {
  font-size: 1rem;
  line-height: 1;
  transition: transform 180ms cubic-bezier(0.2, 0.78, 0.2, 1);
}

.agency-budget-toggle:hover,
.agency-budget-toggle:focus-visible {
  color: var(--blue);
  transform: translateY(-1px);
}

.agency-budget-toggle:focus-visible {
  border-radius: 5px;
}

.agency-distribution {
  position: relative;
  display: grid;
  gap: 8px;
  margin: 2px 0 4px;
  padding: 15px 16px 13px;
  border: 1px solid rgba(21, 88, 168, 0.13);
  border-radius: 10px;
  background: linear-gradient(135deg, #f8fcff, #ffffff 72%);
  box-shadow: 0 8px 22px rgba(7, 27, 52, 0.045);
  animation: agencyOverviewIn 560ms ease backwards;
  transition: margin-bottom 240ms ease;
}

.agency-distribution.tooltip-open-below {
  margin-bottom: var(--tooltip-space, 0px);
}

.agency-distribution-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.agency-distribution-heading > div {
  display: grid;
  gap: 1px;
}

.agency-distribution-kicker {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.agency-distribution-heading strong {
  color: var(--navy);
  font-size: 0.9rem;
  line-height: 1.4;
}

.agency-budget-stack {
  position: relative;
  isolation: isolate;
  display: flex;
  width: 100%;
  height: 30px;
  margin-top: 4px;
  border: 3px solid #ffffff;
  border-radius: 999px;
  background: #e7eef5;
  box-shadow: 0 0 0 1px rgba(21, 88, 168, 0.14), 0 7px 16px rgba(7, 27, 52, 0.08);
}

.agency-budget-stack:hover,
.agency-budget-stack:focus-within,
.agency-budget-stack.has-open-segment {
  z-index: 20;
}

.agency-budget-segment {
  position: relative;
  z-index: 1;
  flex: 0 0 var(--agency-share);
  min-width: 3px;
  height: 100%;
  padding: 0;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.72);
  background: var(--agency-color);
  animation: agencySegmentFade 720ms ease backwards;
  animation-delay: calc(120ms + var(--agency-order) * 55ms);
  transition: box-shadow 180ms ease, filter 180ms ease, opacity 180ms ease;
}

.agency-budget-segment:first-child {
  border-radius: 999px 0 0 999px;
}

.agency-budget-segment:last-child {
  border-right: 0;
  border-radius: 0 999px 999px 0;
}

.agency-budget-stack:hover .agency-budget-segment:not(:hover),
.agency-budget-stack:focus-within .agency-budget-segment:not(:focus-visible),
.agency-budget-stack.has-open-segment .agency-budget-segment:not(.is-open) {
  opacity: 0.48;
  filter: saturate(0.65);
}

.agency-budget-segment:hover,
.agency-budget-segment:focus-visible,
.agency-budget-segment.is-open {
  z-index: 5;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.72);
}

.agency-budget-segment:focus-visible {
  outline-color: rgba(11, 45, 92, 0.64);
  outline-offset: 4px;
}

.agency-segment-tooltip {
  position: fixed;
  z-index: 80;
  left: var(--tooltip-left, 50vw);
  top: var(--tooltip-top, 50vh);
  bottom: var(--tooltip-bottom, auto);
  display: grid;
  gap: 10px;
  width: min(340px, calc(100vw - 48px));
  padding: 18px;
  border: 1px solid rgba(21, 88, 168, 0.14);
  border-radius: 14px;
  color: var(--ink);
  background: #ffffff;
  text-align: left;
  box-shadow: 0 20px 44px rgba(7, 27, 52, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 7px) scale(0.97);
  transform-origin: bottom center;
  transition: opacity 150ms ease, transform 180ms cubic-bezier(0.2, 0.78, 0.2, 1);
}

.agency-segment-tooltip::after {
  content: "";
  position: absolute;
  left: var(--tooltip-arrow-left, 50%);
  top: 100%;
  width: 10px;
  height: 10px;
  border-right: 1px solid rgba(21, 88, 168, 0.14);
  border-bottom: 1px solid rgba(21, 88, 168, 0.14);
  background: #ffffff;
  transform: translate(-50%, -5px) rotate(45deg);
}

.agency-budget-segment:hover .agency-segment-tooltip,
.agency-budget-segment:focus-visible .agency-segment-tooltip,
.agency-budget-segment.is-open .agency-segment-tooltip {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.agency-segment-tooltip.is-below {
  transform-origin: top center;
}

.agency-segment-tooltip.is-below::after {
  top: auto;
  bottom: 100%;
  border-right: 0;
  border-bottom: 0;
  border-top: 1px solid rgba(21, 88, 168, 0.14);
  border-left: 1px solid rgba(21, 88, 168, 0.14);
  transform: translate(-50%, 5px) rotate(45deg);
}

.agency-tooltip-identity {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.agency-tooltip-identity .agency-budget-logo {
  width: 54px;
  height: 54px;
  border-color: color-mix(in srgb, var(--agency-color) 30%, #ffffff);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--agency-color) 18%, transparent);
}

.agency-tooltip-identity .agency-budget-logo img {
  width: 44px;
  height: 44px;
}

.agency-tooltip-name {
  max-width: 100%;
  color: var(--navy);
  font-size: 1.12rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.agency-tooltip-story {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 13px 14px 14px;
  border-radius: 10px;
  color: var(--muted);
  background: color-mix(in srgb, var(--agency-color) 8%, #ffffff);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
}

.agency-tooltip-kicker {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.agency-tooltip-statement {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 5px;
  max-width: 100%;
}

.agency-tooltip-story b {
  color: var(--navy);
  font-weight: 700;
}

.agency-tooltip-story strong {
  color: #1f6a45;
  font-size: 1.25rem;
  line-height: 1.15;
  white-space: nowrap;
}

.agency-distribution-scale {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 600;
  line-height: 1;
}

.agency-distribution-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.4;
}

.agency-distribution-hint span {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--blue);
  background: var(--sky-soft);
  font-weight: 700;
}

.agency-budget-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  max-height: 1400px;
  overflow: hidden;
  opacity: 1;
  transition: max-height 520ms cubic-bezier(0.2, 0.78, 0.2, 1), margin-top 260ms ease, opacity 180ms ease;
}

.agency-budget-grid.is-collapsed {
  max-height: 0;
  margin-top: -12px;
  opacity: 0;
  pointer-events: none;
}

.agency-budget-grid.is-expanded {
  margin-top: 0;
}

.agency-budget-card {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  min-height: 88px;
  padding: 12px 12px 17px;
  overflow: hidden;
  border: 1px solid rgba(21, 88, 168, 0.13);
  border-radius: 10px;
  color: var(--ink);
  background: #ffffff;
  text-align: left;
  box-shadow: 0 6px 18px rgba(7, 27, 52, 0.04);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.agency-budget-grid.is-expanded .agency-budget-card {
  animation: agencyCardIn 540ms cubic-bezier(0.2, 0.78, 0.2, 1) backwards;
  animation-delay: calc(var(--agency-order) * 65ms);
}

.agency-budget-card::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--agency-color);
}

.agency-budget-card:hover,
.agency-budget-card:focus-visible {
  border-color: var(--aqua);
  box-shadow: 0 10px 24px rgba(7, 27, 52, 0.1);
  transform: translateY(-2px);
}

.agency-budget-logo {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border: 1px solid rgba(21, 88, 168, 0.12);
  border-radius: 50%;
  background: #ffffff;
}

.agency-budget-logo img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.agency-budget-logo.fallback {
  color: var(--white);
  border-color: var(--blue);
  background: var(--blue);
  font-size: 0.78rem;
  font-weight: 700;
}

.agency-budget-copy,
.agency-budget-share {
  display: grid;
  min-width: 0;
}

.agency-budget-copy {
  gap: 2px;
}

.agency-budget-copy > strong {
  overflow: hidden;
  color: var(--navy);
  font-size: 0.82rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agency-budget-copy > span {
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 700;
}

.agency-budget-share {
  justify-items: end;
  text-align: right;
}

.agency-budget-share strong {
  color: #1f6a45;
  font-size: 1rem;
}

.agency-budget-share small {
  color: var(--muted);
  font-size: 0.65rem;
  white-space: nowrap;
}

.agency-budget-bar {
  position: absolute;
  right: 10px;
  bottom: 7px;
  left: 10px;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7eef5;
}

.agency-budget-bar i {
  display: block;
  width: var(--agency-share);
  height: 100%;
  border-radius: inherit;
  background: var(--agency-color);
  transform-origin: left center;
  animation: agencySegmentGrow 620ms cubic-bezier(0.2, 0.78, 0.2, 1) backwards;
  animation-delay: calc(420ms + var(--agency-order) * 55ms);
}

.culture-browser {
  position: relative;
  z-index: 2;
  overflow: visible;
  padding: 46px 0 74px;
}

.browser-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.browser-top .eyebrow {
  color: var(--blue);
  margin-bottom: 6px;
}

.browser-top h2 {
  color: var(--navy);
  font-size: clamp(1.8rem, 3vw, 2.45rem);
}

.browser-description {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.result-count {
  margin: 0 0 3px;
  padding: 7px 11px;
  border: 1px solid rgba(21, 88, 168, 0.12);
  border-radius: 999px;
  color: var(--blue);
  background: #ffffff;
  font-size: 0.84rem;
  font-weight: 700;
  text-align: right;
}

.browser-controls {
  position: relative;
  z-index: 30;
  margin-bottom: 18px;
  overflow: visible;
  border: 1px solid rgba(21, 88, 168, 0.12);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(7, 27, 52, 0.06);
}

.controls-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 14px;
}

.controls-heading > div {
  display: grid;
  gap: 2px;
}

.controls-heading strong {
  color: var(--navy);
  font-size: 1rem;
  line-height: 1.35;
}

.controls-eyebrow {
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.filter-panel-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid rgba(21, 88, 168, 0.16);
  border-radius: 12px;
  color: var(--blue);
  background: #f7fbff;
  font-weight: 700;
  touch-action: manipulation;
}

.filter-panel-emoji {
  font-size: 1.08rem;
  line-height: 1;
}

.filter-panel-count {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding-inline: 5px;
  border-radius: 999px;
  color: var(--white);
  background: var(--blue);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.filter-panel-count[hidden] {
  display: none;
}

.filter-panel-caret,
.custom-select-caret {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 180ms ease;
}

.filters-open .filter-panel-caret {
  transform: rotate(225deg) translateY(-2px);
}

.filter-controls-body {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(250px, 0.65fr);
  gap: 12px;
  padding: 0 18px 16px;
}

.control-section {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(21, 88, 168, 0.1);
  border-radius: 14px;
  background: #f9fcff;
}

.refine-control {
  grid-column: 1 / -1;
}

.control-section-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 11px;
}

.control-section-heading > div {
  display: grid;
  gap: 1px;
}

.control-section-heading strong {
  color: var(--navy);
  font-size: 0.84rem;
  line-height: 1.25;
}

.control-section-heading small {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.3;
}

.filter-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.quick-filters {
  display: grid;
  gap: 8px;
}

.filter-button,
.quick-filter-button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 58px;
  padding: 8px 9px;
  border: 1px solid rgba(21, 88, 168, 0.12);
  border-radius: 11px;
  color: var(--ink);
  background: #ffffff;
  font-weight: 700;
  text-align: left;
  box-shadow: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.filter-button:hover,
.filter-button:focus-visible,
.quick-filter-button:hover,
.quick-filter-button:focus-visible {
  border-color: color-mix(in srgb, var(--filter-accent) 48%, var(--line));
  background: color-mix(in srgb, var(--filter-soft) 55%, #ffffff);
  box-shadow: 0 0 0 3px rgba(21, 88, 168, 0.06);
}

.filter-button.active,
.quick-filter-button.active {
  border-color: var(--filter-accent);
  color: var(--navy);
  background: color-mix(in srgb, var(--filter-soft) 78%, #ffffff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--filter-accent) 18%, transparent);
}

.filter-icon-shell {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--filter-soft);
}

.filter-emoji {
  font-size: 1.06rem;
  line-height: 1;
}

.filter-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.filter-name {
  overflow-wrap: anywhere;
  font-size: 0.8rem;
  line-height: 1.22;
}

.filter-count {
  color: color-mix(in srgb, currentColor 72%, transparent);
  font-size: 0.72rem;
  line-height: 1.15;
  white-space: nowrap;
}

.filter-check {
  position: relative;
  width: 18px;
  height: 18px;
  border: 1.5px solid rgba(21, 88, 168, 0.2);
  border-radius: 50%;
  background: #ffffff;
}

.quick-filter-button .filter-check {
  border-radius: 5px;
}

.filter-button.active .filter-check,
.quick-filter-button.active .filter-check {
  border-color: var(--filter-accent);
  background: var(--filter-accent);
}

.filter-button.active .filter-check::after,
.quick-filter-button.active .filter-check::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: rotate(45deg);
}

.sort-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(280px, 1.15fr) auto;
  align-items: start;
  gap: 10px;
  margin: 0;
}

.sort-field {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 5px;
  min-width: 0;
}

.sort-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.sort-field.open,
.custom-select.open {
  z-index: 80;
}

.custom-select-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-width: 0;
  min-height: 62px;
  padding: 8px 38px 8px 12px;
  border: 1px solid rgba(21, 88, 168, 0.14);
  border-radius: 11px;
  color: var(--ink);
  background: #ffffff;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.custom-select-button:hover,
.custom-select-button:focus-visible,
.custom-select.open .custom-select-button {
  border-color: var(--aqua);
  outline: none;
  box-shadow: 0 0 0 4px rgba(24, 181, 204, 0.12);
}

.custom-select-value {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.custom-select-text {
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.3;
}

.custom-select-caret {
  position: absolute;
  right: 15px;
  top: 50%;
  color: var(--muted);
  pointer-events: none;
}

.custom-select.open .custom-select-caret {
  transform: rotate(225deg) translateY(-2px);
}

.custom-select-menu {
  position: absolute;
  right: 0;
  left: 0;
  top: calc(100% + 8px);
  z-index: 120;
  display: none;
  max-height: min(340px, 52dvh);
  overflow: auto;
  padding: 7px;
  border: 1px solid rgba(21, 88, 168, 0.17);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 18px 38px rgba(7, 27, 52, 0.18);
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(21, 88, 168, 0.45) rgba(231, 247, 255, 0.9);
}

.custom-select.open .custom-select-menu {
  display: grid;
  animation: dropdownIn 160ms ease-out both;
}

.custom-select-option {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 54px;
  padding: 8px;
  border: 0;
  border-radius: 10px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.custom-select-option:hover,
.custom-select-option:focus-visible {
  background: #edf7ff;
  transform: translateX(2px);
}

.custom-select-option.selected {
  color: var(--navy);
  background: #e7f4ff;
}

.dropdown-emoji,
.dropdown-agency-logo {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border-radius: 10px;
  background: #eef7ff;
  font-size: 1.05rem;
  line-height: 1;
}

.dropdown-agency-logo {
  border: 1px solid rgba(21, 88, 168, 0.1);
  border-radius: 50%;
  background: #ffffff;
}

.dropdown-agency-logo img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.dropdown-agency-logo.fallback {
  color: var(--white);
  border-color: var(--blue);
  background: var(--blue);
  font-size: 0.66rem;
  font-weight: 800;
}

.custom-option-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.custom-option-main {
  overflow-wrap: anywhere;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.25;
}

.custom-option-meta {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
}

.custom-option-check {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: var(--white);
  background: var(--blue);
  font-size: 0.76rem;
  font-weight: 800;
}

.custom-select-option:not(.selected) .custom-option-check {
  background: transparent;
}

.sort-helper {
  min-height: 1em;
  overflow: visible;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
  white-space: normal;
}

.clear-sorts-button {
  min-height: 62px;
  margin-top: 21px;
  padding: 0 14px;
  border: 1px solid rgba(21, 88, 168, 0.14);
  border-radius: 11px;
  color: var(--blue);
  background: #ffffff;
  font-weight: 700;
  box-shadow: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.clear-sorts-button:hover,
.clear-sorts-button:focus-visible {
  border-color: rgba(21, 88, 168, 0.3);
  color: var(--navy);
  background: #edf7ff;
  box-shadow: 0 0 0 3px rgba(21, 88, 168, 0.07);
}

.clear-sorts-button:disabled {
  border-color: rgba(95, 116, 140, 0.12);
  color: rgba(95, 116, 140, 0.58);
  background: #f3f6f9;
  box-shadow: none;
  cursor: not-allowed;
}

.active-summary {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  min-height: 56px;
  padding: 11px 18px;
  border-top: 1px solid rgba(21, 88, 168, 0.09);
  color: var(--muted);
  background: #fbfdff;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 0 0 18px 18px;
}

.active-summary-copy {
  display: grid;
  flex: 0 0 auto;
  gap: 1px;
}

.active-summary-copy strong {
  color: var(--navy);
  font-size: 0.8rem;
}

.active-filter-chips {
  display: flex;
  flex: 1 1 420px;
  flex-wrap: wrap;
  gap: 6px;
}

.active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: min(100%, 360px);
  min-height: 34px;
  padding: 4px 7px 4px 10px;
  border: 1px solid rgba(21, 88, 168, 0.2);
  border-radius: 999px;
  color: var(--blue);
  background: #ffffff;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.active-filter-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.active-filter-chip b {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #edf7ff;
  font-size: 0.9rem;
  line-height: 1;
}

.active-filter-chip:hover,
.active-filter-chip:focus-visible {
  border-color: var(--blue);
  background: #edf7ff;
}

.culture-items {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
}

.budget-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  min-height: 104px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 4px 12px rgba(7, 27, 52, 0.05);
  cursor: pointer;
  animation: budgetItemIn 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, background 180ms ease;
}

.budget-item:hover,
.budget-item:focus-visible {
  background: var(--white);
  box-shadow: 0 8px 20px rgba(7, 27, 52, 0.1);
  transform: translateY(-1px);
}

.budget-item[data-category="งบบุคลากร"] {
  border-left-color: #1558a8;
}

.budget-item[data-category="งบดำเนินงาน"] {
  border-left-color: #18b5cc;
}

.budget-item[data-category="งบลงทุน"] {
  border-left-color: #3b7f55;
}

.budget-item[data-category="งบเงินอุดหนุน"] {
  border-left-color: #f4bd45;
}

.budget-item[data-category="งบรายจ่ายอื่น"] {
  border-left-color: #f06b4f;
}

.item-main {
  min-width: 0;
}

.item-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-bottom: 4px;
}

.category-chip,
.agency-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border: 0;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
}

.category-chip {
  color: var(--ink);
  background: var(--sky-soft);
}

.facet-chip:hover,
.facet-chip:focus-visible {
  color: var(--white);
  background: var(--blue);
}

.budget-item[data-category="งบบุคลากร"] .category-chip {
  color: #3b267d;
  background: #f0ebff;
}

.budget-item[data-category="งบดำเนินงาน"] .category-chip {
  color: #0f6574;
  background: #e6fbff;
}

.budget-item[data-category="งบลงทุน"] .category-chip {
  color: #1d5c3b;
  background: #eaf8ef;
}

.budget-item[data-category="งบเงินอุดหนุน"] .category-chip {
  color: #755000;
  background: #fff5d8;
}

.budget-item[data-category="งบรายจ่ายอื่น"] .category-chip {
  color: #8e321d;
  background: #ffece6;
}

.agency-chip {
  padding-inline: 2px;
  color: var(--muted);
  background: transparent;
  font-weight: 600;
  text-align: left;
}

.agency-chip:hover,
.agency-chip:focus-visible {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.detail-ready-chip {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--blue);
  background: #edf7ff;
  border: 0;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.2;
}

.item-title {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.item-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-top: 5px;
}

.item-status {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.item-plan {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  width: fit-content;
  min-height: 44px;
  margin: 0;
  padding: 6px 0;
  border: 0;
  color: var(--blue);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 600;
  overflow-wrap: anywhere;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: rgba(21, 88, 168, 0.28);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  touch-action: manipulation;
}

.item-plan:hover,
.item-plan:focus-visible {
  color: var(--navy);
  text-decoration-color: currentColor;
}

.item-amount {
  display: grid;
  align-content: center;
  justify-items: end;
  min-width: 154px;
  text-align: right;
}

.item-amount-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
}

.item-amount strong {
  color: var(--blue);
  font-size: 1.18rem;
  line-height: 1.2;
  white-space: nowrap;
}

.item-year {
  display: inline-flex;
  justify-content: flex-end;
  width: 100%;
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.detail-modal-open {
  overflow: hidden;
}

.budget-detail-modal[hidden] {
  display: none;
}

.budget-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--blue);
}

.detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 27, 52, 0.58);
  backdrop-filter: blur(8px);
}

.detail-panel {
  position: relative;
  z-index: 1;
  width: min(1040px, 100%);
  max-height: min(88vh, 880px);
  overflow: auto;
  padding: 0;
  border: 1px solid rgba(21, 88, 168, 0.18);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 30px 80px rgba(7, 27, 52, 0.28);
  scrollbar-width: thin;
  scrollbar-color: rgba(21, 88, 168, 0.42) rgba(231, 247, 255, 0.9);
}

.detail-close {
  position: sticky;
  top: 16px;
  z-index: 5;
  float: right;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin: 16px 16px -58px 16px;
  border: 1px solid rgba(21, 88, 168, 0.18);
  border-radius: 50%;
  color: var(--blue);
  background: #ffffff;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 8px 20px rgba(7, 27, 52, 0.08);
}

.detail-close:hover,
.detail-close:focus-visible {
  color: #ffffff;
  background: var(--blue);
}

.detail-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, auto);
  gap: 20px;
  align-items: start;
  clear: both;
  padding: 30px 78px 26px 30px;
  border-bottom: 1px solid rgba(21, 88, 168, 0.16);
  background:
    radial-gradient(circle at 88% 12%, rgba(24, 169, 195, 0.14), transparent 34%),
    linear-gradient(135deg, #f7fcff 0%, #ffffff 70%);
}

.detail-eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.detail-header h2 {
  color: var(--navy);
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1.22;
}

.detail-policy-name {
  display: grid;
  gap: 2px;
  max-width: 720px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
}

.detail-policy-name span {
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 700;
}

.detail-amount {
  display: grid;
  justify-items: end;
  gap: 4px;
  padding: 16px;
  border: 1px solid rgba(21, 88, 168, 0.16);
  border-radius: var(--radius);
  background: #f7fcff;
  text-align: right;
}

.detail-amount span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.detail-amount strong {
  color: var(--blue);
  font-size: 1.45rem;
  line-height: 1.2;
}

.detail-amount small {
  color: #257a4f;
  font-size: 0.78rem;
  font-weight: 700;
}

.detail-body {
  display: grid;
  gap: 20px;
  padding: 26px 30px 30px;
}

.detail-tab-nav {
  display: flex;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid rgba(21, 88, 168, 0.14);
  border-radius: 999px;
  background: #f1f7fc;
  box-shadow: 0 8px 22px rgba(9, 51, 98, 0.07);
  scrollbar-width: thin;
  overscroll-behavior-inline: contain;
}

.detail-tab-nav button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.detail-tab-nav button:hover {
  color: var(--blue);
  background: rgba(255, 255, 255, 0.72);
}

.detail-tab-nav button[aria-selected="true"] {
  color: #ffffff;
  background: var(--blue);
  box-shadow: 0 5px 14px rgba(21, 88, 168, 0.24);
}

.detail-tab-nav button:focus-visible {
  outline: 3px solid rgba(24, 169, 195, 0.35);
  outline-offset: 2px;
}

.detail-tab-nav button:active {
  transform: translateY(1px);
}

.detail-tab-panels,
.detail-tab-panels > [role="tabpanel"] {
  min-width: 0;
}

.detail-tab-panels > [role="tabpanel"] {
  animation: detail-tab-enter 180ms ease-out;
}

.detail-tab-panels > [role="tabpanel"][hidden] {
  display: none;
}

@keyframes detail-tab-enter {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.detail-policy-overview,
.detail-category,
.detail-reading-section,
.detail-scope-card {
  min-width: 0;
  border: 1px solid rgba(21, 88, 168, 0.14);
  border-radius: var(--radius);
  background: #ffffff;
}

.detail-policy-overview,
.detail-category,
.detail-scope-card {
  padding: 20px;
}

.detail-scope-card {
  border-color: rgba(37, 122, 79, 0.28);
  background: linear-gradient(135deg, #f7fffa, #ffffff 64%);
  box-shadow: inset 4px 0 0 #257a4f;
}

.detail-scope-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.detail-scope-heading h3 {
  margin: 0;
  color: var(--navy);
  font-size: 1.08rem;
  line-height: 1.4;
}

.detail-scope-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.detail-scope-badge {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  color: #1f6a45;
  background: #e1f5e9;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.detail-scope-comparison {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.detail-scope-comparison > div {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 14px;
  border: 1px solid rgba(21, 88, 168, 0.13);
  border-radius: 10px;
  background: #f7fbff;
}

.detail-scope-comparison > div.current {
  border-color: rgba(37, 122, 79, 0.3);
  background: #eaf8ef;
}

.detail-scope-comparison div > span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.detail-scope-comparison div > strong {
  color: var(--blue);
  font-size: 1.15rem;
}

.detail-scope-comparison div.current > strong {
  color: #1f6a45;
}

.detail-scope-comparison div > small {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.detail-scope-connector {
  align-self: center;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--blue);
  background: var(--sky-soft);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.detail-section-heading {
  display: grid;
  gap: 3px;
  margin-bottom: 14px;
}

.detail-section-heading h3 {
  margin: 0;
  color: var(--navy);
  font-size: 1.12rem;
  line-height: 1.35;
}

.detail-section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.detail-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(21, 88, 168, 0.12);
  border-radius: calc(var(--radius) - 4px);
  background: rgba(21, 88, 168, 0.12);
}

.detail-summary-item {
  min-width: 0;
  padding: 13px 14px;
  background: #f9fdff;
}

.detail-summary-item span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.detail-summary-item p {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--blue);
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.45;
}

.project-value-card {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(240px, 1.2fr);
  gap: 14px 18px;
  align-items: center;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(21, 88, 168, 0.16);
  border-radius: 13px;
  background: linear-gradient(135deg, #f5fbff 0%, #ffffff 62%);
  box-shadow: inset 4px 0 0 var(--blue);
}

.project-value-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.project-value-symbol {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 11px;
  color: var(--white);
  background: var(--blue);
  font-size: 1.05rem;
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(21, 88, 168, 0.18);
}

.project-value-heading > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.project-value-heading span:not(.project-value-symbol) {
  color: var(--navy);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.3;
}

.project-value-heading small,
.project-value-main > span,
.project-value-breakdown small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.35;
}

.project-value-main {
  display: grid;
  justify-items: end;
  gap: 2px;
  min-width: 0;
  padding-left: 18px;
  border-left: 1px solid rgba(21, 88, 168, 0.12);
  text-align: right;
}

.project-value-main p,
.project-value-breakdown p {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-end;
  gap: 5px;
  margin: 0;
}

.project-value-main strong {
  color: var(--blue);
  font-size: clamp(1.35rem, 3vw, 1.78rem);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.project-value-main p small,
.project-value-breakdown p small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.project-value-context,
.project-value-note,
.project-value-breakdown {
  grid-column: 1 / -1;
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
}

.project-value-context {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #24527c;
  background: #eaf4ff;
  font-size: 0.78rem;
  line-height: 1.45;
}

.project-value-context > span {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  margin-top: 1px;
  border-radius: 50%;
  color: var(--white);
  background: var(--blue);
  font-family: Georgia, serif;
  font-size: 0.8rem;
  font-style: italic;
  font-weight: 700;
}

.project-value-context p {
  margin: 0;
}

.project-value-context strong {
  color: #174d7c;
}

.project-value-note,
.project-value-breakdown {
  background: #eaf8ef;
}

.project-value-note {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #1f6a45;
  font-size: 0.8rem;
}

.project-value-note > span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--white);
  background: #257a4f;
  font-size: 0.7rem;
  font-weight: 800;
}

.project-value-breakdown {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #1f6a45;
}

.project-value-breakdown > div {
  display: grid;
  gap: 1px;
}

.project-value-breakdown > div > span {
  font-size: 0.8rem;
  font-weight: 700;
}

.project-value-breakdown p strong {
  font-size: 0.94rem;
  font-variant-numeric: tabular-nums;
}

.detail-policy-narrative {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-left: 4px solid var(--aqua);
  border-radius: 0 calc(var(--radius) - 5px) calc(var(--radius) - 5px) 0;
  color: var(--blue);
  background: #eefaff;
  font-weight: 700;
  line-height: 1.55;
}

.detail-policy-narrative span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.76rem;
}

.detail-policy-narrative p {
  margin: 0;
}

.detail-budget-path {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.detail-budget-path li {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) minmax(180px, auto);
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid rgba(21, 88, 168, 0.13);
  border-radius: 10px;
  background: #ffffff;
}

.detail-budget-path li.has-no-amount {
  grid-template-columns: 34px minmax(0, 1fr);
}

.detail-budget-path li + li {
  margin-top: 14px;
}

.detail-budget-path li + li::before {
  content: "";
  position: absolute;
  left: 31px;
  bottom: 100%;
  width: 2px;
  height: 15px;
  background: rgba(24, 169, 195, 0.55);
}

.detail-budget-step-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--white);
  background: var(--blue);
  font-size: 0.82rem;
  font-weight: 700;
}

.detail-budget-step-copy,
.detail-budget-step-amount {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.detail-budget-step-kind,
.detail-budget-step-amount span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.detail-budget-step-title {
  color: var(--blue);
  font-size: 0.94rem;
  line-height: 1.48;
  overflow-wrap: anywhere;
}

.detail-budget-step-amount {
  justify-items: end;
  text-align: right;
}

.detail-budget-step-amount strong {
  color: var(--navy);
  font-size: 0.9rem;
  white-space: nowrap;
}

.detail-budget-path li.selected {
  background: #eaf8ef;
  border-color: rgba(37, 122, 79, 0.35);
  box-shadow: inset 4px 0 0 #257a4f;
}

.detail-budget-path li.selected .detail-budget-step-number {
  background: #257a4f;
}

.detail-budget-path li.selected .detail-budget-step-kind,
.detail-budget-path li.selected .detail-budget-step-title,
.detail-budget-path li.selected .detail-budget-step-amount strong {
  color: #1f6a45;
}

.detail-budget-path-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--muted);
  background: #f4f8fc;
  font-size: 0.8rem;
  line-height: 1.5;
}

.detail-budget-path-note span {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--white);
  background: var(--blue);
  font-size: 0.7rem;
  font-weight: 700;
}

.detail-reading-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.detail-reading-section {
  padding: 20px;
  background: #fbfdff;
}

.detail-readable-copy {
  display: grid;
  gap: 0;
  padding: 0 14px;
  border-left: 3px solid rgba(24, 169, 195, 0.55);
}

.detail-readable-copy p {
  margin: 0;
  color: var(--blue);
  font-size: 0.96rem;
  line-height: 1.65;
}

.detail-readable-copy p + p {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(21, 88, 168, 0.16);
}

.detail-indicator-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(21, 88, 168, 0.14);
  border-radius: 10px;
  background: #ffffff;
  -webkit-overflow-scrolling: touch;
}

.detail-indicator-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  color: var(--navy);
  font-size: 0.8rem;
}

.detail-indicator-table th,
.detail-indicator-table td {
  padding: 10px 8px;
  border-right: 1px solid rgba(21, 88, 168, 0.1);
  border-bottom: 1px solid rgba(21, 88, 168, 0.1);
  text-align: center;
  vertical-align: middle;
}

.detail-indicator-table tr > :last-child {
  border-right: 0;
}

.detail-indicator-table tbody tr:last-child > * {
  border-bottom: 0;
}

.detail-indicator-table thead th {
  color: #ffffff;
  background: var(--blue);
  font-weight: 700;
  white-space: nowrap;
}

.detail-indicator-table thead small {
  font-size: 0.68rem;
  font-weight: 500;
}

.detail-indicator-table thead th:first-child,
.detail-indicator-table tbody th {
  min-width: 280px;
  text-align: left;
}

.detail-indicator-table tbody th {
  font-weight: 600;
}

.detail-indicator-table .current {
  color: #1f6a45;
  background: #eaf8ef;
  font-weight: 800;
}

.detail-indicator-table thead .current {
  color: #ffffff;
  background: #257a4f;
}

.detail-indicator-type {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--blue);
  background: var(--sky-soft);
  font-size: 0.72rem;
  font-weight: 700;
}

.detail-indicator-label {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  line-height: 1.5;
}

.detail-indicator-unparsed td {
  color: var(--muted);
  text-align: left;
  line-height: 1.55;
}

.detail-related-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 2px;
}

.detail-related-actions > span {
  margin-right: 2px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.detail-loading {
  min-height: 260px;
}

.detail-loading-copy {
  display: grid;
  align-content: center;
  min-height: 260px;
  padding: 42px;
  text-align: center;
}

.detail-loading-copy h2 {
  color: var(--navy);
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.detail-actions,
.detail-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-actions {
  margin: 18px 0;
}

.detail-link-chip,
.detail-chip {
  min-height: 44px;
  border: 1px solid rgba(21, 88, 168, 0.18);
  border-radius: 999px;
  color: var(--blue);
  background: #ffffff;
  font-weight: 700;
  text-align: left;
}

.detail-link-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  text-decoration: none;
}

.detail-link-chip.primary {
  color: #ffffff;
  background: var(--blue);
}

.detail-chip {
  display: grid;
  gap: 1px;
  max-width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: #f7fcff;
}

.detail-chip span {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.1;
}

.detail-link-chip:hover,
.detail-link-chip:focus-visible,
.detail-chip:hover,
.detail-chip:focus-visible,
.detail-line.as-button:hover,
.detail-line.as-button:focus-visible {
  color: #ffffff;
  background: var(--blue);
  border-color: var(--blue);
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 16px;
  margin-bottom: 16px;
}

.detail-section {
  min-width: 0;
  margin-top: 16px;
}

.detail-grid .detail-section {
  margin-top: 0;
}

.detail-section h3 {
  margin-bottom: 10px;
  color: var(--navy);
  font-size: 1.08rem;
}

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

.detail-fact {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(21, 88, 168, 0.14);
  border-radius: var(--radius);
  background: #f7fcff;
}

.detail-fact span,
.detail-line span,
.detail-line small,
.detail-footer,
.detail-empty {
  color: var(--muted);
}

.detail-fact span,
.detail-line span {
  font-size: 0.78rem;
  font-weight: 700;
}

.detail-fact strong,
.detail-line strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--blue);
  font-size: 0.95rem;
  line-height: 1.38;
}

.detail-list {
  display: grid;
  gap: 8px;
}

.detail-line {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 11px 13px;
  border: 1px solid rgba(21, 88, 168, 0.14);
  border-radius: var(--radius);
  background: #ffffff;
  text-align: left;
}

.detail-line.as-button {
  cursor: pointer;
}

.detail-line.as-button:hover strong,
.detail-line.as-button:focus-visible strong,
.detail-line.as-button:hover span,
.detail-line.as-button:focus-visible span,
.detail-chip:hover span,
.detail-chip:focus-visible span {
  color: #ffffff;
}

.detail-line small {
  font-size: 0.8rem;
  font-weight: 700;
}

.detail-footer {
  margin-top: 0;
  padding: 16px 30px;
  border-top: 1px solid rgba(21, 88, 168, 0.16);
  background: #fff8ed;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.55;
}

.detail-footer p {
  margin: 0;
}

.detail-footer a {
  margin-left: 0.25em;
  color: #a84300;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.detail-footer a:hover,
.detail-footer a:focus-visible {
  color: #7a2f00;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 20px auto 0;
}

.pagination-button,
.pagination-ellipsis {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  font-size: 0.82rem;
  font-weight: 700;
}

.pagination-button {
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--white);
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.pagination-button:hover,
.pagination-button:focus-visible {
  border-color: rgba(21, 88, 168, 0.36);
  color: var(--blue);
  background: #edf7ff;
  transform: translateY(-1px);
}

.pagination-button.is-current {
  border-color: var(--blue);
  color: var(--white);
  background: var(--blue);
  box-shadow: 0 5px 12px rgba(21, 88, 168, 0.22);
}

.pagination-ellipsis {
  width: 18px;
  color: var(--muted);
}

.empty-state {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--white);
  text-align: center;
}

.site-footer {
  border-top: 5px solid var(--aqua);
  color: #f8fbff;
  background: var(--ink);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(220px, 0.62fr) minmax(0, 1.55fr);
  align-items: center;
  gap: clamp(32px, 6vw, 88px);
  padding: 40px 0 32px;
}

.footer-logos {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.footer-logo-link {
  display: inline-flex;
  flex: 0 0 auto;
  border-radius: 10px;
}

.footer-logo-link:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 4px;
}

.footer-logo {
  width: auto;
  height: auto;
  object-fit: contain;
}

.footer-logo-budget {
  width: clamp(96px, 9vw, 124px);
}

.footer-logo-flashthink {
  width: clamp(76px, 7vw, 96px);
}

.footer-logo-divider {
  width: 1px;
  height: 52px;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.28);
}

.footer-content {
  width: 100%;
  max-width: 860px;
  margin-left: auto;
}

.site-footer p {
  margin: 0;
}

.footer-disclaimer {
  color: #f8fbff;
  font-size: 0.98rem;
  line-height: 1.75;
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.footer-contact,
.footer-copyright {
  color: #cbdbea;
  font-size: 0.88rem;
  line-height: 1.6;
}

.site-footer a:not(.footer-logo-link) {
  color: var(--sky);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

@keyframes budgetItemIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.992);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes dropdownIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes agencyOverviewIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes agencySegmentFade {
  from {
    opacity: 0.18;
  }

  to {
    opacity: 1;
  }
}

@keyframes metricCardIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes metricNumberPop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.92);
  }

  70% {
    transform: translateY(-2px) scale(1.025);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes metricExactSlide {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes metricGlowPulse {
  0%,
  100% {
    opacity: 0.65;
    transform: scale(0.92);
  }

  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

@keyframes agencySegmentGrow {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

@keyframes agencyCardIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.hero-metrics > div.ministry-year-comparison {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) minmax(210px, auto);
  gap: 16px;
  align-items: center;
  width: min(980px, 100%);
  margin: 8px auto 14px;
  padding: 16px 0;
  border-top: 1px solid rgba(21, 88, 168, 0.14);
  border-bottom: 1px solid rgba(21, 88, 168, 0.14);
  text-align: center;
}

.ministry-year-comparison[hidden] {
  display: none;
}

.comparison-number {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.comparison-number span,
.ministry-change-inline > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.comparison-number strong,
.ministry-change-inline strong {
  color: var(--navy);
  font-size: clamp(1.05rem, 2vw, 1.42rem);
  line-height: 1.25;
}

.comparison-number small {
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 700;
}

.comparison-number-arrow {
  color: var(--aqua);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

.ministry-change-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1px 8px;
  align-items: center;
  min-width: 0;
  padding-left: 18px;
  border-left: 1px solid rgba(21, 88, 168, 0.16);
  text-align: left;
}

.ministry-change-inline > span,
.ministry-change-inline > strong {
  grid-column: 1;
}

.ministry-change-inline em {
  grid-row: 1 / span 2;
  grid-column: 2;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 700;
}

.increase em,
.comparison-delta.increase,
.agency-card-delta.increase,
.agency-tooltip-comparison.increase strong {
  color: #17613e;
  background: #e7f7ee;
}

.decrease em,
.comparison-delta.decrease,
.agency-card-delta.decrease,
.agency-tooltip-comparison.decrease strong {
  color: #a13c28;
  background: #fff0eb;
}

.unchanged em,
.comparison-delta.unchanged,
.agency-card-delta.unchanged,
.agency-tooltip-comparison.unchanged strong {
  color: #526579;
  background: #edf2f6;
}

.agency-tooltip-comparison {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  border-radius: 9px;
  color: var(--muted);
  background: #f6f9fc;
  font-size: 0.73rem;
  font-weight: 700;
}

.agency-tooltip-comparison strong {
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 0.76rem;
  white-space: nowrap;
}

.agency-card-delta {
  margin-top: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.comparison-ready-chip {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 6px;
  border: 0;
  border-radius: 999px;
  color: #0f665f;
  background: #e8f8f5;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.2;
}

.policy-year-comparison,
.comparison-empty-state,
.previous-detail-section {
  padding: 20px;
  border: 1px solid rgba(21, 88, 168, 0.14);
  border-radius: var(--radius);
  background: #f9fdff;
}

.year-comparison-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 14px;
  border-radius: 10px;
  background: #ffffff;
}

.year-comparison-headline > div {
  display: grid;
  gap: 2px;
}

.year-comparison-headline span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.year-comparison-headline strong {
  color: var(--navy);
  font-size: 1.25rem;
}

.comparison-delta {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.year-comparison-bars {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 10px;
  background: #ffffff;
}

.year-comparison-row {
  display: grid;
  grid-template-columns: 42px minmax(80px, 1fr) minmax(140px, auto);
  align-items: center;
  gap: 10px;
}

.year-comparison-row > span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.year-comparison-row i {
  display: block;
  width: max(3px, var(--comparison-width));
  height: 12px;
  border-radius: 999px;
  background: #91a7bb;
}

.year-comparison-row.current i {
  background: linear-gradient(90deg, var(--blue), var(--aqua));
}

.year-comparison-row strong {
  color: var(--navy);
  font-size: 0.86rem;
  text-align: right;
}

.comparison-title-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.comparison-title-grid > div {
  padding: 13px;
  border-radius: 10px;
  background: #ffffff;
}

.comparison-title-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.comparison-plan-link {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 10px 11px;
  border: 1px solid rgba(21, 88, 168, 0.14);
  border-radius: 10px;
  color: var(--blue);
  background: #f8fcff;
  font-weight: 700;
  line-height: 1.5;
  text-decoration: none;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.comparison-plan-link b {
  flex: 0 0 auto;
  color: var(--aqua);
  font-size: 1rem;
  line-height: 1.4;
}

.comparison-plan-link:hover,
.comparison-plan-link:focus-visible {
  border-color: var(--aqua);
  background: #eefaff;
  box-shadow: 0 0 0 3px rgba(24, 169, 195, 0.14);
}

.comparison-plan-reference {
  min-height: 44px;
  margin: 0;
  padding: 10px 11px;
  border: 1px solid rgba(21, 88, 168, 0.11);
  border-radius: 10px;
  color: var(--navy);
  background: #f6f9fc;
  font-weight: 700;
  line-height: 1.5;
}

.comparison-empty-state {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  color: var(--muted);
}

.comparison-empty-state > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--blue);
  background: var(--sky-soft);
  font-size: 1.2rem;
  font-weight: 700;
}

.comparison-empty-state h3,
.comparison-empty-state p {
  margin: 0;
}

.comparison-empty-state h3 {
  color: var(--navy);
  font-size: 1.05rem;
}

.comparison-empty-state p {
  margin-top: 4px;
  line-height: 1.55;
}

.previous-detail-loader {
  margin-top: 14px;
  color: var(--muted);
}

.previous-detail-loader > p {
  margin: 0;
  padding: 18px;
  border: 1px dashed rgba(21, 88, 168, 0.24);
  border-radius: var(--radius);
  background: #f7fbfe;
  text-align: center;
}

.previous-detail-section {
  display: grid;
  gap: 16px;
  background: #ffffff;
}

.previous-detail-section .detail-reading-section {
  margin: 0;
}

.previous-indicator-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.previous-indicator-grid article,
.previous-indicator-grid > p {
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(21, 88, 168, 0.12);
  border-radius: 9px;
  background: #f9fdff;
}

.previous-indicator-grid article {
  display: grid;
  gap: 4px;
}

.previous-indicator-grid span {
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 700;
}

.previous-indicator-grid strong {
  color: var(--navy);
  line-height: 1.45;
}

.previous-indicator-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 1080px) {
  h1 {
    font-size: 4.7rem;
  }

  .filter-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

@media (max-width: 760px) {
  :root {
    --header-height: 66px;
  }

  .container {
    width: min(100% - 28px, 1120px);
  }

  .site-header {
    min-height: var(--header-height);
    padding: 8px 14px;
  }

  .brand-logo {
    width: 38px;
    height: 38px;
  }

  .menu-button {
    display: inline-grid;
  }

  .primary-nav {
    position: absolute;
    right: 14px;
    left: 14px;
    top: calc(100% + 8px);
    display: none;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow);
  }

  .primary-nav.open {
    display: grid;
  }

  .nav-link {
    min-height: 46px;
  }

  .culture-hero {
    padding: 46px 0 36px;
    background-size: auto, 58px 58px;
  }

  h1 {
    font-size: 3.35rem;
  }

  h2 {
    font-size: 2rem;
  }

  .culture-subtitle {
    font-size: 1.03rem;
  }

  .source-credit {
    flex-wrap: wrap;
  }

  .budget-overview {
    gap: 16px;
    padding: 16px;
  }

  .budget-overview-heading,
  .agency-budget-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .agency-budget-toggle {
    align-self: flex-end;
  }

  .budget-overview,
  .agency-budget-section,
  .agency-budget-heading,
  .agency-distribution {
    min-width: 0;
  }

  .agency-budget-heading h3,
  .agency-budget-heading p,
  .agency-distribution-heading strong {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .agency-distribution {
    padding: 14px;
  }

  .agency-distribution-heading {
    align-items: flex-start;
  }

  .agency-budget-stack {
    height: 34px;
  }

  .agency-segment-tooltip {
    gap: 9px;
    width: min(310px, calc(100vw - 24px));
    padding: 14px;
    border-radius: 12px;
  }

  .agency-tooltip-identity {
    gap: 6px;
  }

  .agency-tooltip-identity .agency-budget-logo {
    width: 48px;
    height: 48px;
  }

  .agency-tooltip-identity .agency-budget-logo img {
    width: 39px;
    height: 39px;
  }

  .agency-tooltip-name {
    font-size: 0.98rem;
  }

  .agency-tooltip-story {
    padding: 9px 10px;
    font-size: 0.76rem;
  }

  .agency-tooltip-story strong {
    font-size: 1.12rem;
  }

  .search-shell {
    min-height: 58px;
    padding: 0 16px;
    border-radius: var(--radius);
  }

  .search-shell input {
    font-size: 0.96rem;
  }

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

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .hero-metrics div {
    min-height: 96px;
  }

  .hero-metrics > div.primary {
    min-height: 0;
    padding: 8px 0 12px;
  }

  .hero-metrics > div.ministry-year-comparison,
  .comparison-title-grid,
  .previous-indicator-grid {
    grid-template-columns: 1fr;
  }

  .hero-metrics > div.ministry-year-comparison {
    gap: 8px;
  }

  .ministry-change {
    min-height: 0;
  }

  .metric-total-full {
    display: grid;
    gap: 2px;
  }

  .agency-budget-grid {
    grid-template-columns: 1fr;
  }

  .agency-budget-copy > strong {
    white-space: normal;
  }

  .browser-top,
  .footer-inner {
    align-items: flex-start;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 32px 0 28px;
  }

  .footer-content {
    max-width: none;
    margin-left: 0;
  }

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

  .result-count {
    text-align: left;
  }

  .controls-heading {
    align-items: stretch;
    flex-direction: column;
    padding: 14px;
  }

  .filter-panel-toggle {
    display: flex;
    width: 100%;
    justify-content: flex-start;
  }

  .filter-panel-toggle .filter-panel-caret {
    margin-left: auto;
  }

  .filter-controls-body {
    display: none;
    grid-template-columns: 1fr;
    padding: 0 14px 14px;
  }

  .browser-controls.filters-open .filter-controls-body {
    display: grid;
  }

  .refine-control {
    grid-column: auto;
  }

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

  .sort-panel {
    grid-template-columns: 1fr;
  }

  .sort-helper {
    white-space: normal;
  }

  .custom-select-button {
    min-height: 62px;
    font-size: 1rem;
  }

  .sort-order-field .custom-select-menu {
    top: auto;
    bottom: calc(100% + 8px);
  }

  .clear-sorts-button {
    width: 100%;
    margin-top: 0;
  }

  .active-summary {
    align-items: flex-start;
    padding: 12px 14px;
  }

  .active-summary-copy,
  .active-filter-chips {
    flex-basis: 100%;
  }

  .active-filter-chip {
    min-height: 44px;
  }

  .pagination-button,
  .pagination-ellipsis {
    width: 44px;
    height: 44px;
  }

  .pagination-ellipsis {
    width: 22px;
  }

  .budget-item {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .item-amount {
    justify-items: end;
    min-width: 0;
    text-align: right;
  }

  .budget-detail-modal {
    padding: 12px;
    align-items: end;
  }

  .detail-panel {
    max-height: 92vh;
    padding: 0;
  }

  .detail-header,
  .detail-grid,
  .detail-facts,
  .detail-summary-grid,
  .detail-reading-grid {
    grid-template-columns: 1fr;
  }

  .detail-header {
    padding: 70px 18px 22px;
  }

  .detail-body {
    padding: 18px;
  }

  .detail-tab-nav {
    width: 100%;
    border-radius: 16px;
  }

  .detail-tab-nav button {
    padding-inline: 14px;
  }

  .year-comparison-headline {
    align-items: flex-start;
    flex-direction: column;
  }

  .year-comparison-row {
    grid-template-columns: 38px minmax(70px, 1fr);
  }

  .year-comparison-row strong {
    grid-column: 2;
    text-align: left;
  }

  .policy-year-comparison,
  .comparison-empty-state,
  .previous-detail-section {
    padding: 16px;
  }

  .detail-policy-overview,
  .detail-category,
  .detail-reading-section,
  .detail-scope-card {
    padding: 16px;
  }

  .project-value-card {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px;
  }

  .project-value-main {
    justify-items: start;
    padding: 12px 0 0;
    border-top: 1px solid rgba(21, 88, 168, 0.12);
    border-left: 0;
    text-align: left;
  }

  .project-value-main p,
  .project-value-breakdown p {
    justify-content: flex-start;
  }

  .project-value-breakdown {
    display: grid;
  }

  .detail-scope-heading {
    display: grid;
  }

  .detail-scope-badge {
    width: fit-content;
  }

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

  .detail-scope-connector {
    justify-self: start;
  }

  .detail-amount {
    justify-items: start;
    text-align: left;
  }

  .detail-close {
    width: 40px;
    height: 40px;
    margin: 12px 12px -52px 12px;
  }

  .detail-budget-path li {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 8px 10px;
    padding: 13px;
  }

  .detail-budget-step-amount {
    grid-column: 2;
    justify-items: start;
    text-align: left;
  }

  .detail-budget-step-amount strong {
    white-space: normal;
  }

  .detail-footer {
    display: grid;
    justify-content: stretch;
    padding: 15px 18px;
  }
}

@media (max-width: 420px) {
  h1 {
    font-size: 2.78rem;
  }

  .budget-item {
    padding: 15px;
  }

  .control-section {
    padding: 12px;
  }

  .filter-button,
  .quick-filter-button {
    grid-template-columns: 30px minmax(0, 1fr) 16px;
    gap: 6px;
    min-height: 60px;
    padding: 7px;
  }

  .filter-icon-shell {
    width: 30px;
    height: 30px;
  }

  .filter-name {
    font-size: 0.76rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
