:root {
  color-scheme: light;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: white;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.shell { width: min(calc(100% - clamp(32px, 6.4vw, 112px)), 1500px); margin-inline: auto; }
.skip-link { position: absolute; z-index: 6000; top: 0; left: 1rem; transform: translateY(-150%); background: white; padding: .75rem; }
.skip-link:focus { transform: translateY(0); }
.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .58rem 1rem; text-decoration: none; border: 1px solid transparent; border-radius: 5px; font-weight: 650; font-size: .9rem; line-height: 1.2; }
.button.primary { background: var(--blue); border-color: #4949ff; color: white; }
.button.primary:hover { background: #0404b2; }
.footer a:hover { text-decoration: underline; }
.explore-section { padding-block: clamp(1.15rem, 2vw, 2rem) clamp(1.65rem, 3vw, 3rem); }
.workspace-heading, .section-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .6rem 1rem; }
.workspace-heading { margin-bottom: 1.15rem; align-items: end; }
.workspace-heading h1, .section-heading h2, .worksheet h3 {
  margin: 0; letter-spacing: -.045em; line-height: 1.1; color: var(--ink);
}
.workspace-heading h1 { font-size: clamp(2rem, 3vw, 3.25rem); font-weight: 690; }
.workspace-heading p { margin: .4rem 0 0; color: var(--muted); font-size: clamp(.9rem, 1.05vw, 1.05rem); line-height: 1.45; }
.jump-links { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1.2rem; }
.jump-links a, .text-link { display: inline-flex; align-items: center; gap: .45rem; min-height: 38px; font-weight: 620; font-size: .88rem; color: var(--ink); }
.jump-links a { text-decoration: none; }
.jump-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.jump-links a span { color: var(--blue); font-weight: 700; }
#public-explorer { min-width: 0; }
.loading-note { font-size: .9rem; color: var(--muted); }
.section-heading { margin-bottom: 1.15rem; }
.section-heading h2 { font-size: clamp(1.55rem, 2.4vw, 2.15rem); font-weight: 670; }
.analysis-band { background: var(--wash); border-block: 1px solid #e3e3e7; padding-block: clamp(1.65rem, 3.5vw, 3.7rem); }
.text-link { border: 0; background: transparent; color: var(--blue); text-decoration: underline; text-underline-offset: 3px; padding: .35rem 0; }
.text-link:disabled { color: var(--muted); text-decoration: none; }
#share-url { display: block; width: min(100%, 44rem); margin: 0 0 1rem; padding: .6rem; }
.worksheet { min-width: 0; padding: clamp(1rem, 2.1vw, 2rem); border: 1px solid var(--line); border-radius: 6px; background: white; }
.worksheet h3 { font-size: 1.22rem; font-weight: 660; }
.worksheet-route { color: var(--muted); margin: .55rem 0 1.1rem; font-size: .91rem; line-height: 1.4; }
.scenario-inputs, .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .9rem; }
.scenario-inputs label, .form-grid label { display: flex; flex-direction: column; align-items: stretch; gap: .32rem; color: var(--ink); font-size: .85rem; font-weight: 600; }
.scenario-inputs input, .form-grid input, .form-grid select { min-width: 0; font: inherit; font-weight: 450; background: white; color: var(--ink); min-height: 42px; padding: .52rem .7rem; border: 1px solid #87878d; border-radius: 4px; }
.scenario-values { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .75rem; margin: 1.25rem 0 .9rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.scenario-values dt, .source-note { font-size: .8rem; color: var(--muted); line-height: 1.4; }
.scenario-values dd { color: var(--ink); margin: .3rem 0 0; font-size: clamp(1.3rem, 2.25vw, 2rem); letter-spacing: -.04em; line-height: 1.1; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.source-note { margin: .45rem 0 .7rem; }
.worksheet > .source-note:last-child { margin-bottom: 0; }
.comparison { display: grid; gap: 2px; }
.bar-row { width: 100%; display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-rows: auto 3px; min-height: 33px; gap: .18rem .5rem; align-items: center; padding: .12rem 0 .34rem; border: 0; background: none; text-align: left; color: var(--ink); font-size: .83rem; }
button.bar-row:hover .bar-label { text-decoration: underline; text-underline-offset: 3px; color: var(--blue); }
.bar-value { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar-track { display: flex; grid-row: 2; grid-column: 1 / -1; height: 3px; background: #eeeef1; }
.bar-track > span { background: #85858f; }
.selected-bar { font-weight: 700; color: var(--blue); }
.selected-bar .bar-track > span { background: var(--blue); }
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem 1rem; min-height: 72px; margin-top: auto; padding-block: 1rem; border-top: 1px solid var(--line); font-weight: 620; font-size: .87rem; }
.footer > a { color: var(--ink); text-decoration: none; }
.form-grid { border: 0; padding: 0; margin: 0; }
.form-grid small { display: contents; color: var(--muted); font-weight: 450; }
.form-error { font-size: .87rem; color: #a51515; }
.button.outline { background: white; color: var(--ink); border-color: #72727a; }
@media(max-width: 820px) {
  .workspace-heading { align-items: start; }
}
@media(max-width: 640px) {
  .shell { width: calc(100% - 1.5rem); }
  .explore-section { padding-top: 1rem; }
  .workspace-heading { display: block; margin-bottom: .65rem; }
  .workspace-heading h1 { font-size: 1.95rem; }
  .workspace-heading p { margin-top: .26rem; font-size: .86rem; }
  .jump-links { gap: 1rem; margin-top: .2rem; }
  .jump-links a { min-height: 31px; font-size: .78rem; }
  .worksheet { padding: 1rem; }
  .scenario-values dt { font-size: .72rem; }
}
@media(max-width: 420px) {
  .form-grid { grid-template-columns: 1fr; }
}

.explorer-layout { display: grid; grid-template-columns: minmax(0,1fr) clamp(245px, 23vw, 340px); gap: clamp(1rem, 2.1vw, 2rem); align-items: start; }
.route-rail { margin-top: 2.2rem; padding: 1.15rem; border: 1px solid var(--line); border-radius: 6px; min-width: 0; }
.route-rail details > summary { font-weight: 650; font-size: .9rem; }
.rail-content { display: grid; gap: 1.3rem; }
.rail-section + .rail-section { padding-top: 1.25rem; border-top: 1px solid var(--line); }
.rail-section h2 { font-size: 1.12rem; font-weight: 670; letter-spacing: -.025em; margin: 0; }
.rail-section .source-note { margin: .3rem 0 .85rem; font-size: .76rem; }
.route-rail .bar-value { color: var(--muted); }
.route-rail .selected-bar .bar-value { color: var(--blue); }
.facility-guide { padding: 0; margin: .72rem 0 0; list-style: none; display: grid; gap: .22rem; }
.facility-guide li { font-size: .84rem; }
.facility-guide small { color: var(--muted); font-size: .76rem; }
.worksheet { display: grid; grid-template-columns: minmax(9rem, .7fr) minmax(13rem,.9fr) minmax(16rem,1.25fr); gap: 1rem 1.6rem; align-items: start; }
.worksheet .scenario-values { margin: 0; padding: 0 0 0 1.25rem; border: 0; border-left: 1px solid var(--line); }
.worksheet .worksheet-route { margin-bottom: 0; }
.worksheet > .source-note { grid-column: 1 / -1; }
@media(min-width: 901px) {
  .route-rail details > summary { display: none; }
}
@media(max-width: 900px) {
  .explorer-layout { grid-template-columns: minmax(0,1fr); gap: 1rem; }
  .route-rail { margin-top: 0; padding: .7rem .9rem; }
  .route-rail details > summary { cursor: pointer; }
  .rail-content { padding: 1rem 0 .2rem; grid-template-columns: 1.2fr 1fr; gap: 1.25rem; align-items: start; }
  .rail-section + .rail-section { padding: 0 0 0 1rem; border-top: 0; border-left: 1px solid var(--line); }
  .worksheet { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .worksheet .scenario-values { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); padding: 1rem 0 0; }
}
@media(max-width: 640px) {
  .rail-content { grid-template-columns: 1fr; }
  .rail-section + .rail-section { border: 0; border-top: 1px solid var(--line); padding: 1rem 0 0; }
  .worksheet { grid-template-columns: minmax(0,1fr); }
}

@media(max-width: 640px) {
  .jump-links { gap: .3rem .7rem; }
}

.facility-guide button { display: flex; width: 100%; gap: .62rem; align-items: center; min-height: 32px; padding: .15rem 0; border: 0; background: transparent; color: var(--ink); font: inherit; text-align: left; }
.facility-guide button:enabled { text-underline-offset: 3px; }
.facility-guide button:enabled:hover { text-decoration: underline; }
.facility-guide strong { margin-left: auto; color: var(--blue); white-space: nowrap; font-size: .8rem; font-variant-numeric: tabular-nums; }

.home-shell, .home-main, .tool-main {
  width: min(72rem, calc(100% - clamp(2rem, 8vw, 8rem)));
  margin-inline: auto;
}
.home-main {
  flex: 1;
  display: grid;
  justify-items: center;
  align-content: start;
  padding-block: clamp(4.5rem, 13vh, 9rem) clamp(4rem, 12vh, 8rem);
}
.home-search { width: min(100%, 43rem); }
.home-search h1, .tool-main h1 {
  margin: 0;
  font-size: clamp(2.5rem, 5.2vw, 4.25rem);
  letter-spacing: -.055em;
  line-height: 1.06;
  font-weight: 680;
}
.home-search > p, .tool-main #enquiry-title + p {
  max-width: 48ch; margin: 1.1rem 0 0; color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.12rem); line-height: 1.55;
}
.home-search form { margin-top: 2rem; }
.home-search label { display: block; margin-bottom: .5rem; font-size: .92rem; font-weight: 600; }
.search-controls { display: flex; align-items: stretch; gap: .55rem; }
.search-controls input {
  flex: 1; min-width: 0; min-height: 50px; padding: .6rem .85rem;
  border: 1px solid #777780; border-radius: 4px; background: white; color: var(--ink);
}
.search-controls button {
  padding: .7rem 1.3rem; border: 1px solid var(--blue); border-radius: 4px;
  background: var(--blue); color: white; font-weight: 650;
}
.search-controls button:hover { background: #0404b2; }
.tool-main { max-width: 60rem; flex: 1; padding-block: clamp(2rem, 6vw, 5rem); }
.tool-main:has(#enquiry-form) { max-width: 42rem; }
.tool-main h1 { margin-bottom: 1rem; font-size: clamp(2.2rem, 4vw, 3.1rem); }
.tool-main #enquiry-form { margin-top: 1.7rem; }
.tool-main .converter-heading { margin-top: 1.35rem; }
@media (max-width: 540px) {
  .home-main { padding-block: 3.25rem; }
  .home-search form { margin-top: 1.5rem; }
  .search-controls { flex-direction: column; }
  .search-controls button { min-height: 46px; }
}
