/* =============================================================================
   app.css  —  WordCraft shell + components (builds on styles.css tokens)
   ========================================================================== */

/* ---------------------------------------------------------------- LANDING --- */
.lp { min-height: 100dvh; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 32px 20px; gap: 28px; }
.lp__brand { text-align: center; }
.lp__eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .22em;
  text-transform: uppercase; color: var(--gold); }
.lp__mark { font-family: var(--font-display); font-size: clamp(2.4rem, 6vw, 3.4rem);
  color: var(--navy); margin-top: 6px; line-height: 1; }
.lp__mark b { color: var(--gold); font-weight: 600; }
.lp__tag { color: var(--ink-soft); margin-top: 10px; max-width: 46ch; font-size: 1.02rem; }
.lp__rule { width: 64px; height: 2px; background: var(--gold); margin: 4px auto 0; border-radius: 2px; }
.lp__choices { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; width: 100%; max-width: 720px; }
@media (max-width: 620px) { .lp__choices { grid-template-columns: 1fr; } }
.choice {
  text-align: left; padding: 26px; border-radius: var(--r-lg); border: 1px solid var(--line);
  background: var(--card); box-shadow: var(--shadow-sm); cursor: pointer;
  transition: transform .14s, box-shadow .14s, border-color .14s; display: flex; flex-direction: column; gap: 8px;
}
.choice:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--gold-soft); }
.choice__ic { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
  background: var(--navy); color: #fff; margin-bottom: 4px; }
.choice__ic svg { width: 22px; height: 22px; }
.choice h3 { font-size: 1.25rem; }
.choice p { color: var(--ink-soft); font-size: .9rem; }
.choice--student .choice__ic { background: var(--emerald); }

/* -------------------------------------------------------------------- AUTH -- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 28px 18px; }
.auth__panel { width: 100%; max-width: 430px; }
.auth__panel h2 { font-size: 1.5rem; }
.auth__sub { color: var(--ink-soft); font-size: .9rem; margin: 4px 0 18px; }
.field { margin-bottom: 14px; }
.auth__alt { margin-top: 16px; font-size: .86rem; color: var(--ink-soft); display: flex;
  justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.auth__alt button { color: var(--emerald); font-weight: 600; font-size: .86rem; }
.formError { color: var(--danger); font-size: .84rem; margin-top: -4px; margin-bottom: 10px; min-height: 1em; }
.back { color: var(--ink-soft); font-size: .84rem; font-weight: 600; margin-bottom: 14px;
  display: inline-flex; gap: 6px; align-items: center; }

/* ------------------------------------------------------------------- SHELL -- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100dvh; }
.side { background: var(--navy); color: #e7eef5; padding: 22px 16px; display: flex; flex-direction: column; gap: 6px; }
.side__brand { font-family: var(--font-display); font-size: 1.35rem; color: #fff; padding: 4px 8px 2px; display: flex; align-items: center; gap: 9px; }
.side__brand b { color: var(--gold); font-weight: 600; }
.side__eyebrow { font-size: .6rem; letter-spacing: .2em; text-transform: uppercase;
  color: #8aa2bd; padding: 0 8px 14px; }
.nav__item { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px;
  color: #cdd9e6; font-size: .9rem; font-weight: 500; text-align: left; width: 100%; transition: background .15s, color .15s; }
.nav__item svg { width: 17px; height: 17px; opacity: .85; flex-shrink: 0; }
.nav__item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav__item.is-active { background: var(--gold); color: var(--navy); font-weight: 600; }
.nav__item.is-active svg { opacity: 1; }
.side__foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.1); }
.side__who { font-size: .78rem; color: #9fb3c8; padding: 0 8px 8px; }

.main { padding: 28px 34px 60px; max-width: var(--maxw); width: 100%; }
.page__head { margin-bottom: 22px; }
.page__head h1 { font-size: 1.9rem; }
.page__head p { color: var(--ink-soft); margin-top: 3px; }

/* mobile: sidebar becomes a horizontal scroll bar */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { flex-direction: row; align-items: center; gap: 4px; overflow-x: auto; padding: 10px 12px; }
  .side__brand, .side__eyebrow, .side__who { display: none; }
  .side__foot { margin: 0 0 0 auto; padding: 0; border: none; }
  .nav__item { white-space: nowrap; padding: 8px 12px; }
  .nav__item span { display: none; }
  .nav__item svg { width: 20px; height: 20px; }
  .nav__item.is-active span { display: inline; }
  .main { padding: 20px 16px 50px; }
}

/* --------------------------------------------------------------- GRID/CARDS - */
.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .grid--2, .grid--3 { grid-template-columns: 1fr; } }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat__n { font-family: var(--font-mono); font-size: 1.9rem; font-weight: 700; color: var(--navy); }
.stat__l { font-size: .78rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .05em; }

