:root {
  --bg: #0f172a;
  --panel: #111827;
  --panel-2: #1f2937;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: var(--panel);
  border-bottom: 1px solid #334155;
}
.topbar a { color: var(--text); margin-left: 12px; text-decoration: none; }

.topbar nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}
.brand-mark:hover {
  text-decoration: none;
}
.brand-mark__icon {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(34, 211, 238, 0.18));
}
.brand-mark__copy {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-mark__copy strong {
  font-size: 1.08rem;
  letter-spacing: 0.02em;
}
/* Fase 61: ancho general más amplio en escritorio sin tocar contenedores especiales */
.container {
  width: 100%;
  max-width: min(1440px, calc(100vw - 40px));
  margin: 24px auto;
  padding: 0 16px;
}
.card {
  background: var(--panel);
  border: 1px solid #334155;
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 18px;
}
.narrow { max-width: 480px; }
@media (max-width: 720px) {
  .container {
    max-width: 100%;
    margin: 14px auto;
    padding-left: 12px;
    padding-right: 12px;
  }
}
.grid.two {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.form-grid { display: grid; gap: 12px; }
.inline-form { margin-top: 12px; }
.full-span { grid-column: 1 / -1; }
.small-text { font-size: 0.95rem; line-height: 1.25; }
label { display: grid; gap: 6px; color: var(--muted); }
input, select, textarea, button {
  border-radius: 10px;
  border: 1px solid #475569;
  padding: 10px 12px;
  font: inherit;
}
input, select, textarea { background: var(--panel-2); color: var(--text); }
button {
  background: var(--accent);
  color: #052e16;
  font-weight: 700;
  cursor: pointer;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  text-align: left;
  border-bottom: 1px solid #334155;
  padding: 10px 8px;
}
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #334155;
  color: var(--text);
  font-size: 12px;
}
.muted { color: var(--muted); }
.big { font-size: 32px; font-weight: bold; }
.list-item {
  padding: 12px 0;
  border-bottom: 1px solid #334155;
}
.flash-stack { display: grid; gap: 8px; margin-bottom: 16px; }
.flash { padding: 12px 14px; border-radius: 12px; }
.flash.success { background: rgba(34,197,94,.18); }
.flash.warning { background: rgba(245,158,11,.18); }
.flash.danger { background: rgba(239,68,68,.18); }
.flash.info { background: rgba(59,130,246,.18); }
code { background: #0b1220; padding: 2px 6px; border-radius: 6px; }
.stats-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 18px;
}
.stat-card { padding: 16px 18px; }
.inline-grid {
  display: grid;
  gap: 8px;
}
.compact-form {
  grid-template-columns: 1.3fr .8fr 1.2fr auto auto;
  align-items: center;
}
.wallet-form {
  grid-template-columns: .7fr 1.4fr auto;
}
.compact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.checkbox-row.small { font-size: 14px; }
.divider {
  border: 0;
  border-top: 1px solid #334155;
  margin: 18px 0;
}
textarea { min-height: 84px; resize: vertical; }
a { color: #93c5fd; }
@media (max-width: 980px) {
  .compact-form, .wallet-form {
    grid-template-columns: 1fr;
  }
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.button-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.button-row.wrap { flex-wrap: wrap; }
.btn-link,
.secondary-btn,
.danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid #475569;
}
.btn-link {
  background: var(--accent);
  color: #052e16;
}
.btn-link.secondary,
.secondary-btn {
  background: #1e293b;
  color: var(--text);
}
.danger-btn {
  background: rgba(239,68,68,.18);
  color: #fecaca;
}
.danger-btn.soft {
  padding: 8px 12px;
}

/* Fase 69: estados de carga y borradores IA */
form.is-submitting {
  opacity: .86;
}
button.is-loading,
button:disabled.is-loading,
input[type="submit"].is-loading {
  cursor: wait;
  opacity: .72;
}
button:disabled,
.btn-link.disabled {
  cursor: not-allowed;
}
.btn-link.danger {
  background: rgba(239, 68, 68, .18);
  color: #fecaca;
  border-color: rgba(239, 68, 68, .45);
}
.btn-link.compact-action {
  padding: 7px 10px;
  font-size: 12px;
}
.top-gap-xs {
  margin-top: 6px;
}
.ai-draft-status {
  vertical-align: middle;
}
.ai-draft-status--draft {
  background: rgba(59, 130, 246, .18);
  color: #bfdbfe;
}
.ai-draft-status--published {
  background: rgba(34, 197, 94, .18);
  color: #bbf7d0;
}
.ai-draft-status--discarded {
  background: rgba(148, 163, 184, .18);
  color: #cbd5e1;
}
.kv-list {
  display: grid;
  gap: 10px;
}
.kv-list.compact { gap: 6px; }
.team-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.team-card {
  margin-bottom: 0;
}
.member-edit-form {
  grid-template-columns: 1.3fr .9fr auto auto;
  align-items: center;
}
.mt-8 { margin-top: 8px; }
@media (max-width: 980px) {
  .member-edit-form { grid-template-columns: 1fr; }
  .section-header { flex-direction: column; }
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.subsection {
  margin-top: 16px;
}
.delivery-card {
  background: #0b1220;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 12px;
  margin-top: 10px;
}
.delivery-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.code-box {
  background: #020617;
  color: #dbeafe;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 14px;
  overflow-x: auto;
  white-space: pre;
  overflow-wrap: normal;
  line-height: 1.45;
  tab-size: 2;
  max-width: 100%;
}
details > summary {
  cursor: pointer;
  color: #93c5fd;
  margin-bottom: 8px;
}

.roster-list {
  display: grid;
  gap: 10px;
}
.roster-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #334155;
  border-radius: 12px;
  background: #0b1220;
}
.portfolio-list-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.portfolio-card {
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 14px;
  background: #0b1220;
}
.portfolio-card h3 {
  margin: 10px 0 8px;
}
.portfolio-topline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.simple-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #334155;
  border-radius: 12px;
}
.table-wrap table {
  min-width: 760px;
}
.compact-table th,
.compact-table td {
  font-size: 14px;
  white-space: nowrap;
}
.check-list {
  display: grid;
  gap: 8px;
}
.choice-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #0b1220;
  border: 1px solid #334155;
  border-radius: 12px;
  color: var(--text);
}
.choice-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
}
.stack-on-mobile {
  align-items: flex-start;
}
@media (max-width: 820px) {
  .stack-on-mobile {
    flex-direction: column;
  }
}

.summary-badges {
  display: flex;
  gap: 10px;
  align-items: center;
}
.summary-badges.wrap {
  flex-wrap: wrap;
}
.badge.large {
  padding: 8px 12px;
  font-size: 14px;
}
.top-gap {
  margin-top: 12px;
}

.top-gap { margin-top: 12px; }
.simple-list { margin: 0; padding-left: 18px; }
.team-hero-card {
  background: linear-gradient(180deg, rgba(34,197,94,.08), rgba(17,24,39,1));
}
.team-hero-inner {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 18px;
  align-items: center;
}
.team-logo-wrap {
  width: 84px;
  height: 84px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid #475569;
  background: #0b1220;
  display: flex;
  align-items: center;
  justify-content: center;
}
.team-logo-wrap.large {
  width: 120px;
  height: 120px;
  border-radius: 28px;
}
.team-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.team-logo-placeholder,
.portfolio-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 800;
  color: #d1fae5;
  background: radial-gradient(circle at top, rgba(34,197,94,.35), rgba(15,23,42,1));
}
.gallery-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 10px;
}
.gallery-strip img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid #334155;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}
.gallery-grid.compact-gallery {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}
.gallery-card {
  background: #0b1220;
  border: 1px solid #334155;
  border-radius: 16px;
  overflow: hidden;
}
.gallery-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}
.gallery-card.public img { height: 120px; }
.gallery-card-body,
.gallery-caption {
  padding: 10px 12px;
}
.gallery-card-body {
  display: grid;
  gap: 10px;
}
.portfolio-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.portfolio-card.visual-card {
  background: #0b1220;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid #334155;
}
.portfolio-cover {
  width: 100%;
  height: 160px;
  background: #020617;
  overflow: hidden;
  border-bottom: 1px solid #334155;
}
.portfolio-cover.compact { height: 130px; }
.portfolio-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.portfolio-card-body {
  padding: 14px;
}
.compact-roster .roster-item { padding: 8px 10px; }
.warning-box {
  background: rgba(245,158,11,.12);
  border: 1px solid rgba(245,158,11,.35);
  border-radius: 12px;
  padding: 12px 14px;
  color: #fde68a;
}
.stack-form { display: grid; gap: 10px; }
@media (max-width: 720px) {
  .team-hero-inner { grid-template-columns: 1fr; }
  .team-logo-wrap.large { width: 96px; height: 96px; }
}

.landing-hero {
  background: linear-gradient(135deg, rgba(34,197,94,.16), rgba(59,130,246,.08) 52%, rgba(17,24,39,1));
}
.landing-hero-copy h1 {
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.05;
  margin: 12px 0;
}
.landing-hero-copy p {
  max-width: 820px;
  color: #d1d5db;
  font-size: 17px;
}
.course-group + .course-group {
  margin-top: 18px;
}
.course-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.landing-team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.landing-team-card {
  background: #0b1220;
  border: 1px solid #334155;
  border-radius: 18px;
  padding: 14px;
  display: grid;
  gap: 12px;
}
.landing-team-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.team-logo-wrap.smallish {
  width: 60px;
  height: 60px;
  border-radius: 18px;
}
.landing-score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 6px;
  border-top: 1px solid #334155;
}
.ranking-list {
  display: grid;
  gap: 10px;
}
.ranking-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #334155;
  border-radius: 16px;
  background: #0b1220;
}
.ranking-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ranking-position {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #1e293b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.ranking-score {
  font-weight: 800;
  color: #d1fae5;
  white-space: nowrap;
}
.login-anchor {
  margin: 32px auto 8px;
}
@media (max-width: 720px) {
  .ranking-row,
  .course-group-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

.tiny { font-size: 0.84rem; }
.ranking-breakdown { padding: 0 0 10px 64px; }
@media (max-width: 720px) { .ranking-breakdown { padding-left: 0; } }

.ai-assistant-form textarea {
  min-height: 140px;
}
.ai-history-stack {
  display: grid;
  gap: 12px;
}
.ai-message-card {
  background: rgba(15, 23, 42, 0.55);
}
.ai-response-box {
  white-space: pre-wrap;
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 12px 14px;
  line-height: 1.5;
}

.ai-launcher-block .section-header.compact {
  align-items: center;
  gap: 12px;
}
.ai-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.58);
  opacity: 0;
  transition: opacity 0.18s ease;
  z-index: 60;
}
.ai-drawer-backdrop.is-open {
  opacity: 1;
}
.ai-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(520px, 96vw);
  height: 100vh;
  background: #081327;
  border-left: 1px solid #22314d;
  box-shadow: -18px 0 42px rgba(2, 6, 23, 0.35);
  z-index: 70;
  display: grid;
  grid-template-rows: auto 1fr auto;
  transform: translateX(102%);
  transition: transform 0.18s ease;
}
.ai-drawer.is-open {
  transform: translateX(0);
}
.ai-drawer-header,
.ai-drawer-form {
  padding: 18px 20px;
  background: #0b1730;
}
.ai-drawer-header {
  border-bottom: 1px solid #1f2e49;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}
.ai-drawer-header h3 {
  margin: 8px 0 6px;
}
.ai-drawer-body {
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}
.ai-drawer-status {
  padding: 14px 20px 0;
}
.ai-chat-history {
  overflow-y: auto;
  padding: 14px 20px 20px;
  display: grid;
  gap: 12px;
}
.ai-drawer-form {
  border-top: 1px solid #1f2e49;
  display: grid;
  gap: 12px;
}
.ai-drawer-form textarea {
  min-height: 150px;
}
.ai-drawer-actions {
  display: flex;
  justify-content: flex-end;
}
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid #314160;
  background: #162338;
  color: #f8fafc;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.icon-btn:hover {
  background: #1e2f4a;
}
@media (max-width: 800px) {
  .ai-drawer {
    width: 100vw;
  }
}

.return-highlight {
  border: 1px solid rgba(214, 115, 35, 0.35);
  background: rgba(255, 176, 82, 0.12);
  border-radius: 18px;
  padding: 14px 16px;
}

.return-highlight.major {
  border-width: 2px;
  box-shadow: 0 8px 22px rgba(214, 115, 35, 0.08);
}

.badge.warning {
  background: rgba(214, 115, 35, 0.14);
  color: #9a520f;
}

.delivery-card-strong {
  border-left: 4px solid rgba(55, 113, 200, 0.42);
}

.review-card-return {
  border-left: 4px solid rgba(214, 115, 35, 0.5);
  background: rgba(255, 176, 82, 0.08);
}

.code-box-large {
  max-height: none;
  min-height: 220px;
}


.delivery-focus-hero {
  display: grid;
  gap: 0.75rem;
}

.delivery-focus-code-card {
  overflow: hidden;
}

.code-box-focus {
  min-height: 70vh;
  max-height: none;
  font-size: 0.98rem;
  line-height: 1.55;
  overflow: auto;
  white-space: pre;
}


.site-footer {
  margin-top: 28px;
  border-top: 1px solid #334155;
  background: #0b1220;
}
.site-footer__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 16px 22px;
  display: flex;
  gap: 16px;
  align-items: center;
}
.footer-logo-btn {
  flex: 0 0 auto;
  width: 108px;
  height: 108px;
  padding: 0;
  border-radius: 16px;
  background: transparent;
  border: none;
  box-shadow: none;
  cursor: pointer;
  overflow: visible;
}
.footer-logo-btn:hover {
  border-color: transparent;
}
.footer-logo {
  display: block;
  width: 122px;
  height: 122px;
  object-fit: cover;
  border-radius: 16px;
  background: transparent;
  margin: -7px 0 0 -7px;
}
.footer-copy {
  min-width: 0;
}
.footer-title {
  font-weight: 700;
  margin-bottom: 6px;
}
.footer-copy p {
  margin: 4px 0;
  color: var(--muted);
  line-height: 1.45;
}
.footer-copy strong {
  color: var(--text);
}
.image-lightbox {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1200;
}
.image-lightbox.is-open {
  display: block;
}
.image-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.82);
}
.image-lightbox__dialog {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 4vh auto;
  padding: 18px;
  width: min(92vw, 760px);
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.image-lightbox__img {
  display: block;
  width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 14px;
  background: #020617;
}
.image-lightbox__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  color: var(--text);
  border: 1px solid #475569;
  font-size: 24px;
  line-height: 1;
}
body.lightbox-open {
  overflow: hidden;
}
@media (max-width: 720px) {
  .site-footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .footer-logo-btn {
    width: 88px;
    height: 88px;
  }
}


.market-filter-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: end;
}
.market-filter-actions {
  align-self: end;
}
.market-card {
  position: relative;
}
.market-cover-web {
  background: linear-gradient(135deg, rgba(59,130,246,.18), rgba(34,197,94,.08));
}
.secondary-badge {
  background: #1e293b;
  color: var(--text);
}
.market-offer-card {
  margin-bottom: 0;
}


.web-hero-accent {
  background: linear-gradient(135deg, rgba(59,130,246,.18), rgba(34,197,94,.10) 56%, rgba(17,24,39,1));
}
.market-cover-web img,
.market-cover-web .portfolio-cover-placeholder {
  filter: saturate(1.08) contrast(1.02);
}
.web-service-note {
  background: rgba(59,130,246,.10);
  border: 1px solid rgba(59,130,246,.25);
  color: #dbeafe;
  border-radius: 14px;
  padding: 12px 14px;
}

.home-intro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.info-tile,
.info-subcard {
  background: #0b1220;
  border: 1px solid #334155;
  border-radius: 16px;
}
.info-tile h2,
.info-subcard h2 {
  margin-top: 0;
}
.project-rules-hero {
  grid-template-columns: 96px 1fr;
}
.rules-icon-wrap {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  background: radial-gradient(circle at top, rgba(59,130,246,.28), rgba(15,23,42,1));
  border: 1px solid #475569;
}

