
/* AXIOM · sistema visual
   Azul petróleo oscuro #173E49 · Verde azulado #438B91 · Verde azulado claro #D6E8E7
   Blanco cálido #F6FAFA · Champagne #C5A58A */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --petrol: #173E49; --teal: #438B91; --teal-light: #D6E8E7; --warm-white: #F6FAFA; --champagne: #C5A58A;

  --bg: #F6FAFA;
  --bg-grad: radial-gradient(1100px 560px at 100% -10%, #E3F0EF 0%, rgba(227,240,239,0) 62%), radial-gradient(700px 420px at -10% 110%, #F3ECE5 0%, rgba(243,236,229,0) 60%), #F6FAFA;
  --surface: #FFFFFF;
  --surface-2: #EEF5F5;
  --surface-3: #E2EDED;
  --glass: rgba(255,255,255,.80);
  --text: #12313A;
  --text-2: #4A6870;
  --text-3: #849DA2;
  --line: rgba(23,62,73,.08);
  --line-2: rgba(23,62,73,.15);
  --primary: #173E49;
  --primary-hover: #10313A;
  --primary-text: #FFFFFF;
  --accent: #438B91;
  --accent-hover: #367A80;
  --accent-text: #FFFFFF;
  --accent-soft: #D6E8E7;
  --accent-ink: #2C6A70;
  --gold: #C5A58A;
  --gold-ink: #8E6E52;
  --gold-soft: #F3EAE1;
  --night: #173E49;
  --danger: #B4534A;
  --danger-soft: #F6E6E3;
  --ok: #3E8467;
  --warn: #A67C3E;
  --ring-track: rgba(23,62,73,.08);
  --shadow-1: 0 1px 2px rgba(23,62,73,.04), 0 3px 10px rgba(23,62,73,.045);
  --shadow-2: 0 3px 8px rgba(23,62,73,.05), 0 14px 36px rgba(23,62,73,.09);
  --shadow-3: 0 24px 64px rgba(23,62,73,.20);
  --hero: linear-gradient(140deg, #173E49 0%, #22555F 52%, #438B91 100%);
  --r-s: 10px; --r-m: 14px; --r-l: 20px; --r-xl: 26px;
  --ease: cubic-bezier(.2,.8,.2,1);
  --nav-h: 64px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0A1B21;
  --bg-grad: radial-gradient(1000px 520px at 100% -10%, #12333B 0%, rgba(18,51,59,0) 60%), #0A1B21;
  --surface: #0F262D;
  --surface-2: #143039;
  --surface-3: #1B3B45;
  --glass: rgba(12,32,38,.82);
  --text: #E8F2F2;
  --text-2: #A6C1C3;
  --text-3: #6D8C90;
  --line: rgba(232,242,242,.07);
  --line-2: rgba(232,242,242,.13);
  --primary: #6FB0B5;
  --primary-hover: #82BEC2;
  --primary-text: #06191E;
  --accent: #6FB0B5;
  --accent-hover: #82BEC2;
  --accent-text: #06191E;
  --accent-soft: rgba(67,139,145,.20);
  --accent-ink: #9FD1D4;
  --gold: #D8BEA6;
  --gold-ink: #E2C9B2;
  --gold-soft: rgba(197,165,138,.14);
  --danger: #E3877C;
  --danger-soft: rgba(227,135,124,.13);
  --ok: #7FC2A3;
  --warn: #DDB572;
  --ring-track: rgba(232,242,242,.09);
  --shadow-1: 0 1px 2px rgba(0,0,0,.25);
  --shadow-2: 0 2px 8px rgba(0,0,0,.25), 0 16px 40px rgba(0,0,0,.28);
  --shadow-3: 0 24px 64px rgba(0,0,0,.55);
  --hero: linear-gradient(140deg, #0F2A32 0%, #173E49 55%, #2F6F75 100%);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; min-height: 100%;
  font-family: var(--font); font-size: 16px; line-height: 1.5;
  color: var(--text); background: var(--bg-grad); background-attachment: fixed;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--accent-ink); }
.icw { display: inline-flex; line-height: 0; }
.ic { flex: none; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
::selection { background: var(--accent-soft); }

/* ---------- pantalla de carga ---------- */
#splash {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: #F6FAFA; transition: opacity .5s var(--ease), visibility .5s;
}
#splash.out { opacity: 0; visibility: hidden; }
#splash .mark { width: 132px; height: 132px; border-radius: 30px; box-shadow: 0 18px 50px rgba(23,62,73,.18); animation: rise .9s var(--ease) both; }
#splash .word { margin-top: 18px; font-family: var(--font-display); font-size: 26px; letter-spacing: .02em; color: #173E49; text-align: center; animation: rise .9s .12s var(--ease) both; }
#splash .sub { margin-top: 4px; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: #C5A58A; text-align: center; animation: rise .9s .2s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- estructura ---------- */
.app { min-height: 100vh; display: flex; }
.sidebar { display: none; }
.main { flex: 1; min-width: 0; padding: calc(var(--safe-t) + 8px) calc(20px + var(--safe-r)) calc(var(--nav-h) + var(--safe-b) + 32px) calc(20px + var(--safe-l)); }
.page { max-width: 1040px; margin: 0 auto; animation: pageIn .35s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* barra inferior (celular) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 6px calc(8px + var(--safe-r)) calc(6px + var(--safe-b)) calc(8px + var(--safe-l));
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--line);
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 2px; color: var(--text-3); font-size: 10.5px; font-weight: 500; letter-spacing: .01em; border-radius: 12px; transition: color .2s; }
.tab.active { color: var(--accent); }
.tab .ic { width: 25px; height: 25px; }
.tab:active { transform: scale(.94); }

@media (min-width: 960px) {
  .tabbar { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; width: 252px; flex: none;
    padding: 28px 16px 20px; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 55%, transparent);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  }
  .brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 22px; }
  .brand img { width: 36px; height: 36px; border-radius: 10px; }
  .brand b { font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: .01em; }
  .side-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--text-2); font-weight: 500; font-size: 15px; transition: background .2s, color .2s; text-decoration: none; }
  .side-link:hover { background: var(--surface-2); color: var(--text); }
  .side-link.active { background: var(--accent-soft); color: var(--accent-ink); }
  .side-sep { height: 1px; background: var(--line); margin: 12px 10px; }
  .side-foot { margin-top: auto; padding: 12px; font-size: 12px; color: var(--text-3); }
  .main { padding: 40px 48px 64px; }
}

