/*
 * Fe ResponseLab — brand styling aligned with the FerrumSec landing page.
 * Dark "iron" theme: Space Grotesk + JetBrains Mono, cyan primary, glass panels.
 * Semantic fe-* classes are styled here so templates stay markup-light.
 */
:root {
  --bg: #070a0d;
  --bg-2: #0a0d12;
  --panel: #0d1218;
  --text: #c3cbd6;
  --text-dim: #8b96a5;
  --head: #f1f4f8;
  --iron: #2db9e8;
  --iron-bright: #79d7f2;
  --warm: #ff8a5d;
  --green: #3ddc97;
  --danger: #ff6b6b;
  --hairline: rgba(255, 255, 255, 0.1);
  --hairline-strong: rgba(255, 255, 255, 0.16);
  --glass-fill: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  --glass-shadow: 0 18px 50px -18px rgba(0, 0, 0, 0.85), 0 2px 8px rgba(0, 0, 0, 0.4);
  --inset-hi: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  --blur: saturate(140%) blur(18px);
  --maxw: 1100px;
  --radius: 16px;
  --radius-sm: 11px;
}

* {
  box-sizing: border-box;
}

.fe-body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Ambient atmosphere (mirrors the landing page) */
.fe-body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1100px 540px at 78% -8%, rgba(45, 185, 232, 0.13), transparent 60%),
    radial-gradient(900px 600px at 8% 108%, rgba(45, 185, 232, 0.06), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}
.fe-body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  opacity: 0.32;
}

a {
  color: inherit;
  text-decoration: none;
}
::selection {
  background: rgba(45, 185, 232, 0.28);
  color: #fff;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--iron-bright);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ============ Header / nav ============ */
.fe-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 11, 15, 0.62);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
  -webkit-backdrop-filter: saturate(150%) blur(16px);
  backdrop-filter: saturate(150%) blur(16px);
  border-bottom: 1px solid var(--hairline);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 10px 30px -20px rgba(0, 0, 0, 0.9);
}
.fe-header-inner {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.fe-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-right: auto;
  font-weight: 600;
  font-size: 1.12rem;
  color: var(--head);
  letter-spacing: 0.01em;
}
.fe-brand img {
  height: 32px;
  width: 32px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
}
.fe-brand b {
  color: var(--iron-bright);
  font-weight: 700;
}

.fe-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.fe-navlink {
  padding: 9px 14px;
  border-radius: 9px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-dim);
  transition: color 0.18s ease, background 0.18s ease;
}
.fe-navlink:hover {
  color: var(--head);
  background: rgba(255, 255, 255, 0.05);
}
.fe-navlink--cta {
  color: #04141c;
  background: linear-gradient(180deg, var(--iron-bright), var(--iron));
  font-weight: 600;
  box-shadow: 0 8px 22px -10px rgba(45, 185, 232, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.fe-navlink--cta:hover {
  color: #04141c;
  background: linear-gradient(180deg, var(--iron-bright), var(--iron));
  transform: translateY(-1px);
}
.fe-navbtn {
  font-family: "Space Grotesk", sans-serif;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--hairline-strong);
  color: var(--head);
  border-radius: 9px;
  padding: 8px 14px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.fe-navbtn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(121, 215, 242, 0.5);
}

/* ============ Main / panels ============ */
.fe-main {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 3rem 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.fe-card {
  position: relative;
  width: 100%;
  max-width: 34rem;
  background: var(--glass-fill);
  background-color: rgba(13, 18, 24, 0.55);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--hairline);
  box-shadow: var(--glass-shadow), var(--inset-hi);
  border-radius: var(--radius);
  padding: 2.25rem;
  overflow: hidden;
}
/* Iron filament along the top edge. */
.fe-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--iron), transparent);
  opacity: 0.65;
}
.fe-card--wide {
  max-width: 52rem;
}

/* Mono kicker label (signature of the brand) */
.fe-kicker {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--iron-bright);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin-bottom: 0.85rem;
}
.fe-kicker::before {
  content: "";
  width: 22px;
  height: 1px;
  background: linear-gradient(90deg, var(--iron), transparent);
}

.fe-title {
  margin: 0 0 0.4rem;
  font-size: 1.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--head);
}
.fe-subtitle {
  margin: 1.75rem 0 0.85rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--head);
}
.fe-lead {
  margin: 0 0 0.4rem;
  color: var(--text);
  font-size: 1.05rem;
}
.fe-muted {
  margin: 0 0 1.5rem;
  color: var(--text-dim);
  font-size: 0.95rem;
}
.fe-mono-dim {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ============ Buttons / links ============ */
.fe-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 10px;
  padding: 11px 20px;
  cursor: pointer;
  border: 1px solid transparent;
  color: #04141c;
  background: linear-gradient(180deg, var(--iron-bright), var(--iron));
  box-shadow: 0 8px 22px -8px rgba(45, 185, 232, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: transform 0.16s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  text-align: center;
}
.fe-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -10px rgba(45, 185, 232, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.fe-btn:active {
  transform: translateY(0);
}
.fe-btn--ghost {
  color: var(--head);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--hairline-strong);
  box-shadow: none;
  margin-top: 1.25rem;
}
.fe-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(121, 215, 242, 0.5);
  box-shadow: none;
}
/* Destructive ghost (e.g. cancel-at-Paddle). Reads as a restrained warning until
   hovered, when the danger accent commits. */
