/* Roundhouse wireframe additions — sits on top of tokens.css + app.css */

/* ---- Phone artboard chrome ----
   The DesignCanvas artboards have their own header chrome (label/grip).
   Inside, we put a self-contained "phone" — obsidian rectangle with a
   subtle iOS status bar at the top, a screen scroll region, and a bottom
   nav. Sized 360×780 for the canvas. */

.rh-phone {
  width: 360px;
  height: 780px;
  background: var(--rh-obsidian);
  border: 1px solid var(--rh-obsidian-500);
  border-radius: 28px;
  overflow: hidden;
  position: relative;
  box-shadow:
    0 30px 60px rgba(0,0,0,0.55),
    0 0 0 6px #07070a,
    inset 0 0 0 1px rgba(184,154,86,0.05);
  display: flex;
  flex-direction: column;
}

.rh-phone .ios-bar {
  height: 36px;
  flex: 0 0 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 22px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-1);
  letter-spacing: 0.02em;
  background: var(--rh-obsidian);
  position: relative;
  z-index: 4;
}
.rh-phone .ios-bar .right { display:flex; gap: 5px; align-items:center; opacity:0.85; }
.rh-phone .ios-bar svg { display:block; }

.rh-phone .screen-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--rh-obsidian);
  position: relative;
  scrollbar-width: none;
}
.rh-phone .screen-body::-webkit-scrollbar { display:none; }

/* Override existing .topbar to be relative within the phone */
.rh-phone .topbar { position: sticky; top: 0; z-index: 5; padding: 12px 16px 10px; }
.rh-phone .topbar-logo img { height: 22px; }
.rh-phone .topbar-name { font-size: 16px; }
.rh-phone .icon-btn { width: 32px; height: 32px; }

/* Tighter screen padding for the smaller 360px frame */
.rh-phone .screen { padding: 10px 14px 92px; }
.rh-phone .hero-title { font-size: 40px; line-height: 0.95; }
.rh-phone .bottom-tabs { height: 68px; padding-bottom: 8px; padding-top: 8px; }
.rh-phone .bottom-tabs .tab { font-size: 10px; gap: 3px; letter-spacing: 0.14em; }
.rh-phone .bottom-tabs .tab svg { width: 20px; height: 20px; }

/* ---- Wireframe-y helpers ---- */

/* Dashed placeholder box for "imagery goes here" / data-viz stubs */
.wire-ph {
  border: 1px dashed var(--rh-brass-tint-32);
  background:
    repeating-linear-gradient(135deg,
      rgba(184,154,86,0.04) 0 6px,
      transparent 6px 14px);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--rh-brass-400);
  text-transform: uppercase;
  font-weight: 600;
  padding: 8px;
  text-align: center;
}

/* Faint placeholder for "firearm illustration / photo" */
.wire-firearm {
  height: 88px;
  border: 1px dashed var(--rh-brass-tint-32);
  background: var(--rh-obsidian-800);
  border-radius: 2px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wire-firearm::before {
  /* simplified silhouette: barrel + grip block */
  content: '';
  position: absolute;
  left: 18%; right: 18%;
  top: 44%; height: 8px;
  background: var(--rh-brass-tint-32);
  border-radius: 1px;
}
.wire-firearm::after {
  content: '';
  position: absolute;
  left: 24%; width: 16%;
  top: 52%; height: 22px;
  background: var(--rh-brass-tint-32);
  border-radius: 1px;
}

/* A simple horizontal "fuel bar" — re-used for caliber stockpile / par level */
.par-bar {
  position: relative;
  height: 10px;
  background: var(--rh-obsidian-500);
  border-radius: 1px;
  overflow: visible;
}
.par-bar .fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--rh-brass);
  border-radius: 1px;
}
.par-bar .fill.low { background: #C77A3B; }
.par-bar .fill.crit { background: var(--rh-dusty-red); }
.par-bar .par-mark {
  position: absolute;
  top: -3px; bottom: -3px;
  width: 1px;
  background: var(--rh-bone-300);
  opacity: 0.85;
}
.par-bar .par-mark::after {
  content: 'PAR';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-ui);
  font-size: 7px;
  letter-spacing: 0.24em;
  color: var(--rh-bone-300);
  font-weight: 600;
  white-space: nowrap;
  padding-bottom: 2px;
}

