/* ==========================================================
   末栏 · ARG 三部曲 — DouBao / Tailwind flat UI skin
   Loaded after style.css. Overrides the classic cinematic skin.
   ========================================================== */

body.db-ui {
  --db-blue: #1e5b9d;
  --db-blue-dark: #194a82;
  --db-blue-soft: #eef4fb;
  --db-bg: #f0f2f5;
  --db-card: #ffffff;
  --db-border: #e5e7eb;
  --db-border-strong: #d1d5db;
  --db-text: #111827;
  --db-text-2: #374151;
  --db-muted: #6b7280;
  --db-muted-2: #9ca3af;
  --db-soft: #f9fafb;
  --db-red: #b91c1c;
  --db-red-soft: #fef2f2;
  --db-amber: #b45309;
  --db-amber-soft: #fffbeb;
  --db-green: #047857;
  --db-green-soft: #ecfdf5;
  --db-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  --db-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --db-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  --db-shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.12);
  --serif: var(--db-sans);
  --sans: var(--db-sans);
  --kai: var(--db-sans);
  --mono: var(--db-mono);
  background: var(--db-bg);
  color: var(--db-text);
  font-family: var(--db-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.db-ui *,
body.db-ui *::before,
body.db-ui *::after {
  box-sizing: border-box;
}

body.db-ui #grain {
  display: none !important;
}

body.db-ui h1,
body.db-ui h2,
body.db-ui h3,
body.db-ui h4,
body.db-ui .serif,
body.db-ui .opening-title,
body.db-ui .ending-card h1,
body.db-ui .scroll-sheet h1,
body.db-ui .modal__title {
  font-family: var(--db-sans) !important;
  letter-spacing: 0 !important;
  text-indent: 0 !important;
}

body.db-ui .db-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  vertical-align: -0.125em;
}

body.db-ui .db-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 16px;
  border: 1px solid var(--db-border-strong);
  border-radius: 2px;
  background: #fff;
  color: var(--db-text-2);
  font-family: var(--db-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.2;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  cursor: pointer;
}

body.db-ui .db-btn:hover {
  border-color: #9ca3af;
  background: #f9fafb;
  color: var(--db-text);
}

body.db-ui .db-btn--primary {
  border-color: var(--db-blue);
  background: var(--db-blue);
  color: #fff;
}

body.db-ui .db-btn--primary:hover {
  border-color: var(--db-blue-dark);
  background: var(--db-blue-dark);
  color: #fff;
}

body.db-ui .db-btn--red {
  border-color: var(--db-red);
  background: var(--db-red);
  color: #fff;
}

body.db-ui .db-btn--green {
  border-color: var(--db-green);
  background: var(--db-green);
  color: #fff;
}

body.db-ui .db-btn--ghost {
  border-color: var(--db-border);
  background: #fff;
  color: var(--db-text-2);
}

body.db-ui .db-btn--sm {
  min-height: 32px;
  padding: 5px 11px;
  font-size: 12px;
}

body.db-ui .db-btn--block {
  width: 100%;
}

body.db-ui .db-text-link {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--db-blue);
  font-family: var(--db-sans);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

body.db-ui .db-text-link:hover {
  color: var(--db-blue-dark);
  text-decoration: underline;
}

body.db-ui .db-input,
body.db-ui .db-select {
  width: 100%;
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid var(--db-border-strong);
  border-radius: 0;
  background: #fff;
  color: var(--db-text);
  font-family: var(--db-sans);
  font-size: 14px;
  line-height: 1.4;
  transition: border-color 0.15s, box-shadow 0.15s;
}

body.db-ui .db-input::placeholder {
  color: var(--db-muted-2);
}

body.db-ui .db-input:focus {
  border-color: var(--db-blue);
  outline: 0;
  box-shadow: 0 0 0 2px rgba(30, 91, 157, 0.12);
}

body.db-ui .db-label {
  display: block;
  margin-bottom: 6px;
  color: var(--db-text-2);
  font-size: 13px;
  font-weight: 400;
}

body.db-ui .db-form-error {
  min-height: 18px;
  margin: 6px 0;
  color: var(--db-red);
  font-size: 12px;
}

body.db-ui .db-form-error.is-shaking {
  animation: dbShake 0.35s ease;
}

@keyframes dbShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

body.db-ui .db-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border: 1px solid #e5e7eb;
  border-radius: 2px;
  background: #f9fafb;
  color: var(--db-muted);
  font-family: var(--db-sans);
  font-size: 10px;
  line-height: 1.6;
  white-space: nowrap;
}

body.db-ui .db-tag--red {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

body.db-ui .db-tag--green {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

body.db-ui .db-tag--amber {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
}

body.db-ui .db-badge {
  padding: 2px 6px;
  border-radius: 2px;
  font-size: 10px;
  line-height: 1.5;
}

body.db-ui .db-badge--amber {
  background: #fef3c7;
  color: #92400e;
}

body.db-ui .db-code {
  color: var(--db-muted);
  font-family: var(--db-mono);
  font-size: 11px;
}

body.db-ui .db-muted {
  color: var(--db-muted);
  font-size: 12px;
}

body.db-ui .db-icon-box {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 2px;
  background: var(--db-blue-soft);
  color: var(--db-blue);
}

/* ---------- fixed chrome ---------- */
body.db-ui .audio-toggle {
  left: 24px;
  bottom: 24px;
  width: 40px;
  height: 40px;
  border: 1px solid #e5e7eb;
  background: rgba(255, 255, 255, 0.94);
  color: #6b7280;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
  backdrop-filter: blur(6px);
}

body.db-ui .audio-toggle:hover {
  border-color: #d1d5db;
  background: #fff;
  color: #1f2937;
}

body.db-ui .audio-toggle::after {
  display: none;
}

body.db-ui .clue-dock {
  right: 24px;
  bottom: 24px;
  font-family: var(--db-sans);
}

body.db-ui .clue-dock__tab {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #4b5563;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  backdrop-filter: none;
}

body.db-ui .clue-dock__tab:hover {
  border-color: #d1d5db;
  color: #111827;
}

body.db-ui .clue-dock__tab .dot {
  width: 6px;
  height: 6px;
  background: #ef4444;
  box-shadow: none;
}

body.db-ui .clue-panel {
  right: 0;
  bottom: 48px;
  width: 320px;
  height: 360px;
  max-height: min(72vh, 360px);
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.16);
}

body.db-ui .clue-dock.is-open .clue-dock__tab {
  display: none;
}

body.db-ui .clue-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid #f3f4f6;
  background: #fafafa;
  color: #111827;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}

body.db-ui .db-clue-title {
  display: flex;
  align-items: center;
  gap: 7px;
}

body.db-ui .db-clue-title svg {
  width: 15px;
  height: 15px;
  color: #6b7280;
}

body.db-ui .db-clue-num {
  color: #9ca3af;
  font-size: 11px;
  font-weight: 400;
}

body.db-ui .db-clue-collapse {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  color: #9ca3af;
  font-size: 16px;
  line-height: 1;
}

body.db-ui .clue-panel__body {
  height: calc(100% - 46px);
  max-height: calc(72vh - 46px);
  overflow-y: auto;
  padding: 8px;
  background: #fff;
}

body.db-ui .clue-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 7px;
  margin-bottom: 6px;
  padding: 8px 10px;
  border: 1px solid #f3f4f6;
  border-radius: 4px;
  background: #fafafa;
}

body.db-ui .clue-item__icon {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 2px;
  color: #d1d5db;
}

body.db-ui .clue-item__icon svg {
  width: 14px;
  height: 14px;
}

body.db-ui .clue-item:not(.is-locked) .clue-item__icon {
  color: #10b981;
}

body.db-ui .clue-item__content {
  min-width: 0;
}

body.db-ui .clue-item:last-child {
  margin-bottom: 0;
}

body.db-ui .clue-item__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 16px;
}

body.db-ui .clue-item__name {
  color: #374151;
  font-size: 12px;
  font-weight: 500;
}

body.db-ui .clue-item__answer {
  margin: 4px 0 0;
  color: #b91c1c;
  font-family: var(--db-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}

body.db-ui .clue-item__hint {
  margin: 3px 0 0;
  color: #9ca3af;
  font-size: 10px;
  line-height: 1.5;
}

body.db-ui .clue-item__lock {
  color: #9ca3af;
  font-family: var(--db-sans);
  font-size: 9px;
}

body.db-ui .clue-item.is-locked .clue-item__name,
body.db-ui .clue-item.is-locked .clue-item__answer {
  color: #9ca3af;
  letter-spacing: 0;
}

body.db-ui .clue-item.is-locked .clue-item__hint {
  color: #b6bcc5;
}

body.db-ui #toast {
  bottom: 82px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  background: rgba(17, 24, 39, 0.94);
  color: #f9fafb;
  font-size: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
}

body.db-ui #toast.is-error {
  border-color: #fecaca;
  color: #fecaca;
}

/* ---------- modal ---------- */
body.db-ui .modal-backdrop {
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
}

