/* Secciones de estudio: mismo diseño en web y móvil. */
.app-nav .nav-label{width:auto;white-space:normal;line-height:1.3;font-size:inherit;text-align:left}.app-nav .nav-label-mobile,.calendar-label-mobile{display:none}.app-nav .nav-icon{flex-shrink:0}.calendar-toolbar .calendar-actions{flex-wrap:nowrap;align-items:center}.calendar-actions .button{white-space:nowrap;min-height:44px}
body[data-view="asistente"]{overflow:hidden}body[data-view="asistente"] .shell>main{height:var(--workspace-room,calc(100dvh - 88px));min-height:0;padding:0;display:flex;flex-direction:column;border-radius:0}body[data-view="asistente"] .shell>footer{display:none}body[data-view="asistente"] .shell>header #global-add-exam{display:none}body[data-view="asistente"] main>.ai-card{flex:1;width:100%;max-width:none;min-height:0;margin:0;border:0;border-radius:0;height:100%;box-shadow:none}body[data-view="asistente"] main>.ai-intro{overflow:auto;padding:32px}body[data-view="asistente"] .ai-log{min-height:0;padding:28px;gap:18px}body[data-view="asistente"] .ai-chat #ai-form{padding:16px 24px 0}body[data-view="asistente"] .ai-chat .ai-source{margin:10px 24px 18px}
.page-controls{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:24px}.page-controls button{min-height:44px;border:1px solid var(--border);border-radius:12px;padding:10px 16px;background:var(--surface);font:inherit;color:var(--muted)}.page-controls button[aria-pressed=true]{background:var(--soft);color:var(--accent);border-color:var(--accent)}.tasks-page .pending-section{margin:24px 0 0}.tasks-page .pending-row{padding:18px 0}.tasks-page .pending-row>div{flex:1;min-width:0}.tasks-page .pending-row h3{overflow-wrap:anywhere}.tasks-page .pending-row p{line-height:1.6}.tasks-page .pending-actions{gap:12px;flex-wrap:wrap}.tasks-page .pending-actions button{min-height:44px}.tasks-page .task-empty{padding:32px;border:1px solid var(--border);border-radius:16px;background:var(--surface);color:var(--muted);line-height:1.7}
.study-overview{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-bottom:24px}.study-stat{padding:24px;border:1px solid var(--border);border-radius:16px;background:var(--surface)}.study-stat strong{display:block;font:600 30px var(--font-heading);color:var(--ink)}.study-stat span{display:block;margin-top:8px;color:var(--muted)}.study-panels{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(250px,1fr);gap:24px}.study-panels .panel,.study-progress,.study-history{padding:24px;min-width:0;margin-bottom:24px}.study-panels h2,.study-progress h2,.study-history h2{font:600 20px var(--font-heading);margin:0 0 20px}.study-trend{display:grid;grid-template-columns:repeat(var(--study-days),minmax(0,1fr));gap:8px;align-items:end;height:210px;margin:0;padding:0;list-style:none}.study-trend li{height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:8px;min-width:0}.study-trend i{width:100%;max-width:52px;border-radius:8px 8px 2px 2px;background:var(--accent);min-height:3px}.study-trend small{font-size:12px;color:var(--muted);white-space:nowrap}.study-trend .bar-amount{font-size:12px;color:var(--muted);white-space:nowrap}.study-trend[data-period="30"]{gap:4px}.study-trend[data-period="30"] .bar-amount{display:none}.study-trend[data-period="30"] li:not(:first-child):not(:last-child) small{visibility:hidden}.study-subject{margin:0 0 18px}.study-subject .progress-copy{gap:12px;font-size:14px}.study-subject .progress-copy strong{overflow-wrap:anywhere}.study-progress-row,.study-log{display:flex;gap:16px;justify-content:space-between;padding:18px 0;border-bottom:1px solid var(--border)}.study-progress-row>div,.study-log>div{min-width:0;flex:1}.study-progress-row h3,.study-log h3{margin:0 0 6px;font-size:16px;overflow-wrap:anywhere}.study-progress-row p,.study-log p{margin:0;color:var(--muted);font-size:14px;line-height:1.6;overflow-wrap:anywhere}.study-progress-row strong,.study-log time{color:var(--accent);white-space:nowrap;font-size:14px}.study-note{color:var(--muted);line-height:1.6;font-size:14px}
@media(max-width:780px){
 .sidebar .app-nav{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));grid-auto-flow:row;grid-auto-columns:auto;gap:0;padding:4px 3px calc(4px + env(safe-area-inset-bottom,0px));overflow:visible}.sidebar .app-nav button{min-width:0;min-height:72px;padding:6px 2px;gap:4px;white-space:normal;justify-content:center}.sidebar .app-nav .nav-label{width:auto;font-size:12px;line-height:1.2;overflow-wrap:normal;text-align:center}.app-nav .nav-label-desktop{display:none}.sidebar .app-nav .nav-label-mobile{display:block}.sidebar .app-nav .nav-icon{width:22px;height:22px}.sidebar .app-nav svg{width:22px;height:22px}.shell{padding-bottom:calc(90px + env(safe-area-inset-bottom,0px))}
 main .balance-home .wheel-budget{height:auto;min-height:0;padding:18px;margin-bottom:24px}.wheel-budget .wheel-layout{display:grid;grid-template-columns:110px minmax(0,1fr);gap:16px;align-items:center;margin-top:12px;min-height:0}.wheel-budget .budget-wheel,.wheel-budget .budget-wheel svg{width:110px;height:110px}.wheel-budget .wheel-center strong{font-size:24px;max-width:82px}.wheel-budget .wheel-center span{font-size:12px}.wheel-budget .wheel-breakdown{width:100%;max-width:none}.wheel-budget .wheel-breakdown h3{text-align:left;font-size:17px;margin:0 0 8px}.wheel-budget .wheel-breakdown .wheel-row{display:flex!important;font-size:14px;padding:8px 0;gap:7px}.wheel-budget .wheel-breakdown .wheel-row span{white-space:normal;overflow:visible;text-overflow:initial;overflow-wrap:anywhere}.wheel-budget .wheel-breakdown .wheel-row strong{font-size:14px}.wheel-budget>.balance-budget-detail:not(.balance-overflow){display:block;font-size:14px;line-height:1.6}
 .calendar-toolbar .calendar-actions{display:flex;flex-wrap:nowrap;width:100%;gap:6px;justify-content:space-between}.calendar-toolbar .calendar-actions .button{font-size:14px;padding:9px 10px;min-height:44px}.calendar-label-desktop{display:none}.calendar-label-mobile{display:inline}
 body[data-view="asistente"] .shell>main{height:var(--workspace-room);min-height:0;border-radius:0;padding:0}body[data-view="asistente"] .ai-log{padding:18px 16px;gap:14px}body[data-view="asistente"] .ai-chat #ai-form{padding:10px 12px 0}body[data-view="asistente"] .ai-chat .ai-source{margin:8px 12px 12px;font-size:12px}body[data-view="asistente"] main>.ai-intro{padding:24px 18px}
 .tasks-page .heading{gap:12px}.tasks-page .heading .button{font-size:14px;white-space:nowrap}.tasks-page .heading h1{font-size:26px}.study-overview{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.study-stat{padding:16px 10px}.study-stat strong{font-size:22px}.study-stat span{font-size:13px;line-height:1.5}.study-panels{grid-template-columns:1fr;gap:0}.study-panels .panel,.study-progress,.study-history{padding:20px}.study-trend{gap:6px}.study-trend .bar-amount{font-size:11px}.study-trend small{font-size:11px}.study-progress-row,.study-log{gap:10px;flex-wrap:wrap}.study-progress-row p,.study-log p{font-size:15px}.study-note{font-size:15px}
}
@media(max-width:360px){.wheel-budget .wheel-layout{grid-template-columns:1fr}.wheel-budget .budget-wheel{margin:0 auto}.wheel-budget .wheel-breakdown h3{text-align:center}.study-overview{grid-template-columns:1fr}.study-stat{display:flex;gap:14px;align-items:center}.study-stat span{margin:0}}

