:root {
  --navy: #10233f;
  --navy-2: #1b3556;
  --ink: #16233a;
  --muted: #667085;
  --champagne: #d8c39e;
  --cream: #f7f4ee;
  --paper: #ffffff;
  --line: #e5e7eb;
  --soft: #f7f8fa;
  --success: #e9f6ee;
  --success-ink: #1d6c3c;
  --warning: #fff4df;
  --warning-ink: #8a5c10;
  --danger: #b42318;
  --shadow: 0 20px 60px rgba(16, 35, 63, .12);
  --radius: 14px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--soft); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--soft); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px; position: relative; overflow: hidden; }
.auth-backdrop { position: absolute; inset: 0; background: linear-gradient(135deg, rgba(247,244,238,.95), rgba(255,255,255,.82)), radial-gradient(circle at 10% 20%, #d8c39e 0 2px, transparent 3px); }
.auth-backdrop::before, .auth-backdrop::after { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; filter: blur(3px); opacity: .35; }
.auth-backdrop::before { background: #d8c39e; left: -180px; bottom: -180px; }
.auth-backdrop::after { background: #bbc6d5; right: -200px; top: -190px; }
.auth-card { position: relative; width: min(460px, 100%); background: rgba(255,255,255,.93); border: 1px solid rgba(16,35,63,.09); border-radius: 18px; padding: 42px; box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.wordmark, .sidebar-brand { font-family: Georgia, "Times New Roman", serif; letter-spacing: .18em; color: var(--navy); }
.wordmark { text-align: center; font-size: 22px; }
.wordmark-sub { margin-top: 8px; text-align: center; font-size: 9px; letter-spacing: .2em; color: var(--muted); }
.auth-card section { margin-top: 38px; }
.eyebrow { margin: 0 0 8px; color: #866f49; text-transform: uppercase; letter-spacing: .13em; font-size: 12px; font-weight: 700; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; color: var(--navy); }
h1 { font-size: clamp(28px, 4vw, 38px); line-height: 1.1; margin: 0 0 14px; }
h2 { font-size: 26px; margin: 0 0 10px; }
h3 { font-size: 19px; margin: 0; }
.muted { color: var(--muted); line-height: 1.65; }
label { display: block; margin: 20px 0 8px; font-size: 13px; font-weight: 700; color: var(--ink); }
input, textarea, select { width: 100%; border: 1px solid #cfd5dd; background: #fff; border-radius: 8px; padding: 11px 12px; color: var(--ink); outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(27,53,86,.1); }
textarea { min-height: 100px; resize: vertical; }
.code-input { font-size: 28px; letter-spacing: .32em; text-align: center; font-variant-numeric: tabular-nums; }
.button { border: 0; border-radius: 8px; padding: 11px 16px; font-weight: 700; transition: transform .12s ease, opacity .12s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.button.primary { background: var(--navy); color: #fff; }
.button.secondary { background: var(--cream); color: var(--navy); border: 1px solid #ddcfb6; }
.button.ghost { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.button.danger { background: #fff; color: var(--danger); border: 1px solid #f1b8b4; }
.button.small { padding: 7px 10px; font-size: 12px; }
.full { width: 100%; margin-top: 20px; }
.text-button { background: none; border: 0; padding: 0; color: var(--navy-2); text-decoration: underline; }
.auth-actions { margin-top: 18px; display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.message { min-height: 22px; margin: 18px 0 0; color: var(--danger); font-size: 13px; }
.message.success { color: var(--success-ink); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 235px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: linear-gradient(180deg, #10233f 0%, #0d1d35 100%); color: #fff; padding: 26px 14px 18px; z-index: 20; }
.sidebar-brand { color: #fff; font-size: 16px; padding: 0 10px 24px; white-space: nowrap; }
.main-nav { display: grid; gap: 5px; }
.nav-link { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; color: rgba(255,255,255,.82); padding: 10px 12px; border-radius: 7px; text-align: left; font-size: 13px; }
.nav-link:hover, .nav-link.active { color: #fff; background: rgba(255,255,255,.1); }
.nav-section { padding: 20px 12px 7px; color: rgba(255,255,255,.45); text-transform: uppercase; letter-spacing: .12em; font-size: 10px; font-weight: 800; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 4px; }
.app-frame { min-width: 0; }
.topbar { height: 68px; display: flex; align-items: center; gap: 12px; padding: 0 28px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-spacer { flex: 1; }
.user-chip { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.user-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff; font-weight: 800; }
.menu-toggle { display: none; border: 0; background: none; font-size: 23px; color: var(--navy); }
.content { padding: 34px; max-width: 1500px; width: 100%; margin: 0 auto; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.page-head p { margin: 7px 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 16px rgba(16,35,63,.04); }
.program-card { overflow: hidden; display: flex; flex-direction: column; min-height: 220px; }
.program-cover { height: 118px; min-height: 118px; flex: 0 0 118px; background: linear-gradient(135deg, #f7f3ec, #fbf8f3 55%, #eef1f4); position: relative; }
.program-cover::after { content: ""; position: absolute; width: 74px; height: 54px; right: 24px; top: 15px; border-radius: 5px; transform: rotate(-6deg); background: rgba(188,176,156,.36); box-shadow: -12px 9px 0 rgba(223,213,196,.72); }
.program-body { padding: 17px; display: flex; flex-direction: column; flex: 1; }
.program-body p { color: var(--muted); line-height: 1.5; font-size: 13px; }
.program-body .button { margin-top: auto; }
.status { display: inline-flex; align-items: center; width: fit-content; border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 800; text-transform: capitalize; }
.status.published { background: var(--success); color: var(--success-ink); }
.status.draft { background: var(--warning); color: var(--warning-ink); }
.status.archived { background: #eef0f3; color: #596273; }
.empty { padding: 42px; text-align: center; background: #fff; border: 1px dashed #cfd5dd; border-radius: var(--radius); color: var(--muted); }

.table-wrap { overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; min-width: 690px; }
th, td { padding: 13px 15px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: 13px; }
th { color: #667085; background: #fafbfc; text-transform: uppercase; letter-spacing: .04em; font-size: 10px; }
tr:last-child td { border-bottom: 0; }
.name-cell strong { display: block; color: var(--ink); }
.name-cell span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }

.two-column { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(270px, .55fr); gap: 20px; align-items: start; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid label { margin-top: 0; }
.program-settings { margin-bottom: 16px; }
.label-compact { margin: 0; }
.inline-form-spaced { margin-top: 10px; }
.section-label-spaced { margin-top: 22px; }
.form-grid-spaced { margin-top: 16px; }
.field-label-spaced { margin-top: 20px; }
.member-table-spaced { margin-top: 18px; }

.course-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 22px; align-items: start; }
.course-nav { position: sticky; top: 90px; background: var(--navy); color: #fff; border-radius: var(--radius); padding: 14px 0; overflow: hidden; }
.course-nav-title { padding: 8px 16px 15px; font-family: Georgia, "Times New Roman", serif; font-size: 17px; }
.course-module-title { padding: 9px 16px 6px; color: #d8c39e; text-transform: uppercase; letter-spacing: .06em; font-size: 10px; font-weight: 800; }
.course-page-link { width: 100%; border: 0; background: transparent; color: rgba(255,255,255,.82); text-align: left; padding: 8px 18px 8px 24px; font-size: 12px; }
.course-page-link:hover, .course-page-link.active { background: rgba(255,255,255,.1); color: #fff; }
.lesson { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(24px, 4vw, 48px); min-height: 500px; }
.lesson-header { border-bottom: 1px solid var(--line); padding-bottom: 20px; margin-bottom: 28px; }
.content-block { margin: 0 0 22px; line-height: 1.75; }
.content-block.heading { font-family: Georgia, "Times New Roman", serif; color: var(--navy); font-size: 24px; font-weight: 700; line-height: 1.25; }
.content-block.callout { background: var(--cream); border-left: 4px solid var(--champagne); padding: 16px 18px; border-radius: 0 8px 8px 0; }
.content-block a { color: #24558c; text-decoration-thickness: 1px; }
.video-block { border: 1px solid var(--line); border-radius: 12px; background: #0b1627; overflow: hidden; }
.video-block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 15px; background: #fff; }
.video-block-head strong { color: var(--navy); }
.video-block-head span { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-block-description { padding: 12px 15px 14px; background: #fff; color: var(--text); border-top: 1px solid var(--line); line-height: 1.55; }
.video-block video { display: block; width: 100%; max-height: min(70vh, 720px); background: #000; }

.stack { display: grid; gap: 10px; }
.module-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.module-row, .page-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.module-row { background: #fafbfc; }
.page-row { padding-left: 32px; border-top: 1px solid var(--line); }
.row-main { min-width: 0; flex: 1; }
.row-main strong { display: block; }
.row-main small { color: var(--muted); }

.editor-block { border: 1px solid var(--line); border-radius: 9px; margin-bottom: 10px; background: #fff; }
.editor-block-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 11px; background: #fafbfc; border-bottom: 1px solid var(--line); }
.editor-block-body { padding: 12px; }
.block-type { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.block-toolbar { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }

.permission-list { display: grid; gap: 8px; }
.permission-item { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; }
.permission-item span { flex: 1; font-size: 13px; }
.inline-form { display: flex; gap: 8px; align-items: end; }
.inline-form > div { flex: 1; }
.inline-form label { margin-top: 0; }

.toast { position: fixed; right: 20px; bottom: 20px; max-width: 360px; background: var(--navy); color: #fff; border-radius: 10px; padding: 12px 15px; box-shadow: var(--shadow); z-index: 100; font-size: 13px; }
.toast.error { background: #8e1d16; }
.role-pill { display: inline-block; padding: 4px 8px; border-radius: 999px; background: #eef2f7; color: #344054; font-size: 11px; text-transform: capitalize; }


/* Portal title/tag search */
.search-form { margin-bottom: 18px; }
.search-form label { margin-top: 0; }
.search-input-row { display: flex; gap: 8px; align-items: center; }
.search-input-row input { flex: 1; }
.search-result-list { display: grid; gap: 10px; }
.search-result { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 15px 17px; text-align: left; }
.search-result:hover, .search-result:focus-visible { border-color: #b8c2cf; box-shadow: 0 5px 18px rgba(16,35,63,.06); }
.search-result-title { display: block; color: var(--navy); font-family: Georgia, "Times New Roman", serif; font-size: 18px; font-weight: 700; }
.search-result-path { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; }
.field-help { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -255px; width: 235px; transition: left .18s ease; }
  .sidebar.open { left: 0; box-shadow: 18px 0 50px rgba(0,0,0,.22); }
  .menu-toggle { display: block; }
  .content { padding: 24px 18px; }
  .two-column, .course-layout { grid-template-columns: 1fr; }
  .course-nav { position: static; }
}

@media (max-width: 600px) {
  .auth-card { padding: 30px 22px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .page-head { display: block; }
  .page-head .actions { margin-top: 14px; }
  .inline-form { display: grid; }
}

/* Google Drive resource library */
.resource-card { display: flex; align-items: center; gap: 14px; padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfd; }
.resource-icon { width: 44px; min-width: 44px; height: 44px; display: grid; place-items: center; border-radius: 9px; background: var(--cream); border: 1px solid #ddcfb6; color: var(--navy); font-size: 10px; font-weight: 900; letter-spacing: .03em; }
.resource-copy { min-width: 0; flex: 1; }
.resource-copy strong, .drive-selected strong { display: block; min-width: 0; color: var(--ink); overflow-wrap: anywhere; word-break: break-word; }
.resource-copy span, .drive-selected span { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; }
.drive-selected { display: flex; align-items: center; gap: 12px; padding: 11px; background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; }
.drive-browser { padding: 0; overflow: hidden; }
.drive-browser-head { display: flex; align-items: center; gap: 14px; padding: 15px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.drive-browser-head input { max-width: 280px; margin-left: auto; }
.drive-breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
.crumb { border: 0; background: none; padding: 3px 4px; color: var(--navy-2); font-weight: 700; font-size: 12px; }
.crumb:hover { text-decoration: underline; }
.drive-list { display: grid; }
.drive-row { display: flex; align-items: center; gap: 12px; padding: 12px 15px; border-bottom: 1px solid var(--line); }
.drive-row:last-child { border-bottom: 0; }
.drive-row[hidden] { display: none; }
.drive-row-main { min-width: 0; flex: 1; }
.drive-row-main strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drive-row-main span { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.empty.compact { border: 0; border-radius: 0; padding: 24px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 1000; background: rgba(9,20,36,.65); display: grid; place-items: center; padding: 22px; }
.modal-card { width: min(920px, 100%); max-height: min(760px, 90vh); background: #fff; border-radius: 14px; box-shadow: 0 24px 80px rgba(0,0,0,.25); overflow: hidden; display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: flex-start; gap: 16px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.modal-head > div { flex: 1; }
.modal-head h2 { margin-bottom: 0; }
.icon-button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--navy); font-size: 24px; line-height: 1; }
.drive-picker #drive-picker-body,
.drive-picker #drive-video-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}
.drive-picker #drive-picker-body > .muted:only-child,
.drive-picker #drive-video-body > .muted:only-child {
  margin: 0;
  padding: 22px;
}
.drive-picker .drive-browser-head { position: sticky; top: 0; z-index: 2; }


.drive-picker-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.drive-picker-tools input { min-width: 220px; }
.drive-check { margin: 0; display: grid; place-items: center; }
.drive-check input { width: 18px; height: 18px; margin: 0; }
.drive-picker-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--line); background: #fff; }
.drive-picker-footer > span { color: var(--muted); font-size: 13px; font-weight: 700; }

@media (max-width: 600px) {
  .drive-browser-head { align-items: stretch; display: grid; }
  .drive-browser-head input { max-width: none; margin-left: 0; }
  .drive-picker-tools { display: grid; margin-left: 0; }
  .drive-picker-tools input { min-width: 0; }
  .drive-picker-footer { align-items: stretch; display: grid; }
  .search-input-row { align-items: stretch; display: grid; }
  .drive-row { align-items: flex-start; }
  .resource-card { align-items: flex-start; flex-wrap: wrap; }
  .resource-card .resource-copy { flex: 1 1 calc(100% - 60px); min-width: 0; max-width: 100%; }
}

/* V6 admin ergonomics, program card styling and drag ordering */
.two-column > *, .form-grid > *, .panel, .module-row, .page-row, .editor-block-head, .editor-block-body { min-width: 0; }
.program-settings { overflow: hidden; }
.program-settings-actions { display: flex; justify-content: flex-start; align-items: center; min-width: 0; }
.program-settings-actions .button { width: auto; max-width: 100%; flex: 0 0 auto; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; min-width: 0; }
.program-card-actions { margin-top: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.program-card-actions .button { margin-top: 0; }
.program-cover { background: var(--program-card-color, linear-gradient(135deg, #e9dfce, #f6f1e8 55%, #c6d0dc)); background-position: center; background-size: cover; }
.program-cover.has-image { min-height: 118px; height: 118px; background-position: center; background-repeat: no-repeat; background-size: cover; }
.program-cover.has-image::after { display: none; }
.lesson-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.lesson-header > div { min-width: 0; }

.program-style-editor { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 16px; }
.program-style-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.palette-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 10px; }
.palette-swatch { width: 36px; height: 36px; border: 2px solid #fff; border-radius: 9px; background: var(--swatch, #fff); box-shadow: 0 0 0 1px #cfd5dd; padding: 0; font-size: 9px; color: var(--muted); }
.palette-swatch.default { width: 68px; background: linear-gradient(135deg, #e9dfce, #f6f1e8 55%, #c6d0dc); }
.palette-swatch.selected { box-shadow: 0 0 0 3px rgba(16,35,63,.28); }
.color-input-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px; align-items: center; }
.color-input-row input[type="color"] { height: 42px; padding: 3px; }
.program-image-choice { display: flex; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 9px; padding: 10px; background: #fafbfc; min-width: 0; }
.program-image-preview { width: 120px; height: 48px; aspect-ratio: 5 / 2; border-radius: 7px; object-fit: cover; object-position: center; border: 1px solid var(--line); flex: 0 0 auto; }
.program-image-actions { margin-top: 9px; }

.check-row { display: flex; align-items: center; gap: 9px; margin-top: 14px; font-weight: 600; }
.check-row input[type="checkbox"] { width: 18px; height: 18px; margin: 0; flex: 0 0 auto; }
.editor-block-controls { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.drag-handle { border: 0; background: transparent; color: var(--muted); padding: 6px 7px; border-radius: 6px; font-weight: 900; cursor: grab; line-height: 1; }
.drag-handle:hover, .drag-handle:focus-visible { background: #eef2f7; color: var(--navy); }
.dragging { opacity: .48; }
.drag-over { outline: 2px dashed #98a2b3; outline-offset: -2px; }
.draggable-row, .draggable-block { touch-action: manipulation; }
.page-sort-list { min-width: 0; }
.page-row { padding-left: 14px; }

.drive-picker #drive-image-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}
.drive-picker #drive-image-body > .muted:only-child { margin: 0; padding: 22px; }

@media (max-width: 760px) {
  .program-style-grid { grid-template-columns: 1fr; }
  .module-row, .page-row { align-items: flex-start; flex-wrap: wrap; }
  .row-actions { width: 100%; justify-content: flex-start; padding-left: 34px; }
  .lesson-header { align-items: stretch; flex-direction: column; }
}
.program-cover.has-image { background-color: #e9dfce; }


/* V6.1 routing/admin layout hardening and module ordering */
.content, .two-column, .two-column > div, .two-column > aside, #module-stack, .stack, .module-card, .page-sort-list, .program-settings, .program-style-editor, .program-style-grid, .program-style-grid > * {
  min-width: 0;
  max-width: 100%;
}
.two-column, .program-settings, .module-card, .module-row, .page-row { width: 100%; }
.panel, .program-settings { overflow-wrap: anywhere; }
.panel-head { flex-wrap: wrap; min-width: 0; }
.panel-head > * { min-width: 0; }
.program-settings { overflow: clip; }
.program-settings-actions {
  width: 100%;
  padding: 12px 2px 3px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
}
.program-settings-actions .button { margin: 0; }
.row-actions { max-width: 100%; }
.row-actions .button { flex: 0 1 auto; max-width: 100%; }
.module-row, .page-row { overflow: hidden; }
.module-drag-handle { flex: 0 0 auto; }
.draggable-module { transition: opacity .12s ease, box-shadow .12s ease; }
.draggable-module.drag-over { outline-offset: -3px; }
@media (max-width: 1100px) {
  .two-column { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .program-settings-actions { padding-left: 0; padding-right: 0; }
}

.course-layout, .course-nav, .lesson { min-width: 0; max-width: 100%; }
.course-nav { width: 100%; }
.course-page-link { white-space: normal; overflow-wrap: anywhere; }
.app-frame, .content { min-width: 0; }
.content { overflow-x: clip; }


/* V6.2 program artwork rendering and page deletion polish */
.program-card-title { margin-top: 10px; }
.program-cover { overflow: hidden; }
.program-cover.has-color::after, .program-cover.has-image::after { display: none; }
.program-cover-color,
.program-cover-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.program-cover-color { z-index: 0; }
.program-cover-image { z-index: 1; object-fit: cover; object-position: center; }
.program-cover.has-image { min-height: 118px; height: 118px; }
.palette-swatch { background: #fff; }
.palette-swatch-1 { background: #F7F3EC; }
.palette-swatch-2 { background: #F2EEE6; }
.palette-swatch-3 { background: #EEF1ED; }
.palette-swatch-4 { background: #EEF2F6; }
.palette-swatch-5 { background: #F5EEEE; }
.palette-swatch-6 { background: #F3EFE7; }

/* V7 portal experience refresh */
:root {
  --navy: #0d2543;
  --navy-2: #1d3a5f;
  --ink: #17243a;
  --muted: #66758a;
  --champagne: #c7a66b;
  --cream: #f6f0e6;
  --paper: #fffdf9;
  --soft: #f4f6f8;
  --line: #dfe4ea;
  --shadow-soft: 0 16px 42px rgba(13,37,67,.08);
}
body { background: #f5f6f8; }
.sr-only, .visually-hidden-input { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
code { background: #f0f2f5; border-radius: 5px; padding: 2px 5px; font-size: .92em; }

/* Login / entry landing page */
.auth-shell { background: #ede8df; padding: 48px 24px; }
.auth-backdrop {
  background:
    linear-gradient(90deg, rgba(250,248,244,.92) 0%, rgba(250,248,244,.74) 45%, rgba(13,37,67,.06) 100%),
    radial-gradient(circle at 9% 18%, rgba(94,111,81,.25) 0 7%, transparent 17%),
    radial-gradient(circle at 88% 12%, rgba(199,166,107,.22) 0 9%, transparent 19%),
    linear-gradient(135deg, #e5dccf 0%, #f5f0e8 48%, #cdd7df 100%);
}
.auth-backdrop::before { width: 700px; height: 360px; border-radius: 52% 48% 0 0; left: -130px; bottom: -160px; background: rgba(13,37,67,.22); filter: blur(0); transform: rotate(-8deg); }
.auth-backdrop::after { width: 560px; height: 560px; right: -190px; top: -260px; background: rgba(199,166,107,.3); filter: blur(0); }
.auth-card { width: min(500px, 100%); padding: 44px 46px 36px; background: rgba(255,253,249,.95); border-color: rgba(13,37,67,.12); border-radius: 16px; box-shadow: 0 30px 90px rgba(13,37,67,.18); }
.auth-card::before { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(199,166,107,.22); border-radius: 11px; pointer-events: none; }
.wordmark { font-size: 25px; letter-spacing: .2em; }
.wordmark-sub { color: #8b7656; }
.auth-card section { margin-top: 42px; }
.auth-card h1 { font-size: 35px; }
.auth-help { position: relative; text-align: center; margin-top: 26px; font-size: 12px; }

/* Main shell */
.sidebar { background: linear-gradient(180deg, #0d2543 0%, #0a1d35 100%); padding-top: 24px; box-shadow: 8px 0 30px rgba(13,37,67,.08); }
.sidebar-brand { padding-bottom: 28px; letter-spacing: .16em; }
.nav-link { border-radius: 8px; padding: 11px 12px; }
.nav-link.active { background: rgba(255,255,255,.12); box-shadow: inset 3px 0 0 var(--champagne); }
.topbar { height: 70px; box-shadow: 0 1px 0 rgba(13,37,67,.05); }
.content { padding-top: 38px; }
.page-head { margin-bottom: 28px; }
.page-head h1 { letter-spacing: -.015em; }
.panel, .card, .table-wrap, .lesson { border-color: #dde2e8; box-shadow: 0 8px 24px rgba(13,37,67,.035); }
.button.secondary { background: #f7f0e4; border-color: #dfcba9; }

/* Dashboard welcome treatment */
.welcome-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, .42fr); gap: 28px; align-items: center; margin-bottom: 28px; padding: 10px 4px 2px; }
.welcome-panel h1 { margin-bottom: 8px; }

/* Program cards and persistent finder */
.program-card { border-radius: 13px; transition: transform .15s ease, box-shadow .15s ease; }
.program-card:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(13,37,67,.08); }
.program-body { padding: 18px; }
.program-filter-panel { margin: -4px 0 22px; padding: 16px; background: rgba(255,255,255,.82); border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 6px 20px rgba(13,37,67,.035); }
.program-filter-main { display: grid; grid-template-columns: minmax(240px, 1fr) 170px auto; gap: 9px; align-items: center; }
.program-filter-main input { background: #fff; }
.alpha-picker { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; }
.alpha-button { min-width: 31px; height: 30px; padding: 0 7px; border: 1px solid #d8dee6; border-radius: 7px; background: #fff; color: var(--navy); font-size: 11px; font-weight: 800; }
.alpha-button:hover:not(:disabled), .alpha-button.active { border-color: var(--navy); background: var(--navy); color: #fff; }
.alpha-button:disabled { opacity: .28; cursor: default; }
.program-filter-summary { margin-top: 9px; color: var(--muted); font-size: 12px; }
.program-filter-help { margin-top: 11px; padding-top: 11px; border-top: 1px solid rgba(13,37,67,.08); color: var(--muted); font-size: 12px; }
.program-filter-help[hidden] { display: none; }
.text-action { appearance: none; border: 0; padding: 0; background: transparent; color: var(--navy); font: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.text-action:hover { color: #8f6d37; }
.text-action:focus-visible { outline: 2px solid var(--champagne); outline-offset: 3px; border-radius: 2px; }

/* Classier inner contents navigation */
.course-layout { grid-template-columns: 285px minmax(0, 1fr); gap: 24px; }
.course-nav { background: linear-gradient(180deg, #fbf7f0 0%, #f4ecdf 100%); color: var(--ink); border: 1px solid #e3d5bf; border-radius: 14px; padding: 20px 0 14px; box-shadow: 0 14px 32px rgba(13,37,67,.07); }
.course-nav::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, var(--champagne), transparent 80%); }
.course-nav-kicker { padding: 0 18px 6px; color: #947744; text-transform: uppercase; letter-spacing: .15em; font-size: 9px; font-weight: 900; }
.course-nav-title { padding: 0 18px 18px; color: var(--navy); font-size: 20px; border-bottom: 1px solid rgba(164,130,78,.18); }
.course-module-title { display: flex; align-items: center; gap: 8px; padding: 15px 18px 6px; color: #8f6d37; font-size: 10px; letter-spacing: .08em; }
.course-module-title span { display: inline-grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; background: rgba(199,166,107,.16); color: #8f6d37; font-size: 9px; }
.course-page-link { display: grid; grid-template-columns: 36px minmax(0,1fr); align-items: start; color: #38475b; padding: 9px 18px; font-size: 12px; border-left: 3px solid transparent; }
.course-page-link:hover { background: rgba(13,37,67,.045); color: var(--navy); }
.course-page-link.active { background: #fff; color: var(--navy); border-left-color: var(--champagne); box-shadow: 0 3px 12px rgba(13,37,67,.04); font-weight: 700; }
.course-page-number { color: #a08251; font-size: 10px; font-variant-numeric: tabular-nums; padding-top: 1px; }
.course-nav-empty { padding: 18px; color: var(--muted); font-size: 12px; }
.lesson { border-radius: 14px; }

/* Explicit resource download controls */
.resource-actions { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.video-block-head > div { min-width: 0; }
.video-block-head > div strong { display: block; }
.video-block-head > div span { display: block; margin-top: 3px; }

/* People / CSV admin */
.people-summary { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.people-summary > div { padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: 11px; box-shadow: 0 5px 16px rgba(13,37,67,.03); }
.people-summary strong { display: block; color: var(--navy); font-family: Georgia, "Times New Roman", serif; font-size: 27px; }
.people-summary span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.csv-import-panel { padding: 0; overflow: hidden; }
.csv-import-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 18px 20px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.csv-file-button { display: inline-flex; align-items: center; margin: 0; cursor: pointer; }
.csv-drop-copy { padding: 44px 24px; text-align: center; }
.csv-review-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px; }
.csv-review-head h3 { margin-bottom: 5px; }
.csv-summary { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.csv-table { border-left: 0; border-right: 0; border-radius: 0; }
.status.error-status { background: #fde8e7; color: #a4251e; }
.csv-row-error td { background: #fff9f8; }
.csv-row-warning td { background: #fffdf7; }
.csv-review-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 20px; }
.csv-review-footer p { margin: 0; }

/* Account troubleshooting */
.account-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; max-width: 980px; }
.account-card, .reset-card { min-height: 220px; }
.reset-card { background: linear-gradient(145deg, #fffdf9, #f8f1e7); }

@media (max-width: 900px) {
  .welcome-panel { grid-template-columns: 1fr; }
  .people-summary { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .account-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .program-filter-main { grid-template-columns: 1fr; }
  .program-filter-main .button { width: 100%; }
  .alpha-picker { max-height: 74px; overflow-y: auto; }
  .people-summary { grid-template-columns: 1fr 1fr; }
  .csv-review-head, .csv-review-footer { display: grid; }
  .csv-summary { justify-content: flex-start; }

  /* Keep resource titles readable at phone/tablet widths.  Previously the
     actions became 100% wide before the resource card itself wrapped, which
     could squeeze a long title down to one character per line. */
  .resource-card { align-items: flex-start; flex-wrap: wrap; }
  .resource-card .resource-copy {
    flex: 1 1 calc(100% - 60px);
    min-width: min(220px, calc(100% - 60px));
    max-width: 100%;
  }
  .resource-copy strong, .drive-selected strong {
    overflow-wrap: break-word;
    word-break: normal;
  }
  .resource-actions { width: 100%; padding-left: 58px; }
  .video-block-head { align-items: flex-start; flex-direction: column; }
}
.program-download-modal { width: min(760px, 100%); }
.program-download-list { overflow: auto; padding: 8px 20px 20px; }
.program-download-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.program-download-row:last-child { border-bottom: 0; }
@media (max-width: 600px) { .program-download-row { align-items: flex-start; flex-wrap: wrap; } .program-download-row .button { margin-left: 56px; } }

/* V7.1 portal polish */
.auth-backdrop {
  background:
    linear-gradient(90deg, rgba(247,244,238,.88) 0%, rgba(247,244,238,.72) 42%, rgba(16,35,63,.18) 100%),
    url('/login-background.jpg') center center / cover no-repeat;
  transform: scale(1.015);
}
.auth-backdrop::before {
  inset: 0;
  width: auto;
  height: auto;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(16,35,63,.12));
  filter: none;
  opacity: 1;
}
.auth-backdrop::after {
  width: 360px;
  height: 360px;
  right: -150px;
  top: -150px;
  background: rgba(216,195,158,.55);
  filter: blur(8px);
  opacity: .42;
}
.auth-card { background: rgba(255,255,255,.94); box-shadow: 0 28px 80px rgba(16,35,63,.22); }

/* Dashboard quote / MOTD */
.welcome-message { justify-self: end; max-width: 340px; padding: 20px 24px; border-radius: 12px; box-shadow: var(--shadow-soft); line-height: 1.5; }
.welcome-message.quote { background: linear-gradient(135deg, #f6efe5, #efe0ca); color: #4f4232; font-family: Georgia, "Times New Roman", serif; font-size: 18px; font-style: italic; }
.welcome-message.quote > span { display: block; margin-top: 10px; font-family: Inter, ui-sans-serif, sans-serif; font-size: 10px; font-style: normal; letter-spacing: .12em; text-transform: uppercase; color: #79694f; }
.welcome-message.motd { background: linear-gradient(145deg, #10233f, #1b3556); color: #fff; font-size: 14px; }
.welcome-message.motd .message-label { display: block; margin-bottom: 9px; color: #d8c39e; text-transform: uppercase; letter-spacing: .14em; font-size: 9px; font-weight: 900; }

/* Program finder metadata */
.program-filter-meta { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.program-filter-ignore { margin-top: 9px; color: #8a7350; font-size: 11px; }

/* Inner program contents: higher contrast + collapsible rail */
.course-layout { transition: grid-template-columns .18s ease; }
.course-layout.nav-collapsed { grid-template-columns: 58px minmax(0, 1fr); }
.course-nav { overflow: hidden; transition: padding .18s ease, min-height .18s ease; }
.course-nav-toolbar { display: flex; align-items: center; gap: 8px; padding: 0 12px 10px 18px; border-bottom: 1px solid rgba(164,130,78,.18); }
.course-nav-toolbar .course-nav-kicker { flex: 1; padding: 0; }
.course-nav-toggle { flex: 0 0 30px; width: 30px; height: 30px; border: 1px solid #dfd0b8; border-radius: 8px; background: rgba(255,255,255,.72); color: var(--navy); font-size: 22px; line-height: 1; display: grid; place-items: center; }
.course-nav-toggle:hover { background: #fff; }
.course-nav-title { padding-top: 16px; font-size: 19px; line-height: 1.25; }
.course-module-title { padding-top: 18px; padding-bottom: 8px; color: #795923; font-size: 11px; letter-spacing: .055em; line-height: 1.3; }
.course-module-title strong { color: #6f5225; }
.course-page-link { grid-template-columns: 38px minmax(0,1fr); color: #26394f; padding: 10px 18px; font-size: 13.5px; line-height: 1.42; }
.course-page-link.active { color: #10233f; }
.course-page-number { color: #8c6b36; font-size: 11px; }
.course-layout.nav-collapsed .course-nav { padding: 11px 8px; min-height: 52px; }
.course-layout.nav-collapsed .course-nav::before { width: 3px; }
.course-layout.nav-collapsed .course-nav-toolbar { padding: 0; border: 0; justify-content: center; }
.course-layout.nav-collapsed .course-nav-kicker,
.course-layout.nav-collapsed .course-nav-title,
.course-layout.nav-collapsed .course-module-title,
.course-layout.nav-collapsed .course-page-link,
.course-layout.nav-collapsed .course-nav-empty { display: none; }
.course-layout.nav-collapsed .course-nav-toggle { width: 38px; height: 38px; flex-basis: 38px; }

/* Keep action labels intact and prevent narrow admin selects pushing buttons below awkwardly */
.button { white-space: nowrap; }
.inline-form { display: grid; grid-template-columns: minmax(0, 1fr) max-content; align-items: end; }
.inline-form > div { min-width: 0; }
.inline-form > select { min-width: 0; }
.inline-form .button { width: auto; align-self: end; }
.row-actions .button { white-space: nowrap; }
.table-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }

/* Programs & content filters / group visibility */
.manage-filter-panel { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(180px, .55fr) minmax(150px, .4fr) max-content; gap: 10px; align-items: end; padding: 16px; margin-bottom: 18px; background: #fff; border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 6px 20px rgba(13,37,67,.035); }
.manage-filter-panel label { margin: 0 0 7px; }
.group-chip-list { display: flex; gap: 5px; flex-wrap: wrap; min-width: 150px; }
.group-chip { display: inline-flex; align-items: center; padding: 4px 7px; border-radius: 999px; background: #f4ead9; color: #765a2d; font-size: 10.5px; font-weight: 700; }
.manage-program-table td:last-child { width: 1%; }

/* People/group access */
.access-explainer { display: flex; gap: 12px; align-items: baseline; padding: 14px 18px; margin-bottom: 18px; border-left: 4px solid var(--champagne); border-radius: 0 10px 10px 0; background: #fbf7f0; color: #4a5565; }
.access-explainer strong { color: var(--navy); }
.access-assign-form { margin-top: 14px; }
.access-subheading { margin: 20px 0 10px; font-family: Inter, ui-sans-serif, sans-serif; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #80683f; }
.access-program > span:first-child { display: grid; gap: 3px; flex: 1; }
.access-program small, .group-program-list small { color: var(--muted); font-size: 11px; }
.group-card-stats { display: flex; gap: 18px; margin: 4px 0 15px; color: var(--muted); font-size: 12px; }
.group-card-stats strong { color: var(--navy); font-size: 16px; }
.group-program-list { margin-top: 14px; }
.group-program-list .permission-item > span { display: grid; gap: 3px; }

/* Portal settings */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; max-width: 1120px; }
.settings-grid .panel { margin: 0; }
.settings-save { grid-column: 1 / -1; display: flex; justify-content: flex-start; }
.toggle-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; margin: 0 0 18px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfc; cursor: pointer; }
.toggle-row input { width: auto; margin: 3px 0 0; }
.toggle-row span { display: grid; gap: 3px; }
.toggle-row small { color: var(--muted); font-weight: 400; line-height: 1.45; }
.settings-prefixes { min-height: 130px; }
.settings-example { display: grid; gap: 4px; margin-top: 12px; padding: 12px 14px; border-radius: 9px; background: #f7f1e6; color: #665337; font-size: 12px; line-height: 1.5; }

@media (max-width: 1000px) {
  .manage-filter-panel { grid-template-columns: 1fr 1fr; }
  .manage-filter-panel .button { width: fit-content; }
}

@media (max-width: 900px) {
  .welcome-message { justify-self: stretch; max-width: none; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-save { grid-column: 1; }
  .course-layout.nav-collapsed { grid-template-columns: 1fr; }
  .course-layout.nav-collapsed .course-nav { width: 58px; justify-self: start; }
}

@media (max-width: 700px) {
  .manage-filter-panel { grid-template-columns: 1fr; }
  .manage-filter-panel .button { width: 100%; }
  .inline-form { grid-template-columns: 1fr; }
  .inline-form .button { width: 100%; }
  .access-explainer { display: grid; }
  .table-actions { flex-wrap: wrap; justify-content: flex-start; }
}
/* V7.1.2 — keep program cards at the established three-across desktop size.
   Empty grid tracks are retained, so one or two results do not stretch wider. */
.program-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

@media (max-width: 1120px) {
  .program-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .program-card-grid { grid-template-columns: minmax(0, 1fr); }
}


/* V7.2 — navigation, ordering, access and sign-in polish */

/* Sharper, more editorial login treatment: no blurred/watery decorative blobs. */
.auth-shell {
  place-items: center start;
  padding-left: clamp(28px, 8vw, 120px);
  padding-right: clamp(28px, 7vw, 90px);
  background: #f3efe7;
}
.auth-backdrop {
  background:
    linear-gradient(90deg, rgba(247,244,238,.98) 0%, rgba(247,244,238,.93) 34%, rgba(247,244,238,.55) 56%, rgba(13,37,67,.22) 100%),
    url('/login-background.jpg') center center / cover no-repeat;
  transform: none;
}
.auth-backdrop::before {
  inset: 0;
  width: auto;
  height: auto;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(13,37,67,.10));
  filter: none;
  opacity: 1;
  transform: none;
}
.auth-backdrop::after { display: none; }
.auth-card {
  width: min(470px, 100%);
  background: rgba(255,253,249,.975);
  border-color: rgba(13,37,67,.12);
  box-shadow: 0 26px 80px rgba(10,29,53,.22);
  backdrop-filter: none;
}
.auth-context {
  margin: 15px 0 0;
  padding: 11px 13px;
  border-left: 3px solid var(--champagne);
  border-radius: 0 8px 8px 0;
  background: #f8f1e6;
  color: #61523d;
  font-size: 13px;
  line-height: 1.55;
}

/* Account controls live where users expect them: on the signed-in name. */
.account-menu { position: relative; }
.user-chip {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 6px 8px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}
.user-chip:hover, .account-menu.open .user-chip { background: #f6f3ed; }
.user-chip-copy { display: grid; gap: 1px; line-height: 1.2; }
.user-chip-copy strong { font-size: 13px; color: var(--navy); }
.user-chip-copy small { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.user-chip-chevron { color: #8b7757; font-size: 14px; transition: transform .15s ease; }
.account-menu.open .user-chip-chevron { transform: rotate(180deg); }
.account-dropdown {
  position: absolute;
  z-index: 80;
  right: 0;
  top: calc(100% + 6px);
  min-width: 190px;
  padding: 7px;
  border: 1px solid #dde2e8;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(13,37,67,.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity .12s ease, transform .12s ease, visibility .12s ease;
}
.account-menu.open .account-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}
.account-dropdown button {
  width: 100%;
  border: 0;
  border-radius: 7px;
  background: transparent;
  padding: 10px 11px;
  color: var(--navy);
  text-align: left;
  font-size: 13px;
  font-weight: 700;
}
.account-dropdown button:hover { background: #f7f3ec; }

/* 1200x480 program artwork is 5:2. Preserve that ratio so artwork is not vertically cropped. */
.program-card-grid .program-cover,
.program-card-grid .program-cover.has-image {
  width: 100%;
  height: auto;
  min-height: 0;
  flex: 0 0 auto;
  aspect-ratio: 5 / 2;
}
.program-card-grid .program-cover-image { object-fit: cover; object-position: center top; }

/* Program default-order editor. */
.program-order-hint {
  margin: 0 0 10px;
  padding: 10px 13px;
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.45;
}
.program-order-hint.ready { background: #f6f1e8; color: #705a37; border: 1px solid #eadcc4; }
.program-order-hint.filtered { background: #f7f8fa; color: var(--muted); border: 1px solid var(--line); }
.program-order-column { width: 104px; }
.program-order-cell { white-space: nowrap; }
.program-order-cell > * { vertical-align: middle; }
.program-drag-handle { margin-right: 5px; }
.program-order-arrows { display: inline-flex; gap: 2px; margin-right: 6px; }
.mini-order-button {
  width: 25px;
  height: 25px;
  padding: 0;
  border: 1px solid #d9dee5;
  border-radius: 6px;
  background: #fff;
  color: var(--navy);
  font-size: 12px;
}
.mini-order-button:hover { background: #f6f1e8; border-color: #d3bf9e; }
.manage-program-table tr[data-program-order-row] { transition: opacity .12s ease, background .12s ease; }
.manage-program-table tr[data-program-order-row].dragging { opacity: .48; }
.manage-program-table tr[data-program-order-row].drag-over td { background: #fbf4e8; }

/* Group member lookup/typeahead. */
.member-lookup-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 10px;
  align-items: end;
}
.typeahead-field { position: relative; min-width: 0; }
.typeahead-menu {
  position: absolute;
  z-index: 70;
  left: 0;
  right: 0;
  top: calc(100% + 5px);
  display: none;
  max-height: 300px;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid #d9dee5;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 42px rgba(13,37,67,.14);
}
.typeahead-menu.open { display: block; }
.typeahead-option {
  width: 100%;
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.typeahead-option:hover, .typeahead-option:focus { background: #f7f3ec; outline: none; }
.typeahead-option strong { color: var(--navy); font-size: 13px; }
.typeahead-option span { color: var(--muted); font-size: 11px; }
.typeahead-empty { padding: 12px; color: var(--muted); font-size: 12px; }

/* Group choices on single-user creation. */
.group-selection-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 8px;
  margin-top: 8px;
}
.group-selection-option {
  margin: 0;
  padding: 10px 11px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fafbfc;
  cursor: pointer;
}
.group-selection-option:hover { border-color: #d3bf9e; background: #fbf7f0; }
.group-selection-option input { width: auto; margin: 3px 0 0; }
.group-selection-option span { display: grid; gap: 2px; }
.group-selection-option strong { color: var(--navy); font-size: 12px; }
.group-selection-option small { color: var(--muted); font-size: 10px; line-height: 1.35; }

.permission-divider { height: 1px; margin: 24px 0; background: var(--line); }
.permission-item span > small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.download-grants-panel { grid-column: 1 / -1; }
.resource-unavailable { max-width: 190px; color: var(--muted); font-size: 11px; line-height: 1.35; text-align: right; }

/* Friendly signed-in denial screen for stale/unassigned deep links. */
.friendly-notice {
  width: min(650px, 100%);
  margin: clamp(35px, 8vh, 100px) auto 0;
  padding: clamp(28px, 5vw, 54px);
  border: 1px solid #e2d4bb;
  border-radius: 18px;
  background: linear-gradient(145deg, #fffdf9, #f8f2e9);
  box-shadow: 0 20px 55px rgba(13,37,67,.08);
  text-align: center;
}
.friendly-notice-mark {
  width: 54px;
  height: 54px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 25px;
}
.friendly-notice .muted { max-width: 500px; margin: 0 auto 24px; }

@media (max-width: 760px) {
  .auth-shell { place-items: center; padding: 20px; }
  .auth-backdrop { background-position: 62% center; }
  .user-chip-copy { display: none; }
  .member-lookup-form { grid-template-columns: 1fr; }
  .member-lookup-form .button { width: 100%; }
  .group-selection-grid { grid-template-columns: 1fr; }
  .program-order-arrows { display: none; }
}


/* v7.2.1 whole-program publishing */
.publishing-summary{display:flex;flex-wrap:wrap;gap:10px;margin:16px 0}
.publishing-summary span{display:inline-flex;align-items:center;gap:5px;padding:8px 11px;border:1px solid rgba(16,35,63,.12);border-radius:999px;background:rgba(247,242,233,.72);font-size:.84rem;color:#46566a}
.publishing-summary strong{color:#10233f}
.publishing-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}


/* V7.3 session presence + page editor polish */
.page-editor-actions { margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line); justify-content: flex-end; }
#page-form { padding-bottom: 28px; }
.session-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 420px; }
.session-current { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; font-weight: 700; }
.session-location { min-width: 220px; max-width: 360px; }
.session-location strong, .session-location span { display: block; }
.session-location span { margin-top: 4px; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.session-help { margin-top: 12px; }
@media (max-width: 700px) { .session-summary { grid-template-columns: 1fr 1fr; } }

/* V7.3.1 — entire My Programs card opens the program; explicit controls remain independent. */
.program-card[data-program-card] { cursor: pointer; }
.program-card[data-program-card]:focus-visible {
  outline: 3px solid rgba(184, 140, 70, .48);
  outline-offset: 3px;
}
.program-card[data-program-card] .program-card-actions,
.program-card[data-program-card] .program-card-actions * { cursor: default; }
.program-card[data-program-card] .program-card-actions .button { cursor: pointer; }

/* V7.3.2 — softer default program card palette. */
.program-style-editor .palette-swatch { border-color: #d9d4ca; }

/* V7.3.3 — mobile program view: contents becomes a full-width accordion above the lesson. */
@media (max-width: 700px) {
  .course-layout,
  .course-layout.nav-collapsed {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px;
    width: 100%;
  }

  .course-nav,
  .course-layout.nav-collapsed .course-nav {
    position: static;
    top: auto;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    justify-self: stretch;
    padding: 0;
    border-radius: 12px;
  }

  .course-nav-toolbar,
  .course-layout.nav-collapsed .course-nav-toolbar {
    padding: 11px 13px 11px 15px;
    border-bottom: 1px solid rgba(164,130,78,.18);
    justify-content: space-between;
  }

  /* Keep the Contents label visible when the mobile accordion is closed. */
  .course-layout.nav-collapsed .course-nav-kicker {
    display: block;
    flex: 1;
  }

  .course-nav-toggle,
  .course-layout.nav-collapsed .course-nav-toggle {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    font-size: 20px;
  }

  .course-nav-title {
    padding: 14px 15px;
    font-size: 17px;
  }

  .course-module-title {
    padding: 13px 15px 6px;
  }

  .course-page-link {
    grid-template-columns: 34px minmax(0,1fr);
    padding: 9px 15px;
    font-size: 13px;
  }

  .lesson {
    width: 100%;
    min-width: 0;
    min-height: 0;
    padding: 20px 16px;
  }

  .lesson-header {
    gap: 10px;
  }

  .video-block-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .video-block-head span {
    width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .video-block video {
    max-height: 62vh;
  }

  .page-head {
    display: block;
  }

  .page-head .actions {
    margin-top: 12px;
  }
}

/* Administrator read-only user simulation */
.user-avatar.simulating {
  background: #8f5f18;
  box-shadow: 0 0 0 3px #f3dfb7;
}
.simulation-banner {
  position: sticky;
  top: 68px;
  z-index: 9;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 8px 18px;
  background: #fff5df;
  border-bottom: 1px solid #e4c98f;
  color: #654715;
  font-size: 12px;
  box-shadow: 0 2px 8px rgba(13,37,67,.04);
}
.simulation-banner[hidden] { display: none; }
.simulation-stop {
  border: 1px solid #cda960;
  border-radius: 999px;
  background: #fffdf8;
  color: #5b4013;
  padding: 6px 10px;
  font-weight: 700;
  font-size: 11px;
}
.simulation-results {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.simulation-user {
  width: 100%;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}
.simulation-user:hover,
.simulation-user:focus-visible {
  border-color: #c8b080;
  background: #fffaf1;
  box-shadow: 0 5px 16px rgba(16,35,63,.05);
}
.simulation-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f3ead9;
  color: var(--navy);
  font-weight: 800;
}
.simulation-user > span:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.simulation-user small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.simulation-user-action { color: #8a6427; font-size: 11px; font-weight: 700; white-space: nowrap; }
.simulation-account-note {
  margin: -8px 0 20px;
  padding: 11px 14px;
  border: 1px solid #e4c98f;
  border-radius: 9px;
  background: #fff5df;
  color: #654715;
  font-size: 12px;
}
.empty.compact { padding: 20px; }

@media (max-width: 900px) {
  .simulation-banner { top: 70px; justify-content: space-between; }
}
@media (max-width: 560px) {
  .simulation-banner { align-items: flex-start; flex-direction: column; gap: 7px; }
  .simulation-user { grid-template-columns: 34px minmax(0, 1fr); }
  .simulation-user-action { grid-column: 2; }
}
