/*
 * Tianming bright presentation themes.
 * These are intentionally separate names rather than the retired `light` /
 * `paper` values, so the legacy theme guard cannot erase a user's choice.
 */

html[data-theme="paper-bright"],
html[data-theme="celadon-bright"] {
  color-scheme: light;
  --ink-50: #fffdf8;
  --ink-100: #f5efe4;
  --ink-200: #e5dccd;
  --ink-300: #9b9080;
  --ink-400: #6f665b;
  --ink-500: #4b463f;
  --ink-600: #d8cfc1;
  --ink-700: #fffaf1;
  --ink-800: #f3eee6;
  --ink-900: #e6ddd0;
  --gold-300: #b7793f;
  --gold-400: #98602d;
  --gold-500: #7d4a21;
  --gold-600: #633615;
  --vermillion-300: #d66e58;
  --vermillion-400: #b84c3e;
  --vermillion-500: #8f302b;
  --celadon-300: #8fc9bb;
  --celadon-400: #3f8d7d;
  --celadon-500: #2d6e63;
  --indigo-400: #5276a8;
  --indigo-500: #3c5d8d;
  --green-400: #4b8b62;
  --red-400: #b84c3e;
  --amber-400: #a56a20;
  --color-background: #f3eee6;
  --color-surface: #fffaf1;
  --color-elevated: #ffffff;
  --color-sunken: #e6ddd0;
  --color-foreground: #2b2925;
  --color-foreground-secondary: #5f594f;
  --color-foreground-muted: #786d5e;
  --color-border: #c9bcaa;
  --color-border-subtle: #e0d6c8;
  --color-border-emphasis: #98602d;
  --color-primary: #98602d;
  --color-primary-hover: #7d4a21;
  --color-primary-foreground: #fffdf8;
  --color-accent: #b84c3e;
  --color-accent-subtle: rgba(184, 76, 62, .11);
  --color-info: #3f8d7d;
  --color-info-subtle: rgba(63, 141, 125, .12);
  --color-success: #4b8b62;
  --color-destructive: #b84c3e;
  --color-warning: #a56a20;
  --color-ring: #98602d;
  --color-hover-overlay: rgba(125, 74, 33, .07);
  --bg-0: #e6ddd0;
  --bg-1: #f3eee6;
  --bg-2: #fffaf1;
  --bg-3: #ffffff;
  --bg-4: #ebe2d5;
  --gold: #98602d;
  --gold-l: #b7793f;
  --gold-d: #7d4a21;
  --red: #b84c3e;
  --green: #4b8b62;
  --blue: #5276a8;
  --purple: #8065a0;
  --txt: #2b2925;
  --txt-s: #5f594f;
  --txt-d: #786d5e;
  --bdr: #c9bcaa;
  --bg-paper: #fffaf1;
  --shadow-sm: 0 1px 4px rgba(73, 54, 35, .10);
  --shadow-md: 0 5px 16px rgba(73, 54, 35, .14);
  --shadow-lg: 0 12px 32px rgba(73, 54, 35, .16);
  --shadow-gold: 0 0 14px rgba(152, 96, 45, .14);
}

html[data-theme="celadon-bright"] {
  --color-background: #edf5f1;
  --color-surface: #f9fdf9;
  --color-elevated: #ffffff;
  --color-sunken: #dcebe4;
  --color-border: #b8d1c6;
  --color-border-subtle: #d4e5dd;
  --color-border-emphasis: #36796b;
  --color-primary: #36796b;
  --color-primary-hover: #285e54;
  --color-accent: #ba604e;
  --color-accent-subtle: rgba(186, 96, 78, .11);
  --color-info: #36796b;
  --color-info-subtle: rgba(54, 121, 107, .12);
  --color-background: #edf5f1;
  --color-surface: #f9fdf9;
  --color-foreground-secondary: #50665e;
  --color-foreground-muted: #688078;
  --bg-0: #dcebe4;
  --bg-1: #edf5f1;
  --bg-2: #f9fdf9;
  --bg-3: #ffffff;
  --bg-4: #e4f0eb;
  --gold: #36796b;
  --gold-l: #579989;
  --gold-d: #285e54;
  --txt: #23372f;
  --txt-s: #50665e;
  --txt-d: #688078;
  --bdr: #b8d1c6;
  --bg-paper: #f9fdf9;
}

/* Base surfaces and type. A bright theme should lighten the reading area as
 * well as the launch screen; token overrides above cover the majority of the
 * game, while these selectors catch legacy hard-coded surfaces. */
