/* ===== Student materials (mobile first) ===== */
.mt-band { background: radial-gradient(600px 260px at 85% -40px, rgba(216,195,156,.22), transparent 70%), linear-gradient(160deg, #1E3A32, #16302A); color: #fff; padding: 26px 0 34px; position: relative; overflow: hidden; }
.mt-band::after { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; border: 1px solid rgba(216,195,156,.18); inset-inline-end: -90px; top: -110px; }
.mt-kick { margin: 0; color: #D8C39C; font-weight: 700; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; }
.mt-band h1 { margin: 4px 0 16px; font-family: var(--f-ar-display, 'Amiri', serif); font-size: clamp(1.75rem, 5.5vw, 2.6rem); line-height: 1.25; color: #fff; }
html[lang="en"] .mt-band h1 { font-family: var(--f-en-display, serif); }
.mt-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-width: 640px; }
.mt-steps li { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 10px 11px; border-radius: 14px; background: rgba(255,255,255,.07); border: 1px solid rgba(216,195,156,.18); font-size: .8rem; line-height: 1.45; color: rgba(255,255,255,.88); }
.mt-steps b { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #D8C39C; color: #1E3A32; font-size: .78rem; }

.mt-sec { padding: 18px 0 60px; background: var(--paper, #F6F5F2); }
.mt-wrap { max-width: 860px; }
.mt-list { display: grid; gap: 12px; margin-top: -30px; position: relative; z-index: 2; }
.mt { position: relative; background: #fff; border-radius: 20px; border: 1px solid #E6E1D6; box-shadow: 0 14px 34px -28px rgba(20,40,34,.55); overflow: hidden; animation: mtIn .6s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 60ms); }
@keyframes mtIn { from { opacity: 0; transform: translateY(14px); } }
.mt.is-focus { border-color: #D8C39C; box-shadow: 0 0 0 3px rgba(216,195,156,.35), 0 20px 40px -28px rgba(20,40,34,.6); }
.mt-flag { margin: 0; padding: 7px 16px; background: linear-gradient(90deg, #A8844C, #C9A86A); color: #fff; font-size: .78rem; font-weight: 700; }
.mt-head { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 14px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mt-head:focus-visible { outline: 2px solid #A8844C; outline-offset: -4px; border-radius: 18px; }
.mt-date { flex: none; width: 58px; height: 64px; border-radius: 14px; background: #1E3A32; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.mt-date b { font-size: 1.45rem; font-family: var(--f-en-display, Georgia, serif); }
.mt-date span { font-size: .72rem; margin-top: 4px; color: #E9D3A8; font-weight: 700; }
.mt-date small { font-size: .62rem; margin-top: 3px; opacity: .7; letter-spacing: .05em; }
.mt-hd { flex: 1; min-width: 0; display: grid; gap: 3px; text-align: start; }
.mt-kind { font-size: .72rem; font-weight: 700; color: #A8844C; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-title { font-weight: 700; color: #1E3A32; font-size: 1rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mt-sub { font-size: .76rem; color: #7A817D; }
.mt-chev { flex: none; width: 32px; height: 32px; border-radius: 50%; background: #F2EEE5; position: relative; transition: transform .45s cubic-bezier(.2,.8,.2,1), background .3s; }
.mt-chev::before { content: ""; position: absolute; inset: 0; margin: auto; width: 8px; height: 8px; border-right: 2px solid #1E3A32; border-bottom: 2px solid #1E3A32; transform: translateY(-2px) rotate(45deg); }
.mt.is-open .mt-chev { transform: rotate(180deg); background: #1E3A32; } .mt.is-open .mt-chev::before { border-color: #fff; }

.mt-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .55s cubic-bezier(.2,.8,.2,1); }
.mt.is-open .mt-panel { grid-template-rows: 1fr; }
.mt-clip { overflow: hidden; min-height: 0; }
.mt-in { padding: 4px 14px 18px; display: grid; gap: 14px; opacity: 0; transform: translateY(-8px); transition: opacity .35s ease, transform .5s cubic-bezier(.2,.8,.2,1); }
.mt.is-open .mt-in { opacity: 1; transform: none; transition-delay: .12s; }

/* a little stack of slides */
.mt-cover { position: relative; margin: 6px 10px 10px; aspect-ratio: 16 / 9; }
.mt-cover > span { position: absolute; inset: 0; border-radius: 12px; }
.mt-sheet1 { background: #E9E3D6; transform: translate(10px, 10px) rotate(2.2deg); }
.mt-sheet2 { background: #F3EFE6; transform: translate(5px, 5px) rotate(1deg); box-shadow: 0 2px 6px rgba(0,0,0,.06); }
html[dir="rtl"] .mt-sheet1 { transform: translate(-10px, 10px) rotate(-2.2deg); } html[dir="rtl"] .mt-sheet2 { transform: translate(-5px, 5px) rotate(-1deg); }
.mt-front { overflow: hidden; background: #fff; box-shadow: 0 16px 30px -18px rgba(20,40,34,.6); transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.mt.is-open .mt-front { animation: mtLift .8s cubic-bezier(.2,.8,.2,1) .15s both; }
@keyframes mtLift { from { transform: translateY(16px) scale(.96); opacity: .3; } }
.mt-front img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mt-ph { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 16px; color: #fff; background: radial-gradient(260px 160px at 85% 10%, rgba(216,195,156,.35), transparent 70%), linear-gradient(150deg, #2E5A4C, #1E3A32 60%, #142822); }
.mt-ph b { font-size: 1.05rem; line-height: 1.5; font-family: var(--f-ar-display, serif); }
.mt-ph i { font-style: normal; color: #E9D3A8; font-weight: 700; font-size: .8rem; }

.mt-desc { margin: 0; color: #3D4843; font-size: .93rem; line-height: 1.9; }
.mt-facts { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mt-facts li { display: flex; align-items: flex-start; gap: 8px; padding: 9px 10px; border-radius: 12px; background: #F7F5F0; font-size: .82rem; color: #1E3A32; font-weight: 600; line-height: 1.45; min-width: 0; }
.mt-facts li span { min-width: 0; overflow-wrap: anywhere; }
.mt-facts small { display: block; font-size: .68rem; color: #8A8F8B; font-weight: 500; }
.mt-facts svg, .mt-dl svg, .mt-share svg, .mts-go svg, .mts-again svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mt-facts svg { color: #A8844C; margin-top: 2px; }

.mt-acts { display: flex; gap: 10px; position: sticky; bottom: 10px; }
.mt-dl { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; border: 0; border-radius: 16px; font: inherit; font-weight: 800; font-size: 1.02rem; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, #B8925A, #A8844C 55%, #8E6E3C); box-shadow: 0 14px 26px -14px rgba(168,132,76,.9), inset 0 1px 0 rgba(255,255,255,.25); position: relative; overflow: hidden; -webkit-tap-highlight-color: transparent; transition: transform .2s; }
.mt-dl::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%); transform: translateX(-120%); animation: mtShine 3.4s ease-in-out infinite 1s; }
@keyframes mtShine { 0%, 60% { transform: translateX(-120%); } 90%, 100% { transform: translateX(120%); } }
.mt-dl:active { transform: scale(.98); }
.mt-dl svg { width: 22px; height: 22px; stroke-width: 2.2; }
.mt-share { flex: none; width: 54px; border-radius: 16px; border: 1px solid #E2DCCF; background: #fff; color: #1E3A32; cursor: pointer; display: grid; place-items: center; }
.mt-note { margin: -4px 0 0; font-size: .76rem; color: #7A817D; text-align: center; }
.mt-empty { background: #fff; border-radius: 20px; padding: 40px 20px; text-align: center; color: #56645E; }

/* ===== bottom sheet ===== */
.mts { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-end; justify-content: center; }
.mts[hidden] { display: none; }
.mts-bg { position: absolute; inset: 0; background: rgba(12,26,21,.55); opacity: 0; transition: opacity .3s; }
.mts.on .mts-bg { opacity: 1; }
.mts-box { position: relative; width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; background: #fff; border-radius: 26px 26px 0 0; padding: 12px 20px calc(22px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .45s cubic-bezier(.2,.8,.2,1); box-shadow: 0 -20px 50px -20px rgba(0,0,0,.4); }
.mts.on .mts-box { transform: none; }
.mts-grab { display: block; width: 44px; height: 5px; border-radius: 3px; background: #DDD6C8; margin: 0 auto 10px; }
.mts-x { position: absolute; top: 12px; inset-inline-end: 14px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: #F2EEE5; color: #1E3A32; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.mts-k { margin: 6px 0 0; color: #A8844C; font-weight: 800; font-size: .78rem; letter-spacing: .08em; }
.mts h2 { margin: 2px 0 16px; font-size: 1.12rem; line-height: 1.55; color: #1E3A32; padding-inline-end: 36px; }
.mts-f { position: relative; display: block; margin-bottom: 12px; }
.mts-f input { width: 100%; box-sizing: border-box; height: 56px; padding: 22px 14px 6px; border-radius: 14px; border: 1.5px solid #E2DCCF; background: #FBFAF7; font: inherit; font-size: 16px; color: #1E3A32; outline: none; transition: border-color .2s, background .2s, box-shadow .2s; }
.mts-f input[dir="ltr"] { text-align: left; }
html[dir="rtl"] .mts-f input[dir="ltr"]:placeholder-shown { text-align: right; }
.mts-f span { position: absolute; inset-inline-start: 15px; top: 17px; color: #7A817D; font-size: .95rem; pointer-events: none; transition: all .2s ease; }
.mts-f input:focus { border-color: #A8844C; background: #fff; box-shadow: 0 0 0 4px rgba(168,132,76,.14); }
.mts-f input:focus + span, .mts-f input:not(:placeholder-shown) + span { top: 7px; font-size: .7rem; color: #A8844C; font-weight: 700; }
.mts-f.bad input { border-color: #C0392B; }
.mts-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.mts-priv { margin: 2px 2px 14px; font-size: .74rem; color: #7A817D; line-height: 1.6; }
.mts-err { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: #FDECEA; color: #A93226; font-size: .85rem; font-weight: 600; }
.mts-go { width: 100%; height: 56px; border: 0; border-radius: 16px; font: inherit; font-weight: 800; font-size: 1.05rem; color: #fff; cursor: pointer; background: linear-gradient(135deg, #24493E, #1E3A32); box-shadow: 0 14px 26px -16px rgba(30,58,50,.9); position: relative; }
.mts-go-t { display: inline-flex; align-items: center; gap: 10px; }
.mts-spin { display: none; width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255,255,255,.3); border-top-color: #fff; animation: mtSpin .8s linear infinite; }
@keyframes mtSpin { to { transform: rotate(360deg); } }
.mts-go.busy .mts-go-t { display: none; } .mts-go.busy .mts-spin { display: inline-block; }
.mts-done { text-align: center; padding: 10px 4px 4px; }
.mts-done h2 { padding: 0; margin: 10px 0 6px; font-size: 1.3rem; }
.mts-msg { margin: 0 0 18px; color: #3D4843; line-height: 1.8; font-size: .95rem; }
.mts-msg b { color: #1E3A32; direction: ltr; unicode-bidi: embed; }
.mts-ok svg { width: 78px; height: 78px; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mts-ok circle { stroke: #3E8E5A; stroke-width: 3; stroke-dasharray: 160; stroke-dashoffset: 160; animation: mtDraw .7s ease forwards; }
.mts-ok path { stroke: #3E8E5A; stroke-width: 4; stroke-dasharray: 40; stroke-dashoffset: 40; animation: mtDraw .45s ease .55s forwards; }
@keyframes mtDraw { to { stroke-dashoffset: 0; } }
.mts-again { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; box-sizing: border-box; min-height: 50px; border-radius: 14px; background: #F7F2E7; color: #8E6E3C; font-weight: 800; text-decoration: none; margin-bottom: 10px; }
.mts-close { width: 100%; height: 48px; border-radius: 14px; border: 1px solid #E2DCCF; background: #fff; font: inherit; font-weight: 700; color: #1E3A32; cursor: pointer; }
.mt-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: #1E3A32; color: #fff; padding: 10px 18px; border-radius: 999px; font-size: .88rem; opacity: 0; transition: all .3s; z-index: 210; pointer-events: none; }
.mt-toast.on { opacity: 1; transform: translate(-50%, 0); }
body.mts-lock { overflow: hidden; }

@media (min-width: 700px) {
  .mt-band { padding: 40px 0 56px; }
  .mt-steps li { flex-direction: row; align-items: center; font-size: .86rem; padding: 12px 14px; }
  .mt-list { gap: 16px; margin-top: -36px; }
  .mt-head { padding: 18px 22px; gap: 18px; }
  .mt-date { width: 70px; height: 76px; } .mt-date b { font-size: 1.8rem; }
  .mt-title { font-size: 1.15rem; }
  .mt-in { grid-template-columns: 300px minmax(0, 1fr); align-items: start; padding: 4px 22px 24px; gap: 18px 26px; }
  .mt-cover { grid-row: span 2; margin: 6px 6px 14px; }
  .mt-acts { grid-column: 2; position: static; }
  .mt-note { grid-column: 2; text-align: start; }
  .mts { align-items: center; }
  .mts-box { border-radius: 24px; transform: translateY(30px) scale(.97); opacity: 0; transition: transform .4s cubic-bezier(.2,.8,.2,1), opacity .3s; padding: 22px 26px 26px; }
  .mts.on .mts-box { opacity: 1; }
  .mts-grab { display: none; }
}
@media (max-width: 380px) { .mt-steps { grid-template-columns: 1fr; } .mt-steps li { flex-direction: row; align-items: center; } .mt-facts { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .mt, .mt-front, .mt-dl::after { animation: none !important; } .mt-panel, .mt-in, .mts-box { transition: none; } }
@media (min-width: 700px) {
  .mt-in { grid-template-columns: 300px minmax(0, 1fr); grid-template-areas: "cover acts" "cover note" "text text"; align-items: start; }
  .mt-in .mt-cover { grid-area: cover; } .mt-in .mt-acts { grid-area: acts; align-self: end; } .mt-in .mt-note { grid-area: note; } .mt-in .mt-text { grid-area: text; }
  .mt-acts { margin-top: 30px; }
}
.mt-text { display: grid; gap: 4px; }
.mt-dl small { font-size: .72rem; font-weight: 700; opacity: .85; margin-inline-start: 4px; letter-spacing: .03em; }
.mts-fmt { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 2px 0 12px; }
.mts-fmt[hidden] { display: none; }
.mts-fmt label { position: relative; cursor: pointer; }
.mts-fmt input { position: absolute; opacity: 0; pointer-events: none; }
.mts-fmt span { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 10px 8px; border-radius: 14px; border: 1.5px solid #E2DCCF; background: #FBFAF7; transition: all .2s; }
.mts-fmt b { font-size: .98rem; color: #1E3A32; } .mts-fmt small { font-size: .72rem; color: #7A817D; }
.mts-fmt input:checked + span { border-color: #A8844C; background: #FBF4E6; box-shadow: 0 0 0 3px rgba(168,132,76,.15); }
.mts-fmt input:focus-visible + span { outline: 2px solid #A8844C; }
.mts-files { display: grid; gap: 8px; margin-bottom: 10px; }
.mts-files .mts-again { margin: 0; }
.mts-files .mts-again[hidden] { display: none; }
.mts-again.main { background: linear-gradient(135deg, #B8925A, #A8844C 55%, #8E6E3C); color: #fff; }
.mts-again.mts-ppt:not(.main) { background: #EEF3F0; color: #1E3A32; }
.mt-date { position: relative; }
.mt-stamp { position: absolute; top: -9px; inset-inline-start: -10px; z-index: 2; font-style: normal; font-weight: 800; font-size: .62rem; letter-spacing: .04em; padding: 2px 7px; border-radius: 6px; border: 2px solid currentColor; background: rgba(255,255,255,.94); transform: rotate(-12deg); box-shadow: 0 2px 6px rgba(0,0,0,.12); line-height: 1.3; white-space: nowrap; }
.mt-stamp.ended { color: #A93226; } .mt-stamp.soon { color: #2E7D4F; transform: rotate(-6deg); }
.mts-spam { display: block; margin-top: 8px; font-size: .78rem; color: #8A6A35; background: #FBF4E6; border-radius: 10px; padding: 8px 10px; line-height: 1.7; }
/* iOS Safari: keep every block inside the card width */
.mt-sec { overflow-x: clip; }
.mt-list, .mt, .mt-panel, .mt-clip { min-width: 0; max-width: 100%; }
.mt-panel { grid-template-columns: minmax(0, 1fr); }
.mt-in { grid-template-columns: minmax(0, 1fr); }
.mt-in > * { min-width: 0; }
.mt-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mt-desc { overflow-wrap: anywhere; }
.mt-cover { margin-inline: 10px 14px; }
@media (min-width: 700px) { .mt-in { grid-template-columns: 300px minmax(0, 1fr); } }
@media (max-width: 380px) { .mt-facts { grid-template-columns: minmax(0, 1fr); } }
.mt-list { grid-template-columns: minmax(0, 1fr); }
.mt-hd { grid-template-columns: minmax(0, 1fr); }
.mt-hd > * { min-width: 0; }
.mt-head { max-width: 100%; }