.ranking-row {
  position: relative;
  overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.ranking-row::before,
.ranking-row::after {
  content: "";
  position: absolute;
  inset: -30%;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.ranking-row:hover {
  transform: translateY(-3px) scale(1.01);
}
.ranking-row:hover::before,
.ranking-row:hover::after {
  opacity: 1;
}

.rank-first {
  border-color: rgba(251,191,36,.45);
  background: linear-gradient(90deg, rgba(251,191,36,.08), rgba(11,18,32,1));
}
.rank-first .ranking-position {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #1f2937;
}
.rank-first:hover {
  box-shadow: 0 0 0 1px rgba(251,191,36,.25), 0 16px 34px rgba(245,158,11,.22);
}
.rank-first::before {
  background:
    radial-gradient(circle at 14% 24%, rgba(253,224,71,.95) 0 2px, transparent 3px),
    radial-gradient(circle at 82% 22%, rgba(255,251,235,.9) 0 2px, transparent 3px),
    radial-gradient(circle at 35% 80%, rgba(251,191,36,.85) 0 2px, transparent 3px),
    radial-gradient(circle at 68% 74%, rgba(255,255,255,.78) 0 1.8px, transparent 3px);
  animation: sparkleDrift 2.8s linear infinite;
}
.rank-first::after {
  background: linear-gradient(120deg, transparent 25%, rgba(255,244,182,.22) 50%, transparent 75%);
  animation: sheenSweep 1.8s ease-in-out infinite;
}

.rank-second {
  border-color: rgba(226,232,240,.38);
  background: linear-gradient(90deg, rgba(226,232,240,.08), rgba(11,18,32,1));
}
.rank-second .ranking-position {
  background: linear-gradient(135deg, #e2e8f0, #94a3b8);
  color: #0f172a;
}
.rank-second:hover {
  box-shadow: 0 0 0 1px rgba(203,213,225,.22), 0 14px 28px rgba(148,163,184,.18);
}
.rank-second::before {
  background:
    radial-gradient(circle at 18% 30%, rgba(255,255,255,.9) 0 2px, transparent 3px),
    radial-gradient(circle at 76% 20%, rgba(226,232,240,.85) 0 2px, transparent 3px),
    radial-gradient(circle at 58% 78%, rgba(203,213,225,.8) 0 2px, transparent 3px);
  animation: sparkleDrift 3.2s linear infinite reverse;
}
.rank-second::after {
  background: linear-gradient(120deg, transparent 28%, rgba(255,255,255,.14) 50%, transparent 72%);
  animation: sheenSweep 2.2s ease-in-out infinite;
}

.rank-third {
  border-color: rgba(251,146,60,.38);
  background: linear-gradient(90deg, rgba(251,146,60,.08), rgba(11,18,32,1));
}
.rank-third .ranking-position {
  background: linear-gradient(135deg, #fb923c, #c2410c);
  color: #fff7ed;
}
.rank-third:hover {
  box-shadow: 0 0 0 1px rgba(249,115,22,.2), 0 14px 28px rgba(194,65,12,.18);
}
.rank-third::before {
  background:
    radial-gradient(circle at 12% 70%, rgba(254,215,170,.88) 0 2px, transparent 3px),
    radial-gradient(circle at 82% 28%, rgba(251,146,60,.8) 0 2px, transparent 3px),
    radial-gradient(circle at 54% 16%, rgba(255,237,213,.85) 0 1.8px, transparent 3px);
  animation: sparkleDrift 3.6s linear infinite;
}
.rank-third::after {
  background: linear-gradient(120deg, transparent 30%, rgba(255,237,213,.16) 50%, transparent 70%);
  animation: sheenSweep 2.4s ease-in-out infinite;
}

.rank-antepenultimate {
  border-color: rgba(251,191,36,.22);
  background: linear-gradient(90deg, rgba(120,53,15,.16), rgba(11,18,32,1));
}
.rank-antepenultimate .ranking-position {
  background: linear-gradient(135deg, #7c2d12, #b45309);
  color: #ffedd5;
}
.rank-antepenultimate:hover {
  box-shadow: 0 0 0 1px rgba(180,83,9,.2), 0 14px 28px rgba(124,45,18,.16);
}
.rank-antepenultimate::before {
  background:
    radial-gradient(circle at 24% 24%, rgba(251,146,60,.55) 0 2px, transparent 3px),
    radial-gradient(circle at 82% 74%, rgba(253,186,116,.5) 0 2px, transparent 3px);
  animation: emberDrift 4.2s linear infinite;
}

.rank-penultimate {
  border-color: rgba(239,68,68,.24);
  background: linear-gradient(90deg, rgba(127,29,29,.18), rgba(11,18,32,1));
}
.rank-penultimate .ranking-position {
  background: linear-gradient(135deg, #ef4444, #7f1d1d);
  color: #fee2e2;
}
.rank-penultimate:hover {
  box-shadow: 0 0 0 1px rgba(239,68,68,.18), 0 14px 28px rgba(127,29,29,.18);
}
.rank-penultimate::before {
  background:
    radial-gradient(circle at 18% 22%, rgba(248,113,113,.7) 0 2px, transparent 3px),
    radial-gradient(circle at 76% 34%, rgba(254,202,202,.55) 0 2px, transparent 3px),
    radial-gradient(circle at 42% 82%, rgba(239,68,68,.6) 0 2px, transparent 3px);
  animation: emberDrift 3.8s linear infinite reverse;
}

.rank-last {
  border-color: rgba(220,38,38,.3);
  background: linear-gradient(90deg, rgba(127,29,29,.28), rgba(11,18,32,1));
}
.rank-last .ranking-position {
  background: linear-gradient(135deg, #dc2626, #450a0a);
  color: #fee2e2;
}
.rank-last .ranking-score {
  color: #fecaca;
}
.rank-last:hover {
  box-shadow: 0 0 0 1px rgba(220,38,38,.22), 0 18px 34px rgba(127,29,29,.24);
}
.rank-last::before {
  background:
    radial-gradient(circle at 16% 22%, rgba(248,113,113,.75) 0 2px, transparent 3px),
    radial-gradient(circle at 86% 22%, rgba(254,202,202,.6) 0 2px, transparent 3px),
    radial-gradient(circle at 26% 76%, rgba(153,27,27,.75) 0 2px, transparent 3px),
    radial-gradient(circle at 72% 78%, rgba(239,68,68,.65) 0 2px, transparent 3px);
  animation: emberDrift 3s linear infinite;
}
.rank-last::after {
  background: linear-gradient(120deg, transparent 25%, rgba(248,113,113,.12) 50%, transparent 75%);
  animation: sheenSweep 2.1s ease-in-out infinite;
}

@keyframes sparkleDrift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-2%, 2%, 0) scale(1.02); }
  100% { transform: translate3d(2%, -2%, 0) scale(1); }
}
@keyframes emberDrift {
  0% { transform: translate3d(0, 0, 0) scale(1); filter: blur(0); }
  50% { transform: translate3d(2%, -2%, 0) scale(1.03); filter: blur(.2px); }
  100% { transform: translate3d(-2%, 2%, 0) scale(1); filter: blur(0); }
}
@keyframes sheenSweep {
  0% { transform: translateX(-30%) skewX(-18deg); opacity: 0; }
  25% { opacity: .65; }
  100% { transform: translateX(30%) skewX(-18deg); opacity: 0; }
}

@media (max-width: 720px) {
  .project-rules-hero {
    grid-template-columns: 1fr;
  }
  .rules-icon-wrap {
    width: 88px;
    height: 88px;
  }
}

.course-group-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 16px;
  align-items: start;
}
.course-ranking-panel {
  background: linear-gradient(180deg, rgba(15,23,42,.92), rgba(11,18,32,1));
  border: 1px solid #334155;
  border-radius: 18px;
  padding: 14px;
  position: sticky;
  top: 16px;
}
.course-ranking-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.course-ranking-head h4 {
  margin: 0;
}
.mini-ranking-list {
  gap: 8px;
}
.mini-ranking-row {
  padding: 10px 12px;
}
.mini-ranking-row .ranking-position {
  width: 28px;
  height: 28px;
  font-size: .92rem;
}
.mini-ranking-row .ranking-left {
  gap: 10px;
}

.badge.gold {
  background: linear-gradient(135deg, #facc15, #f59e0b);
  color: #1f2937;
  border: none;
}
.featured-team-card {
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at top, rgba(251,191,36,.16), rgba(59,130,246,.10) 42%, rgba(17,24,39,1) 82%);
  border-color: rgba(251,191,36,.34);
}
.featured-team-shell {
  position: relative;
  display: grid;
  gap: 18px;
  isolation: isolate;
}
.featured-team-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.featured-team-header h2 {
  margin: 10px 0 6px;
}
.featured-window-chip {
  min-width: 180px;
  display: grid;
  gap: 4px;
  justify-items: center;
  background: rgba(15,23,42,.72);
  border: 1px solid rgba(251,191,36,.28);
  border-radius: 18px;
  padding: 12px 14px;
  color: #fef3c7;
}
.featured-team-body {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1fr);
  gap: 18px;
  align-items: center;
}
.featured-team-identity {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}
.featured-team-identity h3 {
  margin: 0 0 6px;
  font-size: clamp(1.6rem, 2.2vw, 2.3rem);
}
.featured-logo-wrap {
  width: 120px;
  height: 120px;
  border-radius: 30px;
  box-shadow: 0 0 0 1px rgba(251,191,36,.22), 0 18px 36px rgba(245,158,11,.22);
}
.featured-team-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.metric-badge {
  background: rgba(15,23,42,.86);
  border: 1px solid rgba(148,163,184,.25);
  border-radius: 16px;
  padding: 12px 14px;
  display: grid;
  gap: 6px;
}
.metric-badge span {
  font-size: .86rem;
  color: #94a3b8;
}
.metric-badge strong {
  font-size: 1.18rem;
  color: #f8fafc;
}
.metric-badge.highlight {
  border-color: rgba(251,191,36,.42);
  background: linear-gradient(135deg, rgba(251,191,36,.14), rgba(15,23,42,.92));
}
.metric-badge.highlight strong {
  color: #fef08a;
}
.metric-badge.negative strong {
  color: #fecaca;
}
.featured-effects {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}
.confetti,
.firework {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.confetti {
  width: 44%;
  height: 160%;
  top: -18%;
  background-repeat: no-repeat;
  filter: saturate(1.15);
}
.confetti-left {
  left: -8%;
  background-image:
    radial-gradient(circle at 12% 10%, rgba(251,191,36,.95) 0 3px, transparent 3.5px),
    radial-gradient(circle at 34% 28%, rgba(59,130,246,.85) 0 3px, transparent 3.5px),
    radial-gradient(circle at 56% 14%, rgba(236,72,153,.9) 0 3px, transparent 3.5px),
    radial-gradient(circle at 70% 34%, rgba(34,197,94,.9) 0 3px, transparent 3.5px),
    radial-gradient(circle at 22% 48%, rgba(248,250,252,.85) 0 3px, transparent 3.5px),
    radial-gradient(circle at 46% 56%, rgba(250,204,21,.9) 0 3px, transparent 3.5px),
    radial-gradient(circle at 76% 64%, rgba(56,189,248,.92) 0 3px, transparent 3.5px),
    radial-gradient(circle at 32% 74%, rgba(244,114,182,.9) 0 3px, transparent 3.5px);
}
.confetti-right {
  right: -8%;
  background-image:
    radial-gradient(circle at 18% 20%, rgba(34,197,94,.9) 0 3px, transparent 3.5px),
    radial-gradient(circle at 36% 10%, rgba(248,250,252,.88) 0 3px, transparent 3.5px),
    radial-gradient(circle at 58% 28%, rgba(250,204,21,.95) 0 3px, transparent 3.5px),
    radial-gradient(circle at 74% 16%, rgba(59,130,246,.9) 0 3px, transparent 3.5px),
    radial-gradient(circle at 28% 46%, rgba(236,72,153,.92) 0 3px, transparent 3.5px),
    radial-gradient(circle at 54% 60%, rgba(34,197,94,.9) 0 3px, transparent 3.5px),
    radial-gradient(circle at 78% 72%, rgba(251,191,36,.95) 0 3px, transparent 3.5px),
    radial-gradient(circle at 34% 82%, rgba(147,197,253,.9) 0 3px, transparent 3.5px);
}
.firework {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255,255,255,.95) 0 2px, transparent 3px),
    radial-gradient(circle, rgba(251,191,36,.75) 0 42%, transparent 43%),
    repeating-conic-gradient(from 0deg, rgba(255,255,255,.0) 0 10deg, rgba(255,255,255,.18) 10deg 12deg, rgba(255,255,255,0) 12deg 22deg),
    repeating-conic-gradient(from 8deg, rgba(250,204,21,.0) 0 14deg, rgba(250,204,21,.22) 14deg 16deg, rgba(250,204,21,0) 16deg 28deg);
  mix-blend-mode: screen;
}
.firework-left { left: 6%; bottom: -16px; }
.firework-center { left: calc(50% - 90px); top: 14%; }
.firework-right { right: 6%; bottom: -24px; }
.featured-team-card:hover {
  box-shadow: 0 0 0 1px rgba(251,191,36,.28), 0 24px 44px rgba(245,158,11,.18);
}
.featured-team-card:hover .confetti-left {
  opacity: 1;
  animation: confettiBurstLeft 1.9s ease-out infinite;
}
.featured-team-card:hover .confetti-right {
  opacity: 1;
  animation: confettiBurstRight 2s ease-out .12s infinite;
}
.featured-team-card:hover .firework-left {
  opacity: 1;
  animation: fireworkBloom 1.6s ease-out infinite;
}
.featured-team-card:hover .firework-center {
  opacity: 1;
  animation: fireworkBloomCenter 1.9s ease-out .22s infinite;
}
.featured-team-card:hover .firework-right {
  opacity: 1;
  animation: fireworkBloom 1.7s ease-out .12s infinite reverse;
}

@keyframes confettiBurstLeft {
  0% { transform: translate3d(0, 24px, 0) rotate(-8deg) scale(.92); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translate3d(14%, -26px, 0) rotate(8deg) scale(1.08); opacity: 0; }
}
@keyframes confettiBurstRight {
  0% { transform: translate3d(0, 26px, 0) rotate(10deg) scale(.94); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translate3d(-14%, -28px, 0) rotate(-10deg) scale(1.08); opacity: 0; }
}
@keyframes fireworkBloom {
  0% { transform: translateY(18px) scale(.18); opacity: 0; }
  20% { opacity: .95; }
  70% { opacity: .72; }
  100% { transform: translateY(-46px) scale(1.08); opacity: 0; }
}
@keyframes fireworkBloomCenter {
  0% { transform: translateY(10px) scale(.14); opacity: 0; }
  20% { opacity: .95; }
  70% { opacity: .7; }
  100% { transform: translateY(-24px) scale(1.15); opacity: 0; }
}

@media (max-width: 980px) {
  .course-group-layout,
  .featured-team-body {
    grid-template-columns: 1fr;
  }
  .course-ranking-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .featured-team-header,
  .featured-team-identity {
    grid-template-columns: 1fr;
    display: grid;
  }
  .featured-team-header {
    justify-content: start;
  }
  .featured-team-metrics {
    grid-template-columns: 1fr;
  }
  .featured-logo-wrap {
    width: 104px;
    height: 104px;
  }
  .featured-window-chip {
    justify-items: start;
    min-width: 0;
  }
}


.web-contract-preview-card {
  overflow: hidden;
}

.web-editor-form {
  display: grid;
  gap: 1rem;
}

.web-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.web-editor-grid textarea {
  width: 100%;
  min-height: 420px;
  resize: vertical;
  font-family: "Fira Code", "Cascadia Code", Consolas, monospace;
  font-size: 0.93rem;
  line-height: 1.55;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(2, 6, 23, 0.72);
  color: #e2e8f0;
  padding: 1rem;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}

.web-editor-grid textarea:focus {
  outline: none;
  border-color: rgba(94, 234, 212, 0.6);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.12);
}

.web-preview-shell {
  display: grid;
  gap: 0.75rem;
}

.web-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.web-preview-frame {
  width: 100%;
  min-height: 720px;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: linear-gradient(180deg, rgba(15,23,42,0.95), rgba(2,6,23,0.95));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02), 0 20px 40px rgba(2,8,23,0.28);
}

.admin-web-preview-card .web-preview-frame {
  min-height: 640px;
}

@media (max-width: 980px) {
  .web-editor-grid {
    grid-template-columns: 1fr;
  }

  .web-editor-grid textarea {
    min-height: 300px;
  }

  .web-preview-frame,
  .admin-web-preview-card .web-preview-frame {
    min-height: 520px;
  }
}


.team-card-clickable {
  box-shadow: 0 0 0 1px rgba(59,130,246,.08);
}
.team-name-link {
  color: #f8fafc;
  text-decoration: none;
}
.team-name-trigger {
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.team-name-link:hover,
.team-name-trigger:focus-visible {
  color: #93c5fd;
  text-decoration: underline;
}
.ranking-link-row {
  text-decoration: none;
  color: inherit;
}
.ranking-link-row:hover {
  color: inherit;
}
.ranking-score-with-status {
  display: grid;
  justify-items: end;
  gap: 4px;
}
.small-link {
  padding: 8px 10px;
  font-size: .86rem;
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .brand-mark__icon {
    width: 38px;
    height: 38px;
  }
}


.score-breakdown-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.score-breakdown-card {
  background: #0b1220;
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 6px;
}
.score-breakdown-card span {
  color: var(--muted);
  font-size: 0.92rem;
}
.score-breakdown-card strong {
  font-size: 1.25rem;
}
.score-breakdown-card small {
  color: var(--muted);
  line-height: 1.35;
}
.score-breakdown-card.negative strong {
  color: #fca5a5;
}
.legend-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Fase 6: home visual, ranking local y modal de equipo */
.landing-team-card {
  position: relative;
  overflow: hidden;
}
.landing-team-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.team-local-rank {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #334155;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.team-local-rank.rank-first { background: linear-gradient(135deg, #facc15, #f59e0b); color: #1f2937; border-color: rgba(251,191,36,.45); }
.team-local-rank.rank-second { background: linear-gradient(135deg, #e2e8f0, #94a3b8); color: #0f172a; border-color: rgba(148,163,184,.44); }
.team-local-rank.rank-third { background: linear-gradient(135deg, #fdba74, #c2410c); color: #fff7ed; border-color: rgba(251,146,60,.4); }
.team-message-indicator {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .88rem;
  background: rgba(59,130,246,.16);
  color: #bfdbfe;
  border: 1px solid rgba(59,130,246,.32);
  box-shadow: 0 0 0 1px rgba(59,130,246,.08), 0 0 18px rgba(59,130,246,.12);
}
.team-image-trigger {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
}
.team-image-trigger:hover .team-logo-wrap,
.team-image-trigger:focus-visible .team-logo-wrap {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 16px 30px rgba(2,6,23,.26);
}
.team-image-trigger .team-logo-wrap {
  transition: transform .18s ease, box-shadow .18s ease;
}
.landing-team-card.rank-first {
  border-color: rgba(251,191,36,.34);
  background: radial-gradient(circle at top, rgba(251,191,36,.12), rgba(11,18,32,1) 70%);
  box-shadow: 0 18px 32px rgba(245,158,11,.08);
}
.landing-team-card.rank-second {
  border-color: rgba(148,163,184,.34);
  background: radial-gradient(circle at top, rgba(226,232,240,.1), rgba(11,18,32,1) 70%);
}
.landing-team-card.rank-third {
  border-color: rgba(251,146,60,.34);
  background: radial-gradient(circle at top, rgba(251,146,60,.10), rgba(11,18,32,1) 70%);
}
.landing-team-card.rank-first::before,
.landing-team-card.rank-second::before,
.landing-team-card.rank-third::before {
  content: "";
  position: absolute;
  inset: auto -10% -38% auto;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  opacity: .18;
  filter: blur(18px);
  pointer-events: none;
}
.landing-team-card.rank-first::before { background: rgba(251,191,36,.65); }
.landing-team-card.rank-second::before { background: rgba(226,232,240,.5); }
.landing-team-card.rank-third::before { background: rgba(251,146,60,.55); }
.landing-team-card.rank-first::after,
.landing-team-card.rank-second::after,
.landing-team-card.rank-third::after {
  content: "";
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  opacity: .55;
  pointer-events: none;
  animation: sparkleDrift 3.1s linear infinite;
}
.landing-team-card.rank-first::after {
  background-image:
    radial-gradient(circle at 14% 18%, rgba(254,240,138,.95) 0 2px, transparent 3px),
    radial-gradient(circle at 82% 16%, rgba(255,255,255,.88) 0 2px, transparent 3px),
    radial-gradient(circle at 74% 74%, rgba(253,224,71,.92) 0 2px, transparent 3px),
    radial-gradient(circle at 26% 70%, rgba(255,255,255,.82) 0 2px, transparent 3px);
}
.landing-team-card.rank-second::after {
  background-image:
    radial-gradient(circle at 18% 20%, rgba(255,255,255,.9) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 22%, rgba(226,232,240,.86) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 76%, rgba(203,213,225,.84) 0 2px, transparent 3px),
    radial-gradient(circle at 28% 72%, rgba(255,255,255,.8) 0 2px, transparent 3px);
}
.landing-team-card.rank-third::after {
  background-image:
    radial-gradient(circle at 16% 18%, rgba(254,215,170,.9) 0 2px, transparent 3px),
    radial-gradient(circle at 82% 22%, rgba(255,237,213,.86) 0 2px, transparent 3px),
    radial-gradient(circle at 72% 74%, rgba(251,146,60,.82) 0 2px, transparent 3px),
    radial-gradient(circle at 30% 70%, rgba(255,237,213,.8) 0 2px, transparent 3px);
}
.team-spotlight-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1250;
}
.team-spotlight-modal.is-open { display: block; }
.team-spotlight-modal__backdrop { position: absolute; inset: 0; background: rgba(2, 6, 23, 0.84); }
.team-spotlight-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(92vw, 840px);
  margin: 5vh auto;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
}
.team-spotlight-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  color: var(--text);
  border: 1px solid #475569;
  font-size: 24px;
  line-height: 1;
  z-index: 2;
}
.team-spotlight-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, .95fr);
  gap: 18px;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(15,23,42,.98), rgba(11,18,32,1));
  border: 1px solid rgba(51,65,85,.85);
  padding: 16px;
  isolation: isolate;
}
.team-spotlight-shell.rank-first { border-color: rgba(251,191,36,.38); box-shadow: 0 0 0 1px rgba(251,191,36,.14), 0 22px 40px rgba(245,158,11,.12); }
.team-spotlight-shell.rank-second { border-color: rgba(203,213,225,.32); }
.team-spotlight-shell.rank-third { border-color: rgba(251,146,60,.34); }
.team-spotlight-visuals { position: absolute; inset: 0; pointer-events: none; z-index: -1; }
.team-spotlight-glow,
.team-spotlight-stars { position: absolute; opacity: 0; }
.team-spotlight-shell.rank-first .team-spotlight-glow,
.team-spotlight-shell.rank-second .team-spotlight-glow,
.team-spotlight-shell.rank-third .team-spotlight-glow,
.team-spotlight-shell.rank-first .team-spotlight-stars,
.team-spotlight-shell.rank-second .team-spotlight-stars,
.team-spotlight-shell.rank-third .team-spotlight-stars { opacity: 1; }
.team-spotlight-glow { width: 180px; height: 180px; border-radius: 50%; filter: blur(22px); }
.team-spotlight-glow.left { left: -40px; top: -30px; }
.team-spotlight-glow.right { right: -40px; bottom: -36px; }
.team-spotlight-shell.rank-first .team-spotlight-glow { background: rgba(251,191,36,.25); }
.team-spotlight-shell.rank-second .team-spotlight-glow { background: rgba(226,232,240,.18); }
.team-spotlight-shell.rank-third .team-spotlight-glow { background: rgba(251,146,60,.2); }
.team-spotlight-stars { width: 100%; height: 100%; animation: sparkleDrift 3s linear infinite; }
.team-spotlight-stars.one {
  background-image:
    radial-gradient(circle at 14% 20%, rgba(255,255,255,.9) 0 2px, transparent 3px),
    radial-gradient(circle at 82% 18%, rgba(255,255,255,.82) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 74%, rgba(255,255,255,.78) 0 2px, transparent 3px),
    radial-gradient(circle at 24% 76%, rgba(255,255,255,.76) 0 2px, transparent 3px);
}
.team-spotlight-stars.two {
  animation-duration: 3.6s;
  background-image:
    radial-gradient(circle at 24% 12%, rgba(250,204,21,.88) 0 2px, transparent 3px),
    radial-gradient(circle at 76% 28%, rgba(59,130,246,.78) 0 2px, transparent 3px),
    radial-gradient(circle at 58% 82%, rgba(236,72,153,.72) 0 2px, transparent 3px),
    radial-gradient(circle at 10% 62%, rgba(34,197,94,.76) 0 2px, transparent 3px);
}
.team-spotlight-media {
  min-height: 340px;
  border-radius: 18px;
  overflow: hidden;
  background: radial-gradient(circle at center, rgba(34,211,238,.08), #020617 72%);
  border: 1px solid #334155;
  display: flex;
  align-items: center;
  justify-content: center;
}
.team-spotlight-img { width: 100%; height: 100%; max-height: 72vh; object-fit: contain; display: block; }
.team-spotlight-placeholder {
  width: 132px;
  height: 132px;
  border-radius: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #1d4ed8, #0f766e);
  color: #eff6ff;
}
.team-spotlight-copy { display: grid; align-content: center; gap: 12px; }
.team-spotlight-copy h3 { margin: 0; font-size: clamp(1.6rem, 2.3vw, 2.2rem); }
.team-spotlight-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hidden { display: none !important; }
@media (max-width: 900px) { .team-spotlight-shell { grid-template-columns: 1fr; } }

/* Fase 7 · Estado operativo de reglas */
.rule-state-card {
  position: relative;
  overflow: hidden;
}
.rule-state-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at top right, rgba(94, 234, 212, 0.12), transparent 38%);
}
.rule-state-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.rule-state-tile {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255,255,255,0.04);
}
.rule-state-tile span,
.rule-state-tile small {
  display: block;
  color: rgba(226,232,240,0.72);
}
.rule-state-tile strong {
  display: block;
  margin: 4px 0;
  font-size: 1.25rem;
}
.rule-permission-list {
  position: relative;
  display: grid;
  gap: 10px;
}
.rule-permission {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255,255,255,0.035);
}
.rule-permission p {
  margin: 2px 0 0;
}
.rule-status-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #5eead4;
  box-shadow: 0 0 16px rgba(94, 234, 212, 0.55);
}
.rule-permission.blocked .rule-status-dot {
  background: #fbbf24;
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.45);
}
.rule-permission.blocked {
  border-color: rgba(251, 191, 36, 0.18);
}

