/* ============================================================
   Injection-Site Rotation Map: page styles
   Depends on shared.css for theme tokens and base components.
   ============================================================ */

.calc-shell--rotate {
  max-width: 860px;
}

.rot-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: flex-start;
}

/* ---------- Figure column ---------- */
.rot-figure-col {
  flex: 0 0 auto;
  width: 300px;
  max-width: 100%;
  margin: 0 auto;
}

/* Front / back segmented toggle with a sliding thumb */
.rot-viewseg {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  margin: 0 0 16px;
  padding: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 11px;
}

.rot-viewseg__thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.24s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
.rot-viewseg[data-active="back"] .rot-viewseg__thumb {
  transform: translateX(100%);
}

.rot-viewseg__opt {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 10px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.rot-viewseg__opt svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
}
.rot-viewseg__opt:hover { color: var(--text); }
.rot-viewseg__opt[aria-checked="true"] { color: var(--accent); }
.rot-viewseg__opt:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 8px;
}

.rot-figure {
  position: relative;
  width: 100%;
  aspect-ratio: 1024 / 1536;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.rot-figure img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

/* ---------- Markers ---------- */
.rot-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease, box-shadow 0.12s ease;
}

.rot-marker:hover {
  transform: translate(-50%, -50%) scale(1.12);
}

.rot-marker:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--bg-elevated), 0 0 0 6px var(--accent);
}

.rot-marker__n {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  color: #0d1117;
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.55);
  pointer-events: none;
}

/* Suggested site gets an accent ring */
.rot-marker.is-suggested {
  border-color: var(--accent);
  box-shadow: 0 0 0 2.5px var(--accent), 0 1px 3px rgba(0, 0, 0, 0.45);
  z-index: 2;
}
.rot-marker.is-suggested:focus-visible {
  box-shadow: 0 0 0 3px var(--bg-elevated), 0 0 0 6px var(--accent);
}

.rot-figure-hint {
  margin: 12px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ---------- Side panel ---------- */
.rot-panel {
  flex: 1 1 280px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.rot-block__label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 8px;
}

.rot-block__hint {
  margin: 7px 0 0;
  font-size: 0.78rem;
  color: var(--text-faint);
  line-height: 1.45;
}

/* Suggested-site card */
.rot-suggest {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rot-suggest__eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.rot-suggest__name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.rot-suggest__meta {
  font-size: 0.88rem;
  color: var(--accent);
  font-weight: 600;
}

.rot-suggest__view {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.rot-suggest__warn {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: var(--danger);
  line-height: 1.45;
}

.rot-suggest .btn { margin-top: 12px; }

/* Legend */
.rot-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.rot-legend li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.rot-legend__d {
  color: var(--text-faint);
  font-size: 0.78rem;
}

.rot-swatch {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

/* Cooldown range */
.rot-range {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Cadence (reuses .compound-select arrow styling) */
.compound-select { position: relative; display: block; }
.compound-select::after {
  content: "";
  position: absolute;
  right: 13px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -6px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  pointer-events: none;
}
.compound-select select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 100%;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 9px 34px 9px 13px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.compound-select select:hover { border-color: var(--accent); }
.compound-select select:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

.rot-cadence-note {
  margin: 10px 0 0;
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.rot-cadence-note.is-warn { color: var(--text); }

.rot-cadence-warn {
  margin: 6px 0 0;
  font-size: 0.82rem;
  color: var(--danger);
  line-height: 1.45;
}

/* Action buttons */
.rot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}
.rot-actions .btn {
  flex: 1 1 auto;
  padding: 9px 12px;
  font-size: 0.85rem;
}
.rot-reset { color: var(--danger); }
.rot-reset:hover { border-color: var(--danger); }

/* Share */
.rot-share[hidden] { display: none; }
.rot-share {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.rot-share__url {
  width: 100%;
  padding: 9px 11px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.78rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  overflow-x: auto;
}
.rot-share__url:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}
.rot-share__row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.rot-share__ok {
  font-size: 0.82rem;
  color: var(--success);
  font-weight: 600;
}

/* ---------- Below-tool reference section ---------- */
.section-divider {
  max-width: 720px;
  margin: 56px auto 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.reference {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 22px 8px;
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 0.95rem;
}
.reference h2 {
  margin: 0 0 10px;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.reference h3 {
  margin: 24px 0 6px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.reference p { margin: 0 0 12px; }
.reference strong { color: var(--text); font-weight: 600; }
.reference .ref-disclaimer {
  font-size: 0.85rem;
  border-left: 3px solid var(--border-strong);
  padding-left: 14px;
}
.reference .related-tools {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}
.reference .related-tools li { margin: 0 0 8px; }

/* ---------- Footer disclaimer ---------- */
.footer-disclaimer {
  max-width: 720px;
  margin: 0 auto 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .calc-shell.calc-shell--rotate {
    padding: 0 16px;
    margin-top: 80px;
  }
  .rot-layout { gap: 22px; }
  .rot-figure-col { width: 260px; }
  .rot-marker { width: 24px; height: 24px; }
  .reference { padding: 28px 16px 8px; }
  .section-divider { margin-top: 40px; }
}
