/* ===========================================================
   Xolver — estilos
   =========================================================== */
:root {
  --bg: #0b0d12;
  --bg-2: #11141b;
  --panel: #161a23;
  --panel-2: #1c2130;
  --border: #262b3a;
  --border-2: #2f3548;
  --text: #e6e9f2;
  --text-dim: #9aa3b8;
  --text-mute: #6b7388;
  --accent: #7c3aed;
  --accent-2: #06b6d4;
  --accent-soft: rgba(124, 58, 237, 0.16);
  --good: #10b981;
  --warn: #f59e0b;
  --bad: #ef4444;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 12px;
  --radius-sm: 8px;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(124,58,237,0.18), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(6,182,212,0.14), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: var(--mono);
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* ============================== TOPBAR ============================== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 13, 18, 0.7);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand h1 {
  font-size: 22px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 0%, #c7d2fe 60%, #67e8f9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.tagline {
  margin: 0;
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--text-dim);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 13px;
  transition: all 0.15s;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text);
  background: var(--panel-2);
  text-decoration: none;
}

.nav-link.active {
  color: var(--text);
  background: var(--accent-soft);
}

.domain {
  margin-left: 8px;
  padding: 6px 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-mute);
  border: 1px solid var(--border);
  border-radius: 999px;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .topbar { padding: 12px 14px; gap: 8px; }
  .brand h1 { font-size: 18px; }
  .tagline { display: none; }
  .nav { gap: 2px; flex: 1; justify-content: flex-end; }
  .nav-link { padding: 6px 10px; font-size: 12px; }
  .domain { display: none; }
}

/* ============================== LAYOUT ============================== */
.layout {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(500px, 1.4fr);
  gap: 20px;
  padding: 20px 28px 40px;
  max-width: 1600px;
  margin: 0 auto;
}

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

@media (max-width: 720px) {
  .layout { padding: 14px; gap: 14px; }
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.panel-tab {
  margin: 20px 28px 40px;
}

@media (max-width: 720px) {
  .panel { padding: 14px; }
  .panel-tab { margin: 14px; }
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
}

.panel-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

/* Sense segmented control */
.sense {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sense .label {
  font-size: 12px;
  color: var(--text-dim);
}

.segmented {
  display: inline-flex;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.segmented .seg {
  background: transparent;
  color: var(--text-dim);
  border: 0;
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.segmented .seg:hover { color: var(--text); }

.segmented .seg.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.35);
}

/* ============================== BLOCKS ============================== */
.block {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 14px;
}

.block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
  flex-wrap: wrap;
}

.block-header h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hint {
  font-size: 11px;
  color: var(--text-mute);
}

/* Variable table */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.vartable {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 380px;
}

.vartable th {
  text-align: left;
  padding: 6px 8px;
  font-weight: 500;
  font-size: 11px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.vartable td {
  padding: 4px 4px;
}

.vartable input, .vartable select {
  width: 100%;
}

/* Inputs */
input[type="text"], input[type="number"], select, textarea {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
}

input[type="text"], textarea {
  font-family: var(--mono);
}

/* Expression input */
.expr-input {
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.expr-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
}

.expr-input .prefix {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-weight: 700;
  padding: 9px 14px;
  font-size: 13px;
  display: flex;
  align-items: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.expr-input input {
  flex: 1;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-family: var(--mono);
  font-size: 14px;
}

.expr-input input:focus { box-shadow: none; }

/* Constraints */
.constraints {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.con-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px 110px 32px;
  gap: 6px;
  align-items: center;
}

.con-row input[type="text"] {
  font-family: var(--mono);
  min-width: 0;
}

@media (max-width: 480px) {
  .con-row { grid-template-columns: minmax(0, 1fr) 60px 90px 28px; gap: 4px; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  background: var(--panel-2);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.btn:hover { background: var(--border); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #8b5cf6, #22d3ee);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.45);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-dim);
}

.btn-ghost:hover { background: var(--panel-2); color: var(--text); }

.btn-sm { padding: 4px 10px; font-size: 11px; }
.btn-lg { padding: 12px 24px; font-size: 14px; }

.btn-icon {
  display: inline-flex;
  font-size: 11px;
}

.btn-del {
  background: transparent;
  border: 0;
  color: var(--text-mute);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 16px;
}

.btn-del:hover { color: var(--bad); background: rgba(239, 68, 68, 0.1); }

/* Options */
.options summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  padding: 4px 0;
  user-select: none;
}

.options summary:hover { color: var(--text); }

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.options-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.options-grid label span {
  font-size: 11px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  align-items: center;
}

.actions .btn-lg { flex: 1; }

/* ============================== RESULTS ============================== */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

@media (max-width: 540px) {
  .status-bar { flex-direction: column; align-items: stretch; }
  .status-meta { justify-content: space-between; }
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

.status-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-mute);
  transition: background 0.2s;
}

.status-pill.solving .dot {
  background: var(--accent);
  animation: pulse 1s infinite;
}
.status-pill.ok .dot { background: var(--good); }
.status-pill.warn .dot { background: var(--warn); }
.status-pill.error .dot { background: var(--bad); }

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.6); opacity: 0.5; }
}