html[data-theme="paper-bright"] body,
html[data-theme="celadon-bright"] body {
  background: var(--color-background) !important;
  color: var(--color-foreground) !important;
  text-shadow: none;
}
html[data-theme="paper-bright"] #launch,
html[data-theme="celadon-bright"] #launch,
html[data-theme="paper-bright"] .home-stage,
html[data-theme="celadon-bright"] .home-stage {
  background: var(--color-background) !important;
  color: var(--color-foreground) !important;
}
html[data-theme="paper-bright"] .home-stage::before,
html[data-theme="paper-bright"] .home-stage::after,
html[data-theme="celadon-bright"] .home-stage::before,
html[data-theme="celadon-bright"] .home-stage::after {
  background: radial-gradient(circle at 50% 20%, rgba(255,255,255,.94), transparent 58%),
    linear-gradient(135deg, rgba(219,191,149,.28), transparent 48%, rgba(184,215,199,.30)) !important;
  mix-blend-mode: normal !important;
  opacity: 1 !important;
  filter: none !important;
}
html[data-theme="paper-bright"] .home-main,
html[data-theme="celadon-bright"] .home-main {
  text-shadow: none !important;
}
html[data-theme="paper-bright"] .home-title,
html[data-theme="celadon-bright"] .home-title {
  color: var(--color-primary) !important;
  -webkit-text-fill-color: currentColor !important;
  background: none !important;
  filter: none !important;
  text-shadow: 0 2px 0 rgba(255,255,255,.8), 0 8px 20px rgba(80,55,34,.12) !important;
}
html[data-theme="paper-bright"] .home-sub,
html[data-theme="celadon-bright"] .home-sub,
html[data-theme="paper-bright"] .home-seal-lbl,
html[data-theme="celadon-bright"] .home-seal-lbl,
html[data-theme="paper-bright"] .home-ylian,
html[data-theme="celadon-bright"] .home-ylian {
  color: var(--color-foreground-muted) !important;
  text-shadow: none !important;
}
html[data-theme="paper-bright"] .home-card,
html[data-theme="celadon-bright"] .home-card {
  border-color: var(--color-border) !important;
  background: linear-gradient(110deg, rgba(255,255,255,.96), rgba(255,250,241,.90)) !important;
  box-shadow: var(--shadow-sm) !important;
  color: var(--color-foreground) !important;
}
html[data-theme="celadon-bright"] .home-card {
  background: linear-gradient(110deg, rgba(255,255,255,.96), rgba(239,249,244,.94)) !important;
}
html[data-theme="paper-bright"] .home-card:hover,
html[data-theme="paper-bright"] .home-card:focus-visible,
html[data-theme="celadon-bright"] .home-card:hover,
html[data-theme="celadon-bright"] .home-card:focus-visible {
  border-color: var(--color-primary) !important;
  background: #ffffff !important;
  box-shadow: var(--shadow-md) !important;
  transform: translateX(4px);
}
html[data-theme="paper-bright"] .home-card-ti,
html[data-theme="celadon-bright"] .home-card-ti,
html[data-theme="paper-bright"] .home-card-desc,
html[data-theme="celadon-bright"] .home-card-desc,
html[data-theme="paper-bright"] .home-card-key,
html[data-theme="celadon-bright"] .home-card-key,
html[data-theme="paper-bright"] .home-recent,
html[data-theme="celadon-bright"] .home-recent,
html[data-theme="paper-bright"] .home-panel,
html[data-theme="celadon-bright"] .home-panel,
html[data-theme="paper-bright"] .home-tools button,
html[data-theme="celadon-bright"] .home-tools button {
  color: var(--color-foreground-secondary) !important;
}
html[data-theme="paper-bright"] .home-panel,
html[data-theme="celadon-bright"] .home-panel {
  border-color: var(--color-border) !important;
  background: rgba(255,255,255,.76) !important;
  box-shadow: var(--shadow-md) !important;
}
html[data-theme="paper-bright"] .home-tools button,
html[data-theme="celadon-bright"] .home-tools button {
  border-color: var(--color-border) !important;
  background: rgba(255,255,255,.72) !important;
}
html[data-theme="paper-bright"] .home-foot,
html[data-theme="celadon-bright"] .home-foot {
  color: var(--color-foreground-muted) !important;
  background: rgba(255,255,255,.84) !important;
  border-top-color: var(--color-border-subtle) !important;
  backdrop-filter: blur(12px);
}

/* Gameplay shell, rails, cards, forms and dialogs. */
html[data-theme="paper-bright"] #bar,
html[data-theme="celadon-bright"] #bar,
html[data-theme="paper-bright"] #G,
html[data-theme="celadon-bright"] #G,
html[data-theme="paper-bright"] #E,
html[data-theme="celadon-bright"] #E,
html[data-theme="paper-bright"] .gc,
html[data-theme="celadon-bright"] .gc,
html[data-theme="paper-bright"] .gs-rail-left,
html[data-theme="celadon-bright"] .gs-rail-left,
html[data-theme="paper-bright"] .gs-rail-right,
html[data-theme="celadon-bright"] .gs-rail-right {
  background-color: var(--color-background) !important;
  background-image: linear-gradient(180deg, rgba(255,255,255,.78), rgba(255,255,255,0)) !important;
  color: var(--color-foreground) !important;
  box-shadow: none !important;
}
html[data-theme="paper-bright"] #bar,
html[data-theme="celadon-bright"] #bar {
  border-bottom-color: var(--color-border) !important;
  box-shadow: 0 3px 14px rgba(73,54,35,.10) !important;
}
html[data-theme="paper-bright"] .gs-panel,
html[data-theme="celadon-bright"] .gs-panel,
html[data-theme="paper-bright"] .cd,
html[data-theme="celadon-bright"] .cd,
html[data-theme="paper-bright"] .scroll-panel,
html[data-theme="celadon-bright"] .scroll-panel,
html[data-theme="paper-bright"] .mem-card,
html[data-theme="celadon-bright"] .mem-card,
html[data-theme="paper-bright"] .ngui-panel,
html[data-theme="celadon-bright"] .ngui-panel,
html[data-theme="paper-bright"] .tm-op-paper,
html[data-theme="celadon-bright"] .tm-op-paper {
  background-color: var(--color-surface) !important;
  background-image: linear-gradient(180deg, rgba(255,255,255,.58), rgba(255,255,255,0)) !important;
  border-color: var(--color-border) !important;
  color: var(--color-foreground) !important;
  box-shadow: var(--shadow-sm) !important;
}
html[data-theme="paper-bright"] input,
html[data-theme="paper-bright"] textarea,
html[data-theme="paper-bright"] select,
html[data-theme="celadon-bright"] input,
html[data-theme="celadon-bright"] textarea,
html[data-theme="celadon-bright"] select {
  color: var(--color-foreground) !important;
  background: #ffffff !important;
  border-color: var(--color-border) !important;
}
html[data-theme="paper-bright"] .bt,
html[data-theme="celadon-bright"] .bt,
html[data-theme="paper-bright"] .gs-rail-btn,
html[data-theme="celadon-bright"] .gs-rail-btn,
html[data-theme="paper-bright"] .bar-icon-btn2,
html[data-theme="celadon-bright"] .bar-icon-btn2 {
  color: var(--color-primary) !important;
  background: rgba(255,255,255,.72) !important;
  border-color: var(--color-border) !important;
}
html[data-theme="paper-bright"] .bp,
html[data-theme="celadon-bright"] .bp {
  color: #fffdf8 !important;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover)) !important;
}
html[data-theme="paper-bright"] .generic-modal-overlay,
html[data-theme="celadon-bright"] .generic-modal-overlay,
html[data-theme="paper-bright"] .modal-bg,
html[data-theme="celadon-bright"] .modal-bg {
  background: rgba(42, 34, 25, .30) !important;
  backdrop-filter: blur(5px);
}
html[data-theme="paper-bright"] .generic-modal,
html[data-theme="celadon-bright"] .generic-modal,
html[data-theme="paper-bright"] .modal,
html[data-theme="celadon-bright"] .modal {
  background: var(--color-surface) !important;
  color: var(--color-foreground) !important;
  border-color: var(--color-border) !important;
  box-shadow: var(--shadow-lg) !important;
}
html[data-theme="paper-bright"] .tm-fulltext-tooltip,
html[data-theme="celadon-bright"] .tm-fulltext-tooltip {
  color: var(--color-foreground) !important;
  background: #fffdf8 !important;
  border-color: var(--color-border) !important;
  box-shadow: var(--shadow-md) !important;
}