.fe-btn--danger {
  color: var(--danger);
  border-color: rgba(255, 107, 107, 0.4);
}
.fe-btn--danger:hover {
  color: var(--head);
  background: rgba(255, 107, 107, 0.14);
  border-color: rgba(255, 107, 107, 0.65);
}
/* Full-width button (federated sign-in). */
.fe-btn--block {
  display: flex;
  width: 100%;
  margin-top: 1rem;
}
/* "or" divider between the federated button and the email/password form. */
.fe-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.1rem 0 0.2rem;
  color: var(--text-dim);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.fe-divider::before,
.fe-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--hairline);
}

.fe-link {
  color: var(--iron-bright);
  border-bottom: 1px solid rgba(121, 215, 242, 0.35);
  transition: border-color 0.16s ease, color 0.16s ease;
}
.fe-link:hover {
  color: #a6e6fa;
  border-color: var(--iron-bright);
}

.fe-cta-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 1.5rem 0;
}

/* ============ Layout helpers ============ */
.fe-row-between {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* ============ Forms ============ */
.fe-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.5rem 0;
}
.fe-label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.fe-input {
  font-family: "Space Grotesk", sans-serif;
  background: rgba(5, 8, 11, 0.6);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.8rem;
  color: var(--head);
  font-size: 0.98rem;
  text-transform: none;
  letter-spacing: normal;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.fe-input:focus {
  outline: none;
  border-color: var(--iron);
  box-shadow: 0 0 0 3px rgba(45, 185, 232, 0.18);
}
.fe-hint {
  font-family: "Space Grotesk", sans-serif;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-dim);
  font-size: 0.78rem;
}
.fe-alert {
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.4);
  color: #ffb3b3;
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  font-size: 0.9rem;
}
/* Positive / neutral confirmation (password-reset sent, reset complete). */
.fe-notice {
  background: rgba(61, 220, 151, 0.1);
  border: 1px solid rgba(61, 220, 151, 0.38);
  color: #9af0c8;
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  font-size: 0.9rem;
}

/* ============ Lists / badges / tables ============ */
.fe-empty {
  border: 1px dashed var(--hairline-strong);
  border-radius: var(--radius);
  padding: 2.25rem;
  text-align: center;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  align-items: center;
}
.fe-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.fe-list-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
  transition: border-color 0.16s ease, background 0.16s ease;
}
.fe-list-item:hover {
  border-color: rgba(121, 215, 242, 0.35);
  background: rgba(255, 255, 255, 0.05);
}
.fe-list-item--col {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}
.fe-list-link {
  flex: 1;
  color: var(--head);
  font-weight: 600;
}
.fe-input--sm {
  padding: 0.3rem 0.45rem;
  font-size: 0.82rem;
}
.fe-inline-form {
  margin: 0;
}
.fe-list-link:hover {
  color: var(--iron-bright);
}
.fe-badge {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--hairline-strong);
  color: var(--text-dim);
}
.fe-badge--role {
  color: var(--iron-bright);
  border-color: rgba(45, 185, 232, 0.45);
  background: rgba(45, 185, 232, 0.08);
}

.fe-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.fe-table th,
.fe-table td {
  text-align: left;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--hairline);
}
.fe-table th {
  font-family: "JetBrains Mono", monospace;
  color: var(--text-dim);
  font-weight: 500;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.fe-table td {
  color: var(--text);
}

/* ============ Misc ============ */
.fe-ping {
  margin-top: 1rem;
  min-height: 1.5rem;
}
.fe-ping-result {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  color: var(--green);
}

.fe-footer {
  border-top: 1px solid var(--hairline);
  background: rgba(8, 11, 15, 0.4);
}
.fe-footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.1rem 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--text-dim);
  font-size: 0.82rem;
}

/* ============ Scenario library ============ */
.fe-scenario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem;
  margin-bottom: 0.5rem;
}
.fe-scenario-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.1rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}
.fe-scenario-card:hover {
  border-color: rgba(121, 215, 242, 0.4);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}
.fe-scenario-title {
  color: var(--head);
  font-weight: 600;
  font-size: 1.02rem;
  line-height: 1.3;
}
.fe-scenario-meta {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--text-dim);
}
.fe-badge--cat {
  align-self: flex-start;
  color: var(--iron-bright);
  border-color: rgba(45, 185, 232, 0.45);
  background: rgba(45, 185, 232, 0.08);
}
.fe-badge--type {
  color: var(--warm);
  border-color: rgba(255, 138, 93, 0.4);
}
.fe-meta-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0 0 1.25rem;
}

