/* Student site shell + pages */

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50; height: var(--topbar-h);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { height: 100%; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: auto; height: 50px; aspect-ratio: 252 / 151; object-fit: cover; border-radius: 12px; box-shadow: 0 2px 10px rgba(8, 18, 34, .25); }
@media (max-width: 640px) { .brand img { height: 42px; } }
/* Narrow phones: the name shrinks (ellipsis) instead of sliding under the header buttons. */
.brand { min-width: 0; flex: 0 1 auto; }
.brand img { flex: none; }
.brand-text { min-width: 0; overflow: hidden; }
.brand-text b, .brand-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { flex: none; }
@media (max-width: 440px) { .topbar-inner { gap: 8px; } .brand { gap: 7px; } .brand img { height: 36px; } .brand-text b { font-size: 15px; } .topbar-actions { gap: 0; } }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 17px; color: var(--primary-ink); }
.brand-text small { font-size: 11.5px; color: var(--muted); }
.topnav { display: none; gap: 2px; margin-inline-start: 12px; }
.topnav a { padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: 14.5px; color: var(--text-2); transition: background .15s, color .15s; }
.topnav a:hover { background: var(--surface-2); color: var(--text); }
.topnav a.active { color: var(--primary-ink); background: var(--primary-soft); }
.topbar-actions { margin-inline-start: auto; display: flex; gap: 4px; }
@media (min-width: 900px) { .topnav { display: flex; } }

/* ---------- Bottom tab bar (mobile) ---------- */
.tabbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 60;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.tabbar a .icon { width: 23px; height: 23px; }
.tabbar a.active { color: var(--primary-ink); }
.tabbar a.active .tab-ic { background: var(--primary-soft); }
.tab-ic { width: 52px; height: 30px; display: grid; place-items: center; border-radius: 999px; transition: background .2s; }
@media (min-width: 900px) { .tabbar { display: none; } }

main { min-height: calc(100dvh - var(--topbar-h)); padding-bottom: calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom)); outline: none; }
@media (min-width: 900px) { main { padding-bottom: 56px; } }
.page-enter { animation: pageIn .32s var(--ease); }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } }

.announce { background: var(--accent-soft); color: #6b4700; font-size: 14px; }
.announce .container { display: flex; align-items: center; gap: 10px; min-height: 44px; padding-block: 8px; }
.announce a { font-weight: 700; text-decoration: underline; }

/* ---------- Image cards ---------- */
.photo-card {
  position: relative; display: block; overflow: hidden; isolation: isolate;
  border-radius: var(--radius-lg); background: #1b2a40; color: #fff;
  aspect-ratio: 4 / 3; box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.photo-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .6s var(--ease); }
.photo-card::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to top, rgba(8, 18, 34, .88) 0%, rgba(8, 18, 34, .45) 42%, rgba(8, 18, 34, .05) 75%);
}
.photo-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.photo-card:hover img { transform: scale(1.05); }
.photo-card .pc-body { position: absolute; inset-inline: 0; bottom: 0; padding: 14px 16px 15px; }
.photo-card .pc-title { font-size: 16px; font-weight: 700; line-height: 1.35; text-shadow: 0 1px 12px rgba(0,0,0,.3); }
.photo-card .pc-sub { font-size: 12.5px; opacity: .85; margin-top: 2px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.photo-card .pc-tag { position: absolute; top: 12px; inset-inline-start: 12px; }
.photo-card .pc-tag .badge { background: var(--on-photo-chip); color: var(--primary-ink); backdrop-filter: blur(6px); }
.photo-card .pc-go {
  position: absolute; top: 12px; inset-inline-end: 12px; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255,255,255,.18); backdrop-filter: blur(8px);
  opacity: 0; transform: translateX(6px); transition: all .25s var(--ease);
}
.photo-card:hover .pc-go { opacity: 1; transform: none; }
.photo-card.wide { aspect-ratio: 16 / 9; }
.photo-card.big .pc-title { font-size: 21px; }
.photo-card.big .pc-sub { font-size: 14px; }
@media (max-width: 639px) {
  /* Phones: the whole title and two lines of description stay readable on any photo. */
  .photo-card:not(.big) .pc-title { font-size: 15px; line-height: 1.4; }
  .photo-card:not(.big) .pc-sub { -webkit-line-clamp: 2; font-size: 12px; line-height: 1.55; opacity: .92; }
  .photo-card .pc-body { padding: 10px 11px 11px; }
  .photo-card::after { background: linear-gradient(to top, rgba(8, 18, 34, .94) 0%, rgba(8, 18, 34, .7) 38%, rgba(8, 18, 34, .12) 72%); }
  .photo-card .pc-title, .photo-card .pc-sub { text-shadow: 0 1px 6px rgba(0,0,0,.55); }
  .hero p { font-size: 14px; }
}

