/* The Meter (#situations): what you have → who you'd usually speak to → what that first step
   can cost, then the CaseReader answer. Built by /js/meter.js for everyone with JS (reduced motion only
   drops the motion); the .meter-table is the rendering without JS or if the data can't load. */

.meter { position: relative; padding: clamp(56px, 8vw, 104px) 0 clamp(48px, 7vw, 88px); border-top: 1px solid var(--night-line); overflow: hidden; }
.meter::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(900px 420px at 12% 0%, rgba(201, 168, 106, 0.07), transparent 65%); }
.meter .wrap { position: relative; }
.meter-head { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: 20px 64px; align-items: end; margin-bottom: clamp(28px, 4vw, 44px); }
.meter-head .h2 { max-width: 24ch; }
.meter-head .h2 em { color: #d4b97f; }
.meter-head .lede { margin: 0; }
@media (max-width: 900px) { .meter-head { grid-template-columns: 1fr; } }

/* Which rendering shows */
.meter-app { display: none; }
html.js .meter-app { display: block; }
html.js #situations:not([data-built]) .meter-app { min-height: 330px; }
html.js #situations:not(.meter-fallback) .meter-table { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#situations.meter-fallback .meter-app { display: none; }
@media (max-width: 759px) { html.js #situations:not([data-built]) .meter-app { min-height: 560px; } }

/* ---------- chips ---------- */
.m-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; padding-bottom: 26px; }
.m-chips { flex: 0 1 auto; display: flex; flex-wrap: wrap; gap: 8px; }
.m-chip {
  position: relative; display: inline-flex; align-items: center; height: 40px; padding: 0 14px;
  border: 1px solid rgba(243, 241, 234, 0.3); border-radius: 2px; background: var(--night); color: var(--on-night);
  font: 500 14.5px/1 var(--sans); white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: background-color 180ms, color 180ms, border-color 180ms;
}
.m-chip:hover { border-color: rgba(243, 241, 234, 0.6); }
.m-chip[aria-checked="true"] { background: var(--paper); color: var(--ink); border-color: var(--paper); z-index: 0; }
.m-chips .m-chip:not([aria-checked="true"]) { z-index: 1; }
.m-link { flex: none; border-style: dashed; color: var(--on-night-2); }
.m-link:hover { color: var(--on-night); }

/* ---------- route: three stops on one strip of tape ---------- */
.m-route {
  --dot: 14px;
  position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(24px, 4vw, 56px);
  padding-top: 34px; border-top: 1px solid var(--night-line);
}
.m-line { position: absolute; left: 0; right: 0; top: calc(34px + var(--dot) / 2 - 1.5px); height: 3px; pointer-events: none; }
.m-line i { position: absolute; inset: 0; background: var(--tape); transform-origin: left center; box-shadow: 0 -1px 0 rgba(240, 138, 160, 0.6) inset; }
.m-line::after { /* the tape's torn end, past the last stop */
  content: ""; position: absolute; right: -2px; top: -4px; width: 10px; height: 11px; background: var(--night);
  clip-path: polygon(40% 0, 100% 0, 100% 100%, 40% 100%, 0 75%, 45% 50%, 0 25%);
}
.stop { position: relative; min-width: 0; }
.dot { display: block; width: var(--dot); height: var(--dot); border-radius: 50%; background: var(--night); border: 3px solid var(--brass); margin-bottom: 22px; position: relative; z-index: 1; }
.s-cost .dot { background: var(--brass); }
.st-l { display: block; font: 500 12px/1.2 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass); margin-bottom: 12px; }
.stop .v { margin: 0; font: 400 clamp(1.5rem, 2.3vw, 2.05rem)/1.2 var(--serif); color: var(--on-night); max-width: 17ch; text-wrap: balance; }
.s-cost .v { max-width: none; }
.s-cost .v.words { font-style: italic; color: var(--on-night); }
.s-cost .sm { margin: 12px 0 0; max-width: 34ch; font-size: 14px; line-height: 1.5; color: var(--on-night-2); }
.s-cost .sm sup.fn a { color: var(--on-night); }

.ctr { display: inline-flex; white-space: nowrap; color: var(--on-night); font: 600 clamp(2.2rem, 3.6vw, 3.4rem)/1 var(--sans); font-variant-numeric: tabular-nums lining-nums; letter-spacing: -0.01em; }
.counter .drum { display: inline-block; height: 1em; overflow: hidden; vertical-align: top; }
.counter .reel { display: block; will-change: transform; }
.counter .reel span { display: block; height: 1em; line-height: 1; }
.counter .glyph { display: inline-block; line-height: 1; }
.meter .glyph[data-c="£"], .meter .glyph[data-c="–"] { color: var(--brass); }