/* ============ Scenario detail ============ */
.fe-role-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}
.fe-role {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--hairline);
  border-left: 2px solid var(--iron);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(255, 255, 255, 0.02);
}
.fe-role-name {
  color: var(--head);
  font-weight: 600;
  font-size: 0.92rem;
}
.fe-role-desc {
  color: var(--text-dim);
  font-size: 0.82rem;
}

/* Inject timeline — the signature element */
.fe-timeline {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
}
.fe-tl-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 1rem;
}
.fe-tl-time {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--iron-bright);
  text-align: right;
  padding-top: 0.1rem;
}
.fe-tl-body {
  position: relative;
  border-left: 1px solid var(--hairline-strong);
  padding: 0 0 1.4rem 1.25rem;
}
.fe-tl-body::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.25rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--iron);
  box-shadow: 0 0 0 3px rgba(45, 185, 232, 0.18);
}
.fe-tl-item:last-child .fe-tl-body {
  border-left-color: transparent;
  padding-bottom: 0.25rem;
}
.fe-tl-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}
.fe-tl-title {
  color: var(--head);
  font-weight: 600;
}
.fe-tl-narrative {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* Decision prompts */
.fe-prompt-list {
  list-style: none;
  counter-reset: prompt;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.fe-prompt {
  counter-increment: prompt;
  position: relative;
  padding: 0.7rem 0.9rem 0.7rem 2.4rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  font-size: 0.92rem;
}
.fe-prompt::before {
  content: counter(prompt, decimal-leading-zero);
  position: absolute;
  left: 0.85rem;
  top: 0.7rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--iron-bright);
}

/* Scenario form extras */
.fe-textarea {
  resize: vertical;
  min-height: 4.5rem;
  font-family: "Space Grotesk", sans-serif;
}
.fe-field-row {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}
.fe-field-row .fe-label {
  flex: 1;
  min-width: 8rem;
}
.fe-label--narrow {
  max-width: 7rem;
}

/* ============ Exercise status badges ============ */
.fe-status {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--hairline-strong);
  color: var(--text-dim);
  white-space: nowrap;
}
.fe-status--scheduled {
  color: var(--iron-bright);
  border-color: rgba(45, 185, 232, 0.45);
  background: rgba(45, 185, 232, 0.08);
}
.fe-status--running {
  color: var(--green);
  border-color: rgba(61, 220, 151, 0.45);
  background: rgba(61, 220, 151, 0.08);
}
.fe-status--paused {
  color: var(--warm);
  border-color: rgba(255, 138, 93, 0.45);
  background: rgba(255, 138, 93, 0.08);
}
.fe-status--cancelled {
  color: #ffb3b3;
  border-color: rgba(255, 107, 107, 0.4);
}

/* ============ Participants + inline forms ============ */
.fe-participants {
  margin-bottom: 0.5rem;
}
.fe-form--inline {
  margin: 1rem 0 0;
  gap: 0.75rem;
}
.fe-cell-action {
  text-align: right;
  width: 1%;
  white-space: nowrap;
}
.fe-btn--sm {
  padding: 7px 14px;
  font-size: 0.85rem;
}
.fe-navbtn--sm {
  padding: 4px 10px;
  font-size: 0.78rem;
}

/* ============ Live room ============ */
.fe-live-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.fe-live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.6);
  animation: fe-pulse 1.8s ease-out infinite;
}
@keyframes fe-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.5);
  }
  100% {
    box-shadow: 0 0 0 10px rgba(61, 220, 151, 0);
  }
}
.fe-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}
.fe-tl-actions {
  display: inline-flex;
  gap: 0.5rem;
  margin-left: auto;
}
@media (prefers-reduced-motion: reduce) {
  .fe-live-dot {
    animation: none;
  }
}

/* ============ Orchestrated page-load reveal ============ */
@keyframes fe-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.fe-header {
  animation: fe-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.fe-card {
  animation: fe-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

@media (prefers-reduced-motion: reduce) {
  .fe-header,
  .fe-card,
  .fe-btn,
  .fe-list-item {
    animation: none;
    transition: none;
  }
}

@media (max-width: 640px) {
  .fe-header-inner {
    padding: 0 16px;
  }
  .fe-main {
    padding: 2rem 16px;
  }
  .fe-card {
    padding: 1.5rem;
  }
}

/* ============ Loading states ============ */
/* Global top progress bar — toggled by /static/js/app.js on htmx requests. */
#fe-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--iron), var(--iron-bright));
  box-shadow: 0 0 12px rgba(45, 185, 232, 0.6);
  opacity: 0;
  z-index: 9999;
  pointer-events: none;
}
.fe-loading #fe-progress {
  opacity: 1;
  animation: fe-progress 1.3s ease-out infinite;
}
@keyframes fe-progress {
  0% {
    transform: scaleX(0);
    opacity: 1;
  }
  65% {
    transform: scaleX(0.72);
    opacity: 1;
  }
  100% {
    transform: scaleX(1);
    opacity: 0;
  }
}