.tasks-page .pending-row .check{width:28px;min-width:28px;height:28px;min-height:28px;flex-shrink:0;border:1px solid var(--accent);border-radius:8px;background:var(--surface);color:var(--accent)}.tasks-page .pending-row.done .check{background:var(--soft)}

@media(max-width:780px){body[data-view="asistente"] .app-nav{bottom:var(--keyboard-inset,0px)}body[data-view="asistente"].workspace-keyboard .ai-source{display:none}}

/* Bienvenida: una pregunta clara, sin mensajes ni estados que muevan la pantalla. */
.welcome-card .school-picker{gap:6px;margin-bottom:24px}.school-picker label{margin:0}.school-picker .form-hint{margin:6px 0 8px}.school-picker [data-school-results]:empty,.school-picker [data-school-selected]:empty{display:none}.school-picker [data-school-manual]{justify-self:start;text-align:left;padding:4px 0;min-height:36px;margin:0}.school-picker [data-school-manual-fields]{display:grid;gap:12px;padding-top:10px}.welcome .welcome-actions{border-top:0;padding-top:14px;gap:0}.welcome .welcome-card[aria-busy=true]{opacity:1}.welcome .welcome-exam{padding:18px;border:1px solid var(--border);border-radius:14px;margin:14px 0}.welcome .welcome-exam h2{font-size:18px;margin:0 0 8px}.welcome .welcome-exam p{font-size:14px;line-height:1.6}.school-settings{padding:24px;margin-bottom:24px}.school-settings .section-heading{gap:16px;margin:0 0 16px}.school-settings h2{font:600 20px var(--font-heading);margin:0}.school-settings .school-name{font-size:18px;font-weight:600;line-height:1.5;margin:0 0 6px;overflow-wrap:anywhere}.school-settings .form-hint{margin:0;line-height:1.6}.school-settings+.welcome-settings{margin-top:0}@media(max-width:780px){.school-settings{padding:20px}.school-settings .section-heading{flex-wrap:wrap}.school-settings .button{font-size:14px}.school-settings .school-name{font-size:18px}}

