/* ==========================================================================
   TAL'S MARKET EDGE v3.0 — iPhone 17 Pro Max Exclusive Titanium & Obsidian OLED
   Portrait: 440 x 956 pt | Pro Landscape: 956 x 440 pt
   Zero external CDNs · Zero cyan/neon chrome · Apple HIG >= 44x44 pt targets
   ========================================================================== */

:root {
  /* True OLED Obsidian Surfaces */
  --bg-oled: #000000;
  --bg-surface: #0C0E12;
  --bg-elevated: #13161C;
  --bg-elevated-2: #1A1E27;
  --bg-glass: rgba(14, 16, 22, 0.84);
  --bg-glass-strong: rgba(12, 14, 18, 0.92);

  /* Hairlines & Elevation */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-med: rgba(255, 255, 255, 0.14);
  --border-active: rgba(255, 255, 255, 0.22);

  /* Monochrome Apple Titanium Chrome (Zero cyan/neon chrome) */
  --titanium: #F5F7FA;
  --titanium-soft: rgba(245, 247, 250, 0.10);
  --titanium-pill: rgba(245, 247, 250, 0.16);
  --text-primary: #F5F7FA;
  --text-secondary: #A1AAB8;
  --text-muted: #6C7687;
  --text-dim: #4A5262;

  /* Financial Data Semantic Palette (Strictly data, candles & signal pills) */
  --bull: #30D18A;
  --bull-bg: rgba(48, 209, 138, 0.14);
  --bull-border: rgba(48, 209, 138, 0.34);
  --bear: #FF4560;
  --bear-bg: rgba(255, 69, 96, 0.14);
  --bear-border: rgba(255, 69, 96, 0.34);
  --caution: #F5A623;
  --caution-bg: rgba(245, 166, 35, 0.14);
  --caution-border: rgba(245, 166, 35, 0.34);
  --cycle-base: #E2E8F0;
  --cycle-80d: #5AC8FA;
  --cycle-80d-bg: rgba(90, 200, 250, 0.14);
  --cycle-80d-border: rgba(90, 200, 250, 0.34);
  --bond-10y: #A78BFA;
  --bond-cbl: #34D399;
  --astro-lab: #F472B6;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif;
  --font-mono: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, monospace;

  /* iPhone 17 Pro Max Safe Areas (Overridden cleanly by hardware preview shell) */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  /* Layout Geometry & Spring Motion */
  --header-h: 52px;
  --dock-h: 58px;
  --tcb-h: 46px;
  --subpane-h: 146px;
  --subpane-collapsed-h: 30px;
  --radius-card: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --radius-sheet: 26px;
  --spring-press: cubic-bezier(0.2, 0.9, 0.25, 1);
  --spring-sheet: cubic-bezier(0.22, 1, 0.36, 1);
  --glass-blur: blur(22px) saturate(160%);
}

/* ==========================================================================
   BASE RESET & VIEWPORT (Exact height: 100%; height: 100dvh; order!)
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg-oled);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.38;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
  overscroll-behavior: none;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
  font-variant-numeric: tabular-nums;
}

/* Strict iOS anti-auto-zoom: ALL text/numeric/search inputs >= 16px */
input,
input[type="text"],
input[type="number"],
input[type="search"],
select,
textarea {
  font-size: 16px;
}

button {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 90ms var(--spring-press), background-color 140ms ease, border-color 140ms ease, color 140ms ease, opacity 140ms ease;
}

button:active,
.tappable:active {
  transform: scale(0.96);
  transition: transform 90ms var(--spring-press);
}

button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--titanium);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Semantic Financial Tones */
.up, .tone-bull, .tone-up, .tone-positive, .badge-verified {
  color: var(--bull);
}
.down, .tone-bear, .tone-down, .tone-negative, .badge-failed {
  color: var(--bear);
}
.warn, .tone-warn, .tone-caution, .tone-amber, .badge-exploratory {
  color: var(--caution);
}
.tone-info, .tone-cycle {
  color: var(--cycle-80d);
}
.flat, .tone-flat, .tone-neutral {
  color: var(--text-secondary);
}

/* ==========================================================================
   APP ROOT SHELL (100% iPhone 17 Pro Max 440x956 Native Frame)
   ========================================================================== */
.app-root {
  position: relative;
  width: 100%;
  max-width: 440px;
  height: 100%;
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--bg-oled);
  overflow: hidden;
  padding-top: var(--safe-top);
}

@media (min-width: 480px) and (min-height: 541px) {
  body:not(.force-iphone-portrait):not(.force-iphone-landscape) .app-root {
    border-left: 1px solid var(--border-subtle);
    border-right: 1px solid var(--border-subtle);
  }
}

.fixture-banner {
  flex: 0 0 auto;
  background: var(--caution-bg);
  border-bottom: 1px solid var(--caution-border);
  color: var(--caution);
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 10px;
}

/* ==========================================================================
   TOP HEADER (Single Sleek 52pt Dynamic-Island-Aware Swipeable Bar)
   ========================================================================== */
.top-header {
  flex: 0 0 var(--header-h);
  height: var(--header-h);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.92);
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  z-index: 30;
}

.asset-swipe-zone {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px 0 12px;
  touch-action: pan-y;
}

.hdr-coin-btn {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 0 4px 0 0;
}

.hdr-coin-sym-wrap {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.hdr-coin-sym {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--titanium);
  line-height: 1;
}

