:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --border: #d9dce3;
  --accent: #2563eb;
  --text: #1f2937;
  --muted: #6b7280;
  --sticky-bar-collapsed-h: 0px;
  --sticky-bar-space: 0px;
}
.tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid #d0d7de;
  background: #fff;
  color: #6b7280;
  cursor: pointer;
  margin: 0;
  line-height: 1;
  font-weight: 700;
}
.tooltip .tiptext-inline { display: none; }
.help-tooltip {
  position: fixed;
  z-index: 50;
  max-width: min(300px, calc(100vw - 32px));
  background: #fff;
  color: #111827;
  padding: 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.35;
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
  border: 1px solid rgba(0,0,0,0.08);
}
.help-tooltip[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: auto;
}
body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 16px 28px;
  min-height: 100%;
}
h1 { margin: 0 0 6px; font-size: 22px; }
.sub { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 12px;
  align-items: start;
  overflow: visible;
}
.layout-followup {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.layout-followup .right-card--meta {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.layout-followup .right-footnote {
  border-top: 1px solid #dbe5f0;
  padding: 12px 13px 0;
}
.layout-followup .right-footnote > details {
  margin: 0;
  padding: 0;
  border: 0;
  border-top: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.layout-followup .right-footnote > details > summary {
  padding: 2px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}
.layout-followup .right-footnote > details > summary:hover {
  color: #0f172a;
}
.layout-followup .right-footnote > details > summary:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 3px;
  border-radius: 4px;
}
.layout-followup .right-footnote__body {
  margin-top: 8px;
  display: grid;
  gap: 12px;
}
.layout-followup .right-footnote__section-title {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}
.layout-followup .right-footnote__assumptions {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
  gap: 6px 10px;
}
.layout-followup .right-footnote__sources {
  margin: 0 0 0 16px;
  padding: 0;
  font-size: 12px;
  line-height: 1.5;
}
.layout > * { min-height: 0; }
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.04);
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.panel.scrollable {
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  padding-bottom: calc(140px + env(safe-area-inset-bottom, 0px));
  scroll-padding-bottom: calc(140px + env(safe-area-inset-bottom, 0px));
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.section-title { margin: 4px 0 8px; font-size: 15px; font-weight: 600; }
.grid { display: grid; gap: 8px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
label { font-size: 13px; display: block; margin-bottom: 4px; color: #111827; }
.label-row label { display: flex; align-items: center; gap: 4px; margin-bottom: 0; }
select, input[type="number"], input[type="range"] {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
}
input[type="range"] { padding: 0; }
.inline-radio { display: flex; gap: 6px; }
.inline-radio label { margin: 0; font-weight: 500; }
.chip { padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.progress {
  height: 10px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}
.progress > div {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.2s ease;
}
.muted { color: var(--muted); font-size: 12px; margin-top: 4px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 13px; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.results-grid { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 8px 0 12px; align-items: start; }
.metrics.desktop-only { gap: 6px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric { padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; height: auto; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.results-grid .metric { padding: 8px; height: auto; }
.metric .label { font-size: 11px; color: var(--muted); font-weight: 500; margin-bottom: 2px; }
.metric .value { font-size: 18px; font-weight: 800; color: #111827; line-height: 1.1; }
.metric .value + .value { font-size: 14px; font-weight: 600; color: #4b5563; margin-top: 2px; }
.metric.primary { padding: 12px; border-color: #cbd5e1; }
.metric.primary .value { font-size: 20px; }
.metric.secondary { padding: 10px; }
.metric.secondary .value { font-size: 18px; }
.metric.tertiary { padding: 8px; border-color: #e5e7eb; color: #4b5563; }
.metric.tertiary .value { font-size: 16px; color: #111827; }
.right-card { padding: 0; border: 0; background: transparent; box-shadow: none; }
#advanced-details .adv-content {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.4;
}
#advanced-details .adv-card + .adv-card { margin-top: 8px; }
#advanced-details .adv-card-title { display: none; }
#advanced-details .adv-row { margin-bottom: 6px; }
#advanced-details .adv-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
#advanced-details .adv-row-head label { margin: 0; }
#advanced-details .adv-control {
  display: flex;
  align-items: center;
  gap: 6px;
}
#advanced-details .adv-control--toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
}
#advanced-details .adv-control--toggle input[type="checkbox"] {
  margin: 0;
}
#advanced-details .adv-control--toggle .adv-toggle { display: none; }
#advanced-details .adv-row-body { margin-top: 4px; }
#advanced-details .adv-nested { margin-top: 6px; }
#advanced-details input[type="number"] { width: 140px; }
#sticky-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 9990;
}
#mobile-sticky-summary {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: #fff;
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 18px rgba(0,0,0,0.08);
  border-radius: 16px 16px 0 0;
  max-height: calc(var(--sticky-bar-collapsed-h) + env(safe-area-inset-bottom, 0px));
  min-height: calc(var(--sticky-bar-collapsed-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  flex-direction: column;
  overflow: hidden;
  transition: max-height 0.25s ease, box-shadow 0.25s ease, opacity 0.15s ease, transform 0.15s ease;
}
#mobile-sticky-summary.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
}
#mobile-sticky-summary .sticky-header {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  border: none;
  background: transparent;
  font: inherit;
  padding: 10px 16px;
  cursor: pointer;
  text-align: left;
}
#mobile-sticky-summary .sticky-header:focus-visible {
  outline: 2px solid rgba(37,99,235,0.6);
  outline-offset: -2px;
  border-radius: 12px;
}
#mobile-sticky-summary .sticky-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
#mobile-sticky-summary .sticky-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
#mobile-sticky-summary .sticky-value {
  font-size: 16px;
  font-weight: 800;
  color: #111827;
  line-height: 1.1;
}
#mobile-sticky-summary .sticky-sub {
  font-size: 11px;
  color: #4b5563;
  font-weight: 600;
  white-space: nowrap;
}
#mobile-sticky-summary .sticky-chevron {
  font-size: 16px;
  color: #6b7280;
  transition: transform 0.2s ease;
}
#sticky-expanded-panel {
  display: none;
  border-top: 1px solid #eef2f7;
  padding: 10px 16px 16px;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
}
#mobile-sticky-summary .sticky-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin: 6px 0 6px;
}
#results-text-summary {
  display: none;
}
#sticky-results-mount #results-text-summary {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
#sticky-results-mount .section-title {
  display: none;
}
#results-text-summary .mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  gap: 12px;
}
#results-text-summary .mini-label {
  color: var(--muted);
  font-weight: 600;
}
#results-text-summary .mini-value {
  font-weight: 700;
  color: #111827;
  text-align: right;
}
#sticky-results-mount .results-grid {
  display: none;
}
#sticky-comparison-mount .right-card {
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}
#sticky-comparison-mount .state-comp-block {
  background: linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
  border: 1px solid #dbe5f0;
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 8px 18px rgba(15,23,42,0.08);
}
#sticky-comparison-mount .state-comp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 0 0 8px !important;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(148,163,184,0.18);
}
#sticky-comparison-mount .state-comp-toggle {
  font-size: 11px;
  color: #475569;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  line-height: 1.2;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid #d8e2ef;
  background: rgba(255,255,255,0.92);
}
#sticky-comparison-mount .other-grid {
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
#sticky-comparison-mount #other-states {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
#sticky-comparison-mount {
  display: block;
}
@media (min-width: 1024px) {
  .results-grid {
    align-items: end;
  }
  .results-grid .metric { min-height: auto; }
}
@media (min-width: 900px) {
  .results-tiles {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 12px;
    align-items: stretch;
  }
  .results-tiles .tile--annual { grid-row: 1 / span 2; padding: 12px; border-color: #cbd5e1; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
  .results-tiles .tile--fortnightly,
  .results-tiles .tile--savings { padding: 12px; }
  .results-tiles .tile--savings .label { color: #6b7280; }
  .state-comp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 12px;
    margin: 0 0 10px !important;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(148,163,184,0.16);
  }
  .state-comp-toggle {
    font-size: 12px;
    color: #475569;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    line-height: 1.2;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #d8e2ef;
    background: rgba(255,255,255,0.94);
  }
  .left-panel-tight .label-row { margin-bottom: 2px; }
  .left-panel-tight .desc-line { margin-top: 0; }
  .left-panel-tight input[type="range"] { margin-top: 4px; }
  .tooltip {
    font-size: 12px;
    margin-left: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #4b5563;
  }
  .tooltip:hover,
  .tooltip:focus { background: #e5e7eb; border-color: #cbd5e1; text-decoration: none; }
  .tooltip:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
  .results-grid .label,
  .other-grid .label { color: #6b7280; }
  .reset-wrap.desktop #reset-btn-desktop {
    background: #fff;
    color: #1f2937;
    border: 1px solid var(--border);
  }
  .state-comp-block {
    border-top: none;
    margin-top: 0;
    padding: 13px;
    border: 1px solid #dbe5f0;
    border-radius: 14px;
    background: linear-gradient(180deg, #fbfdff 0%, #f4f8fe 100%);
    box-shadow: 0 10px 24px rgba(15,23,42,0.05);
  }
  .layout { height: auto; align-items: stretch; }
  .panel.scrollable { height: auto; max-height: none; overflow: visible; padding-top: 10px; padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
  .state-comp-grid { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 11px; }
  .right-stack {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 0;
    align-self: stretch;
  }
  .panel.scrollable.right-stack {
    padding-top: 0;
    padding-bottom: 0;
  }
  .right-primary-module {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
  }
  .right-primary-module > #results-panel {
    margin-bottom: 16px;
  }
  .right-primary-module > #state-comparison-panel {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
  }
  .right-primary-module > #comparison-article-cta {
    margin-top: 6px;
  }
  .right-primary-module #state-comparison-panel .state-comp-block {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    justify-content: flex-start;
  }
  .right-card {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 6px 16px rgba(0,0,0,0.04);
  }
  .tooltip {
    font-size: 13px;
    width: 18px;
    height: 18px;
  }
  .help-tooltip { font-size: 13px; }
}
button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
}
button:hover { background: #1e4fb3; }
.btn-secondary {
  background: var(--accent);
  color: #fff;
  border: none;
}
.btn-secondary:hover { background: #1e4fb3; }
#comparison-article-cta.panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0 13px;
  margin-top: 0;
}
#comparison-article-cta .article-comparison-cta__title {
  margin: 0;
  color: #64748b;
  line-height: 1.45;
  font-size: 13px;
  font-weight: 500;
}
#comparison-article-cta .article-comparison-cta__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #1e3a8a;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  font-weight: 600;
}
#comparison-article-cta .article-comparison-cta__link:hover {
  color: #1d4ed8;
  text-decoration-thickness: 2px;
}
#comparison-article-cta .article-comparison-cta__link:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  border-radius: 4px;
}
@media (max-width: 720px) {
  .layout-followup {
    grid-template-columns: minmax(0, 1fr);
  }
  .layout-followup .right-footnote {
    padding: 10px 12px 0;
  }
  .layout-followup .right-footnote__assumptions {
    grid-template-columns: 1fr;
  }
  #comparison-article-cta.panel {
    padding: 0 12px;
    margin-top: 0;
  }
  #comparison-article-cta .article-comparison-cta__title {
    font-size: 13px;
  }
}
@media (min-width: 900px) {
  .layout-followup {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 12px;
  }
  .layout-followup .right-card--meta {
    grid-column: 1;
  }
}
#reset-btn,
#reset-btn-desktop {
  width: 50%;
  text-align: center;
  padding: 4px 6px;
  font-size: 12px;
}
.reset-wrap {
  display: flex;
  justify-content: center;
  margin: 8px 0;
}
.reset-wrap.desktop { display: none; }
.reset-wrap.mobile { display: flex; }
details { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: #f8fafc; }
summary { cursor: pointer; font-weight: 600; }
.other-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-top: 8px; }
@media (max-width: 720px) {
  h1 { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sub { font-size: 12px; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .page { padding-top: 8px; padding-bottom: 18px; }
  #summary-text { display: none; }
  #results-text-summary { display: none; }
  .panel.scrollable {
    padding-bottom: 12px;
    scroll-padding-bottom: 12px;
  }
  .metrics { margin: 6px 0 8px; gap: 6px; }
  .metric { padding: 6px; }
  .metric .label { font-size: 10px; }
  .metric .value { font-size: 14px; }
  .section-title { font-size: 12px; }
  #detailed-results summary { font-size: 12px; }
  .desktop-inline { display: none; }
  .mobile-inline { display: inline; }
  .desktop-only { display: none !important; }
  .results-grid.desktop-only { display: none !important; }
  .mobile-only { display: block !important; }
  .results-grid.mobile-only { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics.results { grid-template-columns: 1fr; }
  .metrics.desktop-only { grid-template-columns: 1fr; }
}
.pill { border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; background: #fff; text-align: center; display: flex; flex-direction: column; gap: 2px; justify-content: center; align-items: center; }
.pill.link { cursor: pointer; text-decoration: none; color: inherit; }
.pill.link:hover,
.pill.link:focus-visible { box-shadow: 0 0 0 2px #e5e7eb; text-decoration: none; }
.pill .label { font-size: 11px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: visible; }
.pill .val-main { font-weight: 800; font-size: clamp(12px, 2.4vw, 15px); color: #111827; white-space: nowrap; }
.pill .val-main.delta-positive { color: #15803d; }
.pill .val-main.delta-negative { color: #b91c1c; }
.pill .val-sub { font-weight: 600; font-size: clamp(10px, 2.1vw, 13px); color: #4b5563; white-space: nowrap; }
#state-comparison-panel {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
#state-comparison-panel .state-comp-block {
  background: linear-gradient(180deg, #fbfdff 0%, #f6f9fe 100%);
  border: 1px solid #dbe5f0;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 10px 24px rgba(15,23,42,0.05);
}
#state-comparison-panel .state-comp-header {
  align-items: center;
}
#state-comparison-panel .state-comp-toggle input {
  accent-color: var(--accent);
}
#state-comparison-panel .state-comp-grid {
  margin-top: 0;
}
#state-comparison-panel .pill.link {
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  gap: 4px;
  min-height: 86px;
  padding: 10px 11px;
  border-radius: 12px;
  border-color: #dbe5f0;
  background: rgba(255,255,255,0.95);
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
#state-comparison-panel .pill.link:hover,
#state-comparison-panel .pill.link:focus-visible {
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12), 0 6px 12px rgba(15,23,42,0.08);
  border-color: #bfdbfe;
  text-decoration: none;
  transform: translateY(-1px);
}
#state-comparison-panel .pill .label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 2px;
}
#state-comparison-panel .pill .val-main {
  font-size: clamp(14px, 2.2vw, 16px);
  line-height: 1.15;
}
#state-comparison-panel .pill .val-sub {
  font-size: 11px;
  line-height: 1.2;
  white-space: normal;
}
#state-comparison-panel .pill .muted {
  margin-top: 4px !important;
  font-size: 10px !important;
  line-height: 1.25 !important;
  color: #64748b;
}
#state-comparison-panel #net-note {
  margin-top: 10px !important;
  padding-top: 8px;
  border-top: 1px solid rgba(148,163,184,0.18);
  font-size: 11px;
  line-height: 1.35;
}
.desktop-inline { display: inline; }
.mobile-inline { display: none; }
.desktop-only { display: grid; }
.results-grid.desktop-only { display: grid; }
.mobile-only { display: none !important; }
.results-grid.mobile-only { display: none !important; }
.field-label-row { display: flex; align-items: baseline; gap: 8px; }
.tooltip,
.help-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid #d0d7de;
  background: #fff;
  color: #6b7280;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  transition: color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.tooltip:hover,
