/* ============================================================
   Swiftpoint Hub — Profile page.

   Design tokens, the reset and the header live in the shared
   layers (tokens.css, base.css, hdr.css) and are loaded before
   this file. Layout here: identity sidebar + sticky section nav.
   ============================================================ */

/* ============ Header extras ============ */
/* .hdr, .hdr-in, .brand, .hdr-nav, .hdr-link, .hdr-actions and
   .hdr-bmc are owned by css/hdr.css — only the page-specific bits
   are declared here. */

.beta-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--on-accent);
  background: var(--lime);
  border-radius: var(--r-pill);
  padding: 3px 9px 2px;
}

/* user-chip is the shared component in css/hdr.css */

/* Buttons are the shared .btn kit in css/ui.css */

/* ============ Beta strip ============ */

.beta-strip {
  max-width: 1280px;
  margin: 18px auto 0;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.beta-strip p {
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
  padding-left: 14px;
  position: relative;
}
.beta-strip p::before {
  content: '';
  position: absolute;
  left: 0; top: 3px; bottom: 3px;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(var(--lime), var(--teal));
}
.beta-strip strong { color: var(--text); }
.beta-strip a {
  font-size: 13px;
  font-weight: 600;
  color: var(--lime);
  text-decoration: none;
  white-space: nowrap;
}
.beta-strip a:hover { text-decoration: underline; }

/* ============ Hero ============ */

.hero {
  max-width: 1280px;
  margin: 26px auto 30px;
  padding: 0 24px;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 36px;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 36px 40px;
  position: relative;
  overflow: hidden;
  animation: riseIn 0.5s var(--ease) backwards;
}
.hero-grid::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--lime), var(--teal) 55%, transparent);
}

.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.byline {
  margin-top: 14px;
  font-size: 13.5px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
}
.byline .by-author b {
  color: var(--text-dim);
  font-weight: 700;
  font-size: 15px;
}
.by-author { display: inline-flex; align-items: baseline; gap: 7px; }
.byline a { color: var(--text-dim); text-decoration: none; font-weight: 600; transition: color 0.15s ease; }
.byline a:hover { color: var(--lime); }
.byline > span:not(.by-author) { position: relative; padding-left: 12px; }
.byline > span:not(.by-author)::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--text-faint);
  opacity: 0.5;
}
.hero-desc {
  margin: 20px 0 0;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text-dim);
  white-space: pre-line;
  max-width: 72ch;
}

.stats {
  margin: 26px 0 0;
  padding-top: 22px;
  border-top: 1px dashed var(--line-strong);
  display: flex;
  flex-wrap: wrap;
  gap: 16px 44px;
}
.stats > div { min-width: 0; }
.stats dt {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.stats dd {
  margin: 3px 0 0;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 600;
}

/* Hero rail: actions */
.hero-rail {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding-left: 32px;
  border-left: 1px solid var(--line);
}

/* Vote box */
.votebox-wrap { display: flex; flex-direction: column; gap: 14px; }
.votebox { display: flex; align-items: stretch; gap: 10px; }
.hv-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 0;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--text-dim);
  transition: all 0.15s var(--ease);
}
.hv-btn svg { width: 20px; height: 20px; }
.hv-btn:hover { border-color: var(--line-strong); color: var(--text); transform: translateY(-1px); }
.hv-btn.up.active { background: var(--lime-dim); border-color: var(--lime); color: var(--lime); }
.hv-btn.down.active {
  background: rgba(255, 107, 94, 0.1);
  border-color: var(--danger);
  color: var(--danger);
}
.hv-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 64px;
}
.hv-score { font-size: 24px; font-weight: 700; line-height: 1.1; }
.hv-score.bump { animation: voteBump 0.35s var(--ease); }
@keyframes voteBump {
  40% { transform: scale(1.25); color: var(--lime); }
}
.hv-sub {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ============ Main column ============ */

.shell {
  max-width: 1280px;
  margin: 0 auto 80px;
  padding: 0 24px;
}

.main { min-width: 0; }

.sec-nav {
  position: sticky;
  top: calc(var(--hdr-total-h) + 14px);
  z-index: 40;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 8px;
  margin-bottom: 20px;
  background: rgba(18, 18, 21, 0.88);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
}
.sec-nav::-webkit-scrollbar { display: none; }
.sec-link {
  flex: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  background: none;
  border: 0;
  border-radius: var(--r-pill);
  padding: 7px 14px;
  transition: all 0.15s ease;
}
.sec-link:hover { color: var(--text); }
.sec-link.active { color: var(--on-accent); background: var(--lime); }

.layers {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.layers-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.layers-chips { display: flex; gap: 8px; flex-wrap: wrap; }
/* Filter chips are the shared .fchip in css/ui.css */

/* Alerts */
.alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border-radius: var(--r-md);
  border: 1px solid;
  padding: 14px 16px;
  font-size: 13.5px;
  margin-bottom: 12px;
}
.alert-icon { flex: none; font-size: 17px; line-height: 1.3; }
.alert-warn {
  background: var(--orange-dim);
  border-color: var(--orange);
  color: var(--orange);
}
.alert-danger {
  background: var(--red-dim);
  border-color: var(--red);
  color: var(--red);
}

/* Sections */
.sec { margin-bottom: 44px; scroll-margin-top: calc(var(--hdr-total-h) + 28px); }
.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.sec-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 12px;
}
.sec-head h2::before {
  content: '';
  width: 22px; height: 4px;
  border-radius: 2px;
  background: var(--lime);
}
.sec-hint {
  margin: -6px 0 16px;
  font-size: 13px;
  color: var(--text-faint);
  max-width: 68ch;
}