.hdr-chevron {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hdr-price-stack {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.hdr-coin-price {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--titanium);
  white-space: nowrap;
}

.hdr-coin-chg {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.hdr-stance-btn {
  flex: 0 0 auto;
  height: 44px;
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  background-clip: padding-box;
  box-shadow: inset 0 0 0 1px var(--border-med);
  color: var(--titanium);
}

.hdr-stance-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.hdr-stance-dot.bull,
.hdr-stance-dot.tone-bull { background: var(--bull); }
.hdr-stance-dot.bear,
.hdr-stance-dot.tone-bear { background: var(--bear); }
.hdr-stance-dot.warn,
.hdr-stance-dot.caution,
.hdr-stance-dot.tone-warn { background: var(--caution); }
.hdr-stance-dot.info,
.hdr-stance-dot.tone-info { background: var(--cycle-80d); }

.hdr-stance-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--titanium);
  white-space: nowrap;
}

.hdr-edge-score {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.10);
  border-radius: 6px;
  padding: 1px 5px;
  line-height: 1.3;
}

.hdr-coin-dots {
  height: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding-bottom: 2px;
}

.coin-dot {
  width: 4px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.20);
  transition: width 200ms var(--spring-sheet), background-color 180ms ease;
}

.coin-dot.active {
  width: 14px;
  background: var(--titanium);
}

/* ==========================================================================
   MAIN TAB HOST & VIEWS
   ========================================================================== */
.tab-host {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: var(--bg-oled);
}

.tab-view {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-oled);
}

.tab-view.active {
  display: flex;
}

.tab-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: 12px 12px calc(var(--dock-h) + var(--safe-bottom) + 20px);
}

.view-inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ==========================================================================
   TAB 1: CHART (65-80% Full-Bleed OLED Canvas + Sub-Pane + Thumb Bar)
   ========================================================================== */
#view-chart {
  padding-bottom: calc(var(--dock-h) + var(--safe-bottom));
}

.chart-stage {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  background: var(--bg-oled);
  overflow: hidden;
}

#main-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* Non-Truncating 2-Line Floating HUD Overlay */
.chart-hud-overlay {
  position: absolute;
  top: 6px;
  left: 8px;
  right: 58px;
  z-index: 12;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.chart-hud-overlay:empty {
  display: none;
}

.hud-line,
.hud-ohlc-row,
.hud-overlay-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.hud-ohlc-row,
.hud-line-primary {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-primary);
}

.hud-overlay-row,
.hud-line-secondary {
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-secondary);
}

.hud-item,
.hud-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.hud-lbl {
  color: var(--text-muted);
  font-weight: 500;
}

.hud-val {
  font-family: var(--font-mono);
  color: var(--titanium);
  font-weight: 600;
}

.hud-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Floating Crosshair Loupe (Positioned 56pt above finger on long-press) */
.crosshair-loupe {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 30;
  pointer-events: none;
  min-width: 176px;
  max-width: 268px;
  padding: 8px 11px;
  border-radius: 14px;
  background: rgba(14, 16, 22, 0.92);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-active);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.80);
  color: var(--titanium);
  font-size: 11.5px;
  line-height: 1.35;
  will-change: transform, left, top;
}

.loupe-date {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.loupe-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.loupe-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
}

/* Turn Window Tap Tooltip */
.turn-tooltip {
  position: absolute;
  top: 52px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 28;
  width: min(300px, calc(100% - 24px));
  padding: 11px 13px;
  border-radius: 14px;
  background: rgba(14, 16, 22, 0.94);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-active);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.82);
  color: var(--titanium);
  font-size: 12px;
  line-height: 1.4;
}

.turn-tooltip-title {
  font-weight: 700;
  font-size: 12.5px;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.turn-tooltip-note {
  color: var(--text-secondary);
  font-size: 11.5px;
}

/* ==========================================================================
   GHOST TIME-MACHINE BAR (Only visible when Ghost active)
   ========================================================================== */
.ghost-bar {
  flex: 0 0 auto;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-med);
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ghost-bookmarks-row {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.ghost-bookmarks-row::-webkit-scrollbar {
  display: none;
}

.ghost-bm-chip {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.ghost-bm-chip.active {
  background: var(--titanium);
  border-color: var(--titanium);
  color: #000000;
  font-weight: 700;
}

.ghost-controls-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ghost-step-btn,
.ghost-close-btn {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-radius: 12px;
  background: var(--bg-elevated);
  background-clip: padding-box;
  box-shadow: inset 0 0 0 1px var(--border-subtle);
  color: var(--titanium);
  font-size: 16px;
  font-weight: 600;
}

.ghost-play-btn {
  flex: 0 0 auto;
  height: 44px;
  min-height: 44px;
  padding: 0 10px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-radius: 12px;
  background: var(--titanium);
  background-clip: padding-box;
  color: #000000;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.ghost-play-btn.playing {
  background: var(--bg-elevated-2);
  color: var(--titanium);
  box-shadow: inset 0 0 0 1px var(--border-active);
}

.ghost-slider {
  flex: 1 1 auto;
  min-width: 60px;
  height: 44px;
  margin: 0 2px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

.ghost-slider::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.18);
}

.ghost-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--titanium);
  border: 2px solid #000000;
  margin-top: -9px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.ghost-score-badge {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 7px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  white-space: nowrap;
}

.ghost-score-badge.hit,
.ghost-score-badge.tone-bull {
  background: var(--bull-bg);
  border-color: var(--bull-border);
  color: var(--bull);
}

.ghost-score-badge.miss,
.ghost-score-badge.tone-bear {
  background: var(--bear-bg);
  border-color: var(--bear-border);
  color: var(--bear);
}

.ghost-context-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 10.5px;
  color: var(--text-secondary);
}

