@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Nunito:wght@400;600;700&family=Baloo+2:wght@700;800&family=Quicksand:wght@500;700&family=Merriweather:wght@700&family=Lora:wght@400;600&family=Inter:wght@400;500;600;700;800&display=swap');

*{box-sizing:border-box;margin:0;padding:0}
:root{
  /* Brand palette (trial — revert by restoring prior :root colors) */
  --brand-orange:#4F46E5;
  --brand-orange-hover:#4338CA;
  --brand-navy:#0F172A;
  --brand-teal:#06B6D4;
  --brand-dark-teal:#0891B2;
  --brand-gray:#64748B;
  --brand-light-blue:#60A5FA;
  --brand-blue:#4F46E5;
  --brand-blue-hover:#4338CA;
  --brand-yellow:#22C55E;
  --brand-fuchsia:#7C3AED;
  --brand-red:#4F46E5;
  --brand-neutral-0:#FFFFFF;
  --brand-neutral-1:#E2E8F0;
  --brand-neutral-2:#94A3B8;
  --brand-neutral-3:#0F172A;

  --pastel-yellow:#DBEAFE;
  --sky:#F8FAFC;
  --cloud:#ffffff;
  --accent:var(--brand-orange);
  --purple:var(--brand-teal);
  --green:var(--brand-dark-teal);
  --text:var(--brand-neutral-3);
  --font-heading:'Fredoka One',cursive;
  --font-body:'Nunito',sans-serif;
  /* Page backdrops (neutral + light teal / light blue wash) */
  --pastel-bg-home:linear-gradient(165deg,#F8FAFC 0%,#EEF2FF 42%,#E0F2FE 100%);
  --pastel-bg-tools:linear-gradient(180deg,#F8FAFC 0%,#EEF2FF 45%,#ECFEFF 100%);
  --pastel-bg-sky:linear-gradient(180deg,#F8FAFC 0%,#EFF6FF 52%,#ECFEFF 100%);
}

body{font-family:var(--font-body);background:var(--pastel-bg-sky);background-attachment:fixed;min-height:100vh;}
body:not(.home-page){
  background:var(--pastel-bg-tools);
  background-attachment:fixed;
}
/* Distinct soft pastel per Genie tool (overrides --pastel-bg-tools) */
body:not(.home-page):has(.math-gennie-app){
  background:linear-gradient(165deg,#EFF6FF 0%,#EEF2FF 52%,#ECFEFF 100%);
}
body:not(.home-page):has(.reading-gennie-app){
  background:linear-gradient(165deg,#EEF2FF 0%,#E0F2FE 48%,#F8FAFC 100%);
}
body:not(.home-page)[data-word-mode="questions"]{
  background:linear-gradient(165deg,#F5F3FF 0%,#EEF2FF 46%,#ECFEFF 100%);
}
body:not(.home-page)[data-word-mode="flashcards"]{
  background:linear-gradient(165deg,#F8FAFC 0%,#EFF6FF 42%,#EEF2FF 100%);
}
body:not(.home-page):has(.crossword-gennie-app){
  background:linear-gradient(165deg,#ECFEFF 0%,#E0F2FE 50%,#EEF2FF 100%);
}
body:not(.home-page):has(.science-gennie-app){
  background:linear-gradient(165deg,#ECFEFF 0%,#E0F2FE 45%,#F0FDF4 100%);
}
body:not(.home-page):has(.grammar-gennie-app){
  background:linear-gradient(165deg,#F8FAFC 0%,#EEF2FF 42%,#F1F5F9 100%);
}
body:not(.home-page):has(.bilingual-gennie-app){
  background:linear-gradient(165deg,#EEF2FF 0%,#F5F3FF 44%,#ECFEFF 100%);
}
body[data-theme="playful"]{
  --sky:#f8fafc;
  --pastel-bg-sky:linear-gradient(180deg,#F8FAFC 0%,#E0F2FE 42%,#EEF2FF 100%);
  --pastel-bg-home:linear-gradient(165deg,#F8FAFC 0%,#E0F2FE 35%,#EEF2FF 70%,#ECFEFF 100%);
  --pastel-bg-tools:linear-gradient(180deg,#F8FAFC 0%,#EFF6FF 40%,#ECFEFF 100%);
  --cloud:#ffffff;
  --accent:var(--brand-orange);
  --purple:var(--brand-teal);
  --green:var(--brand-light-blue);
  --text:var(--brand-neutral-3);
  --font-heading:'Baloo 2','Fredoka One',cursive;
  --font-body:'Quicksand',sans-serif;
}
body[data-theme="calm"]{
  --sky:#eef2f4;
  --pastel-bg-sky:linear-gradient(180deg,#eef2f4 0%,#f4f3f2 100%);
  --pastel-bg-home:linear-gradient(165deg,#eef2f4 0%,#f0f3f5 50%,#eceff1 100%);
  --pastel-bg-tools:linear-gradient(180deg,#eceff1 0%,#f2f4f6 100%);
  --cloud:#ffffff;
  --accent:var(--brand-navy);
  --purple:var(--brand-dark-teal);
  --green:var(--brand-gray);
  --text:var(--brand-neutral-3);
  --font-heading:'Merriweather',serif;
  --font-body:'Lora',serif;
}

.header h1,
.input-card label,
.story-title,
.questions-title,
.mcq-title,
.mcq-q,
.vocab-list-title,
.vocab-list strong,
.vocab-word,
.magic-word,
.mcq-score,
.question-score,
.pdf-overlay-box p,
.img-generating{
  font-family:var(--font-heading);
}

/* Tabs + primary actions: same UI font as body (not display headings) */
.input-tab,
.btn,
.read-btn{
  font-family:var(--font-body);
  font-weight:500;
  line-height:1.25;
}
body:not(.home-page) .input-tab,
body:not(.home-page) .btn,
body:not(.home-page) .read-btn{
  font-family:'Inter',var(--font-body),sans-serif;
}

body,
textarea,
.opt-row label,
.difficulty-select,
.theme-select,
.para-text,
.questions-list li,
.mcq-item li,
.question-edit-input,
.question-answer-space,
.question-text,
.question-feedback,
.mcq-feedback,
.vocab-meaning,
.progress-label,
.progress-step,
.header p,
.hint,
.file-name,
.upload-notice,
.regen-status,
.error-msg{
  font-family:var(--font-body);
}

/* Clouds */
.bg-wrap{position:fixed;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:0;overflow:hidden;}
.cloud{position:absolute;background:rgba(255,255,255,0.78);border-radius:50px;animation:drift linear infinite;}
.cloud::before,.cloud::after{content:'';position:absolute;background:inherit;border-radius:50%;}
.c1{width:120px;height:40px;top:8%;left:-140px;animation-duration:28s;}
.c1::before{width:60px;height:60px;top:-30px;left:15px;}
.c1::after{width:40px;height:40px;top:-20px;left:55px;}
.c2{width:80px;height:28px;top:22%;left:-100px;animation-duration:22s;animation-delay:6s;}
.c2::before{width:40px;height:40px;top:-20px;left:10px;}
.c2::after{width:30px;height:30px;top:-15px;left:38px;}
.c3{width:100px;height:35px;top:60%;left:-120px;animation-duration:35s;animation-delay:3s;}
.c3::before{width:50px;height:50px;top:-25px;left:12px;}
.c3::after{width:35px;height:35px;top:-18px;left:48px;}
@keyframes drift{to{transform:translateX(calc(100vw + 200px));}}

.app{position:relative;z-index:1;max-width:860px;margin:0 auto;padding:32px 20px 68px;}
body:not(.home-page) .app{
  max-width:none;
  width:min(1120px,94vw);
  padding-top:22px;
}

/* Header */
.header{text-align:center;margin-bottom:30px;animation:popIn .6s cubic-bezier(.34,1.56,.64,1) both;}
.header h1{font-size:2.9rem;color:var(--accent);text-shadow:3px 3px 0 rgba(240,111,189,0.18);}
.header .stars{font-size:1.6rem;display:block;margin-bottom:4px;letter-spacing:4px;}
.header p{font-size:1.02rem;color:#576873;font-weight:700;margin-top:4px;}
body:not(.home-page) .header{
  background:#fff;
  border:1px solid #e4e9f4;
  border-radius:16px;
  padding:18px 20px;
  box-shadow:0 2px 10px rgba(15,23,42,0.05);
}
body:not(.home-page) .header h1{
  font-family:'Inter',var(--font-body),sans-serif;
  font-size:2.25rem;
  font-weight:800;
  color:var(--brand-navy);
  text-shadow:none;
}
body:not(.home-page) .header .stars{
  letter-spacing:2px;
}
body:not(.home-page) .header p{
  color:#546478;
}

/* Input card */
.input-card{background:var(--cloud);border-radius:24px;padding:30px;box-shadow:0 10px 34px rgba(189,178,255,0.22),0 2px 10px rgba(0,0,0,0.05);border:1px solid rgba(255,229,236,0.9);animation:slideUp .5s .1s cubic-bezier(.34,1.56,.64,1) both;}
body:not(.home-page) .input-card{
  border-radius:16px;
  border:1px solid #e4e9f4;
  box-shadow:0 3px 14px rgba(15,23,42,0.06);
}
.input-card label{display:block;font-size:1.1rem;color:var(--purple);margin-bottom:11px;}
textarea{width:100%;min-height:160px;border:2.5px solid #cfe5ff;border-radius:16px;padding:16px;font-size:1rem;color:var(--text);resize:vertical;outline:none;transition:border-color .2s,box-shadow .2s;background:#fbfeff;line-height:1.7;}
textarea:focus{border-color:var(--purple);box-shadow:0 0 0 4px rgba(0,190,171,0.18);}
textarea::placeholder{color:#6f8594;}

.hint{font-size:.82rem;color:#627887;margin-top:8px;font-weight:700;}

.input-tabs{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:12px;
}
.input-tab{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:42px;
  padding:10px 18px;
  border:2px solid var(--brand-light-blue);
  border-radius:999px;
  font-size:.96rem;
  background:transparent;
  color:var(--brand-light-blue);
  cursor:pointer;
  transition:transform .15s,opacity .2s,background .15s,border-color .15s,color .15s;
}
body:not(.home-page) .input-tab{
  border:1px solid #cdddf6;
  color:#334155;
  background:#fff;
  min-height:42px;
  padding:10px 18px;
  font-size:.96rem;
}
body:not(.home-page) .input-tab:hover:not(:disabled):not(.active){
  background:#f8fafc;
  border-color:#b8c9e8;
}
body:not(.home-page) .input-tab:focus-visible{
  outline:none;
  box-shadow:0 0 0 3px rgba(8,106,191,0.12);
}
body:not(.home-page) .input-tab.active{
  border-color:var(--brand-blue);
  color:#fff;
  background:var(--brand-blue);
  box-shadow:0 4px 14px rgba(8,106,191,0.22);
}
.input-tab.active{
  background:transparent;
  color:var(--brand-light-blue);
  border-color:var(--brand-teal);
}
.input-panel{display:none;}
.input-panel.active{display:block;}
.file-box{
  border:2px dashed #b7dcf7;
  border-radius:14px;
  background:#f8fcff;
  padding:14px;
}
.file-box.is-drop-active{
  border-color:#4f8ff9;
  background:#eef5ff;
}
.file-row{display:flex;gap:10px;align-items:center;flex-wrap:wrap;}
.file-name{font-size:.86rem;color:#4d6271;font-weight:700;}
.photo-pages-wrap{
  margin-top:10px;
  border:1px solid #dbe5f6;
  border-radius:12px;
  background:#fff;
  padding:10px;
}
.photo-pages-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
}
.photo-pages-list{
  margin:0;
  padding-left:22px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.photo-page-item{
  display:flex;
  align-items:center;
  gap:8px;
  padding:6px 8px;
  border:1px solid #e5ebf7;
  border-radius:10px;
  background:#fbfdff;
}
.photo-page-item.drag-over{
  border-color:#4f8ff9;
  background:#eef5ff;
}
.photo-page-item.dragging{opacity:.6;}
.photo-page-handle{
  color:#64748b;
  font-size:.95rem;
  cursor:grab;
}
.photo-page-thumb-wrap{
  position:relative;
  width:34px;
  height:34px;
  flex:0 0 auto;
}
.photo-page-thumb{
  width:34px;
  height:34px;
  border-radius:6px;
  border:1px solid #dbe5f6;
  object-fit:cover;
  background:#f1f5f9;
}
.photo-page-num{
  position:absolute;
  right:-6px;
  top:-7px;
  width:16px;
  height:16px;
  border-radius:999px;
  background:var(--brand-blue);
  color:#fff;
  font-size:.65rem;
  font-weight:700;
  line-height:16px;
  text-align:center;
  box-shadow:0 0 0 2px #fff;
}
.photo-page-name{
  flex:1 1 auto;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:.9rem;
  color:#334155;
}
.photo-page-actions{
  display:flex;
  gap:6px;
}
.photo-page-btn{
  min-height:32px;
  padding:6px 10px;
  font-size:.82rem;
}
.math-paste-kind-select{
  width:100%;
  max-width:520px;
  margin-top:6px;
}
.math-paste-textarea{
  width:100%;
  max-width:720px;
  margin-top:6px;
  box-sizing:border-box;
  border:2px solid #bdeceb;
  border-radius:12px;
  padding:12px 14px;
  font-size:.95rem;
  line-height:1.45;
  color:#146e8b;
  background:#fff;
  resize:vertical;
  min-height:140px;
}
.math-paste-textarea:focus{
  outline:none;
  border-color:var(--brand-teal);
  box-shadow:0 0 0 3px rgba(202,255,191,0.65);
}
.upload-notice{
  margin-top:8px;
  font-size:.8rem;
  color:#4f6371;
  font-weight:700;
}

.opt-row{
  margin-top:14px;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:18px;
}
.opt-row label{
  margin:0;
  font-weight:800;
  color:#147b9c;
  font-size:.96rem;
  display:flex;
  align-items:center;
  gap:8px;
  cursor:pointer;
}
.opt-row input[type="checkbox"]{
  width:18px;
  height:18px;
  accent-color:var(--brand-teal);
  cursor:pointer;
}
.difficulty-select{
  border:2px solid #bdeceb;
  background:#fff;
  color:#146e8b;
  border-radius:12px;
  padding:8px 12px;
  font-weight:800;
}
.theme-select{
  border:2px solid #bdeceb;
  background:#fff;
  color:#146e8b;
  border-radius:12px;
  padding:8px 12px;
  font-weight:800;
}

.btn-row{display:flex;gap:12px;margin-top:16px;flex-wrap:wrap;}
.btn{display:inline-flex;align-items:center;gap:8px;padding:14px 28px;border-radius:50px;border:2px solid #6f8391;background:transparent;color:#2f3a45;font-size:1.05rem;font-weight:500;cursor:pointer;transition:transform .15s,opacity .2s;}
.btn:hover:not(:disabled){transform:translateY(-2px);}
.btn:active:not(:disabled){transform:translateY(0);}
.btn:disabled{opacity:0.6;cursor:not-allowed;}
.btn-generate{border-color:var(--brand-light-blue);color:var(--brand-light-blue);flex:1;min-width:160px;}
body:not(.home-page) .btn-generate{
  background:var(--brand-orange);
  border-color:var(--brand-orange);
  color:#fff;
  box-shadow:0 4px 16px rgba(240,111,189,0.28);
}
body:not(.home-page) .btn.is-active{
  background:var(--brand-orange-hover);
  border-color:var(--brand-orange-hover);
  color:#fff;
  box-shadow:0 6px 18px rgba(240,111,189,0.32);
}
body:not(.home-page) .btn-outline.is-active{
  background:var(--brand-orange-hover);
  border-color:var(--brand-orange-hover);
  color:#fff;
}
body:not(.home-page) .btn-outline{
  border-color:#cdddf6;
  color:#334155;
  background:#fff;
}
.btn-pdf{border-color:var(--brand-teal);color:var(--brand-teal);display:none;}
.btn-pdf.show{display:inline-flex;}
.flash-btn-row .btn-pdf{display:inline-flex;}
.btn-outline{border-color:var(--accent);color:var(--accent);background:rgba(240,111,189,0.06);}
.btn-outline:hover:not(:disabled){background:rgba(240,111,189,0.11);}

.reading-history-wrap{
  margin-top:14px;
  border:1px solid #dbe5f6;
  background:#f8fbff;
  border-radius:14px;
  padding:10px 12px;
}
.reading-history-title{
  font-size:.9rem;
  font-weight:700;
  color:#334155;
  margin-bottom:8px;
}
.reading-history-list{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.reading-history-pager{
  margin-top:10px;
  justify-content:space-between;
  align-items:center;
}
.reading-history-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  border:1px solid #e4e9f4;
  background:#fff;
  border-radius:10px;
  padding:8px 10px;
}
.reading-history-meta{
  min-width:0;
}
.reading-history-name{
  font-size:.9rem;
  font-weight:600;
  color:#1f2937;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.reading-history-time{
  font-size:.78rem;
  color:#64748b;
  margin-top:2px;
}
.reading-history-actions{
  display:flex;
  gap:6px;
  flex-shrink:0;
}
.reading-history-actions .btn{
  min-height:32px;
  padding:6px 10px;
  font-size:.82rem;
}

.spinner{width:18px;height:18px;border:3px solid rgba(31,42,51,0.18);border-top-color:var(--accent);border-radius:50%;animation:spin .7s linear infinite;display:none;}
.loading .spinner{display:block;}
.loading .btn-label{display:none;}
@keyframes spin{to{transform:rotate(360deg);}}

/* Progress */
.progress-wrap{margin-top:18px;display:none;}
.progress-wrap.show{display:block;}
.progress-label{font-size:.9rem;color:#455861;font-weight:700;margin-bottom:8px;}
.progress-bar-bg{background:#e2e8f0;border-radius:20px;height:10px;overflow:hidden;}
.progress-bar{height:100%;background:linear-gradient(90deg,var(--brand-teal),var(--brand-blue));border-radius:20px;transition:width .4s ease;width:0%;}
.progress-step{font-size:.82rem;color:#146e8b;margin-top:6px;font-weight:700;min-height:18px;}

/* Result */
.result-area{margin-top:26px;display:none;}
.result-area.show{display:block;}
.result-card{background:var(--cloud);border-radius:24px;padding:38px 34px;box-shadow:0 10px 36px rgba(8,106,191,0.1);border:1px solid #e0f0ff;animation:slideUp .4s cubic-bezier(.34,1.56,.64,1) both;}
body:not(.home-page) .result-card{
  border-radius:16px;
  border:1px solid #e4e9f4;
  box-shadow:0 3px 14px rgba(15,23,42,0.06);
}

/* Kids-friendly title */
.story-title{
  font-size:2.15rem;
  color:var(--accent);
  text-align:center;
  margin-bottom:28px;
  line-height:1.3;
}

/* Paragraph blocks */
.para-block{
  margin-bottom:42px;
  animation:popIn .4s cubic-bezier(.34,1.56,.64,1) both;
}

/* Alternating soft bg for image area */
.para-block:nth-child(odd)  .para-img-wrap{background:#eef9ff;}
.para-block:nth-child(even) .para-img-wrap{background:#f2fff7;}

.para-img-wrap{
  border-radius:20px;
  padding:16px;
  margin-bottom:22px;
  text-align:center;
  min-height:180px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.para-img-wrap img{
  max-width:100%;
  max-height:300px;
  width:auto;
  height:auto;
  border-radius:14px;
  box-shadow:0 4px 20px rgba(0,0,0,0.12);
  object-fit:contain;
  display:block;
  margin:0 auto;
}

/* Image loading state */
.img-generating{
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:10px;height:180px;color:var(--brand-teal);
  font-size:1rem;
}
.mini-spin{width:28px;height:28px;border:3px solid #d8edf8;border-top-color:var(--brand-teal);border-radius:50%;animation:spin .8s linear infinite;}

/* ★ Kids-friendly paragraph text — original content, friendly presentation ★ */
.para-text{
  font-size:1.24rem;          /* bigger than normal */
  font-weight:600;
  line-height:2.05;           /* generous line spacing */
  color:#2d3436;
  letter-spacing:0.015em;     /* slightly spaced letters */
  word-spacing:0.06em;
  padding:0 4px;
}
.magic-word{
  font-size:1.42em;
  line-height:1;
  padding:1px 6px;
  border-radius:10px;
  display:inline-block;
  transform:translateY(0);
  text-shadow:0 1px 0 rgba(0,0,0,0.06);
  letter-spacing:0.02em;
}
.magic-word.style-1{color:var(--brand-blue);background:rgba(8,106,191,0.12);}
.magic-word.style-2{color:var(--brand-dark-teal);background:rgba(202,255,191,0.45);}
.magic-word.style-3{color:#6bcb77;background:rgba(107,203,119,0.16);}
.magic-word.style-4{color:#ff9f1c;background:rgba(255,159,28,0.16);}
.magic-word.style-5{color:#2f6bb2;background:rgba(47,107,178,0.15);}
.magic-word{cursor:pointer;}
.magic-word:focus-visible{outline:2px solid var(--brand-teal);outline-offset:2px;}
.complex-underline{
  text-decoration:underline;
  text-decoration-thickness:2px;
  text-decoration-color:#ff9f1c;
  text-underline-offset:3px;
}
.complex-word{cursor:pointer;}
.complex-word:focus-visible{outline:2px solid #ff9f1c;outline-offset:2px;}

.vocab-popup{
  position:fixed;
  z-index:1200;
  max-width:260px;
  background:#fffdf2;
  border:2px solid #ffc857;
  border-radius:12px;
  box-shadow:0 8px 22px rgba(0,0,0,0.14);
  padding:10px 12px;
  display:none;
}
.vocab-popup.show{display:block;}
.vocab-word{color:#ff9f1c;margin-bottom:4px;}
.vocab-meaning{
  color:#1f2a33;
  font-weight:700;
  line-height:1.4;
  font-size:.95rem;
}

.divider{text-align:center;font-size:1.4rem;margin:4px 0 20px;opacity:0.45;letter-spacing:8px;}

.questions-wrap{margin-top:8px;background:transparent;border:2px dashed var(--brand-teal);border-radius:18px;padding:14px 14px 10px;}
.questions-title{color:var(--brand-blue);font-size:1.4rem;margin-bottom:10px;}
.questions-list{
  margin:0;
  padding-left:22px;
}
.questions-list li{
  font-size:1.24rem;
  line-height:1.7;
  color:#1f2a33;
  font-weight:700;
  margin-bottom:12px;
  list-style-position:outside;
}
.question-row-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
  margin-bottom:6px;
}
.question-row-head > div:last-child{
  display:flex;
  gap:6px;
  flex-shrink:0;
}
.question-text{
  font-size:1.24rem;
  line-height:1.5;
  color:#1f2a33;
  font-weight:800;
  padding-right:8px;
  flex:1;
  min-width:0;
  word-break:break-word;
}
.question-edit-input{
  width:100%;
  min-height:54px;
  border:1px solid #d8e7f5;
  border-radius:8px;
  padding:8px 10px;
  font-size:1.08rem;
  color:#1f2a33;
  line-height:1.45;
  resize:vertical;
  outline:none;
  background:#fff;
}
.question-edit-input:focus{
  border-color:#74b9ff;
  box-shadow:0 0 0 3px rgba(116,185,255,0.2);
}
.question-answer-space{
  margin-top:8px;
  width:100%;
  height:90px;
  border:1px solid #d8e7f5;
  border-radius:8px;
  padding:6px 8px;
  font-size:1.06rem;
  color:#1f2a33;
  line-height:26px;
  resize:vertical;
  outline:none;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 26px,
      rgba(31,42,51,0.22) 26px,
      rgba(31,42,51,0.22) 27px
    );
}
.question-answer-space:focus{
  border-color:#74b9ff;
  box-shadow:0 0 0 3px rgba(116,185,255,0.2);
}
.question-feedback{
  margin-top:8px;
  font-weight:800;
  min-height:20px;
}
.question-score{
  margin-top:8px;
  color:#0984e3;
  font-size:1.1rem;
}
.btn-add-question{
  background:transparent;
  border:2px solid #00b894;
  color:#00b894;
  box-shadow:none;
  font-size:.92rem;
  font-weight:500;
  padding:10px 16px;
}
.btn-remove-question{
  background:transparent;
  border:2px solid #d63031;
  color:#d63031;
  box-shadow:none;
  font-size:.95rem;
  font-weight:500;
  padding:8px 10px;
  min-width:38px;
  justify-content:center;
}
.btn-edit-question{
  background:transparent;
  border:2px solid #00cec9;
  color:#00a7a2;
  box-shadow:none;
  font-size:.95rem;
  font-weight:500;
  padding:8px 10px;
  min-width:38px;
  justify-content:center;
}

.mcq-wrap{
  margin-top:12px;
  background:transparent;
  border:2px dashed #74b9ff;
  border-radius:18px;
  padding:18px 18px 14px;
}
.mcq-title{
  color:#0984e3;
  font-size:1.35rem;
  margin-bottom:10px;
}
.mcq-item{
  margin:0 0 12px;
  padding:12px 14px;
  background:transparent;
  border-radius:12px;
  border:1px solid #e8f3ff;
}
.mcq-q{
  font-weight:800;
  color:#2d3436;
  margin-bottom:6px;
  font-size:1.24rem;
}
.mcq-item ul{
  margin:0;
  padding-left:20px;
}
.mcq-item li{
  line-height:1.7;
  color:#243646;
  font-weight:700;
  font-size:1.24rem;
}
.vocab-list-wrap{
  margin-top:12px;
  background:transparent;
  border:2px dashed #ffc857;
  border-radius:18px;
  padding:14px 14px 10px;
}
.vocab-list-title{
  color:#ff9f1c;
  font-size:1.3rem;
  margin-bottom:10px;
}
.vocab-list{
  margin:0;
  padding-left:20px;
}
.vocab-list li{
  margin-bottom:8px;
  color:#2f3a45;
  line-height:1.6;
  font-weight:700;
  font-size:1.24rem;
}
.vocab-list strong{
  color:var(--brand-light-blue);
  font-size:1.24rem;
}
.mcq-actions{
  margin-top:8px;
}
.btn-check{
  background:transparent;
  border:2px solid #0984e3;
  color:#0984e3;
  box-shadow:none;
  font-weight:500;
}
.mcq-score{
  margin-top:10px;
  color:#0984e3;
  font-size:1.15rem;
}
.mcq-correct{color:#00b894;font-weight:800;}
.mcq-wrong{color:#d63031;font-weight:800;}
.section-actions{
  margin-top:10px;
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.btn-refresh{
  background:transparent;
  border:2px solid #636e72;
  color:#636e72;
  box-shadow:none;
  font-size:.92rem;
  font-weight:500;
  padding:10px 16px;
}
.regen-status{
  margin-top:8px;
  font-size:.9rem;
  font-weight:800;
  color:#147b9c;
}
.read-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:42px;
  padding:10px 18px;
  border:1px solid var(--purple);
  border-radius:999px;
  font-size:.96rem;
  font-weight:500;
  background:#fff;
  color:var(--purple);
  cursor:pointer;
  margin-bottom:12px;
  box-shadow:none;
  transition:transform .15s,opacity .2s,background .15s,border-color .15s,color .15s;
}
.read-btn:hover{transform:translateY(-1px);}
body:not(.home-page) .read-btn:hover:not(:disabled){
  background:#f8fafc;
}

.error-msg{background:#fff5f5;border:2px solid #ffcdd2;border-radius:14px;padding:16px 20px;color:#c0392b;font-weight:600;margin-top:12px;display:none;}
.error-msg.show{display:block;}

/* PDF export-only styling */
.pdf-export-root .read-btn,
.pdf-export-root .section-actions,
.pdf-export-root .mcq-actions,
.pdf-export-root .regen-status,
.pdf-export-root input[type="radio"],
.pdf-export-root input[type="checkbox"],
.pdf-export-root .btn,
.pdf-export-root .spinner{
  display:none !important;
}
.pdf-export-root label{
  cursor:default !important;
}
.pdf-export-root .result-card,
.pdf-export-root{
  background:#fff !important;
  color:#111 !important;
}
.pdf-export-root .story-title,
.pdf-export-root .para-text,
.pdf-export-root .questions-list li,
.pdf-export-root .mcq-q,
.pdf-export-root .mcq-item li,
.pdf-export-root .vocab-meaning,
.pdf-export-root .vocab-list li{
  color:#111 !important;
}
.pdf-export-root .questions-title,
.pdf-export-root .mcq-title,
.pdf-export-root .vocab-list-title{
  color:#111 !important;
}
.pdf-export-root .complex-underline{
  text-decoration-color:#333 !important;
}
.pdf-export-root .pdf-answer-lines{
  margin-top:8px;
  height:90px;
  border:1px solid #d8e7f5;
  border-radius:8px;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 26px,
      rgba(31,42,51,0.28) 26px,
      rgba(31,42,51,0.28) 27px
    );
}

/* Word Genie practice sheet PDF — full color (avoid flat inherited #111) */
.pdf-export-root.word-gennie-pdf-export,
.pdf-export-root.word-gennie-pdf-export .result-card{
  color:#1e293b !important;
}
.pdf-export-root.word-gennie-pdf-export .word-meaning-title{
  color:#7c3aed !important;
}
.pdf-export-root.word-gennie-pdf-export .word-meaning-head{
  color:var(--brand-blue-hover) !important;
}
.pdf-export-root.word-gennie-pdf-export .word-meaning-text{
  color:#475569 !important;
}
.pdf-export-root.word-gennie-pdf-export .word-meaning-item:nth-child(4n+1){background:#f0f7ff !important;}
.pdf-export-root.word-gennie-pdf-export .word-meaning-item:nth-child(4n+2){background:#eefcf8 !important;}
.pdf-export-root.word-gennie-pdf-export .word-meaning-item:nth-child(4n+3){background:#fff8ef !important;}
.pdf-export-root.word-gennie-pdf-export .word-meaning-item:nth-child(4n+4){background:#f7f1ff !important;}
.pdf-export-root.word-gennie-pdf-export .word-meaning-item{
  border-color:rgba(8,106,191,0.35) !important;
}
.pdf-export-root.word-gennie-pdf-export .mcq-title{
  color:#0984e3 !important;
}
.pdf-export-root.word-gennie-pdf-export .mcq-q{
  color:#2d3436 !important;
}
.pdf-export-root.word-gennie-pdf-export .mcq-item li,
.pdf-export-root.word-gennie-pdf-export .mcq-item label{
  color:#243646 !important;
}
.pdf-export-root.word-gennie-pdf-export .mcq-wrap{
  border-color:#74b9ff !important;
}
.pdf-export-root.word-gennie-pdf-export .mcq-item{
  border-color:#d6ebff !important;
}
.pdf-export-root.word-gennie-pdf-export .hint{
  color:#64748b !important;
}
.pdf-export-root.word-gennie-pdf-export .mcq-progress{
  color:#475569 !important;
}
.pdf-export-root.word-gennie-pdf-export .mcq-correct{
  color:#00b894 !important;
}
.pdf-export-root.word-gennie-pdf-export .mcq-wrong{
  color:#d63031 !important;
}

@keyframes popIn{from{opacity:0;transform:scale(0.93);}to{opacity:1;transform:scale(1);}}
@keyframes slideUp{from{opacity:0;transform:translateY(18px);}to{opacity:1;transform:translateY(0);}}

@media (max-width: 700px){
  .input-card{padding:22px;}
  .result-card{padding:24px 20px;}
  .story-title{font-size:1.8rem;}
  .para-text{font-size:1.1rem;line-height:1.9;}
  .btn{width:100%;justify-content:center;}
}

/* ── PDF generating overlay ──────────────────────────────────────────────── */
.pdf-overlay{
  display:none;position:fixed;inset:0;z-index:999;
  background:rgba(162,155,254,0.18);
  backdrop-filter:blur(4px);
  align-items:center;justify-content:center;
  flex-direction:column;gap:16px;
}
.pdf-overlay.show{display:flex;}
.pdf-overlay-box{
  background:#fff;border-radius:24px;padding:32px 40px;
  text-align:center;
  box-shadow:0 8px 40px rgba(162,155,254,0.3);
}
.pdf-overlay-box p{font-size:1.2rem;color:var(--purple);margin-top:12px;}
.pdf-spinner{width:40px;height:40px;border:4px solid #d8edf8;border-top-color:var(--purple);border-radius:50%;animation:spin .8s linear infinite;margin:0 auto;}

/* ── App shell: home + sub-app nav ───────────────────────────────────────── */
.app-nav{
  display:flex;justify-content:flex-start;margin-bottom:8px;
}
.app-nav-link{
  font-family:var(--font-body);font-weight:500;font-size:0.95rem;
  color:var(--accent);text-decoration:none;padding:6px 4px;border-radius:10px;
}
.app-nav-link:hover{text-decoration:underline;}
body:not(.home-page) .app-nav{
  margin-bottom:12px;
}
body:not(.home-page) .app-nav-link{
  display:inline-flex;
  align-items:center;
  border:1px solid #dbe5f6;
  background:#fff;
  padding:8px 12px;
  border-radius:999px;
  color:#334155;
}
/* ── Unified non-home component system ───────────────────────────────────── */
body:not(.home-page) .input-card label{
  font-family:'Inter',var(--font-body),sans-serif;
  font-size:.92rem;
  font-weight:700;
  color:#334155;
  margin-bottom:8px;
}
body:not(.home-page) textarea{
  border:1px solid #d5dfef;
  border-radius:12px;
  background:#fff;
  min-height:170px;
  padding:14px 14px;
  font-size:1rem;
  line-height:1.6;
}
body:not(.home-page) textarea:focus{
  border-color:#93c5fd;
  box-shadow:0 0 0 3px rgba(8,106,191,0.12);
}
body:not(.home-page) .file-box{
  border:1px dashed #c5d7ef;
  border-radius:12px;
  background:#f9fbff;
}
body:not(.home-page) .hint{
  font-family:'Inter',var(--font-body),sans-serif;
  font-size:.84rem;
  color:#607487;
  font-weight:600;
}
body:not(.home-page) .upload-notice,
body:not(.home-page) .file-name,
body:not(.home-page) .progress-label,
body:not(.home-page) .progress-step{
  font-family:'Inter',var(--font-body),sans-serif;
}
body:not(.home-page) .difficulty-select,
body:not(.home-page) .theme-select,
body:not(.home-page) .flashcards-form-grid .difficulty-select{
  border:1px solid #d5dfef;
  border-radius:10px;
  padding:10px 12px;
  min-height:42px;
  background:#fff;
  color:#1f2937;
  font-weight:600;
}
body:not(.home-page) .difficulty-select:focus,
body:not(.home-page) .theme-select:focus{
  outline:none;
  border-color:#93c5fd;
  box-shadow:0 0 0 3px rgba(8,106,191,0.12);
}
body:not(.home-page) .input-tabs{
  gap:10px;
  margin-bottom:14px;
}
body:not(.home-page) .btn-row{
  margin-top:18px;
}
body:not(.home-page) .btn{
  border-radius:999px;
  border-width:1px;
  min-height:42px;
  padding:10px 18px;
  font-family:'Inter',var(--font-body),sans-serif;
  font-size:.96rem;
  font-weight:500;
  transition:transform .15s,opacity .2s,background .15s,border-color .15s,color .15s;
}
body:not(.home-page) .result-card{
  padding:28px 26px;
}
body:not(.home-page) .story-title,
body:not(.home-page) .math-results-title,
body:not(.home-page) .flash-section-title{
  font-family:'Inter',var(--font-body),sans-serif;
  font-weight:800;
  color:var(--brand-neutral-3);
  letter-spacing:-0.01em;
}
body:not(.home-page) .story-title{
  font-size:1.9rem;
}
body:not(.home-page) .math-results-title,
body:not(.home-page) .flash-section-title{
  font-size:1.2rem;
}
body:not(.home-page) .flashcards-meta{
  font-family:'Inter',var(--font-body),sans-serif;
  font-size:.95rem;
  color:#334155;
  font-weight:700;
}
body:not(.home-page) .flash-print-page-title{
  font-family:'Inter',var(--font-body),sans-serif;
  color:var(--brand-blue-hover);
  font-size:1rem;
}

.home-app{
  max-width:none;
  width:min(1440px, 96vw);
}
.home-app .header{margin-bottom:28px;}
.home-app,
.home-app *{
  font-family:'Inter',var(--font-body),sans-serif;
}
.home-topbar{
  display:flex;
  flex-wrap:nowrap;
  align-items:center;
  gap:12px 16px;
  background:#fff;
  border:1px solid #e5ebf5;
  border-radius:14px;
  padding:10px 14px;
  margin-bottom:20px;
  box-shadow:0 2px 10px rgba(15,23,42,0.04);
}
.home-brand{
  flex:0 0 auto;
  text-decoration:none;
  font-size:1.2rem;
  font-weight:800;
  color:var(--brand-navy);
  letter-spacing:-.01em;
}
.home-brand.home-brand-with-mark{
  display:inline-flex;
  align-items:center;
  gap:10px;
}
.home-brand-mark{
  width:44px;
  height:44px;
  flex-shrink:0;
  border-radius:12px;
  object-fit:contain;
  box-shadow:0 2px 12px rgba(189,178,255,0.45);
}
.gennie-tool-logo{
  display:block;
  width:96px;
  height:96px;
  margin:0 auto 6px;
  object-fit:contain;
  border-radius:18px;
  filter:drop-shadow(0 6px 16px rgba(15,23,42,0.1));
}
.home-topbar-search-wrap{
  flex:1 1 8rem;
  min-width:0;
  width:auto;
}
.home-topbar-search{
  width:100%;
  border:1px solid #dbe5f6;
  border-radius:999px;
  padding:9px 14px;
  font-size:.92rem;
  color:#1f2937;
  background:#f8fbff;
  outline:none;
}
.home-topbar-search:focus{
  border-color:#9cc2ff;
  box-shadow:0 0 0 3px rgba(8,106,191,0.12);
}
.home-topbar-actions{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  gap:8px;
  white-space:nowrap;
}
.home-worksheet-reports-link{
  border-radius:999px;
  padding:8px 13px;
  font-size:.9rem;
  font-weight:500;
  text-decoration:none;
  cursor:pointer;
  border:1px solid #c7d7f0;
  background:#fff;
  color:#1e3a5f;
}
.home-worksheet-reports-link:hover{
  border-color:#7aa8ff;
  color:var(--brand-neutral-3);
}
.home-login-btn{
  border-radius:999px;
  padding:8px 13px;
  font-size:.9rem;
  font-weight:500;
  cursor:pointer;
  border:1px solid #dbe5f6;
  background:#fff;
  color:#334155;
}
.worksheet-quality-app .worksheet-quality-header{
  text-align:left;max-width:52rem;margin:0 auto 12px;padding:0 16px;
}
.worksheet-quality-app .worksheet-quality-header h1{
  font-family:var(--font-heading);font-size:1.65rem;color:var(--purple);margin:0 0 8px;
}
.worksheet-quality-lead{
  margin:0;font-size:0.95rem;line-height:1.5;color:var(--text);opacity:0.92;max-width:48rem;
}
.worksheet-quality-lead code{font-size:0.85em;background:rgba(8,106,191,0.08);padding:2px 6px;border-radius:6px;}
.worksheet-quality-card{margin:0 auto 32px;max-width:min(1200px,calc(100vw - 32px));}
.admin-page-header p{
  max-width:48rem;
  margin:10px auto 0;
}
.admin-page-app .admin-page-card{
  max-width:min(1200px,calc(100vw - 32px));
  margin:0 auto 30px;
}
.admin-page-section-title{
  font-family:'Inter',var(--font-body),sans-serif;
  font-size:1.05rem;
  font-weight:700;
  color:var(--brand-neutral-3);
  margin:0 0 12px;
}
.admin-page-app .admin-page-section-title{
  font-size:1.35rem;
}
.admin-page-links{
  display:grid;
  gap:10px;
}
.admin-page-link{
  display:inline-flex;
  align-items:center;
  justify-content:space-between;
  min-height:48px;
  padding:10px 14px;
  border:1px solid #cfe0ff;
  border-radius:12px;
  background:#f8fbff;
  color:var(--brand-blue);
  text-decoration:none;
  font-weight:700;
}
.admin-page-link:hover{
  background:#eef4ff;
  border-color:#a9c4ff;
}
.admin-page-subtitle{
  font-family:'Inter',var(--font-body),sans-serif;
  font-size:0.98rem;
  font-weight:700;
  color:#1e293b;
  margin:28px 0 6px;
}
.admin-page-subtitle:first-of-type{
  margin-top:16px;
}
.admin-stats-summary{
  margin:12px 0 8px;
  font-size:1rem;
  line-height:1.65;
}
.admin-stats-summary p{margin:4px 0;}
.admin-overview-actions{margin:12px 0 8px;}
.admin-table-caption{margin-top:4px;margin-bottom:10px;}
.admin-table-host{margin-bottom:8px;}
.admin-table-scroll{
  overflow:auto;
  max-height:55vh;
  border:1px solid rgba(8,106,191,0.15);
  border-radius:12px;
  background:#fff;
}
.admin-data-table{font-variant-numeric:tabular-nums;}
.admin-customize-tools-block{
  margin-top:18px;
  padding-top:14px;
  border-top:1px solid rgba(15,23,42,0.08);
}
.admin-customize-tools-block .home-customize-tools-btn{margin-top:8px;}
.wq-table-host{margin-top:8px;}
.wq-table-scroll{
  overflow:auto;max-height:70vh;border:1px solid rgba(8,106,191,0.15);border-radius:12px;background:#fff;
}
.wq-report-table{
  width:100%;border-collapse:collapse;font-size:0.82rem;
}
.wq-report-table th,.wq-report-table td{
  border-bottom:1px solid rgba(15,23,42,0.08);padding:8px 10px;text-align:left;vertical-align:top;
}
.wq-report-table th{
  position:sticky;top:0;background:#f1f6ff;font-weight:600;color:var(--brand-neutral-3);z-index:1;
}
.wq-td-time{white-space:nowrap;font-variant-numeric:tabular-nums;}
.wq-td-mono{font-size:0.75rem;word-break:break-all;max-width:10rem;}
.wq-td-wrap{max-width:14rem;word-break:break-word;}
.wq-td-json{font-size:0.72rem;max-width:18rem;word-break:break-word;color:#334155;}
.wq-td-file{max-width:16rem;word-break:break-word;}
.wq-td-num{white-space:nowrap;font-variant-numeric:tabular-nums;}
.wq-review-link{font-weight:600;}
.home-page{
  background:var(--pastel-bg-home);
  background-attachment:fixed;
}
.home-page .bg-wrap{
  opacity:.32;
}
.home-hero{
  text-align:center;
  max-width:860px;
  margin:8px auto 30px;
}
.home-kicker{
  display:inline-block;
  font-size:.74rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--brand-navy);
  font-weight:700;
  background:var(--pastel-yellow);
  border:1px solid rgba(189,178,255,0.55);
  border-radius:999px;
  padding:6px 11px;
}
.home-hero h1{
  margin-top:12px;
  font-size:3rem;
  line-height:1.2;
  color:var(--brand-navy);
  font-weight:800;
  letter-spacing:-.02em;
}
.home-hero p{
  margin-top:10px;
  font-size:1.12rem;
  color:#475569;
}
.home-hero-cta{
  margin-top:22px;
  display:flex;
  justify-content:center;
  gap:12px;
  flex-wrap:wrap;
}
.home-primary-btn,.home-secondary-btn{
  text-decoration:none;
  border-radius:999px;
  padding:12px 18px;
  font-weight:500;font-size:.95rem;
}
.home-primary-btn{
  background:var(--brand-orange);
  color:#fff;
  box-shadow:0 8px 22px rgba(240,111,189,0.35);
}
.home-primary-btn:hover{
  background:var(--brand-orange-hover);
}
.home-secondary-btn{
  background:#fff;
  color:var(--brand-navy);
  border:1px solid var(--brand-neutral-1);
}
.home-secondary-btn:hover{
  border-color:var(--brand-blue);
  color:var(--brand-blue);
}
.home-photo-worksheet{
  max-width:56rem;
  margin:20px auto 10px;
  padding:0 18px 6px;
}
.home-smart-photo-tile{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
  align-items:center;
  justify-items:center;
  padding:16px;
  border:1px solid #dbe6ff;
  border-radius:18px;
  background:linear-gradient(150deg,#ffffff 0%,#f6faff 100%);
  box-shadow:0 8px 20px rgba(8,106,191,0.08);
}
.home-smart-photo-copy{
  text-align:center;
  max-width:44rem;
}
.home-smart-photo-copy h2{
  margin:0;
  color:var(--brand-neutral-3);
  font-size:1.1rem;
  font-weight:800;
  letter-spacing:-0.01em;
}
.home-smart-photo-copy p{
  margin:6px 0 0;
  color:#475569;
  font-size:0.94rem;
  line-height:1.45;
}
.home-photo-worksheet-grid{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:10px;
  max-width:48rem;
  margin:0 auto;
}
a.home-photo-chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-height:44px;
  padding:8px 16px 8px 10px;
  border-radius:999px;
  border:1px solid #d4daf8;
  background:#fffcff;
  color:var(--brand-navy);
  font-size:0.92rem;
  font-weight:600;
  text-decoration:none;
  transition:background .15s ease,border-color .15s ease;
}
.home-photo-chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-height:44px;
  padding:8px 16px 8px 10px;
  border-radius:999px;
  border:1px solid #d4daf8;
  background:#fffcff;
  color:var(--brand-navy);
  font-size:0.92rem;
  font-weight:600;
  text-decoration:none;
  transition:background .15s ease,border-color .15s ease;
}
.home-photo-chip-logo{
  width:40px;
  height:40px;
  object-fit:contain;
  border-radius:10px;
  flex-shrink:0;
  box-shadow:0 1px 4px rgba(15,23,42,0.08);
}
a.home-photo-chip span{
  text-align:left;
}
a.home-photo-chip:hover{
  background:#f3f0ff;
  border-color:#a5b4fc;
}
.home-photo-chip:hover{
  background:#f3f0ff;
  border-color:#a5b4fc;
}
.home-photo-auto-route{
  max-width:48rem;
  margin:0 auto 10px;
  display:grid;
  gap:8px;
}
.home-photo-chip--auto{
  justify-content:center;
  cursor:pointer;
}
.home-photo-chip--tile{
  min-height:62px;
  min-width:300px;
  border-radius:12px;
  border-color:#bfdbfe;
  background:#eff6ff;
  color:var(--brand-blue-hover);
  font-size:1.15rem;
  font-weight:700;
  padding:12px 20px 12px 14px;
}
.home-photo-chip--tile:hover{
  background:#dbeafe;
  border-color:#93c5fd;
}
.home-auto-route-camera{
  font-size:2rem;
  line-height:1;
}
.auto-route-status{
  margin:0;
  max-width:none;
  padding:8px 10px;
  border-radius:10px;
  border:1px solid rgba(59,130,246,0.35);
  background:#eff6ff;
  color:var(--brand-navy);
  font-size:0.9rem;
  line-height:1.4;
  font-weight:600;
}
@media (max-width:760px){
  .home-smart-photo-tile{
    gap:12px;
  }
  .home-photo-chip--auto{
    justify-content:center;
  }
}
.gennie-import-tips{
  margin:12px 0 0;
  font-size:0.92rem;
  line-height:1.5;
  color:#475569;
}
.gennie-privacy-note{
  margin:10px 0 0;
  font-size:0.82rem;
  line-height:1.45;
  color:#64748b;
}
@media (max-width:600px){
  .gennie-camera-btn{
    min-height:44px;
    min-width:44px;
    padding:10px 14px;
  }
}
.home-carousel{
  max-width:none;
  margin:0 auto;
}
.home-carousel-head{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:10px 14px;
  margin:0 0 10px;
}
.home-carousel-head-row{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px 16px;
  min-width:0;
}
.home-carousel-head h2{
  margin:0;
  font-size:1.2rem;
  font-weight:800;
  color:var(--brand-neutral-3);
}
.home-customize-tools-btn{
  border:none;
  background:transparent;
  color:var(--brand-blue);
  font-size:0.88rem;
  font-weight:600;
  cursor:pointer;
  text-decoration:underline;
  text-underline-offset:3px;
  padding:4px 2px;
  font-family:inherit;
}
.home-customize-tools-btn:hover{color:var(--brand-blue-hover);}
.home-customize-tools-btn:focus-visible{
  outline:2px solid var(--brand-blue);
  outline-offset:2px;
  border-radius:4px;
}
.home-carousel-track{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
}
/* JS sets `hidden`; author `.home-slide` / link styles use `display` and can tie specificity and win — force hide. */
[data-home-tool][hidden]{
  display:none !important;
}
.home-slide{
  background:#fff;
  border:1px solid #e4e9f4;
  border-radius:18px;
  box-shadow:0 4px 16px rgba(15,23,42,0.06);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  aspect-ratio:8 / 9;
  min-height:0;
}
.home-slide-media{
  min-height:126px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:3.1rem;
}
.home-slide-media--logo{
  min-height:176px;
  padding:12px 10px;
  font-size:0;
}
.home-slide-media--logo .home-slide-logo{
  width:min(170px,92%);
  height:auto;
  max-height:170px;
  object-fit:contain;
  border-radius:16px;
  filter:drop-shadow(0 6px 14px rgba(15,23,42,0.12));
}
.home-slide-media--blue{background:linear-gradient(135deg,#dbeafe,#bfdbfe);}
.home-slide-media--teal{background:linear-gradient(135deg,#cffafe,#a5f3fc);}
.home-slide-media--orange{background:linear-gradient(135deg,#e0e7ff,#c7d2fe);}
.home-slide-media--purple{background:linear-gradient(135deg,#ede9fe,#ddd6fe);}
.home-slide-media--green{background:linear-gradient(135deg,#dcfce7,#bbf7d0);}
.home-slide-media--slate{background:linear-gradient(135deg,#e2e8f0,#cbd5e1);}
.home-slide-media--amber{background:linear-gradient(135deg,#f1f5f9,#dbeafe);}
.home-slide-content{
  padding:18px 18px 20px;
}
.home-slide-content h2{
  font-size:1.38rem;
  line-height:1.2;
  color:var(--brand-neutral-3);
  font-weight:800;
}
.home-slide-content p{
  margin-top:10px;
  font-size:.98rem;
  line-height:1.55;
  color:#4f6378;
}
.home-slide-content a{
  display:inline-block;
  margin-top:16px;
  font-weight:500;
  color:var(--brand-blue-hover);
  text-decoration:none;
}
.home-carousel-controls{
  display:flex;
  align-items:center;
  gap:10px;
}
.home-carousel-btn{
  width:34px;height:34px;border-radius:999px;
  border:1px solid #d5deef;background:#fff;color:#334155;cursor:pointer;
  font-weight:500;
}
.home-info{
  margin:22px auto 0;
  max-width:none;
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
}
.home-info-card{
  background:#fff;
  border:1px solid #e4e9f4;
  border-radius:16px;
  padding:18px 20px;
  display:grid;
  grid-template-columns:300px minmax(0, 1fr);
  gap:16px;
  align-items:center;
}
.home-info-copy{
  min-width:0;
  align-self:center;
  display:flex;
  flex-direction:column;
  justify-content:center;
}
.home-info-media{
  width:300px;
  height:300px;
  border-radius:12px;
  border:1px dashed #bfd1ee;
  background:#f4f8ff;
  color:#6b7f96;
  font-size:.9rem;
  font-weight:700;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:8px;
  justify-self:start;
  align-self:center;
}
.home-info-card:nth-child(odd){
  grid-template-columns:minmax(0, 1fr) 300px;
}
.home-info-card:nth-child(odd) .home-info-media{
  grid-column:2;
  justify-self:end;
  align-self:center;
}
.home-info-card:nth-child(odd) .home-info-copy{
  grid-column:1;
}
.home-info-card h3{
  font-size:1.12rem;
  font-weight:800;
  color:#19232d;
}
.home-info-card p{
  margin-top:6px;
  font-size:1rem;
  color:#4f6476;
  line-height:1.5;
}
.home-footer-note{
  margin:22px auto 0;
  max-width:none;
  background:#fff;
  border:1px solid #e4e9f4;
  border-radius:16px;
  padding:18px 20px;
}
.home-footer-note h3{
  font-size:1.05rem;
  color:#19232d;
  font-weight:800;
}
.home-footer-note p{
  margin-top:6px;
  color:#4f6476;
}
.home-site-footer{
  margin:28px auto 8px;
  padding:16px 8px 0;
  text-align:center;
}
.home-site-footer-nav{
  display:flex;
  flex-wrap:wrap;
  gap:10px 20px;
  justify-content:center;
  align-items:center;
}
.home-site-footer-nav a{
  font-size:.92rem;
  font-weight:600;
  color:var(--brand-blue);
  text-decoration:none;
}
.home-site-footer-nav a:hover{
  text-decoration:underline;
}
.home-site-footer-meta{
  margin-top:10px;
  font-size:.82rem;
  color:#64748b;
  font-weight:600;
}
.subscription-app{
  width:min(1100px,96vw);
}
.subscription-hero{
  margin-bottom:18px;
}
.subscription-account-status{
  margin:0 auto 12px;
  padding:14px 16px;
  border-radius:14px;
  border:1px solid rgba(71,85,105,0.22);
  background:#fff;
}
.subscription-account-status h2{
  margin:0 0 6px;
  font-size:1.02rem;
  font-weight:800;
  color:#1f2937;
}
.subscription-account-status p{
  margin:0;
  font-size:.94rem;
  line-height:1.5;
  color:#475569;
}
.subscription-trial-note{
  margin:0 auto 16px;
  padding:14px 16px;
  border-radius:14px;
  border:1px solid rgba(79,70,229,0.22);
  background:linear-gradient(90deg,#EEF2FF 0%,#ECFEFF 100%);
}
.subscription-trial-note h2{
  margin:0 0 6px;
  font-size:1.08rem;
  font-weight:800;
  color:#1f2937;
}
.subscription-trial-note p{
  margin:0;
  font-size:.95rem;
  line-height:1.5;
  color:#475569;
}
.subscription-trial-highlight{
  color:var(--brand-blue-hover);
}
.subscription-plans{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
  margin:0 auto 18px;
}
.subscription-plan-card{
  position:relative;
  display:flex;
  flex-direction:column;
  background:#fff;
  border:1px solid #e4e9f4;
  border-radius:16px;
  padding:18px 18px 16px;
  box-shadow:0 6px 18px rgba(15,23,42,0.06);
}
.subscription-plan-card h2{
  margin:0;
  font-size:1.35rem;
  font-weight:800;
  color:#19232d;
}
.subscription-plan-title-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin:0 0 8px;
}
.subscription-price{
  margin:0 0 10px;
  font-size:1.9rem;
  line-height:1.15;
  font-weight:800;
  color:var(--brand-blue-hover);
}
.subscription-price span{
  font-size:.95rem;
  color:#64748b;
  font-weight:600;
}
.subscription-features{
  margin:0;
  padding-left:18px;
  color:#334155;
  display:grid;
  gap:6px;
  font-size:.95rem;
}
.subscription-value{
  margin:12px 0 0;
  font-size:.92rem;
  line-height:1.5;
  color:#4f6378;
}
.subscription-plan-card--recommended{
  border:1px solid rgba(79,70,229,0.45);
  box-shadow:0 10px 26px rgba(79,70,229,0.18);
}
.subscription-plan-card--current{
  border:1px solid rgba(6,182,212,0.55);
  box-shadow:0 10px 26px rgba(6,182,212,0.16);
}
.subscription-badge{
  position:absolute;
  top:-10px;
  right:14px;
  margin:0;
  padding:4px 10px;
  border-radius:999px;
  font-size:.74rem;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.04em;
  color:#fff;
  background:linear-gradient(135deg,#4F46E5,#4338CA);
}
.subscription-current-tag{
  margin:0;
  display:inline-block;
  padding:4px 10px;
  border-radius:999px;
  font-size:.78rem;
  font-weight:700;
  color:#0f766e;
  background:#ccfbf1;
  border:1px solid rgba(15,118,110,.28);
}
.subscription-current-tag[hidden]{
  display:none !important;
}
.subscription-select-btn{
  margin-top:auto;
  width:100%;
  border:none;
  border-radius:10px;
  padding:10px 12px;
  font-size:.92rem;
  font-weight:700;
  color:#fff;
  background:linear-gradient(180deg,#4F46E5,#4338CA);
  cursor:pointer;
}
.subscription-select-btn:hover{
  filter:brightness(1.04);
}
.subscription-select-btn:disabled{
  opacity:.6;
  cursor:not-allowed;
}
.home-topbar-search:disabled{
  opacity:.72;
  cursor:not-allowed;
  background:#f1f5f9;
  color:#64748b;
}
.home-info-media--thumb{
  border:1px solid #e4e9f4;
  background:linear-gradient(180deg,#fff 0%,#f8fbff 100%);
  padding:12px;
  font-size:0;
  color:transparent;
}
.home-info-thumb{
  display:block;
  width:100%;
  height:100%;
  max-height:276px;
  object-fit:contain;
}
.legal-page{
  background:var(--pastel-bg-home);
  background-attachment:fixed;
  min-height:100vh;
  font-family:'Inter',var(--font-body),sans-serif;
}
.legal-page .legal-app{
  max-width:42rem;
  width:100%;
  margin:0 auto;
  padding:28px 20px 48px;
}
.legal-back{
  margin:0 0 18px;
  font-size:.95rem;
}
.legal-back a{
  color:var(--brand-blue);
  font-weight:600;
  text-decoration:none;
}
.legal-back a:hover{
  text-decoration:underline;
}
.legal-main h1{
  font-size:1.75rem;
  font-weight:800;
  color:var(--brand-neutral-3);
  letter-spacing:-.02em;
  margin:0 0 6px;
}
.legal-updated{
  font-size:.88rem;
  color:#64748b;
  margin:0 0 22px;
}
.legal-main h2{
  font-size:1.05rem;
  font-weight:800;
  color:#1e293b;
  margin:22px 0 8px;
}
.legal-main p{
  font-size:.98rem;
  line-height:1.65;
  color:#334155;
  margin:0 0 10px;
}
.legal-main a{
  color:var(--brand-blue);
  font-weight:600;
}
.legal-lead{
  font-size:1rem;
  line-height:1.65;
  color:#334155;
  margin:0 0 20px;
}
.legal-footer-nav{
  display:flex;
  flex-wrap:wrap;
  gap:12px 20px;
  margin-top:32px;
  padding-top:20px;
  border-top:1px solid rgba(15,23,42,0.1);
  font-size:.95rem;
  font-weight:600;
}
.legal-footer-nav a{
  color:var(--brand-blue);
  text-decoration:none;
}
.legal-footer-nav a:hover{
  text-decoration:underline;
}
.home-tools-dialog{
  max-width:min(420px, 92vw);
  border:1px solid #e4e9f4;
  border-radius:16px;
  padding:20px 22px;
  box-shadow:0 16px 48px rgba(15,23,42,0.18);
}
.home-tools-dialog::backdrop{background:rgba(15,23,42,0.35);}
.home-tools-dialog-title{
  margin:0 0 8px;
  font-size:1.15rem;
  font-weight:800;
  color:var(--brand-neutral-3);
}
.home-tools-dialog-hint{
  margin:0 0 14px;
  font-size:0.88rem;
  color:#64748b;
  line-height:1.45;
}
.home-tools-dialog-list{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-bottom:18px;
  max-height:50vh;
  overflow:auto;
}
.home-tools-check-row{
  display:flex;
  align-items:center;
  gap:10px;
  font-size:0.95rem;
  color:#334155;
  cursor:pointer;
}
.home-tools-check-row input{width:1.05rem;height:1.05rem;accent-color:var(--brand-blue);}
.home-tools-dialog-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  justify-content:flex-end;
}
.home-tools-dialog-btn{
  border-radius:10px;
  padding:8px 14px;
  font-size:0.9rem;
  font-weight:600;
  cursor:pointer;
  font-family:inherit;
}
.home-tools-dialog-btn--ghost{
  border:1px solid #dbe5f6;
  background:#fff;
  color:#475569;
}
.home-tools-dialog-btn--primary{
  border:1px solid var(--brand-blue);
  background:var(--brand-blue);
  color:#fff;
}
@media (max-width: 980px){
  .home-topbar{
    flex-wrap:wrap;
  }
  .home-topbar-search-wrap{
    flex:1 1 100%;
    order:3;
    min-width:0;
  }
  .home-brand{order:0;}
  .home-grade-band-wrap{order:1;}
  .home-topbar-actions{
    order:2;
    margin-left:auto;
    justify-content:flex-end;
  }
  .home-info{grid-template-columns:1fr;}
  .home-info-card{
    grid-template-columns:1fr;
  }
  .home-info-media{
    width:100%;
    max-width:300px;
    height:220px;
    justify-self:start;
  }
  .home-carousel-track{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .cw-layout{
    display:grid;
    grid-template-columns:1fr;
  }
}
@media (max-width: 640px){
  .home-hero h1{font-size:2.1rem;}
  .home-info{grid-template-columns:1fr;}
  .home-carousel-head{
    flex-wrap:wrap;
    gap:8px;
  }
  .home-carousel-track{
    grid-template-columns:1fr;
  }
  .home-slide-media{
    min-height:190px;
    font-size:3.3rem;
  }
  .home-slide-media--logo{
    min-height:200px;
  }
  .home-slide-content{
    padding:22px 18px;
  }
  .home-slide-content h2{
    font-size:1.6rem;
  }
  .subscription-plans{
    grid-template-columns:1fr;
  }
}

.math-verify-placeholder{max-width:560px;margin:0 auto;}

/* ── Math Verify ─────────────────────────────────────────────────────────── */
.math-results-wrap{margin-top:18px;}
.math-results-header{
  margin-bottom:16px;
}
.math-results-title{
  font-family:var(--font-heading);font-size:1.35rem;color:var(--purple);margin:0;
}
.math-retry-hint{
  font-size:0.88rem;color:var(--text);opacity:0.85;margin:6px 0 0;line-height:1.45;max-width:36rem;
}
.math-results-actions{
  margin-top:18px;
  align-items:center;
}
.math-results-actions .btn-pdf{
  margin-top:0;
}
.math-quality-report-wrap{
  margin-top:14px;
}
.math-quality-dialog{
  border:none;border-radius:16px;padding:20px 22px;max-width:440px;width:calc(100vw - 32px);
  box-shadow:0 12px 40px rgba(15,23,42,0.18);
  font-family:var(--font-body);
}
.math-quality-dialog::backdrop{
  background:rgba(15,23,42,0.35);
}
.math-quality-dialog-title{
  font-family:var(--font-heading);font-size:1.2rem;color:var(--purple);margin:0 0 8px;
}
.math-quality-dialog-lead{
  margin:0 0 14px;font-size:0.88rem;max-width:36rem;
}
.math-quality-dialog label{
  display:block;margin-top:12px;font-size:0.9rem;font-weight:600;color:var(--text);
}
.math-quality-category-select,.math-quality-note{
  width:100%;margin-top:6px;box-sizing:border-box;
}
.math-quality-note{
  resize:vertical;min-height:72px;border-radius:12px;padding:10px 12px;border:1px solid rgba(8,106,191,0.2);
}
.math-quality-dialog-actions{
  margin-top:18px;margin-bottom:0;
}
.math-item-list{
  list-style:decimal;padding-left:1.4rem;display:flex;flex-direction:column;gap:18px;
}
.math-item-list--grid{
  list-style:none;
  padding-left:0;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
}
@media (max-width:960px){
  .math-item-list--grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media (max-width:480px){
  .math-item-list--grid{
    grid-template-columns:1fr;
  }
}
.math-item{
  background:#fff;border-radius:18px;padding:18px 20px;
  box-shadow:0 4px 18px rgba(8,106,191,0.08);
  border:1px solid rgba(8,106,191,0.12);
}
.worksheet-math-card{
  border:1px solid rgba(30,41,59,0.14);
  box-shadow:0 2px 10px rgba(15,23,42,0.06);
}
.worksheet-math-cell{
  min-height:200px;
  padding:12px;
  border-radius:14px;
}
.math-item-list--grid .worksheet-math-cell,
.math-item-list--grid .math-area-card{
  min-height:188px;
}
.worksheet-math-cell .math-item-head{
  margin-bottom:6px;
}
.worksheet-math-cell .math-item-label{
  display:none;
}
.worksheet-math-cell .math-item-num{
  min-width:36px;
  font-size:0.84rem;
  padding:3px 8px;
}
.worksheet-math-cell .math-vertical-wrap{
  width:100%;
  margin:4px 0 6px;
  padding:8px 10px 7px;
  font-size:1.2rem;
  text-align:right;
}
.worksheet-math-cell .math-inline-answer{
  width:100%;
  margin-top:4px;
  padding:8px 10px;
}
.worksheet-math-cell .math-feedback{
  margin-top:8px;
  font-size:0.84rem;
  line-height:1.3;
}
.worksheet-math-cell--wide{
  grid-column:1 / -1;
}
.math-item-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
}
.math-item-num{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:42px;
  padding:4px 10px;
  border-radius:999px;
  background:#eef6ff;
  color:var(--brand-blue-hover);
  font-weight:800;
  border:1px solid rgba(8,106,191,0.25);
}
.math-item-label{
  font-family:var(--font-heading);font-size:0.85rem;color:var(--accent);margin-bottom:8px;
}
.math-equation-line{
  font-family:var(--font-body);font-size:1.25rem;font-weight:700;color:var(--text);line-height:1.5;
}
.math-vertical-wrap{
  width:min(240px,100%);
  margin:6px 0 8px;
  padding:10px 12px 8px;
  border-radius:12px;
  background:#f8fbff;
  border:1px dashed rgba(8,106,191,0.28);
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
  font-size:1.45rem;
  line-height:1.15;
  text-align:right;
  color:var(--brand-neutral-3);
}
/* Full-width stack so digits and a right-flushed answer box share one right edge. */
.math-item-equation .math-vertical-wrap{
  width:100%;
  max-width:100%;
}
.math-vertical-top,.math-vertical-bottom{padding-right:4px;letter-spacing:0.02em;}
.math-vertical-bottom{
  display:flex;
  justify-content:flex-end;
  gap:6px;
  margin-top:2px;
}
.math-vertical-op{
  min-width:16px;
  text-align:center;
  font-weight:800;
}
.math-vertical-line{
  height:0;
  border-top:3px solid rgba(15,23,42,0.76);
  margin-top:5px;
}
.math-vertical-wrap--stack{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:1px;
}
.math-vertical-stack-row{
  font-variant-numeric:tabular-nums;
  letter-spacing:0.06em;
  line-height:1.2;
}
.math-vertical-stack-row--op{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:6px;
  margin-top:2px;
}
.math-vertical-wrap--gridlines{
  background-color:#f8fbff;
  background-image:repeating-linear-gradient(
    90deg,
    rgba(8,106,191,0.09) 0,
    rgba(8,106,191,0.09) 1px,
    transparent 1px,
    transparent 1ch
  );
}
/* Inline fraction arithmetic (a/b ± c/d) rendered as stacked numerators/denominators */
.math-fraction-pair-wrap .math-fraction-pair-inner{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:flex-end;
  gap:10px 16px;
  width:100%;
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
}
.math-fraction-pair-inner--solo{
  justify-content:flex-end;
}
.math-frac-stack{
  display:inline-flex;
  flex-direction:column;
  align-items:center;
  min-width:2ch;
}
.math-frac-stack-num,
.math-frac-stack-den{
  line-height:1.12;
  font-size:1.32rem;
  font-variant-numeric:tabular-nums;
}
.math-frac-stack-bar{
  width:100%;
  min-width:2.4ch;
  border-top:2.5px solid rgba(15,23,42,0.88);
  margin:3px 0 2px;
}
.math-fraction-pair-op{
  font-weight:900;
  font-size:1.45rem;
  line-height:1;
  padding:0 2px;
  color:var(--brand-neutral-3);
}
.math-fraction-pair-wrap .math-vertical-line{
  margin-top:10px;
}
.worksheet-math-cell .math-fraction-pair-wrap .math-frac-stack-num,
.worksheet-math-cell .math-fraction-pair-wrap .math-frac-stack-den{
  font-size:1.15rem;
}
.math-inline-answer{
  margin-top:2px;
  width:min(260px,100%);
  border:1px solid rgba(31,42,51,0.18);
  border-radius:10px;
  padding:9px 12px;
  font-size:1rem;
}
/* Under vertical problems: smaller box (~half width), left-aligned typing (sum from last digit inward). */
.math-vertical-wrap + .math-inline-answer{
  display:block;
  width:min(128px,50%);
  max-width:min(128px,50%);
  box-sizing:border-box;
  text-align:left;
  margin-left:auto;
  margin-right:0;
}
.math-question{font-size:1.05rem;line-height:1.65;color:var(--text);}
.math-given-answer{
  margin-top:10px;padding:12px 14px;border-radius:12px;background:#f4f9ff;font-size:1rem;
}
.math-given-label{font-weight:700;color:var(--purple);margin-right:6px;}
.math-ta-label{display:block;margin-top:12px;font-weight:700;font-size:0.95rem;}
.math-user-answer{margin-top:6px;width:100%;}
.math-feedback{margin-top:12px;font-weight:700;font-size:0.98rem;}
.math-feedback-partial{color:#e17055;font-weight:800;}

/* ── Math Ginnie: telling time (read clock / draw time) ─────────────────── */
.math-time-worksheet-wrap{margin:14px 0 22px;}
.math-time-list.math-item-list{list-style:none;padding-left:0;}
.math-time-card{
  border:1px solid rgba(31,42,51,0.12);
  border-radius:16px;
  padding:14px 16px;
  background:#fff;
}
.math-time-card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
}
.math-time-instruction{margin:0 0 8px;font-size:0.88rem;color:#475569;line-height:1.35;}
.math-time-body{
  display:flex;
  flex-wrap:wrap;
  align-items:flex-start;
  gap:16px;
}
.math-time-clock-wrap{flex:0 0 auto;}
.math-time-side{flex:1;min-width:180px;}
.math-time-hint{margin:0 0 10px;font-size:0.88rem;color:#475569;line-height:1.45;}
.math-time-hint--draw{margin-bottom:8px;}
.math-time-label{
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
  font-size:1.05rem;
  color:var(--brand-neutral-3);
}
.math-time-inputs{
  display:flex;
  flex-wrap:wrap;
  align-items:flex-end;
  gap:8px 10px;
}
.math-time-field{display:flex;flex-direction:column;gap:4px;}
.math-time-field-lbl{font-size:0.72rem;font-weight:700;color:#64748b;text-transform:uppercase;letter-spacing:0.04em;}
.math-time-hour,.math-time-min{
  width:3.2rem;
  padding:8px 6px;
  border-radius:10px;
  border:1px solid rgba(31,42,51,0.18);
  font-size:1.1rem;
  font-weight:800;
  text-align:center;
}
.math-time-colon{font-size:1.35rem;font-weight:900;color:#64748b;padding:0 2px 6px;}
.math-time-ap{
  padding:8px 10px;
  border-radius:10px;
  border:1px solid rgba(31,42,51,0.18);
  font-size:0.95rem;
  font-weight:700;
  background:#f8fafc;
}
.math-clock-svg--interactive{
  cursor:crosshair;
  touch-action:none;
  user-select:none;
  -webkit-user-select:none;
}
.math-clock-svg--locked{
  pointer-events:none;
  opacity:0.95;
}
.math-time-ap-btns{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
}
.math-time-ap-btn{
  min-width:4.5rem;
  padding:10px 14px;
  border-radius:10px;
  border:2px solid rgba(31,42,51,0.2);
  font-size:0.95rem;
  font-weight:800;
  background:#fff;
  color:#475569;
  cursor:pointer;
}
.math-time-ap-btn--on{
  border-color:var(--brand-blue-hover);
  background:#eef6ff;
  color:var(--brand-blue-hover);
}
.math-time-ap-btn:disabled{
  opacity:0.65;
  cursor:default;
}
.worksheet-math-cell.math-time-card{min-height:0;}

/* ── Math area (grid / rectangle / composite) ───────────────────────────── */
.math-area-worksheet-wrap{margin:14px 0 22px;}
.math-area-section-note{
  margin:-4px 0 12px;
  font-size:0.86rem;
  color:#64748b;
  line-height:1.45;
  max-width:42rem;
}
.math-area-list.math-item-list{list-style:none;padding-left:0;}
.math-area-card{
  border:1px solid rgba(31,42,51,0.12);
  border-radius:16px;
  padding:14px 16px;
  background:#fff;
  list-style:none;
}
.math-area-card-head{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
  margin-bottom:8px;
}
.math-area-label-print{font-size:0.95rem;font-weight:800;color:#475569;}
.math-area-instruction{margin:0 0 10px;font-size:0.88rem;color:#475569;line-height:1.35;}
.math-area-body{margin:8px 0 10px;}
.math-area-hint{margin:0 0 10px;font-size:0.85rem;color:#64748b;line-height:1.4;}
.math-area-hint--tight{margin-top:-4px;}
.math-area-grid{
  display:grid;
  grid-template-columns:repeat(var(--area-cols), minmax(10px, 18px));
  gap:2px;
  width:fit-content;
  max-width:100%;
  padding:8px;
  background:#f8fafc;
  border-radius:12px;
  border:1px solid rgba(148,163,184,0.55);
}
.math-area-cell{
  aspect-ratio:1;
  border-radius:3px;
  background:#fff;
  border:1px solid rgba(148,163,184,0.5);
  min-width:10px;
}
.math-area-cell--on{
  background:var(--area-fill,#fcd34d);
  border-color:rgba(15,23,42,0.22);
}
.math-area-rect-wrap{
  display:flex;
  flex-direction:row;
  align-items:center;
  gap:10px;
  justify-content:center;
  flex-wrap:wrap;
}
.math-area-rect-side{
  font-size:0.82rem;
  font-weight:800;
  color:#334155;
  writing-mode:vertical-rl;
  transform:rotate(180deg);
  min-height:48px;
}
.math-area-rect-col{display:flex;flex-direction:column;align-items:center;gap:6px;}
.math-area-rect-shape{
  background:#bae6fd;
  border:2px solid #0369a1;
  border-radius:6px;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,0.35);
}
.math-area-rect-bottom{font-size:0.82rem;font-weight:800;color:#334155;}
.math-area-parts-row{
  display:flex;
  flex-wrap:wrap;
  align-items:flex-end;
  gap:14px;
  justify-content:flex-start;
}
.math-area-part{display:flex;flex-direction:column;align-items:center;gap:6px;}
.math-area-part-shape{
  border-radius:8px;
  border:2px solid rgba(15,23,42,0.22);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,0.35);
}
.math-area-part-dim{font-size:0.78rem;font-weight:800;color:#475569;}
.math-area-answer-row{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
  font-size:0.95rem;
  font-weight:700;
  color:#334155;
  margin-top:4px;
}
.math-area-answer{
  width:5.5rem;
  padding:8px 10px;
  border-radius:10px;
  border:1px solid rgba(31,42,51,0.18);
  font-size:1.05rem;
  font-weight:800;
  text-align:center;
}
.math-area-unit-hint{font-size:0.82rem;font-weight:700;color:#64748b;}
.worksheet-math-cell.math-area-card{min-height:0;}

/* ── Math worksheet V2 (fraction + number line) ─────────────────────────── */
.math-v2-wrap{margin:14px 0 22px;}
.math-v2-title{
  margin:0 0 10px;
  font-size:1.05rem;
  font-weight:800;
  color:#334155;
}
.math-fn-list{
  list-style:none;
  padding:0;
  margin:0;
  display:flex;
  flex-direction:column;
  gap:14px;
}
.math-fn-list--grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(280px,1fr));
  gap:14px;
}
.math-fn-row{
  border:1px solid rgba(31,42,51,0.12);
  border-radius:16px;
  padding:14px 16px;
  background:#fff;
}
.math-fn-row--example{
  background:linear-gradient(135deg,#fdf2f8 0%,#fff 55%);
  border-color:rgba(236,72,153,0.35);
}
.math-fn-row-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.math-fn-badge{
  font-size:0.75rem;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:0.06em;
  color:#be185d;
  background:rgba(251,207,232,0.65);
  border-radius:999px;
  padding:3px 10px;
}
.math-fn-body{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:16px;
}
.math-fn-visual{flex:0 0 auto;}
.math-fn-pie{
  width:72px;
  height:72px;
  border-radius:50%;
  border:2px solid rgba(15,23,42,0.2);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,0.35);
}
.math-fn-frac-block{flex:1;min-width:160px;}
.math-fn-frac{
  display:flex;
  align-items:center;
  gap:6px;
}
.math-fn-num,.math-fn-den{
  width:64px;
  padding:8px 10px;
  border-radius:10px;
  border:1px solid rgba(31,42,51,0.18);
  font-size:1.05rem;
  font-weight:800;
  text-align:center;
}
.math-fn-slash{font-weight:900;font-size:1.2rem;color:#64748b;}
.math-fn-hint{margin:8px 0 0;font-size:0.85rem;color:#64748b;line-height:1.35;}
.math-fn-instruction{margin:6px 0 0;font-size:0.9rem;color:#475569;}
.math-fn-line-wrap{margin-top:12px;padding-top:10px;border-top:1px dashed rgba(148,163,184,0.6);}
.math-fn-line-ticks{
  display:flex;
  flex-wrap:wrap;
  align-items:flex-end;
  justify-content:space-between;
  gap:4px 2px;
}
.math-fn-tick{
  flex:1 1 auto;
  min-width:36px;
  border:none;
  background:transparent;
  padding:4px 2px 0;
  cursor:pointer;
  font:inherit;
  color:var(--brand-neutral-3);
}
.math-fn-tick-dot{
  display:block;
  width:10px;
  height:10px;
  margin:0 auto 4px;
  border-radius:50%;
  background:#cbd5e1;
  border:1px solid rgba(15,23,42,0.25);
}
.math-fn-tick--selected .math-fn-tick-dot{
  background:#ec4899;
  border-color:#9d174d;
  box-shadow:0 0 0 3px rgba(236,72,153,0.25);
}
.math-fn-tick-lbl{
  display:block;
  font-size:0.68rem;
  font-weight:700;
  color:#64748b;
  line-height:1.1;
  word-break:break-all;
}

/* ── Word Genie ─────────────────────────────────────────────────────────── */
.word-meaning-wrap{
  margin-bottom:20px;
}
.word-meaning-title{
  font-family:var(--font-heading);
  font-size:1.2rem;
  color:var(--purple);
  margin-bottom:10px;
}
.word-meaning-list{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:12px;
}
.word-meaning-item{
  background:#fff;
  border:1px solid rgba(8,106,191,0.14);
  border-radius:14px;
  padding:12px 14px;
}
.word-meaning-item:nth-child(4n+1){background:#f0f7ff;}
.word-meaning-item:nth-child(4n+2){background:#eefcf8;}
.word-meaning-item:nth-child(4n+3){background:#fff8ef;}
.word-meaning-item:nth-child(4n+4){background:#f7f1ff;}
.word-meaning-head{
  font-weight:800;
  color:var(--brand-blue-hover);
  margin-bottom:6px;
}
.word-meaning-clipart{
  display:inline-block;
  font-size:1.15rem;
  margin-right:6px;
  vertical-align:-2px;
}
.word-meaning-text{
  color:#475569;
  line-height:1.5;
}
.word-gennie-app #wordMcqSection .mcq-options-plain{
  list-style:none;
  padding-left:0;
  margin:8px 0 0;
}
.word-gennie-app #wordMcqSection .mcq-options-plain li{
  list-style:none;
}
.word-flash-preview-row{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
}
.word-flash-single{
  display:flex;
  align-items:center;
  justify-content:center;
}
.word-flash-next-btn{
  min-width:42px;
  width:42px;
  height:42px;
  padding:0;
  font-size:1.2rem;
  font-weight:500;
}
.word-flash-card{
  width:var(--flash-card-w);
  height:var(--flash-card-h);
}
.word-flash-card .flash-flip-face{
  border-width:3px;
}
#wordFlashDuplexWrap .flash-print-cell{
  border-width:3px;
}
.word-flash-card .flash-word{
  font-size:1.08rem;
  line-height:1.45;
  padding:0 8px;
  max-width:100%;
  word-break:break-word;
}
.word-action-row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
.word-action-row .btn{
  width:100%;
  justify-content:center;
}
.word-gennie-flashcard-footer{
  text-align:center;
  margin:28px 0 12px;
  font-size:0.95rem;
}
.word-gennie-flashcard-footer a{
  font-weight:600;
  color:var(--brand-blue);
  text-decoration:none;
}
.word-gennie-flashcard-footer a:hover{
  text-decoration:underline;
}
.word-gennie-app .word-input-tab-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:1.45rem;
  line-height:1;
  margin-right:6px;
  transform:translateY(1px);
}
/* Trial: square tile controls for Type / Import / Capture / Predefined on Word Genie create */
.word-gennie-app #wordPanelCreate .word-gennie-square-tabs.input-tabs{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin-bottom:14px;
}
@media (max-width:720px){
  .word-gennie-app #wordPanelCreate .word-gennie-square-tabs.input-tabs{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
.word-gennie-app #wordPanelCreate .word-gennie-square-tabs .input-tab{
  flex-direction:column;
  justify-content:center;
  align-items:center;
  border-radius:14px;
  aspect-ratio:1;
  width:100%;
  min-height:0;
  padding:10px 6px;
  font-size:0.76rem;
  font-weight:700;
  line-height:1.25;
  gap:8px;
  text-align:center;
  overflow-wrap:break-word;
}
.word-gennie-app #wordPanelCreate .word-gennie-square-tabs .input-tab .word-input-tab-icon{
  margin-right:0;
  flex-shrink:0;
  font-size:clamp(3.35rem,17vmin,5.75rem);
  line-height:1;
  transform:none;
}
.bilingual-gennie-app #bilingualPanelCreate .bilingual-gennie-square-tabs.input-tabs{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin-bottom:14px;
}
@media (max-width:720px){
  .bilingual-gennie-app #bilingualPanelCreate .bilingual-gennie-square-tabs.input-tabs{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
.bilingual-gennie-app #bilingualPanelCreate .bilingual-gennie-square-tabs .input-tab{
  flex-direction:column;
  justify-content:center;
  align-items:center;
  border-radius:14px;
  aspect-ratio:1;
  width:100%;
  min-height:0;
  padding:10px 6px;
  font-size:0.76rem;
  font-weight:700;
  line-height:1.25;
  gap:8px;
  text-align:center;
  overflow-wrap:break-word;
}
.bilingual-gennie-app #bilingualPanelCreate .bilingual-gennie-square-tabs .input-tab .word-input-tab-icon{
  margin-right:0;
  flex-shrink:0;
  font-size:clamp(3.35rem,17vmin,5.75rem);
  line-height:1;
  transform:none;
}
.math-gennie-app #mathPanelCreate .math-gennie-square-tabs.input-tabs{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin-bottom:14px;
}
@media (max-width:720px){
  .math-gennie-app #mathPanelCreate .math-gennie-square-tabs.input-tabs{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
.math-gennie-app #mathPanelCreate .math-gennie-square-tabs .input-tab{
  flex-direction:column;
  justify-content:center;
  align-items:center;
  border-radius:14px;
  aspect-ratio:1;
  width:100%;
  min-height:0;
  padding:10px 6px;
  font-size:0.76rem;
  font-weight:700;
  line-height:1.25;
  gap:8px;
  text-align:center;
  overflow-wrap:break-word;
}
.math-gennie-app #mathPanelCreate .math-gennie-square-tabs .input-tab .word-input-tab-icon{
  margin-right:0;
  flex-shrink:0;
  font-size:clamp(3.35rem,17vmin,5.75rem);
  line-height:1;
  transform:none;
}
.crossword-gennie-app .word-input-tab-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:1.45rem;
  line-height:1;
  margin-right:6px;
  transform:translateY(1px);
}
.crossword-gennie-app #crosswordPanelCreate .crossword-gennie-square-tabs.input-tabs{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin-bottom:14px;
}
@media (max-width:720px){
  .crossword-gennie-app #crosswordPanelCreate .crossword-gennie-square-tabs.input-tabs{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
.crossword-gennie-app #crosswordPanelCreate .crossword-gennie-square-tabs .input-tab{
  flex-direction:column;
  justify-content:center;
  align-items:center;
  border-radius:14px;
  aspect-ratio:1;
  width:100%;
  min-height:0;
  padding:10px 6px;
  font-size:0.76rem;
  font-weight:700;
  line-height:1.25;
  gap:8px;
  text-align:center;
  overflow-wrap:break-word;
}
.crossword-gennie-app #crosswordPanelCreate .crossword-gennie-square-tabs .input-tab .word-input-tab-icon{
  margin-right:0;
  flex-shrink:0;
  font-size:clamp(3.35rem,17vmin,5.75rem);
  line-height:1;
  transform:none;
}
.grammar-gennie-app .word-input-tab-icon,
.science-gennie-app .word-input-tab-icon,
.reading-gennie-app .word-input-tab-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:1.45rem;
  line-height:1;
  margin-right:6px;
  transform:translateY(1px);
}
.grammar-gennie-app #grammarPanelCreate .grammar-gennie-square-tabs.input-tabs,
.science-gennie-app #sciencePanelCreate .science-gennie-square-tabs.input-tabs,
.reading-gennie-app #readingPanelCreate .reading-gennie-square-tabs.input-tabs{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin-bottom:14px;
}
@media (max-width:720px){
  .grammar-gennie-app #grammarPanelCreate .grammar-gennie-square-tabs.input-tabs,
  .science-gennie-app #sciencePanelCreate .science-gennie-square-tabs.input-tabs,
  .reading-gennie-app #readingPanelCreate .reading-gennie-square-tabs.input-tabs{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
.grammar-gennie-app #grammarPanelCreate .grammar-gennie-square-tabs .input-tab,
.science-gennie-app #sciencePanelCreate .science-gennie-square-tabs .input-tab,
.reading-gennie-app #readingPanelCreate .reading-gennie-square-tabs .input-tab{
  flex-direction:column;
  justify-content:center;
  align-items:center;
  border-radius:14px;
  aspect-ratio:1;
  width:100%;
  min-height:0;
  padding:10px 6px;
  font-size:0.76rem;
  font-weight:700;
  line-height:1.25;
  gap:8px;
  text-align:center;
  overflow-wrap:break-word;
}
.grammar-gennie-app #grammarPanelCreate .grammar-gennie-square-tabs .input-tab .word-input-tab-icon,
.science-gennie-app #sciencePanelCreate .science-gennie-square-tabs .input-tab .word-input-tab-icon,
.reading-gennie-app #readingPanelCreate .reading-gennie-square-tabs .input-tab .word-input-tab-icon{
  margin-right:0;
  flex-shrink:0;
  font-size:clamp(3.35rem,17vmin,5.75rem);
  line-height:1;
  transform:none;
}
.math-import-review-text{
  width:100%;
  min-height:118px;
  border:1px solid rgba(148,163,184,0.65);
  border-radius:10px;
  padding:10px;
  font-size:0.95rem;
  line-height:1.45;
  resize:vertical;
}
.word-import-review{
  margin-top:12px;
  padding:10px;
  border:1px dashed rgba(59,130,246,0.45);
  border-radius:12px;
  background:#f8fbff;
}
.word-import-review-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.word-import-chip-list{
  margin-top:8px;
  display:grid;
  gap:8px;
}
.word-import-chip{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
}
.word-import-chip input,
.word-import-add-row input{
  width:100%;
  padding:9px 10px;
  border-radius:10px;
  border:1px solid rgba(148,163,184,0.6);
  font-size:0.95rem;
}
.word-import-add-row{
  margin-top:10px;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
}
.word-current-empty{
  margin-top:0;
}
.mcq-progress{
  margin:0 0 12px;
  color:#475569;
  font-weight:700;
  font-size:0.92rem;
}
.word-history-chips{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  margin-top:6px;
}
.word-history-chip{
  display:inline-flex;
  align-items:center;
  padding:2px 8px;
  border-radius:999px;
  background:#eff6ff;
  color:var(--brand-navy);
  font-size:0.73rem;
  font-weight:700;
}

.word-preset-band-row{
  margin:12px 0 14px;
  flex-wrap:wrap;
}
.word-preset-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(200px,1fr));
  gap:10px;
  margin-top:4px;
}
.word-preset-card{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:4px;
  text-align:left;
  padding:12px 14px;
  border-radius:14px;
  border:2px solid rgba(8,106,191,0.2);
  background:#fff;
  cursor:pointer;
  font:inherit;
  color:inherit;
  transition:border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.word-preset-card:hover{
  border-color:rgba(124,58,237,0.45);
  box-shadow:0 4px 14px rgba(8,106,191,0.12);
}
.word-preset-card--selected{
  border-color:#7c3aed;
  background:linear-gradient(145deg,#f5f3ff 0%,#eef8ff 100%);
  box-shadow:0 2px 10px rgba(124,58,237,0.15);
}
.word-preset-card__head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
  width:100%;
}
.word-preset-card__badge{
  flex-shrink:0;
  margin-top:1px;
}
.word-preset-card__title{
  font-weight:800;
  font-size:0.98rem;
  color:var(--brand-navy);
  flex:1;
  min-width:0;
  text-align:left;
}
.word-preset-card__meta{
  font-size:0.78rem;
  color:#64748b;
  line-height:1.35;
}
.word-preset-card__id{
  font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size:0.72rem;
}

.word-quiz-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:1.35rem;
  height:1.35rem;
  padding:0 4px;
  border-radius:999px;
  font-size:0.72rem;
  font-weight:800;
  line-height:1;
  flex-shrink:0;
}
.word-quiz-badge--green{
  background:#22c55e;
  color:#fff;
}
.word-quiz-badge--yellow{
  background:#eab308;
  color:#1e293b;
}
.word-quiz-badge--red{
  background:#ef4444;
  color:#fff;
}
.reading-history-name-row{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
@media (max-width: 720px){
  .mcq-item label{
    display:flex;
    align-items:flex-start;
    gap:8px;
    padding:8px 10px;
    border-radius:10px;
    background:#fff;
    border:1px solid rgba(148,163,184,0.35);
    min-height:44px;
  }
  .word-action-row{
    grid-template-columns:1fr;
  }
  .word-import-review-head{
    align-items:flex-start;
    flex-direction:column;
  }
  .word-import-add-row{
    grid-template-columns:1fr;
  }
}
.word-history-quiz-badge{
  margin-top:1px;
}

/* ── Writing Genie ───────────────────────────────────────────────────────── */
.writing-level-tabs{
  margin-bottom:14px;
}
.writing-level-tabs .input-tab{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
}
.writing-level-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  padding:2px 8px;
  font-size:0.7rem;
  font-weight:700;
  line-height:1.15;
}
.writing-level-badge--muted{
  background:#f1f5f9;
  color:#475569;
}
.writing-level-badge--amber{
  background:#fef3c7;
  color:#92400e;
}
.writing-level-badge--green{
  background:#dcfce7;
  color:#166534;
}
.writing-stage-title{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin-bottom:6px;
  padding:2px 9px;
  border-radius:999px;
  background:#eef2ff;
  color:#3730a3;
  font-size:0.74rem;
  font-weight:800;
  letter-spacing:0.02em;
}
.writing-worksheet-block{
  position:relative;
}
.writing-worksheet-toolbar{
  position:absolute;
  top:10px;
  right:10px;
  left:auto;
  z-index:2;
}
.writing-parent-edit-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:40px;
  height:40px;
  padding:0;
  border-radius:12px;
  border:1px solid rgba(148,163,184,0.45);
  background:#fff;
  color:#334155;
  cursor:pointer;
  box-shadow:0 1px 2px rgba(15,23,42,0.06);
}
.writing-parent-edit-btn:hover{
  border-color:#93c5fd;
  color:var(--brand-blue-hover);
  background:#f8fbff;
}
.writing-parent-edit-btn--active{
  border-color:var(--brand-blue);
  color:var(--brand-blue-hover);
  background:#eff6ff;
}
.writing-parent-edit-icon{
  display:block;
}
.writing-worksheet-block:has(#writingParentEditBtn:not([hidden])) #writingScaffoldHost > .mcq-wrap:first-child{
  padding-top:10px;
  padding-right:52px;
}
.writing-worksheet-block:not(.writing-parent-edit-on) .writing-prompt-input{
  display:none !important;
}
.writing-prompt-input{
  width:100%;
  margin-bottom:6px;
  padding:6px 9px;
  border-radius:10px;
  border:1px solid #bfdbfe;
  background:#f8fbff;
  color:var(--brand-navy);
  font-size:0.84rem;
  font-weight:600;
}
.writing-prompt-input:focus{
  outline:none;
  border-color:var(--brand-blue);
  box-shadow:0 0 0 2px rgba(8,106,191,0.15);
}
.pdf-export-root.writing-ginnie-pdf-export .writing-prompt-input,
.pdf-export-root.writing-ginnie-pdf-export .writing-parent-edit-btn{
  display:none !important;
}
.writing-ginnie-app .writing-answer{
  min-height:96px;
  width:100%;
  border:1px solid #cfe5ff;
  border-radius:12px;
  padding:10px 12px;
  font:inherit;
  color:#243646;
  line-height:1.5;
  resize:vertical;
  background:#fff;
}
.writing-ginnie-app .writing-answer:focus{
  outline:none;
  border-color:var(--brand-light-blue);
  box-shadow:0 0 0 3px rgba(8,106,191,0.15);
}
.writing-ginnie-app .writing-inline-blank{
  display:inline-block;
  min-width:96px;
  max-width:220px;
  width:30%;
  margin:0 5px;
  padding:4px 8px;
  border:1px solid #93c5fd;
  border-radius:8px;
  font:inherit;
  font-weight:700;
  color:var(--brand-navy);
  background:#eff6ff;
  vertical-align:baseline;
}
.writing-ginnie-app .writing-inline-blank:focus{
  outline:none;
  border-color:var(--brand-blue);
  box-shadow:0 0 0 2px rgba(8,106,191,0.2);
}
.writing-rubric-wrap{
  margin-top:10px;
  border:1px solid rgba(8,106,191,0.22);
  border-radius:12px;
  background:#f8fbff;
  padding:10px 12px;
}
.writing-rubric-head{
  font-weight:800;
  color:var(--brand-blue-hover);
  margin-bottom:8px;
}
.writing-rubric-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:8px;
  margin-bottom:8px;
}
.writing-rubric-item{
  background:#fff;
  border:1px solid rgba(148,163,184,0.28);
  border-radius:10px;
  padding:8px 9px;
  color:#334155;
  font-size:0.86rem;
  line-height:1.35;
}
.writing-diff-wrap{
  margin-top:8px;
  display:grid;
  gap:7px;
}
.writing-diff-row{
  background:#fff;
  border:1px solid rgba(148,163,184,0.28);
  border-radius:10px;
  padding:8px 9px;
  font-size:0.84rem;
  color:#334155;
  line-height:1.4;
}
.writing-diff-stage{
  font-weight:700;
  font-size:0.78rem;
  text-transform:uppercase;
  letter-spacing:0.04em;
  color:#475569;
  margin-bottom:4px;
}
.writing-diff-row--changed{
  border-color:rgba(8,106,191,0.45);
  background:#eff6ff;
}
.writing-diff-toggle{
  display:inline-flex;
  align-items:center;
  gap:7px;
  margin:4px 0 6px;
  font-size:0.84rem;
  color:#334155;
  font-weight:700;
}
.writing-diff-toggle input{
  width:16px;
  height:16px;
}
.writing-full-story-wrap{
  margin-top:14px;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid rgba(8,106,191,0.35);
  background:linear-gradient(165deg,#fff 0%,#f0f7ff 100%);
  scroll-margin-top:12px;
}
.writing-full-story-heading{
  font-size:1.05rem;
  font-weight:800;
  color:var(--brand-blue);
}
.writing-full-story-note{
  font-size:0.8rem;
  color:#475569;
  margin-top:2px;
  margin-bottom:10px;
}
.writing-full-story-body{
  color:#1e293b;
  font-size:0.94rem;
  line-height:1.55;
}
.writing-full-story-preface-title,
.writing-full-story-primary-title{
  font-size:0.72rem;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:0.06em;
  color:#4338ca;
  margin:12px 0 6px;
}
.writing-full-story-preface-title{ margin-top:0; }
.writing-full-story-preface{
  margin-bottom:14px;
  padding-bottom:12px;
  border-bottom:1px dashed rgba(100,116,139,0.45);
}
.writing-full-story-segment{
  margin-bottom:14px;
}
.writing-full-story-segment--preface .writing-full-story-stage{
  color:#5b21b6;
}
.writing-full-story-stage{
  font-weight:800;
  font-size:0.8rem;
  color:#0369a1;
  margin-bottom:4px;
}
.writing-full-story-p{
  margin:0 0 1em;
}
.writing-full-story-p:last-child{ margin-bottom:0; }
@keyframes writing-full-story-pulse{
  0%{ box-shadow:0 0 0 0 rgba(8,106,191,0.45); }
  100%{ box-shadow:0 0 0 10px rgba(8,106,191,0); }
}
.writing-full-story-wrap--pulse{
  animation:writing-full-story-pulse 0.78s ease-out 1;
}

.pdf-export-root.writing-ginnie-pdf-export.writing-ginnie-pdf-root{
  display:flex;
  flex-direction:column;
}
.pdf-export-root.writing-ginnie-pdf-export .writing-full-story-wrap{
  order:-1;
  margin-bottom:12px;
  background:#fff;
}
.pdf-export-root.writing-ginnie-pdf-export .writing-pdf-suppress-worksheet{
  display:none !important;
}
.pdf-export-root.writing-ginnie-pdf-export #writingRubricHost,
.pdf-export-root.writing-ginnie-pdf-export #writingImprovePreviewHost,
.pdf-export-root.writing-ginnie-pdf-export #writingFeedback{
  display:none !important;
}
.pdf-export-root.writing-ginnie-pdf-export.writing-ginnie-pdf-hide-fullstory .writing-full-story-wrap{
  display:none !important;
}

/* ── Crossword Genie ───────────────────────────────────────────────────── */
.cw-layout{
  display:flex;
  flex-wrap:wrap;
  gap:16px;
  align-items:start;
}
.cw-layout > .cw-grid{
  flex:0 0 auto;
}
.cw-layout > .cw-clues{
  flex:1 1 280px;
  min-width:280px;
}
.cw-grid{
  table-layout:fixed;
  border-collapse:separate;
  border-spacing:2px;
  background:#d8dee9;
  border:4px solid var(--cw-accent-border,#cbd5e1);
  border-radius:10px;
  padding:2px;
}
.cw-cell,.cw-block{
  width:42px;
  min-width:42px;
  max-width:42px;
  height:42px;
  min-height:42px;
  max-height:42px;
  border:none;
  position:relative;
  background:#fff;
}
.cw-block{
  background:#e8ecf2;
}
.cw-input{
  display:block;
  width:100%;
  height:100%;
  margin:0;
  padding:0;
  box-sizing:border-box;
  border:none;
  text-transform:uppercase;
  text-align:center;
  font-weight:700;
  font-size:1.28rem;
  color:#1f2937;
  outline:none;
  background:#fff;
}
.cw-input.ok{background:#ecfdf3;}
.cw-input.bad{background:#fef2f2;}
.cw-num{
  position:absolute;
  top:2px;
  left:3px;
  font-size:.78rem;
  font-weight:800;
  line-height:1;
}
.cw-num-across{
  color:#dc2626;
}
.cw-num-down{
  color:var(--brand-blue);
}
.cw-num-both{
  color:#7c3aed;
}
.cw-clues{
  background:#fff;
  border:2px solid var(--cw-accent-border,#e4e9f4);
  border-radius:12px;
  padding:12px;
}
.cw-clue-title{
  font-weight:800;
  color:#1f2937;
  margin-bottom:6px;
}
.cw-clues ol{
  margin:0 0 12px 18px;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.cw-clues li{
  line-height:1.4;
  color:#475569;
}
.cw-clues-across li::marker{
  color:#dc2626;
  font-weight:800;
}
.cw-clues-down li::marker{
  color:var(--brand-blue);
  font-weight:800;
}
.crossword-gamebar{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin:2px 0 14px;
}
.crossword-game-pill{
  padding:6px 10px;
  border-radius:999px;
  border:1px solid #dbe5f5;
  background:#f8fbff;
  color:#334155;
  font-weight:500;
}

/* ── Science Genie ─────────────────────────────────────────────────────── */
.science-gennie-app .header,
.science-gennie-app .input-card,
.science-gennie-app #scienceResultArea .result-card{
  max-width:900px;
  margin-left:auto;
  margin-right:auto;
}
.science-gennie-app .gennie-mode-tabs,
.science-gennie-app .gennie-mode-panel{
  max-width:900px;
  margin-left:auto;
  margin-right:auto;
}
.bilingual-gennie-app .gennie-mode-tabs,
.bilingual-gennie-app .gennie-mode-panel{
  max-width:900px;
  margin-left:auto;
  margin-right:auto;
}
.science-gennie-app .gennie-mode-tabs{
  margin-top:16px;
}
.science-gennie-app .gennie-mode-panel{
  margin-top:14px;
}
.science-topic-title{
  font-family:var(--font-heading);
  font-size:1.45rem;
  font-weight:800;
  color:#065f46;
  margin-bottom:10px;
}
.science-summary{
  color:#334155;
  line-height:1.65;
  margin-bottom:18px;
}
.science-summary p{margin:0;}
.science-section{margin-bottom:18px;}
.science-section-title{
  font-family:var(--font-heading);
  font-size:1.08rem;
  font-weight:800;
  color:#047857;
  margin:0 0 8px;
}
.science-concept-list{
  margin:0;
  padding-left:1.25rem;
  color:#475569;
  line-height:1.55;
}
.science-vocab-grid{
  margin-top:4px;
}
.science-try-box{
  margin-top:8px;
  padding:14px 16px;
  border-radius:14px;
  border:1px solid rgba(5,150,105,0.25);
  background:linear-gradient(135deg,#ecfdf5,#f0fdf4);
  color:#14532d;
  line-height:1.55;
}
.science-try-title{
  font-weight:800;
  margin-bottom:6px;
  color:#047857;
}
.science-try-box p{margin:0;}
.science-checkbox-row{
  display:flex;
  align-items:flex-start;
  gap:10px;
  margin-top:14px;
  cursor:pointer;
  font-size:0.95rem;
  color:#475569;
  line-height:1.45;
  max-width:42rem;
}
.science-checkbox-row input{
  margin-top:3px;
  flex-shrink:0;
}
.science-diagram-section .science-diagram-inner{
  border-radius:16px;
  border:1px solid rgba(5,150,105,0.2);
  background:#fff;
  padding:12px;
  min-height:120px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.science-diagram-loading{
  color:#64748b;
  font-weight:600;
  text-align:center;
  padding:16px;
}
.science-diagram-img{
  max-width:100%;
  height:auto;
  border-radius:12px;
  display:block;
}
.science-diagram-fail{
  margin:0;
  color:#b45309;
  font-size:0.95rem;
  text-align:center;
  padding:8px;
}

/* ── Grammar Genie ─────────────────────────────────────────────────────── */
.grammar-grade-row{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:12px;
  margin:14px 0 8px;
}
.grammar-grade-row label{font-size:0.9rem;color:var(--muted,#5c6b7a);}
.grammar-grade-row select{
  font-family:var(--font-body);
  font-weight:500;
  padding:6px 10px;
  border-radius:10px;
  border:2px solid rgba(31,42,51,0.15);
}
.grammar-worksheet-title{
  font-family:var(--font-heading);
  font-size:1.4rem;
  font-weight:800;
  color:#92400e;
  margin-bottom:8px;
}
.grammar-page-summary{
  color:#475569;
  line-height:1.55;
  margin:0 0 16px;
}
.grammar-parent-tips{
  padding:12px 14px;
  border-radius:12px;
  border:1px solid rgba(217,119,6,0.25);
  background:linear-gradient(135deg,#fffbeb,#fff7ed);
  margin-bottom:20px;
}
.grammar-parent-tips-title{
  font-weight:800;
  color:#b45309;
  margin-bottom:8px;
  font-size:0.95rem;
}
.grammar-parent-tips ul{margin:0;padding-left:1.2rem;color:#334155;line-height:1.5;}
.grammar-task-card{
  border:2px solid rgba(31,42,51,0.1);
  border-radius:16px;
  padding:16px 18px;
  margin-bottom:18px;
  background:#fff;
  box-shadow:0 2px 10px rgba(31,42,51,0.05);
}
.grammar-task-title{
  font-family:var(--font-heading);
  font-size:1.1rem;
  font-weight:800;
  color:var(--brand-neutral-3);
  margin:0 0 8px;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
}
.grammar-task-type{
  font-size:0.78rem;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:0.04em;
  color:#b45309;
  background:rgba(251,191,36,0.2);
  padding:3px 8px;
  border-radius:999px;
}
.grammar-task-instruction{
  font-weight:600;
  color:#334155;
  line-height:1.5;
  margin:0 0 12px;
}
.grammar-key-flag{
  font-size:0.88rem;
  color:#047857;
  margin:0 0 10px;
  font-weight:600;
}
.grammar-line-block{margin-bottom:14px;}
.grammar-line-text{
  margin:0 0 8px;
  color:#1e293b;
  line-height:1.55;
  font-size:1.02rem;
}
.grammar-field-label{
  display:block;
  font-size:0.88rem;
  color:#64748b;
  margin-bottom:4px;
}
.grammar-input,.grammar-select,.grammar-textarea{
  width:100%;
  max-width:32rem;
  font-family:var(--font-body);
  font-size:1rem;
  padding:10px 12px;
  border-radius:10px;
  border:2px solid rgba(31,42,51,0.12);
}
.grammar-textarea{min-height:80px;resize:vertical;}
.grammar-blank-field{margin-bottom:12px;}
.grammar-mc-row{
  display:flex;
  align-items:flex-start;
  gap:10px;
  margin:8px 0;
  cursor:pointer;
  color:#1e293b;
  line-height:1.45;
}
.grammar-mc-row input{margin-top:4px;}
.grammar-pick-row{
  display:flex;
  flex-wrap:wrap;
  align-items:flex-start;
  gap:12px 16px;
  margin-bottom:14px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(31,42,51,0.1);
  background:#fafafa;
}
.grammar-pick-row-num{
  font-weight:800;
  color:#b45309;
  min-width:1.5rem;
}
.grammar-pick-options{
  display:flex;
  flex-wrap:wrap;
  gap:10px 14px;
  flex:1;
}
.grammar-pick-opt{
  display:inline-flex;
  align-items:center;
  gap:6px;
  cursor:pointer;
  font-size:0.98rem;
  color:#1e293b;
}
.grammar-pick-opt input{margin:0;}
.grammar-answer-details{
  margin:14px 0 10px;
  font-size:0.95rem;
  color:#64748b;
}
.grammar-answer-details summary{cursor:pointer;font-weight:600;color:#b45309;}
.grammar-answer-inner{padding:10px 0 4px;}
.grammar-answer-key-list{margin:0;padding-left:1.2rem;color:#475569;line-height:1.45;}
.grammar-hint{font-size:0.92rem;color:#64748b;margin:0;}
.grammar-check-row{margin-top:12px;}
.grammar-feedback{
  margin:10px 0 0;
  padding:10px 12px;
  border-radius:10px;
  font-size:0.98rem;
  line-height:1.45;
  min-height:1.2em;
}
.grammar-feedback--pending{background:#f1f5f9;color:#475569;}
.grammar-feedback--correct{
  background:rgba(16,185,129,0.12);
  border:1px solid rgba(16,185,129,0.35);
  color:#14532d;
}
.grammar-feedback--partial{
  background:rgba(251,191,36,0.15);
  border:1px solid rgba(217,119,6,0.35);
  color:#92400e;
}
.grammar-feedback--incorrect{
  background:rgba(248,113,113,0.12);
  border:1px solid rgba(220,38,38,0.25);
  color:#991b1b;
}
.grammar-q-list{margin-top:16px;}
.grammar-q-title{
  margin:0 0 10px;
  font-size:1rem;
  font-weight:800;
  color:#334155;
}
.grammar-q-row{
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:12px;
  border:1px solid rgba(31,42,51,0.12);
  border-radius:12px;
  padding:12px 14px;
  margin-bottom:12px;
  background:#fff;
}
.grammar-q-thumb-wrap{
  position:relative;
  width:100%;
  max-width:100%;
}
.grammar-q-thumb{
  display:block;
  width:100%;
  max-width:min(100%,920px);
  height:auto;
  margin:0 auto;
  border-radius:10px;
  border:1px solid rgba(31,42,51,0.12);
  background:#f8fafc;
  vertical-align:middle;
}
.grammar-q-stamp{
  position:absolute;
  top:clamp(6px,2.2%,14px);
  right:clamp(6px,2.2%,14px);
  z-index:3;
  pointer-events:none;
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
  font-weight:800;
  font-size:clamp(0.78rem,2.1vw + 0.55rem,1.15rem);
  line-height:1.1;
  letter-spacing:0.02em;
  padding:0.35em 0.65em;
  border-radius:10px;
  border:2px solid rgba(15,23,42,0.35);
  box-shadow:0 2px 10px rgba(15,23,42,0.28);
  text-shadow:0 1px 0 rgba(0,0,0,0.18);
}
.grammar-q-stamp--right{
  background:linear-gradient(165deg,#10b981,#059669);
  color:#ecfdf5;
}
.grammar-q-stamp--wrong{
  background:linear-gradient(165deg,#f87171,#dc2626);
  color:#fef2f2;
}
.grammar-q-stamp--na{
  background:linear-gradient(165deg,#fbbf24,#d97706);
  color:#fffbeb;
}
.grammar-q-stamp--partial{
  background:linear-gradient(165deg,#94a3b8,#64748b);
  color:#f8fafc;
}
.grammar-sheet-ref-frame{
  position:relative;
  display:block;
  max-width:100%;
}
.grammar-q-stamp--sheet{
  font-size:clamp(0.95rem,2.4vw + 0.5rem,1.35rem);
  padding:0.45em 0.85em;
  top:clamp(8px,2.5%,18px);
  right:clamp(8px,2.5%,18px);
}
.grammar-q-body{flex:1;min-width:0;width:100%;}
.grammar-q-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:4px;
}
.grammar-q-id{font-weight:700;color:var(--brand-neutral-3);}
.grammar-chip{
  border-radius:999px;
  padding:2px 8px;
  font-size:0.8rem;
  font-weight:700;
}
.grammar-chip--correct{background:rgba(16,185,129,0.12);color:#14532d;}
.grammar-chip--incorrect{background:rgba(248,113,113,0.14);color:#991b1b;}
.grammar-chip--na{background:rgba(251,191,36,0.18);color:#92400e;}
.grammar-q-answer,.grammar-q-reason{font-size:0.95rem;color:#475569;line-height:1.4;}
.grammar-q-rowtext{
  font-size:0.92rem;
  color:#334155;
  line-height:1.45;
  margin:6px 0 8px;
  padding:8px 10px;
  background:rgba(241,245,249,0.9);
  border-radius:8px;
  border-left:3px solid rgba(59,130,246,0.45);
}
.grammar-q-rowtext-label{
  display:block;
  font-size:0.72rem;
  font-weight:800;
  letter-spacing:0.04em;
  text-transform:uppercase;
  color:#64748b;
  margin-bottom:4px;
}
.grammar-sheet-ref{
  margin:12px 0 18px;
  padding:12px;
  background:#fff;
  border:1px solid rgba(31,42,51,0.1);
  border-radius:14px;
}
.grammar-sheet-ref-label{
  margin:0 0 8px;
  font-size:0.85rem;
  font-weight:800;
  color:#334155;
}
.grammar-sheet-ref-img{
  display:block;
  max-width:100%;
  width:auto;
  height:auto;
  max-height:min(92vh,1100px);
  margin:0 auto;
  border-radius:10px;
  border:1px solid rgba(31,42,51,0.12);
  background:#f8fafc;
  vertical-align:middle;
}
.grammar-sheet-ref-hint{margin:10px 0 0;font-size:0.85rem;}

/* Shared content width for standalone Genie pages (with home’s wide `.app` shell). */
body:not(.home-page) .tool-page-app .header,
body:not(.home-page) .tool-page-app .input-card,
body:not(.home-page) .tool-page-app .result-area > .result-card,
body:not(.home-page) .bilingual-gennie-app .header,
body:not(.home-page) .bilingual-gennie-app .gennie-mode-tabs,
body:not(.home-page) .bilingual-gennie-app .gennie-mode-panel,
body:not(.home-page) .bilingual-gennie-app .input-card,
body:not(.home-page) .bilingual-gennie-app .result-area > .result-card,
body:not(.home-page) .bilingual-gennie-app #bilingualHistoryHost .reading-history-wrap,
body:not(.home-page) .math-gennie-app .math-gennie-mode-tabs,
body:not(.home-page) .math-gennie-app .math-gennie-panel,
body:not(.home-page) .math-gennie-app #mathHistoryHost .reading-history-wrap,
body:not(.home-page) .word-gennie-app .header,
body:not(.home-page) .word-gennie-app .gennie-mode-tabs,
body:not(.home-page) .word-gennie-app .input-card,
body:not(.home-page) .word-gennie-app .gennie-generated-wrap,
body:not(.home-page) .word-gennie-app #wordHistoryHost .reading-history-wrap,
body:not(.home-page) .crossword-gennie-app .header,
body:not(.home-page) .crossword-gennie-app .gennie-mode-tabs,
body:not(.home-page) .crossword-gennie-app .input-card,
body:not(.home-page) .crossword-gennie-app .gennie-generated-wrap,
body:not(.home-page) .crossword-gennie-app #crosswordHistoryHost .reading-history-wrap,
body:not(.home-page) .science-gennie-app .header,
body:not(.home-page) .science-gennie-app .input-card,
body:not(.home-page) .science-gennie-app .gennie-mode-tabs,
body:not(.home-page) .science-gennie-app .gennie-generated-wrap,
body:not(.home-page) .science-gennie-app #scienceHistoryHost .reading-history-wrap,
body:not(.home-page) .grammar-gennie-app .header,
body:not(.home-page) .grammar-gennie-app .input-card,
body:not(.home-page) .grammar-gennie-app .gennie-mode-tabs,
body:not(.home-page) .grammar-gennie-app .gennie-generated-wrap,
body:not(.home-page) .grammar-gennie-app #grammarHistoryHost .reading-history-wrap,
  max-width:900px;
  margin-left:auto;
  margin-right:auto;
}
.gennie-mode-tabs{
  margin-top:16px;
  margin-bottom:0;
}
.gennie-mode-panel{
  margin-top:14px;
}
.gennie-generated-wrap{
  margin-top:22px;
}
.gennie-section--history .reading-history-wrap{
  margin-top:0;
  padding:14px 16px 16px;
}

/* ── Math Genie (Create → Generated Worksheet → History) ───────────────── */
.math-gennie-app .header.math-gennie-header{margin-bottom:8px;}
.math-gennie-mode-tabs{
  margin-top:16px;
  margin-bottom:0;
}
.math-gennie-mode-panel{
  margin-top:14px;
}
.math-gennie-tagline{
  max-width:42rem;
  margin:12px auto 0;
  font-size:1.02rem;
  line-height:1.55;
  color:#455861;
}
.math-gennie-section{margin-top:22px;}
.math-generated-worksheet-head{
  display:flex;
  flex-wrap:wrap;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.math-generated-worksheet-head .math-gennie-panel-title{margin:0;}
.math-gennie-section--create{margin-top:18px;}
.math-gennie-panel{
  border:1px solid rgba(189,178,255,0.35);
  background:#fffefb;
  border-radius:16px;
  padding:16px 18px 18px;
  box-shadow:0 4px 18px rgba(189,178,255,0.12);
}
.math-gennie-panel-title{
  font-family:var(--font-heading),serif;
  font-size:1.22rem;
  font-weight:800;
  color:var(--brand-neutral-3);
  margin:0 0 8px;
  letter-spacing:-0.02em;
}
.math-gennie-panel-lead{
  margin:0 0 14px;
  font-size:0.94rem;
  line-height:1.5;
  color:#475569;
  max-width:46rem;
}
.math-gennie-section--create .math-gennie-panel-lead{margin-bottom:18px;}
.math-gennie-section--create .input-tabs{margin-top:2px;}
.math-gennie-primary-row{margin-top:6px;}
.math-gennie-panel .math-results-wrap{margin-top:6px;}
.math-gennie-section--history{margin-top:0;}
.math-gennie-section--history .reading-history-wrap{
  margin-top:0;
  padding:14px 16px 16px;
}
.math-history-wrap-lead{
  margin-bottom:10px;
}
.math-results-idle{padding:4px 4px 0;}
.math-results-idle-title{
  font-size:1.05rem;
  font-weight:800;
  color:#334155;
  margin:0 0 8px;
}
.math-results-idle-copy{margin:0;}
.math-paste-label{margin-top:14px;}
.math-results-wrap--idle{
  margin-top:0;
  padding:20px 16px;
  border:1px dashed rgba(100,116,139,0.38);
  border-radius:12px;
  background:rgba(255,255,255,0.72);
  text-align:center;
}
.math-results-wrap--idle > .hint{
  margin:0 auto;
  max-width:28rem;
  text-align:center;
}
@media (max-width:600px){
  .math-gennie-tagline{font-size:0.95rem;}
}

/* ── Flashcards shell ───────────────────────────────────────────────────── */
.flashcards-placeholder{max-width:760px;margin:0 auto;}
.flashcard-options-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px;margin-top:16px;}
.flashcard-option{background:#fff;border:1px dashed rgba(8,106,191,0.35);border-radius:14px;padding:14px;}
.flashcard-option h3{font-family:var(--font-heading);font-size:1rem;color:var(--purple);margin:0 0 6px;}
.flashcard-option p{font-size:.92rem;line-height:1.5;color:var(--text);margin:0;}

/* ── Flashcards Step 2 ─────────────────────────────────────────────────── */
.flashcards-card{max-width:900px;margin:0 auto;}
.flashcards-app .header,
.flashcards-app .flashcards-card,
.flashcards-app #flashcardsResultArea .result-card{
  max-width:900px;
  margin-left:auto;
  margin-right:auto;
}
.flashcards-form-grid{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px;
}
.flashcards-form-grid label{display:flex;flex-direction:column;gap:7px;}
.flash-btn-row{display:flex;flex-wrap:wrap;gap:10px;align-items:center;}
.flash-bottom-actions{justify-content:center;margin-top:14px;}
.flashcards-meta{
  font-weight:700;color:var(--purple);margin-bottom:14px;
}
:root{
  --flash-card-w:2in;
  --flash-card-h:3in;
}
.flashcards-preview-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,var(--flash-card-w));
  justify-content:center;
  gap:16px;
}
.flash-flip-card{
  cursor:pointer;perspective:1100px;outline:none;border-radius:18px;
  --flash-accent:#7a33e2;
  box-shadow:0 10px 24px rgba(31,42,51,0.12);background:transparent;
  width:var(--flash-card-w);
  height:var(--flash-card-h);
}
.flash-flip-card:focus-visible{box-shadow:0 0 0 3px rgba(8,106,191,0.45);}
.flash-flip-card:nth-child(8n+1){--flash-accent:#6d2ce3;}
.flash-flip-card:nth-child(8n+2){--flash-accent:#b11f3a;}
.flash-flip-card:nth-child(8n+3){--flash-accent:#7d3608;}
.flash-flip-card:nth-child(8n+4){--flash-accent:#f0b71f;}
.flash-flip-card:nth-child(8n+5){--flash-accent:#f2ea3a;}
.flash-flip-card:nth-child(8n+6){--flash-accent:#f59aa3;}
.flash-flip-card:nth-child(8n+7){--flash-accent:#304d8f;}
.flash-flip-card:nth-child(8n+8){--flash-accent:#121212;}
.flash-flip-inner{
  position:relative;width:100%;height:100%;transform-style:preserve-3d;
  transition:transform 0.55s cubic-bezier(0.4,0.2,0.2,1);
}
.flash-flip-card.is-flipped .flash-flip-inner{transform:rotateY(180deg);}
.flash-flip-face{
  position:absolute;inset:0;backface-visibility:hidden;border-radius:16px;padding:16px 14px 14px;
  border:6px solid var(--flash-accent);display:flex;flex-direction:column;align-items:center;text-align:center;
  justify-content:flex-start;
  box-shadow:0 6px 18px rgba(31,42,51,0.15);
  background:var(--flash-accent);
}
.flash-flip-face::before{
  content:"";
  position:absolute;
  inset:10px;
  border-radius:10px;
  background:#fff;
  border:5px dotted rgba(31,42,51,0.2);
}
.flash-flip-front{}
.flash-flip-back{transform:rotateY(180deg);}
.flash-flip-face > *{position:relative;z-index:1;}
.flash-clip{
  margin-top:10px;
  font-size:4.35rem;line-height:1;margin-bottom:8px;user-select:none;filter:drop-shadow(0 2px 4px rgba(31,42,51,0.08));
}
.flashcards-preview-grid[data-flash-cat="animals"] .flash-clip,
.flashcards-preview-grid[data-flash-cat="birds"] .flash-clip,
.flashcards-preview-grid[data-flash-cat="colors"] .flash-clip{
  font-size:5.85rem;margin-bottom:10px;
}
.flash-face-label{
  margin-top:32px;
  font-size:.78rem;font-weight:800;color:#2d3d4d;text-transform:uppercase;letter-spacing:.4px;
}
.flash-word{
  margin-top:4px;font-family:var(--font-heading);font-size:1.35rem;color:var(--text);line-height:1.35;font-weight:800;
}
.flash-pron{
  margin-top:6px;font-size:.88rem;line-height:1.35;font-weight:700;letter-spacing:.02em;color:#5a6d7e;max-width:100%;
}
.flash-corner-arrow{
  position:absolute;bottom:8px;font-size:1.05rem;font-weight:500;line-height:1;color:#314455;
  background:rgba(255,255,255,0.88);border:2px solid rgba(31,42,51,0.35);border-radius:999px;
  width:24px;height:24px;display:flex;align-items:center;justify-content:center;
  box-shadow:0 2px 6px rgba(31,42,51,0.12);
}
.flash-corner-arrow-right{right:8px;}
.flash-corner-arrow-left{left:8px;}
.flash-small{margin-top:6px;font-size:.82rem;color:#6c7b88;}
.flash-print-clip{
  margin-top:10px;
  font-size:4.35rem;line-height:1;text-align:center;margin-bottom:8px;
}
.flash-duplex-wrap[data-flash-cat="animals"] .flash-print-clip,
.flash-duplex-wrap[data-flash-cat="birds"] .flash-print-clip,
.flash-duplex-wrap[data-flash-cat="colors"] .flash-print-clip{
  font-size:5.85rem;margin-bottom:10px;
}
.flash-print-pron{
  margin-top:6px;font-size:.88rem;line-height:1.35;font-weight:700;letter-spacing:.02em;color:#5a6d7e;max-width:100%;
}
.flash-print-pron--dst{margin-top:6px;}
.flashcards-print-note{margin-top:16px;font-size:.9rem;color:#6c7b88;}

/* ── Flashcards Step 3 — duplex print ───────────────────────────────────── */
.flash-section-title{
  font-family:var(--font-heading);font-size:1.1rem;color:var(--purple);margin:18px 0 10px;
}
.flash-duplex-instructions{
  font-size:.9rem;line-height:1.55;color:var(--text);opacity:.92;margin:0 0 14px;max-width:52rem;
}
.flash-print-page{margin-top:16px;}
.flash-print-page-title{
  font-family:var(--font-heading);font-size:1rem;color:var(--accent);margin:0 0 10px;
}
.flash-print-grid{
  display:grid;
  grid-template-columns:repeat(3,var(--flash-card-w));
  justify-content:center;
  gap:.12in;
}
.flash-print-cell{
  position:relative;border:2px solid #1f2a33;border-radius:16px;padding:16px 14px 14px;
  --flash-accent:#6d2ce3;
  border:6px solid var(--flash-accent);
  width:var(--flash-card-w);
  min-height:var(--flash-card-h);
  background:var(--flash-accent);
  box-shadow:0 6px 18px rgba(31,42,51,0.15);
  break-inside:avoid;
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  justify-content:flex-start;
}
.flash-print-cell::before{
  content:"";
  position:absolute;
  inset:10px;
  border-radius:10px;
  background:#fff;
  border:5px dotted rgba(31,42,51,0.2);
}
.flash-print-cell:nth-child(8n+1){--flash-accent:#6d2ce3;}
.flash-print-cell:nth-child(8n+2){--flash-accent:#b11f3a;}
.flash-print-cell:nth-child(8n+3){--flash-accent:#7d3608;}
.flash-print-cell:nth-child(8n+4){--flash-accent:#f0b71f;}
.flash-print-cell:nth-child(8n+5){--flash-accent:#f2ea3a;}
.flash-print-cell:nth-child(8n+6){--flash-accent:#f59aa3;}
.flash-print-cell:nth-child(8n+7){--flash-accent:#304d8f;}
.flash-print-cell:nth-child(8n+8){--flash-accent:#121212;}
.flash-print-cell > *{
  position:relative;
  z-index:1;
}
.flash-print-cell-empty{border-style:dashed;opacity:.35;background:transparent;}
.flash-print-main{
  margin-top:4px;
  font-family:var(--font-heading);font-size:1.35rem;color:var(--text);line-height:1.35;padding-right:0;
}
.flash-print-page-break{break-after:page;page-break-after:always;}

/* Parent grade band (home topbar) */
.home-grade-band-wrap{
  flex:0 1 auto;
  display:flex;
  align-items:center;
  gap:8px;
  margin-right:0;
  min-width:0;
}
.home-grade-band-wrap label{
  font-size:0.85rem;
  color:var(--muted,#5c6b7a);
  white-space:nowrap;
}
.home-grade-band-wrap select{
  font-family:var(--font-body);
  font-weight:500;
  font-size:0.9rem;
  padding:6px 10px;
  border-radius:10px;
  border:2px solid rgba(31,42,51,0.15);
  background:#fff;
}

.story-billing-banner-strip{margin:12px auto 8px;width:min(960px,calc(100% - 32px));padding:10px 14px;border-radius:14px;background:linear-gradient(90deg,#EEF2FF 0%,#ECFEFF 100%);border:1px solid rgba(79,70,229,.25);}
.story-billing-banner-inner{display:flex;gap:14px;align-items:center;flex-wrap:wrap;justify-content:space-between;font:600 14px/1.4 var(--font-body);color:#0f172a;}
.story-billing-banner-inner--trial{background:rgba(255,255,255,.76);padding:10px;border-radius:12px;flex:1}
.story-billing-banner-inner--warn{background:rgba(250,245,218,.94);padding:10px;border-radius:12px;flex:1;border:1px solid rgba(202,138,4,.38);}
.story-billing-banner-inner--blocked{background:rgba(254,226,226,.94);padding:10px;border-radius:12px;flex:1;border:1px solid rgba(239,68,68,.38);}
.story-billing-banner-cta{font-family:var(--font-body);font-weight:700;font-size:13px;padding:9px 16px;border-radius:999px;border:none;background:linear-gradient(180deg,#4F46E5,#4338CA);color:#fff;cursor:pointer;box-shadow:0 6px 16px rgba(79,70,229,.34);}
.story-billing-banner-cta:hover{filter:brightness(1.04);}
.story-billing-banner-strip[hidden]{display:none!important}

.story-paywall-overlay{z-index:100001;position:fixed;inset:0;background:rgba(15,23,42,.54);backdrop-filter:saturate(120%) blur(3px);display:flex;justify-content:center;align-items:center;padding:max(24px,env(safe-area-inset-top));}
.story-paywall-overlay[hidden]{display:none!important}
.story-paywall-dialog{position:relative;width:min(520px,calc(100vw - 32px));max-height:min(560px,calc(100vh - 48px));overflow:auto;background:#fff;border-radius:18px;padding:26px 24px;border:2px solid rgba(79,70,229,.2);box-shadow:0 16px 50px rgba(15,23,42,.26);}
.story-paywall-heading{font-family:var(--font-heading);font-size:1.35rem;color:#0f172a;margin-bottom:8px;}
.story-paywall-intro{font-size:15px;color:#475569;margin-bottom:16px;line-height:1.45;}
.story-paywall-plans{display:flex;flex-direction:column;gap:12px;}
.story-paywall-plan-card{display:flex;flex-direction:column;gap:8px;padding:14px 14px;border-radius:14px;border:1px solid rgba(79,70,229,.2);background:linear-gradient(180deg,#fff,#F8FAFC);}
.story-paywall-plan-top{display:flex;justify-content:space-between;gap:14px;align-items:baseline;}
.story-paywall-plan-name{font-family:var(--font-heading);font-size:1.05rem;color:#4338CA;}
.story-paywall-price{font-weight:700;font-size:14px;color:#0f172a;}
.story-paywall-price span{font-weight:600;color:#64748B;font-size:12px;margin-left:2px;}
.story-paywall-caps{font-size:12px;color:#64748b;}
.story-paywall-subscribe-btn{margin-top:2px;width:fit-content;font-family:var(--font-body);font-weight:700;font-size:13px;padding:10px 18px;border-radius:999px;border:none;background:linear-gradient(180deg,#4338CA,#312E81);color:#fff;cursor:pointer;}
.story-paywall-subscribe-btn:disabled{opacity:.55;cursor:wait;}
.story-paywall-footnote{margin-top:16px;font-size:12px;color:#94a3b8;line-height:1.4;}
.story-paywall-err{font-size:14px;color:#b91c1c;padding:12px;line-height:1.4;background:#fef2f2;border-radius:12px;}
.story-paywall-close{position:absolute;top:12px;right:12px;width:40px;height:40px;line-height:1;border:none;border-radius:999px;background:#f1f5f9;font-size:1.5rem;color:#475569;cursor:pointer;}
.story-paywall-close:hover{background:#e2e8f0;}

@media print{
  .no-print{display:none !important;}
  body{background:#fff !important;}
  .app{max-width:none;padding:0;}
  .result-card{box-shadow:none;border:none;padding:12px;}
}