@media (max-width: 760px) {
  html[data-theme="paper-bright"] .home-stage,
  html[data-theme="celadon-bright"] .home-stage { padding-bottom: 92px !important; }
  html[data-theme="paper-bright"] .home-title,
  html[data-theme="celadon-bright"] .home-title { font-size: clamp(56px, 18vw, 82px) !important; }
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme="paper-bright"] *,
  html[data-theme="celadon-bright"] * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Compact theme entry. The option panel only occupies the screen after the
 * player explicitly opens it. In formal play JS mounts the entry inside the
 * topbar so it participates in the same layout instead of covering it. */
#tm-bright-theme-switcher {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 2147484000;
  width: max-content;
  max-width: calc(100vw - 24px);
  pointer-events: auto;
  color: #5f4b38;
  font: 13px/1.35 "Noto Sans SC", "Microsoft YaHei", sans-serif;
}
#tm-bright-theme-switcher.tm-bright-theme-topbar {
  position: relative !important;
  inset: auto !important;
  z-index: 8;
  flex: 0 0 auto;
  max-width: none;
}
.tm-bright-theme-trigger {
  min-width: 116px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid rgba(125, 74, 33, .30);
  border-radius: 12px;
  color: inherit;
  background: rgba(255, 252, 246, .92);
  box-shadow: 0 7px 20px rgba(73, 54, 35, .14);
  font: inherit;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}
.tm-bright-theme-trigger:hover,
.tm-bright-theme-trigger:focus-visible,
#tm-bright-theme-switcher.is-open .tm-bright-theme-trigger {
  border-color: currentColor;
  transform: translateY(-1px);
  outline: none;
}
.tm-bright-theme-trigger-icon { font-size: 16px; line-height: 1; }
.tm-bright-theme-trigger-label { font-weight: 700; letter-spacing: .08em; }
.tm-bright-theme-trigger b { font-size: 12px; opacity: .72; }
.tm-bright-theme-chevron { font-size: 14px; transition: transform 150ms ease; }
#tm-bright-theme-switcher.is-open .tm-bright-theme-chevron { transform: rotate(180deg); }

