/* Live BTC Chart, V4 "Both-screens" (13 Nov 2026).
   One responsive stage: giant price + inline chart.
   - Desktop and iPad landscape (wider than tall, >=700px, height > 500px):
     price-left / chart-right split that fills the first screen.
   - Phone landscape (orientation: landscape and max-height: 500px):
     single column — compact top bar (price, 24h, USD/CAD, full-screen
     buttons) and a chart that fills the remaining space. The Light/Dark
     pill is hidden in this orientation (all modes) so it is not in the way.
     The left-hand price rail is not used, so the chart can be as wide as
     the popup / full-screen chart views. Full-screen modes are unchanged.
   - iPhone portrait and iPad portrait: stacked, taller chart.
   Same chart, same look, same features (ranges, compare chips, Line/1H/4H,
   USD/CAD, Keep screen on, Light pill). Full-screen chart / full-screen
   price controls live at the bottom of this file. */

/* ---- Mobile-first stage ---- */
body.ps-clock{
  min-height:100dvh;
}
body.ps-clock .wrap{
  max-width:1320px;
  padding:calc(14px + env(safe-area-inset-top,0px)) 16px calc(36px + env(safe-area-inset-bottom,0px));
  box-sizing:border-box;
}
body.ps-clock .brand{
  flex-wrap:nowrap;
  align-items:center;
}
body.ps-clock .brand-text,
body.ps-clock .brand-clock{white-space:nowrap;}
body.ps-clock .top{
  margin:8px 0 10px;
  gap:8px;
}

/* The first-screen stage: clock + chart. */
body.ps-clock .v4-stage{
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:14px 14px 12px;
  border-radius:22px;
}
body.ps-clock .v4-clock{min-width:0;}
body.ps-clock .v4-clock-meta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  flex-wrap:nowrap;
}
body.ps-clock #curLab,
body.ps-clock #blockLab{letter-spacing:.08em;}
body.ps-clock .v4-clock-labs{display:flex;flex-direction:column;gap:2px;min-width:0;}
body.ps-clock .v4-stage .price{
  font-size:clamp(64px,17vw,96px);
  margin:4px 0 2px;
  line-height:.9;
}
body.ps-clock .v4-chg{
  display:flex;
  align-items:baseline;
  gap:6px;
  flex-wrap:wrap;
}
body.ps-clock .v4-chg .mut{font-size:13px;}

body.ps-clock .v4-plot{
  display:flex;
  flex-direction:column;
  flex:1 1 auto;
  min-height:0;
  min-width:0;
}
body.ps-clock .v4-stage #bcInline{
  display:flex !important;
  flex-direction:column;
  flex:1 1 auto;
  min-height:0;
  margin-top:4px !important;
}

/* Hide the inlined pop-up's duplicate header (the clock already is the header). */
body.ps-clock .v4-stage .bc-h,
body.ps-clock .v4-stage .bc-rr,
body.ps-clock .v4-stage .bc-rg-hint{display:none !important;}

/* Compact toolbar + chart that fills leftover space. */
body.ps-clock .v4-plot,
body.ps-clock .v4-stage #bcInline,
body.ps-clock .v4-stage .bc-inline,
body.ps-clock .v4-stage .bc-rg,
body.ps-clock .v4-stage .bc-lg,
body.ps-clock .v4-stage .bc-ct,
body.ps-clock .v4-stage .bc-box{min-width:0 !important;}
body.ps-clock .v4-stage,
body.ps-clock .v4-plot,
body.ps-clock .v4-stage #bcInline{overflow-x:hidden;}
body.ps-clock .v4-stage .bc-inline{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) auto !important;
  grid-template-rows:auto auto 1fr !important;
  flex:1 1 auto !important;
  min-height:0 !important;
  height:100% !important;
  width:100% !important;
  row-gap:6px;
}
body.ps-clock .v4-stage .bc-rg{
  margin:0 !important;
  display:flex;
  align-items:center;
  gap:6px;
  width:100%;
  overflow:hidden;
}
body.ps-clock .v4-stage .bc-rgs{
  display:flex !important;
  flex-wrap:nowrap !important;
  flex:1 1 auto;
  min-width:0;
  width:100%;
  overflow-x:auto;
  scrollbar-width:none;
  -webkit-overflow-scrolling:touch;
}
body.ps-clock .v4-stage .bc-rgs::-webkit-scrollbar{display:none;}
body.ps-clock .v4-stage .bc-lg{
  display:flex;
  flex-wrap:nowrap;
  gap:6px;
  overflow-x:auto;
  scrollbar-width:none;
  -webkit-overflow-scrolling:touch;
  margin:0 !important;
}
body.ps-clock .v4-stage .bc-lg::-webkit-scrollbar{display:none;}
body.ps-clock .v4-stage .bc-lg .bc-k{flex:0 0 auto;}
body.ps-clock .v4-stage .bc-ct{margin:0 !important;}
/* Phone-first toolbar: ranges get their own full-width scrolling row 1;
   compare chips (scrolling) and Line/1H/4H share row 2. Ranges and the
   chart-type buttons never share a row, so 3M/6M can't slide under Line. */
