/* ============ ReviseWise site layer — top menu, pages, accounts, classes, note components ============ */
:root { --mint: #dcf7ea; --mint-d: #14a06a; --yel: #fff3bf; --yel-d: #f2c200; --pink: #ffe3e6; --pink-d: #e5484d; --top: 72px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 200; }
.skip-link:focus { left: 8px; }
body.no-scroll { overflow: hidden; }
#app { min-height: 100vh; display: flex; flex-direction: column; }
.main { margin: 0 auto; width: 100%; max-width: 1240px; padding: 30px clamp(16px, 3.5vw, 40px) 70px; flex: 1; }
.ulink { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--o); font-weight: 700; }
.ulink:hover { color: var(--o); }
.muted b { color: var(--ink); }

/* ---------- top menu ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px); border-bottom: 2.5px solid var(--ink); transition: box-shadow .25s; }
.topbar.scrolled { box-shadow: 0 5px 0 rgba(31, 20, 16, .12); }
.topbar-in { max-width: 1240px; margin: 0 auto; height: var(--top); padding: 0 clamp(16px, 3.5vw, 40px); display: flex; align-items: center; gap: 14px; }
.topbar .brand { padding: 0; font-size: 24px; flex: none; }
.menu { display: flex; align-items: center; gap: 2px; margin-left: 10px; }
.menu-link { display: inline-flex; align-items: center; gap: 5px; padding: 9px 13px; border-radius: 99px; font-weight: 700; font-size: 15px; border: 2.5px solid transparent; transition: background .2s, transform .2s var(--ease), border-color .2s; white-space: nowrap; }
.menu-link:hover { background: var(--o-soft); transform: translateY(-2px); }
.menu-link.active { background: var(--o); color: #fff; border-color: var(--ink); box-shadow: var(--sh-sm); }
.menu-link .ico { transition: transform .25s var(--ease); }
.menu-drop:hover .menu-link .ico, .menu-drop.open .menu-link .ico { transform: rotate(180deg); }
.menu-link .count { background: var(--ink); color: #fff; font-size: 11.5px; min-width: 21px; height: 21px; display: grid; place-items: center; border-radius: 99px; padding: 0 6px; }
.menu-link.active .count { background: #fff; color: var(--ink); }
.menu-drop { position: relative; }
.mega { position: absolute; left: -120px; top: calc(100% + 10px); width: min(900px, 92vw); background: #fff; border: 2.5px solid var(--ink); border-radius: 24px; box-shadow: var(--sh-lg); padding: 18px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  opacity: 0; visibility: hidden; transform: translateY(10px) scale(.98); transform-origin: 20% 0; transition: opacity .2s, transform .25s var(--ease), visibility .2s; }
.mega::before { content: ''; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }
.menu-drop:hover .mega, .menu-drop:focus-within .mega, .menu-drop.open .mega { opacity: 1; visibility: visible; transform: none; }
.topbar.nav-lock .mega, .topbar.nav-lock .user-pop { opacity: 0 !important; visibility: hidden !important; }
.mega-col { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mega-head { display: flex; align-items: center; gap: 9px; font-family: var(--font-d); font-weight: 800; font-size: 18px; padding: 8px; border-radius: 12px; background: var(--c); color: var(--on); border: 2.5px solid var(--ink); margin-bottom: 6px; transition: transform .2s var(--ease); }
.mega-head:hover { transform: rotate(-1.5deg) scale(1.02); }
.mega-ico { width: 30px; height: 30px; border-radius: 9px; background: #fff; color: var(--ink); display: grid; place-items: center; border: 2px solid var(--ink); flex: none; }
.mega-col > a:not(.mega-head) { display: flex; gap: 8px; font-size: 13.5px; font-weight: 500; padding: 6px 8px; border-radius: 9px; line-height: 1.3; transition: background .15s, transform .2s var(--ease); }
.mega-col > a:not(.mega-head):hover { background: var(--o-soft); transform: translateX(3px); }
.mega-col i { font-style: normal; font-family: var(--font-d); font-weight: 800; color: var(--o); min-width: 14px; }
.mega-col .mega-all { font-weight: 700 !important; color: var(--o-deep); align-items: center; margin-top: auto; }

.top-search { margin-left: auto; position: relative; display: flex; align-items: center; gap: 8px; background: var(--cream); border: 2.5px solid var(--ink); border-radius: 99px; padding: 0 12px; height: 44px; width: min(280px, 26vw); transition: box-shadow .2s, transform .2s var(--ease), background .2s, width .3s var(--ease); }
.top-search:focus-within { background: #fff; box-shadow: var(--sh-sm); transform: translate(-1px, -1px); width: min(340px, 30vw); }
.top-search > .ico { color: var(--o); }
.top-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 15px; height: 100%; }
.top-search input::-webkit-search-cancel-button { display: none; }
kbd { font: 700 12px var(--font-b); border: 2px solid var(--ink); border-radius: 7px; padding: 1px 7px; background: #fff; }
.top-search:focus-within kbd { display: none; }
.search-pop { position: absolute; right: 0; top: calc(100% + 10px); width: min(420px, 92vw); background: #fff; border: 2.5px solid var(--ink); border-radius: 20px; box-shadow: var(--sh-lg); padding: 8px; animation: popIn .25s var(--ease) both; transform-origin: 80% 0; }
.sp-row { display: flex; gap: 11px; align-items: center; padding: 9px 10px; border-radius: 13px; transition: background .15s, transform .2s var(--ease); }
.sp-row:hover, .sp-row:focus-visible { background: var(--o-soft); transform: translateX(3px); }
.sp-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--c); color: var(--on); display: grid; place-items: center; border: 2px solid var(--ink); flex: none; }
.sp-row b { display: block; font-size: 15px; line-height: 1.2; }
.sp-row small { color: var(--muted); font-size: 12.5px; }
.sp-all { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 11px 12px; margin-top: 4px; border-top: 2px solid var(--line); font-weight: 700; font-size: 14px; color: var(--o-deep); }
.sp-none { padding: 16px; font-size: 14.5px; color: var(--muted); } .sp-none a { color: var(--o-deep); font-weight: 700; }

.top-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.avatar-btn { display: flex; align-items: center; gap: 4px; padding: 3px 8px 3px 3px; border-radius: 99px; border: 2.5px solid var(--ink); background: #fff; transition: transform .2s var(--ease), box-shadow .2s; }
.avatar-btn:hover { transform: translate(-1px, -1px); box-shadow: var(--sh-sm); }
.avatar-btn .avatar { width: 34px; height: 34px; font-size: 16px; border-width: 2px; }
.user-pop { position: absolute; right: 0; top: calc(100% + 10px); width: 250px; background: #fff; border: 2.5px solid var(--ink); border-radius: 20px; box-shadow: var(--sh-lg); padding: 8px; opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .2s, transform .25s var(--ease), visibility .2s; }
.user-pop::before { content: ''; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }
.menu-drop.user:hover .user-pop, .menu-drop.user:focus-within .user-pop, .menu-drop.user.open .user-pop { opacity: 1; visibility: visible; transform: none; }
.user-pop-head { padding: 10px 12px 12px; border-bottom: 2px solid var(--line); margin-bottom: 6px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.user-pop-head b { font-family: var(--font-d); font-size: 18px; overflow-wrap: anywhere; }
.user-pop a, .user-pop > button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 12px; font-weight: 700; font-size: 15px; text-align: left; transition: background .15s, transform .2s var(--ease); }
.user-pop a:hover, .user-pop > button:hover { background: var(--o-soft); transform: translateX(3px); }
.burger { display: none; }

.drawer { position: fixed; inset: 0; z-index: 70; background: rgba(31, 20, 16, .5); opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
.drawer.open { opacity: 1; visibility: visible; }
.drawer-in { position: absolute; right: 0; top: 0; bottom: 0; width: min(340px, 88vw); background: #fff; border-left: 2.5px solid var(--ink); padding: 18px; overflow: auto; transform: translateX(100%); transition: transform .35s var(--ease); display: flex; flex-direction: column; gap: 14px; }
.drawer.open .drawer-in { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; } .drawer-head .brand { padding: 0; font-size: 22px; }
.drawer nav { display: flex; flex-direction: column; gap: 4px; }
.drawer nav > a:not(.btn), .drawer nav > button { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; font-weight: 700; text-align: left; border: 2.5px solid transparent; }
.drawer nav > a.active { background: var(--o); color: #fff; border-color: var(--ink); }
.drawer nav > a.sub { padding-left: 30px; font-weight: 500; }
.drawer .searchbar { box-shadow: var(--sh-sm); padding: 2px 8px 2px 14px; }
.drawer .searchbar input { font-size: 16px; padding: 8px 0; }

/* ---------- footer ---------- */
.footer { background: var(--ink); color: #fff; margin-top: 40px; }
.foot-in { max-width: 1240px; margin: 0 auto; padding: 44px clamp(16px, 3.5vw, 40px) 28px; display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 30px; }
.foot-in .brand { padding: 0; color: #fff; } .foot-in .brand b { color: var(--o-mid); }
.foot-brand p { opacity: .75; max-width: 24em; margin-top: 10px; }
.foot-in > div:not(.foot-brand) { display: flex; flex-direction: column; gap: 8px; }
.foot-in > div > b { font-family: var(--font-d); font-size: 16px; color: var(--o-mid); margin-bottom: 4px; }
.foot-in > div > a:not(.brand) { opacity: .85; width: fit-content; transition: transform .2s var(--ease), opacity .2s; }
.foot-in > div > a:not(.brand):hover { opacity: 1; transform: translateX(4px); color: var(--o-mid); }
.foot-note { grid-column: 1 / -1; border-top: 2px solid rgba(255, 255, 255, .16); padding-top: 18px; margin: 0; font-size: 13px; opacity: .65; }

/* ---------- landing + shared page bits ---------- */
.hero-title { font-size: clamp(40px, 5.6vw, 74px) !important; }
.stats.four { grid-template-columns: repeat(4, 1fr); }
.steps3 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.step { padding: 22px; position: relative; text-align: left; display: flex; flex-direction: column; gap: 8px; width: 100%; }
.step > .ico { color: var(--o); }
.step h3 { font-size: 21px; font-weight: 800; }
.step p { margin: 0; color: var(--muted); font-size: 14.5px; }
.step:hover { transform: translate(-3px, -3px) rotate(-.6deg); box-shadow: var(--sh-lg); }
.step:hover > .ico { animation: wiggle .5s var(--ease); }
.step-n { position: absolute; right: 16px; top: 12px; font-family: var(--font-d); font-weight: 800; font-size: 46px; line-height: 1; color: var(--o-soft); -webkit-text-stroke: 2px var(--ink); }
.tool:hover { background: var(--o-soft); }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.who { padding: clamp(22px, 3vw, 34px); display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.who h3 { font-size: 30px; font-weight: 800; }
.who.dark { background: var(--ink); color: #fff; box-shadow: 4px 4px 0 var(--o); }
.who-ico { width: 58px; height: 58px; border-radius: 18px; background: var(--o); color: #fff; display: grid; place-items: center; border: 2.5px solid var(--ink); transform: rotate(-6deg); }
.who.dark .who-ico { border-color: #fff; }
.who .ticks { flex: 1; }
.loading { display: grid; place-items: center; text-align: center; padding: 80px 20px; color: var(--muted); font-weight: 700; }
.loading .owl { width: 110px; animation: floaty 1.6s ease-in-out infinite; } .loading.small { padding: 30px; } .loading.small .owl { width: 70px; }
.prose { max-width: 820px; }
.result-count { margin: 0 0 14px; font-weight: 700; }

/* category tiles */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.cat { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
a.cat:hover { transform: translate(-3px, -3px); box-shadow: var(--sh-lg); background: var(--o-soft); }
a.cat > .ico:last-child { margin-left: auto; transition: transform .25s var(--ease); } a.cat:hover > .ico:last-child { transform: translateX(4px); }
.cat-n { width: 42px; height: 42px; border-radius: 13px; background: var(--c, var(--o)); color: var(--on, #fff); border: 2.5px solid var(--ink); display: grid; place-items: center; font-family: var(--font-d); font-weight: 800; font-size: 18px; flex: none; transform: rotate(-5deg); }
.cat b { display: block; line-height: 1.2; font-family: var(--font-d); font-size: 16.5px; } .cat small { color: var(--muted); font-size: 13px; }
.cat.soon, .unit.soon { box-shadow: none; border-style: dashed; background: rgba(255, 255, 255, .55); }
.cat.soon .cat-n, .unit.soon .unit-n { background: #fff; color: var(--muted); transform: none; }
.cat.soon b, .unit.soon h3 { color: var(--muted); }

/* subject + topic pages */
.hero-ring { display: flex; align-items: center; gap: 14px; margin-top: 20px; font-size: 16px; }
.hero-ring .ring { background: #fff; color: var(--o); border-radius: 50%; border: 2.5px solid var(--ink); box-shadow: var(--sh-sm); }
.ring text { font-family: var(--font-d); font-weight: 800; font-size: 15px; fill: var(--ink); }
.ring-val { stroke-dashoffset: var(--off); animation: ringIn 1.2s var(--ease) both; }
@keyframes ringIn { from { stroke-dashoffset: 164; } }
.unit-list, .row-list { display: grid; gap: 14px; }
.unit { display: flex; gap: 16px; padding: 18px; align-items: flex-start; }
.unit:not(.soon):hover { transform: translate(-2px, -2px); box-shadow: var(--sh-lg); }
.unit-n { width: 50px; height: 50px; border-radius: 15px; background: var(--c); color: var(--on); border: 2.5px solid var(--ink); display: grid; place-items: center; font-family: var(--font-d); font-weight: 800; font-size: 22px; flex: none; transform: rotate(-5deg); }
.unit-main { flex: 1; min-width: 0; } .unit-main h3 { font-size: 22px; font-weight: 800; } .unit-main h3 a:hover { color: var(--o); }
.unit-main small { color: var(--muted); font-weight: 500; }
.unit-notes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.unit-notes .chip { font-size: 13px; padding: 5px 12px; border-width: 2px; }
.chip.done { background: var(--mint); } .chip.done .ico { color: var(--mint-d); }
.iconbtn.go { background: var(--ink); color: #fff; } .iconbtn.go:hover { background: var(--o); }

.note-row, .result, .todo, .res { display: flex; align-items: center; gap: 14px; padding: 14px 16px; position: relative; }
.note-row:hover, a.result:hover, a.todo:hover { transform: translate(-2px, -2px); box-shadow: var(--sh-lg); }
.note-row .idx, .result .idx, .todo .idx, .res .idx { width: 44px; height: 44px; border-radius: 13px; background: var(--c, var(--o)); color: var(--on, #fff); border: 2.5px solid var(--ink); display: grid; place-items: center; font-family: var(--font-d); font-weight: 800; font-size: 18px; flex: none; }
.note-row .idx.done { background: var(--mint); color: var(--mint-d); }
.note-row .info, .result .info, .todo .info, .res .info { flex: 1; min-width: 0; }
.note-row .info a { font-family: var(--font-d); font-weight: 700; font-size: 19px; }
.note-row .info a::after { content: ''; position: absolute; inset: 0; }
.note-row .info small, .result .info small, .todo .info small, .res .info small { display: block; color: var(--muted); font-size: 14px; }
.note-row .meta, .work .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-top: 6px; }
.note-row .meta span, .work .meta span { display: inline-flex; align-items: center; gap: 4px; }
.note-row .save { position: relative; z-index: 2; }
.result .info b, .todo .info b, .res .info b { font-family: var(--font-d); font-size: 19px; display: block; line-height: 1.2; }
.result .info p { margin: 6px 0 0; font-size: 14.5px; color: var(--muted); }
mark { background: var(--yel); color: var(--ink); border-radius: 4px; padding: 0 2px; font-weight: 700; }
.unit-line { font-size: 12px; font-weight: 700; color: var(--o-deep); text-transform: uppercase; letter-spacing: .04em; line-height: 1.3; }
.ht-tag, .sep-tag { display: inline-flex; align-items: center; font: 700 11.5px var(--font-b); padding: 3px 9px; border-radius: 99px; border: 2px solid var(--ink); background: #ffd8a8; color: #5a2d00; white-space: nowrap; letter-spacing: 0; }
.sep-tag { background: #fff; color: var(--ink); }
.note-hero .ht-tag, .note-hero .sep-tag { font-size: 12.5px; padding: 4px 10px; }
.note-actions { top: calc(var(--top) + 12px); } .toc { top: calc(var(--top) + 86px); }
.note-sec { scroll-margin-top: calc(var(--top) + 86px); }
.note-sec > h2 { flex-wrap: wrap; }

/* ---------- note components (house style) ---------- */
.spec-box { background: var(--ink); color: #fff; border-radius: var(--r); padding: clamp(18px, 3vw, 26px); margin-bottom: 22px; box-shadow: 4px 4px 0 var(--o); }
.spec-box h2 { font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 10px; margin-bottom: 14px; } .spec-box h2 .ico { color: var(--o-mid); }
.spec-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.spec-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 15.5px; }
.spec-list .tick { width: 20px; height: 20px; border: 2px solid var(--o-mid); border-radius: 6px; flex: none; margin-top: 3px; }
.callout { border: 2px solid var(--ink); border-radius: 16px; padding: 14px 16px 14px 24px; margin: 0 0 1em; position: relative; overflow: hidden; }
.callout::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 9px; }
.callout p { margin: 0; } .c-title { display: block; font-family: var(--font-d); font-weight: 800; font-size: 15px; margin-bottom: 3px; }
.c-def { background: var(--mint); } .c-def::before { background: var(--mint-d); }
.c-tip { background: var(--yel); } .c-tip::before { background: var(--yel-d); }
.c-trap { background: var(--pink); } .c-trap::before { background: var(--pink-d); }
.bigidea { background: var(--ink); color: #fff; border-radius: 16px; padding: 16px 18px; margin: 0 0 1em; display: flex; flex-direction: column; gap: 4px; }
.bigidea b { font-family: var(--font-d); font-size: 18px; color: var(--o-mid); background: none !important; } .bigidea span b { color: #fff; background: none !important; font-size: inherit; font-family: inherit; }
.mnemonics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0 0 1em; }
.mn { background: var(--ink); color: #fff; border-radius: 14px; padding: 12px 14px; transition: transform .25s var(--ease); } .mn:hover { transform: rotate(-2deg) scale(1.03); }
.mn b { display: block; font-family: var(--font-d); font-weight: 800; font-size: 26px; color: var(--o-mid); line-height: 1.1; background: none !important; } .mn span { font-size: 13.5px; }
.worked.method { border-style: solid; background: var(--cream); } .method .worked-title { background: var(--o); }
.tipbox { background: var(--yel); color: var(--ink); } .tipbox .tip-ico { background: #fff; color: #b88a00; }
.tipbox.trap { background: var(--pink); } .tipbox.trap .tip-ico { color: var(--pink-d); animation: none; }
details.skip > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; font-weight: 700; padding: 12px 14px; background: #ffd8a8; color: #5a2d00; border: 2px dashed var(--ink); border-radius: 14px; }
details.skip > summary::-webkit-details-marker { display: none; } details.skip[open] > summary { margin-bottom: 16px; }
.examqs { display: grid; gap: 14px; }
.examq { border: 2.5px solid var(--ink); border-radius: 16px; padding: 16px; background: #fff; }
.examq-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.examq-head .qn { background: var(--ink); color: #fff; font-family: var(--font-d); font-weight: 800; font-size: 14px; padding: 3px 10px; border-radius: 9px; flex: none; }
.examq-head p { margin: 0; flex: 1; font-weight: 500; }
.marks { flex: none; font-weight: 700; font-size: 12.5px; border: 2px solid var(--ink); border-radius: 99px; padding: 2px 10px; background: var(--o-soft); white-space: nowrap; }
.ms { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s ease; } .ms > div { overflow: hidden; }
.examq.open .ms { grid-template-rows: 1fr; margin-top: 12px; }
.ms ul, .ms-print ul { margin: 0; padding: 12px 14px 12px 32px; background: var(--mint); border: 2px solid var(--ink); border-radius: 13px; display: grid; gap: 5px; font-size: 15px; }
.conf { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; } .conf .chip { font-size: 13.5px; padding: 6px 12px; }
.print-foot { display: none; }

/* ---------- forms + accounts ---------- */
.field input:not([type=radio]):not([type=checkbox]):not([type=file]), .field textarea { width: 100%; padding: 13px 15px; border: 2.5px solid var(--ink); border-radius: 15px; font: 500 17px var(--font-b); color: var(--ink); outline: 0; background: var(--cream); transition: box-shadow .2s, transform .2s var(--ease), background .2s; }
.field input:not([type=radio]):not([type=checkbox]):not([type=file]):focus, .field textarea:focus { box-shadow: var(--sh); transform: translate(-2px, -2px); background: #fff; }
.field textarea { resize: vertical; min-height: 70px; }
.field > span i, .field span > i { font-style: normal; color: var(--muted); font-weight: 500; }
.field small { display: block; color: var(--muted); font-size: 13px; margin-top: 7px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-in { cursor: pointer; } .chip-in input { position: absolute; opacity: 0; pointer-events: none; }
.chip-in span { display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px; border-radius: 99px; border: 2.5px solid var(--ink); background: #fff; font-weight: 700; font-size: 14.5px; transition: transform .15s var(--ease), background .2s, color .2s, box-shadow .2s; }
.chip-in:hover span { transform: translateY(-2px) rotate(-1.5deg); background: var(--o-soft); }
.chip-in input:checked + span { background: var(--o); color: #fff; box-shadow: var(--sh-sm); }
.chip-in input:focus-visible + span { outline: 3px solid var(--o); outline-offset: 3px; }
.btn-block { width: 100%; padding: 15px; font-size: 17px; }
.btn.is-busy { pointer-events: none; opacity: .75; } .btn.is-busy .ico { animation: spin 1s linear infinite; }
.btn:disabled, .iconbtn.is-busy { opacity: .6; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.form-error { background: var(--pink); border: 2px solid var(--ink); border-radius: 13px; padding: 10px 14px; font-weight: 700; font-size: 14.5px; margin: 0 0 14px; }
.fine { display: block; margin-top: 14px; font-size: 13.5px; text-align: center; }

.auth { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); border: 2.5px solid var(--ink); border-radius: 34px; overflow: hidden; box-shadow: var(--sh-lg); background: #fff; max-width: 1040px; margin: 10px auto 0; }
.auth-side { background: var(--o); color: #fff; padding: clamp(24px, 4vw, 44px); position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; gap: 14px; }
.auth-side::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(rgba(255, 255, 255, .17) 2px, transparent 2px) 0 0 / 22px 22px; animation: drift 30s linear infinite; }
.auth-side .blob { position: absolute; z-index: -1; width: 340px; height: 340px; right: -140px; bottom: -120px; background: var(--o-deep); border-radius: 42% 58% 63% 37% / 45% 40% 60% 55%; animation: morph 12s ease-in-out infinite; opacity: .75; }
.auth-side .owl { width: 150px; }
.auth-side h2 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 800; }
.auth-side .ticks li::before { background-color: var(--ink); }
.auth-main { padding: clamp(22px, 4vw, 44px); min-width: 0; }
.auth-main h1 { font-size: clamp(32px, 4.4vw, 48px); font-weight: 800; letter-spacing: -.035em; margin-bottom: 8px; } .auth-main h1 em { font-style: normal; color: var(--o); }
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.role-card { cursor: pointer; } .role-card input { position: absolute; opacity: 0; }
.role-card > div { height: 100%; border: 2.5px solid var(--ink); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 4px; background: #fff; transition: transform .2s var(--ease), box-shadow .2s, background .2s, color .2s; }
.role-card > div .ico { color: var(--o); margin-bottom: 4px; transition: transform .3s var(--ease); }
.role-card b { font-family: var(--font-d); font-size: 19px; } .role-card span { font-size: 13.5px; color: var(--muted); }
.role-card:hover > div { transform: translate(-2px, -2px) rotate(-.6deg); box-shadow: var(--sh); }
.role-card input:checked + div { background: var(--o); color: #fff; box-shadow: var(--sh); transform: translate(-2px, -2px); }
.role-card input:checked + div .ico { color: #fff; transform: rotate(-10deg) scale(1.15); } .role-card input:checked + div span { color: #fff; opacity: .92; }
.role-card input:focus-visible + div { outline: 3px solid var(--o); outline-offset: 3px; }
form[data-role=""] .role-reveal { display: none; }
form[data-role] .role-reveal { animation: rise .5s var(--ease) both; }
form[data-role="student"] .only-teacher, form[data-role="teacher"] .only-student, form[data-role=""] .only-teacher { display: none; }
.inbox { text-align: center; padding: 30px 0; display: grid; gap: 12px; justify-items: center; } .inbox > .ico { color: var(--o); animation: floaty 3s ease-in-out infinite; } .inbox p { max-width: 30em; margin: 0; }
.settings { display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; align-items: start; } .settings-side { display: grid; gap: 22px; }
.panel { padding: clamp(18px, 3vw, 28px); } .panel h2 { font-size: 24px; font-weight: 800; display: flex; align-items: center; gap: 10px; margin-bottom: 6px; } .panel h2 .ico { color: var(--o); }

/* ---------- dashboards ---------- */
.prog { display: flex; align-items: center; gap: 16px; padding: 18px; } .prog:hover { transform: translate(-3px, -3px) rotate(-.5deg); box-shadow: var(--sh-lg); }
.prog-ring { color: var(--c); flex: none; } .prog h3 { font-size: 22px; font-weight: 800; } .prog span { font-size: 13.5px; color: var(--muted); } .prog > div { flex: 1; min-width: 0; }
.meter { height: 10px; background: #fff; border: 2px solid var(--ink); border-radius: 99px; margin-top: 8px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--o); border-radius: 99px; transition: width .8s var(--ease); min-width: 0; }
.joinbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 20px; }
.joinbar > div:first-child { display: flex; align-items: center; gap: 14px; } .joinbar > div:first-child > .ico { color: var(--o); flex: none; } .joinbar b { display: block; font-family: var(--font-d); font-size: 19px; }
.join-in { display: flex; gap: 10px; align-items: center; }
.join-in input { width: 150px; padding: 11px 14px; border: 2.5px solid var(--ink); border-radius: 14px; font: 800 20px var(--font-d); letter-spacing: .18em; text-transform: uppercase; text-align: center; background: var(--cream); outline: 0; }
.join-in input:focus { background: #fff; box-shadow: var(--sh-sm); }
.due { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 99px; border: 2px solid var(--ink); background: #fff; white-space: nowrap; color: var(--ink); }
.due.soon { background: var(--yel); } .due.late { background: var(--pink); }

/* ---------- classes ---------- */
.class-card { overflow: hidden; display: flex; flex-direction: column; position: relative; } .class-card:hover { transform: translate(-4px, -4px) rotate(-.5deg); box-shadow: var(--sh-lg); }
.class-top { background: var(--c); color: var(--on); padding: 16px 18px 18px; position: relative; border-bottom: 2.5px solid var(--ink); flex: 1; } .class-top > * { position: relative; }
.class-top .tag { background: #fff; color: var(--ink); } .class-top h3 { font-size: 25px; font-weight: 800; margin-top: 12px; overflow-wrap: anywhere; } .class-top h3 a::after { content: ''; position: absolute; inset: -200px; }
.class-bot { display: flex; align-items: center; gap: 14px; padding: 12px 16px; font-weight: 700; font-size: 14px; } .class-bot span { display: inline-flex; gap: 5px; align-items: center; }
.code { position: relative; z-index: 2; font: 800 15px var(--font-d); letter-spacing: .12em; padding: 4px 11px; border: 2px solid var(--ink); border-radius: 9px; background: var(--o-soft); display: inline-flex; gap: 7px; align-items: center; margin-right: auto; transition: transform .2s var(--ease); } .code:hover { transform: scale(1.06) rotate(-2deg); }
.codebox { background: #fff; color: var(--ink); border: 2.5px solid var(--ink); border-radius: 20px; padding: 14px 20px; text-align: center; box-shadow: var(--sh); transform: rotate(2deg); display: grid; gap: 4px; justify-items: center; }
.codebox small { font-weight: 700; color: var(--muted); } .codebox b { font: 800 34px var(--font-d); letter-spacing: .14em; }
.work { padding: 18px 20px; } .work-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; } .work h3 { font-size: 21px; font-weight: 800; }
.work-msg { background: var(--cream); border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 12px 0 0; font-size: 14.5px; }
.work-prog { display: flex; align-items: center; gap: 12px; margin-top: 12px; } .work-prog .meter { flex: 1; margin: 0; } .work-prog b { font-size: 13.5px; white-space: nowrap; }
.who-done { margin-top: 12px; } .who-done summary { cursor: pointer; font-weight: 700; font-size: 14px; display: inline-flex; gap: 6px; align-items: center; list-style: none; } .who-done summary::-webkit-details-marker { display: none; }
.who-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; } .who-grid span { display: inline-flex; gap: 5px; align-items: center; font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 99px; border: 2px solid var(--ink); background: #fff; } .who-grid .yes { background: var(--mint); } .who-grid .part { background: var(--yel); }
.work-notes { display: grid; gap: 8px; margin-top: 14px; }
.work-note { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 2px solid var(--ink); border-radius: 13px; font-weight: 700; background: #fff; transition: transform .2s var(--ease), background .2s; } .work-note:hover { transform: translateX(4px); background: var(--o-soft); }
.work-note small { margin-left: auto; color: var(--muted); font-weight: 500; } .work-note.done { background: var(--mint); }
.tickbox { width: 24px; height: 24px; border: 2px solid var(--ink); border-radius: 8px; display: grid; place-items: center; background: #fff; flex: none; } .work-note.done .tickbox { background: var(--mint-d); color: #fff; }
.done-tag { background: var(--mint); }
.upload { padding: 18px 20px; display: grid; gap: 14px; border-style: dashed; } .drop { display: flex; gap: 14px; align-items: center; } .drop > .ico { color: var(--o); flex: none; } .drop b { display: block; font-family: var(--font-d); font-size: 18px; }
.upload-in { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.upload-in input[type=text] { flex: 1; min-width: 200px; padding: 11px 14px; border: 2.5px solid var(--ink); border-radius: 14px; font: 500 16px var(--font-b); background: var(--cream); outline: 0; } .upload-in input[type=text]:focus { background: #fff; box-shadow: var(--sh-sm); }
.upload-in input[type=file] { font: 500 14px var(--font-b); max-width: 260px; } .upload-in input[type=file]::file-selector-button { font: 700 14px var(--font-b); border: 2.5px solid var(--ink); background: #fff; border-radius: 99px; padding: 8px 14px; margin-right: 10px; cursor: pointer; }
td .iconbtn { width: 32px; height: 32px; }

/* ---------- modals, toasts ---------- */
.modal.wide { width: min(680px, 100%); }
.gate { text-align: center; } .gate .owl { width: 120px; } .gate h2 { padding: 0; } .modal-foot.center { justify-content: center; }
.pick.scroll { max-height: 300px; overflow: auto; padding: 4px 6px 4px 2px; margin-top: 10px; }
.pick-group { display: grid; gap: 8px; margin-bottom: 12px; } .pick-group > b { font-family: var(--font-d); font-size: 15px; display: flex; gap: 7px; align-items: center; color: var(--o-deep); position: sticky; top: -4px; background: #fff; padding: 4px 0; z-index: 1; }
.pick-row[hidden], .pick-group[hidden] { display: none; }
.searchbar.mini { box-shadow: none; padding: 0 12px; } .searchbar.mini input { font-size: 15px; padding: 8px 0; }
.toast.bad { background: var(--pink-d); box-shadow: 4px 4px 0 var(--ink); } .toast.bad i { background: #fff; color: var(--pink-d); }

/* ---------- responsive ---------- */
@media (max-width: 1120px) { .menu-link { padding: 8px 9px; font-size: 14px; } .top-search { width: 190px; } .top-search kbd { display: none; } .steps3 { grid-template-columns: 1fr 1fr; } .stats.four { grid-template-columns: 1fr 1fr; } }
@media (max-width: 940px) {
  .menu, .top-search, .hide-sm { display: none; } .burger { display: grid; } .top-actions { margin-left: auto; }
  .auth { grid-template-columns: 1fr; } .auth-side { padding: 22px; } .auth-side .owl { width: 90px; } .auth-side .ticks { display: none; }
  .settings, .duo { grid-template-columns: 1fr; } .foot-in { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) { .main { padding: 20px 16px 60px; } .note-actions { top: calc(var(--top) + 8px); } }
@media (max-width: 600px) {
  :root { --top: 62px; } .steps3, .stats.four, .role-pick, .field-row { grid-template-columns: 1fr; } .foot-in { grid-template-columns: 1fr; }
  .unit { flex-wrap: wrap; } .unit .go { display: none; } .note-row .save { display: none; } .codebox { transform: none; width: 100%; }
  .note-actions .btn { padding: 9px 13px; font-size: 14px; } .examq-head { flex-wrap: wrap; } .join-in { width: 100%; } .join-in input { flex: 1; }
}

/* ---------- print + PDF ---------- */
@media print {
  .print-page #print-root { max-width: none; padding: 0; }
  .spec-box { box-shadow: none; break-inside: avoid; } .callout, .bigidea, .mn, .examq, .ms-print { break-inside: avoid; }
  .tipbox { background: var(--yel) !important; } .tipbox.trap { background: var(--pink) !important; }
  .lines { display: grid; gap: 7mm; margin: 4mm 0 2mm; } .lines i { display: block; border-bottom: 1.5px solid #b9aaa0; }
  .ms-print { margin-bottom: 10px; } .ms-print > b { font-family: var(--font-d); display: block; margin-bottom: 4px; }
  .print-foot { display: block; font-size: 8.5pt; color: var(--muted); margin-top: 8mm; text-align: center; }
  .fig .dg { padding: 8px; max-height: 95mm; } .ring-val { animation: none; }
}

/* note toolbar scrolls with the page; quick actions live in the sticky contents card instead */
.note-actions { position: static; }
.toc { top: calc(var(--top) + 18px); }
.toc-acts { display: flex; gap: 8px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 2px solid var(--line); }
.toc-acts .save { position: static; }
.note-sec { scroll-margin-top: calc(var(--top) + 18px); }
/* on phones, let wide tables scroll sideways instead of crushing their columns */
@media (max-width: 600px) { .table-wrap table { min-width: 520px; } }