.tm-bright-theme-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 264px;
  max-width: calc(100vw - 24px);
  padding: 12px;
  border: 1px solid rgba(125, 74, 33, .28);
  border-radius: 14px;
  background: rgba(255, 252, 246, .98);
  box-shadow: 0 18px 44px rgba(73, 54, 35, .22);
  color: #493a2d;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px) scale(.98);
  transform-origin: right top;
  transition: opacity 150ms ease, transform 150ms ease;
  backdrop-filter: blur(16px);
}
#tm-bright-theme-switcher.is-open .tm-bright-theme-popover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.tm-bright-theme-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tm-bright-theme-head strong { font-size: 15px; letter-spacing: .10em; }
.tm-bright-theme-close {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(125, 74, 33, .22);
  border-radius: 9px;
  background: rgba(125, 74, 33, .05);
  color: inherit;
  font: 20px/1 "Microsoft YaHei", sans-serif;
  cursor: pointer;
}
.tm-bright-theme-close:hover,
.tm-bright-theme-close:focus-visible { border-color: currentColor; background: rgba(125, 74, 33, .12); outline: none; }
.tm-bright-theme-hint { margin: 2px 0 10px; color: #77695b; font-size: 12px; }
.tm-bright-theme-buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.tm-bright-theme-buttons button {
  min-width: 0;
  min-height: 66px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 7px 5px;
  border: 1px solid rgba(125, 74, 33, .24);
  border-radius: 10px;
  color: inherit;
  background: rgba(255, 255, 255, .58);
  font: inherit;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}
.tm-bright-theme-buttons button:hover,
.tm-bright-theme-buttons button:focus-visible { transform: translateY(-2px); border-color: currentColor; outline: none; }
.tm-bright-theme-buttons button.is-active {
  color: #fffdf8;
  background: #98602d;
  border-color: #98602d;
  box-shadow: 0 5px 12px rgba(125, 74, 33, .22);
}
html[data-theme="celadon-bright"] .tm-bright-theme-buttons button.is-active { background: #36796b; border-color: #36796b; }
.tm-bright-theme-buttons button span { font-size: 17px; line-height: 1; }
.tm-bright-theme-buttons button b { font-size: 13px; font-weight: 700; }
.tm-bright-theme-buttons button small { font-size: 10px; opacity: .74; white-space: nowrap; }
.tm-bright-theme-settings {
  width: 100%;
  min-height: 38px;
  margin-top: 9px;
  border: 1px solid rgba(125, 74, 33, .24);
  border-radius: 10px;
  background: rgba(125, 74, 33, .07);
  color: inherit;
  font: 700 13px/1.2 "Noto Sans SC", "Microsoft YaHei", sans-serif;
  cursor: pointer;
}
.tm-bright-theme-settings:hover,
.tm-bright-theme-settings:focus-visible { border-color: currentColor; background: rgba(125, 74, 33, .12); outline: none; }
.tm-bright-theme-status { display: block; min-height: 16px; margin-top: 5px; font-size: 11px; opacity: .72; text-align: center; }

html:not([data-theme="paper-bright"]):not([data-theme="celadon-bright"]) #tm-bright-theme-switcher { color: #eadfbd; }
html:not([data-theme="paper-bright"]):not([data-theme="celadon-bright"]) .tm-bright-theme-trigger {
  border-color: rgba(213, 177, 105, .36);
  background: rgba(22, 17, 12, .90);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .30);
}
html:not([data-theme="paper-bright"]):not([data-theme="celadon-bright"]) .tm-bright-theme-popover {
  border-color: rgba(213, 177, 105, .34);
  background: rgba(20, 16, 12, .98);
  color: #eadfbd;
  box-shadow: 0 20px 48px rgba(0, 0, 0, .52);
}
html:not([data-theme="paper-bright"]):not([data-theme="celadon-bright"]) .tm-bright-theme-hint { color: #ad9d7d; }
html:not([data-theme="paper-bright"]):not([data-theme="celadon-bright"]) .tm-bright-theme-buttons button,
html:not([data-theme="paper-bright"]):not([data-theme="celadon-bright"]) .tm-bright-theme-settings,
html:not([data-theme="paper-bright"]):not([data-theme="celadon-bright"]) .tm-bright-theme-close {
  border-color: rgba(213, 177, 105, .30);
  background: rgba(255, 255, 255, .055);
}

@media (max-width: 600px) {
  #tm-bright-theme-switcher { top: 8px; right: 8px; }
  .tm-bright-theme-trigger { min-width: 48px; padding: 0 10px; }
  .tm-bright-theme-trigger-label,
  .tm-bright-theme-trigger b { display: none; }
}

/*
 * Formal shell skin
 *
 * The formal game is assembled after this stylesheet by a number of runtime
 * modules.  Those modules deliberately use dark, high-specificity rules, so
 * the bright skin repeats the `html[data-theme] body.tm-phase8-formal` scope
 * here.  It keeps the visual contract stable without changing the game
 * renderer or its data.
 */
html[data-theme="paper-bright"] body.tm-phase8-formal {
  --tm-formal-bg: #f1ebe1;
  --tm-formal-surface: #fffdf8;
  --tm-formal-surface-2: #f8f3eb;
  --tm-formal-surface-3: #eee6d9;
  --tm-formal-ink: #2f332f;
  --tm-formal-muted: #647068;
  --tm-formal-border: #cbbdaa;
  --tm-formal-border-soft: #ded4c5;
  --tm-formal-primary: #8d5b37;
  --tm-formal-primary-deep: #704329;
  --tm-formal-teal: #3d8174;
  --tm-formal-danger: #a94b42;
}
html[data-theme="celadon-bright"] body.tm-phase8-formal {
  --tm-formal-bg: #eaf3ef;
  --tm-formal-surface: #fbfefc;
  --tm-formal-surface-2: #f3faf6;
  --tm-formal-surface-3: #deece5;
  --tm-formal-ink: #233a33;
  --tm-formal-muted: #5c756b;
  --tm-formal-border: #b7d0c4;
  --tm-formal-border-soft: #d2e3da;
  --tm-formal-primary: #34796b;
  --tm-formal-primary-deep: #285c52;
  --tm-formal-teal: #34796b;
  --tm-formal-danger: #ad594d;
}

/* Keep the game canvas and the shell itself readable even when a legacy
 * module writes a hard-coded near-black background. */
html[data-theme="paper-bright"] body.tm-phase8-formal,
html[data-theme="celadon-bright"] body.tm-phase8-formal,
html[data-theme="paper-bright"] body.tm-phase8-formal #G,
html[data-theme="celadon-bright"] body.tm-phase8-formal #G,
html[data-theme="paper-bright"] body.tm-phase8-formal #E,
html[data-theme="celadon-bright"] body.tm-phase8-formal #E,
html[data-theme="paper-bright"] body.tm-phase8-formal .gc,
html[data-theme="celadon-bright"] body.tm-phase8-formal .gc,
html[data-theme="paper-bright"] body.tm-phase8-formal #tm-phase8-main-shell,
html[data-theme="celadon-bright"] body.tm-phase8-formal #tm-phase8-main-shell,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-map-board,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-map-board {
  background-color: var(--tm-formal-bg) !important;
  color: var(--tm-formal-ink) !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal #tm-phase8-main-shell,
html[data-theme="celadon-bright"] body.tm-phase8-formal #tm-phase8-main-shell {
  text-shadow: none !important;
}

/* The runtime topbar is #topbar (the older #bar is only a compatibility
 * shell).  Hide its dark image underlays and use a paper/porcelain rail. */
html[data-theme="paper-bright"] body.tm-phase8-formal #topbar,
html[data-theme="celadon-bright"] body.tm-phase8-formal #topbar {
  background: linear-gradient(180deg, rgba(255,253,248,.98), rgba(241,234,223,.96)) !important;
  border-bottom: 1px solid var(--tm-formal-border) !important;
  box-shadow: 0 8px 22px rgba(72, 57, 40, .16) !important;
  color: var(--tm-formal-ink) !important;
  text-shadow: none !important;
}
html[data-theme="celadon-bright"] body.tm-phase8-formal #topbar {
  background: linear-gradient(180deg, rgba(253,255,254,.98), rgba(229,241,235,.96)) !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal #topbar::before,
