/* MaxMBA — light theme built on the brand sheet: teal #1F5E57, mint #DCEBE7, amber #FFCB57, paper #F6F5F1, Vazirmatn. */
@font-face { font-family: Vazirmatn; src: url(../fonts/Vazirmatn-Regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(../fonts/Vazirmatn-Medium.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(../fonts/Vazirmatn-Bold.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(../fonts/Vazirmatn-Black.woff2) format("woff2"); font-weight: 900; font-display: swap; }

:root {
  --paper: #F6F5F1; --card: #FFFFFF; --sunk: #EFEEE8;
  --ink: #17302C; --ink-2: #4E615D; --ink-3: #8A9894; --line: #E4E2DA;
  --teal: #1F5E57; --teal-deep: #154540; --mint: #DCEBE7; --mint-2: #EEF6F3;
  --amber: #FFCB57; --amber-soft: #FFF4D9; --amber-ink: #7A5600;
  --danger: #B3412F; --danger-soft: #F9E4DF; --ok: #2E7D4F; --ok-soft: #E2F2E8;
  --r: 18px; --r-sm: 12px;
  --shadow: 0 1px 0 rgba(23,48,44,.04), 0 10px 30px -18px rgba(23,48,44,.35);
  --shadow-lift: 0 1px 0 rgba(23,48,44,.05), 0 18px 40px -20px rgba(23,48,44,.45);
  --tab-h: 0px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.85 Vazirmatn, Tahoma, sans-serif; font-feature-settings: "ss01"; padding-bottom: var(--tab-h); }
img, svg { max-width: 100%; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.45; margin: 0 0 .4em; color: var(--ink); }
h1 { font-size: 1.75rem; font-weight: 900; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1.02rem; font-weight: 700; }
.muted { color: var(--ink-2); } .faint { color: var(--ink-3); }
.small { font-size: .86rem; } .tiny { font-size: .76rem; }
.ltr { direction: ltr; text-align: left; }
.ico { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }
.ico.sm { width: 16px; height: 16px; vertical-align: -3px; }
.ico.fill { fill: currentColor; stroke: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Shell ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
main.wrap { padding-top: 28px; padding-bottom: 72px; }
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(246,245,241,.88); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { display: flex; align-items: center; }
.brand img { height: 34px; width: auto; display: block; }
.mainnav { display: flex; gap: 4px; }
.mainnav a { position: relative; display: flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 99px; color: var(--ink-2); font-weight: 500; font-size: .95rem; }
.mainnav a:hover { background: var(--sunk); color: var(--ink); text-decoration: none; }
.mainnav a.on { background: var(--mint); color: var(--teal-deep); }
.badge { min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; background: var(--amber); color: var(--ink); font-size: .72rem; font-weight: 700; display: inline-grid; place-items: center; line-height: 1; }
.me-menu { margin-inline-start: auto; position: relative; }
.me-menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 12px; border-radius: 99px; }
.me-menu summary::-webkit-details-marker { display: none; }
.me-menu summary:hover { background: var(--sunk); }
.me-menu .menu { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); min-width: 230px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow-lift); padding: 6px; }
.me-menu .menu a, .me-menu .menu button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 9px 12px; border-radius: 8px; color: var(--ink); background: none; border: 0; font: inherit; font-size: .93rem; cursor: pointer; text-align: start; }
.me-menu .menu a:hover, .me-menu .menu button:hover { background: var(--sunk); text-decoration: none; }
.me-name { font-weight: 500; font-size: .92rem; }