/* Inline spinner — pair with `htmx-indicator` to reveal only mid-request. */
.fe-spinner {
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -0.12em;
  margin-right: 0.4em;
  animation: fe-spin 0.6s linear infinite;
}
@keyframes fe-spin {
  to {
    transform: rotate(360deg);
  }
}
.fe-spinner.htmx-indicator {
  display: none;
}
.htmx-request .fe-spinner.htmx-indicator,
.htmx-request.fe-spinner.htmx-indicator {
  display: inline-block;
}

/* Disabled controls (incl. hx-disabled-elt during an in-flight request). */
.fe-btn:disabled,
.fe-btn[disabled],
.fe-btn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: progress;
  pointer-events: none;
}

/* ============ Cookie consent ============ */
.fe-footer-meta {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
}
.fe-consent {
  display: none;
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  z-index: 9998;
  width: min(680px, calc(100% - 2rem));
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1rem;
  background: rgba(13, 18, 24, 0.94);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
.fe-consent.is-open {
  display: flex;
}
.fe-consent-text {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-dim);
  line-height: 1.45;
}
.fe-consent .fe-btn {
  flex: 0 0 auto;
}
@media (max-width: 520px) {
  .fe-consent {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ============ Error pages ============ */
.fe-errcode {
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(3rem, 12vw, 5.5rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--iron);
  text-shadow: 0 0 32px rgba(45, 185, 232, 0.35);
}

@media (prefers-reduced-motion: reduce) {
  .fe-spinner,
  .fe-loading #fe-progress {
    animation: none;
  }
}

/* ============ Landing page ============ */
.fe-aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1100px 540px at 78% -8%, rgba(45, 185, 232, 0.13), transparent 60%),
    radial-gradient(900px 600px at 8% 108%, rgba(45, 185, 232, 0.06), transparent 60%),
    radial-gradient(700px 460px at 92% 96%, rgba(255, 138, 93, 0.05), transparent 60%);
}

.fe-hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3rem;
  align-items: center;
  padding: 2.5rem 0 3.5rem;
}
.fe-hero-copy {
  animation: fe-rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}
.fe-hero-title {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: clamp(2.2rem, 5.2vw, 3.6rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--head);
  margin: 0.6rem 0 1.1rem;
}
.fe-hero-accent {
  background: linear-gradient(92deg, var(--iron), var(--iron-bright));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.fe-btn--lg {
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
}

.fe-hero-panel {
  background: var(--glass-fill);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow), var(--inset-hi);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  padding: 1rem 1.1rem 1.2rem;
  animation: fe-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.18s both;
}
.fe-win {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 0.85rem;
}
.fe-win-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--hairline-strong);
}
.fe-win-dot:nth-child(1) { background: var(--warm); }
.fe-win-dot:nth-child(2) { background: #f1c453; }
.fe-win-dot:nth-child(3) { background: var(--green); }
.fe-win-title {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
  color: var(--text-dim);
  margin-left: 0.4rem;
}
.fe-win .fe-live-dot {
  margin-left: auto;
}
.fe-mini-tl {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.fe-mini-tl li {
  display: flex;
  gap: 0.7rem;
  align-items: baseline;
  font-size: 0.82rem;
  color: var(--text);
}
.fe-mini-t {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--iron);
  flex: 0 0 auto;
}
.fe-mini-foot {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--hairline);
}
.fe-grade {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--green);
  line-height: 1;
}

.fe-section {
  padding: 2.75rem 0;
  border-top: 1px solid var(--hairline);
}
.fe-section .fe-kicker {
  display: block;
  margin-bottom: 1.4rem;
}
.fe-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.fe-feature {
  background: var(--glass-fill);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 1.3rem 1.2rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.fe-feature:hover {
  transform: translateY(-3px);
  border-color: var(--hairline-strong);
}
.fe-feature-ix {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  color: var(--iron);
}
.fe-feature h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.06rem;
  color: var(--head);
  margin: 0.5rem 0 0.45rem;
}
.fe-feature p {
  font-size: 0.88rem;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.5;
}

.fe-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.4rem;
}
.fe-step {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}
.fe-step-n {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--iron);
  color: var(--iron);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
}
.fe-step h4 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.98rem;
  color: var(--head);
  margin: 0.25rem 0 0.3rem;
}
.fe-step p {
  font-size: 0.86rem;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.5;
}

.fe-band {
  margin: 2.75rem 0;
  padding: 2.25rem;
  text-align: center;
  background: var(--glass-fill);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--inset-hi);
}
.fe-band .fe-lead {
  max-width: 60ch;
  margin: 0.8rem auto 0;
}
.fe-section--cta {
  text-align: center;
  border-top: 1px solid var(--hairline);
}
.fe-section--cta .fe-cta-row {
  justify-content: center;
}

