:root {
  --bg: #010302;
  --panel: #070b09;
  --panel-soft: #0b120f;
  --line: rgba(0, 255, 117, 0.3);
  --line-strong: rgba(0, 255, 117, 0.55);
  --fg: #f2fff6;
  --muted: #a5c5af;
  --accent: #0aff63;
  --accent-deep: #05c34b;
  --dark-card: rgba(4, 12, 8, 0.85);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  color: var(--fg);
  background:
    radial-gradient(circle at 18% -10%, rgba(14, 96, 50, 0.35), transparent 44%),
    radial-gradient(circle at 84% 4%, rgba(7, 56, 29, 0.28), transparent 36%),
    #000;
}

main {
  background: linear-gradient(180deg, rgba(4, 10, 7, 0.92), rgba(1, 4, 2, 0.96));
  padding: clamp(18px, 2.2vw, 28px);
}

h1, h2, h3 {
  margin-top: 0;
  letter-spacing: .01em;
  color: var(--fg);
}

p, label, li, a, summary, small, span { color: var(--muted); }
a { text-decoration: none; }
a:hover { color: #d4ffe1; }

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 18px;
  background: rgba(2, 6, 4, 0.8);
}

.nav-links { display: flex; gap: 16px; flex-wrap: wrap; }

textarea, input, select {
  width: 100%;
  /* margin: 0px 0px 14px; */
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #050907;
  color: var(--fg);
}

button {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: #e8ffef;
  border-radius: 999px;
  padding: 11px 24px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: .2s ease;
}

button:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 255, 99, 0.12);
}

button:disabled { opacity: .5; cursor: not-allowed; }


.btn-primary,
.btn-outline,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 11px 24px;
  font-weight: 600;
  font-size: 1rem;
  border: 1px solid var(--line-strong);
  cursor: pointer;
  transition: .2s ease;
}

.btn-primary span,
.btn-outline span,
.btn-secondary span {
  color: inherit;
}

.btn-with-icon .button-icon {
  width: 30px;
  height: 30px;
  flex: 29 29 29px;
}

.btn-primary {
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  color: #04140a;
  font-weight: 700;
  border-color: transparent;
}

.hero-actions .btn-primary {
  position: relative;
  overflow: hidden;
}

.hero-actions .btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 70%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
}

.btn-primary:hover {
  filter: brightness(1.07);
  transform: translateY(-2px);
}

.hero-actions .btn-primary:hover::after {
  animation: shineSweep .75s ease;
}

.btn-outline {
  background: rgba(3, 9, 5, 0.9);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.app-container {
  width: min(1100px, 94vw);
  margin: 20px auto;
}

.alert {
  border-radius: 10px;
  padding: 10px 12px;
  margin: 10px 0;
}

.alert-info { background: rgba(44, 92, 180, 0.25); border: 1px solid rgba(71, 130, 221, 0.45); color: #0f1d33; }
.alert-success { background: rgba(21, 120, 71, 0.25); border: 1px solid rgba(42, 171, 96, 0.45); }
.alert-warning { background: rgba(140, 102, 15, 0.25); border: 1px solid rgba(206, 157, 42, 0.45); }
.alert-error { background: rgba(140, 32, 32, 0.25); border: 1px solid rgba(223, 95, 95, 0.45); }

.form-field { margin-bottom: 12px; }
.field-helper { color: #bbcac0; display: block; margin-top: 4px; }
.field-error { color: #f52525; margin: 5px 0 0; }

.badge {
  border-radius: 999px;
  padding: 2px 10px;
  font-size: .82rem;
  border: 1px solid rgba(255,255,255,.25);
}
.badge-info { background: rgba(44,92,180,.25); }
.badge-success { background: rgba(21,120,71,.25); }
.badge-warning { background: rgba(140,102,15,.25); }

.empty-state { text-align: center; border-style: dashed; }

.pricing-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.pricing-table th,
.pricing-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.pricing-table th {
  color: #d8ffea;
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  margin: 8px 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #08bf6e, #33f59e);
  transition: width .2s ease;
}

pre {
  background: #040905;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  overflow: auto;
  color: rgb(189 246 212 / 76%);  
}

.card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  margin: 14px 0;
  background: linear-gradient(165deg, rgba(5, 12, 8, 0.95), rgba(3, 7, 5, 0.9));
}

/* Landing page now intentionally flattened to feel like one seamless zone */
.landing-main {
  background: transparent;
  margin-top: 1px;
  margin-left: 100px;
  margin-right: 100px;  
  margin-bottom: 0;
  padding-top: 14px;
  padding-bottom: 28px;
}

.landing-section {
  border: 0;
  border-radius: 0;
  background: transparent;
  margin: 0 0 44px;
  padding: 0;
}

/* Landing page: outer page-content-root becomes the single full-page canvas */
body.landing-shell main.page-content-root {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: linear-gradient(
    180deg,
    rgba(3, 14, 8, 1) 0%,
    rgba(2, 9, 5, 1) 28%,
    rgba(1, 5, 3, 1) 58%,
    rgba(0, 2, 1, 1) 82%,
    #000000 100%
  );
}

.hero {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
  gap: clamp(16px, 3vw, 32px);
  min-height: min(82vh, 720px);
}

.logo-saas {
  width: min(92%, 520px);
  display: block;
  margin-bottom: clamp(20px, 3vw, 34px);
}

.eyebrow {
  margin: 0;
  font-size: clamp(1.3rem, 2.2vw, 2rem);
  color: var(--accent);
}

.hero-description {
  margin-top: 18px;
  font-size: clamp(1.04rem, 1.5vw, 1.95rem);
  line-height: 1.42;
  max-width: 54ch;
  color: #d7e4dc;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.hero-robot {
  width: min(100%, 620px);
  justify-self: end;
  filter: drop-shadow(0 18px 36px rgba(0, 0, 0, 0.6));
}

.marketing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.product-visual-slot .slot-label {
  margin: 0 0 6px;
  font-size: .82rem;
  letter-spacing: .06em;
  color: var(--accent);
  text-transform: uppercase;
}

.slot-placeholder {
  margin-top: 10px;
  border: 1px dashed rgba(16, 255, 124, 0.45);
  border-radius: 12px;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b9cfbf;
  background: rgba(5, 18, 12, 0.65);
}

/* Keep roundrect for features cards */
.value-card {
  border: 1px solid rgba(16, 255, 124, 0.26);
  border-radius: 14px;
  padding: 14px;
  background: linear-gradient(160deg, rgba(8, 24, 16, 0.95), rgba(3, 10, 6, 0.95));
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .4s ease, transform .4s ease, box-shadow .35s ease, border-color .35s ease;
}
.value-card.vc-revealed {
  opacity: 1;
  transform: translateY(0);
}
.value-card:hover {
  transform: translateY(-8px) scale(1.02) rotateX(4deg);
  border-color: rgba(16, 255, 124, 0.68);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.45), 0 0 18px rgba(10, 255, 99, 0.2);
  background: radial-gradient(circle at 50% 30%, rgba(10,255,99,.05) 0%, transparent 70%),
              linear-gradient(160deg, rgba(8, 24, 16, 0.95), rgba(3, 10, 6, 0.95));
}

.value-card h3 {
  color: #dfffe9;
  margin-bottom: 8px;
}
.feature-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(16, 255, 124, 0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ecfff3;
  background: rgba(4, 20, 11, 0.9);
  margin-bottom: 10px;
}

.feature-icon svg {
  width: 18px;
  height: 18px;
}


.metrics-proof {
  position: relative;
}

.metrics-proof::before {
  content: "";
  position: absolute;
  inset: -20px 0 -10px;
  background:
    repeating-linear-gradient(160deg, transparent 0 24px, rgba(16, 255, 124, .09) 25px 26px);
  z-index: -1;
  opacity: .45;
}

@property --value {
  syntax: "<number>";
  inherits: false;
  initial-value: 0;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 22px;
}

.metric-card {
  text-align: center;
}

.donut {
  --pct: 80;
  --value: 0;
  width: 172px;
  aspect-ratio: 1;
  margin: 8px auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--accent-deep) calc(var(--value) * 1%), rgba(217, 217, 217, 0.18) 0);
  transition: transform .3s ease;
}
.donut.donut-active {
  animation: spinIn 1.2s ease both, fillDonut 1.4s ease-out .15s forwards;
}

.donut::before {
  content: "";
  width: 114px;
  height: 114px;
  border-radius: 50%;
  background: #050806;
  box-shadow: inset 0 0 0 1px rgba(10, 255, 99, .25);
}

.donut span {
  position: absolute;
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
}

.metric-card h3 {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 2rem);
  color: #fff;
}

.metric-card:hover .donut {
  transform: scale(1.04);
}

.use-cases-carousel {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  padding-bottom: 6px;
}

.use-cases-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 1fr);
  gap: 12px;
}


.use-case-card {
  scroll-snap-align: start;
  border: 1px solid rgba(10, 255, 99, 0.2);
  border-left: 2px solid rgba(10, 255, 99, 0.2);
  border-radius: 14px;
  padding: 16px;
  background: linear-gradient(160deg, rgba(6, 17, 11, 0.95), rgba(3, 10, 6, 0.95));
  opacity: 0;
  transform: translateX(28px);
  transition: opacity .3s ease, transform .3s ease, border-color .25s ease, border-left-color .25s ease, box-shadow .25s ease;
}
.use-case-card.ucc-revealed {
  opacity: 1;
  transform: translateX(0);
}
.use-case-card:hover {
  transform: translateY(-6px);
  border-color: rgba(10, 255, 99, 0.4);
  border-left-color: rgba(10, 255, 99, 0.65);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.38), -2px 0 14px rgba(10, 255, 99, 0.12);
}

.use-case-card h3 {
  margin: 0 0 8px;
  color: #e8ffef;
}

.deployment-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1fr);
  gap: 22px;
  align-items: stretch;
}

.deployment-visual-wrap {
  border: 1px solid rgba(16, 255, 124, 0.2);
  border-radius: 14px;
  overflow: hidden;
  background: #020805;
}

.deployment-visual {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.deployment-cases {
  display: grid;
  gap: 14px;
}

.use-case-card p {
  margin: 0;
  line-height: 1.45;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.pricing-card {
  position: relative;
  border: 1px solid rgba(16, 255, 124, 0.18);
  border-radius: 16px;
  padding: 1.5rem 1.25rem 1.25rem;
  background: linear-gradient(180deg, rgba(10,20,14,.97) 0%, rgba(5,10,7,.99) 100%);
  display: flex;
  flex-direction: column;
  gap: .75rem;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
  overflow: hidden;
}

.pricing-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: transparent;
  border-radius: 16px 16px 0 0;
}

.pricing-card:hover {
  transform: translateY(-5px);
  border-color: rgba(16, 255, 124, 0.38);
  box-shadow: 0 14px 32px rgba(0,0,0,.45), 0 0 20px rgba(10,255,99,.07);
}

.pricing-card.featured {
  box-shadow: 0 0 0 2px rgba(10, 255, 99, .35), 0 16px 28px rgba(0, 0, 0, .45);
}

.price {
  margin: 8px 0 14px;
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
}

.price span {
  font-size: 1rem;
  color: var(--muted);
}

.pricing-card ul {
  margin: 0;
  padding-left: 18px;
  line-height: 1.5;
}

.plan-action {
  margin-top: 14px;
  display: inline-block;
  border: 1px solid rgba(16, 255, 124, 0.58);
  border-radius: 999px;
  padding: 9px 14px;
  color: #e9fff0;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.plan-action:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 0 16px rgba(10, 255, 99, 0.28);
}


.pricing-cta-row td {
  padding-top: 4px;
  padding-bottom: 6px;
}

.pricing-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #1fe26c;
  color: #053116;
  font-weight: 800;
  text-transform: lowercase;
  padding: 4px 12px;
  font-size: .85rem;
}

.monthly-price {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
  color: #f1fff6;
}

/* ── Per-plan pricing card grid ────────────────────────────────────────── */
.pricing-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 1.25rem;
  align-items: start;
}

.pricing-card--featured {
  border-color: rgba(16,255,124,.45) !important;
  box-shadow: 0 0 0 1px rgba(10,255,99,.18), 0 22px 52px rgba(0,0,0,.6), 0 0 52px rgba(10,255,99,.05);
}

.pricing-card--featured::before {
  background: linear-gradient(90deg, rgba(10,255,99,.55), rgba(0,229,255,.8) 50%, rgba(10,255,99,.55));
}

.pricing-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
}

.pricing-card-name {
  margin: 0 0 .2rem;
  font-size: 1.08rem;
  font-weight: 800;
  color: #e8fff3;
  letter-spacing: -.01em;
}