.tabbar { display: none; }
@media (max-width: 760px) {
  :root { --tab-h: calc(66px + env(safe-area-inset-bottom)); }
  .wrap { padding: 0 16px; }
  .mainnav, .me-name { display: none; }
  .topbar .wrap { height: 58px; }
  .brand img { height: 28px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset: auto 0 0 0; z-index: 40; background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .7rem; color: var(--ink-3); padding: 4px 0; position: relative; }
  .tabbar a.on { color: var(--teal); font-weight: 700; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar .ico { width: 23px; height: 23px; }
  .tabbar .badge { position: absolute; top: 0; inset-inline-start: calc(50% + 4px); }
  h1 { font-size: 1.4rem; }
  main.wrap { padding-top: 20px; }
}

/* ---------- Building blocks ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card.tight { padding: 16px; }
.stack > * + * { margin-top: 16px; }
.stack-lg > * + * { margin-top: 28px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.grid-2 { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
.section-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; margin: 34px 0 14px; }
.section-head h2 { margin: 0; font-size: 1.25rem; font-weight: 900; white-space: nowrap; }
.eyebrow { font-size: .78rem; font-weight: 700; color: var(--teal); letter-spacing: 0; margin-bottom: 4px; display: block; }
.crumbs { font-size: .86rem; color: var(--ink-3); margin-bottom: 8px; }
.crumbs a { color: var(--ink-2); }
hr.soft { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

.flash { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: var(--r-sm); background: var(--mint); color: var(--teal-deep); margin-bottom: 20px; font-weight: 500; }
.alert { padding: 12px 16px; border-radius: var(--r-sm); background: var(--amber-soft); color: var(--amber-ink); }
.alert.danger { background: var(--danger-soft); color: var(--danger); }
.empty { text-align: center; padding: 44px 18px; color: var(--ink-2); }
.empty .ico { width: 34px; height: 34px; color: var(--ink-3); display: block; margin: 0 auto 10px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 12px; padding: 9px 18px; font: 700 .93rem Vazirmatn, sans-serif; cursor: pointer; background: var(--teal); color: #fff; transition: background .15s, transform .15s; white-space: nowrap; }
.btn:hover { background: var(--teal-deep); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--sunk); }
.btn.soft { background: var(--mint); color: var(--teal-deep); }
.btn.soft:hover { background: #cfe3dd; }
.btn.amber { background: var(--amber); color: var(--ink); }
.btn.amber:hover { background: #f5bd3e; }
.btn.sm { padding: 5px 12px; font-size: .84rem; border-radius: 10px; }
.btn.block { width: 100%; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-2); cursor: pointer; }
.linkbtn:hover { color: var(--danger); }

label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.hint { font-size: .8rem; color: var(--ink-3); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=time], input[type=search], textarea, .select {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); font: inherit; resize: vertical; transition: border-color .15s, box-shadow .15s; }
input:focus, textarea:focus, .select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px var(--mint); }
.select { width: auto; max-width: 100%; padding: 8px 12px; }
.field + .field { margin-top: 16px; }
.fields { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.error { color: var(--danger); font-size: .86rem; margin-top: 6px; }

.chip { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; font-weight: 500; padding: 2px 10px; border-radius: 99px; background: var(--sunk); color: var(--ink-2); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--amber-soft); color: var(--amber-ink); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.accent { background: var(--mint); color: var(--teal-deep); }

.avatar { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 900; font-size: .9rem; flex: none; }
.avatar.lg { width: 84px; height: 84px; font-size: 1.6rem; }
.avatar.sm { width: 30px; height: 30px; font-size: .72rem; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--sunk); border-radius: var(--r-sm); padding: 12px 14px; }
.stat b { display: block; font-size: 1.45rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.stat span { color: var(--ink-2); font-size: .84rem; }

/* ---------- Signature: the session strip (echoes the logo's pixels) ---------- */
.pixels { display: flex; flex-wrap: wrap; gap: 5px; }
.px { width: 13px; height: 13px; border-radius: 4px; background: var(--card); border: 1.5px solid var(--line); flex: none; }
.px.proc { background: var(--mint); border-color: var(--mint); animation: px-breathe 2.4s ease-in-out infinite; }
.px.ready { background: var(--amber); border-color: var(--amber); }
.px.studied { background: var(--teal); border-color: var(--teal); }
.px.fail { background: var(--danger-soft); border-color: var(--danger); }
@keyframes px-breathe { 50% { opacity: .45; } }
.px-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .78rem; color: var(--ink-2); }
.px-legend span { display: inline-flex; align-items: center; gap: 6px; }
.px-legend .px { width: 11px; height: 11px; }