/* ---------- encabezados ---------- */
.topbar { display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 0 -6px 2px; }
.topbar .spacer { flex: 1; }
.back { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-size: 16px; padding: 6px; border-radius: 10px; max-width: 70%; }
.back span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 50%; color: var(--text-2); transition: background .2s, transform .15s; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.accent { color: var(--accent); }
.icon-btn.filled { background: var(--accent); color: var(--accent-text); }

.eyebrow { font-size: 12.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); margin: 6px 0 4px; }
.title { font-family: var(--font-display); font-weight: 600; font-size: 34px; line-height: 1.12; letter-spacing: -.01em; margin: 0 0 6px; }
.title.sm { font-size: 28px; }
.subtitle { color: var(--text-2); margin: 0 0 22px; font-size: 15.5px; }
.section { margin: 30px 0 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section h2 { font-size: 19px; font-weight: 650; letter-spacing: -.01em; margin: 0; }
.section .link { color: var(--accent); font-size: 15px; font-weight: 500; }
@media (min-width: 960px) { .title { font-size: 40px; } }

/* ---------- tarjetas ---------- */
.card { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow-1); border: 1px solid var(--line); }
.card.pad { padding: 18px; }
.card.hover { transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.card.hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.card.press:active { transform: scale(.985); }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: 1fr; }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
@media (min-width: 700px) { .grid.two { grid-template-columns: 1fr 1fr; } }