.pricing-card-tagline {
  margin: 0;
  font-size: .71rem;
  color: var(--muted, #607060);
  line-height: 1.3;
}

.pricing-card-badge {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  background: rgba(10,255,99,.1);
  color: #4dff88;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .22rem .55rem;
  border-radius: 999px;
  border: 1px solid rgba(10,255,99,.22);
  margin-top: .05rem;
  flex-shrink: 0;
}

.pricing-price-block {
  display: flex;
  align-items: baseline;
  gap: .3rem;
  line-height: 1;
}

.pricing-monthly {
  font-size: 2.05rem;
  font-weight: 900;
  color: #f1fff6;
  letter-spacing: -.03em;
}

.pricing-period {
  font-size: .77rem;
  color: var(--muted, #888);
  padding-bottom: .15rem;
}

.pricing-annual {
  font-size: .71rem;
  color: var(--muted, #5a6a60);
  margin-top: -.35rem;
  min-height: 1.1em;
}

.pricing-sep {
  border: none;
  border-top: 1px solid rgba(255,255,255,.06);
  margin: 0;
}

.pricing-features {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .48rem;
  font-size: .81rem;
  flex: 1;
}

.pricing-features li {
  display: flex;
  align-items: flex-start;
  gap: .45rem;
  color: #c5f5db;
  line-height: 1.35;
}

.pricing-features .pf-missing {
  color: var(--muted, #484e4a);
}

.pf-icon {
  flex-shrink: 0;
  width: 1.15em;
  text-align: center;
  font-size: .84em;
  margin-top: .06em;
}

/* ── Billing toggle ─────────────────────────────────────────────────────── */
.pricing-toggle-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  margin-bottom: 1.6rem;
}

.pricing-toggle-label {
  font-size: .82rem;
  color: var(--muted, #7a9280);
  display: flex;
  align-items: center;
  gap: .4rem;
}

.pricing-toggle-save {
  display: none;
  background: rgba(10,255,99,.1);
  color: #4dff88;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .18rem .45rem;
  border-radius: 999px;
  border: 1px solid rgba(10,255,99,.22);
}

.pricing-toggle-switch {
  position: relative;
  display: inline-block;
  width: 2.6rem;
  height: 1.4rem;
  cursor: pointer;
  flex-shrink: 0;
}

.pricing-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.pricing-toggle-thumb {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  transition: background .22s ease, border-color .22s ease;
}

.pricing-toggle-thumb::after {
  content: '';
  position: absolute;
  top: .18rem;
  left: .18rem;
  width: .95rem;
  height: .95rem;
  background: #7a9280;
  border-radius: 50%;
  transition: transform .22s ease, background .22s ease;
}

.pricing-toggle-switch input:checked + .pricing-toggle-thumb {
  background: rgba(10,255,99,.18);
  border-color: rgba(10,255,99,.45);
}

.pricing-toggle-switch input:checked + .pricing-toggle-thumb::after {
  transform: translateX(1.2rem);
  background: #1fe26c;
}

.pricing-annual-note {
  text-align: center;
  font-size: .72rem;
  color: var(--muted, #5a6a60);
  margin-top: .9rem;
}

/* Full-width CTA inside pricing card */
.pricing-cards .pricing-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  border-radius: 8px;
  padding: .58rem 1rem;
  font-size: .84rem;
  font-weight: 700;
  text-align: center;
  background: #1fe26c;
  color: #042b14;
  transition: background .2s, transform .15s, box-shadow .2s;
}

.pricing-cards .pricing-cta:hover {
  background: #28ff7a;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(31,226,108,.3);
}

.pricing-cta--outline {
  background: transparent !important;
  border: 1px solid rgba(16,255,124,.32) !important;
  color: #7dffc2 !important;
}

.pricing-cta--outline:hover {
  background: rgba(16,255,124,.06) !important;
  border-color: rgba(16,255,124,.65) !important;
  box-shadow: none !important;
}

.pricing-cta--ghost {
  background: transparent !important;
  border: 1px solid rgba(255,255,255,.09) !important;
  color: var(--muted, #6a7872) !important;
}

.pricing-cta--ghost:hover {
  background: rgba(255,255,255,.04) !important;
  border-color: rgba(255,255,255,.2) !important;
  box-shadow: none !important;
  transform: none !important;
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-item {
  border: 1px solid rgba(16, 255, 124, 0.2);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(7, 15, 10, .84);
}

.faq-item summary {
  cursor: pointer;
  color: #e3ffec;
  font-weight: 700;
}

.faq-item p {
  margin: 10px 0 2px;
}

.social-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(16, 255, 124, 0.4);
  border-radius: 999px;
  padding: 10px 18px;
  color: #e5ffee;
  background: rgba(6, 14, 10, 0.8);
  transition: transform .2s ease, box-shadow .2s ease;
}

.social-logo {
  width: 18px;
  height: 18px;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.social-logo svg {
  width: 100%;
  height: 100%;
  display: block;
}

.social-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 16px rgba(10, 255, 99, 0.3);
}

.final-cta {
  text-align: center;
  padding-bottom: 10px;
}

.final-cta p {
  max-width: 62ch;
  margin: 8px auto 18px;
}

/* ── Sticky-footer layout ────────────────────────────────────────── */
html, body { height: 100%; }
body { display: flex; flex-direction: column; min-height: 100vh; }
main.page-content-root { flex: 1 0 auto; }

/* ── Footer ─────────────────────────────────────────────────────── */
.site-footer {
  flex-shrink: 0;
  margin: 0 auto;
  width: min(1180px, 94vw);
  padding: 20px 0 26px;
  text-align: center;
  border-top: 1px solid transparent;
  border-image: linear-gradient(90deg, transparent, rgba(10,255,99,.25) 30%, rgba(139,92,246,.22) 70%, transparent) 1;
}

.footer-brand {
  display: inline-flex; align-items: center; gap: 7px;
  margin-bottom: 10px; font-size: .92rem;
}
.footer-flag { font-size: 1.1rem; line-height: 1; }
.footer-brand-name { font-weight: 800; color: var(--fg); letter-spacing: -.01em; }
.footer-brand-name em { color: var(--accent); font-style: normal; }
.footer-brand-sep { color: var(--muted); opacity: .4; }
.footer-tagline { color: var(--muted); font-size: .82rem; }

.footer-copy {
  margin: 8px 0 0;
  font-size: .75rem;
  color: var(--muted);
  opacity: .65;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 10px;
  margin: 0 0 2px;
  font-size: .78rem;
}
.footer-legal-link {
  color: var(--muted);
  text-decoration: none;
  opacity: .7;
  transition: opacity .15s, color .15s;
}
.footer-legal-link:hover { opacity: 1; color: var(--accent); }
.footer-lang { font-weight: 600; letter-spacing: .04em; }
.footer-legal-sep { color: var(--muted); opacity: .35; font-size: .7rem; }

.footer-links {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color .2s ease;
}

.footer-links a:hover {
  color: var(--fg);
}

/* Animations */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(22px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

@keyframes spinIn {
  from { transform: rotate(-80deg) scale(.6); opacity: 0; }
  to { transform: rotate(0deg) scale(1); opacity: 1; }
}

@keyframes fillDonut {
  from { --value: 0; }
  to { --value: var(--pct); }
}

@keyframes shineSweep {
  from { left: -120%; }
  to { left: 150%; }
}

@media (prefers-reduced-motion: reduce) {
  .value-card, .use-case-card {
    opacity: 1 !important;
    transform: none !important;
  }
  .donut { animation: spinIn 0.01s linear both, fillDonut 0.01s linear .01s forwards; }
}

.animate-slide-up {
  animation: slideUp .85s ease both;
}

.animate-pop-in {
  animation: popIn .8s cubic-bezier(.2,.8,.2,1) both;
}

.delay-1 { animation-delay: .12s; }
.delay-2 { animation-delay: .22s; }

.animate-float {
  animation: float 4.4s ease-in-out infinite;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.stat-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  background: rgba(4, 12, 8, 0.85);
}

.stat-box strong { display: block; color: var(--fg); font-size: 1.15rem; }

.step-card { display: none; }
.step-card.active { display: block; }
.step-controls { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; }
.step-indicator { margin: 6px 0 12px; color: var(--muted); }

.progress-wrap { margin: 14px 0 16px; }
.progress-meta { display:flex; justify-content:space-between; color: var(--muted); margin-bottom:6px; }
.progress-bar {
  width:100%;
  height:12px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#041008;
  overflow:hidden;
}
.progress-fill {
  height:100%;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  box-shadow: 0 0 14px rgba(57,255,120,.45);
  transition: width .6s ease;
}

.count-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 6px 0 14px;
}

.count-grid label { display: block; color: var(--muted); }
.count-grid input { margin: 6px 0 0; }
.count-grid select { margin: 6px 0 0; }

input[type="checkbox"], input[type="radio"] {
  width: auto;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
}

.checkbox-group, .radio-group {
  display: grid;
  gap: 8px;
  margin: 8px 0 14px;
}

.checkbox-row, .radio-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.quality-axis-stack {
  display: grid;
  gap: 12px;
  margin: 8px 0 16px;
}

.quality-preset-wrap {
  margin: 8px 0 14px;
}

.quality-preset-selector {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  overflow: hidden;
}

.quality-preset-btn {
  border-radius: 0;
  border: 0;
  border-right: 1px solid var(--line-strong);
  background: rgba(4, 10, 7, 0.7);
  padding: 10px 12px;
  font-size: .95rem;
}

.quality-preset-btn:last-child {
  border-right: 0;
}

.quality-preset-btn.is-selected {
  background: rgba(26, 72, 42, 0.8);
  color: #e9fff2;
}

.quality-axis-section {
  margin: 0;
}

.quality-axis-section h3 {
  margin-bottom: 10px;
}

.quality-option-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  overflow: hidden;
}

.quality-option-card {
  border: 0;
  border-right: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  padding: 10px 14px;
  text-align: center;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quality-option-card:last-child {
  border-right: 0;
}

.quality-option-card.is-selected {
  background: linear-gradient(120deg, rgba(38, 220, 92, 0.9), rgba(26, 180, 76, 0.95));
  color: #041d0f;
}

.quality-option-card.is-disabled {
  opacity: 0.5;
  cursor: default;
}

.quality-option-description {
  margin: 10px 0 0;
  min-height: 2.8em;
}

.mode-help { min-height: 84px; }

@media (max-width: 820px) {
  .quality-preset-selector {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-radius: 16px;
  }

  .quality-preset-btn:nth-child(2n) {
    border-right: 0;
  }
}

@media (max-width: 920px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-robot {
    justify-self: center;
    max-width: 430px;
  }

  .deployment-layout {
    grid-template-columns: 1fr;
  }

  .deployment-visual-wrap {
    max-height: 360px;
  }

  .donut {
    width: 142px;
  }

  .donut::before {
    width: 90px;
    height: 90px;
  }

  .donut span {
    font-size: 1.7rem;
  }
}


.challenge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  padding-right: 10px;
}
.challenge-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: var(--dark-card);
}

.bundle-delivery-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.bundle-delivery-bar .alert {
  margin: 0;
  flex: 1;
}
.challenge-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.challenge-card h3 {
  margin: 0;
  font-size: 1rem;
}
.challenge-meta {
  margin: 8px 0;
  color: var(--muted);
}
.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--accent);
  font-size: .85rem;
  white-space: nowrap;
}


.challenge-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.challenge-type-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
}
.challenge-type-icon svg {
  width: 24px;
  height: 24px;
  display: block;
}
.icon-stroke {
  stroke: var(--accent);
}
.icon-mark {
  stroke: #ffffff;
}
.difficulty {
  font-weight: 700;
}
.difficulty-intro {
  color: #c5ffd8;
}
.difficulty-easy {
  color: #7dffb4;
}
.difficulty-medium {
  color: #ffd86b;
}
.difficulty-hard {
  color: #ff9f5f;
}
.difficulty-insane {
  color: #ff6b6b;
}
.difficulty-unknown {
  color: #d0d8d3;
}

.error-card {
  max-width: 720px;
  margin: 20px auto;
}

