:root {
  --canvas: #b8bbc0;
  --canvas-deep: #9fa3a9;
  --glass: rgba(255, 255, 255, 0.14);
  --glass-strong: rgba(255, 255, 255, 0.28);
  --glass-faint: rgba(255, 255, 255, 0.16);
  --ink: #17191d;
  --text: #4e545d;
  --muted: #737985;
  --line: rgba(255, 255, 255, 0.56);
  --line-dark: rgba(29, 33, 40, 0.1);
  --accent: #bd6a62;
  --accent-soft: rgba(189, 106, 98, 0.16);
  --active: #111216;
  --shadow-soft: 0 28px 80px rgba(30, 34, 42, 0.18);
  --shadow-card: 0 18px 48px rgba(45, 52, 64, 0.13);
  --font-sans: "Geist", "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "Geist Mono", "SFMono-Regular", "Menlo", monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--canvas);
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0) 38%),
    linear-gradient(180deg, #c9ccd1 0%, var(--canvas) 48%, var(--canvas-deep) 100%);
  font-family: var(--font-sans);
  letter-spacing: 0;
}

body::before {
  position: fixed;
  right: -8vw;
  bottom: -18vh;
  z-index: -1;
  width: 76vw;
  height: 34vh;
  border-radius: 36px 0 0 0;
  background: linear-gradient(145deg, rgba(30, 32, 35, 0.94), rgba(8, 9, 11, 0.98));
  box-shadow: 0 -34px 90px rgba(11, 12, 15, 0.26);
  content: "";
  transform: skewX(-12deg);
}

button,
input {
  font: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

button {
  cursor: pointer;
}

.scene {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 18px;
  width: min(100%, 1480px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: clamp(14px, 2.4vw, 34px);
  transition:
    opacity 260ms ease,
    filter 260ms ease,
    transform 260ms ease;
}

.tool-rail {
  position: sticky;
  top: 24px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: calc(100dvh - 48px);
  padding: 14px 0;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.34);
  backdrop-filter: blur(28px) saturate(1.15);
  box-shadow: var(--shadow-soft);
}

.rail-logo {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.48);
}

.rail-logo img {
  width: 29px;
  height: 29px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(189, 20, 20, 0.12));
}

.rail-icons {
  position: relative;
  display: grid;
  width: 44px;
  gap: 8px;
  justify-items: center;
  margin-top: 12px;
  transition: gap 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.rail-icons::before,
.rail-icons::after {
  position: absolute;
  left: 50%;
  z-index: 0;
  width: 3px;
  border-radius: 999px;
  pointer-events: none;
  content: "";
  opacity: 0;
  transform: translateX(-50%) scaleY(0);
  transform-origin: top;
}

.rail-icons::before {
  top: 4px;
  bottom: 4px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(29, 33, 40, 0.34), rgba(255, 255, 255, 0));
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.28);
  transition:
    opacity 220ms ease,
    transform 360ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.rail-icons::after {
  top: 4px;
  bottom: 4px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0) 28%,
    rgba(241, 126, 126, 0.84) 46%,
    rgba(187, 218, 245, 0.74) 54%,
    rgba(255, 255, 255, 0) 72%,
    rgba(255, 255, 255, 0) 100%
  );
  background-position: 0 -120%;
  background-size: 100% 220%;
  filter: blur(0.2px);
  transform: translateX(-50%) scaleY(0);
  transition:
    opacity 220ms ease,
    transform 360ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.scene.is-drawer-open .rail-icons {
  gap: 0;
}

.scene.is-drawer-open .rail-icons::before {
  opacity: 1;
  transform: translateX(-50%) scaleY(1);
}

.scene.is-drawer-open .rail-icons::after {
  opacity: 1;
  transform: translateX(-50%) scaleY(1);
  animation: railLineFlow 1.55s cubic-bezier(0.3, 0.0, 0.2, 1) infinite;
}

.drawer-toggle {
  margin-top: 14px;
}

.tool-button,
.round-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--text);
  background: rgba(255, 255, 255, 0.36);
  transition:
    color 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    border-radius 260ms ease,
    box-shadow 220ms ease,
    height 260ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 180ms ease,
    width 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tool-button:hover,
.round-button:hover {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.58);
}

.tool-button:active,
.round-button:active,
.module-card:active {
  transform: translateY(1px);
}

.tool-button.is-active {
  color: #ffffff;
  background: var(--active);
}

.rail-icons .module-nav-button {
  position: relative;
  z-index: 1;
}

.rail-icons .module-nav-button svg {
  transition:
    opacity 180ms ease,
    transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.scene.is-drawer-open .rail-icons .module-nav-button {
  width: 12px;
  height: 28px;
  border-color: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: transparent;
  background: rgba(255, 255, 255, 0.28);
  box-shadow:
    0 0 16px rgba(255, 255, 255, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.48);
  pointer-events: none;
  transform: scaleX(0.36);
}

.scene.is-drawer-open .rail-icons .module-nav-button.is-active {
  background: rgba(17, 18, 22, 0.36);
}

.scene.is-drawer-open .rail-icons .module-nav-button svg {
  opacity: 0;
  transform: scale(0.28);
}

.scene.is-drawer-open .rail-icons .module-nav-button:nth-child(1) {
  transition-delay: 20ms;
}

.scene.is-drawer-open .rail-icons .module-nav-button:nth-child(2) {
  transition-delay: 40ms;
}

.scene.is-drawer-open .rail-icons .module-nav-button:nth-child(3) {
  transition-delay: 60ms;
}

.scene.is-drawer-open .rail-icons .module-nav-button:nth-child(4) {
  transition-delay: 80ms;
}

.scene.is-drawer-open .rail-icons .module-nav-button:nth-child(5) {
  transition-delay: 100ms;
}

.scene.is-drawer-open .rail-icons .module-nav-button:nth-child(6) {
  transition-delay: 120ms;
}

.scene.is-drawer-open .rail-icons .module-nav-button:nth-child(7) {
  transition-delay: 140ms;
}

.scene.is-drawer-open .rail-icons .module-nav-button:nth-child(8) {
  transition-delay: 160ms;
}

.scene.is-drawer-open .rail-icons .module-nav-button:nth-child(9) {
  transition-delay: 180ms;
}

.tool-button svg,
.round-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.rail-status {
  appearance: none;
  display: grid;
  width: 44px;
  height: 44px;
  margin-top: auto;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  background: var(--active);
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.rail-status:hover,
.scene.is-account-menu-open .rail-status {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(17, 18, 22, 0.82);
}

.rail-status:active {
  transform: translateY(1px);
}

.rail-status span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.6s ease-in-out infinite;
}

.account-menu {
  position: fixed;
  left: calc((100vw - min(100vw, 1480px)) / 2 + clamp(14px, 2.4vw, 34px) + 88px);
  bottom: clamp(28px, 3vw, 44px);
  z-index: 70;
  display: grid;
  gap: 6px;
  width: 150px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.055) 62%, rgba(255, 255, 255, 0.1)),
    rgba(238, 242, 247, 0.12);
  backdrop-filter: blur(34px) saturate(1.24) contrast(1.03);
  -webkit-backdrop-filter: blur(34px) saturate(1.24) contrast(1.03);
  box-shadow:
    0 24px 78px rgba(24, 29, 38, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.68),
    inset 0 -1px 0 rgba(255, 255, 255, 0.16);
  opacity: 0;
  pointer-events: none;
  transform: translate(-8px, 8px) scale(0.96);
  transform-origin: left bottom;
  transition:
    opacity 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.account-menu::before {
  position: absolute;
  left: -5px;
  bottom: 22px;
  width: 10px;
  height: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.46);
  border-bottom: 1px solid rgba(255, 255, 255, 0.46);
  background: rgba(238, 242, 247, 0.18);
  backdrop-filter: blur(18px);
  content: "";
  transform: rotate(45deg);
}

.scene.is-account-menu-open .account-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translate(0, 0) scale(1);
}

.account-menu-item {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  text-align: left;
  transition:
    color 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.account-menu-item:hover {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.2);
}

.account-menu-item:active {
  transform: translateY(1px);
}

.account-menu-item:last-child {
  color: rgba(132, 38, 35, 0.92);
}

.account-menu-item svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.login-view,
.account-page {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: clamp(16px, 3vw, 42px);
  background: rgba(184, 187, 192, 0.32);
  backdrop-filter: blur(28px) saturate(1.12);
  -webkit-backdrop-filter: blur(28px) saturate(1.12);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 260ms cubic-bezier(0.2, 0.8, 0.2, 1),
    backdrop-filter 260ms ease;
}

body.is-login-visible .login-view,
.account-page.is-open {
  opacity: 1;
  pointer-events: auto;
}

body.is-login-visible .scene {
  filter: blur(14px);
  opacity: 0.28;
  pointer-events: none;
  transform: scale(0.99);
}

body.is-mail-reader-open .scene {
  filter: blur(6px);
  opacity: 0.34;
  transform: scale(0.994);
}

body.is-mail-reader-open .mail-detail-panel.is-open {
  filter: blur(1px) saturate(0.86);
  opacity: 0.54;
}

.mail-detail-panel {
  position: fixed;
  top: clamp(18px, 3vw, 34px);
  right: clamp(14px, 2.4vw, 34px);
  bottom: clamp(18px, 3vw, 34px);
  z-index: 112;
  width: min(450px, calc(100vw - 28px));
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(100% + 28px)) scale(0.985);
  transition:
    opacity 240ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mail-detail-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) scale(1);
}

.mail-reader-panel {
  position: fixed;
  top: clamp(18px, 3vw, 34px);
  right: calc(clamp(14px, 2.4vw, 34px) + min(450px, calc(100vw - 28px)) + 16px);
  bottom: clamp(18px, 3vw, 34px);
  left: clamp(118px, 10vw, 170px);
  z-index: 113;
  opacity: 0;
  pointer-events: none;
  transform: translateX(48px) scale(0.985);
  transition:
    opacity 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mail-reader-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) scale(1);
}

.mail-reader-window {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0.17) 62%, rgba(255, 255, 255, 0.25)),
    rgba(238, 242, 247, 0.78);
  backdrop-filter: blur(42px) saturate(1.22) contrast(1.02);
  -webkit-backdrop-filter: blur(42px) saturate(1.22) contrast(1.02);
  box-shadow:
    0 38px 128px rgba(24, 29, 38, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.mail-reader-head {
  display: grid;
  gap: 6px;
  padding: 18px 20px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.mail-reader-head span {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-reader-head strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: 1.24rem;
  line-height: 1.22;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.mail-reader-content {
  min-height: 0;
  overflow: auto;
  padding: 18px 20px 20px;
  scrollbar-color: rgba(30, 34, 44, 0.26) transparent;
  scrollbar-width: thin;
}

.mail-reader-content::-webkit-scrollbar {
  width: 7px;
}

.mail-reader-content::-webkit-scrollbar-track {
  background: transparent;
}

.mail-reader-content::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(30, 34, 44, 0.2);
}

.mail-detail-window {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.44), rgba(255, 255, 255, 0.16) 62%, rgba(255, 255, 255, 0.24)),
    rgba(238, 242, 247, 0.72);
  backdrop-filter: blur(34px) saturate(1.18) contrast(1.02);
  -webkit-backdrop-filter: blur(34px) saturate(1.18) contrast(1.02);
  box-shadow:
    0 34px 110px rgba(24, 29, 38, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.mail-detail-head {
  display: block;
  padding: 18px 18px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.48);
}

.mail-detail-head strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: 1.16rem;
  line-height: 1.22;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.mail-detail-close {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 50%;
  color: var(--text);
  background: rgba(255, 255, 255, 0.22);
}

.mail-detail-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.mail-detail-content {
  min-height: 0;
  overflow: auto;
  padding: 16px 18px 18px;
}

.mail-open-card,
.mail-open-meta > div,
.mail-open-body {
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.08)),
    rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.mail-open-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.mail-open-meta span,
.mail-open-body span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.mail-open-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mail-open-meta > div {
  display: grid;
  min-height: 62px;
  align-content: center;
  padding: 11px;
}

.mail-open-meta strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.25;
}

.mail-open-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mail-open-labels span {
  --label-bg: rgba(255, 255, 255, 0.24);
  --label-border: rgba(255, 255, 255, 0.52);
  --label-fg: var(--text);
  --label-dot: rgba(42, 46, 58, 0.38);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--label-border);
  border-radius: 999px;
  color: var(--label-fg);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.35), transparent 64%),
    var(--label-bg);
  font-size: 0.76rem;
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    0 8px 18px rgba(24, 29, 38, 0.05);
}

.mail-open-labels span::before {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--label-dot);
  content: "";
}

.mail-open-labels span.is-unread {
  --label-bg: rgba(60, 132, 245, 0.14);
  --label-border: rgba(60, 132, 245, 0.34);
  --label-fg: rgb(24, 89, 188);
  --label-dot: rgba(60, 132, 245, 0.95);
}

.mail-open-labels span.is-important {
  --label-bg: rgba(220, 92, 88, 0.14);
  --label-border: rgba(220, 92, 88, 0.34);
  --label-fg: rgb(166, 54, 51);
  --label-dot: rgba(220, 92, 88, 0.92);
}

.mail-open-labels span.is-flagged {
  --label-bg: rgba(221, 159, 53, 0.15);
  --label-border: rgba(221, 159, 53, 0.36);
  --label-fg: rgb(137, 91, 24);
  --label-dot: rgba(221, 159, 53, 0.95);
}

.mail-open-labels span.is-replied {
  --label-bg: rgba(48, 153, 131, 0.14);
  --label-border: rgba(48, 153, 131, 0.34);
  --label-fg: rgb(25, 105, 90);
  --label-dot: rgba(48, 153, 131, 0.95);
}

.mail-open-labels span.is-read,
.mail-open-labels span.is-neutral {
  --label-bg: rgba(90, 99, 116, 0.1);
  --label-border: rgba(90, 99, 116, 0.22);
  --label-fg: rgba(42, 46, 58, 0.82);
  --label-dot: rgba(90, 99, 116, 0.54);
}

.mail-open-labels span.is-promotion {
  --label-bg: rgba(166, 114, 205, 0.13);
  --label-border: rgba(166, 114, 205, 0.3);
  --label-fg: rgb(105, 72, 139);
  --label-dot: rgba(166, 114, 205, 0.86);
}

.mail-open-labels span.is-update {
  --label-bg: rgba(65, 155, 186, 0.13);
  --label-border: rgba(65, 155, 186, 0.32);
  --label-fg: rgb(38, 101, 123);
  --label-dot: rgba(65, 155, 186, 0.9);
}

.mail-open-body {
  display: grid;
  gap: 9px;
  padding: 12px;
}

.mail-open-body {
  max-height: min(46vh, 440px);
  overflow: auto;
  cursor: pointer;
  scrollbar-color: rgba(30, 34, 44, 0.26) transparent;
  scrollbar-width: thin;
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.mail-open-body:hover,
.mail-open-body:focus-visible {
  border-color: rgba(60, 132, 245, 0.34);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.1)),
    rgba(235, 244, 255, 0.18);
  box-shadow:
    0 14px 34px rgba(60, 132, 245, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.58);
  outline: none;
  transform: translateY(-1px);
}

.mail-open-body::-webkit-scrollbar {
  width: 6px;
}

.mail-open-body::-webkit-scrollbar-track {
  background: transparent;
}

.mail-open-body::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(30, 34, 44, 0.2);
}

.mail-body-state {
  display: grid;
  gap: 8px;
  min-height: 128px;
  align-content: center;
  justify-items: center;
  padding: 18px;
  text-align: center;
}

.mail-body-state > span {
  display: block;
  width: 28px;
  height: 28px;
  border: 2px solid rgba(25, 27, 32, 0.12);
  border-top-color: rgba(42, 148, 255, 0.76);
  border-radius: 50%;
}

.mail-body-state.is-loading > span {
  animation: spin 850ms linear infinite;
}

.mail-body-state.is-error > span {
  border: 0;
  background: rgba(189, 106, 98, 0.75);
  box-shadow: 0 0 0 8px rgba(189, 106, 98, 0.12);
}

.mail-body-state strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.mail-body-state p {
  max-width: 28ch;
  margin: 0;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.46;
}

.mail-attachment-list span,
.mail-attachment-list em {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.63rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.mail-open-text {
  min-height: 180px;
  margin: 0;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--font-sans);
  font-size: 0.83rem;
  font-weight: 600;
  line-height: 1.62;
}

.mail-reader-text {
  min-height: calc(100dvh - 210px);
  margin: 0;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--font-sans);
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.76;
}

.mail-attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 4px;
}

.mail-open-link {
  display: inline-flex;
  justify-content: center;
  min-height: 38px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 999px;
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.12)),
    rgba(255, 255, 255, 0.18);
  font-size: 0.82rem;
  font-weight: 750;
  text-decoration: none;
  box-shadow:
    0 12px 28px rgba(45, 52, 64, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.mail-open-body p {
  margin: 0;
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.58;
}

.login-card,
.account-page-window {
  width: min(100%, 420px);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.06) 58%, rgba(255, 255, 255, 0.13)),
    rgba(238, 242, 247, 0.16);
  backdrop-filter: blur(42px) saturate(1.24) contrast(1.03);
  -webkit-backdrop-filter: blur(42px) saturate(1.24) contrast(1.03);
  box-shadow:
    0 40px 120px rgba(24, 29, 38, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -1px 0 rgba(255, 255, 255, 0.18);
  transform: translateY(16px) scale(0.985);
  transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

body.is-login-visible .login-card,
.account-page.is-open .account-page-window {
  transform: translateY(0) scale(1);
}

.login-card {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.login-brand,
.account-page-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.login-brand img,
.account-avatar img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.login-brand span,
.account-page-head span,
.account-section-head span,
.account-profile span,
.account-tile span {
  display: block;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.login-brand strong,
.account-page-head strong {
  font-size: 1rem;
}

.login-copy {
  display: grid;
  gap: 5px;
  padding: 10px 0 2px;
}

.login-copy h1 {
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  line-height: 0.96;
}

.login-copy p {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
}

.field-line {
  display: grid;
  gap: 8px;
}

.field-line span {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 650;
}

.field-line input {
  min-height: 48px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.3);
  padding: 0 14px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46);
}

.field-line input:focus {
  border-color: rgba(189, 106, 98, 0.48);
  background: rgba(255, 255, 255, 0.42);
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
}

.login-options label {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.login-options button {
  border: 0;
  color: var(--text);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 650;
}

.login-feedback {
  min-height: 18px;
  margin: -2px 0 0;
  color: rgba(189, 106, 98, 0.9);
  font-size: 0.78rem;
  font-weight: 650;
}

.login-submit {
  min-height: 50px;
  border: 1px solid rgba(17, 18, 22, 0.14);
  border-radius: 999px;
  color: #ffffff;
  background: rgba(17, 18, 22, 0.9);
  font-weight: 700;
  box-shadow: 0 18px 44px rgba(24, 29, 38, 0.18);
}

.account-page {
  z-index: 110;
}

.account-page-window {
  position: relative;
  display: grid;
  gap: 16px;
  width: min(100%, 620px);
  max-height: min(760px, calc(100dvh - 32px));
  overflow: auto;
  padding: 20px;
}

.account-avatar {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
}

.account-page-close {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  color: var(--text);
  background: rgba(255, 255, 255, 0.18);
}

.account-page-close svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.account-profile,
.account-tile,
.account-section {
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46);
}

.account-profile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 16px;
}

.account-profile strong {
  display: block;
  margin-top: 6px;
  font-size: 1.4rem;
  line-height: 1.05;
}

.account-profile p {
  margin: 0;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 650;
}

.account-grid {
  display: grid;
  grid-template-columns: minmax(132px, 0.62fr) minmax(0, 1.38fr);
  gap: 10px;
  align-items: stretch;
}

.account-tile {
  display: grid;
  gap: 12px;
  min-height: 126px;
  padding: 13px;
}

.account-tile strong {
  align-self: end;
  font-size: 1.05rem;
}

.account-section {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.account-access {
  min-height: 126px;
}

.account-access.is-admin-mode {
  cursor: pointer;
}

.account-access.is-admin-mode:hover,
.account-access.is-admin-mode:focus-visible {
  border-color: rgba(189, 106, 98, 0.48);
  background: rgba(255, 255, 255, 0.18);
  outline: none;
}

.account-section-head {
  display: grid;
  gap: 5px;
}

.access-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.access-list span,
.security-list button {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.22);
  font-size: 0.8rem;
  font-weight: 650;
}

.access-list span {
  padding: 0 11px;
}

.admin-access-list span {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.3);
}

.security-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.security-list button {
  justify-content: center;
  gap: 8px;
  padding: 0 10px;
}

.security-list button span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(189, 106, 98, 0.74);
}

.security-subpage {
  position: fixed;
  top: 50%;
  right: clamp(18px, 6vw, 118px);
  z-index: 4;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  width: min(390px, calc(100vw - 32px));
  max-height: min(720px, calc(100dvh - 32px));
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.14) 62%, rgba(255, 255, 255, 0.2)),
    rgba(238, 242, 247, 0.66);
  backdrop-filter: blur(30px) saturate(1.18) contrast(1.03);
  -webkit-backdrop-filter: blur(30px) saturate(1.18) contrast(1.03);
  box-shadow:
    0 30px 88px rgba(24, 29, 38, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  opacity: 0;
  pointer-events: none;
  transform: translate(112%, -50%) scale(0.985);
  transition:
    opacity 240ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.account-page.is-security-open .security-subpage {
  opacity: 1;
  pointer-events: auto;
  transform: translate(0, -50%) scale(1);
}

@media (min-width: 980px) {
  .account-page.is-security-open .account-page-window {
    transform: translateX(clamp(-250px, -18vw, -170px)) scale(1);
  }
}

.security-subhead {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.security-back {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 50%;
  color: var(--text);
  background: rgba(255, 255, 255, 0.16);
}

.security-back svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.security-subhead span {
  display: block;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.security-subhead strong {
  display: block;
  margin-top: 4px;
  font-size: 1.3rem;
  line-height: 1.05;
}

.security-subcontent {
  min-height: 0;
  overflow: auto;
}

.security-form,
.device-list,
.preference-list,
.admin-console,
.admin-console-block {
  display: grid;
  gap: 12px;
}

.security-form .field-line input {
  min-height: 46px;
}

.security-primary,
.device-action,
.preference-save {
  min-height: 42px;
  border: 1px solid rgba(17, 18, 22, 0.12);
  border-radius: 999px;
  color: #ffffff;
  background: rgba(17, 18, 22, 0.88);
  font-weight: 700;
}

.security-feedback {
  min-height: 20px;
  margin: 0;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 650;
}

.admin-console-block {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.14);
}

.admin-console-head {
  display: grid;
  gap: 5px;
}

.admin-console-head span,
.admin-role-grid span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.admin-console-head strong {
  color: var(--ink);
  font-size: 1rem;
}

.admin-row,
.admin-role-grid > button {
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.14);
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 62px;
  padding: 10px 11px;
}

.admin-row strong,
.admin-role-grid strong {
  display: block;
  color: var(--ink);
  font-size: 0.9rem;
}

.admin-row p {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 600;
}

.admin-row > button {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.24);
  font-size: 0.68rem;
  font-weight: 760;
  cursor: pointer;
}

.admin-row.is-primary > button {
  color: #1f684a;
  background: rgba(222, 243, 232, 0.82);
}

.admin-row.is-disabled {
  opacity: 0.58;
}

.admin-role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.admin-role-grid > button {
  display: grid;
  gap: 7px;
  min-height: 72px;
  align-content: center;
  padding: 10px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.admin-role-grid > button:hover,
.admin-role-grid > button:focus-visible,
.admin-row > button:hover,
.admin-row > button:focus-visible {
  border-color: rgba(57, 77, 96, 0.28);
  background: rgba(255, 255, 255, 0.36);
  outline: none;
}

.admin-role-grid em {
  color: var(--muted);
  font-size: 0.64rem;
  font-style: normal;
  font-weight: 650;
}

.admin-editor-form select {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.32);
  font: inherit;
}

.admin-status-toggle {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
}

.admin-status-toggle input,
.admin-permission-grid input {
  accent-color: #20252c;
}

.admin-permission-fieldset {
  min-width: 0;
  margin: 0;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 8px;
}

.admin-permission-fieldset legend {
  padding: 0 5px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 760;
}

.admin-permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.admin-permission-grid label {
  display: flex;
  min-width: 0;
  min-height: 34px;
  gap: 7px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.7rem;
  font-weight: 650;
}

.admin-editor-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 8px;
}

.admin-editor-actions > button {
  min-height: 42px;
  border: 1px solid rgba(17, 18, 22, 0.14);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.3);
  font-weight: 720;
}

.admin-editor-actions > .security-primary {
  color: #fff;
  background: rgba(17, 18, 22, 0.88);
}

.device-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 70px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.14);
}

.device-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.16);
}

.device-mark span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(189, 106, 98, 0.74);
}

.device-row strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.94rem;
}

.device-row p {
  margin: 0;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
}

.device-action {
  min-height: 34px;
  padding: 0 12px;
  background: rgba(17, 18, 22, 0.72);
  font-size: 0.78rem;
}

.device-row.is-current .device-action {
  color: var(--text);
  background: rgba(255, 255, 255, 0.18);
}

.preference-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 64px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.14);
}

.preference-toggle strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.92rem;
}

.preference-toggle em {
  display: block;
  color: var(--text);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 600;
}

.preference-toggle input {
  appearance: none;
  position: relative;
  width: 46px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  transition: background-color 180ms ease;
}

.preference-toggle input::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(17, 18, 22, 0.72);
  content: "";
  transition: transform 180ms ease, background-color 180ms ease;
}

.preference-toggle input:checked {
  background: rgba(189, 106, 98, 0.34);
}

.preference-toggle input:checked::after {
  background: rgba(189, 106, 98, 0.9);
  transform: translateX(18px);
}