/* Hub-and-spoke ring — cleaned up May '26.
   Dropped the inner segmented brass perimeter and the dashed outer track.
   Now: a single solid hairline ring connecting four large pillar disks at
   the cardinal points, with the Record disk at center. Target metaphor
   preserved without dashed clutter. */
.hub-ring {
  position: relative;
  width: 320px;
  height: 320px;
  margin: 0 auto;
}
/* v4.4: hub ring re-energized.
   - Ring track breathes (gentle opacity pulse)
   - Spokes get state-driven border colors (attention/low/ready)
   - Attention spoke pulses outward to draw the eye
   - Subtle brass-dash accent around the center disc */
@keyframes hub-ring-breathe {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 0.65; }
}
@keyframes hub-spoke-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(195,58,46,0.40); }
  60%      { box-shadow: 0 0 0 14px rgba(195,58,46,0.0); }
}

.hub-ring .ring-track {
  position: absolute;
  inset: 46px;   /* sits between center disk and spokes */
  border-radius: 50%;
  border: 1px solid var(--rh-brass-tint-32);
  pointer-events: none;
  animation: hub-ring-breathe 4.5s ease-in-out infinite;
}

.hub-spoke.s-ready {
  border-color: var(--rh-brass-tint-32);
}
.hub-spoke.s-low {
  border-color: rgba(199,122,59,0.5);
  background: linear-gradient(to bottom, var(--rh-obsidian-700) 0%, var(--rh-obsidian-800) 100%);
}
.hub-spoke.s-attention {
  border-color: var(--rh-dusty-red);
  background: linear-gradient(to bottom, rgba(195,58,46,0.06) 0%, var(--rh-obsidian-800) 100%);
  animation: hub-spoke-pulse 2.4s infinite;
}
.hub-ring .hub-center {
  position: absolute;
  inset: 30% 30%;
  border: 1px solid var(--rh-brass);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--rh-obsidian-800);
  text-align: center;
  padding: 8px;
  z-index: 2;
}
.hub-ring .hub-spoke {
  position: absolute;
  width: 92px; height: 92px;
  border-radius: 50%;
  border: 1px solid var(--border-default);
  background: var(--rh-obsidian-800);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
  z-index: 3;
}
.hub-ring .hub-spoke:hover { border-color: var(--rh-brass); background: var(--rh-obsidian-700); }
.hub-ring .hub-spoke.top    { top: 0; left: 50%; transform: translateX(-50%); }
.hub-ring .hub-spoke.bottom { bottom: 0; left: 50%; transform: translateX(-50%); }
.hub-ring .hub-spoke.left   { left: 0; top: 50%; transform: translateY(-50%); }
.hub-ring .hub-spoke.right  { right: 0; top: 50%; transform: translateY(-50%); }

/* Caliber row in supply */
.cal-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-hairline);
  align-items: center;
}
.cal-row:last-child { border-bottom: 0; }
.cal-row .cal {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--fg-1);
  letter-spacing: 0.02em;
  line-height: 1;
}