/* --------------------------------------------------------- ONBOARDING STEPS - */
.steps { display: flex; flex-direction: column; gap: 2px; }
.step { display: flex; gap: 14px; padding: 14px 4px; border-bottom: 1px dashed var(--line); }
.step:last-child { border-bottom: none; }
.step__n { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 700; font-size: .9rem; border: 2px solid var(--line); color: var(--ink-soft); }
.step.is-done .step__n { background: var(--emerald); border-color: var(--emerald); color: #fff; }
.step.is-active .step__n { border-color: var(--gold); color: var(--navy); background: var(--gold-soft); }
.step__body { flex: 1; }
.step__body h4 { font-family: var(--font-body); font-size: .98rem; color: var(--ink); font-weight: 600; }
.step__body p { font-size: .85rem; color: var(--ink-soft); margin-top: 1px; }
.step__body .wc-btn { margin-top: 10px; padding: 7px 14px; font-size: .82rem; }

/* ------------------------------------------------------------- EMPTY STATE -- */
.empty { text-align: center; padding: 48px 24px; }
.empty__ic { width: 56px; height: 56px; border-radius: 14px; background: var(--cream);
  display: grid; place-items: center; margin: 0 auto 14px; border: 1px solid var(--line); }
.empty__ic svg { width: 26px; height: 26px; color: var(--gold); }
.empty h3 { font-size: 1.2rem; }
.empty p { color: var(--ink-soft); max-width: 44ch; margin: 6px auto 16px; font-size: .92rem; }
.empty__note { font-size: .78rem; color: var(--ink-soft); margin-top: 12px; font-style: italic; }

/* -------------------------------------------------------------------- LISTS - */
.row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line);
  border-radius: var(--r-md); background: var(--card); margin-bottom: 10px; }
.row__main { flex: 1; min-width: 0; }
.row__title { font-weight: 600; color: var(--navy); }
.row__sub { font-size: .82rem; color: var(--ink-soft); }
.row__actions { display: flex; gap: 8px; flex-shrink: 0; }
.chip { font-size: .72rem; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: var(--cream); color: var(--ink-soft); border: 1px solid var(--line); }
.chip--code { font-family: var(--font-mono); background: var(--emerald-soft); color: var(--emerald);
  border-color: transparent; letter-spacing: .05em; }
.iconbtn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper);
  display: grid; place-items: center; color: var(--ink-soft); }
.iconbtn:hover { color: var(--navy); border-color: var(--gold-soft); }
.iconbtn svg { width: 16px; height: 16px; }
.iconbtn--danger:hover { color: var(--danger); border-color: var(--danger); }

/* ----------------------------------------------------------------- AVATARS -- */
.av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 600; color: #fff; flex-shrink: 0; }
.avpick { display: flex; gap: 8px; flex-wrap: wrap; }
.avpick__o { width: 40px; height: 40px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.avpick__o.is-sel { border-color: var(--navy); }

/* ------------------------------------------------------------------- MODAL -- */
.modal__bg { position: fixed; inset: 0; background: rgba(10,37,64,.42); display: grid; place-items: center;
  z-index: 1000; padding: 20px; animation: wc-fade .15s; }
@keyframes wc-fade { from { opacity: 0; } }
.modal { background: var(--card); border-radius: var(--r-lg); padding: 26px; max-width: 460px; width: 100%;
  box-shadow: var(--shadow-lg); }
.modal h3 { font-size: 1.25rem; }
.modal p { color: var(--ink-soft); margin: 8px 0 18px; font-size: .92rem; }
.modal__actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ------------------------------------------------------------------- TOAST -- */
.toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 1100;
  padding: 11px 20px; border-radius: 10px; font-size: .86rem; font-weight: 600; color: #fff;
  background: var(--navy); box-shadow: var(--shadow-md); animation: wc-slidedown .2s; }
.toast--ok { background: var(--emerald); } .toast--err { background: var(--danger); }
@keyframes wc-slidedown { from { opacity: 0; transform: translate(-50%, -8px); } }