/* ============ Pricing ============ */
.fe-price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.fe-price-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  background: var(--glass-fill);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 1.4rem 1.3rem;
}
.fe-price-card--featured {
  border-color: rgba(45, 185, 232, 0.55);
  box-shadow: 0 0 0 1px rgba(45, 185, 232, 0.25), 0 18px 50px -24px rgba(45, 185, 232, 0.4);
}
.fe-price-badge {
  position: absolute;
  top: -0.7rem;
  right: 1rem;
  background: var(--iron);
  color: #04222e;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
}
.fe-price-name {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.fe-price-amount {
  font-family: "Space Grotesk", sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--head);
  margin: 0;
  line-height: 1;
}
.fe-price-amount span {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dim);
}
.fe-price-list {
  list-style: none;
  margin: 0.3rem 0 0.6rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}
.fe-price-list li {
  font-size: 0.87rem;
  color: var(--text);
  padding-left: 1.2rem;
  position: relative;
}
.fe-price-list li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--iron);
}
.fe-price-card .fe-btn,
.fe-price-card .fe-link {
  margin-top: auto;
}

/* ============ Billing (per-product subscription panel) ============ */
.fe-bill-product {
  padding: 1.5rem 0;
  border-top: 1px solid var(--hairline);
}
.fe-bill-product:first-of-type {
  border-top: none;
  padding-top: 0.5rem;
}
.fe-bill-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}
.fe-bill-head .fe-subtitle {
  margin: 0;
}
.fe-bill-current {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 1.2rem;
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.1rem;
  background: var(--glass-fill);
  border: 1px solid var(--hairline);
  border-left: 2px solid var(--iron);
  border-radius: var(--radius-sm);
}
.fe-bill-current-main {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  flex-wrap: wrap;
}
.fe-bill-plan {
  font-weight: 600;
  color: var(--head);
}
.fe-bill-current-meta {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  flex-wrap: wrap;
}
/* Self-service "manage / cancel" bar — same glass-with-iron-edge treatment as the
   current-plan strip, but laid out as copy + action. */
.fe-bill-manage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  margin: 1.4rem 0 0.5rem;
  padding: 1rem 1.2rem;
  background: var(--glass-fill);
  border: 1px solid var(--hairline);
  border-left: 2px solid var(--iron);
  border-radius: var(--radius-sm);
}
.fe-bill-manage-copy {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-width: 46ch;
}
.fe-bill-manage-copy .fe-hint {
  margin: 0;
}
.fe-bill-manage .fe-btn {
  margin-top: 0;
  flex-shrink: 0;
}

@media (max-width: 760px) {
  .fe-hero {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .fe-hero-panel {
    order: 2;
  }
}
@media (prefers-reduced-motion: reduce) {
  .fe-hero-copy,
  .fe-hero-panel {
    animation: none;
  }
  .fe-feature {
    transition: none;
  }
}

/* ============================================================
   Admin console (P5) — staff "mission control" within the brand
   ============================================================ */

.fe-adm-body { background: var(--bg); }

.fe-adm {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}

/* ----- left command rail ----- */
.fe-adm-rail {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  padding: 1.5rem 1.1rem;
  border-right: 1px solid var(--hairline);
  background:
    linear-gradient(180deg, rgba(45, 185, 232, 0.05), rgba(0, 0, 0, 0)) 0 0 / 100% 220px no-repeat,
    repeating-linear-gradient(0deg, transparent 0 23px, rgba(255, 255, 255, 0.014) 23px 24px),
    var(--bg-2);
}
.fe-adm-brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.fe-adm-brand img { border-radius: 7px; }
.fe-adm-brand-txt {
  display: flex;
  flex-direction: column;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--head);
  line-height: 1.15;
}
.fe-adm-brand-txt b { color: var(--iron); font-weight: 700; }
.fe-adm-brand-txt em {
  font-family: "JetBrains Mono", monospace;
  font-style: normal;
  font-size: 0.56rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 3px;
}
.fe-adm-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 0.3rem; }
.fe-adm-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.7rem 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
a.fe-adm-link:hover { color: var(--head); background: rgba(255, 255, 255, 0.04); }
.fe-adm-link.is-active {
  color: var(--head);
  background: linear-gradient(90deg, rgba(45, 185, 232, 0.16), rgba(45, 185, 232, 0.02));
}
.fe-adm-link.is-active::before {
  content: "";
  position: absolute;
  left: -1.1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 1.1rem;
  border-radius: 0 3px 3px 0;
  background: var(--iron);
  box-shadow: 0 0 12px rgba(45, 185, 232, 0.7);
}
.fe-adm-link.is-soon { color: rgba(139, 150, 165, 0.5); cursor: default; }
.fe-adm-link em {
  font-family: "JetBrains Mono", monospace;
  font-style: normal;
  font-size: 0.54rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(139, 150, 165, 0.55);
  border: 1px solid var(--hairline);
  border-radius: 5px;
  padding: 1px 5px;
}
.fe-adm-rail-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--hairline);
}
.fe-adm-who {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fe-adm-rail-actions { display: flex; gap: 0.5rem; }
.fe-adm-railbtn {
  flex: 1;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  text-align: center;
  padding: 0.42rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-dim);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.fe-adm-railbtn:hover { color: var(--head); border-color: var(--hairline-strong); }

/* ----- stage (content column) ----- */
.fe-adm-stage { display: flex; flex-direction: column; min-width: 0; }
.fe-adm-top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 2rem;
  border-bottom: 1px solid var(--hairline);
  background: rgba(7, 10, 13, 0.72);
  backdrop-filter: var(--blur);
}
.fe-adm-crumb {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.fe-adm-crumb-link { color: var(--text-dim); text-decoration: none; }
.fe-adm-crumb-link:hover { color: var(--iron); }
.fe-adm-crumb-sep { color: rgba(139, 150, 165, 0.45); margin: 0 0.1rem; }
.fe-adm-tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--warm);
  border: 1px solid rgba(255, 138, 93, 0.32);
  background: rgba(255, 138, 93, 0.08);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}