body.db-ui .modal {
  width: min(480px, 100%);
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

body.db-ui .modal--wide {
  width: min(680px, 100%);
}

body.db-ui .modal__head {
  padding: 20px 22px 0;
}

body.db-ui .modal__kicker {
  margin-bottom: 5px;
  color: #9ca3af;
  font-family: var(--db-sans);
  font-size: 9px;
  letter-spacing: 0.12em;
}

body.db-ui .modal__title {
  color: #111827;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.45;
}

body.db-ui .modal__close {
  width: 30px;
  height: 30px;
  border-color: #e5e7eb;
  color: #9ca3af;
  font-size: 15px;
}

body.db-ui .modal__close:hover {
  border-color: #d1d5db;
  color: #111827;
}

body.db-ui .modal__body {
  padding: 14px 22px 20px;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.8;
}

body.db-ui .modal__body p {
  margin: 0 0 10px;
}

body.db-ui .modal__body strong {
  color: #111827;
}

body.db-ui .modal__actions {
  padding: 0 22px 20px;
}

body.db-ui .modal--red {
  border-color: #7f1d1d;
  background: #180606;
  color: #fee2e2;
}

body.db-ui .modal--red .modal__title,
body.db-ui .modal--red .modal__body,
body.db-ui .modal--red .modal__body strong {
  color: #fee2e2;
}

body.db-ui .modal--red .modal__kicker {
  color: #f87171;
}

body.db-ui .modal--red .modal__close {
  border-color: rgba(255, 255, 255, 0.14);
  color: #d4a6a6;
}

body.db-ui .modal--blue {
  border-color: #bfdbfe;
  background: #f8fbff;
}

body.db-ui .modal--blue .modal__title,
body.db-ui .modal--blue .modal__body,
body.db-ui .modal--blue .modal__body strong {
  color: #0c4a6e;
}

body.db-ui .modal--blue .modal__kicker {
  color: #0284c7;
}

body.db-ui .modal--steel {
  border-color: #d1d5db;
  background: #f8fafc;
}

body.db-ui .modal--steel .modal__title,
body.db-ui .modal--steel .modal__body,
body.db-ui .modal--steel .modal__body strong {
  color: #1f2937;
}

body.db-ui .modal--paper {
  border-color: #e7e5e4;
  background: #fffdf7;
  color: #44403c;
}

body.db-ui .modal--paper .modal__title {
  color: #292524;
}

body.db-ui .modal--success {
  border-color: #e5e7eb;
  background: #fff;
}

body.db-ui .modal--success .modal__body .answer,
body.db-ui .modal--success .puzzle-success {
  display: block;
}

/* ---------- opening ---------- */
body.db-ui .screen--opening {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background: #000;
  color: #fff;
  text-align: center;
  cursor: pointer;
}

body.db-ui .screen--opening::before,
body.db-ui .screen--opening::after {
  display: none;
}

body.db-ui .db-opening {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

body.db-ui .db-opening__hit {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
}

body.db-ui .db-opening__inner {
  position: relative;
  z-index: 2;
  width: min(520px, calc(100% - 40px));
  padding-bottom: 3vh;
  pointer-events: none;
}

body.db-ui .db-opening__glow {
  width: 64px;
  height: 64px;
  margin: 0 auto 112px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(220, 38, 38, 0.68) 0, rgba(185, 28, 28, 0.3) 38%, transparent 72%);
  filter: blur(13px);
  animation: dbGlow 4.5s ease-in-out infinite;
}

@keyframes dbGlow {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.12); opacity: 1; }
}

body.db-ui .db-opening__fiction {
  margin: 0;
  color: #e5e7eb;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

body.db-ui .db-opening__hint {
  margin: 56px 0 0;
  color: #6b7280;
  font-size: 12px;
  animation: dbHintPulse 2.6s ease-in-out infinite;
}

@keyframes dbHintPulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.9; }
}

body.db-ui .db-opening__title {
  margin: 48px 0 0;
  color: #fff;
  font-size: 46px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.08em;
}

body.db-ui .db-opening__sub {
  margin: 8px 0 0;
  color: #6b7280;
  font-size: 13px;
  letter-spacing: 0.28em;
}

body.db-ui .db-opening__version {
  position: absolute;
  right: 24px;
  bottom: 22px;
  margin: 0;
  color: #374151;
  font-family: var(--db-mono);
  font-size: 8px;
  letter-spacing: 0.12em;
}

/* ---------- OAS header ---------- */
body.db-ui .db-page {
  min-height: 100vh;
  background: var(--db-bg);
  color: var(--db-text);
  font-family: var(--db-sans);
}

body.db-ui .db-oas-header {
  background: var(--db-blue);
  color: #fff;
  font-family: var(--db-sans);
}

body.db-ui .db-oas-top__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1120px, calc(100% - 40px));
  min-height: 64px;
  margin: 0 auto;
}

body.db-ui .db-oas-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

body.db-ui .db-oas-logo {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-family: var(--db-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

body.db-ui .db-oas-brand__title {
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.35;
  white-space: nowrap;
}

body.db-ui .db-oas-brand__sub {
  color: #bfdbfe;
  font-size: 11px;
  line-height: 1.4;
}

body.db-ui .db-version {
  color: #bfdbfe;
  font-size: 11px;
  white-space: nowrap;
}

body.db-ui .db-oas-nav {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--db-blue);
}

body.db-ui .db-oas-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(1120px, calc(100% - 40px));
  min-height: 46px;
  margin: 0 auto;
}

body.db-ui .db-oas-nav__links {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

body.db-ui .db-oas-nav__links::-webkit-scrollbar {
  display: none;
}

body.db-ui .db-oas-nav__item {
  appearance: none;
  flex: 0 0 auto;
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #dbeafe;
  font-family: var(--db-sans);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

body.db-ui .db-oas-nav__item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

body.db-ui .db-oas-nav__item.is-active {
  border-bottom-color: #fff;
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

body.db-ui .db-oas-nav__user {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #dbeafe;
  font-size: 11px;
  white-space: nowrap;
}

body.db-ui .db-nav-exit {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 30px;
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: transparent;
  color: #dbeafe;
  font-size: 10px;
  cursor: pointer;
}

body.db-ui .db-nav-exit:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
}

body.db-ui .db-nav-exit svg {
  width: 12px;
  height: 12px;
}

body.db-ui .db-container {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 16px 0 60px;
}

body.db-ui .db-breadcrumb {
  margin-bottom: 10px;
  color: var(--db-muted);
  font-size: 11px;
}

body.db-ui .db-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 14px;
  padding: 18px 20px;
  border: 1px solid var(--db-border);
  background: #fff;
}

body.db-ui .db-page-head--flat {
  margin-bottom: 14px;
  padding: 0;
  border: 0;
  background: transparent;
}

body.db-ui .db-page-head h1 {
  margin: 0 0 3px;
  color: var(--db-text);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
}

body.db-ui .db-page-head p {
  margin: 0;
  color: var(--db-muted);
  font-size: 12px;
}

body.db-ui .db-date {
  color: var(--db-muted);
  font-size: 11px;
  white-space: nowrap;
}

body.db-ui .db-stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

body.db-ui .db-stat {
  padding: 14px 10px 16px;
  border: 1px solid var(--db-border);
  background: #fff;
  text-align: center;
}

body.db-ui .db-stat__icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin: 0 auto 8px;
  color: #60a5fa;
}

body.db-ui .db-stat__icon svg {
  width: 19px;
  height: 19px;
}

body.db-ui .db-stat__label {
  color: var(--db-muted);
  font-size: 11px;
  line-height: 1.4;
}

body.db-ui .db-stat__value {
  margin-top: 5px;
  color: var(--db-text);
  font-family: var(--db-sans);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
}

body.db-ui .db-stat.is-danger .db-stat__value {
  color: var(--db-red);
}

body.db-ui .db-stat.is-danger .db-stat__icon {
  color: #f87171;
}

body.db-ui .db-panel {
  margin-bottom: 14px;
  border: 1px solid var(--db-border);
  background: #fff;
}

body.db-ui .db-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 46px;
  padding: 10px 16px;
  border-bottom: 1px solid #f3f4f6;
  color: var(--db-text-2);
  font-size: 12px;
}

body.db-ui .db-panel-head > div:first-child {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

body.db-ui .db-panel-head svg {
  width: 15px;
  height: 15px;
  color: #6b7280;
}

body.db-ui .db-panel-head strong {
  color: var(--db-text);
  font-size: 13px;
  font-weight: 600;
}

body.db-ui .db-panel-head--danger {
  border-bottom-color: #fee2e2;
  background: #fffafa;
}

body.db-ui .db-panel-head--danger svg {
  color: #ef4444;
}

body.db-ui .db-panel-head--amber {
  border-bottom-color: #fef3c7;
  background: #fffdf5;
}

body.db-ui .db-panel-head--amber svg {
  color: #d97706;
}

body.db-ui .db-panel-body {
  padding: 16px;
}

body.db-ui .db-panel-foot {
  padding: 10px 16px;
  border-top: 1px solid #f3f4f6;
  color: var(--db-muted);
  font-size: 11px;
}

body.db-ui .db-panel-foot strong {
  color: #b45309;
  font-weight: 600;
}

body.db-ui .db-archive-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 15px 16px;
  border-bottom: 1px solid #f3f4f6;
}

body.db-ui .db-archive-row:last-child {
  border-bottom: 0;
}

body.db-ui .db-archive-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 2px;
  background: #fef2f2;
  color: #ef4444;
}

body.db-ui .db-archive-icon.is-solved {
  background: var(--db-green-soft);
  color: var(--db-green);
}

body.db-ui .db-archive-icon svg {
  width: 17px;
  height: 17px;
}

body.db-ui .db-archive-titleline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

body.db-ui .db-archive-titleline strong {
  color: var(--db-text);
  font-size: 14px;
  font-weight: 600;
}

body.db-ui .db-archive-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 3px;
  color: var(--db-muted);
  font-size: 11px;
}

body.db-ui .db-archive-meta i {
  width: 1px;
  height: 10px;
  background: #d1d5db;
}

body.db-ui .db-archive-main p {
  margin: 6px 0 0;
  color: #4b5563;
  font-size: 12px;
  line-height: 1.75;
}

body.db-ui .db-row-link {
  appearance: none;
  align-self: center;
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: var(--db-blue);
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}

body.db-ui .db-row-link:hover {
  text-decoration: underline;
}

body.db-ui .db-alert-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
}

body.db-ui .db-alert-row:last-of-type {
  border-bottom: 0;
}

body.db-ui .db-alert-row__icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: #fffbeb;
  color: #d97706;
}

body.db-ui .db-alert-row__icon svg {
  width: 16px;
  height: 16px;
}

body.db-ui .db-alert-row strong {
  display: block;
  color: #374151;
  font-size: 12px;
  font-weight: 600;
}

body.db-ui .db-alert-row p {
  margin: 3px 0;
  color: #6b7280;
  font-size: 11px;
  line-height: 1.65;
}

body.db-ui .db-alert-row span {
  color: #9ca3af;
  font-size: 10px;
}

body.db-ui .db-table-wrap {
  overflow-x: auto;
}

body.db-ui .db-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