.plain-card { position: relative; isolation: isolate; display: flex; align-items: flex-end; min-width: 0; min-height: 132px; padding: 14px; overflow: hidden;
  border-radius: 18px; color: #fff; text-decoration: none; background: linear-gradient(135deg, var(--g1) 0%, var(--g2) 100%);
  box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--g1) 70%, transparent); transition: transform .2s var(--ease), box-shadow .2s; }
.plain-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(120% 90% at 100% 0%, rgba(255,255,255,.22), transparent 55%), radial-gradient(80% 70% at 0% 100%, rgba(0,0,0,.18), transparent 60%); }
.plain-card:hover { color: #fff; transform: translateY(-3px); box-shadow: 0 12px 26px -10px color-mix(in srgb, var(--g1) 80%, transparent); }
.plc-art { position: absolute; inset-inline-end: -14px; top: -10px; z-index: -1; opacity: .16; transform: rotate(-12deg); }
.plc-art .icon { width: 118px; height: 118px; stroke-width: 1.4; }
.plc-ic { position: absolute; top: 12px; inset-inline-start: 12px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: rgba(255,255,255,.2); backdrop-filter: blur(4px); }
.plc-tag { position: absolute; top: 14px; inset-inline-end: 12px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-style: normal; font-weight: 800; background: #fff; color: var(--g1); }
.plc-tag.soft { background: rgba(0,0,0,.28); color: #fff; }
.plc-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.plc-body b { font-size: 17px; font-weight: 800; line-height: 1.35; text-shadow: 0 1px 8px rgba(0,0,0,.18); }
.plc-body small { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; opacity: .92; }
.plc-body small i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .7; }
.plain-card.is-soon { filter: saturate(.35); opacity: .78; }
.plain-card.mine { outline: 3px solid var(--g2); outline-offset: 3px; }
.plain-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .plain-grid { grid-template-columns: repeat(3, 1fr); } .plain-card.wide { min-height: 150px; } }
@media (max-width: 639px) { .plain-card { min-height: 120px; padding: 12px; } .plc-body b { font-size: 15px; } .plain-card.wide { min-height: 96px; } .plc-art .icon { width: 96px; height: 96px; } }
.photo-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .photo-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (min-width: 1000px) { .photo-grid { grid-template-columns: repeat(4, 1fr); } }
.photo-grid .span-2 { grid-column: span 2; aspect-ratio: 16 / 9; }
@media (min-width: 640px) { .photo-grid .span-2 { aspect-ratio: 8 / 3; } }
@media (min-width: 1000px) { .photo-grid .span-2 { aspect-ratio: 2.72; } }
@media (min-width: 640px) and (max-width: 999px) { .photo-grid .span-2.fill-end { grid-column: span 1; aspect-ratio: 4 / 3; } }
.photo-grid .span-full { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
@media (min-width: 640px) { .photo-grid .span-full { aspect-ratio: 4; } }

/* ---------- Home ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate; margin-top: 16px;
  border-radius: 24px; color: #fff; min-height: 300px; display: flex; align-items: flex-end;
}
.hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(10, 26, 50, .92) 0%, rgba(10, 26, 50, .55) 50%, rgba(10, 26, 50, .15) 100%); }
.hero-body { padding: 26px 20px 22px; width: 100%; }
@media (min-width: 768px) { .hero { min-height: 380px; } .hero-body { padding: 40px 40px 34px; } }
.hero .eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: rgba(255,255,255,.16); backdrop-filter: blur(8px); margin-bottom: 12px; }
.hero h1 { color: #fff; max-width: 620px; }
.hero p { opacity: .9; margin-top: 6px; max-width: 560px; }
.hero-search { margin-top: 18px; max-width: 560px; display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 16px; border-radius: 16px; background: var(--surface); color: var(--muted); box-shadow: var(--shadow-lg); width: 100%; text-align: start; font-size: 15px; }
.hero-search .icon { color: var(--primary-ink); }
.hero-search .kbd { margin-inline-start: auto; }
@media (max-width: 767px) { .hero-search .kbd { display: none; } }

.stat-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.stat b { display: block; font-size: 20px; color: var(--primary-ink); line-height: 1.3; }
.stat span { font-size: 12.5px; color: var(--muted); }

.h-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: none; }
.h-scroll::-webkit-scrollbar { display: none; }
.h-scroll > * { scroll-snap-align: start; }
@media (min-width: 1000px) { .h-scroll { grid-auto-columns: calc((100% - 36px) / 4); } }

.file-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.file-card .fc-top { display: flex; align-items: center; gap: 10px; }
.file-card .fc-title { font-weight: 600; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }

/* Date tile */
.date-tile { width: 54px; flex: none; text-align: center; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.date-tile b { display: block; font-size: 19px; line-height: 1.6; color: var(--text); }
.date-tile span { display: block; font-size: 11px; font-weight: 600; background: var(--primary); color: #fff; padding: 2px 0; }

/* Page banner with image */
.banner {
  position: relative; overflow: hidden; isolation: isolate; border-radius: 22px; color: #fff; margin-top: 16px;
  min-height: 170px; display: flex; align-items: flex-end;
}
.banner > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.banner::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(10,26,50,.9), rgba(10,26,50,.35)); }
.banner .banner-body { padding: 22px 20px 18px; width: 100%; }
@media (min-width: 768px) { .banner { min-height: 210px; } .banner .banner-body { padding: 30px 32px 24px; } }
.banner h1 { color: #fff; font-size: clamp(22px, 3.6vw, 30px); }
.banner p { opacity: .88; margin-top: 4px; }
.banner .crumbs { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 13px; opacity: .85; margin-bottom: 6px; }
.banner .crumbs a:hover { text-decoration: underline; }
.banner .back { position: absolute; top: 14px; inset-inline-start: 14px; }
.btn-glass { background: rgba(255,255,255,.16); color: #fff; backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.2); }
.btn-glass:hover { background: rgba(255,255,255,.26); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.toolbar .search-field { flex: 1 1 240px; }

/* Search overlay */
.search-panel { position: fixed; inset: 0; z-index: 95; background: var(--bg); display: flex; flex-direction: column; animation: fade .15s; }
@media (min-width: 768px) {
  .search-panel { background: rgba(10,20,36,.45); backdrop-filter: blur(3px); padding: 70px 16px; align-items: center; }
  .search-panel .sp-box { width: 100%; max-width: 640px; max-height: 76vh; border-radius: 20px; box-shadow: var(--shadow-lg); }
}
.sp-box { background: var(--surface); display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.sp-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.sp-head input { flex: 1; height: 48px; border: 0; outline: 0; font-size: 16px; background: transparent; }
.sp-results { overflow-y: auto; padding: 6px 0 16px; }
.sp-group { padding: 10px 18px 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.sp-results .list-item { border: 0; min-height: 56px; padding: 10px 18px; }
.sp-results mark { background: var(--accent-soft); color: inherit; border-radius: 4px; padding: 0 2px; }

.footer { margin-top: 40px; padding: 22px 0; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.footer .container { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; }

/* Dark mode tweaks */
:root[data-theme="dark"] .announce { color: var(--accent-ink); }
:root[data-theme="dark"] .hero-search { box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), var(--shadow-lg); }
@media (min-width: 768px) {
  :root[data-theme="dark"] .search-panel { background: rgba(2, 6, 14, .62); }
  :root[data-theme="dark"] .search-panel .sp-box { box-shadow: 0 0 0 1px var(--border), var(--shadow-lg); }
}

/* Not available yet ("قريبًا") */
.photo-card.soon { cursor: default; filter: grayscale(.85); opacity: .78; }
.photo-card.soon:hover { transform: none; box-shadow: none; }
.photo-card.soon:hover img { transform: none; }

/* ---------- Server-rendered SEO content (replaced by the app on first render) ---------- */
.js .seo-shell:not(.has-banner), .js .seo-rest { display: none; }
/* Keeps the footer below the fold while the app replaces the banner (no layout shift). */
.js .seo-shell.has-banner { min-height: 100vh; }
.seo-rest { padding-top: 24px; padding-bottom: 24px; line-height: 1.8; }
.seo-sep { opacity: .7; margin: 0 2px; }
.seo-rest h1 { font-size: 26px; margin: 8px 0 10px; }
.seo-rest h2 { font-size: 18px; margin: 22px 0 8px; }
.seo-rest ul { padding-inline-start: 20px; margin: 0; }
.seo-rest li { margin: 4px 0; }
.seo-rest a { color: var(--primary-ink); text-decoration: underline; text-underline-offset: 3px; }
.seo-rest small { color: var(--muted); }
.seo-rest .seo-intro { color: var(--muted); max-width: 760px; }
.seo-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; font-size: 13px; }
.seo-crumbs li + li::before { content: "‹"; margin-inline-end: 6px; color: var(--muted); }
.seo-facts { display: grid; gap: 6px; margin: 12px 0; }
.seo-facts div { display: flex; gap: 8px; }
.seo-facts dt { font-weight: 700; min-width: 130px; }
.seo-facts dd { margin: 0; }
.seo-table { overflow-x: auto; }
.seo-table table { border-collapse: collapse; width: 100%; font-size: 14px; }
.seo-table th, .seo-table td { border: 1px solid var(--border); padding: 6px 8px; text-align: start; }

/* ---------- Site footer ---------- */
.site-footer { margin-top: 0; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.site-footer a { color: var(--text-2); }
.footer-social { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 14px 16px; margin-bottom: 6px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.footer-social-copy { display: flex; flex-direction: column; gap: 2px; }
.footer-social-copy b { color: var(--text); font-size: 15px; }
.footer-social-copy span { font-size: 12.5px; }
.footer-social-links { display: flex; flex-wrap: wrap; gap: 8px; }
.site-footer .fs-btn { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: transform .15s ease, border-color .15s ease; }
.site-footer .fs-btn:hover { transform: translateY(-1px); border-color: var(--primary); color: var(--text); }
.fs-ic { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: #fff; }
.fs-ic .icon { width: 17px; height: 17px; }
.fs-btn.fb .fs-ic { background: #1877f2; }
.fs-btn.ig .fs-ic { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.fs-btn.wa .fs-ic { background: #25d366; }
@media (max-width: 639px) {
  .footer-social { flex-direction: column; align-items: stretch; text-align: center; }
  .footer-social-links { justify-content: center; flex-wrap: nowrap; gap: 6px; }
  .site-footer .fs-btn { gap: 6px; padding: 4px 10px 4px 4px; font-size: 13px; }
  .fs-ic { width: 26px; height: 26px; }
  .fs-ic .icon { width: 15px; height: 15px; }
}
.site-disclaimer { width: 100%; margin: 12px 0 0; color: var(--muted); font-size: 12px; }
body.reading .site-footer { display: none; }
@media (max-width: 899px) { .site-footer { padding-bottom: calc(var(--tabbar-h) + 22px + env(safe-area-inset-bottom)); } main { padding-bottom: 32px; } }

/* ===== Student account (js/shell/account.js, js/lib/auth.js) ===== */
.account-btn { display: inline-flex; align-items: center; gap: 6px; height: 40px; min-width: 40px; padding-inline: 12px; margin-inline-start: 4px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.account-btn:hover { background: var(--hover); }
.account-btn .icon { width: 18px; height: 18px; }
.account-btn.signed-in { padding: 0; width: 40px; justify-content: center; overflow: hidden; border-color: var(--primary-2); }
.account-btn.signed-in img { width: 100%; height: 100%; object-fit: cover; }
.account-initial, .account-avatar { display: grid; place-items: center; width: 100%; height: 100%; background: var(--primary); color: #fff; font-weight: 800; }
@media (max-width: 560px) { .account-btn:not(.signed-in) .account-label { display: none; } .account-btn:not(.signed-in) { padding: 0; width: 40px; justify-content: center; } }

.auth-box { display: flex; flex-direction: column; gap: 14px; }
.auth-reason, .auth-sent { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-ink); font-size: 13.5px; line-height: 1.7; }
.auth-reason .icon, .auth-sent .icon { flex: none; margin-top: 3px; }
.auth-google { gap: 10px; border: 1px solid var(--border-strong, var(--border)); background: var(--surface); color: var(--text); font-weight: 700; min-height: 46px; }
.auth-google:hover { background: var(--hover); }
.auth-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-code { font-size: 24px; letter-spacing: .4em; text-align: center; font-weight: 700; }
.auth-note { margin: 0; text-align: center; }
.auth-links { justify-content: space-between; }
.auth-consent { display: flex; align-items: flex-start; gap: 8px; color: var(--text-2); font-size: 12.5px; line-height: 1.6; cursor: pointer; }
.auth-consent input { width: 17px; height: 17px; flex: none; margin-top: 2px; accent-color: var(--primary); }
.auth-consent a { color: var(--primary-ink); text-decoration: underline; text-underline-offset: 2px; }
.auth-consent.is-missing { color: var(--danger-ink); background: var(--danger-soft); border: 1px solid var(--danger); border-radius: 10px; padding: 8px 10px; animation: auth-shake .4s ease; }
.auth-consent.is-missing input { outline: 2px solid var(--danger); outline-offset: 1px; }
.hint.is-error { color: var(--danger-ink); font-weight: 600; }
@keyframes auth-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) { .auth-consent.is-missing { animation: none; } }
.account-data-actions { display: grid; gap: 8px; margin-top: 12px; }
.account-data-actions .btn { justify-content: flex-start; text-align: start; }
.account-data-note { margin: 8px 0 0; line-height: 1.65; }

.account-card { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--surface-2); }
.account-avatar { width: 48px; height: 48px; flex: none; border-radius: 50%; overflow: hidden; font-size: 20px; }
.account-avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-h { font-size: 15px; margin: 16px 0 8px; }


/* ===== The student's own major / college first (js/lib/me.js) ===== */
.lib-mine { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 20px; text-decoration: none; color: #fff;
  background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary-2) 80%, #14b8a6)); box-shadow: 0 16px 30px -18px var(--primary); transition: transform .15s; }
.lib-mine:hover { transform: translateY(-2px); color: #fff; }
.lib-mine-ic { flex: none; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 16px; background: rgb(255 255 255 / .16); }
.lib-mine-ic .icon { width: 26px; height: 26px; }
.lib-mine-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lib-mine-body small { font-size: 12.5px; font-weight: 700; opacity: .85; }
.lib-mine-body b { font-size: 18px; font-weight: 800; line-height: 1.4; }
.lib-mine-body > span { font-size: 12.5px; opacity: .85; display: flex; align-items: center; gap: 6px; }
.lib-mine-body > span i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .6; }
.lib-mine-go { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 8px 12px; border-radius: 12px; background: rgb(255 255 255 / .16); font-size: 13px; font-weight: 700; }
@media (max-width: 520px) { .lib-mine-go { display: none; } }
.lib-major-item.mine { border-color: color-mix(in srgb, var(--primary-2) 45%, var(--border)); }
.lib-mine-tag { display: inline-block; margin-inline-start: 6px; padding: 1px 8px; border-radius: 999px; font-style: normal; font-size: 11px; font-weight: 800; background: var(--primary); color: #fff; vertical-align: 1px; }
.lib-mine-tag.soft { background: var(--primary-soft); color: var(--primary-ink); }
.pl-mine { border-color: color-mix(in srgb, var(--primary-2) 45%, var(--border)); background: var(--primary-soft); }
.ob-intro { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-ink); font-size: 13.5px; line-height: 1.8; }
.ob-intro .icon { flex: none; margin-top: 4px; }
.ob-note { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--surface-2, #f4f6fa); color: var(--muted); font-size: 13px; line-height: 1.8; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); }
.auth-tabs button { border: 0; background: none; padding: 9px 10px; border-radius: 10px; font: inherit; font-weight: 700; font-size: 14px; color: var(--muted); cursor: pointer; }
.auth-tabs button.on { background: var(--surface); color: var(--primary-ink); box-shadow: 0 1px 3px rgb(0 0 0 / .08); }
.auth-pass { position: relative; }
.auth-pass .input { padding-right: 44px; }
.auth-eye { position: absolute; inset-block: 0; right: 4px; margin: auto; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer; }
.auth-eye.on { color: var(--primary-ink); }
.auth-forgot { align-self: flex-start; border: 0; background: none; padding: 0; font: inherit; font-size: 13px; font-weight: 700; color: var(--primary-ink); cursor: pointer; }
.auth-pass-hint { margin: -4px 0 0; }
.auth-alt { align-self: center; }
.account-btns { display: flex; flex-direction: column; gap: 6px; flex: none; }
.cafe-perks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cafe-perks span { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; background: rgb(255 255 255 / .16); border: 1px solid rgb(255 255 255 / .22); color: #fff; font-size: 12.5px; font-weight: 700; backdrop-filter: blur(4px); }
.cafe-perks .icon { width: 14px; height: 14px; }

/* ===== Phone polish (from _v2_tools/mobile-audit.cjs) ===== */
@media (max-width: 639px) {
  /* Breadcrumb links: a finger-sized tap area without changing the look. */
  .crumbs a, .lib-major-crumbs a { display: inline-block; padding-block: 6px; margin-block: -6px; }
  /* Nothing on a phone smaller than 11px. */
  .lib-major-facts small, .lib-specialization-body small, .lib-course-card-body small, .lib-course-card-meta,
  .pl-adv-course-name small, .pl-adv-course .pl-hrs, .stop-date small, .mq-node .mq-start, .lib-top-share-text small { font-size: 11px !important; }
  .lib-top-share-text b { font-size: 11px !important; }
  /* Plan: the "done" circles stay easy to tap. */
  .pt-card .pl-check { width: 26px !important; height: 26px !important; }
  /* Support: the quick questions show their whole text. */
  .cx-suggest .cx-sug small { white-space: normal; overflow: visible; text-overflow: clip; }
  /* Plan tree cards: long course names get a third line instead of "…". */
  .pt-tree .pt-card .pt-main b, .pt-alone .pt-card .pt-main b { -webkit-line-clamp: 3; }
  /* Support header: the assistant's description wraps on narrow phones. */
  .cx-title small { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; line-height: 1.4; }
  /* Slider dots: bigger touch area around the small dot. */
  .hero-dots button, .slider-dots button, [class*="dots"] > button { position: relative; }
  .hero-dots button::after, .slider-dots button::after, [class*="dots"] > button::after { content: ""; position: absolute; inset: -12px -6px; }
}

/* Library: the student's own major, clearer (label, college, stats, a clear button). */
.lib-mine { padding: 20px 22px; gap: 16px; border-radius: 22px; background: linear-gradient(120deg, #1f4e8c, #2b73c7 55%, #14a3a0); box-shadow: 0 18px 36px -20px #2b73c7; }
.lib-mine-ic { width: 58px; height: 58px; border-radius: 18px; background: rgb(255 255 255 / .18); }
.lib-mine-ic .icon { width: 30px; height: 30px; }
.lib-mine-body { gap: 4px; }
.lib-mine-label { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: #fff; color: #1f4e8c; font-style: normal; font-size: 12.5px; font-weight: 800; }
.lib-mine-label .icon { width: 13px; height: 13px; }
.lib-mine-body b { font-size: 21px; line-height: 1.4; }
.lib-mine-body > small { font-size: 13px; opacity: .9; font-weight: 600; }
.lib-mine-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.lib-mine-stats > span { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: rgb(255 255 255 / .16); font-size: 12.5px; font-weight: 700; }
.lib-mine-stats .icon { width: 14px; height: 14px; }
.lib-mine-go { padding: 10px 16px; border-radius: 14px; background: #fff; color: #1f4e8c; font-size: 14px; font-weight: 800; }
@media (max-width: 520px) {
  .lib-mine { flex-wrap: wrap; padding: 16px; }
  .lib-mine-ic { width: 48px; height: 48px; border-radius: 15px; }
  .lib-mine-body b { font-size: 18px; }
  .lib-mine-go { display: inline-flex; width: 100%; justify-content: center; }
}
/* Library end: the numbers and the "share a file" line. */
.lib-end .lib-proof-row { justify-content: center; margin-top: 12px; }
@media (max-width: 639px) { body .slide-body p { -webkit-line-clamp: 4; } }
.brand-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