.fe-adm-content { width: 100%; max-width: 1080px; margin: 0 auto; padding: 2rem 2rem 4rem; }
.fe-adm-content > * { animation: fe-adm-rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.fe-adm-content > *:nth-child(2) { animation-delay: 0.06s; }
.fe-adm-content > *:nth-child(3) { animation-delay: 0.12s; }
.fe-adm-content > *:nth-child(4) { animation-delay: 0.18s; }
@keyframes fe-adm-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ----- headings ----- */
.fe-adm-head { margin-bottom: 1.6rem; }
.fe-adm-head--detail { border-bottom: 1px solid var(--hairline); padding-bottom: 1.3rem; }
.fe-adm-kicker {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--iron);
}
.fe-adm-kicker--inline { color: var(--text-dim); }
.fe-adm-h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--head);
  margin: 0.25rem 0 0.4rem;
  letter-spacing: -0.01em;
}
.fe-adm-lead { color: var(--text-dim); font-size: 0.95rem; margin: 0; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.fe-adm-dot { color: rgba(139, 150, 165, 0.4); }
.fe-adm-h2 { font-family: "Space Grotesk", sans-serif; font-size: 1.05rem; font-weight: 600; color: var(--head); margin: 0; }
.fe-adm-h3 { font-family: "Space Grotesk", sans-serif; font-size: 0.92rem; font-weight: 600; color: var(--head); margin: 1.5rem 0 0.7rem; }

/* ----- stat cards ----- */
.fe-adm-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.6rem; }
.fe-adm-stat {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.3rem 1.3rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: var(--glass-fill);
  box-shadow: var(--inset-hi);
  text-decoration: none;
}
.fe-adm-stat--link { transition: transform 0.18s, border-color 0.18s; }
.fe-adm-stat--link:hover { transform: translateY(-3px); border-color: rgba(45, 185, 232, 0.4); }
.fe-adm-stat--accent { border-color: rgba(45, 185, 232, 0.3); background: linear-gradient(180deg, rgba(45, 185, 232, 0.1), rgba(45, 185, 232, 0.02)); }
.fe-adm-stat-k { font-family: "JetBrains Mono", monospace; font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); }
.fe-adm-stat-v { font-family: "Space Grotesk", sans-serif; font-size: 2.4rem; font-weight: 700; line-height: 1; color: var(--head); }
.fe-adm-stat-cap { font-size: 0.74rem; color: var(--text-dim); }
.fe-adm-stat--link .fe-adm-stat-cap { color: var(--iron); }

/* ----- panels ----- */
.fe-adm-panel {
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: var(--glass-fill);
  box-shadow: var(--glass-shadow);
  padding: 1.3rem 1.4rem 1.5rem;
  margin-bottom: 1.4rem;
}
.fe-adm-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.fe-adm-more { font-size: 0.8rem; color: var(--iron); text-decoration: none; }
.fe-adm-more:hover { color: var(--iron-bright); }
.fe-adm-count {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--text-dim);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 2px 9px;
}
.fe-adm-split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; align-items: start; }