.status-meta {
  display: flex;
  gap: 18px;
  font-size: 12px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.meta-label {
  color: var(--text-mute);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.05em;
}

.meta-item > span:last-child {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--text);
}

/* Progress bar */
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--panel-2);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.2s ease;
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.5);
}

/* Results grid */
.results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 900px) {
  .results-grid { grid-template-columns: minmax(0, 1fr); }
}

.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  min-width: 0;
  overflow: hidden;
}

.card-wide { grid-column: 1 / -1; }

.card h3 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.card-header h3 { margin: 0; }

.card-sub {
  font-size: 11px;
  color: var(--text-mute);
  font-family: var(--mono);
}

/* Chart */
.chart {
  width: 100%;
  height: 240px;
  min-width: 0;
}

@media (max-width: 720px) {
  .chart { height: 220px; }
}

/* Solution */
.card-solution { display: flex; flex-direction: column; }

.solution-empty {
  color: var(--text-mute);
  font-style: italic;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
}

.big-value {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(124,58,237,0.12), rgba(6,182,212,0.12));
  border-radius: 8px;
  border: 1px solid var(--border-2);
}

.big-label {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
}

.big-num {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 700;
  background: linear-gradient(135deg, #c4b5fd, #67e8f9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  word-break: break-all;
  line-height: 1.1;
}

@media (max-width: 720px) {
  .big-num { font-size: 22px; }
}

.solution-vars {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.var-pill {
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.var-pill .vname {
  font-size: 11px;
  color: var(--text-mute);
  font-family: var(--mono);
}

.var-pill .vval {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 14px;
}

.solution-quality {
  font-size: 12px;
  color: var(--text-dim);
  padding: 8px 12px;
  background: var(--panel-2);
  border-radius: 6px;
  border-left: 3px solid var(--accent-2);
  font-family: var(--mono);
}

/* Iter table */
.iter-table-wrap {
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  -webkit-overflow-scrolling: touch;
}

.iter-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 12px;
  min-width: 560px;
}

.iter-table th:nth-child(1), .iter-table td:nth-child(1) { width: 50px; }
.iter-table th:nth-child(2), .iter-table td:nth-child(2) { width: 110px; }
.iter-table th:nth-child(3), .iter-table td:nth-child(3) { width: 180px; }
.iter-table th:nth-child(4), .iter-table td:nth-child(4) { min-width: 180px; }
.iter-table td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.iter-table thead {
  position: sticky;
  top: 0;
  background: var(--panel);
  z-index: 1;
}

.iter-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-mute);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-family: 'Inter', sans-serif;
}

.iter-table td {
  padding: 6px 12px;
  border-bottom: 1px solid rgba(38, 43, 58, 0.5);
}

.iter-table tbody tr {
  transition: background 0.15s;
}

.iter-table tbody tr:hover { background: var(--panel-2); }

.iter-table tbody tr.new-row {
  animation: flashIn 0.4s ease-out;
}

@keyframes flashIn {
  from { background: rgba(124, 58, 237, 0.25); }
  to { background: transparent; }
}

.iter-table .nota {
  color: var(--text-dim);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
}

/* ============================== LEYENDA ============================== */
.legend {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 14px 0 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.legend-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: center;
  gap: 12px;
}
.legend-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-mute);
  font-weight: 700;
}
.legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
}
.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.legend-text { color: var(--text-dim); }
.legend-badge { font-size: 10px; padding: 3px 9px; }
.legend-diff {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.legend-diff .diff-dot { width: 7px; height: 7px; }
@media (max-width: 720px) {
  .legend { padding: 12px; }
  .legend-row { grid-template-columns: 1fr; gap: 4px; }
  .legend-items { gap: 10px 14px; }
  .legend-chip { font-size: 11.5px; }
}

/* ============================== EJEMPLOS ============================== */
.panel-tab-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 6px;
}
.panel-tab-head h2 { margin: 0; font-size: 18px; }

#cat-tabs .seg { display: inline-flex; align-items: center; gap: 6px; }