html[data-theme="celadon-bright"] body.tm-phase8-formal #topbar::before,
html[data-theme="paper-bright"] body.tm-phase8-formal #topbar::after,
html[data-theme="celadon-bright"] body.tm-phase8-formal #topbar::after,
html[data-theme="paper-bright"] body.tm-phase8-formal #topbar .tb-left::before,
html[data-theme="celadon-bright"] body.tm-phase8-formal #topbar .tb-left::before {
  display: none !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal #topbar .tb-left,
html[data-theme="celadon-bright"] body.tm-phase8-formal #topbar .tb-left,
html[data-theme="paper-bright"] body.tm-phase8-formal #topbar .tb-vars,
html[data-theme="celadon-bright"] body.tm-phase8-formal #topbar .tb-vars,
html[data-theme="paper-bright"] body.tm-phase8-formal #topbar .tb-chip,
html[data-theme="celadon-bright"] body.tm-phase8-formal #topbar .tb-chip {
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(247,241,232,.94)) !important;
  border-color: var(--tm-formal-border) !important;
  box-shadow: 0 5px 16px rgba(72, 57, 40, .13), inset 0 1px 0 rgba(255,255,255,.92) !important;
  color: var(--tm-formal-ink) !important;
  text-shadow: none !important;
}
html[data-theme="celadon-bright"] body.tm-phase8-formal #topbar .tb-left,
html[data-theme="celadon-bright"] body.tm-phase8-formal #topbar .tb-vars,
html[data-theme="celadon-bright"] body.tm-phase8-formal #topbar .tb-chip {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(237,247,242,.95)) !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal #topbar .tb-right,
html[data-theme="celadon-bright"] body.tm-phase8-formal #topbar .tb-right {
  background: transparent !important;
  box-shadow: none !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal #topbar .tb-dyn,
html[data-theme="celadon-bright"] body.tm-phase8-formal #topbar .tb-dyn {
  background: none !important;
  color: var(--tm-formal-primary) !important;
  -webkit-text-fill-color: currentColor !important;
  text-shadow: none !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal #topbar .tb-ruler,
html[data-theme="celadon-bright"] body.tm-phase8-formal #topbar .tb-ruler,
html[data-theme="paper-bright"] body.tm-phase8-formal #topbar .tb-time-main,
html[data-theme="celadon-bright"] body.tm-phase8-formal #topbar .tb-time-main,
html[data-theme="paper-bright"] body.tm-phase8-formal #topbar .tb-time-sub,
html[data-theme="celadon-bright"] body.tm-phase8-formal #topbar .tb-time-sub,
html[data-theme="paper-bright"] body.tm-phase8-formal #topbar .tb-w-name,
html[data-theme="celadon-bright"] body.tm-phase8-formal #topbar .tb-w-name,
html[data-theme="paper-bright"] body.tm-phase8-formal #topbar .tb-w-desc,
html[data-theme="celadon-bright"] body.tm-phase8-formal #topbar .tb-w-desc,
html[data-theme="paper-bright"] body.tm-phase8-formal #topbar .tb-vn,
html[data-theme="celadon-bright"] body.tm-phase8-formal #topbar .tb-vn,
html[data-theme="paper-bright"] body.tm-phase8-formal #topbar .tb-vding,
html[data-theme="celadon-bright"] body.tm-phase8-formal #topbar .tb-vding {
  color: var(--tm-formal-muted) !important;
  text-shadow: none !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal #topbar .tb-time-main,
html[data-theme="celadon-bright"] body.tm-phase8-formal #topbar .tb-time-main,
html[data-theme="paper-bright"] body.tm-phase8-formal #topbar .tb-var .tb-vv,
html[data-theme="celadon-bright"] body.tm-phase8-formal #topbar .tb-var .tb-vv,
html[data-theme="paper-bright"] body.tm-phase8-formal #topbar .tb-var.wide .sv b,
html[data-theme="celadon-bright"] body.tm-phase8-formal #topbar .tb-var.wide .sv b,
html[data-theme="paper-bright"] body.tm-phase8-formal #topbar .tb-seal-idx .tsi-ch,
html[data-theme="celadon-bright"] body.tm-phase8-formal #topbar .tb-seal-idx .tsi-ch,
html[data-theme="paper-bright"] body.tm-phase8-formal #topbar .tb-seal-idx .tsi-val,
html[data-theme="celadon-bright"] body.tm-phase8-formal #topbar .tb-seal-idx .tsi-val {
  color: var(--tm-formal-primary-deep) !important;
  text-shadow: none !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal #topbar .tb-var .tb-vv,
html[data-theme="celadon-bright"] body.tm-phase8-formal #topbar .tb-var .tb-vv {
  -webkit-text-fill-color: currentColor !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal #topbar .tb-var.warn .tb-vv,
html[data-theme="celadon-bright"] body.tm-phase8-formal #topbar .tb-var.warn .tb-vv {
  color: var(--tm-formal-danger) !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal #topbar .tb-var.good .tb-vv,
html[data-theme="celadon-bright"] body.tm-phase8-formal #topbar .tb-var.good .tb-vv,
html[data-theme="paper-bright"] body.tm-phase8-formal #topbar .sd.up,
html[data-theme="celadon-bright"] body.tm-phase8-formal #topbar .sd.up {
  color: var(--tm-formal-teal) !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal #topbar .tb-chip,
html[data-theme="celadon-bright"] body.tm-phase8-formal #topbar .tb-chip,
html[data-theme="paper-bright"] body.tm-phase8-formal #topbar .tb-wentian,
html[data-theme="celadon-bright"] body.tm-phase8-formal #topbar .tb-wentian {
  color: var(--tm-formal-primary) !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal #topbar .tb-seal,