/* Vault doc tile */
.doc-tile {
  background: var(--bg-elevated-1);
  border: 1px solid var(--border-default);
  border-radius: 2px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.doc-tile.missing {
  border-style: dashed;
  border-color: rgba(195,58,46,0.4);
  background: rgba(195,58,46,0.04);
}
.doc-tile .doc-thumb {
  aspect-ratio: 4/3;
  background: var(--rh-obsidian-700);
  border: 1px solid var(--border-hairline);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-size: 8px;
  letter-spacing: 0.22em;
  color: var(--rh-bone-500);
  text-transform: uppercase;
  font-weight: 600;
}
.doc-tile.missing .doc-thumb {
  background: transparent;
  border-style: dashed;
  border-color: rgba(195,58,46,0.4);
  color: rgba(228,138,130,0.8);
}

/* Maintenance / readiness row */
.maint-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-elevated-1);
  border: 1px solid var(--border-default);
  border-radius: 2px;
}
.maint-row + .maint-row { margin-top: 8px; }
.maint-row.due { border-left: 3px solid var(--rh-brass); }
.maint-row.over { border-left: 3px solid var(--rh-dusty-red); }
.maint-row.ready { border-left: 3px solid #6B8E5A; }

.maint-row .ttl { font-family: var(--font-ui); font-size: 12px; font-weight: 600; color: var(--fg-1); letter-spacing: 0.06em; text-transform: uppercase; line-height: 1.1; }
.maint-row .sub { font-family: var(--font-body); font-size: 12px; color: var(--fg-3); margin-top: 3px; }
.maint-row .right { text-align: right; }
.maint-row .pct {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.02em;
  color: var(--fg-1);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.maint-row.over .pct { color: var(--rh-dusty-red); }
.maint-row.due .pct { color: var(--rh-brass-400); }
.maint-row.ready .pct { color: #A6C293; }
.maint-row .pct-sub { font-family: var(--font-ui); font-size: 7px; letter-spacing: 0.24em; color: var(--fg-4); text-transform: uppercase; margin-top: 3px; font-weight: 600; }

/* Timeline row */
.timeline {
  position: relative;
  padding-left: 22px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 7px; top: 4px; bottom: 4px;
  width: 1px;
  background: var(--rh-brass-tint-32);
}
.timeline .tl-item {
  position: relative;
  padding: 0 0 16px 0;
}
.timeline .tl-item::before {
  content: '';
  position: absolute;
  left: -22px; top: 5px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--rh-obsidian);
  border: 1px solid var(--rh-brass);
}
.timeline .tl-item.use::before    { border-color: #6B8E5A; }
.timeline .tl-item.supply::before { border-color: #C77A3B; }
.timeline .tl-item.maint::before  { border-color: var(--rh-brass); }
.timeline .tl-item.protect::before{ border-color: var(--rh-dusty-red); }
.timeline .tl-tag {
  font-family: var(--font-ui);
  font-size: 8px;
  letter-spacing: 0.24em;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--rh-bone-500);
}
.timeline .tl-title { font-family: var(--font-ui); font-size: 12px; color: var(--fg-1); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin: 2px 0 2px; line-height: 1.15; }
.timeline .tl-sub { font-family: var(--font-body); font-size: 12px; color: var(--fg-3); }

/* Big numeric "Today's plan" hero block for Bold home */
.today-block {
  background: var(--bg-elevated-1);
  border: 1px solid var(--rh-brass-tint-32);
  border-radius: 4px;
  padding: 16px 16px 18px;
}
.today-block .label { font-family: var(--font-ui); font-size: 9px; letter-spacing: 0.24em; color: var(--rh-brass-400); text-transform: uppercase; font-weight: 600; }
.today-block .when { font-family: var(--font-display); font-size: 28px; color: var(--fg-1); letter-spacing: 0.02em; line-height: 1; margin: 4px 0 12px; }
.today-block .row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border-hairline); font-family: var(--font-ui); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-2); font-weight: 500; }
.today-block .row:last-of-type { border-bottom: 0; }
.today-block .row .v { color: var(--rh-bone-300); font-family: var(--font-mono); letter-spacing: 0.06em; font-size: 11px; }

/* Big CTA wedge for Bold home */
.big-cta {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--rh-dusty-red);
  color: var(--rh-bone-100);
  border: 0;
  padding: 18px 18px 20px;
  font-family: var(--font-display);
  cursor: pointer;
  position: relative;
  border-radius: 2px;
  transition: background 120ms ease;
}
.big-cta:hover { background: var(--rh-red-400); }
.big-cta .eyebrow {
  font-family: var(--font-ui);
  font-size: 9px;
  letter-spacing: 0.24em;
  color: rgba(230,225,214,0.7);
  font-weight: 600;
}
.big-cta .ttl {
  font-family: var(--font-display);
  font-size: 36px;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-top: 4px;
}
.big-cta .arrow {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-display);
  font-size: 28px;
}

/* Sticky bottom nav bar to align inside .rh-phone */
.rh-phone .bottom-tabs { position: absolute; left: 0; right: 0; bottom: 0; }

/* Hide scroll-anchor jumps on inner phone screens */
.rh-phone * { scroll-behavior: auto; }

/* Tabs at top of detail screens
   v4.1: bigger differentiation between active and inactive. Active tab now
   has a soft brass-tinted background + thicker underline; inactive tabs are
   more muted. Active POPS clearly from the rest. */