/* ----- data table ----- */
.fe-adm-tablewrap { overflow-x: auto; margin: 0 -0.3rem; }
.fe-adm-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.fe-adm-table thead th {
  text-align: left;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0 0.65rem 0.6rem;
  border-bottom: 1px solid var(--hairline);
}
.fe-adm-table tbody td { padding: 0.7rem 0.65rem; border-bottom: 1px solid rgba(255, 255, 255, 0.05); vertical-align: middle; }
.fe-adm-table tbody tr:last-child td { border-bottom: none; }
.fe-adm-trow { transition: background 0.12s; }
.fe-adm-trow:hover { background: rgba(255, 255, 255, 0.025); }
.fe-adm-num { text-align: right; font-family: "JetBrains Mono", monospace; color: var(--text); }
.fe-adm-orglink { display: block; color: var(--head); font-weight: 500; text-decoration: none; }
.fe-adm-orglink:hover { color: var(--iron); }
.fe-adm-uname { display: block; color: var(--head); font-weight: 500; }
.fe-adm-id {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  color: rgba(139, 150, 165, 0.7);
  max-width: 32ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fe-adm-id--lg { display: inline; max-width: none; font-size: 0.78rem; color: var(--text-dim); }
.fe-adm-empty-row { text-align: center; color: var(--text-dim); padding: 1.6rem 0; font-style: italic; }

/* ----- search ----- */
.fe-adm-searchbar { position: relative; margin-bottom: 1.4rem; }
.fe-adm-search-i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; pointer-events: none; }
.fe-adm-search-i::before {
  content: ""; position: absolute; top: 0; left: 0; width: 9px; height: 9px;
  border: 1.6px solid var(--text-dim); border-radius: 50%;
}
.fe-adm-search-i::after {
  content: ""; position: absolute; bottom: 0; right: 0; width: 5px; height: 1.6px;
  background: var(--text-dim); transform: rotate(45deg); transform-origin: right center;
}
.fe-adm-search {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline-strong);
  background: var(--bg-2);
  color: var(--head);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.fe-adm-search::placeholder { color: rgba(139, 150, 165, 0.6); }
.fe-adm-search:focus { outline: none; border-color: var(--iron); box-shadow: 0 0 0 3px rgba(45, 185, 232, 0.16); }
.fe-adm-searching {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--iron);
}

/* ----- audit timeline ----- */
.fe-adm-audit { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.fe-adm-audit-row {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  flex-wrap: wrap;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.fe-adm-audit-row:last-child { border-bottom: none; }
.fe-adm-audit-when { font-family: "JetBrains Mono", monospace; font-size: 0.72rem; color: var(--text-dim); min-width: 12rem; }
.fe-adm-audit-action { font-family: "JetBrains Mono", monospace; font-size: 0.8rem; color: var(--iron); }
.fe-adm-audit-entity { font-size: 0.74rem; color: var(--text-dim); }
.fe-adm-audit-actor { font-size: 0.8rem; color: var(--text); margin-left: auto; }
.fe-adm-audit-meta {
  flex-basis: 100%;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--hairline);
  border-radius: 7px;
  padding: 0.3rem 0.5rem;
  overflow-x: auto;
}

/* ----- dashboard staff entry ----- */
.fe-dash-actions { display: flex; align-items: center; gap: 0.9rem; }
.fe-adm-entry {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--warm);
  text-decoration: none;
  border: 1px solid rgba(255, 138, 93, 0.32);
  border-radius: 999px;
  padding: 0.42rem 0.85rem;
  transition: background 0.15s, border-color 0.15s;
}
.fe-adm-entry:hover { background: rgba(255, 138, 93, 0.1); border-color: rgba(255, 138, 93, 0.5); }

/* ----- responsive: collapse the rail ----- */
@media (max-width: 860px) {
  .fe-adm { grid-template-columns: 1fr; }
  .fe-adm-rail {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.8rem;
  }
  .fe-adm-nav { flex-direction: row; flex-wrap: wrap; margin: 0; }
  .fe-adm-link.is-active::before { display: none; }
  .fe-adm-rail-foot { margin: 0 0 0 auto; border: none; padding: 0; flex-direction: row; align-items: center; }
  .fe-adm-stats { grid-template-columns: 1fr; }
  .fe-adm-split { grid-template-columns: 1fr; }
  .fe-adm-content { padding: 1.4rem 1.1rem 3rem; }
}
@media (prefers-reduced-motion: reduce) {
  .fe-adm-content > * { animation: none; }
}

/* ----- user account actions (5b) ----- */
.fe-adm-actions { display: flex; flex-direction: column; gap: 0.4rem; align-items: flex-start; }
.fe-adm-actions form { margin: 0; }
.fe-adm-actions .fe-hint { margin: 0 0 0.7rem; }
.fe-adm-danger-form { margin-top: 0.5rem; }
.fe-adm-btn-danger {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--danger);
  background: rgba(255, 107, 107, 0.08);
  border: 1px solid rgba(255, 107, 107, 0.4);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.95rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.fe-adm-btn-danger:hover { background: rgba(255, 107, 107, 0.16); border-color: var(--danger); }