body.ps-clock .v4-stage .bc-rg{grid-column:1 / -1;grid-row:1;}
body.ps-clock .v4-stage .bc-lg{grid-column:1;grid-row:2;align-self:center;}
body.ps-clock .v4-stage .bc-ct{grid-column:2;grid-row:2;align-self:center;}
body.ps-clock .v4-stage .bc-box{grid-column:1 / -1 !important;}
@media (max-width:700px){
  body.ps-clock .v4-stage .bc-ct-lab{display:none;}
}
body.ps-clock .v4-stage .bc-rgs button,
body.ps-clock .v4-stage .bc-sc button,
body.ps-clock .v4-stage .bc-k,
body.ps-clock .v4-stage .bc-k-spx,
body.ps-clock .v4-stage .bc-ct button{
  min-height:36px;
}
body.ps-clock .v4-stage .bc-box{
  grid-column:1 / -1 !important;
  height:auto !important;
  min-height:220px;
  position:relative;
  width:100% !important;
  overflow:hidden;
}
body.ps-clock .v4-stage #bcC{
  position:absolute;inset:0;width:100%;height:100%;
}
body.ps-clock .v4-stage .bc-nt,
body.ps-clock .v4-stage .bc-cl{display:none !important;} /* caption lives in .v4-caption */
/* Live fixes 1 (28 Nov 2026): on 5Y/10Y with the trend-support or 200W MA
   line on, the panel tags the note .bc-nt-ltl — it carries the lines'
   as-of date, break rule and shading legend, so it shows here too
   (not in the full-screen view, which keeps the plot as tall as possible). */
html:not(.v4-fs-on) body.ps-clock .v4-stage .bc-nt.bc-nt-ltl{display:block !important;flex:0 0 auto;margin-top:6px;grid-column:1 / -1;min-height:0;overflow-y:auto;overscroll-behavior:contain;}

body.ps-clock .v4-caption{
  display:flex;
  justify-content:space-between;
  gap:8px;
  flex-wrap:wrap;
  font-size:12px;
  margin-top:6px;
  color:#64748b;
  flex:0 0 auto;
}

/* Desk link, 17 Nov 2026: a small text link to the Desk, sitting in the
   chart caption under the plot — clock page only, no new row, no new space.
   The caption already wraps, so narrow phones wrap cleanly instead of
   overflowing. Hidden in full-screen modes (html.v4-fs-on). The padding
   widens the tap target to ~32px tall without changing the caption's
   visual height (negative margin cancels it). */