body.db-ui .db-table th {
  padding: 10px 16px;
  border-bottom: 1px solid #f3f4f6;
  background: #fafafa;
  color: #6b7280;
  font-size: 11px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

body.db-ui .db-table td {
  padding: 11px 16px;
  border-bottom: 1px solid #f9fafb;
  color: #4b5563;
  white-space: nowrap;
}

body.db-ui .db-table tr:last-child td {
  border-bottom: 0;
}

body.db-ui .db-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: #9ca3af;
}

body.db-ui .db-dot.is-green { background: #10b981; }
body.db-ui .db-dot.is-amber { background: #f59e0b; }

body.db-ui .db-entry-panel .db-entry-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 16px;
}

body.db-ui .db-entry {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--db-border);
  background: #fafafa;
  color: #374151;
  font-size: 12px;
  cursor: pointer;
}

body.db-ui .db-entry:hover {
  border-color: #c7d2fe;
  background: #f8faff;
}

body.db-ui .db-entry svg {
  width: 15px;
  height: 15px;
  color: var(--db-blue);
}

body.db-ui .db-entry em {
  color: #9ca3af;
  font-size: 10px;
  font-style: normal;
}

body.db-ui .db-oas-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
  color: #9ca3af;
  font-family: var(--db-sans);
  font-size: 10px;
}

/* ---------- OAS login ---------- */
body.db-ui .db-login {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--db-bg);
  color: var(--db-text);
}

body.db-ui .db-login .db-oas-top {
  background: var(--db-blue);
  color: #fff;
}

body.db-ui .db-login-main {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 24px 20px 60px;
  overflow: hidden;
}

body.db-ui .db-login-main::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../assets/hospital.jpg") center / cover no-repeat;
  opacity: 0.06;
  filter: grayscale(0.65) blur(1px);
  pointer-events: none;
}

body.db-ui .db-login-main::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.35), rgba(240, 242, 245, 0.92));
  pointer-events: none;
}

body.db-ui .db-login-card {
  position: relative;
  z-index: 1;
  width: min(380px, 100%);
  border: 1px solid #e5e7eb;
  background: #fff;
}

body.db-ui .db-login-tabs {
  display: flex;
  border-bottom: 1px solid #e5e7eb;
}

body.db-ui .db-login-tab {
  appearance: none;
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 42px;
  padding: 8px 5px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: #f5f7fa;
  color: #6b7280;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

body.db-ui .db-login-tab:hover {
  color: #374151;
}

body.db-ui .db-login-tab.is-active {
  border-bottom-color: var(--db-blue);
  background: #fff;
  color: var(--db-blue);
}

body.db-ui .db-login-tab.is-locked {
  color: #9ca3af;
}

body.db-ui .db-tab-lock {
  padding: 0 3px;
  border: 1px solid #e5e7eb;
  border-radius: 2px;
  color: #9ca3af;
  font-size: 8px;
  line-height: 1.5;
}

body.db-ui .db-login-form {
  padding: 20px 22px 4px;
}

body.db-ui .db-field-group {
  margin-bottom: 14px;
}

body.db-ui .db-field-group label {
  display: block;
  margin-bottom: 6px;
  color: #374151;
  font-size: 13px;
}

body.db-ui .db-input-wrap {
  position: relative;
}

body.db-ui .db-input-wrap > svg {
  position: absolute;
  top: 50%;
  left: 10px;
  width: 15px;
  height: 15px;
  color: #9ca3af;
  transform: translateY(-50%);
  pointer-events: none;
}

body.db-ui .db-input-wrap .db-input {
  height: 38px;
  padding-left: 32px;
}

body.db-ui .db-login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 0 8px;
}

body.db-ui .db-check {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #6b7280;
  font-size: 11px;
}

body.db-ui .db-check input {
  width: 13px;
  height: 13px;
  accent-color: var(--db-blue);
}

body.db-ui .db-login-row .db-text-link {
  font-size: 11px;
}

body.db-ui .db-login-form .db-btn {
  height: 38px;
  margin: 2px 0 18px;
  background: var(--db-blue);
  border-color: var(--db-blue);
  color: #fff;
  font-size: 14px;
  letter-spacing: 0.08em;
}

body.db-ui .db-login-form .db-btn:hover {
  background: var(--db-blue-dark);
  border-color: var(--db-blue-dark);
}

body.db-ui .db-demo-hint {
  margin: 0 22px 16px;
  padding: 8px 10px;
  border: 1px dashed #dbe3ec;
  background: #f8fafc;
  color: #7b8a9a;
  font-size: 10px;
  line-height: 1.7;
}

body.db-ui .db-login-foot {
  margin-top: 16px;
  width: min(380px, 100%);
  padding: 0;
  border-top: 0;
  color: #9ca3af;
  font-size: 10px;
  line-height: 1.7;
  text-align: center;
}

/* ---------- archive page ---------- */
body.db-ui .db-profile-card {
  margin-bottom: 14px;
  border: 1px solid var(--db-border);
  background: #fff;
}

body.db-ui .db-profile-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #f3f4f6;
}

body.db-ui .db-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #eff6ff;
  color: var(--db-blue);
  font-size: 15px;
  font-weight: 600;
}

body.db-ui .db-avatar--lg {
  width: 46px;
  height: 46px;
  font-size: 18px;
}

body.db-ui .db-profile-name {
  min-width: 0;
}

body.db-ui .db-profile-name h2 {
  margin: 0 0 2px;
  color: var(--db-text);
  font-size: 17px;
  font-weight: 600;
}

body.db-ui .db-profile-name h2 span {
  color: var(--db-muted);
  font-size: 11px;
  font-weight: 400;
}

body.db-ui .db-profile-name p {
  margin: 0;
  color: var(--db-muted);
  font-size: 11px;
}

body.db-ui .db-profile-top > .db-tag {
  margin-left: auto;
}

body.db-ui .db-profile-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 14px 20px 17px;
}

body.db-ui .db-profile-grid span {
  display: block;
  color: #9ca3af;
  font-size: 10px;
}

body.db-ui .db-profile-grid strong {
  display: block;
  margin-top: 3px;
  color: #374151;
  font-size: 12px;
  font-weight: 500;
}

body.db-ui .db-archive-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 14px;
  align-items: start;
}

body.db-ui .db-stack {
  min-width: 0;
}

body.db-ui .db-record-list {
  display: grid;
  gap: 0;
}

body.db-ui .db-record {
  padding: 14px 16px;
  border-bottom: 1px solid #f3f4f6;
}

body.db-ui .db-record:last-child {
  border-bottom: 0;
}

body.db-ui .db-record__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: #9ca3af;
  font-size: 10px;
}

body.db-ui .db-record__type {
  color: var(--db-blue);
  font-weight: 500;
}

body.db-ui .db-record p {
  margin: 6px 0 0;
  color: #4b5563;
  font-size: 12px;
  line-height: 1.8;
}

body.db-ui .db-summary {
  margin: 0;
  color: #4b5563;
  font-size: 12px;
  line-height: 1.9;
}

body.db-ui .db-callout {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #92400e;
  font-size: 11px;
  line-height: 1.75;
}

body.db-ui .db-callout svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  margin-top: 2px;
}

body.db-ui .db-callout--blue {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1e40af;
}

body.db-ui .db-puzzle-card .db-panel-body {
  padding: 16px;
}

body.db-ui .db-cipher {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

body.db-ui .db-cipher span {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 38px;
  padding: 0 6px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  font-family: var(--db-mono);
  font-size: 14px;
  letter-spacing: 0.06em;
}

body.db-ui .db-hint {
  margin: 0 0 12px;
  padding: 8px 10px;
  border-left: 2px solid #f59e0b;
  background: #fffbeb;
  color: #92400e;
  font-size: 10px;
  line-height: 1.7;
}

body.db-ui .db-puzzle-card .db-form-error {
  margin: 4px 0;
}

body.db-ui .db-puzzle-card .db-btn {
  margin-top: 6px;
}

body.db-ui .db-tip {
  margin: 10px 0 0;
  color: #9ca3af;
  font-size: 10px;
  line-height: 1.7;
}

body.db-ui .db-success-box {
  padding: 14px;
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
}

body.db-ui .db-success-answer {
  display: block;
  margin-bottom: 4px;
  color: #15803d;
  font-family: var(--db-mono);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

body.db-ui .db-success-box strong {
  color: #166534;
  font-size: 12px;
}

body.db-ui .db-success-box p {
  margin: 5px 0 10px;
  color: #4d7c5f;
  font-size: 10px;
  line-height: 1.8;
}

body.db-ui .db-kv-list {
  padding: 6px 16px 12px;
}

body.db-ui .db-kv-list > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid #f9fafb;
  color: #6b7280;
  font-size: 11px;
}

body.db-ui .db-kv-list > div:last-child {
  border-bottom: 0;
}

body.db-ui .db-kv-list strong {
  color: #374151;
  font-weight: 500;
}

body.db-ui .db-bottom-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid #dbeafe;
  background: #f8fbff;
}

body.db-ui .db-bottom-cta strong {
  display: block;
  color: #1e40af;
  font-size: 12px;
  font-weight: 600;
}

body.db-ui .db-bottom-cta p {
  margin: 3px 0 0;
  color: #6b7280;
  font-size: 11px;
}

/* ---------- responsive base for new pages ---------- */
@media (max-width: 1100px) {
  body.db-ui .db-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  body.db-ui .db-archive-layout {
    grid-template-columns: 1fr;
  }
  body.db-ui .db-profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.db-ui .db-oas-nav__user > span {
    display: none;
  }
  body.db-ui .db-oas-brand__title {
    font-size: 14px;
  }
}