/* Fase 8 · Panel fuerte de interventoría */
.interventor-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  background: radial-gradient(circle at top left, rgba(59,130,246,.16), rgba(17,24,39,1) 55%);
}
.eyebrow {
  margin: 0 0 4px;
  color: #93c5fd;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .78rem;
  font-weight: 700;
}
.interventor-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.interventor-kpi {
  margin-bottom: 0;
  min-height: 120px;
  position: relative;
  overflow: hidden;
}
.interventor-kpi::after {
  content: "";
  position: absolute;
  inset: auto -28px -46px auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(59,130,246,.16);
  filter: blur(6px);
}
.interventor-kpi.needs-attention::after { background: rgba(245,158,11,.22); }
.interventor-kpi span,
.interventor-kpi small {
  display: block;
  color: var(--muted);
}
.interventor-kpi strong {
  display: block;
  margin: 8px 0 4px;
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  line-height: 1;
}
.interventor-task-list,
.compact-list,
.activity-timeline {
  display: grid;
  gap: 10px;
}
.interventor-task {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(148,163,184,.18);
  background: rgba(15,23,42,.72);
  border-radius: 16px;
  padding: 12px;
}
.interventor-task p,
.activity-row p,
.compact-attention-item p { margin: 3px 0; }
.interventor-task small,
.activity-row small { color: rgba(226,232,240,.70); }
.task-priority-dot {
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: #60a5fa;
  box-shadow: 0 0 18px rgba(96,165,250,.38);
}
.interventor-task.warn { border-color: rgba(245,158,11,.28); }
.interventor-task.warn .task-priority-dot { background: #f59e0b; box-shadow: 0 0 18px rgba(245,158,11,.42); }
.interventor-task.urgent { border-color: rgba(239,68,68,.36); background: rgba(127,29,29,.18); }
.interventor-task.urgent .task-priority-dot { background: #ef4444; box-shadow: 0 0 20px rgba(239,68,68,.55); }
.task-actions { justify-content: flex-end; }
.interventor-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}
.interventor-mini-tile {
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255,255,255,.035);
}
.interventor-mini-tile span {
  display: block;
  color: var(--muted);
  font-size: .9rem;
}
.interventor-mini-tile strong {
  display: block;
  margin-top: 6px;
  font-size: 1.5rem;
}
.compact-attention-item,
.activity-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(148,163,184,.16);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255,255,255,.025);
}
.activity-row { justify-content: flex-start; }
.activity-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 16px rgba(34,197,94,.42);
}
.intervention-review-card {
  border: 1px solid rgba(148,163,184,.16);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
  background: rgba(15,23,42,.50);
}
.intervention-review-card.paused {
  border-color: rgba(239,68,68,.28);
  background: rgba(127,29,29,.14);
}
.review-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.badge.warn {
  background: rgba(245,158,11,.20);
  color: #fde68a;
  border: 1px solid rgba(245,158,11,.24);
}
.badge.danger {
  background: rgba(239,68,68,.20);
  color: #fecaca;
  border: 1px solid rgba(239,68,68,.26);
}
@media (max-width: 820px) {
  .interventor-hero,
  .interventor-task,
  .compact-attention-item,
  .review-card-head {
    display: grid;
    grid-template-columns: 1fr;
  }
  .task-actions { justify-content: flex-start; }
}

/* Fase 9 · Cierre de ciclo e historial */
.history-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  border: 1px solid rgba(255,255,255,0.12);
  position: relative;
  overflow: hidden;
}
.history-hero::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -90px;
  width: 240px;
  height: 240px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(250,204,21,0.18), transparent 68%);
  pointer-events: none;
}
.history-cycle-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.history-cycle-pill {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  text-decoration: none;
  color: inherit;
  background: rgba(255,255,255,0.035);
}
.history-cycle-pill:hover,
.history-cycle-pill.active {
  border-color: rgba(250,204,21,0.45);
  background: rgba(250,204,21,0.08);
}
.history-cycle-pill span {
  font-size: .85rem;
  color: var(--muted);
}
.history-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.history-kpi {
  min-height: 112px;
}
.history-kpi span,
.history-highlight span {
  display: block;
  color: var(--muted);
  font-size: .88rem;
  margin-bottom: 6px;
}
.history-kpi strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
}
.history-kpi small,
.history-highlight small {
  color: var(--muted);
}
.history-highlight-grid {
  gap: 12px;
}
.history-highlight {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255,255,255,0.035);
}
.history-ranking-table td,
.history-ranking-table th {
  vertical-align: middle;
}
.rank-pill.small {
  min-width: 28px;
  height: 28px;
  font-size: .82rem;
}
.history-course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.history-course-card h3 {
  margin-top: 0;
}
.history-course-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.history-course-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.history-course-list li:last-child {
  border-bottom: 0;
}
.history-contract-list {
  display: grid;
  gap: 10px;
}
.history-contract-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.035);
}
.history-contract-item.closed {
  border-color: rgba(34,197,94,0.28);
}
.history-contract-item.cancelled {
  border-color: rgba(239,68,68,0.28);
}
.history-contract-item.submitted_for_review,
.history-contract-item.correction_required {
  border-color: rgba(250,204,21,0.28);
}
.history-contract-item p {
  margin: 4px 0;
}
@media print {
  .no-print,
  nav,
  .flash-messages,
  .button-row.no-print {
    display: none !important;
  }
  body {
    background: #fff !important;
    color: #111 !important;
  }
  .card,
  .history-contract-item,
  .history-highlight,
  .history-cycle-pill {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    background: #fff !important;
    color: #111 !important;
  }
  .muted,
  small {
    color: #444 !important;
  }
  .history-kpi-grid,
  .history-highlight-grid,
  .history-course-grid {
    break-inside: avoid;
  }
}

/* Hotfix visual home cards: puesto arriba a la derecha y logo libre arriba */
.landing-team-card {
  position: relative;
  overflow: hidden;
  grid-template-rows: auto 1fr auto;
}
.landing-team-card .landing-team-card-head {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-end;
  gap: 6px;
  pointer-events: none;
}
.landing-team-card .landing-team-card-head .team-message-indicator {
  pointer-events: auto;
}
.landing-team-card .landing-team-top {
  padding-right: 52px;
}
.landing-team-card .landing-score-row {
  align-items: flex-end;
  gap: 12px;
  margin-top: auto;
}
.landing-team-card .landing-score-row .small-link {
  margin-left: auto;
  white-space: nowrap;
}
@media (max-width: 520px) {
  .landing-team-card .landing-team-top {
    padding-right: 44px;
  }
  .landing-team-card .landing-team-card-head {
    top: 12px;
    right: 12px;
  }
  .landing-team-card .team-local-rank {
    width: 32px;
    height: 32px;
  }
}

/* Fase 11: navegación y tarjetas clicables sin alterar la lógica funcional */
.badge-link {
  text-decoration: none;
  cursor: pointer;
}
.badge-link:hover {
  filter: brightness(1.12);
}
.interventor-kpi-link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.interventor-kpi-link:hover {
  transform: translateY(-1px);
  border-color: rgba(148, 163, 184, .72);
  box-shadow: 0 12px 28px rgba(15, 23, 42, .34);
}
.interventor-kpi-link:focus-visible,
.badge-link:focus-visible {
  outline: 2px solid rgba(34, 197, 94, .9);
  outline-offset: 3px;
}
html {
  scroll-behavior: smooth;
}

/* Fase 12 · mensajería contractual independiente */
.compact-message-summary {
  border-color: rgba(96, 165, 250, 0.35);
}
.message-preview-line {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 12px;
}
.message-preview-pill {
  display: block;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.58);
  text-decoration: none;
  color: inherit;
}
.message-preview-pill:hover {
  border-color: rgba(96, 165, 250, 0.58);
  transform: translateY(-1px);
}
.message-preview-pill span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.9rem;
}
.message-kpi-grid .card,
.message-kpi-link {
  text-decoration: none;
  color: inherit;
}
.message-kpi-link {
  display: block;
  transition: transform 0.16s ease, border-color 0.16s ease;
}
.message-kpi-link:hover {
  transform: translateY(-2px);
  border-color: rgba(96, 165, 250, 0.55);
}
.message-kpi-link span,
.message-kpi-link small {
  display: block;
  color: var(--muted);
}
.message-kpi-link strong {
  display: block;
  margin: 6px 0;
  font-size: 2rem;
}
.message-center-list {
  display: grid;
  gap: 14px;
}
.message-center-card {
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.58);
}
.message-center-card.urgent-soft {
  border-color: rgba(245, 158, 11, 0.48);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.08), 0 18px 40px rgba(245, 158, 11, 0.08);
}
.message-center-card.muted-card {
  background: rgba(15, 23, 42, 0.36);
}
.message-center-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.compact-history .message-center-card {
  opacity: 0.92;
}
@media (max-width: 720px) {
  .message-center-topline {
    flex-direction: column;
  }
}

.field-hint {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.35;
}

/* Laboratorio HTML/CSS independiente */
.html-lab-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.html-lab-hero h1 {
  margin: 10px 0 8px;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.html-lab-hero-actions,
.html-lab-toolbar,
.html-lab-panel-head,
.html-lab-font-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.html-lab-hero-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.html-lab-toolbar {
  justify-content: space-between;
  flex-wrap: wrap;
}

.html-lab-select-wrap {
  min-width: min(100%, 280px);
}

.html-lab-select-wrap span {
  font-size: .86rem;
}

.html-lab-status {
  color: var(--muted);
  font-size: .9rem;
}

.html-lab-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr);
  gap: 16px;
  align-items: stretch;
}

.html-lab-panel {
  min-width: 0;
  margin-bottom: 0;
}

.html-lab-preview-panel {
  grid-column: 1 / -1;
}

.html-lab-panel-head {
  justify-content: space-between;
  margin-bottom: 12px;
}

.html-lab-panel-head h2 {
  margin: 0 0 4px;
}

.html-lab-editor {
  height: 430px;
  border: 1px solid #334155;
  border-radius: 14px;
  overflow: hidden;
  background: #111827;
}

.html-lab-editor.is-disabled {
  display: none;
}

.html-lab-fallback {
  display: none;
  width: 100%;
  min-height: 430px;
  resize: vertical;
  font-family: Consolas, "Liberation Mono", monospace;
  line-height: 1.5;
}

.html-lab-fallback.is-active {
  display: block;
}

.html-lab-preview {
  width: 100%;
  min-height: 520px;
  border: 1px solid #334155;
  border-radius: 14px;
  background: white;
}

.html-lab-note {
  border-color: rgba(34, 197, 94, .35);
}

.secondary-button,
.danger-button {
  border: 1px solid #475569;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

.secondary-button {
  background: #1f2937;
  color: var(--text);
}

.secondary-button:hover {
  background: #334155;
}

.danger-button {
  background: rgba(239, 68, 68, .16);
  color: #fecaca;
}

.secondary-button.compact {
  padding: 7px 10px;
  min-width: 42px;
}

.html-lab-grid.preview-focus {
  grid-template-columns: 1fr;
}

.html-lab-grid.preview-focus .html-lab-panel:not(.html-lab-preview-panel) {
  display: none;
}

.html-lab-grid.preview-focus .html-lab-preview {
  min-height: 76vh;
}

@media (max-width: 920px) {
  .html-lab-hero,
  .html-lab-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .html-lab-hero-actions {
    justify-content: flex-start;
  }

  .html-lab-grid {
    grid-template-columns: 1fr;
  }
}

/* Fase 9 · Ancho ampliado solo para editores HTML/CSS */
.container.editor-wide-container {
  max-width: min(1760px, calc(100vw - 32px));
  padding-left: 16px;
  padding-right: 16px;
}

.editor-wide-container .html-lab-grid {
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
}

.editor-wide-container .html-lab-editor {
  height: clamp(430px, 48vh, 680px);
}

.editor-wide-container .html-lab-preview {
  min-height: clamp(520px, 58vh, 760px);
}

@media (min-width: 1280px) {
  .editor-wide-container .html-lab-grid {
    grid-template-columns: minmax(360px, 1fr) minmax(360px, 1fr) minmax(420px, 1.15fr);
  }

  .editor-wide-container .html-lab-preview-panel {
    grid-column: auto;
  }
}

@media (max-width: 920px) {
  .container.editor-wide-container {
    max-width: 1100px;
    padding-left: 12px;
    padding-right: 12px;
  }
}


/* Fase 5 · Panel estudiante en modo lectura */
.student-readonly-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-color: rgba(251, 191, 36, .35);
  background: linear-gradient(135deg, rgba(251, 191, 36, .10), rgba(59, 130, 246, .08));
}

.student-readonly-banner h2 {
  margin-top: 0;
}

.student-readonly-banner p {
  margin-bottom: 0;
}

@media (max-width: 760px) {
  .student-readonly-banner {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Fase 6 · Ejemplos guiados del laboratorio HTML/CSS */
.html-lab-example-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  border-color: rgba(59, 130, 246, .28);
  background: linear-gradient(135deg, rgba(59, 130, 246, .10), rgba(124, 58, 237, .08));
}

.html-lab-example-card h2 {
  margin: 8px 0 6px;
}

.html-lab-example-tip {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
  font-size: .94rem;
}

@media (max-width: 760px) {
  .html-lab-example-card {
    flex-direction: column;
  }

  .html-lab-example-tip {
    max-width: none;
  }
}

/* Fase 7 · Mejoras de experiencia del laboratorio HTML/CSS */
.html-lab-font-size {
  min-width: 46px;
  text-align: center;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 700;
}

.html-lab-alerts {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.html-lab-alerts p {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(251, 191, 36, .34);
  border-radius: 14px;
  background: rgba(251, 191, 36, .08);
  color: var(--text);
}

.html-lab-alerts code {
  padding: 2px 6px;
  border-radius: 7px;
  background: rgba(15, 23, 42, .35);
}

.html-lab-preview-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  padding: 22px;
  background: rgba(15, 23, 42, .78);
  backdrop-filter: blur(6px);
}

.html-lab-preview-modal.is-active {
  display: grid;
  place-items: center;
}

.html-lab-preview-modal-card {
  width: min(1180px, 96vw);
  max-height: 92vh;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, .35);
  border-radius: 22px;
  background: var(--card);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
}

.html-lab-preview-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.html-lab-preview-modal-head h2 {
  margin: 0;
}

.html-lab-preview-large-frame {
  min-height: 74vh;
}

body.html-lab-light-mode .html-lab-editor {
  border-color: #cbd5e1;
  background: #f8fafc;
}

body.html-lab-light-mode .html-lab-alerts code {
  background: rgba(226, 232, 240, .95);
}

body.html-lab-light-mode .secondary-button {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
}

body.html-lab-light-mode .secondary-button:hover {
  background: #e2e8f0;
}

@media (max-width: 760px) {
  .html-lab-preview-modal {
    padding: 10px;
  }

  .html-lab-preview-modal-card {
    padding: 12px;
  }

  .html-lab-preview-large-frame {
    min-height: 70vh;
  }
}

/* Fase 8 - limpieza visual del editor viejo */
.legacy-editor-retired-note {
  border-style: dashed;
}

.web-contract-editor-actions .btn-link:first-child {
  font-weight: 800;
}

.web-contract-preview-card.editor-enabled .web-preview-header strong::after {
  content: " · solo lectura";
  font-weight: 600;
  color: #94a3b8;
}

.web-editor-grid {
  display: none;
}

.web-editor-form .html-lab-fallback:not(.is-active) {
  display: none !important;
}

/* Fase 10 · Reinicio competitivo conservando equipos */
.reset-cycle-card {
  border-color: rgba(248, 113, 113, 0.38);
  background: linear-gradient(180deg, rgba(127, 29, 29, 0.22), rgba(15, 23, 42, 0.92));
}
.reset-cycle-card h2 {
  color: #fecaca;
}
.reset-cycle-card input[name="confirmation"] {
  letter-spacing: .04em;
  font-weight: 700;
}

/* Fase 13 · Laboratorio Python básico */
.python-lab-hero {
  border-color: rgba(34, 197, 94, .28);
  background: linear-gradient(135deg, rgba(34, 197, 94, .12), rgba(59, 130, 246, .08));
}

.python-lab-grid {
  display: grid;
  grid-template-columns: 190px minmax(420px, 1.25fr) minmax(360px, .95fr);
  gap: 14px;
  align-items: stretch;
}

.python-lab-files,
.python-lab-editor-panel,
.python-lab-console-panel {
  min-width: 0;
  margin-bottom: 0;
}

.python-lab-files {
  padding: 14px;
}

.python-lab-files-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.python-lab-file {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.python-lab-file:hover,
.python-lab-file.is-active {
  border-color: rgba(59, 130, 246, .34);
  background: rgba(59, 130, 246, .13);
}

.python-lab-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: -6px -6px 12px;
  padding: 6px 6px 0;
  border-bottom: 1px solid rgba(148, 163, 184, .18);
}

.python-lab-tab {
  padding: 9px 14px;
  border: 1px solid rgba(148, 163, 184, .25);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: rgba(15, 23, 42, .36);
  color: var(--text);
  font-weight: 700;
}

.python-lab-tab.is-active {
  background: rgba(59, 130, 246, .16);
}

.python-lab-editor {
  min-height: 560px;
  height: auto;
}

.python-lab-output {
  min-height: 560px;
  margin: 0;
  padding: 18px;
  border: 1px solid #334155;
  border-radius: 14px;
  background: #020617;
  color: #d1fae5;
  white-space: pre-wrap;
  overflow-x: auto;
  font-family: Consolas, "Liberation Mono", monospace;
  line-height: 1.5;
}

.python-lab-grid.console-focus {
  grid-template-columns: 1fr;
}

.python-lab-grid.console-focus .python-lab-files,
.python-lab-grid.console-focus .python-lab-editor-panel {
  display: none;
}

.python-lab-grid.console-focus .python-lab-output {
  min-height: 72vh;
}

body.html-lab-light-mode .python-lab-tab,
body.html-lab-light-mode .python-lab-output {
  border-color: #cbd5e1;
}

body.html-lab-light-mode .python-lab-output {
  background: #f8fafc;
  color: #0f172a;
}

body.html-lab-light-mode .python-lab-file:hover,
body.html-lab-light-mode .python-lab-file.is-active {
  background: rgba(59, 130, 246, .10);
}

@media (min-width: 1380px) {
  .python-lab-grid {
    grid-template-columns: 210px minmax(620px, 1.35fr) minmax(460px, 1fr);
  }
}

@media (max-width: 980px) {
  .python-lab-grid {
    grid-template-columns: 1fr;
  }

  .python-lab-files {
    display: none;
  }

  .python-lab-editor,
  .python-lab-output {
    min-height: 420px;
  }
}

/* Fase 15 · Laboratorio Python tipo mini-IDE */
.python-ide-shell {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.python-ide-main {
  min-width: 0;
  padding: 12px;
  margin-bottom: 0;
}

.python-ide-workspace {
  --python-code-width: 58%;
  display: grid;
  grid-template-columns: minmax(360px, var(--python-code-width)) 12px minmax(320px, 1fr);
  gap: 0;
  align-items: stretch;
  min-width: 0;
}

.python-ide-code-pane,
.python-ide-console-pane {
  min-width: 0;
}

.python-ide-code-pane {
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 14px 0 0 14px;
  overflow: hidden;
  background: rgba(15, 23, 42, .20);
}

.python-ide-console-pane {
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 0 14px 14px 0;
  overflow: hidden;
  background: rgba(15, 23, 42, .20);
}

.python-ide-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, .16);
  background: rgba(15, 23, 42, .42);
  font-weight: 800;
}

.python-ide-pane-head small {
  color: var(--muted);
  font-weight: 600;
}

.python-console-head {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, .16);
}

.python-console-head h2,
.python-console-head p {
  margin-bottom: 2px;
}

.python-ide-resizer {
  position: relative;
  cursor: col-resize;
  background: rgba(15, 23, 42, .34);
  border-top: 1px solid rgba(148, 163, 184, .18);
  border-bottom: 1px solid rgba(148, 163, 184, .18);
}

.python-ide-resizer::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 64px;
  border-radius: 999px;
  background: rgba(148, 163, 184, .78);
  transform: translate(-50%, -50%);
}

.python-ide-resizer:hover,
.python-ide-resizer:focus {
  background: rgba(59, 130, 246, .22);
  outline: none;
}

body.python-resizing {
  cursor: col-resize;
  user-select: none;
}

