:root {
  --ink: #162823;
  --forest: #163d32;
  --forest-2: #215344;
  --mint: #dbece4;
  --sage: #a9c8b7;
  --paper: #f7f5ef;
  --white: #fffefa;
  --gold: #d8a84e;
  --muted: #68756f;
  --line: #dfe4df;
  --danger: #a33d39;
  --shadow: 0 22px 70px rgba(22, 40, 35, .11);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--paper); font-family: "DM Sans", sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font: 800 22px/1 "Manrope", sans-serif; letter-spacing: -.8px; }
.brand-light { color: white; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; color: var(--forest); background: var(--gold); font-size: 17px; }
.eyebrow { margin: 0 0 12px; color: #bdd8ca; font-size: 11px; font-weight: 700; letter-spacing: 2px; }
.eyebrow.ink { color: #638578; }
.muted { color: var(--muted); }

.login-shell { display: grid; grid-template-columns: minmax(390px, .92fr) minmax(480px, 1.08fr); min-height: 100vh; }
.login-story { position: relative; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 48px 60px; color: white; background: var(--forest); }
.login-story::before { content: ""; position: absolute; width: 480px; height: 480px; right: -210px; top: 14%; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; box-shadow: 0 0 0 80px rgba(255,255,255,.025), 0 0 0 160px rgba(255,255,255,.02); }
.login-story::after { content: ""; position: absolute; inset: 0; opacity: .12; background-image: radial-gradient(#fff 1px, transparent 1px); background-size: 24px 24px; mask-image: linear-gradient(to bottom right, transparent 10%, #000 70%); }
.login-story > * { position: relative; z-index: 1; }
.story-copy { max-width: 610px; margin: 80px 0; }
.story-copy h1 { margin: 0; font: 800 clamp(44px, 5.4vw, 76px)/.98 "Manrope", sans-serif; letter-spacing: -4px; }
.story-copy > p:last-child { max-width: 520px; margin: 28px 0 0; color: #d7e6de; font-size: 18px; line-height: 1.7; }
.story-proof { display: flex; align-items: center; gap: 18px; }
.story-proof p { margin: 0; color: #d7e6de; font-size: 13px; line-height: 1.5; }
.story-proof strong { color: white; }
.wave { display: flex; align-items: center; gap: 3px; width: 56px; height: 42px; padding: 0 9px; border-radius: 14px; background: rgba(255,255,255,.1); }
.wave i { display: block; width: 3px; border-radius: 3px; background: var(--gold); animation: wave 1.2s ease-in-out infinite alternate; }
.wave i:nth-child(1), .wave i:nth-child(7) { height: 8px; }.wave i:nth-child(2), .wave i:nth-child(6) { height: 18px; animation-delay: .2s; }.wave i:nth-child(3), .wave i:nth-child(5) { height: 28px; animation-delay: .35s; }.wave i:nth-child(4) { height: 35px; animation-delay: .5s; }
@keyframes wave { to { transform: scaleY(.45); } }

.login-panel { display: grid; place-items: center; padding: 48px; background: var(--white); }
.login-card { display: grid; gap: 24px; width: min(440px, 100%); }
.login-card h2 { margin: 0 0 10px; font: 800 38px/1.1 "Manrope", sans-serif; letter-spacing: -1.8px; }
.login-card .muted { margin: 0; line-height: 1.6; }
.login-card label { display: grid; gap: 8px; font-size: 13px; font-weight: 700; }
.login-card input { width: 100%; height: 52px; padding: 0 16px; color: var(--ink); border: 1px solid #ced8d2; border-radius: 12px; outline: none; background: #fff; transition: .2s; }
.login-card input:focus { border-color: var(--forest-2); box-shadow: 0 0 0 4px rgba(33,83,68,.1); }
.password-field { position: relative; }
.password-field input { padding-right: 68px; }
.password-field button { position: absolute; right: 8px; top: 8px; height: 36px; padding: 0 10px; border: 0; color: var(--forest-2); background: transparent; font-size: 12px; font-weight: 700; }
.primary-button { height: 54px; padding: 0 20px; border: 0; border-radius: 13px; color: white; background: var(--forest); box-shadow: 0 12px 30px rgba(22,61,50,.2); font-weight: 700; text-align: left; }
.primary-button span { float: right; font-size: 20px; }
.primary-button:disabled { opacity: .65; cursor: wait; }
.form-error { margin: -10px 0; padding: 11px 13px; color: var(--danger); background: #fbeceb; border-radius: 10px; font-size: 13px; }
.login-help { margin: -10px 0 0; color: var(--muted); font-size: 12px; text-align: center; }

.app-shell { display: grid; grid-template-columns: 245px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 30px 24px; background: var(--white); border-right: 1px solid var(--line); }
.sidebar nav { display: grid; gap: 6px; margin-top: 48px; }
.nav-item { display: flex; align-items: center; gap: 13px; width: 100%; padding: 12px 14px; border: 0; border-radius: 11px; color: var(--muted); background: transparent; text-align: left; font-weight: 600; }
.nav-item span { width: 22px; font-size: 18px; }
.nav-item.active { color: var(--forest); background: var(--mint); }
.sidebar-note { margin-top: auto; padding: 18px; border: 1px solid #d8e4dd; border-radius: 16px; background: #f5faf7; }
.sidebar-note .note-icon { display: grid; place-items: center; width: 30px; height: 30px; margin-bottom: 12px; color: var(--forest); background: var(--mint); border-radius: 10px; }
.sidebar-note strong { font-size: 13px; }.sidebar-note p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.logout-button { margin-top: 16px; padding: 11px; border: 0; color: var(--muted); background: transparent; font-weight: 600; text-align: left; }
.dashboard { min-width: 0; padding: 42px clamp(28px, 5vw, 76px) 80px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.topbar h1 { margin: 0; font: 800 clamp(28px, 3vw, 42px)/1.1 "Manrope", sans-serif; letter-spacing: -1.8px; }
.top-actions { display: flex; align-items: center; gap: 14px; }
.search-box { display: flex; align-items: center; gap: 9px; width: min(330px, 30vw); height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.search-box span { font-size: 20px; color: var(--muted); }.search-box input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; }
.avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: white; background: var(--forest); font-weight: 700; }
.metric-grid { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 16px; margin: 38px 0 46px; }
.metric-card { min-height: 150px; padding: 22px; border: 1px solid var(--line); border-radius: 19px; background: var(--white); box-shadow: 0 8px 30px rgba(22,40,35,.035); }
.metric-card.featured { color: white; border-color: var(--forest); background: var(--forest); }
.metric-card p { margin: 0 0 13px; color: var(--muted); font-size: 12px; font-weight: 600; }.metric-card.featured p, .metric-card.featured span { color: #cbded4; }
.metric-card strong { display: block; margin-bottom: 14px; font: 800 38px/1 "Manrope", sans-serif; }.metric-card span { color: var(--muted); font-size: 11px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 18px; }
.section-heading h2 { margin: 0; font: 800 26px/1.2 "Manrope", sans-serif; letter-spacing: -1px; }
.count-pill { padding: 7px 11px; color: var(--forest-2); background: var(--mint); border-radius: 999px; font-size: 11px; font-weight: 700; }
.lecture-list { display: grid; gap: 10px; }
.lecture-row { display: grid; grid-template-columns: 50px minmax(180px, 1.5fr) minmax(150px, 1fr) 110px 28px; align-items: center; gap: 16px; width: 100%; padding: 17px 18px; border: 1px solid var(--line); border-radius: 15px; color: inherit; background: var(--white); text-align: left; transition: .2s; }
.lecture-row:hover { border-color: var(--sage); transform: translateY(-2px); box-shadow: 0 14px 35px rgba(22,40,35,.07); }
.date-tile { display: grid; place-items: center; height: 48px; border-radius: 12px; color: var(--forest); background: var(--mint); }
.date-tile strong { font: 800 18px/1 "Manrope"; }.date-tile span { font-size: 9px; font-weight: 700; text-transform: uppercase; }
.lecture-title { min-width: 0; }.lecture-title strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }.lecture-title span, .lecture-summary { color: var(--muted); font-size: 11px; }
.lecture-summary { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.45; }
.status { justify-self: start; padding: 6px 9px; border-radius: 999px; font-size: 10px; font-weight: 700; text-transform: capitalize; }
.status.completed { color: #1e664f; background: #dff2e9; }.status.failed { color: #923b37; background: #f9e4e2; }.status.processing, .status.uploaded, .status.transcribing, .status.chunking, .status.inspecting, .status.analysing, .status.assembling { color: #865f16; background: #faeccf; }
.row-arrow { color: #799087; font-size: 19px; }
.state-card { padding: 35px; border: 1px dashed #c7d3cc; border-radius: 16px; color: var(--muted); background: rgba(255,255,255,.5); text-align: center; }
.state-card strong { display: block; color: var(--ink); }.state-card p { margin-bottom: 0; }

.lecture-dialog { width: min(880px, calc(100vw - 30px)); max-height: 88vh; padding: 0; border: 0; border-radius: 22px; color: var(--ink); background: var(--white); box-shadow: var(--shadow); }
.lecture-dialog::backdrop { background: rgba(10,28,23,.58); backdrop-filter: blur(4px); }
.dialog-close { position: sticky; float: right; top: 16px; margin: 16px 16px 0 0; z-index: 2; width: 36px; height: 36px; border: 0; border-radius: 50%; color: var(--ink); background: #eef3ef; font-size: 22px; }
.lecture-detail { padding: 48px clamp(24px, 6vw, 64px) 64px; }
.detail-kicker { color: #628174; font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; }
.lecture-detail h2 { max-width: 700px; margin: 10px 0 14px; font: 800 36px/1.15 "Manrope", sans-serif; letter-spacing: -1.5px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 12px; }
.detail-section { padding-top: 28px; margin-top: 28px; border-top: 1px solid var(--line); }.detail-section h3 { margin: 0 0 12px; font: 800 17px "Manrope"; }.detail-section p { color: #3e4d47; line-height: 1.75; }
.concept-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; }.concept-list li { padding: 7px 10px; border-radius: 9px; color: var(--forest); background: var(--mint); font-size: 12px; font-weight: 600; }
.qa-list { display: grid; gap: 12px; }.qa-item { padding: 14px 16px; border-left: 3px solid var(--gold); background: #fbf8ef; border-radius: 0 10px 10px 0; }.qa-item strong { display: block; margin-bottom: 5px; font-size: 13px; }.qa-item p { margin: 0; font-size: 13px; }
.notice-list { display: grid; gap: 10px; }.notice-item { padding: 14px 16px; border: 1px solid #e3d4b5; border-radius: 12px; background: #fffaf0; }.notice-item strong { display: block; margin-bottom: 5px; color: #785820; font-size: 11px; letter-spacing: .7px; text-transform: uppercase; }.notice-item p { margin: 0; font-size: 13px; }
.transcript { max-height: 430px; overflow: auto; padding: 22px; border-radius: 14px; color: #34443e; background: #f3f5f2; white-space: pre-wrap; font-size: 14px; line-height: 1.75; }

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }.login-story { min-height: 42vh; padding: 30px; }.story-copy { margin: 48px 0; }.story-copy h1 { font-size: 46px; }.login-panel { padding: 45px 24px; }
  .app-shell { grid-template-columns: 78px 1fr; }.sidebar { align-items: center; padding: 26px 12px; }.sidebar .brand span:last-child, .nav-item:not(.active) { font-size: 0; }.nav-item { justify-content: center; padding: 12px; }.nav-item span { width: auto; font-size: 19px; }.sidebar-note { display: none; }.logout-button { font-size: 0; }.logout-button::before { content: "↪"; font-size: 20px; }.dashboard { padding: 30px 22px 60px; }
  .topbar { align-items: flex-start; }.top-actions { flex: 1; justify-content: flex-end; }.search-box { width: min(280px, 45vw); }.metric-grid { grid-template-columns: 1fr 1fr; }.metric-card.featured { grid-column: span 2; }
  .lecture-row { grid-template-columns: 48px minmax(160px,1fr) 100px 20px; }.lecture-summary { display: none; }
}
@media (max-width: 620px) {
  .app-shell { display: block; }.sidebar { position: fixed; inset: auto 0 0; z-index: 20; flex-direction: row; justify-content: space-around; width: auto; height: 68px; padding: 8px; border: 0; border-top: 1px solid var(--line); }.sidebar .brand, .sidebar-note, .logout-button { display: none; }.sidebar nav { display: flex; justify-content: space-around; width: 100%; margin: 0; }.nav-item, .nav-item:not(.active) { width: auto; font-size: 0; }.dashboard { padding: 24px 16px 96px; }.topbar { display: block; }.top-actions { margin-top: 20px; }.search-box { width: 100%; }.avatar { display: none; }.metric-grid { gap: 10px; }.metric-card { min-height: 130px; padding: 18px; }.metric-card strong { font-size: 30px; }.lecture-row { grid-template-columns: 44px minmax(0,1fr) 18px; gap: 12px; }.lecture-row .status { display: none; }.lecture-detail h2 { font-size: 28px; }
}