.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  background: rgba(17, 18, 22, 0.022);
  opacity: 0;
  transition: opacity 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.side-drawer {
  position: fixed;
  top: clamp(14px, 2.4vw, 34px);
  left: calc((100vw - min(100vw, 1480px)) / 2 + clamp(14px, 2.4vw, 34px) + 90px);
  z-index: 50;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(300px, calc(100vw - 124px));
  max-height: calc(100dvh - clamp(28px, 4.8vw, 68px));
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 26px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.018) 58%, rgba(255, 255, 255, 0.045)),
    rgba(238, 242, 247, 0.045);
  backdrop-filter: blur(54px) saturate(1.36) contrast(1.04);
  -webkit-backdrop-filter: blur(54px) saturate(1.36) contrast(1.04);
  box-shadow:
    0 30px 92px rgba(24, 29, 38, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(255, 255, 255, 0.1);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-18px) scale(0.985);
  transform-origin: left center;
  transition:
    opacity 260ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.scene.is-drawer-open .drawer-scrim {
  pointer-events: auto;
  opacity: 1;
}

.scene.is-drawer-open .side-drawer {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) scale(1);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.drawer-head span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.drawer-head strong {
  font-size: 1.08rem;
  line-height: 1.1;
}

.drawer-close {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.drawer-close svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.drawer-nav {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  overflow-y: auto;
}

.drawer-group {
  display: grid;
  gap: 6px;
}

.drawer-item {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 54px;
  padding: 6px 12px 6px 6px;
  border: 1px solid transparent;
  border-radius: 18px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.024);
  text-align: left;
  transition:
    color 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
  transform 180ms ease;
}

.drawer-group.has-subitems > .drawer-item {
  padding-right: 34px;
}

.drawer-group.has-subitems > .drawer-item::after {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 7px;
  height: 7px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  content: "";
  opacity: 0.62;
  transform: translateY(-58%) rotate(45deg);
  transition:
    opacity 180ms ease,
    transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.drawer-group.is-expanded > .drawer-item::after {
  opacity: 0.92;
  transform: translateY(-34%) rotate(225deg);
}

.drawer-item:hover {
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.09);
}

.drawer-item.is-active {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(17, 18, 22, 0.42);
  backdrop-filter: blur(24px) saturate(1.12);
  -webkit-backdrop-filter: blur(24px) saturate(1.12);
}

.drawer-item.is-active .drawer-icon {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.drawer-subitems {
  display: grid;
  gap: 7px;
  max-height: 0;
  margin: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition:
    max-height 320ms cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 220ms ease,
    transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1),
    margin 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.drawer-group.is-expanded .drawer-subitems {
  max-height: 180px;
  margin: 0 0 6px;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.drawer-subitem {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 0 14px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 18px;
  color: rgba(43, 49, 58, 0.92);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.035)),
    rgba(58, 66, 78, 0.095);
  font-size: 0.9rem;
  font-weight: 650;
  letter-spacing: 0;
  text-align: left;
  transition:
    color 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.drawer-subicon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 14px;
  background: rgba(45, 52, 64, 0.1);
}

.drawer-subicon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.drawer-subitem:hover {
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.42);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06)),
    rgba(58, 66, 78, 0.14);
}

.drawer-subitem.is-active {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.03)),
    rgba(17, 18, 22, 0.58);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 12px 28px rgba(24, 29, 38, 0.08);
}

.drawer-subitem.is-active .drawer-subicon {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.13);
}

.drawer-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
}

.drawer-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.glass-window {
  min-width: 0;
  min-height: calc(100dvh - clamp(28px, 4.8vw, 68px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 30px;
  background: rgba(241, 243, 246, 0.46);
  backdrop-filter: blur(34px) saturate(1.08);
  box-shadow:
    0 46px 130px rgba(24, 29, 38, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.stage {
  padding: clamp(18px, 2.4vw, 34px);
}

.journey-board {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 330px);
  gap: 18px;
  align-items: stretch;
  min-height: max(620px, calc(100dvh - clamp(112px, 12vw, 152px)));
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.journey-board.is-detail-hidden {
  grid-template-columns: minmax(0, 1fr);
}

.flow-backbone {
  position: absolute;
  inset: 124px 365px 118px 32px;
  pointer-events: none;
}

.flow-backbone span {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(67, 76, 93, 0.24), transparent);
}

.flow-backbone span:nth-child(1) {
  top: 8%;
}

.flow-backbone span:nth-child(2) {
  top: 44%;
}

.flow-backbone span:nth-child(3) {
  top: 80%;
}

.module-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: minmax(150px, auto);
  gap: 14px;
  align-content: start;
}

.module-card {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto auto;
  min-height: 150px;
  padding: 14px;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.06) 54%, rgba(255, 255, 255, 0.12)),
    var(--glass);
  backdrop-filter: blur(34px) saturate(1.28) contrast(1.03);
  -webkit-backdrop-filter: blur(34px) saturate(1.28) contrast(1.03);
  text-align: left;
  box-shadow:
    0 22px 58px rgba(35, 43, 55, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 0 -1px 0 rgba(255, 255, 255, 0.22);
  opacity: 0;
  transform: translateY(12px);
  animation: cardIn 420ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.module-card::before {
  position: absolute;
  top: 13px;
  right: 13px;
  z-index: 3;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
  opacity: 0.58;
}

.module-card::after {
  position: absolute;
  inset: 1px;
  z-index: 1;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.46), transparent 30%),
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.38), transparent 28%),
    linear-gradient(180deg, transparent 58%, rgba(255, 255, 255, 0.1));
  content: "";
  opacity: 0.72;
}

.module-card > * {
  position: relative;
  z-index: 2;
}

.module-card:hover,
.module-card.is-active {
  border-color: rgba(189, 106, 98, 0.52);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.08) 58%, rgba(255, 255, 255, 0.16)),
    var(--glass-strong);
  box-shadow:
    0 30px 76px rgba(39, 46, 57, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    inset 0 -1px 0 rgba(255, 255, 255, 0.28);
  transform: translateY(-2px);
}

.module-card.is-hidden {
  display: none;
}

.module-card[data-module="tiktok"] {
  grid-column: 1 / span 4;
  grid-row: 1;
}

.module-card[data-module="finance"] {
  grid-column: 1 / span 4;
  grid-row: 2;
}

.module-card[data-module="apps"] {
  grid-column: 1 / span 4;
  grid-row: 3;
}

.module-card[data-module="people"] {
  grid-column: 1 / span 4;
  grid-row: 4;
}

.module-card[data-module="content"] {
  grid-column: 5 / span 4;
  grid-row: 1;
}

.module-card[data-module="support"] {
  grid-column: 5 / span 4;
  grid-row: 2;
}

.module-card[data-module="mail"] {
  grid-column: 5 / span 4;
  grid-row: 4;
}

.module-card[data-module="research"] {
  grid-column: 9 / span 4;
  grid-row: 2 / span 2;
  min-height: 314px;
  align-content: center;
}

.module-card h3 {
  margin: 8px 0 10px;
  color: var(--text);
  font-size: clamp(0.92rem, 1.05vw, 1.08rem);
  font-weight: 650;
  line-height: 1.15;
  text-align: center;
}

.module-symbol {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  justify-self: center;
  align-self: center;
  margin: 8px 0 4px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 26px;
  color: rgba(23, 25, 29, 0.82);
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.18) 62%),
    rgba(255, 255, 255, 0.28);
  box-shadow:
    0 16px 38px rgba(42, 48, 58, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.module-symbol svg {
  width: 42px;
  height: 42px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.1;
}

.module-card[data-module="research"] .module-symbol {
  width: 96px;
  height: 96px;
  border-radius: 32px;
}

.module-card[data-module="research"] .module-symbol svg {
  width: 52px;
  height: 52px;
}

.module-ports {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  margin-top: 12px;
}

.module-ports span {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
}

.module-ports span:nth-child(2) {
  background: rgba(187, 218, 245, 0.74);
}

.module-ports span:nth-child(4) {
  background: rgba(241, 126, 126, 0.68);
}

.dashboard-canvas {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 0;
  min-height: 0;
}

.bi-shell {
  display: grid;
  gap: 14px;
  min-height: 100%;
  opacity: 0;
  transform: translateY(12px);
  animation: cardIn 420ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.bi-head,
.metric-card,
.bi-panel {
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.07) 58%, rgba(255, 255, 255, 0.13)),
    rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(34px) saturate(1.26) contrast(1.03);
  -webkit-backdrop-filter: blur(34px) saturate(1.26) contrast(1.03);
  box-shadow:
    0 22px 58px rgba(35, 43, 55, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    inset 0 -1px 0 rgba(255, 255, 255, 0.2);
}

.bi-head {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 92px;
  padding: 14px;
  border-radius: 8px;
}

.bi-module-icon {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 22px;
  color: rgba(23, 25, 29, 0.84);
  background:
    radial-gradient(circle at 30% 18%, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.18) 64%),
    rgba(255, 255, 255, 0.24);
}

.bi-module-icon svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.bi-title {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.bi-title span,
.panel-head span,
.metric-card em {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.bi-title strong {
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1.05;
}

.bi-state {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-self: end;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.26);
  font-size: 0.78rem;
  font-weight: 650;
}

.bi-state span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(189, 106, 98, 0.8);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  display: grid;
  min-height: 112px;
  padding: 14px;
  border-radius: 8px;
}

.metric-card span {
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 650;
}

.metric-card strong {
  align-self: end;
  color: var(--ink);
  font-size: clamp(1.45rem, 2.2vw, 2.15rem);
  line-height: 1;
}

.metric-card em {
  align-self: end;
}

.bi-main-grid,
.bi-bottom-grid {
  display: grid;
  gap: 14px;
}

.bi-main-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(230px, 0.65fr);
}

.bi-bottom-grid {
  grid-template-columns: minmax(0, 1fr) minmax(230px, 0.5fr);
}

.mail-top-grid,
.mail-list-grid {
  display: grid;
  gap: 14px;
}

.mail-sync-toolbar {
  display: flex;
  min-height: 34px;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.mail-sync-state {
  display: flex;
  min-width: 0;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 800;
}

.mail-sync-state em {
  padding: 4px 6px;
  border-radius: 4px;
  color: #725820;
  background: rgba(236, 207, 137, 0.24);
  font-style: normal;
}

.mail-live-refresh {
  min-width: 62px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 7px;
  color: #fff;
  background: rgba(23, 25, 29, 0.9);
  font: 800 0.68rem/1 var(--font-ui);
  cursor: pointer;
}

.mail-live-refresh:disabled {
  cursor: wait;
  opacity: 0.72;
}

.mail-live-refresh.is-refreshing {
  background-image: linear-gradient(110deg, rgba(23, 25, 29, 0.9) 20%, rgba(86, 98, 113, 0.92) 48%, rgba(23, 25, 29, 0.9) 76%);
  background-size: 220% 100%;
  animation: sheenMove 1.4s ease-in-out infinite;
}

.mail-list-grid {
  grid-template-columns: 1fr;
}

.bi-panel {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border-radius: 8px;
}

.bi-panel::after {
  position: absolute;
  inset: 1px;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.42), transparent 30%),
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.3), transparent 30%);
  content: "";
}

.bi-panel > * {
  position: relative;
  z-index: 1;
}

.bi-panel-large {
  display: grid;
  min-height: 268px;
}

.panel-head {
  display: grid;
  gap: 5px;
}

.panel-head strong {
  font-size: 1rem;
  line-height: 1.1;
}

.bar-visual {
  position: relative;
  display: flex;
  align-items: end;
  gap: clamp(8px, 1.2vw, 14px);
  height: 190px;
  padding: 20px 8px 4px;
}

.bar-visual span {
  flex: 1 1 0;
  min-width: 16px;
  max-width: 48px;
  border-radius: 999px 999px 5px 5px;
  background:
    linear-gradient(180deg, rgba(241, 126, 126, 0.82), rgba(187, 218, 245, 0.74)),
    rgba(255, 255, 255, 0.28);
  box-shadow:
    0 12px 24px rgba(73, 83, 98, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.visual-baseline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 2px;
}

.visual-baseline span {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
}

.bi-panel-focus {
  display: grid;
  gap: 18px;
  align-content: start;
  min-height: 268px;
}

.detail-lines {
  display: grid;
  gap: 14px;
}

.detail-line {
  display: grid;
  gap: 8px;
}

.detail-line i {
  display: block;
  width: var(--line-size);
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(187, 218, 245, 0.82), rgba(241, 126, 126, 0.7));
}

.detail-line span {
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 650;
}

.ring-visual {
  display: grid;
  width: min(180px, 100%);
  aspect-ratio: 1;
  margin: 6px auto 2px;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(241, 243, 246, 0.88) 0 52%, transparent 53%),
    conic-gradient(rgba(241, 126, 126, 0.78) 0 var(--ring-value), rgba(187, 218, 245, 0.62) var(--ring-value) 100%);
  box-shadow:
    0 18px 44px rgba(35, 43, 55, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.64);
}

.ring-visual span {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.34);
  font-size: 1.22rem;
  font-weight: 700;
}

.chart-legend {
  display: grid;
  gap: 8px;
}

.legend-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 30px;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 650;
}

.legend-row i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(189, 106, 98, 0.72);
}

.legend-row:nth-child(even) i {
  background: rgba(139, 185, 224, 0.74);
}

.legend-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-row b {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
}

.placeholder-table {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.placeholder-row {
  display: grid;
  grid-template-columns: minmax(88px, 0.8fr) minmax(90px, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
}

.placeholder-row span {
  overflow: hidden;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.placeholder-row i {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
}

.placeholder-row b {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
}

.action-dots {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.action-dots button {
  display: flex;
  gap: 9px;
  align-items: center;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.82rem;
  font-weight: 650;
}

.action-dots button span {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(189, 106, 98, 0.74);
}

.mail-message-list,
.mail-source-grid {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.mail-source-grid {
  gap: 8px;
  margin-top: 10px;
}

.mail-source-panel .mail-source-grid {
  margin-top: 0;
}

.mail-list-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: clamp(430px, 58vh, 720px);
}

.mail-list-toolbar {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 220px);
  gap: 10px;
  align-items: stretch;
  margin-top: 12px;
}

.mailbox-current {
  display: grid;
  min-width: 0;
  min-height: 60px;
  align-content: center;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.06)),
    rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.mailbox-current > span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.mailbox-current strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mailbox-current em {
  overflow: hidden;
  color: var(--text);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mailbox-select {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 60px;
  padding: 0;
  cursor: pointer;
}

.mailbox-select::after {
  position: absolute;
  right: 13px;
  width: 8px;
  height: 8px;
  border-right: 1.8px solid rgba(23, 27, 34, 0.64);
  border-bottom: 1.8px solid rgba(23, 27, 34, 0.64);
  content: "";
  pointer-events: none;
  transform: rotate(45deg) translateY(-2px);
}

.mailbox-select select {
  appearance: none;
  min-width: 0;
  width: 100%;
  min-height: 60px;
  padding: 0 34px 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.08)),
    rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
  font-size: 0.82rem;
  font-weight: 800;
  outline: none;
  cursor: pointer;
}

.mailbox-select select:focus {
  border-color: rgba(40, 138, 255, 0.56);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.12)),
    rgba(255, 255, 255, 0.18);
}

.mail-list-controls {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: max-content minmax(220px, 1fr);
  gap: 10px;
  align-items: center;
}

.mail-filter-toggle {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(78px, 1fr));
  gap: 4px;
  min-height: 42px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.08)),
    rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.mail-filter-toggle button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  border: 0;
  border-radius: 999px;
  color: var(--text);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  transition:
    color var(--duration) var(--ease),
    background var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease);
}

.mail-filter-toggle button b {
  display: inline-grid;
  min-width: 22px;
  min-height: 20px;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  color: inherit;
  background: rgba(255, 255, 255, 0.24);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 800;
}

.mail-filter-toggle button.is-active {
  color: #fff;
  background:
    linear-gradient(145deg, rgba(30, 34, 42, 0.82), rgba(9, 12, 17, 0.66)),
    rgba(13, 16, 22, 0.64);
  box-shadow:
    0 10px 20px rgba(22, 28, 36, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.mail-search-box {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  min-width: 0;
  padding: 0 10px 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.06)),
    rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.mail-search-box i {
  position: relative;
  width: 14px;
  height: 14px;
  border: 1.8px solid rgba(42, 48, 58, 0.62);
  border-radius: 50%;
}

.mail-search-box i::after {
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 7px;
  height: 1.8px;
  border-radius: 999px;
  background: rgba(42, 48, 58, 0.62);
  content: "";
  transform: rotate(45deg);
  transform-origin: left center;
}

.mail-search-box input {
  min-width: 0;
  width: 100%;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 750;
  outline: none;
}

.mail-search-box input::placeholder {
  color: rgba(82, 91, 105, 0.7);
}

.mail-search-box input::-webkit-search-cancel-button {
  display: none;
}

.mail-search-box button {
  position: relative;
  appearance: none;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 50%;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.08)),
    rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

.mail-search-box button::before,
.mail-search-box button::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 1.7px;
  border-radius: 999px;
  background: rgba(40, 46, 56, 0.72);
  content: "";
}

.mail-search-box button::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.mail-search-box button::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.mail-source-grid {
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.mail-source-grid::-webkit-scrollbar {
  display: none;
}

.mail-message-list {
  position: relative;
  z-index: 1;
  max-height: clamp(330px, 46vh, 610px);
  overflow-y: auto;
  padding-right: 4px;
  overscroll-behavior: contain;
  scrollbar-color: rgba(30, 34, 44, 0.28) transparent;
  scrollbar-width: thin;
}

.mail-message-list::-webkit-scrollbar {
  width: 6px;
}

.mail-message-list::-webkit-scrollbar-track {
  background: transparent;
}

.mail-message-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(30, 34, 44, 0.22);
}

.mail-message-row,
.mail-source-card,
.mail-empty {
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06)),
    rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.mail-message-row {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: center;
  min-height: 58px;
  padding: 7px 12px;
  color: inherit;
  text-align: left;
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.mail-message-row:hover,
.mail-message-row:focus-visible,
.mail-message-row.is-open {
  border-color: rgba(255, 255, 255, 0.7);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.12)),
    rgba(255, 255, 255, 0.24);
  box-shadow:
    0 10px 24px rgba(45, 52, 64, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.56);
  transform: translateY(-1px);
}

.mail-message-row:focus-visible {
  outline: 2px solid rgba(40, 138, 255, 0.84);
  outline-offset: 2px;
}

.mail-message-row.is-unread::before {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(42, 148, 255, 0.88);
  box-shadow: 0 0 0 3px rgba(42, 148, 255, 0.12);
  content: "";
}

.mail-message-main {
  appearance: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 3px 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.mail-message-main:focus-visible {
  outline: 2px solid rgba(40, 138, 255, 0.74);
  outline-offset: 5px;
}

.mail-message-row strong,
.mail-source-card span {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-source-card span {
  font-weight: 800;
}

.mail-message-row p,
.mail-source-card em {
  display: block;
  overflow: hidden;
  margin: 5px 0 0;
  color: var(--text);
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-message-main > span,
.mail-source-card strong {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.mail-source-card small {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 750;
}

.mail-source-card {
  display: grid;
  gap: 4px;
  min-height: 48px;
  min-width: 130px;
  align-content: center;
  padding: 8px 12px;
  text-align: left;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.mail-source-card:hover,
.mail-source-card.is-active {
  border-color: rgba(255, 255, 255, 0.62);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.12)),
    rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.mail-empty {
  display: grid;
  min-height: 210px;
  place-items: center;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
}

.support-dashboard {
  gap: 12px;
}

.support-live-link {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  color: #ffffff;
  background:
    linear-gradient(145deg, rgba(30, 34, 42, 0.82), rgba(9, 12, 17, 0.66)),
    rgba(13, 16, 22, 0.64);
  box-shadow:
    0 14px 28px rgba(22, 28, 36, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  font-size: 0.8rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.support-main-grid {
  display: grid;
  gap: 14px;
}

.support-main-grid {
  grid-template-columns: minmax(0, 1fr);
}

.support-live-panel,
.support-state-panel {
  min-height: 0;
}

.support-live-head {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.support-live-head > div {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.support-live-head .support-live-link {
  justify-self: end;
}

.support-state-bar {
  display: grid;
  grid-template-columns: minmax(132px, 0.22fr) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 86px;
}

.support-conversation-list,
.support-state-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.support-state-bar .support-state-list {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 0;
}

.support-conversation-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  min-height: 68px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06)),
    rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.support-conversation-row strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-conversation-row p {
  display: block;
  overflow: hidden;
  margin: 5px 0 0;
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-platform,
.support-status {
  display: inline-grid;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.support-platform {
  min-width: 58px;
  padding: 0 10px;
  color: #ffffff;
  background: rgba(23, 25, 29, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.support-platform.is-wechat {
  background: rgba(34, 150, 87, 0.82);
}

.support-platform.is-rednote {
  background: rgba(213, 55, 66, 0.8);
}

.support-platform.is-douyin {
  background: rgba(24, 26, 30, 0.86);
}

.support-platform.is-agent {
  background: rgba(49, 90, 122, 0.82);
}

.support-status {
  min-width: 62px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  color: var(--text);
  background: rgba(255, 255, 255, 0.2);
}

.support-status.is-success {
  color: #1f684a;
  background: rgba(222, 243, 232, 0.8);
}

.support-status.is-info {
  color: #315a7a;
  background: rgba(227, 239, 247, 0.82);
}

.support-status.is-warn {
  color: #776433;
  background: rgba(247, 239, 214, 0.82);
}

.support-status.is-neutral {
  color: rgba(61, 68, 80, 0.82);
  background: rgba(255, 255, 255, 0.28);
}

.support-live-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: clamp(620px, 78dvh, 860px);
}

.support-live-frame {
  position: relative;
  min-height: clamp(540px, calc(78dvh - 82px), 780px);
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.06)),
    rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.support-live-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: clamp(540px, calc(78dvh - 82px), 780px);
  border: 0;
  background: #f7f7f5;
}

.support-state-list div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 39px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
}

.support-state-list span {
  overflow: hidden;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-detail-entry {
  cursor: default;
}

.detail-panel.is-support-module .chip-list {
  align-content: flex-start;
  align-items: flex-start;
}

.detail-panel.is-support-module .source-chip {
  flex: 0 0 auto;
}

.people-dashboard {
  align-content: start;
}

.people-dashboard-head {
  min-height: 86px;
}

.people-live-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  min-height: min(650px, calc(100dvh - 188px));
}

.people-live-head {
  display: grid;
  grid-template-areas: "title metrics refresh";
  grid-template-columns: minmax(132px, 0.22fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.people-live-title {
  grid-area: title;
  min-width: 0;
}

.people-live-title span,
.people-live-title em,
.people-live-status span,
.people-row.is-head span,
.people-source span,
.people-source em {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0;
}

.people-live-title strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1.1;
}

.people-live-title em {
  display: block;
  margin-top: 6px;
}

.people-live-refresh {
  grid-area: refresh;
  justify-self: end;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 999px;
  color: #ffffff;
  background:
    linear-gradient(145deg, rgba(30, 34, 42, 0.86), rgba(9, 12, 17, 0.68)),
    rgba(13, 16, 22, 0.64);
  font-size: 0.8rem;
  font-weight: 800;
}

.people-live-refresh:disabled {
  cursor: wait;
  opacity: 0.68;
}

.people-live-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 34px;
}

.people-live-status b {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  color: #173c2d;
  background: rgba(183, 232, 210, 0.52);
  font-size: 0.76rem;
}

.people-live-status.is-loading b {
  color: #5e4d17;
  background: rgba(246, 218, 114, 0.42);
}

.people-live-status.is-error b {
  color: #7c1d27;
  background: rgba(231, 94, 104, 0.24);
}

.people-metric-grid {
  grid-area: metrics;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
  gap: 8px;
  min-width: 0;
}

.people-metric-card {
  min-height: 76px;
  padding: 11px 12px;
}

.people-metric-card span {
  font-size: 0.72rem;
  line-height: 1.2;
}

.people-metric-card strong {
  font-size: clamp(1.08rem, 1.28vw, 1.46rem);
}

.people-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.28fr);
  gap: 12px;
  align-items: stretch;
  height: clamp(500px, calc(100dvh - 132px), 620px);
  min-height: 0;
}

.people-table-panel,
.people-source-panel {
  min-width: 0;
  min-height: 0;
}

.people-table-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.people-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 9px;
  align-items: center;
  margin-bottom: 10px;
}

.people-filter-group,
.people-sort-group {
  display: flex;
  min-width: 0;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
}

.people-filter-group::-webkit-scrollbar,
.people-sort-group::-webkit-scrollbar {
  display: none;
}

.people-filter-group button,
.people-sort-group button,
.people-visible-count {
  flex: 0 0 auto;
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.people-filter-group button b {
  display: grid;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
  font-family: var(--font-mono);
  font-size: 0.66rem;
}

.people-filter-group button.is-active,
.people-sort-group button.is-active {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(17, 18, 22, 0.78);
}

.people-filter-group button.is-active b {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
}

.people-visible-count {
  color: var(--muted);
  font-family: var(--font-mono);
}

.people-table {
  display: grid;
  min-height: 0;
  align-self: stretch;
  max-height: none;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
}

.people-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.2fr) minmax(104px, 0.6fr) minmax(86px, 0.46fr) minmax(98px, 0.5fr) minmax(132px, 0.72fr) minmax(154px, 0.82fr);
  min-width: 820px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.34);
}

.people-row:last-child {
  border-bottom: 0;
}

.people-row > span {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 4px;
  padding: 10px 11px;
}

.people-row strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.people-row em {
  overflow: hidden;
  color: var(--text);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.people-row.is-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(232, 236, 241, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.people-person-cell strong {
  font-size: 0.94rem;
}

.people-tags-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-content: center;
}

.people-tags-cell b {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 7px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.24);
  font-size: 0.68rem;
  font-weight: 800;
}

.people-source-strip {
  display: grid;
  gap: 8px;
}

.people-source {
  display: grid;
  min-height: 68px;
  align-content: center;
  gap: 5px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
}

.people-source strong {
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.15;
}

.people-source.is-ready strong,
.people-source.is-partial strong {
  color: #1f684a;
}

.people-source.is-error strong {
  color: #7c1d27;
}

.people-empty,
.people-loading {
  display: grid;
  align-content: center;
  min-height: 220px;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
}

.people-empty strong {
  color: var(--ink);
  font-size: 1rem;
}

.people-empty span {
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.5;
}

.people-loading {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.people-loading span {
  height: 72px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.18));
  background-size: 220% 100%;
  animation: sheenMove 1.4s ease-in-out infinite;
}