body.ps-clock .v4-desk-link{
  color:#22d3ee;
  text-decoration:none;
  font-weight:700;
  white-space:nowrap;
  padding:10px 6px;
  margin:-10px -6px;
}
body.ps-clock .v4-desk-link:hover{text-decoration:underline;}
body.ps-clock .v4-desk-link:focus-visible{outline:2px solid #22d3ee;outline-offset:2px;border-radius:4px;}
html.v4-fs-on body.ps-clock .v4-desk-link{display:none;}
html[data-theme="light"] body.ps-clock .v4-desk-link{color:#0e7490;}

/* Desk link, fix 19 Nov 2026 (Chief's Batch A review): the link lives in
   .v4-caption, which is hidden on phones (portrait ≤480px, landscape
   ≤500px tall) — so it rendered at zero size on iPhone. On phones, show
   the caption row with ONLY the link: the other caption text stays hidden
   so the row costs a single line (~32px) and the plot just flex-shrinks.
   Still hidden in full-screen modes (the html:not(.v4-fs-on) guard, plus
   the .v4-desk-link rule above). The .v4-plot qualifier lifts specificity
   above the later hide rules regardless of file order. */
@media (max-width:480px) and (orientation:portrait){
  html:not(.v4-fs-on) body.ps-clock .v4-plot .v4-caption{display:flex;}
  html:not(.v4-fs-on) body.ps-clock .v4-plot .v4-caption span{display:none;}
}
@media (orientation:landscape) and (max-height:500px){
  html:not(.v4-fs-on) body.ps-clock .v4-plot .v4-caption{display:flex;}
  html:not(.v4-fs-on) body.ps-clock .v4-plot .v4-caption span{display:none;}
}

/* Light pill: keep off the y-axis on phones; desktop stays bottom-left
   (it then sits on the price column in the split). */
@media (max-width:760px){
  body.ps-clock .ps-theme-pill{
    left:auto !important;
    right:calc(8px + env(safe-area-inset-right,0px));
    bottom:calc(8px + env(safe-area-inset-bottom,0px));
  }
}

/* ---- Tight iPhone portrait ---- */
@media (max-width:480px) and (orientation:portrait){
  body.ps-clock .wrap{
    padding:calc(10px + env(safe-area-inset-top,0px)) 12px calc(18px + env(safe-area-inset-bottom,0px));
  }
  body.ps-clock .top{margin:6px 0 8px;}
  body.ps-clock .v4-stage{
    padding:12px 12px 10px;
    height:calc(100dvh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - 104px);
    overflow:hidden;
  }
  body.ps-clock .v4-caption{display:none;}
  body.ps-clock .v4-stage .price{
    font-size:clamp(64px,17vw,88px);
  }
  body.ps-clock .v4-stage .bc-rgs button,
  body.ps-clock .v4-stage .bc-sc button,
  body.ps-clock .v4-stage .bc-k,
  body.ps-clock .v4-stage .bc-k-spx,
  body.ps-clock .v4-stage .bc-ct button{min-height:32px;}
  body.ps-clock .v4-stage .bc-box{min-height:240px;}
  body.ps-clock .v4-stage .bc-rg{
    grid-column:1 / -1 !important;
    overflow:hidden !important;
    min-width:0;
  }
}

/* ---- Tall stacked tablets (iPad portrait): bigger chart, full width,
      but cap so the ticker can still peek on the first screen. ---- */
@media (min-width:700px) and (max-aspect-ratio:11/10){
  body.ps-clock .wrap{padding:18px 24px 40px;}
  body.ps-clock .v4-stage{
    padding:20px 22px 14px;
    border-radius:26px;
    flex:0 0 auto;
  }
  body.ps-clock .wrap{min-height:0;display:block;}
  body.ps-clock .v4-stage .price{
    font-size:clamp(80px,10vw,120px);
    margin:6px 0 4px;
  }
  body.ps-clock .v4-stage .bc-inline{
    grid-template-columns:minmax(0,1fr) auto !important;
    grid-template-rows:auto auto 1fr !important;
  }
  body.ps-clock .v4-stage .bc-rg{grid-column:1 / -1 !important;grid-row:1;}
  body.ps-clock .v4-stage .bc-lg{grid-column:1;grid-row:2;align-self:center;}
  body.ps-clock .v4-stage .bc-ct{grid-column:2;grid-row:2;align-self:center;}
  body.ps-clock .v4-stage .bc-box{
    height:min(560px, calc(100dvh - 420px)) !important;
    min-height:360px;
  }
}

/* ---- Split: desktop, iPhone landscape, iPad landscape.
      Price is a left-hand clock; the chart takes the remaining width
      and almost the full first-screen height. ---- */
@media (min-aspect-ratio:11/10) and (min-width:700px){
  body.ps-clock .wrap{
    padding:calc(12px + env(safe-area-inset-top,0px)) 22px calc(28px + env(safe-area-inset-bottom,0px));
  }
  /* Compact the page header so the stage can be the screen. */
  body.ps-clock .top .lab{display:none;} /* redundant with brand "· Live BTC Chart" */
  body.ps-clock .top{margin:4px 0 8px;}
  body.ps-clock .v4-stage{
    flex-direction:row;
    align-items:stretch;
    gap:24px;
    padding:18px 20px 14px;
    border-radius:24px;
    height:calc(100dvh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - 86px);
    overflow:hidden;
  }
  body.ps-clock .v4-clock{
    flex:0 0 40%;
    max-width:520px;
    min-width:240px;
    display:flex;
    flex-direction:column;
    justify-content:center;
    container-type:inline-size;
    container-name:clock;
  }
  body.ps-clock .v4-clock-meta{
    flex-wrap:wrap;
  }
  /* Scale the hero price to the column, not the viewport, so it stays
     a clock in a 300px landscape column and on a 500px desktop column. */
  body.ps-clock .v4-stage .price{
    font-size:clamp(52px, calc(100cqi / 4.7), 120px);
    margin:8px 0 10px;
  }
  body.ps-clock .v4-plot{
    flex:1 1 auto;
  }
  /* Ranges on their own full-width row (nowrap + scroll); legend and
     chart-type share the second row; the chart fills the rest. */
  body.ps-clock .v4-stage .bc-inline{
    grid-template-columns:minmax(0,1fr) auto !important;
    grid-template-rows:auto auto 1fr !important;
    column-gap:10px;
    row-gap:8px;
    align-items:center;
  }
  body.ps-clock .v4-stage .bc-rg{grid-column:1 / -1 !important;grid-row:1;margin:0 !important;}
  body.ps-clock .v4-stage .bc-lg{grid-column:1;grid-row:2;align-self:center;overflow-x:auto;}
  body.ps-clock .v4-stage .bc-ct{grid-column:2;grid-row:2;align-self:center;}
  body.ps-clock .v4-stage .bc-ct-lab{display:inline;}
  body.ps-clock .v4-stage .bc-box{
    grid-column:1 / -1 !important;
    grid-row:auto;
    height:100% !important;
    min-height:280px;
    align-self:stretch;
    overflow:hidden;
    max-width:100%;
  }
  body.ps-clock .v4-stage .bc-rgs button,
  body.ps-clock .v4-stage .bc-sc button,
  body.ps-clock .v4-stage .bc-k,
  body.ps-clock .v4-stage .bc-k-spx,
  body.ps-clock .v4-stage .bc-ct button{min-height:32px;}
}

/* ---- Short iPhone landscape: even tighter chrome, still the split. ---- */
@media (orientation:landscape) and (max-height:500px) and (min-width:700px){
  body.ps-clock .wrap{
    padding:calc(6px + env(safe-area-inset-top,0px)) 10px calc(8px + env(safe-area-inset-bottom,0px));
  }
  body.ps-clock .brand .logo{width:28px;height:28px;border-radius:6px;}
  body.ps-clock .brand-text,
  body.ps-clock .brand-clock{font-size:1rem;}
  body.ps-clock .top{margin:2px 0 6px;}
  body.ps-clock .v4-stage{
    gap:14px;
    padding:10px 12px 8px;
    border-radius:18px;
    height:calc(100dvh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - 66px);
    overflow:hidden;
  }
  body.ps-clock .v4-clock{flex-basis:38%;max-width:320px;padding-bottom:0;box-sizing:border-box;}
  body.ps-clock .v4-stage .price{margin:4px 0 6px;}
  body.ps-clock .chg{font-size:16px;}
  body.ps-clock .v4-caption{display:none;} /* keep the plot as tall as possible */
  body.ps-clock .v4-stage .bc-box{min-height:120px !important;}
  body.ps-clock .v4-stage .bc-ct-lab{display:none;}
  body.ps-clock .v4-stage .bc-rgs button,
  body.ps-clock .v4-stage .bc-sc button,
  body.ps-clock .v4-stage .bc-k,
  body.ps-clock .v4-stage .bc-k-spx,
  body.ps-clock .v4-stage .bc-ct button{min-height:28px;}
}

/* ---- Phone landscape: drop the two-column split (13 Nov 2026).
      The 700px+ split was also matching iPhone landscape (e.g. 932x430),
      which left a tall price rail and a ~552x232 chart. Below 500px tall,
      use a single column: a compact top bar for the price, 24h, USD/CAD
      toggle, and full-screen buttons, and let the chart fill the rest.
      Scoped with html:not(.v4-fs-on) so desktop, portrait, tablet, and
      both full-screen modes stay on their existing rules. A short desktop
      window that is also under 500px tall would match; normal desktop
      (e.g. 1280x800) does not. */
@media (orientation: landscape) and (max-height: 500px){
  html:not(.v4-fs-on) body.ps-clock .wrap{
    padding:calc(6px + env(safe-area-inset-top,0px)) 10px calc(8px + env(safe-area-inset-bottom,0px));
  }
  html:not(.v4-fs-on) body.ps-clock .brand .logo{width:28px;height:28px;border-radius:6px;}
  html:not(.v4-fs-on) body.ps-clock .brand-text,
  html:not(.v4-fs-on) body.ps-clock .brand-clock{font-size:1rem;}
  html:not(.v4-fs-on) body.ps-clock .top{margin:2px 0 6px;}
  html:not(.v4-fs-on) body.ps-clock .top .lab{display:none;}
  html:not(.v4-fs-on) body.ps-clock .v4-stage{
    flex-direction:column;
    align-items:stretch;
    gap:6px;
    padding:8px 10px 8px;
    border-radius:18px;
    height:calc(100dvh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - 58px);
    overflow:hidden;
  }
  html:not(.v4-fs-on) body.ps-clock .v4-clock{
    flex:0 0 auto;
    flex-basis:auto;
    max-width:none;
    min-width:0;
    width:100%;
    display:flex;
    flex-direction:row;
    flex-wrap:nowrap;
    align-items:center;
    justify-content:flex-start;
    gap:6px 10px;
    padding-bottom:0;
    box-sizing:border-box;
    container-type:normal;
  }
  html:not(.v4-fs-on) body.ps-clock .v4-clock-meta{
    flex:0 0 auto;
    flex-wrap:nowrap;
    order:3;
    margin-left:auto;
  }
  html:not(.v4-fs-on) body.ps-clock .v4-clock-meta #curLab,
  html:not(.v4-fs-on) body.ps-clock .v4-clock-meta #blockLab,
  html:not(.v4-fs-on) body.ps-clock .v4-clock-labs{display:none;} /* toggle stays; labels are redundant here */
  html:not(.v4-fs-on) body.ps-clock .v4-stage .price{
    order:1;
    /* 32px cap (was 36px): at 932x430 a $100k+ price is ~18px wider and
       would eat the ~16px of spare in the bar. The change text can also
       shrink/ellipsis, so $1,000,000 still fits on one row. */
    font-size:clamp(24px, 4.6vw, 32px);
    margin:0;
    line-height:1;
    white-space:nowrap;
    flex:0 0 auto;
  }
  html:not(.v4-fs-on) body.ps-clock .v4-chg{
    order:2;
    margin:0;
    flex:0 1 auto;
    min-width:0;
    overflow:hidden;
  }
  html:not(.v4-fs-on) body.ps-clock .chg{font-size:14px;flex:0 0 auto;white-space:nowrap;}
  html:not(.v4-fs-on) body.ps-clock .v4-chg .mut{
    font-size:12px;
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  html:not(.v4-fs-on) body.ps-clock .v4-fs{
    display:flex;
    order:4;
    margin-top:0;
    flex:0 0 auto;
    gap:6px;
  }
  html:not(.v4-fs-on) body.ps-clock .v4-fs-btn{
    white-space:nowrap;
    min-height:28px;
    padding:5px 10px;
  }
  html:not(.v4-fs-on) body.ps-clock .v4-plot{
    flex:1 1 auto;
    min-height:0;
    width:100%;
    max-width:none;
  }
  html:not(.v4-fs-on) body.ps-clock .v4-caption{display:none;}
  html:not(.v4-fs-on) body.ps-clock .v4-stage .bc-inline{
    height:100% !important;
    min-height:0 !important;
  }
  html:not(.v4-fs-on) body.ps-clock .v4-stage .bc-box{
    min-height:0 !important;
    height:100% !important;
  }
  html:not(.v4-fs-on) body.ps-clock .v4-stage .bc-ct-lab{display:none;}
  html:not(.v4-fs-on) body.ps-clock .v4-stage .bc-rgs button,
  html:not(.v4-fs-on) body.ps-clock .v4-stage .bc-sc button,
  html:not(.v4-fs-on) body.ps-clock .v4-stage .bc-k,
  html:not(.v4-fs-on) body.ps-clock .v4-stage .bc-k-spx,
  html:not(.v4-fs-on) body.ps-clock .v4-stage .bc-ct button{min-height:28px;}
}
/* Light/Dark pill: hidden in phone landscape, every mode (default,
   full-screen chart, full-screen price). Portrait and desktop are unchanged. */
@media (orientation: landscape) and (max-height: 500px){
  body.ps-clock .ps-theme-pill{display:none !important;}
}
@media (orientation: landscape) and (max-height: 500px) and (max-width: 900px){
  /* Mid/narrow phone landscape (e.g. 844x390, 667x375): shorten the
     full-screen labels so both Chart and Price stay visible on one row.
     The Price-only control must remain available; only the wording shrinks. */
  html:not(.v4-fs-on) body.ps-clock .v4-fs-btn{font-size:0;gap:4px;padding:5px 8px;}
  html:not(.v4-fs-on) body.ps-clock .v4-fs-btn svg{width:12px;height:12px;}
  html:not(.v4-fs-on) body.ps-clock .v4-fs-btn[data-fs="chart"]::after{content:"Chart";font-size:11px;font-weight:900;letter-spacing:0;}
  html:not(.v4-fs-on) body.ps-clock .v4-fs-btn[data-fs="price"]::after{content:"Price";font-size:11px;font-weight:900;letter-spacing:0;}
}
@media (orientation: landscape) and (max-height: 500px) and (max-width: 700px){
  /* Tightest phones (e.g. 667x375): keep the % change, drop the 24h/updated
     text so the bar does not overflow. */
  html:not(.v4-fs-on) body.ps-clock .v4-chg .mut{display:none;}
}

/* Light-mode: don't fight the existing clock light rules; just keep the stage. */
html[data-theme="light"] body.ps-clock .v4-caption{color:#475569;}

/* ---- Full-screen chart / full-screen price (13 Nov 2026) ----
   Two small controls under the price, shown only in the split layout
   (desktop, iPhone landscape, iPad landscape). The Fullscreen API is used
   where the browser has it; iPhone Safari gets the same full-viewport
   layout from CSS (fixed, 100dvh, safe-area padding). Exit: the button
   or Esc. Styled like the USD/CAD toggle so nothing new is introduced. */
body.ps-clock .v4-fs{display:none;gap:6px;flex-wrap:wrap;margin-top:12px}
body.ps-clock .v4-fs-btn,
body.ps-clock .v4-fs-exit,
body.ps-clock .v4-fs-tochart,
body.ps-clock .v4-fs-toprice{
  display:inline-flex;align-items:center;gap:6px;
  background:transparent;color:#94a3b8;
  border:1px solid #1e293b;border-radius:999px;
  padding:6px 12px;min-height:32px;
  font:900 12px/1 Inter,system-ui,sans-serif;cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
body.ps-clock .v4-fs-btn svg,
body.ps-clock .v4-fs-exit svg,
body.ps-clock .v4-fs-tochart svg{width:12px;height:12px;flex:0 0 auto;display:block}
body.ps-clock .v4-fs-btn:hover,
body.ps-clock .v4-fs-exit:hover,
body.ps-clock .v4-fs-tochart:hover,
body.ps-clock .v4-fs-toprice:hover{color:#22d3ee;border-color:rgba(34,211,238,.55)}
body.ps-clock .v4-fs-btn:focus-visible,
body.ps-clock .v4-fs-exit:focus-visible,
body.ps-clock .v4-fs-tochart:focus-visible,
body.ps-clock .v4-fs-toprice:focus-visible{outline:2px solid #22d3ee;outline-offset:2px}
body.ps-clock .v4-fs-exit{
  display:none;position:absolute;z-index:5;
  top:calc(10px + env(safe-area-inset-top,0px));
  right:calc(10px + env(safe-area-inset-right,0px));
  background:rgba(7,11,24,.88);
}
/* "Switch to chart" lives in the full-screen tools bar, price-only mode. */
body.ps-clock .v4-fs-tochart{display:none;white-space:nowrap}
html.v4-fs-price body.ps-clock .v4-fs-bar .v4-fs-tochart{
  display:inline-flex;position:static;
  background:rgba(7,11,24,.88);
}
/* CF-4 add-on 2: "Price clock" lives in the same bar, chart-only mode —
   the mirror of "Switch to chart". Same pill style, same bar. */
body.ps-clock .v4-fs-toprice{display:none;white-space:nowrap}
html.v4-fs-chart body.ps-clock .v4-fs-bar .v4-fs-toprice{
  display:inline-flex;position:static;
  background:rgba(7,11,24,.88);
}
@media (min-aspect-ratio:11/10) and (min-width:700px){
  body.ps-clock .v4-fs{display:flex}
}
html.v4-fs-on,html.v4-fs-on body{overflow:hidden}
html.v4-fs-on body.ps-clock .v4-stage{
  position:fixed;inset:0;z-index:100;
  width:100vw;height:100vh;height:100dvh;max-height:none;
  margin:0;border-radius:0;border:0;
  box-sizing:border-box;
  padding:calc(12px + env(safe-area-inset-top,0px)) calc(14px + env(safe-area-inset-right,0px)) calc(12px + env(safe-area-inset-bottom,0px)) calc(14px + env(safe-area-inset-left,0px));
  background:#05070f;
  overflow:hidden;
}
body.ps-clock .v4-stage:fullscreen{width:100vw;height:100vh}
body.ps-clock .v4-stage::backdrop{background:#05070f}
html.v4-fs-on body.ps-clock .v4-fs{display:none}
html.v4-fs-on body.ps-clock .v4-fs-exit{display:inline-flex}
/* Chart mode: the plot takes the whole screen. */
html.v4-fs-chart body.ps-clock .v4-clock{display:none}
html.v4-fs-chart body.ps-clock .v4-plot{flex:1 1 auto;width:100%;height:100%}
html.v4-fs-chart body.ps-clock .v4-stage .bc-rg{padding-right:150px;box-sizing:border-box}
html.v4-fs-chart body.ps-clock .v4-stage .bc-box{min-height:0 !important}
/* Price mode: the clock takes the whole screen. */
html.v4-fs-price body.ps-clock .v4-plot{display:none}
html.v4-fs-price body.ps-clock .v4-stage{flex-direction:column;justify-content:center;align-items:center}
/* Fix 1 (13 Nov, desktop/large screens): the column hugs the price and is
   centred; the price is centred and never clipped. clock-v4.js shrinks the
   font when a long price (e.g. C$ or 7 digits) would not fit the width. */
html.v4-fs-price body.ps-clock .v4-clock{flex:0 0 auto;container-type:normal;width:fit-content;max-width:100%;min-width:min(100%,320px);align-items:stretch}
@media (orientation: landscape) and (max-height: 500px){
  html.v4-fs-price body.ps-clock .v4-stage{padding-top:calc(52px + env(safe-area-inset-top,0px))}
}
html.v4-fs-price body.ps-clock .v4-stage .price{font-size:min(calc(100vw / 4.9), 46vh);margin:10px 0 .2em;text-align:center;white-space:nowrap}
html.v4-fs-price body.ps-clock .v4-chg{justify-content:center}
html.v4-fs-price body.ps-clock .v4-chg{font-size:clamp(14px,2.2vw,26px)}
html.v4-fs-price body.ps-clock .v4-chg .chg{font-size:clamp(16px,2.6vw,32px)}
/* CAD toggle fix (14 Nov 2026): in price-only mode the giant price text
   overflows its line box — font 261px, line-height only 235px, glyphs
   ~356px tall — so the text spills ~61px above the price div and covers
   the currency toggle, intercepting every tap (elementFromPoint at the
   toggle returns DIV#price). The toggle, its handler and setCur/render
   all work; only hit-testing is broken. Raising the meta row (labels +
   toggle) above the price restores it. No layout change: position:relative
   with no offsets, z-index 1 sits below the fs-bar (6) and theme dot (7). */
html.v4-fs-price body.ps-clock .v4-clock-meta{position:relative;z-index:1}
html[data-theme="light"].v4-fs-on body.ps-clock .v4-stage{background:#f6f8fb}
html[data-theme="light"] body.ps-clock .v4-stage::backdrop{background:#f6f8fb}
html[data-theme="light"] body.ps-clock .v4-fs-btn,
html[data-theme="light"] body.ps-clock .v4-fs-exit,
html[data-theme="light"] body.ps-clock .v4-fs-tochart,
html[data-theme="light"] body.ps-clock .v4-fs-toprice{color:#475569;border-color:#e2e8f0}
html[data-theme="light"] body.ps-clock .v4-fs-exit,
html[data-theme="light"] body.ps-clock .v4-fs-tochart,
html[data-theme="light"] body.ps-clock .v4-fs-toprice{background:rgba(255,255,255,.92)}
html[data-theme="light"] body.ps-clock .v4-fs-btn:hover,
html[data-theme="light"] body.ps-clock .v4-fs-exit:hover,
html[data-theme="light"] body.ps-clock .v4-fs-tochart:hover,
html[data-theme="light"] body.ps-clock .v4-fs-toprice:hover{color:#0e7490;border-color:#22d3ee}
/* 700-1199px split (e.g. iPad landscape 1024x768): drop the "Chart" label so
   the compare chips (+ MSTR) are not clipped. */
@media (min-aspect-ratio:11/10) and (min-width:700px) and (max-width:1199px){
  body.ps-clock .v4-stage .bc-ct-lab{display:none}
}

/* ---- 13 Nov 2026 fixes: full-screen tools bar + live price pill ----
   Fix 4: in either full-screen mode the "Keep screen on" pill joins the
   Exit button in a top-right bar inside the stage (clock-v4.js moves the
   same button there and back, so the wake lock code is untouched). The
   bar's width is published as --v4-fs-bar-w so the range row clears it.
   Fix 2: a draggable live BTC price pill, shown only in full-screen chart
   mode, kept inside the chart box. */
body.ps-clock .v4-fs-bar{display:none}
html.v4-fs-on body.ps-clock .v4-fs-bar{
  display:flex;align-items:center;gap:6px;flex-wrap:nowrap;
  position:absolute;z-index:6;
  top:calc(10px + env(safe-area-inset-top,0px));
  right:calc(10px + env(safe-area-inset-right,0px));
}
html.v4-fs-on body.ps-clock .v4-fs-bar .v4-fs-exit{position:static;display:inline-flex}
html.v4-fs-on body.ps-clock .v4-fs-bar .wl-btn{
  margin:0;min-height:32px;padding:6px 12px;line-height:1;font-size:12px;
  background:rgba(7,11,24,.88);white-space:nowrap;
}
html.v4-fs-on body.ps-clock .v4-fs-bar .wl-btn::after{inset:-6px -3px}
html.v4-fs-on body.ps-clock .v4-fs-bar .wl-btn[aria-pressed="true"]{background:#22d3ee;color:#041018;border-color:#22d3ee}
html.v4-fs-on body.ps-clock .v4-fs-bar .wl-btn[hidden]{display:none}
html[data-theme="light"].v4-fs-on body.ps-clock .v4-fs-bar .wl-btn{background:rgba(255,255,255,.92)}
html[data-theme="light"].v4-fs-on body.ps-clock .v4-fs-bar .wl-btn[aria-pressed="true"]{background:#22d3ee;color:#041018;border-color:#22d3ee}
html.v4-fs-chart body.ps-clock .v4-stage .bc-rg{padding-right:calc(var(--v4-fs-bar-w,140px) + 12px)}
/* iPad native fullscreen (15 Nov 2026): Safari draws its own forced X
   (top-left, ~50px) over the range row. Shift the row right so the 1M
   pill clears it. Scoped to html.v4-ipad-fs (iPad + native fullscreen
   only, set by clock-v4.js): iPhone never enters native fullscreen and
   desktop has no X, so neither is affected. 80px + the stage's 14px left
   padding = 94px clear of the left edge, ~19px past the X's right edge
   (~75px). v2 (15 Nov): 56px left the 1D pill touching the X (~5px
   overlap); 80px clears it with a comfortable gap. */
html.v4-ipad-fs.v4-fs-chart body.ps-clock .v4-stage .bc-rg{padding-left:80px}
/* Narrow screens (phone portrait): the bar gets its own row above the chart. */
@media (max-width:620px){
  html.v4-fs-on body.ps-clock .v4-stage{padding-top:calc(54px + env(safe-area-inset-top,0px))}
  html.v4-fs-price body.ps-clock .v4-stage{padding-top:calc(96px + env(safe-area-inset-top,0px))}
  html.v4-fs-on body.ps-clock .v4-fs-bar{
    left:calc(10px + env(safe-area-inset-left,0px));
    justify-content:flex-end;
    flex-wrap:wrap;
  }
  html.v4-fs-chart body.ps-clock .v4-stage .bc-rg{padding-right:0}
}
html.v4-fs-chart body.ps-clock .v4-plot{position:relative}
body.ps-clock .v4-px-pill{display:none}
/* CF-4 add-on 1 (14 Nov 2026): the pill is 2x on desktop/iPad (font,
   padding, gap, border, change label, shadows all doubled). iPhone keeps
   its smaller size — see the (max-width:620px),(max-height:500px) rule
   below, which resets every scaled value. The calm pulse is a breathing
   glow on a ::before halo: only its opacity animates (compositor-friendly,
   no layout, no JS timers), so the pill never changes size. */
html.v4-fs-chart body.ps-clock .v4-px-pill{
  display:inline-flex;align-items:baseline;gap:32px;
  position:absolute;z-index:4;left:0;top:0;
  padding:28px 56px 28px 48px;border-radius:999px;
  background:rgba(7,11,24,.82);color:#e8eef7;
  border:4px solid rgba(34,211,238,.45);
  box-shadow:0 24px 88px rgba(0,0,0,.45),0 0 72px rgba(34,211,238,.12);
  -webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);
  font:900 80px/1.1 Inter,system-ui,sans-serif;letter-spacing:-.02em;
  font-variant-numeric:tabular-nums;white-space:nowrap;
  cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none;
  -webkit-tap-highlight-color:transparent;
}
html.v4-fs-chart body.ps-clock .v4-px-pill::before{
  content:"";position:absolute;inset:-6px;border-radius:999px;
  pointer-events:none;z-index:-1;
  box-shadow:0 0 72px 8px rgba(34,211,238,.30);
  animation:v4-px-glow 3.5s ease-in-out infinite;
}
@keyframes v4-px-glow{0%,100%{opacity:.35}50%{opacity:1}}
@media (prefers-reduced-motion:reduce){
  html.v4-fs-chart body.ps-clock .v4-px-pill::before{animation:none}
}
html.v4-fs-chart body.ps-clock .v4-px-pill.dragging{cursor:grabbing;box-shadow:0 40px 120px rgba(0,0,0,.55),0 0 88px rgba(34,211,238,.25)}
html.v4-fs-chart body.ps-clock .v4-px-pill:focus-visible{outline:4px solid #22d3ee;outline-offset:4px}
body.ps-clock .v4-px-pill .v4-px-sym{color:#22d3ee}
body.ps-clock .v4-px-pill .v4-px-chg{font-size:52px;font-weight:800}
body.ps-clock .v4-px-pill .v4-px-chg.up{color:#22c55e}
body.ps-clock .v4-px-pill .v4-px-chg.down{color:#ef4444}
/* CF-4 add-on 1: iPhone keeps the pill exactly as it was (32px font,
   12/24/12/20 padding, 16px gap, 2px border, 24px change label, the
   original shadows) — the 2x scale above is desktop/iPad only. The
   breathing glow is smaller here to match. */
@media (max-width:620px),(max-height:500px){
  html.v4-fs-chart body.ps-clock .v4-px-pill{font-size:32px;padding:12px 24px 12px 20px;gap:16px;border-width:2px;box-shadow:0 12px 44px rgba(0,0,0,.45),0 0 36px rgba(34,211,238,.12)}
  html.v4-fs-chart body.ps-clock .v4-px-pill.dragging{box-shadow:0 20px 60px rgba(0,0,0,.55),0 0 44px rgba(34,211,238,.25)}
  html.v4-fs-chart body.ps-clock .v4-px-pill::before{box-shadow:0 0 36px 4px rgba(34,211,238,.28)}
  body.ps-clock .v4-px-pill .v4-px-chg{font-size:24px}
  html[data-theme="light"].v4-fs-chart body.ps-clock .v4-px-pill{box-shadow:0 6px 20px rgba(15,23,42,.14)}
  html[data-theme="light"].v4-fs-chart body.ps-clock .v4-px-pill::before{box-shadow:0 0 32px 4px rgba(14,116,144,.40)}
}
html[data-theme="light"].v4-fs-chart body.ps-clock .v4-px-pill{
  background:rgba(255,255,255,.9);color:#0f172a;border-color:rgba(14,116,144,.4);
  box-shadow:0 12px 40px rgba(15,23,42,.14);
}
html[data-theme="light"].v4-fs-chart body.ps-clock .v4-px-pill::before{
  box-shadow:0 0 64px 8px rgba(14,116,144,.45);
}
html[data-theme="light"] body.ps-clock .v4-px-pill .v4-px-sym{color:#0e7490}
html[data-theme="light"] body.ps-clock .v4-px-pill .v4-px-chg.up{color:#15803d}
html[data-theme="light"] body.ps-clock .v4-px-pill .v4-px-chg.down{color:#b91c1c}

/* Batch B item 12 (15 Nov 2026): "Drag to move" hint under the price
   pill. Shown once, on entering full-screen chart mode, until the user
   has moved the pill (localStorage ps-clock-pxpill-dragged); fades after
   ~4s. Absolutely positioned under the pill, so the pill's transform
   carries it along when dragged. pointer-events:none so it can never
   steal a drag; aria-hidden so it never reaches a screen reader. */
html.v4-fs-chart body.ps-clock .v4-px-pill .v4-px-hint{
  position:absolute;left:50%;top:calc(100% + 12px);transform:translateX(-50%);
  display:none;padding:7px 16px;border-radius:999px;
  background:rgba(7,11,24,.85);color:#94a3b8;
  border:1px solid rgba(148,163,184,.35);
  font:600 15px/1.4 Inter,system-ui,sans-serif;letter-spacing:0;white-space:nowrap;
  pointer-events:none;opacity:0;transition:opacity .6s ease;
}
html.v4-fs-chart body.ps-clock .v4-px-pill .v4-px-hint.show{display:block;opacity:1}
html.v4-fs-chart body.ps-clock .v4-px-pill .v4-px-hint.fade{opacity:0}
html[data-theme="light"].v4-fs-chart body.ps-clock .v4-px-pill .v4-px-hint{
  background:rgba(255,255,255,.94);color:#475569;border-color:rgba(15,23,42,.2);
}
@media (prefers-reduced-motion:reduce){
  html.v4-fs-chart body.ps-clock .v4-px-pill .v4-px-hint{transition:none}
}
@media (max-width:620px),(max-height:500px){
  html.v4-fs-chart body.ps-clock .v4-px-pill .v4-px-hint{
    top:calc(100% + 8px);padding:5px 12px;font-size:12px;
  }
}

/* ---- CF-4 add-on 3 (14 Nov 2026): theme dot, price-only view only ----
   The floating theme pill (z-index 50) sits behind the full-screen stage
   (z-index 100), so the price-only view has no theme control at all.
   This dot fixes that: a small circle in the bottom-right corner, shown
   only in price mode. It lives INSIDE the stage (not on the body): on
   desktop the Fullscreen API puts the stage in the top layer, above
   everything in the document, so a dot outside the stage would be
   covered and untappable; inside the stage it is part of the top layer
   (and on iPhone, where there is no element fullscreen, the stage is a
   fixed div and the dot sits above its content the same way). The colour
   is the mode it switches TO — white in dark mode (tap for light), dark
   blue in light mode (tap for dark) — so it stays obvious in both themes.
   The visible dot is 20px; the button is 44px so it is easy to tap on
   iPhone. Safe-area insets keep it clear of the home indicator. It
   toggles ps-theme (localStorage), the same setting the rest of the
   clock page uses. */
body.ps-clock .v4-theme-dot{display:none}
html.v4-fs-price body.ps-clock .v4-theme-dot{
  display:grid;place-items:center;
  position:absolute;z-index:7;
  right:calc(16px + env(safe-area-inset-right,0px));
  bottom:calc(16px + env(safe-area-inset-bottom,0px));
  width:44px;height:44px;padding:0;border:0;border-radius:50%;
  background:transparent;cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
html.v4-fs-price body.ps-clock .v4-theme-dot::after{
  content:"";width:20px;height:20px;border-radius:50%;
  background:#fff;
  box-shadow:0 0 0 1px rgba(255,255,255,.4),0 2px 10px rgba(0,0,0,.5);
}
html[data-theme="light"].v4-fs-price body.ps-clock .v4-theme-dot::after{
  background:#0f172a;
  box-shadow:0 0 0 1px rgba(15,23,42,.3),0 2px 10px rgba(15,23,42,.3);
}
html.v4-fs-price body.ps-clock .v4-theme-dot:focus-visible{outline:2px solid #22d3ee;outline-offset:3px}

/* ---- Rotate hint (TA final job, 21 Nov 2026) ----
   A small pill at the bottom-left of the clock-page chart, portrait
   only. Tap enters full-screen chart mode and shows a "rotate your
   phone" prompt while still portrait. iOS cannot force landscape — the
   hint only suggests, never locks orientation. The hint lives inside
   .bc-box (bottom-left corner of the canvas); the RSI strip is a grid
   row below the box and the TA pill is in the toolbar row above, so
   neither is covered. Hidden in landscape and in full-screen modes
   (there the chart is already full screen). The prompt is a toast
   inside the stage, bottom-centre, shown only in full-screen chart
   mode while portrait; it fades after ~5s, hides on landscape
   rotation, on exit, or on tap. */
body.ps-clock .v4-rotate-hint{display:none}
body.ps-clock .v4-rotate-prompt{display:none}
@media (orientation:portrait){
  html:not(.v4-fs-on) body.ps-clock .v4-rotate-hint{
    display:inline-flex;align-items:center;gap:6px;
    position:absolute;z-index:5;left:8px;bottom:8px;
    background:rgba(7,11,24,.88);color:#e8eef7;
    border:1px solid rgba(34,211,238,.45);border-radius:999px;
    padding:6px 12px;min-height:36px;
    font:900 12px/1 Inter,system-ui,sans-serif;cursor:pointer;white-space:nowrap;
    -webkit-tap-highlight-color:transparent;
  }
  html:not(.v4-fs-on) body.ps-clock .v4-rotate-hint:hover{color:#22d3ee;border-color:rgba(34,211,238,.55)}
  html:not(.v4-fs-on) body.ps-clock .v4-rotate-hint:focus-visible{outline:2px solid #22d3ee;outline-offset:2px}
  html.v4-fs-chart body.ps-clock .v4-rotate-prompt.show{
    display:flex;align-items:center;gap:8px;
    position:absolute;z-index:8;left:50%;bottom:calc(16px + env(safe-area-inset-bottom,0px));
    transform:translateX(-50%);
    background:rgba(7,11,24,.92);color:#e8eef7;border:1px solid rgba(34,211,238,.45);
    border-radius:999px;padding:10px 16px;white-space:nowrap;
    font:700 13px/1.2 Inter,system-ui,sans-serif;cursor:pointer;
    box-shadow:0 12px 40px rgba(0,0,0,.5);
  }
}
html[data-theme="light"] body.ps-clock .v4-rotate-hint{background:rgba(255,255,255,.92);color:#0f172a;border-color:#e2e8f0}
html[data-theme="light"] body.ps-clock .v4-rotate-hint:hover{color:#0e7490;border-color:#22d3ee}
html[data-theme="light"].v4-fs-chart body.ps-clock .v4-rotate-prompt.show{background:rgba(255,255,255,.95);color:#0f172a;border-color:#e2e8f0;box-shadow:0 12px 32px rgba(15,23,42,.18)}