.python-lab-editor {
  min-height: 600px;
  padding: 0;
  border: 0;
  border-radius: 0;
}

.python-lab-output {
  min-height: 600px;
  border: 0;
  border-radius: 0;
}

.python-ide-shell.console-focus {
  grid-template-columns: 1fr;
}

.python-ide-shell.console-focus .python-lab-files,
.python-ide-shell.console-focus .python-ide-code-pane,
.python-ide-shell.console-focus .python-ide-resizer {
  display: none;
}

.python-ide-shell.console-focus .python-ide-workspace {
  grid-template-columns: 1fr;
}

.python-ide-shell.console-focus .python-ide-console-pane {
  border-radius: 14px;
}

.python-ide-shell.console-focus .python-lab-output {
  min-height: 72vh;
}

body.html-lab-light-mode .python-ide-code-pane,
body.html-lab-light-mode .python-ide-console-pane {
  background: #ffffff;
  border-color: #cbd5e1;
}

body.html-lab-light-mode .python-ide-pane-head,
body.html-lab-light-mode .python-console-head {
  background: #f8fafc;
  border-color: #e2e8f0;
}

body.html-lab-light-mode .python-ide-resizer {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

@media (min-width: 1380px) {
  .python-ide-shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .python-lab-editor,
  .python-lab-output {
    min-height: 650px;
  }
}

@media (max-width: 980px) {
  .python-ide-shell {
    grid-template-columns: 1fr;
  }

  .python-ide-workspace {
    display: block;
  }

  .python-ide-resizer {
    display: none;
  }

  .python-ide-code-pane,
  .python-ide-console-pane {
    border-radius: 14px;
  }

  .python-ide-console-pane {
    margin-top: 14px;
  }

  .python-lab-editor,
  .python-lab-output {
    min-height: 420px;
  }

  .python-ide-shell.mobile-console-visible .python-ide-code-pane {
    display: none;
  }

  .python-ide-shell:not(.mobile-console-visible) .python-ide-console-pane {
    display: none;
  }
}


/* Fase 16: ejemplos y plantillas guiadas del Laboratorio Python */
.python-example-extra {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: min(360px, 100%);
}

.python-expected-box {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.28);
  padding: 0.8rem 0.95rem;
}

.python-expected-box summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--text, #e5e7eb);
}

.python-expected-box pre {
  margin: 0.7rem 0 0;
  white-space: pre-wrap;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #dbeafe;
}

.html-lab-light-mode .python-expected-box {
  background: rgba(248, 250, 252, 0.86);
  border-color: rgba(15, 23, 42, 0.12);
}

.html-lab-light-mode .python-expected-box pre {
  color: #1e293b;
}

/* Fase 17 · Navegación fina para estudiantes */
.student-lab-note {
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.7rem 0.9rem;
  border-radius: 14px;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.32);
}


/* Fase 18 · Seguridad didáctica del Laboratorio Python */
.python-security-alerts {
  border-left: 4px solid rgba(251, 191, 36, 0.75);
}

.python-security-alerts p {
  margin-bottom: 0.45rem;
}

.python-lab-hero button:disabled,
.html-lab-toolbar button:disabled {
  cursor: wait;
  opacity: 0.68;
  filter: grayscale(0.15);
}

.python-lab-output {
  max-height: none;
  overflow-wrap: anywhere;
}

.html-lab-light-mode .python-security-alerts {
  border-left-color: rgba(217, 119, 6, 0.82);
}


/* FIX · Input por líneas en Laboratorio Python */
.python-console-actions {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.python-run-console {
  border-color: rgba(34, 197, 94, 0.7);
  color: #ecfdf5;
  background: rgba(22, 163, 74, 0.15);
}

.python-input-box {
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.34);
  padding: 0.75rem 0.85rem;
}

.python-input-box label {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: baseline;
  color: #f8fafc;
  margin-bottom: 0.45rem;
}

.python-input-box label span {
  color: #93c5fd;
  font-size: 0.82rem;
}

.python-input-lines {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  border-radius: 14px;
  border: 1px solid rgba(96, 165, 250, 0.32);
  background: rgba(2, 6, 23, 0.92);
  color: #e0f2fe;
  padding: 0.7rem 0.8rem;
  font-family: "Consolas", "Cascadia Code", monospace;
  font-size: 0.92rem;
  line-height: 1.45;
  outline: none;
}

.python-input-lines:focus {
  border-color: rgba(34, 197, 94, 0.78);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.13);
}

.python-input-box .muted {
  margin: 0.45rem 0 0;
  font-size: 0.83rem;
}

.html-lab-light-mode .python-input-box {
  background: rgba(241, 245, 249, 0.95);
  border-color: rgba(15, 23, 42, 0.12);
}

.html-lab-light-mode .python-input-box label {
  color: #0f172a;
}

.html-lab-light-mode .python-input-lines {
  background: #ffffff;
  color: #0f172a;
  border-color: rgba(59, 130, 246, 0.35);
}

@media (max-width: 760px) {
  .python-console-actions {
    justify-content: flex-start;
  }
}

/* FIX · Laboratorio Python: elimina franja blanca del gutter de Ace */
.python-lab-editor,
.python-lab-editor .ace_editor,
.python-lab-editor .ace_scroller,
.python-lab-editor .ace_content,
.python-lab-editor .ace_gutter,
.python-lab-editor .ace_gutter-layer,
.python-lab-editor .ace_gutter-cell {
  background-color: #111827 !important;
}

.python-lab-editor .ace_gutter {
  color: #cbd5e1 !important;
  border-right: 1px solid rgba(148, 163, 184, .18) !important;
}

.python-lab-editor .ace_gutter-active-line,
.python-lab-editor .ace_marker-layer .ace_active-line {
  background-color: rgba(148, 163, 184, .16) !important;
}

body.html-lab-light-mode .python-lab-editor,
body.html-lab-light-mode .python-lab-editor .ace_editor,
body.html-lab-light-mode .python-lab-editor .ace_scroller,
body.html-lab-light-mode .python-lab-editor .ace_content,
body.html-lab-light-mode .python-lab-editor .ace_gutter,
body.html-lab-light-mode .python-lab-editor .ace_gutter-layer,
body.html-lab-light-mode .python-lab-editor .ace_gutter-cell {
  background-color: #f8fafc !important;
}

body.html-lab-light-mode .python-lab-editor .ace_gutter {
  color: #475569 !important;
  border-right: 1px solid #cbd5e1 !important;
}

body.html-lab-light-mode .python-lab-editor .ace_gutter-active-line,
body.html-lab-light-mode .python-lab-editor .ace_marker-layer .ace_active-line {
  background-color: #e2e8f0 !important;
}


/* Fase 19 · Consola interactiva para input() en Laboratorio Python */
.python-console-live {
  display: flex;
  flex-direction: column;
  min-height: 520px;
  background: rgba(2, 6, 23, 0.96);
}

.python-console-history {
  flex: 1 1 auto;
  min-height: 460px;
  max-height: none;
  overflow-y: auto;
  border-radius: 0;
  border: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(2, 6, 23, 0.96);
  white-space: pre-wrap;
}

.python-console-input-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.72rem 0.85rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.92);
}

.python-console-caret {
  font-family: "Consolas", "Cascadia Code", monospace;
  color: #86efac;
  font-weight: 900;
}

.python-console-input {
  width: 100%;
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(96, 165, 250, 0.28);
  background: rgba(2, 6, 23, 0.72);
  color: #e0f2fe;
  padding: 0.55rem 0.75rem;
  font-family: "Consolas", "Cascadia Code", monospace;
  font-size: 0.96rem;
  outline: none;
}

.python-console-input:focus {
  border-color: rgba(34, 197, 94, 0.8);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

.python-console-input:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

#pythonSendInput:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.python-ide-shell.console-focus .python-console-live,
.python-ide-shell.console-focus .python-console-history {
  min-height: 72vh;
}

body.html-lab-light-mode .python-console-live,
body.html-lab-light-mode .python-console-history {
  background: #ffffff;
  color: #0f172a;
}

body.html-lab-light-mode .python-console-input-row {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.12);
}

body.html-lab-light-mode .python-console-input {
  background: #ffffff;
  color: #0f172a;
  border-color: rgba(59, 130, 246, 0.35);
}

body.html-lab-light-mode .python-console-caret {
  color: #047857;
}

@media (min-width: 1380px) {
  .python-console-live {
    min-height: 650px;
  }

  .python-console-history {
    min-height: 590px;
  }
}

@media (max-width: 760px) {
  .python-console-live {
    min-height: 420px;
  }

  .python-console-history {
    min-height: 330px;
  }

  .python-console-input-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  #pythonSendInput {
    grid-column: 2;
    justify-self: start;
  }
}

/* Fase 20 · Ajuste conversacional para chatbots en Laboratorio Python */
.python-console-history {
  padding: 0.7rem 0;
  font-family: "Consolas", "Cascadia Code", monospace;
  line-height: 1.45;
}

.python-console-line {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 0.7rem;
  align-items: start;
  padding: 0.14rem 0.9rem;
  border-left: 3px solid transparent;
}

.python-console-line + .python-console-line {
  margin-top: 0.1rem;
}

.python-console-line-label {
  align-self: start;
  justify-self: end;
  min-width: 58px;
  border-radius: 999px;
  padding: 0.08rem 0.38rem;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.72);
  background: rgba(148, 163, 184, 0.12);
}

.python-console-line-text {
  min-width: 0;
  color: #dbeafe;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.python-console-line--program .python-console-line-text {
  color: #e0f2fe;
}

.python-console-line--prompt {
  border-left-color: rgba(250, 204, 21, 0.65);
  background: rgba(250, 204, 21, 0.035);
}

.python-console-line--prompt .python-console-line-label {
  color: #fde68a;
  background: rgba(250, 204, 21, 0.14);
}

.python-console-line--prompt .python-console-line-text {
  color: #fef3c7;
  font-weight: 800;
}

.python-console-line--input {
  border-left-color: rgba(34, 197, 94, 0.65);
  background: rgba(34, 197, 94, 0.04);
}

.python-console-line--input .python-console-line-label {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.14);
}

.python-console-line--input .python-console-line-text {
  color: #bbf7d0;
  font-weight: 800;
}

.python-console-line--error {
  border-left-color: rgba(248, 113, 113, 0.8);
  background: rgba(127, 29, 29, 0.22);
}

.python-console-line--error .python-console-line-label {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.16);
}

.python-console-line--error .python-console-line-text {
  color: #fecaca;
}

.python-console-line--system .python-console-line-label {
  color: #bfdbfe;
  background: rgba(96, 165, 250, 0.14);
}

.python-console-line--system .python-console-line-text {
  color: #bfdbfe;
}

body.html-lab-light-mode .python-console-line-label {
  color: #475569;
  background: rgba(100, 116, 139, 0.1);
}

body.html-lab-light-mode .python-console-line-text,
body.html-lab-light-mode .python-console-line--program .python-console-line-text {
  color: #0f172a;
}

body.html-lab-light-mode .python-console-line--prompt {
  background: rgba(245, 158, 11, 0.08);
}

body.html-lab-light-mode .python-console-line--prompt .python-console-line-label {
  color: #92400e;
  background: rgba(245, 158, 11, 0.18);
}

body.html-lab-light-mode .python-console-line--prompt .python-console-line-text {
  color: #78350f;
}

body.html-lab-light-mode .python-console-line--input {
  background: rgba(22, 163, 74, 0.08);
}

body.html-lab-light-mode .python-console-line--input .python-console-line-label {
  color: #166534;
  background: rgba(22, 163, 74, 0.16);
}

body.html-lab-light-mode .python-console-line--input .python-console-line-text {
  color: #14532d;
}

body.html-lab-light-mode .python-console-line--error {
  background: rgba(239, 68, 68, 0.08);
}

body.html-lab-light-mode .python-console-line--error .python-console-line-label {
  color: #991b1b;
  background: rgba(239, 68, 68, 0.14);
}

body.html-lab-light-mode .python-console-line--error .python-console-line-text {
  color: #7f1d1d;
}

body.html-lab-light-mode .python-console-line--system .python-console-line-label {
  color: #1d4ed8;
  background: rgba(59, 130, 246, 0.12);
}

body.html-lab-light-mode .python-console-line--system .python-console-line-text {
  color: #1e3a8a;
}

@media (max-width: 760px) {
  .python-console-line {
    grid-template-columns: 1fr;
    gap: 0.2rem;
    padding: 0.2rem 0.75rem;
  }

  .python-console-line-label {
    justify-self: start;
    min-width: auto;
  }
}

/* Fase 22 · Seguridad y estabilidad de consola interactiva Python */
.python-stop-console {
  border-color: rgba(248, 113, 113, 0.42) !important;
  color: #fecaca !important;
  background: rgba(127, 29, 29, 0.28) !important;
}

.python-stop-console:not(:disabled):hover,
.python-stop-console:not(:disabled):focus {
  border-color: rgba(248, 113, 113, 0.86) !important;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.16);
}

.python-stop-console:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.python-console-actions {
  align-items: center;
}

.python-console-line--system .python-console-line-text {
  overflow-wrap: anywhere;
}

body.html-lab-light-mode .python-stop-console {
  color: #991b1b !important;
  background: rgba(254, 226, 226, 0.9) !important;
  border-color: rgba(220, 38, 38, 0.32) !important;
}


/* FIX · Confirmación segura de reinicio competitivo */
.reset-action-row {
  display: flex;
  justify-content: flex-start;
  margin-top: 16px;
}
.reset-confirm-card {
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.danger-tag {
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.35);
}
.danger-alert,
.warning-alert {
  border-radius: 18px;
  padding: 14px 16px;
  margin: 18px 0;
  line-height: 1.5;
}
.danger-alert {
  background: rgba(127, 29, 29, 0.28);
  border: 1px solid rgba(239, 68, 68, 0.42);
}
.warning-alert {
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
}
.reset-scope-grid {
  align-items: stretch;
}
.scope-box {
  border-radius: 20px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.35);
}
.scope-box ul {
  margin: 10px 0 0;
  padding-left: 20px;
}
.scope-box li {
  margin-bottom: 7px;
}
.keep-box {
  border-color: rgba(34, 197, 94, 0.32);
}
.delete-box {
  border-color: rgba(239, 68, 68, 0.32);
}
.reset-confirm-form {
  margin-top: 18px;
}
.checkbox-line {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.45;
}
.reset-last-log {
  margin-top: 14px;
}

/* Fase 24 · Recuperación del laboratorio HTML/CSS tipo Programiz */
.container.editor-wide-container {
  width: min(100%, calc(100vw - 16px));
  max-width: none;
  margin-top: 18px;
  padding-left: 8px;
  padding-right: 8px;
}

.editor-wide-container .html-lab-hero,
.editor-wide-container .html-lab-toolbar,
.editor-wide-container .html-lab-example-card,
.editor-wide-container .html-lab-note,
.editor-wide-container .html-ide-shell {
  max-width: none;
}

.html-ide-shell {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 18px;
  min-height: 72vh;
}

.html-ide-files {
  padding: 16px 12px;
  border-right: 1px solid rgba(148, 163, 184, .24);
  background: rgba(15, 23, 42, .7);
}

.html-ide-shell.files-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.html-ide-shell.files-collapsed .html-ide-files {
  display: none;
}

.html-ide-files-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--text);
}

.html-ide-files-head span {
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(96, 165, 250, .12);
  color: #dbeafe;
  font-size: .72rem;
  font-weight: 800;
}

.html-ide-file {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 10px 11px;
  margin-bottom: 8px;
  background: transparent;
  color: var(--text);
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.html-ide-file:hover,
.html-ide-file.is-active {
  background: rgba(59, 130, 246, .18);
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, .45);
}

.html-ide-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.html-ide-tabs {
  display: flex;
  align-items: end;
  min-height: 48px;
  border-bottom: 1px solid rgba(148, 163, 184, .22);
  background: rgba(15, 23, 42, .45);
  padding-left: 10px;
  overflow-x: auto;
}

.html-ide-tab {
  border: 1px solid rgba(148, 163, 184, .28);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  padding: 11px 16px;
  background: rgba(15, 23, 42, .52);
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
}

.html-ide-tab + .html-ide-tab {
  margin-left: 6px;
}

.html-ide-tab.is-active {
  background: rgba(37, 99, 235, .25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}

.html-ide-tab span {
  margin-left: 8px;
  color: #bfdbfe;
}

.html-ide-file-toggle {
  align-self: center;
  margin: 0 8px 6px;
  white-space: nowrap;
}

.html-ide-tabs-spacer {
  flex: 1 1 auto;
}

.html-ide-font-controls {
  padding: 6px 10px 6px 0;
  flex: 0 0 auto;
}

.html-ide-workspace {
  --html-ide-code-pct: 58%;
  display: flex;
  align-items: flex-start;
  min-width: 0;
  width: 100%;
}

.html-ide-code-pane,
.html-ide-preview-pane {
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: rgba(15, 23, 42, .42);
}

.html-ide-code-pane {
  flex: 0 0 var(--html-ide-code-pct);
  max-width: 72%;
}

.html-ide-preview-pane {
  flex: 1 1 auto;
}

.html-ide-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, .18);
}

.html-ide-pane-head h2 {
  margin: 0 0 2px;
  font-size: 1.05rem;
}

.html-ide-pane-head p {
  margin: 0;
}

.html-ide-mode-label {
  color: #bfdbfe;
  font-size: .82rem;
  font-weight: 800;
  white-space: nowrap;
}

.html-ide-editor-stack {
  min-width: 0;
}

.html-ide-editor-slot {
  display: none;
}

.html-ide-editor-slot.is-active {
  display: block;
}

.html-ide-editor {
  height: auto;
  min-height: 66vh;
  border: 0;
  border-radius: 0;
  background: #111827;
}

.html-ide-editor .ace_editor,
.html-ide-editor .ace_scroller,
.html-ide-editor .ace_content,
.html-ide-editor .ace_gutter,
.html-ide-editor .ace_gutter-layer,
.html-ide-editor .ace_gutter-cell {
  background-color: #111827 !important;
}

.html-ide-editor .ace_gutter {
  border-right: 1px solid rgba(148, 163, 184, .16);
  color: #cbd5e1;
}

.html-ide-editor .ace_gutter-active-line,
.html-ide-editor .ace_marker-layer .ace_active-line {
  background: rgba(148, 163, 184, .16) !important;
}

.html-ide-resizer {
  flex: 0 0 12px;
  align-self: stretch;
  min-height: 72vh;
  cursor: col-resize;
  background: linear-gradient(90deg, transparent, rgba(148, 163, 184, .28), transparent);
  position: relative;
}

.html-ide-resizer::after {
  content: "⋮\A↔\A⋮";
  white-space: pre;
  position: sticky;
  top: 45vh;
  display: block;
  width: 20px;
  margin-left: -4px;
  border-radius: 999px;
  padding: 4px 0;
  background: rgba(15, 23, 42, .9);
  border: 1px solid rgba(148, 163, 184, .4);
  color: #dbeafe;
  text-align: center;
  font-size: .78rem;
  line-height: 1;
}

body.html-ide-resizing {
  cursor: col-resize;
  user-select: none;
}

.html-ide-preview {
  min-height: 72vh;
  border: 0;
  border-radius: 0;
  display: block;
  background: #fff;
}

.html-ide-shell.preview-focus {
  grid-template-columns: 0 minmax(0, 1fr);
}

.html-ide-shell.preview-focus .html-ide-files,
.html-ide-shell.preview-focus .html-ide-code-pane,
.html-ide-shell.preview-focus .html-ide-resizer,
.html-ide-shell.preview-focus .html-ide-tabs .html-ide-tab,
.html-ide-shell.preview-focus .html-ide-font-controls {
  display: none;
}

.html-ide-shell.preview-focus .html-ide-workspace {
  display: block;
}

.html-ide-shell.preview-focus .html-ide-preview {
  min-height: 82vh;
}

body.html-lab-light-mode .html-ide-shell,
body.html-lab-light-mode .html-ide-main,
body.html-lab-light-mode .html-ide-files,
body.html-lab-light-mode .html-ide-tabs,
body.html-lab-light-mode .html-ide-code-pane,
body.html-lab-light-mode .html-ide-preview-pane,
body.html-lab-light-mode .html-ide-pane-head {
  background: #f8fafc;
  color: #0f172a;
}

body.html-lab-light-mode .html-ide-tab,
body.html-lab-light-mode .html-ide-file {
  color: #0f172a;
}

body.html-lab-light-mode .html-ide-tab.is-active,
body.html-lab-light-mode .html-ide-file.is-active,
body.html-lab-light-mode .html-ide-file:hover {
  background: #dbeafe;
}

body.html-lab-light-mode .html-ide-editor,
body.html-lab-light-mode .html-ide-editor .ace_editor,
body.html-lab-light-mode .html-ide-editor .ace_scroller,
body.html-lab-light-mode .html-ide-editor .ace_content,
body.html-lab-light-mode .html-ide-editor .ace_gutter,
body.html-lab-light-mode .html-ide-editor .ace_gutter-layer,
body.html-lab-light-mode .html-ide-editor .ace_gutter-cell {
  background-color: #ffffff !important;
}