.shangqi-dashboard {
  gap: 12px;
  align-content: start;
  grid-template-rows: auto auto;
  position: relative;
}

.shangqi-dashboard.is-ambient-drawer {
  gap: 12px;
  grid-template-rows: minmax(0, 1fr);
  opacity: 1;
  transform: none;
  animation: none;
}

.shangqi-live-panel {
  display: grid;
  grid-template-rows: auto auto;
  align-content: start;
  align-self: start;
  gap: 0;
  min-height: 0;
  padding-top: 4px;
  overflow: hidden;
}

.shangqi-live-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.shangqi-live-head span,
.shangqi-live-meta span,
.shangqi-live-status span,
.shangqi-live-row.is-head span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0;
}

.shangqi-live-head strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1.1;
}

.shangqi-live-refresh {
  justify-self: end;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 999px;
  color: #ffffff;
  background:
    linear-gradient(145deg, rgba(30, 34, 42, 0.86), rgba(9, 12, 17, 0.68)),
    rgba(13, 16, 22, 0.64);
  font-size: 0.8rem;
  font-weight: 800;
}

.shangqi-live-refresh:disabled {
  cursor: wait;
  opacity: 0.68;
}

.shangqi-live-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 38px;
}

.shangqi-live-status b {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  color: #173c2d;
  background: rgba(183, 232, 210, 0.52);
  font-size: 0.76rem;
}

.shangqi-live-status.is-loading b {
  color: #5e4d17;
  background: rgba(246, 218, 114, 0.42);
}

.shangqi-live-status.is-error b {
  color: #7c1d27;
  background: rgba(231, 94, 104, 0.24);
}

.shangqi-live-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.shangqi-live-meta div {
  min-width: 0;
  min-height: 72px;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
}

.shangqi-live-meta strong {
  display: block;
  overflow: hidden;
  margin-top: 8px;
  color: var(--ink);
  font-size: 0.95rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shangqi-live-table {
  display: grid;
  min-height: 0;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
}

.shangqi-live-row {
  display: grid;
  grid-template-columns: repeat(var(--shangqi-live-columns, 6), minmax(120px, 1fr));
  min-width: max-content;
  border-bottom: 1px solid rgba(255, 255, 255, 0.34);
}

.shangqi-live-row:last-child {
  border-bottom: 0;
}

.shangqi-live-row span {
  overflow: hidden;
  min-width: 0;
  padding: 10px 11px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shangqi-live-row.is-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(232, 236, 241, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.shangqi-live-empty,
.shangqi-live-error,
.shangqi-live-loading {
  display: grid;
  align-content: center;
  justify-items: start;
  min-height: 180px;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
}

.shangqi-live-empty strong,
.shangqi-live-error strong {
  color: var(--ink);
  font-size: 1rem;
}

.shangqi-live-empty span,
.shangqi-live-error span {
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.5;
}

.shangqi-live-loading {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.shangqi-live-loading span {
  height: 52px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.18));
  background-size: 220% 100%;
  animation: sheenMove 1.4s ease-in-out infinite;
}

.shangqi-snapshot-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: max-content;
  align-items: start;
  align-content: start;
  min-height: 0;
  gap: 12px;
  overflow: auto;
}

.shangqi-snapshot-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(132px, 168px));
  gap: 10px;
  align-content: start;
  justify-content: start;
}

.shangqi-snapshot-metric,
.shangqi-snapshot-card {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.13);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.16);
}

.shangqi-snapshot-metric {
  --metric-tint: rgba(255, 255, 255, 0.13);
  --metric-line: rgba(255, 255, 255, 0.44);
  --metric-ink: var(--ink);
  position: relative;
  display: grid;
  align-content: space-between;
  min-height: 78px;
  gap: 8px;
  overflow: hidden;
  padding: 10px;
  border-color: var(--metric-line);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.08) 62%),
    var(--metric-tint);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.24),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.shangqi-snapshot-metric::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: var(--metric-line);
  content: "";
}

.shangqi-snapshot-metric:nth-child(1) {
  --metric-tint: rgba(112, 161, 205, 0.18);
  --metric-line: rgba(79, 128, 174, 0.52);
  --metric-ink: #173954;
}

.shangqi-snapshot-metric:nth-child(2) {
  --metric-tint: rgba(111, 177, 139, 0.18);
  --metric-line: rgba(62, 139, 93, 0.5);
  --metric-ink: #1f5539;
}

.shangqi-snapshot-metric:nth-child(3) {
  --metric-tint: rgba(196, 167, 91, 0.2);
  --metric-line: rgba(164, 127, 39, 0.48);
  --metric-ink: #654c17;
}

.shangqi-snapshot-metric:nth-child(4) {
  --metric-tint: rgba(189, 106, 98, 0.17);
  --metric-line: rgba(177, 84, 76, 0.46);
  --metric-ink: #72342d;
}

.shangqi-snapshot-metric:nth-child(5) {
  --metric-tint: rgba(94, 161, 155, 0.18);
  --metric-line: rgba(54, 134, 128, 0.48);
  --metric-ink: #1d5651;
}

.shangqi-snapshot-metric:nth-child(6) {
  --metric-tint: rgba(145, 135, 170, 0.18);
  --metric-line: rgba(104, 94, 138, 0.44);
  --metric-ink: #4b416d;
}

.shangqi-snapshot-metric:nth-child(7) {
  --metric-tint: rgba(143, 159, 103, 0.18);
  --metric-line: rgba(105, 127, 68, 0.46);
  --metric-ink: #43542c;
}

.shangqi-snapshot-metric:nth-child(8) {
  --metric-tint: rgba(178, 135, 97, 0.18);
  --metric-line: rgba(143, 98, 58, 0.46);
  --metric-ink: #604326;
}

.shangqi-snapshot-metric:nth-child(9) {
  --metric-tint: rgba(103, 119, 137, 0.16);
  --metric-line: rgba(74, 91, 111, 0.42);
  --metric-ink: #344254;
}

.shangqi-snapshot-metric span,
.shangqi-snapshot-section-head span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.25;
}

.shangqi-snapshot-metric strong {
  color: var(--metric-ink);
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1;
}

.shangqi-usage-chart {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 10px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 8px;
  color: inherit;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.07) 60%),
    rgba(219, 228, 237, 0.22);
  box-shadow:
    0 16px 42px rgba(38, 49, 64, 0.08),
    inset 0 1px rgba(255, 255, 255, 0.62);
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
  backdrop-filter: blur(30px) saturate(1.16);
  -webkit-backdrop-filter: blur(30px) saturate(1.16);
}

.shangqi-usage-chart:hover,
.shangqi-usage-chart:focus-visible {
  border-color: rgba(38, 59, 85, 0.3);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.44), rgba(255, 255, 255, 0.1) 60%),
    rgba(219, 228, 237, 0.28);
  outline: none;
  transform: translateY(-1px);
}

.shangqi-usage-chart.is-empty {
  min-height: 250px;
  align-content: center;
  justify-items: center;
}

.shangqi-usage-chart.is-empty a {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 850;
  text-decoration: none;
}

.shangqi-usage-head {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto auto;
  gap: 12px;
  align-items: center;
}

.shangqi-usage-title {
  display: flex;
  gap: 10px;
  align-items: baseline;
  min-width: 0;
}

.shangqi-usage-title strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.2;
}

.shangqi-usage-title span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
}

.shangqi-usage-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}

.shangqi-usage-filters button {
  display: inline-flex;
  min-height: 28px;
  gap: 5px;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 5px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.13);
  font: 800 0.62rem/1 var(--font-ui);
  cursor: pointer;
}

.shangqi-usage-filters button i {
  width: 12px;
  height: 3px;
  border-radius: 3px;
  background: var(--series-color);
  opacity: 0.42;
}

.shangqi-usage-filters button.is-active {
  border-color: color-mix(in srgb, var(--series-color) 40%, white);
  color: var(--ink);
  background: color-mix(in srgb, var(--series-color) 13%, rgba(255, 255, 255, 0.24));
}

.shangqi-usage-filters button.is-active i {
  opacity: 1;
}

.shangqi-usage-filters button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--series-color) 55%, white);
  outline-offset: 1px;
}

.shangqi-usage-yesterday {
  display: flex;
  gap: 18px;
  align-items: center;
}

.shangqi-usage-yesterday > div {
  display: grid;
  min-width: 94px;
  gap: 2px;
  padding-left: 12px;
  border-left: 3px solid rgba(38, 59, 85, 0.28);
}

.shangqi-usage-yesterday > div:nth-child(2) {
  border-left-color: rgba(63, 141, 105, 0.5);
}

.shangqi-usage-yesterday span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.shangqi-usage-yesterday strong {
  color: var(--ink);
  font-size: 1.55rem;
  line-height: 1;
}

.shangqi-usage-yesterday small {
  margin-left: 2px;
  font-size: 0.72rem;
}

.shangqi-usage-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
}

.shangqi-usage-legend span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--text);
  font-size: 0.7rem;
  font-weight: 800;
}

.shangqi-usage-legend i {
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: var(--series-color);
}

.shangqi-usage-svg {
  display: block;
  width: 100%;
  height: clamp(250px, 37dvh, 340px);
  min-width: 0;
  overflow: visible;
}

.shangqi-usage-plot {
  min-width: 0;
  overflow: hidden;
}

.shangqi-usage-direct-link {
  display: block;
  min-width: 0;
  border-radius: 6px;
  color: inherit;
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
  transition: background 160ms ease;
}

.shangqi-usage-direct-link:hover,
.shangqi-usage-direct-link:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  outline: none;
}

.shangqi-chart-grid {
  stroke: rgba(67, 79, 95, 0.14);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.shangqi-chart-axis {
  fill: rgba(63, 73, 87, 0.64);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
}

.shangqi-chart-line {
  fill: none;
  stroke: var(--series-color);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}

.shangqi-chart-point {
  fill: rgba(246, 248, 250, 0.96);
  stroke: var(--series-color);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.shangqi-snapshot-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-self: start;
  justify-self: end;
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: 300px;
}

.shangqi-snapshot-card {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  gap: 12px;
  height: 320px;
  max-height: calc(100dvh - 212px);
  min-height: 236px;
  padding: 12px;
  overflow: hidden;
}

.shangqi-snapshot-section-head strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.2;
}

.shangqi-rank-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(23, 25, 29, 0.32) transparent;
}

.shangqi-rank-list::-webkit-scrollbar {
  width: 6px;
}

.shangqi-rank-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(23, 25, 29, 0.26);
}

.shangqi-rank-row {
  width: 100%;
  appearance: none;
  display: grid;
  align-items: center;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.shangqi-rank-row {
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 7px 9px;
}

.shangqi-rank-row:hover,
.shangqi-rank-row:focus-visible,
.shangqi-rank-row.is-active {
  border-color: rgba(23, 25, 29, 0.22);
  background: rgba(255, 255, 255, 0.28);
  outline: none;
}

.shangqi-rank-row b {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: rgba(23, 25, 29, 0.82);
  font-size: 0.72rem;
}

.shangqi-rank-row span {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shangqi-rank-row strong {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.shangqi-rank-detail {
  position: absolute;
  z-index: 2;
  inset: 58px 12px 12px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  overflow: auto;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(233, 238, 244, 0.58)),
    rgba(244, 247, 250, 0.7);
  box-shadow:
    0 18px 46px rgba(35, 43, 55, 0.18),
    inset 0 1px rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(24px) saturate(1.18);
  -webkit-backdrop-filter: blur(24px) saturate(1.18);
}

.shangqi-rank-detail > span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0;
}

.shangqi-rank-detail > strong {
  color: var(--ink);
  font-size: 1.18rem;
  line-height: 1.15;
}

.shangqi-rank-detail dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.shangqi-rank-detail dl div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.28);
}

.shangqi-rank-detail dt,
.shangqi-rank-detail dd {
  margin: 0;
}

.shangqi-rank-detail dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.shangqi-rank-detail dd {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shangqi-rank-detail-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(23, 25, 29, 0.12);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.44);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 900;
}

.shangqi-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.07) 58%, rgba(255, 255, 255, 0.13)),
    rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(34px) saturate(1.26) contrast(1.03);
  -webkit-backdrop-filter: blur(34px) saturate(1.26) contrast(1.03);
  box-shadow:
    0 22px 58px rgba(35, 43, 55, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    inset 0 -1px 0 rgba(255, 255, 255, 0.2);
}

.shangqi-hero span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
}

.shangqi-hero strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: clamp(1.9rem, 4.4vw, 3.4rem);
  line-height: 0.98;
}

.shangqi-dashboard:not(.regard-feishu-page) > .shangqi-hero strong {
  color: #ff0019;
  font-size: 38px;
}

.shangqi-hero-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  justify-content: flex-end;
  min-width: 118px;
}

.shangqi-hero a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.28);
  font-size: 0.8rem;
  font-weight: 800;
  text-decoration: none;
}

.shangqi-options-hotspot {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 77;
  width: 48px;
  background: linear-gradient(270deg, rgba(17, 18, 22, 0.06), rgba(17, 18, 22, 0));
  opacity: 0.18;
  pointer-events: auto;
  transition: opacity 180ms ease;
}

.shangqi-options-hotspot:hover,
.scene.is-shangqi-options-open .shangqi-options-hotspot {
  opacity: 0.42;
}

.shangqi-options-scrim {
  position: fixed;
  inset: 0;
  z-index: 78;
  background: rgba(21, 25, 31, 0.14);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.shangqi-options-drawer {
  position: fixed;
  top: clamp(18px, 2.4vw, 34px);
  right: clamp(14px, 2.4vw, 34px);
  bottom: clamp(18px, 2.4vw, 34px);
  z-index: 79;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(360px, calc(100vw - 28px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.08) 62%),
    rgba(231, 235, 239, 0.82);
  box-shadow:
    0 30px 80px rgba(28, 33, 42, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(100% + 34px));
  transition:
    opacity 240ms ease,
    transform 240ms ease;
  backdrop-filter: blur(34px) saturate(1.2);
  -webkit-backdrop-filter: blur(34px) saturate(1.2);
}

.scene.is-shangqi-options-open .shangqi-options-scrim {
  opacity: 0;
  pointer-events: none;
}

.shangqi-options-hotspot:hover ~ .shangqi-options-drawer,
.shangqi-options-drawer:hover,
.scene.is-shangqi-options-open .shangqi-options-drawer {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.shangqi-options-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 6px 2px 14px;
}

.shangqi-options-head span,
.shangqi-option-item span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0;
}

.shangqi-options-head strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 1.28rem;
  line-height: 1.1;
}

.shangqi-options-close {
  appearance: none;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.3);
}

.shangqi-options-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

.shangqi-options-list {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.shangqi-task-drawer {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.shangqi-task-sync {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
}

.shangqi-task-sync > span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 800;
}

.shangqi-task-sync > span i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c99035;
  box-shadow: 0 0 0 4px rgba(201, 144, 53, 0.1);
}

.shangqi-task-sync > span.is-ready i {
  background: #4ba875;
  box-shadow: 0 0 0 4px rgba(75, 168, 117, 0.1);
}

.shangqi-task-sync > span.is-error i {
  background: #c75d58;
  box-shadow: 0 0 0 4px rgba(199, 93, 88, 0.1);
}

.shangqi-task-sync time {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shangqi-task-sync button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 7px;
  color: #fff;
  background: rgba(25, 28, 34, 0.9);
  font-size: 0.66rem;
  font-weight: 800;
}

.shangqi-task-sync button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.shangqi-task-data-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.shangqi-task-data-card {
  display: grid;
  min-width: 0;
  min-height: 112px;
  align-content: space-between;
  gap: 16px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.06)),
    rgba(193, 214, 228, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.shangqi-task-data-card.is-tone-2 {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.06)),
    rgba(202, 222, 207, 0.36);
}

.shangqi-task-data-card.is-tone-3 {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.06)),
    rgba(222, 211, 188, 0.4);
}

.shangqi-task-data-card.is-tone-4 {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.06)),
    rgba(205, 202, 224, 0.36);
}

.shangqi-task-data-card span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
  line-height: 1.35;
}

.shangqi-task-data-card strong {
  color: var(--ink);
  font-size: 2rem;
  line-height: 1;
}

.shangqi-task-sync-error {
  margin: 10px 0 0;
  color: #8c3d39;
  font-size: 0.7rem;
  line-height: 1.45;
}

.shangqi-option-item {
  appearance: none;
  display: grid;
  min-width: 0;
  min-height: 78px;
  align-content: center;
  gap: 6px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 8px;
  color: var(--ink);
  text-align: left;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.09)),
    rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.64),
    0 16px 36px rgba(32, 38, 48, 0.08);
}

.shangqi-option-item strong {
  overflow: hidden;
  color: currentColor;
  font-size: 0.9rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shangqi-option-item.is-dark {
  color: #ffffff;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.025)),
    rgba(21, 23, 28, 0.9);
}

.shangqi-option-item.is-dark span {
  color: rgba(255, 255, 255, 0.68);
}

.shangqi-option-item.is-yellow {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.03)),
    rgba(242, 203, 64, 0.8);
}

.shangqi-option-item.is-yellow-amber {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.025)),
    rgba(226, 173, 58, 0.82);
}

.shangqi-option-item.is-yellow-soft {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.08)),
    rgba(247, 219, 96, 0.68);
}

.shangqi-option-item.is-red {
  color: #ffffff;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.03)),
    rgba(204, 64, 58, 0.84);
}

.shangqi-option-item.is-green {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.04)),
    rgba(134, 198, 74, 0.76);
}

.shangqi-main-grid {
  display: grid;
  gap: 14px;
}

.shangqi-main-grid {
  grid-template-columns: minmax(0, 1fr);
}

.shangqi-entry-panel {
  display: grid;
  gap: 14px;
  min-height: 0;
}

.shangqi-entry-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 0;
}

.shangqi-entry-card {
  display: grid;
  min-height: 112px;
  align-content: center;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.09)),
    rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    0 16px 36px rgba(32, 38, 48, 0.08);
}

.shangqi-entry-card.is-dark {
  color: #ffffff;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.025)),
    rgba(21, 23, 28, 0.9);
}

.shangqi-entry-card.is-yellow {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.03)),
    rgba(242, 203, 64, 0.8);
}

.shangqi-entry-card.is-yellow-amber {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.025)),
    rgba(226, 173, 58, 0.82);
}

.shangqi-entry-card.is-yellow-soft {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.08)),
    rgba(247, 219, 96, 0.68);
}

.shangqi-entry-card.is-red {
  color: #ffffff;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.03)),
    rgba(204, 64, 58, 0.84);
}

.shangqi-entry-card.is-green {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.04)),
    rgba(134, 198, 74, 0.76);
}

.shangqi-entry-card strong {
  display: block;
  color: currentColor;
  font-size: 0.88rem;
  line-height: 1.1;
}

.shangqi-page-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.shangqi-page-card {
  appearance: none;
  display: grid;
  min-width: 0;
  min-height: 86px;
  align-content: center;
  gap: 7px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 8px;
  color: var(--ink);
  text-align: left;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.08)),
    rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.64),
    0 16px 36px rgba(32, 38, 48, 0.08);
}

.shangqi-page-card:hover {
  border-color: rgba(189, 106, 98, 0.44);
  transform: translateY(-1px);
}

.shangqi-page-card.is-dark {
  color: #ffffff;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.025)),
    rgba(21, 23, 28, 0.9);
}

.shangqi-page-card.is-yellow,
.shangqi-page-card.is-yellow-amber,
.shangqi-page-card.is-yellow-soft {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.035)),
    rgba(232, 185, 64, 0.76);
}

.shangqi-page-card span,
.regard-feishu-meta span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0;
}

.shangqi-page-card.is-dark span,
.shangqi-page-card.is-dark em {
  color: rgba(255, 255, 255, 0.68);
}

.shangqi-page-card strong {
  color: currentColor;
  font-size: 0.92rem;
  line-height: 1.12;
}

.shangqi-page-card em {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 700;
}

.regard-feishu-page {
  align-content: start;
}

.regard-feishu-hero {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.regard-feishu-hero.is-dark {
  color: #ffffff;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.025)),
    rgba(21, 23, 28, 0.9);
}

.regard-feishu-hero.is-yellow,
.regard-feishu-hero.is-yellow-amber,
.regard-feishu-hero.is-yellow-soft {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.04)),
    rgba(236, 191, 68, 0.7);
}

.regard-feishu-back {
  appearance: none;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 50%;
  color: currentColor;
  background: rgba(255, 255, 255, 0.22);
}

.regard-feishu-back svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.regard-feishu-panel {
  display: grid;
  gap: 14px;
}

.regard-feishu-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.regard-feishu-meta div {
  display: grid;
  min-width: 0;
  min-height: 74px;
  align-content: center;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
}

.regard-feishu-meta strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.regard-feishu-url-text {
  overflow-wrap: anywhere;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.16);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.45;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.34);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
}

.detail-panel {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 18px;
  align-self: stretch;
  min-height: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.12) 60%, rgba(255, 255, 255, 0.2)),
    rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(34px) saturate(1.2);
  -webkit-backdrop-filter: blur(34px) saturate(1.2);
  box-shadow:
    0 30px 90px rgba(28, 34, 45, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.detail-panel[hidden] {
  display: none;
}

.detail-top {
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.52);
}

.detail-top h2 {
  margin: 0 0 8px;
  font-size: 1.45rem;
  line-height: 1.08;
}

.detail-top p {
  margin: 0;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.5;
}

.detail-group {
  display: grid;
  gap: 10px;
}

.detail-group strong {
  font-size: 0.86rem;
}

.detail-panel.is-mail-module {
  grid-template-rows: auto auto auto;
  align-content: start;
  gap: 10px;
}

.detail-panel.is-mail-module .detail-top {
  padding-bottom: 8px;
}

.detail-panel.is-mail-module .detail-top h2 {
  margin-bottom: 0;
}

.detail-panel.is-mail-module .detail-group {
  gap: 8px;
}

.chip-list,
.action-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.source-chip,
.detail-action {
  appearance: none;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.36);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}

.source-chip.is-active {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(17, 18, 22, 0.72);
}

.mail-count-chip {
  gap: 8px;
}

.mail-count-chip b {
  display: grid;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.38);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1;
}

.mail-count-chip.is-active b {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.14);
}

.detail-action {
  justify-content: space-between;
  width: 100%;
  border-radius: 8px;
  color: var(--ink);
}

.detail-action span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.action-list.mail-summary-list {
  display: grid;
}

.mail-summary-card {
  display: grid;
  gap: 12px;
  width: 100%;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.07)),
    rgba(255, 255, 255, 0.16);
}

.mail-summary-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.mail-summary-head span,
.mail-summary-card em {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 650;
  letter-spacing: 0.06em;
}

.mail-summary-head b {
  color: var(--ink);
  font-size: 0.82rem;
}

.mail-summary-card ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mail-summary-card li {
  position: relative;
  padding-left: 14px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.46;
}

.mail-summary-card li::before {
  position: absolute;
  top: 0.62em;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(189, 106, 98, 0.74);
  content: "";
}

.brain-dashboard {
  align-content: start;
  gap: 10px;
}

.brain-dashboard-head,
.brain-source-card,
.brain-metric-card,
.brain-quality-note,
.brain-state-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.08) 58%, rgba(255, 255, 255, 0.15)),
    rgba(255, 255, 255, 0.18);
  box-shadow:
    0 18px 48px rgba(35, 43, 55, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(30px) saturate(1.2);
  -webkit-backdrop-filter: blur(30px) saturate(1.2);
}

.brain-dashboard-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  min-height: 66px;
  padding: 10px 12px;
}

.brain-head-title,
.brain-head-actions,
.brain-state-panel,
.brain-empty {
  display: grid;
}

.brain-head-title {
  gap: 2px;
}

.brain-head-title span,
.brain-panel-head span,
.brain-detail-head span,
.brain-detail-section > span,
.brain-quality-note > strong,
.brain-metric-card em {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brain-head-title strong {
  color: var(--ink);
  font-size: 1.32rem;
}

.brain-head-status {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  font-size: 0.72rem;
  font-weight: 700;
}

.brain-head-status span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #509863;
}

.brain-head-status.is-partial span {
  background: #bd6a62;
}

.brain-head-actions {
  grid-auto-flow: column;
  gap: 9px;
  align-items: center;
}

.brain-head-actions em {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-style: normal;
}

.brain-head-actions button,
.brain-state-panel button {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: #17191d;
  font-weight: 700;
}

.brain-source-strip,
.brain-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.brain-source-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  min-height: 88px;
  padding: 10px;
  border-top: 3px solid rgba(78, 84, 93, 0.34);
}

.brain-source-card.is-ready {
  border-top-color: #509863;
}

.brain-source-card.is-partial {
  border-top-color: #6f95b0;
}

.brain-source-card.is-stale {
  border-top-color: #bd6a62;
}

.brain-source-card.is-blocked {
  border-top-color: #4e545d;
}

.brain-source-card > div {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.brain-source-card span,
.brain-source-card strong,
.brain-source-card p {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brain-source-card span {
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 750;
  white-space: nowrap;
}

.brain-source-card b {
  flex: 0 0 auto;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.58rem;
}

.brain-source-card strong {
  font-size: 0.78rem;
}

.brain-source-card p {
  display: -webkit-box;
  margin: 0;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.brain-metric-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 8px;
  align-items: end;
  min-height: 72px;
  padding: 10px 12px;
}

.brain-metric-card span {
  align-self: start;
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 700;
}

.brain-metric-card strong {
  grid-row: 1 / 3;
  grid-column: 2;
  color: var(--ink);
  font-size: 1.62rem;
  line-height: 1;
}

.brain-metric-card em {
  letter-spacing: 0;
}

.brain-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(310px, 0.75fr);
  gap: 10px;
  min-height: 390px;
}

.brain-queue-panel,
.brain-detail-card {
  min-height: 0;
  padding: 12px;
}

.brain-queue-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.brain-panel-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 9px;
}

.brain-panel-head > div:first-child {
  display: grid;
  gap: 2px;
}

.brain-panel-head strong {
  font-size: 1rem;
}