.top-tabs { display:flex; gap: 0; border-bottom: 1px solid var(--border-default); margin: 8px -14px 12px; padding: 0 14px; }
.top-tabs .t {
  flex: 1;
  padding: 14px 4px 12px;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 13px;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--rh-bone-700);
  text-transform: uppercase;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: color 120ms ease, background 120ms ease, border-color 120ms ease;
  position: relative;
}
.top-tabs .t.on {
  color: var(--fg-1);
  border-bottom-color: var(--rh-brass);
  background: linear-gradient(to bottom, transparent 0%, rgba(184,154,86,0.08) 100%);
}
.top-tabs .t.on::before {
  /* subtle top accent on active tab */
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 1px;
  background: var(--rh-brass-tint-32);
}
.top-tabs .t:hover:not(.on) { color: var(--rh-bone-300); }
.top-tabs .t .dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
}

/* CollapsingHero — scrolls naturally at top, with an optional sticky
   summary bar that glues just below the topbar after the hero exits. */
.ch-hero {
  padding: 8px 0 10px;
}
.ch-eyebrow {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.20em;
  color: var(--rh-brass-400);
  text-transform: uppercase;
  font-weight: 600;
}
.ch-headline {
  font-family: var(--font-display);
  font-size: 44px;
  line-height: 0.95;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--fg-1);
  margin: 4px 0 6px;
}
.ch-sub {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--rh-bone-300);
  max-width: 92%;
}
.ch-bar {
  position: sticky;
  top: 44px;      /* sits just below the topbar (~44px tall) */
  z-index: 4;
  margin: 4px -14px 10px;
  padding: 8px 14px;
  background: var(--rh-obsidian);
  border-top: 1px solid var(--border-hairline);
  border-bottom: 1px solid var(--border-hairline);
}
.ch-bar-summary {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--rh-bone-300);
  text-transform: uppercase;
  font-weight: 600;
}
.ch-hero-right {
  position: absolute;
  top: 8px;
  right: 0;
  z-index: 1;
}

/* Tweak: variation toggle */
.var-toggle {
  display: inline-flex;
  background: var(--bg-elevated-1);
  border: 1px solid var(--border-default);
  border-radius: 2px;
  padding: 2px;
}
.var-toggle button {
  border: 0;
  background: transparent;
  padding: 6px 10px;
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--rh-bone-500);
  text-transform: uppercase;
  cursor: pointer;
  font-weight: 600;
  border-radius: 1px;
}
.var-toggle button.on { background: var(--rh-brass); color: var(--rh-obsidian); }

/* DesignCanvas section header — make brass-colored to match brand */
.dc-section h2,
.dc-section h3,
.dc-section .dc-section-title {
  color: var(--rh-bone-100) !important;
}

/* ---- On a real phone: strip the desktop frame, fill the viewport ---- */
@media (max-width: 500px) {
  .proto-stage {
    display: block;
    padding: 0;
    min-height: 100vh;
    background: var(--rh-obsidian);
  }
  .proto-stage::before { display: none; }

  /* Pin to viewport — !important overrides the inline .proto-stage > * { position: relative } */
  .rh-phone {
    position: fixed !important;
    inset: 0;
    width: auto;
    height: auto;
    border-radius: 0;
    box-shadow: none;
    border: none;
  }

  /* Hide the fake "9:41" status bar */
  .rh-phone .ios-bar { display: none; }

  /* min-height: 0 is required for a flex child to scroll correctly */
  .rh-phone .screen-body {
    min-height: 0;
  }

  /* Bottom tabs back in flex flow so screen-body fills the space above */
  .rh-phone .bottom-tabs {
    position: relative;
    left: auto; right: auto; bottom: auto;
    flex-shrink: 0;
    padding-bottom: env(safe-area-inset-bottom, 8px);
  }

  /* Topbar sticky within screen-body */
  .rh-phone .topbar {
    position: sticky;
    top: 0;
  }

  .rh-phone .screen {
    padding-bottom: 32px;
  }

  /* Bigger tap targets for chips/pills */
  .chip {
    font-size: 13px;
    padding: 10px 16px;
    letter-spacing: 0.06em;
  }
}
