/* ============ MentorIA ============ */
@font-face { font-family: 'Atkinson Hyperlegible'; src: url(../fonts/atkinson-hyperlegible-latin-400-normal.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Atkinson Hyperlegible'; src: url(../fonts/atkinson-hyperlegible-latin-700-normal.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'OpenDyslexic'; src: url(../fonts/opendyslexic-latin-400-normal.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'OpenDyslexic'; src: url(../fonts/opendyslexic-latin-700-normal.woff2) format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --font: 'Atkinson Hyperlegible', 'Segoe UI', system-ui, sans-serif;
  --navy: #0B2A5B; --blue: #1D6FE0; --teal: #14B8A6; --yellow: #F5B83D; --violet: #7C5CE0;
  --bg: #EEF4FC; --surface: #FFFFFF; --surface-2: #F6F9FE; --sidebar: #F7FAFF;
  --text: #0E2244; --muted: #5B6B85; --line: #DCE5F2; --line-2: #E9EFF8;
  --shadow: 0 1px 2px rgba(15, 40, 90, .04), 0 6px 20px rgba(15, 40, 90, .06);
  --shadow-lg: 0 20px 60px rgba(15, 40, 90, .18);
  --p-blue: #E7F0FF; --p-blue-ink: #1D5FD0; --p-blue-strong: #CFE1FF;
  --p-green: #E1F7EF; --p-green-ink: #11896A; --p-green-strong: #C3EEDD;
  --p-violet: #EFEAFF; --p-violet-ink: #6A4BD6; --p-violet-strong: #DCD2FF;
  --p-yellow: #FFF4D9; --p-yellow-ink: #B07A0A; --p-yellow-strong: #FFE5A6;
  --p-peach: #FFEDE3; --p-peach-ink: #C2552A; --p-peach-strong: #FFD6C0;
  --p-rose: #FFE8EF; --p-rose-ink: #C23A65; --p-rose-strong: #FFCFDD;
  --p-teal: #DFF7F7; --p-teal-ink: #0C8C8C; --p-teal-strong: #BDEEEE;
  --p-indigo: #EAEBFF; --p-indigo-ink: #4C55C9; --p-indigo-strong: #D3D6FF;
  --focus: 0 0 0 3px #fff, 0 0 0 6px #1D6FE0;
  --radius: 20px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0B1322; --surface: #131E33; --surface-2: #18253D; --sidebar: #0F1A2D;
  --text: #E7EEF9; --muted: #9DAFCB; --line: #26375A; --line-2: #1E2D4A;
  --navy: #E7EEF9;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  --p-blue: #16294A; --p-blue-ink: #8DB8FF; --p-blue-strong: #1E3A66;
  --p-green: #11302A; --p-green-ink: #6BDDB4; --p-green-strong: #164338;
  --p-violet: #231E45; --p-violet-ink: #B9A6FF; --p-violet-strong: #2F2860;
  --p-yellow: #33290F; --p-yellow-ink: #F7CB68; --p-yellow-strong: #4A3A12;
  --p-peach: #36221A; --p-peach-ink: #FFAE88; --p-peach-strong: #4C2E22;
  --p-rose: #361B26; --p-rose-ink: #FF98B8; --p-rose-strong: #4D2434;
  --p-teal: #0F2F31; --p-teal-ink: #6BE0DF; --p-teal-strong: #144244;
  --p-indigo: #1D2048; --p-indigo-ink: #A9AFFF; --p-indigo-strong: #292D63;
  --focus: 0 0 0 3px #0B1322, 0 0 0 6px #8DB8FF;
  color-scheme: dark;
}
[data-font="dyslexic"] { --font: 'OpenDyslexic', 'Atkinson Hyperlegible', sans-serif; }
[data-contrast="high"] { --muted: var(--text); --line: currentColor; }
[data-contrast="high"][data-theme="light"] { --text: #000; --navy: #000; --bg: #fff; --surface-2: #fff; }
[data-contrast="high"][data-theme="dark"] { --text: #fff; --bg: #000; --surface: #000; --surface-2: #000; --sidebar: #000; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 16px; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }
[data-font="dyslexic"] body { line-height: 1.7; letter-spacing: .01em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 10px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--blue); color: #fff; padding: 8px 14px; border-radius: 10px; z-index: 100; }
.skip:focus { left: 8px; }
.ic { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
h1, h2, h3, h4 { margin: 0; color: var(--navy); line-height: 1.2; }
p { margin: 0; }
a { color: var(--blue); }
[data-theme="dark"] a { color: #8DB8FF; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 270px 1fr; min-height: 100vh; max-width: 1600px; margin: 0 auto; }
.sidebar { background: var(--sidebar); border-right: 1px solid var(--line-2); padding: 22px 18px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; flex-direction: column; align-items: center; text-decoration: none; text-align: center; margin-bottom: 28px; gap: 2px; }
.brand img { width: 84px; height: auto; }
.brand-name { font-size: 2.1rem; font-weight: 700; color: var(--navy); letter-spacing: -.02em; line-height: 1.1; }
[data-theme="light"] .brand-name { color: #0B2A5B; }
.brand-name b { background: linear-gradient(90deg, #1D6FE0, #19C3B1); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-tag { color: var(--muted); font-size: .95rem; line-height: 1.3; }
.nav { display: flex; flex-direction: column; gap: 6px; }
.nav a { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 14px; color: var(--text); text-decoration: none; font-size: 1.05rem; transition: background .15s; }
.nav a:hover { background: var(--p-blue); }
.nav a[aria-current="page"] { background: var(--p-blue-strong); color: var(--p-blue-ink); font-weight: 700; }
.nav a[aria-current="page"] .ic { stroke-width: 2.3; }
.side-quote { margin-top: auto; background: var(--p-teal); border-radius: 18px; padding: 16px; display: flex; gap: 10px; align-items: center; font-style: italic; color: var(--muted); font-size: .9rem; margin-top: 24px; }
.main-wrap { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 36px 0; gap: 12px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.top-status { font-size: .9rem; }
.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--text); }
.icon-btn:hover { background: var(--surface); border-color: var(--line); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.menu-btn { display: none; }
.teacher-chip { display: flex; align-items: center; gap: 10px; padding: 5px 14px 5px 5px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2); font-weight: 700; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; flex-shrink: 0; font-size: .95rem; }
.view { padding: 18px 36px 48px; outline: none; min-width: 0; }

/* ---------- Componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { font-size: 1.3rem; display: flex; align-items: center; gap: 10px; }
.card-head p { color: var(--muted); font-size: .95rem; margin-top: 4px; }
.link-btn { background: none; border: 0; color: var(--blue); font-weight: 700; padding: 4px; white-space: nowrap; }
[data-theme="dark"] .link-btn { color: #8DB8FF; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; color: var(--text); text-decoration: none; transition: transform .1s, background .15s; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn-primary { background: linear-gradient(135deg, #1D6FE0, #2F86F0); color: #fff; border-color: transparent; }
.btn-primary:hover { background: linear-gradient(135deg, #1860C8, #1D6FE0); }
.btn-teal { background: linear-gradient(135deg, #12A594, #19C3B1); color: #fff; border-color: transparent; }
.btn-danger { color: #C23A3A; }
.btn-sm { padding: 7px 12px; font-size: .9rem; border-radius: 10px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: .85rem; font-weight: 700; background: var(--p-blue); color: var(--p-blue-ink); white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.c-blue { --pc: var(--p-blue); --pi: var(--p-blue-ink); --ps: var(--p-blue-strong); }
.c-green { --pc: var(--p-green); --pi: var(--p-green-ink); --ps: var(--p-green-strong); }
.c-violet { --pc: var(--p-violet); --pi: var(--p-violet-ink); --ps: var(--p-violet-strong); }
.c-yellow { --pc: var(--p-yellow); --pi: var(--p-yellow-ink); --ps: var(--p-yellow-strong); }
.c-peach { --pc: var(--p-peach); --pi: var(--p-peach-ink); --ps: var(--p-peach-strong); }
.c-rose { --pc: var(--p-rose); --pi: var(--p-rose-ink); --ps: var(--p-rose-strong); }
.c-teal { --pc: var(--p-teal); --pi: var(--p-teal-ink); --ps: var(--p-teal-strong); }
.c-indigo { --pc: var(--p-indigo); --pi: var(--p-indigo-ink); --ps: var(--p-indigo-strong); }
.chip[class*="c-"] { background: var(--pc); color: var(--pi); }
.icon-tile { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--ps); color: var(--pi); flex-shrink: 0; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label, .label { font-weight: 700; font-size: .95rem; }
.field .hint { color: var(--muted); font-size: .85rem; }
.input, .select, .textarea { width: 100%; padding: 11px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); transition: border-color .15s; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(29, 111, 224, .18); }
.textarea { resize: vertical; min-height: 84px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; font-weight: 700; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--blue); box-shadow: var(--shadow); }
[data-theme="dark"] .seg button[aria-pressed="true"] { color: #8DB8FF; background: var(--p-blue); }

/* Interruptor */
.switch { position: relative; width: 54px; height: 30px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #CBD5E3; transition: background .2s; }
[data-theme="dark"] .switch span { background: #33476B; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + span { background: var(--sw, #3BA3F0); }
.switch input:checked + span::after { transform: translateX(24px); }
.switch input:focus-visible + span { box-shadow: var(--focus); }

/* ---------- Inicio ---------- */
.hero { position: relative; display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: center; margin-bottom: 22px; }
.hero h1 { font-size: clamp(2rem, 3.4vw, 2.9rem); letter-spacing: -.02em; }
.hero > div > p { font-size: 1.2rem; color: var(--muted); margin: 8px 0 22px; }
.searchbar { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 18px; padding: 8px 8px 8px 20px; box-shadow: var(--shadow); max-width: 760px; }
.searchbar input { flex: 1; border: 0; background: transparent; font-size: 1.1rem; padding: 10px 0; min-width: 0; }
.searchbar input:focus { outline: none; }
.searchbar:focus-within { border-color: var(--blue); }
.searchbar .go { width: 52px; height: 48px; border-radius: 14px; border: 0; background: linear-gradient(135deg, #4F7DF5, #1D6FE0); color: #fff; display: grid; place-items: center; }
.hero-art { position: relative; height: 230px; }
.hero-art .blob { position: absolute; inset: 0; background: radial-gradient(circle at 60% 50%, var(--p-violet-strong), transparent 70%), radial-gradient(circle at 30% 70%, var(--p-blue-strong), transparent 60%); border-radius: 50% 40% 50% 45%; opacity: .9; }
.hero-art svg { position: absolute; left: 0; bottom: 0; height: 92%; }
.hero-art .note { position: absolute; right: -6px; top: 34px; font-size: .95rem !important; font-family: 'Segoe Print', 'Bradley Hand', 'Comic Sans MS', cursive; color: var(--text); font-size: 1.05rem; line-height: 1.5; transform: rotate(-8deg); text-align: center; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.qcard { position: relative; border-radius: var(--radius); padding: 22px 20px 58px; background: var(--pc); border: 0; text-align: left; display: flex; flex-direction: column; gap: 10px; transition: transform .15s, box-shadow .15s; color: var(--text); }
.qcard:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.qcard h3 { font-size: 1.3rem; }
.qcard p { color: var(--muted); font-size: .98rem; }
.qcard .go { position: absolute; right: 16px; bottom: 16px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--ps); color: var(--pi); }
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.toggle-card { display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.toggle-card .icon-tile { width: 44px; height: 44px; border-radius: 12px; }
.toggle-card .grow { font-weight: 700; }
.toggle-card small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; line-height: 1.3; }
.prow { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 16px; margin-bottom: 10px; background: var(--surface); width: 100%; text-align: left; }
.prow:hover { border-color: var(--blue); }
.prow .name { font-weight: 700; min-width: 70px; }
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.res-card { display: flex; gap: 14px; border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: var(--surface); text-align: left; position: relative; width: 100%; }
.res-card:hover { border-color: var(--blue); box-shadow: var(--shadow); }
.res-card .icon-tile { width: 62px; height: 62px; }
.res-card h4 { font-size: 1rem; margin-bottom: 2px; }
.res-card .sub { font-size: .88rem; color: var(--muted); margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.res-card .date { font-size: .82rem; color: var(--muted); margin-top: 6px; }
.empty { text-align: center; padding: 28px 16px; color: var(--muted); border: 2px dashed var(--line); border-radius: 16px; }
.empty .ic { margin-bottom: 6px; }

/* ---------- Estudio ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 2rem; }
.page-head p { color: var(--muted); margin-top: 4px; font-size: 1.05rem; }
.studio { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.step { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--p-blue-strong); color: var(--p-blue-ink); font-weight: 700; font-size: .95rem; }
.drop { display: block; border: 2px dashed var(--line); border-radius: 16px; padding: 22px; text-align: center; transition: background .15s, border-color .15s; cursor: pointer; background: var(--surface-2); }
.drop:hover, .drop.over { border-color: var(--blue); background: var(--p-blue); }
.drop strong { display: block; margin-top: 6px; }
.drop span { color: var(--muted); font-size: .9rem; }
.src-tabs { display: flex; gap: 6px; margin: 14px 0 10px; }
.src-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.src { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.src input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--blue); }
.src .meta { font-size: .8rem; color: var(--muted); }
.src .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src.err { border-color: #E9A3A3; background: var(--p-rose); }
.needs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.need { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); text-align: left; font-weight: 700; transition: all .15s; }
.need .icon-tile { width: 36px; height: 36px; border-radius: 10px; }
.need .ic { width: 20px; height: 20px; }
.need[aria-pressed="true"] { border-color: var(--pi); background: var(--pc); color: var(--pi); }
.need .tick { margin-left: auto; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; }
.need[aria-pressed="true"] .tick { background: var(--pi); border-color: var(--pi); color: var(--surface); }
.out-groups { display: grid; gap: 18px; }
.out-group h3 { font-size: 1rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.outs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.out { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 18px; border: 1.5px solid transparent; background: var(--pc); text-align: left; transition: transform .15s, border-color .15s; position: relative; }
.out:hover { transform: translateY(-2px); border-color: var(--pi); }
.out .icon-tile { width: 46px; height: 46px; border-radius: 14px; }
.out strong { font-size: 1.05rem; color: var(--text); }
.out span { font-size: .88rem; color: var(--muted); line-height: 1.35; }
.out .fmt { position: absolute; right: 12px; top: 12px; font-size: .72rem; font-weight: 700; letter-spacing: .05em; color: var(--pi); background: var(--surface); border-radius: 8px; padding: 2px 7px; }
.out[disabled] { opacity: .6; }
.summary-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 16px; font-size: .95rem; }

/* ---------- Resultado ---------- */
.result { margin-top: 16px; scroll-margin-top: 16px; }
.result-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding-bottom: 14px; border-bottom: 1px solid var(--line-2); margin-bottom: 18px; }
.result-toolbar .row { gap: 8px; }
.loading { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 40px 10px; text-align: center; }
.spinner { width: 54px; height: 54px; border-radius: 50%; border: 5px solid var(--p-blue-strong); border-top-color: var(--blue); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.doc { max-width: 860px; margin: 0 auto; font-size: 1.08rem; }
.doc h2.title { font-size: 1.9rem; margin-bottom: 6px; }
.doc h3 { font-size: 1.3rem; margin: 22px 0 10px; color: var(--blue); }
[data-theme="dark"] .doc h3 { color: #8DB8FF; }
.doc p { margin-bottom: 10px; }
.doc ul, .doc ol { padding-left: 1.4em; margin: 0 0 12px; }
.doc li { margin-bottom: 6px; }
.callout { border-radius: 16px; padding: 14px 18px; margin: 14px 0; background: var(--pc, var(--p-blue)); }
.callout b { color: var(--navy); }
.key-ideas { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 10px 0 6px; }
.key-idea { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; font-weight: 700; }
.emoji { font-size: 1.6em; line-height: 1; }
.q { border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; margin-bottom: 12px; }
.q .opts { display: grid; gap: 8px; margin-top: 10px; }
.q .opt { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); text-align: left; }
.q .opt.ok { border-color: #22A77B; background: var(--p-green); }
.q .opt.bad { border-color: #D45B5B; background: var(--p-rose); }
.q .expl { margin-top: 10px; padding: 10px 14px; border-radius: 12px; background: var(--p-yellow); white-space: pre-line; }
.steps-list { list-style: none; padding: 0 !important; counter-reset: s; }
.steps-list li { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: 16px; margin-bottom: 10px !important; }
.steps-list .num { width: 40px; height: 40px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.steps-list .picto { font-size: 2.2rem; line-height: 1; }
.level { border-radius: 18px; padding: 16px 18px; margin-bottom: 14px; background: var(--pc); }
.level h3 { margin-top: 0 !important; color: var(--pi) !important; }
.act { background: var(--surface); border-radius: 14px; padding: 14px 16px; margin-top: 10px; }
details.sol { margin-top: 8px; }
details.sol summary { cursor: pointer; font-weight: 700; color: var(--teal); }
details.sol div { white-space: pre-line; padding: 8px 0 0; }
.gloss { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.gloss .term { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.gloss .term h4 { font-size: 1.15rem; display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.rubric { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; font-size: .95rem; }
.rubric th, .rubric td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.rubric th { background: var(--surface-2); }
.canvas-wrap { background: var(--surface-2); border-radius: 16px; padding: 12px; border: 1px solid var(--line); }
.canvas-wrap canvas, .canvas-wrap img { width: 100%; height: auto; display: block; border-radius: 10px; }
.notes { margin-top: 22px; border-radius: 16px; padding: 14px 18px; background: var(--p-violet); }
.notes h4 { display: flex; align-items: center; gap: 8px; color: var(--p-violet-ink); margin-bottom: 6px; }
.notes ul { margin: 0; }
.warn { display: flex; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--p-yellow); color: var(--text); margin-bottom: 12px; font-size: .95rem; }
.audio-box { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 16px; background: var(--p-violet); margin: 12px 0; }
.audio-box audio { width: 100%; }
.refine { display: flex; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }

/* Chat */
.chat { display: flex; flex-direction: column; gap: 12px; max-height: 520px; overflow-y: auto; padding: 4px; }
.msg { max-width: 82%; padding: 12px 16px; border-radius: 18px; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 6px; }
.msg.assistant { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.chat-input { display: flex; gap: 8px; margin-top: 12px; }
.suggest { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.suggest button { border: 1px solid var(--line); background: var(--surface); padding: 6px 12px; border-radius: 999px; font-size: .88rem; }

/* Perfiles */
.profiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.pcard { display: flex; flex-direction: column; gap: 12px; }
.pcard-top { display: flex; gap: 12px; align-items: center; }
.pcard-top h3 { font-size: 1.2rem; }
.track { border-left: 3px solid var(--teal); padding: 4px 0 4px 12px; margin-bottom: 8px; font-size: .92rem; }
.track time { color: var(--muted); font-size: .8rem; display: block; }

/* Informes */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stat { display: flex; gap: 14px; align-items: center; }
.stat b { font-size: 1.9rem; display: block; line-height: 1; color: var(--navy); }
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar { display: grid; grid-template-columns: 170px 1fr 36px; gap: 10px; align-items: center; font-size: .92rem; }
.bar .track-b { height: 14px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line-2); }
.bar .fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #1D6FE0, #19C3B1); }

/* Configuración */
.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.key-row { display: flex; gap: 8px; }
.key-row .input { font-family: ui-monospace, Consolas, monospace; }
.provider { display: flex; gap: 10px; flex-wrap: wrap; }
.provider label { flex: 1; min-width: 170px; display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer; }
.provider input { margin-top: 4px; accent-color: var(--blue); width: 18px; height: 18px; }
.provider label:has(input:checked) { border-color: var(--blue); background: var(--p-blue); }
.provider small { display: block; color: var(--muted); font-size: .85rem; }
.ok-badge { color: #11896A; font-weight: 700; font-size: .85rem; display: inline-flex; gap: 4px; align-items: center; }
[data-theme="dark"] .ok-badge { color: #6BDDB4; }
.privacy { display: flex; gap: 12px; background: var(--p-green); border-radius: 16px; padding: 14px 16px; font-size: .92rem; }

/* Modal y avisos */
.modal-backdrop { position: fixed; inset: 0; background: rgba(8, 20, 45, .55); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--surface); border-radius: 22px; width: min(980px, 100%); max-height: 92vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.modal-head h2 { font-size: 1.3rem; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal.sm { width: min(560px, 100%); }
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 60; }
.toast { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--blue); border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow-lg); max-width: 420px; animation: pop .25s ease-out; }
.toast.error { border-left-color: #D45B5B; }
.toast.ok { border-left-color: #22A77B; }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } }
.banner { display: flex; gap: 12px; align-items: center; padding: 12px 16px; background: var(--p-yellow); border-radius: 14px; margin-bottom: 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) { .quick { grid-template-columns: repeat(2, 1fr); } .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 1100px) { .hero { grid-template-columns: 1fr; } .hero-art { display: none; } .home-grid, .studio, .settings { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 40; width: 280px; transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .menu-btn { display: grid; }
  .view, .topbar { padding-left: 16px; padding-right: 16px; }
  .quick, .toggles, .needs { grid-template-columns: 1fr; }
  .teacher-chip, .top-status { display: none; }
  .bar { grid-template-columns: 110px 1fr 30px; }
}
@media print {
  .sidebar, .topbar, .result-toolbar, .refine, .notes { display: none !important; }
  .app { display: block; } .card { box-shadow: none; border: 0; }
}

/* ---------- Cuentas de usuario (v2) ---------- */
.teacher-chip { position: relative; padding: 0; border: 0; background: none; }
.user-btn { display: flex; align-items: center; gap: 10px; padding: 5px 12px 5px 5px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2); font-weight: 700; color: var(--text); }
.user-btn:hover { border-color: var(--blue); }
.user-btn .chev { transform: rotate(90deg); color: var(--muted); }
.user-btn[aria-expanded="true"] .chev { transform: rotate(-90deg); }
.user-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 280px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 8px; z-index: 45; }
.user-menu .um-head { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; border-bottom: 1px solid var(--line-2); margin-bottom: 6px; }
.user-menu .um-head span { color: var(--muted); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; }
.user-menu .um-head .chip { align-self: flex-start; margin-top: 6px; color: var(--pi); }
.user-menu a, .user-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 10px; border: 0; background: none; color: var(--text); text-decoration: none; text-align: left; font-weight: 700; }
.user-menu a:hover, .user-menu button:hover, .user-menu a:focus-visible, .user-menu button:focus-visible { background: var(--p-blue); }
.user-menu #logoutBtn { color: #C23A3A; }
[data-theme="dark"] .user-menu #logoutBtn { color: #FF8F8F; }
.status-list { display: grid; gap: 8px; margin-bottom: 18px; }
.status-row { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 12px; font-weight: 700; }
.status-row.ok { background: var(--p-green); color: var(--p-green-ink); }
.status-row.no { background: var(--surface-2); color: var(--muted); border: 1px dashed var(--line); }
.cred { display: grid; gap: 8px; margin: 14px 0; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.cred div { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cred span { color: var(--muted); }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 1.1rem; letter-spacing: .04em; user-select: all; }
.utable { width: 100%; border-collapse: collapse; font-size: .95rem; }
.utable th, .utable td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: middle; }
.utable td:first-child, .utable td:last-child, .utable th { white-space: nowrap; }
.utable th { background: var(--surface-2); font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.utable tr:last-child td { border-bottom: 0; }
.utable tr.off td { opacity: .6; }
.utable .num { text-align: right; }
.utable .actions .icon-btn { width: 36px; height: 36px; }
.icon-btn.danger { color: #C23A3A; }
[data-theme="dark"] .icon-btn.danger { color: #FF8F8F; }
.small { font-size: .85rem; }
.tabs button { display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 860px) { .teacher-chip { display: block !important; } .user-btn > span:not(.avatar) { display: none; } .user-menu { width: min(280px, calc(100vw - 32px)); } }

/* ---------- v2.1: pictogramas, editor, banco, corrección, comunicados ---------- */
.picto-slot { display: inline-grid; place-items: center; line-height: 1; }
.picto-slot.has-img img { width: 100%; height: 100%; object-fit: contain; background: #fff; border-radius: 10px; }
.steps-list .picto .picto-slot.has-img { width: 76px; height: 76px; }
.key-idea .picto-slot.has-img { width: 48px; height: 48px; flex-shrink: 0; }
.lf-head { display: flex; align-items: center; gap: 12px; }
.picto-slot.lf.has-img { width: 72px; height: 72px; }
.picto-slot.gl.has-img { width: 52px; height: 52px; }
.picto-attr { font-size: .78rem; color: var(--muted); margin-top: 12px; }
.btn.is-on { background: var(--p-violet); color: var(--p-violet-ink); border-color: transparent; }
.bank-by { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--p-violet); margin-bottom: 14px; font-size: .95rem; }
.editor { max-width: 900px; margin: 0 auto; }
.ed-bar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; margin-bottom: 16px; border-radius: 14px; background: var(--p-yellow); box-shadow: var(--shadow); }
.ed-group { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 14px; margin: 0 0 14px; }
.ed-group legend { font-weight: 700; padding: 0 6px; color: var(--blue); }
[data-theme="dark"] .ed-group legend { color: #8DB8FF; }
.ed-item { display: flex; gap: 8px; align-items: flex-start; padding: 10px; border-radius: 12px; background: var(--surface-2); margin-bottom: 8px; }
.ed-item-body { flex: 1; min-width: 0; }
.ed-item-body > .field { margin-bottom: 0; }
.ed-item .ed-obj .field:last-child { margin-bottom: 0; }
.ed-check { display: flex; gap: 8px; align-items: center; font-weight: 400; margin: 4px 0; cursor: pointer; }
.ed-check input { width: 18px; height: 18px; accent-color: var(--blue); }
.lang-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px 10px; }
.score { display: flex; gap: 18px; align-items: center; padding: 16px 18px; border-radius: 16px; background: var(--p-teal); margin: 8px 0 14px; }
.score-num { display: flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.score-num b { font-size: 2.6rem; color: var(--navy); line-height: 1; }
.score-num span { color: var(--muted); font-weight: 700; }
.com-lang { padding: 18px 0; border-bottom: 2px dashed var(--line); }
.com-lang:last-of-type { border-bottom: 0; }
.com-lang[dir="rtl"] { text-align: right; }
.cut { margin-top: 14px; padding-top: 14px; border-top: 2px dashed var(--muted); }
.aci-data div { justify-content: flex-start; }
.aci-data span { min-width: 170px; }
@media (max-width: 860px) { .lang-grid { grid-template-columns: repeat(2, 1fr); } .score { flex-direction: column; align-items: flex-start; } }
