:root{--page-width: 210mm;--page-height: 297mm;--cursor-x: 0px;--cursor-y: 0px;font-family:Bai Jamjuree,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;color:#0f172a;background-color:#e6edf7;line-height:1.4}*{box-sizing:border-box}body{margin:0;min-height:100vh;background:radial-gradient(circle at 20% 20%,rgba(255,255,255,.45),transparent 45%),radial-gradient(circle at 78% 25%,rgba(148,163,184,.2),transparent 55%),radial-gradient(circle at 60% 80%,rgba(191,219,254,.25),transparent 45%),linear-gradient(135deg,#eff3fb,#d7e3f4 35%,#cfe5ff);position:relative;overflow-x:hidden}body:before{content:"";position:fixed;top:0;right:0;bottom:0;left:0;pointer-events:none;background-image:url("data:image/svg+xml,%3Csvg width='160' height='120' viewBox='0 0 160 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%2381a1d1' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M20 30h40v40c-12 6-28 6-40 0z'/%3E%3Cpath d='M100 20h32v44c-10 5-22 5-32 0z'/%3E%3Cpath d='M24 32v36M60 32v36M104 22v40M132 22v40'/%3E%3Cpath d='M20 78h40M100 70h32' stroke='%2394a3b8'/%3E%3Ctext x='80' y='110' text-anchor='middle' font-family='Bai Jamjuree' font-size='18' fill='%2381a1d1' opacity='0.35'%3EPractice Makes Perfect%3C/text%3E%3C/g%3E%3C/svg%3E");background-size:220px;opacity:.25;mix-blend-mode:multiply;transform:translate(calc(var(--cursor-x) * .02),calc(var(--cursor-y) * .02));transition:transform .3s ease;z-index:-2}body:after{content:"";position:fixed;top:0;right:0;bottom:0;left:0;pointer-events:none;background:radial-gradient(circle at calc(50% + var(--cursor-x) * .03) calc(30% + var(--cursor-y) * .03),rgba(255,255,255,.35),transparent 55%);mix-blend-mode:screen;opacity:.5;transition:background-position .3s ease;z-index:-1}@media(prefers-reduced-motion:reduce){body:before,body:after{transition:none;transform:none;background-position:center}}main{min-height:100vh}.app-shell{max-width:1200px;margin:0 auto;padding:2rem 1.5rem 4rem;display:flex;flex-direction:column;gap:1.5rem}.app-header{background:linear-gradient(110deg,#f8fafcf2,#d6e3f7f2);border-radius:1rem;padding:1.25rem 1.5rem;box-shadow:0 10px 30px #0f172a26;border:1px solid rgba(148,163,184,.4)}.app-header h1{margin:0 0 .4rem;color:#324982;font-weight:100}.app-header p{margin:0;color:#475569}.controls-panel{display:grid;grid-template-columns:1fr;gap:1.25rem;padding:1.25rem;background:linear-gradient(145deg,#fff,#f0f9ff);border-radius:1.2rem;border:1px solid rgba(59,130,246,.2);box-shadow:0 18px 45px #0f172a1f}.simple-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:1rem}.control-group input,.control-group select{border:1px solid #cbd5f5;border-radius:.5rem;padding:.55rem .65rem;font-size:.95rem;background:#fff}.page-list{display:flex;flex-direction:column;gap:.75rem}.page-header{display:flex;justify-content:space-between;align-items:center}.page-header p,.word-page-header p{margin:0;font-weight:600;color:#0f172a}.page-card{border:1px solid rgba(59,130,246,.2);border-radius:1rem;padding:.95rem;background:linear-gradient(150deg,#fff 60%,#edf5ff);box-shadow:0 15px 35px #0f172a1f;display:flex;flex-direction:column;gap:.6rem;position:relative}.page-card-header{display:flex;justify-content:space-between;align-items:center;font-weight:600;padding-right:2.5rem}.page-card-actions{display:flex;align-items:center;gap:.85rem}.card-close{position:absolute;top:-12px;right:-12px;width:34px;height:34px;border-radius:999px;border:2px solid #fff;background:linear-gradient(145deg,#dbeafe,#bfdbfe);color:#1e293b;font-size:1.15rem;line-height:1;display:flex;align-items:center;justify-content:center;box-shadow:0 6px 16px #0f172a2e;cursor:pointer;transition:transform .15s ease,box-shadow .15s ease}.card-close:hover{transform:translateY(-1px);box-shadow:0 10px 20px #0f172a38}.card-close:active{transform:translateY(0);box-shadow:0 5px 10px #0f172a2e}.page-card-title{margin:0;display:flex;flex-direction:column;gap:.2rem;color:#0f172a}.page-card-summary{font-size:.85rem;font-weight:200;color:#334155}.page-card-body{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:.75rem}.control-group{display:flex;flex-direction:column;gap:.35rem}.control-group label{font-weight:600;font-size:.9rem}.control-group select,.control-group input{border:1px solid #a5b4fc;border-radius:.5rem;padding:.55rem .65rem;font-size:.95rem;width:100%;box-sizing:border-box;background:#fffffff2;box-shadow:inset 0 1px 4px #0f172a14}.control-group small{color:#64748b;font-size:.75rem}.muted{color:#475569;font-size:.85rem}.mix-list{display:flex;flex-direction:column;gap:.75rem}.mix-header{display:flex;justify-content:space-between;align-items:center}.mix-header p{margin:0;font-weight:600;color:#0f172a}.add-button{border:1px solid #94a3b8;background:linear-gradient(145deg,#f8fafc,#eef2ff);color:#0f172a;font-weight:500;padding:.4rem .9rem;border-radius:999px;font-size:.9rem;display:inline-flex;align-items:center;gap:.35rem;cursor:pointer;box-shadow:0 6px 12px #0f172a1a;transition:transform .15s ease,box-shadow .15s ease}.add-button:hover{transform:translateY(-1px);box-shadow:0 10px 18px #0f172a26}.add-button:active{transform:translateY(0);box-shadow:0 4px 8px #0f172a1f}.mix-header button{background:transparent;border:1px dashed #94a3b8;border-radius:.5rem;padding:.35rem .8rem;font-weight:600;cursor:pointer}.mix-card{border:1px solid rgba(14,165,233,.2);border-radius:.95rem;padding:.85rem;display:flex;flex-direction:column;gap:.5rem;background:linear-gradient(160deg,#e0f2fee6,#eef2ffe6);box-shadow:0 12px 26px #0f172a1a}.mix-card-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:.75rem}.allocation-warning{margin:0;font-size:.85rem;color:#475569}.allocation-warning.error{color:#be123c;font-weight:600}.word-page-controls button.tertiary,.mix-card .tertiary{background:transparent;color:#1d4ed8;box-shadow:none;padding:.35rem .65rem;border:none;align-self:flex-start}.fab-container{position:fixed;bottom:2rem;right:2rem;display:flex;flex-direction:column;align-items:flex-end;gap:.75rem;z-index:50}.fab{border-radius:999px;border:none;font-size:.95rem;font-weight:100;color:#fff;background:#22c55e;box-shadow:0 6px 20px #0f172a40;cursor:pointer;padding:.65rem 1.1rem;display:inline-flex;gap:.5rem;align-items:center}.fab.secondary{background:#facc15;color:#0f172a}.fab:disabled{opacity:.4;cursor:not-allowed;box-shadow:none}.fab-text{display:inline-block;font-size:.95rem;font-weight:100}.fab-icon{font-size:1.35rem;width:1.4rem;text-align:center;line-height:1}.fab[data-tooltip]{position:relative}.fab[data-tooltip]:after{content:attr(data-tooltip);position:absolute;right:100%;margin-right:.5rem;background:#0f172ad9;color:#fff;padding:.35rem .6rem;border-radius:.5rem;font-size:.75rem;white-space:nowrap;opacity:0;transform:translateY(10px);pointer-events:none;transition:opacity .15s ease,transform .15s ease}.fab[data-tooltip]:hover:after{opacity:1;transform:translateY(0)}.fab-icon{font-size:1.1rem}.word-page-controls{width:100%;border:1px dashed rgba(79,70,229,.3);border-radius:1rem;padding:1rem;display:flex;flex-direction:column;gap:.75rem;background:linear-gradient(145deg,#f5f7ff,#e2e8f9);box-shadow:inset 0 1px 8px #4f46e514}.word-page-header{display:flex;justify-content:space-between;align-items:center}.word-page-card{border:1px solid rgba(99,102,241,.35);border-radius:1rem;padding:1rem;display:flex;flex-direction:column;gap:.8rem;background:linear-gradient(150deg,#fff 60%,#ddd6fee6);box-shadow:0 18px 38px #4f46e526}.word-card-header{display:flex;justify-content:space-between;gap:1rem;align-items:center}.word-card-title{margin:0;font-weight:600;font-size:1rem}.word-card-body{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:.75rem}.word-card-custom{border-top:1px dashed #dbeafe;padding-top:.75rem;display:flex;flex-direction:column;gap:.6rem}.word-ops-section{display:flex;flex-direction:column;gap:.35rem}.word-ops-section p{margin:0;font-weight:600;color:#0f172a;font-size:.9rem}.word-ops-list{display:flex;flex-wrap:wrap;gap:.4rem;width:100%}.chip-control{position:relative;display:inline-flex}.chip-control input{position:absolute;opacity:0;pointer-events:none}.chip-control span{display:inline-flex;align-items:center;justify-content:center;gap:.25rem;font-size:.9rem;border:1.5px solid #cbd5f5;border-radius:999px;padding:.45rem .95rem;background:#fff;box-shadow:0 1px 3px #0f172a14;transition:all .15s ease;min-width:4.5rem}.chip-control input:checked+span{background:#2563eb;color:#fff;border-color:#1d4ed8;box-shadow:0 4px 10px #2563eb40;font-weight:600}.word-page-actions{width:100%;display:flex;justify-content:flex-end}.word-digit-radios{display:flex;flex-wrap:wrap;gap:.4rem}.preview-panel{display:flex;flex-direction:column;gap:2rem;margin-bottom:4rem}.preview-status,.preview-error{font-weight:600}.preview-error{color:#be123c}.worksheet-page{background:#fff;padding:1.1rem 1.25rem;border:1px solid #dbeafe;border-radius:.85rem;box-shadow:0 8px 28px #3b82f61f;page-break-after:auto;page-break-inside:avoid;break-inside:avoid;display:flex;flex-direction:column;width:100%;font-size:1.05rem}.worksheet-header{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start;border-bottom:2px solid #e2e8f0;padding-bottom:.75rem}.worksheet-title{margin:0;font-size:1.15rem;font-weight:700}.worksheet-subtitle{margin:.2rem 0 0;color:#475569;font-size:.9rem}.worksheet-page-number{font-weight:600}.worksheet-meta-row{display:flex;flex-wrap:wrap;gap:1rem;align-items:flex-start;margin:1rem 0 .75rem}.worksheet-meta-row .accuracy-box{flex:1 1 280px;margin:0}.worksheet-meta{display:flex;flex-direction:column;gap:.7rem;color:#0f172a;font-weight:600;font-size:.9rem;line-height:1.6;flex:1 1 320px}.worksheet-meta div{display:flex;align-items:flex-end;min-height:2rem;width:100%;white-space:nowrap;flex-wrap:nowrap}.meta-blank{display:inline-block;border-bottom:1px solid #94a3b8;width:100%;max-width:320px;margin-left:.6rem;padding-bottom:.45rem}.time-meta{display:flex;flex-direction:column;gap:.6rem}.time-meta .meta-blank{margin-left:.6rem;width:100%;max-width:320px;padding-bottom:.45rem}.time-meta div{white-space:nowrap;flex-wrap:nowrap}.accuracy-box{border:1px dashed #94a3b8;border-radius:.75rem;padding:.45rem .75rem;background:#fff;font-size:.85rem}.accuracy-box p{margin:0 0 .45rem;font-weight:600;text-align:left}.accuracy-box ul{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:.25rem}.accuracy-box li{display:flex;align-items:center;gap:.5rem;border-bottom:1px dashed #e2e8f0;padding-bottom:.2rem;font-weight:600;color:#0f172a}.accuracy-option-label{min-width:52px}.accuracy-choice-box{width:1.25rem;height:1.25rem;border:2px solid #94a3b8;border-radius:50%}.accuracy-note{font-weight:400;color:#475569;margin-left:.75rem}.accuracy-reviewer-note{margin:.4rem 0 0;font-size:.75rem;color:#475569;font-weight:500;text-align:right}.worksheet-grid{display:grid;column-gap:1rem;row-gap:1.3rem;margin-top:1rem;flex:1;min-height:0;grid-auto-rows:minmax(0,1fr)}.worksheet-grid-spacious{row-gap:2rem}.word-grid{row-gap:1.5rem}.problem-cell{border:1px dashed #cbd5f5;border-radius:.75rem;padding:.6rem;display:flex;align-items:center;justify-content:center;font-size:2rem;font-weight:600;color:#0f172a;font-variant-numeric:tabular-nums;break-inside:avoid;page-break-inside:avoid;min-height:90px}.problem-index{font-size:.85rem;margin-right:.45rem;color:#475569;font-weight:600;min-width:2.2rem;text-align:center;display:inline-flex;justify-content:center;align-items:center;white-space:nowrap}.problem-cell.single-line{justify-content:flex-start}.problem-cell.word-problem{align-items:center;grid-column:1 / -1;min-height:140px;justify-content:flex-start}.word-problem-content{display:flex;align-items:center;gap:.75rem;width:100%}.word-problem-text{flex:1;white-space:normal;margin:0;font-weight:500;line-height:1.45;font-size:1.15rem}.show-work-area{width:100%;margin-top:.35rem;border-bottom:1px dashed #94a3b8;min-height:2.4rem}.single-line-operation{display:flex;gap:.5rem;align-items:flex-end;width:100%;padding-bottom:.2rem}.answer-space{flex:1;min-width:70px;border-bottom:2px solid #94a3b8;margin-left:.35rem;padding-bottom:.4rem}.problem-cell.stacked{flex-direction:column;align-items:flex-start;min-height:110px}.problem-meta{width:100%;display:flex;justify-content:flex-start}.stacked-operation{width:100%;margin-top:.2rem}.stacked-row{display:flex;justify-content:flex-end;gap:.25rem;font-size:2rem}.stacked-row.bottom{border-bottom:2px solid #94a3b8;padding-bottom:.5rem}.operator-symbol{margin-right:.5rem}.answer-line{height:16px;border-bottom:2px solid #94a3b8;margin-top:.6rem}@page{size:A4;margin:0}@media print{body{background:#fff}.app-shell{padding:0}.controls-panel,.app-header{display:none}.worksheet-page{border:none;box-shadow:none;border-radius:0;padding:12mm 15mm 14mm;page-break-after:always;page-break-inside:avoid;width:var(--page-width);margin:0}.worksheet-page:last-of-type{page-break-after:auto}.worksheet-grid{gap:.5rem;break-inside:avoid;page-break-inside:avoid}.problem-cell{break-inside:avoid;page-break-inside:avoid;font-size:2rem;min-height:unset}}.word-switch-inline{display:flex;align-items:center;justify-content:flex-end;gap:.4rem;color:#475569;font-size:.85rem;font-weight:500}.ios-switch{position:relative;width:48px;height:24px;display:inline-block}.ios-switch--compact{width:34px;height:18px}.ios-switch input{opacity:0;width:0;height:0}.ios-switch-slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#cbd5f5;border-radius:24px;transition:.2s}.ios-switch-slider:before{position:absolute;content:"";height:20px;width:20px;left:2px;bottom:2px;background-color:#fff;border-radius:50%;transition:.2s;box-shadow:0 1px 3px #0f172a40}.ios-switch--compact .ios-switch-slider{border-radius:18px}.ios-switch--compact .ios-switch-slider:before{height:14px;width:14px;left:2px;bottom:2px}.ios-switch input:checked+.ios-switch-slider{background-color:#2563eb}.ios-switch input:checked+.ios-switch-slider:before{transform:translate(24px)}.ios-switch--compact input:checked+.ios-switch-slider:before{transform:translate(16px)}