.m-note { grid-column: 1 / -1; margin: 28px 0 0; visibility: hidden; max-width: 80ch; padding: 10px 14px; border-left: 3px solid #e7bf62; background: rgba(231, 191, 98, 0.1); color: var(--on-night); font-size: 14.5px; line-height: 1.5; border-radius: 0 2px 2px 0; }
.m-note.on { visibility: visible; }

/* Before the intro plays (WAAPI holds these while it runs) */
.m-route:not(.played) .m-line i { transform: scaleX(0); }
.m-route:not(.played) .dot { transform: scale(0); }
.m-route:not(.played) .st-l, .m-route:not(.played) .v, .m-route:not(.played) .sm { opacity: 0; }

@media (max-width: 999px) {
  .m-row { overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 calc(-1 * var(--gut)); padding: 0 var(--gut); scroll-padding: 0 var(--gut); scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); }
  .m-row::-webkit-scrollbar { display: none; }
  .m-row { flex-wrap: nowrap; padding-bottom: 20px; }
  .m-chips { flex: none; flex-wrap: nowrap; }
  .m-chip { scroll-snap-align: start; }
  .m-link { margin-right: 24px; }
}
@media (max-width: 759px) {
  .m-route { grid-template-columns: minmax(0, 1fr); gap: 30px; padding: 28px 0 0 34px; }
  .m-line { left: calc(var(--dot) / 2 - 1.5px); right: auto; top: 34px; width: 3px; height: var(--line-h, 70%); }
  .m-line i { transform-origin: center top; }
  .m-line::after { display: none; }
  .m-route:not(.played) .m-line i { transform: scaleY(0); }
  .dot { position: absolute; left: -34px; top: 2px; margin: 0; }
  .m-note { margin-top: 0; }
}

/* ---------- the answer: CaseReader first (static, also the no-JS version) ---------- */
.meter-first {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 28px; align-items: center;
  margin: clamp(36px, 5vw, 56px) 0 0; padding: 26px 28px 22px; background: var(--paper); color: var(--ink-2); border-radius: 1px;
  font-size: 1rem; line-height: 1.55; box-shadow: 0 24px 50px -30px rgba(0, 0, 0, 0.7);
}
.meter-first::before { content: ""; position: absolute; left: 18px; width: 120px; top: -6px; height: 12px; background: var(--tape); transform: rotate(-1deg); clip-path: polygon(0 0, 100% 0, 97% 50%, 100% 100%, 0 100%, 3% 50%); }
.meter-first b { font: 400 clamp(1.35rem, 2vw, 1.7rem)/1.2 var(--serif); color: var(--ink); }
.meter-first [data-price] { color: var(--ink); font-weight: 600; }
.meter-first .go { justify-self: end; display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 20px; background: var(--tape); color: var(--night); font-weight: 600; text-decoration: none; white-space: nowrap; border-radius: 2px; }
.meter-first .go:hover { background: #f07a91; }
@media (max-width: 860px) { .meter-first { grid-template-columns: 1fr; } .meter-first .go { justify-self: start; } }
html.js #situations:not([data-built]) .meter-first { visibility: hidden; }

/* ---------- static table (no JS, reduced motion, or no data) ---------- */
.meter-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; border-top: 1px solid var(--night-line); }
.meter-table caption { caption-side: bottom; text-align: left; padding-top: 14px; font-size: 0.86rem; color: var(--on-night-2); }
.meter-table thead th { font: 500 0.72rem/1.3 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--brass); text-align: left; padding: 14px 16px 12px 0; border-bottom: 1px solid var(--night-line); }
.meter-table tbody th, .meter-table td { padding: 16px 16px 16px 0; border-bottom: 1px solid var(--night-line); text-align: left; vertical-align: top; color: var(--on-night-2); }
.meter-table tbody th { font: 400 1.08rem/1.35 var(--serif); color: var(--on-night); width: 28%; }
.meter-table tbody th small { display: block; margin-top: 8px; padding-left: 10px; border-left: 2px solid #e7bf62; font: 400 0.84rem/1.5 var(--sans); color: var(--on-night-2); }
.meter-table .fig { display: block; font-size: 1.35rem; color: var(--on-night); margin-bottom: 2px; }
.meter-table sup.fn a { color: var(--on-night); }
@media (max-width: 760px) {
  .meter-table thead { display: none; }
  .meter-table, .meter-table tbody, .meter-table tr, .meter-table th, .meter-table td { display: block; width: auto; }
  .meter-table tr { padding: 14px 0; border-bottom: 1px solid var(--night-line); }
  .meter-table tbody th, .meter-table td { border: 0; padding: 4px 0; }
}

.meter-fine { margin: 28px 0 0; max-width: 92ch; font-size: 0.88rem; line-height: 1.6; color: var(--on-night-2); }
.meter-fine a { color: var(--on-night); white-space: nowrap; }
@media (max-width: 600px) { .meter-fine a { white-space: normal; } }