/* On-load panel */
.onload {
  background: linear-gradient(160deg, rgba(255, 159, 69, 0.09), rgba(255, 159, 69, 0.02));
  border: 1px solid rgba(255, 159, 69, 0.3);
  border-radius: var(--r-md);
  padding: 16px 18px;
  margin-bottom: 16px;
}
.onload-title { margin: 0; font-weight: 700; font-size: 14px; color: var(--orange); }
.onload-desc { margin: 2px 0 10px; font-size: 12.5px; color: var(--text-dim); }
.key-row { display: flex; flex-wrap: wrap; gap: 7px; }

/* Key badges — keyboard-cap style */
.key-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2.5px;
  border-radius: 7px;
  padding: 3px 9px 2px;
  line-height: 1.4;
}
.key-badge.loop {
  color: var(--violet);
  border-color: var(--violet);
  background: rgba(182, 155, 255, 0.09);
}

/* Device settings spec grid */
.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.spec-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 13px 15px;
}
.spec-card .label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 3px;
}
.spec-card .value {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.spec-card.full { grid-column: 1 / -1; }
.spec-card.double { grid-column: span 2; }

/* Mapping cards */
.map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(390px, 1fr));
  gap: 12px;
}
.map-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  animation: riseIn 0.4s var(--ease) backwards;
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(8px); }
}
.map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px 11px;
  border-bottom: 1px solid var(--line);
}
.map-name { margin: 0; font-family: var(--font-display); font-size: 15px; font-weight: 700; }
.map-count { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); }
.map-row {
  padding: 11px 16px;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 4px 14px;
  align-items: start;
}
.map-row + .map-row { border-top: 1px dashed var(--line); }
.trig {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
  padding-top: 4px;
}
.map-row.deep .trig { color: var(--orange); }
.trig .depth { display: block; color: var(--text-faint); letter-spacing: 0; }
.map-out { display: flex; flex-wrap: wrap; gap: 6px; }
.map-label { grid-column: 2; font-size: 12.5px; font-style: italic; color: var(--text-dim); }
.oled-inline { grid-column: 2; display: flex; flex-wrap: wrap; gap: 10px; }
.no-results { grid-column: 1 / -1; text-align: center; color: var(--text-faint); padding: 30px 0; }

