/* Mobile-first visual reference. No simulated phone hardware or OS chrome. */
:root {
  color-scheme: dark;
  --background: #061522;
  --panel: #0a2132;
  --border: #245371;
  --text: #f2f6fc;
  --muted: #a5c0d7;
  --lime: #adf546;
  --blue: #62afe0;
  --orange: #ff895d;
  --link: #82d9f3;
  --radius: 16px;
  --gap: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-synthesis: none;
  font-variant-numeric: tabular-nums;
  background: var(--background);
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: radial-gradient(ellipse at 85% 8%, #0d2b43 0, transparent 48%), linear-gradient(170deg,#071521,#04111d 65%,#081b2b); }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
button:disabled { cursor: default; }
h1,h2,p,figure { margin: 0; }
.app { width: min(100%, 428px); margin-inline: auto; padding: calc(10px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); display: grid; gap: var(--gap); }
.icon { width: 20px; height: 20px; flex: none; }
.brand-header { position: relative; min-height: 56px; display: flex; align-items: center; justify-content: space-between; isolation: isolate; }
.blueprint { position: absolute; width: 51%; height: 82px; right: 0; bottom: -8px; z-index: -1; opacity: .63; pointer-events: none; mask-image: linear-gradient(90deg,transparent,#000 23%,#000 80%,transparent); }
.brand { display: flex; align-items: flex-start; gap: 9px; }
.brand > .icon { width: 30px; height: 34px; color: var(--lime); stroke-width: 1.9; margin-top: 1px; }
.brand h1 { font-size: clamp(25px,7vw,36px); font-weight: 780; letter-spacing: -.045em; line-height: 1.08; }
.brand p { color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .075em; margin-top: 6px; }
.refresh { background: transparent; border: 0; width: 44px; height: 44px; display: grid; place-items: center; color: var(--muted); }
.refresh .icon { width: 24px; height: 24px; }
.card { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); background: radial-gradient(ellipse at 10% 0%,rgba(30,109,164,.16),transparent 65%),linear-gradient(155deg,#0c2539,#091d2c 68%,#0a2233); box-shadow: inset 0 1px 0 rgba(105,194,255,.12),0 5px 15px #0003; }
.current-card { padding: 12px; display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); gap: 10px; align-items: center; border-color: #397da5; box-shadow: inset 0 1px 0 #7fdbff36,inset 0 0 18px #2485c014,0 4px 20px #0004; }
.current-price h2 { font-size: clamp(15px,4.3vw,22px); font-weight: 680; letter-spacing: -.025em; }
.price-line { display: flex; align-items: baseline; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.price-line strong { color: var(--lime); font-size: clamp(36px,11vw,57px); line-height: 1.04; letter-spacing: -.045em; font-weight: 800; }
.price-line span { color: var(--muted); font-size: clamp(11px,3.3vw,17px); white-space: nowrap; }
.controls { display: grid; gap: 8px; }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #376682; border-radius: 999px; background: #102b3d; overflow: hidden; }
.mode-switch button { border: 0; background: transparent; min-width: 0; min-height: 42px; padding: 0 3px; font-size: 12px; font-weight: 550; }
.mode-switch button[aria-pressed="true"] { border-radius: 999px; background: linear-gradient(#29b8fa,#007bd4); box-shadow: inset 0 0 0 1px #6ad5ff70; color: #fff; }
.date-button { display: flex; gap: 5px; justify-content: center; align-items: center; min-height: 44px; padding: 4px; border: 1px solid #407b9f; border-radius: 9px; background: #0d2a3d; font-size: 12px; white-space: nowrap; }
.date-button .icon { width: 17px; height: 17px; }
.status { grid-column: 1/-1; display: flex; align-items: flex-start; gap: 6px; font-size: 11px; line-height: 1.4; color: var(--muted); }
.status .icon { width: 15px; height: 15px; }
.summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.stat { padding: 9px 10px 9px; border-radius: 14px; }
.stat h2 { display: flex; justify-content: space-between; align-items: center; gap: 2px; font-size: clamp(11px,3.2vw,16px); font-weight: 580; white-space: nowrap; }
.stat h2 span { display: grid; place-items: center; width: 19px; height: 19px; flex: none; border-radius: 50%; background: #aecde01c; color: var(--muted); font-size: 14px; }
.stat strong { display: block; font-size: clamp(22px,6.4vw,34px); font-weight: 760; line-height: 1.15; letter-spacing: -.035em; margin-top: 4px; }
.stat p { font-size: 11px; color: var(--muted); margin-top: 3px; }
.cheapest strong,.cheapest h2 span { color: var(--lime); }
.highest strong,.highest h2 span { color: var(--orange); }
.chart-card { padding: 11px 12px 10px; }
.chart-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-gap: 6px; row-gap: 3px; }
.chart-heading h2 { font-size: clamp(17px,4.8vw,25px); letter-spacing: -.025em; font-weight: 730; }
.chart-heading time { font-size: 11px; color: var(--muted); }
.chart-subtitle { font-size: 12px; color: var(--muted); margin-top: 4px; }
.price-chart { display: block; width: 100%; height: auto; margin-top: 8px; overflow: visible; }
.price-chart text { font-size: 10px; fill: var(--muted); }
.grid-line { stroke: #325571; stroke-width: .7; stroke-dasharray: 4 4; }
.zero { stroke: #50728a; stroke-width: .8; }
.bar.low { fill: url(#low); }
.bar.mid { fill: url(#mid); }
.bar.high { fill: url(#high); }
.bar.current { fill: #f8fbff; stroke: #dce7ef; stroke-width: .5; }
.making-of { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)) minmax(0,1.35fr); align-items: center; gap: 7px; padding: 8px 10px; }
.portrait { min-width: 0; position: relative; padding-bottom: 8px; }
.portrait img { width: 100%; aspect-ratio: 1; display: block; object-fit: cover; border: 1px solid #39718f; border-radius: 13px; }
.cathy img { object-position: 56% 45%; }
.amos img { object-position: 44% 32%; }
.ida img { object-position: 58% 45%; }
.portrait figcaption { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); border-radius: 999px; background: #102c40; border: 1px solid #376781; padding: 2px 9px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.video-link { min-width: 0; border-left: 1px solid #34546a; padding-left: 8px; display: grid; align-content: center; gap: 5px; color: var(--link); text-decoration: none; }
.play { width: 26px; height: auto; }
.video-link strong { font-size: clamp(12px,3.35vw,19px); line-height: 1.23; letter-spacing: -.015em; }
.video-link small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.source-note { font-size: 10px; line-height: 1.4; text-align: center; color: var(--muted); }
/* Keep the three summary cards and three portraits side by side even on phones. */
@media(max-width: 355px) {
  .app { padding-inline: 9px; gap: 9px; }
  .current-card { padding: 11px 9px; gap: 7px; }
  .stat { padding: 9px 7px; }
  .stat h2 span { display: none; }
  .making-of { padding-inline: 7px; gap: 5px; }
  .portrait figcaption { padding-inline: 6px; font-size: 10px; }
  .video-link { padding-left: 6px; }
}

/* Interactive implementation additions. */
.mode-note { padding:4px 8px; border:1px solid #376682; border-radius:8px; font-size:11px; color:var(--muted); line-height:1.4; }
.current-detail { color:var(--muted); font-size:11px; line-height:1.4; margin-top:5px; }
.date-button { position:relative; overflow:hidden; }
.date-button:focus-within { outline:2px solid var(--lime); outline-offset:3px; }
.mode-switch button:focus-visible { outline-offset:-3px; }
.mode-switch button:disabled { opacity:.45; }
.status { display:block; }
.status:empty, .bar-detail:empty, .mode-note[hidden] { display:none; }
.bar-detail { padding-top:5px; font-size:12px; line-height:1.4; color:var(--muted); }
.price-chart { overflow:hidden; }
.bar-hit { cursor:pointer; outline:none; }
.bar-hit:focus-visible .hit-area, .bar-hit.selected .hit-area { stroke:var(--lime); stroke-width:1; fill:#adf54612; }
.source-note a { color:var(--link); }
.video-link[aria-disabled=true] { cursor:default; }
.video-link:not([aria-disabled=true]) { min-height:44px; }
.stat strong,.price-line strong { overflow-wrap:anywhere; }

@media(max-width:355px) { .price-line strong { font-size:clamp(29px,10vw,39px); } }

/* Compact mobile reference v2: keep controls touch-sized, never hide real content
   by clipping or disabling vertical scrolling. A selected bar can add one line. */
@media (max-height: 850px) {
  .app { row-gap: 8px; }
  .brand-header { min-height: 52px; }
  .portrait img { max-height: 90px; }
}
@media (max-width: 355px) { .app { gap: 7px; } }

/* App-owned calendar: predictable dismissal and no extra height when closed. */
.calendar { width:min(calc(100% - 24px), 390px); max-height:calc(100dvh - 24px); margin:auto; padding:14px; color:var(--text); border:1px solid #397da5; border-radius:16px; background:#0b2335; box-shadow:0 12px 48px #0009; overflow:auto; }
.calendar::backdrop { background:#020b14b8; }
.calendar-heading,.calendar-nav { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.calendar-heading h2 { font-size:18px; }
.calendar-heading button,.calendar-nav button { display:grid; place-items:center; width:44px; min-height:44px; border:1px solid #376682; border-radius:9px; background:#102e43; font-size:26px; }
.calendar-nav h3 { margin:0; font-size:16px; font-weight:650; text-align:center; }
.calendar-nav button:disabled { opacity:.35; }
.calendar-week,.calendar-days { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:3px; text-align:center; }
.calendar-week { margin:10px 0 4px; font-size:11px; color:var(--muted); }
.calendar-days button { min-width:0; min-height:44px; padding:0; font-size:14px; border:1px solid transparent; border-radius:8px; background:#102e43; }
.calendar-days button[aria-pressed=true] { color:#061522; background:var(--lime); font-weight:700; }
.calendar-days button[aria-current=date]:not([aria-pressed=true]) { border-color:var(--lime); }
.calendar-days button:disabled { background:transparent; opacity:.32; }
.calendar-days button:focus-visible { outline-offset:-2px; }
@media(max-width:355px) { .calendar { padding:10px; } .calendar-days { gap:2px; } }
