/* ==========================================================================
   STUDY FARM — dark forest theme
   ========================================================================== */

:root {
  --bg: #06120c;
  --bg-2: #08180f;
  --surface: #0d2117;
  --surface-2: #112a1d;
  --surface-3: #163524;
  --border: #1c3a29;
  --border-soft: rgba(52, 211, 153, 0.12);
  --text: #eaf6ef;
  --muted: #8fb3a1;
  --muted-2: #6d8f7e;
  --accent: #34d399;
  --accent-2: #a3e635;
  --accent-ink: #032018;
  --danger: #f87171;
  --warn: #fbbf24;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  --nav-h: 64px;
  --font-head: "Sora", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  background: var(--bg);
  /* Android WebView font-boosting band — warna headings clip ho jaate hain */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
}

.app-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 45% at 15% 0%, rgba(52, 211, 153, 0.16), transparent 60%),
    radial-gradient(50% 40% at 90% 5%, rgba(163, 230, 53, 0.1), transparent 65%),
    radial-gradient(80% 60% at 50% 100%, rgba(16, 185, 129, 0.06), transparent 70%),
    var(--bg);
  pointer-events: none;
}

.app-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent 60%);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-head);
  margin: 0;
  letter-spacing: -0.02em;
}

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  font-size: 22px;
  line-height: 1;
  vertical-align: middle;
  user-select: none;
}

.material-symbols-outlined.active,
.active > .material-symbols-outlined {
  font-variation-settings: "FILL" 1;
}

.clamp1,
.clamp2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.clamp1 {
  -webkit-line-clamp: 1;
}
.clamp2 {
  -webkit-line-clamp: 2;
}

.muted {
  color: var(--muted);
}
.small {
  font-size: 12.5px;
}
.spin {
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#app {
  max-width: 1180px;
  margin: 0 auto;
}

.page {
  padding: 16px clamp(14px, 4vw, 28px) 32px;
  animation: fadeUp 0.28s ease both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ============================== boot ============================== */

.boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 14px;
  justify-items: center;
  color: var(--muted);
  font-family: var(--font-head);
  letter-spacing: 0.28em;
  font-size: 12px;
}
.boot-ring {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(52, 211, 153, 0.18);
  border-top-color: var(--accent);
  border-right-color: var(--accent-2);
  animation: spin 0.8s linear infinite;
}