.error-code {
  margin: 0 0 8px;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

body.auth-page {
  padding-left: 0;
  padding-top: 0;
  background: #eef2ef;
  color: #0d1b16;
}

body.auth-page.auth-page-light {
  background: #eef2ef;
  color: #0f1f1a;
}

body.auth-page main {
  width: auto;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  padding: 0;
}

.auth-shell {
  width: min(760px, 94vw);
  margin: clamp(24px, 8vh, 80px) auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.auth-card {
  border-radius: 18px;
  border: 1px solid rgba(16, 40, 31, 0.14);
  background: #ffffff;
  max-width: 680px;
  margin: 0 auto;
  padding: clamp(24px, 3.8vw, 44px);
  box-shadow: 0 16px 34px rgba(14, 31, 24, 0.10);
}

.auth-form input {
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: #ffffff;
  color: #0e1d19;
}

.auth-form input:focus-visible {
  border-color: #58d301;
}

.auth-brand {
  width: clamp(160px, 24vw, 220px);
  max-height: 64px;
  object-fit: contain;
  display: block;
  margin: 0 auto 14px;
  background: transparent;
}

.auth-subtitle {
  text-align: center;
  margin: -10px auto 24px;
  max-width: 62ch;
  color: #2a4f3f;
}

.auth-card h1 {
  text-align: center;
  margin: 0 0 26px;
  font-size: clamp(1.65rem, 3vw, 2.15rem);
  color: #0d261d;
}

.auth-grid {
  display: grid;
  grid-template-columns: 1fr 28px 1fr;
  gap: 20px;
  align-items: center;
}

.auth-form label {
  display: block;
  margin-bottom: 4px;
  color: #17362a;
  font-weight: 600;
}

.auth-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.auth-row a { color: #237246; font-weight: 600; font-size: .95rem; }
.auth-row a[aria-disabled="true"] { pointer-events: none; opacity: 0.9; }

.auth-divider { display: flex; align-items: center; justify-content: center; color: #5a6d64; font-size: 1.1rem; position: relative; min-height: 100%; }
.auth-divider::before,
.auth-divider::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 1px;
  height: calc(50% - 18px);
  transform: translateX(-50%);
  background: rgba(107, 123, 116, 0.34);
}
.auth-divider::before { top: 0; }
.auth-divider::after { bottom: 0; }

.auth-oidc { display: grid; gap: 12px; margin-top: 8px; }
.auth-oidc-btn {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(16, 40, 31, 0.16);
  background: #f4f8f6;
  color: #123125;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.auth-oidc-icon { font-weight: 800; width: 24px; text-align: center; }
.auth-footer-link { margin: 30px 0 0; text-align: center; font-size: 1.05rem; color: #2b4a3d; }
.auth-footer-link a { color: #1f6f43; font-weight: 700; }

.auth-card .btn-primary {
  background: #2aa65f;
  color: #ffffff;
}

.profile-shell {
  width: min(860px, 94vw);
  margin: 110px auto 56px;
}

.profile-card {
  max-width: 620px;
  margin: 0 auto;
  border-radius: 20px;
  border: 1px solid rgba(143, 241, 192, 0.35);
  background: radial-gradient(circle at 20% 20%, rgba(38, 114, 82, 0.36), rgba(7, 21, 17, 0.95));
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.35);
  padding: 40px 36px;
  text-align: center;
}

.profile-hero-mark {
  font-size: 2rem;
  margin-bottom: 12px;
}

.profile-kicker {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: #9be7bc;
  margin-bottom: 8px;
}

.profile-pseudonym {
  font-size: 2rem;
  font-weight: 700;
  color: #f4fff8;
  margin: 6px 0;
}

.profile-handle {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 1rem;
  color: #bbf5d5;
  margin: 0 0 16px;
}

.profile-note {
  margin: 0;
  color: #d8efe3;
}

body.app-shell.theme-light .profile-card {
  border: 1px solid rgba(26, 92, 63, 0.2);
  background: linear-gradient(160deg, #ffffff, #f3fbf6);
  box-shadow: 0 16px 40px rgba(17, 66, 42, 0.14);
}

body.app-shell.theme-light .profile-kicker {
  color: #1f7a4e;
}

body.app-shell.theme-light .profile-pseudonym {
  color: #0f2f20;
}

body.app-shell.theme-light .profile-handle,
body.app-shell.theme-light .profile-note {
  color: #295743;
}

@media (max-width: 860px) {
  .auth-grid { grid-template-columns: 1fr; }
  .auth-divider { min-height: 36px; }
  .auth-divider::before,
  .auth-divider::after {
    left: 0;
    top: 50%;
    width: calc(50% - 26px);
    height: 1px;
    transform: translateY(-50%);
  }
  .auth-divider::after { left: auto; right: 0; }
  .auth-oidc { margin-top: 0; }
}

.auth-card-login { max-width: 620px; }
.auth-card-signup, .auth-card-narrow { max-width: 560px; margin: 0 auto; }
.auth-card-narrow p { margin: 0 0 18px; }
body.auth-page .site-footer { width: min(760px, 94vw); margin: 0 auto 16px; border-image: none; border-top-color: rgba(0,0,0,.1); }
body.auth-page .site-footer, body.auth-page .site-footer * { color: #1d2c25; }

.adv-cards-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-right: 10px;
}


.mode-toggle {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}

.mode-toggle-btn {
  border: 0;
  border-right: 1px solid var(--line-strong);
  border-radius: 0;
  margin: 0;
  background: transparent;
  color: var(--text);
  padding: 10px 14px;
  font-weight: 700;
}

.mode-toggle-btn:last-child {
  border-right: 0;
}

.mode-toggle-btn.active {
  background: linear-gradient(120deg, rgba(38, 220, 92, 0.9), rgba(26, 180, 76, 0.95));
  color: #041d0f;
}


.advanced-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
  align-items: start;
}

.advanced-stack-panel {
  position: sticky;
  top: 12px;
}

.adv-card {
  position: relative;
  overflow: hidden;
  transition: border-color .18s, box-shadow .18s, transform .15s;
}
.adv-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: rgba(10,255,99,.5);
  border-radius: 16px 0 0 16px;
}

/* Category accent colours — exact match with /challenge-specs */
.adv-card[data-category*="web"]::before      { background: linear-gradient(180deg,#3b82f6,#2563eb); }
.adv-card[data-category*="offsec"]::before   { background: linear-gradient(180deg,#ef4444,#b91c1c); }
.adv-card[data-category*="forensic"]::before { background: linear-gradient(180deg,#a855f7,#7c3aed); }
.adv-card[data-category*="crypto"]::before   { background: linear-gradient(180deg,#f59e0b,#d97706); }
.adv-card[data-category*="osint"]::before    { background: linear-gradient(180deg,#06b6d4,#0891b2); }
.adv-card[data-category*="infra"]::before    { background: linear-gradient(180deg,#6366f1,#4338ca); }
.adv-card[data-category*="cloud"]::before    { background: linear-gradient(180deg,#14b8a6,#0d9488); }
.adv-card[data-category*="siem"]::before     { background: linear-gradient(180deg,#f97316,#ea580c); }
.adv-card[data-category*="pwn"]::before      { background: linear-gradient(180deg,#84cc16,#65a30d); }
.adv-card[data-category*="rev"]::before      { background: linear-gradient(180deg,#22c55e,#16a34a); }
.adv-card[data-category*="misc"]::before     { background: linear-gradient(180deg,#6b7280,#4b5563); }

.adv-card:hover {
  border-color: rgba(10,255,99,.3);
  box-shadow: 0 4px 18px rgba(0,0,0,.08);
  transform: translateY(-2px);
}

/* Category breadcrumb chip */
.adv-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  letter-spacing: .03em;
  margin-bottom: 6px;
  border: 1px solid transparent;
  background: rgba(10,255,99,.08);
  color: #6b7280;
  border-color: rgba(10,255,99,.18);
}
.adv-card[data-category*="web"] .adv-cat-chip      { background:rgba(59,130,246,.1);  border-color:rgba(59,130,246,.25);  }
.adv-card[data-category*="offsec"] .adv-cat-chip   { background:rgba(239,68,68,.1);   border-color:rgba(239,68,68,.25);   }
.adv-card[data-category*="forensic"] .adv-cat-chip { background:rgba(168,85,247,.1);  border-color:rgba(168,85,247,.25);  }
.adv-card[data-category*="crypto"] .adv-cat-chip   { background:rgba(245,158,11,.1);  border-color:rgba(245,158,11,.25);  }
.adv-card[data-category*="osint"] .adv-cat-chip    { background:rgba(6,182,212,.1);   border-color:rgba(6,182,212,.25);   }
.adv-card[data-category*="infra"] .adv-cat-chip    { background:rgba(99,102,241,.1);  border-color:rgba(99,102,241,.25);  }
.adv-card[data-category*="cloud"] .adv-cat-chip    { background:rgba(20,184,166,.1);  border-color:rgba(20,184,166,.25);  }
.adv-card[data-category*="siem"] .adv-cat-chip     { background:rgba(249,115,22,.1);  border-color:rgba(249,115,22,.25);  }
.adv-card[data-category*="pwn"] .adv-cat-chip      { background:rgba(132,204,22,.1);  border-color:rgba(132,204,22,.25);  }
.adv-card[data-category*="rev"] .adv-cat-chip      { background:rgba(34,197,94,.1);   border-color:rgba(34,197,94,.25);   }
.adv-card[data-category*="misc"] .adv-cat-chip     { background:rgba(107,114,128,.1); border-color:rgba(107,114,128,.25); }

/* Stability badge chip */
.adv-stab-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: .7rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.adv-stab--good   { background: rgba(10,255,99,.1);  color: #4ade80; border-color: rgba(10,255,99,.2); }
.adv-stab--medium { background: rgba(251,191,36,.1); color: #fbbf24; border-color: rgba(251,191,36,.2); }
.adv-stab--unknown{ background: rgba(107,114,128,.1); color: #9ca3af; border-color: rgba(107,114,128,.2); }


.difficulty-calibrate-label {
  margin: 6px 0 4px;
  font-size: .75rem;
  font-weight: 600;
  color: var(--muted);
}

.difficulty-slider-wrap {
  margin: 8px 0 10px;
}

/* Redesigned card difficulty slider — matches csl-diff-slider style */
.difficulty-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: 6px;
  outline: none; cursor: pointer; margin: 4px 0;
  background: linear-gradient(to right,
    var(--thumb-color, #0aff63) 0%,
    var(--thumb-color, #0aff63) var(--pct, 0%),
    rgba(107,114,128,.25) var(--pct, 0%));
  transition: background .1s;
}
.difficulty-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--thumb-color, #0aff63); cursor: pointer;
  border: 2px solid rgba(255,255,255,.5);
  box-shadow: 0 0 8px var(--thumb-color, #0aff63);
}
.difficulty-slider::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--thumb-color, #0aff63); cursor: pointer;
  border: 2px solid rgba(255,255,255,.5);
  box-shadow: 0 0 8px var(--thumb-color, #0aff63);
}
body.app-shell.theme-light .difficulty-slider {
  background: linear-gradient(to right,
    var(--thumb-color, #05c34b) 0%,
    var(--thumb-color, #05c34b) var(--pct, 0%),
    #e5e7eb var(--pct, 0%));
}

.global-difficulty-wrap {
  width: min(340px, 50%);
}

.global-difficulty-wrap .difficulty-slider {
  width: 100%;
}

@media (max-width: 720px) {
  .global-difficulty-wrap {
    width: 100%;
  }
}

.difficulty-slider-value {
  margin: 4px 0 0;
  font-size: .8rem;
  font-weight: 700;
}

.difficulty-label--easy   { color: #20b15a; }
.difficulty-label--medium { color: #b89f16; }
.difficulty-label--hard   { color: #c86f0f; }
.difficulty-label--insane { color: #cc3b3b; }

/* Spec card action buttons */
.adv-add-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: .38rem .9rem; border-radius: 999px;
  font-size: .78rem; font-weight: 700;
  background: rgba(10,255,99,.12);
  color: #0aff63;
  border: 1px solid rgba(10,255,99,.3);
  cursor: pointer; transition: background .15s, box-shadow .15s;
}
.adv-add-btn:hover {
  background: rgba(10,255,99,.22);
  box-shadow: 0 0 8px rgba(10,255,99,.25);
}
body.app-shell.theme-light .adv-add-btn {
  background: rgba(5,195,75,.1); color: #1a7a4e; border-color: rgba(5,195,75,.3);
}
body.app-shell.theme-light .adv-add-btn:hover { background: rgba(5,195,75,.18); box-shadow: none; }

.adv-configure-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: .38rem .9rem; border-radius: 999px;
  font-size: .78rem; font-weight: 700;
  background: rgba(239,68,68,.12);
  color: #f87171;
  border: 1px solid rgba(239,68,68,.3);
  cursor: pointer; transition: background .15s, box-shadow .15s;
}
.adv-configure-btn:hover {
  background: rgba(239,68,68,.22);
  box-shadow: 0 0 8px rgba(239,68,68,.2);
}
body.app-shell.theme-light .adv-configure-btn { background: rgba(239,68,68,.08); color: #dc2626; border-color: rgba(239,68,68,.25); }

.btn-mesh {
  display: inline-flex; align-items: center; gap: 5px;
  padding: .38rem .9rem; border-radius: 999px;
  font-size: .78rem; font-weight: 700;
  background: rgba(139,92,246,.12);
  color: #a78bfa;
  border: 1px solid rgba(139,92,246,.3);
  cursor: pointer; transition: background .15s, box-shadow .15s;
}
.btn-mesh:hover {
  background: rgba(139,92,246,.22);
  box-shadow: 0 0 8px rgba(139,92,246,.25);
}
body.app-shell.theme-light .btn-mesh { background: rgba(139,92,246,.1); color: #7c3aed; border-color: rgba(139,92,246,.3); }

/* Stack item mini-card */
.stack-item-mini {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 8px 10px;
  background: var(--panel, rgba(10,30,15,.6));
  border: 1px solid var(--line, rgba(255,255,255,.1));
  border-radius: 10px;
  border-left: 3px solid rgba(10,255,99,.4);
}
.btn-remove {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  font-size: .75rem; font-weight: 700;
  background: rgba(239,68,68,.1);
  color: #f87171;
  border: 1px solid rgba(239,68,68,.25);
  cursor: pointer; transition: background .15s;
}
.btn-remove:hover { background: rgba(239,68,68,.22); }
.stack-item-mini[data-category*="web"]     { border-left-color: #3b82f6; }
.stack-item-mini[data-category*="offsec"]  { border-left-color: #ef4444; }
.stack-item-mini[data-category*="forensic"]{ border-left-color: #a855f7; }
.stack-item-mini[data-category*="crypto"]  { border-left-color: #f59e0b; }
.stack-item-mini[data-category*="osint"]   { border-left-color: #06b6d4; }
.stack-item-mini[data-category*="cloud"]   { border-left-color: #14b8a6; }
.stack-item-mini[data-category*="infra"]   { border-left-color: #6366f1; }
.stack-item-mini[data-category*="siem"]    { border-left-color: #f97316; }
.stack-item-mini[data-category*="pwn"]     { border-left-color: #84cc16; }
.stack-item-mini[data-category*="rev"]     { border-left-color: #22c55e; }
.stack-item-mini[data-category*="misc"]    { border-left-color: #6b7280; }
.stack-item-mini-info { flex: 1; min-width: 0; }
.stack-item-mini-title { font-size: .82rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stack-item-mini-sub { font-size: .72rem; color: var(--muted); }
.stack-diff-badge {
  font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; flex-shrink: 0;
}
.stack-diff--easy   { background:rgba(32,177,90,.15);  color:#20b15a; }
.stack-diff--medium { background:rgba(209,184,42,.15); color:#b89f16; }
.stack-diff--hard   { background:rgba(217,122,18,.15); color:#c86f0f; }
.stack-diff--insane { background:rgba(214,69,69,.15);  color:#cc3b3b; }

.stability-good { color: #39d353; font-weight: 600; }
.stability-medium { color: #f5a524; font-weight: 600; }

/* Upgrade badge — orange pill shown on spec cards requiring a higher plan */
.pill-upgrade {
  background: #7c2d12;
  border-color: #ea580c;
  color: #fed7aa;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
/* Row containing category pill + optional upgrade pill */
.spec-pill-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
/* Locked card — subtle dimming to signal non-interactive state */
.spec-card-locked {
  opacity: 0.82;
}
.spec-card-locked:hover {
  opacity: 1;
}

@media (max-width: 900px) {
  .advanced-layout {
    grid-template-columns: 1fr;
  }

  .advanced-stack-panel {
    position: static;
  }
}

.app-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.app-modal.active {
  display: flex;
}

.app-modal-card {
  width: min(560px, 92vw);
  border: 1px solid var(--line-strong, rgba(255,255,255,.15));
  border-radius: 16px;
  background: var(--card-bg, #0d130f);
  padding: 18px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7);
  color: var(--fg);
}

/* Upgrade modal specific styles */
.upgrade-modal-card {
  position: relative;
  padding: 28px 28px 24px;
  text-align: center;
}

.upgrade-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: inherit;
  opacity: 0.55;
  line-height: 1;
  padding: 4px 6px;
}
.upgrade-modal-close:hover { opacity: 1; }

.upgrade-modal-icon {
  font-size: 2rem;
  margin: 0 0 6px;
  line-height: 1;
}

.upgrade-modal-title {
  margin: 0 0 10px;
  font-size: 1.15rem;
}

.upgrade-modal-body {
  color: var(--muted, #94a3b8);
  font-size: 0.92rem;
  margin: 0 0 20px;
  line-height: 1.5;
}

.upgrade-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}


@media (max-width: 1024px) {
  .adv-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .adv-cards-grid {
    grid-template-columns: 1fr;
  }
}

.history-table {
  width: 100%;
  border-collapse: collapse;
}

.history-table th,
.history-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 8px;
  text-align: left;
}

.billing-packs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

/* Shared animated navbar component */
.app-navbar {
  position: relative;
  overflow: hidden;
  border-color: rgba(10, 255, 99, 0.38);
  background: linear-gradient(120deg, rgba(3, 10, 6, 0.92), rgba(5, 16, 10, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 10px 28px rgba(0, 0, 0, 0.35);
}

.app-navbar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(10, 255, 99, 0.08) 48%, transparent 100%);
  transform: translateX(-55%);
  pointer-events: none;
  animation: navSweep 5.2s ease-in-out infinite;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
  line-height: 0;
}

.nav-brand-logo {
  margin-top: 10px;
  width: clamp(150px, 22vw, 210px);
  height: auto;
  max-height: 52px;
  object-fit: contain;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mobile-nav-toggle {
  display: none;
  border-radius: 12px;
  padding: 6px 10px;
  min-width: 40px;
  line-height: 1;
  font-size: 1.25rem;
}


.app-navbar .nav-links {
  gap: 12px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: #d9fbe5;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.nav-link span {
  color: inherit;
}

.nav-link:hover,
.nav-link:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(10, 255, 99, 0.4);
  background: rgba(10, 255, 99, 0.1);
}

.nav-link.is-active {
  border-color: rgba(10, 255, 99, 0.55);
  background: rgba(10, 255, 99, 0.16);
  color: #f4fff8;
}

.nav-link-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  opacity: 0.9;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  stroke: currentColor;
  display: block;
  opacity: 0.85;
  transition: opacity .15s;
}
.nav-link:hover .nav-icon,
.nav-link:focus-visible .nav-icon,
.nav-link.is-active .nav-icon {
  opacity: 1;
}

/* Keep legacy .nav-emoji for any non-navbar usages */
.nav-emoji {
  font-size: 1.05rem;
  line-height: 1;
  flex: 0 0 auto;
  display: inline-block;
  user-select: none;
}

.nav-link.nav-cta {
  border-color: rgba(10, 255, 99, 0.75);
  background: linear-gradient(90deg, rgba(6, 148, 67, 0.95), rgba(10, 255, 99, 0.9));
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(10, 255, 99, 0.28), 0 10px 22px rgba(0, 0, 0, 0.28);
  font-weight: 700;
}

.nav-link.nav-cta:hover,
.nav-link.nav-cta:focus-visible,
.nav-link.nav-cta.is-active {
  background: linear-gradient(90deg, rgba(7, 167, 74, 1), rgba(40, 255, 124, 0.98));
  color: #ffffff;
  border-color: rgba(10, 255, 99, 0.95);
}

@keyframes navSweep {
  0% { transform: translateX(-55%); }
  55% { transform: translateX(65%); }
  100% { transform: translateX(65%); }
}

@keyframes navPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(10, 255, 99, 0.14); }
  50% { box-shadow: 0 0 24px rgba(10, 255, 99, 0.3); }
}

.my-ctf-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 0.5rem 0 1rem;
}

.my-ctf-tab {
  display: inline-block;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border-color, #334155);
  border-radius: 999px;
  color: inherit;
  text-decoration: none;
  background: transparent;
}

.my-ctf-tab.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: #6366f1;
}

/* ── Shared mc-tabs (used by /my-ctf, /history, /managed) ─────────── */
.mc-tabs-shared {
  display: flex; gap: 4px; margin-bottom: 28px;
  border-bottom: 1px solid var(--line); padding-bottom: 0;
}
.mc-tab-shared {
  padding: 8px 18px; border-radius: 10px 10px 0 0; font-size: .88rem; font-weight: 600;
  color: var(--muted); text-decoration: none; border: 1px solid transparent;
  border-bottom: none; transition: all .15s; position: relative; top: 1px;
}
.mc-tab-shared:hover { color: var(--fg); }
.mc-tab-shared.active {
  color: var(--accent); border-color: var(--line); border-bottom-color: var(--bg, #0b0f0c);
  background: var(--card-bg, #0d130f);
}
.mc-section-count-shared {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; font-size: .7rem; font-weight: 700;
  background: rgba(10,255,99,.15); color: var(--accent); border: 1px solid rgba(10,255,99,.3);
  margin-left: 4px; vertical-align: middle;
}


.is-hidden {
  display: none !important;
}

.mt-1 {
  margin-top: 1rem;
}

/* Backoffice shell layout (does not apply to landing-shell) */
body.app-shell {
  padding-left: 250px;
}

body.app-shell main {
  margin: 100px 28px 10px 40px;
}

body.app-shell main.page-content-root {
  border: none;
  box-shadow: none;
  border-radius: 18px;  
}

.sidebar-nav {
  position: fixed;
  top: 16px;
  left: 16px;
  bottom: 16px;
  width: 220px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: linear-gradient(120deg, rgba(3, 10, 6, 0.92), rgba(5, 16, 10, 0.9));
  display: flex;
  flex-direction: column;
  gap: 18px;
  z-index: 10;
  transition: width .22s ease, padding .22s ease;
  overflow: hidden;
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Collapse button */
.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(10,255,99,.25);
  background: transparent;
  color: rgba(10,255,99,.7);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, color .15s;
  align-self: flex-start;
}
.sidebar-collapse-btn:hover {
  background: rgba(10,255,99,.12);
  color: #adffc8;
}

/* Collapsed sidebar state */
body.app-shell.sidebar-collapsed {
  padding-left: 76px;
}
body.app-shell.sidebar-collapsed main {
  margin-left: 40px;
}
body.app-shell.sidebar-collapsed .sidebar-nav {
  width: 52px;
  padding: 14px 10px;
}
body.app-shell.sidebar-collapsed .sidebar-header .nav-brand-logo {
  display: none;
}
body.app-shell.sidebar-collapsed .sidebar-header {
  justify-content: center;
}
body.app-shell.sidebar-collapsed .nav-label {
  display: none;
}
body.app-shell.sidebar-collapsed .sidebar-links .nav-link {
  justify-content: center;
  padding: 9px 0;
  position: relative;
}
body.app-shell.sidebar-collapsed .sidebar-links .nav-link .nav-emoji,
body.app-shell.sidebar-collapsed .sidebar-links .nav-link .nav-icon {
  margin: 0;
}
/* Tooltip on hover when collapsed */
body.app-shell.sidebar-collapsed .sidebar-links .nav-link::after {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(5, 20, 12, 0.95);
  color: #d9fbe5;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 7px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s;
  border: 1px solid rgba(10,255,99,.2);
  z-index: 100;
}
body.app-shell.sidebar-collapsed .sidebar-links .nav-link:hover::after,
body.app-shell.sidebar-collapsed .sidebar-links .nav-link:focus-visible::after {
  opacity: 1;
}
body.app-shell.sidebar-collapsed .sidebar-collapse-btn {
  align-self: center;
}

.top-right-actions {
  position: fixed;
  top: 16px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 11;
}

.theme-toggle {
  min-width: 44px;
  padding: 8px 10px;
}

.production-goals-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.goal-card {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(4, 10, 7, 0.85);
  color: var(--fg);
  padding: 14px;
  text-align: left;
  display: grid;
  gap: 8px;
}

.goal-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(10, 255, 99, 0.28);
}

body.app-shell.theme-light {
  --bg: #f1f6f2;
  --panel: #ffffff;
  --panel-soft: #f8fbf9;
  --line: rgba(13, 110, 52, 0.22);
  --line-strong: rgba(11, 141, 67, 0.45);
  --fg: #102218;
  --muted: #385645;
  --accent: #0a9e4b;
  --accent-deep: #06763a;
  background: #eaf1ed;
}

body.app-shell.theme-light .app-navbar,
body.app-shell.theme-light .card,
body.app-shell.theme-light main {
  background: #ffffff;
}

body.app-shell.theme-light .sidebar-nav {
  background: linear-gradient(120deg, rgba(3, 10, 6, 0.92), rgba(5, 16, 10, 0.9));
  border-color: rgba(10, 255, 99, 0.28);
}

body.app-shell.theme-light .nav-link {
  color: #214634;
  border-color: transparent;
}

body.app-shell.theme-light .sidebar-nav .nav-link {
  color: #d9fbe5;
}

body.app-shell.theme-light .sidebar-nav .nav-link:hover,
body.app-shell.theme-light .sidebar-nav .nav-link:focus-visible {
  border-color: rgba(10, 255, 99, 0.4);
  background: rgba(10, 255, 99, 0.12);
  color: #f4fff8;
}

body.app-shell.theme-light .sidebar-nav .nav-link.is-active {
  border-color: rgba(10, 255, 99, 0.55);
  background: rgba(10, 255, 99, 0.18);
  color: #f4fff8;
}


body.app-shell.theme-light .nav-link:hover,
body.app-shell.theme-light .nav-link:focus-visible {
  border-color: rgba(10, 158, 75, 0.35);
  background: rgba(10, 158, 75, 0.12);
  color: #153323;
}

body.app-shell.theme-light .nav-link.is-active {
  border-color: rgba(10, 158, 75, 0.6);
  background: rgba(10, 158, 75, 0.18);
  color: #102b1d;
}

body.app-shell.theme-light .nav-link-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

body.app-shell.theme-light .nav-link.nav-cta {
  border-color: rgba(10, 158, 75, 0.8);
  background: linear-gradient(90deg, #0a9e4b, #2ed17c);
  color: #ffffff;
}

body.app-shell.theme-light .nav-link.nav-cta:hover,
body.app-shell.theme-light .nav-link.nav-cta:focus-visible,
body.app-shell.theme-light .nav-link.nav-cta.is-active {
  border-color: rgba(10, 158, 75, 0.95);
  background: linear-gradient(90deg, #089043, #22c06d);
  color: #ffffff;
}

body.app-shell.theme-light .goal-card {
  background: #f5fbf7;
  color: #123224;
  border-color: rgba(13, 110, 52, 0.3);
}

body.app-shell.theme-light .goal-card span,
body.app-shell.theme-light .goal-card strong {
  color: #123224;
}

body.app-shell.theme-light .goal-card.is-selected {
  border-color: #0a9e4b;
  box-shadow: 0 0 0 2px rgba(10, 158, 75, 0.2);
}

body.app-shell.theme-light .quality-preset-selector {
  border-color: rgba(13, 110, 52, 0.45);
}

body.app-shell.theme-light .quality-preset-btn {
  background: transparent;
  color: #1b3e2d;
  border-right-color: rgba(13, 110, 52, 0.45);
}

body.app-shell.theme-light .quality-preset-btn.is-selected {
  background: linear-gradient(120deg, rgba(38, 220, 92, 0.9), rgba(26, 180, 76, 0.95));
  color: #041d0f;
}

body.app-shell.theme-light .quality-option-card {
  background: transparent;
  color: #123224;
  border-color: transparent;
}

body.app-shell.theme-light .quality-option-card:not(:last-child) {
  border-right-color: rgba(13, 110, 52, 0.35);
}

body.app-shell.theme-light .quality-option-card.is-selected {
  background: linear-gradient(120deg, rgba(52, 197, 99, 0.95), rgba(22, 163, 74, 0.95));
  color: #041d0f;
}

body.app-shell.theme-light input,
body.app-shell.theme-light textarea,
body.app-shell.theme-light select {
  background: #ffffff;
  color: #102218;
  border-color: rgba(13, 110, 52, 0.3);
}

body.app-shell.theme-light button {
  color: #1b3e2d;
  border-color: rgba(10, 158, 75, 0.45);
}

body.app-shell.theme-light .btn-outline {
  background: #ffffff;
  color: #1b3e2d;
}

body.app-shell.theme-light .btn-primary {
  color: #ffffff;
  border-color: transparent;
}

body.app-shell.theme-light a:hover {
  color: #0f3a26;
}

body.app-shell.theme-light .stat-box {
  background: #f5fbf7;
}

body.app-shell.theme-light .challenge-card {
  background: #f7fcf9;
  border-color: rgba(13, 110, 52, 0.28);
}

body.app-shell.theme-light .challenge-card h3,
body.app-shell.theme-light .challenge-card p,
body.app-shell.theme-light .challenge-meta {
  color: #173a2a;
}

body.app-shell.theme-light .pill {
  color: #0b8f45;
  border-color: rgba(11, 143, 69, 0.35);
}

@media (max-width: 1024px) {
  body.app-shell {
    padding-left: 0;
    padding-top: 132px;
  }

  body.app-shell main {
    width: min(1180px, 92vw);
    margin: 10px auto 20px;
  }

  .sidebar-nav {
    position: fixed;
    top: 10px;
    left: 10px;
    right: 10px;
    padding: 5px;
    height: auto;
    bottom: auto;
    gap: 10px;
  }

  .sidebar-links {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .top-right-actions {
    top: 74px;
    right: 10px;
    left: 10px;
    justify-content: flex-end;
  }

  .production-goals-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body.app-shell {
    padding-top: 92px;
  }

  body.app-shell main.page-content-root {
    padding-top: 0;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar-nav {
    padding: 10px 12px;
  }

  .sidebar-links {
    display: none;
    flex-direction: column;
    width: 100%;
    padding-top: 6px;
  }

  body.mobile-nav-open .sidebar-links {
    display: flex;
  }

  .top-right-actions {
    position: static;
    margin: 10px 12px 0;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  body.app-shell main {
    margin-top: 18px;
  }
}

/* ================================================================
   Managed CTF Details page  (my_ctf_managed_details.html)
   ================================================================ */

/* Page wrapper */
/* ═══════════════════════════════════════════════════════════════════
   MANAGED CTF DETAILS PAGE
   ═══════════════════════════════════════════════════════════════════ */

.md-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ── Page header ── */
.md-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.md-page-header-left { display: flex; flex-direction: column; gap: 4px; }
.md-page-header-right { display: flex; align-items: center; gap: 8px; }

.md-back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  color: var(--muted);
  transition: color .15s;
}
.md-back-link:hover { color: var(--accent); }
.md-back-link svg { stroke: currentColor; }

.md-page-title { margin: 0; font-size: 1.45rem; }

/* ── Prose output from render_md filter ── */
.md-prose { display: block; line-height: 1.7; }
.md-prose > *:first-child { margin-top: 0; }
.md-prose > *:last-child  { margin-bottom: 0; }
.md-prose p  { margin: 0 0 .85em; }
.md-prose ul,
.md-prose ol { margin: 0 0 .85em; padding-left: 1.5em; }
.md-prose li { margin-bottom: .3em; }
.md-prose h1, .md-prose h2, .md-prose h3, .md-prose h4 { margin: 1em 0 .4em; font-weight: 700; }
.md-prose code {
  background: rgba(255,255,255,.08);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: 'Courier New', monospace;
  font-size: .88em;
}
.md-prose pre {
  background: rgba(0,0,0,.3);
  border-radius: 6px;
  padding: 10px 14px;
  overflow-x: auto;
  margin: 0 0 .85em;
}
.md-prose pre code { background: none; padding: 0; }
body.app-shell.theme-light .md-prose code { background: #f0f2f5; color: #b45309; }
body.app-shell.theme-light .md-prose pre  { background: #f6f8fa; }

/* ── Two-column layout ── */
.md-body {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 18px;
  align-items: start;
}

/* Left column stack */
.md-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* ── Card base ── */
.md-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 24px;
  background: var(--panel-soft);
}
body.app-shell.theme-light .md-card { background: #ffffff; }

.md-card h3 { margin: 0 0 14px; font-size: 1rem; }

/* ── Card section title (h3 with icon) ── */
.md-card-section-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 14px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--fg);
}
.md-card-section-title svg { stroke: var(--accent); flex-shrink: 0; }

/* ── Card header row (title + count badge) ── */
.md-card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.md-card-header-row .md-card-section-title { margin-bottom: 0; }

/* ── Count badge ── */
.md-count-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(10,255,99,.1);
  border: 1px solid rgba(10,255,99,.3);
  color: var(--accent);
}

/* ── Identity card ── */
.md-card--identity {
  border-left: 3px solid var(--accent);
}

.md-identity-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.md-identity-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(10,255,99,.1);
  border: 1px solid rgba(10,255,99,.2);
  color: var(--accent);
  flex-shrink: 0;
}
.md-identity-icon svg { stroke: var(--accent); }

.md-identity-title-block { display: flex; flex-direction: column; gap: 3px; }
.md-identity-title { margin: 0; font-size: 1.15rem; }
.md-identity-meta { margin: 0; font-size: 0.75rem; color: var(--muted); }

.md-identity-fields { display: flex; flex-direction: column; gap: 10px; }

.md-identity-field {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px;
  align-items: center;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,.02);
}
.md-identity-field:hover { background: rgba(10,255,99,.03); }

.md-field-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.md-field-label svg { stroke: var(--muted); flex-shrink: 0; }

.md-field-value { font-size: 0.88rem; color: var(--fg); word-break: break-all; }

/* URL row */
.md-url-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.md-url-link {
  font-size: 0.85rem;
  color: var(--accent);
  word-break: break-all;
  flex: 1;
  min-width: 0;
}
.md-url-link:hover { color: #d4ffe1; }

/* Icon buttons */
.md-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: border-color .15s, color .15s, background .15s;
}
.md-icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(10,255,99,.06);
  box-shadow: none;
  transform: none;
}
.md-icon-btn svg { stroke: currentColor; }
.md-icon-btn--link { text-decoration: none; }
.md-icon-btn:disabled { opacity: .35; cursor: not-allowed; }

/* Password row */
.md-pw-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.md-pw-code { transition: filter .2s; }

/* Inline code */
.md-code-inline {
  background: rgba(10,255,99,.07);
  border: 1px solid rgba(10,255,99,.15);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 0.82rem;
  color: var(--fg);
  font-family: monospace;
}

/* ── Visibility card ── */
.md-card--visibility {}

.md-vis-legend {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}
.md-vis-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}
.md-vis-legend-item svg { flex-shrink: 0; }
.md-vis-legend-item--private svg { stroke: #94a3b8; }
.md-vis-legend-item--public svg { stroke: #4ade80; }
.md-vis-legend-item strong { color: var(--fg); }

.md-vis-toggle-row { margin-bottom: 12px; }

/* Toggle buttons */
.md-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: .15s ease;
  border: 1px solid;
}
.md-toggle-btn svg { stroke: currentColor; flex-shrink: 0; }
.md-toggle-btn--on {
  background: rgba(10,255,99,.12);
  border-color: rgba(10,255,99,.4);
  color: var(--accent);
}
.md-toggle-btn--on:hover {
  background: rgba(10,255,99,.2);
  border-color: var(--accent);
  transform: none;
  box-shadow: none;
}
.md-toggle-btn--off {
  background: rgba(239,68,68,.08);
  border-color: rgba(239,68,68,.35);
  color: #f87171;
}
.md-toggle-btn--off:hover {
  background: rgba(239,68,68,.15);
  border-color: #f87171;
  transform: none;
  box-shadow: none;
}
.md-toggle-btn--sm { padding: 5px 12px; font-size: 0.8rem; }

/* Public link row */
.md-public-link-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(10,255,99,.04);
  border: 1px solid rgba(10,255,99,.12);
  margin-bottom: 12px;
  transition: opacity .2s;
}
.md-public-link-row--dimmed { opacity: .45; }
.md-public-link-code {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  font-size: 0.8rem;
  color: var(--muted);
  word-break: break-all;
  font-family: monospace;
}

/* Enrollment toggle row */
.md-enroll-toggle-row {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.md-enroll-toggle-desc { font-size: 0.8rem; color: var(--muted); max-width: 280px; }
.md-enroll-toggle-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.md-enroll-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 600;
}
.md-enroll-status--open { color: #4ade80; }
.md-enroll-status--closed { color: #94a3b8; }

.md-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.md-status-dot--green { background: #4ade80; box-shadow: 0 0 6px rgba(74,222,128,.6); }
.md-status-dot--gray  { background: #94a3b8; }

/* Notice */
.md-notice {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  margin: 0;
}
.md-notice svg { flex-shrink: 0; }
.md-notice--warn {
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.25);
  color: #f59e0b;
}
.md-notice--warn svg { stroke: #f59e0b; }

/* ── KV list ── */
.md-kv { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.md-kv div { display: grid; grid-template-columns: 130px 1fr; gap: 6px; align-items: baseline; }
.md-kv dt { font-weight: 700; font-size: 0.83rem; color: var(--fg); }
.md-kv dd { margin: 0; font-size: 0.88rem; color: var(--muted); word-break: break-all; }
body.app-shell.theme-light .md-kv dt { color: #102218; }

/* KV with icons in dt */
.md-kv--icons dt {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
}
.md-kv--icons dt svg { stroke: var(--muted); flex-shrink: 0; }

/* Date range display */
.md-kv-date { align-items: start !important; }
.md-dates-range {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.md-date-badge {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
}
.md-date-badge--start { background: rgba(10,255,99,.07); border: 1px solid rgba(10,255,99,.15); }
.md-date-badge--end   { background: rgba(10,255,99,.05); border: 1px solid rgba(10,255,99,.18); }
.md-date-label { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.md-date-arrow { color: var(--muted); font-size: 0.9rem; }

/* ── Quality list ── */
.md-quality-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.md-quality-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(255,255,255,.02);
  gap: 8px;
}
.md-quality-key { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.md-quality-val {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 5px;
  background: rgba(10,255,99,.1);
  border: 1px solid rgba(10,255,99,.2);
  color: var(--accent);
  white-space: nowrap;
}

/* ── Empty state ── */
.md-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px 16px;
  border-radius: 8px;
  border: 1px dashed var(--line);
  text-align: center;
}
.md-empty-state svg { stroke: var(--muted); opacity: .5; }
.md-empty-state p { margin: 0; font-size: 0.84rem; color: var(--muted); }

/* ── Challenges table ── */
.md-challenges-table {
  width: 100%;
  border-collapse: collapse;
}
.md-challenges-table th {
  padding: 9px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.md-challenges-table td {
  padding: 9px 10px;
  font-size: 0.84rem;
  color: var(--fg);
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.md-challenges-table tbody tr:hover { background: rgba(10,255,99,.03); }
.md-challenges-table tbody tr:last-child td { border-bottom: none; }

/* Category pill */
.md-cat-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  background: rgba(10,255,99,.1);
  border: 1px solid rgba(10,255,99,.25);
  color: #4ade80;
  white-space: nowrap;
}

.md-subtype-text { font-size: 0.82rem; color: var(--muted); }

/* Difficulty badges */
.md-diff-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}
/* Default */
.md-diff-badge { background: rgba(148,163,184,.1); border: 1px solid rgba(148,163,184,.2); color: #94a3b8; }
/* Easy / Low / Facile */
.md-diff-badge--easy,
.md-diff-badge--low,
.md-diff-badge--facile { background: rgba(74,222,128,.12); border-color: rgba(74,222,128,.3); color: #4ade80; }
/* Medium / Normal / Moyen */
.md-diff-badge--medium,
.md-diff-badge--normal,
.md-diff-badge--moyen { background: rgba(251,191,36,.12); border-color: rgba(251,191,36,.3); color: #fbbf24; }
/* Hard / High / Difficile */
.md-diff-badge--hard,
.md-diff-badge--high,
.md-diff-badge--difficile { background: rgba(249,115,22,.12); border-color: rgba(249,115,22,.3); color: #f97316; }
/* Expert / Extreme / Insane / Très difficile */
.md-diff-badge--expert,
.md-diff-badge--extreme,
.md-diff-badge--insane,
.md-diff-badge--trèsdifficile { background: rgba(248,113,113,.12); border-color: rgba(248,113,113,.3); color: #f87171; }

/* ── Split card (Event overview | Quality profile) ── */
.md-card-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

/* ── Table wrapper ── */
.md-table-wrap { overflow-x: auto; }

/* ── Sidebar ── */
.md-sidebar {
  min-width: 0;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.md-participants-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.md-participants-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 1.05rem;
}
.md-participants-title svg { stroke: var(--accent); }

/* Participant stats chips */
.md-participants-stats { display: flex; gap: 5px; align-items: center; }
.md-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.md-stat-chip svg { flex-shrink: 0; }
.md-stat-chip--accepted { background: rgba(74,222,128,.1); border: 1px solid rgba(74,222,128,.25); color: #4ade80; }
.md-stat-chip--accepted svg { stroke: #4ade80; }
.md-stat-chip--pending  { background: rgba(251,191,36,.1); border: 1px solid rgba(251,191,36,.25); color: #fbbf24; }
.md-stat-chip--pending svg { stroke: #fbbf24; }
.md-stat-chip--refused  { background: rgba(148,163,184,.08); border: 1px solid rgba(148,163,184,.2); color: #94a3b8; }
.md-stat-chip--refused svg { stroke: #94a3b8; }

/* Enroll + User check buttons row */
.md-participants-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.md-participants-actions form { margin: 0; }

/* Shared small button modifier */
.md-btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 15px;
  font-size: 0.85rem;
}
.md-btn-sm svg { stroke: currentColor; flex-shrink: 0; }
.md-btn-xs { padding: 3px 10px; font-size: 0.78rem; }

/* Inline form (resend, delete) */
.md-form-inline { display: inline; }

/* ── Invite feedback row ── */
.md-invite-feedback {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0;
}
.md-feedback-item {
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}
.md-feedback-item--ok  { background: rgba(74,222,128,.1); border: 1px solid rgba(74,222,128,.25); color: #4ade80; }
.md-feedback-item--warn { background: rgba(251,191,36,.1); border: 1px solid rgba(251,191,36,.25); color: #fbbf24; }
.md-feedback-item--err { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.25); color: #f87171; }

/* ── Invitations section ── */
.md-invitations {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.md-invitations > h3 { margin: 0 0 10px; font-size: 0.88rem; font-weight: 700; color: var(--fg); }

/* Invite buckets with color coding */
.md-invite-bucket {
  margin-bottom: 2px;
  border-radius: 8px;
  overflow: hidden;
}
.md-invite-bucket:last-child { margin-bottom: 0; }

.md-bucket-title {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 7px 7px 0 0;
  cursor: default;
}
.md-bucket-title svg { flex-shrink: 0; }
.md-bucket-count {
  margin-left: auto;
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 700;
}

/* Accepted bucket — green */
.md-invite-bucket--accepted .md-bucket-title {
  background: rgba(74,222,128,.07);
  color: #4ade80;
  border: 1px solid rgba(74,222,128,.15);
}
.md-invite-bucket--accepted .md-bucket-title svg { stroke: #4ade80; }
.md-invite-bucket--accepted .md-bucket-count { background: rgba(74,222,128,.15); color: #4ade80; }

/* Pending bucket — amber */
.md-invite-bucket--pending .md-bucket-title {
  background: rgba(251,191,36,.07);
  color: #fbbf24;
  border: 1px solid rgba(251,191,36,.15);
}
.md-invite-bucket--pending .md-bucket-title svg { stroke: #fbbf24; }
.md-invite-bucket--pending .md-bucket-count { background: rgba(251,191,36,.15); color: #fbbf24; }

/* Refused bucket — gray */
.md-invite-bucket--refused .md-bucket-title {
  background: rgba(148,163,184,.05);
  color: #94a3b8;
  border: 1px solid rgba(148,163,184,.12);
}
.md-invite-bucket--refused .md-bucket-title svg { stroke: #94a3b8; }
.md-invite-bucket--refused .md-bucket-count { background: rgba(148,163,184,.1); color: #94a3b8; }

/* Expired bucket — orange */
.md-invite-bucket--expired .md-bucket-title {
  background: rgba(249,115,22,.07);
  color: #f97316;
  border: 1px solid rgba(249,115,22,.15);
}
.md-invite-bucket--expired .md-bucket-title svg { stroke: #f97316; }
.md-invite-bucket--expired .md-bucket-count { background: rgba(249,115,22,.15); color: #f97316; }

/* Invite list items */
.md-invite-list { list-style: none; margin: 0; padding: 2px 0 4px; }

.md-invite-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 5px;
  transition: background .1s;
}
.md-invite-item:hover { background: rgba(255,255,255,.02); }

.md-invite-item--pending {
  flex-direction: column;
  align-items: stretch;
}
.md-invite-item--expired {
  align-items: center;
}

.md-invite-item-main {
  display: flex;
  align-items: center;
  gap: 6px;
}
.md-invite-item-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.md-invite-email { font-size: 0.82rem; color: var(--fg); }
.md-invite-expires { font-size: 0.72rem; color: var(--muted); }

/* Role pills */
.md-invite-role {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .04em;
  flex-shrink: 0;
}
.md-role--player { background: rgba(10,255,99,.1); border: 1px solid rgba(10,255,99,.25); color: #4ade80; }
.md-role--staff  { background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.25); color: #f59e0b; }

/* ── User check report ── */
.md-user-check-report { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.md-user-check-report h4 { margin: 0 0 10px; font-size: 0.9rem; }

/* ── Danger zone ── */
.md-danger-zone {
  display: flex;
  align-items: center;
  gap: 16px;
  border-color: rgba(239,68,68,.2);
  background: rgba(239,68,68,.03);
}
.md-danger-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.2);
  flex-shrink: 0;
}
.md-danger-icon svg { stroke: #f87171; }
.md-danger-content { flex: 1; min-width: 0; }
.md-danger-content h3 { margin: 0 0 3px; font-size: 0.95rem; color: var(--fg); }
.md-danger-desc { margin: 0; font-size: 0.8rem; color: var(--muted); }

/* ── Utility ── */
.md-muted { font-size: 0.84rem; color: var(--muted); margin: 4px 8px; }
.md-error { font-size: 0.86rem; color: #e05252; margin: 6px 0; }
.md-modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 16px; }

/* Missing badge + button variants */
.badge-danger { background: rgba(180, 44, 44, 0.25); }
.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #c0392b;
  border-color: #c0392b;
  color: #fff;
}
.btn-danger svg { stroke: currentColor; flex-shrink: 0; }
.btn-danger:hover { background: #a93226; border-color: #a93226; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Responsive: stack columns on narrow screens */
@media (max-width: 960px) {
  .md-body { grid-template-columns: 1fr; }
  .md-participants-card { position: static; }
  .md-card-split { grid-template-columns: 1fr; gap: 18px; }
  .md-identity-field { grid-template-columns: 100px 1fr; }
  .md-enroll-toggle-row { flex-direction: column; align-items: flex-start; }
}

/* ── Chain mode UI ──────────────────────────────────────────────────────── */
.stack-item {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.stack-item:last-child { border-bottom: none; }

.stack-item-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.stack-item-header > span { flex: 1; font-size: 0.9rem; }

/* ── Chain: "Add to chain" button & select ──────────────────────────────── */
.chain-row {
  margin-top: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.chain-add-btn {
  padding: 0.2rem 0.6rem;
  font-size: 0.78rem;
  background: transparent;
  border: 1px dashed rgba(10,255,99,0.4);
  border-radius: 999px;
  color: rgba(10,255,99,0.8);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.chain-add-btn:hover {
  background: rgba(10,255,99,0.08);
  border-color: rgba(10,255,99,0.7);
}

.chain-num-select {
  padding: 0.2rem 0.5rem;
  font-size: 0.8rem;
  background: var(--panel, #070b09);
  border: 1px solid rgba(10,255,99,0.4);
  border-radius: 6px;
  color: inherit;
}

/* ── Chain group block ───────────────────────────────────────────────────── */
.chain-group-block {
  margin-top: 0.6rem;
  border: 1px solid rgba(10,255,99,0.3);
  border-radius: 8px;
  overflow: hidden;
}

.chain-group-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: rgba(10,255,99,0.07);
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(10,255,99,0.9);
  border-bottom: 1px solid rgba(10,255,99,0.2);
}
.chain-group-icon { font-size: 1rem; }
.chain-group-count {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.6;
}

.chain-group-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.chain-group-list .stack-item {
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 0.4rem 0.75rem;
}
.chain-group-list .stack-item:last-child { border-bottom: none; }

/* ── Chain position badge ────────────────────────────────────────────────── */
.chain-pos-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.chain-pos-entry   { background: rgba(10,255,99,0.15);  color: #0aff63; border: 1px solid rgba(10,255,99,0.35); }
.chain-pos-middle  { background: rgba(251,191,36,0.12); color: #fbbf24; border: 1px solid rgba(251,191,36,0.3); }
.chain-pos-terminal{ background: rgba(167,139,250,0.12);color: #a78bfa; border: 1px solid rgba(167,139,250,0.3); }

/* ── Chain unlink button ─────────────────────────────────────────────────── */
.chain-unlink-btn {
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  background: transparent;
  border: 1px solid rgba(248,113,113,0.35);
  border-radius: 999px;
  color: rgba(248,113,113,0.8);
  cursor: pointer;
  transition: background 0.15s;
}
.chain-unlink-btn:hover {
  background: rgba(248,113,113,0.1);
}

#chain-validation:not(:empty) { margin-top: 0.5rem; font-size: 0.85rem; }
.error-text { color: #f87171; }

/* ── OFFSEC configure panel ─────────────────────────────────────────────── */
.card-action-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.offsec-configure-btn {
  padding: 0.3rem 0.9rem;
  font-size: 0.85rem;
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.4);
  border-radius: 6px;
  color: #f87171;
  cursor: pointer;
  transition: background 0.15s;
}
.offsec-configure-btn:hover { background: rgba(248,113,113,0.2); }

/* ── OFFSEC full-width configure workspace ───────────────────────────────── */
#offsec-workspace {
  margin-top: 1rem;
}
.offsec-ws-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.offsec-ws-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
}

/* Topology diagram container */
.offsec-ws-diagram {
  border: 1.5px solid rgba(10,158,75,0.45);
  border-radius: 10px;
  padding: 20px 24px 16px;
  background: rgba(10,158,75,0.025);
  overflow-x: auto;
  margin-bottom: 1rem;
}

/* Main horizontal chain */
.offsec-ws-main-row {
  display: flex;
  align-items: flex-end;  /* align arrows to bottom of nodes */
  gap: 0;
  flex-wrap: nowrap;
  margin-bottom: 4px;
}

/* Node element: label on top, icon below */
.offsec-ws-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 90px;
  max-width: 90px;
}
.offsec-ws-node-label {
  font-size: 0.63rem;
  color: rgba(255,255,255,0.55);
  text-align: center;
  white-space: nowrap;
  line-height: 1.2;
}
.offsec-ws-node-icon {
  font-size: 1.5rem;
  line-height: 1;
  text-align: center;
}
/* Static (non-configurable) nodes */
.offsec-ws-static .offsec-ws-node-icon { opacity: 0.75; }

/* Pivot box */
.offsec-ws-pivot .offsec-ws-node-icon { filter: hue-rotate(200deg); }

/* Online box */
.offsec-ws-online .offsec-ws-node-icon { filter: hue-rotate(160deg) brightness(1.2); }

/* Arrow between nodes */
.offsec-ws-arr {
  color: rgba(255,255,255,0.4);
  font-size: 0.85rem;
  flex-shrink: 0;
  padding: 0 2px;
  /* sit at icon row: push down by label height (~18px) + icon height (24px) / 2 */
  padding-bottom: 10px;
  letter-spacing: -1px;
  white-space: nowrap;
}

/* Branch wrap: indent + vertical line + branch rows */
.offsec-ws-branch-wrap {
  display: flex;
  flex-direction: column;
  /* indent horizontally so branch starts under its source node */
  padding-left: var(--branch-indent, 244px);
  margin-top: 2px;
}
.offsec-ws-vline {
  width: 2px;
  height: 18px;
  background: rgba(10,158,75,0.5);
  margin-left: calc(90px / 2 - 1px); /* center under node */
}
.offsec-ws-branch-hrow {
  display: flex;
  align-items: flex-end;
  gap: 0;
  margin-bottom: 4px;
}
.offsec-ws-branch-hrow .offsec-ws-arr { padding-bottom: 10px; }

/* Pick button inside configurable nodes */
.offsec-topo-pick-btn {
  margin-top: 4px;
  padding: 0.18rem 0.5rem;
  font-size: 0.65rem;
  border: 1px dashed rgba(10,255,99,0.45);
  border-radius: 5px;
  background: rgba(10,255,99,0.04);
  color: rgba(10,255,99,0.8);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
  max-width: 86px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.offsec-topo-pick-btn:hover { border-color: rgba(10,255,99,0.65); color: #0aff63; background: rgba(10,255,99,0.07); }
.offsec-topo-pick-btn.has-selection {
  border-style: solid;
  border-color: rgba(10,255,99,0.55);
  background: rgba(10,255,99,0.08);
  color: #0aff63;
}

.offsec-configure-panel {
  margin-top: 0.6rem;
  padding: 0.75rem;
  background: rgba(10,255,99,0.03);
  border: 1px solid rgba(10,255,99,0.2);
  border-radius: 8px;
}
.offsec-panel-intro {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.55);
  margin: 0 0 0.5rem;
}
.offsec-box-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.offsec-box-label {
  font-size: 0.8rem;
  white-space: nowrap;
  min-width: 140px;
  color: rgba(255,255,255,0.75);
}
.offsec-box-select {
  flex: 1;
  padding: 0.2rem 0.4rem;
  font-size: 0.8rem;
  background: var(--panel, #070b09);
  border: 1px solid rgba(10,255,99,0.2);
  border-radius: 5px;
  color: inherit;
}
.offsec-add-btn {
  margin-top: 0.6rem;
  width: 100%;
  padding: 0.35rem 0;
  font-size: 0.85rem;
  font-weight: 600;
  background: linear-gradient(90deg, rgba(6,148,67,.9), rgba(10,255,99,.85));
  border: none;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  transition: filter 0.15s;
}
.offsec-add-btn:hover { filter: brightness(1.08); }

/* OFFSEC box summary in Selected Stack */
.offsec-stack-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.3rem;
}
.offsec-stack-box-tag {
  padding: 0.1rem 0.45rem;
  font-size: 0.72rem;
  background: rgba(10,255,99,0.07);
  border: 1px solid rgba(10,255,99,0.25);
  border-radius: 999px;
  color: rgba(10,255,99,0.85);
  white-space: nowrap;
}

/* ── OFFSEC visual topology diagram ─────────────────────────────────────── */
.offsec-topo-chain {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 0;
}

.offsec-topo-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  min-width: 72px;
  text-align: center;
}

.offsec-topo-static {
  border-color: rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
  opacity: 0.8;
}

.offsec-topo-pivot {
  border-color: rgba(251,191,36,0.45);
  background: rgba(251,191,36,0.07);
}

.offsec-topo-external {
  border-color: rgba(52,211,153,0.45);
  background: rgba(52,211,153,0.07);
}

.offsec-topo-internal {
  border-color: rgba(99,102,241,0.45);
  background: rgba(99,102,241,0.07);
}

.offsec-topo-arrow {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.3);
  padding: 0 2px;
  flex-shrink: 0;
  align-self: center;
}

.offsec-topo-connector {
  display: flex;
  justify-content: center;
  margin: 4px 0;
}

.offsec-topo-connector::before {
  content: '';
  display: block;
  width: 2px;
  height: 18px;
  background: rgba(255,255,255,0.15);
  border-radius: 1px;
}

.offsec-topo-services {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.offsec-topo-select {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.15rem 0.3rem;
  font-size: 0.7rem;
  background: var(--panel, #070b09);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 5px;
  color: inherit;
  max-width: 110px;
}

.topo-emoji {
  font-size: 1.5rem;
  line-height: 1;
}

.topo-label {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.6);
  white-space: nowrap;
}

/* ── CVE Box — stat tiles ────────────────────────────────────────────────── */
.cve-stat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 1.2rem;
}

.cve-stat-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 14px 18px;
  background: var(--dark-card, #0d1410);
  border: 1px solid var(--line, rgba(255,255,255,0.08));
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  min-width: 120px;
}
.cve-stat-tile:hover  { border-color: rgba(248,113,113,0.4); background: rgba(248,113,113,0.04); }
.cve-stat-tile.active { border-color: rgba(248,113,113,0.7); background: rgba(248,113,113,0.08); }

.cve-stat-emoji { font-size: 1.5rem; line-height: 1; }
.cve-stat-count {
  font-size: 1.6rem;
  font-weight: 700;
  color: #f87171;
  line-height: 1.1;
}
.cve-stat-name {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ── CVE Box — filter bar ─────────────────────────────────────────────────── */
.cve-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.cve-search-wrap {
  flex: 1;
  min-width: 220px;
  position: relative;
}
.cve-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  pointer-events: none;
}
.cve-search-input {
  width: 100%;
  padding: 0.45rem 0.75rem 0.45rem 2rem;
  background: var(--dark-card, #0d1410);
  border: 1px solid var(--line, rgba(255,255,255,0.1));
  border-radius: 8px;
  color: inherit;
  font-size: 0.88rem;
}
.cve-search-input:focus { outline: none; border-color: rgba(248,113,113,0.45); }

.cve-filter-select {
  padding: 0.45rem 0.65rem;
  background: var(--dark-card, #0d1410);
  border: 1px solid var(--line, rgba(255,255,255,0.1));
  border-radius: 8px;
  color: inherit;
  font-size: 0.88rem;
}

.cve-result-count {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.45);
  white-space: nowrap;
}

/* ── CVE Box — card grid ──────────────────────────────────────────────────── */
.cve2-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.cve2-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: var(--dark-card, #0d1410);
  border: 1px solid var(--line, rgba(255,255,255,0.08));
  border-radius: 10px;
  transition: border-color 0.15s;
}
.cve2-card:hover { border-color: rgba(248,113,113,0.4); }

.cve2-icon-col { flex-shrink: 0; }
.cve2-icon-box {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
}

.cve2-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }

.cve2-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.cve2-product { font-size: 0.92rem; font-weight: 600; }

.cve2-cve-badge {
  font-size: 0.72rem;
  padding: 0.08rem 0.45rem;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 5px;
  color: rgba(255,255,255,0.65);
  font-family: monospace;
  white-space: nowrap;
}
.cve2-cve-none { opacity: 0.5; }

.cve2-diff-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.diff-easy   { background: rgba(16,185,129,0.18); color: #34d399; border: 1px solid rgba(16,185,129,0.35); }
.diff-medium { background: rgba(245,158,11,0.18); color: #fbbf24; border: 1px solid rgba(245,158,11,0.35); }
.diff-hard   { background: rgba(239,68,68,0.18);  color: #f87171; border: 1px solid rgba(239,68,68,0.35); }

.cve2-path {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.35);
  font-family: monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cve2-tags {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.cve2-cvss-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 5px;
  color: rgba(255,255,255,0.75);
}

.cve2-flag-pill {
  font-size: 0.68rem;
  padding: 0.1rem 0.4rem;
  background: rgba(167,139,250,0.1);
  border: 1px solid rgba(167,139,250,0.25);
  border-radius: 999px;
  color: #a78bfa;
}

.cve2-desc {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── CVE Box redesign (light-mode Alpine component) ──────────────────────── */
.cvebox-wrap { display: flex; flex-direction: column; gap: 1rem; }

/* Stat tiles */
.cvebox-stat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cvebox-stat-tile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #ffffff;
  border: 1px solid var(--line, rgba(13,110,52,0.22));
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: left;
  font: inherit;
}
.cvebox-stat-tile:hover {
  border-color: var(--accent, #0a9e4b);
  background: rgba(10,158,75,0.04);
}
.cvebox-stat-tile.is-active {
  border-color: var(--accent, #0a9e4b);
  background: rgba(10,158,75,0.08);
  box-shadow: 0 0 0 2px rgba(10,158,75,0.18);
}
.cvebox-stat-icon { font-size: 1.2rem; line-height: 1; }
.cvebox-stat-count {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent, #0a9e4b);
  line-height: 1;
}
.cvebox-stat-name {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #385645);
  white-space: nowrap;
}

/* Filter bar */
.cvebox-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.cvebox-search-wrap {
  flex: 1;
  min-width: 0;
  position: relative;
}
.cvebox-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  pointer-events: none;
}
.cvebox-search-input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.1rem;
  background: #ffffff;
  border: 1px solid var(--line, rgba(13,110,52,0.22));
  border-radius: 8px;
  color: inherit;
  font-size: 0.88rem;
  box-sizing: border-box;
}
.cvebox-search-input:focus {
  outline: none;
  border-color: var(--accent, #0a9e4b);
  box-shadow: 0 0 0 2px rgba(10,158,75,0.15);
}
.cvebox-filter-select {
  padding: 0.5rem 0.65rem;
  background: #ffffff;
  border: 1px solid var(--line, rgba(13,110,52,0.22));
  border-radius: 8px;
  color: inherit;
  font-size: 0.88rem;
}
.cvebox-reset-btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  color: var(--muted, #385645);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s;
}
.cvebox-reset-btn:hover { color: #dc2626; }
.cvebox-count {
  font-size: 0.82rem;
  color: var(--muted, #385645);
  white-space: nowrap;
  margin-left: auto;
}

/* Active category chip */
.cvebox-cat-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cvebox-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(162,28,175,0.08);
  color: #a21caf;
  border: 1px solid rgba(162,28,175,0.25);
}

/* Card grid */
.cvebox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.cvebox-card {
  background: #ffffff;
  border: 1px solid var(--line, rgba(13,110,52,0.18));
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cvebox-card:hover {
  border-color: var(--accent, #0a9e4b);
  box-shadow: 0 2px 8px rgba(10,158,75,0.1);
}
.cvebox-card.is-expanded {
  border-color: var(--accent, #0a9e4b);
  box-shadow: 0 0 0 2px rgba(10,158,75,0.18);
}

.cvebox-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px 0;
}
.cvebox-card-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 9px;
  background: rgba(10,158,75,0.08);
  border: 1px solid rgba(10,158,75,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}
.cvebox-card-titles { flex: 1; min-width: 0; }

.cvebox-card-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}
.cvebox-product { font-size: 0.9rem; font-weight: 700; }
.cvebox-cve-badge {
  font-size: 0.7rem;
  padding: 0.08rem 0.45rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 5px;
  color: #1d4ed8;
  font-family: monospace;
  white-space: nowrap;
}
.cvebox-cve-badge.is-none { opacity: 0.45; }
.cvebox-path {
  font-family: monospace;
  font-size: 0.7rem;
  color: var(--muted, #385645);
  opacity: 0.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Badges row */
.cvebox-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 8px 14px 10px;
}
.cvebox-cvss-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
}
.cvebox-diff-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  letter-spacing: 0.03em;
}
/* Light-mode difficulty colours */
.cvebox-diff-badge.diff-easy   { background:#f0fdf4; color:#16a34a; border:1px solid #bbf7d0; }
.cvebox-diff-badge.diff-medium { background:#fefce8; color:#ca8a04; border:1px solid #fde68a; }
.cvebox-diff-badge.diff-hard   { background:#fff7ed; color:#ea580c; border:1px solid #fed7aa; }
.cvebox-diff-badge.diff-insane { background:#fef2f2; color:#dc2626; border:1px solid #fecaca; }

.cvebox-class-chip {
  font-size: 0.68rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: rgba(162,28,175,0.07);
  color: #a21caf;
  border: 1px solid rgba(162,28,175,0.2);
}
.cvebox-flag-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

/* Description / solve panel */
.cvebox-desc-preview {
  padding: 0 14px 12px;
  font-size: 0.78rem;
  color: var(--muted, #385645);
  opacity: 0.8;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cvebox-solve-panel {
  border-top: 1px solid var(--line, rgba(13,110,52,0.18));
  padding: 12px 14px;
  background: rgba(10,158,75,0.03);
}
.cvebox-solve-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent, #0a9e4b);
  margin-bottom: 6px;
}
.cvebox-solve-body {
  font-size: 0.82rem;
  color: var(--fg, #102218);
  line-height: 1.55;
  margin: 0 0 8px;
}
.cvebox-solve-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line, rgba(13,110,52,0.12));
  font-size: 0.75rem;
}
.cvebox-affected { font-family: monospace; color: #ca8a04; }
.cvebox-vulhub-link {
  margin-left: auto;
  color: #4f46e5;
  font-size: 0.75rem;
  text-decoration: none;
}
.cvebox-vulhub-link:hover { color: #4338ca; text-decoration: underline; }

.cvebox-empty { text-align: center; padding: 4rem 1rem; }

/* ── OFFSEC modal config & topology diagram ──────────────────────────────── */
.offsec-diff-block { margin: .5rem 0 .85rem; }
.offsec-section-label { font-size: .82rem; font-weight: 600; display: block; margin-bottom: .35rem; }
.offsec-slider {
  width: 100%;
  accent-color: var(--accent, #0a9e4b);
  cursor: pointer;
  margin: .3rem 0 .2rem;
}
.offsec-diff-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent, #0a9e4b);
}
.offsec-params-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: .75rem;
}
.offsec-param {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
}
.offsec-param-name { font-weight: 600; color: var(--muted, #385645); white-space: nowrap; }
.offsec-param-select {
  padding: .25rem .5rem;
  font-size: .84rem;
  border: 1px solid var(--line, rgba(13,110,52,.18));
  border-radius: 6px;
  background: #fff;
  font: inherit;
}
.offsec-box-diff-badge {
  font-weight: 700;
  color: var(--fg, #102218);
  background: rgba(10,158,75,0.08);
  border: 1px solid rgba(10,158,75,0.28);
  padding: .12rem .55rem;
  border-radius: 999px;
  font-size: .82rem;
}

/* Topology container */
.offsec-topo-wrap {
  border: 1.5px solid rgba(10,158,75,0.35);
  border-radius: 8px;
  padding: 14px 16px 10px;
  background: rgba(10,158,75,0.025);
  overflow-x: auto;
  margin-top: .25rem;
}
/* Outer flex: base chain + right branches side-by-side */
.offsec-topo-inner {
  display: inline-flex;
  align-items: flex-start;
  gap: 0;
}
.offsec-topo-chain {
  display: flex;
  align-items: center;
  gap: 0;
}
/* Right-hand column: stacked branch rows */
.offsec-topo-branches {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
}
.offsec-topo-branch {
  display: flex;
  align-items: center;
  gap: 0;
}
/* Online row: L-branch — left border + indent simulate the elbow from pivot */
.offsec-topo-online-row {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 4px;
  padding-left: 18px;
  border-left: 2px solid rgba(10,158,75,0.35);
  margin-left: 14px;
}

/* Individual node — label ON TOP, icon below */
.topo-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 68px;
}
/* Label sits above icon */
.topo-label {
  font-size: 0.63rem;
  color: var(--muted, #385645);
  text-align: center;
  white-space: normal;
  max-width: 70px;
  word-break: break-word;
  line-height: 1.2;
  order: 0;
}
.topo-icon {
  font-size: 1.45rem;
  line-height: 1;
  text-align: center;
  order: 1;
}
/* Pivot: slightly larger, accent colour */
.topo-pivot .topo-icon { color: #2563eb; font-size: 1.5rem; }

/* Arrows — vertically centered with icon row (label + icon ≈ 38px total) */
.topo-arr {
  display: flex;
  align-items: flex-end;      /* align arrow to icon baseline */
  padding-bottom: 2px;
  color: #777;
  font-size: .82rem;
  flex-shrink: 0;
  white-space: nowrap;
  letter-spacing: -1px;
}

/* ── OSINT info panel ───────────────────────────────────────────────────── */
.osint-info-panel {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(10,255,99,0.3);
  border-radius: 6px;
  background: rgba(10,255,99,0.04);
}
.osint-info-panel h4 {
  margin: 0 0 0.3rem;
  font-size: 0.95rem;
  color: var(--accent, #0aff63);
}
.osint-info-panel .muted { font-size: 0.82rem; margin: 0 0 0.4rem; }

.osint-services-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.service-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  background: rgba(10,255,99,0.08);
  border: 1px solid rgba(10,255,99,0.25);
  border-radius: 12px;
  font-size: 0.78rem;
  cursor: default;
  white-space: nowrap;
}

/* ── Locked category (plan restriction) ─────────────────────────────────── */
.category-locked {
  opacity: 0.45;
  cursor: pointer;
  position: relative;
  user-select: none;
}

.category-locked input[type="number"] {
  pointer-events: none;
  background: rgba(128, 128, 128, 0.12);
}

.category-lock-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 8px;
  font-size: 0.68rem;
  font-weight: 600;
  color: #d97706;
  vertical-align: middle;
  letter-spacing: 0.02em;
  cursor: pointer;
}

/* ── Credit bar in Selected Stack ───────────────────────────────────────── */
/* Selected stack header row — title + spec count badge */
.adv-stack-header-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .65rem;
}
.adv-stack-title { margin: 0; }

/* Animated spec count badge */
@keyframes spec-badge-bump {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); }
  70%  { transform: scale(.92); }
  100% { transform: scale(1); }
}
.adv-spec-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 24px; padding: 0 9px;
  border-radius: 999px;
  font-size: .78rem; font-weight: 800;
  background: rgba(10,255,99,.15);
  color: #0aff63;
  border: 1px solid rgba(10,255,99,.35);
  transition: background .2s;
}
.adv-spec-badge.is-bumping { animation: spec-badge-bump .32s ease; }
body.app-shell.theme-light .adv-spec-badge { background: rgba(5,195,75,.12); color: #1a7a4e; border-color: rgba(5,195,75,.35); }

/* Credit bar panel — matches res-credits style */
.adv-credit-panel {
  border: 1px solid var(--line, rgba(255,255,255,.1));
  border-radius: 14px;
  padding: .75rem 1rem;
  margin-bottom: .75rem;
  background: var(--panel-soft, rgba(5,12,8,.6));
}
.adv-credit-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: .45rem;
}
.adv-credit-label {
  font-size: .68rem; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted);
}
.adv-credit-count {
  font-size: .75rem; font-weight: 600; color: var(--fg);
}
.adv-credit-track {
  display: flex; height: 8px; border-radius: 999px;
  background: rgba(255,255,255,.08); overflow: hidden;
}
.adv-credit-fill-used {
  height: 100%; background: #3b82f6;
  border-radius: 999px 0 0 999px;
  transition: width .4s ease; flex-shrink: 0;
}
.adv-credit-fill-stack {
  height: 100%; background: linear-gradient(90deg,#08bf6e,#33f59e);
  transition: width .4s ease; flex-shrink: 0;
}
.adv-credit-track.is-over .adv-credit-fill-used  { background: #dc2626; }
.adv-credit-track.is-over .adv-credit-fill-stack { background: #ef4444; }

.adv-credit-warn {
  font-size: .78rem; padding: .45rem .65rem;
  border-radius: 8px; margin-top: .45rem; line-height: 1.45;
}
.adv-credit-warn.error {
  background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.3); color: #f87171;
}
body.app-shell.theme-light .adv-credit-panel { background: rgba(240,249,244,.8); border-color: rgba(13,110,52,.15); }
body.app-shell.theme-light .adv-credit-track { background: rgba(0,0,0,.08); }

/* ── Credit quota exceeded modal ────────────────────────────────────────── */
.credit-quota-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
}
.credit-quota-overlay.is-hidden { display: none; }

.credit-quota-box {
  background: var(--dark-card, #0d1410);
  border: 1px solid rgba(239,68,68,0.4);
  border-radius: 14px;
  padding: 2rem 2rem 1.5rem;
  max-width: 420px;
  width: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.credit-quota-icon { font-size: 2.5rem; line-height: 1; }
.credit-quota-title { font-size: 1.1rem; font-weight: 700; margin: 0; color: #f87171; }
.credit-quota-msg   { font-size: 0.88rem; color: rgba(255,255,255,0.7); margin: 0; line-height: 1.5; }

.credit-quota-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.credit-quota-btn-secondary {
  padding: 0.45rem 1rem;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 7px;
  background: transparent;
  color: rgba(255,255,255,0.7);
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.15s;
}
.credit-quota-btn-secondary:hover { background: rgba(255,255,255,0.07); }

.credit-quota-btn-primary {
  padding: 0.45rem 1rem;
  border-radius: 7px;
  background: rgba(168,85,247,0.2);
  border: 1px solid rgba(168,85,247,0.5);
  color: #c084fc;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}
.credit-quota-btn-primary:hover { background: rgba(168,85,247,0.32); }

/* ── OFFSEC topology controls row ───────────────────────────────────────── */
.offsec-topo-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line, rgba(13,110,52,0.18));
}
.offsec-topo-ctrl-label {
  font-size: 0.78rem;
  color: var(--fg, #102218);
  white-space: nowrap;
  font-weight: 600;
}
.offsec-topo-ctrl-select {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  background: var(--bg, #fff);
  border: 1px solid rgba(10,158,75,0.3);
  border-radius: 6px;
  color: var(--fg, #102218);
}

/* ── OFFSEC node pick button ─────────────────────────────────────────────── */
.offsec-topo-pick-btn {
  margin-top: 0.3rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.68rem;
  background: rgba(10,255,99,0.04);
  border: 1px dashed rgba(10,255,99,0.4);
  border-radius: 5px;
  color: rgba(10,255,99,0.75);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
.offsec-topo-pick-btn:hover { border-color: rgba(10,255,99,0.65); color: #0aff63; background: rgba(10,255,99,0.08); }
.offsec-topo-pick-btn.has-selection {
  border-style: solid;
  border-color: rgba(10,255,99,0.55);
  color: #0aff63;
  background: rgba(10,255,99,0.09);
}

/* ── OFFSEC topology warn ────────────────────────────────────────────────── */
.offsec-topo-warn {
  font-size: 0.8rem;
  color: #fbbf24;
  margin: 0.5rem 0;
  text-align: center;
}

/* ── OFFSEC box picker modal ─────────────────────────────────────────────── */
.offsec-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}
.offsec-picker-overlay.is-hidden { display: none; }

.offsec-picker-box {
  background: #ffffff;
  color: #111827;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 1.25rem;
  width: min(700px, 95vw);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.07), 0 20px 50px rgba(0,0,0,0.18);
}

.offsec-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.offsec-picker-title { font-size: 1rem; font-weight: 700; color: #111827; }
.offsec-picker-close {
  background: transparent;
  border: none;
  color: #9ca3af;
  font-size: 1rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}
.offsec-picker-close:hover { color: #111827; background: #f3f4f6; }

.offsec-picker-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.offsec-picker-search-wrap {
  flex: 1;
  min-width: 180px;
  position: relative;
}
.offsec-picker-search-icon {
  position: absolute; left: 9px; top: 50%;
  transform: translateY(-50%); font-size: 0.85rem; pointer-events: none; color: #9ca3af;
}
.offsec-picker-search {
  width: 100%;
  padding: 0.35rem 0.7rem 0.35rem 1.8rem;
  background: #f9fafb;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  color: #111827;
  font-size: 0.85rem;
}
.offsec-picker-search::placeholder { color: #9ca3af; }
.offsec-picker-search:focus { outline: none; border-color: #10b981; background: #fff; }

.offsec-picker-select {
  padding: 0.35rem 0.6rem;
  background: #f9fafb;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  color: #111827;
  font-size: 0.85rem;
}
.offsec-picker-select:focus { outline: none; border-color: #10b981; }

.offsec-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  overflow-y: auto;
  padding-right: 4px;
}

.offsec-picker-card {
  padding: 10px 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.offsec-picker-card:hover {
  border-color: #10b981;
  background: #f0fdf4;
  box-shadow: 0 2px 8px rgba(16,185,129,0.1);
}

.offsec-picker-card-top { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.offsec-picker-product  { font-size: 0.82rem; font-weight: 600; color: #111827; }
.offsec-picker-cve {
  font-size: 0.68rem; padding: 0.05rem 0.35rem;
  background: #e5e7eb; border-radius: 4px;
  color: #4b5563; font-family: monospace;
}
.offsec-picker-cvss {
  font-size: 0.65rem; font-weight: 700; padding: 0.05rem 0.35rem;
  border-radius: 4px; margin-left: auto;
}
.offsec-cvss-crit { background: #fee2e2; color: #dc2626; }
.offsec-cvss-high { background: #ffedd5; color: #ea580c; }
.offsec-cvss-med  { background: #fef9c3; color: #ca8a04; }

.offsec-picker-path { font-size: 0.67rem; color: #9ca3af; font-family: monospace; }
.offsec-picker-desc {
  font-size: 0.72rem; color: #6b7280; margin: 0; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.offsec-picker-count { font-size: 0.75rem; color: #9ca3af; margin: 0; }
.offsec-picker-loading { color: #6b7280; font-size: 0.85rem; }

/* ═══════════════════════════════════════════════════════════════════
   LIGHT THEME — page-specific overrides (signed-in app surfaces)
   Base tokens already set on body.app-shell.theme-light above.
   ═══════════════════════════════════════════════════════════════════ */

/* ── billing.html (bl-*) ──────────────────────────────────────────── */
body.app-shell.theme-light {
  --bg-card:   #ffffff;
  --border:    rgba(13, 110, 52, 0.18);
  --text:      #102218;
  --text-muted:#4a7060;
}
body.app-shell.theme-light .bl-bar-track {
  background: rgba(13, 110, 52, 0.08);
}
body.app-shell.theme-light .bl-pack-savings {
  background: rgba(10, 158, 75, 0.12);
  color: #0a7a3b;
  border-color: rgba(10, 158, 75, 0.28);
}

/* ── my_ctf.html (mc-*) ───────────────────────────────────────────── */
body.app-shell.theme-light {
  --card-bg: #ffffff;
}
body.app-shell.theme-light .mc-card {
  border-color: rgba(13, 110, 52, 0.16);
}
body.app-shell.theme-light .mc-card:hover {
  border-color: rgba(10, 158, 75, 0.45);
  box-shadow: 0 4px 24px rgba(10, 158, 75, 0.09);
}
body.app-shell.theme-light .mc-tab.active {
  border-bottom-color: #f1f6f2;
  background: #ffffff;
}
body.app-shell.theme-light .mc-type-pill {
  background: rgba(13, 110, 52, 0.06);
  color: #2d5a3a;
  border-color: rgba(13, 110, 52, 0.16);
}
body.app-shell.theme-light .mc-type-pill--web    { color: #0a7a3b; background: rgba(10,122,59,.10); border-color: rgba(10,122,59,.24); }
body.app-shell.theme-light .mc-type-pill--pwn    { color: #b91c1c; background: rgba(185,28,28,.09); border-color: rgba(185,28,28,.22); }
body.app-shell.theme-light .mc-type-pill--offsec { color: #6d28d9; background: rgba(109,40,217,.09); border-color: rgba(109,40,217,.22); }
body.app-shell.theme-light .mc-type-pill--ctf    { color: #0369a1; background: rgba(3,105,161,.09); border-color: rgba(3,105,161,.22); }
body.app-shell.theme-light .mc-section-count {
  background: rgba(10, 158, 75, 0.12);
  color: #0a9e4b;
  border-color: rgba(10, 158, 75, 0.25);
}
body.app-shell.theme-light .mc-card-foot {
  border-top-color: rgba(0, 0, 0, 0.06);
}
body.app-shell.theme-light .mc-btn-outline {
  border-color: rgba(13, 110, 52, 0.22);
  color: #1b3e2d;
}
body.app-shell.theme-light .mc-btn-outline:hover {
  border-color: #0a9e4b;
  color: #0a9e4b;
}
body.app-shell.theme-light .mc-failed-hd {
  background: rgba(185, 28, 28, 0.05);
}
body.app-shell.theme-light .mc-game-card {
  border-color: rgba(13, 110, 52, 0.16);
}

/* ── my_ctf_details.html (sc-*) ───────────────────────────────────── */
body.app-shell.theme-light .sc-play-card {
  background: #ffffff;
  border-color: rgba(10, 158, 75, 0.28);
  box-shadow: 0 0 32px rgba(10, 158, 75, 0.05);
}
body.app-shell.theme-light .sc-play-url a { color: #0a9e4b; }
body.app-shell.theme-light .sc-copy-btn {
  background: rgba(10, 158, 75, 0.07);
  border-color: rgba(10, 158, 75, 0.22);
  color: #4a7060;
}
body.app-shell.theme-light .sc-copy-btn:hover {
  border-color: #0a9e4b;
  color: #0a9e4b;
}
body.app-shell.theme-light .sc-play-btn {
  background: linear-gradient(90deg, #089043, #0a9e4b);
  color: #ffffff;
}
body.app-shell.theme-light .sc-pending-card {
  background: #f5fbf7;
  border-color: rgba(13, 110, 52, 0.18);
}
body.app-shell.theme-light .sc-actions button {
  border-color: rgba(13, 110, 52, 0.25);
  color: #102218;
}
body.app-shell.theme-light .sc-actions button:hover:not(:disabled) {
  border-color: #0a9e4b;
  box-shadow: 0 0 0 3px rgba(10, 158, 75, 0.10);
}
body.app-shell.theme-light .sc-actions button.sc-btn-danger {
  border-color: rgba(185, 28, 28, 0.40);
  color: #b91c1c;
}
body.app-shell.theme-light .sc-toast-success {
  background: rgba(10, 158, 75, 0.09);
  border-color: rgba(10, 158, 75, 0.25);
  color: #0a7a3b;
}
body.app-shell.theme-light .sc-type-badge {
  background: rgba(99, 102, 241, 0.10);
  border-color: rgba(99, 102, 241, 0.24);
  color: #4f46e5;
}
body.app-shell.theme-light .sc-pill-live {
  background: rgba(10, 158, 75, 0.10);
  border-color: rgba(10, 158, 75, 0.28);
  color: #0a7a3b;
}
body.app-shell.theme-light .sc-pill-idle,
body.app-shell.theme-light .sc-pill-unreachable {
  color: #4a7060;
}

/* ── my_ctf_managed.html (mgd-*) ──────────────────────────────────── */
body.app-shell.theme-light .mgd-card {
  background: #ffffff;
  border-color: rgba(13, 110, 52, 0.16);
}
body.app-shell.theme-light .mgd-card:hover {
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 4px 28px rgba(56, 189, 248, 0.10);
}
body.app-shell.theme-light .mgd-card-foot {
  border-top-color: rgba(0, 0, 0, 0.06);
}
body.app-shell.theme-light .mgd-btn-outline {
  border-color: rgba(13, 110, 52, 0.22);
  color: #1b3e2d;
}
body.app-shell.theme-light .mgd-btn-outline:hover {
  border-color: #38bdf8;
  color: #0369a1;
}
body.app-shell.theme-light .mgd-pw-code {
  background: rgba(13, 110, 52, 0.07);
  color: #102218;
}
