/* Paired app themes. Print/email export styles retain their own document palette. */
@media screen {
  html:has(body.nomad-themed) {background:var(--ui-bg)!important;}
  body.nomad-themed {--theme-shadow:none;font-family:var(--theme-font);font-size:13px;line-height:1.45;background:var(--ui-bg)!important;}
  body.nomad-themed :is(button,input,select,textarea) {font-family:var(--theme-font);}
  body.nomad-themed strong {font-weight:650;}
  body.nomad-themed .info-tip::after {display:none;}
  body.nomad-themed .info-tip:hover::after,body.nomad-themed .info-tip:focus-visible::after {display:block;}
  body.nomad-themed :is(button,.tab,.view,.picker-btn,.action) {font-size:12px;font-weight:600;min-height:36px;padding:8px 12px;border-radius:calc(var(--theme-radius)*.65)!important;}
  body.nomad-themed :is(input,select,textarea,.mini-search) {border-radius:calc(var(--theme-radius)*.45)!important;}
  body.nomad-themed :is(button.primary,.primary,.picker-btn.active,.block-choice.active),
  body.nomad-themed :is(#buildButton,#saveShared,#scheduleReturnSetup,#editBoardAbsences,#scheduleActionsOpen,#scheduleWorkspaceSave),
  body.nomad-themed :is(button.primary,.picker-btn.active,.block-choice.active):hover {
    background:var(--ui-blue)!important;border-color:var(--ui-blue)!important;color:var(--theme-primary-ink)!important;
  }
  body.nomad-themed :is(button,input,select,textarea,[contenteditable]):focus-visible {outline:2px solid var(--theme-accent);outline-offset:3px;}
  body.nomad-themed .theme-icon {width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0;}
  body.nomad-themed :is(.card,.admin-card,.metric,.table-wrap,.schedule-workspace) {border-radius:var(--theme-radius)!important;box-shadow:var(--theme-shadow)!important;}

  /* One shell around the real app views, with the preview's navigation and hierarchy. */
  body.nomad-themed #appShell {width:100%!important;max-width:none!important;margin:0 auto!important;padding:16px 24px 24px 16px!important;min-height:100dvh;gap:0 24px;align-items:start;background:transparent!important;}
  body.nomad-themed #appShell:not(.auth-hidden) {display:grid!important;grid-template-columns:194px minmax(0,1fr);grid-template-rows:auto 1fr;}
  body.nomad-themed.layout-standard #appShell {max-width:1640px!important;}
  body.nomad-themed #appShell>.page {min-width:0;grid-column:2;grid-row:2;}
  body.nomad-themed #appShell>.top {grid-column:2;grid-row:1;position:relative!important;left:auto!important;width:100%!important;margin:0!important;padding:0 0 12px!important;min-height:50px;display:flex;gap:12px;background:transparent!important;border:0!important;border-bottom:1px solid var(--ui-line)!important;box-shadow:none!important;border-radius:0!important;}
  body.nomad-themed #appShell>.top>.app-brand {display:none;}
  body.nomad-themed #headerSettings {display:none;}
  body.nomad-themed .theme-top-context {display:flex;justify-content:space-between;align-items:center;gap:16px;flex:1;min-width:0;color:var(--ui-muted);font-size:11px;}
  body.nomad-themed .theme-top-context strong {font-weight:500;}
  body.nomad-themed #themeTopDate {text-align:right;}
  body.nomad-themed .header-workflow-actions button {font-size:11px;min-height:31px;padding:6px 10px;}
  body.nomad-themed #userBox {flex:0 0 auto;}
  body.nomad-themed .profile-menu {background:var(--ui-panel)!important;color:var(--ui-text)!important;border-color:var(--ui-line)!important;}
  body.nomad-themed #profileMenuThemeToggle {background:var(--theme-accent-soft)!important;color:var(--theme-accent)!important;border-color:var(--ui-line)!important;}
  .theme-sidebar {grid-column:1;grid-row:1/span 2;position:sticky;top:16px;display:flex;flex-direction:column;align-self:start;min-height:calc(100dvh - 32px);max-height:calc(100dvh - 32px);overflow:auto;padding:20px 12px;border:1px solid var(--ui-line);border-radius:var(--theme-radius);background:var(--ui-panel);}
  .theme-brand {display:flex;align-items:center;gap:10px;font-size:27px;font-weight:750;letter-spacing:-1.4px;}
  .theme-brand-mark {display:grid;place-items:center;width:32px;height:32px;border-radius:9px;background:var(--ui-blue);color:var(--theme-primary-ink);font-size:23px;font-weight:500;}
  .theme-school {margin-top:22px;padding:18px 8px 8px;border-top:1px solid var(--ui-line);}
  .theme-school small,.theme-school strong {display:block;overflow-wrap:anywhere;}
  .theme-school strong {margin-top:5px;font-size:13px;font-weight:650;}
  .theme-school small {font-size:11px;}
  .theme-nav-label {padding:24px 10px 11px;font-size:9px;font-weight:700;letter-spacing:1.8px;text-transform:uppercase;color:var(--ui-muted);}
  .theme-sidebar nav {display:flex;flex-direction:column;gap:7px;}
  body.nomad-themed .theme-sidebar button {display:flex;align-items:center;gap:10px;width:100%;min-height:42px;padding:11px 10px;text-align:left;font-size:12px;background:transparent!important;border:1px solid transparent!important;color:var(--ui-muted)!important;}
  body.nomad-themed .theme-sidebar button.active {background:var(--theme-accent-soft)!important;color:var(--theme-accent)!important;}
  body.nomad-themed .theme-sidebar button:disabled {opacity:.55;}
  .theme-sidebar-bottom {margin-top:auto;padding-top:24px;}
  body.nomad-themed #themeModeToggle {border-top:1px solid var(--ui-line)!important;border-radius:0!important;margin-top:12px;padding-top:16px;}
  .theme-account {display:flex;align-items:center;gap:10px;margin:12px 6px 0;}
  #themeAccountInitial {display:grid;place-items:center;width:31px;height:31px;flex-shrink:0;border-radius:50%;background:var(--theme-accent-soft);color:var(--theme-accent);font-weight:700;}
  .theme-account div {min-width:0;}
  .theme-account strong {display:block;font-size:11px;overflow-wrap:anywhere;}
  .theme-account small {display:block;font-size:10px;margin-top:3px;}
  .theme-kicker {font-size:10px;text-transform:uppercase;letter-spacing:1.8px;color:var(--theme-accent);font-weight:700;margin-bottom:10px;}
  .theme-page-heading {display:flex;align-items:center;justify-content:space-between;gap:20px;margin:28px 0 22px;}
  body.nomad-themed :is(.theme-page-heading h2,#boardTitle,.settings-hero h2) {font-family:var(--theme-heading);font-size:34px;line-height:1.12;font-weight:650;letter-spacing:-1.1px;margin:0 0 9px;}
  .theme-page-heading p {margin:0;color:var(--ui-muted);font-size:12px;}

  /* Setup: schedule cards above a day/substitute column and the absence panel. */
  body.nomad-themed #setupPage .setup-manage-row {justify-content:flex-end;}
  body.nomad-themed #setupPage .setup-schedule-method {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:0 0 18px;}
  body.nomad-themed #setupPage .setup-schedule-method>button {padding:19px;min-height:84px;border-radius:var(--theme-radius)!important;background:var(--ui-panel)!important;border-color:var(--ui-line)!important;box-shadow:var(--theme-shadow)!important;position:relative;}
  body.nomad-themed #setupPage .setup-schedule-method>button span {font-size:14px;font-weight:650;color:var(--ui-text);}
  body.nomad-themed #setupPage .setup-schedule-method>button strong {font-size:11px;font-weight:400;color:var(--ui-muted);padding-right:15px;}
  body.nomad-themed #setupPage .setup-schedule-method>button::after {content:'↗';position:absolute;right:18px;top:30px;color:var(--theme-accent);font-size:19px;}
  .theme-setup-grid {display:grid;grid-template-columns:1.05fr 1fr;gap:16px;align-items:stretch;}
  .theme-setup-stack {display:flex;flex-direction:column;gap:16px;min-width:0;}
  body.nomad-themed #setupPage .card {padding:20px;margin:0;min-width:0;}
  .theme-section-heading {display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px;}
  .theme-section-heading h3 {margin:0;font-size:15px;font-weight:650;}
  .theme-section-heading>span {font-size:10px;border-radius:30px;background:var(--theme-accent-soft);color:var(--theme-accent);padding:5px 9px;white-space:nowrap;}
  body.nomad-themed #setupPage .setup-cycle-only {grid-template-columns:1fr 1fr!important;max-width:none;gap:15px;margin-bottom:16px;}
  body.nomad-themed #setupPage label {font-size:11px;font-weight:500;color:var(--ui-muted);margin:0 0 8px;}
  body.nomad-themed #setupPage :is(input,select) {min-height:38px;padding:8px 10px;font-size:12px;}
  body.nomad-themed #setupBoardDate {max-width:none;width:100%;}
  body.nomad-themed #cycleCalendarStatus {font-size:11px;margin:0 0 10px;}
  body.nomad-themed .setup-cycle-row {display:flex;align-items:center;flex-wrap:wrap;gap:12px;}
  body.nomad-themed #cycleDayButtons {gap:6px;display:flex;flex-wrap:wrap;}
  body.nomad-themed #cycleDayButtons button {width:32px;min-width:32px;min-height:32px;padding:5px;font-weight:500;}
  body.nomad-themed #setupSavedToday {font-size:10px;min-height:32px;background:var(--ui-green-bg)!important;color:var(--ui-green)!important;border-color:var(--ui-line)!important;}
  body.nomad-themed .theme-absences-card .quick-card {margin:0 0 14px;padding:14px 0 0;border:0!important;border-top:1px solid var(--ui-line)!important;border-radius:0!important;box-shadow:none!important;background:transparent!important;}
  body.nomad-themed .theme-absences-card .section-title-row {gap:10px;align-items:center;}
  body.nomad-themed .theme-absences-card h3 {font-size:12px;font-weight:650;}
  body.nomad-themed .theme-absences-card .mini-search {width:145px;max-width:50%;min-height:28px!important;font-size:10px!important;padding:5px 7px!important;}
  body.nomad-themed #setupPage :is(.quick-pick,.selected-pill) {font-size:11px;font-weight:500;padding:6px 9px;border-radius:calc(var(--theme-radius)*.7)!important;background:var(--ui-panel-2)!important;}
  body.nomad-themed #setupPage .quick-pick.added,body.nomad-themed #setupPage .quick-pick.added small {color:var(--theme-accent)!important;background:var(--theme-accent-soft)!important;border-color:var(--theme-accent)!important;}
  body.nomad-themed #setupPage .quick-picks {gap:6px;max-height:200px;overflow-y:auto;align-content:start;}
  body.nomad-themed #setupPage .selected-list {padding:9px 10px;background:var(--ui-panel-2)!important;border-color:transparent!important;border-radius:calc(var(--theme-radius)*.45)!important;font-size:11px;}
  .theme-sub-list {margin-top:16px;}
  .theme-sub-list>strong {font-size:11px;font-weight:600;color:var(--ui-muted);}
  body.nomad-themed #setupPage .theme-build-card {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:14px;margin-top:16px;padding:18px 20px;}
  .theme-build-card h3 {font-size:14px;margin:0 0 4px;}
  .theme-build-card p {font-size:11px;color:var(--ui-muted);margin:0;}
  .theme-build-actions {display:flex;gap:8px;flex-wrap:wrap;}

  /* Coverage keeps the working cells, drag/drop, manual text, and staff controls. */
  body.nomad-themed #boardPage .board-control-card {padding:0!important;margin:28px 0 18px;border:0!important;background:transparent!important;box-shadow:none!important;gap:10px;}
  body.nomad-themed #boardPage .board-control-top {display:flex;justify-content:space-between;align-items:center;gap:16px;margin:0;}
  body.nomad-themed #boardPage .board-title-block {min-width:0;}
  body.nomad-themed #boardMessage {font-size:12px;margin-top:10px;}
  body.nomad-themed #boardPage .board-actions {justify-content:flex-end;gap:8px;}
  body.nomad-themed #boardPage .board-actions button {min-width:0;min-height:38px;padding:9px 12px;border-color:var(--ui-line)!important;background:var(--ui-panel)!important;color:var(--ui-text)!important;}
  body.nomad-themed #boardPage #saveShared {background:var(--ui-blue)!important;border-color:var(--ui-blue)!important;color:var(--theme-primary-ink)!important;}
  body.nomad-themed .board-live-status :is(.change-state,.status) {font-size:10px;padding:4px 8px;background:var(--ui-panel-2)!important;}
  body.nomad-themed #boardSummary {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:0 0 16px;}
  body.nomad-themed #boardSummary .metric {padding:17px 19px;font-size:11px;font-weight:400;color:var(--ui-muted)!important;}
  body.nomad-themed #boardSummary strong {font-size:29px;letter-spacing:-1px;font-weight:650;color:var(--ui-text);margin-bottom:5px;}
  .theme-absence-summary {margin-bottom:14px;font-size:11px;color:var(--ui-muted);}
  .theme-absence-summary>summary {cursor:pointer;}
  body.nomad-themed #boardPage .views {gap:5px;margin:14px 0 12px;background:transparent!important;border:0!important;padding:0;}
  body.nomad-themed #boardPage .views button {background:transparent!important;border-color:transparent!important;color:var(--ui-muted)!important;}
  body.nomad-themed #boardPage .views button.active {background:var(--theme-accent-soft)!important;border-color:var(--ui-line)!important;color:var(--theme-accent)!important;}
  body.nomad-themed #boardContainer.board-layout {display:block;}
  body.nomad-themed #boardContainer .board-page-grid {display:grid!important;grid-template-columns:minmax(0,1fr) 210px!important;gap:16px!important;align-items:start;}
  body.nomad-themed #boardContainer .staff-panel-slot {grid-column:2;grid-row:1;position:sticky;top:16px;min-width:0;height:auto;max-height:calc(100dvh - 40px);}
  body.nomad-themed #boardContainer .board-page-grid>.staff-panel-slot+div {grid-column:1;grid-row:1;min-width:0;}
  body.nomad-themed #boardContainer .board-toolbar {background:transparent!important;border:0!important;padding:0 0 9px!important;margin:0!important;box-shadow:none!important;}
  body.nomad-themed #boardContainer .board-toolbar h3 {display:none;}
  body.nomad-themed .board-legend {font-size:10px;gap:8px;flex-wrap:wrap;}
  body.nomad-themed .board-legend :is(.legend-label,.legend-pill) {font-size:9px;background:transparent!important;border:0!important;padding:2px;}
  body.nomad-themed #boardContainer .table-wrap {padding:0 6px 6px!important;background:var(--ui-panel)!important;overflow-x:auto;max-width:100%;}
  body.nomad-themed #boardContainer .coverage-table {width:100%;min-width:720px;table-layout:fixed;border-collapse:separate;border-spacing:6px 8px!important;background:transparent!important;}
  body.nomad-themed #boardContainer .coverage-table :is(th,td) {font-size:11px;border:0!important;padding:8px 7px;}
  body.nomad-themed #boardContainer .coverage-table thead th {background:var(--ui-panel)!important;color:var(--ui-muted)!important;font-size:11px;letter-spacing:0;text-transform:none;font-weight:600;}
  body.nomad-themed #boardContainer .coverage-table :is(th,td):first-child {width:112px;min-width:112px;max-width:112px;}
  body.nomad-themed #boardContainer .coverage-table td.coverage-row-target {background:var(--ui-panel)!important;font-size:11px;vertical-align:middle;word-break:normal;overflow-wrap:anywhere;}
  body.nomad-themed #boardContainer .coverage-table td.coverage-row-target .muted {font-size:10px;color:var(--ui-muted)!important;}
  body.nomad-themed #boardContainer .coverage-table td.need-cell {border-radius:calc(var(--theme-radius)*.55)!important;border:1px solid var(--ui-line)!important;min-width:0;vertical-align:top;}
  body.nomad-themed #boardContainer .coverage-table td.need-cell.covered {background:var(--ui-green-bg)!important;color:var(--ui-text)!important;border-color:color-mix(in srgb,var(--ui-green) 25%,var(--ui-panel))!important;}
  body.nomad-themed #boardContainer .coverage-table td.need-cell.uncovered {background:var(--theme-warning-bg)!important;color:var(--ui-text)!important;border-color:color-mix(in srgb,var(--theme-warning) 28%,var(--ui-panel))!important;}
  body.nomad-themed #boardContainer .coverage-table td:empty {background:var(--ui-panel-2)!important;border-radius:calc(var(--theme-radius)*.55);}
  body.nomad-themed #boardContainer .coverage-slot {min-width:0;font-size:11px;}
  body.nomad-themed #boardContainer .coverage-slot>strong {font-size:11px;font-weight:650;}
  body.nomad-themed #boardContainer :is(.need-meta,.room-display,.need-students,.chain-opened-from) {font-size:10px!important;color:var(--ui-muted);}
  body.nomad-themed #boardContainer .room-display {background:transparent;border:0;padding:0;margin:5px 0;}
  body.nomad-themed #boardContainer .room-display strong {font-size:10px;font-weight:500;}
  body.nomad-themed #boardContainer .assignment-row {gap:5px;margin-top:8px;}
  body.nomad-themed #boardContainer .assignment {font-size:10px;font-weight:650;padding:5px;background:var(--ui-green-bg)!important;color:var(--ui-green)!important;border:0!important;border-top:1px solid color-mix(in srgb,var(--ui-green) 25%,transparent)!important;border-radius:0!important;}
  body.nomad-themed #boardContainer .assignment::after {font-size:8px;}
  body.nomad-themed #boardContainer .manual-cover-input {min-width:0;min-height:25px;height:25px;padding:3px 5px;font-size:10px!important;}
  body.nomad-themed #boardContainer .replacement-plus-select {min-width:26px;width:26px;min-height:25px;height:25px;padding:1px;font-size:14px;}
  body.nomad-themed #boardContainer :is(.chain-hint,.chain-badge) {font-size:9px;}
  body.nomad-themed #boardContainer .coverage-program-header th {background:var(--ui-panel-2)!important;color:var(--theme-accent)!important;padding:8px 10px!important;font-size:10px!important;letter-spacing:1px;border:0!important;text-transform:uppercase;border-radius:calc(var(--theme-radius)*.4);}
  body.nomad-themed #boardContainer .staff-panel {width:100%;height:auto!important;padding:16px 13px!important;max-height:calc(100dvh - 40px);background:var(--ui-panel)!important;}
  body.nomad-themed #boardContainer .staff-panel h3 {font-size:13px;font-weight:650;}
  body.nomad-themed #boardContainer .staff-counts {gap:5px;margin:12px 0;}
  body.nomad-themed #boardContainer .staff-count {background:var(--ui-panel-2)!important;border-color:var(--ui-line)!important;padding:6px;font-size:9px;}
  body.nomad-themed #boardContainer .staff-count strong {font-size:17px;}
  body.nomad-themed #staffList {background:transparent!important;max-height:65dvh;padding:0;}
  body.nomad-themed #staffList .staff-chip {background:transparent!important;border:0!important;border-top:1px solid var(--ui-line)!important;border-radius:0!important;padding:12px 0;margin:0;box-shadow:none!important;}
  body.nomad-themed #staffList .staff-chip strong {font-size:11px;font-weight:650;}
  body.nomad-themed #staffList :is(.staff-chip-status,.staff-chip-meta) {font-size:9px;color:var(--ui-muted)!important;}
  body.nomad-themed #staffList .staff-chip-blocks {gap:3px;}
  body.nomad-themed #staffList .staff-block-badge {font-size:9px;padding:3px;min-width:22px;}
  body.nomad-themed #boardInlineActions {margin-top:18px;padding-top:15px;border-color:var(--ui-line);gap:16px;}

  /* Schedules retain their actual editable grid and independently scrolling data. */
  body.nomad-themed #scheduleSystemToolbar {background:transparent!important;border:0!important;padding:0!important;margin:0 0 16px!important;box-shadow:none!important;gap:12px;}
  body.nomad-themed .schedule-workspace-groups {border:1px solid var(--ui-line);background:var(--ui-panel-2);padding:4px;border-radius:calc(var(--theme-radius)*.7);gap:5px;}
  body.nomad-themed .schedule-workspace-groups button {padding:8px 20px!important;background:transparent!important;border:0!important;color:var(--ui-muted)!important;box-shadow:none!important;}
  body.nomad-themed .schedule-workspace-groups button.active {background:var(--ui-panel)!important;color:var(--theme-accent)!important;border-color:var(--ui-line)!important;box-shadow:0 1px 3px #0000000d!important;}
  body.nomad-themed .schedule-workspace {gap:0;border:1px solid var(--ui-line);background:var(--ui-panel)!important;overflow:hidden;}
  body.nomad-themed .schedule-system-status {padding:16px 18px;background:var(--ui-panel)!important;border-color:var(--ui-line)!important;gap:12px;flex-wrap:wrap;}
  body.nomad-themed #scheduleWorkspaceHeading {font-size:16px;font-weight:650;}
  body.nomad-themed #scheduleWorkspaceCount {color:var(--ui-muted);font-size:11px;}
  body.nomad-themed #scheduleWorkspaceSaveState {color:var(--ui-green);font-size:10px;background:var(--ui-green-bg);border-radius:30px;padding:5px 8px;}
  body.nomad-themed .schedule-system-status:has(#scheduleWorkspaceSave:not(:disabled)) #scheduleWorkspaceSaveState {color:var(--theme-warning);background:var(--theme-warning-bg);}
  body.nomad-themed .schedule-workspace-day-filter {padding:13px 18px;background:var(--ui-panel)!important;border-color:var(--ui-line)!important;gap:14px;flex-wrap:wrap;}
  body.nomad-themed .schedule-workspace-day-tabs button {min-width:30px;min-height:30px;padding:5px 8px;font-weight:500;}
  body.nomad-themed .schedule-workspace-day-tabs button.active {background:var(--ui-blue)!important;color:var(--theme-primary-ink)!important;border-color:var(--ui-blue)!important;}
  body.nomad-themed .schedule-row-help {font-size:10px;padding:9px 18px;color:var(--ui-muted);}
  body.nomad-themed .schedule-grid-shell {min-width:0;background:var(--ui-panel)!important;}
  body.nomad-themed .schedule-grid-wrap {max-height:72dvh;background:var(--ui-panel)!important;}
  body.nomad-themed #schedulesPage .schedule-edit-grid {background:var(--ui-panel)!important;border-color:var(--ui-line)!important;}
  body.nomad-themed #schedulesPage .schedule-edit-grid :is(th,td) {border-color:var(--ui-line)!important;background:var(--ui-panel)!important;color:var(--ui-text)!important;}
  body.nomad-themed #schedulesPage .schedule-edit-grid thead th {background:var(--ui-panel-2)!important;color:var(--ui-muted)!important;font-weight:600;font-size:11px;padding:12px 9px!important;}
  body.nomad-themed #schedulesPage .schedule-edit-grid :is(th,td)[data-block-column="true"] {border-left:1px solid var(--ui-line)!important;min-width:145px!important;}
  body.nomad-themed #schedulesPage .schedule-edit-grid :is(th,td)[data-sticky-name] {width:153px;min-width:153px;max-width:153px;}
  body.nomad-themed #schedulesPage .schedule-edit-grid :is(th,td)[data-sticky-name="2"] {left:197px;}
  body.nomad-themed #schedulesPage .schedule-edit-grid td:has(.pmt-status-toggle) {background:var(--ui-panel)!important;}
  body.nomad-themed #schedulesPage .schedule-column-header-toggle button {background:var(--ui-panel-2)!important;color:var(--theme-accent)!important;border-color:var(--ui-line)!important;}
  body.nomad-themed #schedulesPage .schedule-edit-grid .schedule-structured-cell {padding:9px 8px!important;min-height:65px;}
  body.nomad-themed #schedulesPage .schedule-edit-grid .schedule-structured-line {margin:0!important;font-weight:400;}
  body.nomad-themed #schedulesPage .schedule-edit-grid .schedule-structured-line input {font-family:var(--theme-font)!important;font-size:11px!important;color:var(--ui-text)!important;}
  body.nomad-themed #schedulesPage .schedule-edit-grid .schedule-structured-line.derived input {color:var(--theme-accent)!important;}
  body.nomad-themed #schedulesPage .schedule-edit-grid .schedule-edit-cell {font-family:var(--theme-font);font-size:12px;padding:10px 8px;}
  body.nomad-themed #schedulesPage .schedule-edit-grid .schedule-program-header th {background:var(--theme-accent-soft)!important;color:var(--theme-accent)!important;padding:8px 12px!important;font-size:10px!important;letter-spacing:1px;border:0!important;}
  body.nomad-themed #schedulesPage .schedule-edit-grid .schedule-program-editor {color:var(--theme-accent)!important;background:transparent!important;font-family:var(--theme-font);padding:0;min-height:18px;font-size:10px;}
  body.nomad-themed #schedulesPage .schedule-edit-grid td.schedule-empty-class-block {background:var(--ui-panel-2)!important;box-shadow:inset 0 0 0 1px var(--theme-accent-soft)!important;}
  body.nomad-themed #schedulesPage .schedule-edit-grid tr.selected>td {box-shadow:inset 0 0 0 1px var(--theme-accent)!important;}
  body.nomad-themed .pmt-status-toggle {background:var(--ui-green-bg)!important;color:var(--ui-green)!important;border-color:var(--ui-line)!important;font-size:10px;font-weight:600;min-height:28px;}
  body.nomad-themed .pmt-status-toggle.inactive {background:var(--ui-panel-2)!important;color:var(--ui-muted)!important;}
  body.nomad-themed .pmt-status-toggle.pending {background:var(--theme-warning-bg)!important;color:var(--theme-warning)!important;}

  /* Settings: style families first, then the ten paired color schemes. */
  body.nomad-themed .settings-hero {background:transparent!important;border:0!important;box-shadow:none!important;margin:28px 0 20px;padding:0!important;}
  body.nomad-themed .settings-shell.refined-settings {grid-template-columns:200px minmax(0,1fr);gap:20px;}
  body.nomad-themed .settings-nav.refined-nav {border:0!important;border-right:1px solid var(--ui-line)!important;border-radius:0!important;background:transparent!important;padding:0 15px 0 0;box-shadow:none!important;}
  body.nomad-themed .settings-nav button {font-size:11px;min-height:34px;}
  body.nomad-themed .settings-nav button.active {background:var(--theme-accent-soft)!important;color:var(--theme-accent)!important;border-color:var(--ui-line)!important;}
  body.nomad-themed .app-theme-picker {padding:22px!important;}
  .theme-picker-heading {display:flex;justify-content:space-between;align-items:start;gap:16px;}
  .theme-picker-heading h3 {font-size:25px;font-family:var(--theme-heading);font-weight:600;margin-bottom:8px;}
  .theme-current {font-size:10px;padding:6px 9px;border-radius:30px;background:var(--theme-accent-soft);color:var(--theme-accent);white-space:nowrap;}
  body.nomad-themed .settings-mode-card {background:var(--ui-panel-2)!important;border:1px solid var(--ui-line)!important;border-radius:calc(var(--theme-radius)*.7)!important;padding:16px;margin:18px 0 24px;}
  .settings-mode-actions {display:flex;gap:6px;}
  body.nomad-themed .settings-mode-actions button.active {background:var(--ui-blue)!important;color:var(--theme-primary-ink)!important;border-color:var(--ui-blue)!important;}
  .theme-picker-step {font-size:10px;text-transform:uppercase;letter-spacing:1.6px;margin:0 0 14px;color:var(--ui-muted);font-weight:600;}
  .theme-family-grid {display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;}
  .theme-scheme-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;}
  body.nomad-themed :is(.theme-family-choice,.theme-scheme-choice) {display:block;min-width:0;width:100%;padding:0!important;border:1px solid var(--ui-line)!important;border-radius:10px!important;background:var(--ui-panel)!important;overflow:hidden;text-align:left;box-shadow:none!important;}
  body.nomad-themed :is(.theme-family-choice,.theme-scheme-choice).active {outline:2px solid var(--theme-accent);outline-offset:2px;border-color:var(--theme-accent)!important;}
  .theme-family-choice img,.theme-scheme-choice img {display:block;width:100%;height:auto;aspect-ratio:3;object-fit:cover;}
  .theme-family-choice>span {display:block;padding:10px 9px;}
  .theme-family-choice strong {display:block;font-size:12px;font-weight:650;}
  .theme-family-choice small {display:block;font-size:9px;margin-top:4px;}
  .theme-scheme-heading {display:flex;justify-content:space-between;align-items:end;gap:15px;margin:28px 0 16px;}
  .theme-scheme-heading h3 {font-size:21px;font-family:var(--theme-heading);font-weight:600;margin-bottom:7px;}
  .theme-scheme-heading .admin-sub {font-size:11px;margin:0;}
  .theme-pair-label {font-size:10px;white-space:nowrap;color:var(--ui-muted);}
  .theme-scheme-meta {display:flex;flex-direction:column;gap:10px;padding:12px;}
  .theme-scheme-name {display:flex;gap:8px;align-items:baseline;}
  .theme-scheme-name small {font-size:10px;font-weight:400;}
  .theme-scheme-name strong {font-size:13px;font-weight:650;}
  .theme-swatches {display:flex;gap:4px;}
  .theme-swatches i {display:block;width:24px;height:6px;border-radius:4px;}
  .theme-scheme-state {font-size:10px;color:var(--ui-muted);}
  .theme-scheme-choice.active .theme-scheme-state {color:var(--theme-accent);font-weight:650;}
  .theme-picker-footer {display:flex;justify-content:space-between;align-items:center;gap:20px;border-top:1px solid var(--ui-line);padding-top:18px;margin-top:24px;font-size:11px;color:var(--ui-muted);}
  .theme-picker-footer>div:last-child {display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end;}
  body.nomad-themed .theme-login-settings {padding:18px!important;margin-top:16px;}
  .theme-login-settings summary {cursor:pointer;font-size:13px;font-weight:600;}
  .theme-login-settings[open] summary {margin-bottom:16px;}
  .app-theme-preview-dialog {width:min(1320px,95vw);max-height:94dvh;border:1px solid var(--ui-line);border-radius:16px;background:var(--ui-panel);color:var(--ui-text);padding:20px;overflow:auto;}
  .app-theme-preview-dialog::backdrop {background:#101821b8;backdrop-filter:blur(4px);}
  .theme-preview-heading {display:flex;align-items:center;justify-content:space-between;gap:20px;}
  .theme-preview-heading h2 {font-family:var(--theme-heading);font-size:22px;}
  .app-theme-preview-dialog p {font-size:12px;color:var(--ui-muted);}
  .app-theme-preview-dialog img {display:block;width:100%;height:auto;margin-top:18px;}

  /* The ten visual families use the same component treatments as their images. */
  body.nomad-themed[data-theme-family="nordic"] {--theme-shadow:0 4px 24px #00000004;}
  body.nomad-themed[data-theme-family="nordic"] .theme-sidebar {background:transparent;border:0;}
  body.nomad-themed[data-theme-family="nordic"] :is(.card,.metric) {border-color:transparent!important;}
  body.nomad-themed[data-theme-family="nordic"] button {border-radius:30px!important;}
  body.nomad-themed[data-theme-family="nordic"] :is(.theme-page-heading h2,#boardTitle) {font-size:36px;font-weight:500;}
  body.nomad-themed[data-theme-family="botanical"] {--theme-shadow:0 4px 10px #00000004;}
  body.nomad-themed[data-theme-family="botanical"] .theme-sidebar {background:var(--theme-rail);color:var(--theme-rail-ink);border:0;}
  body.nomad-themed[data-theme-family="botanical"] .theme-sidebar :is(small,.theme-nav-label,button) {color:#c4d1ca!important;}
  body.nomad-themed[data-theme-family="botanical"] .theme-sidebar button.active {background:#ffffff19!important;color:white!important;}
  body.nomad-themed[data-theme-family="botanical"] :is(.theme-school,#themeModeToggle) {border-color:#ffffff22!important;}
  body.nomad-themed[data-theme-family="botanical"] :is(.theme-page-heading h2,#boardTitle) {font-size:39px;font-weight:400;}
  body.nomad-themed[data-theme-family="botanical"] :is(button,.quick-pick) {border-radius:30px!important;}
  body.nomad-themed[data-theme-family="editorial"] :is(.theme-page-heading h2,#boardTitle) {font-size:45px;font-weight:400;}
  body.nomad-themed[data-theme-family="editorial"] #boardSummary .metric {background:transparent!important;border:0!important;border-left:2px solid var(--theme-accent)!important;}
  body.nomad-themed[data-theme-family="editorial"] :is(.theme-kicker,.coverage-program-header,.schedule-program-header) {font-family:Menlo,monospace;}
  body.nomad-themed[data-theme-family="studio"] {--theme-shadow:4px 4px 0 var(--ui-text);}
  body.nomad-themed[data-theme-family="studio"] :is(.card,.metric,.theme-sidebar,.table-wrap,.schedule-workspace) {border:2px solid var(--ui-text)!important;box-shadow:var(--theme-shadow)!important;}
  body.nomad-themed[data-theme-family="studio"] .theme-sidebar button.active {background:var(--ui-blue)!important;color:var(--theme-primary-ink)!important;}
  body.nomad-themed[data-theme-family="studio"] :is(.theme-page-heading h2,#boardTitle) {text-transform:uppercase;font-size:31px;letter-spacing:-1.2px;}
  body.nomad-themed[data-theme-family="studio"] .theme-brand-mark {border-radius:0;}
  body.nomad-themed[data-theme-family="tidal"] .theme-brand {color:var(--theme-accent);}
  body.nomad-themed[data-theme-family="tidal"] #boardSummary .metric {border-top:3px solid var(--theme-accent)!important;}
  body.nomad-themed[data-theme-family="tidal"] :is(.theme-page-heading h2,#boardTitle) {font-size:37px;font-weight:500;}
  body.nomad-themed[data-theme-family="prism"] {--theme-shadow:0 9px 28px #00000008;background:radial-gradient(ellipse at 2% 2%,color-mix(in srgb,var(--theme-accent) 20%,var(--ui-bg)),transparent 50%),radial-gradient(ellipse at 100% 100%,color-mix(in srgb,var(--theme-accent) 14%,var(--ui-bg)),transparent 65%),var(--ui-bg)!important;background-attachment:fixed!important;}
  body.nomad-themed[data-theme-family="prism"] :is(.card,.metric,.theme-sidebar,.schedule-workspace) {background:color-mix(in srgb,var(--ui-panel) 80%,transparent)!important;backdrop-filter:blur(12px);}
  body.nomad-themed[data-theme-family="prism"] .theme-sidebar {margin-top:9px;min-height:calc(100dvh - 50px);}
  body.nomad-themed[data-theme-family="prism"] :is(.theme-page-heading h2,#boardTitle) {font-size:38px;font-weight:500;}
  body.nomad-themed[data-theme-family="prism"] :is(button.primary,.theme-brand-mark) {background:linear-gradient(125deg,var(--ui-blue),color-mix(in srgb,var(--ui-blue) 96%,var(--ui-panel)))!important;}
  body.nomad-themed[data-theme-family="atelier"] .theme-sidebar {background:transparent;border:0;border-right:1px solid var(--ui-line);border-radius:0;padding-right:24px;}
  body.nomad-themed[data-theme-family="atelier"] .theme-brand {font-family:var(--theme-heading);font-weight:400;font-size:35px;}
  body.nomad-themed[data-theme-family="atelier"] :is(.theme-page-heading h2,#boardTitle) {font-size:44px;font-weight:400;}
  body.nomad-themed[data-theme-family="atelier"] #boardSummary .metric {border-top:2px solid var(--theme-accent)!important;}
  body.nomad-themed[data-theme-family="atelier"] #boardSummary strong {font-family:var(--theme-heading);font-weight:400;font-size:34px;}
  body.nomad-themed[data-theme-family="atelier"] .theme-kicker {letter-spacing:2.6px;font-size:9px;}
  body.nomad-themed[data-theme-family="signal"] {background-image:linear-gradient(var(--ui-line) 1px,transparent 1px),linear-gradient(90deg,var(--ui-line) 1px,transparent 1px)!important;background-size:24px 24px!important;background-blend-mode:soft-light;}
  body.nomad-themed[data-theme-family="signal"] .theme-sidebar {border-top:3px solid var(--theme-accent);}
  body.nomad-themed[data-theme-family="signal"] :is(.theme-page-heading h2,#boardTitle) {font-size:29px;letter-spacing:-1.5px;font-weight:600;}
  body.nomad-themed[data-theme-family="signal"] .theme-kicker::before {content:'// ';}
  body.nomad-themed[data-theme-family="signal"] .theme-brand-mark {border-radius:0;}
  body.nomad-themed[data-theme-family="signal"] .theme-sidebar button {font-size:10px;letter-spacing:-.4px;}
  body.nomad-themed[data-theme-family="pop"] {--theme-shadow:0 5px 0 color-mix(in srgb,var(--theme-accent) 10%,transparent);}
  body.nomad-themed[data-theme-family="pop"] .theme-sidebar {background:var(--theme-accent-soft);border:0;}
  body.nomad-themed[data-theme-family="pop"] .theme-brand-mark {border-radius:50%;}
  body.nomad-themed[data-theme-family="pop"] .theme-sidebar button.active {background:var(--ui-blue)!important;color:var(--theme-primary-ink)!important;}
  body.nomad-themed[data-theme-family="pop"] button {border-radius:40px!important;}
  body.nomad-themed[data-theme-family="pop"] #boardSummary .metric:nth-child(3) {background:var(--ui-green-bg)!important;}
  body.nomad-themed[data-theme-family="pop"] #boardSummary .metric:nth-child(4) {background:var(--theme-warning-bg)!important;}

  /* Editorial and Tidal use the wide masthead shown in their concept images. */
  body.nomad-themed:is([data-theme-family="editorial"],[data-theme-family="tidal"]) #appShell:not(.auth-hidden) {display:block!important;padding:0 34px 24px!important;}
  body.nomad-themed:is([data-theme-family="editorial"],[data-theme-family="tidal"]) .theme-sidebar {position:static;flex-direction:row;align-items:center;gap:42px;height:72px;min-height:72px;max-height:none;overflow:visible;padding:0;border:0;border-bottom:1px solid var(--ui-line);border-radius:0;background:transparent;}
  body.nomad-themed:is([data-theme-family="editorial"],[data-theme-family="tidal"]) .theme-sidebar :is(.theme-school,.theme-nav-label,.theme-sidebar-bottom) {display:none;}
  body.nomad-themed:is([data-theme-family="editorial"],[data-theme-family="tidal"]) .theme-sidebar nav {flex-direction:row;gap:16px;}
  body.nomad-themed:is([data-theme-family="editorial"],[data-theme-family="tidal"]) .theme-sidebar nav button {width:auto;padding:12px 18px;}
  body.nomad-themed:is([data-theme-family="editorial"],[data-theme-family="tidal"]) #headerSettings {display:block;}
  body.nomad-themed[data-theme-family="tidal"] .theme-sidebar {border-bottom:3px solid var(--theme-accent);}

  /* Keep readable, fully functional layouts on smaller windows and phones. */
  @media(max-width:1200px) {
    body.nomad-themed #appShell:not(.auth-hidden) {grid-template-columns:176px minmax(0,1fr);gap:0 18px;padding-right:18px!important;}
    body.nomad-themed .settings-shell.refined-settings {grid-template-columns:170px minmax(0,1fr);gap:14px;}
    .theme-family-grid {grid-template-columns:repeat(3,minmax(0,1fr));}
    .theme-scheme-grid {grid-template-columns:repeat(2,minmax(0,1fr));}
    body.nomad-themed #boardContainer .board-page-grid {grid-template-columns:minmax(0,1fr) 190px!important;gap:12px!important;}
    .theme-picker-heading,.theme-picker-footer {align-items:start;flex-direction:column;}
    #themeTopDate {display:none;}
  }
  @media(max-width:960px) {
    body.nomad-themed #appShell:not(.auth-hidden),body.nomad-themed:is([data-theme-family="editorial"],[data-theme-family="tidal"]) #appShell:not(.auth-hidden) {display:block!important;padding:12px!important;}
    body.nomad-themed .theme-sidebar,body.nomad-themed:is([data-theme-family="editorial"],[data-theme-family="tidal"]) .theme-sidebar {position:static;display:flex;flex-direction:row;align-items:center;gap:16px;min-height:0;max-height:none;height:auto;margin:0 0 10px;padding:10px 12px;overflow:visible;border:1px solid var(--ui-line);border-radius:var(--theme-radius);}
    body.nomad-themed .theme-sidebar :is(.theme-school,.theme-nav-label,.theme-sidebar-bottom) {display:none;}
    body.nomad-themed .theme-sidebar nav {flex:1;flex-direction:row;flex-wrap:wrap;justify-content:flex-end;gap:4px;}
    body.nomad-themed .theme-sidebar nav button {width:auto;min-height:36px;padding:8px!important;font-size:11px;gap:6px;}
    body.nomad-themed .theme-brand {font-size:24px;}
    body.nomad-themed #headerSettings {display:block;}
    .theme-setup-grid {grid-template-columns:1fr 1fr;gap:12px;}
    body.nomad-themed #boardContainer .board-page-grid {display:flex!important;flex-direction:column;}
    body.nomad-themed #boardContainer .staff-panel-slot {position:static;order:2;width:100%;}
    body.nomad-themed #boardContainer .board-page-grid>.staff-panel-slot+div {order:1;width:100%;}
    body.nomad-themed #staffList {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;max-height:300px;}
    body.nomad-themed #boardContainer .staff-panel {max-height:none;}
    body.nomad-themed #setupPage .card {padding:15px;}
    body.nomad-themed .settings-shell.refined-settings {grid-template-columns:1fr;}
    body.nomad-themed .settings-nav.refined-nav {position:static;border-right:0!important;padding:0;}
    .theme-family-grid {grid-template-columns:repeat(5,minmax(0,1fr));}
    .theme-scheme-grid {grid-template-columns:repeat(3,minmax(0,1fr));}
  }
  @media(max-width:650px) {
    body.nomad-themed .info-tip::after {position:fixed;left:16px;right:16px;bottom:16px;transform:none;width:auto;max-width:none;}
    body.nomad-themed #appShell>.top {flex-wrap:wrap;gap:8px;}
    .theme-top-context {min-width:150px;}
    body.nomad-themed .header-workflow-actions {order:3;width:100%;justify-content:flex-start;}
    body.nomad-themed .theme-sidebar,body.nomad-themed:is([data-theme-family="editorial"],[data-theme-family="tidal"]) .theme-sidebar {flex-direction:column;align-items:stretch;gap:8px;}
    body.nomad-themed .theme-sidebar nav {justify-content:space-between;gap:3px;}
    body.nomad-themed .theme-sidebar nav button {font-size:10px;padding:7px 6px!important;}
    body.nomad-themed .theme-sidebar nav .theme-icon {width:14px;height:14px;}
    .theme-page-heading {flex-direction:column;align-items:flex-start;margin:22px 0 18px;gap:14px;}
    body.nomad-themed #setupPage .setup-manage-row {justify-content:flex-start;}
    body.nomad-themed #setupPage .setup-schedule-method {grid-template-columns:1fr;gap:8px;}
    body.nomad-themed #setupPage .setup-schedule-method>button {padding:14px;min-height:70px;}
    .theme-setup-grid {display:flex;flex-direction:column;}
    body.nomad-themed #boardPage .board-control-top {flex-direction:column;align-items:flex-start;}
    body.nomad-themed #boardSummary {grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;}
    body.nomad-themed #boardPage .board-actions {justify-content:flex-start;}
    body.nomad-themed #staffList {grid-template-columns:repeat(2,minmax(0,1fr));}
    body.nomad-themed .app-theme-picker {padding:16px!important;}
    .theme-family-grid {grid-template-columns:repeat(2,minmax(0,1fr));}
    .theme-scheme-grid {grid-template-columns:1fr;}
    .theme-scheme-heading {align-items:start;flex-direction:column;}
    .settings-mode-row {flex-wrap:wrap;gap:12px;}
    .theme-picker-footer>div:last-child {justify-content:flex-start;}
    .theme-current {white-space:normal;}
    .theme-preview-heading h2 {font-size:17px;}
  }
  @media(prefers-reduced-motion:reduce) {body.nomad-themed * {animation-duration:.01ms!important;transition:none!important;}}
}
@media print {
  #themeSidebar,.theme-top-context,.app-theme-preview-dialog {display:none!important;}
}