@media (max-width: 680px) {
  body.db-ui .db-oas-top__inner,
  body.db-ui .db-oas-nav__inner,
  body.db-ui .db-container {
    width: calc(100% - 28px);
  }
  body.db-ui .db-oas-top__inner {
    min-height: 58px;
    gap: 8px;
  }
  body.db-ui .db-oas-brand__title {
    font-size: 12px;
    white-space: normal;
    line-height: 1.35;
  }
  body.db-ui .db-oas-brand__sub,
  body.db-ui .db-version {
    display: none;
  }
  body.db-ui .db-oas-logo {
    width: 28px;
    height: 28px;
    font-size: 9px;
  }
  body.db-ui .db-oas-nav__inner {
    min-height: 42px;
  }
  body.db-ui .db-oas-nav__item {
    min-height: 42px;
    padding: 0 13px;
    font-size: 12px;
  }
  body.db-ui .db-oas-nav__user {
    display: none;
  }
  body.db-ui .db-page-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
    padding: 14px;
  }
  body.db-ui .db-page-head h1 {
    font-size: 16px;
  }
  body.db-ui .db-stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  body.db-ui .db-stat {
    padding: 11px 7px 12px;
  }
  body.db-ui .db-stat__value {
    font-size: 21px;
  }
  body.db-ui .db-archive-row {
    grid-template-columns: 32px minmax(0, 1fr);
    padding: 12px;
  }
  body.db-ui .db-archive-icon {
    width: 30px;
    height: 30px;
  }
  body.db-ui .db-row-link {
    grid-column: 2;
    justify-self: start;
    padding-top: 2px;
    font-size: 11px;
  }
  body.db-ui .db-alert-row {
    grid-template-columns: 30px minmax(0, 1fr);
    padding: 11px 12px;
  }
  body.db-ui .db-alert-row > .db-tag {
    grid-column: 2;
    justify-self: start;
  }
  body.db-ui .db-table th,
  body.db-ui .db-table td {
    padding: 9px 12px;
  }
  body.db-ui .db-entry-links {
    flex-direction: column;
    padding: 12px;
  }
  body.db-ui .db-entry {
    width: 100%;
    justify-content: flex-start;
  }
  body.db-ui .db-profile-top {
    padding: 14px;
  }
  body.db-ui .db-profile-grid {
    padding: 12px 14px 14px;
  }
  body.db-ui .db-bottom-cta {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 13px;
  }
  body.db-ui .db-bottom-cta .db-btn {
    width: 100%;
  }
  body.db-ui .db-login-main {
    padding: 20px 14px 50px;
    align-items: flex-start;
  }
  body.db-ui .db-login-card {
    margin-top: 14px;
  }
  body.db-ui .db-login-form {
    padding: 16px 16px 2px;
  }
  body.db-ui .db-login-foot {
  margin-top: 16px;
    padding: 10px 16px 16px;
  }
  body.db-ui .db-opening__glow {
    margin-bottom: 88px;
  }
  body.db-ui .db-opening__fiction {
    font-size: 15px;
  }
  body.db-ui .db-opening__hint {
    margin-top: 48px;
  }
  body.db-ui .db-opening__title {
    margin-top: 38px;
    font-size: 40px;
  }
  body.db-ui .clue-dock {
    right: 12px;
    bottom: 12px;
  }
  body.db-ui .clue-panel {
    width: calc(100vw - 24px);
    bottom: 48px;
    max-height: 62vh;
  }
  body.db-ui .clue-panel__body {
    max-height: calc(62vh - 46px);
  }
  body.db-ui .audio-toggle {
    left: 12px;
    bottom: 12px;
    width: 38px;
    height: 38px;
  }
  body.db-ui .db-oas-footer {
    font-size: 9px;
  }
}


/* ==========================================================
   Remaining scenes — flat editorial / official-site skin
   ========================================================== */

body.db-ui {
  color-scheme: light;
}

/* ---------- institute ---------- */
body.db-ui .screen--institute {
  background: #f8fafc;
  color: #111827;
  font-family: var(--db-sans);
}

body.db-ui .inst-header {
  background: #fff;
  color: #111827;
  border-bottom: 1px solid #e5e7eb;
}

body.db-ui .inst-header__top {
  width: min(1120px, calc(100% - 40px));
  min-height: 70px;
}

body.db-ui .inst-brand .mark {
  border: 1px solid #a7f3d0;
  background: #ecfdf5;
  color: #047857;
  font-size: 17px;
}

body.db-ui .inst-brand .name {
  color: #111827;
  font-family: var(--db-sans);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0;
}

body.db-ui .inst-brand .en {
  color: #9ca3af;
  font-size: 8px;
}

body.db-ui .inst-header__meta {
  color: #9ca3af;
  font-size: 8px;
}

body.db-ui .inst-header__meta-wrap {
  gap: 16px;
}

body.db-ui .inst-back {
  border-color: #e5e7eb;
  color: #6b7280;
  font-size: 10px;
}

body.db-ui .inst-back:hover {
  border-color: #d1d5db;
  color: #111827;
}

body.db-ui .inst-nav {
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
  backdrop-filter: none;
}

body.db-ui .inst-nav__inner {
  width: min(1120px, calc(100% - 40px));
}

body.db-ui .inst-nav button {
  min-height: 46px;
  color: #6b7280;
  font-size: 13px;
}

body.db-ui .inst-nav button.is-active {
  border-bottom-color: #047857;
  color: #047857;
  font-weight: 500;
}

body.db-ui .inst-main {
  width: min(1120px, calc(100% - 40px));
  padding-top: 20px;
}

body.db-ui .inst-hero {
  min-height: 360px;
  padding: 40px;
  border: 1px solid #e5e7eb;
}

body.db-ui .inst-hero::before {
  background: linear-gradient(90deg, rgba(6, 78, 59, 0.84), rgba(6, 78, 59, 0.38) 60%, rgba(6, 78, 59, 0.12));
}

body.db-ui .inst-hero h1 {
  margin-bottom: 14px;
  font-family: var(--db-sans);
  font-size: clamp(28px, 3.4vw, 42px);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0;
}

body.db-ui .inst-hero p {
  max-width: 560px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  line-height: 1.8;
}

body.db-ui .inst-hero .eyebrow {
  color: #a7f3d0;
}

body.db-ui .inst-section {
  margin-top: 34px;
}

body.db-ui .inst-section__head {
  margin-bottom: 14px;
}

body.db-ui .inst-section__head h2 {
  color: #111827;
  font-family: var(--db-sans);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0;
}

body.db-ui .inst-section__head p {
  color: #9ca3af;
  font-size: 10px;
}

body.db-ui .inst-cards {
  gap: 12px;
}

body.db-ui .inst-card {
  padding: 18px;
  border: 1px solid #e5e7eb;
  background: #fff;
  box-shadow: none;
  transition: border-color 0.15s;
}

body.db-ui .inst-card:hover {
  border-color: #d1d5db;
  box-shadow: none;
  transform: none;
}

body.db-ui .inst-card .num {
  margin-bottom: 12px;
  color: #9ca3af;
  font-size: 9px;
}

body.db-ui .inst-card h3 {
  margin-bottom: 6px;
  color: #111827;
  font-size: 14px;
  font-weight: 600;
}

body.db-ui .inst-card p {
  color: #6b7280;
  font-size: 11px;
  line-height: 1.8;
}

body.db-ui .inst-photo {
  min-height: 300px;
}

body.db-ui .inst-quote {
  padding: 28px;
  border: 1px solid #e5e7eb;
  background: #fff;
}

body.db-ui .inst-quote blockquote {
  color: #111827;
  font-family: var(--db-sans);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.7;
  letter-spacing: 0;
}

body.db-ui .inst-quote cite {
  color: #9ca3af;
}

body.db-ui .inst-text h1 {
  color: #111827;
  font-family: var(--db-sans);
  font-size: clamp(26px, 2.8vw, 36px);
  font-weight: 600;
  letter-spacing: 0;
}

body.db-ui .inst-text .lead {
  color: #374151;
  font-family: var(--db-sans);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.8;
}

body.db-ui .inst-text p {
  color: #6b7280;
  font-size: 13px;
  line-height: 1.95;
}

body.db-ui .fact-grid {
  border-color: #e5e7eb;
  background: #e5e7eb;
}

body.db-ui .fact-item {
  padding: 15px;
  background: #fff;
}

body.db-ui .fact-item .k {
  color: #9ca3af;
}

body.db-ui .fact-item .v {
  color: #111827;
  font-size: 14px;
}

body.db-ui .people-grid {
  gap: 12px;
}

body.db-ui .person-card {
  padding: 18px;
  border-color: #e5e7eb;
  box-shadow: none;
}

body.db-ui .person-card .avatar {
  width: 38px;
  height: 38px;
  background: #ecfdf5;
  color: #047857;
  font-size: 14px;
}

body.db-ui .person-card h3 {
  color: #111827;
  font-size: 14px;
}

body.db-ui .person-card .role,
body.db-ui .person-card p {
  color: #6b7280;
}

body.db-ui .news-list {
  border-color: #e5e7eb;
  background: #e5e7eb;
}

body.db-ui .news-row {
  background: #fff;
}

body.db-ui .news-row:hover {
  background: #f9fafb;
}

body.db-ui .news-row h3 {
  color: #111827;
  font-size: 14px;
}

body.db-ui .news-row p {
  color: #6b7280;
}

body.db-ui .news-row .date,
body.db-ui .news-row .cat {
  color: #9ca3af;
}

body.db-ui .news-article {
  border-color: #e5e7eb;
}

body.db-ui .news-article__head h2 {
  color: #111827;
  font-family: var(--db-sans);
  font-size: clamp(24px, 2.8vw, 34px);
  font-weight: 600;
  letter-spacing: 0;
}

body.db-ui .news-article__body p {
  color: #4b5563;
  font-size: 13px;
  line-height: 2;
}

body.db-ui .news-article__body p:first-child::first-letter {
  color: #047857;
}

body.db-ui .news-cipher {
  border-color: #e5e7eb;
  background: #f9fafb;
}

body.db-ui .news-cipher code {
  border-color: #d1d5db;
  background: #fff;
  color: #111827;
}

body.db-ui .contact-card {
  border-color: #e5e7eb;
  background: #fff;
}

body.db-ui .contact-card h3 {
  color: #111827;
}

body.db-ui .contact-card dd {
  color: #4b5563;
}

body.db-ui .institute-footer {
  border-top-color: #e5e7eb;
  color: #9ca3af;
}

/* ---------- forum ---------- */
body.db-ui .screen--forum {
  background: #f3efe3;
  color: #292524;
}

body.db-ui .forum-head {
  background: #272b30;
  border-bottom-color: #3f3f46;
}