/* OLED canvas cards */
.oled-card { text-align: center; transition: transform 0.25s var(--ease); }
.oled-card:hover { transform: translateY(-3px); }
.oled-canvas {
  width: 150px;
  image-rendering: pixelated;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--oled-canvas);
  transition: box-shadow 0.25s var(--ease);
}
.oled-card:hover .oled-canvas {
  box-shadow: 0 0 28px -4px rgba(124, 255, 227, 0.4), 0 8px 24px rgba(0, 0, 0, 0.5);
}
.oled-cap {
  margin: 6px 0 0;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* OLED animation block: a playable preview above the static frame cards */
.oled-block { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.oled-anim { position: relative; display: flex; flex-direction: column; gap: 8px; }
.oled-anim-controls {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px; border-radius: 8px;
  background: rgba(6, 10, 14, 0.55); border: 1px solid var(--line-strong);
  width: max-content;
}
.oled-anim-play {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border: none; border-radius: 6px;
  background: var(--teal-dim);
  color: var(--teal);
  font-size: 11px; cursor: pointer;
  transition: background 0.2s var(--ease);
}
.oled-anim-play:hover { background: var(--teal); color: var(--bg); }
.oled-anim-play.playing { background: var(--teal-dim); }
.oled-anim-count, .oled-anim-time {
  font-size: 10px; color: var(--teal);
  letter-spacing: 0.03em;
}
.oled-anim-time { color: var(--text-faint); }
.oled-frames { display: flex; flex-wrap: wrap; gap: 10px; }

/* Force stages */
.force-list { display: flex; flex-direction: column; gap: 14px; }
.force-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px;
  animation: riseIn 0.4s var(--ease) backwards;
}
.force-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.force-button { font-family: var(--font-display); font-size: 16px; font-weight: 700; }
.force-count { font-size: 11px; color: var(--text-faint); }

.force-track {
  position: relative;
  height: 14px;
  border-radius: 7px;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  overflow: hidden;
}
.force-band { position: absolute; top: 0; bottom: 0; transition: background 0.25s ease; }
.force-card:hover .force-band.light { background: rgba(79, 216, 196, 0.5); }
.force-card:hover .force-band.deep { background: rgba(255, 159, 69, 0.55); }
.force-band.light { left: 0; background: rgba(79, 216, 196, 0.35); }
.force-band.deep { background: rgba(255, 159, 69, 0.4); }
/* Threshold hint lives inside the deep band itself. */
.force-track .deep-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(11, 11, 13, 0.75);
  pointer-events: none;
}
.force-scale {
  display: flex;
  justify-content: space-between;
  margin: 10px 0 4px;
  font-size: 10px;
  color: var(--text-faint);
}

.force-ladder { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.force-rung {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 11px 13px;
}
.force-rung.light { border-left: 3px solid var(--teal); }
.force-rung.deep { border-left: 3px solid var(--orange); }
.rung-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}
.rung-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.force-rung.light .rung-tag { color: var(--teal); }
.force-rung.deep .rung-tag { color: var(--orange); }
.rung-range { font-size: 11px; color: var(--text-dim); }
.rung-bar {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-raise);
  overflow: hidden;
  margin-bottom: 9px;
}
.rung-fill { position: absolute; top: 0; bottom: 0; }
.rung-fill.light { background: var(--teal); }
.rung-fill.deep { background: var(--orange); }
.rung-out { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.rung-label { font-size: 12.5px; font-style: italic; color: var(--text-dim); margin-right: 4px; }
.rung-follow { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 9px; }
.rung-follow-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  font-size: 12.5px;
}
.rung-follow-row .oled-inline { display: contents; }
.rung-follow-arrow { font-family: var(--font-mono); font-size: 10.5px; color: var(--violet); }
.rung-follow-name { font-weight: 700; }
.rung-follow-label { font-style: italic; color: var(--text-dim); }

/* Sequences */
.seq-list { display: flex; flex-direction: column; gap: 14px; }
.seq-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px;
  animation: riseIn 0.4s var(--ease) backwards;
}
.seq-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.seq-title-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; }
.seq-title { margin: 0; font-family: var(--font-display); font-size: 15px; font-weight: 700; }
.seq-type {
  flex: none;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  background: rgba(110, 168, 254, 0.12);
  border-radius: var(--r-pill);
  padding: 3px 9px 2px;
}
.seq-count { font-size: 11px; color: var(--text-faint); }
.seq-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  flex-wrap: wrap;
}
.seq-step + .seq-step { border-top: 1px dashed var(--line); }
.step-num {
  flex: none;
  width: 24px; height: 24px;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--bg);
  background: var(--blue);
  border-radius: 50%;
}
.seq-input { font-size: 13px; font-weight: 600; color: var(--text-dim); min-width: 110px; }
.seq-out { display: flex; flex-wrap: wrap; gap: 6px; }
.seq-step .oled-inline { margin-left: auto; grid-column: auto; }