/* ----- impersonation (5d) ----- */
.fe-imp-banner {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 1.2rem;
  background: linear-gradient(90deg, rgba(255, 138, 93, 0.96), rgba(255, 107, 107, 0.96));
  color: #190a05;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.3);
  box-shadow: 0 8px 26px -12px rgba(0, 0, 0, 0.7);
}
.fe-imp-banner-txt strong { font-weight: 700; }
.fe-imp-banner-tag {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.6rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.32);
  color: #fff;
  border-radius: 4px;
  padding: 1px 6px;
  margin: 0 0.3rem;
}
.fe-imp-banner-end { margin: 0; }
.fe-imp-banner-btn {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  background: #0d1218;
  color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.45);
  border-radius: 8px;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
}
.fe-imp-banner-btn:hover { background: #000; }
.fe-imp-start { display: flex; gap: 0.5rem; margin: 0.3rem 0 0; align-items: stretch; }
.fe-imp-start .fe-input { flex: 1; }

/* ----- audit feed table (5c) ----- */
.fe-adm-feed-entity {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.64rem;
  color: var(--text-dim);
  margin-left: 0.45rem;
}
.fe-adm-feed-meta {
  display: inline-block;
  max-width: 30ch;
  vertical-align: middle;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ----- metrics dashboard (5e) ----- */
.fe-adm-stats--quad { grid-template-columns: repeat(4, 1fr); }
.fe-adm-more-static {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
  color: var(--text-dim);
}

/* 14-day new-users sparkline — bar heights are decile classes (CSP-safe) */
.fe-spark { display: flex; align-items: flex-end; gap: 6px; padding-top: 0.5rem; }
.fe-spark-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.fe-spark-track { width: 100%; height: 120px; display: flex; align-items: flex-end; justify-content: center; }
.fe-spark-bar {
  width: 62%;
  max-width: 26px;
  min-height: 3px;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, var(--iron-bright), var(--iron));
  box-shadow: 0 0 16px -5px rgba(45, 185, 232, 0.65);
  transform-origin: bottom;
  animation: fe-spark-rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}
.fe-spark-x { font-family: "JetBrains Mono", monospace; font-size: 0.6rem; color: var(--text-dim); }
@keyframes fe-spark-rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.fe-h0 { height: 0; } .fe-h1 { height: 10%; } .fe-h2 { height: 20%; } .fe-h3 { height: 30%; }
.fe-h4 { height: 40%; } .fe-h5 { height: 50%; } .fe-h6 { height: 60%; } .fe-h7 { height: 70%; }
.fe-h8 { height: 80%; } .fe-h9 { height: 90%; } .fe-h10 { height: 100%; }

/* horizontal breakdown bars — fill widths are decile classes (CSP-safe) */
.fe-mbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.fe-mbar-row { display: grid; grid-template-columns: 8.5rem 1fr 3rem; align-items: center; gap: 0.85rem; }
.fe-mbar-label {
  font-size: 0.82rem;
  color: var(--text);
  text-transform: capitalize;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fe-mbar-track { height: 12px; border-radius: 6px; background: rgba(255, 255, 255, 0.05); overflow: hidden; }
.fe-mbar-fill {
  display: block;
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--iron), var(--iron-bright));
}
.fe-mbar-val {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--head);
  text-align: right;
}
.fe-w0 { width: 0; } .fe-w1 { width: 10%; } .fe-w2 { width: 20%; } .fe-w3 { width: 30%; }
.fe-w4 { width: 40%; } .fe-w5 { width: 50%; } .fe-w6 { width: 60%; } .fe-w7 { width: 70%; }
.fe-w8 { width: 80%; } .fe-w9 { width: 90%; } .fe-w10 { width: 100%; }

/* last-7-days activity mini-stats */
.fe-adm-mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.fe-adm-ministat {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}
.fe-adm-ministat-v {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1;
  color: var(--head);
}
.fe-adm-ministat-k {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.fe-adm-ministat--warn { border-color: rgba(255, 107, 107, 0.4); }
.fe-adm-ministat--warn .fe-adm-ministat-v { color: var(--danger); }

@media (max-width: 860px) {
  .fe-adm-stats--quad { grid-template-columns: repeat(2, 1fr); }
  .fe-adm-mini { grid-template-columns: repeat(2, 1fr); }
  .fe-mbar-row { grid-template-columns: 7rem 1fr 2.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .fe-spark-bar { animation: none; }
}

/* ---- Admin TOTP 2FA (enrolment QR, secret, recovery codes) ---- */
.fe-totp-qr {
  display: flex;
  justify-content: center;
  margin: 1rem 0;
}
.fe-totp-qr svg {
  width: 220px;
  height: 220px;
  background: #fff;
  padding: 10px;
  border-radius: var(--radius-sm);
  box-shadow: var(--glass-shadow);
}
.fe-totp-secret {
  text-align: center;
  margin: 0.25rem 0 1rem;
}
.fe-totp-secret code {
  display: inline-block;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.85rem;
  font-family: var(--mono, ui-monospace, "JetBrains Mono", monospace);
  letter-spacing: 0.18em;
  color: var(--iron-bright);
  word-break: break-all;
}
.fe-recovery {
  list-style: none;
  padding: 0;
  margin: 1rem 0 1.25rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}
.fe-recovery li code {
  display: block;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  font-family: var(--mono, ui-monospace, "JetBrains Mono", monospace);
  letter-spacing: 0.12em;
  color: var(--text);
}
@media (max-width: 480px) {
  .fe-recovery { grid-template-columns: 1fr; }
}