/* ============================== brand ============================== */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand-logo {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(145deg, var(--accent), #0f9d68 60%, var(--accent-2));
  color: #032018;
  box-shadow: 0 6px 18px rgba(52, 211, 153, 0.28);
}
.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.brand-logo .material-symbols-outlined {
  font-size: 24px;
  font-variation-settings: "FILL" 1, "wght" 500;
}
.brand-name {
  font-family: var(--font-head);
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: 15px;
  background: linear-gradient(90deg, var(--text), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ------------------------------ telegram ------------------------------ */

.brandrow-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tg-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: #d7f9ea;
  background: rgba(41, 171, 226, 0.14);
  border: 1px solid rgba(41, 171, 226, 0.32);
  transition: background 0.18s, border-color 0.18s, transform 0.18s;
}
.tg-icon svg {
  width: 19px;
  height: 19px;
  margin-left: -1px;
}
.tg-icon:hover {
  background: rgba(41, 171, 226, 0.24);
  border-color: rgba(41, 171, 226, 0.55);
  transform: translateY(-1px);
}

.tg-cta {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 16px;
  background:
    linear-gradient(120deg, rgba(41, 171, 226, 0.18), rgba(52, 211, 153, 0.12) 55%, transparent),
    var(--surface-2);
  border: 1px solid rgba(41, 171, 226, 0.28);
  box-shadow: 0 10px 30px rgba(4, 20, 14, 0.55);
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}
.tg-cta:hover {
  border-color: rgba(41, 171, 226, 0.55);
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(4, 20, 14, 0.65);
}
.tg-cta-badge {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(160deg, #37bff2, #1f96d6 60%, #177fb8);
  box-shadow: 0 8px 18px rgba(41, 171, 226, 0.4);
}
.tg-cta-badge svg {
  width: 21px;
  height: 21px;
  margin-left: -1px;
}
.tg-cta-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.tg-cta-title {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  color: #eafcf5;
}
.tg-cta-sub {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.35;
}
.tg-cta-go {
  margin-left: auto;
  color: #7fd6f7;
  display: grid;
  place-items: center;
}
.tg-cta-go .material-symbols-outlined {
  font-size: 20px;
  transition: transform 0.18s;
}
.tg-cta:hover .tg-cta-go .material-symbols-outlined {
  transform: translateX(3px);
}

/* ============================== topbar ============================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 12px;
  background: linear-gradient(to bottom, rgba(6, 18, 12, 0.96), rgba(6, 18, 12, 0.72) 70%, transparent);
  backdrop-filter: blur(14px);
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.topbar-titles {
  min-width: 0;
}
.topbar-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.25;
}
.topbar-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}
.topbar-right {
  display: flex;
  gap: 6px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-grid;
  place-items: center;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-soft);
  transition: background 0.15s, transform 0.15s;
  flex: none;
}
.icon-btn:hover {
  background: rgba(52, 211, 153, 0.12);
}
.icon-btn:active {
  transform: scale(0.94);
}
.icon-btn.active {
  color: var(--accent);
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.12);
}

/* ============================== home ============================== */

.home-head {
  padding: 8px 0 4px;
}
.home-brandrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
}
.home-title {
  font-size: clamp(26px, 7vw, 40px);
  font-weight: 800;
  line-height: 1.18;
  padding-bottom: 4px;
  color: #f4fdf8;
  text-shadow: 0 0 26px rgba(52, 211, 153, 0.28);
}
.home-title em {
  font-style: normal;
  color: var(--accent);
}
.home-sub {
  color: var(--muted);
  font-size: 13.5px;
  margin: 10px 0 18px;
  max-width: 46ch;
}

.searchbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: 50px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.searchbar:focus-within {
  border-color: rgba(52, 211, 153, 0.5);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.08);
}
.searchbar > .material-symbols-outlined {
  color: var(--muted);
}
.searchbar input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  color: var(--text);
  font-size: 15px;
  height: 100%;
}
.searchbar input::placeholder {
  color: var(--muted-2);
}
.searchbar input::-webkit-search-cancel-button,
.searchbar input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}
.search-clear {
  color: var(--muted);
  display: grid;
  place-items: center;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px 0 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar {
  display: none;
}
.chip {
  flex: none;
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all 0.15s;
  white-space: nowrap;
}
.chip:hover {
  color: var(--text);
  border-color: var(--surface-3);
}
.chip.active {
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(52, 211, 153, 0.25);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 26px 0 14px;
}
.section-head h2 {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
}
.count {
  font-size: 12px;
  color: var(--muted);
}

/* ============================== grids & cards ============================== */

.grid {
  display: grid;
  gap: 14px;
}
.grid-batches {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.grid-lectures {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.grid-subjects {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
  position: relative;
}
.card:hover {
  transform: translateY(-3px);
  border-color: rgba(52, 211, 153, 0.35);
  box-shadow: var(--shadow);
}

.card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface-3);
  overflow: hidden;
}
.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s;
}
.card:hover .card-img {
  transform: scale(1.04);
}
.card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(4, 12, 8, 0.75), transparent 55%);
  pointer-events: none;
}

.card-body {
  padding: 12px 14px 14px;
}
.card-title {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.35;
}
.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 11.5px;
}

/* cards in a grid ek jaisi height ke hote hain — meta ko neeche pin karte hain */
.batch-card,
.lecture-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.batch-card .card-body,
.lecture-card .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.batch-card .card-meta,
.lecture-card .card-meta {
  margin-top: auto;
  padding-top: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-soft);
  white-space: nowrap;
}
.pill .material-symbols-outlined {
  font-size: 14px;
}
.pill-free {
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
}

.badge-free {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 9px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  z-index: 2;
}
.badge-class {
  position: absolute;
  bottom: 10px;
  left: 10px;
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 700;
  color: #d9f8e7;
  background: rgba(3, 20, 14, 0.75);
  border: 1px solid rgba(52, 211, 153, 0.3);
  backdrop-filter: blur(6px);
  z-index: 2;
}

.save-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #e9fbf2;
  background: rgba(4, 16, 11, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  transition: all 0.15s;
}
.save-btn:hover {
  background: rgba(4, 16, 11, 0.8);
}
.save-btn.active {
  color: var(--accent);
  border-color: rgba(52, 211, 153, 0.5);
}
.save-btn .material-symbols-outlined {
  font-size: 19px;
}

.img-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted-2);
  background: linear-gradient(135deg, var(--surface-3), var(--surface));
}
.img-fallback .material-symbols-outlined {
  font-size: 30px;
}

