/* Manjot AI — one stylesheet for the whole site.
 * Light and fast: no web fonts, no images (the grid background is pure CSS), only short CSS transitions.
 * Written to work in Safari (incl. older iPhones), Chrome, Edge and Firefox. */
:root {
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-soft: #eef2ff;
  --primary-line: #c7d2fe;
  --ok: #15803d;
  --ok-soft: #dcfce7;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-lg: 0 12px 32px -8px rgba(15, 23, 42, .12), 0 4px 12px -4px rgba(15, 23, 42, .06);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.2; letter-spacing: -.015em; color: var(--text); }
h1 { font-size: 2rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hidden, [hidden] { display: none !important; }
.container { max-width: 1140px; margin: 0 auto; padding: 0 16px; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- icons (from /icons.svg) ---------- */
.icon { width: 1.15em; height: 1.15em; flex: 0 0 auto; display: inline-block; vertical-align: -.2em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 1em; height: 1em; }
.icon.lg { width: 1.5em; height: 1.5em; }
.ico-tile { width: 44px; height: 44px; border-radius: 12px; display: -webkit-inline-box; display: inline-flex; align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary); -webkit-flex-shrink: 0; flex-shrink: 0; }
.ico-tile .icon { width: 22px; height: 22px; }
.ico-tile.sm { width: 34px; height: 34px; border-radius: 9px; }
.ico-tile.sm .icon { width: 17px; height: 17px; }
.t-indigo { background: #eef2ff; color: #4f46e5; }
.t-emerald { background: #ecfdf5; color: #059669; }
.t-amber { background: #fffbeb; color: #d97706; }
.t-rose { background: #fff1f2; color: #e11d48; }
.t-sky { background: #f0f9ff; color: #0284c7; }
.t-violet { background: #f5f3ff; color: #7c3aed; }

/* ---------- buttons & form controls ---------- */
.btn {
  display: -webkit-inline-box; display: inline-flex; align-items: center; justify-content: center;
  padding: .62rem 1.1rem; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--text);
  font: inherit; font-weight: 600; font-size: .94rem; line-height: 1.2; text-decoration: none; cursor: pointer; white-space: nowrap;
  -webkit-transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, -webkit-transform .1s;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s;
  -webkit-tap-highlight-color: transparent; -webkit-appearance: none; appearance: none;
}
.btn .icon { margin-right: .45rem; }
.btn .icon.after { margin-right: 0; margin-left: .45rem; }
.btn-icon .icon, .cbtn .icon { margin: 0; }
.btn:hover { background: var(--bg-soft); border-color: var(--line-2); text-decoration: none; }
.btn:active { -webkit-transform: scale(.98); transform: scale(.98); }
.btn:disabled { opacity: .6; cursor: not-allowed; -webkit-transform: none; transform: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(79, 70, 229, .25), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-danger { color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: var(--danger-soft); border-color: #fca5a5; }
.btn-ok { color: var(--ok); border-color: #bbf7d0; }
.btn-ok:hover { background: var(--ok-soft); border-color: #86efac; }
.btn-sm { padding: .38rem .7rem; font-size: .84rem; border-radius: 8px; }
.btn-lg { padding: .8rem 1.4rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon { padding: .38rem; }
.link { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; display: -webkit-inline-box; display: inline-flex; align-items: center; }
.link .icon { margin-right: .35rem; }
.link:hover { text-decoration: underline; }

.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .35rem; color: var(--text-2); }
.input, .select, .textarea {
  width: 100%; padding: .65rem .8rem; border: 1px solid var(--line-2); border-radius: 10px; background: #fff;
  font: inherit; font-size: 16px; color: var(--text); -webkit-appearance: none; appearance: none;
  -webkit-transition: border-color .15s, box-shadow .15s; transition: border-color .15s, box-shadow .15s;
}
.select { padding-right: 2.2rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .8rem center; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .15); }
.input::-webkit-input-placeholder, .textarea::-webkit-input-placeholder { color: #94a3b8; }
.input::placeholder, .textarea::placeholder { color: #94a3b8; }
.textarea { min-height: 90px; resize: vertical; }
.textarea.tall { min-height: 180px; }
.hint { display: block; color: var(--muted); font-size: .8rem; margin-top: .3rem; }
.check { display: -webkit-box; display: flex; align-items: flex-start; font-size: .9rem; margin-bottom: 1rem; cursor: pointer; color: var(--text-2); }
.check input { margin: .28rem .55rem 0 0; width: 16px; height: 16px; accent-color: var(--primary); -webkit-flex-shrink: 0; flex-shrink: 0; }
.form-error { display: -webkit-box; display: flex; align-items: flex-start; color: var(--danger); background: var(--danger-soft); border-radius: 8px; padding: .55rem .75rem; font-size: .88rem; margin: 0 0 .9rem; -webkit-animation: pop .2s var(--ease); animation: pop .2s var(--ease); }
.form-error:empty { display: none; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; grid-column-gap: 1rem; column-gap: 1rem; }

/* ---------- cards, badges, bars ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; }
.card + .card { margin-top: 1rem; }
.card.narrow { max-width: 460px; margin: 0 auto; }
.card-head { display: -webkit-box; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: .8rem; }
.card-head h3 { margin: 0 .75rem 0 0; display: -webkit-box; display: flex; align-items: center; }
.card-head h3 .icon { margin-right: .5rem; color: var(--primary); }

.badge { display: -webkit-inline-box; display: inline-flex; align-items: center; padding: .14rem .6rem; border-radius: 999px; font-size: .74rem; font-weight: 600; background: #f1f5f9; color: #334155; white-space: nowrap; line-height: 1.5; }
.badge .icon { width: 12px; height: 12px; margin-right: .25rem; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.blue { background: var(--primary-soft); color: var(--primary); }

.bar { height: 8px; background: #e2e8f0; border-radius: 999px; overflow: hidden; min-width: 60px; }
.bar > i { display: block; height: 100%; background: var(--primary); border-radius: 999px; -webkit-transition: width .6s var(--ease); transition: width .6s var(--ease); }
.bar.done > i { background: #16a34a; }
.pct { display: -webkit-box; display: flex; align-items: center; }
.pct .bar { -webkit-box-flex: 1; flex: 1; }
.pct span { font-size: .8rem; color: var(--muted); min-width: 3.4em; text-align: right; margin-left: .5rem; font-variant-numeric: tabular-nums; }

.notice { display: -webkit-box; display: flex; align-items: flex-start; padding: .8rem 1rem; border-radius: 10px; background: var(--warn-soft); color: #78350f; margin-bottom: 1rem; font-size: .92rem; border: 1px solid #fde68a; }
.notice.info { background: var(--primary-soft); color: #312e81; border-color: var(--primary-line); }
.notice .icon { margin: .15rem .6rem 0 0; }

.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty .ico-tile { width: 56px; height: 56px; border-radius: 16px; margin-bottom: .8rem; }
.empty .ico-tile .icon { width: 26px; height: 26px; }
.empty h3 { color: var(--text); }
.spinner { width: 28px; height: 28px; border: 3px solid #e2e8f0; border-top-color: var(--primary); border-radius: 50%; -webkit-animation: spin .8s linear infinite; animation: spin .8s linear infinite; margin: 2.5rem auto; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th, .tbl td { padding: .7rem .85rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th { background: var(--bg-soft); font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); white-space: nowrap; font-weight: 600; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td small { display: block; color: var(--muted); font-size: .8rem; }
.tbl tbody tr { -webkit-transition: background-color .12s; transition: background-color .12s; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #f8faff; }
.tbl td.actions { white-space: nowrap; text-align: right; }
.tbl td.actions .btn { margin-left: .3rem; }

/* ---------- toasts & modal ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: -webkit-box; display: flex; -webkit-box-orient: vertical; flex-direction: column; align-items: flex-end; max-width: calc(100% - 32px); }
.toast { background: #0f172a; color: #fff; padding: .7rem 1rem; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: .92rem; margin-top: .5rem; -webkit-animation: toastIn .25s var(--ease); animation: toastIn .25s var(--ease); }
.toast.err { background: var(--danger); }
.toast.ok { background: #15803d; }

.modal-back { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(15, 23, 42, .45); z-index: 90; display: -webkit-box; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; -webkit-animation: fadeIn .15s ease-out; animation: fadeIn .15s ease-out; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 520px; padding: 1.35rem; box-shadow: 0 24px 60px -12px rgba(15, 23, 42, .35); -webkit-animation: modalIn .2s var(--ease); animation: modalIn .2s var(--ease); }
.modal.wide { max-width: 720px; }
.modal-head { display: -webkit-box; display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.modal-head h3 { margin: 0 1rem 0 0; }
.modal-x { background: none; border: 0; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--muted); padding: .1rem .4rem; border-radius: 8px; }
.modal-x:hover { background: #f1f5f9; color: var(--text); }
.modal-foot { display: -webkit-box; display: flex; justify-content: flex-end; flex-wrap: wrap; margin-top: 1rem; }
.modal-foot .btn { margin-left: .5rem; }
body.no-scroll { overflow: hidden; }

/* ---------- top bar ---------- */
.topbar { background: rgba(255, 255, 255, .92); border-bottom: 1px solid var(--line); position: -webkit-sticky; position: sticky; top: 0; z-index: 20; }
@supports ((-webkit-backdrop-filter: blur(8px)) or (backdrop-filter: blur(8px))) {
  .topbar { background: rgba(255, 255, 255, .8); -webkit-backdrop-filter: saturate(180%) blur(10px); backdrop-filter: saturate(180%) blur(10px); }
}
.topbar .container { display: -webkit-box; display: flex; align-items: center; min-height: 62px; }
.topbar .container > * + * { margin-left: .75rem; }
.brand { -webkit-flex-shrink: 0; flex-shrink: 0; white-space: nowrap; display: -webkit-box; display: flex; align-items: center; font-weight: 800; font-size: 1.1rem; color: var(--text); text-decoration: none; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; margin-right: .55rem; border-radius: 8px; }
.topbar .spacer { -webkit-box-flex: 1; flex: 1; }
.topbar .who { font-size: .9rem; color: var(--muted); display: -webkit-box; display: flex; align-items: center; }
.topbar .who .icon { margin-right: .35rem; }
.nav-links { display: -webkit-box; display: flex; align-items: center; }
.nav-links a { color: var(--text-2); font-weight: 500; font-size: .93rem; padding: .4rem .7rem; border-radius: 8px; -webkit-transition: background-color .15s, color .15s; transition: background-color .15s, color .15s; }
.nav-links a:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }

/* ---------- homepage ---------- */
.grid-bg {
  position: relative; overflow: hidden;
  background-color: #fff;
  background-image:
    radial-gradient(ellipse 80% 60% at 70% 0%, rgba(99, 102, 241, .10), rgba(255, 255, 255, 0) 60%),
    radial-gradient(ellipse 60% 50% at 0% 30%, rgba(14, 165, 233, .07), rgba(255, 255, 255, 0) 60%),
    linear-gradient(to right, rgba(15, 23, 42, .045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, .045) 1px, transparent 1px);
  background-size: auto, auto, 40px 40px, 40px 40px;
}
.grid-bg::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 120px; background: -webkit-linear-gradient(top, rgba(255, 255, 255, 0), #fff); background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff); pointer-events: none; }
.hero { padding: 4rem 0 3.5rem; }
.hero .container { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-column-gap: 3rem; column-gap: 3rem; align-items: start; }
.hero h1 { font-size: 3rem; line-height: 1.08; letter-spacing: -.035em; margin: 1rem 0 1rem; }
.hero .accent { color: var(--primary); }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero .accent { background: -webkit-linear-gradient(left, #4f46e5, #0ea5e9); background: linear-gradient(90deg, #4f46e5, #0ea5e9); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
}
.hero .lead { font-size: 1.15rem; color: var(--text-2); max-width: 36rem; }
.pill { display: -webkit-inline-box; display: inline-flex; align-items: center; padding: .3rem .8rem .3rem .4rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); font-size: .82rem; font-weight: 600; color: var(--text-2); }
.pill .dot { display: -webkit-inline-box; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); margin-right: .45rem; }
.pill .dot .icon { width: 13px; height: 13px; }
.ticks { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; grid-template-columns: 1fr 1fr; grid-gap: .6rem 1rem; gap: .6rem 1rem; }
.ticks li { display: -webkit-box; display: flex; align-items: flex-start; color: var(--text-2); font-size: .96rem; }
.ticks .icon { color: #16a34a; margin: .2rem .5rem 0 0; width: 18px; height: 18px; }
.hero-points { display: -webkit-box; display: flex; flex-wrap: wrap; margin-top: 1.75rem; }
.hero-point { display: -webkit-box; display: flex; align-items: center; margin: 0 1.25rem .6rem 0; font-size: .9rem; color: var(--text-2); font-weight: 500; }
.hero-point .ico-tile { margin-right: .55rem; }
.auth-card { box-shadow: var(--shadow-lg); border-radius: 18px; padding: 1.5rem; }
.auth-card h2 { font-size: 1.25rem; }
.tabs { position: relative; display: -webkit-box; display: flex; background: #f1f5f9; border-radius: 12px; padding: 4px; margin-bottom: 1.25rem; }
.tabs button { -webkit-box-flex: 1; flex: 1; border: 0; background: none; padding: .55rem; border-radius: 9px; font: inherit; font-weight: 600; font-size: .93rem; color: var(--muted); cursor: pointer; -webkit-transition: background-color .2s, color .2s, box-shadow .2s; transition: background-color .2s, color .2s, box-shadow .2s; }
.tabs button:hover { color: var(--text); }
.tabs button.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(15, 23, 42, .1); }
.form-pane { -webkit-animation: fadeUp .25s var(--ease); animation: fadeUp .25s var(--ease); }
.section { padding: 4.5rem 0; }
.section.soft { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 2.5rem; }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); margin-bottom: .6rem; }
.section-head h2 { font-size: 2rem; letter-spacing: -.025em; }
.section-head p { color: var(--muted); margin: 0; font-size: 1.05rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-gap: 1.1rem; gap: 1.1rem; }
.feature { -webkit-transition: border-color .2s, box-shadow .25s var(--ease), -webkit-transform .25s var(--ease); transition: border-color .2s, box-shadow .25s var(--ease), transform .25s var(--ease); }
.feature:hover { -webkit-transform: translateY(-3px); transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--primary-line); }
.feature .ico-tile { margin-bottom: 1rem; }
.feature h3 { font-size: 1.05rem; margin-bottom: .35rem; }
.feature p { margin: 0; color: var(--muted); font-size: .95rem; }
.steps { counter-reset: step; position: relative; }
.step { position: relative; text-align: center; padding: 1.5rem 1.25rem; }
.step-num { position: relative; z-index: 1; width: 56px; height: 56px; margin: 0 auto 1rem; border-radius: 50%; background: #fff; border: 1px solid var(--primary-line); color: var(--primary); display: -webkit-box; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 6px var(--primary-soft); }
.step-num .icon { width: 24px; height: 24px; }
.step-num b { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; font-size: .75rem; display: -webkit-box; display: flex; align-items: center; justify-content: center; }
.step p { color: var(--muted); margin: 0; font-size: .95rem; }
.steps-line { position: absolute; top: 52px; left: 17%; right: 17%; border-top: 2px dashed var(--primary-line); }
.faq { max-width: 760px; margin: 0 auto; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: .65rem; -webkit-transition: border-color .2s, box-shadow .2s; transition: border-color .2s, box-shadow .2s; }
.faq details[open] { border-color: var(--primary-line); box-shadow: var(--shadow); }
.faq summary { list-style: none; display: -webkit-box; display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.15rem; font-weight: 600; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::marker { content: ""; }
.faq summary .icon { color: var(--muted); -webkit-transition: -webkit-transform .2s var(--ease); transition: transform .2s var(--ease); margin-left: 1rem; }
.faq details[open] summary .icon { -webkit-transform: rotate(180deg); transform: rotate(180deg); color: var(--primary); }
.faq details p { margin: 0; padding: 0 1.15rem 1.1rem; color: var(--text-2); -webkit-animation: fadeUp .25s var(--ease); animation: fadeUp .25s var(--ease); }
.cta { text-align: center; padding: 3rem 1.5rem; border-radius: 20px; color: #fff; background-color: #4338ca; background-image: radial-gradient(circle at 20% 0%, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0) 45%), linear-gradient(135deg, #4f46e5, #4338ca 55%, #3730a3); }
.cta h2 { color: #fff; font-size: 1.8rem; }
.cta p { color: #e0e7ff; margin-bottom: 1.5rem; }
.cta .btn { background: #fff; color: var(--primary-dark); border-color: #fff; }
.cta .btn:hover { background: #eef2ff; }
.footer { border-top: 1px solid var(--line); padding: 2rem 0; color: var(--muted); font-size: .9rem; background: #fff; }
.footer .container { display: -webkit-box; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.footer p { margin: .25rem 0; }
.footer .contact a { display: -webkit-inline-box; display: inline-flex; align-items: center; color: var(--text-2); margin-right: 1.25rem; }
.footer .contact .icon { margin-right: .4rem; color: var(--primary); }
.status-card { text-align: center; padding: .5rem 0; -webkit-animation: fadeUp .3s var(--ease); animation: fadeUp .3s var(--ease); }
.status-card .ico-tile { width: 60px; height: 60px; border-radius: 18px; margin-bottom: 1rem; }
.status-card .ico-tile .icon { width: 28px; height: 28px; }
.status-card .btn-row { justify-content: center; }
.center-page { min-height: 100vh; display: -webkit-box; display: flex; align-items: center; justify-content: center; padding: 16px; }

/* ---------- student course page ---------- */
.page-soft { background-color: var(--bg-soft); background-image: linear-gradient(to bottom, #fff, rgba(248, 250, 252, 0) 260px); background-repeat: no-repeat; min-height: 100vh; }
.course-tabs { display: -webkit-box; display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.course-tabs button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: .38rem .95rem; margin-right: .4rem; font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; color: var(--muted); white-space: nowrap; -webkit-transition: all .15s; transition: all .15s; }
.course-tabs button:hover { color: var(--text); border-color: var(--line-2); }
.course-tabs button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.learn { display: grid; grid-template-columns: minmax(0, 1fr) 360px; grid-gap: 1.5rem; gap: 1.5rem; padding: 1.5rem 0 2.5rem; align-items: start; }
.lecture-info { margin-top: 1.1rem; -webkit-animation: fadeUp .3s var(--ease); animation: fadeUp .3s var(--ease); }
.lecture-info h2 { margin-bottom: .4rem; font-size: 1.5rem; }
.lec-meta { display: -webkit-box; display: flex; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: .88rem; margin: 0 0 .3rem; }
.lec-meta .icon { margin-right: .3rem; }
.lecture-nav { display: -webkit-box; display: flex; justify-content: space-between; flex-wrap: wrap; margin: 1.1rem 0; }
.lecture-nav .btn + .btn { margin-left: auto; }
.desc { white-space: pre-line; color: var(--text-2); }
.lectures { position: -webkit-sticky; position: sticky; top: 80px; max-height: calc(100vh - 96px); display: -webkit-box; display: flex; -webkit-box-orient: vertical; flex-direction: column; padding: 0; overflow: hidden; }
.lectures-head { padding: 1.1rem 1.1rem .85rem; border-bottom: 1px solid var(--line); }
.lectures-head h3 { display: -webkit-box; display: flex; align-items: center; margin-bottom: .6rem; }
.lectures-head h3 .ico-tile { margin-right: .6rem; }
.lecture-list { list-style: none; margin: 0; padding: .45rem; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.lecture-list button { position: relative; width: 100%; display: -webkit-box; display: flex; align-items: flex-start; text-align: left; background: none; border: 0; border-radius: 10px; padding: .65rem; font: inherit; cursor: pointer; color: var(--text); -webkit-transition: background-color .15s; transition: background-color .15s; }
.lecture-list button:hover { background: var(--bg-soft); }
.lecture-list button.current { background: var(--primary-soft); }
.lecture-list button.current::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--primary); }
.lecture-list button.locked { opacity: .55; cursor: not-allowed; }
.lecture-list .num { -webkit-box-flex: 0; flex: 0 0 28px; width: 28px; height: 28px; margin-right: .7rem; border-radius: 50%; background: #f1f5f9; display: -webkit-box; display: flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 700; color: var(--muted); }
.lecture-list .num .icon { width: 14px; height: 14px; }
.lecture-list .current .num { background: var(--primary); color: #fff; }
.lecture-list .done .num { background: #16a34a; color: #fff; }
.lecture-list .t { -webkit-box-flex: 1; flex: 1; min-width: 0; }
.lecture-list .t b { display: block; font-weight: 600; font-size: .92rem; line-height: 1.35; }
.lecture-list .t small { display: -webkit-box; display: flex; align-items: center; color: var(--muted); font-size: .78rem; margin-top: .1rem; }
.lecture-list .t small .icon { width: 12px; height: 12px; margin-right: .25rem; }
.lecture-list .bar { margin-top: .4rem; height: 4px; }
.resources { list-style: none; padding: 0; margin: 0; }
.resources li { border: 1px solid var(--line); border-radius: 12px; padding: .75rem .85rem; margin-bottom: .55rem; -webkit-transition: border-color .15s, background-color .15s; transition: border-color .15s, background-color .15s; }
.resources li:hover { border-color: var(--primary-line); background: #fcfcff; }
.resources .r-head { display: -webkit-box; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.resources .r-title { display: -webkit-box; display: flex; align-items: center; font-weight: 600; margin: .15rem .75rem .15rem 0; }
.resources .r-title .ico-tile { margin-right: .65rem; }
.resources .r-actions .btn { margin: .15rem 0 .15rem .35rem; }
.file-preview { margin-top: .65rem; }
.file-preview .fp-head { display: -webkit-box; display: flex; align-items: center; justify-content: space-between; margin-bottom: .4rem; }
.code-view { margin: 0; white-space: pre; overflow: auto; max-height: 420px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: .75rem; font-size: .8rem; line-height: 1.5; font-family: var(--mono); color: var(--text-2); -webkit-overflow-scrolling: touch; tab-size: 2; }
.file-preview.media video { width: 100%; max-height: 70vh; border-radius: 10px; background: #000; display: block; }
.file-preview.media audio { width: 100%; display: block; }
.prompt-text { white-space: pre-wrap; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: .75rem; font-size: .85rem; margin-top: .65rem; max-height: 220px; overflow: auto; font-family: var(--mono); color: var(--text-2); }

/* ---------- video player ----------
 * Normal view: video on top, control bar underneath (never covering the picture).
 * Full screen: only the video; the controls float over the bottom and fade out while it plays. */
.player { position: relative; z-index: 5; background: #000; border-radius: var(--radius); box-shadow: var(--shadow-lg); outline: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.player-box { position: relative; width: 100%; max-width: calc(75vh * var(--ar, 1.7778)); margin: 0 auto; aspect-ratio: var(--ar, 1.7778); background: #000; overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; -webkit-transform: translateZ(0); transform: translateZ(0); }
@supports not (aspect-ratio: 1) {
  .player-box { height: 0; padding-top: 56.25%; padding-top: var(--pad, 56.25%); }
}
/* The YouTube frame is taller than the box: the video fits the width exactly (the box has the video's own shape),
 * and YouTube's title bar and buttons fall outside the visible area. */
.player-box iframe, .player-box > #player { position: absolute; left: 0; top: -25%; width: 100%; height: 150%; border: 0; pointer-events: none; }
.player.ios-first iframe { pointer-events: auto; }
.shield { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 2; cursor: pointer; background: transparent; }
.player.ios-first .shield { display: none; }
.player.ios-first .cover { pointer-events: none; }
.cover { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 3; display: -webkit-box; display: flex; align-items: center; justify-content: center; background: #000 center / cover no-repeat; cursor: pointer; }
.cover::before { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: rgba(15, 23, 42, .25); }
.cover.paused { background: -webkit-linear-gradient(top, rgba(0,0,0,.85), rgba(0,0,0,0) 30%, rgba(0,0,0,0) 75%, rgba(0,0,0,.6)) !important; background: linear-gradient(to bottom, rgba(0,0,0,.85), rgba(0,0,0,0) 30%, rgba(0,0,0,0) 75%, rgba(0,0,0,.6)) !important; }
.cover.paused::before { display: none; }
.big-play { position: relative; width: 74px; height: 74px; border-radius: 50%; border: 0; background: rgba(79, 70, 229, .95); color: #fff; display: -webkit-box; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 0 0 8px rgba(255, 255, 255, .18), 0 10px 30px rgba(0, 0, 0, .35); -webkit-transition: -webkit-transform .2s var(--ease), background-color .2s; transition: transform .2s var(--ease), background-color .2s; }
.big-play:hover, .cover:hover .big-play { -webkit-transform: scale(1.07); transform: scale(1.07); background: #4f46e5; }
.big-play svg { width: 30px; height: 30px; margin-left: 4px; fill: currentColor; }
.cover-note { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; color: #fff; font-size: .85rem; text-shadow: 0 1px 3px #000; }
.buffering { position: absolute; z-index: 4; left: 50%; top: 50%; width: 42px; height: 42px; margin: -21px 0 0 -21px; border: 4px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%; -webkit-animation: spin .8s linear infinite; animation: spin .8s linear infinite; pointer-events: none; }
.player-msg { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 5; display: -webkit-box; display: flex; -webkit-box-orient: vertical; flex-direction: column; align-items: center; justify-content: center; color: #e2e8f0; text-align: center; padding: 1rem; background: #0f172a; }
.player-msg .icon { width: 30px; height: 30px; margin-bottom: .6rem; color: #94a3b8; }
.player-msg p { margin: .4rem 0 0; color: #94a3b8; font-size: .9rem; max-width: 420px; }

/* viewer watermark (email + user ID) over the video: small and faint, kept near the edges,
   moves rarely with a soft fade; lighter while playing but never hidden.
   Performance: the full-size pattern is its own GPU layer and never animates (no repaint of the video area);
   only the small label fades. No container query on .player-box (it added containment to the player). */
.wm-tile, .wm-move { pointer-events: none !important; z-index: 4 !important; display: block !important; visibility: visible !important; -webkit-user-select: none; user-select: none; }
.wm-tile { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background-repeat: repeat; background-size: 420px 240px; opacity: .08; -webkit-transform: translateZ(0); transform: translateZ(0); contain: strict; }
.wm-move { position: absolute; top: 0; left: 0; color: #fff; font: 600 11px/1.3 Arial, Helvetica, sans-serif; white-space: nowrap; text-shadow: 0 0 2px rgba(0, 0, 0, .7), 0 1px 2px rgba(0, 0, 0, .6); opacity: .5; will-change: transform, opacity; contain: layout style; -webkit-transition: opacity 1.2s ease; transition: opacity 1.2s ease; }
.wm-move b { display: block; font-weight: 600; }
.wm-move span { display: block; font-weight: 500; font-size: .82em; }
.player.wm-playing .wm-move { opacity: .26; }
.player.wm-playing .wm-tile { opacity: .045; }
.wm-move.wm-fade, .player.wm-playing .wm-move.wm-fade { opacity: .07; }

.controls { position: relative; z-index: 6; background: #0f172a; color: #fff; padding: .3rem .6rem .45rem; border-radius: 0 0 var(--radius) var(--radius); }
.seek { width: 100%; height: 20px; margin: 0; display: block; cursor: pointer; -webkit-appearance: none; appearance: none; background: transparent; touch-action: none; }
.seek::-webkit-slider-runnable-track { height: 5px; border-radius: 5px; background: #334155; background: var(--track, #334155); }
.seek::-moz-range-track { height: 5px; border-radius: 5px; background: #334155; background: var(--track, #334155); }
.seek::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; margin-top: -4.5px; border: 0; box-shadow: 0 1px 3px rgba(0,0,0,.4); -webkit-transition: -webkit-transform .15s; transition: transform .15s; }
.seek:hover::-webkit-slider-thumb { -webkit-transform: scale(1.2); transform: scale(1.2); }
.seek::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; }
.ctrl-row { display: -webkit-box; display: flex; align-items: center; }
.ctrl-row > * { margin-right: .15rem; }
.ctrl-row > *:last-child { margin-right: 0; }
.cbtn { -webkit-flex-shrink: 0; flex-shrink: 0; background: none; border: 0; color: #fff; height: 38px; min-width: 38px; padding: 0 .45rem; border-radius: 8px; cursor: pointer; display: -webkit-inline-box; display: inline-flex; align-items: center; justify-content: center; font: inherit; font-size: .85rem; font-weight: 600; -webkit-transition: background-color .15s; transition: background-color .15s; -webkit-tap-highlight-color: transparent; }
.cbtn:hover, .cbtn[aria-expanded=true] { background: rgba(255,255,255,.14); }
.cbtn svg { width: 22px; height: 22px; fill: currentColor; }
.vol { width: 80px; accent-color: #fff; cursor: pointer; -webkit-flex-shrink: 0; flex-shrink: 0; }
.ctime { font-size: .82rem; color: #cbd5e1; padding: 0 .3rem; white-space: nowrap; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ctrl-row .grow { -webkit-box-flex: 1; flex: 1; min-width: 0; }
.menu-wrap { position: relative; -webkit-flex-shrink: 0; flex-shrink: 0; }
/* menus open DOWNWARDS, below the control bar, and scroll if they are long */
.pmenu { position: absolute; right: 0; top: calc(100% + 8px); background: #1e293b; border-radius: 12px; padding: .35rem; min-width: 150px; max-height: 70vh; max-height: min(70vh, 440px); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; box-shadow: 0 14px 34px rgba(0,0,0,.45); z-index: 30; -webkit-animation: pop .15s var(--ease); animation: pop .15s var(--ease); }
.pmenu b { display: block; font-size: .7rem; color: #94a3b8; padding: .3rem .65rem; text-transform: uppercase; letter-spacing: .05em; }
.pmenu button { display: -webkit-box; display: flex; align-items: center; justify-content: space-between; width: 100%; text-align: left; background: none; border: 0; color: #fff; padding: .5rem .65rem; border-radius: 8px; font: inherit; font-size: .9rem; cursor: pointer; }
.pmenu button:hover { background: rgba(255,255,255,.1); }
.pmenu button.on { color: #a5b4fc; font-weight: 600; }
.pmenu button.on::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #a5b4fc; margin-left: .75rem; }
.pmenu small { display: block; color: #94a3b8; font-size: .72rem; padding: .35rem .65rem .2rem; max-width: 200px; }

/* full screen (real full screen, or filling the window on iPhone where websites can't use real full screen) */
.player.is-fs { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 2147483000; width: 100%; height: 100%; margin: 0; border-radius: 0; box-shadow: none; display: -webkit-box; display: flex; align-items: center; justify-content: center; background: #000; }
.player.is-fs .player-box { width: 100%; max-width: calc(100vh * var(--ar, 1.7778)); max-height: 100vh; border-radius: 0; }
@supports (height: 100dvh) {
  .player.is-fs { height: 100dvh; }
  .player.is-fs .player-box { max-width: calc(100dvh * var(--ar, 1.7778)); max-height: 100dvh; }
}
.player.is-fs .controls { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 0; background: -webkit-linear-gradient(top, rgba(0,0,0,0), rgba(0,0,0,.82)); background: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,.82)); padding: 2.2rem max(1rem, env(safe-area-inset-right)) max(.7rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left)); -webkit-transition: opacity .3s ease; transition: opacity .3s ease; }
.player.is-fs .pmenu, .pmenu.up { top: auto; bottom: calc(100% + 8px); }
.player.is-fs .pmenu { max-height: 65vh; }
.player.is-fs.idle .controls { opacity: 0; pointer-events: none; }
.player.is-fs.idle, .player.is-fs.idle .shield { cursor: none; }
.player.is-fs .cbtn svg { width: 24px; height: 24px; }

@media (hover: none) and (pointer: coarse) {
  .seek { height: 28px; }
  .seek::-webkit-slider-thumb { width: 18px; height: 18px; margin-top: -6.5px; }
  .seek::-moz-range-thumb { width: 18px; height: 18px; }
  .vol { display: none; }
}

/* ---------- page protection cover ---------- */
.guard-overlay { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 2147483647; background: #000; display: none; align-items: center; justify-content: center; color: #94a3b8; font-size: 1rem; text-align: center; padding: 1rem; }
html.guard-on body > *:not(.guard-overlay) { visibility: hidden !important; }

/* ---------- admin ---------- */
.admin-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100vh - 63px); background: var(--bg-soft); }
.side { background: #fff; border-right: 1px solid var(--line); padding: 1rem .7rem; }
.side nav { display: -webkit-box; display: flex; -webkit-box-orient: vertical; flex-direction: column; position: -webkit-sticky; position: sticky; top: 80px; }
.side button { text-align: left; background: none; border: 0; padding: .6rem .75rem; margin-bottom: 2px; border-radius: 10px; font: inherit; font-weight: 600; font-size: .91rem; color: var(--text-2); cursor: pointer; display: -webkit-box; display: flex; align-items: center; -webkit-transition: background-color .15s, color .15s; transition: background-color .15s, color .15s; }
.side button .icon { margin-right: .65rem; color: var(--muted); -webkit-transition: color .15s; transition: color .15s; }
.side button .label { -webkit-box-flex: 1; flex: 1; }
.side button:hover { background: var(--bg-soft); color: var(--text); }
.side button.active { background: var(--primary-soft); color: var(--primary); }
.side button.active .icon { color: var(--primary); }
.side .count { background: #f59e0b; color: #fff; border-radius: 999px; font-size: .72rem; padding: 0 .45rem; line-height: 1.5; margin-left: .5rem; }
.content { padding: 1.6rem; min-width: 0; -webkit-animation: fadeIn .2s ease-out; animation: fadeIn .2s ease-out; }
.content > h1 { font-size: 1.55rem; margin-bottom: 1.1rem; letter-spacing: -.02em; }
.view-in { -webkit-animation: fadeUp .25s var(--ease); animation: fadeUp .25s var(--ease); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); grid-gap: .8rem; gap: .8rem; margin-bottom: 1.25rem; }
.stat { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .95rem 1rem; text-align: left; font: inherit; color: inherit; box-shadow: var(--shadow-sm); -webkit-transition: border-color .15s, box-shadow .2s, -webkit-transform .2s var(--ease); transition: border-color .15s, box-shadow .2s, transform .2s var(--ease); }
button.stat { cursor: pointer; width: 100%; }
button.stat:hover { border-color: var(--primary-line); box-shadow: var(--shadow-lg); -webkit-transform: translateY(-2px); transform: translateY(-2px); }
.stat span { display: block; font-size: .8rem; color: var(--muted); font-weight: 600; }
.stat b { display: block; font-size: 1.65rem; line-height: 1.2; margin-top: .25rem; letter-spacing: -.02em; }
.stat small { color: var(--muted); font-size: .78rem; }
.stat.attn { border-color: #fcd34d; background: #fffbeb; }
.toolbar { display: -webkit-box; display: flex; flex-wrap: wrap; align-items: center; margin: 0 0 1rem -.5rem; }
.toolbar > * { margin: 0 0 .5rem .5rem; }
.toolbar .input, .toolbar .select { width: auto; min-width: 170px; -webkit-box-flex: 0; flex: 0 1 auto; }
.toolbar .input[type=search] { -webkit-box-flex: 1; flex: 1 1 220px; }
.toolbar .grow { -webkit-box-flex: 1; flex: 1; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-gap: 1rem; gap: 1rem; margin-bottom: 1rem; }
.cols .card + .card { margin-top: 0; }
.facts { display: grid; grid-template-columns: 150px minmax(0, 1fr); grid-gap: .5rem 1rem; gap: .5rem 1rem; margin: 0; font-size: .92rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.btn-row { display: -webkit-box; display: flex; flex-wrap: wrap; margin: 0 0 0 -.5rem; }
.btn-row > * { margin: 0 0 .5rem .5rem; }
.sec-title { font-size: 1rem; margin: 1.6rem 0 .7rem; }
.chips { display: -webkit-box; display: flex; flex-wrap: wrap; margin-top: .5rem; }
.chip { display: -webkit-inline-box; display: inline-flex; align-items: center; background: var(--primary-soft); color: #312e81; border-radius: 999px; padding: .2rem .4rem .2rem .7rem; font-size: .85rem; margin: 0 .4rem .4rem 0; }
.chip button { background: none; border: 0; cursor: pointer; font-size: 1rem; line-height: 1; color: inherit; margin-left: .25rem; }
.pick-list { border: 1px solid var(--line); border-radius: 10px; margin-top: .35rem; max-height: 200px; overflow-y: auto; }
.pick-list:empty { display: none; }
.pick-list button { display: block; width: 100%; text-align: left; border: 0; background: #fff; padding: .55rem .75rem; font: inherit; font-size: .9rem; cursor: pointer; border-bottom: 1px solid var(--line); }
.pick-list button:hover { background: var(--bg-soft); }
.radio-card { display: -webkit-box; display: flex; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: .85rem; margin-bottom: .55rem; cursor: pointer; -webkit-transition: border-color .15s, background-color .15s; transition: border-color .15s, background-color .15s; }
.radio-card:hover { border-color: var(--primary-line); }
.radio-card input { margin: .3rem .7rem 0 0; accent-color: var(--primary); }
.radio-card small { display: block; color: var(--muted); }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; vertical-align: middle; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: var(--line-2); border-radius: 999px; cursor: pointer; -webkit-transition: background-color .2s; transition: background-color .2s; }
.switch i::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; box-shadow: 0 1px 2px rgba(0,0,0,.2); -webkit-transition: -webkit-transform .2s var(--ease); transition: transform .2s var(--ease); }
.switch input:checked + i { background: #16a34a; }
.switch input:checked + i::before { -webkit-transform: translateX(18px); transform: translateX(18px); }
.switch input:focus-visible + i { outline: 2px solid var(--primary); outline-offset: 2px; }
.grid-tbl th.lec { text-transform: none; letter-spacing: 0; min-width: 90px; max-width: 160px; white-space: normal; font-size: .75rem; line-height: 1.3; vertical-align: bottom; }
.grid-tbl td.cell { text-align: center; font-weight: 600; font-size: .82rem; }
.cell-0 { color: #94a3b8; }
.cell-low { background: #fef3c7; color: #92400e; }
.cell-mid { background: #e0e7ff; color: #3730a3; }
.cell-done { background: #dcfce7; color: #166534; }
.legend { display: -webkit-box; display: flex; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.legend span { display: -webkit-inline-box; display: inline-flex; align-items: center; margin-right: .9rem; }
.legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; margin-right: .3rem; border: 1px solid rgba(0,0,0,.05); }
.res-admin { list-style: none; padding: 0; margin: 0 0 1rem; }
.res-admin li { display: -webkit-box; display: flex; align-items: center; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; padding: .55rem .7rem; margin-bottom: .45rem; }
.res-admin li > * + * { margin-left: .5rem; }
.res-admin .grow { -webkit-box-flex: 1; flex: 1; min-width: 0; }
.res-admin small { display: block; color: var(--muted); overflow-wrap: anywhere; }
.seg { display: -webkit-inline-box; display: inline-flex; flex-wrap: wrap; background: #f1f5f9; border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; border-radius: 8px; padding: .38rem .85rem; font: inherit; font-size: .88rem; font-weight: 600; color: var(--muted); cursor: pointer; -webkit-transition: background-color .15s, color .15s, box-shadow .15s; transition: background-color .15s, color .15s, box-shadow .15s; }
.seg button:hover { color: var(--text); }
.seg button.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(15, 23, 42, .1); }
.thumb { width: 72px; height: 40px; border-radius: 6px; object-fit: cover; background: #e2e8f0; display: block; }

/* ---------- small entrance animations ---------- */
@-webkit-keyframes spin { to { -webkit-transform: rotate(360deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@-webkit-keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@-webkit-keyframes fadeUp { from { opacity: 0; -webkit-transform: translateY(8px); } to { opacity: 1; -webkit-transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@-webkit-keyframes pop { from { opacity: 0; -webkit-transform: scale(.97); } to { opacity: 1; -webkit-transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@-webkit-keyframes modalIn { from { opacity: 0; -webkit-transform: translateY(10px) scale(.98); } to { opacity: 1; -webkit-transform: none; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@-webkit-keyframes toastIn { from { opacity: 0; -webkit-transform: translateY(10px); } to { opacity: 1; -webkit-transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.anim-up { -webkit-animation: fadeUp .55s var(--ease) both; animation: fadeUp .55s var(--ease) both; }
.d1 { -webkit-animation-delay: .06s; animation-delay: .06s; }
.d2 { -webkit-animation-delay: .12s; animation-delay: .12s; }
.d3 { -webkit-animation-delay: .18s; animation-delay: .18s; }
.d4 { -webkit-animation-delay: .24s; animation-delay: .24s; }
/* Cards fade in as they scroll into view (only when JavaScript runs, so nothing stays hidden without it). */
.js .reveal { opacity: 0; -webkit-transform: translateY(14px); transform: translateY(14px); -webkit-transition: opacity .5s var(--ease), -webkit-transform .5s var(--ease); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.js .reveal.in { opacity: 1; -webkit-transform: none; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { -webkit-animation-duration: .01ms !important; animation-duration: .01ms !important; -webkit-animation-delay: 0s !important; animation-delay: 0s !important; -webkit-transition-duration: .01ms !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; -webkit-transform: none; transform: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .learn { grid-template-columns: minmax(0, 1fr); }
  .lectures { position: static; max-height: none; }
  .lecture-list { max-height: 480px; }
}
@media (max-width: 880px) {
  .hero { padding: 2.5rem 0 2rem; }
  .hero .container { grid-template-columns: minmax(0, 1fr); }
  .hero .auth-card { margin-top: 2rem; }
  .hero h1 { font-size: 2.3rem; }
  .grid3 { grid-template-columns: minmax(0, 1fr); }
  .steps-line { display: none; }
  .nav-links { display: none; }
  .section { padding: 3rem 0; }
  .admin-layout { grid-template-columns: minmax(0, 1fr); }
  .side { border-right: 0; border-bottom: 1px solid var(--line); padding: .5rem; }
  .side nav { -webkit-box-orient: horizontal; flex-direction: row; overflow-x: auto; -webkit-overflow-scrolling: touch; position: static; }
  .side button { white-space: nowrap; -webkit-box-flex: 0; flex: 0 0 auto; margin: 0 .2rem 0 0; }
  .content { padding: 1rem; }
  .cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .topbar .container { flex-wrap: wrap; padding-top: .5rem; padding-bottom: .5rem; }
  .course-tabs { -webkit-box-ordinal-group: 6; order: 5; width: 100%; margin: .5rem 0 0 !important; }
  .course-tabs:empty { display: none; }
  .ticks { grid-template-columns: minmax(0, 1fr); }
  .section-head h2 { font-size: 1.6rem; }
  .footer .container { display: block; }
}
@media (max-width: 380px) {
  #cBack, #cFwd { display: none; }
}
@media (max-width: 560px) {
  .hero h1 { font-size: 2rem; }
  .row2 { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: minmax(0, 1fr); grid-gap: .1rem; gap: .1rem; }
  .facts dd { margin-bottom: .5rem; }
  .topbar .who { display: none; }
  .toolbar .input, .toolbar .select { min-width: 0; -webkit-box-flex: 1; flex: 1 1 100%; }
  .stat b { font-size: 1.35rem; }
  .cbtn { min-width: 34px; height: 36px; padding: 0 .3rem; }
  .ctime { font-size: .74rem; padding: 0 .15rem; }
  .controls { padding: .25rem .4rem .35rem; }
  .pmenu { min-width: 140px; }
  .auth-card { padding: 1.15rem; }
}
.brand .badge { margin-left: .55rem; }