/* tarjeta héroe del período */
.hero {
  position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 22px; color: #EAF3F5;
  background: var(--hero);
  box-shadow: 0 18px 44px rgba(23,62,73,.24);
}
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(circle, rgba(214,232,231,.22), rgba(214,232,231,0) 70%); }
.hero .k { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--champagne); }
.hero h3 { font-family: var(--font-display); font-weight: 600; font-size: 24px; margin: 6px 0 2px; }
.hero p { margin: 0; color: #A9C3CB; font-size: 14px; }
.hero .row { display: flex; align-items: center; justify-content: space-between; gap: 16px; position: relative; z-index: 1; }
.hero .ring { color: #9FD6DF; }
.hero .ring span { color: #EAF3F5; }
.hero-stats { display: flex; gap: 22px; margin-top: 18px; position: relative; z-index: 1; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats b { font-size: 20px; font-weight: 600; }
.hero-stats small { font-size: 12px; color: #8FB0BA; }

.ring { position: relative; display: inline-grid; place-items: center; color: var(--accent); flex: none; }
.ring svg { position: absolute; inset: 0; }
.ring svg circle:last-child { transition: stroke-dashoffset .8s var(--ease); }
.ring span { font-size: 11.5px; font-weight: 650; color: var(--text); }

/* tarjeta de materia */
.subject { display: flex; flex-direction: column; gap: 14px; padding: 18px; text-decoration: none; color: inherit; position: relative; overflow: hidden; }
.subject .s-top { display: flex; align-items: center; gap: 12px; }
.s-ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: #fff; flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.subject h4 { margin: 0; font-size: 16.5px; font-weight: 600; line-height: 1.3; }
.subject .meta { font-size: 13px; color: var(--text-3); }
.bar { height: 5px; border-radius: 3px; background: var(--ring-track); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 3px; background: currentColor; transition: width .8s var(--ease); }

/* accesos rápidos */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.q { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 4px 12px; border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); font-size: 12.5px; font-weight: 500; color: var(--text-2); text-align: center; transition: transform .2s var(--ease); }
.q .qi { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.q:active { transform: scale(.95); }
@media (min-width: 700px) { .quick { grid-template-columns: repeat(4, minmax(0, 160px)); } }

/* mini estadísticas */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { padding: 14px; }
.stat .v { font-size: 22px; font-weight: 650; letter-spacing: -.01em; display: flex; align-items: center; gap: 6px; }
.stat .l { font-size: 12.5px; color: var(--text-3); }
.stat .v .ic { color: var(--accent); }

/* listas */
.list { background: var(--surface); border-radius: var(--r-l); border: 1px solid var(--line); box-shadow: var(--shadow-1); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; min-height: 56px; text-decoration: none; color: inherit; width: 100%; text-align: left; position: relative; }
.list .row + .row::before { content: ""; position: absolute; top: 0; left: 60px; right: 0; height: 1px; background: var(--line); }
.list.plain .row + .row::before { left: 16px; }
button.row:hover, a.row:hover { background: var(--surface-2); }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 550; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.row .d { font-size: 13px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .chev { color: var(--text-3); }
.row-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: none; }
.row-ic.accent { background: var(--accent-soft); color: var(--accent-ink); }
.row-ic.exam { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge.accent { background: var(--accent-soft); color: var(--accent-ink); }
.badge.warn { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }

/* botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 14px; font-weight: 600; font-size: 15.5px; transition: background .2s, transform .15s, opacity .2s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--primary); color: var(--primary-text); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.ghost { background: var(--surface-2); color: var(--text); }
.btn.ghost:hover { background: var(--surface-3); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.soft { background: var(--accent-soft); color: var(--accent-ink); }
.btn.sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 11px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.fab { position: fixed; right: calc(20px + var(--safe-r)); bottom: calc(var(--nav-h) + var(--safe-b) + 18px); z-index: 25; width: 56px; height: 56px; border-radius: 18px; background: var(--primary); color: var(--primary-text); display: grid; place-items: center; box-shadow: 0 10px 28px rgba(23,62,73,.32); transition: transform .2s var(--ease); }
.fab:active { transform: scale(.92); }
@media (min-width: 960px) { .fab { bottom: 32px; right: 40px; } }

/* chips / filtros */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; margin: 0 -20px 10px; padding-left: 20px; padding-right: 20px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text-2); font-size: 14px; font-weight: 500; transition: all .2s; }
.chip.on { background: var(--text); color: var(--bg); border-color: transparent; }
@media (min-width: 960px) { .chips { margin: 0 0 10px; padding-left: 0; padding-right: 0; flex-wrap: wrap; } }

/* buscador */
.searchbox { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); color: var(--text-3); margin-bottom: 14px; }
.searchbox input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 16px; color: var(--text); min-width: 0; }
.searchbox input::placeholder { color: var(--text-3); }
mark { background: color-mix(in srgb, var(--accent) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

/* formularios */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.hint { color: var(--text-3); font-size: 12.5px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=url], input[type=search], input:not([type]), select, textarea {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 13px; border: 1px solid var(--line-2); background: var(--surface); font-size: 16px; outline: none; transition: border-color .2s, box-shadow .2s; -webkit-appearance: none; appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
textarea { height: auto; padding: 12px 14px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.invalid { border-color: var(--danger) !important; }
.check-row { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.check-row input { width: 20px; height: 20px; accent-color: var(--accent); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 34px; height: 34px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); transition: transform .15s; }
.swatch.sel { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--text); }
.icon-pick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.ip { height: 44px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; color: var(--text-2); }
.ip.sel { background: var(--accent); color: var(--accent-text); }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface-2); gap: 2px; }
.seg button { height: 34px; padding: 0 14px; border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

/* hoja inferior */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(6,14,24,.38); opacity: 0; transition: opacity .28s var(--ease); pointer-events: auto; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; display: flex; flex-direction: column; background: var(--surface); border-radius: 24px 24px 0 0; box-shadow: var(--shadow-3); transform: translateY(100%); transition: transform .32s var(--ease); pointer-events: auto; padding-bottom: var(--safe-b); }
.sheet-wrap.in .sheet-backdrop { opacity: 1; }
.sheet-wrap.in .sheet { transform: none; }
.sheet-grab { width: 38px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 8px auto 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px 4px 22px; }
.sheet-head h3 { margin: 0; font-size: 18px; font-weight: 650; }
.sheet-body { padding: 8px 22px 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet-actions { display: flex; gap: 10px; padding: 10px 22px 16px; border-top: 1px solid var(--line); }
.sheet-actions .btn { flex: 1; }
@media (min-width: 700px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 520px; max-height: 84vh; border-radius: 24px; transform: translate(-50%, -46%) scale(.98); opacity: 0; transition: transform .28s var(--ease), opacity .28s; }
  .sheet.wide { width: 720px; }
  .sheet-wrap.in .sheet { transform: translate(-50%, -50%); opacity: 1; }
  .sheet-grab { display: none; }
}
.menu-list { display: flex; flex-direction: column; margin: 0 -10px; }
.menu-item { display: flex; align-items: center; gap: 14px; padding: 13px 12px; border-radius: 12px; font-size: 16px; text-align: left; }
.menu-item:hover { background: var(--surface-2); }
.menu-item .ic { color: var(--text-2); }
.menu-item.danger, .menu-item.danger .ic { color: var(--danger); }

/* avisos */
#toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b) + 14px); z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 14px; max-width: 520px; padding: 12px 16px; border-radius: 14px; background: #173E49; color: #EEF3F7; font-size: 14.5px; box-shadow: var(--shadow-3); opacity: 0; transform: translateY(10px); transition: all .3s var(--ease); }
.toast.in { opacity: 1; transform: none; }
.toast-act { color: #D6E8E7; font-weight: 600; }
@media (min-width: 960px) { #toasts { bottom: 28px; } }

/* vacío */
.empty { text-align: center; padding: 36px 20px; color: var(--text-2); }
.empty-ic { width: 60px; height: 60px; border-radius: 18px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; margin: 0 auto 12px; }
.empty h4 { margin: 0 0 4px; font-size: 17px; color: var(--text); }
.empty p { margin: 0 auto 16px; max-width: 360px; font-size: 14.5px; }

/* ---------- materia / unidades / temas ---------- */
.subject-head { display: flex; align-items: center; gap: 16px; margin: 4px 0 18px; }
.subject-head .s-ic { width: 60px; height: 60px; border-radius: 18px; }
.unit { margin-bottom: 12px; }
.unit-head { display: flex; align-items: center; gap: 12px; padding: 14px 12px 14px 16px; width: 100%; text-align: left; }
.unit-head .num { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--surface-2); color: var(--text-2); flex: none; }
.unit-head h4 { margin: 0; font-size: 16px; font-weight: 600; }
.unit-head .tw { transition: transform .25s var(--ease); color: var(--text-3); }
.unit.closed .unit-head .tw { transform: rotate(-90deg); }
.unit.closed .unit-body { display: none; }
.unit-body { border-top: 1px solid var(--line); }
.topic-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; min-height: 50px; }
.topic-row + .topic-row { border-top: 1px solid var(--line); }
.topic-row.sub { padding-left: 44px; }
.topic-row a { flex: 1; min-width: 0; color: inherit; text-decoration: none; font-size: 15px; }
.status-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--text-3); flex: none; }
.status-btn.studying { color: var(--warn); }
.status-btn.mastered { color: var(--ok); }
.add-inline { display: flex; align-items: center; gap: 8px; padding: 12px 16px; color: var(--accent); font-weight: 500; font-size: 15px; width: 100%; border-top: 1px solid var(--line); }

/* estado de un tema */
.status-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 6px; }
.status-seg button { display: flex; align-items: center; justify-content: center; gap: 6px; height: 42px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--text-2); font-size: 14px; font-weight: 550; }
.status-seg button.on.pending { background: var(--surface-3); color: var(--text); }
.status-seg button.on.studying { background: color-mix(in srgb, var(--warn) 15%, var(--surface)); color: var(--warn); border-color: transparent; }
.status-seg button.on.mastered { background: color-mix(in srgb, var(--ok) 15%, var(--surface)); color: var(--ok); border-color: transparent; }