/* ---------------------------------------------------------------- PRIVACY --- */
.privacy { border-left: 3px solid var(--gold); background: #fffdf6; padding: 16px 18px; border-radius: 0 var(--r-md) var(--r-md) 0; }
.privacy ul { margin: 8px 0 0 18px; } .privacy li { font-size: .86rem; color: var(--ink-soft); margin: 4px 0; }
.note { font-size: .82rem; color: var(--ink-soft); }
.danger-zone { border: 1px solid #e9c9c5; background: #fdf6f5; border-radius: var(--r-md); padding: 16px 18px; }
.danger-zone h4 { font-family: var(--font-body); color: var(--danger); }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.inline-form .field { margin: 0; flex: 1; min-width: 160px; }

/* ----------------------------------------------------------- WORKSPACE ----- */
.ws { min-height: 100dvh; display: flex; flex-direction: column; }
.ws__top { display: flex; align-items: center; gap: 16px; padding: 14px 22px; border-bottom: 1px solid var(--line);
  background: var(--paper); position: sticky; top: 0; z-index: 10; }
.ws__top .back { margin: 0; }
.ws__bar { display: flex; align-items: center; gap: 6px; margin: 0 auto; flex-wrap: wrap; }
.ws-step { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  font-size: .82rem; font-weight: 600; color: var(--ink-soft); background: var(--cream); border: 1px solid var(--line); }
.ws-step.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }
.ws-step.is-done { color: var(--emerald); border-color: var(--emerald-soft); }
.ws-step__sep { width: 14px; height: 1px; background: var(--line); }
.ws__id { flex-shrink: 0; }
.ws__body { flex: 1; padding: 28px 22px 60px; max-width: 1080px; width: 100%; margin: 0 auto; }
.ws__center { max-width: 760px; margin: 0 auto; text-align: center; }
.ws__center .wc-card { text-align: left; }

.ws__plan, .ws__write { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
@media (max-width: 820px) { .ws__plan, .ws__write { grid-template-columns: 1fr; } }
.ws__aside { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; position: sticky; top: 84px; }

.ws-acc { border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 8px; overflow: hidden; }
.ws-acc summary { cursor: pointer; padding: 10px 13px; font-size: .85rem; font-weight: 600; color: var(--navy); list-style: none; }
.ws-acc summary::-webkit-details-marker { display: none; }
.ws-acc summary::before { content: '+'; margin-right: 8px; color: var(--gold); font-weight: 700; }
.ws-acc[open] summary::before { content: '–'; }
.ws-acc__body { padding: 0 13px 13px; }

.ws__meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.ws__wc { font-size: .9rem; color: var(--ink-soft); }
.ws__wc strong { font-family: var(--font-mono); color: var(--navy); font-size: 1.05rem; }
.ws__timer { font-family: var(--font-mono); font-weight: 700; color: var(--navy); font-size: 1.05rem; margin-left: auto; }
.ws__timer.is-low { color: var(--danger); }
.ws__progress { height: 6px; background: var(--cream); border-radius: 3px; overflow: hidden; margin-bottom: 14px; }
.ws__progress span { display: block; height: 100%; background: var(--emerald); transition: width .3s; }
.ws__text { width: 100%; min-height: 46vh; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--paper); font-family: var(--font-display); font-size: 1.08rem; line-height: 1.7; resize: vertical; }
.ws__text:focus { border-color: var(--emerald); }

.ws-check { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; font-size: .9rem; cursor: pointer; }
.ws-check input { margin-top: 3px; accent-color: var(--emerald); }

/* --- Stage 6: teacher home dashboard --------------------------------------- */
.dash { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.dash__card { display: flex; flex-direction: column; }
.dash__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.dash__head .wc-eyebrow { display: inline-flex; align-items: center; gap: 6px; }
.dash__ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: var(--navy); color: #fff; flex: none; }
.dash__line { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 0; border-top: 1px solid var(--line); font-size: .88rem; color: var(--ink); }
.dash__line:first-of-type { border-top: 0; }
.ql-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ql { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 16px 10px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--paper); cursor: pointer;
  font-size: .82rem; font-weight: 600; color: var(--navy); transition: border-color .15s, transform .12s, box-shadow .15s; }
.ql:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.ql svg { color: var(--gold); }
.skel { height: 14px; border-radius: 6px; margin: 8px 0;
  background: linear-gradient(90deg, var(--cream) 25%, #efe7d6 37%, var(--cream) 63%);
  background-size: 400% 100%; animation: skel 1.3s ease infinite; }
@keyframes skel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (max-width: 760px) { .dash, .ql-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .dash, .ql-grid { grid-template-columns: 1fr; } }

/* --- Stage 7: student writing-journey hero --------------------------------- */
.jhero { margin-bottom: 16px; border-top: 3px solid var(--gold); }
.jhero__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.jhero__title { font-family: var(--font-display); color: var(--navy); margin: 4px 0 0; font-size: 1.35rem; }
.jpath { display: flex; align-items: center; margin: 16px 0 6px; flex-wrap: wrap; gap: 2px; }
.jstep { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 56px; }
.jstep__dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--cream); color: var(--ink-soft); font-weight: 700; font-size: .85rem; border: 1px solid var(--line); }
.jstep__l { font-size: .74rem; color: var(--ink-soft); font-weight: 600; }
.jstep.is-active .jstep__dot { background: var(--navy); color: #fff; border-color: var(--navy); box-shadow: 0 0 0 4px var(--navy-soft); }
.jstep.is-active .jstep__l { color: var(--navy); }
.jstep.is-done .jstep__dot { background: var(--emerald); color: #fff; border-color: var(--emerald); }
.jstep__line { flex: 1; height: 2px; background: var(--line); min-width: 14px; margin-top: -16px; }
.jtiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0; }
.jtile { text-align: center; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 8px; }
.jtile__n { font-size: 1.3rem; font-weight: 800; color: var(--navy); line-height: 1; }
.jtile__l { font-size: .72rem; color: var(--ink-soft); margin-top: 4px; }
.jhero__focus { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  background: #fdf8ee; border: 1px solid var(--gold-soft); border-radius: var(--r-md); padding: 12px 14px; }
.jhero__badges { margin-top: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 560px) { .jtiles { grid-template-columns: 1fr 1fr; } .jstep { min-width: 48px; } }

/* --- Stage 7: celebration overlay ----------------------------------------- */
.celebrate { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  background: rgba(10, 37, 64, .42); backdrop-filter: blur(2px); animation: fadein .2s ease; padding: 20px; }
.celebrate__card { position: relative; background: var(--card); border-radius: var(--r-lg); border: 1px solid var(--line);
  box-shadow: var(--shadow-lg); padding: 30px 28px; max-width: 420px; text-align: center; animation: pop .3s cubic-bezier(.2,1.3,.5,1); }
.celebrate__ic { width: 60px; height: 60px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center;
  background: var(--emerald-soft); color: var(--emerald); }
.celebrate__card h2 { font-family: var(--font-display); color: var(--navy); margin: 0 0 6px; }
.celebrate__card p { color: var(--ink-soft); margin: 0 0 16px; line-height: 1.55; }
.celebrate__badges { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.celebrate__streak { font-weight: 700; color: #9a6b00; margin-bottom: 16px; }
.celebrate__confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.cf { position: absolute; top: -10px; width: 9px; height: 14px; border-radius: 2px; opacity: .9; animation: fall 1.8s linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(360deg); opacity: 0; } }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* --- Stage 8: practice modes ---------------------------------------------- */
.prac__bar { height: 6px; background: var(--cream); border-radius: 3px; overflow: hidden; margin: 8px 0 6px; }
.prac__bar span { display: block; height: 100%; background: var(--emerald); transition: width .3s; }
.prac__meta { display: flex; justify-content: space-between; font-size: .8rem; color: var(--ink-soft); margin-bottom: 14px; }
.prac__ideas { display: flex; gap: 8px; flex-wrap: wrap; }
.prac__weak { background: #fdecea; border-left: 3px solid var(--danger); padding: 10px 12px; border-radius: 4px;
  font-family: var(--font-display); font-style: italic; }
.prac__input { width: 100%; margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md);
  font-family: var(--font-display); font-size: 1rem; line-height: 1.6; resize: vertical; background: var(--paper); }
.prac__input:focus { border-color: var(--emerald); outline: none; }
.prac__model { background: var(--emerald-soft); border-radius: var(--r-md); padding: 12px 14px; margin-top: 12px; }
.prac__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.prac__slot { border-top: 1px solid var(--line); padding: 12px 0; }
.prac__slot:first-of-type { border-top: 0; }
.prac__slotlabel { font-weight: 700; color: var(--navy); display: flex; align-items: center; gap: 8px; }
.prac__slotlabel .badge { background: var(--navy); color: #fff; width: 22px; height: 22px; border-radius: 50%;
  display: inline-grid; place-items: center; font-size: .78rem; }
.prac__opts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.prac__opt { padding: 9px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper);
  cursor: pointer; font-size: .9rem; font-weight: 600; color: var(--navy); transition: all .15s; }
.prac__opt:hover:not(:disabled) { border-color: var(--gold); transform: translateY(-1px); }
.prac__opt.ok { background: var(--emerald); color: #fff; border-color: var(--emerald); }
.prac__opt.no { background: #fdecea; color: var(--danger); border-color: var(--danger); }

/* --- Stage 8: Support / Standard / Challenge layers ------------------------ */
.lyrs { }
.lyr { border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 8px; overflow: hidden; }
.lyr summary { cursor: pointer; padding: 12px 14px; list-style: none; display: flex; align-items: center; }
.lyr summary::-webkit-details-marker { display: none; }
.lyr__tag { font-weight: 700; font-size: .82rem; padding: 4px 12px; border-radius: 999px; }
.lyr__tag--support { background: var(--emerald-soft); color: var(--emerald); }
.lyr__tag--standard { background: var(--navy-soft); color: var(--navy); }
.lyr__tag--challenge { background: var(--gold-soft); color: #9a6b00; }
.lyr summary::after { content: '+'; margin-left: auto; color: var(--gold); font-weight: 700; font-size: 1.1rem; }
.lyr[open] summary::after { content: '–'; }
.lyr__body { padding: 0 14px 14px; }
.lyr__model { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; margin: 8px 0; }
.lyr__model p { margin: 6px 0 0; font-family: var(--font-display); font-style: italic; font-size: .95rem; }
.lyr__b { margin-top: 12px; }
.lyr__b .chip { margin: 2px 3px 2px 0; }

/* --- Stage 9: genre mini lesson ------------------------------------------- */
.mini__head { margin-bottom: 8px; }
.mini__d { border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 8px; overflow: hidden; }
.mini__d summary { cursor: pointer; padding: 11px 13px; list-style: none; font-weight: 600; font-size: .9rem; color: var(--navy); }
.mini__d summary::-webkit-details-marker { display: none; }
.mini__d summary::before { content: '+'; margin-right: 8px; color: var(--gold); font-weight: 700; }
.mini__d[open] summary::before { content: '–'; }
.mini__b { padding: 0 14px 14px; font-size: .92rem; }
.mini__ex { border-radius: var(--r-md); padding: 10px 12px; margin: 8px 0; }
.mini__ex p { margin: 5px 0 0; font-family: var(--font-display); font-style: italic; }
.mini__ex--weak { background: #fdecea; border-left: 3px solid var(--danger); }
.mini__ex--good { background: var(--emerald-soft); border-left: 3px solid var(--emerald); }
.mini__why { background: #fdf8ee; border: 1px solid var(--gold-soft); border-radius: var(--r-md); padding: 10px 12px; margin-top: 8px; font-size: .9rem; }

/* --- Stage 10: feedback comment bank + filters ---------------------------- */
.fbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.fchip { padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper);
  cursor: pointer; font-size: .84rem; font-weight: 600; color: var(--ink-soft); transition: all .15s; }
.fchip:hover { border-color: var(--gold); }
.fchip.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }
.fchip__n { opacity: .7; margin-left: 4px; }
.cmtbank { display: grid; gap: 8px; }
.cmtcat { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.cmtcat summary { cursor: pointer; padding: 10px 13px; list-style: none; font-weight: 600; font-size: .9rem; color: var(--navy); }
.cmtcat summary::-webkit-details-marker { display: none; }
.cmtcat summary::before { content: '+'; margin-right: 8px; color: var(--gold); font-weight: 700; }
.cmtcat[open] summary::before { content: '–'; }
.cmtcat__b { padding: 0 13px 13px; }
.cmt__wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.cmt { text-align: left; padding: 7px 11px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--paper);
  cursor: pointer; font-size: .84rem; color: var(--ink); transition: all .15s; max-width: 100%; }
.cmt:hover { border-color: var(--emerald); background: var(--emerald-soft); }
.cmt--custom { display: inline-flex; align-items: center; gap: 6px; border-color: var(--gold-soft); background: #fdf8ee; padding: 7px 9px 7px 11px; }
.cmt__x { all: unset; cursor: pointer; color: var(--danger); font-weight: 700; padding: 0 4px; }
.cmt__add { display: flex; gap: 8px; margin-top: 10px; }
.cmt__add .wc-input { flex: 1; }

/* --- Stage 11: Print Center ----------------------------------------------- */
.pc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.pc-opts { display: flex; flex-wrap: wrap; gap: 14px; padding: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); }
.pc-check { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--ink); cursor: pointer; }
.pc-check input { accent-color: var(--emerald); width: 16px; height: 16px; }
@media (max-width: 560px) { .pc-grid { grid-template-columns: 1fr; } }

/* =============================================================================
   Stage 12 — Visual design polish (additive; respects reduced-motion guard)
   ========================================================================== */

/* --- Accessibility: clear keyboard focus on every interactive element ------ */
.choice:focus-visible, .ql:focus-visible, .fchip:focus-visible, .cmt:focus-visible,
.prac__opt:focus-visible, .nav__item:focus-visible, .row__actions .wc-btn:focus-visible,
summary:focus-visible, .cmt__x:focus-visible {
  outline: 2px solid var(--emerald); outline-offset: 2px; border-radius: 6px;
}
.lyr summary:focus-visible, .mini__d summary:focus-visible, .cmtcat summary:focus-visible {
  outline: 2px solid var(--emerald); outline-offset: -2px;
}
/* respect users who turn on high-contrast/forced colours */
@media (forced-colors: active) {
  .wc-btn, .choice, .wc-card { border: 1px solid currentColor; }
}

/* --- Buttons: refined hover / active / disabled / focus -------------------- */
.wc-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.wc-btn:disabled, .wc-btn[disabled] {
  opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; filter: none;
}
.wc-btn:disabled:hover { background: var(--navy); }
.wc-btn--ghost:disabled:hover { background: transparent; color: var(--navy); }
.iconbtn { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  color: var(--ink-soft); transition: background .15s, color .15s; }
.iconbtn:hover { background: var(--cream); color: var(--navy); }

/* --- Cards & rows: gentle, consistent depth on hover ----------------------- */
.wc-card { transition: box-shadow .18s ease, border-color .18s ease; }
.row { transition: border-color .15s, box-shadow .15s, background .15s; }
.row:hover { border-color: var(--gold-soft); box-shadow: var(--shadow-sm); }
.choice:active, .ql:active { transform: translateY(0); }

/* --- Page heading entrance (one-time per view; reduced-motion neutralises) - */
.page__head { animation: wc-fade .28s ease both; }
@keyframes wc-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* --- Toast: slide-in, leading status dot ----------------------------------- */
.toast { animation: wc-toast-in .26s cubic-bezier(.2,1.2,.4,1) both; display: flex; align-items: center; gap: 9px; }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.85); flex: none; }
@keyframes wc-toast-in { from { opacity: 0; transform: translateX(-50%) translateY(-10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* --- Inline error: a calmer, clearer banner when present ------------------- */
.formError:not(:empty) {
  background: #fbeae8; border: 1px solid #eccac6; color: var(--danger);
  border-radius: var(--r-md); padding: 9px 12px; font-size: .86rem; margin: 0 0 12px;
  animation: wc-fade .2s ease both;
}

/* --- Loading: reusable inline loader --------------------------------------- */
.wc-loading { display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 28px; color: var(--ink-soft); font-size: .9rem; }
.wc-loading .wc-spinner { width: 20px; height: 20px; border-width: 2px; }

/* --- Progress ring (reusable; bars already used in the journey) ------------ */
.ring { --val: 0; --size: 56px; width: var(--size); height: var(--size); border-radius: 50%;
  display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--gold) calc(var(--val) * 1%), var(--gold-soft) 0); }
.ring__inner { width: calc(var(--size) - 12px); height: calc(var(--size) - 12px); border-radius: 50%;
  background: var(--card); display: grid; place-items: center; font-weight: 800; color: var(--navy); font-size: .9rem; }

/* --- Badge chips: subtle unlock sheen on the journey hero ------------------ */
.jhero__badges .chip { transition: transform .15s; }
.jhero__badges .chip:hover { transform: translateY(-1px); }

/* --- Empty states: a touch more generous + iconwell tint ------------------- */
.empty__ic { box-shadow: inset 0 0 0 1px var(--line); }

/* --- Mobile spacing tidy --------------------------------------------------- */
@media (max-width: 560px) {
  .wc-card { padding: 18px; }
  .row { padding: 12px 13px; }
  .page__head h1 { font-size: 1.5rem; }
}
/* =============================================================================
   annotate.css  —  Editorial annotation layer (light UI, matches app.css)
   Append to app.css. Uses existing WordCraft tokens only — no new variables.
   Styled for the real teacher UI (white wc-cards on cream), NOT the dark
   preview desk.
   ========================================================================== */

/* --- Marks inside the student writing block ------------------------------- */
.anmark { padding: 1px 2px; border-radius: 3px; cursor: pointer; transition: filter .15s; }
.anmark:hover, .anmark.is-lit { filter: brightness(.93); }
.anmark.is-lit { animation: anmark-pulse 1s ease; }
@keyframes anmark-pulse { 50% { box-shadow: inset 0 -2px 0 currentColor, 0 0 0 3px rgba(196,160,82,.35); } }
.anmark__n {
  display: inline-grid; place-items: center; min-width: 15px; height: 15px; padding: 0 2px;
  border-radius: 8px; margin-left: 1px; color: #fff; line-height: 1; vertical-align: super;
  font-family: var(--font-body); font-size: .6rem; font-weight: 700;
}

/* --- Selection hint bar --------------------------------------------------- */
.ann-hint {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 12px 0 0; padding: 9px 12px; background: var(--cream);
  border: 1px solid var(--gold-soft); border-radius: var(--r-sm);
  font-size: .84rem; color: var(--ink);
}
.ann-hint__q { font-family: var(--font-display); font-style: italic; color: var(--navy); }

/* --- Editor's margin (anchored-notes list) -------------------------------- */
.ann-margin { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.ann-margin__empty {
  margin-top: 14px; padding: 16px; border: 1px dashed var(--gold-soft);
  border-radius: var(--r-md); background: #fffaf0; color: var(--ink-soft);
  font-size: .85rem; line-height: 1.5;
}
.anote {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 12px 13px; cursor: pointer; transition: box-shadow .15s, border-color .15s;
}
.anote:hover { box-shadow: var(--shadow-sm); border-color: var(--gold-soft); }
.anote__top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.anote__n {
  width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
  flex-shrink: 0; color: #fff; font-size: .62rem; font-weight: 700;
}
.anote__cat { font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; }
.anote__x {
  margin-left: auto; color: var(--ink-soft); cursor: pointer; font-size: 1.05rem; line-height: 1;
  padding: 0 3px; background: none; border: none;
}
.anote__x:hover { color: var(--danger); }
.anote__quote {
  font-family: var(--font-display); font-size: .82rem; color: var(--ink-soft); font-style: italic;
  border-left: 2px solid var(--gold-soft); padding-left: 8px; margin-bottom: 6px; line-height: 1.4;
}
.anote__txt { font-size: .88rem; color: var(--ink); line-height: 1.45; }

/* --- Floating add-button (appears on selection) --------------------------- */
.wc-anno-add {
  position: fixed; z-index: 2000; transform: translate(-50%, -100%); display: none;
  padding: 7px 13px; border-radius: 9px; background: var(--navy); color: #fff;
  font-family: var(--font-body); font-size: .8rem; font-weight: 600; cursor: pointer;
  border: 1px solid var(--gold-soft); box-shadow: var(--shadow-md); white-space: nowrap;
}
.wc-anno-add span { color: var(--gold-soft); margin-right: 3px; }
.wc-anno-add::after {
  content: ""; position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%) rotate(45deg);
  width: 9px; height: 9px; background: var(--navy);
  border-right: 1px solid var(--gold-soft); border-bottom: 1px solid var(--gold-soft);
}

/* --- Category / comment picker -------------------------------------------- */
.wc-anno-picker {
  position: fixed; z-index: 2001; transform: translateX(-50%); width: 330px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.wc-anno-picker__h {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 14px; border-bottom: 1px solid var(--line);
}
.wc-anno-picker__t {
  font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 700;
}
.wc-anno-picker__x { background: none; border: none; cursor: pointer; color: var(--ink-soft); font-size: 1.15rem; line-height: 1; }
.wc-anno-cats { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 14px; }
.wc-anno-cat {
  font-size: .74rem; padding: 5px 10px; border-radius: 100px; cursor: pointer; color: var(--ink);
  background: var(--cream); border: 1px solid var(--line); transition: filter .15s;
}
.wc-anno-cat:hover { filter: brightness(.97); }
.wc-anno-items { max-height: 230px; overflow-y: auto; padding: 4px 8px 10px; }
.wc-anno-item {
  display: block; width: 100%; text-align: left; font-size: .82rem; color: var(--ink); line-height: 1.4;
  padding: 9px 11px; border-radius: var(--r-sm); background: none; border: 1px solid transparent; cursor: pointer;
}
.wc-anno-item:hover { background: var(--gold-soft); border-color: var(--gold); }
.wc-anno-empty { padding: 16px 12px; font-size: .82rem; color: var(--ink-soft); text-align: center; }
.wc-anno-custom { display: flex; gap: 6px; padding: 8px 12px 12px; border-top: 1px solid var(--line); }
.wc-anno-custom input {
  flex: 1; padding: 8px 10px; border-radius: var(--r-sm); border: 1px solid var(--line);
  font-family: var(--font-body); font-size: .82rem; color: var(--ink);
}
.wc-anno-custom button {
  padding: 8px 12px; border-radius: var(--r-sm); background: var(--gold); color: var(--navy);
  font-weight: 700; font-size: .8rem; border: none; cursor: pointer;
}

/* Thin gold scrollbar to match the house style */
.wc-anno-items::-webkit-scrollbar { width: 8px; }
.wc-anno-items::-webkit-scrollbar-thumb { background: linear-gradient(var(--gold), var(--gold-soft)); border-radius: 8px; }

/* Boot-screen emblem (platform logo on load) */
.wc-boot__emblem { display: block; margin: 0 auto 12px; }

/* Emblem placement — sidebar + landing */
.side__brand__t { line-height: 1.05; }
.side__brand .wc-emblem { flex-shrink: 0; }
.lp__emblemwrap { text-align: center; margin-bottom: 8px; }
.lp__emblemwrap .wc-emblem { filter: drop-shadow(0 6px 14px rgba(196,160,82,.28)); }

/* =============================================================================
   Cinematic landing (.cine)  —  dark atmosphere, staggered entrance, logo
   Own namespace so it never touches the shared .choice component.
   ========================================================================== */
.cine {
  position: relative; min-height: 100dvh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; overflow: hidden; padding: 40px 20px 64px;
  background:
    radial-gradient(1200px 640px at 78% -14%, #123253 0%, transparent 56%),
    radial-gradient(900px 520px at 8% 112%, #0d2a49 0%, transparent 52%),
    #08203a;
}
.cine__bg { position: absolute; inset: 0; pointer-events: none; }
.cine__bg::before {              /* faint mashrabiya lattice */
  content: ""; position: absolute; inset: 0; opacity: .05;
  background-image:
    repeating-linear-gradient(45deg, #cbb37a 0 1px, transparent 1px 24px),
    repeating-linear-gradient(-45deg, #cbb37a 0 1px, transparent 1px 24px);
}
.cine__bg::after {               /* slow drifting gold aura */
  content: ""; position: absolute; inset: -20%;
  background: radial-gradient(520px 520px at 50% 40%, rgba(196,160,82,.10), transparent 60%);
  animation: cine-drift 16s ease-in-out infinite;
}
.cine__spark {
  position: absolute; left: var(--x); top: var(--y); width: 3px; height: 3px; border-radius: 50%;
  background: #e6d6a6; box-shadow: 0 0 8px 2px rgba(230,214,166,.5); opacity: .0;
  animation: cine-float 7s ease-in-out infinite; animation-delay: var(--d);
}

.cine__stage { position: relative; text-align: center; max-width: 760px; width: 100%; }

.cine__emblem {
  display: inline-flex; margin-bottom: 14px;
  filter: drop-shadow(0 0 22px rgba(196,160,82,.45));
  animation: cine-emblem 1s cubic-bezier(.2,.7,.3,1) both, cine-hover 6s ease-in-out 1s infinite;
}
.cine__eyebrow {
  font-size: .74rem; font-weight: 700; letter-spacing: .32em; text-transform: uppercase;
  color: var(--gold); animation: cine-rise .7s ease .15s both;
}
.cine__title {
  font-family: var(--font-display); font-size: clamp(2.8rem, 8vw, 4.6rem); line-height: 1;
  color: #f4ecda; margin-top: 10px; font-weight: 600; animation: cine-rise .8s ease .28s both;
}
.cine__title b { color: var(--gold); font-weight: 600; }
.cine__rule {
  width: 190px; height: 2px; margin: 16px auto 0; border-radius: 2px; transform-origin: center;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  animation: cine-draw .7s ease .5s both;
}
.cine__tag {
  color: #aebfce; max-width: 48ch; margin: 16px auto 0; font-size: 1.04rem; line-height: 1.6;
  animation: cine-rise .8s ease .6s both;
}

.cine__portals {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 34px auto 0; max-width: 680px;
  animation: cine-rise .8s ease .75s both;
}
@media (max-width: 600px) { .cine__portals { grid-template-columns: 1fr; } }
.cine__portal {
  position: relative; overflow: hidden; text-align: left; cursor: pointer;
  background: rgba(255,255,255,.045); border: 1px solid rgba(198,168,110,.24);
  border-radius: 18px; padding: 24px; color: inherit;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease, background .22s ease;
}
.cine__portal::before {          /* gold sweep on hover */
  content: ""; position: absolute; top: 0; left: -70%; width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(230,214,166,.14), transparent);
  transition: left .55s ease;
}
.cine__portal:hover {
  transform: translateY(-5px); background: rgba(255,255,255,.07);
  border-color: rgba(198,168,110,.6); box-shadow: 0 24px 54px -20px rgba(0,0,0,.65);
}
.cine__portal:hover::before { left: 130%; }
.cine__ic {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; margin-bottom: 14px;
}
.cine__ic svg { width: 23px; height: 23px; }
.cine__ic--t { background: linear-gradient(160deg, var(--gold), #a9832f); color: #0a2540; }
.cine__ic--s { background: linear-gradient(160deg, #2a8f6f, var(--emerald)); color: #fff; }
.cine__portal h3 { font-family: var(--font-display); color: #f4ecda; font-size: 1.35rem; }
.cine__portal p { color: #9fb3c8; font-size: .9rem; line-height: 1.5; margin-top: 6px; }
.cine__go {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 16px;
  font-family: var(--font-body); font-size: .82rem; font-weight: 700; letter-spacing: .02em;
  color: var(--gold-soft); transition: gap .2s ease;
}
.cine__portal:hover .cine__go { gap: 10px; }

.cine__trust {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; margin: 26px auto 0;
  font-family: var(--font-body); font-size: .78rem; color: #8aa2bd; animation: cine-rise .8s ease .9s both;
}
.cine__trust span { display: inline-flex; align-items: center; gap: 6px; }
.cine__trust span:not(:first-child)::before { content: "·"; margin-right: 22px; color: #46617e; }
.cine__trust svg { width: 13px; height: 13px; color: var(--gold); }

.cine__credit {
  position: relative; margin-top: 40px; display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase;
  color: #7d94ac; animation: cine-rise 1s ease 1.05s both;
}
.cine__credit .wc-emblem { opacity: .8; }

@keyframes cine-rise   { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes cine-emblem { from { opacity: 0; transform: scale(.78) translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes cine-draw   { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }
@keyframes cine-hover  { 0%,100% { translate: 0 0; } 50% { translate: 0 -6px; } }
@keyframes cine-drift  { 0%,100% { transform: translate(-3%, 0) scale(1); } 50% { transform: translate(3%, 2%) scale(1.08); } }
@keyframes cine-float  { 0%,100% { opacity: 0; transform: translateY(0); } 50% { opacity: .8; transform: translateY(-18px); } }

@media (prefers-reduced-motion: reduce) {
  .cine__emblem, .cine__eyebrow, .cine__title, .cine__rule, .cine__tag,
  .cine__portals, .cine__trust, .cine__credit, .cine__bg::after, .cine__spark { animation: none; }
  .cine__rule { transform: none; } .cine__emblem { filter: drop-shadow(0 0 16px rgba(196,160,82,.4)); }
}