body.db-ui .forum-brand .name {
  font-family: var(--db-sans);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0;
}

body.db-ui .forum-brand .sub {
  color: #a1a1aa;
  font-size: 8px;
}

body.db-ui .forum-head__meta {
  color: #a1a1aa;
}

body.db-ui .forum-nav button {
  color: #d4d4d8;
  font-size: 11px;
}

body.db-ui .forum-nav .is-active {
  background: #3f3f46;
  color: #fff;
}

body.db-ui .forum-main {
  width: min(1000px, calc(100% - 38px));
}

body.db-ui .forum-notice {
  border-color: #e7dfcd;
  background: #faf6ea;
  color: #78716c;
}

body.db-ui .forum-toolbar h1 {
  color: #292524;
  font-size: 18px;
  font-weight: 600;
}

body.db-ui .post-table {
  border-color: #ddd3be;
  background: #fffdf7;
}

body.db-ui .post-row {
  background: transparent;
}

body.db-ui .post-row:hover {
  background: #faf5e8;
}

body.db-ui .post-row__main h2 {
  color: #292524;
  font-size: 14px;
  font-weight: 600;
}

body.db-ui .post-row__main p {
  color: #78716c;
}

body.db-ui .post-row__icon {
  border-color: #d6c9ae;
  color: #8a5a3d;
}

body.db-ui .thread {
  border-color: #ddd3be;
  background: #fffdf7;
}

body.db-ui .thread__head h1 {
  color: #292524;
  font-family: var(--db-sans);
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 600;
  letter-spacing: 0;
}

body.db-ui .thread__body p {
  color: #44403c;
  font-size: 13px;
  line-height: 2;
}

body.db-ui .floor__body {
  color: #57534e;
}

body.db-ui .hidden-link {
  color: #78716c;
  font-family: var(--db-sans);
}

body.db-ui .hidden-link:hover {
  color: #b91c1c;
}

body.db-ui .account-scrap {
  border-color: #ddd3be;
  background: #f3ecdc;
  color: #78716c;
}

body.db-ui .forum-foot {
  color: #a8a29e;
}

/* ---------- panyang ---------- */
body.db-ui .screen--panyang-login {
  background: #0b1117;
}

body.db-ui .panyang-visual h2 {
  font-family: var(--db-sans);
  font-weight: 600;
  letter-spacing: 0;
}

body.db-ui .panyang-login-card h1 {
  font-family: var(--db-sans);
  font-weight: 600;
}

body.db-ui .panyang-logo,
body.db-ui .panyang-banner h1,
body.db-ui .panyang-panel__head h2,
body.db-ui .announcement h3,
body.db-ui .mail-row h3 {
  font-family: var(--db-sans);
}

body.db-ui .panyang-banner h1 {
  font-weight: 600;
  letter-spacing: 0;
}

/* ---------- dark scenes: hell / corridor / terminal / portals ---------- */
body.db-ui .screen--hell {
  background: #09090b;
  color: #e4e4e7;
  font-family: var(--db-sans);
}

body.db-ui .screen--hell::before,
body.db-ui .hell-arch,
body.db-ui .scroll-sheet::before,
body.db-ui .scroll-sheet::after {
  display: none !important;
}

body.db-ui .hell-header {
  border-bottom-color: #27272a;
  background: rgba(9, 9, 11, 0.96);
  backdrop-filter: blur(8px);
}

body.db-ui .hell-header__inner {
  width: min(1120px, calc(100% - 40px));
  min-height: 58px;
}