/* ---------- Dashboard ---------- */
.desk { position: relative; overflow: hidden; background: var(--teal); color: #fff; border-radius: 26px; padding: 30px 32px; box-shadow: var(--shadow-lift); }
.desk h1 { color: #fff; font-size: 1.9rem; margin-bottom: 2px; }
.desk .lead { color: #CFE5DF; margin: 0 0 22px; }
.desk-items { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; position: relative; z-index: 1; }
.desk-item { display: flex; gap: 12px; align-items: center; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 16px; padding: 14px 16px; color: #fff; transition: background .15s; }
.desk-item:hover { background: rgba(255,255,255,.14); text-decoration: none; }
.desk-item b { display: block; font-size: 1.35rem; font-weight: 900; line-height: 1.3; }
.desk-item span { font-size: .84rem; color: #CFE5DF; }
.desk-item .ico { width: 26px; height: 26px; color: var(--amber); }
.desk-deco { position: absolute; inset-inline-end: 30px; top: 30px; display: grid; grid-template-columns: repeat(3, 22px); gap: 9px; opacity: .9; }
.desk-deco i { width: 22px; height: 22px; border-radius: 6px; background: rgba(255,255,255,.1); }
@media (max-width: 760px) { .desk { padding: 22px 18px; border-radius: 22px; } .desk h1 { font-size: 1.45rem; } .desk-deco { display: none; } }

.course-card { display: flex; flex-direction: column; gap: 14px; color: var(--ink); transition: transform .18s, box-shadow .18s, border-color .18s; }
.course-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: #cfd8d4; }
.course-card h3 { font-size: 1.12rem; font-weight: 900; margin: 0; }
.course-card .who { font-size: .84rem; color: var(--ink-2); display: flex; gap: 6px; align-items: center; }
.course-card .foot { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; color: var(--ink-2); margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--line); }

.fresh-list { list-style: none; margin: 0; padding: 0; }
.fresh-list li + li { border-top: 1px solid var(--line); }
.fresh-list a { display: flex; gap: 12px; align-items: center; padding: 12px 2px; color: var(--ink); }
.fresh-list a:hover { text-decoration: none; color: var(--teal); }
.fresh-list .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--amber); flex: none; }

.meetup-mini { display: flex; gap: 14px; align-items: center; padding: 12px 0; color: var(--ink); }
.meetup-mini + .meetup-mini { border-top: 1px solid var(--line); }
.meetup-mini:hover { text-decoration: none; color: var(--teal); }
.datebox { width: 54px; flex: none; text-align: center; border-radius: 14px; background: var(--amber-soft); color: var(--amber-ink); padding: 6px 0; line-height: 1.25; }
.datebox b { display: block; font-size: 1.35rem; font-weight: 900; color: var(--ink); }
.datebox span { font-size: .72rem; }

/* ---------- Course page ---------- */
.course-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: end; margin-bottom: 18px; }
.course-hero h1 { font-size: 2rem; margin: 0; }
.course-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 760px) { .course-hero { grid-template-columns: 1fr; } .course-hero h1 { font-size: 1.5rem; } }
.instructor { display: flex; gap: 16px; align-items: flex-start; }
.instructor .avatar { background: var(--mint); color: var(--teal-deep); }
.links { display: flex; gap: 8px; flex-wrap: wrap; }
.link-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 99px; background: var(--sunk); color: var(--ink); font-size: .86rem; font-weight: 500; }
.link-pill:hover { background: var(--mint); color: var(--teal-deep); text-decoration: none; }
.link-pill.telegram .ico { color: #229ED9; } .link-pill.whatsapp .ico { color: #25A244; } .link-pill.linkedin .ico { color: #0A66C2; } .link-pill.instagram .ico { color: #C13584; }
details.editor > summary { cursor: pointer; list-style: none; color: var(--teal); font-weight: 500; font-size: .88rem; display: inline-flex; gap: 6px; align-items: center; }
details.editor > summary::-webkit-details-marker { display: none; }
details.editor[open] > summary { margin-bottom: 14px; }

.subnav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 0 22px; padding-bottom: 2px; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); color: var(--ink-2); font-size: .9rem; font-weight: 500; white-space: nowrap; }
.subnav a:hover { text-decoration: none; color: var(--ink); border-color: #cfd8d4; }
.subnav a.on { background: var(--ink); border-color: var(--ink); color: #fff; }

.lesson-list { list-style: none; margin: 0; padding: 0; }
.lesson-list li + li { border-top: 1px solid var(--line); }
.lesson-list a { display: flex; align-items: center; gap: 14px; padding: 14px 6px; color: var(--ink); border-radius: 12px; }
.lesson-list a:hover { text-decoration: none; background: var(--mint-2); }
.lesson-list .num { width: 38px; height: 38px; border-radius: 12px; background: var(--sunk); display: grid; place-items: center; font-weight: 900; flex: none; color: var(--ink-2); }
.lesson-list .ready .num { background: var(--amber); color: var(--ink); }
.lesson-list .done .num { background: var(--teal); color: #fff; }
.lesson-list .grow { flex: 1; min-width: 0; }
.lesson-list .grow b { display: block; }

/* ---------- Lesson page ---------- */
.players { display: grid; gap: 12px; }
.player { background: var(--mint-2); border: 1px solid #d7e8e2; border-radius: 16px; padding: 14px 16px; }
.player audio { width: 100%; margin-top: 8px; height: 40px; }
.player.playing { border-color: var(--teal); box-shadow: 0 0 0 3px var(--mint); }
.speeds { display: flex; gap: 4px; }
.speeds button { border: 1px solid var(--line); background: var(--card); color: var(--ink-2); border-radius: 8px; padding: 0 9px; font: 500 .78rem Vazirmatn, sans-serif; cursor: pointer; }
.speeds button.on { background: var(--teal); color: #fff; border-color: var(--teal); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px; font: 700 .95rem Vazirmatn, sans-serif; color: var(--ink-3); cursor: pointer; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs button.on { color: var(--teal); border-bottom-color: var(--teal); }
.tab { display: none; } .tab.on { display: block; }

.prose { line-height: 2.1; font-size: 1.02rem; }
.prose h2 { margin-top: 1.9em; padding-bottom: 8px; border-bottom: 2px solid var(--mint); font-weight: 900; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.4em; color: var(--teal); }
.prose h4 { margin: 1.2em 0 .3em; }
.prose ul, .prose ol { padding-inline-start: 1.4em; }
.prose li + li { margin-top: .35em; }
.prose li::marker { color: var(--teal); }
.prose blockquote { margin: 1.2em 0; padding: 10px 18px; border-inline-start: 4px solid var(--amber); background: var(--amber-soft); border-radius: 10px; color: var(--ink); }
.prose strong { color: var(--teal-deep); }
.prose table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 6px 10px; }
.prose code { background: var(--sunk); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.transcript { white-space: pre-wrap; line-height: 2.15; }
a.ts { font-size: .78rem; color: var(--teal-deep); background: var(--mint); border-radius: 6px; padding: 1px 7px; font-weight: 500; }

.qa { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--card); }
.qa + .qa { margin-top: 12px; }
.qa summary { cursor: pointer; font-weight: 700; list-style: none; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "نمایش پاسخ"; display: block; font-size: .8rem; color: var(--teal); margin-top: 6px; font-weight: 500; }
.qa[open] summary::after { content: "پنهان کردن پاسخ"; }
.qa .answer { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); white-space: pre-wrap; }

.flash-card { perspective: 1200px; height: 260px; cursor: pointer; user-select: none; max-width: 640px; margin: 0 auto; }
.flash-card .inner { position: relative; width: 100%; height: 100%; transition: transform .5s cubic-bezier(.2,.7,.2,1); transform-style: preserve-3d; }
.flash-card.flipped .inner { transform: rotateY(180deg); }
.flash-card .face { position: absolute; inset: 0; backface-visibility: hidden; display: grid; place-items: center; text-align: center; padding: 28px; border-radius: 22px; border: 1px solid var(--line); background: var(--card); font-size: 1.2rem; font-weight: 700; overflow: auto; box-shadow: var(--shadow-lift); }
.flash-card .back { transform: rotateY(180deg); background: var(--teal); color: #fff; border-color: var(--teal); font-weight: 500; }

.lesson-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; }

/* ---------- Ask / quiz / mind map ---------- */
.msg-q { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 18px 18px 18px 6px; max-width: 85%; white-space: pre-wrap; margin-inline-start: auto; width: fit-content; font-weight: 500; }
.msg-a { margin-top: 8px !important; }
.ask-box { position: sticky; bottom: calc(12px + var(--tab-h)); }
a.cite { display: inline-flex; align-items: center; font-size: .78rem; padding: 0 9px; margin: 0 2px; border-radius: 99px; background: var(--mint); color: var(--teal-deep); white-space: nowrap; line-height: 1.9; font-weight: 500; }
a.cite:hover { text-decoration: none; background: #cfe3dd; }
.quiz-q textarea { margin-top: 8px; }
.quiz-q .answer { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.qa-answer { white-space: pre-wrap; }
.feedback { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--mint-2); }
.mindmap-wrap { position: relative; padding: 0; overflow: hidden; }
#mindmap { width: 100%; height: 72vh; display: block; direction: ltr; background: var(--card); }
#mindmap .markmap-foreign { font-family: Vazirmatn, sans-serif; direction: rtl; color: var(--ink); }
.mindmap-tools { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; }
.mm-tag { font-size: .7em; padding: 0 5px; border-radius: 6px; background: var(--mint); color: var(--teal-deep); }

/* ---------- People ---------- */
.person-card { display: flex; gap: 14px; align-items: flex-start; color: var(--ink); }
.person-card:hover { text-decoration: none; border-color: #cfd8d4; box-shadow: var(--shadow-lift); }
.person-card b { display: block; font-size: 1.02rem; }
.person-card .meta { font-size: .84rem; color: var(--ink-2); }
.profile-head { display: flex; gap: 20px; align-items: center; }
.profile-head h1 { margin: 0; }
.skills { display: flex; flex-wrap: wrap; gap: 6px; }
.skills span { padding: 3px 12px; border-radius: 99px; background: var(--mint); color: var(--teal-deep); font-size: .84rem; font-weight: 500; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: .94rem; }
.facts dt { color: var(--ink-3); } .facts dd { margin: 0; }
.search-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.search-bar input { flex: 1 1 240px; }

/* ---------- Meetups ---------- */
.meetup-card { display: flex; gap: 16px; color: var(--ink); }
.meetup-card:hover { text-decoration: none; box-shadow: var(--shadow-lift); }
.meetup-card .datebox { width: 64px; padding: 8px 0; }
.attendees { display: flex; flex-wrap: wrap; gap: 8px; }
.attendee { display: inline-flex; gap: 8px; align-items: center; padding: 4px 12px 4px 4px; background: var(--sunk); border-radius: 99px; color: var(--ink); font-size: .88rem; }
.attendee:hover { text-decoration: none; background: var(--mint); }
.date-fields { display: grid; grid-template-columns: 1fr 1.4fr 1fr 1.2fr; gap: 10px; }
@media (max-width: 520px) { .date-fields { grid-template-columns: 1fr 1fr; } }

/* ---------- Chat ---------- */
.rooms { list-style: none; margin: 0; padding: 0; }
.rooms li + li { border-top: 1px solid var(--line); }
.rooms a { display: flex; gap: 14px; align-items: center; padding: 14px 6px; color: var(--ink); border-radius: 12px; }
.rooms a:hover { text-decoration: none; background: var(--mint-2); }
.rooms .room-ico { width: 44px; height: 44px; border-radius: 14px; background: var(--mint); color: var(--teal-deep); display: grid; place-items: center; flex: none; }
.rooms .grow { flex: 1; min-width: 0; }
.rooms .preview { color: var(--ink-2); font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat { display: flex; flex-direction: column; height: calc(100dvh - 68px - 28px - 72px - var(--tab-h)); min-height: 420px; padding: 0; overflow: hidden; }
.chat-head { display: flex; gap: 12px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.chat-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 4px; background: linear-gradient(var(--mint-2), var(--card) 40%); }
.bubble-row { display: flex; gap: 8px; align-items: flex-end; max-width: 82%; }
.bubble-row.mine { margin-inline-start: auto; flex-direction: row-reverse; }
.bubble { padding: 8px 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); white-space: pre-wrap; word-break: break-word; }
.bubble-row.mine .bubble { background: var(--teal); color: #fff; border-color: var(--teal); border-end-end-radius: 6px; }
.bubble-row:not(.mine) .bubble { border-end-start-radius: 6px; }
.bubble .who { display: block; font-size: .74rem; font-weight: 700; color: var(--teal); }
.bubble time { display: block; font-size: .68rem; opacity: .65; margin-top: 2px; }
.day-sep { align-self: center; font-size: .74rem; color: var(--ink-3); background: var(--sunk); padding: 2px 12px; border-radius: 99px; margin: 10px 0; }
.chat-form { display: flex; gap: 10px; padding: 12px; border-top: 1px solid var(--line); background: var(--card); }
.chat-form textarea { min-height: 46px; max-height: 140px; resize: none; }
@media (max-width: 760px) { .chat { height: calc(100dvh - 58px - 20px - 24px - var(--tab-h)); border-radius: 16px; } .bubble-row { max-width: 92%; } }

/* ---------- Auth ---------- */
.auth { min-height: 100dvh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-side { background: var(--teal); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side h2 { color: #fff; font-size: 2.1rem; font-weight: 900; line-height: 1.5; margin: 0 0 14px; }
.auth-side p { color: #CFE5DF; max-width: 440px; }
.auth-side ul { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; }
.auth-side li { display: flex; gap: 12px; align-items: center; color: #E7F2EF; }
.auth-side li i { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.auth-main { display: grid; place-items: center; padding: 40px 20px; }
.auth-box { width: 100%; max-width: 400px; }
.auth-box .logo { height: 52px; margin-bottom: 26px; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* ---------- Pagination ---------- */
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 24px; }
.pager a, .pager span { min-width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 0 10px; }
.pager .on { background: var(--teal); color: #fff; border-color: var(--teal); }
.pager .off { color: var(--ink-3); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* Chat fills the viewport exactly; long room titles truncate. */
main.wrap:has(.chat) { padding-bottom: 16px; }
.chat-head b, .chat-head .tiny { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat { height: calc(100dvh - 68px - 28px - 16px - var(--tab-h)); }
@media (max-width: 760px) { .chat { height: calc(100dvh - 58px - 20px - 16px - var(--tab-h)); } .chat-head .btn.ghost:not([aria-label]) { display: none; } }

/* «بزودی» menu items */
.mainnav .soon { display: flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 99px; color: var(--ink-3); font-weight: 500; font-size: .95rem; cursor: not-allowed; }
.soon-tag { font-size: .66rem; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--amber-soft); color: var(--amber-ink); margin-inline-start: 2px; }
.tabbar .soon { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .7rem; color: var(--ink-3); padding: 4px 0; position: relative; opacity: .65; }
.tabbar .soon .ico { width: 23px; height: 23px; }
.tabbar .soon .soon-tag { position: absolute; top: -4px; inset-inline-start: calc(50% + 2px); font-size: .56rem; padding: 0 5px; }

/* NotebookLM resources & admin tools */
.resource + .resource { padding-top: 14px; border-top: 1px solid var(--line); }
.resource audio, .resource video, .resource img { width: 100%; margin-top: 8px; border-radius: 12px; display: block; }
.admin-card { border: 1.5px dashed #E8C26A; background: #FFFCF3; }
input[type=file] { width: 100%; font: inherit; font-size: .88rem; padding: 10px; border: 1px dashed var(--line); border-radius: 12px; background: var(--card); }

.pdf-view { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 14px; margin-top: 14px; background: var(--sunk); }
@media (max-width: 760px) { .pdf-view { height: 60vh; } }
a.cite.play { background: var(--teal); color: #fff; }
a.cite.play:hover { background: var(--teal-deep); }

/* Difficulty filter */
.level-filter { display: inline-flex; gap: 4px; padding: 4px; background: var(--sunk); border-radius: 99px; flex-wrap: wrap; }
.level-filter a, .level-filter button { padding: 4px 14px; border-radius: 99px; color: var(--ink-2); font: 500 .85rem Vazirmatn, sans-serif; background: none; border: 0; cursor: pointer; }
.level-filter a:hover, .level-filter button:hover { text-decoration: none; color: var(--ink); }
.level-filter .on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(23,48,44,.12); }
.level-filter .lv-easy.on { color: var(--ok); } .level-filter .lv-medium.on { color: var(--amber-ink); } .level-filter .lv-hard.on { color: var(--danger); }
.chip.class-q { background: #E6EEF7; color: #2D4E73; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; }
.suggest button { text-align: start; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 8px 12px; font: inherit; font-size: .88rem; color: var(--ink); cursor: pointer; max-width: 100%; }
.suggest button:hover { border-color: var(--teal); background: var(--mint-2); }

/* Avatars with photos; crop dialog */
img.avatar { object-fit: cover; display: inline-block; }
.photo-card { display: flex; gap: 18px; align-items: center; }
.crop-dialog { border: 0; border-radius: 20px; padding: 22px; width: min(560px, calc(100vw - 32px)); box-shadow: var(--shadow-lift); }
.crop-dialog::backdrop { background: rgba(23,48,44,.55); }
.crop-area { width: 100%; height: min(60vh, 420px); background: var(--sunk); border-radius: 12px; overflow: hidden; }
.crop-area img { display: block; max-width: 100%; }