/* Tilt / Roll / Pivot */
.tilt-list {
  display: grid;
  gap: 16px;
}
.tilt-card {
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-left: 3px solid var(--pink);
  border-radius: var(--r-md);
  padding: 14px 16px;
  animation: riseIn 0.4s var(--ease) backwards;
}
.tilt-card[data-axis="roll"] { border-left-color: var(--teal); }
.tilt-card[data-axis="yaw"]  { border-left-color: var(--lime); }
.tilt-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tilt-title { margin: 0; font-family: var(--font-display); font-size: 14.5px; font-weight: 700; }
.tilt-gate {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
}
.tilt-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lime);
  background: var(--lime-dim);
  border: 1px solid rgba(198, 245, 66, 0.25);
  border-radius: 999px;
  padding: 2px 8px;
}
.tilt-gauge { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.tilt-axis { color: var(--pink); flex: none; display: flex; }
.tilt-axis svg { width: 16px; height: 16px; }
.tilt-card[data-axis="roll"] .tilt-axis { color: var(--teal); }
.tilt-card[data-axis="yaw"]  .tilt-axis { color: var(--lime); }
.angle-gauge { flex: none; display: block; width: 118px; height: auto; }
.ag-track { fill: none; stroke: var(--line); stroke-width: 1.4; opacity: 0.7; }
.ag-guide { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 3; }
.ag-tick { stroke: var(--text-dim); stroke-width: 1; opacity: 0.5; }
.ag-tick.major { stroke: var(--text-dim); stroke-width: 1.5; opacity: 0.8; }
.ag-fill { fill: none; stroke: var(--pink); stroke-width: 7; stroke-linecap: round; opacity: 0.9; }
.tilt-card[data-axis="roll"] .ag-fill { stroke: var(--teal); }
.tilt-card[data-axis="yaw"]  .ag-fill { stroke: var(--lime); }
.ag-label { fill: var(--text-dim); font-family: var(--font-mono); font-size: 7px; }
.ag-label.level { fill: var(--text); font-weight: 700; }
.tilt-note { margin: -4px 0 10px; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-dim); }
.tilt-out { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }

.imu-group {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.imu-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.imu-group-icon { flex: none; display: flex; color: var(--pink); }
.imu-group-icon svg { width: 16px; height: 16px; }
.imu-group[data-axis="roll"] .imu-group-icon { color: var(--teal); }
.imu-group[data-axis="yaw"]  .imu-group-icon { color: var(--lime); }
.imu-group-name { margin: 0; font-family: var(--font-display); font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.imu-group-count { margin-left: auto; font-size: 12px; color: var(--text-dim); }
.imu-group-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  padding: 12px;
}

/* Raw JSON */
.raw-box {
  margin-bottom: 44px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
}
.raw-box summary {
  cursor: pointer;
  padding: 13px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  user-select: none;
}
.raw-box summary:hover { color: var(--lime); }
.raw-box pre {
  margin: 0;
  padding: 0 18px 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-dim);
  overflow-x: auto;
  max-height: 480px;
}

/* Comments */
.comment-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.comment-empty { color: var(--text-faint); font-size: 14px; }
.comment-item {
  display: flex;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
}
.comment-item.patch { border-color: rgba(198, 245, 66, 0.35); }
.comment-avatar {
  flex: none;
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
}
span.comment-avatar {
  display: grid;
  place-items: center;
  background: var(--surface-2);
  font-weight: 700;
  color: var(--text-dim);
}
.comment-main { min-width: 0; flex: 1; }
.comment-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 5px;
}
.comment-user { font-weight: 700; font-size: 13.5px; }
.meta-link { color: inherit; text-decoration: none; }
.meta-link:hover { color: var(--lime); }
.comment-badge {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lime);
  background: var(--lime-dim);
  border-radius: var(--r-pill);
  padding: 3px 8px 2px;
}
.comment-date { font-size: 12px; color: var(--text-faint); }
.comment-rep, .comment-del {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--text-faint);
  background: none;
  border: 0;
  padding: 2px 4px;
}
.comment-del:hover { color: var(--danger); }
.comment-rep:hover { color: var(--orange); }
.comment-body { font-size: 14px; overflow-wrap: anywhere; }
.comment-body > :first-child { margin-top: 0; }
.comment-body > :last-child { margin-bottom: 0; }
.comment-body pre {
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  overflow-x: auto;
  font-size: 12.5px;
}
.comment-body code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--bg-raise);
  border-radius: 5px;
  padding: 1px 5px;
}
.comment-body pre code { background: none; padding: 0; }
.comment-body blockquote {
  margin: 8px 0;
  padding: 4px 14px;
  border-left: 3px solid var(--lime);
  color: var(--text-dim);
}