body.db-ui .hell-brand .name {
  color: #f4f4f5;
  font-family: var(--db-sans);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

body.db-ui .hell-brand .en {
  color: #71717a;
}

body.db-ui .hell-user {
  color: #a1a1aa;
  font-family: var(--db-sans);
}

body.db-ui .hell-user .dot {
  background: #ef4444;
  box-shadow: none;
}

body.db-ui .hell-back {
  border-color: #3f3f46;
  color: #a1a1aa;
}

body.db-ui .hell-back:hover {
  border-color: #71717a;
  color: #f4f4f5;
}

body.db-ui .hell-verse {
  width: min(980px, calc(100% - 40px));
  padding: 22px 0 16px;
  color: #a1a1aa;
  font-family: var(--db-sans);
  font-size: 12px;
  letter-spacing: 0;
}

body.db-ui .hell-verse::before,
body.db-ui .hell-verse::after {
  color: #52525b;
}

body.db-ui .hell-nav {
  gap: 2px;
  width: min(1120px, calc(100% - 40px));
  justify-content: flex-start;
  border-bottom: 1px solid #27272a;
  padding-bottom: 0;
}

body.db-ui .hell-nav button {
  min-height: 42px;
  border: 1px solid transparent;
  border-bottom: 0;
  color: #a1a1aa;
  font-family: var(--db-sans);
  font-size: 12px;
  letter-spacing: 0;
}

body.db-ui .hell-nav button.is-active {
  border-color: transparent;
  border-bottom: 2px solid #dc2626;
  background: transparent;
  color: #f4f4f5;
}

body.db-ui .hell-main {
  width: min(1120px, calc(100% - 40px));
  padding-top: 18px;
}

body.db-ui .hell-intro {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom-color: #27272a;
}

body.db-ui .hell-intro h1 {
  color: #f4f4f5;
  font-family: var(--db-sans);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0;
}

body.db-ui .hell-intro p {
  color: #a1a1aa;
  font-size: 11px;
}

body.db-ui .hell-intro .count {
  color: #a1a1aa;
}

body.db-ui .hell-intro .count strong {
  color: #f87171;
}

body.db-ui .scroll-grid {
  gap: 12px;
}

body.db-ui .scroll-card {
  min-height: 160px;
  padding: 18px;
  border: 1px solid #27272a;
  border-radius: 2px;
  background: #111113;
  color: #d4d4d8;
}

body.db-ui .scroll-card:hover {
  border-color: #7f1d1d;
  background: #151518;
  transform: none;
}

body.db-ui .scroll-card::after {
  color: #3f3f46;
}

body.db-ui .scroll-card__num {
  margin-bottom: 12px;
  color: #71717a;
}

body.db-ui .scroll-card h2 {
  color: #f4f4f5;
  font-family: var(--db-sans);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
}

body.db-ui .scroll-card p {
  color: #a1a1aa;
  font-size: 11px;
}

body.db-ui .scroll-card__status {
  color: #a1a1aa;
}

body.db-ui .scroll-card--final {
  background: #180a0a;
  border-color: #7f1d1d;
}

body.db-ui .scroll-card--final h2 {
  color: #fecaca;
}

body.db-ui .hell-map {
  min-height: 470px;
  border-color: #27272a;
  background: #0b0b0d;
}

body.db-ui .hell-map::before {
  color: #71717a;
}

body.db-ui .map-wrap {
  gap: 14px;
}

body.db-ui .map-side {
  gap: 12px;
}

body.db-ui .map-side .side-block {
  border-color: #27272a;
  background: #111113;
}

body.db-ui .map-side h3 {
  color: #e4e4e7;
  font-family: var(--db-sans);
  font-weight: 600;
  letter-spacing: 0;
}

body.db-ui .map-side p {
  color: #a1a1aa;
}

body.db-ui .map-counter {
  color: #f4f4f5;
}

body.db-ui .map-counter span {
  color: #71717a;
}

body.db-ui .discussion-list {
  border-color: #27272a;
  background: #27272a;
}

body.db-ui .discussion-item {
  background: #0b0b0d;
}

body.db-ui .discussion-item__head:hover {
  background: #151518;
}

body.db-ui .discussion-item__user {
  color: #a1a1aa;
}

body.db-ui .discussion-item__title {
  color: #e4e4e7;
}

body.db-ui .discussion-item__reply {
  color: #71717a;
}

body.db-ui .discussion-item__body p {
  border-top-color: #27272a;
  color: #a1a1aa;
}

body.db-ui .vault-grid {
  gap: 12px;
}

body.db-ui .vault-card {
  border-color: #27272a;
  background: #111113;
}

body.db-ui .vault-card h2 {
  color: #f4f4f5;
  font-family: var(--db-sans);
  font-weight: 600;
  letter-spacing: 0;
}

body.db-ui .vault-card p {
  color: #a1a1aa;
}

body.db-ui .message-bubble {
  border-color: #3f3f46;
  background: #18181b;
  color: #d4d4d8;
}

body.db-ui .message-bubble.is-mine {
  border-color: #334155;
  background: #0f172a;
  color: #cbd5e1;
}

body.db-ui .message-bubble .from {
  color: #71717a;
}

body.db-ui .hell-detail {
  width: min(900px, calc(100% - 40px));
  padding-top: 24px;
}

body.db-ui .hell-detail__back button {
  color: #a1a1aa;
  font-size: 11px;
}

body.db-ui .scroll-sheet {
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid #27272a;
  background: #0f0f11;
  box-shadow: none;
}

body.db-ui .scroll-sheet h1 {
  color: #f4f4f5;
  font-family: var(--db-sans);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 600;
  letter-spacing: 0;
}

body.db-ui .scroll-sheet .sub {
  color: #71717a;
}

body.db-ui .scroll-body {
  color: #d4d4d8;
  font-family: var(--db-sans);
  font-size: 14px;
  line-height: 2;
  letter-spacing: 0;
}

body.db-ui .scroll-cipher {
  border-color: #27272a;
  background: #09090b;
}

body.db-ui .scroll-cipher .cipher span {
  border-color: #3f3f46;
  background: #111113;
  color: #f4f4f5;
}

body.db-ui .scroll-cipher .puzzle-note {
  border-left-color: #dc2626;
  background: #180a0a;
  color: #fca5a5;
}

body.db-ui .scroll-cipher .db-input,
body.db-ui .scroll-cipher .field {
  border-color: #3f3f46;
  background: #0b0b0d;
  color: #f4f4f5;
}

body.db-ui .scroll-cipher .btn {
  border-color: #7f1d1d;
  background: #7f1d1d;
  color: #fff;
}

body.db-ui .revealed-scripture {
  border-color: #3f3f46;
  background: #0b0b0d;
}

body.db-ui .revealed-scripture .seal {
  color: #71717a;
}

body.db-ui .revealed-scripture p {
  color: #e4e4e7;
  font-family: var(--db-sans);
  font-size: 14px;
  line-height: 2;
}

body.db-ui .hidden-note {
  border-color: #27272a;
  background: #111113;
}

body.db-ui .hidden-note summary {
  color: #e4e4e7;
}

body.db-ui .hidden-note .hidden-note__body {
  border-top-color: #27272a;
  color: #a1a1aa;
}

body.db-ui .hell-login {
  background: #080808;
}

body.db-ui .hell-login-title {
  color: #ef4444;
  font-family: var(--db-sans);
  font-size: clamp(36px, 6vw, 54px);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
}

body.db-ui .hell-login-en {
  color: #71717a;
}

body.db-ui .hell-login-sub {
  color: #a1a1aa;
  font-family: var(--db-sans);
  letter-spacing: 0;
}

body.db-ui .hell-form .field {
  border-color: #3f3f46;
  background: #111113;
  color: #f4f4f5;
}

body.db-ui .hell-form .field::placeholder {
  color: #71717a;
}

body.db-ui .hell-form .btn {
  border-color: #991b1b;
  background: #991b1b;
  color: #fff;
}

body.db-ui .hell-quote,
body.db-ui .hell-hint {
  color: #a1a1aa;
  font-family: var(--db-sans);
}

body.db-ui .finaldoor {
  background: #080808;
}


/* ---------- final door ---------- */
body.db-ui .screen--finaldoor {
  background: #080808;
  color: #f4f4f5;
  font-family: var(--db-sans);
}

body.db-ui .finaldoor-main {
  padding-top: 22px;
}

body.db-ui .door-wrap {
  margin-bottom: 22px;
}

body.db-ui .door {
  border-color: #3f3f46;
  border-radius: 6px 6px 0 0;
  background: #111113;
  box-shadow: none;
}

body.db-ui .door::before {
  background: #27272a;
}

body.db-ui .door::after {
  color: #3f3f46;
  font-family: var(--db-sans);
}

body.db-ui .door-sigil {
  opacity: 0.35;
}

body.db-ui .finaldoor-title {
  color: #f4f4f5;
  font-family: var(--db-sans);
  font-size: clamp(30px, 4vw, 40px);
  font-weight: 600;
  letter-spacing: 0.14em;
}

body.db-ui .finaldoor-sub {
  color: #a1a1aa;
  font-family: var(--db-sans);
  letter-spacing: 0;
}

body.db-ui .finaldoor-clues .clue-seal {
  border-color: #3f3f46;
  color: #d4d4d8;
}

body.db-ui .finaldoor-clues .clue-seal.is-missing {
  border-color: #27272a;
  color: #71717a;
}

body.db-ui .finaldoor-form .field {
  border-color: #3f3f46;
  background: #111113;
  color: #f4f4f5;
}

body.db-ui .finaldoor-form .field::placeholder {
  color: #71717a;
}

body.db-ui .finaldoor-note {
  color: #a1a1aa;
  font-family: var(--db-sans);
}

body.db-ui .topbar {
  border-bottom-color: #27272a;
  background: rgba(9, 9, 11, 0.94);
}

/* ---------- corridor ---------- */
body.db-ui .screen--corridor {
  font-family: var(--db-sans);
}

body.db-ui .corridor-dialogue {
  border-left-color: #dc2626;
  background: rgba(9, 9, 11, 0.9);
}

body.db-ui .corridor-dialogue .who {
  color: #a1a1aa;
  font-family: var(--db-sans);
}

body.db-ui .corridor-dialogue .line {
  color: #f4f4f5;
  font-family: var(--db-sans);
  font-size: clamp(17px, 2vw, 21px);
  letter-spacing: 0;
}

body.db-ui .corridor-step {
  color: #a1a1aa;
}

body.db-ui .corridor-hud {
  color: #a1a1aa;
  font-family: var(--db-sans);
}

body.db-ui .corridor-controls .btn {
  min-height: 38px;
  border-color: #3f3f46;
  background: rgba(17, 17, 19, 0.8);
  color: #e4e4e7;
}

body.db-ui .corridor-controls .btn--primary {
  border-color: #991b1b;
  background: #991b1b;
  color: #fff;
}

/* ---------- terminal ---------- */
body.db-ui .screen--terminal {
  font-family: var(--db-mono);
}

body.db-ui .screen--terminal::after {
  color: rgba(34, 197, 94, 0.018);
}

body.db-ui .term-head {
  border-bottom-color: #1f2937;
  background: #030705;
}

body.db-ui .term-head__left {
  color: #4ade80;
  font-family: var(--db-mono);
}

body.db-ui .term-head__right {
  color: #86efac;
}

body.db-ui .term-wrap {
  width: min(1000px, calc(100% - 40px));
}

body.db-ui .term-intro {
  border-bottom-color: #14532d;
  color: #4ade80;
}

body.db-ui .term-line {
  color: #86efac;
  font-family: var(--db-mono);
  font-size: 12px;
}

body.db-ui .term-line.is-it {
  color: #bbf7d0;
}

body.db-ui .term-line.is-user {
  color: #4ade80;
}

body.db-ui .term-line .prefix {
  color: #15803d;
}

body.db-ui .term-chip {
  border-color: #14532d;
  background: #030705;
  color: #86efac;
  font-family: var(--db-mono);
}

body.db-ui .term-chip:hover {
  border-color: #22c55e;
  color: #dcfce7;
}

body.db-ui .term-choice {
  border-color: #14532d;
  background: #030705;
}

body.db-ui .term-choice:hover {
  border-color: #22c55e;
  background: #041108;
}

body.db-ui .term-input-row .field {
  min-height: 40px;
  border-color: #14532d;
  background: #030705;
  color: #bbf7d0;
}

body.db-ui .term-input-row .btn {
  min-width: 72px;
  border-color: #14532d;
  background: #041108;
  color: #bbf7d0;
  white-space: nowrap;
}

body.db-ui .term-hint {
  color: #3f7d50;
}

/* ---------- patient portal ---------- */
body.db-ui .screen--patient {
  background: #060b10;
  font-family: var(--db-sans);
}

body.db-ui .portal-head--patient {
  border-bottom-color: #1e293b;
  background: rgba(5, 10, 16, 0.96);
}

body.db-ui .portal-head__inner {
  width: min(1040px, calc(100% - 40px));
}

body.db-ui .portal-brand strong {
  font-family: var(--db-sans);
  font-weight: 600;
}

body.db-ui .portal-tabs {
  width: min(1040px, calc(100% - 40px));
}

body.db-ui .portal-tabs button {
  font-family: var(--db-sans);
}

body.db-ui .portal-wrap {
  width: min(1040px, calc(100% - 40px));
}

body.db-ui .portal-vitals {
  border-color: #1f2937;
  background: #0b1117;
  padding: 20px;
}

body.db-ui .portal-vitals__copy h1 {
  font-family: var(--db-sans);
  font-weight: 600;
  letter-spacing: 0;
}

body.db-ui .portal-section-head h2 {
  font-family: var(--db-sans);
  font-weight: 600;
  letter-spacing: 0;
}

body.db-ui .diary-entry {
  border-color: #1f2937;
  background: #0b1117;
}

body.db-ui .diary-entry summary strong {
  font-family: var(--db-sans);
  font-weight: 500;
}

body.db-ui .diary-entry__body p {
  font-family: var(--db-sans);
  color: #cbd5e1;
}

body.db-ui .chat-window,
body.db-ui .report-card,
body.db-ui .patient-card {
  border-color: #1f2937;
  background: #0b1117;
}

body.db-ui .chat-bubble {
  font-family: var(--db-sans);
}

body.db-ui .patient-card__top h3,
body.db-ui .report-card__head h3 {
  font-family: var(--db-sans);
}

/* ---------- engineer portal : blue / slate, like the original app ---------- */
body.db-ui .screen--engineer {
  background: #05080f;
  font-family: var(--db-sans);
}

body.db-ui .portal-head--engineer {
  border-bottom-color: #1e293b;
  background: rgba(5, 9, 15, 0.96);
}

body.db-ui .portal-head--engineer .portal-brand .mark {
  border-color: #1d4ed8;
  color: #93c5fd;
}

body.db-ui .portal-head--engineer .portal-brand strong {
  color: #e2e8f0;
}

body.db-ui .portal-head--engineer .portal-brand span {
  color: #64748b;
}

body.db-ui .portal-head--engineer .portal-live {
  color: #60a5fa;
}

body.db-ui .portal-head--engineer .live-dot {
  background: #3b82f6;
  box-shadow: none;
}

body.db-ui .portal-head--engineer .portal-exit {
  border-color: #1e3a5f;
  color: #93c5fd;
}

body.db-ui .portal-head--engineer .portal-tabs button {
  color: #64748b;
}

body.db-ui .portal-head--engineer .portal-tabs button.is-active {
  border-bottom-color: #3b82f6;
  color: #93c5fd;
}

body.db-ui .screen--engineer .portal-wrap {
  width: min(1040px, calc(100% - 40px));
}

body.db-ui .eng-hero {
  border-color: #1e293b;
  background: #0b1220;
  padding: 20px;
}

body.db-ui .eng-hero .eyebrow {
  color: #60a5fa;
}

body.db-ui .eng-hero h1 {
  color: #e2e8f0;
  font-family: var(--db-sans);
  font-weight: 600;
  letter-spacing: 0;
}

body.db-ui .eng-hero p {
  color: #94a3b8;
}

body.db-ui .eng-meter {
  color: #93c5fd;
}

body.db-ui .eng-meter small {
  color: #64748b;
}

body.db-ui .eng-section-head {
  border-bottom-color: #1e293b;
}

body.db-ui .eng-section-head h2 {
  color: #e2e8f0;
  font-family: var(--db-sans);
  font-weight: 600;
  letter-spacing: 0;
}

body.db-ui .eng-section-head p {
  color: #64748b;
}

body.db-ui .order-card {
  border-color: #1e293b;
  background: #0b1220;
}

body.db-ui .order-card.is-final {
  border-color: #7f1d1d;
}

body.db-ui .order-id {
  color: #60a5fa;
}

body.db-ui .order-title {
  color: #e2e8f0;
}

body.db-ui .order-title small {
  color: #64748b;
}

body.db-ui .order-status {
  color: #94a3b8;
}

body.db-ui .order-status.is-active {
  color: #fbbf24;
}

body.db-ui .order-card__body {
  border-top-color: #1e293b;
}

body.db-ui .order-card__body > p {
  color: #94a3b8;
}

body.db-ui .order-log {
  border-color: #1e293b;
  background: #05080f;
  color: #94a3b8;
}

body.db-ui .order-morse {
  border-left-color: #3b82f6;
  background: #0f172a;
}

body.db-ui .order-morse > span {
  color: #93c5fd;
}

body.db-ui .order-morse code {
  color: #cbd5e1;
}

body.db-ui .audio-file {
  border-color: #1e293b;
  background: #0b1220;
}

body.db-ui .audio-file__head {
  color: #cbd5e1;
}

body.db-ui .waveform span {
  background: linear-gradient(180deg, #60a5fa, #1e3a5f);
}

body.db-ui .waveform span:nth-child(5n) {
  background: #93c5fd;
}

body.db-ui .recording-copy {
  border-color: #1e293b;
  background: #0b1220;
}

body.db-ui .recording-copy > p {
  color: #cbd5e1;
}

body.db-ui .eng-choice {
  border-top-color: #1e293b;
}

body.db-ui .eng-choice__prompt {
  color: #e2e8f0;
  font-family: var(--db-sans);
  font-weight: 600;
  letter-spacing: 0;
}

body.db-ui .eng-choice .btn {
  border-color: #1e3a5f;
  background: #0f172a;
  color: #cbd5e1;
}

body.db-ui .eng-choice .btn--primary {
  border-color: #1d4ed8;
  background: #1d4ed8;
  color: #fff;
}

body.db-ui .eng-result {
  border-color: #334155;
  background: #0f172a;
}

body.db-ui .eng-result.is-good {
  border-color: #14532d;
  background: #041108;
}

body.db-ui .eng-result h3 {
  color: #93c5fd;
}

body.db-ui .eng-result.is-good h3 {
  color: #86efac;
}

body.db-ui .eng-result p {
  color: #94a3b8;
}

body.db-ui .eng-profile {
  border-color: #1e293b;
  background: #0b1220;
}

body.db-ui .eng-avatar {
  border-color: #1d4ed8;
  color: #93c5fd;
}

body.db-ui .eng-profile h3 {
  color: #e2e8f0;
}

body.db-ui .eng-profile p {
  color: #64748b;
}

body.db-ui .eng-note {
  border-left-color: #3b82f6;
  background: #0f172a;
  color: #94a3b8;
}

body.db-ui .portal-wrap--engineer .info-grid strong {
  color: #cbd5e1;
}

body.db-ui .dutybook {
  border-color: #d6c9ae;
  background: #f3ecdc;
  box-shadow: none;
}

body.db-ui .dutybook p {
  font-family: var(--db-sans);
}

/* ---------- endings ---------- */
body.db-ui .screen--ending {
  background: #f8fafc;
  color: #111827;
  font-family: var(--db-sans);
}

body.db-ui .ending-bg {
  display: none;
}

body.db-ui .ending-veil {
  background: radial-gradient(ellipse at 50% 30%, #ffffff, #f1f5f9 70%);
}

body.db-ui .ending-top {
  color: #9ca3af;
  font-family: var(--db-sans);
}

body.db-ui .ending-top .rec {
  color: #b91c1c;
}

body.db-ui .ending-chapter {
  color: #6b7280;
  font-family: var(--db-sans);
  letter-spacing: 0.02em;
}

body.db-ui .ending-chapter strong {
  color: #111827;
}

body.db-ui .ending-line .who {
  color: #6b7280;
  font-family: var(--db-sans);
  letter-spacing: 0;
}

body.db-ui .ending-line .text {
  color: #111827;
}

body.db-ui .ending-line--blood .text {
  color: #b91c1c;
  text-shadow: none;
}

body.db-ui .ending-line--green .text {
  color: #047857;
}

body.db-ui .ending-caption,
body.db-ui .ending-skip,
body.db-ui .cine-controls .hint {
  color: #9ca3af;
  font-family: var(--db-sans);
}

body.db-ui .ending-progress span {
  background: #e5e7eb;
}

body.db-ui .ending-progress span.is-on {
  background: #1e5b9d;
}

body.db-ui .ending-card h1 {
  color: #111827;
  font-weight: 600;
}

body.db-ui .ending-card__no,
body.db-ui .ending-card__sub,
body.db-ui .ending-card__desc,
body.db-ui .ending-card__collection {
  color: #6b7280;
  font-family: var(--db-sans);
}

body.db-ui .ending-card__tag {
  border-color: #e5e7eb;
  color: #6b7280;
  font-family: var(--db-sans);
}

body.db-ui .ending-card__tag--green {
  border-color: #bbf7d0;
  color: #047857;
}

body.db-ui .ending-card .btn,
body.db-ui .ending-actions .btn {
  border-color: #e5e7eb;
  background: #fff;
  color: #374151;
}

body.db-ui .ending-card .btn--primary,
body.db-ui .ending-actions .btn--primary {
  border-color: #1e5b9d;
  background: #1e5b9d;
  color: #fff;
}

body.db-ui .ending-card .btn:hover,
body.db-ui .ending-actions .btn:hover {
  border-color: #d1d5db;
  background: #f9fafb;
}

body.db-ui .ending-card .btn--primary:hover,
body.db-ui .ending-actions .btn--primary:hover {
  border-color: #194a82;
  background: #194a82;
}

body.db-ui .heart-count p {
  color: #6b7280;
}

body.db-ui .heart-orb {
  border-color: #fecaca;
  color: #b91c1c;
}

body.db-ui .countdown {
  color: #b91c1c;
}

/* bad ending remains dark / red */
body.db-ui .screen--ending.ending--bad {
  background: #080303;
  color: #f4f4f5;
}

body.db-ui .screen--ending.ending--bad .ending-veil {
  background: radial-gradient(ellipse at 50% 32%, rgba(127, 29, 29, 0.36), #080303 72%);
}

body.db-ui .screen--ending.ending--bad .ending-top,
body.db-ui .screen--ending.ending--bad .ending-chapter,
body.db-ui .screen--ending.ending--bad .ending-line .who,
body.db-ui .screen--ending.ending--bad .ending-caption,
body.db-ui .screen--ending.ending--bad .ending-skip,
body.db-ui .screen--ending.ending--bad .cine-controls .hint {
  color: #a1a1aa;
}

body.db-ui .screen--ending.ending--bad .ending-chapter strong,
body.db-ui .screen--ending.ending--bad .ending-line .text,
body.db-ui .screen--ending.ending--bad .ending-card h1 {
  color: #f4f4f5;
}

body.db-ui .screen--ending.ending--bad .ending-line--blood .text {
  color: #f87171;
}

body.db-ui .screen--ending.ending--bad .ending-card__no,
body.db-ui .screen--ending.ending--bad .ending-card__sub,
body.db-ui .screen--ending.ending--bad .ending-card__desc,
body.db-ui .screen--ending.ending--bad .ending-card__collection {
  color: #a1a1aa;
}

body.db-ui .screen--ending.ending--bad .ending-card .btn,
body.db-ui .screen--ending.ending--bad .ending-actions .btn {
  border-color: #3f3f46;
  background: #18181b;
  color: #e4e4e7;
}

body.db-ui .screen--ending.ending--bad .ending-card .btn--primary,
body.db-ui .screen--ending.ending--bad .ending-actions .btn--primary {
  border-color: #991b1b;
  background: #991b1b;
  color: #fff;
}

body.db-ui .screen--ending.ending--bad .ending-progress span {
  background: #27272a;
}

body.db-ui .screen--ending.ending--bad .ending-progress span.is-on {
  background: #dc2626;
}

body.db-ui .screen--ending.ending--bad .location-panel {
  background: #140606;
}

/* ---------- small adjustments ---------- */
body.db-ui .db-login-tabs .db-login-tab {
  min-height: 42px;
}

body.db-ui .db-login-form {
  padding-bottom: 6px;
}

body.db-ui .db-login-form .db-btn {
  margin-bottom: 20px;
}

body.db-ui .clue-item.is-locked .clue-item__icon {
  color: #d1d5db;
}

body.db-ui .clue-panel__body {
  scrollbar-width: thin;
  scrollbar-color: #e5e7eb transparent;
}

body.db-ui .db-oas-nav__inner {
  min-height: 46px;
}

/* responsive additions */
@media (max-width: 900px) {
  body.db-ui .inst-header__top,
  body.db-ui .inst-nav__inner,
  body.db-ui .inst-main {
    width: calc(100% - 28px);
  }
  body.db-ui .inst-hero {
    padding: 26px;
  }
  body.db-ui .inst-quote blockquote {
    font-size: 18px;
  }
  body.db-ui .portal-head__inner,
  body.db-ui .portal-tabs,
  body.db-ui .portal-wrap,
  body.db-ui .screen--engineer .portal-wrap {
    width: calc(100% - 28px);
  }
  body.db-ui .hell-header__inner,
  body.db-ui .hell-nav,
  body.db-ui .hell-main,
  body.db-ui .hell-verse {
    width: calc(100% - 28px);
  }
  body.db-ui .term-wrap {
    width: calc(100% - 24px);
  }
  body.db-ui .screen--ending .ending-card h1 {
    font-size: 44px;
  }
}

@media (max-width: 680px) {
  body.db-ui .db-oas-top__inner,
  body.db-ui .db-oas-nav__inner,
  body.db-ui .db-container {
    width: calc(100% - 28px);
  }
  body.db-ui .db-oas-nav__inner {
    min-height: 42px;
  }
  body.db-ui .db-oas-nav__item {
    min-height: 42px;
    padding: 0 12px;
    font-size: 12px;
  }
  body.db-ui .db-login-main {
    align-items: center;
    padding: 18px 14px 52px;
  }
  body.db-ui .db-login-card {
    margin-top: 0;
  }
  body.db-ui .db-login-main::before {
    opacity: 0.04;
  }
  body.db-ui .db-login-foot {
    margin-top: 12px;
  }
  body.db-ui .clue-panel {
    height: 360px;
    max-height: 62vh;
  }
  body.db-ui .clue-panel__body {
    height: calc(100% - 46px);
    max-height: none;
  }
  body.db-ui .inst-hero {
    min-height: 320px;
    padding: 22px;
  }
  body.db-ui .inst-hero h1 {
    font-size: 27px;
  }
  body.db-ui .inst-quote {
    padding: 22px;
  }
  body.db-ui .scroll-card {
    min-height: 145px;
    padding: 15px;
  }
  body.db-ui .hell-login-title {
    font-size: 38px;
  }
  body.db-ui .portal-vitals {
    grid-template-columns: 1fr;
  }
  body.db-ui .eng-hero {
    padding: 16px;
  }
  body.db-ui .eng-hero h1 {
    font-size: 26px;
  }
  body.db-ui .ending-line {
    font-size: clamp(19px, 5.4vw, 28px);
  }
  body.db-ui .ending-top {
    font-size: 8px;
  }
  body.db-ui .term-input-row .btn {
    min-width: 64px;
  }
}


/* ---------- mobile exit ---------- */
body.db-ui .db-mobile-exit {
  display: none;
  appearance: none;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: #dbeafe;
  font-family: var(--db-sans);
  font-size: 9px;
  line-height: 1.4;
}

/* ---------- flat Panyang staff login ---------- */
body.db-ui .db-panyang-login {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--db-bg);
  color: var(--db-text);
  font-family: var(--db-sans);
}

body.db-ui .db-py-header {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

body.db-ui .db-py-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(1120px, calc(100% - 40px));
  min-height: 68px;
  margin: 0 auto;
}

body.db-ui .db-py-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

body.db-ui .db-py-brand .mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid #99f6e4;
  background: #f0fdfa;
  color: #0f766e;
  font-family: var(--db-mono);
  font-size: 9px;
  font-weight: 700;
}

body.db-ui .db-py-brand strong {
  display: block;
  color: #111827;
  font-size: 16px;
  font-weight: 600;
}

body.db-ui .db-py-brand small {
  display: block;
  color: #9ca3af;
  font-family: var(--db-mono);
  font-size: 7px;
  letter-spacing: 0.1em;
}

body.db-ui .db-py-main {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px 60px;
  overflow: hidden;
}

body.db-ui .db-py-main::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../assets/panyang-hq.jpg") center / cover no-repeat;
  opacity: 0.055;
  filter: grayscale(0.3);
  pointer-events: none;
}

body.db-ui .db-py-main::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(248, 250, 252, 0.4), rgba(240, 242, 245, 0.96));
  pointer-events: none;
}

