/* ===== Curso de IA · PNP — estilos ===== */
:root {
    --green-900: #0b2e1d;
    --green-800: #0f3d27;
    --green-700: #155c38;
    --green-600: #1f7a4d;
    --green-100: #e3f2e9;
    --green-50: #f1f8f4;
    --gold: #d99a00;
    --gold-light: #f6c343;
    --red: #c8102e;
    --blue: #2f6fb0;
    --ink: #12211a;
    --ink-2: #4c5c54;
    --muted: #74847c;
    --line: #e2e9e5;
    --bg: #f3f6f4;
    --surface: #ffffff;
    --radius: 20px;
    --shadow: 0 1px 2px rgba(16, 40, 28, .06), 0 10px 30px -12px rgba(16, 40, 28, .18);
    --shadow-lg: 0 24px 60px -20px rgba(11, 46, 29, .35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
[hidden] { display: none !important; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.01em; }
a { color: var(--green-600); }
.muted { color: var(--muted); margin: .25rem 0 0; }
.small { font-size: .85rem; }

/* ----- Hero ----- */
.hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(135deg, var(--green-900) 0%, var(--green-800) 45%, var(--green-700) 100%);
    padding: 0 16px 96px;
}
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(60px); animation: float 14s ease-in-out infinite; }
.orb-1 { width: 420px; height: 420px; background: var(--gold); top: -180px; right: -80px; opacity: .28; }
.orb-2 { width: 360px; height: 360px; background: #2bb673; bottom: -200px; left: -100px; animation-delay: -6s; opacity: .3; }
.grid-lines {
    position: absolute; inset: 0;
    background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse at 70% 30%, #000 20%, transparent 70%);
}
@keyframes float { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-30px, 25px); } }

.topbar {
    position: relative;
    max-width: 1080px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 0;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: .95rem; }
