/* src/css/globe-redesign.css — loaded always, only active when redesign flag is on */
#redesignShell { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
#redesignShell > * { pointer-events: auto; }

/* When redesign is active, hide legacy chrome */
body.redesign-on .sior-header,
body.redesign-on #marketPanel,
body.redesign-on .sior-globe-controls { display: none !important; }
body.redesign-on .sior-section-globe { padding: 0; }

.rd-header {
  position: fixed; top: 0; left: 0; right: 0; height: 56px;
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
  background: rgba(13, 22, 32, 0.85); backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: #e7eef7; font-family: 'Open Sans', sans-serif;
  z-index: 60;
}
.rd-brand { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.rd-brand-divider { opacity: .3; }
.rd-search-pill {
  flex: 0 1 360px; display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px; padding: 8px 14px; color: #9bb0c8;
  cursor: pointer; transition: background .15s, border-color .15s;
  /* MOBILE-1 touch-target floor (44×44 CSS px, Apple HIG). */
  min-height: 44px;
}
.rd-search-pill:hover { background: rgba(255,255,255,0.1); border-color: rgba(0, 169, 230, .5); /* SIOR cyan */ }
.rd-search-pill .material-icons { font-size: 18px; color: #64ccc9; /* not a SIOR brand token — ARBITRARY (legacy mint accent) */ }
.rd-search-placeholder { flex: 1; text-align: left; font-size: 13px; }
.rd-kbd {
  font-family: monospace; font-size: 11px;
  background: rgba(255,255,255,0.08); padding: 2px 6px; border-radius: 4px;
}
.rd-header-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.rd-tour-btn, .rd-login-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 6px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent;
  /* MOBILE-1 touch-target floor (44×44 CSS px, Apple HIG). */
  min-height: 44px;
  min-width: 44px;
}
.rd-tour-btn { background: transparent; color: #e7eef7; border-color: rgba(255,255,255,0.15); }
.rd-tour-btn:hover { background: rgba(255,255,255,0.06); }
.rd-login-btn { background: var(--sior-cyan); color: #fff; }
.rd-login-btn:hover { background: var(--sior-blue); /* SIOR blue link colour as hover state */ }
.rd-tour-btn .material-icons, .rd-login-btn .material-icons { font-size: 16px; }

/* ========================================================================
   Market Card (Phase 3)
   ======================================================================== */
.rd-market-card {
  position: fixed; right: 24px; top: 50%; transform: translateY(-50%);
  width: 320px; max-width: calc(100vw - 48px);
  background: rgba(15, 34, 56, 0.92); backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 169, 230, 0.3); /* SIOR cyan border */ border-radius: 12px;
  padding: 16px; color: #e7eef7;
  box-shadow: 0 12px 48px rgba(0,0,0,0.5);
  font-family: 'Open Sans', sans-serif;
  animation: rd-card-in .25s ease-out;
  z-index: 60;
}
@keyframes rd-card-in { from { opacity: 0; transform: translate(8px, -50%); } to { opacity: 1; transform: translate(0, -50%); } }
.rd-mc-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; gap: 8px; }
.rd-mc-title { margin: 0; font-size: 18px; color: #fff; }
.rd-mc-sub { margin: 2px 0 0; font-size: 12px; color: #9bb0c8; }
.rd-mc-actions { display: flex; gap: 6px; }
.rd-mc-chip {
  background: transparent; border: 1px solid rgba(100, 204, 201, .5); color: #64ccc9;
  border-radius: 999px; padding: 4px 10px; font-size: 11px; cursor: pointer;
}
.rd-mc-chip[aria-pressed="true"] { background: rgba(100, 204, 201, .15); }
.rd-mc-close {
  background: transparent; border: none; color: #9bb0c8;
  font-size: 22px; cursor: pointer; line-height: 1;
  /* MOBILE-1 touch-target floor (44×44 CSS px). The visual glyph stays small
   * but the tap area is comfortable. */
  min-width: 44px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
}
.rd-mc-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.rd-mc-metric { background: rgba(10, 22, 40, .5); padding: 8px; border-radius: 6px; text-align: center; }
.rd-mc-metric span { display: block; font-size: 10px; color: #9bb0c8; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.rd-mc-metric b { font-size: 15px; color: #fff; }
.rd-mc-cta {
  width: 100%; background: #64ccc9; color: #0a1628;
  border: none; border-radius: 6px; padding: 10px;
  font-size: 13px; font-weight: 700; cursor: pointer;
  /* MOBILE-1 touch-target floor. */
  min-height: 44px;
}
.rd-mc-cta:hover { background: #4cb5b1; }

/* ========================================================================
   Compare Chip Rail (Phase 3)
   ======================================================================== */
.rd-rail {
  position: fixed; bottom: 20px; left: 20px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: rgba(15, 34, 56, 0.85); backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 999px;
  padding: 8px 14px; font-family: 'Open Sans', sans-serif; color: #e7eef7;
  max-width: calc(100vw - 360px);
  z-index: 56;
}
.rd-rail-empty { opacity: .85; }
.rd-rail-label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: #9bb0c8; }
.rd-rail-prompt { font-size: 12px; color: #9bb0c8; }
.rd-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(100,204,201,.15); border: 1px solid rgba(100,204,201,.4);
  color: #64ccc9; font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px;
}
.rd-chip button { background: none; border: none; color: inherit; cursor: pointer; padding: 0 0 0 4px; font-size: 11px; }
.rd-rail-cta {
  background: #64ccc9; color: #0a1628; border: none; border-radius: 999px;
  padding: 6px 14px; font-size: 12px; font-weight: 700; cursor: pointer; margin-left: 4px;
}
.rd-rail-cta:hover { background: #4cb5b1; }

/* Search palette (⌘K) */
.rd-palette-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 70; }
.rd-palette {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%);
  width: min(560px, calc(100vw - 32px));
  background: rgba(15, 34, 56, 0.98); backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 169, 230, .4); /* SIOR cyan border */ border-radius: 12px;
  padding: 16px; z-index: 80;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  font-family: 'Open Sans', sans-serif; color: #e7eef7;
}

/* MOBILE-1: at ≤480px, the palette becomes a near-full-width sheet (≥95%
 * of viewport) so the input has room to breathe and result items are
 * thumb-reachable. */
@media (max-width: 480px) {
  .rd-palette {
    /* 95vw min — width-min calc keeps the rule intact at 320px viewports. */
    width: calc(100vw - 16px);
    top: 64px;
  }
  .rd-result {
    /* Touch-target floor: each result row tappable. */
    min-height: 44px;
  }
  .rd-intent {
    min-height: 44px;
    /* Pad horizontally so they remain visually distinct on small screens. */
    padding: 8px 14px;
  }
}
.rd-palette-input {
  width: 100%; background: rgba(10,22,40,.6); border: 1px solid rgba(255,255,255,.1);
  color: #fff; font-size: 16px; padding: 12px 14px; border-radius: 8px;
  margin-bottom: 12px; outline: none;
}
.rd-palette-input:focus { border-color: #64ccc9; }
.rd-palette-intents { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.rd-intent {
  background: transparent; border: 1px solid rgba(255,255,255,.15); color: #9bb0c8;
  border-radius: 999px; padding: 5px 12px; font-size: 12px; cursor: pointer;
}
.rd-intent.active { background: rgba(100,204,201,.18); border-color: #64ccc9; color: #64ccc9; }
.rd-palette-results { max-height: 360px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.rd-result {
  display: flex; justify-content: space-between; align-items: baseline;
  background: transparent; border: none; color: #e7eef7;
  padding: 10px 12px; border-radius: 6px; cursor: pointer; text-align: left;
  width: 100%;
}
.rd-result:hover { background: rgba(100,204,201,.12); }
.rd-result-name { font-weight: 600; }
.rd-result-country { font-size: 12px; color: #9bb0c8; }

/* Phase 5: Metric chips for column metric switching */
.rd-metric-chips {
  position: fixed;
  top: 72px;
  right: 24px;
  display: flex;
  gap: 6px;
  z-index: 55;
}
.rd-metric-chip {
  background: rgba(15, 34, 56, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #9bb0c8;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11px;
  cursor: pointer;
  font-family: 'Open Sans', sans-serif;
}
.rd-metric-chip.active {
  background: rgba(100, 204, 201, 0.18);
  border-color: #64ccc9;
  color: #64ccc9;
}

/* ----------------------------------------------------------------------
 * MOBILE-1 (Phase 4): responsive baseline.
 *
 * Breakpoints (locked, see brand-tokens.css):
 *   ≤480px  → small phone
 *   ≤768px  → large phone / tablet portrait
 *
 * Mobile-sheet trigger: ≤768px (was ≤414px in the original Phase 7 work,
 * but anything below tablet-landscape benefits from the bottom-sheet UX).
 *
 * Touch-target rule: every interactive element ≥44×44 CSS px at every
 * breakpoint. Achieved by `min-width`/`min-height` on the affected
 * selectors below.
 * ---------------------------------------------------------------------- */
@media (max-width: 768px) {
  .rd-header {
    /* Tighten padding so the header fits 360–414px viewports without
       horizontal overflow. The pill collapses below; tour-btn collapses
       below 480; settings + login stay visible at all sizes. */
    padding: 0 12px;
    gap: 8px;
  }
  .rd-search-pill { display: none; }
  /* Hide the desktop right-anchored card; its data is rendered in the
     bottom sheet instead (mounted via mobile-sheet.js). */
  .rd-market-card { display: none; }
  .rd-rail {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: none;
  }
  .rd-metric-chips { top: 64px; right: 12px; }
}

/* ≤480px (small phone): tighter still + chip rail becomes horizontal-scroll. */
@media (max-width: 480px) {
  .rd-tour-btn { display: none; }
  .rd-rail {
    /* Horizontal scroll with momentum on iOS — chips do not wrap so the
       user discovers more by scrolling, not by reflowing the rail. */
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    /* Allow chips to extend past the right edge (clipped by overflow:auto). */
    max-width: calc(100vw - 24px);
  }
  .rd-rail .rd-chip { flex: 0 0 auto; white-space: nowrap; }
  .rd-rail-cta { flex: 0 0 auto; white-space: nowrap; }
}

.rd-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 34, 56, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px 20px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  transform: translateY(calc(100% - 56px));
  transition: transform 0.25s ease-out;
  z-index: 65;
  padding: 12px 16px 24px;
  display: none;
}
/* MOBILE-1: sheet activates at ≤768px (was 414 — large phones / tablet
 * portrait benefit from the bottom-sheet UX too). */
@media (max-width: 768px) {
  .rd-sheet { display: block; }
}
.rd-sheet.open { transform: translateY(0); }
.rd-sheet-handle {
  display: block;
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 2px;
  margin: 0 auto 12px;
  padding: 0;
  cursor: pointer;
}
.rd-sheet-body { color: #e7eef7; }
.rd-sheet-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.rd-sheet-name { font-weight: 600; font-size: 16px; }
.rd-sheet-meta { font-size: 11px; color: #9bb0c8; }
.rd-sheet-cta {
  width: 100%;
  background: #64ccc9;
  color: #0a1628;
  border: none;
  padding: 10px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