body.db-ui .db-py-main .db-login-card {
  z-index: 1;
}

body.db-ui .db-py-card-head {
  padding: 22px 22px 0;
}

body.db-ui .db-eyebrow {
  margin: 0 0 8px;
  color: #0f766e;
  font-family: var(--db-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
}

body.db-ui .db-py-card-head h1 {
  margin: 0 0 8px;
  color: #111827;
  font-size: 25px;
  font-weight: 600;
}

body.db-ui .db-py-card-head p {
  margin: 0;
  color: #6b7280;
  font-size: 11px;
  line-height: 1.75;
}

body.db-ui .db-btn--teal {
  border-color: #0f766e;
  background: #0f766e;
  color: #fff;
}

body.db-ui .db-btn--teal:hover {
  border-color: #115e59;
  background: #115e59;
  color: #fff;
}

body.db-ui .db-py-foot {
  padding: 0 22px 20px;
}

body.db-ui .db-py-foot .db-text-link {
  color: #6b7280;
  font-size: 10px;
}

/* ---------- final door compact ---------- */
body.db-ui .finaldoor-main {
  padding: 18px 0 42px;
}

body.db-ui .door-wrap {
  margin-bottom: 16px;
}

body.db-ui .door {
  height: min(300px, 37vh);
}

body.db-ui .finaldoor-title {
  font-size: clamp(28px, 3.4vw, 36px);
}

body.db-ui .finaldoor-sub {
  margin-bottom: 18px;
}

body.db-ui .finaldoor-clues {
  margin-bottom: 16px;
}

body.db-ui .finaldoor-form .db-btn {
  margin-top: 10px;
}

body.db-ui .finaldoor-note {
  margin-top: 12px;
  font-size: 9px;
}

/* ---------- institute hero legibility ---------- */
body.db-ui .inst-hero::before {
  background: linear-gradient(90deg, rgba(4, 62, 48, 0.92), rgba(4, 62, 48, 0.62) 55%, rgba(4, 62, 48, 0.2));
}

body.db-ui .inst-hero h1 {
  max-width: 650px;
  font-size: clamp(26px, 2.9vw, 36px);
  line-height: 1.4;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
}

body.db-ui .inst-hero p {
  max-width: 500px;
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
}

/* ---------- terminal send button ---------- */
body.db-ui .term-input-row .term-send {
  flex: 0 0 72px;
  width: 72px;
  min-width: 72px;
  padding: 0 8px;
  font-size: 11px;
  letter-spacing: 0;
  white-space: nowrap;
  writing-mode: horizontal-tb;
  word-break: keep-all;
}

/* ---------- mobile additions ---------- */
@media (max-width: 680px) {
  body.db-ui .db-mobile-exit {
    display: inline-flex;
    margin-left: auto;
  }
  body.db-ui .db-py-header__inner {
    width: calc(100% - 28px);
    min-height: 58px;
  }
  body.db-ui .db-py-brand strong {
    font-size: 14px;
  }
  body.db-ui .db-py-brand small,
  body.db-ui .db-py-header .db-version {
    display: none;
  }
  body.db-ui .db-py-main {
    padding: 18px 14px 52px;
  }
  body.db-ui .db-py-card-head {
    padding: 18px 16px 0;
  }
  body.db-ui .db-py-card-head h1 {
    font-size: 22px;
  }
  body.db-ui .db-py-foot {
    padding: 0 16px 16px;
  }
  body.db-ui .door {
    height: min(260px, 34vh);
  }
  body.db-ui .finaldoor-main {
    padding-bottom: 90px;
  }
  body.db-ui .term-input-row .term-send {
    flex-basis: 64px;
    width: 64px;
    min-width: 64px;
  }
}


/* ---------- gallery modal ---------- */
body.db-ui .gallery-grid {
  gap: 10px;
}

body.db-ui .gallery-item {
  border-color: #e5e7eb;
  background: #fafafa;
}

body.db-ui .gallery-item h3 {
  color: #111827;
  font-family: var(--db-sans);
  font-weight: 600;
}

body.db-ui .gallery-item p {
  color: #6b7280;
  font-family: var(--db-sans);
}

body.db-ui .gallery-item .kicker {
  color: #9ca3af;
}

body.db-ui .gallery-item.is-locked {
  opacity: 0.45;
}

body.db-ui .gallery-item.is-locked h3 {
  color: #9ca3af;
}


/* ---------- legacy .btn used by modals and old scenes ---------- */
body.db-ui .btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 15px;
  border: 1px solid #d1d5db;
  border-radius: 2px;
  background: #fff;
  color: #374151;
  font-family: var(--db-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

body.db-ui .btn:hover {
  border-color: #9ca3af;
  background: #f9fafb;
  color: #111827;
}

body.db-ui .btn--primary {
  border-color: var(--db-blue);
  background: var(--db-blue);
  color: #fff;
}

body.db-ui .btn--primary:hover {
  border-color: var(--db-blue-dark);
  background: var(--db-blue-dark);
  color: #fff;
}

body.db-ui .btn--ghost {
  border-color: #e5e7eb;
  background: #fff;
  color: #374151;
}

body.db-ui .btn--ghost:hover {
  border-color: #d1d5db;
  background: #f9fafb;
  color: #111827;
}

body.db-ui .btn--gold {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #92400e;
}

body.db-ui .btn--sm {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 12px;
}

body.db-ui .btn[disabled],
body.db-ui .btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

body.db-ui .modal__actions .btn {
  min-height: 38px;
}

body.db-ui .modal--red .btn--primary {
  border-color: #991b1b;
  background: #991b1b;
  color: #fff;
}

body.db-ui .screen--hell .btn--primary,
body.db-ui .screen--finaldoor .btn--primary,
body.db-ui .scroll-cipher .btn,
body.db-ui .finaldoor-form .btn {
  border-color: #991b1b;
  background: #991b1b;
  color: #fff;
}

body.db-ui .screen--hell .btn--primary:hover,
body.db-ui .screen--finaldoor .btn--primary:hover,
body.db-ui .scroll-cipher .btn:hover,
body.db-ui .finaldoor-form .btn:hover {
  border-color: #7f1d1d;
  background: #7f1d1d;
  color: #fff;
}

body.db-ui .screen--hell .btn--ghost {
  border-color: #3f3f46;
  background: #111113;
  color: #e4e4e7;
}

body.db-ui .screen--engineer .btn--primary {
  border-color: #1d4ed8;
  background: #1d4ed8;
}

body.db-ui .screen--engineer .btn--ghost {
  border-color: #1e293b;
  background: #0b1220;
  color: #cbd5e1;
}

body.db-ui .modal__actions .btn--ghost {
  border-color: #e5e7eb;
  background: #fff;
  color: #374151;
}

body.db-ui .modal--red .modal__actions .btn--ghost {
  border-color: #3f3f46;
  background: #111113;
  color: #e4e4e7;
}


body.db-ui .db-login-form .db-btn--teal {
  border-color: #0f766e;
  background: #0f766e;
  color: #fff;
}

body.db-ui .db-login-form .db-btn--teal:hover {
  border-color: #115e59;
  background: #115e59;
  color: #fff;
}


body.db-ui .screen--ending .heart-count .btn {
  width: auto;
  min-width: 220px;
  align-self: center;
  flex: 0 0 auto;
}

body.db-ui .screen--ending .heart-count {
  align-items: center;
}