body.html-lab-light-mode .html-ide-editor .ace_gutter {
  color: #475569;
  border-right-color: #e2e8f0;
}

body.html-lab-light-mode .html-ide-resizer::after {
  background: #ffffff;
  color: #1e3a8a;
}

@media (min-width: 1500px) {
  .container.editor-wide-container {
    width: min(100%, calc(100vw - 10px));
    padding-left: 5px;
    padding-right: 5px;
  }

  .html-ide-shell {
    grid-template-columns: 156px minmax(0, 1fr);
  }
}

@media (max-width: 920px) {
  .container.editor-wide-container {
    width: auto;
    max-width: 1100px;
    margin-top: 14px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .html-ide-shell {
    display: block;
    min-height: auto;
  }

  .html-ide-files {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(148, 163, 184, .24);
  }

  .html-ide-shell.files-collapsed .html-ide-files {
    display: none;
  }

  .html-ide-files-head {
    flex: 0 0 auto;
    margin-bottom: 0;
  }

  .html-ide-file {
    width: auto;
    margin-bottom: 0;
    white-space: nowrap;
  }

  .html-ide-tabs {
    padding-left: 8px;
  }

  .html-ide-workspace {
    display: block;
  }

  .html-ide-code-pane {
    max-width: none;
  }

  .html-ide-resizer {
    display: none;
  }

  .html-ide-preview {
    min-height: 520px;
  }

  .html-ide-font-controls {
    display: none;
  }
}




.html-color-tool {
  --current-css-color: #7C3AED;
  display: grid;
  gap: 12px;
  border: 1px solid rgba(148, 163, 184, .22);
  background: linear-gradient(180deg, rgba(15, 23, 42, .56), rgba(15, 23, 42, .34));
}

.html-color-tool-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.html-color-tool-head strong {
  display: block;
  font-size: 1rem;
  color: var(--text);
}

.html-color-tool-head span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 700;
}

.html-color-tool-head code,
.html-color-tool-field code {
  background: rgba(15, 23, 42, .55);
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 8px;
  padding: 1px 5px;
  color: inherit;
}

.html-color-tool-row {
  display: grid;
  grid-template-columns: minmax(120px, .7fr) minmax(150px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
}

.html-color-tool-field {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.html-color-tool-field input[type="color"] {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 12px;
  padding: 3px;
  background: rgba(15, 23, 42, .72);
  cursor: pointer;
}

.html-color-tool-field input[type="text"] {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 12px;
  padding: 0 12px;
  background: rgba(15, 23, 42, .72);
  color: var(--text);
  font-family: Consolas, "SFMono-Regular", Menlo, Monaco, monospace;
  font-weight: 900;
  letter-spacing: .04em;
}

.html-color-tool-field input:focus-visible,
.html-color-recent-chip:focus-visible {
  outline: 3px solid rgba(59, 130, 246, .28);
  outline-offset: 2px;
}

.html-color-tool-recents {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 900;
}

.html-color-tool-recents-list {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.html-color-recent-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(148, 163, 184, .26);
  border-radius: 999px;
  padding: 5px 8px 5px 6px;
  background: rgba(15, 23, 42, .62);
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
}

.html-color-recent-chip:hover {
  border-color: rgba(147, 197, 253, .78);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .16);
}

.html-color-recent-chip span {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--chip-color, var(--current-css-color));
  border: 1px solid rgba(255, 255, 255, .72);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .16);
}

.html-color-recent-chip code {
  font-size: .74rem;
  color: inherit;
  background: transparent;
  padding: 0;
}

.html-color-tool-empty {
  display: inline-block;
  border: 1px dashed rgba(148, 163, 184, .28);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--muted);
  font-size: .78rem;
}

body.html-lab-light-mode .html-color-tool {
  background: #ffffff;
  border-color: #dbeafe;
}

body.html-lab-light-mode .html-color-tool-field input[type="color"],
body.html-lab-light-mode .html-color-tool-field input[type="text"],
body.html-lab-light-mode .html-color-recent-chip {
  background: #f8fafc;
  color: #0f172a;
  border-color: #dbeafe;
}

@media (max-width: 860px) {
  .html-color-tool-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .html-color-tool-row {
    grid-template-columns: 1fr;
  }
}


/* Admin workspace */
.admin-workspace {
  max-width: min(1760px, calc(100vw - 40px));
  padding: 0 20px;
}

.admin-workspace .card {
  margin-bottom: 0;
  min-width: 0;
}

.admin-page-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.admin-page-head--compact {
  padding: 16px 18px;
  border: 1px solid #334155;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.36);
}

.admin-page-copy {
  min-width: 0;
}

.admin-page-head h1 {
  margin-bottom: 8px;
}

.admin-page-head p {
  max-width: 900px;
  margin-bottom: 0;
}

.admin-head-actions {
  justify-content: flex-end;
  min-width: 360px;
}

.admin-head-actions .btn-link {
  flex: 0 1 auto;
}

.admin-stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.admin-quick-zone {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.65fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.admin-side-stack,
.admin-column-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.admin-main-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  gap: 18px;
  align-items: start;
}

.admin-card {
  min-width: 0;
}

.admin-card--tokens {
  align-self: start;
}

.admin-button-stack {
  align-items: stretch;
}

.admin-button-stack .btn-link {
  flex: 1 1 180px;
}

.admin-workspace label,
.admin-workspace .form-grid,
.admin-workspace .inline-grid {
  min-width: 0;
}

.admin-workspace input,
.admin-workspace select,
.admin-workspace textarea,
.admin-workspace button {
  max-width: 100%;
}

.admin-workspace input,
.admin-workspace select,
.admin-workspace textarea {
  width: 100%;
  min-width: 0;
}

/* Fase 68: los inputs generales ocupan 100%, pero checkbox/radio no deben estirarse. */
.admin-workspace input[type="checkbox"],
.admin-workspace input[type="radio"],
.checkbox-row input[type="checkbox"],
.checkbox-row input[type="radio"],
.choice-row input[type="checkbox"],
.choice-row input[type="radio"] {
  width: 18px;
  min-width: 18px;
  max-width: 18px;
  height: 18px;
  padding: 0;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--accent);
}

.checkbox-row {
  justify-content: flex-start;
  flex-wrap: nowrap;
  line-height: 1.25;
}

.admin-workspace .checkbox-row {
  width: auto;
  max-width: 100%;
}

.admin-workspace .form-grid button[type="submit"] {
  min-width: 0;
}

.admin-token-form {
  grid-template-columns: minmax(0, 2fr) minmax(96px, .55fr) minmax(140px, .7fr) minmax(150px, .75fr);
  align-items: end;
}

.admin-token-form button {
  width: 100%;
}

.admin-offer-form {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: end;
}

.admin-field-title {
  grid-column: span 6;
}

.admin-field-category {
  grid-column: span 6;
}

.admin-field-reward {
  grid-column: span 3;
}

.admin-field-date {
  grid-column: span 3;
}

.admin-field-full {
  grid-column: 1 / -1;
}

.admin-offer-form > button {
  grid-column: span 6;
  width: 100%;
}

.admin-interventor-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}

.admin-interventor-form .checkbox-row,
.admin-interventor-form button {
  grid-column: 1 / -1;
}

.admin-workspace .member-edit-form {
  grid-template-columns: minmax(180px, 1fr) auto auto;
  align-items: center;
}

.admin-workspace .table-wrap {
  background: rgba(15, 23, 42, 0.3);
  overflow-x: auto;
  max-width: 100%;
}

.admin-workspace .table-wrap--soft {
  overflow-x: auto;
}

.admin-workspace .table-wrap--audit {
  overflow-x: auto;
}

.admin-workspace .table-wrap table {
  min-width: 100%;
}

.admin-workspace .admin-table-sm {
  min-width: 100%;
}

.admin-workspace .admin-table-md {
  min-width: 100%;
}

.admin-workspace .admin-table-lg {
  min-width: 760px;
}

.admin-workspace .compact-table {
  font-size: 0.94rem;
}

.admin-workspace .compact-table th,
.admin-workspace .compact-table td {
  vertical-align: top;
  overflow-wrap: anywhere;
}

.admin-workspace .compact-table th {
  white-space: nowrap;
}

.admin-audit-table {
  min-width: 840px;
}

.admin-audit-table td,
.admin-review-table td {
  line-height: 1.25;
}

.admin-audit-table td:last-child,
.admin-review-table td:last-child {
  white-space: normal;
  min-width: 240px;
  max-width: 460px;
  overflow-wrap: anywhere;
  font-size: 0.88rem;
}

.admin-audit-table td:last-child {
  color: #cbd5e1;
}

.admin-interventor-table td:last-child {
  white-space: normal;
  min-width: 320px;
}

.admin-interventor-table select {
  min-width: 0;
}

@media (min-width: 1500px) {
  .admin-quick-zone {
    grid-template-columns: minmax(300px, 0.62fr) minmax(0, 1.9fr);
  }

  .admin-main-columns {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .admin-audit-table td:last-child {
    max-width: 520px;
  }
}

@media (max-width: 1280px) {
  .admin-workspace {
    max-width: min(1320px, calc(100vw - 32px));
    padding: 0 16px;
  }

  .admin-page-head--compact {
    display: block;
  }

  .admin-head-actions {
    justify-content: flex-start;
    min-width: 0;
    margin-top: 14px;
  }

  .admin-quick-zone {
    grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  }

  .admin-token-form,
  .admin-offer-form,
  .admin-interventor-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-field-title,
  .admin-field-category,
  .admin-field-reward,
  .admin-field-date,
  .admin-field-full,
  .admin-offer-form > button,
  .admin-interventor-form .checkbox-row,
  .admin-interventor-form button {
    grid-column: auto;
  }

  .admin-offer-form .admin-field-full,
  .admin-offer-form > button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .admin-quick-zone,
  .admin-main-columns {
    grid-template-columns: 1fr;
  }

  .admin-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-workspace .admin-table-lg,
  .admin-audit-table {
    min-width: 720px;
  }
}

@media (max-width: 720px) {
  .admin-workspace {
    max-width: 100%;
    margin-top: 16px;
    padding: 0 12px;
  }

  .admin-page-head {
    display: block;
  }

  .admin-page-head--compact {
    padding: 14px;
  }

  .admin-head-actions .btn-link,
  .admin-button-stack .btn-link {
    flex-basis: 100%;
  }

  .admin-stats-grid,
  .admin-token-form,
  .admin-offer-form,
  .admin-interventor-form {
    grid-template-columns: 1fr;
  }

  .admin-field-title,
  .admin-field-category,
  .admin-field-reward,
  .admin-field-date,
  .admin-field-full,
  .admin-offer-form > button,
  .admin-interventor-form .checkbox-row,
  .admin-interventor-form button {
    grid-column: 1 / -1;
  }

  .admin-workspace .admin-table-lg,
  .admin-audit-table {
    min-width: 680px;
  }

  .admin-workspace .member-edit-form {
    grid-template-columns: 1fr;
  }
}



/* Admin polish - Fase 37 */
.admin-workspace {
  --admin-gap: 16px;
}

.admin-page-head--compact {
  align-items: center;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.admin-page-copy h1 {
  margin: 0 0 6px;
}

.admin-head-summary {
  max-width: 680px;
}

.admin-head-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 8px;
  min-width: 380px;
}

.admin-head-actions .btn-link {
  width: 100%;
  padding: 9px 12px;
}

.admin-stats-grid {
  margin-bottom: var(--admin-gap);
}

.admin-stats-grid .stat-card {
  padding: 14px 16px;
}

.admin-stats-grid .stat-card .big {
  line-height: 1.05;
}

.admin-quick-zone,
.admin-main-columns {
  gap: var(--admin-gap);
}

.admin-side-stack,
.admin-column-stack {
  gap: var(--admin-gap);
}

.admin-card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.admin-card-title-row h2 {
  margin: 0;
}

.admin-card-title-row .badge,
.admin-card-title-row .btn-link {
  flex: 0 0 auto;
}

.admin-help-text {
  max-width: 78ch;
  margin-top: -2px;
}

.admin-card--compact h2,
.admin-card--slim h2 {
  margin-bottom: 0;
}

.admin-card--compact .divider {
  margin: 14px 0;
}

.admin-card--quick .kv-list {
  display: grid;
  gap: 4px;
  font-size: 0.95rem;
}

.admin-card--reward .form-grid {
  gap: 10px;
}

.admin-card--reward input,
.admin-card--reward select {
  padding-top: 9px;
  padding-bottom: 9px;
}

.admin-card--slim {
  padding-bottom: 14px;
}

.admin-card--slim .table-wrap {
  margin-top: 8px;
}

.admin-workspace .table-wrap {
  border-radius: 14px;
}

.admin-empty-row td {
  color: #94a3b8;
  font-style: italic;
  padding: 14px 12px;
}

.admin-detail-cell {
  min-width: 220px;
}

.admin-audit-detail summary {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid #475569;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.8);
  color: #bfdbfe;
  font-size: 0.82rem;
  font-weight: 700;
}

.admin-audit-detail[open] summary {
  margin-bottom: 8px;
}

.admin-audit-detail div,
.admin-note-cell {
  max-height: 150px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid rgba(71, 85, 105, 0.7);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.32);
  padding: 8px 10px;
  color: #cbd5e1;
  font-size: 0.86rem;
  line-height: 1.28;
}

.admin-note-cell {
  max-height: 110px;
}

.admin-audit-table td:last-child,
.admin-review-table td:last-child {
  min-width: 220px;
  max-width: 420px;
}

.admin-workspace .compact-table th,
.admin-workspace .compact-table td {
  padding-top: 9px;
  padding-bottom: 9px;
}

.admin-workspace .compact-table code {
  white-space: nowrap;
}

@media (min-width: 1500px) {
  .admin-card--audit {
    align-self: start;
  }

  .admin-audit-table td:last-child,
  .admin-review-table td:last-child {
    max-width: 480px;
  }
}

@media (max-width: 1280px) {
  .admin-head-actions {
    display: flex;
    flex-wrap: wrap;
    min-width: 0;
  }

  .admin-head-actions .btn-link {
    width: auto;
  }

  .admin-card-title-row {
    align-items: flex-start;
  }
}

@media (max-width: 720px) {
  .admin-page-head--compact {
    padding: 12px;
  }

  .admin-card-title-row {
    display: block;
  }

  .admin-card-title-row .badge,
  .admin-card-title-row .btn-link,
  .admin-card-title-row .muted {
    margin-top: 8px;
  }

  .admin-head-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-head-actions .btn-link {
    width: 100%;
  }

  .admin-audit-detail div,
  .admin-note-cell {
    max-height: 180px;
  }
}

/* Admin operational reorder - Fase 38 */
.admin-operations-zone {
  display: grid;
  grid-template-columns: minmax(280px, 0.46fr) minmax(0, 1.85fr);
  gap: var(--admin-gap, 16px);
  align-items: start;
  margin-bottom: var(--admin-gap, 16px);
}

.admin-priority-stack {
  display: flex;
  flex-direction: column;
  gap: var(--admin-gap, 16px);
  min-width: 0;
}

.admin-side-stack--operations {
  gap: var(--admin-gap, 16px);
}

.admin-main-columns--secondary {
  margin-top: 0;
}

.admin-card--offers,
.admin-card--teams {
  align-self: start;
}

.admin-card--offers .admin-help-text {
  max-width: 90ch;
}

.admin-card--teams .table-wrap {
  margin-top: 4px;
}

.admin-card--tokens {
  background: rgba(15, 23, 42, 0.52);
}

.admin-card--tokens .admin-help-text {
  max-width: 72ch;
}

@media (min-width: 1500px) {
  .admin-operations-zone {
    grid-template-columns: minmax(300px, 0.42fr) minmax(0, 2.12fr);
  }
}

@media (max-width: 1280px) {
  .admin-operations-zone {
    grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
  }
}

@media (max-width: 980px) {
  .admin-operations-zone,
  .admin-main-columns--secondary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .admin-operations-zone {
    gap: 12px;
  }
}


/* Admin quick points - Fase 39 */
.admin-card--points {
  border-color: rgba(74, 222, 128, 0.28);
  background: linear-gradient(180deg, rgba(22, 163, 74, 0.08), rgba(15, 23, 42, 0.72));
}

.admin-card--points .admin-card-title-row {
  margin-bottom: 6px;
}

.admin-card--points .admin-help-text {
  margin-bottom: 10px;
  max-width: 48ch;
}

.admin-points-form {
  gap: 10px;
}

.admin-points-form input,
.admin-points-form select {
  padding-top: 9px;
  padding-bottom: 9px;
}

.admin-points-form button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

@media (max-width: 980px) {
  .admin-card--points .admin-help-text {
    max-width: 100%;
  }
}

/* Admin dashboard reconstruction - Fase 40 */
.admin-cockpit-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.55fr) minmax(520px, 1.22fr) minmax(420px, 1fr);
  gap: var(--admin-gap, 16px);
  align-items: start;
  margin-bottom: var(--admin-gap, 16px);
}

.admin-cockpit-column {
  min-width: 0;
}

.admin-cockpit-column--left {
  align-self: start;
}

.admin-cockpit-column--center,
.admin-cockpit-column--right {
  align-self: start;
}

.admin-cockpit-column--center .admin-card--offers,
.admin-cockpit-column--center .admin-card--teams,
.admin-cockpit-column--center .admin-card--tokens,
.admin-cockpit-column--right .admin-card {
  align-self: stretch;
}

.admin-cockpit-column--center .admin-card--tokens {
  order: 3;
  margin-top: 0;
}

.admin-cockpit-column--left .admin-button-stack .btn-link {
  flex-basis: 100%;
}

.admin-cockpit-column--left .admin-card--quick,
.admin-cockpit-column--left .admin-card--points,
.admin-cockpit-column--left .admin-card--reward {
  padding: 16px;
}

.admin-cockpit-column--left .admin-card--quick h2,
.admin-cockpit-column--left .admin-card--points h2,
.admin-cockpit-column--left .admin-card--reward h2 {
  line-height: 1.08;
}

.admin-cockpit-column--center .admin-card--offers .admin-help-text {
  max-width: 100%;
}

.admin-cockpit-column--center .admin-offer-form {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.admin-cockpit-column--center .admin-card--teams .table-wrap,
.admin-cockpit-column--center .admin-card--tokens .table-wrap,
.admin-cockpit-column--right .table-wrap {
  width: 100%;
}

.admin-cockpit-column--right .admin-card--audit {
  background: rgba(15, 23, 42, 0.48);
}

@media (min-width: 1500px) {
  .admin-cockpit-grid {
    grid-template-columns: minmax(260px, 0.52fr) minmax(600px, 1.28fr) minmax(440px, 1fr);
  }
}

@media (max-width: 1320px) {
  .admin-cockpit-grid {
    grid-template-columns: minmax(240px, 0.55fr) minmax(0, 1.45fr);
  }

  .admin-cockpit-column--right {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--admin-gap, 16px);
  }

  .admin-cockpit-column--right > .admin-card:first-child,
  .admin-cockpit-column--right > .admin-card--audit {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .admin-cockpit-grid {
    grid-template-columns: 1fr;
  }

  .admin-cockpit-column--right {
    grid-column: auto;
    display: flex;
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .admin-cockpit-grid {
    gap: 12px;
  }

  .admin-cockpit-column--left .admin-card--quick,
  .admin-cockpit-column--left .admin-card--points,
  .admin-cockpit-column--left .admin-card--reward {
    padding: 14px;
  }
}

/* Admin dashboard visual editor - Fase 41 */
.admin-layout-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin: 0 0 16px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.64);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.admin-layout-toolbar > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 220px;
}

.admin-layout-actions {
  justify-content: flex-end;
  margin-left: auto;
}

.admin-layout-toolbar button.btn-link {
  cursor: pointer;
  font: inherit;
}

.admin-layout-toolbar button.btn-link:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.admin-layout-status {
  min-width: 170px;
  text-align: right;
}

.admin-drag-handle {
  display: none;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 74px;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px dashed rgba(147, 197, 253, 0.66);
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.14);
  color: #bfdbfe;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  cursor: grab;
  user-select: none;
}

.admin-cockpit-grid.is-layout-editing .admin-drag-handle {
  display: inline-flex;
}

.admin-cockpit-grid.is-layout-editing .admin-card > .admin-drag-handle:first-child {
  margin-bottom: 10px;
}

.admin-cockpit-grid.is-layout-editing .admin-card {
  outline: 1px dashed rgba(147, 197, 253, 0.38);
  outline-offset: 3px;
}

.admin-cockpit-grid.is-layout-editing .admin-card.is-draggable {
  cursor: default;
}

.admin-cockpit-grid.is-layout-editing .admin-card.is-dragging {
  opacity: 0.58;
  transform: scale(0.985);
}

.admin-cockpit-column.is-drop-zone {
  min-height: 180px;
  border-radius: 18px;
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.admin-cockpit-grid.is-layout-editing .admin-cockpit-column.is-drop-zone {
  padding: 4px;
  background: rgba(59, 130, 246, 0.045);
  box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.12);
}

.admin-cockpit-grid.is-layout-editing .admin-card-title-row {
  gap: 8px;
}