.play-badge {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #04231a;
  background: rgba(52, 211, 153, 0.94);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  z-index: 2;
  transition: transform 0.18s;
}
.lecture-card:hover .play-badge {
  transform: scale(1.1);
}
.duration {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(3, 14, 9, 0.8);
  color: #e8fff4;
}

/* ============================== subjects ============================== */

.subject-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
}
.subject-thumb {
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-3);
}
.subject-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.subject-info {
  flex: 1;
  min-width: 0;
}
.subject-info h3 {
  font-size: 14.5px;
  font-weight: 700;
}
.subject-info p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.chev {
  color: var(--muted-2);
}

/* ============================== lists ============================== */

.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.row:hover {
  border-color: rgba(52, 211, 153, 0.35);
  background: var(--surface-2);
}
.row:active {
  transform: scale(0.995);
}
.row-icon {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.18);
}
.row-icon.doc {
  color: var(--accent-2);
  background: rgba(163, 230, 53, 0.1);
  border-color: rgba(163, 230, 53, 0.18);
}
.row-main {
  flex: 1;
  min-width: 0;
}
.row-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
}
.row-sub {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted);
  flex-wrap: wrap;
}
.row-sub .material-symbols-outlined {
  font-size: 14px;
  margin-right: 2px;
}
.doc-row {
  cursor: pointer;
}
.doc-row.loading {
  opacity: 0.6;
  pointer-events: none;
}

.saved-thumb {
  width: 56px;
  height: 42px;
  flex: none;
  border-radius: 9px;
  overflow: hidden;
  background: var(--surface-3);
}
.saved-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================== batch hero ============================== */

.batch-hero {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 6px;
}
.batch-hero-bg {
  position: absolute;
  inset: -20%;
  background-size: cover;
  background-position: center;
  filter: blur(26px) saturate(1.1) brightness(0.5);
  transform: scale(1.1);
}
.batch-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(6, 18, 12, 0.92), rgba(6, 18, 12, 0.62));
}
.batch-hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 16px;
  padding: 18px;
  align-items: center;
}
.batch-poster {
  width: 96px;
  height: 96px;
  flex: none;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface-3);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.batch-poster-empty {
  display: grid;
  place-items: center;
  color: var(--accent);
  background: linear-gradient(145deg, rgba(52, 211, 153, 0.16), rgba(163, 230, 53, 0.06));
  border-color: rgba(52, 211, 153, 0.25);
}
.batch-poster-empty .material-symbols-outlined {
  font-size: 34px;
}
.batch-hero-text h1 {
  font-size: clamp(17px, 4.6vw, 24px);
  font-weight: 800;
  line-height: 1.2;
}
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 8px;
}

.crumb {
  margin: 2px 0 10px;
}
.crumb a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-soft);
}
.crumb a:hover {
  color: var(--accent);
}

/* ============================== tabs ============================== */

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 0 10px;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar {
  display: none;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  white-space: nowrap;
  transition: all 0.15s;
}
.tab .material-symbols-outlined {
  font-size: 18px;
}
.tab.active {
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  font-weight: 700;
}

/* ============================== player ============================== */

.watch-page {
  padding-bottom: 24px;
}
.player-shell {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
  box-shadow: var(--shadow);
}
.player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  display: grid;
  place-items: center;
}
.video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}
.yt-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
  z-index: 3;
}
.player-state {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  background: radial-gradient(60% 60% at 50% 50%, rgba(13, 33, 23, 0.95), #04100a);
}
.player-state.media-only {
  display: block;
  padding: 0;
  background: #000;
}
.player-state .material-symbols-outlined {
  font-size: 34px;
  color: var(--accent);
}
.player-error h3 {
  color: var(--text);
  font-size: 15px;
  margin: 6px 0;
}
.player-error p {
  font-size: 12.5px;
  max-width: 44ch;
  margin: 0 auto 12px;
  color: var(--muted);
}
.player-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface);
}

/* ============================== buttons ============================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text);
  transition: all 0.15s;
}
.btn:hover {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.35);
}
.btn-primary {
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  font-weight: 700;
}
.btn.sm {
  padding: 7px 12px;
  font-size: 12px;
}
.btn .material-symbols-outlined {
  font-size: 18px;
}

.loadmore {
  display: flex;
  justify-content: center;
  padding: 22px 0 8px;
}
.loadmore[hidden] {
  display: none;
}

.sentinel {
  height: 8px;
}

/* ============================== empty / error / skeleton ============================== */

.empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
  padding: 54px 20px;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  background: rgba(255, 255, 255, 0.015);
}
.empty h3 {
  font-size: 15.5px;
}
.empty p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  max-width: 42ch;
}
.empty-icon {
  font-size: 38px !important;
  color: var(--muted-2);
  margin-bottom: 6px;
}
.empty.error .empty-icon {
  color: var(--danger);
}
.empty .btn {
  margin-top: 12px;
}

.sk {
  pointer-events: none;
}
.sk-img {
  aspect-ratio: 16 / 9;
  background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.sk-line {
  height: 10px;
  border-radius: 6px;
  margin-top: 8px;
  background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.sk-line.w70 {
  width: 70%;
}
.sk-line.w50 {
  width: 50%;
}
.sk-line.w40 {
  width: 40%;
}
.sk-line.w30 {
  width: 30%;
}
.sk-row {
  pointer-events: none;
}
.sk-avatar {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--surface-3);
  flex: none;
}
@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ============================== modal ============================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 8, 5, 0.72);
  backdrop-filter: blur(10px);
  animation: fade 0.18s ease both;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
.modal {
  width: min(460px, 100%);
  border-radius: 18px;
  padding: 18px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 15px;
  min-width: 0;
}
.modal-actions {
  display: flex;
  gap: 6px;
}
.modal-text {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0 0 14px;
}
.cf-slot {
  min-height: 70px;
  display: grid;
  place-items: center;
}
.cf-error {
  font-size: 12px;
  color: var(--warn);
  text-align: center;
  margin: 8px 0 0;
}
.token-fallback {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.link-btn {
  font-size: 12px;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
#paste-box {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}
#token-input {
  width: 100%;
  border-radius: 10px;
  padding: 10px;
  font-size: 12px;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--border);
  resize: vertical;
}

.modal-pdf {
  width: min(1000px, 100%);
  height: min(88dvh, 900px);
  padding: 12px;
  display: flex;
  flex-direction: column;
}
.pdf-backdrop {
  padding: 8px;
}
.pdf-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border-radius: 12px;
  background: #0a1710;
  border: 1px solid var(--border);
  scrollbar-width: thin;
}
.pdf-meta {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px 12px;
  font-size: 11.5px;
  color: var(--muted);
  background: rgba(10, 23, 16, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.pdf-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 12px;
}
.pdf-page {
  position: relative;
  max-width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  min-width: 40%;
}
.pdf-page canvas {
  display: block;
  max-width: 100%;
  height: auto !important;
}
.pdf-page-num {
  position: absolute;
  top: 6px;
  right: 8px;
  z-index: 2;
  font-size: 10px;
  font-weight: 700;
  color: #0d2117;
  background: rgba(52, 211, 153, 0.85);
  border-radius: 999px;
  padding: 1px 7px;
}
.pdf-status {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 48px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}
.pdf-status .material-symbols-outlined {
  font-size: 30px;
  color: var(--accent);
}
.pdf-status.error .material-symbols-outlined {
  color: var(--danger);
}
.pdf-status p {
  margin: 0;
  max-width: 40ch;
}

/* ============================== toasts ============================== */

#toasts {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: min(440px, calc(100vw - 28px));
}
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 13px;
  color: var(--text);
  background: rgba(13, 33, 23, 0.96);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s, transform 0.2s;
  backdrop-filter: blur(10px);
}
.toast.show {
  opacity: 1;
  transform: none;
}
.toast .material-symbols-outlined {
  font-size: 18px;
  color: var(--accent);
}
.toast-error .material-symbols-outlined {
  color: var(--danger);
}

/* ============================== bottom nav ============================== */

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  background: rgba(7, 20, 13, 0.92);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(16px);
}
.bottom-nav a {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted-2);
  transition: color 0.15s;
}
.bottom-nav a.active {
  color: var(--accent);
}
.bottom-nav .material-symbols-outlined {
  font-size: 23px;
}

/* ============================== responsive ============================== */

@media (min-width: 720px) {
  .bottom-nav {
    display: none;
  }
  body {
    padding-bottom: 24px;
  }
  #toasts {
    bottom: 24px;
  }
  .grid-batches {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

@media (max-width: 420px) {
  .grid-batches {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .grid-lectures {
    grid-template-columns: 1fr;
  }
  .card-body {
    padding: 10px 11px 12px;
  }
  .card-title {
    font-size: 12.8px;
  }
  .batch-poster {
    width: 74px;
    height: 74px;
  }
}
