@font-face { font-family: 'Integra Escolar'; src: url('../fonts/escolar-ligada.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: block; }
@font-face { font-family: 'Integra Escolar Puntos'; src: url('../fonts/escolar-ligada-puntos-v013.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: block; }
:root {
    --navy: #102c57;
    --blue: #165baa;
    --turquoise: #08aeb5;
    --mint: #dff7ef;
    --violet: #7c5ce5;
    --orange: #ff8a3d;
    --yellow: #ffd34f;
    --ink: #24334a;
    --muted: #67758a;
    --paper: #ffffff;
    --warm: #f8f5ee;
    --line: #dce4e9;
    --danger: #b84343;
    --shadow: 0 22px 55px rgba(36, 51, 74, .12);
    --soft-shadow: 0 10px 30px rgba(36, 51, 74, .08);
    --radius-xl: 30px;
    --radius-lg: 22px;
    --radius-md: 15px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--warm); }
body { margin: 0; min-height: 100%; color: var(--ink); font-family: Inter, ui-rounded, "Nunito Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(8, 174, 181, .25); outline-offset: 2px; }
[hidden] { display: none !important; }

.app-page {
    background:
        radial-gradient(circle at 6% 17%, rgba(255, 211, 79, .18) 0 110px, transparent 112px),
        radial-gradient(circle at 93% 7%, rgba(8, 174, 181, .12) 0 145px, transparent 147px),
        var(--warm);
}
.app-page::before, .app-page::after { content: ""; position: fixed; z-index: -1; border-radius: 50% 44% 58% 42%; filter: blur(.2px); }
.app-page::before { width: 220px; height: 180px; left: -80px; bottom: 8%; background: rgba(124, 92, 229, .07); transform: rotate(24deg); }
.app-page::after { width: 170px; height: 220px; right: -60px; bottom: 12%; background: rgba(255, 138, 61, .08); transform: rotate(-18deg); }

.topbar { height: 86px; display: grid; grid-template-columns: minmax(210px, 1fr) auto minmax(210px, 1fr); align-items: center; gap: 24px; padding: 14px clamp(22px, 4vw, 64px); background: rgba(255,255,255,.86); border-bottom: 1px solid rgba(16,44,87,.08); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 30; }
.brand-button { border: 0; background: transparent; padding: 0; justify-self: start; cursor: pointer; }
.brand-button img { display: block; width: 208px; height: 54px; object-fit: contain; object-position: left center; }
.topnav { padding: 5px; display: flex; gap: 4px; background: #f1f5f4; border-radius: 999px; }
.nav-pill { padding: 10px 17px; border: 0; background: transparent; color: var(--muted); font-weight: 750; border-radius: 999px; cursor: pointer; }
.nav-pill.active { background: white; color: var(--navy); box-shadow: 0 4px 12px rgba(36,51,74,.08); }
.user-menu { display: flex; align-items: center; justify-self: end; gap: 10px; font-size: 13px; }
.user-menu strong, .user-menu small { display: block; }
.user-menu small { color: var(--muted); margin-top: 2px; }
.user-avatar { width: 38px; height: 38px; display: grid; place-items: center; color: white; background: linear-gradient(145deg, var(--turquoise), #5acb9b); border-radius: 13px 16px 12px 17px; font-weight: 900; }
.text-link { color: var(--blue); text-decoration: none; margin-left: 5px; font-weight: 750; }

.app-shell { width: min(1320px, calc(100% - 44px)); margin: 0 auto; padding: 50px 0 80px; }
.view { display: none; }
.view.active { display: block; animation: view-in .28s ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.eyebrow { display: block; margin-bottom: 8px; color: var(--turquoise); font-size: 12px; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 12px; color: var(--navy); font-size: clamp(34px, 4vw, 58px); line-height: 1.02; letter-spacing: -.035em; }
h2 { color: var(--navy); font-size: 28px; letter-spacing: -.025em; }
.welcome-strip { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; padding: 26px 8px 35px; }
.welcome-strip p, .page-heading p { max-width: 660px; color: var(--muted); font-size: 17px; line-height: 1.55; margin-bottom: 0; }
.primary-button, .soft-button { border: 0; border-radius: 14px; font-weight: 850; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.primary-button { padding: 13px 20px; color: white; background: linear-gradient(135deg, var(--blue), var(--turquoise)); box-shadow: 0 9px 24px rgba(22,91,170,.22); }
.primary-button:hover, .soft-button:hover { transform: translateY(-2px); }
.primary-button.wide { width: 100%; padding: 15px 22px; }
.create-shortcut { min-width: 190px; background: linear-gradient(135deg, var(--orange), #ffb15f); }
.create-shortcut span { margin-right: 5px; }
.soft-button { padding: 11px 15px; color: var(--navy); background: white; border: 1px solid var(--line); }

.workbench-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.workbench-card { min-height: 176px; padding: 24px; position: relative; display: grid; grid-template-columns: 72px 1fr auto; align-items: center; gap: 18px; text-align: left; border: 1px solid rgba(16,44,87,.07); background: rgba(255,255,255,.9); border-radius: 28px 24px 31px 21px; box-shadow: var(--soft-shadow); cursor: pointer; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.workbench-card:nth-child(even) { border-radius: 22px 31px 23px 29px; }
.workbench-card:not(:disabled):hover { transform: translateY(-5px) rotate(-.2deg); box-shadow: var(--shadow); }
.workbench-card::after { content: ""; position: absolute; right: -35px; bottom: -55px; width: 130px; height: 120px; border-radius: 52% 46% 63% 38%; opacity: .15; transform: rotate(25deg); }
.workbench-card.literacy { border-color: rgba(8,174,181,.25); background: linear-gradient(150deg, #fff 35%, #e4fbf6); }
.workbench-card.literacy::after { background: var(--turquoise); }
.workbench-card.adapted::after { background: var(--violet); }
.workbench-card.session::after { background: var(--orange); }
.workbench-card.visual::after { background: var(--yellow); }
.workbench-card.manipulatives::after { background: #57bf77; }
.workbench-card.transform::after { background: var(--blue); }
.workbench-card:disabled { cursor: default; opacity: .72; }
.card-icon { width: 70px; height: 70px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 25px 19px 22px 18px; color: var(--navy); background: var(--mint); font-size: 25px; font-weight: 950; }
.literacy .card-icon { color: white; background: linear-gradient(145deg, var(--turquoise), #55c99e); }
.adapted .card-icon { background: #eee9ff; color: var(--violet); }
.session .card-icon { background: #ffebdf; color: #d96321; }
.visual .card-icon { background: #fff4c8; color: #9b7200; }
.manipulatives .card-icon { background: #e6f7e9; color: #328a4d; }
.transform .card-icon { background: #e5eefb; color: var(--blue); }
.card-copy strong, .card-copy small { display: block; }
.card-copy strong { color: var(--navy); font-size: 19px; }
.card-copy small { margin-top: 8px; color: var(--muted); line-height: 1.45; font-size: 13px; }
.card-arrow { width: 34px; height: 34px; display: grid; place-items: center; align-self: end; color: var(--turquoise); background: white; border-radius: 50%; font-size: 18px; box-shadow: 0 5px 13px rgba(36,51,74,.09); }
.coming-label { position: absolute; top: 14px; right: 16px; padding: 5px 8px; color: var(--muted); background: rgba(255,255,255,.7); border-radius: 999px; font-size: 10px; font-weight: 800; }

.recent-section { margin-top: 54px; }
.section-heading, .page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.section-heading h2, .page-heading h1 { margin-bottom: 0; }
.page-heading { align-items: center; padding: 18px 6px 25px; }
.page-heading h1 { font-size: 45px; }
.resource-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.recent-card, .library-card { display: grid; background: white; border: 1px solid rgba(16,44,87,.08); border-radius: var(--radius-lg); box-shadow: var(--soft-shadow); overflow: hidden; }
.recent-card { grid-template-columns: 100px 1fr; align-items: center; min-height: 150px; padding: 18px; gap: 17px; }
.resource-thumbnail { aspect-ratio: .77; min-width: 78px; padding: 14px 10px; background: linear-gradient(155deg, #e7faf5, #fff); border: 1px solid #d4e9e3; border-radius: 12px; box-shadow: 0 7px 17px rgba(36,51,74,.08); }
.resource-thumbnail span { display: block; margin-bottom: 13px; color: var(--turquoise); font-weight: 950; font-size: 18px; }
.resource-thumbnail i { display: block; height: 5px; margin: 7px 0; background: #dfe8e8; border-radius: 3px; }
.resource-thumbnail i:last-child { width: 65%; }
.resource-copy h3 { margin: 5px 0; color: var(--navy); font-size: 16px; }
.resource-copy p { margin: 0; color: var(--muted); font-size: 12px; }
.resource-tag { color: var(--turquoise); font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.resource-actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid #edf1f2; padding-top: 10px; }
.resource-actions button { border: 0; padding: 6px 9px; color: var(--blue); background: transparent; font-size: 12px; font-weight: 800; cursor: pointer; }
.resource-actions .danger-link { color: var(--danger); }
.empty-card { grid-column: 1 / -1; padding: 32px; text-align: center; color: var(--muted); background: rgba(255,255,255,.6); border: 1px dashed #cbd5d8; border-radius: var(--radius-lg); }

.filter-bar { display: flex; gap: 12px; padding: 15px; margin-bottom: 20px; background: rgba(255,255,255,.65); border-radius: 18px; }
.filter-bar input, .filter-bar select { padding: 12px 14px; border: 1px solid var(--line); background: white; border-radius: 12px; }
.filter-bar input { flex: 1; }
.worksheet-library { display: grid; grid-template-columns: repeat(3, 1fr); gap: 17px; }
.library-card { grid-template-columns: 115px 1fr; align-items: center; padding: 19px; gap: 18px; }
.library-card .resource-thumbnail { width: 98px; }
.empty-library { grid-column: 1 / -1; padding: 70px 25px; text-align: center; background: rgba(255,255,255,.7); border: 1px dashed #cbd5d8; border-radius: 25px; }
.empty-library span { font-size: 38px; color: var(--turquoise); }
.empty-library h3 { margin: 10px 0 5px; color: var(--navy); }
.empty-library p { margin-bottom: 0; color: var(--muted); }
.template-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.template-card { min-height: 220px; padding: 30px; text-align: left; border: 1px solid rgba(16,44,87,.08); background: white; border-radius: 28px; box-shadow: var(--soft-shadow); cursor: pointer; transition: transform .2s ease; }
.template-card:hover { transform: translateY(-5px); }
.template-card > span { width: 58px; height: 58px; margin-bottom: 25px; display: grid; place-items: center; color: var(--turquoise); background: var(--mint); border-radius: 19px 15px 21px 16px; font-size: 26px; }
.template-card strong, .template-card small { display: block; }
.template-card strong { margin-bottom: 8px; color: var(--navy); font-size: 19px; }
.template-card small { color: var(--muted); line-height: 1.5; }

.modal-open { overflow: hidden; }
.modal-layer { position: fixed; inset: 0; z-index: 100; padding: 22px; display: grid; place-items: center; background: rgba(16, 32, 55, .48); backdrop-filter: blur(10px); }
.creator-panel { position: relative; width: min(940px, 100%); max-height: calc(100vh - 44px); overflow: auto; padding: clamp(28px, 5vw, 56px); background: #fffefa; border-radius: 34px 27px 38px 29px; box-shadow: 0 35px 90px rgba(13,35,66,.28); }
.close-modal { position: absolute; top: 20px; right: 20px; }
.icon-button { width: 40px; height: 40px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--navy); background: white; border-radius: 13px; cursor: pointer; font-size: 21px; }
.creator-intro { max-width: 650px; margin-bottom: 32px; }
.creator-intro h2 { margin-bottom: 9px; font-size: 35px; }
.creator-intro p { color: var(--muted); line-height: 1.55; }
.creator-form { display: grid; gap: 25px; }
.form-step { display: grid; grid-template-columns: 43px 1fr; gap: 17px; }
.step-number { width: 38px; height: 38px; display: grid; place-items: center; color: white; background: linear-gradient(145deg, var(--turquoise), #5bc69e); border-radius: 14px 11px 16px 12px; font-weight: 900; }
.form-step h3 { margin: 7px 0 14px; color: var(--navy); }
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.choice-chip input, .toggle-grid input { position: absolute; opacity: 0; pointer-events: none; }
.choice-chip span { display: block; padding: 12px 10px; text-align: center; border: 1px solid var(--line); background: white; border-radius: 12px; cursor: pointer; font-size: 13px; font-weight: 750; }
.choice-chip input:checked + span { color: var(--navy); background: var(--mint); border-color: var(--turquoise); box-shadow: 0 0 0 2px rgba(8,174,181,.08); }
.form-grid { display: grid; gap: 14px; }
.two-columns { grid-template-columns: repeat(2, 1fr); }
.full-width { grid-column: 1 / -1; }
.form-grid label, .login-form label, .properties-content label { display: grid; gap: 7px; color: #4f5f74; font-size: 12px; font-weight: 850; }
.form-grid input, .form-grid select, .login-form input, .properties-content input, .properties-content select, .properties-content textarea { width: 100%; padding: 12px 13px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 11px; font-weight: 500; }
.properties-content textarea { min-height: 88px; resize: vertical; line-height: 1.45; }
.toggle-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.toggle-grid span { display: block; position: relative; padding: 11px 12px 11px 38px; background: #f4f6f5; border: 1px solid transparent; border-radius: 11px; cursor: pointer; font-size: 13px; }
.toggle-grid span::before { content: ""; position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; border: 2px solid #aeb9bd; border-radius: 5px; transform: translateY(-50%); }
.toggle-grid input:checked + span { background: var(--mint); border-color: rgba(8,174,181,.25); }
.toggle-grid input:checked + span::before { content: "✓"; display: grid; place-items: center; color: white; background: var(--turquoise); border-color: var(--turquoise); font-size: 11px; }

.editing { overflow: hidden; }
.editor-screen { position: fixed; inset: 0; z-index: 80; display: grid; grid-template-rows: 78px 1fr; background: #e8eceb; }
.editor-toolbar { position: relative; z-index: 4; padding: 11px 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: white; border-bottom: 1px solid #d9e0e1; box-shadow: 0 4px 15px rgba(36,51,74,.06); }
.editor-brand { display: flex; align-items: center; gap: 12px; }
.editor-brand img { width: 142px; height: 48px; object-fit: contain; }
.editor-brand > div { padding-left: 12px; border-left: 1px solid var(--line); }
.editor-brand span, .editor-brand strong { display: block; }
.editor-brand span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.editor-brand strong { max-width: 240px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--navy); font-size: 13px; }
.editor-actions { display: flex; align-items: center; gap: 9px; }
.save-status { margin-right: 5px; color: #39805a; font-size: 11px; font-weight: 800; }
.save-status.dirty { color: #a76d1b; }
.editor-layout { min-height: 0; display: grid; grid-template-columns: 112px minmax(630px, 1fr) 294px; }
.tool-dock { padding: 18px 11px; display: flex; flex-direction: column; gap: 8px; background: #f7f9f8; border-right: 1px solid #d9e0e1; overflow-y: auto; }
.dock-label { margin: 2px 0 5px; text-align: center; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.tool-dock button { padding: 10px 5px; display: grid; gap: 5px; place-items: center; border: 1px solid transparent; background: transparent; border-radius: 12px; color: #56667a; cursor: pointer; font-size: 10px; font-weight: 750; }
.tool-dock button:hover { color: var(--navy); background: white; border-color: var(--line); box-shadow: 0 5px 12px rgba(36,51,74,.07); }
.tool-dock button span { width: 32px; height: 32px; display: grid; place-items: center; color: var(--turquoise); background: var(--mint); border-radius: 10px; font-size: 15px; font-weight: 900; }
.canvas-stage { min-width: 0; overflow: auto; padding: 38px 45px 80px; background-color: #e7ebea; background-image: radial-gradient(#c7cecc 1px, transparent 1px); background-size: 18px 18px; }
.worksheet-page { --worksheet-font-size: 20px; width: 210mm; min-height: 297mm; margin: 0 auto; padding: 14mm 15mm 13mm; position: relative; background: var(--paper); box-shadow: 0 22px 55px rgba(36,51,74,.18); color: #27384b; overflow: hidden; }
.worksheet-page::before { content: ""; position: absolute; width: 45mm; height: 45mm; right: -25mm; top: -26mm; border-radius: 48% 52% 43% 57%; background: rgba(8,174,181,.08); }
.worksheet-header { min-height: 19mm; display: flex; align-items: center; justify-content: space-between; gap: 12mm; border-bottom: 1px solid #dce5e4; position: relative; z-index: 1; }
.worksheet-header img { width: 57mm; height: 16mm; object-fit: contain; object-position: left center; }
.worksheet-page.hide-logo .worksheet-header img { visibility: hidden; }
.student-fields { flex: 1; display: grid; gap: 4mm; font-size: 10pt; }
.student-fields span { display: flex; gap: 3mm; white-space: nowrap; }
.student-fields i { flex: 1; display: block; border-bottom: 1px solid #9aa9ad; }
.worksheet-title-wrap { padding: 9mm 0 5mm; text-align: center; }
.worksheet-title { width: 100%; padding: 0; text-align: center; color: var(--navy); background: transparent; border: 0; font-size: 23pt; font-weight: 900; letter-spacing: -.02em; }
.worksheet-title-wrap p { margin: 2mm 0 0; color: var(--turquoise); font-size: 9pt; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.worksheet-blocks { display: grid; gap: 4mm; }
.worksheet-block { position: relative; min-height: 20mm; padding: 5mm 5mm 5mm 13mm; border: 1.5px solid #dbe6e4; border-radius: 5mm; background: white; transition: border-color .15s, box-shadow .15s; }
.worksheet-block.selected { border-color: var(--turquoise); box-shadow: 0 0 0 2px rgba(8,174,181,.12); }
.block-number { position: absolute; left: 4mm; top: 5mm; width: 6mm; height: 6mm; display: grid; place-items: center; color: white; background: var(--turquoise); border-radius: 42% 58% 49% 51%; font-size: 8pt; font-weight: 900; }
.block-content { font-size: var(--worksheet-font-size); }
.activity-instruction, .instruction-copy { margin: 0 0 3mm; font-size: .72em; font-weight: 760; line-height: 1.35; }
.instruction-copy { margin: 0; color: var(--navy); }
.block-tools { position: absolute; right: 3mm; top: -5mm; padding: 1mm; display: none; gap: 1mm; background: white; border: 1px solid var(--line); border-radius: 3mm; box-shadow: 0 4px 10px rgba(36,51,74,.1); }
.worksheet-block.selected .block-tools { display: flex; }
.block-tools button { width: 7mm; height: 7mm; padding: 0; border: 0; color: var(--navy); background: #f2f6f5; border-radius: 2mm; cursor: pointer; font-size: 9pt; font-weight: 800; }
.block-tools button:last-child { color: var(--danger); }
.trace-list { display: grid; gap: 1.5mm; }
.trace-text { font-family: 'Integra Escolar Puntos'; font-size: calc(var(--worksheet-font-size) * 1.65); font-weight: 400; font-synthesis: none; line-height: 2.2; overflow-wrap: anywhere; white-space: pre-wrap; color: #27384b; padding: 0 2mm; }

.copy-list { display: grid; gap: 3mm; }
.copy-list > div, .syllable-list > div { display: grid; grid-template-columns: 42mm 1fr; align-items: end; gap: 5mm; }
.learning-text { color: var(--navy); font-size: .95em; font-weight: 650; }
.writing-line { min-height: 7mm; border-bottom: 1px solid #7c8d94; position: relative; }
.worksheet-page[data-guide="double"] .writing-line { border-top: 1px solid #bdc7ca; }
.worksheet-page[data-guide="montessori"] .writing-line { border-top: 1px solid #b9c5c8; background: linear-gradient(to bottom, transparent 49%, #d6dfe1 50%, transparent 52%); }
.worksheet-page[data-guide="grid"] .writing-line { min-height: 8mm; background-image: linear-gradient(#cdd7d9 1px, transparent 1px), linear-gradient(90deg, #cdd7d9 1px, transparent 1px); background-size: 8mm 8mm; border: 0; }
.worksheet-page[data-guide="none"] .writing-line { border: 0; min-height: 8mm; }
.syllable-list { display: grid; gap: 3mm; }
.syllable-list span { padding: 2mm 3mm; text-align: center; color: var(--navy); background: #eff8f5; border-radius: 2mm; font-size: .75em; font-weight: 800; }
.choice-question { margin: 2mm 0; color: var(--navy); font-size: .85em; font-weight: 800; }
.choice-options { display: flex; flex-wrap: wrap; gap: 5mm; font-size: .75em; }
.free-writing { display: grid; gap: 2mm; }
.worksheet-footer { position: absolute; left: 15mm; right: 15mm; bottom: 7mm; display: flex; justify-content: space-between; color: #7c8b94; font-size: 7pt; }
.worksheet-page[data-font="school-linked"] .learning-text, .worksheet-page[data-font="school-linked"] .choice-question, .worksheet-page[data-font="school-linked"] .choice-options { font-family: 'Integra Escolar', cursive; font-weight: 400; line-height: 2; font-synthesis: none; }
.worksheet-page[data-font="uppercase"] .learning-text, .worksheet-page[data-font="uppercase"] .choice-question, .worksheet-page[data-font="uppercase"] .choice-options { text-transform: uppercase; letter-spacing: .04em; }
.worksheet-page[data-font="dotted"] .learning-text { color: #46515c; -webkit-text-stroke: 0; font-family: 'Integra Escolar Puntos'; font-weight: 400; }
.worksheet-page.low-load .worksheet-block { border-color: transparent; padding-top: 7mm; padding-bottom: 7mm; }
.worksheet-page.low-load .worksheet-blocks { gap: 7mm; }
.worksheet-page.low-load .worksheet-block:nth-child(n+4) { display: none; }

.properties-panel { min-width: 0; background: #f9faf9; border-left: 1px solid #d9e0e1; overflow-y: auto; }
.panel-tabs { padding: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 5px; border-bottom: 1px solid var(--line); }
.panel-tabs button { padding: 9px; border: 0; color: var(--muted); background: transparent; border-radius: 10px; font-size: 12px; font-weight: 850; cursor: pointer; }
.panel-tabs button.active { color: var(--navy); background: white; box-shadow: 0 4px 10px rgba(36,51,74,.07); }
.properties-content { padding: 18px; display: grid; gap: 16px; }
.property-empty { padding: 35px 12px; text-align: center; color: var(--muted); }
.property-empty span { display: block; margin-bottom: 10px; color: var(--turquoise); font-size: 28px; }
.property-empty p { margin: 0; font-size: 12px; line-height: 1.5; }
.property-heading span, .property-heading strong { display: block; }
.property-heading span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.property-heading strong { margin-top: 4px; color: var(--navy); font-size: 17px; }
.quick-adapt { padding: 14px; background: #eef8f5; border-radius: 13px; }
.quick-adapt > span { display: block; margin-bottom: 9px; color: var(--navy); font-size: 11px; font-weight: 850; }
.quick-adapt div { display: flex; flex-wrap: wrap; gap: 7px; }
.quick-adapt button { padding: 7px 8px; color: var(--blue); background: white; border: 1px solid #d4e3df; border-radius: 8px; cursor: pointer; font-size: 10px; font-weight: 800; }
.inline-toggle { grid-template-columns: auto 1fr !important; align-items: center; }
.inline-toggle input { width: auto; }

.preview-mode .tool-dock, .preview-mode .properties-panel { display: none; }
.preview-mode .editor-layout { grid-template-columns: 1fr; }
.preview-mode .worksheet-block { border-color: #dbe6e4; box-shadow: none; }
.preview-mode .block-tools { display: none !important; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 200; max-width: min(420px, calc(100% - 32px)); padding: 12px 17px; color: white; background: #263a50; border-radius: 12px; box-shadow: 0 10px 35px rgba(22,42,60,.25); opacity: 0; transform: translate(-50%, 18px); pointer-events: none; transition: .22s ease; font-weight: 750; font-size: 13px; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.toast[data-tone="success"] { background: #287c57; }
.toast[data-tone="error"] { background: #a63f43; }

.auth-page { min-height: 100vh; padding: 35px 20px; display: grid; place-items: center; background: radial-gradient(circle at 10% 10%, #dff7ef 0 14%, transparent 15%), radial-gradient(circle at 91% 88%, #fff1c6 0 12%, transparent 13%), var(--warm); }
.auth-card { width: min(470px, 100%); padding: 40px; background: rgba(255,255,255,.95); border: 1px solid rgba(16,44,87,.08); border-radius: 32px 25px 36px 27px; box-shadow: var(--shadow); }
.install-card { width: min(780px, 100%); }
.auth-logo { width: 240px; height: 75px; object-fit: contain; object-position: left center; margin-bottom: 25px; }
.auth-heading h1 { font-size: 34px; }
.auth-heading p { color: var(--muted); line-height: 1.55; }
.login-form { display: grid; gap: 15px; margin-top: 24px; }
.install-form { display: grid; gap: 25px; }
.install-form fieldset { padding: 20px; border: 1px solid var(--line); border-radius: 18px; }
.install-form legend { padding: 0 8px; color: var(--navy); font-weight: 900; }
.alert { padding: 13px 15px; margin: 15px 0; border-radius: 12px; font-size: 13px; line-height: 1.45; }
.alert p { margin: 0; }
.alert p + p { margin-top: 5px; }
.alert-error { color: #87383d; background: #feecee; border: 1px solid #f5cbd0; }
.alert-success { color: #276946; background: #e5f7ed; border: 1px solid #c6ead5; }

@media (max-width: 1100px) {
    .workbench-grid, .worksheet-library { grid-template-columns: repeat(2, 1fr); }
    .resource-row { grid-template-columns: 1fr; }
    .editor-layout { grid-template-columns: 92px minmax(620px, 1fr); }
    .properties-panel { position: absolute; right: 0; top: 78px; bottom: 0; width: 294px; z-index: 5; box-shadow: -10px 0 30px rgba(36,51,74,.12); }
    .topbar { grid-template-columns: auto 1fr auto; }
    .user-menu > div { display: none; }
}

@media (max-width: 780px) {
    .topbar { height: auto; grid-template-columns: 1fr auto; padding: 11px 16px; }
    .brand-button img { width: 160px; }
    .topnav { grid-column: 1 / -1; grid-row: 2; overflow-x: auto; }
    .nav-pill { flex: 1; white-space: nowrap; }
    .user-menu .text-link { display: none; }
    .app-shell { width: min(100% - 26px, 1320px); padding-top: 24px; }
    .welcome-strip, .page-heading { align-items: stretch; flex-direction: column; }
    .welcome-strip { display: flex; }
    .workbench-grid, .worksheet-library, .template-grid { grid-template-columns: 1fr; }
    .workbench-card { min-height: 140px; grid-template-columns: 58px 1fr; padding: 19px; }
    .card-icon { width: 56px; height: 56px; }
    .card-arrow { display: none; }
    .choice-grid, .two-columns, .toggle-grid { grid-template-columns: 1fr; }
    .form-step { grid-template-columns: 1fr; }
    .creator-panel { padding: 28px 20px; }
    .editor-toolbar { flex-wrap: wrap; }
    .editor-brand img, .save-status { display: none; }
    .editor-screen { grid-template-rows: auto 1fr; }
    .editor-layout { grid-template-columns: 70px minmax(620px, 1fr); }
    .canvas-stage { padding: 25px; }
    .properties-panel { display: none; }
}

/* 0.1.2: readable controls and locally hosted school handwriting. */
.creator-panel { width: min(1020px, 100%); padding: 32px 36px; }
.creator-intro { padding-right: 34px; }
.creator-intro h2 { font-size: clamp(26px, 3.4vw, 36px); line-height: 1.16; }
.creator-intro p { font-size: 18px; color: #4f5f74; }
.creator-form { gap: 30px; }
.form-step { grid-template-columns: 40px minmax(0, 1fr); gap: 16px; }
.form-step > div, .form-grid label { min-width: 0; }
.form-step h3 { font-size: 21px; line-height: 1.35; }
.creator-form .form-grid label, .properties-content label { font-size: 17px; line-height: 1.4; }
.creator-form input, .creator-form select, .properties-content input, .properties-content select, .properties-content textarea { font-size: 18px; min-width: 0; min-height: 50px; }
.choice-chip span { font-size: 17px; line-height: 1.4; min-height: 54px; display: grid; place-items: center; padding: 13px 12px; }
.toggle-grid span { font-size: 17px; line-height: 1.45; min-height: 52px; display: flex; align-items: center; padding-left: 42px; }
.choice-chip input:focus-visible + span, .toggle-grid input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 3px; }
.creator-form .primary-button { font-size: 19px; min-height: 56px; }
.panel-tabs button, .quick-adapt > span, .property-empty p { font-size: 16px; }
.quick-adapt button { font-size: 16px; min-height: 44px; }
.font-preview { margin-top: 22px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 20px; }
.font-preview-label { font: 600 16px/1.5 system-ui, sans-serif; color: #4f5f74; }
.font-preview p { font-size: 30px; line-height: 2; margin: 4px 0 12px; overflow-wrap: anywhere; font-weight: 400; font-synthesis: none; }
.font-preview-model { font-family: 'Integra Escolar'; }
.font-preview-dots { font-family: 'Integra Escolar Puntos'; }
.worksheet-page[data-font="school-linked"] .syllable-list span { font-family: 'Integra Escolar'; font-weight: 400; line-height: 2; }
.worksheet-page[data-font="dotted"] .learning-text { line-height: 2; font-synthesis: none; }
.learning-text { overflow-wrap: anywhere; }
@media (max-width: 780px) {
    .modal-layer { padding: 10px; }
    .creator-panel { padding: 24px 18px; max-height: calc(100dvh - 20px); border-radius: 20px; }
    .form-step { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .creator-intro h2 { padding-right: 8px; }
    .close-modal { right: 12px; top: 12px; }
    .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .two-columns, .toggle-grid { grid-template-columns: minmax(0, 1fr); }
    .creator-form select { max-width: 100%; }
    .font-preview { padding: 14px; }
    .font-preview p { font-size: 27px; }
}
@media (max-width: 360px) { .choice-grid { grid-template-columns: minmax(0, 1fr); } }

@page { size: A4 portrait; margin: 0; }
@media print {
    html, body { width: 210mm; min-height: 297mm; background: white !important; }
    body { overflow: visible !important; }
    .no-print, .topbar, .app-shell, .modal-layer, .tool-dock, .properties-panel, .editor-toolbar, .toast { display: none !important; }
    .editor-screen { position: static !important; display: block !important; background: white; }
    .editor-layout, .canvas-stage { display: block !important; padding: 0 !important; overflow: visible !important; background: white !important; }
    .worksheet-page { width: 210mm; min-height: 297mm; margin: 0; box-shadow: none; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .worksheet-block { break-inside: avoid; border-color: #dbe6e4 !important; box-shadow: none !important; }
    .worksheet-title { color: var(--navy); }
}

/* 0.1.4 — illustrated activities and accessible image controls */
[hidden] { display: none !important; }
.tool-dock button { font-size: 13px; min-height: 62px; }
.properties-content { font-size: 16px; }
.properties-content label { font-size: 16px; }
.properties-content input, .properties-content textarea, .properties-content select { font-size: 17px; }
.properties-content button { font-size: 15px; }
.worksheet-page.low-load .worksheet-block:nth-child(n+4) { display: block; }
.illustrated-rows { display: grid; gap: 4mm; }
.illustrated-row { display: grid; grid-template-columns: minmax(0,1fr); align-items: center; gap: 5mm; break-inside: avoid; }
.illustrated-row.has-image { grid-template-columns: var(--image-size,27mm) minmax(0,1fr); }
.activity-image { display: block; width: var(--image-size,27mm); height: var(--image-size,27mm); object-fit: contain; max-width: 100%; }
.word-work { min-width: 0; overflow-wrap: anywhere; }
.word-work .trace-text { font-size: calc(var(--worksheet-font-size) * 1.45); }
.word-work .learning-text { display: block; }
.scene-image { display: block; width: 100%; max-height: 67mm; object-fit: contain; margin: 0 auto 5mm; }
.complete-answer { display: grid; grid-template-columns: minmax(0,1fr); gap: 4mm; }
.complete-answer:has(.learning-text) { grid-template-columns: minmax(20mm,1fr) minmax(0,1.4fr); align-items: center; }
.matching-list { display: grid; gap: 3mm; }
.matching-row { display: grid; grid-template-columns: 43% 57%; align-items: center; break-inside: avoid; }
.match-picture { display: flex; gap: 5mm; align-items: center; }
.match-word { display: flex; flex-wrap: wrap; gap: 2mm 4mm; align-items: center; min-width: 0; }
.match-word .learning-text { overflow-wrap: anywhere; }
.match-word .trace-text { width: 100%; padding-left: 8mm; font-size: calc(var(--worksheet-font-size) * 1.25); }
.match-dot { font-family: sans-serif; font-size: 11px; }
.picture-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7mm; }
.picture-tile { display: flex; flex-direction: column; align-items: center; gap: 3mm; break-inside: avoid; }
.picture-tile .learning-text { text-align: center; overflow-wrap: anywhere; max-width: 100%; }
.sequence-answer { display: block; width: 10mm; height: 10mm; border: 1px solid #8da0a6; border-radius: 2mm; }
.empty-image { display: grid; place-items: center; height: var(--image-size,27mm); width: var(--image-size,27mm); border: 1px dashed #aec3c5; border-radius: 3mm; padding: 2mm; font-size: 12px; text-align: center; color: #52666d; }
.reading-text { white-space: pre-wrap; line-height: 2; margin: 2mm 0; overflow-wrap: anywhere; }
.grayscale-images .activity-image,.grayscale-images .scene-image { filter: grayscale(1); }
.image-credits { font: 8px/1.5 system-ui,sans-serif; color: #41545e; margin: 7mm 0 0; overflow-wrap: anywhere; }
.worksheet-footer { position: static; margin-top: 9mm; }
.image-properties { display: grid; gap: 12px; border-top: 1px solid #d4e1df; padding-top: 16px; }
.image-controls { display: flex; gap: 7px; flex-wrap: wrap; }
.image-edit-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 10px 0; border-bottom: 1px solid #dce7e4; }
.image-edit-row > span { flex: 1; min-width: 70px; overflow-wrap: anywhere; }
.image-edit-row button { padding: 8px; min-height: 38px; }
.image-thumb { width: 42px; height: 42px; object-fit: contain; }
.mobile-properties { display: none; }
.images-modal { position: fixed; inset: 0; z-index: 150; background: #152e4fa8; padding: 24px; display: grid; place-items: center; }
.images-dialog { width: min(920px,100%); max-height: calc(100dvh - 48px); overflow-y: auto; padding: 28px; border-radius: 24px; background: #fffefa; color: #253c52; box-shadow: 0 18px 90px #152e4f45; font: 17px/1.5 system-ui,sans-serif; }
.images-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.images-heading h2 { margin: 7px 0; color: #102c57; font-size: 30px; }
.images-heading p { margin: 0 0 20px; }
.image-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 20px; }
.image-tabs button { border: 1px solid #cbdcda; border-radius: 12px; padding: 11px 14px; min-height: 44px; background: white; font: inherit; font-weight: 600; cursor: pointer; color: #183959; }
.image-tabs button.active { background: #dff6f0; border-color: #00a8ad; }
.images-dialog label { display: grid; gap: 6px; font-weight: 600; }
.images-dialog input:not([type=checkbox]), .images-dialog textarea,.images-dialog select { width: 100%; min-width: 0; border: 1px solid #bdcfce; border-radius: 10px; background: white; color: #213c55; font: 17px/1.5 system-ui,sans-serif; padding: 11px 13px; }
.images-dialog .inline-toggle { display: flex; align-items: flex-start; gap: 10px; }
.images-dialog .inline-toggle input { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 3px; }
.image-form { display: grid; gap: 16px; }
.image-form p { margin: 0; }
.image-form .primary-button { justify-self: start; }
.image-search-row { display: flex; align-items: end; gap: 12px; }
.image-search-row label { flex: 1; min-width: 0; }
.image-hint,.license-note { font-size: 15px; line-height: 1.6; color: #536776; }
.license-note { background: #f3f5ed; padding: 14px; border-radius: 10px; }
.image-results { display: grid; grid-template-columns: repeat(auto-fill,minmax(125px,1fr)); gap: 12px; }
.image-result { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; padding: 12px 8px; border: 1px solid #d7e2df; border-radius: 14px; background: white; color: #183959; font: 16px/1.4 system-ui,sans-serif; cursor: pointer; }
.image-result:hover,.image-result:focus-visible { border-color: #00a8ad; outline: 2px solid #b9eae0; }
.image-result img { width: 100%; height: 100px; object-fit: contain; }
.image-result span { overflow-wrap: anywhere; max-width: 100%; }
.images-dialog button:disabled { opacity: .6; cursor: wait; }
#image-status { min-height: 24px; font-weight: 600; }
#image-status.error { color: #a52c36; }
.upload-panel { padding: 18px; border: 2px dashed #a6ccca; border-radius: 15px; }
.upload-control { margin: 20px 0; }
.generated-preview { display: block; max-height: 360px; max-width: 100%; margin: 16px auto; }
@media(max-width:1100px) {
 .mobile-properties { display: inline-flex; }
 .properties-panel { display: none; }
 .properties-open .properties-panel { display: block; width: min(370px,calc(100vw - 24px)); z-index: 12; top: 0; }
 #close-properties { margin: 14px; }
 .editor-actions { flex-wrap: wrap; justify-content: flex-end; }
 .editor-toolbar { min-height: 96px; height: auto; }
 .editor-layout { grid-template-columns: 90px minmax(0,1fr); }
 .canvas-stage { padding: 22px; }
}
@media(max-width:600px) {
 .images-modal { padding: 8px; }
 .images-dialog { padding: 17px; max-height: calc(100dvh - 16px); border-radius: 17px; }
 .images-heading h2 { font-size: 26px; }
 .images-heading p { font-size: 16px; }
 .image-tabs { gap: 6px; }
 .image-tabs button { padding: 9px; font-size: 15px; }
 .image-results { grid-template-columns: repeat(2,minmax(0,1fr)); }
 .image-search-row { flex-wrap: wrap; }
 .image-search-row label { flex-basis: 100%; }
 .editor-brand img,.editor-brand > div { display: none; }
 .editor-toolbar { gap: 6px; padding: 10px; }
 .editor-actions { gap: 6px; }
 .editor-actions button { font-size: 13px; padding: 10px; min-height: 40px; }
 .save-status { width: 100%; text-align: right; }
}
@page { size: A4 portrait; margin: 12mm; }
@media print {
 html,body { width: auto; min-height: 0; }
 .worksheet-page { width: 100%; min-height: 0; padding: 0; overflow: visible; }
 .worksheet-blocks { display: block; }
 .worksheet-block { margin: 0 0 4mm; break-inside: avoid; }
 .worksheet-page::before { display: none; }
 .worksheet-footer { position: static; margin-top: 6mm; }
 .illustrated-row,.matching-row,.picture-tile { break-inside: avoid; }
 .worksheet-page.low-load .worksheet-block:nth-child(n+4) { display: block; }
}

.image-edit-row .text-link { border: 0; background: transparent; color: #195b96; cursor: pointer; }

/* 0.1.5 — printable area, trace distribution and image administration */
.worksheet-blocks { padding-top: 5mm; }
.illustrated-rows.columns-2 { grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 7mm; }
.illustrated-rows.columns-2 .illustrated-row { min-width: 0; gap: 3mm; }
.illustrated-rows.columns-2 .illustrated-row.has-image { grid-template-columns: minmax(18mm,var(--image-size,27mm)) minmax(0,1fr); }
.illustrated-rows.columns-2 .activity-image { width: min(var(--image-size,27mm),100%); }
.illustrated-rows.columns-2 .trace-text { font-size: calc(var(--worksheet-font-size) * 1.15); }
.trace-layout-controls { display: grid; gap: 12px; padding: 15px; background: #eef8f5; border: 1px solid #d4e6e1; border-radius: 14px; }
.trace-layout-controls > strong { color: var(--navy); }
.trace-layout-controls small { color: #536776; line-height: 1.45; }
.admin-heading { align-items: center; }
.admin-status { display: inline-flex; align-items: center; min-height: 38px; padding: 8px 13px; border-radius: 999px; color: #795b1f; background: #fff2c9; font-weight: 800; }
.admin-status.ready { color: #216c4b; background: #dff4e9; }
.admin-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.admin-card { display: grid; grid-template-columns: 48px minmax(0,1fr); align-content: start; gap: 14px 16px; padding: 24px; background: white; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 10px 30px rgba(36,51,74,.06); }
.admin-card > label,.admin-card > a { grid-column: 1/-1; }
.admin-card h2 { margin: 0 0 5px; color: var(--navy); font-size: 21px; }
.admin-card p { margin: 0; color: var(--muted); line-height: 1.5; }
.admin-card label { display: grid; gap: 8px; color: #4f5f74; font-size: 16px; font-weight: 800; }
.admin-card input:not([type=checkbox]),.admin-card select { width: 100%; min-height: 50px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; background: white; color: var(--ink); font-size: 16px; }
.admin-card small { font-weight: 500; line-height: 1.5; }
.admin-card-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; color: var(--turquoise); background: var(--mint); font-size: 22px; font-weight: 900; }
.admin-save { grid-column: 1/-1; display: flex; align-items: center; gap: 16px; }
.admin-usage { margin-top: 28px; padding: 24px; background: white; border: 1px solid var(--line); border-radius: 20px; }
.admin-table-wrap { overflow-x: auto; }
.admin-usage table { width: 100%; border-collapse: collapse; }
.admin-usage th,.admin-usage td { padding: 14px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.admin-usage th { color: #607082; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.admin-usage td strong,.admin-usage td small { display: block; }
.admin-usage td small { margin-top: 3px; color: var(--muted); }
.admin-usage td:last-child { text-align: right; }
@media(max-width:780px){
 .admin-grid { grid-template-columns: minmax(0,1fr); }
 .admin-save { grid-column: auto; align-items: stretch; flex-direction: column; }
}
@media(max-width:600px){
 .illustrated-rows.columns-2 { grid-template-columns: minmax(0,1fr); }
}
@media print {
 .worksheet-blocks { padding-top: 5mm; }
 .illustrated-rows.columns-2 { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

/* Banco propio 0.1.7 */
.bank-filters {display:grid;grid-template-columns:1fr 1fr auto;align-items:end;gap:12px;margin:12px 0;}
#bank-count {font-weight:650;color:#173657;}
#bank-selection-actions:not([hidden]) {display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin:12px 0 20px;}
.image-result.selected {border:3px solid #00a9af;background:#e1f6ef;padding:10px 6px;}
.image-result.selected::after {content:'✓ Seleccionada';color:#006a70;font-size:13px;font-weight:bold;}
@media(max-width:600px){.bank-filters{grid-template-columns:1fr;}.bank-filters button{justify-self:start;}}

@media(max-width:600px){
 .images-heading h2{font-size:25px;margin:4px 0;}
 .images-heading p{display:none;}
 .image-tabs{flex-wrap:nowrap;overflow-x:auto;padding-bottom:6px;}
 .image-tabs button{flex:0 0 auto;white-space:nowrap;}
 .bank-filters{grid-template-columns:1fr 1fr;gap:8px;}
 .bank-filters button{grid-column:1/-1;min-height:36px;padding:6px 12px;}
 #bank-count{font-size:15px;margin:8px 0;}
 [data-image-panel=bank] .image-hint{font-size:14px;margin:8px 0;}
 .bank-filters label{font-size:15px;}
 .bank-filters select{padding:8px;font-size:16px;}
}
