/* Bibliotheke quality pass: one calm command surface across every studio. */
:root {
  --q-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --q-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --q-mono: "SF Mono", "JetBrains Mono", ui-monospace, monospace;
  --q-ink: #08100f;
  --q-ink-deep: #050908;
  --q-surface: rgba(16, 25, 24, .94);
  --q-surface-soft: rgba(24, 36, 34, .78);
  --q-paper: #f1e6c9;
  --q-paper-muted: #b9b7a8;
  --q-teal: #73d7c6;
  --q-gold: #d3b36c;
  --q-line: rgba(233, 225, 202, .12);
  --q-ease: cubic-bezier(.16, 1, .3, 1);
}

body.uw-active {
  font-family: var(--q-font) !important;
  background: var(--q-ink-deep) !important;
  color: var(--q-paper) !important;
  letter-spacing: 0 !important;
}

body.uw-active > .app {
  background: var(--q-ink-deep) !important;
}

/* The chrome is a single instrument: brand, six studios, then two utilities. */
body.uw-active .uw-chrome {
  background: rgba(7, 14, 13, .94) !important;
  border-bottom: 1px solid rgba(211, 179, 108, .2) !important;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .3), inset 0 -1px rgba(255, 255, 255, .035) !important;
}

body.uw-active .uw-primary {
  height: 58px !important;
  grid-template-columns: 174px minmax(0, 1fr) auto !important;
  gap: 12px !important;
  padding: 7px 14px 5px !important;
}

body.uw-active .uw-brand {
  position: relative !important;
  align-items: flex-start !important;
  justify-content: center !important;
  padding: 0 16px 0 10px !important;
  border-right: 1px solid rgba(233, 225, 202, .13) !important;
}

body.uw-active .uw-brand::before {
  content: '';
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--q-teal), var(--q-gold)) !important;
  box-shadow: 0 0 16px rgba(115, 215, 198, .28);
}

body.uw-active .uw-brand span {
  font-family: var(--q-display) !important;
  font-size: 1.18rem !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  color: var(--q-paper) !important;
}

body.uw-active .uw-brand small {
  margin-top: 5px !important;
  color: rgba(115, 215, 198, .72) !important;
  font: 600 .42rem/1 var(--q-mono) !important;
  letter-spacing: .16em !important;
}

body.uw-active .uw-studios {
  gap: 3px !important;
  padding: 3px !important;
  border: 1px solid rgba(233, 225, 202, .12) !important;
  border-radius: 12px !important;
  background: rgba(11, 19, 18, .82) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, .04), 0 8px 18px rgba(0, 0, 0, .16) !important;
}

body.uw-active .uw-studio {
  min-height: 42px !important;
  padding: 4px 9px !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  color: rgba(185, 183, 168, .72) !important;
  background: transparent !important;
  transition: color .24s var(--q-ease), background .24s var(--q-ease), border-color .24s var(--q-ease), transform .24s var(--q-ease) !important;
}

body.uw-active .uw-studio:hover {
  color: var(--q-paper) !important;
  background: rgba(115, 215, 198, .07) !important;
  transform: translateY(-1px) !important;
}

body.uw-active .uw-studio.active {
  color: var(--q-paper) !important;
  border-color: color-mix(in srgb, var(--accent) 42%, rgba(233, 225, 202, .12)) !important;
  background: color-mix(in srgb, var(--accent) 10%, rgba(255, 255, 255, .035)) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, .08), inset 0 -2px var(--accent) !important;
}

body.uw-active .uw-studio::after {
  display: none !important;
}

body.uw-active .uw-studio > i {
  width: 24px !important;
  height: 24px !important;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, rgba(233, 225, 202, .16)) !important;
  border-radius: 7px !important;
  background: transparent !important;
  color: color-mix(in srgb, var(--accent) 78%, var(--q-paper) 22%) !important;
  font: 600 .61rem/1 var(--q-mono) !important;
}

body.uw-active .uw-studio.active > i {
  background: color-mix(in srgb, var(--accent) 18%, transparent) !important;
  border-color: color-mix(in srgb, var(--accent) 80%, transparent) !important;
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 22%, transparent) !important;
  transform: none !important;
}

body.uw-active .uw-studio strong {
  font: 650 .68rem/1 var(--q-font) !important;
  letter-spacing: .01em !important;
}

body.uw-active .uw-global-actions {
  gap: 4px !important;
  padding-left: 10px !important;
  border-left: 1px solid rgba(233, 225, 202, .13) !important;
}

body.uw-active .uw-icon {
  width: 34px !important;
  height: 34px !important;
  border: 1px solid rgba(233, 225, 202, .13) !important;
  border-radius: 9px !important;
  background: rgba(255, 255, 255, .025) !important;
  color: rgba(241, 230, 201, .74) !important;
  font: 600 .78rem/1 var(--q-mono) !important;
}

body.uw-active .uw-icon:hover,
body.uw-active .uw-icon:focus-visible {
  color: var(--q-paper) !important;
  border-color: var(--q-teal) !important;
  background: rgba(115, 215, 198, .1) !important;
  outline: none !important;
}

/* Context line: one focus, one handoff, one truth signal. */
body.uw-active .uw-contextbar {
  height: 46px !important;
  grid-template-columns: 148px minmax(170px, 230px) minmax(220px, 1fr) minmax(132px, 180px) 108px 154px !important;
  gap: 7px !important;
  padding: 5px 14px !important;
  border-top: 1px solid rgba(115, 215, 198, .08) !important;
  border-bottom: 1px solid rgba(211, 179, 108, .18) !important;
  background: rgba(4, 9, 9, .76) !important;
}

body.uw-active .uw-tool-current,
body.uw-active .uw-ref-form,
body.uw-active .uw-reader-toggle,
body.uw-active .uw-truth-button {
  height: 34px !important;
  border: 1px solid rgba(233, 225, 202, .12) !important;
  border-radius: 9px !important;
  background: rgba(255, 255, 255, .025) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, .035) !important;
}

body.uw-active :is(.uw-tool-current:hover, .uw-ref-form:focus-within, .uw-reader-toggle:hover, .uw-truth-button:hover) {
  border-color: color-mix(in srgb, var(--uw-accent) 58%, rgba(233, 225, 202, .14)) !important;
  background: color-mix(in srgb, var(--uw-accent) 8%, rgba(255, 255, 255, .035)) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, .08), 0 6px 16px rgba(0, 0, 0, .14) !important;
}

body.uw-active .uw-tool-current {
  padding-inline: 9px !important;
  border-left: 2px solid var(--uw-accent) !important;
}

body.uw-active .uw-tool-current small,
body.uw-active .uw-ref-form label,
body.uw-active .uw-focus-summary > span,
body.uw-active .uw-truth-button small {
  color: rgba(115, 215, 198, .7) !important;
  font: 600 .46rem/1 var(--q-mono) !important;
  letter-spacing: .14em !important;
  text-transform: uppercase !important;
}

body.uw-active .uw-tool-current strong,
body.uw-active .uw-focus-summary strong,
body.uw-active .uw-truth-button strong,
body.uw-active .uw-reader-toggle span {
  color: var(--q-paper) !important;
  font: 650 .71rem/1 var(--q-font) !important;
}

body.uw-active .uw-ref-form {
  grid-template-columns: auto minmax(0, 1fr) 30px !important;
  padding-inline: 9px !important;
}

body.uw-active .uw-ref-form input {
  height: 28px !important;
  color: var(--q-paper) !important;
  font: 650 .72rem/1 var(--q-mono) !important;
}

body.uw-active .uw-ref-form button {
  width: 26px !important;
  height: 26px !important;
  border: 1px solid rgba(211, 179, 108, .3) !important;
  border-radius: 7px !important;
  background: rgba(211, 179, 108, .08) !important;
}

body.uw-active .uw-focus-summary {
  min-width: 0 !important;
  padding-inline: 11px !important;
  border-left: 1px solid rgba(233, 225, 202, .1) !important;
  border-right: 1px solid rgba(233, 225, 202, .1) !important;
}

