:root {
  color-scheme: dark;
  --bg: #080d18;
  --panel: #101827;
  --panel-2: #172235;
  --text: #f4f7fb;
  --muted: #9aabc2;
  --line: #26344a;
  --accent: #43b6ff;
  --accent-2: #1973d1;
  --danger: #ff6577;
  font: 16px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at 20% -10%, #163351, transparent 32rem), var(--bg); color: var(--text); min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, .button { border: 0; cursor: pointer; }
.site-header { position: sticky; z-index: 20; top: 0; min-height: 68px; padding: 0 3vw; display: flex; align-items: center; gap: 2rem; background: rgb(8 13 24 / 92%); border-bottom: 1px solid var(--line); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: .7rem; font-weight: 800; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #04101d; }
.site-header nav { display: flex; align-items: center; gap: 1.2rem; flex: 1; }
.site-header nav a, footer a { color: var(--muted); }
.site-header nav a:hover, footer a:hover { color: var(--text); }
.account-actions { display: flex; align-items: center; gap: .8rem; }
.account-actions form { margin: 0; }
.username { color: var(--muted); }
.text-button { padding: 0; background: none; color: var(--accent); }
.button { display: inline-flex; align-items: center; justify-content: center; padding: .75rem 1.1rem; border-radius: 10px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #03101e; font-weight: 800; }
.button.small { padding: .5rem .75rem; font-size: .9rem; }
.button.secondary { background: var(--panel-2); border: 1px solid var(--line); color: var(--text); }
.constrained { width: min(1180px, 92vw); margin-inline: auto; }
.narrow { max-width: 760px; }
.hero { width: min(920px, 92vw); margin: 0 auto; padding: 8rem 0 5rem; text-align: center; }
.hero h1 { max-width: 850px; margin: .3rem auto 1rem; font-size: clamp(2.6rem, 7vw, 5.5rem); line-height: .98; letter-spacing: -.06em; }
.hero p:not(.eyebrow) { max-width: 650px; margin: 0 auto 2rem; color: var(--muted); font-size: 1.15rem; }
.eyebrow { margin: 0 0 .5rem; color: var(--accent); font-size: .78rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.feature-grid, .item-grid, .video-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; padding: 1rem 0 6rem; }
.feature-grid article, .item-card, .video-card, .form-card, .list-panel, .legal, .error-page { background: linear-gradient(145deg, rgb(23 34 53 / 90%), rgb(12 20 34 / 90%)); border: 1px solid var(--line); border-radius: 18px; }
.feature-grid article { padding: 1.5rem; }
.feature-grid p, small { color: var(--muted); }
.page-heading, .watch-hero { display: flex; justify-content: space-between; align-items: end; gap: 2rem; padding: 4rem 0 1.5rem; }
.page-heading h1, .watch-hero h1 { margin: .2rem 0; font-size: clamp(2rem, 5vw, 4rem); letter-spacing: -.04em; line-height: 1; }
.new-item { display: flex; gap: .6rem; }
input, textarea, select { width: 100%; padding: .75rem; color: var(--text); background: #0b1321; border: 1px solid var(--line); border-radius: 8px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(67 182 255 / 12%); }
.item-card { min-height: 155px; padding: 1.25rem; display: flex; flex-direction: column; gap: .65rem; transition: transform .15s, border-color .15s; }
.item-card:hover, .video-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.file-icon { display: grid; place-items: center; width: 42px; height: 48px; border-radius: 6px; background: var(--accent-2); font-weight: 900; }
.item-card small { margin-top: auto; }
.empty-state { grid-column: 1 / -1; padding: 3rem; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 16px; }
.editor-shell { min-height: calc(100vh - 68px); background: #0d1421; }
.editor-toolbar { position: sticky; z-index: 10; top: 68px; display: flex; align-items: center; gap: .75rem; padding: .7rem 2vw; background: #101827; border-bottom: 1px solid var(--line); }
.editor-toolbar > input { max-width: 520px; border-color: transparent; background: transparent; font-weight: 700; }
#save-status { margin-left: auto; color: var(--muted); font-size: .85rem; }
.document-stage { min-height: calc(100vh - 140px); padding: 3rem 1rem; background: #1a2331; }
#doc-body { display: block; width: min(850px, 96vw); min-height: 1100px; margin: 0 auto; padding: 5rem 4.5rem; resize: vertical; border: 0; border-radius: 2px; background: #fff; color: #172033; box-shadow: 0 15px 50px rgb(0 0 0 / 35%); font: 17px/1.75 Georgia, serif; }
.sheet-stage { overflow: auto; height: calc(100vh - 140px); }
#sheet-grid { border-collapse: collapse; background: #fff; color: #172033; }
#sheet-grid th { position: sticky; z-index: 2; top: 0; min-width: 120px; padding: .4rem; background: #e6edf5; border: 1px solid #bdc8d5; }
#sheet-grid th:first-child { left: 0; z-index: 3; min-width: 45px; }
#sheet-grid td:first-child { position: sticky; left: 0; min-width: 45px; text-align: center; background: #e6edf5; border: 1px solid #bdc8d5; }
#sheet-grid input { min-width: 120px; padding: .45rem; color: #172033; background: white; border: 1px solid #d0d8e2; border-radius: 0; box-shadow: none; }
.slides-stage { display: grid; grid-template-columns: 250px 1fr; min-height: calc(100vh - 140px); }
.slides-stage aside { padding: 1rem; overflow-y: auto; border-right: 1px solid var(--line); }
#slide-list { padding: 0; list-style: none; }
#slide-list button { width: 100%; margin: .35rem 0; padding: .8rem; text-align: left; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--text); }
#slide-list button.active { border-color: var(--accent); }
.slide-canvas { align-self: center; width: min(950px, 80vw); aspect-ratio: 16 / 9; margin: 3rem auto; padding: 8%; display: flex; flex-direction: column; justify-content: center; background: #f6f8fc; box-shadow: 0 15px 60px #0008; }
.slide-canvas input, .slide-canvas textarea { color: #111827; background: transparent; border: 0; box-shadow: none; text-align: center; }
.slide-canvas input { font-size: clamp(2rem, 5vw, 4rem); font-weight: 800; }
.slide-canvas textarea { min-height: 45%; resize: none; font-size: clamp(1rem, 2.5vw, 1.8rem); }
.editor-details { padding: 2rem 0 5rem; display: flex; justify-content: space-between; gap: 2rem; }
.editor-details details { min-width: 300px; }
.editor-details details form { display: flex; justify-content: space-between; gap: 1rem; margin-top: .7rem; }
.danger { padding: .55rem .8rem; border-radius: 8px; color: white; background: #8a2030; }
.presentation { overflow-y: auto; scroll-snap-type: y mandatory; }
.present-slide { min-height: 100vh; padding: 10vw; display: grid; place-content: center; text-align: center; background: #f7f8fb; color: #141a26; scroll-snap-align: start; }
.present-slide h1 { font-size: clamp(3rem, 8vw, 8rem); line-height: 1; }
.slide-copy { max-width: 1100px; white-space: pre-wrap; font-size: clamp(1.3rem, 3vw, 3rem); }
.exit-present { position: fixed; right: 1rem; top: 1rem; padding: .5rem; border-radius: 7px; background: #111b; color: white; }
.watch-hero { padding-top: 5rem; }
.video-card { display: flex; flex-direction: column; gap: .5rem; padding: .65rem; border: 1px solid transparent; border-radius: 13px; transition: transform .15s, border-color .15s; }
.thumbnail { aspect-ratio: 16 / 9; display: grid; place-items: center; border-radius: 9px; background: linear-gradient(135deg, #172b45, #244e70); }
.thumbnail span { display: grid; place-items: center; width: 50px; height: 50px; padding-left: 4px; border-radius: 50%; background: #fff2; font-size: 1.4rem; }
.list-panel { padding: 1rem; }
.list-panel article { padding: 1rem; display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); }
.list-panel article div { display: flex; flex-direction: column; }
.form-card, .legal, .error-page { margin-top: 4rem; margin-bottom: 5rem; padding: clamp(1.5rem, 5vw, 3.5rem); }
.form-card label, .comment-form label, .thread form label { display: grid; gap: .35rem; margin: 1rem 0; font-weight: 700; }
progress { width: 100%; height: 12px; accent-color: var(--accent); }
.watch-page { padding-top: 2rem; padding-bottom: 5rem; }
.watch-page video { width: 100%; max-height: 75vh; background: #000; border-radius: 12px; }
.watch-page h1 { font-size: 2rem; margin-bottom: .4rem; }
.video-meta, .inline-actions { display: flex; gap: 1rem; align-items: center; color: var(--muted); }
.video-meta a { color: var(--accent); font-weight: 800; }
.description { padding: 1rem; white-space: pre-wrap; background: var(--panel); border-radius: 10px; }
.comments { margin-top: 3rem; }
.comments article { padding: 1rem 0; border-top: 1px solid var(--line); }
.messages-shell { display: grid; grid-template-columns: 280px 1fr; min-height: calc(100vh - 170px); margin-top: 2rem; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.messages-shell aside { padding: 1.25rem; background: var(--panel); }
.messages-shell aside a { display: block; padding: .7rem; margin-top: .4rem; border-radius: 7px; background: var(--panel-2); }
.thread { padding: 1.5rem; }
.thread-messages { min-height: 360px; }
.thread-messages p { max-width: 75%; padding: .75rem; display: flex; flex-direction: column; border-radius: 10px; background: var(--panel-2); }
.thread-messages .mine { margin-left: auto; background: #164977; }
.legal h2 { margin-top: 2rem; }
.legal p { color: #c1ccdc; }
.error-page { text-align: center; }
.error-code { margin: 0; color: var(--accent); font-size: 5rem; font-weight: 900; }
footer { min-height: 100px; padding: 2rem 4vw; display: flex; gap: 1.3rem; align-items: center; border-top: 1px solid var(--line); color: var(--muted); }
.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; }
@media (max-width: 760px) {
  .site-header { flex-wrap: wrap; gap: .5rem 1rem; padding-block: .6rem; }
  .site-header nav { order: 3; width: 100%; overflow-x: auto; }
  .username { display: none; }
  .page-heading, .watch-hero, .editor-details { align-items: stretch; flex-direction: column; }
  .new-item { flex-direction: column; }
  .editor-toolbar { top: 104px; flex-wrap: wrap; }
  #doc-body { padding: 2rem 1.4rem; }
  .slides-stage, .messages-shell { grid-template-columns: 1fr; }
  .slides-stage aside { border-right: 0; border-bottom: 1px solid var(--line); }
  .slide-canvas { width: 94vw; }
  footer { flex-wrap: wrap; }
}