.ghost-context-strip:empty {
  display: none;
}

/* ==========================================================================
   COLLAPSIBLE SUB-PANE DRAWER (146px expanded -> 30px collapsed pill bar)
   ========================================================================== */
.subpane-drawer {
  flex: 0 0 var(--subpane-h);
  height: var(--subpane-h);
  display: flex;
  flex-direction: column;
  background: #06070A;
  border-top: 1px solid var(--border-subtle);
  overflow: hidden;
  transition: flex-basis 240ms var(--spring-sheet), height 240ms var(--spring-sheet);
}

.subpane-drawer.collapsed {
  flex: 0 0 var(--subpane-collapsed-h);
  height: var(--subpane-collapsed-h);
}

.subpane-handle {
  flex: 0 0 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  background: var(--bg-surface);
  cursor: pointer;
  touch-action: none;
  position: relative;
}

.subpane-drawer.collapsed .subpane-handle {
  flex: 0 0 var(--subpane-collapsed-h);
  height: var(--subpane-collapsed-h);
  background: #0D1016;
}

.subpane-grabber {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 3px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.24);
}

.subpane-drawer.collapsed .subpane-grabber {
  display: none;
}

.subpane-status-mini {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 26px);
}

.subpane-drawer:not(.collapsed) .subpane-status-mini {
  opacity: 0;
  pointer-events: none;
}

.subpane-drawer.collapsed .subpane-status-mini {
  opacity: 1;
  color: var(--titanium);
}

.subpane-chevron {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  transition: transform 220ms var(--spring-sheet);
}

.subpane-drawer.collapsed .subpane-chevron {
  transform: rotate(180deg);
  stroke: var(--titanium);
}

.subpane-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.subpane-drawer.collapsed .subpane-body {
  display: none;
}

.subpane-tabs {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
  margin: 0 8px 3px;
  padding: 2px;
  border-radius: 9px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.sub-tab {
  height: 26px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 4px;
}

.sub-tab.active {
  background: var(--bg-elevated-2);
  color: var(--titanium);
  box-shadow: inset 0 0 0 1px var(--border-med);
}

.subpane-legend {
  flex: 0 0 16px;
  height: 16px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
  color: var(--text-secondary);
  overflow: hidden;
  white-space: nowrap;
}

.subpane-legend:empty {
  flex: 0 0 0;
  height: 0;
}

.subpane-legend-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.subpane-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.subpane-canvas-wrap {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  background: var(--bg-oled);
}

#subpane-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* ==========================================================================
   THUMB COMMAND BAR (46px tall above bottom dock, every tap target >= 44px!)
   ========================================================================== */
.thumb-command-bar {
  flex: 0 0 var(--tcb-h);
  height: var(--tcb-h);
  background: #080A0E;
  border-top: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
}

.tcb-scroll-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 12px 0 7px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  /* Gentle trailing edge fade mask so overflowing badges never hard-slice */
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 12px), transparent 100%);
  mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 12px), transparent 100%);
}

.tcb-scroll-inner::-webkit-scrollbar {
  display: none;
}

.tcb-btn {
  flex: 0 0 auto;
  height: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 8px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-radius: 14px;
  background: var(--bg-elevated);
  background-clip: padding-box;
  box-shadow: inset 0 0 0 1px var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.tcb-tf {
  min-width: 38px;
  padding: 0 8px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--titanium);
  background: rgba(245, 247, 250, 0.13);
  background-clip: padding-box;
  box-shadow: inset 0 0 0 1px var(--border-med);
}

.tcb-btn.active {
  background: var(--titanium-pill);
  background-clip: padding-box;
  box-shadow: inset 0 0 0 1px rgba(245, 247, 250, 0.34);
  color: var(--titanium);
}

.tcb-badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 5px;
  background: var(--titanium);
  color: #000000;
  line-height: 1.25;
}

.range-strip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 2px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-radius: 14px;
  background: var(--bg-surface);
  background-clip: padding-box;
  box-shadow: inset 0 0 0 1px var(--border-subtle);
}

.range-btn {
  flex: 0 0 auto;
  height: 44px;
  min-height: 44px;
  min-width: 28px;
  padding: 0 5px;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-radius: 12px;
  background: transparent;
  background-clip: padding-box;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}

.range-btn.active {
  background: var(--titanium);
  background-clip: padding-box;
  color: #000000;
}

.tcb-divider {
  flex: 0 0 1px;
  width: 1px;
  height: 18px;
  background: var(--border-subtle);
  margin: 0 2px;
}

/* ==========================================================================
   FROSTED-GLASS BOTTOM THUMB DOCK (iOS Native Tab Bar — Titanium Monochrome)
   ========================================================================== */
.bottom-dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  padding: 4px 8px calc(4px + var(--safe-bottom));
  background: var(--bg-glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-top: 1px solid rgba(255, 255, 255, 0.10);
}

.dock-btn {
  position: relative;
  flex: 1 1 0;
  min-height: 48px;
  min-width: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.dock-btn svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dock-btn.active {
  color: var(--titanium);
}

.dock-btn.active::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 2.5px;
  border-radius: var(--radius-pill);
  background: var(--titanium);
}

/* ==========================================================================
   SHARED OBSIDIAN CARDS, PILLS, BADGES, SWITCHES & ACCORDIONS
   ========================================================================== */
.obsidian-card,
.section-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 13px 14px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.card-title {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--titanium);
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
}

.pill,
.status-pill,
.metric-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  white-space: nowrap;
}