.brain-filter-tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.2);
}

.brain-filter-tabs button {
  min-height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
  font-size: 0.68rem;
  font-weight: 700;
}

.brain-filter-tabs button.is-active {
  color: #ffffff;
  background: #2d3035;
}

.brain-queue-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(78, 84, 93, 0.38) transparent;
}

.brain-queue-row {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.18);
  text-align: left;
}

.brain-queue-row + .brain-queue-row {
  margin-top: 5px;
}

.brain-queue-row::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #6f95b0;
  content: "";
}

.brain-queue-row.is-critical::before {
  background: #bd6a62;
}

.brain-queue-row.is-high::before {
  background: #c99c45;
}

.brain-queue-row:hover,
.brain-queue-row.is-active,
.brain-queue-row:focus-visible {
  border-color: rgba(23, 25, 29, 0.34);
  background: rgba(255, 255, 255, 0.5);
}

.brain-score {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: #34383e;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
}

.brain-row-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.brain-row-copy strong,
.brain-row-copy em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brain-row-copy strong {
  font-size: 0.78rem;
}

.brain-row-copy em {
  color: var(--muted);
  font-size: 0.64rem;
  font-style: normal;
}

.brain-row-state {
  min-height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  color: #334150;
  background: rgba(187, 218, 245, 0.56);
  font-size: 0.62rem;
  font-weight: 750;
  line-height: 24px;
  white-space: nowrap;
}

.brain-row-state.is-doing {
  color: #72581e;
  background: rgba(238, 210, 142, 0.58);
}

.brain-row-state.is-deferred {
  color: #5b536d;
  background: rgba(205, 195, 221, 0.58);
}

.brain-row-state.is-done {
  color: #2f6944;
  background: rgba(186, 224, 198, 0.58);
}

.brain-detail-card {
  display: grid;
  align-content: start;
  gap: 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.brain-detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px;
  gap: 10px;
  align-items: start;
}

.brain-detail-head > div:first-child {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.brain-detail-head strong {
  overflow-wrap: anywhere;
  font-size: 0.92rem;
  line-height: 1.28;
}

.brain-score-ring {
  position: relative;
  display: grid;
  width: 54px;
  height: 54px;
  place-content: center;
  border-radius: 50%;
  background: conic-gradient(#bd6a62 calc(var(--brain-score) * 1%), rgba(78, 84, 93, 0.14) 0);
  text-align: center;
}

.brain-score-ring::after {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #e8ebef;
  content: "";
}

.brain-score-ring strong,
.brain-score-ring span {
  position: relative;
  z-index: 1;
}

.brain-score-ring strong {
  font-size: 0.88rem;
}

.brain-score-ring span {
  color: var(--muted);
  font-size: 0.54rem;
}

.brain-detail-section {
  display: grid;
  gap: 6px;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.48);
}

.brain-detail-section p,
.brain-detail-section ul,
.brain-policy-note p {
  margin: 0;
  color: var(--text);
  font-size: 0.7rem;
  line-height: 1.48;
}

.brain-detail-section ul {
  display: grid;
  gap: 4px;
  padding-left: 16px;
}

.brain-score-parts,
.brain-evidence-list {
  display: grid;
  gap: 5px;
}

.brain-score-parts > div {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 24px;
  gap: 7px;
  align-items: center;
  font-size: 0.64rem;
}

.brain-score-parts i {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(78, 84, 93, 0.13);
}

.brain-score-parts i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6f95b0, #bd6a62);
}

.brain-score-parts strong {
  text-align: right;
}

.brain-evidence-list > div {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  font-size: 0.66rem;
}

.brain-evidence-list span {
  color: var(--muted);
}

.brain-evidence-list strong {
  overflow-wrap: anywhere;
}

.brain-policy-note {
  padding: 9px;
  border-left: 3px solid #bd6a62;
  border-radius: 4px;
  background: rgba(189, 106, 98, 0.08);
}

.brain-policy-note span {
  font-size: 0.68rem;
  font-weight: 800;
}

.brain-policy-note p {
  margin-top: 3px;
  color: var(--muted);
}

.brain-detail-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.brain-detail-actions button,
.brain-detail-actions a {
  display: grid;
  min-height: 34px;
  padding: 0 8px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 5px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.28);
  font-size: 0.68rem;
  font-weight: 750;
  text-align: center;
  text-decoration: none;
}

.brain-detail-actions button.is-primary,
.brain-detail-actions a.is-primary {
  color: #ffffff;
  background: #22252a;
}

.brain-detail-actions button:disabled {
  cursor: default;
  opacity: 0.46;
}

.brain-quality-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px 10px;
  align-items: center;
  padding: 8px 10px;
}

.brain-quality-note > span {
  color: var(--text);
  font-size: 0.68rem;
}

.brain-quality-note > div {
  display: flex;
  grid-column: 1 / -1;
  gap: 5px;
  flex-wrap: wrap;
}

.brain-quality-note em {
  padding: 3px 6px;
  border-radius: 4px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.25);
  font-size: 0.6rem;
  font-style: normal;
}

.brain-state-panel {
  gap: 8px;
  place-content: center;
  min-height: 420px;
  padding: 24px;
  text-align: center;
}

.brain-state-panel strong {
  font-size: 1.1rem;
}

.brain-state-panel span,
.brain-empty span {
  color: var(--muted);
  font-size: 0.72rem;
}

.brain-state-panel button {
  justify-self: center;
}

.brain-empty {
  gap: 5px;
  place-content: center;
  min-height: 140px;
  text-align: center;
}

.brain-empty strong {
  font-size: 0.86rem;
}

@keyframes cardIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(189, 106, 98, 0.32);
  }
  50% {
    box-shadow: 0 0 0 9px rgba(189, 106, 98, 0);
  }
}

@keyframes sheenMove {
  from {
    background-position: 120% 0;
  }

  to {
    background-position: -120% 0;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes railLineFlow {
  0% {
    background-position: 0 -120%;
  }
  100% {
    background-position: 0 120%;
  }
}

@keyframes railLineFlowX {
  0% {
    background-position: -120% 0;
  }
  100% {
    background-position: 120% 0;
  }
}

@media (max-width: 1180px) {
  .journey-board {
    grid-template-columns: 1fr;
  }

  .bi-main-grid,
  .bi-bottom-grid,
  .people-main-grid,
  .shangqi-main-grid,
  .support-main-grid {
    grid-template-columns: 1fr;
  }

  .brain-source-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .people-main-grid {
    height: auto;
  }

  .people-live-head {
    grid-template-areas:
      "title refresh"
      "metrics metrics";
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .people-metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .people-source-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .shangqi-entry-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .shangqi-snapshot-main {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    min-height: auto;
  }
}

@media (max-width: 900px) {
  .scene {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .shangqi-snapshot-layout {
    grid-template-columns: 1fr;
  }

  .shangqi-live-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shangqi-snapshot-metrics {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .shangqi-snapshot-main {
    grid-template-columns: 1fr;
  }

  .brain-dashboard-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .brain-head-status {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
  }

  .brain-head-actions {
    grid-column: 2;
    grid-row: 1 / 3;
  }

  .brain-workspace {
    grid-template-columns: 1fr;
  }

  .brain-queue-panel,
  .brain-detail-card {
    max-height: 430px;
  }

  .tool-rail {
    position: static;
    flex-direction: row;
    justify-content: space-between;
    height: auto;
    padding: 10px 12px;
    border-radius: 24px;
  }

  .rail-icons {
    grid-auto-flow: column;
    width: auto;
    margin-top: 0;
    overflow-x: auto;
  }

  .rail-icons::before,
  .rail-icons::after {
    top: 50%;
    left: 4px;
    width: auto;
    height: 3px;
    transform: translateY(-50%) scaleX(0);
    transform-origin: left;
  }

  .rail-icons::before {
    right: 4px;
    bottom: auto;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(29, 33, 40, 0.34), rgba(255, 255, 255, 0));
  }

  .rail-icons::after {
    right: 4px;
    width: auto;
    background: linear-gradient(
      90deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0) 28%,
      rgba(241, 126, 126, 0.84) 46%,
      rgba(187, 218, 245, 0.74) 54%,
      rgba(255, 255, 255, 0) 72%,
      rgba(255, 255, 255, 0) 100%
    );
    background-position: -120% 0;
    background-size: 220% 100%;
    transform: translateY(-50%) scaleX(0);
  }

  .scene.is-drawer-open .rail-icons::before {
    transform: translateY(-50%) scaleX(1);
  }

  .scene.is-drawer-open .rail-icons::after {
    transform: translateY(-50%) scaleX(1);
    animation-name: railLineFlowX;
  }

  .scene.is-drawer-open .rail-icons .module-nav-button {
    width: 28px;
    height: 12px;
    transform: scaleY(0.36);
  }

  .drawer-toggle {
    margin-top: 0;
  }

  .rail-status {
    margin-top: 0;
  }

  .shangqi-options-drawer {
    top: 78px;
    right: 12px;
    bottom: 12px;
    width: min(360px, calc(100vw - 24px));
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .people-metric-grid,
  .people-source-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bi-head {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .support-live-head .support-live-link {
    justify-self: end;
  }

  .support-state-bar {
    grid-template-columns: 1fr;
  }

  .support-state-bar .support-state-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bi-state {
    grid-column: 2;
    justify-self: start;
  }

}

@media (max-width: 620px) {
  .scene {
    padding: 86px 10px calc(18px + env(safe-area-inset-bottom));
  }

  .login-view,
  .account-page {
    padding: 12px;
  }

  .login-card,
  .account-page-window {
    border-radius: 28px;
    padding: 18px;
  }

  .login-copy h1 {
    font-size: 2.2rem;
  }

  .login-options {
    align-items: flex-start;
    flex-direction: column;
  }

  .account-profile,
  .account-grid,
  .security-list,
  .admin-role-grid {
    grid-template-columns: 1fr;
  }

  .account-profile {
    align-items: start;
  }

  .security-subpage {
    top: 12px;
    right: 12px;
    bottom: 12px;
    width: min(430px, calc(100vw - 24px));
    max-height: none;
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0.2) 62%, rgba(255, 255, 255, 0.28)),
      rgba(238, 242, 247, 0.82);
    transform: translateX(110%) scale(0.985);
  }

  .account-page.is-security-open .security-subpage {
    transform: translateX(0) scale(1);
  }

  body {
    background:
      linear-gradient(180deg, #c7ccd5 0%, #bfc5cf 58%, #aeb4bd 100%);
  }

  body::before {
    width: 84vw;
    height: 18vh;
    border-radius: 22px 0 0 0;
  }

  .tool-rail {
    position: fixed;
    top: 10px;
    right: 10px;
    left: 10px;
    z-index: 60;
    flex-direction: row;
    gap: 8px;
    width: auto;
    height: 58px;
    padding: 7px;
    border: 1px solid rgba(255, 255, 255, 0.48);
    border-radius: 29px;
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.08) 62%, rgba(255, 255, 255, 0.14)),
      rgba(232, 236, 244, 0.32);
    backdrop-filter: blur(30px) saturate(1.2);
    -webkit-backdrop-filter: blur(30px) saturate(1.2);
    box-shadow:
      0 18px 56px rgba(24, 29, 38, 0.14),
      inset 0 1px 0 rgba(255, 255, 255, 0.62);
  }

  .rail-logo {
    display: none;
  }

  .rail-status {
    width: 44px;
    height: 44px;
    margin-top: 0;
    flex: 0 0 auto;
    border-color: rgba(255, 255, 255, 0.24);
    box-shadow: 0 10px 28px rgba(33, 39, 49, 0.12);
  }

  .account-menu {
    top: 74px;
    right: 12px;
    bottom: auto;
    left: auto;
    width: 146px;
    transform-origin: right top;
  }

  .account-menu::before {
    top: -5px;
    right: 20px;
    bottom: auto;
    left: auto;
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.46);
    border-left: 1px solid rgba(255, 255, 255, 0.46);
  }

  .rail-icons {
    grid-auto-flow: column;
    grid-auto-columns: 44px;
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
    gap: 7px;
    padding: 0;
    margin-top: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .rail-icons::-webkit-scrollbar {
    display: none;
  }

  .rail-icons::before,
  .rail-icons::after {
    top: 50%;
    right: 4px;
    left: 4px;
    width: auto;
    height: 3px;
    border-radius: 999px;
    transform: translateY(-50%) scaleX(0);
    transform-origin: left;
  }

  .rail-icons::before {
    bottom: auto;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(29, 33, 40, 0.34), rgba(255, 255, 255, 0));
  }

  .rail-icons::after {
    bottom: auto;
    background: linear-gradient(
      90deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0) 28%,
      rgba(241, 126, 126, 0.84) 46%,
      rgba(187, 218, 245, 0.74) 54%,
      rgba(255, 255, 255, 0) 72%,
      rgba(255, 255, 255, 0) 100%
    );
    background-position: -120% 0;
    background-size: 220% 100%;
    transform: translateY(-50%) scaleX(0);
  }

  .scene.is-drawer-open .rail-icons::before {
    transform: translateY(-50%) scaleX(1);
  }

  .scene.is-drawer-open .rail-icons::after {
    transform: translateY(-50%) scaleX(1);
    animation-name: railLineFlowX;
  }

  .scene.is-drawer-open .rail-icons .module-nav-button {
    width: 28px;
    height: 12px;
    transform: scaleY(0.36);
  }

  .tool-button {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    border-color: rgba(255, 255, 255, 0.46);
    background: rgba(255, 255, 255, 0.48);
    backdrop-filter: blur(18px);
    box-shadow: 0 10px 28px rgba(33, 39, 49, 0.1);
  }

  .side-drawer {
    top: 78px;
    right: 10px;
    left: 10px;
    width: auto;
    max-height: calc(100dvh - 100px);
    padding: 14px;
    border-radius: 28px;
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.055) 58%, rgba(255, 255, 255, 0.12)),
      rgba(232, 236, 244, 0.22);
    backdrop-filter: blur(46px) saturate(1.28) contrast(1.04);
    -webkit-backdrop-filter: blur(46px) saturate(1.28) contrast(1.04);
    transform: translateY(-12px) scale(0.985);
    transform-origin: top center;
  }

  .drawer-scrim {
    background: rgba(159, 163, 169, 0.2);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
  }

  .shangqi-options-drawer {
    top: 78px;
    right: 10px;
    bottom: 10px;
    width: min(360px, calc(100vw - 20px));
    border-radius: 24px;
    transform: translateX(calc(100% + 20px));
    transform-origin: center right;
  }

  .shangqi-options-hotspot:hover ~ .shangqi-options-drawer,
  .shangqi-options-drawer:hover,
  .scene.is-shangqi-options-open .shangqi-options-drawer {
    transform: translateX(0);
  }

  .shangqi-options-scrim {
    background: rgba(159, 163, 169, 0.2);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
  }

  .scene.is-drawer-open .side-drawer {
    transform: translateY(0) scale(1);
  }

  .drawer-nav {
    gap: 7px;
  }

  .drawer-item {
    min-height: 50px;
    border-radius: 18px;
    color: rgba(23, 25, 29, 0.78);
    background: rgba(255, 255, 255, 0.08);
  }

  .drawer-subitem {
    color: rgba(23, 25, 29, 0.72);
    background: rgba(255, 255, 255, 0.18);
  }

  .glass-window {
    min-height: calc(100dvh - 20px);
    border-radius: 34px;
    background: rgba(232, 236, 244, 0.52);
  }

  .stage {
    padding: 10px;
  }

  .journey-board {
    margin-left: 0;
    min-height: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .bi-shell {
    gap: 10px;
    min-height: 0;
  }

  .brain-dashboard-head {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 10px;
  }

  .brain-head-title strong {
    font-size: 1.08rem;
  }

  .brain-head-actions em,
  .brain-head-status {
    display: none;
  }

  .brain-head-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .brain-source-strip {
    grid-template-columns: 1fr;
  }

  .brain-source-card {
    min-height: 76px;
  }

  .brain-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brain-metric-card {
    min-height: 66px;
  }

  .brain-workspace {
    min-height: 0;
  }

  .brain-queue-panel,
  .brain-detail-card {
    max-height: none;
  }

  .brain-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .brain-filter-tabs {
    overflow-x: auto;
  }

  .brain-filter-tabs button {
    flex: 1 0 auto;
  }

  .brain-queue-list {
    max-height: 360px;
  }

  .brain-queue-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .brain-row-state {
    grid-column: 2;
    justify-self: start;
  }

  .brain-detail-actions {
    grid-template-columns: 1fr;
  }

  .brain-quality-note {
    grid-template-columns: 1fr;
  }

  .brain-quality-note > div {
    grid-column: 1;
  }

  .bi-head,
  .metric-card,
  .bi-panel,
  .shangqi-hero,
  .shangqi-entry-card,
  .shangqi-page-card,
  .shangqi-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    min-height: auto;
    padding: 14px;
  }

  .shangqi-hero strong {
    font-size: 1.58rem;
  }

  .shangqi-hero-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .shangqi-hero-actions > * {
    width: 100%;
  }

  .shangqi-options-drawer {
    top: 78px;
    right: 12px;
    bottom: 12px;
    width: min(360px, calc(100vw - 24px));
  }

  .shangqi-hero a {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .shangqi-entry-grid {
    grid-template-columns: 1fr;
  }

  .shangqi-page-grid,
  .regard-feishu-meta {
    grid-template-columns: 1fr;
  }

  .shangqi-entry-card {
    min-height: 126px;
  }

  .bi-head {
    grid-template-columns: 48px minmax(0, 1fr);
    min-height: 74px;
    padding: 11px;
  }

  .bi-module-icon {
    width: 48px;
    height: 48px;
    border-radius: 18px;
  }

  .bi-module-icon svg {
    width: 28px;
    height: 28px;
  }

  .bi-title strong {
    font-size: 1.18rem;
  }

  .bi-title span,
  .panel-head span,
  .metric-card em {
    display: none;
  }

  .bi-state {
    display: none;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .people-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .metric-card {
    min-height: 84px;
    padding: 12px;
  }

  .metric-card strong {
    font-size: 1.45rem;
  }

  .bi-panel-large {
    min-height: 208px;
  }

  .bar-visual {
    height: 132px;
    gap: 7px;
  }

  .bi-panel-focus {
    min-height: auto;
  }

  .ring-visual {
    width: 132px;
    margin-block: 2px;
  }

  .ring-visual span {
    width: 58px;
    height: 58px;
    font-size: 1rem;
  }

  .placeholder-row {
    grid-template-columns: minmax(0, 1fr) 42px auto;
    min-height: 36px;
  }

  .detail-panel {
    order: -1;
    min-height: 0;
    gap: 14px;
    padding: 16px;
    border-radius: 26px;
    color: #ffffff;
    background: rgba(24, 25, 29, 0.94);
  }

  .detail-top h2 {
    font-size: 1.34rem;
  }

  .detail-top p {
    font-size: 0.86rem;
  }

  .source-chip,
  .detail-action {
    min-height: 32px;
  }

  .detail-top {
    border-bottom-color: rgba(255, 255, 255, 0.12);
  }

  .detail-top p,
  .detail-group strong,
  .detail-action span {
    color: rgba(255, 255, 255, 0.7);
  }

  .source-chip,
  .detail-action {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.1);
  }

  .tool-button,
  .round-button {
    width: 40px;
    height: 40px;
  }
}

/* Cached operations cockpit */
.shangqi-intelligence-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: 12px;
  align-items: stretch;
}

.shangqi-assistant,
.shangqi-reminder,
.shangqi-people-ranking,
.brain-source-dialog > section {
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.08) 62%),
    rgba(215, 225, 235, 0.2);
  box-shadow:
    0 18px 44px rgba(35, 47, 61, 0.09),
    inset 0 1px rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(30px) saturate(1.2);
  -webkit-backdrop-filter: blur(30px) saturate(1.2);
}

.shangqi-assistant {
  display: flex;
  min-width: 0;
  min-height: 390px;
  max-height: 460px;
  overflow: hidden;
  flex-direction: column;
  gap: 10px;
  padding: 13px 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.08) 62%),
    rgba(187, 218, 245, 0.2);
}

.shangqi-assistant > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.shangqi-assistant > header div {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.shangqi-assistant > header span,
.shangqi-assistant > header em,
.shangqi-assistant-message > span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0;
}

.shangqi-assistant > header strong {
  color: var(--ink);
  font-size: 0.88rem;
}

.shangqi-assistant > header em {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.shangqi-assistant > header em::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ba875;
  box-shadow: 0 0 0 4px rgba(75, 168, 117, 0.1);
  content: "";
}

.shangqi-assistant > header em.is-loading::before {
  background: #c99035;
  box-shadow: 0 0 0 4px rgba(201, 144, 53, 0.12);
  animation: pulse 1.3s ease-in-out infinite;
}

.shangqi-assistant > header em.is-error::before {
  background: #c75d58;
  box-shadow: 0 0 0 4px rgba(199, 93, 88, 0.1);
}

.shangqi-assistant-messages {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  contain: content;
  padding: 4px 3px 4px 0;
  scrollbar-width: thin;
}

.shangqi-assistant-message {
  display: grid;
  width: min(88%, 560px);
  gap: 5px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.2);
}

.shangqi-assistant-message.is-user {
  align-self: end;
  background: rgba(179, 204, 225, 0.2);
}

.shangqi-assistant-message.is-assistant {
  align-self: start;
  border-left: 3px solid rgba(49, 82, 111, 0.48);
}

.shangqi-assistant-message.is-assistant.used-lark-tools {
  border-left-color: rgba(51, 139, 96, 0.68);
  background: rgba(184, 220, 199, 0.18);
}

.shangqi-assistant-message.is-assistant.used-lark-tools > span {
  color: #326a4b;
}

.shangqi-assistant-message-body {
  display: grid;
  gap: 5px;
}

.shangqi-assistant-resource-link {
  color: #265c43;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(38, 92, 67, 0.36);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.shangqi-assistant-resource-link:hover,
.shangqi-assistant-resource-link:focus-visible {
  color: #163d2b;
  text-decoration-color: currentColor;
}

.shangqi-assistant-message-body p,
.shangqi-assistant-message-body h4,
.shangqi-assistant-message-body ul,
.shangqi-assistant-message-body ol,
.shangqi-assistant-message-body blockquote {
  margin: 0;
  color: var(--text);
  font-size: 0.72rem;
  line-height: 1.55;
}

.shangqi-assistant-message-body h4 {
  color: var(--ink);
  font-size: 0.76rem;
}

.shangqi-assistant-message-body ul,
.shangqi-assistant-message-body ol {
  display: grid;
  gap: 3px;
  padding-left: 18px;
}

.shangqi-assistant-message-body blockquote {
  padding: 5px 8px;
  border-left: 2px solid rgba(49, 82, 111, 0.42);
  background: rgba(255, 255, 255, 0.14);
}

.shangqi-assistant-message-body code {
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(37, 45, 57, 0.08);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.shangqi-assistant-error {
  margin: 0;
  color: #8c3d39;
  font-size: 0.68rem;
  line-height: 1.4;
}

.shangqi-assistant-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 7px;
  align-items: end;
}

.shangqi-assistant-composer textarea {
  width: 100%;
  min-height: 54px;
  max-height: 112px;
  resize: vertical;
  padding: 10px 11px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 7px;
  outline: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.28);
  font: inherit;
  font-size: 0.74rem;
  line-height: 1.45;
}

.shangqi-assistant-composer textarea:focus {
  border-color: rgba(49, 82, 111, 0.42);
  box-shadow: 0 0 0 3px rgba(49, 82, 111, 0.08);
}

.shangqi-assistant-composer button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 7px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.3);
}

.shangqi-assistant-composer button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.shangqi-assistant-composer .shangqi-assistant-send {
  color: #fff;
  background: rgba(25, 28, 34, 0.92);
  touch-action: manipulation;
}

.shangqi-assistant-composer button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.shangqi-reminder {
  display: flex;
  min-width: 0;
  min-height: 390px;
  max-height: 460px;
  flex-direction: column;
  gap: 10px;
  padding: 13px 14px;
}

.shangqi-reminder > header,
.shangqi-people-ranking > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.shangqi-reminder > header div {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.shangqi-reminder > header span,
.shangqi-reminder > header em,
.shangqi-people-ranking > header span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0;
}

.shangqi-reminder > header strong,
.shangqi-people-ranking > header strong {
  color: var(--ink);
  font-size: 0.88rem;
}

.shangqi-reminder blockquote {
  margin: 0;
  padding: 9px 11px;
  border-left: 3px solid rgba(38, 59, 85, 0.52);
  color: var(--text);
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.76rem;
  font-weight: 650;
  line-height: 1.55;
}

.shangqi-reminder-columns {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.shangqi-reminder-columns > section {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.15);
}

.shangqi-reminder-columns .is-urgent {
  background: rgba(226, 154, 148, 0.13);
}

.shangqi-reminder-columns .is-later {
  background: rgba(179, 204, 225, 0.15);
}

.shangqi-reminder h3 {
  margin: 0 0 7px;
  color: var(--ink);
  font-size: 0.72rem;
  letter-spacing: 0;
}

.shangqi-reminder ol {
  display: grid;
  min-height: 0;
  flex: 1;
  gap: 5px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  list-style: none;
}

.shangqi-reminder li {
  display: block;
  min-width: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.2);
}

.shangqi-reminder li > button {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  padding: 7px 8px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.shangqi-reminder li > button:hover,
.shangqi-reminder li > button:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  outline: 2px solid rgba(49, 82, 111, 0.22);
  outline-offset: -2px;
}

.shangqi-reminder li.is-empty {
  padding: 7px 8px;
}