/* ---------- biblioteca ---------- */
.mat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 700px) { .mat-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }
.mat { display: flex; flex-direction: column; overflow: hidden; text-decoration: none; color: inherit; text-align: left; }
.mat .thumb { aspect-ratio: 4/3; background: var(--surface-2); display: grid; place-items: center; color: var(--text-3); position: relative; overflow: hidden; }
.mat .thumb img, .mat .thumb video { width: 100%; height: 100%; object-fit: cover; }
.mat .thumb .ext { position: absolute; left: 10px; bottom: 10px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; padding: 3px 7px; border-radius: 6px; background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-1); }
.mat .thumb .fav { position: absolute; right: 8px; top: 8px; color: var(--gold); }
.mat .info { padding: 10px 12px 12px; }
.mat .info b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.mat .info small { color: var(--text-3); font-size: 12px; }
.note-thumb { padding: 14px; font-size: 11.5px; line-height: 1.45; color: var(--text-2); text-align: left; align-self: stretch; justify-self: stretch; overflow: hidden; background: linear-gradient(var(--surface-2), var(--surface-2)); }
.note-thumb::after { content: ""; }
.folder-card { display: flex; align-items: center; gap: 12px; padding: 14px; text-decoration: none; color: inherit; }
.folder-card .row-ic { background: var(--accent-soft); color: var(--accent-ink); }
.crumbs { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 13.5px; color: var(--text-3); margin: 0 0 10px; }
.crumbs a { color: var(--accent); text-decoration: none; }
.dropzone { border: 1.5px dashed var(--line-2); border-radius: var(--r-l); padding: 26px; text-align: center; color: var(--text-2); transition: all .2s; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }

/* visor */
.viewer { margin: 0 -20px; }
@media (min-width: 960px) { .viewer { margin: 0; } }
.pdf-pages { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 4px 0 20px; overflow-x: auto; }
.pdf-pages canvas, .pdf-page-ph { background: #fff; box-shadow: var(--shadow-2); border-radius: 4px; max-width: none; }
.pdf-page-ph { display: grid; place-items: center; color: #9AA4AF; font-size: 13px; }
.viewer-bar { position: sticky; top: calc(var(--safe-t) + 4px); z-index: 10; display: flex; align-items: center; gap: 6px; justify-content: center; margin: 0 auto 12px; width: max-content; padding: 4px 6px; border-radius: 14px; background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid var(--line); box-shadow: var(--shadow-1); font-size: 14px; color: var(--text-2); }
.doc-html { background: var(--surface); border-radius: var(--r-l); padding: 24px 22px; border: 1px solid var(--line); line-height: 1.65; overflow-wrap: anywhere; }
.doc-html img { max-width: 100%; height: auto; border-radius: 6px; }
.doc-html table { border-collapse: collapse; width: 100%; font-size: 14px; display: block; overflow-x: auto; }
.doc-html td, .doc-html th { border: 1px solid var(--line-2); padding: 6px 8px; }
.slide { padding: 20px; margin-bottom: 14px; }
.slide .sn { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; }
.slide p { margin: 0 0 6px; }
.slide p:first-of-type { font-weight: 650; font-size: 18px; font-family: var(--font-display); }
.slide .imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 10px; }
.slide .imgs img { width: 100%; border-radius: 8px; background: var(--surface-2); }
.media-view { width: 100%; max-height: 72vh; border-radius: var(--r-l); background: #000; display: block; }
.img-view { width: 100%; height: auto; border-radius: var(--r-l); display: block; background: var(--surface-2); }
.meta-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; }
.meta-grid dt { color: var(--text-3); }
.meta-grid dd { margin: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- editor de apuntes ---------- */
.editor-wrap { background: var(--surface); border-radius: var(--r-l); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.toolbar { position: sticky; top: calc(var(--safe-t)); z-index: 5; display: flex; gap: 2px; padding: 6px; overflow-x: auto; border-bottom: 1px solid var(--line); background: var(--surface); border-radius: var(--r-l) var(--r-l) 0 0; scrollbar-width: none; }
.toolbar::-webkit-scrollbar { display: none; }
.toolbar button { flex: none; width: 38px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: var(--text-2); }
.toolbar button:hover, .toolbar button.on { background: var(--surface-2); color: var(--text); }
.toolbar .sep { width: 1px; background: var(--line); margin: 6px 4px; flex: none; }
.note-title { width: 100%; border: 0 !important; box-shadow: none !important; background: transparent !important; font-family: var(--font-display); font-size: 26px !important; font-weight: 600; padding: 16px 20px 0 !important; height: auto !important; }
.editor { min-height: 46vh; padding: 10px 20px 28px; outline: none; font-size: 17px; line-height: 1.7; overflow-wrap: anywhere; }
.editor:empty::before { content: attr(data-placeholder); color: var(--text-3); }
.editor h2, .doc-html h2 { font-family: var(--font-display); font-size: 22px; margin: 18px 0 6px; font-weight: 600; }
.editor h3, .doc-html h3 { font-size: 18px; margin: 14px 0 4px; font-weight: 650; }
.editor blockquote, .doc-html blockquote { margin: 10px 0; padding: 8px 14px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; color: var(--text); }
.editor mark, .doc-html mark { background: color-mix(in srgb, #E2B84E 38%, transparent); }
.save-state { font-size: 12.5px; color: var(--text-3); display: inline-flex; align-items: center; gap: 4px; }

/* lector en voz alta */
.tts-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + var(--safe-b) + 12px); z-index: 35; display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 14px; border-radius: 18px; background: #173E49; color: #EEF3F7; box-shadow: var(--shadow-3); font-size: 14px; max-width: calc(100% - 24px); }
.tts-bar .icon-btn { color: #EEF3F7; width: 36px; height: 36px; }
.tts-bar .icon-btn:hover { background: rgba(255,255,255,.08); }
.tts-bar select { height: 32px; width: auto; padding: 0 28px 0 10px; border-radius: 9px; background-color: rgba(255,255,255,.08); border: 0; color: #EEF3F7; font-size: 13px; background-position: calc(100% - 14px) 14px, calc(100% - 9px) 14px; }
@media (min-width: 960px) { .tts-bar { bottom: 28px; } }

/* hoja de ruta */
.phase { display: flex; gap: 14px; padding: 16px; }
.phase .pn { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; background: var(--surface-2); color: var(--text-2); }
.phase.now .pn { background: var(--accent); color: var(--accent-text); }
.phase h4 { margin: 0 0 2px; font-size: 15.5px; }
.phase p { margin: 0; font-size: 13.5px; color: var(--text-2); }
.notice { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r-m); background: var(--accent-soft); color: var(--accent-ink); font-size: 14px; line-height: 1.45; }
.notice.warn { background: color-mix(in srgb, var(--warn) 13%, transparent); color: var(--warn); }
.notice b { color: inherit; }

/* bienvenida */
.welcome { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.welcome-card { width: 100%; max-width: 440px; text-align: center; }
.welcome-card img { width: 84px; height: 84px; border-radius: 22px; box-shadow: var(--shadow-2); }
.welcome-card h1 { font-family: var(--font-display); font-size: 34px; margin: 18px 0 6px; font-weight: 600; }
.welcome-card p { color: var(--text-2); margin: 0 0 26px; }
.welcome-card .form { text-align: left; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ajustes finos */
.tab, .back, .link, .side-link, .section a, .hero, .row, .subject, .mat, .folder-card, .q { text-decoration: none; }
.searchbox input[type=search], .searchbox input { border: 0; height: auto; padding: 0; background: transparent; box-shadow: none; border-radius: 0; }
.searchbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.searchbox input::-webkit-search-cancel-button { -webkit-appearance: none; }
.hero h3 { font-size: 23px; line-height: 1.2; }


/* ================= AXIOM 1.0 ================= */
kbd { margin-left: auto; font: 600 11px var(--font); color: var(--text-3); border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 6px; }
.brand { text-decoration: none; color: inherit; }
.brand b { letter-spacing: .12em; font-family: var(--font-display); }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.link { color: var(--accent-ink); font-weight: 550; background: none; border: 0; cursor: pointer; }
.seg.wrap { flex-wrap: wrap; }
.pick-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pick-chips .chip { height: auto; min-height: 34px; padding: 6px 14px; text-align: left; }

/* inicio de sesión */
.welcome-card { padding: 34px 26px; }
.login-logo { width: 120px; height: 120px; border-radius: 28px; box-shadow: var(--shadow-2); }
.welcome-card h1 { color: var(--petrol); }
:root[data-theme="dark"] .welcome-card h1 { color: var(--text); }
.login-msg { color: var(--text-2); font-size: 14px; margin: 16px 0 0; text-align: center; }
.code-in { font-size: 18px !important; text-align: center; font-variant-numeric: tabular-nums; }

/* pastilla de sincronización */
.sync-pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--surface); border: 1px solid var(--line); color: var(--text-2); text-decoration: none; margin-right: 4px; }
.sync-pill.ok { color: var(--ok); } .sync-pill.warn { color: var(--warn); } .sync-pill.danger { color: var(--danger); }

/* widgets del inicio */
.widgets { display: grid; grid-template-columns: 1fr; gap: 14px; }
.widgets > * { min-width: 0; }
.widgets .hero { display: block; text-decoration: none; }
.w { padding: 16px; text-decoration: none; color: inherit; display: block; }
.w-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.w-head b { font-size: 15px; flex: 1; }
.w-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.w-more { color: var(--text-3); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; }
.w-more:hover { background: var(--surface-2); }
.w-line { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 14.5px; min-width: 0; }
.w-line + .w-line { border-top: 1px solid var(--line); }
.w-line .t { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-line .grow { flex: 1; min-width: 0; }
.w-date { width: 42px; text-align: center; border-radius: 10px; background: var(--gold-soft); color: var(--gold-ink); padding: 4px 0; line-height: 1.1; flex: none; }
.w-date b { display: block; font-size: 17px; } .w-date small { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.w-empty { color: var(--text-3); font-size: 14px; margin: 6px 0 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.money-mid { font-size: 26px; font-weight: 650; letter-spacing: -.01em; margin-top: 2px; }
.quick-card { padding: 12px; }
.quick-card .quick { gap: 8px; }
.quick-card .q { box-shadow: none; border: 0; background: transparent; }
.quick-card .q:hover { background: var(--surface-2); }
.list.flat { border: 0; box-shadow: none; background: transparent; margin: 0 -16px; }
.anat { background: linear-gradient(135deg, var(--surface) 40%, var(--gold-soft)); }
@media (min-width: 760px) {
  .widgets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .w-wide { grid-column: 1 / -1; }
}
@media (min-width: 1180px) {
  .widgets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .widgets .hero.w-wide { grid-column: span 2; }
  .widgets .quick-card.w-wide { grid-column: span 1; }
  .quick-card .quick { grid-template-columns: repeat(2, 1fr); }
  .w-cal { grid-row: span 2; }
}

/* calendario */
.w-cal { padding: 12px 14px 14px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-head b { font-size: 15px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal-dow { font-size: 11px; font-weight: 700; color: var(--text-3); padding: 4px 0; }
.cal-day { position: relative; aspect-ratio: 1 / .9; border-radius: 10px; font-size: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text); }
.cal-day:hover { background: var(--surface-2); }
.cal-day.today span:first-child { background: var(--primary); color: var(--primary-text); border-radius: 50%; width: 28px; height: 28px; display: grid; place-items: center; font-weight: 700; }
.cal-dots { display: flex; gap: 3px; position: absolute; bottom: 3px; }
.cal-dots i, .cal-legend i { width: 5px; height: 5px; border-radius: 50%; display: inline-block; }
i.exam { background: var(--danger); } i.task { background: var(--accent); } i.plan { background: var(--gold); }
.cal-legend { display: flex; gap: 14px; justify-content: center; margin-top: 8px; font-size: 11.5px; color: var(--text-3); }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }

/* herramientas de la materia y "Más" */
.study-tools, .tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
@media (min-width: 760px) { .study-tools { grid-template-columns: repeat(4, 1fr); } .tiles { grid-template-columns: repeat(3, 1fr); } }
.tool, .tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; text-align: left; text-decoration: none; color: inherit; }
.tool .qi, .tile .qi { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); margin-bottom: 6px; }
.tool small, .tile small { color: var(--text-3); font-size: 12.5px; }
.tile b { font-size: 15px; }

/* exámenes */
.score-chip { min-width: 42px; height: 36px; padding: 0 8px; border-radius: 11px; display: grid; place-items: center; font-weight: 700; font-size: 15px; flex: none; }
.score-chip.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.score-chip.bad { background: var(--danger-soft); color: var(--danger); }
.q-area { margin-top: 14px; }
.q-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; color: var(--text-3); font-weight: 600; margin-bottom: 8px; }
.q-stem { font-size: 18.5px; line-height: 1.5; font-weight: 550; margin: 4px 0 16px; white-space: pre-wrap; }
.q-options { display: flex; flex-direction: column; gap: 10px; }
.q-opt { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1.5px solid var(--line-2); text-align: left; font-size: 16px; line-height: 1.45; transition: border-color .15s, background .15s, transform .1s; width: 100%; }
button.q-opt:hover { border-color: var(--accent); }
button.q-opt:active { transform: scale(.99); }
.q-opt.sel { border-color: var(--primary); background: var(--accent-soft); }
.q-letter { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--surface-2); color: var(--text-2); flex: none; }
.q-opt.sel .q-letter { background: var(--primary); color: var(--primary-text); }
.q-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 20px; }
.icon-btn.flagged { color: var(--gold); background: var(--gold-soft); }
.q-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.q-dot { width: 34px; height: 34px; border-radius: 10px; font-size: 13px; font-weight: 600; background: var(--surface); border: 1px solid var(--line-2); color: var(--text-2); }
.q-dot.ans { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.q-dot.flag { box-shadow: inset 0 -3px 0 var(--gold); }
.q-dot.cur { outline: 2px solid var(--primary); outline-offset: 1px; }
.result-hero { display: flex; align-items: center; gap: 20px; padding: 22px; border-radius: var(--r-xl); color: #fff; background: var(--hero); box-shadow: var(--shadow-2); }
.result-hero.bad { background: linear-gradient(140deg, #3A2E2C, #6E4A42 60%, #A86A55); }
.result-hero .ring { color: #D6E8E7; } .result-hero .ring span { color: #fff; font-size: 16px; }
.result-hero.bad .ring { color: #F1D3C5; }
.result-grade { font-size: 44px; font-weight: 700; line-height: 1.05; font-family: var(--font-display); }
.result-grade small { font-size: 18px; opacity: .75; font-family: var(--font); }
.review { padding: 16px; margin-bottom: 12px; border-left: 4px solid var(--line-2); }
.review.ok { border-left-color: var(--ok); } .review.bad { border-left-color: var(--danger); } .review.partial, .review.pending { border-left-color: var(--warn); }
.review-opts .q-opt { border-width: 1px; padding: 11px 12px; font-size: 15px; }
.q-opt.right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, var(--surface)); color: var(--text); }
.q-opt.right .q-letter { background: var(--ok); color: #fff; }
.q-opt.right > .icw { color: var(--ok); }
.q-opt.wrong { border-color: var(--danger); background: var(--danger-soft); }
.q-opt.wrong .q-letter { background: var(--danger); color: #fff; }
.q-opt.wrong > .icw { color: var(--danger); }
.tag-me { margin-left: 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.why { font-size: 13.5px; color: var(--text-2); margin-top: 4px; }
.rv-block { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 14.5px; }
.rv-block.ok { background: color-mix(in srgb, var(--ok) 10%, var(--surface)); }
.rv-block p { margin: 4px 0 0; white-space: pre-wrap; }
.rv-ref { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12.5px; color: var(--text-3); }

/* tarjetas */
.flash { width: 100%; min-height: 300px; padding: 28px 22px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2); display: grid; place-items: center; text-align: center; transition: transform .35s var(--ease); }
.flash.flipped { background: linear-gradient(160deg, var(--surface), var(--accent-soft)); animation: flip .35s var(--ease); }
@keyframes flip { from { transform: rotateY(90deg); } to { transform: none; } }
.flash-text { font-size: 21px; line-height: 1.45; font-weight: 550; white-space: pre-wrap; }
.grade-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.grade-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 4px; border-radius: 14px; font-weight: 650; font-size: 14.5px; background: var(--surface-2); }
.grade-btn small { font-weight: 500; font-size: 11.5px; color: var(--text-3); }
.grade-btn.bad { color: var(--danger); } .grade-btn.warn { color: var(--warn); } .grade-btn.ok { color: var(--ok); } .grade-btn.accent { color: var(--accent-ink); }

/* economía */
.hero.money .money-big { font-size: 38px; font-weight: 700; letter-spacing: -.01em; margin: 4px 0 6px; font-variant-numeric: tabular-nums; position: relative; z-index: 1; }
.hero.money p { color: #CFE2E1; position: relative; z-index: 1; }
.hero.money .hero-stats { flex-wrap: wrap; row-gap: 10px; }
.period-nav { display: flex; align-items: center; gap: 4px; }
.period-nav b { min-width: 120px; text-align: center; font-size: 14.5px; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.mini-stats small { display: block; color: var(--text-3); font-size: 12px; }
.mini-stats b { font-size: 15px; font-variant-numeric: tabular-nums; }
.amount { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 15px; }
.amount.in { color: var(--ok); } .amount.out { color: var(--text); } .amount.planned { color: var(--text-3); font-style: italic; }

/* gráficos */
.chart-scroll { overflow-x: auto; scrollbar-width: none; }
.chart-scroll::-webkit-scrollbar { display: none; }
.chart svg { display: block; max-width: none; }
.ch-l { font-size: 11px; fill: var(--text-3); font-family: var(--font); }
.ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-target { stroke: var(--gold); stroke-dasharray: 4 4; stroke-width: 1.5; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin-top: 8px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 10px; }
.donut { position: relative; flex: none; }
.donut-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; font-size: 13px; }
.donut-c small { color: var(--text-3); font-size: 11.5px; }
.donut-legend { display: flex; flex-direction: column; gap: 7px; font-size: 13px; flex: 1; min-width: 160px; }
.donut-legend div { display: flex; align-items: center; gap: 8px; }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.donut-legend span { flex: 1; color: var(--text-2); }

/* plan del parcial */
.day { padding: 12px 14px; margin-bottom: 10px; }
.day.today { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow-1); }
.day.past { opacity: .72; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.plan-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 15px; }
.plan-item.done .grow { text-decoration: line-through; color: var(--text-3); }

/* resúmenes e IA */
.mode-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mode-card { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1.5px solid transparent; text-align: left; }
.mode-card span { font-size: 12.5px; color: var(--text-2); line-height: 1.35; }
.mode-card.on { border-color: var(--primary); background: var(--accent-soft); }
@media (max-width: 420px) { .mode-cards { grid-template-columns: 1fr; } }
.prompt-box { font-family: var(--font-mono); font-size: 12.5px !important; margin-top: 8px; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--text-2); font-size: 14.5px; }
.note-thumb.summary { background: linear-gradient(160deg, var(--surface-2), var(--gold-soft)); }
.doc-html table, .editor table { border-collapse: collapse; width: 100%; font-size: 14.5px; margin: 10px 0; display: block; overflow-x: auto; }
.editor td, .editor th { border: 1px solid var(--line-2); padding: 6px 8px; text-align: left; }
.editor th { background: var(--surface-2); }
details summary { cursor: pointer; }

/* entradas: puntero fino, teclado y lápiz */
@media (hover: hover) and (pointer: fine) { .q-opt, .chip, .row { cursor: pointer; } }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.editor { touch-action: manipulation; }

/* impresión */
@media print {
  .sidebar, .tabbar, .topbar, .toolbar, .fab, #toasts, .btn-row, .tts-bar { display: none !important; }
  body { background: #fff; }
  .main { padding: 0 !important; }
  .editor-wrap, .card { box-shadow: none; border: 0; }
}

/* protección contra desbordes horizontales en pantallas angostas */
.main { min-width: 0; overflow-x: clip; }
.section { flex-wrap: wrap; row-gap: 8px; }
.sheet-body { min-height: 0; }
.period-nav { margin-left: auto; }
@media (max-width: 420px) { .period-nav b { min-width: 96px; } .seg button { padding: 0 11px; } }
.hero-stats { flex-wrap: wrap; row-gap: 10px; }
.q-nav .btn { padding: 0 14px; }
a.btn, .btn { text-decoration: none; }
.page:has(.fab) { padding-bottom: 76px; }