.pill.bull, .status-pill.bull, .pill.tone-bull, .status-pill.tone-bull {
  background: var(--bull-bg);
  border-color: var(--bull-border);
  color: var(--bull);
}

.pill.bear, .status-pill.bear, .pill.tone-bear, .status-pill.tone-bear {
  background: var(--bear-bg);
  border-color: var(--bear-border);
  color: var(--bear);
}

.pill.warn, .status-pill.warn, .pill.caution, .pill.tone-warn, .status-pill.tone-warn {
  background: var(--caution-bg);
  border-color: var(--caution-border);
  color: var(--caution);
}

.pill.info, .status-pill.info, .pill.tone-info {
  background: var(--cycle-80d-bg);
  border-color: var(--cycle-80d-border);
  color: var(--cycle-80d);
}

.pill.titanium, .status-pill.titanium {
  background: var(--titanium);
  border-color: var(--titanium);
  color: #000000;
  font-weight: 700;
}

/* Bespoke Apple Titanium iOS Switch */
.ios-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  min-height: 44px;
  cursor: pointer;
  flex-shrink: 0;
}

.ios-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.ios-switch-track {
  position: relative;
  width: 46px;
  height: 27px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: background-color 180ms ease, border-color 180ms ease;
}

.ios-switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--titanium);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  transition: transform 200ms var(--spring-sheet), background-color 180ms ease;
}

.ios-switch input:checked + .ios-switch-track,
.ios-switch.on .ios-switch-track {
  background: var(--switch-color, var(--titanium));
  border-color: var(--switch-color, var(--titanium));
}

.ios-switch input:checked + .ios-switch-track::after,
.ios-switch.on .ios-switch-track::after {
  transform: translateX(19px);
  background: #000000;
}

/* Clean Native Collapsible Accordions (<details>) */
details.ios-accordion,
#radar-detail-section details,
#view-audit details {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  overflow: hidden;
}

details.ios-accordion > summary,
#radar-detail-section details > summary,
#view-audit details > summary {
  list-style: none;
  min-height: 48px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--titanium);
  cursor: pointer;
  user-select: none;
}

details > summary::-webkit-details-marker {
  display: none;
}

details > summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 1.8px solid var(--text-muted);
  border-bottom: 1.8px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform 200ms var(--spring-sheet);
  flex-shrink: 0;
  margin-right: 2px;
}

details[open] > summary::after {
  transform: rotate(-135deg);
  border-color: var(--titanium);
}

.accordion-body {
  padding: 0 14px 14px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ==========================================================================
   TAB 2: RADAR (10-Second 5-Coin Morning Brief)
   ========================================================================== */
.radar-posture-strip {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.radar-posture-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.radar-posture-pills::-webkit-scrollbar {
  display: none;
}

.posture-pill {
  flex: 1 0 auto;
  min-height: 44px;
  padding: 7px 11px;
  border-radius: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  text-align: left;
}

.posture-pill.active {
  border-color: var(--border-active);
  background: var(--bg-elevated);
}

.posture-pill-lbl {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.posture-pill-val {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--titanium);
  white-space: nowrap;
}

.posture-detail-box {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-med);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.radar-ranked-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.radar-card {
  width: 100%;
  text-align: left;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  position: relative;
}

.radar-card.active,
.radar-card.selected {
  border-color: var(--border-active);
  background: var(--bg-elevated);
}

.radar-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.radar-pair-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.radar-rank {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.radar-card:first-child .radar-rank {
  background: var(--titanium);
  color: #000000;
}

.radar-pair {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--titanium);
}

.radar-price-col {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.radar-price {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--titanium);
}

.radar-chg {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
}

.radar-edge-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 9px;
  background: var(--bg-elevated-2);
  border: 1px solid var(--border-med);
  color: var(--titanium);
  flex-shrink: 0;
}

.radar-edge-badge.tone-bull {
  background: var(--bull-bg);
  border-color: var(--bull-border);
  color: var(--bull);
}

.radar-edge-badge.tone-warn {
  background: var(--caution-bg);
  border-color: var(--caution-border);
  color: var(--caution);
}

.radar-edge-badge.tone-bear {
  background: var(--bear-bg);
  border-color: var(--bear-border);
  color: var(--bear);
}

.radar-metrics-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.radar-trigger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-secondary);
}

.radar-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.radar-action-btn {
  flex: 1 1 0;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 11px;
  background: var(--bg-elevated-2);
  border: 1px solid var(--border-subtle);
  color: var(--titanium);
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.radar-action-btn.primary {
  background: var(--titanium);
  border-color: var(--titanium);
  color: #000000;
  font-weight: 700;
}

.radar-detail-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Key Levels Visual Horizontal Ladder */
.level-ladder {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.level-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.level-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.level-name {
  color: var(--text-secondary);
  font-weight: 600;
}

.level-vals {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.level-bar-track {
  height: 5px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.level-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--titanium);
}

.level-bar-fill.bull { background: var(--bull); }
.level-bar-fill.bear { background: var(--bear); }
.level-bar-fill.warn { background: var(--caution); }

/* Upcoming Turn Calendar Rows */
.turn-cal-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.turn-cal-row {
  width: 100%;
  min-height: 48px;
  padding: 9px 11px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
}

.turn-cal-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.turn-cal-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--titanium);
}

.turn-cal-meta {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ==========================================================================
   TAB 3: MACRO (Split-Pane Locked-Chart Liquidity & Bond Offset Studio)
   ========================================================================== */
#view-macro {
  height: 100%;
  overflow: hidden;
}