.shangqi-reminder li b {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.69rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shangqi-reminder li span {
  overflow: hidden;
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shangqi-reminder li em {
  color: #7a302b;
  font-family: var(--font-mono);
  font-size: 0.63rem;
  font-style: normal;
  font-weight: 800;
}

.shangqi-usage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 12px;
  align-items: stretch;
  min-width: 0;
}

.shangqi-people-ranking {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 9px;
  min-width: 0;
  min-height: 0;
  padding: 13px;
}

.shangqi-people-ranking-list {
  display: grid;
  align-content: start;
  gap: 5px;
  max-height: 344px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.shangqi-person-rank {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto 42px;
  gap: 7px;
  align-items: center;
  min-height: 43px;
  padding: 6px 7px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.16);
}

.shangqi-person-rank.is-first {
  background: rgba(238, 210, 142, 0.24);
}

.shangqi-person-rank > b {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(34, 42, 53, 0.84);
  font-family: var(--font-mono);
  font-size: 0.61rem;
}

.shangqi-person-rank > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.shangqi-person-rank > div strong,
.shangqi-person-rank > div span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shangqi-person-rank > div strong {
  color: var(--ink);
  font-size: 0.69rem;
}

.shangqi-person-rank > div span {
  color: var(--muted);
  font-size: 0.57rem;
}

.shangqi-person-rank > em {
  padding: 4px 6px;
  border-radius: 4px;
  color: #2d5068;
  background: rgba(158, 201, 228, 0.24);
  font-size: 0.58rem;
  font-style: normal;
  font-weight: 800;
}

.shangqi-person-rank > em.is-docs { color: #2e674b; background: rgba(156, 215, 178, 0.24); }
.shangqi-person-rank > em.is-calendar { color: #6e4d13; background: rgba(238, 210, 142, 0.26); }
.shangqi-person-rank > em.is-vc { color: #544876; background: rgba(193, 181, 224, 0.26); }

.shangqi-person-rank > strong {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-align: right;
}

.shangqi-people-empty {
  padding: 18px 8px;
  color: var(--muted);
  font-size: 0.68rem;
  text-align: center;
}

.shangqi-live-refresh.is-refreshing {
  background-size: 220% 100%;
  animation: sheenMove 1.4s ease-in-out infinite;
}

.brain-bi-source-row {
  width: 100%;
  padding: 0;
  border-top: 0;
  border-right: 0;
  border-left: 0;
  border-radius: 0;
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.brain-bi-source-row:hover,
.brain-bi-source-row:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  outline: none;
}

.brain-source-dialog {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: 24px;
  background: rgba(22, 28, 35, 0.46);
  backdrop-filter: blur(18px) saturate(0.86);
  -webkit-backdrop-filter: blur(18px) saturate(0.86);
}

.brain-source-dialog > section {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(720px, 94vw);
  max-height: min(640px, 82dvh);
  overflow: hidden;
  padding: 14px;
  color: #17191d;
  border-color: rgba(255, 255, 255, 0.86);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.93), rgba(229, 235, 241, 0.89)),
    rgba(238, 243, 247, 0.94);
  box-shadow:
    0 28px 70px rgba(15, 22, 30, 0.28),
    0 2px 14px rgba(15, 22, 30, 0.12),
    inset 0 1px rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(36px) saturate(1.04);
  -webkit-backdrop-filter: blur(36px) saturate(1.04);
}

.brain-source-dialog > section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -14px -14px 10px;
  padding: 14px;
  border-bottom: 1px solid rgba(86, 102, 118, 0.16);
  background: rgba(248, 250, 252, 0.72);
}

.brain-source-dialog > section > header div {
  display: grid;
  gap: 2px;
}

.brain-source-dialog > section > header span {
  color: #5e6a78;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 800;
}

.brain-source-dialog > section > header strong {
  color: #17191d;
  font-size: 1rem;
}

.brain-source-dialog > section > header button {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(83, 98, 114, 0.22);
  border-radius: 50%;
  color: #17191d;
  background: rgba(255, 255, 255, 0.82);
  font-size: 1.2rem;
  cursor: pointer;
}

.brain-source-dialog > section > header button:hover,
.brain-source-dialog > section > header button:focus-visible {
  background: #ffffff;
  outline: 2px solid rgba(46, 112, 160, 0.24);
  outline-offset: 1px;
}

.brain-source-detail-list {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 3px;
  scrollbar-color: rgba(76, 91, 107, 0.42) transparent;
}

.brain-source-detail-list article {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto auto;
  gap: 9px;
  align-items: center;
  padding: 9px;
  border: 1px solid rgba(92, 108, 124, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.82);
}

.brain-source-detail-list article > b {
  color: #52606e;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-align: center;
}

.brain-source-detail-list article > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.brain-source-detail-list article strong,
.brain-source-detail-list article span {
  overflow: hidden;
  overflow-wrap: anywhere;
}

.brain-source-detail-list article strong { color: #17191d; font-size: 0.72rem; line-height: 1.45; }
.brain-source-detail-list article span { color: #53606d; font-size: 0.63rem; line-height: 1.5; }
.brain-source-detail-list article time { color: #687583; font-family: var(--font-mono); font-size: 0.58rem; }
.brain-source-detail-list article a { color: #1f587c; font-size: 0.64rem; font-weight: 800; }
.brain-source-detail-empty {
  padding: 30px 24px;
  border: 1px solid rgba(92, 108, 124, 0.14);
  border-radius: 6px;
  color: #596674;
  background: rgba(255, 255, 255, 0.68);
  font-size: 0.72rem;
  text-align: center;
}

.brain-automation-actions button.is-direct {
  background: rgba(179, 204, 225, 0.2);
}

.brain-automation-actions button.is-completed {
  color: #315c45;
  background: rgba(186, 224, 198, 0.24);
}

.brain-action-feedback a {
  margin-left: 6px;
  color: inherit;
  font-weight: 850;
}

.shangqi-options-drawer {
  border-radius: 8px;
}

@media (max-width: 1100px) {
  .shangqi-usage-grid {
    grid-template-columns: minmax(0, 1fr) 260px;
  }

  .shangqi-usage-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .shangqi-usage-filters {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
  }
}

@media (max-width: 820px) {
  .shangqi-intelligence-grid,
  .shangqi-reminder-columns,
  .shangqi-usage-grid {
    grid-template-columns: 1fr;
  }

  .shangqi-people-ranking-list {
    max-height: 260px;
  }
}

@media (max-width: 620px) {
  .shangqi-assistant {
    height: min(430px, 64dvh);
    min-height: min(350px, 64dvh);
    max-height: 430px;
    padding: 11px;
  }

  .shangqi-reminder {
    min-height: 410px;
    max-height: 470px;
    padding: 11px;
  }

  .shangqi-assistant-message {
    width: 94%;
  }

  .shangqi-assistant-composer {
    position: relative;
    display: block;
  }

  .shangqi-assistant-composer textarea {
    min-height: 112px;
    max-height: 160px;
    padding: 11px 11px 55px;
    resize: none;
  }

  .shangqi-assistant-composer button {
    position: absolute;
    bottom: 10px;
    width: 44px;
    height: 44px;
  }

  .shangqi-assistant-composer .shangqi-assistant-send {
    left: 10px;
  }

  .shangqi-reminder-columns {
    gap: 7px;
  }

  .shangqi-reminder blockquote {
    font-size: 0.69rem;
  }

  .brain-source-dialog {
    align-items: end;
    padding: 10px;
  }

  .brain-source-dialog > section {
    width: 100%;
    max-height: 76dvh;
  }

  .brain-source-detail-list article {
    grid-template-columns: 26px minmax(0, 1fr) auto;
  }

  .brain-source-detail-list article time {
    display: none;
  }
}

/* Phase 3 secondary-brain control center */
.brain-dashboard-head {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.brain-view-tabs {
  display: flex;
  gap: 4px;
  justify-self: center;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.16);
}

.brain-view-tabs button {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  font-size: 0.7rem;
  font-weight: 760;
}

.brain-view-tabs button.is-active {
  color: #fff;
  background: rgba(23, 25, 29, 0.92);
}

.brain-view-tabs b {
  display: grid;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  place-items: center;
  border-radius: 4px;
  color: inherit;
  background: rgba(255, 255, 255, 0.2);
  font-size: 0.58rem;
}

.brain-automation-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.brain-automation-actions button {
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 5px;
  color: var(--text);
  background: rgba(186, 224, 198, 0.2);
  font-size: 0.67rem;
  font-weight: 750;
  text-align: left;
}

.brain-automation-actions button.is-approval_required {
  background: rgba(238, 210, 142, 0.18);
}

.brain-automation-actions button b {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.54rem;
}

.brain-action-feedback {
  padding: 7px 9px;
  border: 1px solid rgba(80, 152, 99, 0.24);
  border-radius: 5px;
  color: #2f6944;
  background: rgba(186, 224, 198, 0.18);
  font-size: 0.66rem;
  font-weight: 700;
}

.brain-action-feedback.is-error {
  color: #7a302b;
  border-color: rgba(189, 106, 98, 0.28);
  background: rgba(226, 154, 148, 0.18);
}

.brain-control-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 10px;
  height: clamp(420px, calc(100dvh - 180px), 680px);
  min-height: 420px;
}

.brain-control-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  padding: 12px;
}

.brain-control-panel.is-wide {
  min-height: clamp(420px, calc(100dvh - 180px), 680px);
}

.brain-control-list,
.brain-audit-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.brain-gate-row,
.brain-execution-row,
.brain-audit-row {
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
}

.brain-gate-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
}

.brain-gate-row + .brain-gate-row,
.brain-execution-row + .brain-execution-row,
.brain-audit-row + .brain-audit-row {
  margin-top: 6px;
}

.brain-gate-row > div:first-child,
.brain-execution-row > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.brain-gate-row strong,
.brain-execution-row strong {
  overflow: hidden;
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brain-gate-row span,
.brain-execution-row span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.brain-gate-row > b,
.brain-gate-row > em,
.brain-execution-row time {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-style: normal;
}

.brain-gate-actions {
  display: flex;
  grid-column: 1 / -1;
  gap: 5px;
}

.brain-gate-actions button,
.brain-control-empty button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 5px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.64rem;
  font-weight: 750;
}

.brain-gate-actions button:first-child {
  color: #fff;
  background: rgba(23, 25, 29, 0.9);
}

.brain-execution-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px;
}

.brain-audit-row {
  display: grid;
  grid-template-columns: 110px 92px minmax(0, 1fr) 96px;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 7px 10px;
  font-size: 0.68rem;
}

.brain-audit-row time,
.brain-audit-row b {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.58rem;
}

.brain-audit-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brain-skill-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.brain-skill-card {
  display: grid;
  grid-template-rows: auto auto minmax(56px, 1fr) auto;
  gap: 10px;
  min-height: 178px;
  padding: 12px;
}

.brain-skill-card.is-tint-1 { background-color: var(--tint-blue); }
.brain-skill-card.is-tint-2 { background-color: var(--tint-green); }
.brain-skill-card.is-tint-3 { background-color: var(--tint-yellow); }
.brain-skill-card.is-tint-4 { background-color: var(--tint-red); }

.brain-skill-card header,
.brain-skill-card > div,
.brain-skill-card footer {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.brain-skill-card header strong {
  font-size: 0.82rem;
}

.brain-skill-card header b,
.brain-skill-card > div,
.brain-skill-card footer {
  color: var(--muted);
  font-size: 0.62rem;
}

.brain-skill-card p {
  display: flex;
  gap: 4px;
  align-content: start;
  margin: 0;
  flex-wrap: wrap;
}

.brain-skill-card p i {
  padding: 3px 5px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.13);
  font-size: 0.58rem;
  font-style: normal;
}

.brain-control-empty {
  display: grid;
  gap: 10px;
  min-height: 420px;
  place-content: center;
  text-align: center;
}

body.glass-refined .brain-dashboard-head {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

body.glass-refined .brain-view-tabs,
body.glass-refined .brain-gate-row,
body.glass-refined .brain-execution-row,
body.glass-refined .brain-audit-row,
body.glass-refined .brain-automation-actions button {
  border-color: var(--glass-line-soft);
  backdrop-filter: blur(24px) saturate(1.12);
  -webkit-backdrop-filter: blur(24px) saturate(1.12);
}

@media (max-width: 1000px) {
  .brain-dashboard-head,
  body.glass-refined .brain-dashboard-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .brain-view-tabs {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .brain-view-tabs button {
    flex: 1;
    justify-content: center;
  }

  .brain-control-grid {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
  }

  .brain-control-panel {
    min-height: 360px;
  }

  .brain-skill-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .brain-view-tabs {
    overflow-x: auto;
  }

  .brain-view-tabs button {
    min-width: 74px;
    padding: 0 8px;
  }

  .brain-automation-actions,
  .brain-skill-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .brain-audit-row {
    grid-template-columns: 76px minmax(0, 1fr) 70px;
  }

  .brain-audit-row span {
    display: none;
  }
}

@media (max-width: 760px) {
  .mail-detail-panel {
    top: 72px;
    right: 10px;
    bottom: max(86px, env(safe-area-inset-bottom));
    left: 10px;
    width: auto;
  }

  .mail-reader-panel {
    top: 72px;
    right: 10px;
    bottom: max(86px, env(safe-area-inset-bottom));
    left: 10px;
  }

  body.is-mail-reader-open .mail-detail-panel.is-open {
    opacity: 0.18;
    pointer-events: none;
  }

  .mail-reader-head {
    padding: 16px 16px 13px;
  }

  .mail-reader-content {
    padding: 15px 16px 18px;
  }

  .mail-reader-text {
    min-height: 58dvh;
    font-size: 0.9rem;
  }

  .mail-open-meta {
    grid-template-columns: 1fr;
  }

  .mail-list-toolbar {
    grid-template-columns: 1fr;
  }

  .mail-list-controls {
    grid-template-columns: 1fr;
  }

  .mail-filter-toggle {
    width: 100%;
  }

  .mail-list-panel {
    min-height: 520px;
  }

  .mail-message-list {
    max-height: 54dvh;
  }

  .support-live-frame,
  .support-live-frame iframe {
    min-height: 420px;
  }
}

@media (max-width: 620px) {
  .people-live-panel {
    min-height: 520px;
  }

  .people-live-head {
    grid-template-areas:
      "title"
      "metrics"
      "refresh";
  }

  .people-live-head,
  .people-metric-grid,
  .people-source-strip,
  .people-toolbar {
    grid-template-columns: 1fr;
  }

  .people-visible-count {
    justify-content: center;
  }

  .people-live-refresh {
    width: 100%;
  }

  .people-table {
    max-height: 56dvh;
  }

  .people-loading {
    grid-template-columns: 1fr;
  }

  .shangqi-live-panel {
    min-height: 460px;
  }

  .shangqi-live-meta {
    grid-template-columns: 1fr;
  }

  .shangqi-snapshot-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shangqi-usage-head {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .shangqi-usage-yesterday {
    justify-content: space-between;
  }

  .shangqi-usage-yesterday > div {
    min-width: 0;
    flex: 1;
  }

  .shangqi-usage-plot {
    overflow-x: auto;
  }

  .shangqi-usage-svg {
    width: 640px;
    min-width: 640px;
    height: 245px;
  }

  .mailbox-current {
    min-height: 56px;
    padding: 9px 11px;
  }

  .mailbox-select {
    min-height: 48px;
  }

  .mailbox-select select {
    min-height: 48px;
  }

  .mail-message-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .mail-message-main {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .mail-message-main > span {
    justify-self: start;
  }

  .support-live-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .support-live-head .support-live-link {
    width: auto;
  }

  .support-conversation-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .support-conversation-row > div {
    grid-column: 1 / -1;
  }

  .support-status {
    justify-self: end;
  }

  .support-state-bar .support-state-list {
    grid-template-columns: 1fr;
  }

  .support-live-frame,
  .support-live-frame iframe {
    min-height: 360px;
  }

}

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

/* Refined translucent workspace */
body.glass-refined {
  --surface-shell: rgba(241, 243, 246, 0.2);
  --surface-panel: rgba(246, 248, 251, 0.1);
  --surface-card: rgba(255, 255, 255, 0.14);
  --surface-hover: rgba(255, 255, 255, 0.3);
  --tint-blue: rgba(187, 218, 245, 0.13);
  --tint-green: rgba(186, 224, 198, 0.13);
  --tint-yellow: rgba(238, 210, 142, 0.13);
  --tint-red: rgba(226, 154, 148, 0.12);
  --glass-line: rgba(255, 255, 255, 0.46);
  --glass-line-soft: rgba(255, 255, 255, 0.28);
  --glass-shadow: 0 20px 58px rgba(32, 38, 48, 0.1);
}

body.glass-refined .glass-window {
  border-color: rgba(255, 255, 255, 0.52);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.025) 58%, rgba(255, 255, 255, 0.08)),
    var(--surface-shell);
  backdrop-filter: blur(48px) saturate(1.18) contrast(1.02);
  -webkit-backdrop-filter: blur(48px) saturate(1.18) contrast(1.02);
  box-shadow:
    0 34px 94px rgba(24, 29, 38, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08);
}

body.glass-refined .tool-rail {
  border-color: rgba(255, 255, 255, 0.5);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.19), rgba(255, 255, 255, 0.035) 62%),
    rgba(240, 243, 247, 0.12);
  backdrop-filter: blur(44px) saturate(1.2);
  -webkit-backdrop-filter: blur(44px) saturate(1.2);
  box-shadow:
    0 22px 64px rgba(24, 29, 38, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

body.glass-refined .tool-button,
body.glass-refined .round-button,
body.glass-refined .rail-logo {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.19);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46);
}

body.glass-refined .tool-button:hover,
body.glass-refined .round-button:hover {
  background: rgba(255, 255, 255, 0.38);
}

body.glass-refined .tool-button.is-active {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(17, 18, 22, 0.9);
  box-shadow:
    0 10px 24px rgba(17, 18, 22, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

body.glass-refined .stage {
  padding: clamp(14px, 1.8vw, 24px);
}

body.glass-refined .journey-board,
body.glass-refined .journey-board.is-detail-hidden {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  min-height: max(600px, calc(100dvh - clamp(92px, 9vw, 120px)));
}

body.glass-refined .detail-panel[hidden] {
  display: none;
}

body.glass-refined .bi-shell {
  gap: 10px;
}

body.glass-refined .bi-head,
body.glass-refined .metric-card,
body.glass-refined .bi-panel,
body.glass-refined .brain-dashboard-head,
body.glass-refined .brain-source-card,
body.glass-refined .brain-metric-card,
body.glass-refined .brain-state-panel,
body.glass-refined .shangqi-snapshot-metric,
body.glass-refined .shangqi-snapshot-card,
body.glass-refined .shangqi-usage-chart,
body.glass-refined .account-tile,
body.glass-refined .account-section,
body.glass-refined .admin-console-block,
body.glass-refined .admin-row,
body.glass-refined .admin-role-grid > button,
body.glass-refined .device-row,
body.glass-refined .preference-toggle {
  border-color: var(--glass-line);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.025) 60%, rgba(255, 255, 255, 0.08)),
    var(--surface-card);
  backdrop-filter: blur(34px) saturate(1.18) contrast(1.02);
  -webkit-backdrop-filter: blur(34px) saturate(1.18) contrast(1.02);
  box-shadow:
    var(--glass-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08);
}

body.glass-refined .bi-panel::after {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.28), transparent 34%);
  opacity: 0.56;
}

body.glass-refined .bi-title span,
body.glass-refined .bi-state,
body.glass-refined .panel-head > span,
body.glass-refined .metric-card em,
body.glass-refined .brain-head-title > span,
body.glass-refined .brain-panel-head > div > span,
body.glass-refined .brain-metric-card em,
body.glass-refined .brain-source-card p,
body.glass-refined .brain-quality-note,
body.glass-refined .brain-policy-note p,
body.glass-refined .detail-top p,
body.glass-refined .mail-source-card em,
body.glass-refined .people-live-title > span,
body.glass-refined .people-live-title > em,
body.glass-refined .people-source em,
body.glass-refined .preference-toggle em,
body.glass-refined .account-page-head > div > span,
body.glass-refined .account-section-head > span,
body.glass-refined .security-subhead span,
body.glass-refined .admin-console-head span,
body.glass-refined .regard-feishu-url-text,
body.glass-refined .shangqi-page-card span,
body.glass-refined .shangqi-page-card em {
  display: none;
}

body.glass-refined .placeholder-row {
  grid-template-columns: minmax(0, 1fr) minmax(56px, 112px);
}

body.glass-refined .placeholder-row b {
  display: none;
}

body.glass-refined .bi-title strong {
  font-size: 1.55rem;
}

body.glass-refined .bi-head {
  min-height: 76px;
  padding: 10px 12px;
}

body.glass-refined .metric-grid,
body.glass-refined .people-metric-grid {
  gap: 8px;
}

body.glass-refined .metric-card,
body.glass-refined .people-metric-card {
  min-height: 82px;
  padding: 11px 12px;
}

body.glass-refined .metric-card:nth-child(4n + 1),
body.glass-refined .brain-metric-card:nth-child(4n + 1),
body.glass-refined .people-metric-card:nth-child(4n + 1) {
  background-color: var(--tint-blue);
}

body.glass-refined .metric-card:nth-child(4n + 2),
body.glass-refined .brain-metric-card:nth-child(4n + 2),
body.glass-refined .people-metric-card:nth-child(4n + 2) {
  background-color: var(--tint-green);
}

body.glass-refined .metric-card:nth-child(4n + 3),
body.glass-refined .brain-metric-card:nth-child(4n + 3),
body.glass-refined .people-metric-card:nth-child(4n + 3) {
  background-color: var(--tint-yellow);
}

body.glass-refined .metric-card:nth-child(4n + 4),
body.glass-refined .brain-metric-card:nth-child(4n + 4),
body.glass-refined .people-metric-card:nth-child(4n + 4) {
  background-color: var(--tint-red);
}

body.glass-refined .metric-card strong {
  font-size: 1.65rem;
}

body.glass-refined .mail-source-panel {
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

body.glass-refined .mail-source-panel::after {
  display: none;
}

body.glass-refined .mail-source-grid {
  grid-template-columns: repeat(3, minmax(118px, 160px));
  gap: 8px;
  justify-content: start;
}

body.glass-refined .mail-source-card {
  min-height: 54px;
  padding: 10px 12px;
  border-color: var(--glass-line);
  border-radius: 8px;
  background: var(--tint-blue);
  backdrop-filter: blur(24px) saturate(1.16);
  -webkit-backdrop-filter: blur(24px) saturate(1.16);
}

body.glass-refined .mail-source-card:nth-child(2) {
  background: var(--tint-green);
}

body.glass-refined .mail-source-card:nth-child(3) {
  background: var(--tint-yellow);
}

body.glass-refined .mail-source-card.is-active {
  border-color: rgba(23, 25, 29, 0.32);
  background: rgba(255, 255, 255, 0.34);
}

body.glass-refined .mail-list-panel {
  min-height: min(640px, calc(100dvh - 154px));
  padding: 13px;
}

body.glass-refined .mail-list-toolbar {
  gap: 8px;
}

body.glass-refined .mail-message-list {
  max-height: calc(100dvh - 342px);
}

body.glass-refined .mail-message-row {
  min-height: 52px;
  border-color: var(--glass-line-soft);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
}

body.glass-refined .mail-message-row:nth-child(4n + 1) {
  background-color: rgba(187, 218, 245, 0.08);
}

body.glass-refined .mail-message-row:nth-child(4n + 2) {
  background-color: rgba(186, 224, 198, 0.07);
}

body.glass-refined .mail-message-row:nth-child(4n + 3) {
  background-color: rgba(238, 210, 142, 0.07);
}

body.glass-refined .mail-message-row:nth-child(4n + 4) {
  background-color: rgba(226, 154, 148, 0.06);
}

body.glass-refined .mail-message-main strong,
body.glass-refined .mail-message-main p,
body.glass-refined .mail-message-main > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.glass-refined .brain-dashboard-head {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 56px;
  padding: 8px 10px;
}

body.glass-refined .brain-head-title strong {
  font-size: 1.2rem;
}

body.glass-refined .brain-head-actions em {
  font-size: 0.62rem;
}

body.glass-refined .brain-source-strip,
body.glass-refined .brain-metric-grid {
  gap: 7px;
}

body.glass-refined .brain-source-card {
  min-height: 62px;
  align-content: space-between;
  padding: 8px 9px;
  border-top-width: 2px;
}

body.glass-refined .brain-source-card.is-ready {
  background-color: var(--tint-green);
}

body.glass-refined .brain-source-card.is-partial {
  background-color: var(--tint-blue);
}

body.glass-refined .brain-source-card.is-stale {
  background-color: var(--tint-red);
}

body.glass-refined .brain-source-card.is-blocked,
body.glass-refined .brain-source-card.is-error {
  background-color: rgba(78, 84, 93, 0.07);
}

body.glass-refined .brain-source-card strong {
  font-size: 0.74rem;
  white-space: nowrap;
}

body.glass-refined .brain-metric-card {
  min-height: 58px;
  padding: 8px 10px;
}

body.glass-refined .brain-metric-card strong {
  font-size: 1.45rem;
}

body.glass-refined .brain-workspace {
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.72fr);
  height: clamp(360px, calc(100dvh - 342px), 500px);
  min-height: 360px;
}

body.glass-refined .brain-queue-panel,
body.glass-refined .brain-detail-card {
  height: 100%;
  max-height: none;
}

body.glass-refined .brain-queue-row {
  min-height: 54px;
  border-color: var(--glass-line-soft);
  background: rgba(255, 255, 255, 0.09);
}

body.glass-refined .brain-queue-row:hover,
body.glass-refined .brain-queue-row.is-active,
body.glass-refined .brain-queue-row:focus-visible {
  background: rgba(255, 255, 255, 0.28);
}

body.glass-refined .brain-row-copy strong,
body.glass-refined .brain-row-copy em {
  max-width: 100%;
}

body.glass-refined .brain-detail-head > div:first-child > strong {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
}

body.glass-refined .brain-detail-section p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
}

body.glass-refined .brain-detail-section ul {
  max-height: 88px;
  overflow-y: auto;
}

body.glass-refined .brain-policy-note {
  padding: 7px 9px;
  background: var(--tint-red);
}

body.glass-refined .brain-detail-actions button,
body.glass-refined .brain-detail-actions a {
  background: rgba(255, 255, 255, 0.16);
}

body.glass-refined .brain-detail-actions button.is-primary,
body.glass-refined .brain-detail-actions a.is-primary {
  background: rgba(23, 25, 29, 0.9);
}

body.glass-refined .support-live-panel {
  min-height: min(650px, calc(100dvh - 126px));
}

body.glass-refined .support-live-frame {
  border-color: var(--glass-line-soft);
  background: rgba(255, 255, 255, 0.08);
}