html[data-theme="celadon-bright"] body.tm-phase8-formal #topbar .tb-seal {
  background: radial-gradient(circle at 34% 24%, #e88973, transparent 28%), linear-gradient(145deg, #bf594b, #963932) !important;
  border-color: #9f5146 !important;
  color: #fffaf3 !important;
  box-shadow: inset 0 0 0 2px rgba(255,248,232,.48), 0 4px 12px rgba(137,61,49,.24) !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal #topbar .tb-seal-idx,
html[data-theme="celadon-bright"] body.tm-phase8-formal #topbar .tb-seal-idx {
  background: linear-gradient(180deg, #fff8ec, #eee2d1) !important;
  border-color: var(--tm-formal-border) !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.74), 0 3px 10px rgba(72,57,40,.12) !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal #topbar .tb-var:hover,
html[data-theme="celadon-bright"] body.tm-phase8-formal #topbar .tb-var:hover,
html[data-theme="paper-bright"] body.tm-phase8-formal #topbar .tb-var.pinned,
html[data-theme="celadon-bright"] body.tm-phase8-formal #topbar .tb-var.pinned {
  background: rgba(141,91,55,.10) !important;
}

/* During the brief shell hand-off before JS mounts the compact entry into the
 * topbar, keep its body-level fallback below the rail. */
html[data-theme="paper-bright"] body.tm-phase8-game-active #tm-bright-theme-switcher:not(.tm-bright-theme-topbar),
html[data-theme="celadon-bright"] body.tm-phase8-game-active #tm-bright-theme-switcher:not(.tm-bright-theme-topbar) {
  top: 84px !important;
  right: 14px !important;
}

/* Brighten the map board while retaining the generated historical map art. */
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-board-bg,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-board-bg {
  filter: saturate(.86) brightness(1.16) !important;
  opacity: .94 !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal #mapwrap,
html[data-theme="celadon-bright"] body.tm-phase8-formal #mapwrap {
  background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(246,238,225,.38)), url("preview/img/ancient-tabletop-board.png?tmAsset=20260831-assets2") center/cover no-repeat, var(--tm-formal-bg) !important;
}
html[data-theme="celadon-bright"] body.tm-phase8-formal #mapwrap {
  background: linear-gradient(180deg, rgba(255,255,255,.30), rgba(224,241,234,.38)), url("preview/img/ancient-tabletop-board.png?tmAsset=20260831-assets2") center/cover no-repeat, var(--tm-formal-bg) !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal #mapwrap::before,
html[data-theme="celadon-bright"] body.tm-phase8-formal #mapwrap::before {
  background: radial-gradient(ellipse at 50% 48%, rgba(255,255,255,.18), transparent 64%), linear-gradient(180deg, rgba(255,255,255,.10), rgba(93,67,42,.05)) !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal #mapwrap::after,