.macro-locked-top {
  flex: 0 0 42%;
  min-height: 248px;
  max-height: 46%;
  display: flex;
  flex-direction: column;
  background: var(--bg-oled);
  border-bottom: 1px solid var(--border-med);
  position: relative;
  z-index: 6;
}

.macro-top-bar {
  flex: 0 0 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px;
}

.macro-range-strip {
  display: inline-flex;
  align-items: center;
  height: 44px;
  gap: 1px;
  padding: 0 2px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-radius: 13px;
  background: var(--bg-surface);
  background-clip: padding-box;
  box-shadow: inset 0 0 0 1px var(--border-subtle);
}

.mrange-btn {
  min-width: 38px;
  height: 44px;
  min-height: 44px;
  padding: 0 8px;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-radius: 11px;
  background: transparent;
  background-clip: padding-box;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.mrange-btn.active {
  background: var(--titanium);
  background-clip: padding-box;
  color: #000000;
}

.macro-canvas-stage {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  background: var(--bg-oled);
  overflow: hidden;
}

#macro-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.macro-hud {
  position: absolute;
  top: 4px;
  left: 8px;
  right: 54px;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
}

.macro-hud:empty {
  display: none;
}

.macro-hud-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--titanium);
  white-space: nowrap;
}

.macro-plumbing-strip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 7px;
  overflow-x: auto;
  scrollbar-width: none;
  background: #06070A;
  border-top: 1px solid var(--border-subtle);
}

.macro-plumbing-strip::-webkit-scrollbar {
  display: none;
}

.plumbing-pill {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.plumbing-pill.tone-warn {
  background: var(--caution-bg);
  border-color: var(--caution-border);
  color: var(--caution);
}

.plumbing-pill.tone-bull {
  background: var(--bull-bg);
  border-color: var(--bull-border);
  color: var(--bull);
}

.plumbing-pill.tone-bear {
  background: var(--bear-bg);
  border-color: var(--bear-border);
  color: var(--bear);
}

.macro-scroll-bottom {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: 10px 12px calc(var(--dock-h) + var(--safe-bottom) + 20px);
}

.macro-series-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Clean Obsidian Macro Card with Subtle 3px Left Accent Bar (Zero Neon Box) */
.macro-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--series-color, var(--titanium));
  border-radius: 14px;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.macro-card.focused,
.macro-card.active {
  background: var(--bg-elevated);
  border-color: var(--border-med);
  border-left-color: var(--series-color, var(--titanium));
}

.macro-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.macro-card-title-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.macro-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--titanium);
  letter-spacing: -0.015em;
}

.macro-card-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.macro-card-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 8px 9px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid var(--border-subtle);
}

.macro-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.macro-metric-lbl {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.macro-metric-val {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--titanium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.macro-card-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

/* Every button in #macro-series-cards strictly >= 44px height */
#macro-series-cards button,
.macro-btn {
  min-height: 44px;
  padding: 0 8px;
  border-radius: 11px;
  background: var(--bg-elevated-2);
  border: 1px solid var(--border-subtle);
  color: var(--titanium);
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}

#macro-series-cards button.primary,
.macro-btn.primary {
  background: var(--titanium);
  border-color: var(--titanium);
  color: #000000;
  font-weight: 700;
}

#macro-series-cards button.pinned,
.macro-btn.pinned {
  background: var(--titanium-pill);
  border-color: var(--border-active);
  color: var(--titanium);
}

/* ==========================================================================
   TAB 4: AUDIT (Honest Backtest Proof & Stacked Mobile Cards — ZERO Tables)
   ========================================================================== */
.audit-verified-hero,
.audit-ablation-cards,
.audit-scorecard-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.audit-summary-bar {
  display: flex;
  height: 7px;
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: var(--bg-elevated-2);
  gap: 2px;
  margin: 8px 0;
}

.audit-bar-verified { background: var(--bull); }
.audit-bar-exploratory { background: var(--caution); }
.audit-bar-failed { background: rgba(255, 69, 96, 0.45); }

.audit-counts-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.audit-count-tile {
  padding: 9px 10px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.audit-count-num {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
}

.verified-edge-card,
.ghost-proof-card,
.ablation-card,
.scorecard-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.verified-edge-card {
  border-left: 3px solid var(--bull);
}

.ghost-proof-card {
  width: 100%;
  min-height: 56px;
  text-align: left;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ghost-proof-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.ghost-proof-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--titanium);
}

.ghost-proof-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

.ablation-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ablation-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
}

.ablation-row-label {
  color: var(--text-secondary);
  font-weight: 600;
}

.ablation-row-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--titanium);
  text-align: right;
}

.audit-scorecard-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.audit-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.audit-search-icon {
  position: absolute;
  left: 13px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  pointer-events: none;
}

.audit-search {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px 10px 38px;
  border-radius: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-med);
  color: var(--titanium);
  font-size: 16px;
  outline: none;
}

.audit-search::placeholder {
  color: var(--text-muted);
}

.audit-search:focus {
  border-color: var(--titanium);
  background: var(--bg-elevated);
}

.audit-filter-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.audit-filter-btn {
  min-height: 44px;
  border-radius: 11px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 0 6px;
}

.audit-filter-btn.active {
  background: var(--titanium);
  border-color: var(--titanium);
  color: #000000;
  font-weight: 700;
}

.scorecard-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.scorecard-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--titanium);
  line-height: 1.3;
}

.scorecard-id {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
}

.scorecard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 7px 9px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid var(--border-subtle);
}

.scorecard-note {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ==========================================================================
   DRAGGABLE MULTI-DETENT iOS SPRING BOTTOM SHEET
   ========================================================================== */
.spring-sheet-scrim {
  position: absolute;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, 0.56);
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
}