@media (max-width: 980px) {
  .admin-layout-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-layout-actions {
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }

  .admin-layout-actions .btn-link {
    flex: 1 1 180px;
  }

  .admin-layout-status {
    min-width: 0;
    text-align: left;
  }
}

@media (max-width: 620px) {
  .admin-layout-actions .btn-link {
    flex-basis: 100%;
  }
}

/* Admin dashboard visual editor hotfix - Fase 41b */
.admin-card-layout-tools {
  display: none;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-left: auto;
  flex-wrap: wrap;
}

.admin-cockpit-grid.is-layout-editing .admin-card-layout-tools {
  display: inline-flex;
}

.admin-cockpit-grid.is-layout-editing .admin-card > .admin-card-layout-tools:first-child {
  display: flex;
  margin-bottom: 10px;
}

.admin-layout-mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid rgba(148, 163, 184, 0.42);
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.88);
  color: #e5e7eb;
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.admin-layout-mini-btn:hover:not(:disabled) {
  border-color: rgba(147, 197, 253, 0.8);
  background: rgba(59, 130, 246, 0.24);
}

.admin-layout-mini-btn:disabled {
  cursor: not-allowed;
  opacity: 0.34;
}

.admin-cockpit-grid.is-layout-editing .admin-card.is-draggable {
  cursor: grab;
}

.admin-cockpit-grid.is-layout-editing .admin-card.is-draggable:active {
  cursor: grabbing;
}

.admin-cockpit-grid.is-layout-editing .admin-card :is(input, select, textarea, a, button, label) {
  cursor: auto;
}

.admin-cockpit-grid.is-layout-editing .admin-layout-mini-btn,
.admin-cockpit-grid.is-layout-editing .admin-drag-handle {
  cursor: pointer;
}

.admin-cockpit-grid.is-layout-editing .admin-drag-handle {
  cursor: grab;
}

.admin-cockpit-grid.is-layout-editing .admin-drag-handle:active {
  cursor: grabbing;
}

.admin-cockpit-grid.is-layout-editing .admin-cockpit-column.is-drop-target {
  background: rgba(34, 197, 94, 0.08);
  box-shadow: inset 0 0 0 2px rgba(34, 197, 94, 0.26);
}

@media (max-width: 620px) {
  .admin-card-layout-tools {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }
}

/* Fase 46 · Editor Python compacto y centrado en el código */
.python-lab-hero-compact {
  align-items: center;
  padding: 10px 14px;
  margin-bottom: 10px;
  gap: 12px;
}

.python-lab-hero-compact .python-lab-titlebar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  min-width: 0;
}

.python-lab-hero-compact h1 {
  margin: 0;
  font-size: clamp(1.05rem, 1.4vw, 1.28rem);
  line-height: 1.15;
}

.python-lab-hero-compact p {
  margin: 0;
  font-size: 0.9rem;
}

.python-lab-hero-compact .badge.large {
  padding: 5px 10px;
  font-size: 0.78rem;
}

.python-lab-hero-compact .html-lab-hero-actions {
  align-items: center;
  gap: 8px;
}

.python-lab-hero-compact .secondary-button {
  padding: 8px 12px;
}

.python-hero-status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.22);
  white-space: nowrap;
}

.python-ide-shell {
  margin-bottom: 12px;
}

.python-lab-tools {
  padding: 12px 14px;
  margin-top: 0;
  margin-bottom: 10px;
}

.python-lab-tools .secondary-button,
.python-lab-tools .danger-button {
  padding: 8px 12px;
}

.python-lab-example-compact {
  align-items: center;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.python-lab-example-compact h2 {
  margin: 4px 0 3px;
  font-size: 1.08rem;
}

.python-lab-example-compact p {
  margin-bottom: 0;
}

.python-lab-example-compact .python-example-extra {
  gap: 0.5rem;
}

.python-lab-example-compact .html-lab-example-tip {
  font-size: 0.86rem;
}

.python-lab-example-compact .python-expected-box {
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
}

@media (max-width: 920px) {
  .python-lab-hero-compact {
    align-items: stretch;
  }

  .python-lab-hero-compact .python-lab-titlebar {
    align-items: flex-start;
  }

  .python-lab-hero-compact .html-lab-hero-actions {
    justify-content: flex-start;
  }

  .python-hero-status {
    width: fit-content;
    max-width: 100%;
    white-space: normal;
  }
}

/* Fase 47H: portada pública amplia y tablón seguro */
.container.landing-wide-container {
  max-width: min(1680px, 96vw);
  padding-left: 24px;
  padding-right: 24px;
}
.landing-wide-container .landing-hero--compact {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr);
  gap: 18px;
  align-items: stretch;
  padding: 24px;
  background:
    radial-gradient(circle at 8% 10%, rgba(59,130,246,.24), transparent 36%),
    linear-gradient(135deg, rgba(15,23,42,.98), rgba(30,41,59,.92));
}
.landing-wide-container .landing-hero--compact h1 {
  margin-bottom: 8px;
}
.landing-wide-container .landing-hero--compact p {
  max-width: 780px;
}
.home-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.landing-hero-status {
  display: grid;
  gap: 10px;
  align-content: center;
}
.home-board-card {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 5% 0%, rgba(34,197,94,.12), transparent 38%),
    radial-gradient(circle at 95% 10%, rgba(59,130,246,.16), transparent 35%),
    rgba(15,23,42,.88);
}
.home-board-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: .25;
  pointer-events: none;
}
.home-board-card > * {
  position: relative;
  z-index: 1;
}
.home-board-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.home-board-post {
  border: 1px solid rgba(148,163,184,.28);
  border-radius: 18px;
  padding: 14px;
  background: rgba(11,18,32,.78);
  box-shadow: 0 16px 30px rgba(2,6,23,.14);
  display: grid;
  gap: 8px;
  min-height: 138px;
}
.home-board-post.is-pinned {
  border-color: rgba(250,204,21,.45);
  background: radial-gradient(circle at top left, rgba(250,204,21,.14), rgba(11,18,32,.86) 65%);
}
.home-board-post-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.home-board-post h3 {
  margin: 0;
  font-size: 1.02rem;
}
.home-board-post p {
  margin: 0;
  color: #d1d5db;
  line-height: 1.45;
}
.home-help-panel details {
  border: 1px solid rgba(148,163,184,.22);
  border-radius: 18px;
  padding: 12px 14px;
  background: rgba(11,18,32,.62);
}
.home-help-panel summary {
  cursor: pointer;
  font-weight: 800;
  color: #f8fafc;
}
.home-help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.landing-wide-container .course-group-layout {
  grid-template-columns: minmax(0, 2.65fr) minmax(320px, .85fr);
}
.landing-wide-container .landing-team-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}
.landing-wide-container .featured-team-metrics--public {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.admin-home-board-settings,
.admin-home-board-form {
  align-items: end;
}
.admin-home-board-form .full-span {
  grid-column: 1 / -1;
}
.admin-home-board-list {
  display: grid;
  gap: 14px;
}
.admin-home-board-post {
  border: 1px solid #334155;
  border-radius: 18px;
  padding: 14px;
  background: rgba(11,18,32,.72);
}
.admin-home-board-post.is-inactive {
  opacity: .68;
}
@media (min-width: 1320px) {
  .landing-wide-container .landing-team-grid {
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  }
}
@media (max-width: 900px) {
  .landing-wide-container .landing-hero--compact,
  .landing-wide-container .course-group-layout {
    grid-template-columns: 1fr;
  }
  .landing-hero-status {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}
@media (max-width: 720px) {
  .container.landing-wide-container {
    max-width: 1100px;
    margin-top: 18px;
    padding-left: 14px;
    padding-right: 14px;
  }
  .landing-wide-container .landing-hero--compact {
    padding: 18px;
  }
  .home-board-strip,
  .home-help-grid,
  .landing-wide-container .landing-team-grid {
    grid-template-columns: 1fr;
  }
}

/* Fase 47I: tablón dinámico y panel admin corregido */
.admin-home-board-settings-panel {
  display: grid;
  gap: 16px;
}
.admin-home-board-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.admin-home-board-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 84px;
  padding: 14px 16px;
  border: 1px solid rgba(148,163,184,.25);
  border-radius: 18px;
  background: rgba(15,23,42,.72);
  cursor: pointer;
}
.admin-home-board-option span {
  display: grid;
  gap: 4px;
}
.admin-home-board-option strong {
  color: #f8fafc;
  line-height: 1.2;
}
.admin-home-board-option small {
  color: #cbd5e1;
  line-height: 1.35;
}
.admin-home-board-option input[type="checkbox"] {
  width: 22px;
  height: 22px;
  min-width: 22px;
  accent-color: #22c55e;
}
.admin-home-board-timing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  align-items: end;
}
.home-board-carousel {
  display: grid;
  gap: 16px;
}
.home-board-header {
  align-items: flex-start;
}
.home-board-status {
  border: 1px solid rgba(148,163,184,.28);
  border-radius: 999px;
  padding: 8px 12px;
  color: #e5e7eb;
  background: rgba(15,23,42,.78);
  font-weight: 800;
  white-space: nowrap;
}
.home-board-stage {
  position: relative;
  min-height: 190px;
  border: 1px solid rgba(148,163,184,.22);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(11,18,32,.82), rgba(15,23,42,.96));
  overflow: hidden;
}
.home-board-stage .home-board-post {
  border: none;
  border-radius: 0;
  min-height: 190px;
  padding: 24px;
  background: transparent;
  box-shadow: none;
  opacity: 0;
  transform: translateY(8px) scale(.99);
  transition: opacity .42s ease, transform .42s ease;
}
.home-board-stage .home-board-post.is-active {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.home-board-post[hidden] {
  display: none !important;
}
.home-board-stage .home-board-post h3 {
  font-size: clamp(1.25rem, 2vw, 1.9rem);
  letter-spacing: -.02em;
}
.home-board-stage .home-board-post p {
  max-width: 920px;
  font-size: 1.02rem;
}
.home-board-post-flags {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.home-board-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(148,163,184,.14);
  z-index: 3;
}
.home-board-progress span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #facc15, #38bdf8);
  box-shadow: 0 0 22px rgba(250,204,21,.34);
}
.home-board-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.home-board-nav,
.home-board-dot {
  border: 1px solid rgba(148,163,184,.3);
  background: rgba(15,23,42,.82);
  color: #f8fafc;
}
.home-board-nav {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  font-size: 1.35rem;
  font-weight: 900;
  cursor: pointer;
}
.home-board-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
}
.home-board-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 999px;
  cursor: pointer;
  opacity: .58;
}
.home-board-dot.is-active {
  width: 26px;
  opacity: 1;
  background: linear-gradient(90deg, #facc15, #22c55e);
}
.home-board-reactions {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.home-board-reaction {
  position: absolute;
  bottom: 12px;
  font-size: 1.5rem;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.32));
  animation: homeBoardFloat 1.85s ease-out forwards;
}
@keyframes homeBoardFloat {
  0% { opacity: 0; transform: translate(0, 14px) scale(.8) rotate(-4deg); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--float-x, 0), -132px) scale(1.25) rotate(10deg); }
}
.home-board-post--destacado.is-active::after,
.home-board-post--ranking.is-active::after,
.home-board-post--logro.is-active::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 22px;
  pointer-events: none;
  background:
    radial-gradient(circle at 22% 22%, rgba(250,204,21,.2), transparent 13%),
    radial-gradient(circle at 82% 18%, rgba(56,189,248,.18), transparent 12%),
    radial-gradient(circle at 70% 78%, rgba(34,197,94,.15), transparent 14%);
  animation: homeBoardPulse 1.25s ease-out 1;
}
@keyframes homeBoardPulse {
  from { opacity: .9; transform: scale(.985); }
  to { opacity: 0; transform: scale(1.03); }
}
@media (prefers-reduced-motion: reduce) {
  .home-board-stage .home-board-post,
  .home-board-progress span,
  .home-board-reaction,
  .home-board-post--destacado.is-active::after,
  .home-board-post--ranking.is-active::after,
  .home-board-post--logro.is-active::after {
    animation: none !important;
    transition: none !important;
  }
  .home-board-reactions,
  .home-board-progress {
    display: none !important;
  }
}
@media (max-width: 720px) {
  .admin-home-board-option {
    align-items: flex-start;
  }
  .home-board-stage,
  .home-board-stage .home-board-post {
    min-height: 220px;
  }
  .home-board-stage .home-board-post {
    padding: 18px;
  }
  .home-board-controls {
    justify-content: space-between;
  }
}

/* Fase 47J: tablón de dos niveles, noticia actual + anterior lateral */
.home-board-stage.home-board-stage--two-level {
  display: grid;
  grid-template-columns: minmax(0, 2.55fr) minmax(260px, .95fr);
  gap: 14px;
  align-items: stretch;
  min-height: 205px;
  border: none;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}
.home-board-current-slot,
.home-board-previous-slot {
  min-width: 0;
}
.home-board-current-slot {
  position: relative;
  min-height: 205px;
  border: 1px solid rgba(148,163,184,.22);
  border-radius: 24px;
  background:
    radial-gradient(circle at 14% 12%, rgba(250,204,21,.10), transparent 32%),
    radial-gradient(circle at 78% 18%, rgba(34,197,94,.12), transparent 38%),
    linear-gradient(135deg, rgba(11,18,32,.86), rgba(15,23,42,.98));
  overflow: hidden;
}
.home-board-current-slot .home-board-post {
  border: none;
  border-radius: 0;
  min-height: 205px;
  padding: 24px;
  background: transparent;
  box-shadow: none;
  opacity: 0;
  transform: translateX(18px) scale(.992);
  transition: opacity .42s ease, transform .42s ease;
}
.home-board-current-slot .home-board-post.is-active {
  opacity: 1;
  transform: translateX(0) scale(1);
}
.home-board-current-slot .home-board-post.is-entering {
  animation: homeBoardMainIn .44s ease-out 1;
}
.home-board-current-slot .home-board-post h3 {
  font-size: clamp(1.25rem, 2vw, 1.9rem);
  letter-spacing: -.02em;
}
.home-board-current-slot .home-board-post p {
  max-width: 860px;
  font-size: 1.02rem;
}
.home-board-previous-slot {
  display: grid;
  gap: 10px;
  align-content: stretch;
  padding: 12px;
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0%, rgba(59,130,246,.14), transparent 42%),
    rgba(11,18,32,.58);
  opacity: .92;
}
.home-board-previous-slot[hidden] {
  display: none !important;
}
.home-board-previous-slot.is-entering {
  animation: homeBoardPreviousIn .38s ease-out 1;
}
.home-board-previous-slot > .badge {
  justify-self: start;
  opacity: .85;
}
.home-board-previous-slot .home-board-post--previous {
  min-height: 0;
  height: 100%;
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 18px;
  padding: 14px;
  background: rgba(15,23,42,.70);
  box-shadow: none;
  opacity: .88;
  transform: none;
  overflow: hidden;
}
.home-board-previous-slot .home-board-post--previous h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
}
.home-board-previous-slot .home-board-post--previous p {
  margin: 0;
  color: #cbd5e1;
  font-size: .92rem;
  line-height: 1.38;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.home-board-progress {
  display: none !important;
}
.home-board-controls {
  margin-top: -2px;
}
.home-board-dot {
  width: 8px;
  height: 8px;
}
.home-board-dot.is-active {
  width: 20px;
  background: linear-gradient(90deg, #22c55e, #38bdf8);
}
@keyframes homeBoardMainIn {
  0% { opacity: 0; transform: translateX(22px) scale(.985); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes homeBoardPreviousIn {
  0% { opacity: 0; transform: translateX(-12px) scale(.985); }
  100% { opacity: .92; transform: translateX(0) scale(1); }
}
@media (max-width: 920px) {
  .home-board-stage.home-board-stage--two-level {
    grid-template-columns: 1fr;
  }
  .home-board-previous-slot {
    display: none !important;
  }
}
@media (max-width: 720px) {
  .home-board-current-slot,
  .home-board-current-slot .home-board-post {
    min-height: 220px;
  }
  .home-board-current-slot .home-board-post {
    padding: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .home-board-current-slot .home-board-post,
  .home-board-current-slot .home-board-post.is-entering,
  .home-board-previous-slot.is-entering {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}


/* Fase 70 · Lectura correcta de consignas, entregas y código */
.activity-text-box {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.55;
  margin: 0.35rem 0 0.75rem;
  max-width: 100%;
}

.activity-submission-content,
.compact-text-box {
  border: 1px solid rgba(71, 85, 105, 0.72);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.28);
  padding: 10px 12px;
}

.compact-text-box {
  margin: 0.35rem 0 0;
  max-height: 260px;
  overflow: auto;
}

.activity-review-table td {
  white-space: normal;
  vertical-align: top;
}

.activity-review-table .activity-actions-cell,
.activity-review-table .activity-actions-cell * {
  white-space: nowrap;
}

.activity-table-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 360px;
  max-height: 140px;
  overflow: auto;
  line-height: 1.35;
}

.activity-review-table .code-box,
.activity-submission-content .code-box {
  white-space: pre;
}

/* F72: actividades archivadas y borrado seguro */
.archived-row {
  opacity: 0.78;
}
.archived-row td {
  background: rgba(148, 163, 184, 0.08);
}
.archived-row a strong {
  color: var(--text-muted, #64748b);
}

/* F73: cuentas estudiantiles y restablecimiento de contraseña */
.student-account-kpis .stat-card .big {
  line-height: 1;
}

.student-accounts-table-wrap {
  overflow-x: auto;
}

.student-accounts-table td,
.student-accounts-table th {
  vertical-align: top;
}

.student-accounts-table code {
  display: inline-block;
  max-width: 180px;
  overflow-wrap: anywhere;
  white-space: normal;
}

.narrow-card {
  max-width: 680px;
  margin-inline: auto;
}

/* Fase 74 · Laboratorio Python: modo clase, zoom y paneles ocultables */
.python-class-toolbar {
  align-items: center;
  gap: 0.55rem;
}

.python-zoom-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

body.python-lab-class-mode .python-lab-hero {
  position: sticky;
  top: 8px;
  z-index: 30;
  padding: 0.8rem 1rem;
  margin-bottom: 0.75rem;
  backdrop-filter: blur(12px);
}

body.python-lab-class-mode .python-lab-titlebar h1 {
  margin: 0.15rem 0;
  font-size: clamp(1.25rem, 2.4vw, 2rem);
}

body.python-lab-class-mode .python-lab-titlebar p {
  display: none;
}

body.python-lab-class-mode .python-lab-example-compact,
body.python-lab-class-mode .html-lab-note {
  display: none;
}

body.python-lab-class-mode .python-lab-editor,
body.python-lab-class-mode .python-lab-output {
  min-height: clamp(620px, 72vh, 880px);
}

body.python-lab-class-mode .python-console-live {
  min-height: clamp(620px, 72vh, 880px);
}

body.python-lab-helpers-hidden .python-lab-tools,
body.python-lab-helpers-hidden .python-lab-example-compact,
body.python-lab-helpers-hidden .html-lab-note,
body.python-lab-helpers-hidden .python-lab-files {
  display: none;
}

body.python-lab-helpers-hidden .python-ide-shell {
  grid-template-columns: 1fr;
}

.python-ide-shell.editor-focus {
  grid-template-columns: 1fr;
}

.python-ide-shell.editor-focus .python-lab-files,
.python-ide-shell.editor-focus .python-ide-console-pane,
.python-ide-shell.editor-focus .python-ide-resizer {
  display: none;
}

.python-ide-shell.editor-focus .python-ide-workspace {
  grid-template-columns: 1fr;
}

.python-ide-shell.editor-focus .python-ide-code-pane {
  border-radius: 14px;
}

.python-ide-shell.editor-focus .python-lab-editor {
  min-height: clamp(680px, 78vh, 960px);
}

body.python-lab-class-mode .python-ide-shell.editor-focus .python-lab-editor {
  min-height: clamp(740px, 82vh, 1040px);
}

body.python-lab-class-mode .python-ide-main {
  padding: 10px;
}

body.python-lab-class-mode .python-lab-tabs {
  margin-bottom: 8px;
}

body.python-lab-class-mode .python-ide-pane-head,
body.python-lab-class-mode .python-console-head {
  padding-top: 8px;
  padding-bottom: 8px;
}

body.python-lab-class-mode .python-console-head p {
  display: none;
}

@media (max-width: 980px) {
  body.python-lab-class-mode .python-lab-hero {
    position: static;
  }

  body.python-lab-class-mode .python-lab-editor,
  body.python-lab-class-mode .python-lab-output,
  body.python-lab-class-mode .python-console-live,
  .python-ide-shell.editor-focus .python-lab-editor {
    min-height: 74vh;
  }
}

@media (max-width: 760px) {
  .python-class-toolbar {
    justify-content: flex-start;
  }

  .python-class-toolbar .secondary-button {
    flex: 1 1 135px;
  }

  body.python-lab-class-mode .python-lab-hero {
    padding: 0.75rem;
  }
}

/* Fase 75: administración de ejemplos Python */
.python-example-admin-card {
  display: grid;
  gap: 1rem;
}

.python-example-form textarea.python-example-code-input,
.python-example-form textarea.python-example-output-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  white-space: pre-wrap;
  line-height: 1.45;
  tab-size: 4;
  min-height: 220px;
}

.python-example-form textarea.python-example-output-input {
  min-height: 110px;
}

.python-example-admin-list {
  display: grid;
  gap: .9rem;
}

.python-example-admin-item {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.38);
}

.python-example-admin-item.is-inactive {
  opacity: .72;
}

.python-example-admin-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.python-example-admin-item-head h3 {
  margin: 0 0 .2rem;
}

.python-example-edit-details {
  margin-top: .85rem;
}

.python-example-edit-details summary {
  cursor: pointer;
  font-weight: 700;
}

@media (max-width: 760px) {
  .python-example-admin-item-head {
    display: grid;
  }
}

/* Fase 77: centro de interventoría admin */
.intervention-center-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.intervention-center-grid {
  align-items: start;
  margin-bottom: 18px;
}
.intervention-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px;
}
.intervention-mini-tile {
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(15, 23, 42, .52);
}
.intervention-mini-tile span {
  display: block;
  color: var(--muted);
  font-size: .82rem;
}
.intervention-mini-tile strong {
  display: block;
  margin-top: 4px;
  font-size: 1.35rem;
  line-height: 1;
}
.intervention-access-grid .soft-card {
  text-decoration: none;
  color: inherit;
  min-height: 120px;
  border-style: dashed;
}
.intervention-access-grid .soft-card:hover {
  transform: translateY(-1px);
  border-color: rgba(147, 197, 253, .64);
}
.admin-intervention-card .intervention-mini-grid {
  margin-top: 10px;
}
@media (max-width: 760px) {
  .intervention-center-kpis,
  .intervention-mini-grid {
    grid-template-columns: 1fr;
  }
  .intervention-center-grid {
    margin-bottom: 12px;
  }
}

/* F77B: visor ligero para código Python en entregas y revisión */
.python-code-viewer {
  position: relative;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: #020617;
  color: #dbeafe;
  border-color: rgba(96, 165, 250, 0.42);
  overflow-x: auto;
  tab-size: 2;
}

.python-code-viewer::before {
  content: attr(data-code-lang);
  position: absolute;
  top: 8px;
  right: 10px;
  padding: 2px 7px;
  border: 1px solid rgba(96, 165, 250, 0.35);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  color: #93c5fd;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: none;
}

.activity-submission-content.python-code-viewer {
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
  padding: 14px;
  padding-top: 28px;
  line-height: 1.45;
}

.code-box.python-code-viewer {
  padding-top: 28px;
}

.py-token.py-keyword { color: #c4b5fd; font-weight: 700; }
.py-token.py-builtin { color: #67e8f9; }
.py-token.py-string { color: #86efac; }
.py-token.py-number { color: #fbbf24; }
.py-token.py-comment { color: #94a3b8; font-style: italic; }

/* Admin dashboard header nav cleanup - hotfix post Fase 77 */
.admin-page-head--compact .admin-page-copy {
  width: 100%;
}

.admin-page-head--compact .admin-head-summary {
  max-width: 920px;
}

/* Fase 101 · Gestor interno de trabajos guardados en editor Python */
.python-work-manager {
  margin: 0 0 10px;
  padding: 12px 14px;
  display: grid;
  gap: 10px;
}

.python-work-manager-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.python-work-manager-head h2 {
  margin: 4px 0 2px;
  font-size: 1.05rem;
}

.python-work-manager-head p {
  margin: 0;
}

.python-work-current {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.24);
  color: rgba(226, 232, 240, 0.82);
  font-size: 0.88rem;
}

.python-work-current.has-work {
  border-color: rgba(94, 234, 212, 0.32);
  background: rgba(20, 184, 166, 0.12);
  color: rgba(240, 253, 250, 0.95);
}

.python-work-actions {
  gap: 8px;
}

.python-work-actions .secondary-button {
  padding: 8px 12px;
}


.python-work-rename-panel {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(94, 234, 212, 0.22);
  background: rgba(20, 184, 166, 0.08);
}

.python-work-rename-panel[hidden] {
  display: none;
}

.python-work-inline-form {
  display: grid;
  gap: 5px;
  min-width: min(360px, 100%);
  flex: 1 1 280px;
}

.python-work-inline-form span {
  color: rgba(226, 232, 240, 0.76);
  font-size: .82rem;
  font-weight: 700;
}

.python-work-name-input {
  width: 100%;
  min-height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.42);
  color: rgba(248, 250, 252, 0.94);
  padding: 8px 10px;
  font: inherit;
}

.python-work-name-input:focus {
  outline: none;
  border-color: rgba(94, 234, 212, 0.62);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.14);
}

body.html-lab-light-mode .python-work-rename-panel {
  background: rgba(20, 184, 166, 0.08);
  border-color: rgba(13, 148, 136, 0.22);
}

body.html-lab-light-mode .python-work-inline-form span {
  color: rgba(15, 23, 42, 0.70);
}

body.html-lab-light-mode .python-work-name-input {
  background: rgba(255, 255, 255, 0.84);
  border-color: rgba(15, 23, 42, 0.14);
  color: rgba(15, 23, 42, 0.90);
}

.python-work-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}

.python-work-hints span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 9px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.16);
  color: rgba(226, 232, 240, 0.76);
  font-size: 0.82rem;
}

.python-work-hints strong {
  color: rgba(240, 253, 250, 0.94);
}

.python-work-message {
  margin: 0;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.python-work-message.is-success {
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.28);
  background: rgba(22, 163, 74, 0.12);
}

.python-work-message.is-warning,
.python-work-message.is-error {
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.28);
  background: rgba(180, 83, 9, 0.12);
}