html[data-theme="celadon-bright"] body.tm-phase8-formal #mapwrap::after {
  box-shadow: inset 0 0 88px rgba(255,255,255,.28), inset 0 0 0 1px rgba(130,103,70,.16), 0 18px 52px rgba(73,56,38,.22) !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-map-paper,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-map-paper {
  background: linear-gradient(180deg, rgba(255,250,238,.82), rgba(238,225,202,.72)), #f3e8d4 !important;
  box-shadow: inset 0 0 0 1px rgba(125,93,50,.20), inset 0 0 70px rgba(255,255,255,.34), 0 18px 42px rgba(76,58,38,.24) !important;
}
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-map-paper {
  background: linear-gradient(180deg, rgba(252,255,252,.88), rgba(218,236,226,.76)), #e4f0e9 !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal .map-bg,
html[data-theme="celadon-bright"] body.tm-phase8-formal .map-bg {
  opacity: .23 !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal .ming-map-wash,
html[data-theme="celadon-bright"] body.tm-phase8-formal .ming-map-wash {
  opacity: .72 !important;
  mix-blend-mode: screen !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal .ming-region,
html[data-theme="celadon-bright"] body.tm-phase8-formal .ming-region,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-region,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-region {
  mix-blend-mode: normal !important;
  stroke: #806e59 !important;
  stroke-opacity: .62 !important;
  filter: saturate(.82) brightness(1.10) !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal .ming-label text,
html[data-theme="celadon-bright"] body.tm-phase8-formal .ming-label text,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-faction-label text.sub,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-faction-label text.sub {
  fill: #3d403a !important;
  stroke: rgba(255,252,242,.82) !important;
  text-shadow: none !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-faction-label text.main,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-faction-label text.main {
  fill: #4d5b52 !important;
  stroke: rgba(255,252,242,.74) !important;
}

/* Map controls and the event board read as light paper cards. */
html[data-theme="paper-bright"] body.tm-phase8-formal .map-tools-toggle,
html[data-theme="celadon-bright"] body.tm-phase8-formal .map-tools-toggle,
html[data-theme="paper-bright"] body.tm-phase8-formal .map-tools-pop,
html[data-theme="celadon-bright"] body.tm-phase8-formal .map-tools-pop,
html[data-theme="paper-bright"] body.tm-phase8-formal .map-legend,
html[data-theme="celadon-bright"] body.tm-phase8-formal .map-legend,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-map-legend,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-map-legend,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-map-tools,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-map-tools,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-map-alerts,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-map-alerts,
html[data-theme="paper-bright"] body.tm-phase8-formal .map-scale-strip,
html[data-theme="celadon-bright"] body.tm-phase8-formal .map-scale-strip,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-event-feed,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-event-feed,
html[data-theme="paper-bright"] body.tm-phase8-formal #tm-phase8-event-notice,
html[data-theme="celadon-bright"] body.tm-phase8-formal #tm-phase8-event-notice {
  background: rgba(255,253,247,.90) !important;
  border-color: var(--tm-formal-border) !important;
  box-shadow: 0 10px 28px rgba(73,56,37,.17) !important;
  color: var(--tm-formal-ink) !important;
  text-shadow: none !important;
}
html[data-theme="celadon-bright"] body.tm-phase8-formal .map-tools-toggle,
html[data-theme="celadon-bright"] body.tm-phase8-formal .map-tools-pop,
html[data-theme="celadon-bright"] body.tm-phase8-formal .map-legend,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-map-legend,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-map-tools,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-map-alerts,
html[data-theme="celadon-bright"] body.tm-phase8-formal .map-scale-strip,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-event-feed,
html[data-theme="celadon-bright"] body.tm-phase8-formal #tm-phase8-event-notice {
  background: rgba(249,254,251,.93) !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal .map-layer,
html[data-theme="celadon-bright"] body.tm-phase8-formal .map-layer,
html[data-theme="paper-bright"] body.tm-phase8-formal .mnp-row button,
html[data-theme="celadon-bright"] body.tm-phase8-formal .mnp-row button,
html[data-theme="paper-bright"] body.tm-phase8-formal .map-alert,
html[data-theme="celadon-bright"] body.tm-phase8-formal .map-alert,
html[data-theme="paper-bright"] body.tm-phase8-formal .map-scale,
html[data-theme="celadon-bright"] body.tm-phase8-formal .map-scale,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-map-mode,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-map-mode,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-map-alerts button,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-map-alerts button {
  background: rgba(255,255,255,.76) !important;
  border-color: var(--tm-formal-border) !important;
  color: var(--tm-formal-primary-deep) !important;
  text-shadow: none !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal .map-layer.on,
html[data-theme="celadon-bright"] body.tm-phase8-formal .map-layer.on,
html[data-theme="paper-bright"] body.tm-phase8-formal .mnp-row button.on,
html[data-theme="celadon-bright"] body.tm-phase8-formal .mnp-row button.on,
html[data-theme="paper-bright"] body.tm-phase8-formal .map-scale.on,
html[data-theme="celadon-bright"] body.tm-phase8-formal .map-scale.on,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-map-mode.active,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-map-mode.active {
  background: rgba(141,91,55,.14) !important;
  border-color: var(--tm-formal-primary) !important;
  color: var(--tm-formal-primary-deep) !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal .map-search,
html[data-theme="celadon-bright"] body.tm-phase8-formal .map-search {
  background: #fff !important;
  border-color: var(--tm-formal-border) !important;
  color: var(--tm-formal-ink) !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal .tm-event-item,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tm-event-item,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-event-row,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-event-row {
  background: linear-gradient(100deg, rgba(255,255,255,.98), rgba(248,242,232,.88)) !important;
  border-color: var(--tm-formal-border-soft) !important;
  color: var(--tm-formal-ink) !important;
  box-shadow: 0 3px 10px rgba(73,56,37,.10) !important;
}
html[data-theme="celadon-bright"] body.tm-phase8-formal .tm-event-item,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-event-row {
  background: linear-gradient(100deg, rgba(255,255,255,.98), rgba(239,249,244,.90)) !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal .tm-event-item b,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tm-event-item b,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-event-main b,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-event-main b,
html[data-theme="paper-bright"] body.tm-phase8-formal .tm-event-board-title,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tm-event-board-title {
  color: var(--tm-formal-primary-deep) !important;
  text-shadow: none !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal .tm-event-item em,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tm-event-item em,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-event-main em,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-event-main em,
html[data-theme="paper-bright"] body.tm-phase8-formal .tm-event-type,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tm-event-type {
  color: var(--tm-formal-muted) !important;
}

/* Formal cards, drawers and dialogs.  These selectors cover the native
 * Phase8 modules as well as the older right-rail drawers opened from them. */
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-card,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-card,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmrp-card,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmrp-card,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmrp-summary,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmrp-summary,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmrp-person,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmrp-person,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmrp-log,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmrp-log,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmrp-office-node,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmrp-office-node,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmrp-office-pos,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmrp-office-pos,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmrp-fin-line,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmrp-fin-line,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmrp-ecology,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmrp-ecology,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmrp-ecology-edge,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmrp-ecology-edge,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmrp-mode-card,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmrp-mode-card,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmrp-chain-step,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmrp-chain-step,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmrp-pcdebug-row,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmrp-pcdebug-row {
  background: var(--tm-formal-surface-2) !important;
  border-color: var(--tm-formal-border-soft) !important;
  color: var(--tm-formal-ink) !important;
  box-shadow: 0 2px 8px rgba(72,57,40,.08) !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal .tmrp-summary,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmrp-summary {
  background: var(--tm-formal-surface) !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal .tmrp-stat,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmrp-stat,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmrp-avatar,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmrp-avatar,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmrp-pill,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmrp-pill,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmrp-wd-person,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmrp-wd-person {
  background: rgba(255,255,255,.72) !important;
  border-color: var(--tm-formal-border-soft) !important;
  color: var(--tm-formal-ink) !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal .tmrp-tabs button,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmrp-tabs button,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmrp-issue-tabs button,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmrp-issue-tabs button,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmrp-btn,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmrp-btn,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-action,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-action,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-person-actions button,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-person-actions button {
  background: rgba(255,255,255,.78) !important;
  border-color: var(--tm-formal-border) !important;
  color: var(--tm-formal-primary-deep) !important;
  text-shadow: none !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal .tmrp-tabs button.active,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmrp-tabs button.active,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmrp-issue-tabs button.active,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmrp-issue-tabs button.active,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmrp-btn.primary,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmrp-btn.primary,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-action.main,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-action.main {
  background: linear-gradient(135deg, var(--tm-formal-primary), var(--tm-formal-primary-deep)) !important;
  border-color: var(--tm-formal-primary) !important;
  color: #fffdf8 !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-module-note,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-module-note,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-prose,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-prose,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmrp-meta,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmrp-meta,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmrp-empty,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmrp-empty,
html[data-theme="paper-bright"] body.tm-phase8-formal [class*="tmrp-"] span,
html[data-theme="celadon-bright"] body.tm-phase8-formal [class*="tmrp-"] span,
html[data-theme="paper-bright"] body.tm-phase8-formal [class*="tmrp-"] small {
  color: var(--tm-formal-muted) !important;
  text-shadow: none !important;
}
html[data-theme="celadon-bright"] body.tm-phase8-formal [class*="tmrp-"] small {
  color: var(--tm-formal-muted) !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-module h2,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-module h2,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-module h3,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-module h3,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmrp-card-title span,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmrp-card-title span,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmrp-stat b,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmrp-stat b,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmrp-person b,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmrp-person b {
  color: var(--tm-formal-primary-deep) !important;
  text-shadow: none !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-module-overlay,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-module-overlay,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-records-overlay,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-records-overlay,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-event-detail,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-event-detail,
html[data-theme="paper-bright"] body.tm-phase8-formal .tm-bridge-scrim,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tm-bridge-scrim,
html[data-theme="paper-bright"] body.tm-phase8-formal .arc-scrim,
html[data-theme="celadon-bright"] body.tm-phase8-formal .arc-scrim {
  background: rgba(47,42,35,.28) !important;
  backdrop-filter: blur(4px) !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-module,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-module,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-records-dialog,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-records-dialog,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-event-dialog,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-event-dialog,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-map-dossier,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-map-dossier,
html[data-theme="paper-bright"] body.tm-phase8-formal .renwu-atlas,
html[data-theme="celadon-bright"] body.tm-phase8-formal .renwu-atlas,
html[data-theme="paper-bright"] body.tm-phase8-formal .tm-bridge-panel,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tm-bridge-panel,
html[data-theme="paper-bright"] body.tm-phase8-formal .arc-modal,
html[data-theme="celadon-bright"] body.tm-phase8-formal .arc-modal {
  background: linear-gradient(180deg, var(--tm-formal-surface), var(--tm-formal-surface-2)) !important;
  border-color: var(--tm-formal-border) !important;
  box-shadow: 0 22px 64px rgba(69,54,37,.22), inset 0 1px 0 rgba(255,255,255,.88) !important;
  color: var(--tm-formal-ink) !important;
  text-shadow: none !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-module > header,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-module > header,
html[data-theme="paper-bright"] body.tm-phase8-formal .renwu-atlas-head,
html[data-theme="celadon-bright"] body.tm-phase8-formal .renwu-atlas-head {
  background: linear-gradient(90deg, rgba(141,91,55,.12), rgba(61,129,116,.07), transparent) !important;
  border-bottom-color: var(--tm-formal-border-soft) !important;
}
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-module > header,
html[data-theme="celadon-bright"] body.tm-phase8-formal .renwu-atlas-head {
  background: linear-gradient(90deg, rgba(52,121,107,.13), rgba(87,153,137,.07), transparent) !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-module-body,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-module-body,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-module-left,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-module-left,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-module-right,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-module-right {
  background: var(--tm-formal-surface-2) !important;
  border-color: var(--tm-formal-border-soft) !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-module-main,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-module-main {
  background: var(--tm-formal-surface) !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-module input,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-module input,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmf-module textarea,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmf-module textarea,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmrp-input,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmrp-input,
html[data-theme="paper-bright"] body.tm-phase8-formal .tmrp-textarea,
html[data-theme="celadon-bright"] body.tm-phase8-formal .tmrp-textarea {
  background: #fff !important;
  border-color: var(--tm-formal-border) !important;
  color: var(--tm-formal-ink) !important;
}

/* Action plaques retain their artwork, but lose the heavy black wash that
 * made the bright themes look dark at the most common starting viewport. */
html[data-theme="paper-bright"] body.tm-phase8-formal #tm-phase8-action-tray .zb-img,
html[data-theme="celadon-bright"] body.tm-phase8-formal #tm-phase8-action-tray .zb-img {
  filter: saturate(.88) contrast(.98) brightness(1.15) !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal #tm-phase8-action-tray .zb-img-btn::before,
html[data-theme="celadon-bright"] body.tm-phase8-formal #tm-phase8-action-tray .zb-img-btn::before {
  opacity: .42 !important;
  background: linear-gradient(90deg, rgba(255,248,232,.06), rgba(255,248,232,.02)) !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal #tm-phase8-action-tray .zb-img-btn::after,
html[data-theme="celadon-bright"] body.tm-phase8-formal #tm-phase8-action-tray .zb-img-btn::after {
  box-shadow: inset 0 0 0 1px rgba(128,96,58,.24), inset 0 0 16px rgba(255,255,255,.12) !important;
}
html[data-theme="paper-bright"] body.tm-phase8-formal #tm-phase8-action-tray .zb-action-title,
html[data-theme="celadon-bright"] body.tm-phase8-formal #tm-phase8-action-tray .zb-action-title,
html[data-theme="paper-bright"] body.tm-phase8-formal #tm-phase8-action-tray .zb-action-sub,
html[data-theme="celadon-bright"] body.tm-phase8-formal #tm-phase8-action-tray .zb-action-sub,
html[data-theme="paper-bright"] body.tm-phase8-formal #tm-phase8-action-tray .zb-action-kicker,
html[data-theme="celadon-bright"] body.tm-phase8-formal #tm-phase8-action-tray .zb-action-kicker {
  color: var(--tm-formal-primary-deep) !important;
  text-shadow: 0 1px 0 rgba(255,255,255,.86) !important;
}

@media (max-width: 1080px) {
  html[data-theme="paper-bright"] body.tm-phase8-game-active #tm-bright-theme-switcher:not(.tm-bright-theme-topbar),
  html[data-theme="celadon-bright"] body.tm-phase8-game-active #tm-bright-theme-switcher:not(.tm-bright-theme-topbar) {
    top: 80px !important;
    right: 10px !important;
  }
}
@media (max-width: 600px) {
  html[data-theme="paper-bright"] body.tm-phase8-game-active #tm-bright-theme-switcher:not(.tm-bright-theme-topbar),
  html[data-theme="celadon-bright"] body.tm-phase8-game-active #tm-bright-theme-switcher:not(.tm-bright-theme-topbar) {
    top: 78px !important;
    right: 8px !important;
  }
}