.welcome-chips input:checked+span{background:var(--accent);border-color:var(--accent);color:var(--on-accent,#fff);font-weight:600}

/* Barra de abajo en móvil: cinco pestañas de una palabra (las guías de iOS y Android
   recomiendan de 3 a 5). El asistente va en la cabecera, junto a Ajustes. */
.mobile-assistant{display:none}
@media(max-width:780px){
.sidebar .app-nav{grid-template-columns:repeat(5,minmax(0,1fr));padding:6px 4px calc(6px + env(safe-area-inset-bottom,0px))}
.sidebar .app-nav [data-view="asistente"]{display:none!important}
.sidebar .app-nav button{min-height:56px;padding:4px 0 2px;gap:4px}
.sidebar .app-nav .nav-label{font-size:11px;line-height:1.1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.sidebar .app-nav .nav-icon{width:48px;height:30px;border-radius:999px;display:grid;place-items:center;transition:background .15s}
.sidebar .app-nav button.active .nav-icon{background:color-mix(in srgb,var(--accent) 24%,transparent)}
.sidebar .app-nav button.active .nav-label{font-weight:600}
.sidebar .app-nav button,.sidebar .app-nav button.active,html[data-theme] .sidebar .app-nav button.active{background:transparent;box-shadow:none}
.sidebar .app-nav button.active{color:var(--ink)}
.mobile-assistant{display:grid;place-items:center;min-width:44px;min-height:44px;color:var(--accent)}
.mobile-assistant svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linejoin:round}
body[data-view="asistente"] .mobile-assistant{background:color-mix(in srgb,var(--accent) 24%,transparent);border-radius:999px}
}