body.glass-refined .people-live-panel,
body.glass-refined .shangqi-live-panel {
  background-color: rgba(255, 255, 255, 0.06);
}

body.glass-refined .people-row,
body.glass-refined .shangqi-live-row {
  border-color: rgba(255, 255, 255, 0.25);
}

body.glass-refined .people-row:nth-child(even),
body.glass-refined .shangqi-live-row:nth-child(even) {
  background: rgba(187, 218, 245, 0.055);
}

body.glass-refined .shangqi-live-row.is-head,
body.glass-refined .people-row.is-head {
  background: rgba(232, 236, 241, 0.7);
  backdrop-filter: blur(28px) saturate(1.12);
  -webkit-backdrop-filter: blur(28px) saturate(1.12);
}

body.glass-refined .login-card,
body.glass-refined .mail-detail-window,
body.glass-refined .mail-reader-window {
  border-color: rgba(255, 255, 255, 0.56);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.045) 60%, rgba(255, 255, 255, 0.1)),
    rgba(238, 242, 247, 0.2);
  backdrop-filter: blur(48px) saturate(1.18) contrast(1.02);
  -webkit-backdrop-filter: blur(48px) saturate(1.18) contrast(1.02);
  box-shadow:
    0 34px 96px rgba(24, 29, 38, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.66);
}

body.glass-refined #accountPanel {
  background: rgba(42, 48, 57, 0.52);
  backdrop-filter: blur(10px) saturate(0.92);
  -webkit-backdrop-filter: blur(10px) saturate(0.92);
}

body.glass-refined #accountPanel .account-page-window,
body.glass-refined #accountPanel .security-subpage {
  border-color: rgba(255, 255, 255, 0.82);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(241, 245, 249, 0.34) 60%, rgba(255, 255, 255, 0.52)),
    rgb(228, 234, 241);
  backdrop-filter: blur(24px) saturate(1.06);
  -webkit-backdrop-filter: blur(24px) saturate(1.06);
  box-shadow:
    0 36px 100px rgba(24, 29, 38, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

body.glass-refined #accountPanel .security-subpage {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(233, 240, 247, 0.38) 60%, rgba(255, 255, 255, 0.56)),
    rgb(220, 229, 238);
}

body.glass-refined .account-tile,
body.glass-refined .account-section,
body.glass-refined .admin-console-block,
body.glass-refined .admin-row,
body.glass-refined .admin-role-grid > button,
body.glass-refined .device-row,
body.glass-refined .preference-toggle {
  border-radius: 8px;
}

body.glass-refined .access-list span,
body.glass-refined .security-list button,
body.glass-refined .admin-row > button {
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.13);
}

body.glass-refined .preference-toggle em {
  display: none;
}

@media (max-width: 900px) {
  body.glass-refined .brain-workspace {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    min-height: 0;
  }

  body.glass-refined .brain-queue-panel,
  body.glass-refined .brain-detail-card {
    height: auto;
    max-height: 430px;
  }
}

@media (max-width: 620px) {
  body.glass-refined .scene {
    padding: 78px 8px calc(16px + env(safe-area-inset-bottom));
  }

  body.glass-refined #accountPanel {
    background: rgba(38, 44, 52, 0.58);
    backdrop-filter: blur(6px) saturate(0.92);
    -webkit-backdrop-filter: blur(6px) saturate(0.92);
  }

  body.glass-refined #accountPanel .account-page-window,
  body.glass-refined #accountPanel .security-subpage {
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(239, 244, 248, 0.4) 60%, rgba(255, 255, 255, 0.58)),
      rgb(226, 233, 240);
    backdrop-filter: blur(16px) saturate(1.02);
    -webkit-backdrop-filter: blur(16px) saturate(1.02);
  }

  body.glass-refined .tool-rail {
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.035) 62%),
      rgba(232, 236, 244, 0.13);
  }

  body.glass-refined .glass-window {
    min-height: calc(100dvh - 88px);
    border-radius: 26px;
    background: rgba(232, 236, 244, 0.18);
  }

  body.glass-refined.is-shangqi-live-view .glass-window {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  body.glass-refined .stage {
    padding: 8px;
  }

  body.glass-refined .brain-dashboard-head {
    padding: 8px;
  }

  body.glass-refined .brain-head-actions em {
    display: none;
  }

  body.glass-refined .brain-source-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.glass-refined .brain-source-card {
    min-height: 60px;
  }

  body.glass-refined .brain-source-card > div {
    gap: 5px;
  }

  body.glass-refined .brain-source-card b {
    font-size: 0.54rem;
  }

  body.glass-refined .brain-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.glass-refined .brain-queue-list {
    max-height: 340px;
  }

  body.glass-refined .brain-detail-card {
    max-height: 440px;
  }

  body.glass-refined .mail-source-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.glass-refined .mail-source-card {
    min-width: 0;
  }

  body.glass-refined .mail-list-panel {
    min-height: 540px;
    padding: 10px;
  }

  body.glass-refined .mail-message-list {
    max-height: 50dvh;
  }

  body.glass-refined .mail-message-row {
    min-height: 58px;
  }

  body.glass-refined .bi-title strong {
    font-size: 1.15rem;
  }

  body.glass-refined .metric-card strong {
    font-size: 1.4rem;
  }
}

body.glass-refined .brain-dashboard-head {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

@media (max-width: 1000px) {
  body.glass-refined .brain-dashboard-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

/* MiniMax M3 settings */
.settings-page-window {
  width: min(100%, 760px);
}

.settings-avatar svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.55;
}

.model-settings-hero,
.model-toggle-row,
.model-settings-form,
.model-privacy-note {
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46);
}

.model-settings-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  background:
    radial-gradient(circle at 8% 16%, rgba(188, 107, 99, 0.18), transparent 36%),
    rgba(255, 255, 255, 0.14);
}

.model-settings-hero > div:first-child {
  display: grid;
  gap: 5px;
}

.model-settings-hero > div:first-child > span,
.model-field > span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.07em;
}

.model-settings-hero strong {
  font-size: 1.5rem;
  line-height: 1;
}

.model-settings-hero p,
.model-privacy-note p {
  margin: 0;
  color: var(--text);
  font-size: 0.79rem;
  line-height: 1.5;
}

.model-connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.2);
  font-size: 0.72rem;
  font-weight: 750;
  white-space: nowrap;
}

.model-connection-pill i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9aa0a8;
  box-shadow: 0 0 0 4px rgba(154, 160, 168, 0.1);
}

.model-connection-pill.is-ready i {
  background: #4f9770;
  box-shadow: 0 0 0 4px rgba(79, 151, 112, 0.12);
}

.model-connection-pill.is-error i {
  background: #bd6a62;
  box-shadow: 0 0 0 4px rgba(189, 106, 98, 0.12);
}

.model-connection-pill.is-loading i {
  animation: pulse 1.5s ease-in-out infinite;
}

.model-settings-form {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.model-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  cursor: pointer;
}

.model-toggle-row > span {
  display: grid;
  gap: 5px;
}

.model-toggle-row strong {
  font-size: 0.9rem;
}

.model-toggle-row small,
.model-field small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.model-toggle-row input {
  position: relative;
  width: 46px;
  height: 26px;
  flex: 0 0 auto;
  appearance: none;
  border: 1px solid rgba(17, 18, 22, 0.14);
  border-radius: 999px;
  background: rgba(90, 96, 106, 0.2);
  cursor: pointer;
  transition: background-color 180ms ease;
}

.model-toggle-row input::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 9px rgba(24, 29, 38, 0.18);
  content: "";
  transition: transform 180ms ease;
}

.model-toggle-row input:checked {
  background: rgba(17, 18, 22, 0.86);
}

.model-toggle-row input:checked::after {
  transform: translateX(20px);
}

.model-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.model-field {
  display: grid;
  gap: 7px;
}

.model-field input {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 14px;
  outline: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.28);
  padding: 0 12px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.model-field input:focus {
  border-color: rgba(189, 106, 98, 0.52);
  background: rgba(255, 255, 255, 0.4);
}

.model-field input[readonly] {
  color: var(--text);
  background: rgba(255, 255, 255, 0.14);
}

.model-api-key-field {
  padding-top: 2px;
}

.model-privacy-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
}

.model-privacy-note strong {
  color: var(--ink);
  font-size: 0.76rem;
  white-space: nowrap;
}

.model-settings-feedback {
  min-height: 18px;
  margin: 0;
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 650;
}

.model-settings-feedback.is-success {
  color: #3f825f;
}

.model-settings-feedback.is-error {
  color: #a94d47;
}

.model-settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.model-settings-actions button {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 750;
}

.model-test-button {
  border: 1px solid rgba(17, 18, 22, 0.14);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.26);
}

.model-save-button {
  border: 1px solid rgba(17, 18, 22, 0.18);
  color: #fff;
  background: rgba(17, 18, 22, 0.9);
  box-shadow: 0 12px 30px rgba(24, 29, 38, 0.14);
}

.model-settings-actions button:disabled {
  cursor: wait;
  opacity: 0.56;
}

.brain-model-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.14);
  font-size: 0.74rem;
}

.brain-model-banner > div {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.brain-model-banner i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #9aa0a8;
}

.brain-model-banner.is-ready i {
  background: #4f9770;
}

.brain-model-banner.is-fallback i,
.brain-model-banner.is-needs-key i {
  background: #bd6a62;
}

.brain-model-banner strong {
  color: var(--ink);
}

.brain-model-banner span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brain-model-banner em {
  flex: 0 0 auto;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-style: normal;
}

.brain-model-overview {
  margin: 0;
  padding: 0 4px;
  color: var(--text);
  font-size: 0.76rem;
  line-height: 1.55;
}

@media (max-width: 640px) {
  .settings-page-window {
    width: 100%;
  }

  .model-settings-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .model-field-grid {
    grid-template-columns: 1fr;
  }

  .model-privacy-note {
    grid-template-columns: 1fr;
  }

  .model-settings-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .brain-model-banner {
    align-items: flex-start;
    flex-direction: column;
  }
}

.brain-dashboard {
  width: 100%;
  min-width: 0;
}

.brain-dashboard > *,
.brain-dashboard-head > *,
.brain-view-tabs {
  min-width: 0;
}

.brain-view-tabs {
  max-width: 100%;
}

.brain-model-banner {
  border-radius: 8px;
}

@media (max-width: 620px) {
  .brain-view-tabs button {
    min-width: 0;
    padding: 0 5px;
  }

  .brain-view-tabs button span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brain-model-banner span {
    overflow: visible;
    white-space: normal;
  }

  .brain-model-overview {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    line-clamp: 4;
  }
}

/* Decision BI cockpit: one visual surface replaces the former source and metric cards. */
.brain-bi-overview {
  display: grid;
  grid-template-columns: minmax(260px, 0.62fr) minmax(0, 1.38fr);
  min-width: 0;
  min-height: 188px;
  overflow: hidden;
  border: 1px solid var(--glass-line-soft, rgba(255, 255, 255, 0.46));
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(187, 218, 245, 0.13), rgba(255, 255, 255, 0.06) 44%, rgba(186, 224, 198, 0.1)),
    rgba(238, 242, 247, 0.16);
  box-shadow:
    0 22px 58px rgba(35, 43, 55, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(34px) saturate(1.18);
  -webkit-backdrop-filter: blur(34px) saturate(1.18);
}

.brain-bi-summary {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-width: 0;
  padding: 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(187, 218, 245, 0.08);
}

.brain-bi-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 124px;
  aspect-ratio: 1;
}

.brain-bi-ring svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.brain-bi-ring circle {
  fill: none;
  stroke-width: 8;
}

.brain-bi-ring-base {
  stroke: rgba(78, 84, 93, 0.12);
}

.brain-bi-ring-value {
  stroke: #bd6a62;
  stroke-linecap: round;
  filter: drop-shadow(0 4px 8px rgba(189, 106, 98, 0.2));
}

.brain-bi-ring > div {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 2px;
}

.brain-bi-ring strong {
  color: var(--ink);
  font-size: 2.08rem;
  line-height: 1;
}

.brain-bi-ring span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 750;
}

.brain-bi-priority {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.brain-bi-priority-bar {
  display: flex;
  width: 100%;
  min-height: 72px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
}

.brain-bi-priority-bar > span {
  display: grid;
  flex: var(--brain-priority-flex) 1 0;
  align-content: center;
  gap: 3px;
  min-width: 58px;
  padding: 9px 11px;
}

.brain-bi-priority-bar > span + span {
  border-left: 1px solid rgba(255, 255, 255, 0.52);
}

.brain-bi-priority-bar .is-high {
  color: #7a2924;
  background: rgba(226, 154, 148, 0.3);
}

.brain-bi-priority-bar .is-review {
  color: #315c45;
  background: rgba(186, 224, 198, 0.28);
}

.brain-bi-priority-bar b {
  font-size: 1.28rem;
  line-height: 1;
}

.brain-bi-priority-bar em,
.brain-bi-source-row em {
  color: currentColor;
  font-family: var(--font-mono);
  font-size: 0.59rem;
  font-style: normal;
  font-weight: 700;
}

.brain-bi-posture {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--text);
  font-size: 0.67rem;
  font-weight: 700;
}

.brain-bi-posture span,
.brain-bi-legend span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.brain-bi-posture i,
.brain-bi-legend i {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #6f95b0;
}

.brain-bi-posture .is-stale i,
.brain-bi-legend .is-stale i {
  background: #bd6a62;
}

.brain-bi-posture .is-gated i,
.brain-bi-legend .is-partial i {
  background: #6f95b0;
}

.brain-bi-legend .is-ready i {
  background: #509863;
}

.brain-bi-sources {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  padding: 13px 15px 14px;
}

.brain-bi-sources > header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.brain-bi-sources > header strong {
  color: var(--ink);
  font-size: 0.78rem;
}

.brain-bi-legend {
  display: flex;
  gap: 11px;
  align-items: center;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 700;
}

.brain-bi-source-matrix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  min-width: 0;
}

.brain-bi-source-row {
  display: grid;
  grid-template-columns: minmax(72px, 0.78fr) minmax(66px, 1.5fr) 40px 56px;
  gap: 7px;
  align-items: center;
  min-width: 0;
  min-height: 27px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
  color: var(--muted);
}

.brain-bi-source-row span {
  overflow: hidden;
  color: var(--text);
  font-size: 0.67rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brain-bi-source-row strong {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  text-align: right;
}

.brain-bi-source-row em {
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brain-bi-source-track {
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(78, 84, 93, 0.1);
}

.brain-bi-source-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #4e545d;
  box-shadow: 0 2px 7px rgba(78, 84, 93, 0.16);
}

.brain-bi-source-row.is-ready .brain-bi-source-track i {
  background: #509863;
}

.brain-bi-source-row.is-partial .brain-bi-source-track i {
  background: #6f95b0;
}

.brain-bi-source-row.is-stale .brain-bi-source-track i {
  background: #bd6a62;
}

@media (max-width: 1180px) {
  .brain-bi-overview {
    grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1.3fr);
  }

  .brain-bi-summary {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .brain-bi-ring {
    width: 106px;
  }

  .brain-bi-source-matrix {
    gap: 0 14px;
  }

  .brain-bi-source-row {
    grid-template-columns: minmax(68px, 0.85fr) minmax(46px, 1.2fr) 36px 50px;
    gap: 5px;
  }
}

@media (max-width: 900px) {
  .brain-bi-overview {
    grid-template-columns: 1fr;
  }

  .brain-bi-summary {
    grid-template-columns: 116px minmax(0, 1fr);
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.42);
  }

  .brain-bi-ring {
    width: 108px;
  }
}

@media (max-width: 620px) {
  .brain-bi-summary {
    grid-template-columns: 96px minmax(0, 1fr);
    padding: 10px;
  }

  .brain-bi-ring {
    width: 92px;
  }

  .brain-bi-ring strong {
    font-size: 1.7rem;
  }

  .brain-bi-priority-bar {
    min-height: 58px;
  }

  .brain-bi-priority-bar > span {
    padding: 7px 8px;
  }

  .brain-bi-posture {
    gap: 9px;
  }

  .brain-bi-sources {
    padding: 11px 10px 12px;
  }

  .brain-bi-sources > header {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .brain-bi-source-matrix {
    grid-template-columns: 1fr;
  }

  .brain-bi-source-row {
    grid-template-columns: minmax(78px, 0.9fr) minmax(70px, 1.5fr) 38px 54px;
  }
}

/* Finance Base aggregation */
.finance-dashboard {
  min-width: 0;
}

.finance-live-panel {
  display: grid;
  gap: 10px;
  min-height: calc(100dvh - 96px);
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 8px;
  background: rgba(246, 249, 250, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(28px) saturate(1.12);
  -webkit-backdrop-filter: blur(28px) saturate(1.12);
}

.finance-live-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
}

.finance-live-state {
  display: flex;
  gap: 7px;
  align-items: center;
  min-width: 0;
  color: var(--muted);
  font-size: 0.64rem;
}

.finance-live-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #56ad7c;
  box-shadow: 0 0 0 4px rgba(86, 173, 124, 0.12);
}

.finance-live-state.is-loading i,
.finance-live-state.is-partial i {
  background: #d5a84f;
  box-shadow: 0 0 0 4px rgba(213, 168, 79, 0.12);
}

.finance-live-state strong {
  color: var(--text);
  font-size: 0.7rem;
}

.finance-live-state span {
  font-family: var(--font-mono);
  font-size: 0.58rem;
}

.finance-refresh {
  min-width: 64px;
  min-height: 32px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 6px;
  color: #fff;
  background: rgba(23, 25, 29, 0.92);
  font-size: 0.68rem;
  font-weight: 760;
}

.finance-refresh:disabled {
  opacity: 0.58;
}

.finance-refresh.is-refreshing {
  animation: finance-refresh-pulse 1.1s ease-in-out infinite;
}

@keyframes finance-refresh-pulse {
  50% { opacity: 0.52; }
}

.finance-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.finance-metric {
  display: grid;
  gap: 8px;
  min-width: 0;
  min-height: 88px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 6px;
  background: rgba(218, 231, 241, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.finance-metric.is-income { background-color: rgba(174, 220, 195, 0.22); }
.finance-metric.is-expense { background-color: rgba(235, 176, 169, 0.2); }
.finance-metric.is-net-negative { background-color: rgba(222, 183, 177, 0.25); }
.finance-metric.is-net-positive { background-color: rgba(176, 218, 190, 0.25); }
.finance-metric.is-records { background-color: rgba(192, 186, 221, 0.2); }

.finance-metric span,
.finance-brand-card header span,
.finance-brand-metrics span,
.finance-brand-scope,
.finance-analysis-panel header span {
  color: var(--muted);
  font-size: 0.59rem;
}

.finance-metric strong {
  overflow: hidden;
  font-size: clamp(1.18rem, 2.2vw, 1.75rem);
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(300px, 0.86fr);
  gap: 9px;
  align-items: stretch;
  min-width: 0;
}

.finance-brand-list {
  display: contents;
}

.finance-brand-card,
.finance-analysis-panel {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 7px;
  background: rgba(246, 248, 249, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.44);
  backdrop-filter: blur(24px) saturate(1.1);
  -webkit-backdrop-filter: blur(24px) saturate(1.1);
}

.finance-brand-card.is-coffee { background-color: rgba(240, 207, 109, 0.18); }
.finance-brand-card.is-ritmohub { background-color: rgba(231, 190, 105, 0.16); }
.finance-brand-card.is-error { background-color: rgba(226, 161, 156, 0.18); }
.finance-analysis-panel { background-color: rgba(176, 207, 224, 0.16); }

.finance-brand-card > header,
.finance-analysis-panel > header {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
}

.finance-brand-card > header > div,
.finance-analysis-panel > header > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.finance-brand-card header strong,
.finance-analysis-panel header strong {
  font-size: 0.9rem;
}

.finance-brand-card header a,
.finance-analysis-panel header > b {
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 5px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.57rem;
  font-style: normal;
  font-weight: 720;
  text-decoration: none;
  white-space: nowrap;
}

.finance-analysis-panel header > b.is-ready {
  color: #235d42;
  background-color: rgba(174, 220, 195, 0.28);
}

.finance-brand-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
}

.finance-brand-metrics > div {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.11);
}

.finance-brand-metrics strong {
  overflow: hidden;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-brand-metrics .is-negative strong { color: #9d403a; }
.finance-brand-metrics .is-positive strong { color: #276849; }

.finance-brand-scope {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.finance-brand-scope b {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.57rem;
}

.finance-brand-breakdowns {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.finance-brand-card.is-ritmohub .finance-brand-breakdowns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.finance-breakdown-block {
  min-width: 0;
}

.finance-breakdown-block > strong,
.finance-analysis-columns > section > strong {
  display: block;
  margin-bottom: 7px;
  font-size: 0.64rem;
}

.finance-breakdown-list,
.finance-insight-list {
  display: grid;
  gap: 5px;
}

.finance-breakdown-block.is-dimensional .finance-breakdown-list {
  max-height: 250px;
  overflow-y: auto;
  padding-right: 3px;
  scrollbar-color: rgba(108, 91, 49, 0.42) transparent;
}

.finance-breakdown-row {
  display: grid;
  grid-template-columns: minmax(62px, 0.85fr) minmax(42px, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.finance-breakdown-label {
  display: flex;
  gap: 5px;
  align-items: center;
  min-width: 0;
}

.finance-breakdown-label > span {
  overflow: hidden;
  font-size: 0.57rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-breakdown-label > small {
  flex: 0 0 auto;
  padding: 1px 4px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 4px;
  color: #735913;
  background: rgba(242, 215, 137, 0.28);
  font-size: 0.46rem;
  font-weight: 800;
}

.finance-breakdown-label > small.is-project {
  color: #6e481e;
  background: rgba(224, 184, 113, 0.3);
}

.finance-breakdown-row > i {
  overflow: hidden;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.28);
}

.finance-breakdown-row > i > b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #c89f3b;
}

.finance-breakdown-row.is-ritmohub > i > b { background: #b78235; }
.finance-breakdown-row.is-expense > i > b { background: #b8645d; }

.finance-breakdown-row > em {
  display: grid;
  gap: 1px;
  justify-items: end;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.53rem;
  font-style: normal;
  white-space: nowrap;
}

.finance-breakdown-row > em small {
  color: #806723;
  font-size: 0.46rem;
}

.finance-breakdown-empty,
.finance-brand-error,
.finance-analysis-empty {
  color: var(--muted);
  font-size: 0.62rem;
}

.finance-brand-error {
  display: grid;
  min-height: 240px;
  place-content: center;
  text-align: center;
}

.finance-analysis-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px;
  gap: 8px;
  align-items: center;
  width: 100%;
  margin: 12px 0;
  padding: 10px;
  border: 0;
  border-left: 3px solid rgba(66, 108, 139, 0.62);
  border-radius: 0 5px 5px 0;
  color: #303a43;
  background: rgba(255, 255, 255, 0.12);
  font-family: inherit;
  font-size: 0.68rem;
  line-height: 1.55;
  text-align: left;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
}

.finance-analysis-summary:hover,
.finance-analysis-summary:focus-visible {
  background: rgba(255, 255, 255, 0.26);
  outline: none;
  transform: translateX(2px);
}

.finance-analysis-summary svg,
.finance-insight-row > svg,
.finance-action-row > svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  opacity: 0.48;
}

.finance-analysis-columns {
  display: grid;
  gap: 12px;
}

.finance-insight-row,
.finance-action-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 18px;
  gap: 7px;
  align-items: start;
  width: 100%;
  padding: 7px 0;
  border-top: 0;
  border-right: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.34);
  border-left: 0;
  border-radius: 0;
  color: var(--text);
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 160ms ease, padding 160ms ease;
}

.finance-insight-row:hover,
.finance-insight-row:focus-visible,
.finance-action-row:hover,
.finance-action-row:focus-visible {
  padding-right: 5px;
  padding-left: 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.2);
  outline: none;
}

.finance-insight-row:last-child,
.finance-action-row:last-child {
  border-bottom: 0;
}

.finance-insight-row > i {
  width: 7px;
  height: 7px;
  margin-top: 3px;
  border-radius: 50%;
  background: #c79a42;
}

.finance-insight-row.is-high > i { background: #c65b54; }
.finance-insight-row.is-low > i { background: #5fa47c; }

.finance-insight-row > div,
.finance-action-row > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.finance-insight-row strong,
.finance-action-row strong {
  font-size: 0.63rem;
}

.finance-insight-row span,
.finance-action-row span {
  color: var(--muted);
  font-size: 0.57rem;
  line-height: 1.45;
}

.finance-action-row > b {
  display: grid;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  color: #fff;
  background: rgba(23, 25, 29, 0.82);
  font-family: var(--font-mono);
  font-size: 0.52rem;
  place-content: center;
}

#financeAnalysisDialogRoot:empty {
  display: none;
}

body.is-finance-dialog-open {
  overflow: hidden;
}

.finance-analysis-dialog {
  position: fixed;
  inset: 0;
  z-index: 420;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(26, 32, 40, 0.24);
  backdrop-filter: blur(13px) saturate(1.08);
  -webkit-backdrop-filter: blur(13px) saturate(1.08);
}

.finance-analysis-dialog-window {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(920px, calc(100vw - 36px));
  max-height: min(720px, calc(100dvh - 36px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 8px;
  background: rgba(224, 231, 237, 0.82);
  box-shadow: 0 30px 90px rgba(24, 34, 45, 0.24), inset 0 1px rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(42px) saturate(1.22);
  -webkit-backdrop-filter: blur(42px) saturate(1.22);
}

.finance-analysis-dialog-window > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.15);
}

.finance-analysis-dialog-window > header > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.finance-analysis-dialog-window > header span,
.finance-dialog-chat > header em,
.finance-dialog-message > span,
.finance-dialog-item-mark span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-style: normal;
  font-weight: 800;
}

.finance-analysis-dialog-window > header strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-analysis-dialog-window > header button {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.2);
  place-content: center;
  cursor: pointer;
}

.finance-analysis-dialog-window > header button svg,
.finance-dialog-composer button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.finance-dialog-body {
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1.22fr);
  min-height: 0;
}

.finance-dialog-context {
  min-width: 0;
  overflow-y: auto;
  padding: 20px;
  border-right: 1px solid rgba(255, 255, 255, 0.46);
  background: rgba(190, 214, 231, 0.16);
}

.finance-dialog-context.is-high { background-color: rgba(226, 166, 160, 0.17); }
.finance-dialog-context.is-low { background-color: rgba(176, 220, 195, 0.17); }
.finance-dialog-context.is-action { background-color: rgba(234, 207, 144, 0.16); }

.finance-dialog-item-mark {
  display: flex;
  align-items: center;
  gap: 7px;
}

.finance-dialog-item-mark i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b98232;
}