body.uw-active .uw-focus-summary strong,
body.uw-active .uw-focus-summary small {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.uw-active .uw-focus-summary small {
  color: rgba(185, 183, 168, .66) !important;
  font-size: .55rem !important;
}

body.uw-active .uw-handoff button {
  height: 32px !important;
  max-width: 180px !important;
  padding-inline: 10px !important;
  border: 1px solid rgba(211, 179, 108, .34) !important;
  border-radius: 9px !important;
  color: var(--q-paper) !important;
  background: rgba(211, 179, 108, .08) !important;
  font: 650 .6rem/1 var(--q-mono) !important;
  letter-spacing: .06em !important;
}

body.uw-active .uw-reader-toggle {
  justify-content: center !important;
  padding-inline: 11px !important;
  border-color: rgba(115, 215, 198, .26) !important;
}

body.uw-active .uw-reader-toggle span { color: var(--q-teal) !important; }
body.uw-active .uw-reader-toggle small { color: rgba(115, 215, 198, .62) !important; }

body.uw-active .uw-truth-button {
  justify-content: flex-end !important;
  padding-inline: 8px !important;
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.uw-active .uw-truth-button > i {
  width: 7px !important;
  height: 7px !important;
  margin-right: 7px !important;
  border-radius: 50% !important;
  background: var(--truth, var(--q-teal)) !important;
  box-shadow: 0 0 12px color-mix(in srgb, var(--truth, var(--q-teal)) 55%, transparent) !important;
}

/* Tool menus and panels inherit the same quiet hierarchy. */
body.uw-active .uw-tool-menu,
body.uw-active .uw-utility-menu,
body.uw-active .uw-panel,
body.uw-active .uw-command,
body.uw-active .uw-compare,
body.uw-active .uw-presentation {
  border: 1px solid rgba(211, 179, 108, .24) !important;
  border-radius: 14px !important;
  background: rgba(10, 18, 17, .97) !important;
  box-shadow: 0 26px 80px rgba(0, 0, 0, .48), inset 0 1px rgba(255, 255, 255, .045) !important;
  backdrop-filter: blur(24px) saturate(1.1) !important;
}

body.uw-active .uw-tool-menu header,
body.uw-active .uw-utility-menu header,
body.uw-active .uw-panel-head,
body.uw-active .uw-command header {
  border-bottom-color: rgba(233, 225, 202, .11) !important;
}

body.uw-active .uw-tool-menu > div button,
body.uw-active .uw-utility-menu > div button,
body.uw-active .uw-action-grid button {
  min-height: 42px !important;
  border: 1px solid transparent !important;
  border-radius: 9px !important;
  font-family: var(--q-font) !important;
}

body.uw-active .uw-tool-menu > div button:hover,
body.uw-active .uw-utility-menu > div button:hover,
body.uw-active .uw-action-grid button:hover {
  border-color: rgba(115, 215, 198, .24) !important;
  background: rgba(115, 215, 198, .08) !important;
}

/* Reader: readable controls, lighter focus plate, and a deliberate text column. */
body.uw-active[data-uw-bridge="reader"] .app .side {
  border-color: rgba(211, 179, 108, .22) !important;
  background: linear-gradient(180deg, rgba(18, 29, 28, .98), rgba(8, 15, 14, .98)) !important;
}

body.uw-active[data-uw-bridge="reader"] .app .reader-tools {
  gap: 7px !important;
}

body.uw-active[data-uw-bridge="reader"] .app .tabs {
  padding: 3px !important;
  border: 1px solid rgba(211, 179, 108, .22) !important;
  border-radius: 10px !important;
  background: rgba(5, 11, 10, .7) !important;
}

body.uw-active[data-uw-bridge="reader"] .app .tab {
  min-height: 32px !important;
  color: rgba(185, 183, 168, .76) !important;
  font-size: .72rem !important;
  letter-spacing: .04em !important;
}

body.uw-active[data-uw-bridge="reader"] .app .tab.act {
  color: #17201d !important;
  background: linear-gradient(180deg, #f1e5c6, #caae72) !important;
}

body.uw-active[data-uw-bridge="reader"] .app .focussearch input,
body.uw-active[data-uw-bridge="reader"] .app .rnav select,
body.uw-active[data-uw-bridge="reader"] .app .rnav button {
  font-size: .68rem !important;
}

body.uw-active[data-uw-bridge="reader"] .app .rbody .chapter-copy {
  max-width: 64ch !important;
  margin-inline: auto !important;
  font-family: var(--q-font) !important;
}

body.uw-active[data-uw-bridge="reader"] .app .rbody .vs,
body.uw-active[data-uw-bridge="reader"] .app .rbody .vtext {
  font-size: clamp(1rem, 1.1vw, 1.14rem) !important;
  line-height: 1.72 !important;
}

body.uw-active[data-uw-bridge="reader"] #VIZHUD {
  width: min(254px, calc(100% - 28px)) !important;
  padding: 11px !important;
  border-radius: 14px !important;
  background: linear-gradient(145deg, rgba(18, 32, 30, .96), rgba(8, 16, 15, .95)) !important;
}

body.uw-active[data-uw-bridge="reader"] #VIZHUD .vizhud-title {
  font-size: 1.12rem !important;
}

/* Timeline: the archive axis gets a stable header and non-clipping context cards. */
body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-head {
  border: 1px solid rgba(211, 179, 108, .18) !important;
  border-radius: 12px !important;
  background: linear-gradient(180deg, rgba(17, 27, 29, .92), rgba(8, 14, 18, .92)) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, .04), 0 10px 24px rgba(0, 0, 0, .16) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-title-wrap h2 {
  color: var(--q-paper) !important;
  font-family: var(--q-display) !important;
  font-size: 1.28rem !important;
  letter-spacing: 0 !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-searchbox-main input {
  min-height: 40px !important;
  border: 1px solid rgba(115, 215, 198, .22) !important;
  border-radius: 9px !important;
  color: var(--q-paper) !important;
  background: rgba(3, 9, 10, .62) !important;
  font: 500 .78rem/1 var(--q-font) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-searchbox-main input:focus {
  border-color: var(--q-teal) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(115, 215, 198, .1) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-segment {
  border: 1px solid rgba(233, 225, 202, .1) !important;
  border-radius: 9px !important;
  background: rgba(5, 11, 12, .58) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-segment button {
  color: rgba(185, 183, 168, .76) !important;
  font: 650 .58rem/1 var(--q-mono) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-segment button.act {
  color: var(--q-paper) !important;
  background: rgba(211, 179, 108, .14) !important;
}

@media (min-width: 901px) {
  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-rail {
    height: 46px !important;
    align-items: stretch !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay :is(.tl-context-chip, .tl-stage-meta .tl-context-chip) {
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    overflow: hidden !important;
    display: grid !important;
    grid-template-columns: max-content minmax(0, 1fr) !important;
    grid-template-rows: 17px 15px !important;
    align-content: center !important;
    gap: 0 8px !important;
    padding: 4px 9px !important;
    border-radius: 8px !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-chip span {
    grid-column: 1 !important;
    grid-row: 1 / -1 !important;
    align-self: center !important;
    font: 650 .56rem/1 var(--q-mono) !important;
    color: var(--q-gold) !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-chip strong,
  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-chip small {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-chip strong {
    grid-column: 2 !important;
    grid-row: 1 !important;
    font: 650 .63rem/1 var(--q-font) !important;
    color: var(--q-paper) !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-chip small {
    grid-column: 2 !important;
    grid-row: 2 !important;
    font: 500 .49rem/1 var(--q-mono) !important;
    color: rgba(185, 183, 168, .58) !important;
  }
}

/* Location: the map remains the primary surface; controls read as one toolbar. */
body.uw-active .app[data-active-mode="location"] #VIZ.loc,
body.uw-active .app[data-active-mode="location"] #MAPV {
  border-color: rgba(211, 179, 108, .2) !important;
  border-radius: 14px !important;
  background: #0a1112 !important;
  box-shadow: 0 18px 52px rgba(0, 0, 0, .3), inset 0 1px rgba(255, 255, 255, .04) !important;
}

body.uw-active .app[data-active-mode="location"] .mapstage-workbar {
  border: 1px solid rgba(233, 225, 202, .12) !important;
  border-radius: 11px !important;
  background: rgba(8, 15, 15, .9) !important;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .24), inset 0 1px rgba(255, 255, 255, .04) !important;
}

body.uw-active .app[data-active-mode="location"] :is(.mapwork-search input, .mapsearch-inline input) {
  color: var(--q-paper) !important;
  font: 500 .78rem/1 var(--q-font) !important;
}

body.uw-active .app[data-active-mode="location"] :is(.mapwork-actions button, .mapwork-search button, .mapstage-hud button, .maphud button, .mapdensity-row button, .modebrief-actions button) {
  min-height: 30px !important;
  border: 1px solid rgba(233, 225, 202, .14) !important;
  border-radius: 8px !important;
  color: rgba(241, 230, 201, .8) !important;
  background: rgba(255, 255, 255, .035) !important;
  font: 650 .57rem/1 var(--q-mono) !important;
  letter-spacing: .04em !important;
}

body.uw-active .app[data-active-mode="location"] :is(.mapwork-actions button:hover, .mapwork-search button:hover, .mapstage-hud button:hover, .maphud button:hover, .mapdensity-row button:hover, .modebrief-actions button:hover),
body.uw-active .app[data-active-mode="location"] :is(.mapwork-actions button.act, .mapdensity-row button.act) {
  border-color: var(--q-teal) !important;
  color: var(--q-teal) !important;
  background: rgba(115, 215, 198, .1) !important;
}

body.uw-active .app[data-active-mode="location"] .mapplace-card {
  border: 1px solid rgba(233, 225, 202, .1) !important;
  border-radius: 9px !important;
  background: rgba(255, 255, 255, .025) !important;
  transition: border-color .22s var(--q-ease), background .22s var(--q-ease), transform .22s var(--q-ease) !important;
}

body.uw-active .app[data-active-mode="location"] .mapplace-card:hover,
body.uw-active .app[data-active-mode="location"] .mapplace-card:focus-visible {
  border-color: rgba(115, 215, 198, .46) !important;
  background: rgba(115, 215, 198, .08) !important;
  transform: translateY(-1px) !important;
  outline: none !important;
}

/* Dense workspaces get one shared surface rhythm. */
body.uw-active .studymode-shell,
body.uw-active .timeline-overlay,
body.uw-active .heatmode-shell,
body.uw-active .treemode-shell {
  border-radius: 14px !important;
  border-color: rgba(211, 179, 108, .2) !important;
  box-shadow: 0 18px 52px rgba(0, 0, 0, .28), inset 0 1px rgba(255, 255, 255, .035) !important;
}

body.uw-active :is(.studymode-shell, .timeline-overlay, .heatmode-shell, .treemode-shell) :is(button, input, select):focus-visible {
  outline: 2px solid rgba(115, 215, 198, .82) !important;
  outline-offset: 2px !important;
}

@media (max-width: 1180px) {
  body.uw-active .uw-primary { grid-template-columns: 52px minmax(0, 1fr) auto !important; padding-inline: 8px !important; }
  body.uw-active .uw-brand { padding-inline: 0 !important; border-right: 0 !important; align-items: center !important; }
  body.uw-active .uw-brand span { font-size: 0 !important; }
  body.uw-active .uw-brand span::before { content: 'b' !important; font: 600 1.3rem/1 var(--q-display) !important; color: var(--q-paper) !important; }
  body.uw-active .uw-brand small { display: none !important; }
  body.uw-active .uw-studios { grid-template-columns: repeat(6, minmax(72px, 1fr)) !important; }
  body.uw-active .uw-contextbar { grid-template-columns: 140px minmax(160px, 220px) minmax(0, 1fr) 124px 40px !important; padding-inline: 8px !important; }
  body.uw-active .uw-truth-button { width: 40px !important; justify-content: center !important; padding: 0 !important; }
  body.uw-active .uw-truth-button > span { display: none !important; }
}

@media (max-width: 760px) {
  :root { --uw-header: 112px; }
  body.uw-active .uw-primary { height: 62px !important; grid-template-columns: 38px minmax(0, 1fr) auto !important; padding: 5px !important; }
  body.uw-active .uw-studios { gap: 2px !important; padding: 3px !important; border-radius: 10px !important; }
  body.uw-active .uw-studio { flex: 0 0 76px !important; min-height: 50px !important; grid-template-columns: 1fr !important; gap: 3px !important; justify-items: center !important; padding: 4px 2px !important; }
  body.uw-active .uw-studio strong { max-width: 70px !important; font-size: .62rem !important; text-align: center !important; }
  body.uw-active .uw-studio > i { width: 22px !important; height: 22px !important; }
  body.uw-active .uw-global-actions { padding-left: 2px !important; }
  body.uw-active .uw-icon { width: 30px !important; height: 40px !important; }
  body.uw-active .uw-contextbar { height: auto !important; min-height: 50px !important; grid-template-columns: minmax(106px, 1fr) minmax(0, 1fr) 36px !important; grid-template-areas: "tool ref truth" "focus focus focus" !important; gap: 5px !important; padding: 5px !important; }
  body.uw-active .uw-tool-current { grid-area: tool; }
  body.uw-active .uw-ref-form { grid-area: ref; }
  body.uw-active .uw-truth-button { grid-area: truth; }
  body.uw-active .uw-focus-summary { grid-area: focus; min-height: 25px !important; border: 0 !important; }
  body.uw-active .uw-handoff,
  body.uw-active .uw-reader-toggle { display: none !important; }
  body.uw-active[data-uw-bridge="reader"] .app .rbody .chapter-copy { max-width: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  body.uw-active *,
  body.uw-active *::before,
  body.uw-active *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* Tablet context rail: keep all six controls in the same visible row. */
@media (min-width: 761px) and (max-width: 1180px) {
  body.uw-active .uw-contextbar {
    height: 48px !important;
    min-height: 48px !important;
    grid-template-columns: 132px 172px minmax(170px, 1fr) 120px 92px 36px !important;
    gap: 6px !important;
    padding: 4px 10px !important;
    align-items: center !important;
  }

  body.uw-active .uw-tool-current,
  body.uw-active .uw-ref-form,
  body.uw-active .uw-reader-toggle,
  body.uw-active .uw-truth-button {
    height: 38px !important;
    min-width: 0 !important;
  }

  body.uw-active .uw-tool-current {
    padding-inline: 8px !important;
    border-left-width: 2px !important;
  }

  body.uw-active .uw-tool-current small {
    display: block !important;
    font-size: .4rem !important;
    letter-spacing: .11em !important;
  }

  body.uw-active .uw-tool-current strong {
    margin-top: 4px !important;
    font-size: .67rem !important;
  }

  body.uw-active .uw-ref-form {
    grid-template-columns: auto minmax(0, 1fr) 28px !important;
    padding-inline: 8px !important;
  }

  body.uw-active .uw-ref-form label {
    font-size: .4rem !important;
    letter-spacing: .11em !important;
  }

  body.uw-active .uw-ref-form input {
    font-size: .68rem !important;
  }

  body.uw-active .uw-ref-form button {
    width: 24px !important;
    height: 24px !important;
    padding: 0 !important;
    font-size: 0 !important;
  }

  body.uw-active .uw-ref-form button::before {
    content: '\2192';
    color: var(--q-paper) !important;
    font: 700 .9rem/1 var(--q-font) !important;
  }

  body.uw-active .uw-focus-summary {
    grid-template-columns: max-content max-content minmax(0, 1fr) !important;
    gap: 7px !important;
    padding-inline: 9px !important;
  }

  body.uw-active .uw-focus-summary > span {
    font-size: .4rem !important;
  }

  body.uw-active .uw-focus-summary strong {
    font-size: .68rem !important;
  }

  body.uw-active .uw-focus-summary small {
    font-size: .48rem !important;
  }

  body.uw-active .uw-handoff {
    min-width: 0 !important;
  }

  body.uw-active .uw-handoff button {
    width: 100% !important;
    max-width: 120px !important;
    height: 34px !important;
    overflow: hidden !important;
    padding-inline: 7px !important;
    text-overflow: ellipsis !important;
    font-size: .49rem !important;
    letter-spacing: .025em !important;
  }

  body.uw-active .uw-reader-toggle {
    display: flex !important;
    padding-inline: 7px !important;
  }

  body.uw-active .uw-reader-toggle span {
    font-size: .58rem !important;
  }

  body.uw-active .uw-reader-toggle small {
    font-size: .4rem !important;
  }

  body.uw-active .uw-truth-button {
    width: 36px !important;
    justify-content: center !important;
    padding: 0 !important;
  }

  body.uw-active .uw-truth-button > i {
    margin-right: 0 !important;
  }

  body.uw-active .uw-truth-button > span {
    display: none !important;
  }
}

/* Timeline minimal overview: one hierarchy, three facts, no duplicate command row. */
body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-main {
  padding: 8px !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-commandbar {
  grid-template-columns: minmax(220px, 1fr) minmax(284px, 380px) 34px !important;
  gap: 7px !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-segment {
  display: none !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tlr-summary-strip {
  grid-template-columns: 1.15fr 1fr .9fr !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tlr-summary-item {
  padding-inline: 11px !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-workbench {
  grid-template-columns: 224px minmax(0, 1fr) !important;
  gap: 8px !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-sidebar-shell {
  gap: 6px !important;
  padding: 8px !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-hero {
  gap: 6px !important;
  padding: 11px !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-title-row h3 {
  max-width: 142px !important;
  font-size: 1.14rem !important;
  line-height: 1.08 !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-hero > p {
  margin: 5px 0 !important;
  -webkit-line-clamp: 2 !important;
  font-size: .67rem !important;
  line-height: 1.38 !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-meta {
  gap: 6px !important;
  font-size: .46rem !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-stats {
  gap: 3px !important;
  margin-top: 1px !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-stats span {
  gap: 2px !important;
  padding: 6px !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-stats strong {
  overflow: hidden !important;
  font-size: .67rem !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-stats small {
  font-size: .4rem !important;
  letter-spacing: .02em !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-journey {
  display: none !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-details summary {
  min-height: 34px !important;
  font-size: .59rem !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-stage-meta {
  grid-template-rows: 32px 42px 10px !important;
  height: 92px !important;
  min-height: 92px !important;
  max-height: 92px !important;
  padding: 7px 9px 5px !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-rail,
body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-chip {
  height: 42px !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-rail {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 4px !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-chip {
  grid-template-rows: 15px 14px !important;
  gap: 1px 6px !important;
  padding: 4px 7px !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-chip strong {
  font-size: .57rem !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-chip small {
  font-size: .4rem !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-stage-actions #tlZoomOut,
body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-stage-actions #tlZoomIn {
  display: none !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-depthline > small {
  display: none !important;
}

@media (max-width: 900px) {
  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-commandbar {
    grid-template-columns: minmax(0, 1fr) 34px !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tlr-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-stage-meta {
    grid-template-rows: 32px 49px 10px !important;
    height: 112px !important;
    min-height: 112px !important;
    max-height: 112px !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-rail {
    display: flex !important;
    grid-template-columns: none !important;
    height: 49px !important;
    overflow-x: auto !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-chip {
    flex: 0 0 150px !important;
    width: 150px !important;
    height: 49px !important;
  }
}

/* After Christ: one workspace, one hierarchy. The embedded desk owns the
   research surface; the main shell keeps only the shared focus and actions. */
body.uw-active .app[data-active-mode="afterChrist"] .acmode-head {
  min-height: 48px !important;
  height: 48px !important;
  padding: 7px 14px !important;
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  border-bottom: 1px solid rgba(118,210,192,.16) !important;
  background: rgba(7,18,21,.82) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.18) !important;
}

body.uw-active .app[data-active-mode="afterChrist"] .acmode-shell {
  grid-template-rows: auto 1fr !important;
  gap: 8px !important;
  padding: 10px !important;
  background: linear-gradient(180deg,rgba(7,18,21,.96),rgba(5,12,15,.98)) !important;
}

body.uw-active .app[data-active-mode="afterChrist"] .acmode-head .modechrome-copy {
  min-width: 0 !important;
  display: flex !important;
  align-items: baseline !important;
  gap: 10px !important;
}

body.uw-active .app[data-active-mode="afterChrist"] .acmode-kicker {
  color: #76d2c0 !important;
  font-size: .46rem !important;
  letter-spacing: .18em !important;
  white-space: nowrap !important;
}

body.uw-active .app[data-active-mode="afterChrist"] .acmode-title {
  color: #f1eadb !important;
  font-family: 'Cormorant Garamond', serif !important;
  font-size: 1.18rem !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

body.uw-active .app[data-active-mode="afterChrist"] .acmode-copy,
body.uw-active .app[data-active-mode="afterChrist"] .acmode-overview,
body.uw-active .app[data-active-mode="afterChrist"] #ACBRIEF {
  display: none !important;
}

body.uw-active .app[data-active-mode="afterChrist"] .acmode-head .modechrome-actions {
  margin-left: auto !important;
  gap: 6px !important;
}

body.uw-active .app[data-active-mode="afterChrist"] .acmode-head .modechrome-btn {
  min-height: 30px !important;
  padding: 0 10px !important;
  border-radius: 8px !important;
  border-color: rgba(190,220,210,.14) !important;
  background: rgba(255,255,255,.025) !important;
  color: rgba(225,233,226,.68) !important;
  font-size: .52rem !important;
  letter-spacing: .09em !important;
}

body.uw-active .app[data-active-mode="afterChrist"] .acmode-head .modechrome-btn:hover {
  border-color: rgba(118,210,192,.48) !important;
  background: rgba(118,210,192,.08) !important;
  color: #f1eadb !important;
}

body.uw-active .app[data-active-mode="afterChrist"] .acmode-workspace {
  min-height: 0 !important;
  height: calc(100% - 48px) !important;
  display: block !important;
  padding: 10px !important;
  background: linear-gradient(135deg,rgba(6,16,19,.96),rgba(9,20,23,.88)) !important;
}

body.uw-active .app[data-active-mode="afterChrist"] .acmode-framewrap {
  min-width: 0 !important;
  min-height: 0 !important;
  height: 100% !important;
  border: 1px solid rgba(118,210,192,.16) !important;
  border-radius: 14px !important;
  overflow: hidden !important;
  background: #081014 !important;
  box-shadow: 0 18px 48px rgba(0,0,0,.26), inset 0 1px 0 rgba(255,255,255,.04) !important;
}

body.uw-active .app[data-active-mode="afterChrist"] .acmode-framewrap::before {
  display: none !important;
}

body.uw-active .app[data-active-mode="afterChrist"] .acmode-frame {
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
}

@media (max-width: 760px) {
  body.uw-active .app[data-active-mode="afterChrist"] .acmode-head {
    min-height: 42px !important;
    height: 42px !important;
    padding: 5px 9px !important;
  }

  body.uw-active .app[data-active-mode="afterChrist"] .acmode-title {
    font-size: 1rem !important;
  }

  body.uw-active .app[data-active-mode="afterChrist"] .acmode-kicker,
  body.uw-active .app[data-active-mode="afterChrist"] .acmode-head .modechrome-btn[data-shell-fullscreen="ACMODE"] {
    display: none !important;
  }

  body.uw-active .app[data-active-mode="afterChrist"] .acmode-workspace {
    height: calc(100% - 42px) !important;
    padding: 5px !important;
  }
}

@media (max-width: 900px) {
  /* Mobile timeline tracks must shrink with the viewport, never with the
     historical desktop minimums. */
  body.uw-active .app[data-active-mode="timeline"],
  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay,
  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-head,
  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-main,
  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-shell,
  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-workbench,
  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-controls,
  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-commandbar,
  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-reader-nav,
  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-sidebar,
  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-sidebar-shell,
  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-stage-shell,
  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-stage-meta,
  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-stage {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-head {
    padding-inline: 8px !important;
    overflow: hidden !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-reader-nav {
    grid-template-columns: 26px minmax(0, 1fr) 72px 40px 26px !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-reader-nav-book,
  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-reader-nav select {
    min-width: 0 !important;
    width: 100% !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-hero {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-title-row h3 {
    max-width: calc(100% - 68px) !important;
  }
}

/* Runtime guard: an older injected timeline style must not collapse the grid. */
body.uw-active.expert-ui-ready.analysis-open.workspace-open .app[data-active-mode="timeline"] .timeline-overlay .tl-main {
  display: block !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body.uw-active.expert-ui-ready.analysis-open.workspace-open .app[data-active-mode="timeline"] .timeline-overlay .tl-shell {
  display: grid !important;
  height: 100% !important;
  min-height: 0 !important;
  grid-template-rows: 42px minmax(0, 1fr) !important;
}

body.uw-active.expert-ui-ready.analysis-open.workspace-open .app[data-active-mode="timeline"] .timeline-overlay .tl-ribbon {
  display: block !important;
  height: 42px !important;
  min-height: 42px !important;
}

body.uw-active.expert-ui-ready.analysis-open.workspace-open .app[data-active-mode="timeline"] .timeline-overlay .tl-workbench {
  display: grid !important;
  height: 100% !important;
  min-height: 0 !important;
  grid-template-rows: minmax(0, 1fr) !important;
}

body.uw-active.expert-ui-ready.analysis-open.workspace-open .app[data-active-mode="timeline"] .timeline-overlay .tl-stage-shell,
body.uw-active.expert-ui-ready.analysis-open.workspace-open .app[data-active-mode="timeline"] .timeline-overlay .tl-sidebar-shell {
  height: 100% !important;
  min-height: 0 !important;
}

body.uw-active.expert-ui-ready.analysis-open.workspace-open .app[data-active-mode="timeline"] .timeline-overlay .tl-stage {
  height: 100% !important;
  min-height: 0 !important;
}

@media (max-width: 900px) {
  body.uw-active.expert-ui-ready.analysis-open.workspace-open .app[data-active-mode="timeline"] .timeline-overlay .tl-main {
    height: auto !important;
    overflow: visible !important;
  }

  body.uw-active.expert-ui-ready.analysis-open.workspace-open .app[data-active-mode="timeline"] .timeline-overlay .tl-shell,
  body.uw-active.expert-ui-ready.analysis-open.workspace-open .app[data-active-mode="timeline"] .timeline-overlay .tl-workbench {
    height: auto !important;
  }
}

/* Reader typography: labels are quiet, readable text is deliberately larger. */
body.uw-active[data-uw-bridge="reader"] .app .reader-tools {
  min-height: 40px !important;
  gap: 8px !important;
}

body.uw-active[data-uw-bridge="reader"] .app .tabs {
  min-height: 38px !important;
  padding: 3px !important;
  border: 1px solid rgba(211, 179, 108, .3) !important;
  border-radius: 11px !important;
  background: linear-gradient(180deg, rgba(21, 31, 30, .92), rgba(7, 13, 13, .9)) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, .06), 0 8px 20px rgba(0, 0, 0, .16) !important;
}

body.uw-active[data-uw-bridge="reader"] .app .tab {
  min-height: 32px !important;
  padding-inline: 14px !important;
  color: rgba(241, 230, 201, .64) !important;
  font: 650 .74rem/1 var(--q-font) !important;
  letter-spacing: .035em !important;
  text-transform: none !important;
}

body.uw-active[data-uw-bridge="reader"] .app .tab:hover {
  color: var(--q-paper) !important;
  background: rgba(115, 215, 198, .1) !important;
}

body.uw-active[data-uw-bridge="reader"] .app .tab.act {
  color: #15201d !important;
  background: linear-gradient(180deg, #f5e9c9 0%, #caae72 100%) !important;
  box-shadow: 0 4px 14px rgba(211, 179, 108, .2), inset 0 1px rgba(255, 255, 255, .72) !important;
}

body.uw-active[data-uw-bridge="reader"] .app .reader-word-toggle {
  min-height: 34px !important;
  padding-inline: 13px !important;
  border: 1px solid rgba(115, 215, 198, .38) !important;
  border-radius: 9px !important;
  color: var(--q-teal) !important;
  background: rgba(115, 215, 198, .075) !important;
  font: 650 .68rem/1 var(--q-mono) !important;
  letter-spacing: .09em !important;
  text-transform: uppercase !important;
}

body.uw-active[data-uw-bridge="reader"] .app .reader-word-toggle:hover,
body.uw-active[data-uw-bridge="reader"] .app .reader-word-toggle[aria-pressed="true"] {
  border-color: var(--q-teal) !important;
  color: #0a1715 !important;
  background: var(--q-teal) !important;
  box-shadow: 0 6px 18px rgba(115, 215, 198, .18) !important;
}

body.uw-active[data-uw-bridge="reader"] .app .focussearch input {
  color: var(--q-paper) !important;
  font: 500 .74rem/1 var(--q-font) !important;
}

body.uw-active[data-uw-bridge="reader"] .app .rnav select,
body.uw-active[data-uw-bridge="reader"] .app .rnav button {
  font-size: .7rem !important;
}

body.uw-active[data-uw-bridge="reader"] .app .rbody .chapter-title,
body.uw-active[data-uw-bridge="reader"] .app .rbody .chtitle {
  font-size: clamp(1.5rem, 2.4vw, 2rem) !important;
  line-height: 1.04 !important;
}

/* At tablet width the wordmark remains a real brand signal, not a fallback glyph. */
@media (min-width: 761px) and (max-width: 1180px) {
  body.uw-active .uw-primary {
    grid-template-columns: 158px minmax(0, 1fr) auto !important;
    gap: 9px !important;
    padding-inline: 10px !important;
  }

  body.uw-active .uw-brand {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
    padding: 0 12px 0 10px !important;
    border-right: 1px solid rgba(233, 225, 202, .13) !important;
  }

  body.uw-active .uw-brand span {
    font-size: 1.06rem !important;
  }

  body.uw-active .uw-brand span::before {
    content: none !important;
  }

  body.uw-active .uw-brand small {
    display: block !important;
    margin-top: 4px !important;
    font-size: .39rem !important;
  }

  body.uw-active .uw-studios {
    grid-template-columns: repeat(6, minmax(72px, 1fr)) !important;
  }

  body.uw-active .uw-studio {
    grid-template-columns: 24px minmax(0, 1fr) !important;
    gap: 6px !important;
    padding-inline: 6px !important;
  }

  body.uw-active .uw-studio strong {
    font-size: .65rem !important;
  }
}

/* Voice capture: an intentional instrument, not a floating leftover control. */
body.uw-active .voicefab#bSpeak {
  width: 68px !important;
  height: 68px !important;
  min-width: 68px !important;
  min-height: 68px !important;
  right: max(18px, calc(var(--side-w, 360px) + 20px)) !important;
  bottom: 22px !important;
  border: 1px solid rgba(211, 179, 108, .66) !important;
  border-radius: 50% !important;
  color: var(--q-paper) !important;
  background:
    radial-gradient(circle at 32% 18%, rgba(255, 246, 214, .28), transparent 28%),
    linear-gradient(145deg, rgba(33, 42, 40, .98), rgba(8, 17, 16, .98) 62%, rgba(20, 32, 31, .98)) !important;
  box-shadow:
    0 22px 52px rgba(0, 0, 0, .52),
    0 0 0 1px rgba(255, 255, 255, .07) inset,
    0 0 34px rgba(211, 179, 108, .16) !important;
  transition: transform .28s var(--q-ease), border-color .28s ease, box-shadow .28s ease, filter .28s ease !important;
}

body.uw-active .voicefab#bSpeak::before {
  inset: -8px !important;
  opacity: .46 !important;
  background: conic-gradient(from 210deg, transparent, rgba(211, 179, 108, .7), rgba(115, 215, 198, .38), transparent 72%) !important;
  filter: blur(6px) !important;
}

body.uw-active .voicefab#bSpeak::after {
  inset: 7px !important;
  background: linear-gradient(145deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .015)) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, .16), inset 0 -16px 26px rgba(0, 0, 0, .24) !important;
}

body.uw-active .voicefab#bSpeak .vi {
  width: 42px !important;
  height: 42px !important;
  background: linear-gradient(145deg, rgba(211, 179, 108, .3), rgba(115, 215, 198, .14)) !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .1) inset, 0 0 20px rgba(211, 179, 108, .16) !important;
}

body.uw-active .voicefab#bSpeak .vi svg {
  width: 23px !important;
  height: 23px !important;
  stroke-width: 1.85 !important;
  filter: drop-shadow(0 0 9px rgba(211, 179, 108, .42)) !important;
}

body.uw-active .voicefab#bSpeak:hover {
  transform: translateY(-3px) scale(1.045) !important;
  border-color: var(--q-teal) !important;
  box-shadow: 0 28px 62px rgba(0, 0, 0, .58), 0 0 0 1px rgba(255, 255, 255, .08) inset, 0 0 40px rgba(115, 215, 198, .22) !important;
}

body.uw-active .voicefab#bSpeak:focus-visible {
  outline: 2px solid var(--q-teal) !important;
  outline-offset: 5px !important;
}

@media (max-width: 1120px) {
  body.uw-active .voicefab#bSpeak {
    top: auto !important;
    right: 16px !important;
    bottom: 16px !important;
  }
}

@media (max-width: 760px) {
  body.uw-active .voicefab#bSpeak {
    width: 60px !important;
    height: 60px !important;
    min-width: 60px !important;
    min-height: 60px !important;
    right: 14px !important;
    bottom: 14px !important;
  }

  body.uw-active .voicefab#bSpeak .vi {
    width: 37px !important;
    height: 37px !important;
  }
}

/* Timeline clarity pass: one archive header, one axis, details only on demand. */
body.uw-active .app[data-active-mode="timeline"] .timeline-overlay {
  --tl-quiet-ink: #0a1112;
  --tl-quiet-surface: #101b1b;
  --tl-quiet-surface-2: #162424;
  --tl-quiet-line: rgba(233, 225, 202, .14);
  --tl-quiet-paper: #f1e6c9;
  --tl-quiet-muted: #9daaa6;
  --tl-quiet-teal: #73d7c6;
  --tl-quiet-gold: #d3b36c;
  grid-template-rows: 82px minmax(0, 1fr) !important;
  border: 1px solid rgba(211, 179, 108, .22) !important;
  border-radius: 16px !important;
  background:
    radial-gradient(circle at 12% 0%, rgba(115, 215, 198, .08), transparent 28%),
    linear-gradient(180deg, #0b1516 0%, #081011 100%) !important;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .42), inset 0 1px rgba(255, 255, 255, .04) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-head {
  grid-template-columns: 184px minmax(0, 1fr) auto !important;
  grid-template-areas: "title controls actions" !important;
  align-items: center !important;
  height: 82px !important;
  min-height: 82px !important;
  max-height: 82px !important;
  gap: 16px !important;
  padding: 12px 16px !important;
  border-bottom: 1px solid rgba(211, 179, 108, .18) !important;
  background: linear-gradient(180deg, rgba(13, 24, 24, .98), rgba(9, 17, 18, .94)) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-title-block {
  grid-area: title !important;
  min-width: 0 !important;
  gap: 4px !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-kicker {
  color: var(--tl-quiet-teal) !important;
  font: 650 .54rem/1 var(--q-mono) !important;
  letter-spacing: .12em !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-title-wrap h2 {
  color: var(--tl-quiet-paper) !important;
  font: 600 1.8rem/1 var(--q-display) !important;
  letter-spacing: 0 !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-sub {
  overflow: hidden !important;
  color: var(--tl-quiet-muted) !important;
  font: 500 .58rem/1.2 var(--q-mono) !important;
  letter-spacing: .03em !important;
  text-overflow: ellipsis !important;
  text-transform: none !important;
  white-space: nowrap !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-controls {
  grid-area: controls !important;
  min-width: 0 !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-commandbar {
  display: grid !important;
  grid-template-columns: minmax(170px, 1fr) minmax(284px, 380px) minmax(132px, 150px) 34px !important;
  align-items: center !important;
  gap: 7px !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-searchbox-main input {
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 13px !important;
  border: 1px solid rgba(115, 215, 198, .2) !important;
  border-radius: 10px !important;
  background: rgba(5, 12, 13, .72) !important;
  color: var(--tl-quiet-paper) !important;
  font: 500 .75rem/1 var(--q-font) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-searchbox-main input::placeholder {
  color: rgba(157, 170, 166, .7) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-reader-nav {
  display: grid !important;
  grid-template-columns: 28px minmax(96px, 1fr) 92px 52px 28px !important;
  align-items: center !important;
  gap: 4px !important;
  min-width: 0 !important;
  height: 38px !important;
  padding: 3px !important;
  border: 1px solid rgba(233, 225, 202, .15) !important;
  border-radius: 10px !important;
  background: rgba(5, 12, 13, .72) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-reader-nav-book {
  display: grid !important;
  min-width: 0 !important;
  gap: 3px !important;
  padding-inline: 6px !important;
  color: var(--tl-quiet-paper) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-reader-nav-book span {
  color: var(--tl-quiet-teal) !important;
  font: 650 .45rem/1 var(--q-mono) !important;
  letter-spacing: .12em !important;
  text-transform: uppercase !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-reader-nav-book strong {
  overflow: hidden !important;
  color: var(--tl-quiet-paper) !important;
  font: 650 .73rem/1 var(--q-font) !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-reader-nav select,
body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-reader-nav-arrow {
  min-width: 0 !important;
  height: 30px !important;
  border: 1px solid rgba(233, 225, 202, .12) !important;
  border-radius: 7px !important;
  background: rgba(255, 255, 255, .035) !important;
  color: var(--tl-quiet-paper) !important;
  font: 600 .66rem/1 var(--q-font) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-reader-nav select {
  padding-inline: 7px !important;
  cursor: pointer !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-reader-nav-arrow {
  padding: 0 !important;
  color: var(--tl-quiet-teal) !important;
  font-size: 1rem !important;
  cursor: pointer !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-reader-nav :is(select:hover, select:focus, .tl-reader-nav-arrow:hover) {
  border-color: var(--tl-quiet-teal) !important;
  outline: none !important;
  background: rgba(115, 215, 198, .1) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-segment {
  height: 38px !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 3px !important;
  padding: 3px !important;
  border: 1px solid rgba(211, 179, 108, .24) !important;
  border-radius: 10px !important;
  background: rgba(211, 179, 108, .05) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-segment button {
  height: 30px !important;
  min-height: 30px !important;
  padding-inline: 7px !important;
  border-radius: 7px !important;
  color: rgba(241, 230, 201, .68) !important;
  font: 650 .61rem/1 var(--q-font) !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-segment button.act {
  color: #15201d !important;
  background: linear-gradient(180deg, #f4e7c6, #caae72) !important;
  box-shadow: 0 5px 12px rgba(211, 179, 108, .16) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-command-icon {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  border-radius: 9px !important;
  border-color: rgba(115, 215, 198, .34) !important;
  background: rgba(115, 215, 198, .09) !important;
  color: var(--tl-quiet-teal) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-command-meta {
  display: none !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-head-actions {
  grid-area: actions !important;
  align-self: center !important;
  gap: 5px !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay :is(.tl-shell-btn, .tl-close) {
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 !important;
  border: 1px solid rgba(233, 225, 202, .15) !important;
  border-radius: 9px !important;
  background: rgba(255, 255, 255, .035) !important;
  color: var(--tl-quiet-paper) !important;
  font: 600 .86rem/1 var(--q-font) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-main {
  min-height: 0 !important;
  padding: 10px !important;
  overflow: hidden !important;
  background:
    linear-gradient(90deg, rgba(115, 215, 198, .02) 1px, transparent 1px) 0 0 / 56px 56px,
    #081113 !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-shell {
  display: grid !important;
  grid-template-rows: 42px minmax(0, 1fr) !important;
  gap: 9px !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-ribbon {
  display: block !important;
  height: 42px !important;
  min-height: 42px !important;
  padding: 0 !important;
  border: 1px solid rgba(233, 225, 202, .12) !important;
  border-radius: 11px !important;
  background: rgba(12, 24, 24, .78) !important;
  overflow: hidden !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tlr-summary-strip {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  height: 100% !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tlr-summary-item {
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: max-content minmax(0, 1fr) !important;
  grid-template-rows: 16px 16px !important;
  align-content: center !important;
  column-gap: 8px !important;
  padding: 4px 12px !important;
  border-right: 1px solid rgba(233, 225, 202, .1) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tlr-summary-item:last-child {
  border-right: 0 !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tlr-summary-item .tlr-k {
  grid-row: 1 / -1 !important;
  align-self: center !important;
  color: var(--tl-quiet-teal) !important;
  font: 650 .47rem/1 var(--q-mono) !important;
  letter-spacing: .1em !important;
  text-transform: uppercase !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tlr-summary-item strong,
body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tlr-summary-item .tlr-p {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tlr-summary-item strong {
  color: var(--tl-quiet-paper) !important;
  font: 650 .68rem/1 var(--q-font) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tlr-summary-item .tlr-p {
  color: var(--tl-quiet-muted) !important;
  font: 500 .5rem/1 var(--q-mono) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-atlas,
body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-focus-dock,
body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-scene-strip {
  display: none !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-workbench {
  display: grid !important;
  grid-template-columns: 252px minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
  gap: 10px !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-sidebar {
  min-width: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-sidebar-shell {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
  padding: 10px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  border: 1px solid rgba(233, 225, 202, .13) !important;
  border-radius: 12px !important;
  background: linear-gradient(180deg, rgba(15, 28, 28, .98), rgba(8, 16, 17, .98)) !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(211, 179, 108, .42) transparent !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-hero {
  flex: 0 0 auto !important;
  gap: 8px !important;
  padding: 13px !important;
  border: 1px solid rgba(115, 215, 198, .28) !important;
  border-radius: 10px !important;
  background: linear-gradient(145deg, rgba(22, 47, 50, .72), rgba(12, 24, 29, .55)) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-title-row h3 {
  max-width: 160px !important;
  color: var(--tl-quiet-paper) !important;
  font: 600 1.28rem/1.05 var(--q-display) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-hero > p {
  display: -webkit-box !important;
  margin: 7px 0 !important;
  color: #b1bfbb !important;
  font: 500 .72rem/1.45 var(--q-font) !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 3 !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-meta {
  display: flex !important;
  gap: 8px !important;
  color: var(--tl-quiet-muted) !important;
  font: 500 .5rem/1.2 var(--q-mono) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-stats {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 4px !important;
  margin-top: 2px !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-stats span {
  display: grid !important;
  gap: 3px !important;
  min-width: 0 !important;
  padding: 7px !important;
  border: 1px solid rgba(233, 225, 202, .11) !important;
  background: rgba(0, 0, 0, .18) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-stats strong {
  color: var(--tl-quiet-paper) !important;
  font: 650 .78rem/1 var(--q-mono) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-stats small {
  color: var(--tl-quiet-muted) !important;
  font: 500 .46rem/1 var(--q-mono) !important;
  text-transform: uppercase !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-actions {
  display: grid !important;
  grid-template-columns: 1fr 1fr 32px !important;
  gap: 5px !important;
  margin-top: 2px !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay :is(.tl-nav-action, .tl-nav-more) {
  min-height: 32px !important;
  padding-inline: 8px !important;
  border: 1px solid rgba(233, 225, 202, .14) !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, .035) !important;
  color: var(--tl-quiet-paper) !important;
  font: 650 .6rem/1 var(--q-font) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-action.primary,
body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-more:not(.quiet) {
  border-color: rgba(211, 179, 108, .48) !important;
  background: linear-gradient(180deg, #f1dfb9, #caae72) !important;
  color: #17211e !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-details {
  flex: 0 0 auto !important;
  border-top: 1px solid rgba(233, 225, 202, .11) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-details summary {
  min-height: 40px !important;
  padding-inline: 3px !important;
  color: var(--tl-quiet-paper) !important;
  font: 650 .64rem/1 var(--q-font) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-detail-body {
  padding: 3px 0 11px !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-ladder,
body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-tile-grid {
  gap: 5px !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-step,
body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-tile,
body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-mode-btn {
  border-radius: 8px !important;
  border-color: rgba(233, 225, 202, .12) !important;
  background: rgba(255, 255, 255, .025) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-step.act,
body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-tile.act,
body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-mode-btn.act {
  border-color: rgba(115, 215, 198, .4) !important;
  background: rgba(115, 215, 198, .09) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-stage-shell {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: 96px minmax(0, 1fr) !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
  border: 1px solid rgba(233, 225, 202, .14) !important;
  border-radius: 12px !important;
  background: #071012 !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, .04) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-stage-meta {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: 32px 46px 12px !important;
  gap: 3px !important;
  height: 96px !important;
  min-height: 96px !important;
  max-height: 96px !important;
  padding: 8px 10px 6px !important;
  overflow: hidden !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(233, 225, 202, .11) !important;
  border-radius: 0 !important;
  background: linear-gradient(180deg, rgba(18, 34, 34, .86), rgba(10, 20, 21, .82)) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-console-head {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  min-width: 0 !important;
  align-items: center !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-stage-copy > span,
body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nearby > header span {
  color: var(--tl-quiet-teal) !important;
  font: 650 .5rem/1 var(--q-mono) !important;
  letter-spacing: .1em !important;
  text-transform: uppercase !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-stage-copy > strong {
  display: block !important;
  margin-top: 4px !important;
  overflow: hidden !important;
  color: var(--tl-quiet-paper) !important;
  font: 650 .86rem/1 var(--q-font) !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-stage-copy > small {
  display: block !important;
  margin-top: 3px !important;
  color: var(--tl-quiet-muted) !important;
  font: 500 .5rem/1 var(--q-mono) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-stage-actions {
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-stage-btn {
  width: 30px !important;
  min-width: 30px !important;
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 !important;
  border: 1px solid rgba(233, 225, 202, .16) !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, .035) !important;
  color: var(--tl-quiet-paper) !important;
  font: 650 .8rem/1 var(--q-font) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-console-window {
  display: none !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nearby {
  grid-row: 2 !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nearby > header {
  display: none !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-rail {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 5px !important;
  width: 100% !important;
  height: 46px !important;
  overflow: hidden !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-chip {
  display: grid !important;
  grid-template-columns: max-content minmax(0, 1fr) !important;
  grid-template-rows: 17px 15px !important;
  gap: 2px 7px !important;
  align-content: center !important;
  min-width: 0 !important;
  height: 46px !important;
  padding: 5px 8px !important;
  overflow: hidden !important;
  border: 1px solid rgba(233, 225, 202, .12) !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, .025) !important;
  text-align: left !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-chip span {
  grid-column: 1 !important;
  grid-row: 1 !important;
  color: var(--tl-quiet-gold) !important;
  font: 650 .53rem/1 var(--q-mono) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-chip strong {
  grid-column: 2 !important;
  grid-row: 1 !important;
  min-width: 0 !important;
  overflow: hidden !important;
  color: var(--tl-quiet-paper) !important;
  font: 650 .61rem/1.15 var(--q-font) !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-chip small {
  grid-column: 1 / -1 !important;
  grid-row: 2 !important;
  overflow: hidden !important;
  color: var(--tl-quiet-muted) !important;
  font: 500 .5rem/1 var(--q-mono) !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-depthline {
  grid-row: 3 !important;
  display: grid !important;
  grid-template-columns: max-content minmax(50px, 1fr) minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 7px !important;
  height: 12px !important;
  overflow: hidden !important;
  color: var(--tl-quiet-muted) !important;
  font: 500 .48rem/1 var(--q-mono) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-reader-bridge {
  display: grid !important;
  grid-template-columns: max-content max-content !important;
  gap: 5px !important;
  align-items: center !important;
  min-height: 18px !important;
  padding-inline: 7px !important;
  border: 1px solid rgba(115, 215, 198, .28) !important;
  border-radius: 6px !important;
  background: rgba(115, 215, 198, .07) !important;
  color: var(--tl-quiet-teal) !important;
  font: 650 .5rem/1 var(--q-mono) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-reader-bridge b {
  color: var(--tl-quiet-paper) !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-stage,
body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-canvas-wrap,
body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-stage,
body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-canvas-wrap {
  overflow: hidden !important;
  border-radius: 0 0 12px 12px !important;
  background: #071012 !important;
}

/* Selection details remain available, but do not steal the initial viewport. */
body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-inspector {
  display: none !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay:has(.tl-inspector .tli-close) .tl-inspector {
  display: block !important;
  position: absolute !important;
  z-index: 30 !important;
  top: 142px !important;
  right: 22px !important;
  width: min(360px, calc(100% - 44px)) !important;
  max-height: calc(100% - 164px) !important;
  overflow: auto !important;
  border: 1px solid rgba(211, 179, 108, .34) !important;
  border-radius: 14px !important;
  background: rgba(9, 18, 18, .97) !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .04) inset !important;
}

body.uw-active .app[data-active-mode="timeline"] .timeline-overlay:has(.tl-inspector .tli-close) .tl-inspector .tli-shell {
  min-height: 0 !important;
  border: 0 !important;
  border-radius: inherit !important;
  box-shadow: none !important;
}

@media (max-width: 1100px) and (min-width: 901px) {
  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-head {
    grid-template-columns: 150px minmax(0, 1fr) auto !important;
    gap: 10px !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-commandbar {
    grid-template-columns: minmax(140px, 1fr) minmax(245px, 310px) 110px 34px !important;
    gap: 5px !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-reader-nav {
    grid-template-columns: 24px minmax(78px, 1fr) 78px 44px 24px !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-workbench {
    grid-template-columns: 220px minmax(0, 1fr) !important;
  }
}

@media (max-width: 900px) {
  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay {
    grid-template-rows: 132px minmax(0, 1fr) !important;
    overflow-y: auto !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-head {
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-rows: 34px 82px !important;
    grid-template-areas: "title actions" "controls controls" !important;
    height: 132px !important;
    min-height: 132px !important;
    max-height: 132px !important;
    gap: 6px !important;
    padding: 9px 10px !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-kicker,
  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-sub {
    display: none !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-title-wrap h2 {
    font-size: 1.25rem !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-commandbar {
    grid-template-columns: minmax(0, 1fr) 34px !important;
    grid-template-rows: 38px 38px !important;
    gap: 5px !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-searchbox-main {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-command-icon {
    grid-column: 2 !important;
    grid-row: 1 !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-reader-nav {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    grid-template-columns: 26px minmax(0, 1fr) 84px 48px 26px !important;
    height: 38px !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-segment {
    display: none !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-main {
    height: auto !important;
    min-height: 0 !important;
    padding: 6px !important;
    overflow: visible !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-shell {
    height: auto !important;
    min-height: 0 !important;
    grid-template-rows: 42px auto !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tlr-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tlr-summary-item {
    padding-inline: 8px !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-workbench {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: 300px 480px !important;
    height: auto !important;
    overflow: visible !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-sidebar-shell {
    height: 300px !important;
    max-height: 300px !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-stage-shell {
    grid-template-rows: 112px 368px !important;
    height: 480px !important;
    min-height: 480px !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay:has(.tl-inspector .tli-close) .tl-inspector {
    top: 142px !important;
    right: 12px !important;
    width: calc(100% - 24px) !important;
    max-height: calc(100% - 154px) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay *,
  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay *::before,
  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Final context-rail contract: later legacy layers must not hide or reflow
   the six shared controls after the workspace has mounted. */
@media (min-width: 1181px) {
  body.uw-active[data-uw-bridge] .uw-contextbar {
    grid-template-columns: 148px minmax(170px, 230px) minmax(220px, 1fr) minmax(132px, 180px) 108px 154px !important;
  }
}

@media (min-width: 761px) and (max-width: 1180px) {
  body.uw-active[data-uw-bridge] .uw-contextbar {
    height: 48px !important;
    min-height: 48px !important;
    grid-template-columns: 132px 172px minmax(170px, 1fr) 120px 92px 68px !important;
    gap: 6px !important;
    padding: 4px 10px !important;
    align-items: center !important;
  }

  body.uw-active[data-uw-bridge] .uw-handoff {
    display: flex !important;
    min-width: 0 !important;
    align-items: center !important;
  }

  body.uw-active[data-uw-bridge] .uw-handoff button {
    width: 100% !important;
    max-width: 120px !important;
    height: 34px !important;
    overflow: hidden !important;
    padding-inline: 7px !important;
    text-overflow: ellipsis !important;
    font-size: .49rem !important;
  }

  body.uw-active[data-uw-bridge] .uw-reader-toggle {
    display: flex !important;
    min-width: 0 !important;
    height: 38px !important;
    padding-inline: 7px !important;
  }

  body.uw-active[data-uw-bridge] .uw-reader-toggle span {
    font-size: .58rem !important;
  }

  body.uw-active[data-uw-bridge] .uw-reader-toggle small {
    display: block !important;
    font-size: .4rem !important;
  }

  body.uw-active[data-uw-bridge] .uw-truth-button {
    width: 68px !important;
    height: 38px !important;
    justify-content: flex-start !important;
    padding-inline: 7px !important;
  }

  body.uw-active[data-uw-bridge] .uw-truth-button > i {
    flex: none !important;
    margin-right: 5px !important;
  }

  body.uw-active[data-uw-bridge] .uw-truth-button > span {
    display: block !important;
    min-width: 0 !important;
  }

  body.uw-active[data-uw-bridge] .uw-truth-button small {
    display: none !important;
  }

  body.uw-active[data-uw-bridge] .uw-truth-button strong {
    display: block !important;
    max-width: 45px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: .47rem !important;
  }

  body.uw-active[data-uw-bridge] .uw-focus-summary {
    grid-template-columns: max-content max-content minmax(0, 1fr) !important;
    gap: 7px !important;
    padding-inline: 9px !important;
  }
}

/* Final timeline minimal pass: these rules intentionally come last so the
   older timeline layers cannot restore duplicate controls or dense panels. */
@media (min-width: 901px) {
  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-main {
    padding: 8px !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-commandbar {
    grid-template-columns: minmax(220px, 1fr) minmax(284px, 380px) 34px !important;
    gap: 7px !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-segment {
    display: none !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tlr-summary-strip {
    grid-template-columns: 1.15fr 1fr .9fr !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tlr-summary-item {
    padding-inline: 11px !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-workbench {
    grid-template-columns: 224px minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-sidebar-shell {
    gap: 6px !important;
    padding: 8px !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-hero {
    gap: 6px !important;
    padding: 11px !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-title-row h3 {
    max-width: 142px !important;
    font-size: 1.14rem !important;
    line-height: 1.08 !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-hero > p {
    margin: 5px 0 !important;
    -webkit-line-clamp: 2 !important;
    font-size: .67rem !important;
    line-height: 1.38 !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-meta {
    gap: 6px !important;
    font-size: .46rem !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-stats {
    gap: 3px !important;
    margin-top: 1px !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-stats span {
    gap: 2px !important;
    padding: 6px !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-stats strong {
    overflow: hidden !important;
    font-size: .67rem !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-stats small {
    font-size: .4rem !important;
    letter-spacing: .02em !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-journey {
    display: none !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-details summary {
    min-height: 34px !important;
    font-size: .59rem !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-stage-meta {
    grid-template-rows: 32px 42px 10px !important;
    height: 92px !important;
    min-height: 92px !important;
    max-height: 92px !important;
    padding: 7px 9px 5px !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 4px !important;
    height: 42px !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-chip {
    grid-template-rows: 15px 14px !important;
    gap: 1px 6px !important;
    height: 42px !important;
    padding: 4px 7px !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-chip strong {
    font-size: .57rem !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-chip small {
    font-size: .4rem !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-stage-actions #tlZoomOut,
  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-stage-actions #tlZoomIn,
  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-depthline > small {
    display: none !important;
  }
}

@media (max-width: 900px) {
  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-segment {
    display: none !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tlr-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-nav-journey {
    display: none !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-stage-meta {
    grid-template-rows: 32px 49px 10px !important;
    height: 112px !important;
    min-height: 112px !important;
    max-height: 112px !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-rail {
    display: flex !important;
    grid-template-columns: none !important;
    height: 49px !important;
    overflow-x: auto !important;
  }

  body.uw-active .app[data-active-mode="timeline"] .timeline-overlay .tl-context-chip {
    flex: 0 0 150px !important;
    width: 150px !important;
    height: 49px !important;
  }
}