.badge-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}
.badge-dot.res { background: #a78bfa; box-shadow: 0 0 6px rgba(167,139,250,0.6); }
.badge-dot.ej  { background: #34d399; box-shadow: 0 0 6px rgba(52,211,153,0.6); }

.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.example-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  position: relative;
  overflow: hidden;
  animation: card-in 0.32s ease-out both;
  animation-delay: calc(var(--idx, 0) * 20ms);
}

.example-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--border-2);
  transition: background 0.18s ease;
}
.example-card.kind-resuelto::before { background: linear-gradient(180deg, #a78bfa, #7c3aed); }
.example-card.kind-ejercicio::before { background: linear-gradient(180deg, #34d399, #06b6d4); }

.example-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(124, 58, 237, 0.22);
}
.example-card.kind-ejercicio:hover {
  border-color: #34d399;
  box-shadow: 0 12px 30px rgba(52, 211, 153, 0.18);
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.example-card h4 {
  margin: 6px 0 6px;
  font-size: 14px;
  font-weight: 700;
}

.example-card p {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.5;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid transparent;
}
.badge-res {
  background: rgba(167, 139, 250, 0.14);
  color: #c4b5fd;
  border-color: rgba(167, 139, 250, 0.35);
}
.badge-ej {
  background: rgba(52, 211, 153, 0.14);
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.35);
}
.tag-badge {
  background: var(--panel-2);
  color: var(--text-dim);
  border-color: var(--border);
  font-family: var(--mono);
}

.difficulty {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
}
.diff-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--border-2);
}
.diff-dot.on { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.diff-label {
  font-size: 10px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.card-action {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
  margin-top: 2px;
  letter-spacing: 0.02em;
}
.example-card:hover .card-action { color: var(--accent-2); }

/* ============================== MODAL ============================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 12, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.modal-backdrop.open { opacity: 1; }

.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55);
  transform: scale(0.96) translateY(8px);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.modal-backdrop.open .modal { transform: scale(1) translateY(0); opacity: 1; }

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.modal-titlebar {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.btn-close {
  background: transparent;
  border: 0;
  color: var(--text-dim);
  font-size: 28px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  line-height: 1;
}
.btn-close:hover { background: var(--panel-2); color: var(--text); }

.modal-title {
  margin: 8px 0 18px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.modal-body {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
}
.modal-body h3 {
  margin: 16px 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.modal-body h4 {
  margin: 14px 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: #c4b5fd;
}
.modal-body p { margin: 6px 0; color: var(--text-dim); }
.modal-body ul {
  margin: 6px 0;
  padding-left: 22px;
}
.modal-body li {
  color: var(--text-dim);
  margin: 3px 0;
}
.modal-body b { color: var(--text); }

.md-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 12.5px;
  font-family: var(--mono);
}
.md-table th, .md-table td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: left;
}
.md-table th {
  background: var(--panel-2);
  color: var(--text);
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.md-table td { color: var(--text-dim); }

.modal-answer {
  margin-top: 18px;
  background: linear-gradient(135deg, rgba(52,211,153,0.10), rgba(6,182,212,0.10));
  border: 1px solid rgba(52,211,153,0.3);
  border-radius: 8px;
  padding: 12px 14px;
  animation: card-in 0.3s ease-out both;
}
.answer-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6ee7b7;
  font-weight: 700;
  margin-bottom: 4px;
}
.answer-text {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
}

.modal-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
  flex-wrap: wrap;
}

/* ============================== BANNER DEL EJEMPLO CARGADO ============================== */
.loaded-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(124,58,237,0.10), rgba(6,182,212,0.10));
  border: 1px solid rgba(124,58,237,0.25);
  padding: 8px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 12.5px;
}
.lb-kind {
  font-size: 14px;
}
.lb-title {
  flex: 1;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-link {
  background: transparent;
  border: 0;
  color: var(--accent-2);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  font-family: inherit;
}
.btn-link:hover { background: var(--panel-2); }

@media (max-width: 720px) {
  .modal { padding: 18px; max-height: 88vh; }
  .modal-title { font-size: 18px; }
  .md-table { font-size: 11.5px; }
  .md-table th, .md-table td { padding: 5px 7px; }
  .panel-tab-head { flex-direction: column; align-items: stretch; }
  #cat-tabs { width: 100%; }
  #cat-tabs .seg { flex: 1; justify-content: center; }
  .difficulty .diff-label { display: none; }
}

/* ============================== AYUDA ============================== */
.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.help-grid article {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.help-grid h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.help-grid p { margin: 0 0 6px; font-size: 13px; color: var(--text-dim); }

.muted { color: var(--text-dim); }

/* ============================== FOOTER ============================== */
.footer {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-mute);
  font-size: 12px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