.help-icon:hover {
  border-color: #9ca3af;
  color: #111827;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  background: #fff;
}
.tooltip:focus-visible,
.help-icon:focus-visible {
  outline: 2px solid rgba(59,130,246,0.6);
  outline-offset: 2px;
}
.tooltip-trigger { position: relative; display: inline-flex; }
.tooltip .tiptext {
  display: block;
  visibility: hidden;
  opacity: 0;
  background: #fff;
  color: #111827;
  text-align: left;
  border-radius: 12px;
  padding: 10px 12px;
  position: absolute;
  z-index: 40;
  width: auto;
  max-width: min(320px, calc(100vw - 32px));
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
  font-size: 13px;
  line-height: 1.35;
  transition: opacity 0.12s ease, visibility 0.12s ease;
  border: 1px solid rgba(0,0,0,0.08);
  pointer-events: none;
}
.tooltip-bubble {
  position: absolute;
  z-index: 9999;
  min-width: 220px;
  max-width: min(320px, calc(100vw - 32px));
  flex: 0 0 auto;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: auto;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
  background: #fff;
}
.tooltip .tiptext.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}
.tooltip .tiptext.below {
  bottom: auto;
  top: 120%;
}
.inline-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  cursor: help;
}
.inline-tooltip .tiptext-inline {
  visibility: hidden;
  opacity: 0;
  background: #111827;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 6px 8px;
  position: absolute;
  z-index: 12;
  white-space: nowrap;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 8px 18px rgba(0,0,0,0.15);
  font-size: 11px;
  line-height: 1.2;
  transition: opacity 0.12s ease;
}
.inline-tooltip:hover .tiptext-inline,
.inline-tooltip:focus-within .tiptext-inline {
  visibility: visible;
  opacity: 1;
}
.ded-disabled label {
  color: #9ca3af;
}
.ded-disabled input[type="number"] {
  background: #f3f4f6;
  color: #6b7280;
  border-color: #d1d5db;
}
.label-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.label-row label { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 0; white-space: normal; }
.value-chip { background: #eef2ff; padding: 2px 8px; border-radius: 999px; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.desc-line { display: block; line-height: 1.2; width: 100%; margin-top: 2px; }
.warning { color: #b91c1c; font-weight: 700; }
/* Smooth sliders */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 0%, #e5e7eb 0%);
  outline: none;
  transition: background 0.2s ease;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
input[type="range"]::-webkit-slider-thumb:hover,
input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(0,0,0,0.18);
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
}
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr 0.9fr; gap: 10px; }
  .results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  :root {
    --sticky-bar-collapsed-h: 76px;
    --sticky-bar-space: 90px;
  }
  .page {
    padding-bottom: calc(28px + var(--sticky-bar-space) + env(safe-area-inset-bottom, 0px));
  }
  #mobile-sticky-summary {
    display: flex;
  }
  #sticky-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
  }
  body.sticky-open {
    overflow: hidden;
  }
  body.sticky-open #mobile-sticky-summary {
    max-height: 70vh;
    box-shadow: 0 -14px 30px rgba(15,23,42,0.18);
  }
  body.sticky-open #mobile-sticky-summary .sticky-chevron {
    transform: rotate(180deg);
  }
  body.sticky-open #sticky-expanded-panel {
    display: block;
  }
  #results-placeholder,
  #state-comparison-placeholder {
    display: none;
  }
  #results-panel .section-title {
    display: none;
  }
  #results-tiles {
    display: none !important;
  }
  #mobile-sticky-sheet #results-tiles {
    display: none !important;
  }
  .reset-wrap.mobile {
    display: none !important;
  }
  #mobile-sticky-summary .sticky-reset-wrap {
    margin-top: 12px;
  }
  #mobile-sticky-summary .sticky-reset-btn {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
    color: #1f2937;
    font: inherit;
    font-weight: 700;
  }
  .layout { grid-template-columns: 1fr; gap: 10px; }
  .panel.scrollable {
    overflow: visible;
    height: auto;
    max-height: none;
    padding-bottom: 12px;
    scroll-padding-bottom: 12px;
  }
  #advanced-details > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    min-height: 44px;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    list-style: none;
  }
  #advanced-details > summary::-webkit-details-marker { display: none; }
  #advanced-details > summary::after {
    content: 'v';
    font-size: 12px;
    color: var(--muted);
    transition: transform 0.2s ease;
  }
  #advanced-details[open] > summary::after {
    transform: rotate(180deg);
  }
  #advanced-details .adv-content {
    display: block;
    margin-top: 0;
    padding: 0 12px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transition: max-height 0.25s ease, opacity 0.2s ease;
  }
  #advanced-details[open] .adv-content {
    max-height: 1200px;
    opacity: 1;
    padding: 8px 12px 12px;
    pointer-events: auto;
  }
  #advanced-details .adv-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 10px 12px;
    box-shadow: 0 4px 12px rgba(15,23,42,0.06);
  }
  #advanced-details .adv-card + .adv-card { margin-top: 10px; }
  #advanced-details .adv-card-title {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 6px;
  }
  #advanced-details .adv-row {
    padding: 8px 0;
    border-bottom: 1px solid #eef2f7;
    margin-bottom: 0;
  }
  #advanced-details .adv-row:last-child { border-bottom: 0; }
  #advanced-details .adv-row-head {
    justify-content: space-between;
    align-items: center;
  }
  #advanced-details .adv-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
  }
  #advanced-details .adv-control { margin-left: auto; }
  #advanced-details .adv-row-body {
    margin-top: 6px;
    font-size: 11px;
    color: var(--muted);
  }
  #advanced-details .adv-row-body .muted { margin-top: 0; }
  #advanced-details .adv-control--toggle {
    width: 44px;
    height: 26px;
    border-radius: 999px;
    background: #e5e7eb;
    transition: background 0.2s ease;
    cursor: pointer;
  }
  #advanced-details .adv-control--toggle input[type="checkbox"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
  }
  #advanced-details .adv-control--toggle .adv-toggle {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    position: relative;
    background: #e5e7eb;
    transition: background 0.2s ease;
  }
  #advanced-details .adv-control--toggle .adv-toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(15,23,42,0.15);
    transition: transform 0.2s ease;
  }
  #advanced-details .adv-control--toggle input[type="checkbox"]:checked + .adv-toggle {
    background: #2563eb;
  }
  #advanced-details .adv-control--toggle input[type="checkbox"]:checked + .adv-toggle::after {
    transform: translateX(18px);
  }
  #advanced-details .adv-control--toggle input[type="checkbox"]:focus-visible + .adv-toggle {
    outline: 2px solid rgba(37,99,235,0.5);
    outline-offset: 2px;
  }
  #advanced-details input[type="number"] {
    height: 44px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    padding: 6px 10px;
    font-size: 13px;
    max-width: 140px;
    text-align: right;
    background: #fff;
  }
  #advanced-details input[type="number"]::placeholder {
    font-size: 12px;
    color: #9ca3af;
  }
  #advanced-details .adv-nested {
    margin-top: 8px;
    padding: 8px;
    background: #f8fafc;
    border-radius: 12px;
    box-shadow: inset 2px 0 0 #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  #advanced-details .adv-row--nested {
    padding: 0;
    border-bottom: 0;
  }
  #advanced-details .ded-disabled { opacity: 0.6; }
  .left-panel-tight .section-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 10px 12px;
    box-shadow: 0 4px 12px rgba(15,23,42,0.06);
  }
  .left-panel-tight .section-card + .section-card { margin-top: 10px; }
  .left-panel-tight .section-card .section-title {
    margin: 0 0 6px !important;
    font-size: 12px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--muted);
  }
  .left-panel-tight .grid.two,
  .left-panel-tight .grid.three {
    grid-template-columns: 1fr;
  }
  .left-panel-tight .grid { gap: 6px; }
  .left-panel-tight .field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 0;
    border-bottom: 1px solid #eef2f7;
  }
  .left-panel-tight .field:first-child { padding-top: 0; }
  .left-panel-tight .field:last-child { padding-bottom: 0; border-bottom: 0; }
  .left-panel-tight .field--summary { padding: 0; border-bottom: 0; }
  .left-panel-tight .field > label {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
  }
  .left-panel-tight .label-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: nowrap;
  }
  .left-panel-tight .field-label-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
  }
  .left-panel-tight .field-label-row label {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
  }
  .left-panel-tight .value-chip {
    margin-left: auto;
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    background: transparent;
    padding: 0;
    border-radius: 0;
    font-size: 12px;
    font-weight: 700;
    color: #111827;
  }
  .left-panel-tight .desc-line,
  .left-panel-tight #remaining-text,
  .left-panel-tight #ot-note {
    display: none;
  }
  .left-panel-tight .field.roster-readable .label-row {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .left-panel-tight .field.roster-readable .value-chip {
    display: none !important;
  }
  .left-panel-tight .field.roster-readable .desc-line,
  .left-panel-tight .field.roster-readable #after-breakdown,
  .left-panel-tight .field.roster-readable #night-breakdown {
    display: block;
    width: 100%;
  }
  .left-panel-tight .row { align-items: center; gap: 8px; }
  .left-panel-tight .field-value {
    font-size: 12px;
    font-weight: 700;
    color: #111827;
  }
  .left-panel-tight select,
  .left-panel-tight input[type="number"] {
    border-radius: 12px;
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid #e5e7eb;
    background: #fff;
  }
  .left-panel-tight input[type="range"] {
    height: 6px;
  }
  .left-panel-tight input[type="range"]::-webkit-slider-thumb {
    width: 16px;
    height: 16px;
    box-shadow: 0 1px 3px rgba(15,23,42,0.18);
  }
  .left-panel-tight input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    box-shadow: 0 1px 3px rgba(15,23,42,0.18);
  }
  .left-panel-tight .inline-radio {
    display: flex;
    gap: 0;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
  }
  .left-panel-tight .inline-radio .chip {
    flex: 1;
    margin: 0;
    padding: 8px 0;
    border: 0;
    border-right: 1px solid #e5e7eb;
    border-radius: 0;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    background: transparent;
  }
  .left-panel-tight .inline-radio .chip:last-child { border-right: 0; }
  .left-panel-tight .inline-radio .chip.active {
    background: var(--accent);
    color: #fff;
    font-weight: 700;
  }
  .left-panel-tight .help-icon {
    width: 20px;
    height: 20px;
    font-size: 11px;
    border-color: #e5e7eb;
    color: #6b7280;
    background: #fff;
    box-shadow: none;
    touch-action: manipulation;
  }
  #help-tooltip {
    max-width: min(320px, 92vw);
    font-size: 13px;
    line-height: 1.4;
    border-radius: 14px;
  }
  .left-panel-tight details.section-card {
    padding: 0;
  }
  .left-panel-tight details.section-card > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    list-style: none;
  }
  .left-panel-tight details.section-card > summary::-webkit-details-marker { display: none; }
  .left-panel-tight details.section-card > summary::after {
    content: 'v';
    font-size: 12px;
    color: var(--muted);
  }
  .left-panel-tight details.section-card[open] > summary { border-bottom: 1px solid #eef2f7; }
  .left-panel-tight details.section-card[open] > summary::after { transform: rotate(180deg); }
  .left-panel-tight details.section-card > div {
    margin-top: 0 !important;
    padding: 8px 12px 12px;
    font-size: 12px;
  }
}
@media (max-width: 768px) {
  .page {
    padding: 8px;
    padding-bottom: calc(8px + var(--sticky-bar-space) + env(safe-area-inset-bottom, 0px));
  }
  .panel { padding: 8px; }
  .layout { grid-template-columns: 1fr; gap: 6px; }
  .grid.three { grid-template-columns: 1fr; }
  .grid.two { grid-template-columns: 1fr; }
  .results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  select, input[type="number"], input[type="range"] { width: 100%; }
  .other-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  h1 { font-size: 20px; }
  .section-title { font-size: 14px; }
  .metric .value { font-size: 16px; }
  .metric { padding: 8px; }
  .panel.scrollable { height: auto; max-height: none; overflow: visible; }
  .deduction-row,
  .hecs-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .deduction-row input[type="number"] {
    width: 100% !important;
    max-width: 100%;
  }
  .reset-wrap.desktop { display: none; }
  .reset-wrap.mobile { display: flex; }
}
@media (min-width: 769px) {
  .reset-wrap.desktop { display: flex; }
  .reset-wrap.mobile { display: none; }
  #reset-btn-desktop {
    background: #fff;
    color: #1f2937;
    border: 1px solid var(--border);
  }
}
@media (max-width: 640px) {
  html, body { height: auto; overflow: auto; }
  .page {
    min-height: 100%;
    padding-bottom: calc(12px + var(--sticky-bar-space) + env(safe-area-inset-bottom, 0px));
  }
  .layout { grid-template-columns: 1fr; overflow: visible; }
  .panel.scrollable {
    height: auto;
    max-height: none;
    padding-bottom: 12px;
    scroll-padding-bottom: 12px;
    overflow: visible;
  }
  .results-grid { display: grid !important; grid-template-columns: 1fr; }
  .results-grid .metric { padding: 4px 6px; text-align: center; height: auto; min-height: auto; }
  .results-grid .metric .label { font-size: 10px; color: var(--muted); font-weight: 500; }
  .results-grid .metric .value { font-size: clamp(13px, 4vw, 16px); line-height: 1.05; white-space: nowrap; letter-spacing: -0.08px; }
  .results-grid .metric .value + .value { font-size: clamp(11px, 3.4vw, 14px); line-height: 1.05; white-space: nowrap; color: #4b5563; font-weight: 600; }
  .results-grid .metric.tertiary { padding: 4px 6px; }
  .results-grid .metric.tertiary .value { font-size: clamp(12px, 3.8vw, 14px); }
  .results-grid .metric.secondary { padding: 5px 7px; }
  .results-grid .metric.secondary .value { font-size: clamp(14px, 4.4vw, 17px); }
  .results-grid .metric.primary { padding: 6px 8px; }
  .results-grid .metric.primary .value { font-size: clamp(17px, 5vw, 20px); }
  #state-comparison-panel .state-comp-block {
    padding: 11px;
    border-radius: 13px;
  }
  #state-comparison-panel .state-comp-header {
    gap: 8px 10px;
    margin-bottom: 8px !important;
    padding-bottom: 8px;
  }
  #state-comparison-panel .state-comp-toggle {
    font-size: 11px;
    padding: 5px 8px;
  }
  #state-comparison-panel .pill.link {
    min-height: 78px;
    padding: 9px 10px;
  }
  .other-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  details.mobile-only { display: block !important; }
  details.mobile-only summary { font-size: 12px; }
}
@media (max-width: 480px) {
  .results-grid { display: grid !important; grid-template-columns: 1fr; }
  .other-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* ── NSW pages UX improvements ───────────────────────────────────────────── */

/* Collapsible tables: hide last column (lowest-value "Where to check" col) */
.table-wrap--collapsible table { min-width: 0; }
@media (max-width: 600px) {
  .table-wrap--collapsible th:last-child,
  .table-wrap--collapsible td:last-child { display: none; }
}

/* Mobile CTA links inside example cards and role-cta-link lists */
@media (max-width: 640px) {
  .example-card .calc-link,
  .role-cta-links a {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    margin-top: 6px;
    box-sizing: border-box;
  }
  .example-card .calc-link:hover,
  .role-cta-links a:hover { background: #1e4fb3; }
}

/* Example card income figures */
.example-card .income-gross { font-size: 18px; font-weight: 800; color: #111827; }
.example-card .income-net   { font-size: 16px; font-weight: 700; color: #15803d; }
.example-card .income-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

/* Editorial "real life" commentary block inside worked examples */
.editorial-note {
  border-left: 3px solid var(--accent);
  padding: 8px 12px;
  background: #f8fbff;
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  color: #374151;
  margin: 10px 0 0;
  line-height: 1.5;
}

/* Table section divider row (between early-career and registrar grades) */
.table-section-head td {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 6px 10px 4px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}