.spring-sheet-scrim.open {
  opacity: 1;
  pointer-events: auto;
}

.spring-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  max-height: 85%;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  background: rgba(14, 16, 22, 0.90);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  backdrop-filter: blur(26px) saturate(170%);
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.84);
  transform: translateY(105%);
  transition: transform 340ms var(--spring-sheet);
  padding-bottom: var(--safe-bottom);
  will-change: transform;
}

.spring-sheet.open {
  transform: translateY(0);
}

.spring-sheet.dragging {
  transition: none !important;
}

.spring-sheet.sheet-compact {
  max-height: 62%;
}

.sheet-drag-handle {
  flex: 0 0 auto;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  cursor: grab;
}

.sheet-drag-handle:active {
  cursor: grabbing;
}

.sheet-grabber-pill {
  width: 38px;
  height: 4.5px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.28);
}

.sheet-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px 10px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.sheet-title-group {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sheet-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--titanium);
}

.sheet-subtitle {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.sheet-subtitle:empty {
  display: none;
}

.sheet-close-btn {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-pill);
  border: 6px solid transparent;
  background: rgba(255, 255, 255, 0.10);
  background-clip: padding-box;
  color: var(--titanium);
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: 14px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: none;
}

.sheet-body > * {
  flex-shrink: 0;
}

/* Pure Native Invisible iOS Scrollbars + Crisp Macro .tme-switch Pill Toggle */
.tab-view,
#macro-scroll-bottom,
.sheet-chip-row,
.ruler-series-row,
.range-strip,
.ghost-bookmarks-row,
body {
  scrollbar-width: none;
}

*::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.tme-switch {
  position: relative;
  width: 46px;
  height: 27px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.16);
  flex-shrink: 0;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease;
}

.tme-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--titanium);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  transition: transform 200ms var(--spring-sheet), background-color 180ms ease;
}

.tme-switch[aria-checked="true"] {
  background: var(--titanium);
  border-color: var(--titanium);
}

.tme-switch[aria-checked="true"]::after {
  transform: translateX(19px);
  background: #000000;
}

body.force-iphone-landscape #chart-stage {
  padding-bottom: 12px;
}

/* Sheet Groups, Toggle Rows, Chips & Coin Picker (All >= 44px) */
.sheet-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sheet-group-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-left: 2px;
}

.sheet-list {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  overflow: hidden;
}

.sheet-toggle-row,
.sheet-row-btn {
  width: 100%;
  min-height: 48px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.sheet-toggle-row:last-child,
.sheet-row-btn:last-child {
  border-bottom: 0;
}

.sheet-row-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sheet-row-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--titanium);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.sheet-row-desc {
  font-size: 11px;
  color: var(--text-muted);
}

.sheet-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.sheet-chip,
#spring-sheet .sheet-btn {
  min-height: 44px;
  padding: 0 13px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.sheet-chip.active,
#spring-sheet .sheet-btn.primary {
  background: var(--titanium);
  border-color: var(--titanium);
  color: #000000;
  font-weight: 700;
}