.finance-dialog-context.is-high .finance-dialog-item-mark i { background: #bd514b; }
.finance-dialog-context.is-low .finance-dialog-item-mark i { background: #4d966e; }

.finance-dialog-context h3 {
  margin: 14px 0 9px;
  color: var(--ink);
  font-size: clamp(1.15rem, 2vw, 1.65rem);
  line-height: 1.16;
}

.finance-dialog-context > p {
  margin: 0;
  color: #35424d;
  font-size: 0.74rem;
  line-height: 1.68;
}

.finance-dialog-context dl {
  display: grid;
  gap: 0;
  margin: 24px 0 0;
}

.finance-dialog-context dl > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.42);
}

.finance-dialog-context dt {
  color: var(--muted);
  font-size: 0.6rem;
}

.finance-dialog-context dd {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 800;
  text-align: right;
}

.finance-dialog-chat {
  display: grid;
  grid-template-rows: auto minmax(160px, 1fr) auto auto;
  min-width: 0;
  min-height: 0;
  padding: 14px;
}

.finance-dialog-chat > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 1px 1px 11px;
}

.finance-dialog-chat > header strong {
  color: var(--ink);
  font-size: 0.82rem;
}

.finance-dialog-chat > header em {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.finance-dialog-chat > header em::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5aa079;
  content: "";
}

.finance-dialog-chat > header em.is-loading::before {
  background: #c7983c;
  animation: finance-refresh-pulse 1s ease-in-out infinite;
}

.finance-dialog-chat > header em.is-error::before { background: #c45d57; }

.finance-dialog-messages {
  display: flex;
  min-height: 0;
  overflow-y: auto;
  flex-direction: column;
  gap: 8px;
  padding: 3px 3px 10px;
  scrollbar-width: thin;
}

.finance-dialog-message {
  width: min(90%, 480px);
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.18);
}

.finance-dialog-message.is-user {
  align-self: flex-end;
  background: rgba(190, 216, 235, 0.3);
}

.finance-dialog-message > div {
  color: #27323a;
  font-size: 0.69rem;
  line-height: 1.58;
}

.finance-dialog-message p,
.finance-dialog-message h4,
.finance-dialog-message ul,
.finance-dialog-message ol,
.finance-dialog-message blockquote {
  margin: 6px 0 0;
}

.finance-dialog-message ul,
.finance-dialog-message ol {
  padding-left: 18px;
}

.finance-dialog-message code {
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.26);
}

.finance-dialog-prompts {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 7px;
  margin: auto 0;
}

.finance-dialog-prompts button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 5px;
  color: #314351;
  background: rgba(255, 255, 255, 0.18);
  font-family: inherit;
  font-size: 0.62rem;
  font-weight: 760;
  cursor: pointer;
}

.finance-dialog-error {
  margin: 0 0 7px;
  color: #9e403a;
  font-size: 0.61rem;
}

.finance-dialog-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: end;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.42);
}

.finance-dialog-composer textarea {
  width: 100%;
  min-height: 64px;
  max-height: 150px;
  resize: vertical;
  padding: 10px 11px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.22);
  font: inherit;
  font-size: 0.69rem;
  line-height: 1.45;
  outline: none;
}

.finance-dialog-composer textarea:focus {
  border-color: rgba(65, 104, 133, 0.48);
  box-shadow: 0 0 0 2px rgba(105, 155, 190, 0.13);
}

.finance-dialog-composer button {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(23, 25, 29, 0.16);
  border-radius: 6px;
  color: #fff;
  background: rgba(23, 25, 29, 0.9);
  place-content: center;
  cursor: pointer;
}

.finance-dialog-composer button:disabled {
  cursor: default;
  opacity: 0.36;
}

.finance-cache-warning {
  padding: 7px 9px;
  border-left: 3px solid #c79a42;
  color: #725724;
  background: rgba(236, 208, 145, 0.16);
  font-size: 0.6rem;
}

.finance-live-empty,
.finance-loading {
  display: grid;
  min-height: 440px;
  place-content: center;
}

.finance-live-empty {
  gap: 12px;
  justify-items: center;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}

.finance-live-empty button {
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 5px;
  color: #fff;
  background: rgba(23, 25, 29, 0.9);
}

.finance-loading {
  grid-template-columns: repeat(4, 96px);
  gap: 8px;
}

.finance-loading span {
  height: 84px;
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  animation: finance-refresh-pulse 1.2s ease-in-out infinite;
}

@media (max-width: 1180px) {
  .finance-dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .finance-brand-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .finance-analysis-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .finance-live-panel {
    min-height: 620px;
    padding: 10px;
  }

  .finance-metric-grid,
  .finance-brand-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-analysis-columns,
  .finance-brand-card.is-ritmohub .finance-brand-breakdowns {
    grid-template-columns: minmax(0, 1fr);
  }

  .finance-analysis-dialog {
    align-items: end;
    padding: 10px;
  }

  .finance-analysis-dialog-window {
    width: 100%;
    max-height: calc(100dvh - 20px);
  }

  .finance-dialog-body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(150px, auto) minmax(310px, 1fr);
    overflow-y: auto;
  }

  .finance-dialog-context {
    max-height: 290px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.46);
  }

  .finance-dialog-chat {
    min-height: 390px;
  }
}

@media (max-width: 520px) {
  .finance-live-head {
    align-items: stretch;
    flex-direction: column;
  }

  .finance-refresh {
    width: 100%;
  }

  .finance-metric-grid,
  .finance-brand-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .finance-metric {
    min-height: 76px;
  }

  .finance-metric strong {
    font-size: 1.45rem;
  }
}

/* ONDACO production business summary */
.ondaco-dashboard {
  padding: 0;
}

.ondaco-live-panel {
  min-height: 560px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 7px;
  background: rgba(248, 250, 251, 0.23);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48), 0 20px 42px rgba(34, 42, 48, 0.08);
  backdrop-filter: blur(22px) saturate(128%);
}

.ondaco-head,
.ondaco-brand,
.ondaco-head-actions,
.ondaco-panel-head,
.ondaco-health-item > div {
  display: flex;
  align-items: center;
}

.ondaco-head {
  min-height: 58px;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.ondaco-brand {
  gap: 11px;
}

.ondaco-brand-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 7px;
  color: #fff;
  background: rgba(24, 30, 34, 0.92);
  box-shadow: 0 10px 22px rgba(18, 25, 29, 0.12);
}

.ondaco-brand-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.ondaco-brand div {
  display: grid;
  gap: 2px;
}

.ondaco-brand small,
.ondaco-panel-head span,
.ondaco-connect > div span {
  color: #697681;
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0;
}

.ondaco-brand strong {
  font-size: 1.18rem;
}

.ondaco-head-actions {
  gap: 7px;
}

.ondaco-head-actions > a,
.ondaco-head-actions > button,
.ondaco-connect > button,
.ondaco-health-link {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 5px;
  color: #fff;
  background: rgba(23, 27, 31, 0.9);
  font-size: 0.68rem;
  font-weight: 800;
  text-decoration: none;
}

.ondaco-head-actions > button:disabled,
.ondaco-connect > button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.ondaco-source-state {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 5px;
  color: #40505a;
  background: rgba(255, 255, 255, 0.25);
  font-size: 0.65rem;
  font-weight: 800;
}

.ondaco-source-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2cad74;
  box-shadow: 0 0 0 4px rgba(44, 173, 116, 0.12);
}

.ondaco-source-state.is-cached i,
.ondaco-source-state.is-auth i {
  background: #d59c2c;
  box-shadow: 0 0 0 4px rgba(213, 156, 44, 0.12);
}

.ondaco-source-state small {
  grid-column: 2;
  color: #77838c;
  font-size: 0.54rem;
  font-weight: 700;
}

.ondaco-connect {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(140px, 0.7fr) minmax(140px, 0.7fr) auto;
  align-items: end;
  gap: 8px;
  margin-bottom: 11px;
  padding: 10px;
  border: 1px solid rgba(211, 159, 62, 0.3);
  border-radius: 6px;
  background: rgba(247, 226, 174, 0.19);
}

.ondaco-connect > div,
.ondaco-connect label {
  display: grid;
  gap: 4px;
}

.ondaco-connect > div strong {
  font-size: 0.78rem;
}

.ondaco-connect label span {
  color: #64717a;
  font-size: 0.58rem;
  font-weight: 800;
}

.ondaco-connect input {
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 4px;
  outline: 0;
  background: rgba(255, 255, 255, 0.4);
}

.ondaco-connect input:focus {
  border-color: rgba(26, 87, 119, 0.52);
  box-shadow: 0 0 0 3px rgba(26, 87, 119, 0.08);
}

.ondaco-connect p {
  grid-column: 1 / -1;
  margin: 0;
  color: #9a3f35;
  font-size: 0.62rem;
}

.ondaco-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 9px;
}

.ondaco-metric {
  position: relative;
  display: grid;
  min-height: 91px;
  align-content: space-between;
  padding: 11px 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.61);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.28);
}

.ondaco-metric::after {
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  content: "";
  background: #3d5665;
  opacity: 0.68;
}