.brand img { width: 38px; height: 46px; object-fit: contain; clip-path: ellipse(46% 47% at 50% 50%); }
.brand small { display: block; font-weight: 500; opacity: .75; font-size: .78rem; }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: 999px;
    color: #fff; text-decoration: none; font-size: .82rem; font-weight: 600;
    border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08);
    backdrop-filter: blur(6px); transition: background .2s;
}
.chip:hover { background: rgba(255,255,255,.18); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.credit-logo {
    display: block; width: 42px; height: 42px; border-radius: 50%; overflow: hidden;
    box-shadow: 0 0 0 2px rgba(90, 160, 255, .55), 0 6px 16px -6px rgba(0, 0, 0, .5);
    transition: transform .2s, box-shadow .2s;
}
.credit-logo:hover { transform: scale(1.08); box-shadow: 0 0 0 3px rgba(90, 160, 255, .8), 0 8px 20px -6px rgba(40, 110, 255, .6); }
.credit-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chip-admin { background: var(--gold); border-color: var(--gold); color: var(--green-900); }

.hero-content {
    position: relative;
    max-width: 1080px; margin: 28px auto 0;
    display: flex; align-items: center; gap: 32px;
    animation: rise .9s cubic-bezier(.2, .8, .2, 1) both;
}
.hero-logo {
    width: 128px; height: 156px; flex: none; object-fit: contain;
    clip-path: ellipse(46.5% 47.5% at 50% 50%);
    filter: drop-shadow(0 18px 30px rgba(0,0,0,.35));
    animation: logoIn 1.1s cubic-bezier(.2, .8, .2, 1) both;
}
.hero h1 { font-size: clamp(1.7rem, 4.2vw, 2.9rem); font-weight: 800; max-width: 760px; }
.hero-sub { margin: 10px 0 0; font-size: 1.08rem; opacity: .85; max-width: 640px; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes logoIn { from { opacity: 0; transform: scale(.8) rotate(-6deg); } to { opacity: 1; transform: none; } }

/* ----- Estado ----- */
.status {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 5px 12px; border-radius: 999px; margin-bottom: 12px;
    font-size: .76rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    background: rgba(255,255,255,.14); color: #fff;
}
.status i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-open i { background: #3ddc84; box-shadow: 0 0 0 0 rgba(61,220,132,.7); animation: ping 1.6s infinite; }
.status-pending i { background: var(--gold-light); }
.status-closed i { background: #ff8a8a; }
.card .status { background: var(--green-50); color: var(--green-700); }
.card .status-pending { background: #fff6dc; color: #8a6200; }
.card .status-closed { background: #fde8eb; color: var(--red); }
.card .status-closed i { background: var(--red); }
@keyframes ping { 70% { box-shadow: 0 0 0 8px rgba(61,220,132,0); } 100% { box-shadow: 0 0 0 0 rgba(61,220,132,0); } }

/* ----- Layout ----- */
.container {
    position: relative;
    max-width: 880px; margin: -64px auto 0; padding: 0 16px 48px;
}
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
    margin-bottom: 20px;
    border: 1px solid rgba(16, 40, 28, .04);
}
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s cubic-bezier(.2,.8,.2,1), transform .7s cubic-bezier(.2,.8,.2,1); transition-delay: var(--d, 0ms); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ----- Portada ----- */
.survey-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.survey-tile { display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: transform .25s, box-shadow .25s, opacity .7s; }
.survey-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.survey-tile h2 { font-size: 1.3rem; }
.survey-tile .status { align-self: flex-start; }
.tile-foot { margin-top: auto; padding-top: 20px; display: flex; justify-content: space-between; font-size: .88rem; color: var(--muted); }
.tile-cta { color: var(--green-600); font-weight: 700; }

/* ----- Formulario ----- */
.progress-wrap {
    position: sticky; top: 8px; z-index: 5;
    display: flex; align-items: center; gap: 14px;
    padding: 12px 18px; margin-bottom: 20px;
    background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
    border-radius: 999px; box-shadow: var(--shadow);
}
.progress { flex: 1; height: 8px; border-radius: 99px; background: var(--green-100); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--green-600), var(--gold)); transition: width .5s cubic-bezier(.2,.8,.2,1); }
.progress-wrap small { font-weight: 600; color: var(--ink-2); white-space: nowrap; }

.q-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.q-head h2 { font-size: 1.2rem; font-weight: 700; padding-top: 6px; }
.q-head em, .field em { color: var(--red); font-style: normal; }
.q-num {
    flex: none; display: grid; place-items: center;
    width: 40px; height: 40px; border-radius: 12px;
    background: linear-gradient(135deg, var(--green-600), var(--green-800)); color: #fff;
    font-weight: 800; box-shadow: 0 6px 14px -6px rgba(31,122,77,.7);
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.field { display: block; }
.field > span { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; color: var(--ink-2); }
.field input, .field textarea {
    width: 100%; font: inherit; color: var(--ink);
    padding: 13px 15px; border-radius: 12px;
    border: 1.5px solid var(--line); background: var(--green-50);
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--green-600); background: #fff; box-shadow: 0 0 0 4px rgba(31,122,77,.14); }
.char-count { display: block; text-align: right; color: var(--muted); font-size: .78rem; margin-top: 4px; }

.field-error { display: none; color: var(--red); font-weight: 600; font-size: .83rem; margin-top: 6px; }
.field.has-error .field-error, .q-card.has-error > .q-error { display: block; }
.field.has-error input { border-color: var(--red); }
.q-card.has-error { box-shadow: 0 0 0 2px rgba(200,16,46,.35), var(--shadow); }
.error-msg { color: var(--red); font-weight: 600; }
.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }

.options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.options-3 { grid-template-columns: repeat(3, 1fr); }
.option { position: relative; cursor: pointer; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option-box {
    display: flex; align-items: center; gap: 12px;
    padding: 15px 16px; border-radius: 14px;
    border: 1.5px solid var(--line); background: #fff;
    font-weight: 600; transition: all .2s ease;
}
.option:hover .option-box { border-color: #9cc9ae; transform: translateY(-2px); box-shadow: 0 8px 18px -10px rgba(31,122,77,.4); }
.option-mark {
    flex: none; width: 22px; height: 22px; border-radius: 50%;
    border: 2px solid #b7c7be; display: grid; place-items: center; transition: all .2s;
}
.option input[type=checkbox] + .option-box .option-mark { border-radius: 7px; }
.option-mark::after {
    content: ''; width: 10px; height: 6px; margin-top: -2px;
    border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff;
    transform: rotate(-45deg) scale(0); transition: transform .2s cubic-bezier(.3,1.6,.5,1);
}
.option input:checked + .option-box { border-color: var(--green-600); background: var(--green-50); color: var(--green-800); box-shadow: 0 0 0 3px rgba(31,122,77,.12); }
.option input:checked + .option-box .option-mark { background: var(--green-600); border-color: var(--green-600); }
.option input:checked + .option-box .option-mark::after { transform: rotate(-45deg) scale(1); }
.option input:focus-visible + .option-box { outline: 3px solid var(--gold-light); outline-offset: 2px; }
.other-field { margin-top: 14px; animation: rise .35s both; }

.submit-row { display: flex; justify-content: center; padding: 8px 0 24px; }

/* ----- Botones ----- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font: inherit; font-weight: 700; font-size: .9rem;
    padding: 11px 18px; border-radius: 12px; border: 1.5px solid transparent;
    cursor: pointer; text-decoration: none; transition: transform .15s, box-shadow .2s, background .2s;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: none; }
.btn:disabled { opacity: .7; cursor: wait; transform: none; }
.btn-primary { background: var(--green-600); color: #fff; box-shadow: 0 8px 18px -8px rgba(31,122,77,.7); }
.btn-gold { background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: var(--green-900); box-shadow: 0 10px 22px -10px rgba(217,154,0,.8); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--green-600); color: var(--green-700); }
.btn-ghost-light { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.25); }
.btn-danger { background: #fff; color: var(--red); border-color: #f3c2ca; }
.btn-danger:hover { background: #fde8eb; }
.btn-lg { padding: 16px 34px; font-size: 1.05rem; border-radius: 16px; }
.btn-sm { padding: 7px 13px; font-size: .82rem; border-radius: 10px; }
.btn-block { width: 100%; }

/* ----- Pantallas de estado ----- */
.state-card { text-align: center; padding: 48px 28px; }
.state-card h2 { font-size: 1.5rem; margin-top: 20px; }
.state-card .muted { max-width: 460px; margin: 10px auto 0; }
.pulse-ring { position: relative; width: 120px; height: 120px; margin: 0 auto; display: grid; place-items: center; }
.pulse-ring span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--green-600); animation: pulse 2.4s ease-out infinite; }
.pulse-ring span + span { animation-delay: 1.2s; }
.pulse-ring img { width: 70px; height: 86px; object-fit: contain; clip-path: ellipse(46% 47% at 50% 50%); }
@keyframes pulse { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }

.check-anim svg { width: 96px; height: 96px; }
.check-anim circle { fill: none; stroke: var(--green-600); stroke-width: 3; stroke-dasharray: 160; stroke-dashoffset: 160; animation: draw .8s ease forwards; }
.check-anim path { fill: none; stroke: var(--green-600); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .5s .7s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.live-counter {
    display: inline-flex; align-items: center; gap: 8px; margin-top: 22px;
    padding: 8px 16px; border-radius: 999px; background: var(--green-50); color: var(--green-700); font-size: .9rem;
}
.live-counter .dot { width: 8px; height: 8px; border-radius: 50%; background: #2bb673; animation: ping 1.6s infinite; box-shadow: 0 0 0 0 rgba(43,182,115,.6); }

/* ----- Barra de instructor ----- */
.admin-bar {
    display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
    padding: 12px 16px; margin-bottom: 20px; border-radius: 16px;
    background: var(--green-900); color: #fff; box-shadow: var(--shadow-lg);
}
.admin-bar-title { font-weight: 800; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--gold-light); }
.admin-bar-count { font-size: .9rem; opacity: .9; }
.admin-bar-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.admin-bar form, .admin-actions form { margin: 0; }

/* ----- Resultados ----- */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi { background: var(--surface); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.kpi-label { display: block; font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.kpi-value { display: block; font-size: 2.3rem; font-weight: 800; color: var(--ink); line-height: 1.1; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi-text { font-size: 1.5rem; padding-top: 8px; }
.loading { text-align: center; color: var(--muted); }

.insight {
    margin: -6px 0 20px; padding: 12px 16px; border-radius: 12px;
    background: var(--green-50); border-left: 4px solid var(--green-600); color: var(--ink-2);
}
.insight strong { color: var(--ink); }
.chart-box { position: relative; width: 100%; }
.chart-doughnut { height: 280px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; }

.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.legend li { display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 4px 10px; }
.swatch { width: 14px; height: 14px; border-radius: 4px; }
.legend-label { font-weight: 600; }
.legend-val { color: var(--ink-2); font-size: .9rem; font-variant-numeric: tabular-nums; }
.legend-bar { grid-column: 2 / -1; height: 6px; border-radius: 99px; background: #eef2ef; overflow: hidden; }
.legend-bar i { display: block; height: 100%; width: var(--w); border-radius: 99px; animation: grow 1.2s cubic-bezier(.2,.8,.2,1) both; }
@keyframes grow { from { width: 0; } }

.data-table { margin-top: 18px; font-size: .88rem; }
.data-table summary, .people summary, .variants summary { cursor: pointer; font-weight: 600; color: var(--green-700); }
.data-table table, .people table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
td:not(:first-child) { font-variant-numeric: tabular-nums; }

.others { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.others-title { font-size: .85rem; font-weight: 700; color: var(--ink-2); margin-right: 4px; }
.pill { padding: 5px 12px; border-radius: 999px; background: #fff6dc; font-size: .85rem; font-weight: 600; }
.pill b { margin-left: 4px; color: #8a6200; }

/* Pestañas del análisis de texto */
.text-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--green-50); margin-bottom: 18px; flex-wrap: wrap; }
.text-tabs button {
    font: inherit; font-size: .88rem; font-weight: 600; color: var(--ink-2);
    border: 0; background: none; padding: 8px 14px; border-radius: 9px; cursor: pointer; transition: all .2s;
}
.text-tabs button.active { background: #fff; color: var(--green-700); box-shadow: 0 2px 8px -2px rgba(16,40,28,.2); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: rise .45s both; }

.cloud { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 18px; padding: 18px 8px; }
.cloud-word {
    font-size: var(--s); font-weight: var(--fw); line-height: 1.15; color: var(--ink-2);
    animation: pop .6s cubic-bezier(.3,1.5,.5,1) both; animation-delay: var(--d); cursor: default;
    transition: transform .2s;
}
.cloud-word:hover { transform: scale(1.08); }
.cloud-word.w3, .cloud-word.w2 { color: var(--green-700); }
.cloud-word.w0 { color: var(--muted); }
.cloud-word sup { font-size: .55em; font-weight: 700; color: var(--muted); margin-left: 2px; }
@keyframes pop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }

.groups { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.groups > li { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); animation: rise .5s both; animation-delay: var(--d); }
.group-row { display: flex; align-items: center; gap: 12px; }
.group-rank { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--green-50); color: var(--green-700); font-weight: 800; font-size: .85rem; }
.group-body { flex: 1; min-width: 0; }
.group-text { margin: 0 0 6px; font-weight: 600; overflow-wrap: anywhere; }
.group-bar { display: block; height: 6px; border-radius: 99px; background: #eef2ef; overflow: hidden; }
.group-bar i { display: block; height: 100%; width: var(--w); background: var(--blue); border-radius: 99px; animation: grow 1.2s cubic-bezier(.2,.8,.2,1) both; }
.group-count { flex: none; font-weight: 800; font-size: 1.05rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.variants { margin: 10px 0 0 40px; font-size: .88rem; }
.variants ul { margin: 8px 0 0; padding-left: 18px; color: var(--ink-2); }

/* ----- Admin ----- */
.login-card { max-width: 420px; margin: 0 auto 20px; text-align: center; }
.login-card .field { text-align: left; margin: 22px 0 16px; }
.login-icon { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center; background: var(--green-50); color: var(--green-600); }
.admin-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; color: #fff; }
.admin-toolbar form { margin: 0; }
.admin-card-head { display: flex; flex-direction: column; gap: 18px; }
.admin-card h3 { font-size: 1.25rem; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.share-box {
    display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
    margin-top: 20px; padding: 12px 14px; border-radius: 12px; background: var(--green-50); font-size: .88rem;
}
.share-box span { font-weight: 700; color: var(--ink-2); }
.share-box code { flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--green-800); }
.people { margin-top: 18px; }
.table-wrap { max-height: 360px; overflow: auto; }
.link-danger { background: none; border: 0; color: var(--red); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }

/* ----- Pie ----- */
.footer { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 16px 16px 32px; color: var(--muted); font-size: .82rem; text-align: center; }
.footer-org { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; max-width: 100%; }
.footer-org img { width: 22px; height: 27px; object-fit: contain; clip-path: ellipse(46% 47% at 50% 50%); }
.footer-credit {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: center;
    padding: 10px 20px; border-radius: 16px; background: #fff; text-decoration: none;
    border: 1px solid var(--line); box-shadow: var(--shadow); max-width: 100%;
}
.footer-credit a { display: block; border-radius: 8px; transition: transform .2s; }
.footer-credit a:hover { transform: scale(1.04); }
.footer-credit img { height: 48px; width: auto; display: block; }
.footer-credit-label { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ----- Responsive ----- */
@media (max-width: 720px) {
    .hero { padding-bottom: 84px; }
    .hero-content { flex-direction: column; align-items: flex-start; gap: 18px; }
    .hero-logo { width: 84px; height: 102px; }
    .brand span { display: none; }
    .credit-logo { width: 36px; height: 36px; }
    .footer-credit img { height: 40px; }
    .card { padding: 20px; }
    .grid-2, .split { grid-template-columns: 1fr; }
    .options, .options-3 { grid-template-columns: 1fr; }
    .kpis { grid-template-columns: 1fr 1fr; }
    .kpis .kpi:last-child { grid-column: 1 / -1; }
    .admin-bar-actions { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .reveal { opacity: 1; transform: none; }
}

/* ----- Rondas ----- */
.status-run { background: rgba(246, 195, 67, .18); color: var(--gold-light); }
.card .status-run { background: #fff6dc; color: #8a6200; }
.status-run::before { content: '#'; opacity: .6; margin-right: -3px; }
.history { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.history-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.history-head h4 { margin: 0; font-size: 1rem; }
.history table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.history tr.is-current td { background: var(--green-50); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 99px; background: var(--green-600); color: #fff; font-size: .7rem; font-weight: 700; vertical-align: middle; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions a { font-weight: 600; margin-left: 12px; text-decoration: none; }
.row-actions a:hover { text-decoration: underline; }

/* ----- Caso práctico ----- */
:root {
    --tool-0: #1f7a4d; --tool-1: #d99a00; --tool-2: #2f6fb0;
    --tool-3: #c8102e; --tool-4: #1aa5a0; --tool-5: #8a4fb0;
}
.start-row { display: flex; justify-content: flex-end; margin-top: 18px; }

.case-card { position: relative; overflow: hidden; }
.case-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 5px; background: linear-gradient(90deg, var(--green-600), var(--gold), var(--red)); }
.case-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 18px; }
.case-code { padding: 5px 12px; border-radius: 8px; background: var(--green-900); color: var(--gold-light); font-weight: 800; font-size: .8rem; letter-spacing: .08em; }
.case-head h2 { font-size: 1.45rem; font-weight: 800; }
.case-notice { margin-left: auto; padding: 4px 10px; border-radius: 99px; border: 1px dashed #d9a3ad; color: var(--red); font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.case-steps { list-style: none; padding: 0; margin: 0 0 20px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.case-steps li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--green-50); font-size: .86rem; font-weight: 600; color: var(--ink-2); }
.case-steps b { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--green-600); color: #fff; font-size: .8rem; }
.case-material { border-left: 3px solid var(--green-100); padding-left: 4px; }
.case-material p { position: relative; margin: 0 0 12px; padding: 10px 12px 10px 44px; border-radius: 10px; line-height: 1.65; transition: background .2s; }
.case-material p:hover { background: var(--green-50); }
.par-num { position: absolute; left: 10px; top: 11px; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: #eef2ef; color: var(--muted); font-size: .75rem; font-weight: 800; }
.case-actions { display: flex; justify-content: flex-end; margin-top: 4px; }

.prompt-card { background: linear-gradient(160deg, #0d1f17, #11261c); color: #e8f3ec; border-color: rgba(255,255,255,.06); }
.prompt-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.prompt-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: .12em; font-size: .85rem; color: var(--gold-light); }
.prompt-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.prompt-body {
    margin: 0; padding: 18px 20px; border-radius: 14px; background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.08);
    font-family: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: .92rem; line-height: 1.8;
    white-space: pre-wrap; overflow-wrap: anywhere;
}
.btn.is-copied { background: var(--green-600); color: #fff; border-color: var(--green-600); }

/* Selector de IA y tabla comparativa */
.tool-picker { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.tool-chip { cursor: pointer; }
.tool-chip input { position: absolute; opacity: 0; pointer-events: none; }
.tool-chip span {
    display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px;
    border: 1.5px solid var(--line); background: #fff; font-weight: 700; font-size: .92rem; transition: all .2s;
}
.tool-chip:hover span { border-color: var(--tc); transform: translateY(-2px); }
.tool-chip input:checked + span { border-color: var(--tc); background: color-mix(in srgb, var(--tc) 12%, #fff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tc) 18%, transparent); }
.tool-chip input:focus-visible + span { outline: 3px solid var(--gold-light); outline-offset: 2px; }
.tool-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--tc, var(--muted)); flex: none; }
.rating-empty { margin: 4px 0 0; padding: 18px; border-radius: 12px; border: 1.5px dashed var(--line); text-align: center; color: var(--muted); font-weight: 600; }
.rating-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px 4px; animation: rise .4s both; }
.rating-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.rating-table th, .rating-table td { border-bottom: 1px solid var(--line); padding: 12px 10px; vertical-align: middle; }
.rating-table thead th { font-size: .85rem; text-transform: none; letter-spacing: 0; color: var(--ink); font-weight: 800; white-space: nowrap; }
.rating-table thead th .tool-dot { margin-right: 6px; }
.rating-table thead th small, .rating-table tbody th small { display: block; font-weight: 500; color: var(--muted); font-size: .76rem; }
.rating-table tbody th { font-weight: 700; font-size: .93rem; color: var(--ink); min-width: 180px; text-align: left; text-transform: none; letter-spacing: 0; }
.rating-table tbody tr:hover td, .rating-table tbody tr:hover th { background: var(--green-50); }
.scale { display: flex; gap: 4px; }
.scale label { cursor: pointer; }
.scale input { position: absolute; opacity: 0; pointer-events: none; }
.scale span {
    display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
    border: 1.5px solid var(--line); background: #fff; font-weight: 800; font-size: .9rem; color: var(--ink-2);
    transition: all .15s;
}
.scale label:hover span { border-color: var(--green-600); color: var(--green-700); transform: translateY(-1px); }
.scale input:checked + span { background: var(--green-600); border-color: var(--green-600); color: #fff; transform: scale(1.06); box-shadow: 0 6px 14px -6px rgba(31,122,77,.8); }
.scale input:focus-visible + span { outline: 3px solid var(--gold-light); outline-offset: 2px; }

.avg-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.avg-table th { white-space: nowrap; }
.avg-table .tool-dot { margin-right: 6px; }
.avg-table td:not(:first-child), .avg-table th:not(:first-child) { text-align: center; font-variant-numeric: tabular-nums; }
.avg-total td { font-weight: 800; background: var(--green-50); }
.avg-n td { color: var(--muted); font-size: .82rem; }

@media (max-width: 720px) {
    .case-steps { grid-template-columns: 1fr; }
    .case-notice { margin-left: 0; }
    .scale span { width: 30px; height: 30px; }
    .rating-table tbody th { min-width: 140px; }
}

/* ----- Notas crudas (Práctica 2) ----- */
.case-notes {
    position: relative; padding: 18px 20px 18px 56px; border-radius: 14px;
    background:
        linear-gradient(90deg, transparent 40px, rgba(200, 16, 46, .35) 40px, rgba(200, 16, 46, .35) 42px, transparent 42px),
        repeating-linear-gradient(#fffdf4, #fffdf4 33px, #e3eaf3 33px, #e3eaf3 34px);
    border: 1px solid #efe6c8; box-shadow: inset 0 1px 0 #fff, 0 10px 24px -18px rgba(90, 70, 0, .45);
}
.notes-title {
    margin: -4px 0 8px; font-weight: 800; letter-spacing: .1em; font-size: .82rem; color: var(--red);
    font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace;
}
.case-notes ul { list-style: none; margin: 0; padding: 0; }
.case-notes li {
    font-family: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: .95rem;
    line-height: 34px; color: #2a3340; white-space: normal; overflow-wrap: anywhere;
    transform: translateX(calc((var(--i) * 7 % 5) * 3px)) rotate(calc((var(--i) * 3 % 5 - 2) * .25deg));
}
.case-notes li::before { content: '›'; color: #b08a2a; margin-right: 8px; font-weight: 800; }
@media (max-width: 720px) {
    .case-notes { padding-left: 50px; }
    .case-notes li { transform: none; font-size: .88rem; }
}