.python-work-list {
  display: grid;
  gap: 8px;
}

.python-work-list[hidden] {
  display: none;
}

.python-work-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.20);
}

.python-work-item.is-active {
  border-color: rgba(94, 234, 212, 0.35);
  background: rgba(20, 184, 166, 0.12);
}

.python-work-item strong,
.python-work-item span {
  display: block;
}

.python-work-item span {
  margin-top: 2px;
  color: rgba(226, 232, 240, 0.72);
  font-size: 0.84rem;
}

.python-work-empty {
  margin: 0;
}

body.html-lab-light-mode .python-work-current,
body.html-lab-light-mode .python-work-hints span,
body.html-lab-light-mode .python-work-message,
body.html-lab-light-mode .python-work-item {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(15, 23, 42, 0.12);
  color: rgba(15, 23, 42, 0.82);
}

body.html-lab-light-mode .python-work-current.has-work,
body.html-lab-light-mode .python-work-item.is-active {
  background: rgba(20, 184, 166, 0.10);
  border-color: rgba(13, 148, 136, 0.25);
}

body.html-lab-light-mode .python-work-item span {
  color: rgba(15, 23, 42, 0.62);
}

body.html-lab-light-mode .python-work-hints strong {
  color: rgba(15, 23, 42, 0.88);
}

@media (max-width: 720px) {
  .python-work-manager-head,
  .python-work-item {
    align-items: stretch;
    flex-direction: column;
  }

  .python-work-current {
    width: 100%;
    justify-content: center;
  }
}

/* Fase 105 · Vista admin de trabajos guardados personales */
.admin-saved-works-stats {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin: .75rem 0;
}

.compact-stat {
  padding: .85rem 1rem;
}

.compact-stat strong {
  display: block;
  font-size: 1.35rem;
  margin-top: .2rem;
}

.admin-saved-works-filters {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.admin-saved-works-table .is-selected-row {
  outline: 2px solid rgba(14, 165, 233, .35);
  outline-offset: -2px;
  background: rgba(14, 165, 233, .07);
}

.admin-saved-work-code-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  align-items: start;
}

.admin-saved-work-code {
  min-height: 220px;
  max-height: 520px;
  overflow: auto;
  white-space: pre-wrap;
}

.admin-saved-work-viewer-card h3 {
  margin-top: .9rem;
}

/* Fase 112 · Panel docente de ejemplos dentro de editores */
.teacher-examples-panel {
  margin: 1rem 0;
  border: 1px solid rgba(148, 163, 184, .22);
  background: linear-gradient(180deg, rgba(15, 23, 42, .86), rgba(15, 23, 42, .72));
}

.teacher-examples-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.teacher-examples-head h2 {
  margin: .35rem 0 .25rem;
}

.teacher-examples-count {
  flex: 0 0 auto;
  border: 1px solid rgba(148, 163, 184, .24);
  background: rgba(255, 255, 255, .08);
  border-radius: 999px;
  padding: .45rem .75rem;
  color: rgba(226, 232, 240, .86);
  font-weight: 700;
}

.teacher-examples-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .8rem;
  align-items: end;
}

.teacher-field,
.teacher-check {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.teacher-field-wide {
  grid-column: span 2;
}

.teacher-field span,
.teacher-check span {
  color: rgba(226, 232, 240, .78);
  font-size: .86rem;
  font-weight: 700;
}

.teacher-field input,
.teacher-field select,
.teacher-field textarea {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, .26);
  background: rgba(15, 23, 42, .74);
  color: rgba(248, 250, 252, .94);
  border-radius: 14px;
  padding: .72rem .8rem;
}

.teacher-field textarea {
  resize: vertical;
  min-height: 86px;
}

.teacher-check {
  flex-direction: row;
  align-items: center;
  align-self: center;
  min-height: 44px;
}

.teacher-check input {
  width: 18px;
  height: 18px;
}

.teacher-actions {
  margin-top: .9rem;
}

body.html-lab-light-mode .teacher-examples-panel {
  background: rgba(255, 255, 255, .86);
  border-color: rgba(15, 23, 42, .12);
}

body.html-lab-light-mode .teacher-examples-count,
body.html-lab-light-mode .teacher-field input,
body.html-lab-light-mode .teacher-field select,
body.html-lab-light-mode .teacher-field textarea {
  background: rgba(255, 255, 255, .88);
  border-color: rgba(15, 23, 42, .14);
  color: rgba(15, 23, 42, .88);
}

body.html-lab-light-mode .teacher-field span,
body.html-lab-light-mode .teacher-check span {
  color: rgba(15, 23, 42, .7);
}

@media (max-width: 920px) {
  .teacher-examples-head {
    flex-direction: column;
  }

  .teacher-examples-grid {
    grid-template-columns: 1fr;
  }

  .teacher-field-wide {
    grid-column: auto;
  }
}

/* FASE 113 · IA pedagógica en editores */
.editor-ai-panel {
  display: grid;
  gap: 14px;
}

.editor-ai-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.editor-ai-head h2 {
  margin-bottom: 4px;
}

.editor-ai-counter {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(91, 58, 160, .10);
  color: var(--primary, #5b3aa0);
  font-weight: 700;
  font-size: .9rem;
  white-space: nowrap;
}

.editor-ai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.editor-ai-action.is-active {
  box-shadow: 0 0 0 3px rgba(91, 58, 160, .16);
  transform: translateY(-1px);
}

.editor-ai-question-wrap {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.editor-ai-question-wrap textarea {
  width: 100%;
  min-height: 82px;
  resize: vertical;
  border-radius: 16px;
  border: 1px solid rgba(91, 58, 160, .18);
  padding: 12px 14px;
  font: inherit;
  background: rgba(255, 255, 255, .82);
}

.editor-ai-message {
  margin: 0;
}

.editor-ai-message.is-success {
  color: #23784f;
}

.editor-ai-message.is-warning {
  color: #9a6518;
}

.editor-ai-message.is-error {
  color: #a33a3a;
}

.editor-ai-response {
  border-radius: 18px;
  border: 1px solid rgba(91, 58, 160, .16);
  background: rgba(91, 58, 160, .07);
  padding: 14px 16px;
}

.editor-ai-response strong {
  display: block;
  margin-bottom: 8px;
}

.editor-ai-response p {
  margin: 0;
  line-height: 1.55;
}

@media (max-width: 760px) {
  .editor-ai-head {
    display: grid;
  }
  .editor-ai-counter {
    justify-content: center;
    white-space: normal;
  }
}

/* FASE 114 — bloqueo pedagógico de pegado en editores estudiantiles */
.html-lab-status.is-warning {
  color: #fde68a;
}

.editor-paste-guard-toast,
.activity-copy-paste-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10000;
  max-width: min(650px, calc(100vw - 32px));
  padding: 10px 12px 10px 16px;
  border: 1px solid rgba(245, 158, 11, 0.34);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.96);
  color: #fde68a;
  box-shadow: 0 18px 42px rgba(2, 8, 23, 0.36);
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.editor-paste-guard-toast.is-visible,
.activity-copy-paste-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.guard-mascot-toast {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: left;
}

.guard-mascot-toast__text {
  display: block;
  font-weight: 800;
  line-height: 1.25;
}

.guard-mascot-toast__gif {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  object-fit: contain;
  image-rendering: pixelated;
}

@media (max-width: 520px) {
  .editor-paste-guard-toast,
  .activity-copy-paste-toast {
    width: calc(100vw - 24px);
    bottom: 14px;
    padding: 10px 10px 10px 12px;
  }

  .guard-mascot-toast__gif {
    width: 56px;
    height: 56px;
  }
}

/* Hotfix visual: login público + Google institucional */
.landing-login-card {
  padding: 28px;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.16), transparent 38%),
    linear-gradient(180deg, rgba(17, 24, 39, 0.98) 0%, rgba(15, 23, 42, 0.98) 100%);
  box-shadow: 0 18px 38px rgba(2, 6, 23, 0.28);
}
.landing-login-card__head {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}
.landing-login-card__head h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.35rem);
}
.login-badge {
  width: fit-content;
  background: rgba(59, 130, 246, 0.18);
  color: #bfdbfe;
  border: 1px solid rgba(96, 165, 250, 0.28);
}
.landing-login-form {
  gap: 14px;
}
.landing-login-form input {
  min-height: 48px;
  padding: 12px 14px;
  border-color: #52627b;
  background: rgba(31, 41, 55, 0.95);
}
.landing-login-form input::placeholder {
  color: #8491a4;
}
.landing-login-primary {
  min-height: 50px;
  font-size: 1rem;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 24px rgba(34, 197, 94, 0.24);
}
.landing-login-actions {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
.google-login-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #475569;
  background: linear-gradient(180deg, #ffffff 0%, #eef2f7 100%);
  color: #0f172a;
  text-decoration: none;
  box-shadow: 0 14px 28px rgba(2, 6, 23, 0.18);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.google-login-btn:hover {
  transform: translateY(-1px);
  border-color: #64748b;
  box-shadow: 0 18px 34px rgba(2, 6, 23, 0.24);
  text-decoration: none;
}
.google-login-btn__icon {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.35);
  flex: 0 0 auto;
}
.google-login-btn__icon svg {
  width: 22px;
  height: 22px;
  display: block;
}
.google-login-btn__copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.google-login-btn__copy strong {
  font-size: 1rem;
  line-height: 1.1;
  color: #0f172a;
}
.google-login-btn__copy small {
  color: #475569;
  line-height: 1.25;
}
.landing-login-note {
  margin: -2px 0 0;
  line-height: 1.35;
}
.landing-register-btn {
  width: 100%;
}
@media (max-width: 640px) {
  .landing-login-card {
    padding: 20px;
  }
  .google-login-btn {
    align-items: flex-start;
  }
}

/* Orden visual de ofertas automáticas y públicas */
.offer-detail-card {
  padding: 24px;
}
.offer-detail-header {
  align-items: flex-start;
}
.offer-detail-lead {
  max-width: 1100px;
  line-height: 1.45;
}
.offer-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.offer-summary-card {
  display: grid;
  gap: 10px;
}
.offer-meta-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.offer-meta-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}
.offer-meta-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.offer-meta-list span {
  color: #94a3b8;
}
.offer-content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.offer-section-card {
  display: grid;
  gap: 10px;
  padding: 18px;
}
.offer-section-card h2 {
  margin: 0;
  font-size: 1.1rem;
}
.offer-point-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 8px;
  line-height: 1.45;
}
.offer-point-list.compact {
  gap: 6px;
}
.offer-section-warning h2 {
  color: #f8fafc;
}
.top-gap-small {
  margin-top: 8px;
}
.offer-card-summary {
  line-height: 1.45;
}
@media (max-width: 900px) {
  .offer-summary-grid,
  .offer-content-grid {
    grid-template-columns: 1fr;
  }
}

/* Fase H1: vista previa de importación masiva Google */
.google-import-preview-wrap {
  max-height: 620px;
  overflow: auto;
}
.google-import-preview-table th,
.google-import-preview-table td {
  vertical-align: top;
}
.google-import-status-pill {
  margin-left: 6px;
  margin-top: 6px;
}
.google-import-row--coincidencia_segura {
  background: rgba(34, 197, 94, 0.05);
}
.google-import-row--coincidencia_sugerida,
.google-import-row--dudosa_por_multiples_coincidencias,
.google-import-row--sin_cuenta_interna,
.google-import-row--usuario_ya_tiene_google {
  background: rgba(245, 158, 11, 0.06);
}
.google-import-row--dominio_invalido,
.google-import-row--correo_invalido {
  background: rgba(239, 68, 68, 0.07);
}
.google-import-preview-table select {
  min-width: 260px;
  max-width: 100%;
}

/* Fase H2: confirmación masiva Google Auth */
.google-import-confirm-result .badge {
  margin: 4px 4px 0 0;
}
.google-import-preview-table th:first-child,
.google-import-preview-table td:first-child {
  min-width: 120px;
}
.top-gap-small {
  margin-top: 8px;
}

/* Fase H3: filtros y lenguaje claro para coordinación de equipo */
.student-account-filters {
  margin-top: 16px;
}
.student-account-filter-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  gap: 14px;
}
.student-account-filter-actions {
  align-items: center;
}
.coordinator-badge {
  display: inline-flex;
  margin-bottom: 8px;
}
.student-accounts-table td form {
  margin-top: 8px;
}
@media (max-width: 900px) {
  .student-account-filter-grid {
    grid-template-columns: 1fr;
  }
}

/* Fase H5: interventores y tokens en gestión de cuentas */
.interventor-management-card {
  border: 1px solid rgba(148, 163, 184, 0.18);
}
.interventor-management-table td,
.interventor-token-table td {
  vertical-align: top;
}
.interventor-token-form {
  margin-top: 12px;
}
.interventor-management-table form,
.interventor-token-table form {
  margin: 0;
}

/* Fase H6: inicio personal de interventoría */
.interventor-home-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
}
.interventor-home-hero h1 {
  margin: 0 0 10px;
}
.interventor-home-primary {
  min-width: 240px;
  display: grid;
  gap: 10px;
  justify-items: start;
}
.interventor-home-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.interventor-home-card {
  display: grid;
  gap: 10px;
  align-content: start;
}
.interventor-home-card h2 {
  margin: 0;
}
.interventor-home-safe-note {
  margin-top: 16px;
}
@media (max-width: 1050px) {
  .interventor-home-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  .interventor-home-hero {
    display: grid;
  }
  .interventor-home-grid {
    grid-template-columns: 1fr;
  }
}
/* Hotfix importación Google: ocultar filas ya vinculadas */
.google-import-tools {
  align-items: center;
  justify-content: flex-start;
}
.google-import-hide-linked-toggle {
  width: fit-content;
  padding: 7px 10px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
}
#google-import-hide-linked:checked ~ .google-import-preview-wrap .google-import-row--correo_ya_vinculado {
  display: none;
}

/* Fase I2: estados claros del editor de web de equipo */
.team-site-publish-help {
  border-color: rgba(59, 130, 246, .35);
  background: rgba(59, 130, 246, .10);
}
.html-lab-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, .22);
  background: rgba(15, 23, 42, .6);
}
.html-lab-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #94a3b8;
  flex: 0 0 auto;
}
.html-lab-status[data-editor-state="ready"] {
  color: #bfdbfe;
  border-color: rgba(96, 165, 250, .32);
  background: rgba(59, 130, 246, .10);
}
.html-lab-status[data-editor-state="ready"]::before {
  background: #60a5fa;
}
.html-lab-status[data-editor-state="unsaved"] {
  color: #fde68a;
  border-color: rgba(245, 158, 11, .38);
  background: rgba(245, 158, 11, .12);
}
.html-lab-status[data-editor-state="unsaved"]::before {
  background: #f59e0b;
}
.html-lab-status[data-editor-state="saving"] {
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, .34);
  background: rgba(34, 197, 94, .10);
}
.html-lab-status[data-editor-state="saving"]::before {
  background: #22c55e;
}

/* Fase I6: panel admin IA estudiantil */
.admin-table-lg .badge.warning {
  white-space: nowrap;
}


