:root {
  --navy: #16344f;
  --navy-2: #244b69;
  --brand: #16344f;
  --brand-dark: #0d2538;
  --brand-soft: #edf2f5;
  --gold: #b8a254;
  --gold-dark: #6f622f;
  --gold-soft: #f4f0e3;
  --ink: #16344f;
  --muted: #637181;
  --line: #dce3e9;
  --surface: #ffffff;
  --canvas: #f3f6f8;
  --success: #237a57;
  --success-soft: #e8f5ef;
  --warning: #8a6823;
  --warning-soft: #f7f1df;
  --danger: #a84040;
  --danger-soft: #fbe8e7;
  --shadow: 0 18px 48px rgba(23, 33, 43, .08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { min-height: 100vh; margin: 0; background: radial-gradient(circle at 100% 0, rgba(22,52,79,.045), transparent 30rem), var(--canvas); color: var(--ink); font-size: 16px; line-height: 1.5; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.icon { width: 1.25rem; height: 1.25rem; flex: none; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: 15.5rem;
  flex-direction: column;
  padding: 2rem 1.25rem 1.25rem;
  color: #fff;
  background: linear-gradient(165deg, #0d2538 0%, #16344f 100%);
}
.brand { display: flex; align-items: center; gap: .75rem; width: fit-content; margin: 0 .65rem 3rem; color: inherit; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 2.55rem; height: 2.55rem; flex: none; border-radius: .78rem; background: #fff; box-shadow: 0 8px 22px rgba(4,20,31,.2); }
.brand-mark img { width: 1.9rem; height: auto; display: block; }
.brand-copy { display: grid; line-height: 1.15; }
.brand-copy strong { color: #fff; font-size: .98rem; letter-spacing: -.01em; }
.brand-copy small { margin-top: .24rem; color: rgba(255,255,255,.61); font-size: .62rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.sidebar nav { display: grid; gap: .35rem; }
.sidebar nav a { display: flex; align-items: center; gap: .85rem; min-height: 3rem; padding: 0 .9rem; border-radius: .65rem; color: #bfccda; font-weight: 650; text-decoration: none; transition: .18s ease; }
.sidebar nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.sidebar nav a.active { color: #fff; background: rgba(255,255,255,.1); box-shadow: inset 3px 0 0 var(--gold); }
.sidebar nav a.active .icon { color: var(--gold); }
.account { display: grid; grid-template-columns: 2.25rem 1fr auto; gap: .7rem; align-items: center; margin-top: auto; padding: 1rem .75rem 0; border-top: 1px solid rgba(255,255,255,.12); }
.account strong, .account small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account strong { color: #fff; font-size: .85rem; }
.account small { color: #9daec0; font-size: .72rem; }
.avatar { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; color: var(--navy); background: var(--gold); font-size: .72rem; font-weight: 800; }
.icon-button { display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; padding: 0; border: 0; border-radius: .55rem; color: inherit; background: transparent; cursor: pointer; }
.icon-button:hover { background: rgba(255,255,255,.08); }

.main { min-height: 100vh; margin-left: 15.5rem; padding: 2.25rem clamp(1.5rem, 4vw, 4.5rem) 4rem; }
.page-shell { max-width: 92rem; margin: 0 auto; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; margin-bottom: 1.9rem; }
.eyebrow { margin: 0 0 .35rem; color: var(--gold-dark); font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .3rem; font-size: clamp(1.8rem, 3vw, 2.55rem); line-height: 1.12; letter-spacing: -.035em; }
h2 { margin-bottom: 1rem; font-size: 1.25rem; line-height: 1.25; letter-spacing: -.015em; }
h3 { margin-bottom: .5rem; font-size: 1.02rem; }
.lede, .muted { color: var(--muted); }
.lede { max-width: 48rem; margin-bottom: 0; }
.header-actions { display: flex; flex-wrap: wrap; gap: .65rem; justify-content: flex-end; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.8rem; padding: .65rem 1rem; border: 1px solid transparent; border-radius: .62rem; color: #fff; background: var(--brand); font-weight: 700; text-decoration: none; cursor: pointer; transition: .17s ease; }
.button:hover { background: var(--brand-dark); transform: translateY(-1px); }
.button-secondary { color: var(--navy); border-color: var(--line); background: #fff; }
.button-secondary:hover { background: #f8fafb; }
.button-gold { color: var(--navy); background: var(--gold); }
.button-gold:hover { color: var(--navy); background: #aa9341; }
.button-danger { background: var(--danger); }
.button-small { min-height: 2.3rem; padding: .45rem .7rem; font-size: .88rem; }
.button[disabled] { opacity: .45; pointer-events: none; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; padding: .8rem; margin-bottom: 1.25rem; border: 1px solid var(--line); border-radius: .8rem; background: rgba(255,255,255,.82); }
.search { position: relative; flex: 1 1 18rem; }
.search .icon { position: absolute; left: .85rem; top: 50%; color: #7c8997; transform: translateY(-50%); pointer-events: none; }
.search input { width: 100%; padding-left: 2.7rem; }
.toolbar select { min-width: 10rem; }
.filter-pills { display: flex; flex-wrap: wrap; gap: .35rem; }
.filter-pill { padding: .5rem .7rem; border-radius: .45rem; color: var(--muted); font-size: .84rem; font-weight: 700; text-decoration: none; }
.filter-pill:hover, .filter-pill.active { color: var(--navy); background: var(--gold-soft); }

input, textarea, select { width: 100%; padding: .72rem .8rem; border: 1px solid #cfd7df; border-radius: .55rem; color: var(--ink); background: #fff; outline: none; }
textarea { min-height: 8rem; resize: vertical; line-height: 1.55; }
textarea.script { min-height: 22rem; }
input:focus, textarea:focus, select:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(22,52,79,.13); }
label { display: grid; gap: .4rem; color: #39495c; font-size: .9rem; font-weight: 700; }
label small { color: var(--muted); font-weight: 500; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; }
.field-grid .wide { grid-column: 1 / -1; }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(10rem,1fr)); gap: .55rem; }
.check-card { display: flex; align-items: center; gap: .65rem; padding: .7rem; border: 1px solid var(--line); border-radius: .55rem; font-weight: 650; cursor: pointer; }
.check-card input { width: 1.1rem; height: 1.1rem; accent-color: var(--brand); }

.panel { padding: 1.35rem; border: 1px solid var(--line); border-radius: .85rem; background: var(--surface); box-shadow: 0 7px 24px rgba(30,45,60,.035); }
.panel + .panel { margin-top: 1rem; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.panel-header h2, .panel-header p { margin-bottom: 0; }
.panel-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.form-actions { display: flex; justify-content: flex-end; gap: .65rem; padding-top: 1rem; }

.course-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(18rem,1fr)); gap: 1rem; }
.course-card { position: relative; overflow: hidden; min-height: 21rem; border: 1px solid var(--line); border-radius: .9rem; background: #fff; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease; }
.course-card:hover { transform: translateY(-3px); box-shadow: 0 22px 50px rgba(24,38,55,.13); }
.course-card > a { display: flex; height: 100%; flex-direction: column; text-decoration: none; }
.course-cover { position: relative; display: grid; place-items: center; aspect-ratio: 16/8.7; overflow: hidden; color: #fff; background: linear-gradient(135deg, #173553, #264f72); }
.course-cover::after { content: ""; position: absolute; inset: auto -10% -40% 35%; height: 90%; border-radius: 50%; background: rgba(184,162,84,.16); transform: rotate(-12deg); }
.course-cover img { width: 100%; height: 100%; object-fit: cover; }
.course-monogram { z-index: 1; color: rgba(255,255,255,.9); font-family: Georgia,serif; font-size: 2.7rem; }
.course-card-body { display: flex; flex: 1; flex-direction: column; padding: 1.15rem; }
.course-number { color: var(--warning); font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.course-card h2 { margin: .25rem 0 1rem; font-size: 1.15rem; }
.status-list { display: grid; gap: .5rem; margin-top: auto; color: var(--muted); font-size: .84rem; }
.status-row { display: flex; align-items: center; justify-content: space-between; gap: .7rem; }
.status-row span:first-child { display: flex; align-items: center; gap: .45rem; }
.status-row .icon { width: 1rem; height: 1rem; }

.badge { display: inline-flex; align-items: center; gap: .35rem; width: fit-content; padding: .28rem .55rem; border-radius: 99rem; font-size: .76rem; font-weight: 800; line-height: 1.2; }
.badge-success { color: var(--success); background: var(--success-soft); }
.badge-warning { color: var(--warning); background: var(--warning-soft); }
.badge-danger { color: var(--danger); background: var(--danger-soft); }
.badge-neutral { color: #526274; background: #edf1f4; }

.empty { padding: 4rem 2rem; border: 1px dashed #c7d0da; border-radius: 1rem; text-align: center; background: rgba(255,255,255,.6); }
.empty .empty-icon { display: grid; place-items: center; width: 4rem; height: 4rem; margin: 0 auto 1rem; border-radius: 1.2rem; color: var(--navy); background: var(--gold-soft); }
.empty .empty-icon .icon { width: 2rem; height: 2rem; }
.empty p { max-width: 32rem; margin: 0 auto 1.4rem; color: var(--muted); }

.course-hero { display: grid; grid-template-columns: minmax(8rem,12rem) 1fr auto; gap: 1.5rem; align-items: center; padding: 1.2rem; margin-bottom: 1rem; border-radius: 1rem; color: #fff; background: linear-gradient(115deg, #102943, #1c4163); box-shadow: var(--shadow); }
.course-hero-image { display: grid; place-items: center; aspect-ratio: 16/10; overflow: hidden; border-radius: .65rem; color: var(--navy); background: var(--gold); font-family: Georgia,serif; font-size: 2rem; }
.course-hero-image img { width: 100%; height: 100%; object-fit: cover; }
.course-hero h1 { margin-bottom: .3rem; color: #fff; font-size: clamp(1.55rem,3vw,2.25rem); }
.course-hero .eyebrow { color: var(--gold); }
.course-hero-meta { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; color: #c7d4e1; font-size: .86rem; }
.course-version { min-width: 6rem; padding: .7rem; border: 1px solid rgba(255,255,255,.18); border-radius: .65rem; text-align: center; }
.course-version strong { display: block; color: var(--gold); font-size: 1.25rem; }
.course-version span { color: #b8c7d5; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }

.tabs { display: flex; gap: .25rem; overflow-x: auto; padding: .35rem; margin-bottom: 1rem; border: 1px solid var(--line); border-radius: .75rem; background: #fff; }
.tabs a { flex: none; padding: .6rem .8rem; border-radius: .5rem; color: var(--muted); font-size: .88rem; font-weight: 750; text-decoration: none; }
.tabs a:hover, .tabs a.active { color: var(--navy); background: var(--gold-soft); }

.chapter-list { display: grid; gap: .75rem; }
.chapter { display: grid; grid-template-columns: 2.6rem 1fr auto; gap: 1rem; align-items: center; padding: .9rem; border: 1px solid var(--line); border-radius: .75rem; background: #fff; }
.chapter[draggable="true"] .chapter-index { cursor: grab; }
.chapter.dragging { opacity: .45; border-color: var(--gold); }
.chapter-index { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: .6rem; color: var(--navy); background: #edf1f4; font-weight: 850; }
.chapter h3 { margin: 0 0 .15rem; }
.chapter-meta { display: flex; flex-wrap: wrap; gap: .45rem .9rem; color: var(--muted); font-size: .78rem; }
.chapter-audit-meta { display: flex; flex-wrap: wrap; gap: .32rem 1rem; margin-top: .45rem; color: var(--muted); font-size: .74rem; }
.chapter-audit-meta strong { color: #425363; font-weight: 750; }
.chapter-actions { display: flex; gap: .4rem; }

.status-strip { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .75rem; margin-bottom: 1rem; }
.status-tile { padding: 1rem; border: 1px solid var(--line); border-radius: .7rem; background: #fff; }
.status-tile span { display: block; color: var(--muted); font-size: .76rem; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.status-tile strong { display: block; margin-top: .2rem; font-size: 1.15rem; }

.language-switcher { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.language-switcher a { padding: .45rem .7rem; border: 1px solid var(--line); border-radius: .5rem; background: #fff; font-size: .85rem; font-weight: 750; text-decoration: none; }
.language-switcher a.active { color: var(--navy); border-color: #ded3a6; background: var(--gold-soft); }
.content-layout { display: grid; grid-template-columns: minmax(0,2fr) minmax(18rem,1fr); gap: 1rem; }
.video-frame { overflow: hidden; aspect-ratio: 16/9; border-radius: .7rem; background: #dfe4e8; }
.video-frame iframe { width: 100%; height: 100%; border: 0; }
.video-empty { display: grid; place-items: center; height: 100%; color: #758494; text-align: center; }
.video-empty .icon { width: 2.4rem; height: 2.4rem; margin: 0 auto .5rem; }
.content-text { white-space: pre-wrap; }
.meta-line { margin-top: 1rem; color: var(--muted); font-size: .78rem; }
.approval-box { padding: 1rem; border: 1px solid #ecd6a1; border-radius: .7rem; background: #fff9e9; }
.approval-box form + form { margin-top: .6rem; }

.history { position: relative; margin: 0; padding: 0; list-style: none; }
.history::before { content: ""; position: absolute; top: .5rem; bottom: .5rem; left: .45rem; width: 1px; background: var(--line); }
.history li { position: relative; display: grid; grid-template-columns: 1rem minmax(8rem,10rem) 1fr; gap: .8rem; padding: 0 0 1.1rem; }
.history-dot { z-index: 1; width: .65rem; height: .65rem; margin-top: .4rem; border: 2px solid #fff; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.history time { color: var(--muted); font-size: .8rem; }
.history p { margin: 0; }
.history small { display: block; color: var(--muted); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .75rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; }
td { font-size: .9rem; }

.flash { position: fixed; z-index: 50; top: 1rem; right: 1rem; max-width: 30rem; padding: .8rem 1rem; border: 1px solid; border-radius: .65rem; box-shadow: var(--shadow); animation: flash-in .2s ease; }
.flash-success { color: var(--success); border-color: #abd4c4; background: #f2fbf7; }
.flash-error { color: var(--danger); border-color: #edb7b5; background: #fff6f5; }
.flash-notice { color: var(--navy); border-color: #b9cadb; background: #f5f9fc; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-8px); } }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 1.9rem; background: radial-gradient(circle at 100% 0, rgba(22,52,79,.055), transparent 32rem), var(--canvas); }
.login-card { width: min(60rem,100%); display: grid; grid-template-columns: 1.1fr .9fr; overflow: hidden; border-radius: 1.5rem; background: #fff; box-shadow: 0 28px 90px rgba(23,33,43,.16); }
.login-intro { padding: clamp(2.5rem,5vw,3.65rem); color: #fff; background: linear-gradient(145deg,#0d2538,#16344f); }
.login-intro .eyebrow { color: var(--gold); }
.login-intro h1 { margin: .9rem 0; color: #fff; font-size: clamp(2rem,4vw,2.65rem); line-height: 1.08; }
.login-intro p { color: #d8e1e8; }
.feature-list { display: grid; gap: .75rem; margin: 1.75rem 0 0; padding: 0; list-style: none; }
.feature-list li::before { content: "✓"; margin-right: .55rem; color: var(--gold); font-weight: 900; }
.login-form-panel { padding: 3.25rem 2.75rem; }
.login-form-panel .brand { margin: 0 0 2.5rem; color: var(--ink); }
.login-form-panel .brand-mark { background: transparent; box-shadow: none; }
.login-form-panel .brand-copy strong { color: var(--ink); }
.login-form-panel .brand-copy small { color: var(--muted); }
.login-form-panel h2 { margin-bottom: .45rem; font-size: 1.75rem; }
.stacked-form { display: grid; gap: .9rem; margin-top: 1.55rem; }
.stacked-form .button { width: 100%; margin-top: .35rem; }
.public-page .main { margin: 0; padding: 0; }

dialog { width: min(92vw,34rem); padding: 0; border: 0; border-radius: .9rem; box-shadow: 0 30px 90px rgba(10,24,38,.3); }
dialog::backdrop { background: rgba(9,25,42,.55); backdrop-filter: blur(2px); }
.dialog-body { padding: 1.4rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .6rem; padding: 1rem 1.4rem; border-top: 1px solid var(--line); background: #f7f9fa; }
.vimeo-item { width: 100%; border: 1px solid var(--line); color: var(--ink); text-align: left; cursor: pointer; }
.vimeo-item:hover { border-color: #ded3a6; background: var(--gold-soft); }
.vimeo-item:disabled { opacity: .58; cursor: default; background: #f6f8f8; }
.vimeo-item span:nth-child(2) { display: grid; }
.vimeo-upload { padding: 1rem; margin-bottom: 1.2rem; border: 1px solid #ecd6a1; border-radius: .75rem; background: #fffaf0; }
.vimeo-upload label { margin-bottom: .65rem; }
.vimeo-upload p { margin-bottom: .8rem; font-size: .82rem; }
.vimeo-upload-note { padding: .75rem; margin-bottom: 1.1rem; border-radius: .6rem; background: #f3f5f7; font-size: .82rem; }
.upload-progress { display: grid; gap: .35rem; margin-top: .8rem; color: var(--muted); font-size: .8rem; }
.upload-progress progress { width: 100%; height: .65rem; accent-color: var(--brand); }

.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin: 1rem 0 .8rem; }
.section-heading h3, .section-heading p { margin-bottom: 0; }
.picker-field { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem; border: 1px solid var(--line); border-radius: .7rem; background: #f8faf9; }
.picker-field span, .language-folder-row span:first-child, .access-baseline span:last-child { display: grid; }
.picker-field small, .language-folder-row small, .access-baseline small { color: var(--muted); font-size: .76rem; font-weight: 500; }
.language-folder-map { display: grid; grid-template-columns: repeat(auto-fit,minmax(14rem,1fr)); gap: .5rem; margin-top: .65rem; }
.language-folder-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: .6rem; }
.language-folder-row input { position: absolute; opacity: 0; pointer-events: none; }
.integration-hint { padding: .75rem .85rem; margin: .75rem 0 0; border-radius: .6rem; color: var(--muted); background: var(--canvas); font-size: .8rem; }
.integration-hint a { color: var(--brand-dark); font-weight: 700; }
.folder-browser-toolbar { display: flex; justify-content: space-between; gap: .6rem; margin-bottom: 1rem; }
.video-selection { display: grid; gap: .7rem; margin-top: .85rem; }
.video-selection p { margin: 0; font-size: .78rem; overflow-wrap: anywhere; }
.access-baseline { display: flex; align-items: center; gap: .75rem; padding: .75rem; margin-bottom: 1rem; border: 1px solid #ded3a6; border-radius: .65rem; background: var(--gold-soft); }
.access-baseline .status-icon { color: var(--navy); background: #fff; }

.integration-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .8rem; margin-bottom: 1rem; }
.integration-card { display: grid; grid-template-columns: 2rem 1fr auto; gap: .85rem; align-items: start; min-height: 7rem; padding: 1rem; border: 1px solid var(--line); border-radius: .8rem; background: #fff; }
.integration-card h2 { margin: .1rem 0 .3rem; font-size: 1rem; }
.integration-card p { margin: 0; color: var(--muted); font-size: .82rem; }
.status-icon { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%; font-weight: 900; }
.status-icon.ok { color: var(--success); background: var(--success-soft); }
.status-icon.pending { color: var(--warning); background: var(--warning-soft); }
.details-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .75rem 1.25rem; margin: 0; }
.details-list div { padding-bottom: .65rem; border-bottom: 1px solid var(--line); }
.details-list dt { color: var(--muted); font-size: .75rem; }
.details-list dd { margin: .2rem 0 0; font-weight: 750; overflow-wrap: anywhere; }
.diff-legend { display: flex; gap: 1rem; margin-bottom: 1rem; color: var(--muted); font-size: .85rem; }
.diff-text { padding: 1rem; margin-bottom: 1rem; border: 1px solid var(--line); border-radius: .6rem; line-height: 1.8; white-space: pre-wrap; background: #fafbfc; }
.diff-text del, .diff-legend del { padding: .08rem .15rem; color: #8b3030; background: #f9d9d7; text-decoration-color: #c46464; }
.diff-text ins, .diff-legend ins { padding: .08rem .15rem; color: #1f694f; background: #d8f0e6; text-decoration: none; }

.revision-compare-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.revision-compare-toolbar form { width: min(32rem,100%); }
.revision-pair { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; margin-bottom: 1rem; }
.revision-column-header, .revision-field { min-width: 0; padding: 1.1rem; border: 1px solid var(--line); border-radius: .8rem; background: #fff; }
.revision-column-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.revision-column-header h2 { margin: .15rem 0 .3rem; }
.revision-column-header p { margin: 0; color: var(--muted); font-size: .8rem; }
.revision-current { border-color: #d8c98d; }
.revision-field h3 { padding-bottom: .65rem; margin-bottom: .8rem; border-bottom: 1px solid var(--line); }
.revision-text { min-height: 3rem; color: #263d52; line-height: 1.65; overflow-wrap: anywhere; white-space: pre-wrap; }
.revision-comparison del, .revision-comparison ins { padding: .06rem .12rem; border-radius: .2rem; text-decoration: none; }
.revision-comparison.show-diff del { color: #8b3030; background: #f9d9d7; }
.revision-comparison.show-diff ins { color: #1f694f; background: #d8f0e6; }
.revision-comparison:not(.show-diff) del, .revision-comparison:not(.show-diff) ins { color: inherit; background: transparent; }

@media (max-width: 980px) {
  .sidebar { width: 5rem; padding: 1.5rem .7rem 1rem; }
  .brand { margin: 0 auto 2rem; }
  .sidebar .brand-copy, .sidebar nav span, .account > span:not(.avatar), .account form { display: none; }
  .sidebar nav a { justify-content: center; padding: 0; }
  .account { display: flex; justify-content: center; padding: 1rem 0 0; }
  .main { margin-left: 5rem; padding-inline: 1.3rem; }
  .content-layout { grid-template-columns: 1fr; }
  .status-strip { grid-template-columns: repeat(2,1fr); }
  .details-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .revision-compare-toolbar { align-items: stretch; flex-direction: column; }
  .login-card { grid-template-columns: 1fr; }
  .login-intro { display: none; }
}

@media (max-width: 680px) {
  .sidebar { inset: auto 0 0; width: auto; height: 4.2rem; flex-direction: row; padding: .45rem; }
  .sidebar .brand, .sidebar .account { display: none; }
  .sidebar nav { width: 100%; display: flex; }
  .sidebar nav a { min-width: 0; min-height: 3.2rem; flex: 1; flex-direction: column; gap: .1rem; font-size: .67rem; }
  .sidebar nav span { display: block; }
  .sidebar nav a.active { box-shadow: inset 0 -3px 0 var(--gold); }
  .main { margin: 0; padding: 1.25rem 1rem 6rem; }
  .page-header { display: grid; gap: 1rem; }
  .header-actions { justify-content: flex-start; }
  .course-grid { grid-template-columns: 1fr; }
  .course-hero { grid-template-columns: 5.5rem 1fr; }
  .course-version { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
  .field-grid { grid-template-columns: 1fr; }
  .field-grid .wide { grid-column: auto; }
  .chapter { grid-template-columns: 2.5rem 1fr; }
  .chapter-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .status-strip { grid-template-columns: 1fr 1fr; }
  .login-shell { padding: .9rem; }
  .login-form-panel { padding: 2.35rem 1.5rem; }
  .history li { grid-template-columns: 1rem 1fr; }
  .history time { grid-column: 2; }
  .integration-grid, .details-list { grid-template-columns: 1fr; }
  .integration-card { grid-template-columns: 2rem 1fr; }
  .integration-card > .badge { grid-column: 2; }
  .picker-field, .section-heading { align-items: stretch; flex-direction: column; }
  .revision-pair { grid-template-columns: 1fr; }
}