.ondaco-metric.is-orders { background: rgba(198, 224, 238, 0.31); }
.ondaco-metric.is-orders::after { background: #3c8db2; }
.ondaco-metric.is-revenue { background: rgba(227, 237, 197, 0.3); }
.ondaco-metric.is-revenue::after { background: #809e3f; }
.ondaco-metric.is-modules { background: rgba(239, 218, 187, 0.29); }
.ondaco-metric.is-modules::after { background: #b8843b; }

.ondaco-metric span {
  color: #66747e;
  font-size: 0.64rem;
  font-weight: 800;
}

.ondaco-metric strong {
  overflow-wrap: anywhere;
  font-size: clamp(1.28rem, 2vw, 1.85rem);
  line-height: 1;
}

.ondaco-metric small {
  color: #65727b;
  font-size: 0.58rem;
  font-weight: 700;
}

.ondaco-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(235px, 0.32fr);
  gap: 9px;
}

.ondaco-panel {
  min-width: 0;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.2);
}

.ondaco-panel-head {
  min-height: 34px;
  justify-content: space-between;
  margin-bottom: 7px;
}

.ondaco-panel-head > div {
  display: grid;
  gap: 2px;
}

.ondaco-panel-head strong {
  font-size: 0.83rem;
}

.ondaco-panel-head > b {
  display: grid;
  min-width: 30px;
  height: 26px;
  place-items: center;
  border-radius: 4px;
  color: #fff;
  background: rgba(30, 36, 40, 0.86);
  font-size: 0.65rem;
}

.ondaco-merchant-list {
  display: grid;
  max-height: 338px;
  gap: 5px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.ondaco-merchant-row {
  display: grid;
  grid-template-columns: 34px minmax(145px, 1fr) 68px 110px minmax(120px, 0.8fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 55px;
  padding: 7px 8px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 5px;
  color: inherit;
  background: rgba(255, 255, 255, 0.18);
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.ondaco-merchant-row:hover {
  border-color: rgba(38, 74, 91, 0.28);
  background: rgba(255, 255, 255, 0.38);
  transform: translateY(-1px);
}

.ondaco-merchant-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 5px;
  color: #fff;
  background: rgba(29, 36, 41, 0.9);
  font-size: 0.62rem;
  font-weight: 900;
}

.ondaco-merchant-identity,
.ondaco-merchant-orders,
.ondaco-merchant-revenue {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.ondaco-merchant-identity strong,
.ondaco-merchant-identity small,
.ondaco-merchant-orders strong,
.ondaco-merchant-revenue strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ondaco-merchant-identity strong {
  font-size: 0.72rem;
}

.ondaco-merchant-identity small,
.ondaco-merchant-orders small,
.ondaco-merchant-revenue small {
  color: #72808a;
  font-size: 0.54rem;
}

.ondaco-merchant-orders strong,
.ondaco-merchant-revenue strong {
  font-size: 0.68rem;
}

.ondaco-merchant-modules {
  display: flex;
  min-width: 0;
  gap: 3px;
  overflow: hidden;
}

.ondaco-merchant-modules i,
.ondaco-status {
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 0.52rem;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.ondaco-merchant-modules i {
  color: #50616c;
  background: rgba(221, 231, 235, 0.66);
}

.ondaco-status {
  color: #695b34;
  background: rgba(239, 218, 164, 0.54);
}

.ondaco-status.is-active,
.ondaco-status.is-online {
  color: #236446;
  background: rgba(180, 225, 198, 0.55);
}

.ondaco-status.is-expired,
.ondaco-status.is-suspended,
.ondaco-status.is-blocked,
.ondaco-status.is-revoked {
  color: #8c3f39;
  background: rgba(238, 188, 184, 0.52);
}

.ondaco-health {
  display: grid;
  align-content: start;
}

.ondaco-health-item {
  display: grid;
  gap: 6px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
}

.ondaco-health-item > div {
  justify-content: space-between;
  color: #52616b;
  font-size: 0.64rem;
  font-weight: 800;
}

.ondaco-health-item > i {
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(69, 82, 90, 0.1);
}

.ondaco-health-item > i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #326f8d, #77a24e);
}

.ondaco-health-counts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 10px 0;
}

.ondaco-health-counts span {
  display: grid;
  gap: 2px;
  padding: 9px;
  border-radius: 5px;
  color: #68757e;
  background: rgba(255, 255, 255, 0.24);
  font-size: 0.55rem;
}

.ondaco-health-counts strong {
  color: #1d252a;
  font-size: 1rem;
}

.ondaco-health-link {
  display: grid;
  margin-top: auto;
  place-items: center;
}

.ondaco-warning {
  margin-top: 8px;
  padding: 8px 10px;
  border-left: 3px solid #c98943;
  color: #76542d;
  background: rgba(242, 220, 183, 0.24);
  font-size: 0.6rem;
}

.ondaco-empty,
.ondaco-loading {
  display: grid;
  min-height: 300px;
  place-content: center;
  gap: 10px;
  color: #697780;
  text-align: center;
}

.ondaco-empty a {
  color: #315e76;
  font-size: 0.65rem;
  font-weight: 800;
}

.ondaco-loading {
  grid-template-columns: repeat(3, 12px);
}

.ondaco-loading span {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: rgba(39, 83, 105, 0.48);
  animation: finance-refresh-pulse 1.1s ease-in-out infinite;
}

@media (max-width: 980px) {
  .ondaco-connect {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ondaco-connect > div {
    grid-column: 1 / -1;
  }

  .ondaco-connect > button {
    grid-column: 2;
  }

  .ondaco-content-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ondaco-merchant-row {
    grid-template-columns: 34px minmax(130px, 1fr) 64px 105px auto;
  }

  .ondaco-merchant-modules {
    display: none;
  }
}

@media (max-width: 700px) {
  .ondaco-live-panel {
    min-height: 600px;
    padding: 10px;
  }

  .ondaco-head {
    align-items: stretch;
    flex-direction: column;
  }

  .ondaco-head-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .ondaco-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ondaco-connect {
    grid-template-columns: minmax(0, 1fr);
  }

  .ondaco-connect > div,
  .ondaco-connect > button {
    grid-column: 1;
  }

  .ondaco-merchant-row {
    grid-template-columns: 34px minmax(115px, 1fr) 58px auto;
  }

  .ondaco-merchant-revenue {
    display: none;
  }
}

@media (max-width: 460px) {
  .ondaco-head-actions {
    grid-template-columns: minmax(0, 1fr) repeat(2, auto);
  }

  .ondaco-head-actions > a,
  .ondaco-head-actions > button {
    padding: 0 9px;
  }

  .ondaco-merchant-row {
    grid-template-columns: 32px minmax(95px, 1fr) auto;
  }

  .ondaco-merchant-orders {
    display: none;
  }
}

/* Login motion backdrop */
.login-view {
  isolation: isolate;
  overflow: hidden;
  background: #000;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.login-view::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  content: "";
  background: rgba(0, 0, 0, 0.12);
}

.login-motion {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background-color: #000;
}

.login-motion video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  mix-blend-mode: normal;
  transform: none;
}

.login-motion video {
  z-index: 0;
  object-fit: cover;
  opacity: 1;
  image-rendering: auto;
  filter: contrast(1.035) brightness(0.98) saturate(1.035);
  backface-visibility: hidden;
  transition: opacity 220ms ease;
}

.login-motion video.is-switching {
  opacity: 0;
}

/* Research center */
.research-dashboard {
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.research-live-panel {
  position: relative;
  display: grid;
  min-height: 100%;
  padding: 12px;
  overflow: hidden;
  color: #1d2227;
  background:
    radial-gradient(circle at 8% 6%, rgba(255, 255, 255, 0.58), transparent 31%),
    linear-gradient(145deg, rgba(240, 244, 246, 0.5), rgba(200, 207, 212, 0.25));
}

.research-head,
.research-brand,
.research-head-actions,
.research-filterbar,
.research-policy,
.research-section-head,
.research-project-item,
.research-device-item,
.research-session-toolbar,
.research-transcript-head,
.research-message header,
.research-transfer-dialog header,
.research-transfer-actions {
  display: flex;
  align-items: center;
}

.research-head {
  justify-content: space-between;
  gap: 14px;
  padding: 2px 2px 11px;
}

.research-brand {
  min-width: 0;
  gap: 10px;
}

.research-brand > span,
.research-auth-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 8px;
  color: rgba(246, 249, 250, 0.96);
  background: #20252a;
  box-shadow: 0 10px 22px rgba(42, 49, 54, 0.18);
}

.research-brand svg,
.research-auth-icon svg {
  width: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.research-brand > div,
.research-transcript-head > div,
.research-session-toolbar > div,
.research-section-head,
.research-auth > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.research-brand small,
.research-brand p,
.research-section-head span,
.research-session-toolbar span,
.research-transcript-head span,
.research-auth > div > span,
.research-transfer-dialog header span,
.research-onboarding > div > span {
  margin: 0;
  color: #69737a;
  font-family: "Geist Mono", monospace;
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.research-brand strong {
  font-size: 1rem;
}

.research-brand p {
  letter-spacing: 0;
}

.research-head-actions {
  justify-content: flex-end;
  gap: 6px;
}

.research-head-actions button,
.research-clear-filter,
.research-auth button,
.research-transfer-actions button {
  height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 6px;
  color: #2d3439;
  background: rgba(255, 255, 255, 0.42);
  font: 700 0.62rem "Geist", sans-serif;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, color 150ms ease;
}

.research-head-actions button:hover,
.research-clear-filter:hover,
.research-auth button:hover,
.research-transfer-actions button:hover {
  background: rgba(255, 255, 255, 0.72);
  transform: translateY(-1px);
}

.research-head-actions button[data-research-transfer],
.research-transfer-actions button[type="submit"],
.research-auth button {
  color: #f6f8f9;
  background: #20252a;
}

.research-head-actions button:disabled,
.research-transfer-actions button:disabled {
  cursor: default;
  opacity: 0.38;
  transform: none;
}

.research-source-state {
  display: grid;
  min-width: 94px;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 2px 6px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 6px;
  color: #48535a;
  background: rgba(255, 255, 255, 0.26);
  font-size: 0.58rem;
  font-weight: 800;
}

.research-source-state i {
  width: 7px;
  height: 7px;
  grid-row: 1 / 3;
  border-radius: 50%;
  background: #bd6a62;
}

.research-source-state.is-ready i {
  background: #58866b;
  box-shadow: 0 0 0 4px rgba(88, 134, 107, 0.1);
}

.research-source-state small {
  color: #7b858b;
  font-size: 0.48rem;
}

.research-alert {
  margin-bottom: 8px;
  padding: 7px 10px;
  border-left: 3px solid #bd6a62;
  color: #74504b;
  background: rgba(230, 199, 194, 0.3);
  font-size: 0.62rem;
}

.research-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 8px;
}

.research-metrics article {
  position: relative;
  display: grid;
  min-height: 76px;
  align-content: space-between;
  padding: 10px 11px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.28);
}

.research-metrics article::after {
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  content: "";
  background: #566973;
  opacity: 0.72;
}

.research-metrics article:nth-child(2) { background: rgba(205, 225, 238, 0.34); }
.research-metrics article:nth-child(2)::after { background: #628ba2; }
.research-metrics article:nth-child(3) { background: rgba(223, 229, 210, 0.35); }
.research-metrics article:nth-child(3)::after { background: #7f9667; }
.research-metrics article:nth-child(4) { background: rgba(236, 219, 204, 0.35); }
.research-metrics article:nth-child(4)::after { background: #a77c60; }

.research-metrics span,
.research-metrics small {
  color: #68737a;
  font-size: 0.55rem;
  font-weight: 750;
}

.research-metrics strong {
  font-size: clamp(1.05rem, 2vw, 1.55rem);
  line-height: 1;
}

.research-filterbar {
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  padding: 7px 8px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.18);
}

.research-filterbar > label {
  display: flex;
  align-items: center;
  gap: 7px;
}

.research-filterbar > label span {
  color: #657178;
  font-size: 0.56rem;
  font-weight: 800;
}

.research-filterbar select,
.research-transfer-dialog select,
.research-transfer-dialog textarea,
.research-auth input {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 5px;
  outline: none;
  color: #263037;
  background: rgba(255, 255, 255, 0.48);
  font: 600 0.62rem "Geist", sans-serif;
}

.research-filterbar select {
  height: 30px;
  padding: 0 8px;
}

.research-policy {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.research-policy span {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border-radius: 5px;
  color: #56636a;
  background: rgba(224, 232, 235, 0.62);
  font-size: 0.5rem;
  font-weight: 750;
}

.research-policy span i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #618876;
}

.research-policy .is-consent {
  background: rgba(234, 219, 204, 0.62);
}

.research-policy .is-consent i {
  background: #a4775e;
}

.research-workspace {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(180px, 0.52fr) minmax(320px, 1.12fr) minmax(280px, 0.9fr);
  gap: 8px;
}

.research-sidebar,
.research-session-panel,
.research-transcript {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.21);
}

.research-sidebar {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 9px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.research-side-section {
  display: grid;
  gap: 5px;
}

.research-section-head {
  margin: 2px 2px 3px;
}

.research-section-head strong,
.research-session-toolbar strong,
.research-transcript-head strong {
  overflow: hidden;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.research-project-item,
.research-device-item {
  width: 100%;
  min-width: 0;
  gap: 7px;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.research-project-item:hover,
.research-device-item:hover,
.research-project-item.is-active,
.research-device-item.is-active {
  border-color: rgba(255, 255, 255, 0.66);
  background: rgba(255, 255, 255, 0.38);
}

.research-project-item.is-active {
  color: #f5f7f8;
  background: #20252a;
}

.research-project-mark {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 5px;
  color: #edf1f3;
  background: #59646b;
  font: 700 0.48rem "Geist Mono", monospace;
}

.research-project-item.is-active .research-project-mark {
  color: #20252a;
  background: #eef1f2;
}

.research-project-item > span:nth-child(2),
.research-device-item > span:nth-child(2) {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 2px;
}

.research-project-item strong,
.research-device-item strong {
  overflow: hidden;
  font-size: 0.62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.research-project-item small,
.research-device-item small {
  overflow: hidden;
  color: #778188;
  font-size: 0.48rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.research-project-item.is-active small {
  color: #aeb8bd;
}

.research-project-item > b,
.research-device-item > b {
  color: #69757b;
  font-size: 0.5rem;
}

.research-device-signal {
  display: grid;
  width: 21px;
  height: 27px;
  flex: 0 0 auto;
  place-items: end center;
  padding-bottom: 4px;
  border: 1px solid rgba(74, 86, 94, 0.24);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.28);
}

.research-device-signal i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #8d969b;
}

.research-device-signal.is-online i {
  background: #5d8f72;
  box-shadow: 0 0 0 3px rgba(93, 143, 114, 0.12);
}

.research-clear-filter {
  width: 100%;
  height: 28px;
}

.research-side-empty {
  padding: 14px 7px;
  color: #7b858b;
  font-size: 0.55rem;
  text-align: center;
}

.research-handoff-item {
  display: grid;
  min-width: 0;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.2);
}

.research-handoff-item > span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 5px;
  color: #f1f4f5;
  background: #5d686e;
  font-size: 0.52rem;
  font-weight: 800;
}

.research-handoff-item > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.research-handoff-item strong,
.research-handoff-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.research-handoff-item strong { font-size: 0.57rem; }
.research-handoff-item small { color: #778188; font-size: 0.46rem; }
.research-handoff-item > b { color: #5d826d; font-size: 0.48rem; }

.research-session-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.research-session-toolbar {
  justify-content: space-between;
  gap: 8px;
  padding: 9px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.48);
}

.research-session-toolbar small {
  color: #7b868c;
  font-size: 0.5rem;
}

.research-search {
  display: flex;
  width: min(210px, 48%);
  height: 30px;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.34);
}

.research-search svg {
  width: 14px;
  fill: none;
  stroke: #6d797f;
  stroke-width: 1.8;
}

.research-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 0.58rem;
}

.research-session-list {
  display: grid;
  min-height: 0;
  align-content: start;
  gap: 5px;
  padding: 7px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.research-session-row {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  border: 1px solid rgba(255, 255, 255, 0.47);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.18);
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.research-session-row:hover,
.research-session-row.is-open {
  border-color: rgba(54, 70, 79, 0.22);
  background: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.research-session-row.is-open {
  box-shadow: inset 3px 0 #bd6a62;
}

.research-session-check {
  display: grid;
  place-items: start center;
  padding-top: 12px;
  cursor: pointer;
}

.research-session-check input {
  position: absolute;
  opacity: 0;
}

.research-session-check span {
  display: block;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(65, 77, 84, 0.35);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.54);
}

.research-session-check input:checked + span {
  border-color: #20252a;
  background: #20252a;
  box-shadow: inset 0 0 0 3px rgba(245, 247, 248, 0.9);
}

.research-session-row > button {
  display: grid;
  min-width: 0;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 8px 7px 2px;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.research-session-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: #f4f6f7;
  background: #59656c;
  font-size: 0.62rem;
  font-weight: 800;
}

.research-session-copy,
.research-session-meta {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.research-session-copy strong,
.research-session-copy small,
.research-session-copy p {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.research-session-copy strong { font-size: 0.64rem; }
.research-session-copy small { color: #778188; font-size: 0.49rem; }
.research-session-copy p { color: #5d686f; font-size: 0.54rem; }

.research-session-meta {
  justify-items: end;
  color: #758087;
  font-size: 0.48rem;
}

.research-session-meta b { color: #3d4b53; font-size: 0.55rem; }
.research-session-meta em { padding: 3px 5px; border-radius: 3px; background: rgba(213, 223, 227, 0.64); font-style: normal; }

.research-session-empty,
.research-message-empty,
.research-message-loading {
  display: grid;
  min-height: 150px;
  place-content: center;
  gap: 5px;
  color: #778188;
  font-size: 0.58rem;
  text-align: center;
}

.research-session-empty strong { color: #445159; font-size: 0.7rem; }

.research-transcript {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.research-transcript.is-empty {
  display: grid;
  place-items: center;
}

.research-transcript-placeholder {
  display: grid;
  max-width: 220px;
  justify-items: center;
  gap: 7px;
  padding: 20px;
  color: #6e797f;
  text-align: center;
}

.research-transcript-placeholder > span {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 10px;
  color: #f3f5f6;
  background: #353e43;
}

.research-transcript-placeholder svg {
  width: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.research-transcript-placeholder strong { color: #3b474e; font-size: 0.72rem; }
.research-transcript-placeholder p { margin: 0; font-size: 0.56rem; line-height: 1.5; }

.research-transcript-head {
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.48);
}

.research-transcript-head small {
  overflow: hidden;
  color: #737e84;
  font-size: 0.5rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.research-transcript-head button,
.research-transfer-dialog header button {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 50%;
  color: #58646b;
  background: rgba(255, 255, 255, 0.36);
  cursor: pointer;
}

.research-transcript-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.42);
}

.research-transcript-stats span {
  display: grid;
  gap: 2px;
  padding: 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.25);
}

.research-transcript-stats small { color: #7a858a; font-size: 0.46rem; }
.research-transcript-stats strong { overflow: hidden; font-size: 0.58rem; text-overflow: ellipsis; white-space: nowrap; }

.research-message-list {
  display: grid;
  min-height: 0;
  align-content: start;
  gap: 7px;
  padding: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.research-message {
  display: grid;
  gap: 5px;
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.31);
}

.research-message.is-assistant {
  margin-left: 18px;
  background: rgba(215, 228, 234, 0.38);
}

.research-message header {
  justify-content: space-between;
  gap: 8px;
}

.research-message header strong { font-size: 0.57rem; }
.research-message header span { color: #7c868c; font-size: 0.46rem; }
.research-message p { margin: 0; color: #3e4a51; font-size: 0.57rem; line-height: 1.48; white-space: pre-wrap; overflow-wrap: anywhere; }

.research-message-loading {
  grid-template-columns: auto auto;
}

.research-message-loading i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #bd6a62;
  animation: finance-refresh-pulse 1.1s ease-in-out infinite;
}

.research-onboarding {
  display: grid;
  min-height: 360px;
  grid-template-columns: minmax(220px, 0.65fr) minmax(300px, 1fr);
  align-content: center;
  align-items: center;
  gap: 24px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.19);
}

.research-onboarding > div:nth-child(2) {
  display: grid;
  gap: 8px;
}

.research-onboarding strong { font-size: 1.15rem; }
.research-onboarding p { max-width: 620px; margin: 0; color: #5d686f; font-size: 0.66rem; line-height: 1.55; }
.research-onboarding code { display: block; padding: 10px 12px; overflow-x: auto; border-radius: 6px; color: #e8edef; background: #2a3237; font: 500 0.56rem/1.5 "Geist Mono", monospace; white-space: nowrap; }
.research-onboarding small { color: #758087; font-size: 0.53rem; line-height: 1.45; }
.research-onboarding .research-policy { grid-column: 1 / -1; justify-content: center; }

.research-onboarding-visual {
  position: relative;
  display: grid;
  min-height: 210px;
  grid-template-columns: repeat(2, 92px);
  place-content: center;
  gap: 22px 34px;
}

.research-onboarding-visual span {
  position: relative;
  z-index: 2;
  display: grid;
  width: 92px;
  height: 54px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 8px;
  color: #556269;
  background: rgba(255, 255, 255, 0.42);
  font: 700 0.55rem "Geist Mono", monospace;
  box-shadow: 0 12px 28px rgba(50, 61, 68, 0.09);
}

.research-onboarding-visual .is-center {
  color: #f2f5f6;
  background: #283036;
}

.research-onboarding-visual i {
  position: absolute;
  z-index: 1;
  width: 112px;
  height: 1px;
  background: rgba(67, 84, 93, 0.28);
  transform-origin: left center;
}

.research-onboarding-visual i:nth-of-type(1) { top: 79px; left: calc(50% - 56px); transform: rotate(24deg); }
.research-onboarding-visual i:nth-of-type(2) { top: 132px; left: calc(50% - 56px); transform: rotate(-24deg); }
.research-onboarding-visual i:nth-of-type(3) { top: 105px; left: calc(50% - 56px); }

.research-auth {
  display: grid;
  min-height: 390px;
  grid-template-columns: auto minmax(220px, 420px);
  place-content: center;
  align-items: center;
  gap: 16px;
}

.research-auth > div strong { font-size: 1rem; }
.research-auth > div p { margin: 2px 0 0; color: #657178; font-size: 0.62rem; }
.research-auth form { display: grid; grid-column: 2; grid-template-columns: minmax(180px, 1fr) auto; gap: 7px; }
.research-auth label { display: grid; gap: 4px; }
.research-auth label span { color: #68747a; font-size: 0.52rem; font-weight: 800; }
.research-auth input { height: 34px; padding: 0 10px; }
.research-auth button { align-self: end; }

.research-transfer-dialog {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(38, 43, 47, 0.38);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.research-transfer-dialog form {
  display: grid;
  width: min(440px, 100%);
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 12px;
  background: rgba(225, 229, 231, 0.96);
  box-shadow: 0 28px 70px rgba(32, 40, 45, 0.25);
}

.research-transfer-dialog header { justify-content: space-between; }
.research-transfer-dialog header > div { display: grid; gap: 3px; }
.research-transfer-dialog header strong { font-size: 0.95rem; }
.research-transfer-dialog form > p { margin: 0; color: #58646b; font-size: 0.62rem; line-height: 1.5; }
.research-transfer-dialog form > label { display: grid; gap: 5px; color: #5e6a71; font-size: 0.56rem; font-weight: 750; }
.research-transfer-dialog select { height: 35px; padding: 0 8px; }
.research-transfer-dialog textarea { padding: 9px; resize: vertical; }
.research-transfer-actions { justify-content: flex-end; gap: 7px; }
.research-transfer-dialog form > small { min-height: 16px; color: #965046; font-size: 0.55rem; }

@media (max-width: 1180px) {
  .research-workspace {
    grid-template-columns: minmax(180px, 0.48fr) minmax(330px, 1fr);
  }

  .research-transcript {
    min-height: 380px;
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .research-live-panel { overflow-y: auto; }
  .research-head { align-items: stretch; flex-direction: column; }
  .research-head-actions { justify-content: stretch; }
  .research-source-state { margin-right: auto; }
  .research-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .research-filterbar { align-items: stretch; flex-direction: column; }
  .research-policy { justify-content: flex-start; }
  .research-workspace { grid-template-columns: minmax(0, 1fr); }
  .research-sidebar { max-height: 330px; }
  .research-transcript { grid-column: 1; }
  .research-onboarding { grid-template-columns: minmax(0, 1fr); padding: 18px; }
  .research-onboarding-visual { min-height: 180px; }
  .research-onboarding .research-policy { grid-column: 1; }
}

@media (max-width: 560px) {
  .research-live-panel { padding: 8px; }
  .research-head-actions { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, auto); }
  .research-source-state { width: auto; margin: 0; }
  .research-head-actions button { padding: 0 8px; }
  .research-metrics article { min-height: 72px; }
  .research-session-toolbar { align-items: stretch; flex-direction: column; }
  .research-search { width: 100%; }
  .research-session-row > button { grid-template-columns: 30px minmax(0, 1fr); }
  .research-session-meta { display: none; }
  .research-transcript-stats { grid-template-columns: minmax(0, 1fr); }
  .research-onboarding-visual { transform: scale(0.84); }
  .research-auth { grid-template-columns: minmax(0, 1fr); }
  .research-auth-icon { margin: auto; }
  .research-auth > div { text-align: center; }
  .research-auth form { grid-column: 1; grid-template-columns: minmax(0, 1fr); }
}

.login-view[data-login-motion="screen"]::after {
  background: rgba(0, 0, 0, 0.25);
}

.login-view[data-login-motion="flow"] .login-motion video {
  object-position: center;
}

.login-view[data-login-motion="torus"] .login-motion video {
  object-fit: contain;
  object-position: 12% center;
  mix-blend-mode: screen;
  filter: contrast(1.02) brightness(1.01);
}

.login-card {
  position: relative;
  z-index: 2;
}

body.glass-refined .login-card {
  border-color: rgba(255, 255, 255, 0.34);
  color: #fff;
  background: transparent;
  backdrop-filter: blur(12px) brightness(0.72) saturate(1.05);
  -webkit-backdrop-filter: blur(12px) brightness(0.72) saturate(1.05);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.login-card .login-brand span,
.login-card .login-brand strong,
.login-card .field-line span,
.login-card .login-options,
.login-card .login-options button {
  color: #fff;
}

.login-card .login-brand span,
.login-card .field-line span,
.login-card .login-options {
  color: rgba(255, 255, 255, 0.76);
}

.login-card .field-line input {
  border-color: rgba(255, 255, 255, 0.32);
  color: #fff;
  caret-color: #fff;
  background: rgba(0, 0, 0, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.login-card .field-line input:focus {
  border-color: rgba(255, 255, 255, 0.62);
  background: rgba(0, 0, 0, 0.24);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.login-card .login-feedback {
  color: #ffaaa4;
}

.login-card .login-submit {
  border-color: rgba(255, 255, 255, 0.32);
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.26);
}

.login-card .login-submit:hover {
  background: rgba(255, 255, 255, 0.2);
}

.login-motion-picker {
  position: absolute;
  right: clamp(16px, 2.2vw, 32px);
  bottom: clamp(16px, 2.2vw, 32px);
  z-index: 4;
  display: grid;
  justify-items: end;
}

.login-motion-trigger {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 50%;
  color: #fff;
  background: rgba(8, 11, 14, 0.62);
  backdrop-filter: blur(16px) saturate(1.12);
  -webkit-backdrop-filter: blur(16px) saturate(1.12);
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  cursor: pointer;
}

.login-motion-trigger > span {
  display: grid;
  grid-template-columns: repeat(3, 7px);
  gap: 3px;
}

.login-motion-trigger i {
  width: 7px;
  height: 18px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.88);
}

.login-motion-trigger i:nth-child(1) {
  background: rgba(216, 126, 114, 0.95);
}

.login-motion-trigger i:nth-child(2) {
  background: rgba(98, 181, 151, 0.95);
}

.login-motion-trigger i:nth-child(3) {
  background: rgba(231, 196, 115, 0.95);
}

.login-motion-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  display: grid;
  width: 178px;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(10, 13, 17, 0.86);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.98);
  transform-origin: right bottom;
  transition:
    opacity 160ms ease,
    transform 180ms ease;
}

.login-motion-picker.is-open .login-motion-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.login-motion-menu > button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 10px;
  min-height: 42px;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.055);
  text-align: left;
  cursor: pointer;
}

.login-motion-menu > button:hover,
.login-motion-menu > button.is-active {
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.login-motion-menu strong {
  font-size: 0.78rem;
}

.login-motion-menu > button > i {
  width: 6px;
  height: 6px;
  justify-self: center;
  border-radius: 50%;
  background: transparent;
}

.login-motion-menu > button.is-active > i {
  background: #72caa8;
  box-shadow: 0 0 10px rgba(114, 202, 168, 0.72);
}

.login-motion-swatch {
  width: 34px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 4px;
  background-color: #050608;
}

.login-motion-swatch.is-screen {
  background: radial-gradient(circle at 58% 45%, rgba(255, 255, 255, 0.92) 0 10%, rgba(188, 108, 94, 0.42) 22%, #050506 58%);
}

.login-motion-swatch.is-flow {
  background: radial-gradient(circle at 80% 15%, #23c798 0 14%, rgba(14, 91, 76, 0.7) 30%, #03090a 68%);
}

.login-motion-swatch.is-torus {
  background: radial-gradient(circle at 50% 50%, transparent 0 20%, rgba(218, 163, 85, 0.9) 22% 26%, transparent 29%), #030303;
}

@media (min-width: 900px) {
  .login-view {
    place-items: center;
  }
}

@media (max-width: 899px) {
  .login-view::after {
    background: rgba(0, 0, 0, 0.2);
  }

  .login-view[data-login-motion="screen"]::after {
    background: rgba(0, 0, 0, 0.38);
  }

  .login-motion video {
    inset: 0;
    width: 100%;
    height: 100%;
    object-position: 68% center;
    transform: none;
  }

  .login-view[data-login-motion="screen"] .login-motion video,
  .login-view[data-login-motion="torus"] .login-motion video {
    object-position: center;
  }

  .login-view[data-login-motion="flow"] .login-motion video {
    object-position: 68% center;
  }

  .login-motion video {
    opacity: 0.94;
  }

  /* Preserve translucent color while avoiding continuous mobile GPU blur. */
  body.glass-refined * {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body.glass-refined .drawer-scrim {
    background: rgba(32, 37, 45, 0.46);
  }

  body.glass-refined .login-motion-menu,
  body.glass-refined .login-motion-trigger {
    background-color: rgba(8, 11, 14, 0.94);
  }

  body.glass-refined .side-drawer {
    border-color: rgba(255, 255, 255, 0.74);
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(232, 236, 242, 0.78) 62%, rgba(242, 245, 248, 0.86)),
      rgba(225, 230, 237, 0.96);
    box-shadow:
      0 30px 76px rgba(19, 24, 31, 0.28),
      inset 0 1px 0 rgba(255, 255, 255, 0.9);
  }

  body.glass-refined .drawer-item {
    border-color: rgba(255, 255, 255, 0.64);
    background: rgba(255, 255, 255, 0.58);
  }

  body.glass-refined .drawer-subitem {
    border-color: rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.68);
  }

  body.glass-refined .drawer-item.is-active,
  body.glass-refined .drawer-subitem.is-active {
    color: #fff;
    background: rgba(23, 25, 29, 0.9);
  }

  .scene.is-drawer-open .rail-icons::after,
  .rail-status span,
  .mail-live-refresh.is-refreshing,
  .people-loading span,
  .shangqi-live-loading span,
  .shangqi-live-refresh.is-refreshing,
  .model-connection-pill.is-loading i,
  .finance-refresh.is-refreshing,
  .finance-dialog-chat > header em.is-loading::before,
  .finance-loading span,
  .ondaco-loading span {
    animation: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-motion video {
    display: none;
  }

  .login-motion-picker {
    display: none;
  }
}

/* Account surfaces stay legible above image and video content. */
body.glass-refined .account-menu {
  border-color: rgba(255, 255, 255, 0.9);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(237, 242, 247, 0.62)),
    rgb(225, 232, 239);
  backdrop-filter: blur(24px) saturate(1.04);
  -webkit-backdrop-filter: blur(24px) saturate(1.04);
  box-shadow:
    0 24px 68px rgba(20, 25, 33, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

body.glass-refined .account-menu::before {
  border-color: rgba(255, 255, 255, 0.84);
  background: rgb(226, 233, 240);
}

body.glass-refined .account-menu-item {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.58);
}

body.glass-refined .account-menu-item:hover,
body.glass-refined .account-menu-item:focus-visible {
  border-color: rgba(23, 25, 29, 0.16);
  background: rgba(255, 255, 255, 0.88);
  outline: none;
}

body.glass-refined #settingsPanel {
  background: rgba(33, 39, 48, 0.62);
  backdrop-filter: blur(10px) saturate(0.92);
  -webkit-backdrop-filter: blur(10px) saturate(0.92);
}

body.glass-refined #settingsPanel .settings-page-window {
  border-color: rgba(255, 255, 255, 0.88);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(235, 241, 247, 0.58) 62%, rgba(255, 255, 255, 0.7)),
    rgb(224, 232, 240);
  backdrop-filter: blur(24px) saturate(1.04);
  -webkit-backdrop-filter: blur(24px) saturate(1.04);
  box-shadow:
    0 38px 110px rgba(15, 20, 28, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body.glass-refined #settingsPanel :is(.model-settings-hero, .model-toggle-row, .model-settings-form, .model-privacy-note) {
  border-color: rgba(255, 255, 255, 0.76);
  background-color: rgba(255, 255, 255, 0.5);
}

body.glass-refined #settingsPanel .model-field input {
  border-color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.72);
}

html.theme-dark {
  --canvas: #000000;
  --canvas-deep: #000000;
  background: #000000;
  color-scheme: dark;
}

body.theme-dark {
  --canvas: #000000;
  --canvas-deep: #000000;
  --glass: rgba(255, 255, 255, 0.055);
  --glass-strong: rgba(255, 255, 255, 0.09);
  --glass-faint: rgba(255, 255, 255, 0.045);
  --ink: #f4f6f8;
  --text: #c8cdd4;
  --muted: #9299a4;
  --line: rgba(255, 255, 255, 0.16);
  --line-dark: rgba(255, 255, 255, 0.08);
  --active: #f4f6f8;
  --shadow-soft: 0 28px 80px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 18px 48px rgba(0, 0, 0, 0.34);
  color: var(--ink);
  background: #000000;
  color-scheme: dark;
}

body.theme-dark::before {
  display: none;
}

body.glass-refined.theme-dark {
  --surface-shell: rgba(10, 12, 15, 0.9);
  --surface-panel: rgba(17, 20, 24, 0.88);
  --surface-card: rgba(24, 28, 34, 0.78);
  --surface-hover: rgba(255, 255, 255, 0.1);
  --tint-blue: rgba(86, 139, 184, 0.18);
  --tint-green: rgba(80, 150, 111, 0.18);
  --tint-yellow: rgba(190, 151, 69, 0.18);
  --tint-red: rgba(178, 83, 77, 0.18);
  --glass-line: rgba(255, 255, 255, 0.14);
  --glass-line-soft: rgba(255, 255, 255, 0.09);
  --glass-shadow: 0 20px 58px rgba(0, 0, 0, 0.32);
}

body.glass-refined.theme-dark .glass-window,
body.glass-refined.theme-dark .tool-rail,
body.glass-refined.theme-dark .side-drawer {
  border-color: rgba(255, 255, 255, 0.15);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012) 62%),
    rgba(8, 10, 13, 0.92);
  box-shadow:
    0 34px 96px rgba(0, 0, 0, 0.52),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

body.glass-refined.theme-dark .tool-button,
body.glass-refined.theme-dark .round-button,
body.glass-refined.theme-dark .rail-logo {
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text);
  background: rgba(255, 255, 255, 0.065);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body.glass-refined.theme-dark .tool-button:hover,
body.glass-refined.theme-dark .round-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

body.glass-refined.theme-dark .tool-button.is-active {
  color: #111216;
  border-color: rgba(255, 255, 255, 0.72);
  background: #f2f4f6;
}

body.glass-refined.theme-dark :is(
  .bi-head,
  .metric-card,
  .bi-panel,
  .brain-dashboard-head,
  .brain-source-card,
  .brain-metric-card,
  .brain-state-panel,
  .shangqi-snapshot-metric,
  .shangqi-snapshot-card,
  .shangqi-usage-chart,
  .account-tile,
  .account-section,
  .admin-console-block,
  .admin-row,
  .device-row,
  .preference-toggle,
  .finance-live-panel,
  .finance-brand-card,
  .finance-analysis-panel,
  .ondaco-live-panel,
  .research-live-panel
) {
  border-color: var(--glass-line);
  background-image: linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.008) 62%);
  background-color: var(--surface-card);
  box-shadow:
    var(--glass-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body.glass-refined.theme-dark .bi-panel::after {
  opacity: 0.16;
}

body.glass-refined.theme-dark :is(.drawer-item, .drawer-subitem, .brain-queue-row, .mail-message-row, .people-row, .shangqi-live-row) {
  border-color: rgba(255, 255, 255, 0.09);
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
}

body.glass-refined.theme-dark :is(.drawer-item, .drawer-subitem, .brain-queue-row, .mail-message-row):hover,
body.glass-refined.theme-dark :is(.drawer-item, .drawer-subitem, .brain-queue-row, .mail-message-row):focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

body.glass-refined.theme-dark :is(.drawer-item.is-active, .drawer-subitem.is-active, .brain-queue-row.is-active) {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(189, 106, 98, 0.34);
}

body.glass-refined.theme-dark .detail-panel,
body.glass-refined.theme-dark .mail-detail-window,
body.glass-refined.theme-dark .mail-reader-window {
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.012) 62%),
    rgba(13, 16, 20, 0.95);
}

body.glass-refined.theme-dark .account-menu {
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.018)),
    rgb(13, 16, 20);
  box-shadow:
    0 26px 76px rgba(0, 0, 0, 0.62),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

body.glass-refined.theme-dark .account-menu::before {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgb(13, 16, 20);
}

body.glass-refined.theme-dark .account-menu-item {
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.055);
}

body.glass-refined.theme-dark .account-menu-item:hover,
body.glass-refined.theme-dark .account-menu-item:focus-visible {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.12);
}

body.glass-refined.theme-dark .account-menu-item:last-child {
  color: #ef9a92;
}

body.glass-refined.theme-dark :is(#accountPanel, #settingsPanel) {
  background: rgba(0, 0, 0, 0.78);
}

body.glass-refined.theme-dark #accountPanel :is(.account-page-window, .security-subpage),
body.glass-refined.theme-dark #settingsPanel .settings-page-window {
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.012) 62%),
    rgb(14, 17, 21);
  box-shadow:
    0 38px 110px rgba(0, 0, 0, 0.68),
    inset 0 1px 0 rgba(255, 255, 255, 0.11);
}

body.glass-refined.theme-dark #settingsPanel :is(.model-settings-hero, .model-toggle-row, .model-settings-form, .model-privacy-note) {
  border-color: rgba(255, 255, 255, 0.11);
  background-color: rgba(255, 255, 255, 0.045);
}

body.glass-refined.theme-dark :is(input, textarea, select),
body.glass-refined.theme-dark #settingsPanel .model-field input {
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.075);
}

body.glass-refined.theme-dark :is(input, textarea)::placeholder {
  color: rgba(200, 205, 212, 0.48);
}

body.glass-refined.theme-dark .shangqi-live-row.is-head,
body.glass-refined.theme-dark .people-row.is-head {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.09);
}

@media (max-width: 899px) {
  body.glass-refined .account-menu {
    border-color: rgba(255, 255, 255, 0.96);
    background: rgb(228, 235, 242);
    box-shadow: 0 22px 58px rgba(17, 22, 30, 0.36);
  }

  body.glass-refined #settingsPanel {
    background: rgba(29, 34, 42, 0.76);
  }

  body.glass-refined #settingsPanel .settings-page-window {
    background: rgb(226, 233, 240);
  }

  body.glass-refined.theme-dark .account-menu {
    border-color: rgba(255, 255, 255, 0.17);
    background: rgb(13, 16, 20);
  }

  body.glass-refined.theme-dark .side-drawer,
  body.glass-refined.theme-dark #settingsPanel .settings-page-window,
  body.glass-refined.theme-dark #accountPanel :is(.account-page-window, .security-subpage) {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgb(14, 17, 21);
    box-shadow: 0 28px 72px rgba(0, 0, 0, 0.66);
  }

  body.glass-refined.theme-dark .glass-window,
  body.glass-refined.theme-dark .tool-rail {
    background: rgba(8, 10, 13, 0.96);
  }
}

/* Native mobile scrolling for menus, dialogs, and long in-panel lists. */
@media (max-width: 899px) {
  .side-drawer {
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  .drawer-nav {
    min-height: 0;
    max-height: 100%;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }

  .account-menu {
    max-height: calc(100dvh - 88px - env(safe-area-inset-bottom));
    overflow-y: auto;
  }

  .account-page-window {
    max-height: calc(100dvh - 24px);
  }

  .security-subpage {
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  .research-transfer-dialog {
    align-items: end;
    padding: 10px;
  }

  .research-transfer-dialog form {
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
  }

  :is(
    .account-menu,
    .account-page-window,
    .security-subcontent,
    .drawer-nav,
    .mail-reader-content,
    .mail-detail-content,
    .mail-open-body,
    .mail-message-list,
    .shangqi-options-list,
    .shangqi-task-data-grid,
    .shangqi-snapshot-layout,
    .shangqi-rank-list,
    .shangqi-rank-detail,
    .shangqi-assistant-messages,
    .shangqi-reminder ol,
    .shangqi-people-ranking-list,
    .brain-queue-list,
    .brain-detail-card,
    .brain-source-detail-list,
    .brain-control-list,
    .brain-audit-list,
    .brain-detail-section ul,
    .finance-breakdown-list,
    .finance-dialog-body,
    .finance-dialog-context,
    .finance-dialog-messages,
    .ondaco-merchant-list,
    .research-live-panel,
    .research-sidebar,
    .research-session-list,
    .research-message-list,
    .research-transfer-dialog form
  ) {
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
    scrollbar-width: thin;
  }

  .shangqi-assistant-messages {
    overscroll-behavior: contain;
  }

  :is(.people-table, .shangqi-live-table) {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-x pan-y;
  }

  :is(.rail-icons, .brain-filter-tabs, .brain-view-tabs, .mail-source-grid) {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
  }
}