/* F117 · Alertas internas para estudiantes e interventores */
.notification-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: 1px solid rgba(125, 211, 252, .30);
  background: rgba(14, 165, 233, .12);
  color: #e0f2fe !important;
  border-radius: 999px;
  padding: .35rem .65rem;
  text-decoration: none;
  font-weight: 700;
}
.notification-nav-pill span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 .35rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, .25);
  color: #fff;
  font-size: .78rem;
}
.notification-panel {
  margin: 1rem 0;
  border-color: rgba(96, 165, 250, .24);
  background: linear-gradient(135deg, rgba(15, 23, 42, .94), rgba(30, 41, 59, .88));
}
.notification-panel-head h2 { margin-bottom: .25rem; }
.notification-count-badge {
  background: rgba(56, 189, 248, .16);
  border-color: rgba(125, 211, 252, .28);
  color: #e0f2fe;
}
.notification-card-list {
  display: grid;
  gap: .75rem;
}
.notification-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .75rem;
  border: 1px solid rgba(148, 163, 184, .20);
  background: rgba(15, 23, 42, .72);
  border-radius: 18px;
  padding: .9rem;
  box-shadow: 0 12px 28px rgba(2, 6, 23, .18);
}
.notification-card-marker {
  width: .7rem;
  min-height: 100%;
  border-radius: 999px;
  background: #60a5fa;
  box-shadow: 0 0 0 5px rgba(96, 165, 250, .10);
}
.notification-card.severity-action_required .notification-card-marker,
.notification-card.severity-warning .notification-card-marker {
  background: #f59e0b;
  box-shadow: 0 0 0 5px rgba(245, 158, 11, .12);
}
.notification-card.severity-success .notification-card-marker {
  background: #22c55e;
  box-shadow: 0 0 0 5px rgba(34, 197, 94, .12);
}
.notification-card.severity-danger .notification-card-marker {
  background: #ef4444;
  box-shadow: 0 0 0 5px rgba(239, 68, 68, .12);
}
.notification-card-body { min-width: 0; }
.notification-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}
.notification-card-title-row strong {
  color: #f8fafc;
  font-size: 1rem;
}
.notification-card p {
  margin: .35rem 0 0;
  color: rgba(226, 232, 240, .86);
  line-height: 1.45;
}
.notification-severity-badge {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .02em;
  opacity: .86;
}
.notification-card-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-top: .7rem;
}
.notification-card-actions .inline-form.compact {
  display: inline-flex;
  margin: 0;
}
.btn-link.small,
button.btn-link.small {
  padding: .42rem .68rem;
  font-size: .88rem;
}
.btn-link.ghost,
button.btn-link.ghost {
  border-color: rgba(148, 163, 184, .28);
  background: rgba(15, 23, 42, .35);
  color: rgba(226, 232, 240, .92);
}
.notification-empty-text {
  margin: .25rem 0 0;
  padding: .8rem 0;
}
.interventor-priority-panel {
  border-color: rgba(251, 191, 36, .22);
}
@media (max-width: 720px) {
  .notification-card { grid-template-columns: 1fr; }
  .notification-card-marker { width: 100%; height: .35rem; min-height: .35rem; }
  .notification-card-actions { align-items: stretch; }
  .notification-card-actions a,
  .notification-card-actions button { width: 100%; justify-content: center; }
}

/* F118 · Vista completa de avisos */
.notification-panel-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .55rem;
  flex-wrap: wrap;
}
.notifications-hero {
  margin-bottom: 1rem;
}
.notifications-full-grid {
  display: grid;
  gap: 1rem;
}
.notification-full-section {
  border-color: rgba(96, 165, 250, .20);
  background: rgba(15, 23, 42, .78);
}
.notification-card-list-full {
  gap: .7rem;
}
.notification-card-full {
  padding: 1rem;
}
.notification-card.read {
  opacity: .78;
  background: rgba(15, 23, 42, .48);
}
.notification-card.read .notification-card-marker {
  background: #64748b;
  box-shadow: 0 0 0 5px rgba(100, 116, 139, .10);
}
.notification-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: .45rem;
  color: rgba(203, 213, 225, .70);
  font-size: .82rem;
}
.muted-notification-list .notification-card-title-row strong {
  color: rgba(226, 232, 240, .86);
}
@media (max-width: 720px) {
  .notification-panel-tools {
    width: 100%;
    justify-content: flex-start;
  }
  .notification-panel-tools .btn-link {
    width: 100%;
    justify-content: center;
  }
}


/* F119 - correos opcionales para alertas */
.email-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.email-alert-types {
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.34);
}

.email-alert-types .checkbox-line {
  margin-top: 0.55rem;
}

.email-queue-table-wrap td {
  vertical-align: top;
}

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


/* Hotfix F121: orden visual del panel de reglas automáticas.
   Mantiene la lógica del motor y corrige el formulario que heredaba columnas compactas. */
.auto-rules-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr));
  align-items: start;
}

.auto-rule-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid #334155;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.34);
}

.auto-rule-edit-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.auto-rule-card .compact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auto-option-panel {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid #334155;
  border-radius: 14px;
  background: rgba(31, 41, 55, 0.45);
}

.auto-option-panel .checkbox-row {
  align-items: flex-start;
}

.auto-help-note {
  display: block;
  margin-top: 6px;
  line-height: 1.35;
}

.auto-rule-note {
  margin: 0;
  line-height: 1.35;
}

.auto-rule-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
}

.auto-rule-flags .checkbox-row {
  margin: 0;
}

@media (max-width: 880px) {
  .auto-rule-card .compact-grid {
    grid-template-columns: 1fr;
  }
}

/* Fase 124 · Distribución UI sincronizada y accesos plegables */
.admin-quick-accordion {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-quick-group {
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.34);
  overflow: hidden;
}

.admin-quick-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
  color: #e5e7eb;
  font-weight: 900;
  user-select: none;
}

.admin-quick-group summary::-webkit-details-marker {
  display: none;
}

.admin-quick-group summary::before {
  content: '▸';
  color: #93c5fd;
  font-size: 0.9rem;
  transition: transform 0.16s ease;
}

.admin-quick-group[open] summary::before {
  transform: rotate(90deg);
}

.admin-quick-group summary span {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(51, 65, 85, 0.86);
  color: #bfdbfe;
  font-size: 0.76rem;
}

.admin-quick-group[open] summary {
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(30, 41, 59, 0.38);
}

.admin-button-stack--compact {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px;
}

.admin-button-stack--compact .btn-link {
  flex: 1 1 auto;
  justify-content: center;
  min-height: 38px;
  padding: 8px 10px;
  font-size: 0.93rem;
}

.admin-layout-toolbar[data-dashboard-layout-toolbar] {
  flex-wrap: wrap;
}

.admin-layout-toolbar[data-dashboard-layout-toolbar] .admin-layout-actions {
  row-gap: 8px;
}

.admin-layout-toolbar[data-dashboard-layout-toolbar] .admin-layout-actions .btn-link {
  white-space: nowrap;
}

@media (max-width: 760px) {
  .admin-quick-group summary {
    align-items: flex-start;
  }

  .admin-layout-toolbar[data-dashboard-layout-toolbar] .admin-layout-actions .btn-link {
    flex: 1 1 100%;
  }
}

/* F126 — Interventoría: chat interno y guía operativa */
.intervention-chat-card .compact-attention-item,
.intervention-guide-card .compact-attention-item {
  align-items: center;
}
.intervention-guide-card details {
  width: 100%;
}
.intervention-guide-card summary {
  cursor: pointer;
  color: var(--text, #e8f0ff);
  font-size: 1.05rem;
  margin-bottom: .75rem;
}
.intervention-guide-list {
  margin: .75rem 0 0 1.25rem;
  padding: 0;
  color: var(--muted, #b8c7dc);
  line-height: 1.45;
}
.intervention-guide-list li {
  margin: .35rem 0;
}
.intervention-chat-card-mini .badge.warning {
  background: rgba(245, 158, 11, .18);
  border-color: rgba(245, 158, 11, .45);
  color: #facc15;
}

/* FASE 128 - pausa pedagógica por curso */
.course-pause-admin-panel,
.course-pause-notice-card {
  border-color: rgba(245, 158, 11, 0.32);
}
.course-pause-notice-card {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(15, 23, 42, 0.92));
}

/* Fase 129: resumen interno de aportes visible solo para coordinación */
.team-internal-contributions-card {
  border: 1px solid rgba(125, 211, 252, 0.22);
}
.team-internal-contributions summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-weight: 700;
  gap: 0.75rem;
  justify-content: space-between;
  list-style: none;
}
.team-internal-contributions summary::-webkit-details-marker {
  display: none;
}
.team-internal-contributions summary::after {
  content: "▾";
  color: var(--muted, #94a3b8);
  font-size: 0.9rem;
}
.team-internal-contributions:not([open]) summary::after {
  content: "▸";
}
.team-contribution-table td,
.team-contribution-table th {
  vertical-align: top;
}
.team-contribution-table .badge {
  white-space: nowrap;
}
.compact-table-wrap {
  margin-top: 0.75rem;
}


/* FASE 130 — Workspace unificado: panel derecho Resultado/IA */
.workspace-side-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.workspace-side-tabs {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  padding: 0.55rem 0.65rem 0.35rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.76);
  position: sticky;
  top: 0;
  z-index: 2;
}

.workspace-side-tab {
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.82);
  color: rgba(226, 232, 240, 0.86);
  border-radius: 999px;
  padding: 0.38rem 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.workspace-side-tab:hover,
.workspace-side-tab.is-active {
  border-color: rgba(59, 130, 246, 0.62);
  background: rgba(37, 99, 235, 0.22);
  color: #f8fafc;
}

.workspace-side-pane {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.workspace-side-pane[hidden] {
  display: none !important;
}

.workspace-ai-pane {
  padding: 0.65rem;
  background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 34%), rgba(2, 6, 23, 0.32);
  overflow: auto;
}

.workspace-ai-pane .editor-ai-panel {
  margin: 0;
  min-height: 100%;
  box-shadow: none;
  border-color: rgba(96, 165, 250, 0.22);
  background: rgba(15, 23, 42, 0.76);
}

.workspace-ai-empty {
  border: 1px dashed rgba(148, 163, 184, 0.25);
  border-radius: 14px;
  padding: 0.8rem;
  margin: 0.5rem 0;
}

.editor-ai-session-note {
  margin: 0.25rem 0 0.6rem;
  font-size: 0.86rem;
}

.editor-ai-chat-log {
  max-height: 360px;
  overflow-y: auto;
  padding: 0.55rem;
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.34);
}

.editor-ai-chat-message {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  padding: 0.58rem 0.65rem;
  margin: 0 0 0.55rem;
  background: rgba(15, 23, 42, 0.72);
}

.editor-ai-chat-message.is-user {
  border-color: rgba(34, 197, 94, 0.28);
  background: rgba(22, 101, 52, 0.16);
}

.editor-ai-chat-message.is-assistant {
  border-color: rgba(96, 165, 250, 0.28);
  background: rgba(30, 64, 175, 0.16);
}

.editor-ai-chat-message strong {
  display: block;
  margin-bottom: 0.25rem;
  color: #e2e8f0;
}

.editor-ai-chat-message p {
  margin: 0;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .workspace-side-tabs {
    position: static;
    flex-wrap: wrap;
  }
  .editor-ai-chat-log {
    max-height: 300px;
  }
}

/* F131 — contexto de actividad dentro de workspaces */
.workspace-activity-context {
  border-color: rgba(125, 211, 252, 0.34);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12), rgba(15, 23, 42, 0.82));
}

.workspace-activity-context h2 {
  margin: 0.25rem 0 0.35rem;
}

.workspace-activity-context details {
  margin-top: 0.85rem;
}

.workspace-activity-context summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--text, #e5e7eb);
}

.workspace-activity-details .activity-text-box {
  margin-top: 0.75rem;
}

.workspace-activity-launch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.workspace-activity-launch p {
  margin-bottom: 0;
}

@media (max-width: 780px) {
  .workspace-activity-launch {
    align-items: stretch;
  }
  .workspace-activity-launch .button-row {
    width: 100%;
  }
}

/* Fase 133 · código inicial, plantillas modificables y consignas estructuradas */
.starter-payload-panel,
.starter-preview-box {
  border: 1px solid rgba(125, 211, 252, 0.28);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.09), rgba(15, 23, 42, 0.78));
  padding: 1rem;
}

.starter-preview-box h3,
.starter-preview-box h4,
.starter-payload-panel h3 {
  margin-top: 0;
}

.starter-preview-box h4 {
  margin-bottom: 0.35rem;
  color: var(--muted, #9ca3af);
}

.starter-code-block {
  max-height: 360px;
  margin-top: 0.35rem;
  margin-bottom: 0.9rem;
}

.starter-field-hint {
  margin-top: -0.35rem;
  font-size: 0.82rem;
  color: var(--muted, #9ca3af);
}

/* FASE 134 · pulido final de actividades y workspaces */
.html-lab-hero.is-activity-workspace {
  border-color: rgba(125, 211, 252, 0.38);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.14), rgba(15, 23, 42, 0.86));
}

.activity-text-box {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.16);
  padding: 10px 12px;
}

.activity-review-criteria-box {
  border-color: rgba(34, 197, 94, 0.24);
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.08), rgba(15, 23, 42, 0.76));
}

.workspace-activity-context .button-row .btn-link:not(.secondary) {
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.16);
}

.workspace-activity-context .tiny-text,
.python-work-message,
.editor-ai-session-note {
  line-height: 1.45;
}

.editor-ai-head {
  gap: 0.75rem;
}

.workspace-ai-pane .editor-ai-actions,
.workspace-ai-pane .button-row {
  gap: 0.45rem;
}

@media (max-width: 720px) {
  .workspace-activity-context .section-header,
  .html-lab-hero.is-activity-workspace {
    align-items: stretch;
  }
  .workspace-activity-context .button-row .btn-link,
  .workspace-activity-context .button-row button,
  .workspace-ai-pane .button-row button {
    width: 100%;
    justify-content: center;
  }
}

/* FASE 135 · detalle admin de actividades con pestañas */
.activity-admin-tabs {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1rem;
  padding: 0.65rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(10px);
}

.activity-admin-tab {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.72);
  color: #dbeafe;
  cursor: pointer;
  font-weight: 800;
  padding: 0.55rem 0.85rem;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.activity-admin-tab:hover,
.activity-admin-tab:focus-visible {
  border-color: rgba(96, 165, 250, 0.62);
  background: rgba(30, 64, 175, 0.42);
  outline: none;
  transform: translateY(-1px);
}

.activity-admin-tab.is-active {
  border-color: rgba(34, 197, 94, 0.58);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.75), rgba(34, 197, 94, 0.28));
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12);
}

.activity-admin-tab-panel {
  display: grid;
  gap: 1rem;
}

.activity-admin-tab-panel[hidden] {
  display: none !important;
}

.activity-admin-summary-list {
  display: grid;
  gap: 0.45rem;
}

.activity-admin-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.activity-admin-quick-actions .btn-link {
  justify-content: center;
}

@media (max-width: 760px) {
  .activity-admin-tabs {
    position: static;
    align-items: stretch;
  }
  .activity-admin-tab,
  .activity-admin-quick-actions .btn-link {
    width: 100%;
  }
}

/* FASE 136 - Menú contextual pedagógico de ayuda de código */
.jero-code-hints-menu {
  position: fixed;
  z-index: 9999;
  width: min(320px, calc(100vw - 18px));
  max-height: min(360px, calc(100vh - 28px));
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(125, 211, 252, 0.28);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.97);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.38);
  color: #e5f0ff;
}

.jero-code-hints-menu[hidden] {
  display: none !important;
}

.jero-code-hints-head {
  padding: 6px 8px 8px;
  color: #93c5fd;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.jero-code-hint {
  display: grid;
  width: 100%;
  gap: 2px;
  margin: 2px 0;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.jero-code-hint:hover,
.jero-code-hint.is-active {
  border-color: rgba(96, 165, 250, 0.38);
  background: rgba(37, 99, 235, 0.24);
}

.jero-code-hint-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
  font-weight: 800;
  color: #f8fafc;
}

.jero-code-hint-detail {
  color: #bfdbfe;
  font-size: 0.78rem;
  line-height: 1.25;
}

.html-lab-light-mode .jero-code-hints-menu {
  border-color: rgba(37, 99, 235, 0.22);
  background: rgba(248, 250, 252, 0.98);
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.18);
  color: #0f172a;
}

.html-lab-light-mode .jero-code-hints-head {
  color: #1d4ed8;
}

.html-lab-light-mode .jero-code-hint:hover,
.html-lab-light-mode .jero-code-hint.is-active {
  border-color: rgba(37, 99, 235, 0.30);
  background: rgba(219, 234, 254, 0.9);
}

.html-lab-light-mode .jero-code-hint-label {
  color: #0f172a;
}

.html-lab-light-mode .jero-code-hint-detail {
  color: #334155;
}

/* FASE 137 - Diccionario manual de código */
.jero-code-dictionary-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 6, 23, 0.68);
  backdrop-filter: blur(8px);
}

.jero-code-dictionary-backdrop[hidden] {
  display: none !important;
}

.jero-code-dictionary {
  width: min(980px, calc(100vw - 28px));
  max-height: min(86vh, 820px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(125, 211, 252, 0.24);
  border-radius: 24px;
  background:
    radial-gradient(circle at 15% 0%, rgba(59, 130, 246, 0.16), transparent 30%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(11, 18, 32, 0.98));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.48);
  color: #e5f0ff;
}

.jero-code-dictionary-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 20px 22px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.jero-code-dictionary-head h2 {
  margin: 0.35rem 0 0.25rem;
}

.jero-code-dictionary-tabs {
  display: flex;
  gap: 0.5rem;
  padding: 12px 22px 0;
}

.jero-code-dictionary-body {
  overflow: auto;
  padding: 16px 22px 22px;
}

.jero-code-dictionary-group {
  margin-bottom: 18px;
}

.jero-code-dictionary-group h3 {
  margin: 0 0 10px;
  font-size: 0.96rem;
  color: #bfdbfe;
}

.jero-code-dictionary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.jero-code-dictionary-item {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  min-height: 100%;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.72);
}

.jero-code-dictionary-item-main {
  display: grid;
  gap: 6px;
}

.jero-code-dictionary-item strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  color: #f8fafc;
}

.jero-code-dictionary-item p {
  margin: 0;
  color: #cbd5e1;
  font-size: 0.86rem;
  line-height: 1.35;
}

.jero-code-dictionary-item pre {
  max-height: 112px;
  margin: 0;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.62);
  color: #dbeafe;
  font-size: 0.78rem;
  white-space: pre-wrap;
}

.jero-code-dictionary-item .secondary-button {
  align-self: flex-start;
}

.html-lab-light-mode .jero-code-dictionary {
  border-color: rgba(37, 99, 235, 0.18);
  background:
    radial-gradient(circle at 15% 0%, rgba(37, 99, 235, 0.10), transparent 30%),
    #f8fafc;
  color: #0f172a;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.18);
}

.html-lab-light-mode .jero-code-dictionary-head,
.html-lab-light-mode .jero-code-dictionary-item,
.html-lab-light-mode .jero-code-dictionary-item pre {
  border-color: rgba(15, 23, 42, 0.12);
}

.html-lab-light-mode .jero-code-dictionary-item {
  background: rgba(255, 255, 255, 0.86);
}

.html-lab-light-mode .jero-code-dictionary-group h3 {
  color: #1d4ed8;
}

.html-lab-light-mode .jero-code-dictionary-item strong {
  color: #0f172a;
}

.html-lab-light-mode .jero-code-dictionary-item p {
  color: #475569;
}

.html-lab-light-mode .jero-code-dictionary-item pre {
  background: #eef2ff;
  color: #1e293b;
}

@media (max-width: 720px) {
  .jero-code-dictionary-backdrop {
    align-items: stretch;
    padding: 10px;
  }
  .jero-code-dictionary {
    width: 100%;
    max-height: calc(100vh - 20px);
    border-radius: 18px;
  }
  .jero-code-dictionary-head {
    flex-direction: column;
    padding: 16px;
  }
  .jero-code-dictionary-tabs,
  .jero-code-dictionary-body {
    padding-left: 16px;
    padding-right: 16px;
  }
  .jero-code-dictionary-grid {
    grid-template-columns: 1fr;
  }
}

/* FASE 147 - detalle de contrato con acción contextual de interventoría */
.contract-detail-top-grid {
  align-items: stretch;
}

.contract-summary-card,
.contract-context-card {
  min-height: 0;
}

.contract-summary-list {
  display: grid;
  gap: 0.45rem;
}

.contract-context-card .summary-badges {
  margin-bottom: 0.75rem;
}

.contract-state-note {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.45);
}

.contract-state-note h3 {
  margin: 0 0 0.45rem;
}

.contract-action-form {
  margin-top: 0.9rem;
}

.contract-action-form textarea {
  min-height: 96px;
}

.compact-note {
  padding: 0.85rem 1rem;
}

@media (max-width: 900px) {
  .contract-detail-top-grid {
    grid-template-columns: 1fr;
  }
}

/* FASE 157 — Editor contractual simplificado */
.contract-code-shell .python-ide-workspace {
  display: block;
}

.contract-code-shell .python-ide-code-pane,
.contract-code-shell .python-ide-console-pane {
  border-radius: 14px;
}

.contract-code-shell [data-contract-python-pane][hidden] {
  display: none !important;
}

.contract-editor-ai-panel {
  margin-top: 1rem;
}

.contract-editor-secondary-actions summary {
  cursor: pointer;
  font-weight: 800;
}
