:root {
  --canvas: #f7f9fc;
  --surface: #ffffff;
  --surface-muted: #f1f5f9;
  --line: #e2e8f0;
  --ink: #152238;
  --muted: #64748b;
  --subtle: #94a3b8;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --teal: #0f9c96;
  --teal-soft: #e6f7f5;
  --danger: #b42318;
  --danger-soft: #fff0ef;
  --shadow: 0 18px 50px rgba(15, 35, 65, .08);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { min-height: 100vh; margin: 0; color: var(--ink); background: radial-gradient(circle at 84% -10%, #e6f7f5 0, rgba(230,247,245,0) 28rem), var(--canvas); font: 400 16px/1.5 "DM Sans", Arial, sans-serif; }
button, input, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid rgba(37,99,235,.28); outline-offset: 2px; }
a { color: inherit; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 280px; flex: 0 0 280px; min-height: 100vh; display: flex; flex-direction: column; padding: 24px 18px 20px; background: rgba(255,255,255,.88); border-right: 1px solid var(--line); backdrop-filter: blur(16px); }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 7px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 800 21px/1 "Manrope", sans-serif; letter-spacing: -.8px; text-decoration: none; }
.brand-mark { width: 28px; height: 28px; padding: 6px; display: inline-flex; align-items: end; gap: 3px; border-radius: 9px; background: linear-gradient(135deg, var(--blue), var(--teal)); box-shadow: 0 6px 14px rgba(37,99,235,.22); }
.brand-mark i { display: block; flex: 1; border-radius: 2px; background: #fff; opacity: .95; }
.brand-mark i:nth-child(1) { height: 45%; }.brand-mark i:nth-child(2) { height: 100%; }.brand-mark i:nth-child(3) { height: 68%; }
.sidebar-close, .menu-button { display: none; }

.sidebar-nav { margin: 36px 0 22px; display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px; color: var(--muted); text-align: left; font-weight: 600; background: transparent; }
.nav-item:hover { color: var(--ink); background: var(--surface-muted); }.nav-item-active { color: var(--blue); background: #edf4ff; }
.nav-icon { width: 18px; color: currentColor; font-size: 20px; line-height: 1; }

.collection-card { padding: 16px; border: 1px solid #dce8fb; border-radius: 14px; background: linear-gradient(145deg, #f7fbff, #edf7ff); }
.eyebrow { margin: 0 0 5px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }.eyebrow.accent { color: var(--blue); }
.collection-name { overflow: hidden; margin-bottom: 9px; font: 700 15px/1.35 "Manrope", sans-serif; text-overflow: ellipsis; white-space: nowrap; }.collection-status { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 3px rgba(15,156,150,.14); }.collection-status.processing .status-dot { background: #d97706; box-shadow: 0 0 0 3px rgba(217,119,6,.14); }.collection-status.error .status-dot { background: var(--danger); box-shadow: 0 0 0 3px rgba(180,35,24,.14); }.collection-count { min-height: 20px; margin: 6px 0 14px; color: var(--muted); font-size: 12px; }

.button { display: inline-flex; justify-content: center; align-items: center; min-height: 42px; padding: 0 16px; border-radius: 9px; font-weight: 700; transition: transform .15s, background .15s, box-shadow .15s; }.button:hover { transform: translateY(-1px); }.button:disabled { cursor: not-allowed; opacity: .6; transform: none; }.button-primary { color: white; background: var(--blue); box-shadow: 0 8px 18px rgba(37,99,235,.2); }.button-primary:hover { background: var(--blue-dark); }.button-secondary { color: #315171; background: #fff; border: 1px solid #ccd9e7; }.button-secondary:hover { background: #f8fafc; }.button-full { width: 100%; }.text-button { color: var(--blue); background: none; font-weight: 700; }
.source-list-wrap { flex: 1; min-height: 0; margin-top: 25px; }.sidebar-section-title { margin: 0 8px 9px; color: var(--subtle); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }.source-list { display: grid; gap: 2px; max-height: 335px; overflow-y: auto; padding-right: 2px; }.source-list-empty { padding: 10px 8px; color: var(--muted); font-size: 13px; }.source-mini { display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: 9px; }.source-mini:hover { background: var(--surface-muted); }.source-mini img { width: 38px; height: 26px; flex: 0 0 auto; border-radius: 5px; object-fit: cover; }.source-mini-text { min-width: 0; }.source-mini-title { overflow: hidden; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }.source-mini-meta { color: var(--subtle); font-size: 11px; }.sidebar-note { margin: 19px 7px 0; color: var(--subtle); font-size: 11px; line-height: 1.45; }
.source-more { margin: 3px 8px; }.source-more summary { color: var(--blue); cursor: pointer; font-size: 12px; font-weight: 700; }.source-more-list { margin-top: 5px; }

.page { min-width: 0; flex: 1; }.topbar { height: 70px; display: flex; align-items: center; justify-content: flex-end; padding: 0 42px; }.mobile-brand { display: none; font: 800 18px "Manrope", sans-serif; }.main-content { width: min(100%, 1100px); margin: 0 auto; padding: 58px 42px 72px; }
.welcome { max-width: 720px; padding-top: 38px; }.welcome h1, .workspace-header h1 { margin: 0; font: 800 clamp(32px, 4vw, 52px)/1.13 "Manrope", sans-serif; letter-spacing: -1.8px; }.welcome > p:not(.eyebrow) { max-width: 630px; margin: 19px 0 28px; color: var(--muted); font-size: 18px; line-height: 1.65; }
.workspace-header { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 27px; }.workspace-header h1 { font-size: clamp(28px, 3vw, 39px); }.library-subtitle { margin: 9px 0 0; color: var(--muted); }.notice { margin: 0 0 19px; padding: 13px 15px; color: #315171; border: 1px solid #bfdbfe; border-radius: 10px; background: #eff6ff; font-size: 14px; }.notice.warning { color: #8a4b00; border-color: #f8d79a; background: #fff8e8; }.notice.error { color: var(--danger); border-color: #f5c2bd; background: var(--danger-soft); }

.composer-card, .answer-card, .details { background: var(--surface); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); }.composer-card { overflow: hidden; }.composer-card textarea { width: 100%; min-height: 104px; resize: vertical; padding: 22px 23px 12px; color: var(--ink); border: 0; outline: 0; background: transparent; font-size: 17px; line-height: 1.55; }.composer-card textarea::placeholder { color: var(--subtle); }.composer-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 14px 13px 20px; border-top: 1px solid var(--line); background: #fcfdff; }.quick-actions { display: flex; flex-wrap: wrap; gap: 7px; }.action-button { padding: 7px 10px; color: #42627f; border-radius: 7px; background: transparent; font-size: 13px; font-weight: 700; }.action-button:hover { color: var(--blue); background: #edf4ff; }
.result { margin-top: 48px; }.result-heading, .section-heading { display: flex; align-items: end; justify-content: space-between; gap: 15px; }.result-heading h2, .section-heading h3 { margin: 0; font: 800 25px/1.2 "Manrope", sans-serif; letter-spacing: -.6px; }.researching { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }.spinner { width: 15px; height: 15px; border: 2px solid #cbd5e1; border-top-color: var(--blue); border-radius: 50%; animation: spin .7s linear infinite; }@keyframes spin { to { transform: rotate(360deg); } }
.answer-card { margin-top: 16px; padding: 27px 29px; line-height: 1.72; }.answer-card > :first-child { margin-top: 0; }.answer-card > :last-child { margin-bottom: 0; }.markdown h1,.markdown h2,.markdown h3 { color: var(--ink); font-family: "Manrope", sans-serif; }.markdown h1 { font-size: 24px; }.markdown h2 { font-size: 20px; }.markdown h3 { font-size: 17px; }.markdown p { margin: 0 0 14px; }.markdown ul,.markdown ol { margin: 0 0 15px; padding-left: 24px; }.markdown li { margin-bottom: 7px; }.markdown a { color: var(--blue); font-weight: 600; }.markdown code { padding: 2px 5px; border-radius: 4px; background: var(--surface-muted); font-size: .9em; }
.muted-answer { color: var(--muted); }.error-answer { color: var(--danger); }
.sources-section { margin-top: 37px; }.section-heading h3 { font-size: 20px; }.source-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 15px; }.citation-card { display: flex; gap: 13px; min-width: 0; padding: 11px; color: inherit; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-decoration: none; transition: border .15s, box-shadow .15s, transform .15s; }.citation-card:hover { border-color: #9bc1fb; box-shadow: 0 8px 22px rgba(37,99,235,.09); transform: translateY(-1px); }.citation-card img { width: 92px; height: 61px; flex: 0 0 auto; border-radius: 7px; object-fit: cover; }.citation-content { min-width: 0; }.citation-time { display: inline-block; margin-bottom: 4px; color: var(--blue); font-size: 11px; font-weight: 800; }.citation-title { overflow: hidden; font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }.citation-snippet { display: -webkit-box; overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }.empty-citations { padding: 16px; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; font-size: 14px; }.details { margin-top: 25px; padding: 0 18px; box-shadow: none; }.details summary { padding: 15px 0; color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 700; }.trajectory { margin: 0 0 16px; padding-left: 20px; color: var(--muted); font-size: 13px; }.trajectory li { margin: 6px 0; }.trajectory code { color: #315171; }
.library-view { padding-top: 5px; }.video-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }.video-card { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }.video-card img { width: 100%; aspect-ratio: 16 / 9; display: block; object-fit: cover; }.video-card-body { padding: 13px; }.video-card-title { min-height: 42px; font: 700 14px/1.4 "Manrope", sans-serif; }.video-card-meta { margin-top: 6px; color: var(--muted); font-size: 12px; }.video-card a { color: var(--blue); font-size: 12px; font-weight: 700; text-decoration: none; }
.video-card-skipped { border-style: dashed; background: #fffdfb; }.video-card-reason { display: -webkit-box; overflow: hidden; margin: 10px 0 0; color: var(--subtle); font-size: 12px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }

.modal-backdrop { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(15,31,52,.36); backdrop-filter: blur(4px); }.modal { position: relative; width: min(100%, 590px); padding: 32px; border-radius: 18px; background: #fff; box-shadow: 0 24px 80px rgba(15,35,65,.22); }.modal h2 { margin: 0; font: 800 28px/1.2 "Manrope", sans-serif; letter-spacing: -.8px; }.modal-copy { margin: 10px 0 23px; color: var(--muted); }.modal label { display: block; margin: 16px 0 7px; color: #315171; font-size: 13px; font-weight: 700; }.optional { color: var(--subtle); font-weight: 400; }.modal input,.modal textarea { width: 100%; padding: 11px 12px; color: var(--ink); border: 1px solid #cbd5e1; border-radius: 8px; outline-color: var(--blue); background: #fff; }.modal textarea { resize: vertical; }.input-help { margin: 7px 0 0; color: var(--subtle); font-size: 12px; }.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 25px; }.modal-close { position: absolute; top: 14px; right: 17px; width: 32px; height: 32px; color: var(--muted); border-radius: 50%; background: transparent; font-size: 25px; line-height: 1; }.modal-close:hover { background: var(--surface-muted); }.modal-error { margin-top: 14px; padding: 10px 12px; color: var(--danger); border-radius: 8px; background: var(--danger-soft); font-size: 13px; }

@media (max-width: 860px) { .sidebar { position: fixed; z-index: 15; width: min(82vw, 300px); transform: translateX(-105%); transition: transform .2s ease; box-shadow: 15px 0 45px rgba(15,35,65,.12); }.sidebar.open { transform: translateX(0); }.sidebar-close { display: block; }.icon-button { display: inline-grid; place-content: center; width: 36px; height: 36px; padding: 0; color: var(--ink); border-radius: 8px; background: transparent; }.sidebar-close span { display: block; width: 16px; height: 1.5px; background: currentColor; }.sidebar-close span:first-child { transform: translateY(1px) rotate(45deg); }.sidebar-close span:last-child { transform: translateY(-1px) rotate(-45deg); }.topbar { justify-content: space-between; padding: 0 22px; border-bottom: 1px solid rgba(226,232,240,.8); background: rgba(247,249,252,.82); backdrop-filter: blur(12px); }.menu-button { display: grid; gap: 4px; }.menu-button span { display: block; width: 17px; height: 1.5px; background: currentColor; }.mobile-brand { display: block; margin-right: auto; }.main-content { padding: 42px 26px 64px; }.desktop-add-source { display: none; }.video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .topbar { height: 62px; padding: 0 17px; }.main-content { padding: 35px 17px 45px; }.welcome { padding-top: 10px; }.welcome > p:not(.eyebrow) { font-size: 16px; }.workspace-header { align-items: start; margin-bottom: 20px; }.workspace-header h1 { font-size: 29px; }.composer-footer { align-items: stretch; flex-direction: column; padding: 11px; }.quick-actions { order: 2; }.composer-footer .button { width: 100%; }.result { margin-top: 34px; }.result-heading { align-items: start; flex-direction: column; }.answer-card { padding: 21px 19px; }.source-cards, .video-grid { grid-template-columns: 1fr; }.modal-backdrop { align-items: end; padding: 0; }.modal { max-height: 92vh; overflow-y: auto; padding: 28px 20px 22px; border-radius: 18px 18px 0 0; }.modal-actions { display: grid; grid-template-columns: 1fr 1fr; }.sidebar-note { display: none; } }