.coin-picker-row {
  width: 100%;
  min-height: 58px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.coin-picker-row:last-child {
  border-bottom: 0;
}

.coin-picker-row.active {
  background: var(--titanium-soft);
}

/* Trade Plan & Levels Sheet 3-Axis Cards */
.plan-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plan-kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.plan-kv {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.edge-bar-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.edge-bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.edge-bar-track {
  height: 5px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.edge-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--titanium);
}

.plan-note {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.45;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
}

/* ==========================================================================
   APPLE-CAMERA TACTILE OFFSET RULER DIAL SHEET
   ========================================================================== */
.ruler-series-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.ruler-series-strip::-webkit-scrollbar {
  display: none;
}

.ruler-series-chip {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.ruler-series-chip.active {
  background: var(--titanium-pill);
  border-color: var(--titanium);
  color: var(--titanium);
  font-weight: 700;
}

.ruler-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.ruler-stat-box {
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ruler-stat-val {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--titanium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ruler-heatmap-box {
  background: #060709;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 8px 10px 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ruler-heatmap-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#ruler-heatmap-canvas {
  display: block;
  width: 100%;
  height: 64px;
}

/* Tactile Horizontal Apple-Camera Dial */
#ruler-dial-wrap,
.ruler-dial-wrap {
  position: relative;
  height: 68px;
  border-radius: 16px;
  background: linear-gradient(180deg, #07080B 0%, #10131A 52%, #07080B 100%);
  border: 1px solid var(--border-med);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  cursor: grab;
}

#ruler-dial-wrap:active,
.ruler-dial-wrap:active {
  cursor: grabbing;
}

#ruler-dial-wrap::before,
.ruler-dial-wrap::before,
#ruler-dial-wrap::after,
.ruler-dial-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 52px;
  z-index: 4;
  pointer-events: none;
}

#ruler-dial-wrap::before,
.ruler-dial-wrap::before {
  left: 0;
  background: linear-gradient(90deg, #07080B 10%, transparent 100%);
}

#ruler-dial-wrap::after,
.ruler-dial-wrap::after {
  right: 0;
  background: linear-gradient(270deg, #07080B 10%, transparent 100%);
}

.ruler-needle,
.ruler-center-needle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  background: var(--titanium);
  z-index: 6;
  pointer-events: none;
}

.ruler-needle::before,
.ruler-center-needle::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--titanium);
}

#ruler-track,
.ruler-track {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  will-change: transform;
  pointer-events: none;
}

.ruler-tick {
  position: absolute;
  bottom: 8px;
  width: 1px;
  height: 11px;
  background: rgba(255, 255, 255, 0.22);
}

.ruler-tick.med,
.ruler-tick-med {
  height: 18px;
  background: rgba(255, 255, 255, 0.42);
}

.ruler-tick.major,
.ruler-tick-major {
  width: 1.5px;
  height: 26px;
  background: rgba(245, 247, 250, 0.78);
}

.ruler-tick.peak,
.ruler-tick-peak {
  width: 2px;
  height: 30px;
  background: var(--bull);
}

.ruler-tick.preset,
.ruler-tick-preset {
  width: 1.5px;
  height: 22px;
  background: var(--caution);
}

.ruler-tick-label {
  position: absolute;
  top: 9px;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Direct 16px Numeric Input + Step Buttons + Snap Peak */
.ruler-stepper-row {
  display: grid;
  grid-template-columns: 48px 44px 1fr 44px 48px;
  gap: 6px;
  align-items: center;
}

.ruler-step-btn {
  height: 44px;
  min-height: 44px;
  min-width: 44px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-med);
  color: var(--titanium);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#ruler-num-input,
.ruler-num-input {
  width: 100%;
  height: 44px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 12px;
  background: #060709;
  border: 1px solid var(--border-active);
  color: var(--titanium);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
}

#ruler-num-input::-webkit-inner-spin-button,
#ruler-num-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#ruler-num-input:focus {
  border-color: var(--titanium);
}

.ruler-snap-btn {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--titanium);
  color: #000000;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.ruler-presets-row {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.ruler-presets-row::-webkit-scrollbar {
  display: none;
}

.ruler-preset-btn,
.ruler-preset-chip {
  flex: 1 0 auto;
  min-height: 44px;
  min-width: 48px;
  padding: 0 10px;
  border-radius: 11px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.ruler-preset-btn.active,
.ruler-preset-chip.active {
  background: var(--titanium-pill);
  border-color: var(--titanium);
  color: var(--titanium);
}

/* Radar Translation, Options, Positioning & Sheet Segmented Controls */
.translation-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.cycle-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cycle-bar-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cycle-bar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.cycle-bar-track {
  position: relative;
  height: 6px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.cycle-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--cycle-80d);
}

.cycle-bar-fill.left-trans { background: var(--bear); }
.cycle-bar-fill.right-trans { background: var(--bull); }

.options-wall-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.options-wall-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.term-grid,
.positioning-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.term-chip,
.pos-stat {
  padding: 8px 10px;
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.whale-alarm-banner {
  padding: 9px 11px;
  border-radius: 11px;
  background: var(--bear-bg);
  border: 1px solid var(--bear-border);
  color: var(--bear);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.sheet-seg-group {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
  padding: 3px;
  border-radius: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.sheet-seg-btn {
  min-height: 44px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.sheet-seg-btn.active {
  background: var(--titanium);
  color: #000000;
  font-weight: 700;
}

.info-footnote {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.45;
}

.empty-state {
  padding: 20px 14px;
  text-align: center;
  border-radius: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 12.5px;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Hover States Strictly Guarded for Pointer Devices (Zero Sticky iOS Hover) */
@media (hover: hover) {
  .tcb-btn:hover:not(.active),
  .radar-card:hover,
  .turn-cal-row:hover,
  .ghost-proof-card:hover,
  .ruler-step-btn:hover,
  .sheet-chip:hover:not(.active) {
    border-color: var(--border-active);
  }
}

/* ==========================================================================
   TRUE PRO LANDSCAPE MODE (956 x 440 Widescreen · >85% OLED Chart Area!)
   Shared rules for real iPhone Landscape + body.force-iphone-landscape
   ========================================================================== */
body.force-iphone-landscape {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
}

body.force-iphone-landscape .app-root {
  max-width: 956px;
  width: 100%;
  height: min(440px, 100dvh);
  padding-top: 0;
  border: none;
}

body.force-iphone-landscape .top-header {
  position: absolute;
  top: 6px;
  left: calc(58px + var(--safe-left));
  width: auto;
  max-width: calc(100% - 124px - var(--safe-left) - var(--safe-right));
  height: 44px;
  flex: none;
  border-radius: var(--radius-pill);
  background: var(--bg-glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-med);
}

body.force-iphone-landscape .asset-swipe-zone {
  height: 44px;
  padding: 0 6px 0 12px;
  gap: 8px;
}

body.force-iphone-landscape .hdr-coin-dots {
  display: none;
}

body.force-iphone-landscape .hdr-coin-btn,
body.force-iphone-landscape .hdr-stance-btn {
  min-height: 44px;
  height: 44px;
}

body.force-iphone-landscape .hdr-stance-btn {
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

body.force-iphone-landscape #view-chart {
  padding: 0 calc(58px + var(--safe-right)) 0 calc(56px + var(--safe-left));
}

body.force-iphone-landscape #chart-hud-overlay {
  top: 54px;
  left: 6px;
}

body.force-iphone-landscape #subpane-drawer {
  display: none;
}

/* Left Ultra-Slim Floating Glass Navigation Rail */
body.force-iphone-landscape #bottom-dock {
  top: 50%;
  left: max(6px, var(--safe-left));
  right: auto;
  bottom: auto;
  transform: translateY(-50%);
  width: 46px;
  padding: 5px 2px;
  flex-direction: column;
  gap: 2px;
  border-radius: 22px;
  border: 1px solid var(--border-med);
}

body.force-iphone-landscape .dock-btn {
  min-height: 44px;
  min-width: 42px;
  gap: 1px;
  font-size: 9px;
}

body.force-iphone-landscape .dock-btn svg {
  width: 18px;
  height: 18px;
}

body.force-iphone-landscape .dock-btn.active::before {
  top: 50%;
  left: -2px;
  transform: translateY(-50%);
  width: 2.5px;
  height: 20px;
}

/* Right Ultra-Slim Floating Glass Chart Controls Rail */
body.force-iphone-landscape #thumb-command-bar {
  position: absolute;
  top: 50%;
  right: max(6px, var(--safe-right));
  transform: translateY(-50%);
  width: 50px;
  height: auto;
  max-height: calc(100% - 14px);
  border-radius: 22px;
  border: 1px solid var(--border-med);
  background: var(--bg-glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  z-index: 35;
}

body.force-iphone-landscape .tcb-scroll-inner {
  flex-direction: column;
  padding: 5px 2px;
  gap: 2px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-mask-image: none;
  mask-image: none;
}

body.force-iphone-landscape .tcb-btn {
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0 2px;
  font-size: 9.5px;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}

body.force-iphone-landscape .range-strip,
body.force-iphone-landscape .tcb-divider {
  display: none;
}

body.force-iphone-landscape .tab-scroll {
  padding: 52px calc(14px + var(--safe-right)) 14px calc(62px + var(--safe-left));
}

body.force-iphone-landscape #view-macro {
  flex-direction: row;
  padding: 50px calc(10px + var(--safe-right)) 8px calc(60px + var(--safe-left));
  gap: 10px;
}

body.force-iphone-landscape #macro-locked-top {
  flex: 0 0 56%;
  max-height: none;
  min-height: 0;
  height: 100%;
  border-bottom: 0;
  border-right: 1px solid var(--border-subtle);
  padding-right: 8px;
}

body.force-iphone-landscape #macro-scroll-bottom {
  padding: 0 2px 10px;
}

body.force-iphone-landscape .spring-sheet {
  left: 50%;
  right: auto;
  width: min(500px, calc(100% - 120px));
  max-height: 92%;
  transform: translate(-50%, 105%);
}

body.force-iphone-landscape .spring-sheet.open {
  transform: translate(-50%, 0);
}

/* Native Hardware Orientation Landscape Media Query (Real iPhone 17 Pro Max 956x440) */
@media (orientation: landscape) and (max-height: 540px) {
  .app-root {
    max-width: none;
    width: 100%;
    height: 100%;
    height: 100dvh;
    padding-top: 0;
    border: none;
  }

  .top-header {
    position: absolute;
    top: 6px;
    left: calc(58px + var(--safe-left));
    width: auto;
    max-width: calc(100% - 124px - var(--safe-left) - var(--safe-right));
    height: 44px;
    flex: none;
    border-radius: var(--radius-pill);
    background: var(--bg-glass);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-med);
  }

  .asset-swipe-zone {
    height: 44px;
    padding: 0 6px 0 12px;
    gap: 8px;
  }

  .hdr-coin-dots { display: none; }

  .hdr-coin-btn,
  .hdr-stance-btn {
    min-height: 44px;
    height: 44px;
  }

  .hdr-stance-btn {
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
  }

  #view-chart {
    padding: 0 calc(58px + var(--safe-right)) 0 calc(56px + var(--safe-left));
  }

  #chart-hud-overlay {
    top: 54px;
    left: 6px;
  }

  #subpane-drawer { display: none; }

  #bottom-dock {
    top: 50%;
    left: max(6px, var(--safe-left));
    right: auto;
    bottom: auto;
    transform: translateY(-50%);
    width: 46px;
    padding: 5px 2px;
    flex-direction: column;
    gap: 2px;
    border-radius: 22px;
    border: 1px solid var(--border-med);
  }

  .dock-btn {
    min-height: 44px;
    min-width: 42px;
    gap: 1px;
    font-size: 9px;
  }

  .dock-btn svg {
    width: 18px;
    height: 18px;
  }

  .dock-btn.active::before {
    top: 50%;
    left: -2px;
    transform: translateY(-50%);
    width: 2.5px;
    height: 20px;
  }

  #thumb-command-bar {
    position: absolute;
    top: 50%;
    right: max(6px, var(--safe-right));
    transform: translateY(-50%);
    width: 50px;
    height: auto;
    max-height: calc(100% - 14px);
    border-radius: 22px;
    border: 1px solid var(--border-med);
    background: var(--bg-glass);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    z-index: 35;
  }

  .tcb-scroll-inner {
    flex-direction: column;
    padding: 5px 2px;
    gap: 2px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .tcb-btn {
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0 2px;
    font-size: 9.5px;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
  }

  .range-strip,
  .tcb-divider { display: none; }

  .tab-scroll {
    padding: 52px calc(14px + var(--safe-right)) 14px calc(62px + var(--safe-left));
  }

  #view-macro {
    flex-direction: row;
    padding: 50px calc(10px + var(--safe-right)) 8px calc(60px + var(--safe-left));
    gap: 10px;
  }

  #macro-locked-top {
    flex: 0 0 56%;
    max-height: none;
    min-height: 0;
    height: 100%;
    border-bottom: 0;
    border-right: 1px solid var(--border-subtle);
    padding-right: 8px;
  }

  #macro-scroll-bottom {
    padding: 0 2px 10px;
  }

  .spring-sheet {
    left: 50%;
    right: auto;
    width: min(500px, calc(100% - 120px));
    max-height: 92%;
    transform: translate(-50%, 105%);
  }

  .spring-sheet.open {
    transform: translate(-50%, 0);
  }
}