.comment-form { position: relative; }
.comment-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 88px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 13px 15px;
}
.comment-form textarea:focus { outline: none; border-color: var(--lime); }
.comment-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  flex-wrap: wrap;
}
.comment-tool {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 6px 12px;
  transition: all 0.15s ease;
}
.comment-tool:hover, .comment-tool.active { color: var(--lime); border-color: rgba(198, 245, 66, 0.4); }
.comment-send { margin-left: auto; }
.kind-select {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.kind-opt {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  background: none;
  border: 0;
  padding: 6px 13px;
}
.kind-opt.active { background: var(--surface-2); color: var(--lime); }
.emoji-popover {
  position: absolute;
  z-index: 30;
  bottom: calc(100% - 130px);
  left: 0;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 8px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  max-width: 340px;
}
.emoji-btn {
  font-size: 18px;
  background: none;
  border: 0;
  border-radius: 7px;
  padding: 4px;
}
.emoji-btn:hover { background: var(--surface); }
.comment-login { font-size: 13.5px; color: var(--text-dim); }
.comment-login a { color: var(--lime); font-weight: 600; }

/* Live character counter beside a field label */
.field-count {
  float: right;
  font-size: 11px;
  color: var(--text-3);
}

/* Modals, form fields, toasts and the notification bell are the
   shared components in css/ui.css (markup is unchanged). */

/* ============ Hover feedback & micro-interactions ============ */

.map-card,
.spec-card,
.seq-card,
.tilt-card,
.force-card,
.comment-item {
  transition: transform 0.2s var(--ease), border-color 0.2s ease, box-shadow 0.25s ease;
}
.map-card:hover,
.tilt-card:hover,
.force-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: 0 14px 36px -16px rgba(0, 0, 0, 0.8);
}
.spec-card:hover { border-color: rgba(198, 245, 66, 0.3); }
.spec-card:hover .value { color: var(--accent); }
.spec-card .value { transition: color 0.2s ease; }
.seq-card:hover { border-color: rgba(110, 168, 254, 0.35); }
.comment-item:hover { border-color: var(--line-strong); }

/* Binding rows light up on hover */
.map-row { transition: background 0.15s ease; }
.map-row:hover { background: var(--surface-2); }

/* Key badges pop slightly */
.key-badge { transition: transform 0.15s var(--ease), border-color 0.15s ease, color 0.15s ease; }
.key-badge:hover { transform: translateY(-2px); border-color: var(--text-3); color: var(--accent); }

/* Buttons & links */
.sec-link,
.comment-tool {
  will-change: transform;
}
.sec-link:not(.active):hover { background: var(--surface-2); transform: translateY(-1px); }
.comment-tool:hover { transform: translateY(-1px); }

/* Vote feedback */
.hv-btn.active { animation: votePop 0.28s var(--ease); }
@keyframes votePop {
  45% { transform: scale(1.08); }
}

/* Sections fade in */
.sec { animation: riseIn 0.45s var(--ease) backwards; }
.sec:nth-of-type(1) { animation-delay: 0.05s; }
.sec:nth-of-type(2) { animation-delay: 0.1s; }
.sec:nth-of-type(n+3) { animation-delay: 0.15s; }

/* Alerts draw attention gently */
.alert { animation: riseIn 0.4s var(--ease) backwards; }
.alert-icon { animation: alertPulse 2.4s ease-in-out infinite; }
@keyframes alertPulse {
  50% { opacity: 0.55; transform: scale(1.12); }
}

/* Force rungs slide in from their side */
.rung-out { min-width: 0; }
.force-rung { transition: background 0.2s ease; }
.force-rung.light:hover { background: rgba(79, 216, 196, 0.05); }
.force-rung.deep:hover { background: rgba(255, 159, 69, 0.05); }

/* Sequence steps highlight on hover */
.seq-step { transition: background 0.15s ease; border-radius: 6px; }
.seq-step:hover { background: rgba(110, 168, 254, 0.06); }
.seq-step:hover .step-num { transform: scale(1.15); }
.step-num { transition: transform 0.2s var(--ease); }

/* Raw JSON summary */
.raw-box { transition: border-color 0.2s ease; }
.raw-box:hover { border-color: var(--line-strong); }
.raw-box[open] summary { color: var(--lime); border-bottom: 1px solid var(--line); }

/* ============ Responsive ============ */

@media (max-width: 1020px) {
  .hero-grid { grid-template-columns: 1fr; padding: 26px; gap: 24px; }
  .hero-rail {
    padding-left: 0;
    border-left: 0;
    padding-top: 22px;
    border-top: 1px dashed var(--line-strong);
  }
}

@media (max-width: 640px) {
  .hero { padding: 0 16px; margin-top: 16px; }
  .shell { padding: 0 16px; margin-top: 16px; }
  .beta-strip { padding: 0 16px; margin-top: 14px; }
  .map-grid { grid-template-columns: 1fr; }
  .imu-group-list { grid-template-columns: 1fr; }
  .stats { gap: 14px 28px; }
  .modal { padding: 20px; }
}
