:root {
  --bg: #0b1612;
  --bg-deep: #07100d;
  --panel: rgba(246, 250, 244, 0.92);
  --panel-strong: #fbfcf7;
  --panel-dark: rgba(17, 31, 25, 0.82);
  --panel-hover: rgba(232, 241, 231, 0.88);
  --line: rgba(37, 62, 51, 0.16);
  --line-strong: rgba(205, 219, 205, 0.26);
  --text: #102119;
  --text-inverse: #f6fbf2;
  --muted: #6c7c72;
  --muted-inverse: rgba(236, 246, 234, 0.72);
  --gold: #c99d4a;
  --gold-hover: #dfb968;
  --celadon: #cfe6dc;
  --celadon-strong: #9cc9bb;
  --jade: #2f6d58;
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --ok: #22c55e;
  --ok-bg: rgba(34, 197, 94, 0.12);
  --info: #3f8f78;
  --info-bg: rgba(159, 201, 187, 0.18);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --radius: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 70px rgba(3, 15, 11, 0.24);
  --shadow-sm: 0 14px 34px rgba(3, 15, 11, 0.13);
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
  --safe-left: env(safe-area-inset-left);
  --safe-right: env(safe-area-inset-right);
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 64px;
  --topbar-height: 48px;
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --font-sans: "Aptos", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-display: "Aptos Display", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0.01ms;
    --transition-base: 0.01ms;
  }
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background:
    radial-gradient(circle at 15% 10%, rgba(207, 230, 220, 0.18), transparent 30%),
    radial-gradient(circle at 86% 8%, rgba(201, 157, 74, 0.16), transparent 28%),
    linear-gradient(135deg, #07100d 0%, #0b1712 42%, #1b130d 100%);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 36px 36px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent 78%);
          mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent 78%);
}

button {
  font-family: inherit;
}

a {
  color: var(--gold);
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

input,
textarea,
select {
  font: inherit;
  color: inherit;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
.\!visible {
  visibility: visible !important;
}
.visible {
  visibility: visible;
}
.fixed {
  position: fixed;
}
.absolute {
  position: absolute;
}
.relative {
  position: relative;
}
.inset-0 {
  inset: 0px;
}
.inset-y-0 {
  top: 0px;
  bottom: 0px;
}
.left-0 {
  left: 0px;
}
.right-0 {
  right: 0px;
}
.right-4 {
  right: 1rem;
}
.top-0 {
  top: 0px;
}
.top-4 {
  top: 1rem;
}
.-z-10 {
  z-index: -10;
}
.z-50 {
  z-index: 50;
}
.z-\[100\] {
  z-index: 100;
}
.my-2 {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}
.my-3 {
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
}
.mb-1 {
  margin-bottom: 0.25rem;
}
.mb-3 {
  margin-bottom: 0.75rem;
}
.mb-4 {
  margin-bottom: 1rem;
}
.ml-2 {
  margin-left: 0.5rem;
}
.mr-2 {
  margin-right: 0.5rem;
}
.mt-0\.5 {
  margin-top: 0.125rem;
}
.mt-1 {
  margin-top: 0.25rem;
}
.mt-2 {
  margin-top: 0.5rem;
}
.mt-3 {
  margin-top: 0.75rem;
}
.mt-4 {
  margin-top: 1rem;
}
.line-clamp-2 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.block {
  display: block;
}
.inline-block {
  display: inline-block;
}
.inline {
  display: inline;
}
.flex {
  display: flex;
}
.table {
  display: table;
}
.grid {
  display: grid;
}
.hidden {
  display: none;
}
.h-1 {
  height: 0.25rem;
}
.h-1\.5 {
  height: 0.375rem;
}
.h-10 {
  height: 2.5rem;
}
.h-12 {
  height: 3rem;
}
.h-16 {
  height: 4rem;
}
.h-24 {
  height: 6rem;
}
.h-28 {
  height: 7rem;
}
.h-3 {
  height: 0.75rem;
}
.h-32 {
  height: 8rem;
}
.h-4 {
  height: 1rem;
}
.h-40 {
  height: 10rem;
}
.h-44 {
  height: 11rem;
}
.h-48 {
  height: 12rem;
}
.h-5 {
  height: 1.25rem;
}
.h-64 {
  height: 16rem;
}
.h-72 {
  height: 18rem;
}
.h-8 {
  height: 2rem;
}
.h-96 {
  height: 24rem;
}
.h-full {
  height: 100%;
}
.max-h-\[60vh\] {
  max-height: 60vh;
}
.min-h-0 {
  min-height: 0px;
}
.min-h-\[60vh\] {
  min-height: 60vh;
}
.w-10 {
  width: 2.5rem;
}
.w-24 {
  width: 6rem;
}
.w-28 {
  width: 7rem;
}
.w-3 {
  width: 0.75rem;
}
.w-32 {
  width: 8rem;
}
.w-4 {
  width: 1rem;
}
.w-40 {
  width: 10rem;
}
.w-48 {
  width: 12rem;
}
.w-5 {
  width: 1.25rem;
}
.w-64 {
  width: 16rem;
}
.w-\[280px\] {
  width: 280px;
}
.w-\[calc\(100\%-32px\)\] {
  width: calc(100% - 32px);
}
.w-full {
  width: 100%;
}
.min-w-0 {
  min-width: 0px;
}
.min-w-\[680px\] {
  min-width: 680px;
}
.min-w-\[820px\] {
  min-width: 820px;
}
.min-w-\[900px\] {
  min-width: 900px;
}
.max-w-lg {
  max-width: 32rem;
}
.max-w-md {
  max-width: 28rem;
}
.max-w-sm {
  max-width: 24rem;
}
.max-w-xs {
  max-width: 20rem;
}
.flex-1 {
  flex: 1 1 0%;
}
.shrink-0 {
  flex-shrink: 0;
}
.transform {
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.animate-spin {
  animation: spin 1s linear infinite;
}
.cursor-pointer {
  cursor: pointer;
}
.resize {
  resize: both;
}
.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}
.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.flex-col {
  flex-direction: column;
}
.flex-wrap {
  flex-wrap: wrap;
}
.items-start {
  align-items: flex-start;
}
.items-end {
  align-items: flex-end;
}
.items-center {
  align-items: center;
}
.justify-start {
  justify-content: flex-start;
}
.justify-end {
  justify-content: flex-end;
}
.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-1 {
  gap: 0.25rem;
}
.gap-2 {
  gap: 0.5rem;
}
.gap-3 {
  gap: 0.75rem;
}
.gap-4 {
  gap: 1rem;
}
.gap-px {
  gap: 1px;
}
.space-y-1 > :not([hidden]) ~ :not([hidden]) {
  --tw-space-y-reverse: 0;
  margin-top: calc(0.25rem * calc(1 - var(--tw-space-y-reverse)));
  margin-bottom: calc(0.25rem * var(--tw-space-y-reverse));
}
.space-y-2 > :not([hidden]) ~ :not([hidden]) {
  --tw-space-y-reverse: 0;
  margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse)));
  margin-bottom: calc(0.5rem * var(--tw-space-y-reverse));
}
.space-y-3 > :not([hidden]) ~ :not([hidden]) {
  --tw-space-y-reverse: 0;
  margin-top: calc(0.75rem * calc(1 - var(--tw-space-y-reverse)));
  margin-bottom: calc(0.75rem * var(--tw-space-y-reverse));
}
.space-y-4 > :not([hidden]) ~ :not([hidden]) {
  --tw-space-y-reverse: 0;
  margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse)));
  margin-bottom: calc(1rem * var(--tw-space-y-reverse));
}
.space-y-6 > :not([hidden]) ~ :not([hidden]) {
  --tw-space-y-reverse: 0;
  margin-top: calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));
  margin-bottom: calc(1.5rem * var(--tw-space-y-reverse));
}
.overflow-auto {
  overflow: auto;
}
.overflow-hidden {
  overflow: hidden;
}
.overflow-x-auto {
  overflow-x: auto;
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.whitespace-nowrap {
  white-space: nowrap;
}
.whitespace-pre-wrap {
  white-space: pre-wrap;
}
.break-all {
  word-break: break-all;
}
.rounded {
  border-radius: 0.25rem;
}
.rounded-full {
  border-radius: 9999px;
}
.rounded-lg {
  border-radius: 0.5rem;
}
.rounded-md {
  border-radius: 0.375rem;
}
.rounded-sm {
  border-radius: 0.125rem;
}
.rounded-xl {
  border-radius: 0.75rem;
}
.border {
  border-width: 1px;
}
.border-2 {
  border-width: 2px;
}
.border-b {
  border-bottom-width: 1px;
}
.border-b-2 {
  border-bottom-width: 2px;
}
.border-r {
  border-right-width: 1px;
}
.border-t {
  border-top-width: 1px;
}
.border-\[rgba\(201\2c 157\2c 74\2c 0\.42\)\] {
  border-color: rgba(201,157,74,0.42);
}
.border-\[var\(--gold\)\] {
  border-color: var(--gold);
}
.border-\[var\(--info\)\] {
  border-color: var(--info);
}
.border-\[var\(--line\)\] {
  border-color: var(--line);
}
.border-green-500\/30 {
  border-color: rgb(34 197 94 / 0.3);
}
.border-red-500 {
  --tw-border-opacity: 1;
  border-color: rgb(239 68 68 / var(--tw-border-opacity, 1));
}
.border-red-500\/30 {
  border-color: rgb(239 68 68 / 0.3);
}
.border-transparent {
  border-color: transparent;
}
.border-t-transparent {
  border-top-color: transparent;
}
.bg-\[rgba\(201\2c 157\2c 74\2c 0\.10\)\] {
  background-color: rgba(201,157,74,0.10);
}
.bg-\[var\(--accent-bg\)\] {
  background-color: var(--accent-bg);
}
.bg-\[var\(--bg\)\] {
  background-color: var(--bg);
}
.bg-\[var\(--danger-bg\)\] {
  background-color: var(--danger-bg);
}
.bg-\[var\(--gold\)\] {
  background-color: var(--gold);
}
.bg-\[var\(--info-bg\)\] {
  background-color: var(--info-bg);
}
.bg-\[var\(--line\)\] {
  background-color: var(--line);
}
.bg-\[var\(--ok-bg\)\] {
  background-color: var(--ok-bg);
}
.bg-\[var\(--panel\)\] {
  background-color: var(--panel);
}
.bg-\[var\(--panel-hover\)\] {
  background-color: var(--panel-hover);
}
.bg-\[var\(--surface\)\] {
  background-color: var(--surface);
}
.bg-black\/60 {
  background-color: rgb(0 0 0 / 0.6);
}
.bg-red-500\/70 {
  background-color: rgb(239 68 68 / 0.7);
}
.p-0 {
  padding: 0px;
}
.p-3 {
  padding: 0.75rem;
}
.p-4 {
  padding: 1rem;
}
.p-6 {
  padding: 1.5rem;
}
.px-1\.5 {
  padding-left: 0.375rem;
  padding-right: 0.375rem;
}
.px-2 {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}
.px-3 {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}
.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}
.py-0\.5 {
  padding-top: 0.125rem;
  padding-bottom: 0.125rem;
}
.py-1\.5 {
  padding-top: 0.375rem;
  padding-bottom: 0.375rem;
}
.py-2 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.py-3 {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}
.py-8 {
  padding-top: 2rem;
  padding-bottom: 2rem;
}
.pt-2 {
  padding-top: 0.5rem;
}
.pt-4 {
  padding-top: 1rem;
}
.text-left {
  text-align: left;
}
.text-center {
  text-align: center;
}
.align-top {
  vertical-align: top;
}
.font-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
.text-2xl {
  font-size: 1.5rem;
  line-height: 2rem;
}
.text-3xl {
  font-size: 1.875rem;
  line-height: 2.25rem;
}
.text-\[10px\] {
  font-size: 10px;
}
.text-base {
  font-size: 1rem;
  line-height: 1.5rem;
}
.text-lg {
  font-size: 1.125rem;
  line-height: 1.75rem;
}
.text-sm {
  font-size: 0.875rem;
  line-height: 1.25rem;
}
.text-xl {
  font-size: 1.25rem;
  line-height: 1.75rem;
}
.text-xs {
  font-size: 0.75rem;
  line-height: 1rem;
}
.font-bold {
  font-weight: 700;
}
.font-medium {
  font-weight: 500;
}
.font-semibold {
  font-weight: 600;
}
.leading-relaxed {
  line-height: 1.625;
}
.text-\[\#152116\] {
  --tw-text-opacity: 1;
  color: rgb(21 33 22 / var(--tw-text-opacity, 1));
}
.text-\[var\(--danger\)\] {
  color: var(--danger);
}
.text-\[var\(--gold\)\] {
  color: var(--gold);
}
.text-\[var\(--muted\)\] {
  color: var(--muted);
}
.text-\[var\(--ok\)\] {
  color: var(--ok);
}
.text-\[var\(--text\)\] {
  color: var(--text);
}
.text-black {
  --tw-text-opacity: 1;
  color: rgb(0 0 0 / var(--tw-text-opacity, 1));
}
.text-red-500 {
  --tw-text-opacity: 1;
  color: rgb(239 68 68 / var(--tw-text-opacity, 1));
}
.opacity-0 {
  opacity: 0;
}
.opacity-70 {
  opacity: 0.7;
}
.opacity-75 {
  opacity: 0.75;
}
.opacity-90 {
  opacity: 0.9;
}
.shadow-\[0_0_0_6px_rgba\(214\2c 186\2c 102\2c 0\.16\)\] {
  --tw-shadow: 0 0 0 6px rgba(214,186,102,0.16);
  --tw-shadow-colored: 0 0 0 6px var(--tw-shadow-color);
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}
.shadow-lg {
  --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}
.shadow-xl {
  --tw-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}
.blur {
  --tw-blur: blur(8px);
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
}
.filter {
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
}
.transition {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.transition-all {
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.transition-colors {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

/* App shell */
.app-shell {
  display: flex;
  min-height: 100%;
  height: 100%;
  color: var(--text);
  background:
    radial-gradient(circle at 78% 12%, rgba(201, 157, 74, 0.16), transparent 26%),
    linear-gradient(135deg, rgba(207, 230, 220, 0.07), rgba(255, 255, 255, 0));
}

.auth-shell {
  min-height: 100%;
  color: var(--text-inverse);
  background:
    radial-gradient(circle at 20% 22%, rgba(207, 230, 220, 0.22), transparent 26%),
    radial-gradient(circle at 82% 28%, rgba(201, 157, 74, 0.20), transparent 24%),
    linear-gradient(135deg, #06110e 0%, #0e2019 56%, #20160e 100%);
  overflow: auto;
  overflow-x: hidden;
}

.app-shell,
.auth-shell {
  scrollbar-color: rgba(207, 230, 220, 0.32) rgba(255, 255, 255, 0.04);
  scrollbar-width: thin;
}

.app-shell *,
.auth-shell * {
  scrollbar-width: thin;
  scrollbar-color: rgba(207, 230, 220, 0.26) transparent;
}

.app-shell *::-webkit-scrollbar,
.auth-shell *::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.app-shell *::-webkit-scrollbar-track,
.auth-shell *::-webkit-scrollbar-track {
  background: transparent;
}

.app-shell *::-webkit-scrollbar-thumb,
.auth-shell *::-webkit-scrollbar-thumb {
  min-height: 40px;
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(207, 230, 220, 0.30);
  background-clip: content-box;
}

.app-shell *::-webkit-scrollbar-thumb:hover,
.auth-shell *::-webkit-scrollbar-thumb:hover {
  background-color: rgba(229, 216, 168, 0.44);
}

.auth-content {
  min-height: 100%;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 480px);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding: clamp(28px, 6vw, 82px);
}

.icp-footer {
  grid-column: 1 / -1;
  align-self: end;
  justify-self: center;
  margin-top: clamp(4px, 1.5vw, 18px);
  color: rgba(238, 248, 236, 0.36);
  font-size: 10px;
  line-height: 1.4;
}

.icp-footer a {
  color: inherit;
  text-decoration: none;
}

.icp-footer a:hover,
.icp-footer a:focus-visible {
  color: rgba(255, 244, 199, 0.72);
  text-decoration: underline;
}

.login-hero {
  position: relative;
  max-width: 900px;
}

.login-hero::before {
  content: "";
  position: absolute;
  inset: -10% 8% auto auto;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(229, 216, 168, 0.22);
  border-radius: 999px;
  background:
    radial-gradient(circle at 42% 42%, rgba(247, 252, 244, 0.16), transparent 34%),
    conic-gradient(from 210deg, transparent, rgba(201, 157, 74, 0.38), transparent 58%);
  filter: blur(0.2px);
  opacity: 0.75;
}

.login-brand {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px 10px 10px;
  border: 1px solid rgba(240, 232, 190, 0.18);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px);
}

.login-brand img {
  width: 48px;
  height: 48px;
  border-radius: 16px;
}

.login-brand strong,
.login-brand span {
  display: block;
}

.login-brand strong {
  font-size: 1.1rem;
  letter-spacing: 0.01em;
}

.login-brand span {
  color: var(--muted-inverse);
  font-size: 0.86rem;
}

.login-copy {
  position: relative;
  z-index: 1;
  margin-top: clamp(42px, 7vw, 82px);
  max-width: 760px;
}

.login-overline {
  width: -moz-fit-content;
  width: fit-content;
  margin: 0 0 18px;
  color: #f1dca3;
  font-weight: 800;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
}

.login-copy h1 {
  margin: 0;
  color: #fffdf2;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 6.8rem);
  line-height: 0.94;
  letter-spacing: -0.065em;
  max-width: 820px;
}

.login-copy p:not(.login-overline) {
  max-width: 620px;
  margin: 26px 0 0;
  color: rgba(238, 248, 236, 0.78);
  font-size: clamp(1rem, 1.5vw, 1.18rem);
}

.login-feature-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: clamp(34px, 5vw, 64px);
}

.login-feature-card {
  min-height: 170px;
  padding: 22px;
  border-radius: 28px;
  border: 1px solid rgba(235, 228, 190, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.045));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(20px);
}

.login-feature-card span {
  display: block;
  color: #f1dca3;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  margin-bottom: 24px;
}

.login-feature-card strong {
  display: block;
  color: #fffdf2;
  font-size: 1.06rem;
  margin-bottom: 8px;
}

.login-feature-card p {
  margin: 0;
  color: var(--muted-inverse);
  font-size: 0.9rem;
}

.login-card-wrap {
  position: relative;
  z-index: 1;
}

.login-card {
  padding: clamp(28px, 4vw, 42px);
  border-radius: 34px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 247, 238, 0.92));
  color: var(--text);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.56);
}

.login-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.45rem);
  letter-spacing: -0.04em;
}

.login-card-subtitle {
  margin: 8px 0 24px;
  color: var(--muted);
}

.login-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px;
  margin-bottom: 24px;
  border-radius: 999px;
  background: rgba(20, 45, 34, 0.07);
}

.login-mode-tabs button {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.login-mode-tabs button.active {
  color: #152116;
  background: linear-gradient(135deg, #fff4c7, var(--gold));
  box-shadow: 0 10px 22px rgba(201, 157, 74, 0.20);
}

.login-card label {
  color: #203027;
  font-weight: 750;
}

@media (max-width: 980px) {
  .login-page {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 22px;
    padding: 18px;
  }

  .login-hero {
    max-width: none;
  }

  .login-hero::before {
    inset: -58px -116px auto auto;
    width: 280px;
    height: 280px;
    opacity: 0.42;
  }

  .login-brand {
    max-width: 100%;
    gap: 12px;
  }

  .login-brand img {
    width: 44px;
    height: 44px;
  }

  .login-copy {
    margin-top: 30px;
  }

  .login-overline {
    margin-bottom: 12px;
    font-size: 0.72rem;
  }

  .login-copy h1 {
    max-width: 11em;
    font-size: clamp(2.75rem, 9vw, 4.2rem);
    line-height: 1.02;
    letter-spacing: -0.045em;
  }

  .login-copy p:not(.login-overline) {
    max-width: 34em;
    margin-top: 16px;
  }

  .login-feature-grid {
    display: none;
  }

  .login-card-wrap {
    width: 100%;
  }

  .icp-footer {
    margin-top: 2px;
  }
}

@media (max-width: 520px) {
  .login-copy h1 {
    max-width: 9.5em;
    font-size: clamp(2.2rem, 9.4vw, 2.75rem);
    line-height: 1.08;
    letter-spacing: -0.02em;
  }

  .login-copy p:not(.login-overline) {
    font-size: 0.95rem;
    line-height: 1.72;
  }

  .login-card {
    padding: 24px;
    border-radius: 28px;
  }

  .login-card h2 {
    font-size: 1.9rem;
  }

  .login-card-subtitle {
    margin-bottom: 18px;
  }

  .login-mode-tabs {
    margin-bottom: 18px;
  }

  .login-card .space-y-4 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 0.85rem;
  }
}

/* Workspace */
.workspace-page {
  gap: 18px;
}

.workspace-page,
.history-page,
.pro-mode-page,
.admin-page {
  animation: react-v2-page-enter 360ms cubic-bezier(0.2, 0.78, 0.22, 1) both;
}

.workspace-chat-panel,
.workspace-artifact-panel,
.workspace-mobile-projects,
.workspace-mobile-artifacts,
.pro-canvas-shell {
  position: relative;
}

.workspace-chat-panel::before,
.workspace-artifact-panel::before,
.workspace-mobile-projects::before,
.workspace-mobile-artifacts::before,
.pro-canvas-shell::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 244, 199, 0.42), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 42%);
  opacity: 0.58;
  pointer-events: none;
}

.workspace-continue-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(80, 166, 132, 0.22);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(224, 247, 234, 0.82), rgba(255, 251, 226, 0.58));
  margin: 10px 0 0;
  padding: 12px;
}

.workspace-continue-banner span {
  display: block;
  color: #1d6f4b;
  font-size: 0.72rem;
  font-weight: 920;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workspace-continue-banner strong {
  display: block;
  color: var(--text);
  font-size: 0.96rem;
  font-weight: 940;
  margin-top: 2px;
}

.workspace-continue-banner p {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  margin: 4px 0;
}

.workspace-continue-banner small {
  color: var(--muted);
  font-size: 0.74rem;
}

/* History / Pro */
.history-page-actions,
.pro-mode-header,
.pro-project-picker,
.pro-canvas-toolbar,
.pro-canvas-actions,
.pro-tool-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.history-page-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.history-management-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.history-management-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.history-summary-card {
  border: 1px solid rgba(37, 62, 51, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.46);
  padding: 10px 12px;
}

.history-summary-card span,
.history-filter-grid label span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 820;
}

.history-summary-card strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 1.18rem;
  font-weight: 950;
}

.history-summary-card small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
}

.history-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.history-filter-grid label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.history-filter-grid .select,
.history-filter-grid .btn {
  width: 100%;
}

.history-project-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-radius: 12px;
  padding: 10px;
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.history-project-row:hover,
.history-project-row.is-active {
  background: var(--panel-hover);
}

.history-project-row.is-active {
  box-shadow: inset 3px 0 0 rgba(193, 143, 35, 0.72);
}

.history-project-link {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 6px;
}

.history-project-title-row,
.history-project-meta,
.history-project-badges,
.history-task-relation-row,
.history-round-relation {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.history-project-title-row {
  justify-content: space-between;
}

.history-project-status,
.history-project-badges span,
.history-projection-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(37, 62, 51, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  color: #4d5b50;
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1;
  padding: 5px 7px;
}

.history-project-meta,
.history-task-relation-row,
.history-round-relation {
  color: var(--muted);
  font-size: 0.74rem;
  flex-wrap: wrap;
}

.history-project-badges {
  flex-wrap: wrap;
}

.history-projection-badge {
  border-color: rgba(133, 83, 23, 0.22);
  background: rgba(255, 245, 215, 0.72);
  color: #835317;
}

.history-row-action {
  flex: 0 0 auto;
  color: #8a6720;
  font-size: 0.78rem;
  font-weight: 850;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.group:hover .history-row-action,
.group:focus-within .history-row-action {
  opacity: 1;
}

.history-detail-status-panel,
.history-deliverable-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.history-detail-status-panel article,
.history-deliverable-summary article {
  border: 1px solid rgba(37, 62, 51, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.46);
  padding: 11px 12px;
  min-width: 0;
}

.history-deliverable-summary article.is-empty {
  background: rgba(245, 247, 244, 0.62);
}

.history-detail-status-panel span,
.history-deliverable-summary span,
.history-projection-notice span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.history-detail-status-panel strong,
.history-deliverable-summary strong,
.history-projection-notice strong {
  display: block;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 940;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.history-detail-status-panel small,
.history-deliverable-summary small,
.history-projection-notice p {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
  margin-top: 3px;
}

.history-projection-notice {
  border: 1px solid rgba(133, 83, 23, 0.22);
  border-radius: 12px;
  background: rgba(255, 246, 220, 0.72);
  margin: 0 0 14px;
  padding: 12px;
}

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

.history-deliverable-group-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.history-deliverable-group-heading h3 {
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 940;
}

.history-deliverable-group-heading span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 820;
}

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

.history-deliverable-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.48);
  overflow: hidden;
  min-width: 0;
}

.history-deliverable-card img,
.history-deliverable-file {
  width: 100%;
  aspect-ratio: 1 / 1;
}

.history-deliverable-card img {
  -o-object-fit: contain;
     object-fit: contain;
  background: rgba(255, 255, 255, 0.44);
}

.history-deliverable-file {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.82rem;
  padding: 14px;
  text-align: center;
}

.history-deliverable-card-body {
  display: grid;
  gap: 5px;
  padding: 9px;
}

.history-deliverable-card-body span,
.history-deliverable-card-body small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.history-deliverable-card-body span {
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 850;
}

.history-deliverable-card-body small {
  color: var(--muted);
  font-size: 0.7rem;
}

.pro-mode-header {
  position: absolute;
  top: 78px;
  left: 22px;
  right: 22px;
  z-index: 8;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  pointer-events: none;
}

.pro-mode-header > * {
  pointer-events: auto;
}

.pro-mode-header > div:first-child {
  max-width: min(420px, 42vw);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(15, 32, 25, 0.62), rgba(20, 31, 21, 0.32));
  box-shadow: 0 18px 48px rgba(5, 18, 13, 0.2);
  backdrop-filter: blur(16px);
}

.pro-mode-header h1 {
  color: rgba(244, 252, 244, 0.96);
  text-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

.pro-mode-header p {
  margin-top: 5px;
  color: rgba(231, 240, 232, 0.72);
}

.app-shell-pro,
.app-content-pro,
.pro-mode-page {
  overflow: hidden;
}

/* Pro 模式需要让画布占满整个右侧内容区，因此取消通用 app-content 的 padding 和滚动条。 */
.app-content-pro {
  display: flex;
  min-width: 0;
  min-height: 0;
  padding: 0;
}

body.pro-canvas-css-fullscreen .app-shell-pro,
body.pro-canvas-css-fullscreen .app-content-pro {
  overflow: visible;
}

body.pro-canvas-css-fullscreen .app-content-pro {
  filter: none !important;
}

body.pro-canvas-css-fullscreen .pro-mode-page {
  transform: none !important;
}

.pro-mode-page {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.pro-mode-workspace {
  flex: 1;
  position: relative;
  display: block;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.pro-mode-side-rail {
  position: absolute;
  top: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 18;
  width: min(var(--pro-rail-width, 390px), calc(100% - 56px));
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  transition: transform 220ms ease, opacity 220ms ease;
}

.pro-mode-side-rail.has-inspector {
  grid-template-rows: minmax(220px, 1.08fr) minmax(180px, 0.86fr);
}

.pro-rail-resize-handle {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  z-index: 2;
  width: 10px;
  cursor: col-resize;
  border-radius: 999px;
}

.pro-rail-resize-handle::after {
  content: "";
  position: absolute;
  top: 42%;
  bottom: 42%;
  left: 2px;
  width: 4px;
  border-radius: 999px;
  background: rgba(201, 157, 74, 0.42);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.62);
}

.pro-rail-resize-handle:hover::after,
.pro-rail-resize-handle:focus-visible::after {
  background: rgba(201, 157, 74, 0.82);
}

.pro-rail-agent-slot,
.pro-rail-inspector-slot {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.pro-rail-agent-slot {
  display: grid;
}

.pro-rail-agent-slot > .panel {
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.pro-mode-side-rail.collapsed {
  transform: translateX(calc(100% + 24px));
  opacity: 0;
  pointer-events: none;
}

.pro-rail-toggle-tab {
  position: absolute;
  top: 50%;
  right: 0;
  z-index: 19;
  transform: translateY(-50%);
  border: 1px solid rgba(201, 157, 74, 0.34);
  border-right: 0;
  border-radius: 18px 0 0 18px;
  padding: 12px 10px;
  color: #183126;
  background: rgba(252, 253, 247, 0.94);
  box-shadow: 0 16px 42px rgba(11, 31, 22, 0.18);
  font-size: 0.78rem;
  font-weight: 900;
  backdrop-filter: blur(14px);
}

.pro-agent-floating-toggle {
  display: grid;
  gap: 5px;
  min-width: 48px;
  min-height: 118px;
  place-items: center;
}

.pro-agent-floating-toggle span,
.pro-agent-floating-toggle strong {
  display: block;
  writing-mode: vertical-rl;
  line-height: 1;
}

.pro-agent-floating-toggle span {
  color: var(--muted);
  font-size: 0.72rem;
}

.pro-agent-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  max-height: none;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 249, 242, 0.84));
  box-shadow: 0 24px 76px rgba(5, 16, 11, 0.24);
}

.pro-rail-inspector {
  display: grid;
  min-height: 0;
  max-height: none;
  overflow: hidden;
  pointer-events: auto;
}

.pro-mode-side-rail.has-inspector .pro-agent-panel {
  min-height: 0;
}

.pro-rail-inspector .pro-node-inspector {
  box-sizing: border-box;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  box-shadow: 0 18px 54px rgba(8, 24, 17, 0.16);
}

.pro-rail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pro-rail-head strong,
.pro-rail-head span {
  display: block;
}

.pro-rail-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.pro-agent-collapse-button {
  flex: 0 0 auto;
  min-width: 54px;
  border: 1px solid rgba(201, 157, 74, 0.3);
  border-radius: 999px;
  padding: 7px 10px;
  color: #5f4615;
  background: rgba(255, 248, 226, 0.74);
  font-size: 0.75rem;
  font-weight: 900;
}

.pro-agent-collapse-button:hover,
.pro-agent-collapse-button:focus-visible {
  border-color: rgba(201, 157, 74, 0.58);
  background: rgba(247, 225, 151, 0.86);
}

.pro-agent-main {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
}

.pro-agent-body {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  overflow: hidden;
}

.pro-agent-scroll-region {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
  padding: 2px 4px 2px 2px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 157, 74, 0.58) rgba(255, 255, 255, 0.16);
}

.pro-agent-scroll-region::-webkit-scrollbar,
.pro-agent-confirmation-stack::-webkit-scrollbar,
.pro-agent-reference-tray::-webkit-scrollbar,
#proAgentInput::-webkit-scrollbar,
.pro-node-inline-prompt::-webkit-scrollbar,
.pro-node-inline-prompt .textarea::-webkit-scrollbar,
.pro-node-inspector::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.pro-agent-scroll-region::-webkit-scrollbar-track,
.pro-agent-confirmation-stack::-webkit-scrollbar-track,
.pro-agent-reference-tray::-webkit-scrollbar-track,
#proAgentInput::-webkit-scrollbar-track,
.pro-node-inline-prompt::-webkit-scrollbar-track,
.pro-node-inline-prompt .textarea::-webkit-scrollbar-track,
.pro-node-inspector::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.pro-agent-scroll-region::-webkit-scrollbar-thumb,
.pro-agent-confirmation-stack::-webkit-scrollbar-thumb,
.pro-agent-reference-tray::-webkit-scrollbar-thumb,
#proAgentInput::-webkit-scrollbar-thumb,
.pro-node-inline-prompt::-webkit-scrollbar-thumb,
.pro-node-inline-prompt .textarea::-webkit-scrollbar-thumb,
.pro-node-inspector::-webkit-scrollbar-thumb {
  min-height: 30px;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(226, 194, 99, 0.82), rgba(95, 163, 129, 0.62));
  background-clip: padding-box;
}

.pro-message-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: visible;
  padding: 2px;
}

.pro-agent-confirmation-stack {
  display: grid;
  gap: 9px;
  max-height: min(42vh, 320px);
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 157, 74, 0.58) rgba(255, 255, 255, 0.16);
}

.pro-agent-confirmation-stack > strong {
  color: #8a6824;
  font-size: 0.75rem;
  font-weight: 950;
}

.pro-agent-context-panel {
  display: grid;
  gap: 9px;
  border: 1px solid rgba(53, 78, 65, 0.12);
  border-radius: 16px;
  padding: 10px;
  background: linear-gradient(135deg, rgba(250, 252, 244, 0.86), rgba(239, 248, 241, 0.72));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.pro-agent-context-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.pro-agent-context-head strong,
.pro-agent-context-head span {
  display: block;
  min-width: 0;
}

.pro-agent-context-head strong {
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 950;
}

.pro-agent-context-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
}

.pro-agent-context-head b {
  flex: 0 0 auto;
  border: 1px solid rgba(201, 157, 74, 0.28);
  border-radius: 999px;
  padding: 4px 7px;
  color: #76591d;
  background: rgba(249, 229, 166, 0.5);
  font-size: 0.66rem;
  font-weight: 950;
}

.pro-agent-context-panel > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.pro-agent-context-actions {
  display: grid;
  gap: 6px;
}

.pro-agent-context-action {
  display: grid;
  gap: 3px;
  justify-items: start;
  min-width: 0;
  border: 1px solid rgba(37, 62, 51, 0.12);
  border-radius: 14px;
  padding: 9px 10px;
  color: #243b30;
  background: rgba(255, 255, 255, 0.7);
  text-align: left;
  line-height: 1.15;
  transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.pro-agent-context-action span {
  color: inherit;
  font-size: 0.76rem;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.pro-agent-context-action small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.pro-agent-context-action.primary {
  border-color: rgba(201, 157, 74, 0.36);
  background: rgba(255, 247, 222, 0.8);
  color: #624714;
}

.pro-agent-context-action.quiet {
  background: rgba(245, 248, 242, 0.58);
}

.pro-agent-context-action.running {
  border-color: rgba(201, 157, 74, 0.46);
  background: repeating-linear-gradient(
    135deg,
    rgba(255, 248, 224, 0.84) 0,
    rgba(255, 248, 224, 0.84) 7px,
    rgba(248, 233, 183, 0.72) 7px,
    rgba(248, 233, 183, 0.72) 14px
  );
  color: #614612;
}

.pro-agent-context-action:hover:not(:disabled),
.pro-agent-context-action:focus-visible:not(:disabled) {
  border-color: rgba(201, 157, 74, 0.48);
  background: rgba(255, 245, 208, 0.84);
  color: #644914;
  transform: translateY(-1px);
}

.pro-agent-context-action:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.pro-agent-action-receipt {
  display: grid;
  gap: 3px;
  border-radius: 14px;
  padding: 8px 10px;
  font-size: 0.74rem;
  line-height: 1.35;
}

.pro-agent-action-receipt.success {
  border: 1px solid rgba(76, 145, 102, 0.24);
  background: rgba(226, 245, 232, 0.66);
}

.pro-agent-action-receipt.error {
  border: 1px solid rgba(175, 72, 62, 0.22);
  background: rgba(255, 236, 232, 0.72);
}

.pro-agent-action-receipt strong {
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 950;
}

.pro-agent-action-receipt span {
  min-width: 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 780;
  overflow-wrap: anywhere;
}

.pro-mode-side-rail.has-inspector .pro-agent-context-panel {
  gap: 6px;
  padding: 8px;
  border-radius: 14px;
}

.pro-mode-side-rail.has-inspector .pro-agent-context-head strong {
  font-size: 0.78rem;
}

.pro-mode-side-rail.has-inspector .pro-agent-context-head span {
  display: none;
}

.pro-mode-side-rail.has-inspector .pro-agent-context-panel > p {
  display: none;
}

.pro-mode-side-rail.has-inspector .pro-agent-context-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.pro-mode-side-rail.has-inspector .pro-agent-context-action {
  min-height: 28px;
  justify-items: center;
  border-radius: 999px;
  padding: 5px 6px;
  text-align: center;
}

.pro-mode-side-rail.has-inspector .pro-agent-context-action span {
  font-size: 0.62rem;
  line-height: 1.1;
}

.pro-mode-side-rail.has-inspector .pro-agent-context-action small {
  display: none;
}

.pro-mode-side-rail.has-inspector .pro-agent-action-receipt {
  padding: 6px 8px;
  border-radius: 12px;
}

.pro-mode-side-rail.has-inspector .pro-agent-action-receipt span {
  display: none;
}

.pro-agent-event-digest {
  border: 1px solid rgba(53, 78, 65, 0.12);
  border-radius: 16px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.48);
}

.pro-agent-event-digest summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.compact-events {
  margin-top: 8px;
  max-height: 156px;
}

.pro-agent-empty,
.muted {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.pro-message {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.66);
}

.pro-message.user {
  background: rgba(216, 181, 91, 0.18);
}

.pro-message span {
  color: #8a6824;
  font-size: 0.74rem;
  font-weight: 900;
}

.pro-message p {
  margin: 0;
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pro-clarification-card {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  border: 1px solid rgba(201, 157, 74, 0.3);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255, 250, 228, 0.72);
}

.pro-clarification-card strong {
  color: var(--text);
  font-size: 0.84rem;
}

.pro-clarification-card div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pro-clarification-card button {
  border: 1px solid rgba(201, 157, 74, 0.34);
  border-radius: 999px;
  padding: 5px 9px;
  color: #6f4f17;
  background: rgba(255, 255, 255, 0.74);
  font-size: 0.74rem;
  font-weight: 850;
}

.pro-clarification-card small {
  color: rgba(37, 62, 51, 0.58);
  font-size: 0.72rem;
}

.pending-tool-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
  padding-right: 4px;
  overscroll-behavior: contain;
}

.pending-tool-card {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(216, 181, 91, 0.35);
  border-radius: 16px;
  padding: 12px;
  background: rgba(216, 181, 91, 0.1);
}

.pending-tool-card > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pending-tool-card strong {
  min-width: 0;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.35;
}

.pending-tool-card span {
  flex: 0 0 auto;
  border: 1px solid rgba(216, 181, 91, 0.34);
  border-radius: 999px;
  padding: 3px 8px;
  color: #6c4b13;
  background: rgba(255, 246, 216, 0.76);
  font-size: 0.72rem;
  font-weight: 850;
}

.pending-tool-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.pending-tool-card dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 8px;
  margin: 0;
}

.pending-tool-card dt,
.pending-tool-card dd {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.4;
}

.pending-tool-card dt {
  color: rgba(37, 62, 51, 0.56);
  font-weight: 850;
}

.pending-tool-card dd {
  min-width: 0;
  color: var(--text);
  word-break: break-word;
}

.pending-tool-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.pro-agent-composer {
  display: grid;
  gap: 9px;
  min-width: 0;
  flex: 0 0 auto;
}

#proAgentInput {
  width: 100%;
  min-height: 92px;
  max-height: 180px;
  overflow-y: auto;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 157, 74, 0.58) rgba(255, 255, 255, 0.16);
}

.pro-mode-side-rail.has-inspector #proAgentInput {
  height: 52px;
  min-height: 52px;
  max-height: 64px;
  resize: none;
}

.pro-mode-side-rail.has-inspector .pro-agent-action-row {
  gap: 6px;
}

.pro-mode-side-rail.has-inspector .chat-reference-upload-btn,
.pro-mode-side-rail.has-inspector .pro-agent-action-row .btn {
  min-height: 32px;
  height: 32px;
}

.pro-agent-reference-tray[hidden] {
  display: none !important;
}

.pro-agent-reference-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 54px;
  overflow: auto;
  padding-right: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 157, 74, 0.58) rgba(255, 255, 255, 0.16);
}

.pro-agent-action-row {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr);
  gap: 8px;
  align-items: center;
}

.chat-reference-upload-btn {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  justify-content: center;
}

.chat-reference-upload-icon {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px;
  min-height: 22px;
  flex: 0 0 22px;
  display: block;
  transform: none;
  color: currentColor;
}

.chat-reference-upload-btn svg {
  width: 22px !important;
  height: 22px !important;
}

.chat-reference-upload-icon path {
  vector-effect: non-scaling-stroke;
}

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

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

.compact-tools {
  grid-template-columns: 1fr;
}

.canvas-upload {
  cursor: pointer;
}

.canvas-upload input {
  display: none;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.event-stream,
.layer-list,
.tool-log-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.42);
}

.pro-project-picker {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pro-project-picker label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.pro-project-picker .select {
  width: min(280px, 70vw);
}

.pro-canvas-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.pro-canvas-shell.is-fullscreen {
  position: fixed;
  top: var(--pro-fullscreen-top, 10px);
  right: auto;
  bottom: auto;
  left: var(--pro-fullscreen-left, 10px);
  z-index: 120;
  width: calc(100vw - 20px);
  height: calc(100dvh - 20px);
  min-height: 0;
  border-radius: 20px;
}

.pro-canvas-empty {
  min-width: 0;
  min-height: 0;
}

.pro-canvas-project-empty {
  min-height: min(76vh, 820px);
  display: grid;
  align-content: center;
  padding: clamp(20px, 4vw, 46px);
  background:
    linear-gradient(150deg, rgba(246, 250, 243, 0.96), rgba(232, 243, 235, 0.88)),
    linear-gradient(90deg, rgba(201, 157, 74, 0.18), transparent 48%, rgba(81, 139, 112, 0.16));
}

.pro-project-empty-shell {
  width: min(1080px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.86fr);
  gap: clamp(18px, 3vw, 34px);
  align-items: stretch;
}

.pro-project-empty-intro {
  display: grid;
  align-content: center;
  gap: 14px;
  min-width: 0;
  grid-row: 1 / span 2;
}

.pro-project-empty-intro span {
  width: -moz-fit-content;
  width: fit-content;
  border: 1px solid rgba(201, 157, 74, 0.28);
  border-radius: 999px;
  padding: 6px 10px;
  color: #75581d;
  background: rgba(252, 243, 210, 0.62);
  font-size: 0.78rem;
  font-weight: 950;
}

.pro-project-empty-intro h1 {
  margin: 0;
  max-width: 720px;
  color: #132f23;
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.pro-project-empty-intro p {
  margin: 0;
  max-width: 600px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.75;
}

.pro-project-create-panel,
.pro-project-picker-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid rgba(53, 78, 65, 0.16);
  border-radius: 22px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 26px 72px rgba(3, 19, 12, 0.13);
}

.pro-project-create-panel {
  align-content: start;
}

.pro-project-create-panel strong,
.pro-project-picker-panel strong {
  color: var(--text);
  font-size: 1.02rem;
}

.pro-project-create-panel label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.pro-project-picker-panel {
  margin-top: 12px;
  grid-column: 2;
  box-shadow: 0 18px 54px rgba(3, 19, 12, 0.09);
}

.pro-project-picker-card {
  width: 100%;
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.pro-canvas-toolbar {
  position: absolute;
  top: 14px;
  left: 14px;
  right: calc(var(--pro-rail-width, 390px) + 42px);
  z-index: 16;
  flex-wrap: wrap;
  justify-content: space-between;
  max-height: min(22vh, 142px);
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(37, 62, 51, 0.12);
  border-radius: 14px;
  background: rgba(252, 253, 247, 0.9);
  box-shadow: 0 16px 42px rgba(11, 31, 22, 0.14);
  backdrop-filter: blur(18px);
}

.pro-canvas-shell.rail-collapsed .pro-canvas-toolbar {
  right: 14px;
}

.pro-canvas-toolbar-title {
  min-width: 140px;
}

.pro-canvas-toolbar-title strong,
.pro-canvas-toolbar-title span {
  display: block;
}

.pro-canvas-toolbar-title span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.pro-canvas-project-picker {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: min(260px, 100%);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.pro-canvas-project-picker .select {
  width: min(260px, 42vw);
  min-height: 34px;
}

.pro-canvas-actions,
.pro-tool-group {
  flex-wrap: wrap;
  min-width: 0;
}

.pro-canvas-actions {
  justify-content: flex-end;
}

.pro-canvas-toolbar .btn {
  min-height: 31px;
  padding: 6px 10px;
  font-size: 0.78rem;
}

.pro-tool-btn {
  min-height: 31px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(20, 45, 34, 0.05);
  color: var(--muted);
  font-weight: 800;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.pro-tool-btn:hover:not(:disabled),
.pro-tool-btn:focus-visible:not(:disabled) {
  border-color: rgba(201, 157, 74, 0.42);
  background: rgba(255, 246, 210, 0.72);
  color: #5d4718;
  transform: translateY(-1px);
}

.pro-tool-btn:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.pro-tool-btn.active {
  border-color: rgba(201, 157, 74, 0.58);
  background: linear-gradient(135deg, rgba(240, 216, 145, 0.92), rgba(229, 244, 236, 0.76));
  color: #1a2a22;
  box-shadow: 0 10px 26px rgba(135, 101, 24, 0.18);
}

.pro-canvas-stage-react {
  cursor: default;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  touch-action: none;
  overscroll-behavior: contain;
}

.pro-canvas-world {
  position: absolute;
  inset: 0;
  width: 2400px;
  height: 1600px;
  transform-origin: 0 0;
}

.pro-canvas-edges {
  position: absolute;
  inset: 0;
  width: 2400px;
  height: 1600px;
  overflow: hidden;
  pointer-events: none;
}

.pro-canvas-edge {
  fill: none;
  stroke: rgba(201, 157, 74, 0.76);
  stroke-width: 3.5;
  stroke-linecap: round;
  filter: drop-shadow(0 8px 12px rgba(41, 30, 8, 0.12));
}

.pro-canvas-edge-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 22;
  stroke-linecap: round;
  cursor: pointer;
  pointer-events: stroke;
}

.pro-canvas-edge.strong-reference {
  stroke: rgba(87, 160, 123, 0.92);
  stroke-width: 4.5;
  filter: drop-shadow(0 10px 14px rgba(34, 94, 67, 0.18));
}

.pro-canvas-edge.selected-edge {
  stroke: rgba(24, 49, 38, 0.94);
  stroke-width: 5;
  filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0)) drop-shadow(0 10px 20px rgba(24, 49, 38, 0.24));
}

.pro-canvas-edge.active-connection {
  stroke: rgba(203, 145, 47, 0.9);
  stroke-dasharray: 10 9;
  filter: drop-shadow(0 8px 16px rgba(145, 96, 16, 0.2));
}

.pro-canvas-edge-arrow {
  fill: rgba(201, 157, 74, 0.86);
}

.pro-canvas-selection-box {
  position: absolute;
  z-index: 9;
  border: 1px solid rgba(201, 157, 74, 0.82);
  background: rgba(201, 157, 74, 0.14);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.45) inset;
  pointer-events: none;
}

.pro-canvas-node {
  position: absolute;
  z-index: 1;
  box-sizing: border-box;
  border-radius: 22px;
  cursor: grab;
  overflow: visible;
  transition: transform 80ms linear;
}

.pro-canvas-node-surface {
  box-sizing: border-box;
  display: grid;
  align-content: start;
  gap: 8px;
  width: 100%;
  height: 100%;
  padding: 14px;
  border: 1px solid rgba(53, 78, 65, 0.2);
  border-radius: 22px;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.94), rgba(235, 243, 236, 0.86)),
    radial-gradient(circle at 12% 0%, rgba(244, 214, 139, 0.28), transparent 42%);
  box-shadow: 0 18px 54px rgba(3, 19, 12, 0.16);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-color: rgba(201, 157, 74, 0.58) rgba(255, 255, 255, 0.16);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.pro-canvas-node-surface::-webkit-scrollbar {
  width: 8px;
}

.pro-canvas-node-surface::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.pro-canvas-node-surface::-webkit-scrollbar-thumb {
  min-height: 32px;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(226, 194, 99, 0.82), rgba(95, 163, 129, 0.62));
  background-clip: padding-box;
}

.pro-canvas-node:active {
  cursor: grabbing;
}

.pro-canvas-node.selected {
  z-index: 6;
}

.pro-canvas-node.selected .pro-canvas-node-surface {
  border-color: rgba(201, 157, 74, 0.78);
  box-shadow:
    0 0 0 4px rgba(230, 202, 122, 0.22),
    0 24px 64px rgba(3, 19, 12, 0.2);
}

.pro-canvas-node.connect-source {
  z-index: 7;
}

.pro-canvas-node.connect-source .pro-canvas-node-surface {
  border-color: rgba(80, 166, 132, 0.82);
  box-shadow:
    0 0 0 5px rgba(80, 166, 132, 0.18),
    0 24px 64px rgba(3, 19, 12, 0.2);
}

.pro-canvas-node.type-task .pro-canvas-node-surface {
  background:
    linear-gradient(155deg, rgba(255, 248, 225, 0.96), rgba(239, 246, 237, 0.86)),
    radial-gradient(circle at 0% 0%, rgba(218, 171, 74, 0.34), transparent 44%);
}

.pro-canvas-node.type-note .pro-canvas-node-surface {
  background:
    linear-gradient(155deg, rgba(239, 249, 241, 0.94), rgba(225, 239, 231, 0.82)),
    radial-gradient(circle at 0% 0%, rgba(140, 199, 169, 0.28), transparent 42%);
}

.pro-canvas-node.type-input .pro-canvas-node-surface {
  border-color: rgba(80, 166, 132, 0.34);
  background:
    linear-gradient(155deg, rgba(233, 251, 241, 0.96), rgba(255, 250, 230, 0.82)),
    radial-gradient(circle at 0% 0%, rgba(88, 188, 145, 0.26), transparent 44%);
}

.pro-canvas-node.type-reference_image .pro-canvas-node-surface {
  border-color: rgba(80, 166, 132, 0.42);
  background:
    linear-gradient(155deg, rgba(240, 249, 244, 0.96), rgba(255, 251, 235, 0.86)),
    radial-gradient(circle at 0% 0%, rgba(97, 183, 141, 0.28), transparent 44%);
}

.pro-canvas-node.type-image .pro-canvas-node-surface,
.pro-canvas-node.type-design_image .pro-canvas-node-surface {
  border-color: rgba(80, 166, 132, 0.38);
  background:
    linear-gradient(155deg, rgba(240, 249, 244, 0.96), rgba(255, 252, 238, 0.88)),
    radial-gradient(circle at 0% 0%, rgba(97, 183, 141, 0.24), transparent 44%);
}

.pro-canvas-node.type-prompt .pro-canvas-node-surface {
  border-color: rgba(93, 126, 214, 0.34);
  background:
    linear-gradient(155deg, rgba(238, 242, 255, 0.94), rgba(255, 252, 235, 0.84)),
    radial-gradient(circle at 0% 0%, rgba(130, 164, 242, 0.26), transparent 44%);
}

.pro-canvas-node.type-clarification .pro-canvas-node-surface,
.pro-canvas-node.needs-clarification .pro-canvas-node-surface,
.pro-canvas-node.manual-override .pro-canvas-node-surface {
  border-color: rgba(201, 157, 74, 0.5);
  background:
    linear-gradient(155deg, rgba(255, 250, 228, 0.96), rgba(238, 248, 240, 0.9)),
    radial-gradient(circle at 0% 0%, rgba(230, 188, 86, 0.3), transparent 44%);
}

.pro-canvas-node header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.pro-canvas-node header b {
  border: 1px solid rgba(201, 157, 74, 0.28);
  border-radius: 999px;
  padding: 3px 8px;
  color: #7a5c1f;
  background: rgba(240, 216, 145, 0.22);
  letter-spacing: 0;
}

.pro-node-status-row {
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 6px;
}

.pro-node-status-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 22px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.15;
  white-space: normal;
  color: #183126;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(24, 49, 38, 0.12);
}

.pro-node-status-badge.status-running {
  color: #31577a;
  background: rgba(221, 235, 249, 0.9);
  border-color: rgba(78, 133, 184, 0.28);
}

.pro-node-status-badge.status-completed {
  color: #27604a;
  background: rgba(217, 244, 230, 0.9);
  border-color: rgba(72, 159, 116, 0.3);
}

.pro-node-status-badge.status-failed {
  color: #8b2f3e;
  background: rgba(253, 229, 232, 0.9);
  border-color: rgba(197, 70, 90, 0.3);
}

.pro-node-status-badge.status-superseded {
  color: #6b5670;
  background: rgba(238, 232, 244, 0.92);
  border-color: rgba(133, 105, 149, 0.3);
}

.pro-node-status-badge.status-forked {
  color: #73531b;
  background: rgba(250, 235, 194, 0.92);
  border-color: rgba(201, 157, 74, 0.35);
}

.pro-node-action-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 22px;
  border: 1px solid rgba(30, 68, 50, 0.14);
  border-radius: 999px;
  padding: 3px 9px;
  color: #244438;
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.15;
  white-space: normal;
}

.pro-node-action-chip.action-wait {
  color: #31577a;
  background: rgba(234, 243, 251, 0.88);
  border-color: rgba(78, 133, 184, 0.24);
}

.pro-node-action-chip.action-retry {
  color: #8b2f3e;
  background: rgba(255, 239, 241, 0.9);
  border-color: rgba(197, 70, 90, 0.24);
}

.pro-node-action-chip.action-continue {
  color: #27604a;
  background: rgba(226, 247, 235, 0.9);
  border-color: rgba(72, 159, 116, 0.26);
}

.pro-node-action-chip.action-inspect {
  color: #6b5670;
  background: rgba(242, 237, 247, 0.9);
  border-color: rgba(133, 105, 149, 0.24);
}

.pro-canvas-node img {
  width: 100%;
  max-height: 136px;
  -o-object-fit: cover;
     object-fit: cover;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.56);
  pointer-events: none;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  -webkit-user-drag: none;
}

.pro-canvas-node.type-reference_image img,
.pro-canvas-node.type-image img,
.pro-canvas-node.type-design_image img {
  height: 174px;
  max-height: none;
  -o-object-fit: contain;
     object-fit: contain;
  border: 1px solid rgba(30, 68, 50, 0.1);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(231, 241, 234, 0.64));
}

.pro-canvas-node.type-reference_image p,
.pro-canvas-node.type-image p,
.pro-canvas-node.type-design_image p {
  -webkit-line-clamp: 2;
}

.pro-node-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #10251d;
  background: linear-gradient(135deg, rgba(220, 248, 237, 0.92), rgba(231, 194, 96, 0.62));
  font-weight: 950;
}

.pro-canvas-node strong {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pro-canvas-node p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.48;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pro-canvas-node.type-reference_image p,
.pro-canvas-node.type-image p,
.pro-canvas-node.type-design_image p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.pro-canvas-node small {
  width: -moz-fit-content;
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  color: #4f6f62;
  background: rgba(11, 56, 39, 0.08);
  font-weight: 850;
}

.pro-node-gate,
.pro-node-gate-summary,
.pro-node-inspector-gate {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid rgba(201, 157, 74, 0.34);
  border-radius: 16px;
  padding: 10px;
  background: rgba(255, 246, 216, 0.58);
}

.pro-node-gate b,
.pro-node-gate-summary b,
.pro-node-inspector-gate > span {
  color: #9b7022;
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.06em;
}

.pro-node-gate span,
.pro-node-gate-summary span,
.pro-node-inspector-gate strong {
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.42;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pro-node-gate div,
.pro-node-inspector-gate div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.pro-node-gate button,
.pro-node-inspector-gate button {
  border: 1px solid rgba(201, 157, 74, 0.34);
  border-radius: 999px;
  padding: 5px 9px;
  color: #6f4f17;
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 850;
}

.pro-node-gate-actions {
  padding-top: 2px;
}

.pro-node-gate-actions button:last-child {
  color: #10251d;
  background: linear-gradient(135deg, rgba(245, 226, 152, 0.96), rgba(216, 181, 91, 0.92));
}

.pro-node-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 2px;
}

.pro-node-inline-actions button,
.pro-node-inline-prompt button {
  border: 1px solid rgba(37, 62, 51, 0.14);
  border-radius: 999px;
  padding: 5px 9px;
  color: #183126;
  background: rgba(255, 255, 255, 0.74);
  font-size: 0.72rem;
  font-weight: 880;
}

.pro-node-inline-actions button:first-child,
.pro-node-inline-prompt [data-canvas-inline-submit] {
  border-color: rgba(201, 157, 74, 0.34);
  background: linear-gradient(135deg, rgba(246, 225, 151, 0.94), rgba(225, 240, 230, 0.82));
}

.pro-node-inline-actions button:disabled,
.pro-node-inline-prompt button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.pro-node-inline-prompt {
  position: absolute;
  z-index: 12;
  top: 0;
  left: 0;
  display: grid;
  gap: 9px;
  max-height: 320px;
  overflow: auto;
  margin-top: 0;
  border: 1px solid rgba(80, 166, 132, 0.28);
  border-radius: 16px;
  padding: 10px;
  background:
    linear-gradient(135deg, rgba(237, 249, 240, 0.96), rgba(255, 250, 226, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 157, 74, 0.58) rgba(255, 255, 255, 0.16);
}

.pro-node-inline-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.pro-node-inline-head span,
.pro-node-inline-head strong {
  display: block;
}

.pro-node-inline-head span {
  color: #39745c;
  font-size: 0.7rem;
  font-weight: 920;
  line-height: 1.25;
}

.pro-node-inline-head strong {
  margin-top: 2px;
  font-size: 0.86rem;
}

.pro-node-inline-prompt .textarea {
  min-height: 92px;
  max-height: 136px;
  overflow-y: auto;
  border-radius: 12px;
  font-size: 0.8rem;
  resize: none;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 157, 74, 0.58) rgba(255, 255, 255, 0.16);
}

.pro-node-inline-submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pro-node-inline-submit-row span {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.pro-node-port {
  position: absolute;
  z-index: 10;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.94);
  border-radius: 999px;
  background: #d3bd76;
  box-shadow: 0 4px 10px rgba(22, 32, 27, 0.2);
  cursor: crosshair;
  outline: 0;
  pointer-events: auto;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.pro-node-port:hover,
.pro-node-port:focus-visible,
.pro-canvas-node.connection-target-input .pro-node-port-input,
.pro-canvas-node.connection-target-strong .pro-node-port-strong {
  border-color: rgba(255, 249, 222, 0.98);
  box-shadow: 0 0 0 6px rgba(201, 157, 74, 0.2), 0 8px 18px rgba(22, 32, 27, 0.22);
  transform: scale(1.2);
}

.pro-node-port-input {
  left: -7px;
  top: calc(50% - 7px);
}

.pro-node-port-strong {
  left: -7px;
  top: 84px;
  background: #65b58a;
}

.pro-node-port-output {
  right: -7px;
  top: calc(50% - 7px);
  background: #d79b45;
}

.pro-canvas-empty-state {
  position: absolute;
  left: 360px;
  top: 320px;
  display: grid;
  gap: 8px;
  width: 560px;
  max-width: 70vw;
  color: rgba(14, 33, 25, 0.76);
  text-align: center;
}

.pro-canvas-empty-state strong {
  font-size: clamp(1.05rem, 2vw, 1.45rem);
}

.pro-canvas-empty-state span {
  color: var(--muted);
  font-size: 0.9rem;
}

.react-pro-context-menu {
  position: fixed;
  z-index: 120;
  min-width: 196px;
  padding: 8px;
  border: 1px solid rgba(226, 211, 155, 0.28);
  border-radius: 16px;
  background: rgba(18, 29, 24, 0.94);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(16px);
}

.react-pro-context-menu-section {
  display: block;
  padding: 7px 10px 4px;
  color: rgba(239, 250, 242, 0.54);
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.react-pro-context-menu button {
  width: 100%;
  border: 0;
  border-radius: 11px;
  padding: 9px 10px;
  color: #effaf2;
  background: transparent;
  text-align: left;
  font-weight: 820;
}

.react-pro-context-menu button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.react-pro-context-menu button.danger {
  color: #ffbab0;
}

.pro-reference-chip {
  max-width: 100%;
  border: 1px solid rgba(201, 157, 74, 0.28);
  border-radius: 999px;
  padding: 6px 9px;
  overflow: hidden;
  color: #72561e;
  background: rgba(240, 216, 145, 0.2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pro-message span,
.pro-event-row span {
  display: block;
  margin-bottom: 4px;
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 900;
}

.pro-message p,
.pro-event-row p {
  margin: 0;
  color: var(--text);
  line-height: 1.55;
}

.pro-upload-progress {
  position: relative;
  min-height: 26px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(25, 51, 39, 0.08);
}

.pro-upload-progress span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(97, 185, 146, 0.76), rgba(229, 194, 96, 0.86));
}

.pro-upload-progress b {
  position: relative;
  z-index: 1;
  display: block;
  padding: 5px 10px;
  color: #173328;
  font-size: 0.75rem;
  font-weight: 900;
}

.pro-node-inspector {
  display: grid;
  flex: 1 1 auto;
  gap: 12px;
  min-height: 180px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 157, 74, 0.58) rgba(255, 255, 255, 0.16);
  color: var(--muted);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(241, 248, 241, 0.82));
}

.pro-node-inspector > strong,
.pro-node-inspector-head strong {
  color: var(--text);
}

.pro-node-inspector-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.pro-node-inspector-head span,
.pro-node-inspector-head strong {
  display: block;
}

.pro-node-inspector-head span {
  margin-bottom: 3px;
  font-size: 0.74rem;
}

.pro-node-inspector-head b {
  border: 1px solid rgba(201, 157, 74, 0.28);
  border-radius: 999px;
  padding: 5px 8px;
  color: #75581d;
  background: rgba(240, 216, 145, 0.18);
  font-size: 0.72rem;
}

.pro-node-inspector dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.pro-node-inspector dl div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid rgba(53, 78, 65, 0.1);
  padding-bottom: 7px;
}

.pro-node-inspector dt,
.pro-node-inspector dd {
  margin: 0;
  font-size: 0.78rem;
}

.pro-node-inspector dd {
  color: var(--text);
  font-weight: 850;
  text-align: right;
  word-break: break-all;
}

.pro-node-inspector-body {
  margin: 0;
  max-height: 180px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.pro-node-inspector-body::-webkit-scrollbar {
  width: 8px;
}

.pro-node-inspector-body::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.pro-node-inspector-body::-webkit-scrollbar-thumb {
  min-height: 30px;
  border: 2px solid rgba(255, 255, 255, 0.44);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(226, 194, 99, 0.82), rgba(95, 163, 129, 0.62));
  background-clip: padding-box;
}

.pro-node-inspector-task-state {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(30, 68, 50, 0.12);
  border-radius: 16px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(238, 248, 242, 0.88), rgba(255, 248, 218, 0.7));
}

.pro-node-inspector-task-state span {
  color: #7b5b1d;
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.06em;
}

.pro-node-inspector-task-state strong {
  color: var(--text);
  font-size: 0.9rem;
}

.pro-node-inspector-task-state p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.pro-node-inspector-task-state small {
  width: -moz-fit-content;
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  color: #244438;
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 900;
}

.pro-node-inspector-lineage {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(30, 68, 50, 0.12);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.62);
}

.pro-node-inspector-lineage span {
  color: #496e5e;
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.06em;
}

.pro-node-inspector-lineage div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.pro-node-inspector-lineage small {
  display: inline-flex;
  max-width: 100%;
  border: 1px solid rgba(30, 68, 50, 0.12);
  border-radius: 999px;
  padding: 4px 8px;
  color: #244438;
  background: rgba(238, 248, 242, 0.86);
  font-size: 0.72rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.pro-node-inspector-image {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.pro-node-inspector-image img {
  width: 100%;
  max-height: 240px;
  -o-object-fit: contain;
     object-fit: contain;
  border: 1px solid rgba(30, 68, 50, 0.12);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.74), rgba(231, 241, 234, 0.64));
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  -webkit-user-drag: none;
}

.pro-node-inspector-image-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.pro-node-inspector-image-actions a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(201, 157, 74, 0.34);
  border-radius: 999px;
  color: #6f4f17;
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: none;
}

.pro-node-inspector-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px;
}

.pro-node-local-chat {
  display: grid;
  gap: 14px;
}

.pro-node-local-target {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(201, 157, 74, 0.26);
  border-radius: 16px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(255, 248, 218, 0.82), rgba(238, 247, 239, 0.78));
}

.pro-node-local-target span {
  color: #806022;
  font-size: 0.74rem;
  font-weight: 900;
}

.pro-node-local-target strong {
  color: var(--text);
}

.pro-node-local-target p {
  max-height: 120px;
  margin: 0;
  overflow: auto;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.pro-node-local-chat label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.pro-canvas-stage {
  flex: 1;
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(rgba(37, 62, 51, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 62, 51, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 50% 38%, rgba(207, 230, 220, 0.32), transparent 46%);
  background-size: 30px 30px, 30px 30px, auto;
}

.pro-canvas-body {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.pro-canvas-status {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 3;
  width: -moz-fit-content;
  width: fit-content;
  max-width: calc(100% - 28px);
  padding: 8px 11px;
  border: 1px solid rgba(37, 62, 51, 0.12);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.9);
  font-size: 0.78rem;
  box-shadow: var(--shadow-sm);
}

.pro-canvas-shell:fullscreen {
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  border-radius: 0;
  border: 0;
  background:
    radial-gradient(circle at 18% 10%, rgba(240, 216, 145, 0.18), transparent 30%),
    radial-gradient(circle at 85% 18%, rgba(205, 229, 219, 0.28), transparent 35%),
    var(--panel-strong);
}

.pro-canvas-shell:fullscreen .pro-canvas-toolbar,
.pro-canvas-shell.is-fullscreen .pro-canvas-toolbar {
  top: 16px;
  left: 16px;
  right: calc(var(--pro-rail-width, 390px) + 52px);
  max-height: min(24vh, 190px);
  border-radius: 18px;
  background: rgba(252, 253, 247, 0.94);
}

.pro-canvas-shell.rail-collapsed:fullscreen .pro-canvas-toolbar,
.pro-canvas-shell.rail-collapsed.is-fullscreen .pro-canvas-toolbar {
  right: 16px;
}

.pro-canvas-shell:fullscreen .pro-canvas-body,
.pro-canvas-shell.is-fullscreen .pro-canvas-body {
  min-height: 0;
}

.pro-canvas-shell:fullscreen .pro-mode-side-rail,
.pro-canvas-shell.is-fullscreen .pro-mode-side-rail {
  top: 18px;
  right: 18px;
  bottom: 18px;
  width: min(var(--pro-rail-width, 390px), calc(100% - 72px));
}

.pro-canvas-shell:fullscreen .pro-canvas-stage,
.pro-canvas-shell.is-fullscreen .pro-canvas-stage {
  background-size: 34px 34px, 34px 34px, auto;
}

@media (max-width: 1100px) {
  .pro-mode-workspace {
    overflow: auto;
    scrollbar-gutter: stable;
  }

  .pro-canvas-shell,
  .pro-canvas-empty {
    min-height: min(68vh, 620px);
  }

  .pro-mode-side-rail {
    position: static;
    width: 100%;
    margin-top: 14px;
    overflow: visible;
    padding-right: 0;
  }

  .pro-canvas-toolbar {
    right: 14px;
  }

  .pro-project-empty-shell {
    grid-template-columns: 1fr;
  }

  .pro-project-empty-intro,
  .pro-project-picker-panel {
    grid-column: 1;
    grid-row: auto;
  }

}

@media (max-width: 700px) {
  .history-page-actions,
  .pro-mode-header,
  .pro-project-picker {
    align-items: stretch;
    justify-content: stretch;
  }

  .history-management-summary,
  .history-filter-grid,
  .history-detail-status-panel,
  .history-deliverable-summary,
  .history-deliverable-grid {
    grid-template-columns: 1fr;
  }

  .history-project-title-row,
  .history-deliverable-group-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .history-page-actions,
  .history-page-actions .input,
  .workspace-continue-banner,
  .pro-project-picker,
  .pro-project-picker .select,
  .pro-project-picker .btn {
    width: 100%;
  }

  .workspace-continue-banner {
    flex-direction: column;
  }
}

.workspace-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 4px 4px 8px;
  color: var(--text-inverse);
}

.workspace-hero span {
  display: block;
  color: #f0d898;
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.16em;
}

.workspace-hero h1 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.workspace-hero p {
  max-width: 520px;
  margin: 0;
  color: var(--muted-inverse);
  font-size: 0.98rem;
}

.workspace-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(520px, 1fr) minmax(280px, 340px);
  gap: 18px;
}

.workspace-rail,
.workspace-chat-panel,
.workspace-artifact-panel,
.workspace-mobile-projects,
.workspace-mobile-artifacts {
  min-height: 0;
}

.workspace-chat-panel {
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 249, 242, 0.94));
}

.workspace-chat-panel > *,
.workspace-artifact-panel > *,
.workspace-mobile-projects > *,
.workspace-mobile-artifacts > *,
.pro-canvas-shell > * {
  position: relative;
  z-index: 1;
}

.workspace-artifact-panel {
  background:
    linear-gradient(180deg, rgba(244, 250, 242, 0.94), rgba(232, 242, 233, 0.88));
}

.workspace-mobile-projects,
.workspace-mobile-artifacts {
  display: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(239, 248, 240, 0.92));
}

.workspace-mobile-artifacts .empty-state {
  min-height: 210px;
  border-radius: 24px;
  border: 1px solid rgba(37, 62, 51, 0.12);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 248, 218, 0.56), transparent 42%),
    linear-gradient(180deg, rgba(250, 253, 247, 0.98), rgba(231, 242, 232, 0.95));
  color: #405248;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.workspace-mobile-artifacts .empty-state strong {
  color: var(--text);
  font-size: 1.02rem;
}

.workspace-mobile-artifacts .empty-state .text-muted {
  color: #56685d;
  max-width: 250px;
  line-height: 1.7;
}

.workspace-mobile-projects .project-list-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  max-height: 240px;
  overflow: auto;
  padding-right: 2px;
}

.workspace-mobile-projects .project-list-row {
  min-height: 62px;
}

.workspace-start-panel {
  min-height: 100%;
  display: grid;
  align-content: center;
  gap: 22px;
  padding: clamp(18px, 4vw, 44px);
}

.workspace-start-hero {
  display: grid;
  gap: 14px;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.workspace-start-hero span {
  color: #8c6b25;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.workspace-start-hero h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.65rem, 4vw, 3.2rem);
  letter-spacing: -0.055em;
}

.workspace-start-hero p {
  margin: 0 auto;
  max-width: 560px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.8;
}

.workspace-start-hero .btn {
  justify-self: center;
  min-width: 220px;
}

.workspace-start-list {
  width: min(760px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.workspace-start-project {
  min-width: 0;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(37, 62, 51, 0.12);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(239, 248, 240, 0.72));
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(37, 62, 51, 0.08);
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.workspace-start-project:hover {
  transform: translateY(-2px);
  border-color: rgba(201, 157, 74, 0.42);
  box-shadow: 0 18px 42px rgba(37, 62, 51, 0.12);
}

.workspace-start-project strong,
.workspace-start-project small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-start-project strong {
  font-weight: 900;
}

.workspace-start-project small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.78rem;
}

.app-dialog-content {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-height: min(720px, calc(100dvh - 32px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-dialog-header {
  flex: 0 0 auto;
  padding: 24px 24px 0;
}

.app-dialog-body {
  min-height: 0;
  overflow: auto;
  padding: 16px 24px 0;
}

.app-dialog-actions {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 18px 24px 24px;
}

.project-summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(27, 64, 49, 0.08), rgba(201, 157, 74, 0.08));
  border: 1px solid rgba(37, 62, 51, 0.12);
}

.project-summary-card strong,
.project-summary-card span {
  display: block;
}

.project-summary-card strong {
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.project-summary-card span {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 2px;
}

.project-summary-card em {
  flex: 0 0 auto;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(201, 157, 74, 0.14);
  color: #7d5f1f;
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 850;
}

.project-list > .btn,
.project-create-form .btn {
  width: 100%;
}

.project-create-form {
  padding: 12px;
  border-radius: 22px;
  background: rgba(20, 45, 34, 0.045);
  border: 1px solid rgba(37, 62, 51, 0.10);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-create-bridge {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}

.project-create-form .dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.project-create-form .dialog-actions .btn {
  width: auto;
}

.project-list-items {
  margin: 0;
  padding: 0;
  list-style: none;
}

.project-list-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  min-height: 68px;
  padding: 12px 12px 12px 14px;
  border-radius: 20px;
  border: 1px solid transparent;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.project-list-row::before {
  content: "";
  position: absolute;
  inset: 7px auto 7px 0;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f1dca3, var(--gold));
  opacity: 0;
  transform: scaleY(0.46);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.project-list-select {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.project-list-select:disabled {
  cursor: progress;
}

.project-list-row .btn-icon {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
}

.project-list-row:hover {
  background: rgba(26, 68, 50, 0.055);
  transform: translateX(2px);
  box-shadow: 0 12px 28px rgba(37, 62, 51, 0.08);
}

.project-list-row.active {
  background: linear-gradient(135deg, rgba(207, 230, 220, 0.58), rgba(255, 246, 210, 0.42));
  border-color: rgba(201, 157, 74, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62), 0 14px 34px rgba(201, 157, 74, 0.11);
}

.project-list-row.switching {
  background: linear-gradient(135deg, rgba(255, 248, 222, 0.82), rgba(230, 244, 235, 0.72));
  border-color: rgba(201, 157, 74, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 16px 38px rgba(37, 62, 51, 0.12);
}

.project-list-row:hover::before,
.project-list-row:focus-within::before,
.project-list-row.active::before {
  opacity: 1;
  transform: scaleY(1);
}

.project-list-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.project-list-name {
  display: block;
  flex: 1 1 auto;
  color: var(--text);
  font-weight: 850;
  min-width: 0;
}

.project-list-switching {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(201, 157, 74, 0.16);
  color: #7d5f1f;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
}

.project-list-meta {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-pane-refresh {
  min-width: 0;
  min-height: 0;
}

.workspace-chat-panel > .workspace-pane-refresh {
  flex: 1;
}

.workspace-pane-loading {
  display: grid;
  align-content: start;
  gap: 12px;
}

.workspace-local-switching {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 11px;
  border-radius: 14px;
  border: 1px solid rgba(201, 157, 74, 0.22);
  background: rgba(255, 249, 229, 0.72);
  color: #73581e;
  font-size: 0.82rem;
  font-weight: 850;
}

.workspace-local-switching::before {
  content: "";
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(201, 157, 74, 0.14);
}

.chat-thread {
  padding: 2px 2px 18px;
}

.chat-empty-state {
  min-height: 220px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  border-radius: 28px;
  border: 1px dashed rgba(37, 62, 51, 0.18);
  background: rgba(255, 255, 255, 0.36);
}

.chat-message-row {
  padding: 0 4px;
}

.chat-bubble {
  max-width: min(84%, 780px);
  border-radius: 22px;
  padding: 13px 15px;
  font-size: 0.96rem;
  line-height: 1.65;
  box-shadow: 0 8px 26px rgba(37, 62, 51, 0.08);
  animation: chat-bubble-in 280ms cubic-bezier(0.2, 0.78, 0.22, 1) both;
}

.chat-bubble-user {
  border-top-right-radius: 8px;
  background: linear-gradient(135deg, #f5e0a2, #d8b85f);
  color: #172118;
}

.chat-bubble-assistant {
  border-top-left-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(37, 62, 51, 0.12);
}

.chat-thinking-bubble {
  width: -moz-fit-content;
  width: fit-content;
  max-width: min(84%, 560px);
  margin: 0 4px;
  padding: 13px 15px;
  border: 1px solid rgba(37, 62, 51, 0.12);
  border-radius: 22px 22px 22px 8px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 246, 210, 0.58), transparent 44%),
    rgba(255, 255, 255, 0.76);
  color: #304238;
  box-shadow: 0 8px 26px rgba(37, 62, 51, 0.08);
  animation: chat-bubble-in 280ms cubic-bezier(0.2, 0.78, 0.22, 1) both;
}

.chat-thinking-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #5f4a19;
  font-size: 0.84rem;
  font-weight: 850;
}

.chat-thinking-toggle {
  width: 100%;
  min-height: 30px;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.chat-thinking-head::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 0 6px rgba(201, 157, 74, 0.12);
}

.chat-thinking-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
}

.chat-thinking-dots::before,
.chat-thinking-dots::after,
.chat-thinking-dots span,
.chat-thinking-dots i {
  content: "";
  display: block;
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(95, 74, 25, 0.72);
  animation: thinking-dot 1s ease-in-out infinite;
}

.chat-thinking-dots span,
.chat-thinking-dots i:nth-child(1) {
  animation-delay: 120ms;
}

.chat-thinking-dots i:nth-child(2) {
  animation-delay: 240ms;
}

.chat-thinking-dots::after {
  animation-delay: 360ms;
}

.chat-thinking-timer {
  color: rgba(95, 74, 25, 0.62);
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

.chat-thinking-content {
  max-height: min(260px, 34dvh);
  overflow: auto;
  padding-right: 4px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.chat-thinking-title {
  display: block;
  margin-top: 10px;
  color: #425348;
  font-size: 0.88rem;
  line-height: 1.45;
}

.chat-thinking-body {
  margin: 10px 0 0;
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-thinking-steps {
  display: grid;
  gap: 7px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.chat-thinking-steps li {
  position: relative;
  padding-left: 18px;
  color: #5e6f62;
  font-size: 0.9rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.chat-thinking-steps li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.68em;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(201, 157, 74, 0.72);
}

.chat-thinking-next {
  display: block;
  margin-top: 10px;
  color: #6a756e;
  overflow-wrap: anywhere;
}

.chat-message-assets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chat-message-assets img,
.chat-bubble img {
  width: min(180px, 46vw);
  max-height: 220px;
  -o-object-fit: cover;
     object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(37, 62, 51, 0.12);
}

.chat-composer {
  padding-top: 14px;
  border-top: 1px solid rgba(37, 62, 51, 0.10);
}

.chat-composer-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 10px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(238, 247, 239, 0.86));
  border: 1px solid rgba(37, 62, 51, 0.13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.chat-composer-row:focus-within {
  border-color: rgba(201, 157, 74, 0.5);
  box-shadow: 0 0 0 4px rgba(201, 157, 74, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.88);
  transform: translateY(-1px);
}

.chat-composer-row .btn-icon {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
}

.chat-composer-row .btn-icon svg {
  display: block;
  margin: auto;
}

.chat-composer-input {
  min-height: 54px;
  max-height: 150px;
  border: 0;
  background: transparent;
  box-shadow: none;
  resize: none;
}

.chat-composer-input:focus {
  box-shadow: none;
}

.upload-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 10px;
}

.upload-chip {
  position: relative;
  width: 94px;
  height: 94px;
  overflow: hidden;
  border: 1px solid rgba(37, 62, 51, 0.14);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 10px 28px rgba(37, 62, 51, 0.10);
}

.upload-chip-image {
  width: 100%;
  height: 100%;
  display: block;
  -o-object-fit: cover;
     object-fit: cover;
}

.upload-chip-progress,
.upload-chip-error {
  position: absolute;
  inset: auto 6px 6px;
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

.upload-chip-progress {
  padding: 6px;
  background: rgba(13, 24, 19, 0.72);
  color: #fff8dc;
  font-size: 0.68rem;
  font-weight: 850;
}

.upload-chip-progress > div {
  height: 4px;
  margin-top: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.upload-chip-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #fff3bb, #d7ae42);
  transition: width 160ms ease;
}

.upload-chip-error {
  inset: 6px;
  display: grid;
  place-items: center;
  padding: 8px;
  color: #fff;
  font-size: 0.68rem;
  line-height: 1.25;
  text-align: center;
  background: rgba(137, 33, 28, 0.82);
}

.upload-chip-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  min-height: 24px;
  border-radius: 999px;
  color: #fff;
  background: rgba(13, 24, 19, 0.58);
}

.artifact-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(37, 62, 51, 0.14);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.artifact-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 38%, rgba(255, 255, 255, 0.38), transparent 62%);
  opacity: 0;
  transform: translateX(-28%);
  transition: opacity var(--transition-fast), transform 420ms ease;
  pointer-events: none;
}

.artifact-card:hover {
  border-color: rgba(201, 157, 74, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(37, 62, 51, 0.13);
}

.artifact-card:hover::after {
  opacity: 1;
  transform: translateX(28%);
}

.artifact-card-preview,
.artifact-card-file {
  width: 100%;
  aspect-ratio: 1;
}

.artifact-card-preview {
  display: block;
  -o-object-fit: cover;
     object-fit: cover;
}

.artifact-card-file {
  display: grid;
  place-items: center;
  padding: 18px;
  color: var(--muted);
  background:
    radial-gradient(circle at 50% 42%, rgba(207, 230, 220, 0.55), transparent 42%),
    linear-gradient(135deg, rgba(27, 64, 49, 0.05), rgba(201, 157, 74, 0.09));
  text-align: center;
}

.artifact-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}

.artifact-card-title {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifact-card-download {
  flex: 0 0 auto;
  color: #8a6720;
  font-size: 0.82rem;
  font-weight: 850;
}

.btn-sm {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
}

.project-tree-panel {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 26px;
  border: 1px solid rgba(37, 62, 51, 0.14);
  background:
    radial-gradient(circle at 10% 0%, rgba(240, 216, 145, 0.24), transparent 36%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.86), rgba(234, 244, 235, 0.76));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    0 20px 46px rgba(37, 62, 51, 0.1);
}

.project-tree-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.project-tree-kicker {
  display: block;
  color: #92712b;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.project-tree-head h3 {
  margin: 3px 0 0;
  color: var(--text);
  font-size: 1.02rem;
  letter-spacing: -0.025em;
}

.project-tree-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.project-tree-stats span,
.project-tree-type {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(201, 157, 74, 0.13);
  color: #85631d;
  font-size: 0.72rem;
  font-weight: 900;
}

.project-tree-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.project-tree-graph,
.project-tree-inspector {
  min-width: 0;
  border-radius: 20px;
  border: 1px solid rgba(37, 62, 51, 0.1);
  background: rgba(255, 255, 255, 0.48);
}

.project-tree-graph {
  max-height: 360px;
  overflow: auto;
  padding: 10px;
}

.project-tree-children {
  margin-left: 16px;
  padding-left: 11px;
  border-left: 1px solid rgba(201, 157, 74, 0.22);
}

.project-tree-node {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 3px 0;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.project-tree-node:hover,
.project-tree-node[data-selected="true"] {
  transform: translateX(2px);
  border-color: rgba(201, 157, 74, 0.34);
  background: rgba(255, 250, 225, 0.64);
}

.project-tree-node-dot {
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, #e7d18a, #3f8d62);
  box-shadow: 0 0 0 4px rgba(201, 157, 74, 0.13);
}

.project-tree-node-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.project-tree-node-main em {
  color: #8b6923;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 900;
}

.project-tree-node-main strong,
.project-tree-node-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-tree-node-main strong {
  font-size: 0.84rem;
}

.project-tree-node-main small {
  color: var(--muted);
  font-size: 0.72rem;
}

.project-tree-inspector {
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 12px;
}

.project-tree-inspector strong {
  color: var(--text);
  font-size: 0.98rem;
}

.project-tree-inspector p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.65;
}

.project-tree-inspector img {
  width: 100%;
  max-height: 180px;
  -o-object-fit: cover;
     object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(37, 62, 51, 0.1);
}

.project-tree-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-tree-assets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.project-tree-assets button {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 7px;
  border-radius: 15px;
  border: 1px solid rgba(37, 62, 51, 0.1);
  background: rgba(255, 255, 255, 0.5);
  color: var(--text);
  cursor: pointer;
}

.project-tree-assets img,
.project-tree-assets span {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  -o-object-fit: cover;
     object-fit: cover;
  background:
    radial-gradient(circle, rgba(201, 157, 74, 0.18), transparent 54%),
    rgba(37, 62, 51, 0.06);
}

.project-tree-assets small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brief-action-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin: 2px 2px 16px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(201, 157, 74, 0.22);
  border-radius: 26px;
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 244, 199, 0.72), transparent 38%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(234, 246, 235, 0.9));
  box-shadow: 0 18px 48px rgba(37, 62, 51, 0.10);
  animation: brief-card-enter 340ms cubic-bezier(0.2, 0.78, 0.22, 1) both;
}

.brief-action-card::before {
  content: "";
  position: absolute;
  inset: auto 18px 0;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, transparent, rgba(201, 157, 74, 0.7), transparent);
  opacity: 0.72;
}

.brief-action-card h3 {
  margin: 4px 0 8px;
  color: #17241c;
  font-family: var(--font-display);
  font-size: clamp(1.24rem, 2.6vw, 1.78rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.brief-action-card p {
  max-width: 68ch;
  margin: 0;
  color: #405248;
  line-height: 1.72;
}

.brief-action-card small {
  display: block;
  margin-top: 10px;
  color: #66746b;
  font-size: 0.82rem;
  line-height: 1.6;
}

.brief-action-card .btn {
  align-self: center;
  min-width: 132px;
  box-shadow: 0 12px 30px rgba(201, 157, 74, 0.18);
}

.brief-action-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #8a6720;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.brief-action-kicker::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 0 6px rgba(201, 157, 74, 0.13);
}

.brief-confirm-card {
  border-color: rgba(108, 143, 112, 0.26);
  background:
    radial-gradient(circle at 8% 0%, rgba(207, 230, 220, 0.82), transparent 40%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(241, 249, 238, 0.93));
}

.brief-confirm-reference-note {
  display: block;
  margin-top: 6px;
  color: rgba(46, 78, 64, 0.74);
}

.brief-confirm-reference-strip {
  display: flex;
  max-width: 100%;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
}

.brief-confirm-reference-strip img {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  -o-object-fit: cover;
     object-fit: cover;
  border: 1px solid rgba(37, 62, 51, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 18px rgba(37, 62, 51, 0.10);
}

.brief-question-card {
  max-height: min(680px, 64dvh);
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-items: stretch;
  min-height: 0;
}

.brief-question-status-card {
  grid-template-columns: minmax(0, 1fr);
}

.brief-question-head {
  max-width: 760px;
}

.brief-question-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 12px;
  margin-top: 4px;
  padding: 2px 4px 2px 0;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.brief-question-item {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(37, 62, 51, 0.11);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(250, 253, 247, 0.66));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.brief-question-item strong {
  color: #203027;
  line-height: 1.58;
}

.brief-question-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.brief-question-options button {
  min-height: 36px;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(201, 157, 74, 0.24);
  border-radius: 999px;
  background: rgba(255, 248, 220, 0.68);
  color: #624b17;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.brief-question-options button:hover:not(:disabled),
.brief-question-options button:focus-visible:not(:disabled) {
  border-color: rgba(201, 157, 74, 0.58);
  background: linear-gradient(135deg, #fff4c7, rgba(201, 157, 74, 0.2));
  box-shadow: 0 10px 22px rgba(201, 157, 74, 0.12);
  transform: translateY(-1px);
}

.brief-question-options button.is-selected {
  border-color: rgba(201, 157, 74, 0.88);
  background: linear-gradient(135deg, #f1cf68, #d3a743);
  color: #102419;
  box-shadow: 0 12px 28px rgba(201, 157, 74, 0.25);
}

.brief-question-options button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.brief-question-custom {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
}

.brief-question-custom .input {
  min-height: 44px;
}

.brief-question-textarea {
  max-height: 128px;
  overflow: auto;
  resize: none;
  line-height: 1.55;
}

.brief-question-submit-row {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin: 2px -2px -2px;
  padding: 12px 2px 2px;
  border-top: 1px solid rgba(37, 62, 51, 0.08);
  background:
    linear-gradient(180deg, rgba(247, 251, 243, 0.72), rgba(247, 251, 243, 0.96));
  backdrop-filter: blur(10px);
}

.brief-question-submit-row small {
  color: rgba(52, 71, 61, 0.68);
  font-weight: 700;
}

.react-model3d-section {
  min-width: 0;
}

.react-model3d-viewer {
  overflow: hidden;
  border: 1px solid rgba(201, 157, 74, 0.26);
  border-radius: 28px;
  background:
    radial-gradient(circle at 18% 18%, rgba(207, 230, 220, 0.26), transparent 28%),
    linear-gradient(145deg, rgba(17, 28, 22, 0.95), rgba(36, 31, 19, 0.92));
  color: #f8fff5;
  box-shadow: 0 24px 68px rgba(0, 0, 0, 0.22);
}

.react-model3d-head,
.react-model3d-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
}

.react-model3d-head strong,
.react-model3d-modal-head strong {
  display: block;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.react-model3d-head span,
.react-model3d-modal-head span {
  display: block;
  margin-top: 4px;
  color: rgba(238, 248, 236, 0.68);
  font-size: 0.78rem;
}

.react-model3d-actions {
  display: inline-flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.react-model3d-actions .btn-secondary {
  color: #f8fff5;
  border-color: rgba(238, 248, 236, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

.react-model3d-stage {
  position: relative;
  min-height: 280px;
  margin: 0 14px;
  overflow: hidden;
  border: 1px solid rgba(238, 248, 236, 0.12);
  border-radius: 24px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 50% 44%, rgba(207, 230, 220, 0.12), transparent 42%),
    #111816;
  background-size: 28px 28px, 28px 28px, auto, auto;
  cursor: grab;
  touch-action: none;
}

.react-model3d-stage:active {
  cursor: grabbing;
}

.react-model3d-stage canvas,
.react-model3d-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.react-model3d-stage canvas {
  z-index: 2;
}

.react-model3d-preview {
  z-index: 1;
  -o-object-fit: contain;
     object-fit: contain;
  padding: 10px;
  opacity: 0.9;
}

.react-model3d-stage[data-model3d-viewer="three"] .react-model3d-preview {
  opacity: 0.3;
  filter: blur(1px) saturate(0.9);
}

.react-model3d-status {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  width: -moz-fit-content;
  width: fit-content;
  max-width: calc(100% - 24px);
  padding: 8px 10px;
  border: 1px solid rgba(238, 248, 236, 0.14);
  border-radius: 999px;
  color: rgba(248, 255, 245, 0.82);
  background: rgba(8, 18, 14, 0.74);
  font-size: 0.76rem;
  backdrop-filter: blur(14px);
}

.react-model3d-downloads {
  display: grid;
  gap: 10px;
  padding: 14px 16px 16px;
}

.react-model3d-download-primary {
  width: 100%;
}

.react-model3d-package-pending {
  display: block;
  padding: 12px 14px;
  border: 1px dashed rgba(238, 248, 236, 0.2);
  border-radius: 18px;
  color: rgba(238, 248, 236, 0.7);
  font-size: 0.84rem;
}

.react-model3d-file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.react-model3d-file-link {
  max-width: 100%;
  overflow: hidden;
  padding: 8px 11px;
  border: 1px solid rgba(238, 248, 236, 0.14);
  border-radius: 999px;
  color: #f5df9e;
  background: rgba(255, 255, 255, 0.07);
  font-size: 0.78rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.react-model3d-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 48px);
  background: rgba(4, 10, 8, 0.74);
  backdrop-filter: blur(18px);
}

.react-model3d-modal {
  width: min(1120px, 100%);
  max-height: min(860px, 100%);
  overflow: hidden;
  border: 1px solid rgba(238, 248, 236, 0.18);
  border-radius: 34px;
  background:
    radial-gradient(circle at 18% 18%, rgba(207, 230, 220, 0.14), transparent 30%),
    linear-gradient(145deg, #0f1815, #191811);
  color: #f8fff5;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.5);
}

.react-model3d-stage-modal {
  height: min(70vh, 680px);
  margin: 0 18px 18px;
}

@media (max-width: 1180px) {
  .workspace-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .workspace-rail,
  .workspace-artifact-panel {
    display: none;
  }

  .workspace-mobile-projects,
  .workspace-mobile-artifacts {
    display: block;
  }

  .workspace-hero {
    display: block;
  }

  .workspace-hero p {
    margin-top: 10px;
  }
}

@media (max-width: 700px) {
  .workspace-page {
    gap: 12px;
  }

  .workspace-hero {
    padding: 0 2px;
  }

  .workspace-hero h1 {
    font-size: clamp(2.35rem, 12vw, 3.2rem);
    line-height: 1;
  }

  .workspace-hero p {
    font-size: 0.9rem;
  }

  .workspace-chat-panel,
  .workspace-mobile-projects,
  .workspace-mobile-artifacts {
    padding: 14px;
    border-radius: 24px;
  }

  .project-summary-card {
    display: grid;
    gap: 10px;
  }

  .chat-bubble {
    max-width: 94%;
    padding: 12px 13px;
    border-radius: 22px;
    font-size: 0.93rem;
  }

  .chat-composer-row {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: stretch;
  }

  .chat-composer-row .textarea {
    grid-column: 1 / -1;
    order: -1;
    min-height: 88px;
  }

  .chat-composer-row .btn:not(.btn-icon) {
    min-height: 46px;
  }

  .react-model3d-head,
  .react-model3d-modal-head {
    display: grid;
  }

  .react-model3d-actions {
    justify-content: flex-start;
  }

  .react-model3d-stage {
    min-height: 230px;
    margin: 0 10px;
  }

  .react-model3d-stage-modal {
    height: 64vh;
    margin: 0 10px 10px;
  }

  .react-model3d-modal-backdrop {
    padding: 10px;
  }

  .react-model3d-modal {
    border-radius: 26px;
  }
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.mobile-topbar {
  display: none;
}

.mobile-menu-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  gap: 4px;
  border: 1px solid rgba(232, 210, 153, 0.2);
  border-radius: 16px;
  background:
    radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.16), transparent 40%),
    rgba(8, 22, 17, 0.72);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.mobile-menu-button span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #f4f5e8;
}

.app-content {
  flex: 1;
  overflow: auto;
  padding: 18px;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

@media (min-width: 1024px) {
  .app-content {
    padding: 28px 32px;
  }
}

@media (max-width: 1023px) {
  .mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: calc(env(safe-area-inset-top) + 8px) 14px 8px;
    color: #f7fff4;
    background:
      linear-gradient(135deg, rgba(5, 18, 13, 0.88), rgba(30, 26, 14, 0.78)),
      radial-gradient(circle at 84% 0%, rgba(201, 157, 74, 0.22), transparent 32%);
    border-bottom: 1px solid rgba(232, 210, 153, 0.12);
    backdrop-filter: blur(18px);
  }

  .mobile-topbar strong {
    font-size: 0.95rem;
    letter-spacing: 0.02em;
  }

  .app-content {
    padding: 14px;
  }
}

/* Admin console */
.admin-page {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
}

.admin-page-header span {
  display: block;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.14em;
}

.admin-page-header h1 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.admin-page-header p {
  max-width: 520px;
  margin: 0;
  color: var(--muted-inverse);
  line-height: 1.7;
}

.admin-tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 6px;
  border: 1px solid rgba(224, 238, 226, 0.14);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(18px);
  scrollbar-gutter: stable;
}

.admin-tab {
  position: relative;
  flex: 0 0 auto;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 0 16px;
  background: transparent;
  color: rgba(238, 248, 236, 0.68);
  font-weight: 850;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.admin-tab:hover {
  color: #fff8df;
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.admin-tab.active {
  color: #16231b;
}

.admin-tab-label {
  position: relative;
  z-index: 1;
}

.admin-tab-active-bg {
  position: absolute;
  inset: -1px;
  border-radius: 18px;
  border: 1px solid rgba(255, 244, 199, 0.72);
  background: linear-gradient(135deg, #fff2bf, var(--gold));
  box-shadow: 0 14px 30px rgba(201, 157, 74, 0.24);
  z-index: 0;
}

.admin-tab-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.admin-soft-card {
  border: 1px solid rgba(37, 62, 51, 0.12);
  border-radius: 16px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.62), transparent 40%),
    linear-gradient(135deg, rgba(248, 250, 242, 0.94), rgba(230, 238, 229, 0.76));
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  padding: 12px;
}

.admin-soft-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid rgba(37, 62, 51, 0.12);
  border-radius: 999px;
  background: rgba(248, 250, 242, 0.88);
  color: var(--text);
  padding: 0 11px;
  font-size: 0.82rem;
  font-weight: 760;
}

.admin-table-scroll {
  max-height: min(48vh, 520px);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(37, 62, 51, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.24);
  scrollbar-gutter: stable;
}

.admin-table-scroll.compact {
  max-height: 360px;
}

.admin-log-table-scroll {
  max-height: min(54vh, 620px);
}

.admin-log-payload-preview {
  margin: 8px 0 0;
  max-height: 220px;
  overflow: auto;
  border: 1px solid rgba(37, 62, 51, 0.1);
  border-radius: 12px;
  background: rgba(248, 250, 242, 0.78);
  padding: 10px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.admin-table-scroll table {
  border-collapse: separate;
  border-spacing: 0;
}

.admin-table-scroll thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(247, 250, 243, 0.96);
  backdrop-filter: blur(12px);
}

.admin-section-label {
  display: inline-flex;
  width: -moz-fit-content;
  width: fit-content;
  margin-bottom: 6px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.admin-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.admin-section-head h3,
.admin-table-title {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 950;
}

.admin-business-filter-panel {
  display: grid;
  gap: 18px;
}

.admin-business-filter-panel p {
  margin: 0;
  color: var(--muted);
}

.admin-business-filter-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.admin-business-filter-row label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 820;
}

.admin-business-period-grid,
.admin-business-kpi-grid,
.admin-business-grid-two {
  display: grid;
  gap: 14px;
}

.admin-business-period-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-business-kpi-grid,
.admin-business-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-business-period-card {
  display: grid;
  gap: 12px;
}

.admin-business-period-card .admin-section-head b {
  border: 1px solid rgba(80, 166, 132, 0.24);
  border-radius: 999px;
  background: rgba(224, 247, 234, 0.72);
  color: #1d6f4b;
  padding: 5px 10px;
  font-size: 0.78rem;
}

.admin-business-period-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.admin-business-period-metrics div,
.admin-business-metric-card {
  border: 1px solid rgba(37, 62, 51, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.42);
  padding: 10px;
}

.admin-business-period-metrics span,
.admin-business-metric-card span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 760;
}

.admin-business-period-metrics strong,
.admin-business-metric-card strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 950;
}

.admin-business-metric-select {
  width: 160px;
}

.admin-business-line-chart {
  width: 100%;
  min-height: 190px;
}

.admin-business-line-chart .chart-axis {
  stroke: rgba(37, 62, 51, 0.14);
  stroke-width: 1;
}

.admin-business-line-chart .chart-line {
  fill: none;
  stroke: var(--gold);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 8px 12px rgba(201, 157, 74, 0.16));
}

.admin-business-line-chart .chart-dot {
  fill: #fff9dc;
  stroke: var(--gold);
  stroke-width: 2;
}

.admin-business-line-chart text {
  fill: var(--muted);
  font-size: 10px;
}

.admin-pricing-overview {
  display: grid;
  gap: 14px;
}

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

.admin-billing-contract-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-billing-contract-strip > div {
  min-width: 0;
  border: 1px solid rgba(37, 62, 51, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
  padding: 10px 12px;
}

.admin-billing-contract-strip span,
.admin-billing-contract-strip strong {
  display: block;
  min-width: 0;
}

.admin-billing-contract-strip span {
  color: var(--muted);
  font-size: 0.72rem;
}

.admin-billing-contract-strip strong {
  margin-top: 4px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 860;
  overflow-wrap: anywhere;
}

.admin-pricing-block {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid rgba(37, 62, 51, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.44);
  padding: 12px;
}

.admin-pricing-block.wide {
  grid-column: 1 / -1;
  overflow-x: auto;
}

.admin-pricing-block h4 {
  margin: 0;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 930;
}

.admin-pricing-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  color: var(--text);
  font-size: 0.78rem;
}

.admin-pricing-table th,
.admin-pricing-table td {
  border-bottom: 1px solid rgba(37, 62, 51, 0.08);
  padding: 8px 6px;
  text-align: left;
  vertical-align: top;
}

.admin-pricing-table th {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 840;
}

.admin-pricing-list {
  display: grid;
  gap: 8px;
}

.admin-pricing-list > div {
  display: grid;
  gap: 3px;
  border-top: 1px solid rgba(37, 62, 51, 0.08);
  padding-top: 8px;
}

.admin-pricing-list > div:first-child {
  border-top: 0;
  padding-top: 0;
}

.admin-pricing-list strong,
.admin-pricing-list span,
.admin-pricing-list small {
  overflow-wrap: anywhere;
}

.admin-pricing-list strong {
  color: var(--text);
  font-size: 0.86rem;
}

.admin-pricing-list span {
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 820;
}

.admin-pricing-list small {
  color: var(--muted);
  font-size: 0.72rem;
}

.admin-data-table {
  width: 100%;
  min-width: 720px;
  color: var(--text);
  font-size: 0.82rem;
}

.admin-data-table th,
.admin-data-table td {
  border-bottom: 1px solid rgba(37, 62, 51, 0.08);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.admin-data-table th {
  color: var(--muted);
  font-weight: 900;
}

.admin-data-table tbody tr:hover {
  background: rgba(255, 251, 226, 0.42);
}

.admin-empty-inline {
  border: 1px dashed rgba(37, 62, 51, 0.16);
  border-radius: 16px;
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.knowledge-diagnostics-panel {
  display: grid;
  gap: 14px;
}

.knowledge-safety-strip {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-color: rgba(83, 125, 102, 0.24);
  background: rgba(236, 246, 239, 0.58);
}

.knowledge-safety-strip > div {
  display: grid;
  gap: 4px;
  min-width: 180px;
}

.knowledge-safety-strip strong {
  color: var(--text);
  font-size: 0.94rem;
}

.knowledge-safety-strip p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.65;
}

.knowledge-import-contract {
  display: grid;
  gap: 12px;
}

.knowledge-import-upload {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.knowledge-import-upload .input {
  max-width: 300px;
}

.knowledge-diagnostics-header,
.knowledge-diagnostics-actions,
.knowledge-diagnostic-search {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.knowledge-diagnostics-actions,
.knowledge-diagnostic-search {
  flex-wrap: wrap;
}

.knowledge-diagnostic-search {
  align-items: end;
}

.knowledge-diagnostic-search .input:first-child {
  flex: 1 1 280px;
}

.knowledge-diagnostics-limit {
  width: 96px;
}

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

.knowledge-metric-grid,
.knowledge-search-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.knowledge-search-summary {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  margin: 0 0 10px;
}

.knowledge-metric {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(37, 62, 51, 0.08);
  background: rgba(255, 255, 255, 0.46);
}

.knowledge-metric em {
  color: var(--muted);
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 850;
}

.knowledge-metric strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 950;
}

.knowledge-search-diagnostic-result {
  display: grid;
  gap: 10px;
}

.knowledge-result-summary {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.5;
}

.knowledge-summary-text {
  max-width: 560px;
}

.knowledge-review-blocked {
  display: grid;
  gap: 10px;
}

.knowledge-review-blocked p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.65;
}

.knowledge-queue-lists {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.knowledge-mini-list {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(37, 62, 51, 0.1);
  background: rgba(255, 255, 255, 0.38);
}

.knowledge-mini-list > strong {
  color: var(--text);
  font-size: 0.84rem;
}

.knowledge-mini-row {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 7px 0;
  border-top: 1px solid rgba(37, 62, 51, 0.08);
}

.knowledge-mini-row span,
.knowledge-mini-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-mini-row small {
  color: var(--muted);
  font-size: 0.74rem;
}

.admin-anomaly-panel {
  display: grid;
  gap: 10px;
}

.admin-anomaly-panel article {
  border: 1px solid rgba(202, 87, 87, 0.18);
  border-radius: 18px;
  background: rgba(255, 239, 232, 0.58);
  padding: 12px;
}

.admin-anomaly-panel article strong {
  color: #8e3a2d;
  font-size: 0.82rem;
}

.admin-anomaly-panel article p {
  margin: 5px 0;
  color: var(--text);
}

.admin-business-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-model-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.admin-model-hero p {
  margin: 6px 0 0;
  color: var(--muted);
}

.admin-model-edit-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-model-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.admin-model-routing-dashboard {
  display: grid;
  gap: 10px;
}

.admin-routing-layer-list,
.admin-routing-report-strip,
.admin-routing-followups {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-routing-report-strip,
.admin-routing-followups {
  align-items: stretch;
}

.admin-routing-report-strip .admin-soft-card,
.admin-routing-followups .admin-soft-card {
  min-width: 180px;
  flex: 1 1 220px;
}

.admin-routing-followup-cell {
  max-width: 300px;
  white-space: normal;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.admin-routing-followups code {
  display: block;
  max-width: 100%;
  margin-top: 6px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.admin-model-runtime-card {
  display: grid;
  gap: 8px;
}

.admin-model-runtime-card > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.admin-model-runtime-card strong {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 950;
}

.admin-model-runtime-card p {
  min-height: 36px;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.admin-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.admin-model-structured-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.admin-embedding-panel {
  display: grid;
  gap: 12px;
}

.admin-embedding-default-notice {
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(80, 166, 132, 0.2);
  background: rgba(224, 247, 234, 0.62);
  color: #1d6f4b;
  font-size: 0.82rem;
  font-weight: 850;
}

.admin-embedding-default-notice.warning {
  border-color: rgba(202, 87, 87, 0.2);
  background: rgba(255, 239, 232, 0.62);
  color: #8e3a2d;
}

.admin-model-field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.admin-model-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(37, 62, 51, 0.08);
  background: rgba(255, 255, 255, 0.48);
}

.admin-model-field span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}

.admin-model-field strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 0.86rem;
}

.admin-model-input {
  min-width: 140px;
  height: 36px;
  padding: 7px 9px;
  font-size: 0.8rem;
}

.admin-model-notes-input {
  min-width: 220px;
  font-size: 0.78rem;
}

.admin-model-toggle-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-model-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: -moz-fit-content;
  width: fit-content;
  min-height: 32px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(37, 62, 51, 0.1);
  background: rgba(255, 255, 255, 0.58);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 850;
}

.admin-model-toggle.compact {
  min-height: 28px;
  padding: 3px 8px;
  font-size: 0.72rem;
}

.admin-model-toggle input {
  width: 14px;
  height: 14px;
  accent-color: var(--gold);
}

.admin-model-toggle input:disabled {
  cursor: not-allowed;
}

.admin-model-capability-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.admin-model-warning-pill {
  display: inline-flex;
  align-items: center;
  width: -moz-fit-content;
  width: fit-content;
  min-height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(202, 87, 87, 0.2);
  background: rgba(255, 239, 232, 0.7);
  color: #8e3a2d;
  padding: 0 9px;
  font-size: 0.72rem;
  font-weight: 950;
}

.admin-model-cost-edit {
  display: grid;
  grid-template-columns: minmax(86px, 1fr) minmax(86px, 1fr);
  gap: 6px;
}

.admin-status-pill {
  display: inline-flex;
  align-items: center;
  width: -moz-fit-content;
  width: fit-content;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 0.72rem;
  font-weight: 900;
}

.admin-status-pill.active {
  border: 1px solid rgba(80, 166, 132, 0.24);
  background: rgba(224, 247, 234, 0.72);
  color: #1d6f4b;
}

.admin-status-pill.inactive {
  border: 1px solid rgba(202, 87, 87, 0.18);
  background: rgba(255, 239, 232, 0.62);
  color: #8e3a2d;
}

.security-posture-grid,
.security-geo-source-list {
  display: grid;
  gap: 10px;
}

.security-section-buttons {
  display: flex;
  flex: 1 1 480px;
  flex-wrap: wrap;
  gap: 8px;
}

.security-refresh-state {
  display: inline-flex;
  flex: 1 1 320px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.security-refresh-state span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(37, 62, 51, 0.10);
  border-radius: 999px;
  background: rgba(248, 250, 242, 0.66);
  padding: 0 10px;
}

.security-refresh-state[data-fetching="true"] span:first-child {
  color: #6d551d;
  border-color: rgba(201, 157, 74, 0.30);
  background: rgba(242, 222, 165, 0.32);
}

.security-scanner-notice {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  border: 1px solid rgba(37, 62, 51, 0.10);
  border-radius: 14px;
  background: rgba(248, 250, 242, 0.72);
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.78rem;
}

.security-scanner-notice strong {
  color: var(--text);
  font-size: 0.86rem;
}

.security-scanner-notice b {
  color: #8e3a2d;
  font-weight: 900;
}

.security-scanner-notice.warning {
  border-color: rgba(202, 87, 87, 0.24);
  background: rgba(255, 239, 232, 0.68);
}

.security-posture-row,
.security-geo-source-row {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(37, 62, 51, 0.1);
  border-radius: 18px;
  background:
    radial-gradient(circle at 0% 0%, rgba(240, 216, 145, 0.2), transparent 38%),
    rgba(248, 250, 242, 0.78);
  padding: 12px;
}

.security-posture-row div,
.security-geo-source-row div {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.security-posture-row strong,
.security-geo-source-row strong {
  color: var(--text);
  font-size: 0.92rem;
}

.security-posture-row span,
.security-geo-source-row span {
  color: var(--muted);
  font-size: 0.78rem;
}

.security-posture-row > i,
.security-geo-source-row > i {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(201, 157, 74, 0.8), rgba(87, 169, 132, 0.7));
}

.security-geo-source-row > b {
  position: relative;
  z-index: 1;
  display: inline-flex;
  margin-top: 8px;
  color: #7a5c1f;
  font-size: 1.1rem;
  font-weight: 900;
}

.security-rules-head,
.security-blocks-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.security-rules-head p,
.security-blocks-head p {
  margin: 4px 0 0;
}

.security-rule-filter-panel {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.security-block-filter-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 0.6fr) auto;
  gap: 12px;
  align-items: end;
}

.security-rule-filter-panel label,
.security-block-filter-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 820;
}

.security-rule-filter-summary {
  color: var(--muted);
  font-size: 0.78rem;
  padding-bottom: 9px;
}

.security-rule-card {
  display: grid;
  gap: 10px;
}

.security-rule-toggle {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.security-rule-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.security-rule-reasons button {
  cursor: pointer;
}

.admin-unlimited-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(240, 216, 145, 0.38), rgba(202, 232, 213, 0.42));
  color: #755719;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(201, 157, 74, 0.2);
}

.admin-user-entitlement {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(37, 62, 51, 0.12);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(236, 246, 237, 0.72));
}

.admin-user-entitlement span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-entitlement strong {
  flex: 0 0 auto;
  color: #755719;
  font-weight: 950;
}

.admin-user-transactions {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(37, 62, 51, 0.1);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.42);
}

.admin-user-transactions-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-user-transactions-head strong,
.admin-user-transactions-head span {
  display: block;
}

.admin-user-transactions-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.admin-transaction-list {
  max-height: 240px;
  display: grid;
  gap: 8px;
  overflow: auto;
  padding-right: 2px;
}

.admin-transaction-row {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(37, 62, 51, 0.1);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.58);
}

.admin-transaction-row > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-transaction-row strong {
  min-width: 0;
  color: var(--text);
}

.admin-transaction-row span {
  flex: 0 0 auto;
  font-weight: 900;
}

.admin-transaction-row span.positive {
  color: var(--ok);
}

.admin-transaction-row span.negative {
  color: var(--danger);
}

.admin-transaction-row p,
.admin-transaction-row small {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.admin-transaction-row p {
  font-size: 0.8rem;
  line-height: 1.45;
}

.admin-transaction-row small {
  font-size: 0.73rem;
}

.admin-log-refresh-state {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  color: var(--muted);
  font-size: 0.78rem;
}

.admin-log-refresh-state span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(37, 62, 51, 0.10);
  border-radius: 999px;
  background: rgba(248, 250, 242, 0.66);
  padding: 0 10px;
}

.admin-log-refresh-state[data-fetching="true"] span:first-child {
  color: #6d551d;
  border-color: rgba(201, 157, 74, 0.30);
  background: rgba(242, 222, 165, 0.32);
}

/* 日志级别标签：用颜色区分 error/warning/info/debug，方便管理员快速定位异常。 */
.admin-log-level {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  background: rgba(37, 62, 51, 0.08);
  color: var(--muted);
}

.admin-log-level-error {
  background: rgba(220, 60, 60, 0.12);
  color: #a02a2a;
}

.admin-log-level-warning {
  background: rgba(201, 157, 74, 0.18);
  color: #755719;
}

.admin-log-level-info {
  background: rgba(74, 145, 201, 0.12);
  color: #1e557a;
}

.admin-log-level-debug {
  background: rgba(120, 120, 120, 0.10);
  color: #5a5a5a;
}

.admin-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.admin-settings-card {
  display: grid;
  align-content: start;
  gap: 12px;
}

.admin-settings-card-wide {
  grid-column: 1 / -1;
}

.admin-settings-card h3 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.035em;
}

.admin-settings-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.admin-settings-label {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.admin-settings-route-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.admin-settings-route-card,
.admin-toggle-row {
  border: 1px solid rgba(37, 62, 51, 0.12);
  border-radius: 20px;
  background: rgba(20, 45, 34, 0.05);
}

.admin-settings-route-card {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 178px;
  padding: 14px;
  color: var(--text);
  font-weight: 780;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.admin-settings-route-card:hover,
.admin-settings-route-card:focus-visible {
  border-color: rgba(201, 157, 74, 0.48);
  box-shadow: 0 16px 36px rgba(19, 34, 25, 0.12);
  transform: translateY(-1px);
}

.admin-settings-route-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 820;
}

.admin-settings-route-meta > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-settings-status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 8px;
  border: 1px solid rgba(37, 62, 51, 0.12);
  background: rgba(255, 255, 255, 0.56);
  color: #455347;
}

.admin-settings-status.ready {
  border-color: rgba(73, 139, 98, 0.28);
  background: rgba(73, 139, 98, 0.12);
  color: #2b6a43;
}

.admin-settings-status.watch {
  border-color: rgba(201, 157, 74, 0.32);
  background: rgba(201, 157, 74, 0.14);
  color: #76571b;
}

.admin-settings-route-card strong {
  color: #6d551d;
  font-size: 0.98rem;
}

.admin-settings-route-description {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.admin-settings-route-state {
  color: #1f3328;
  font-size: 0.82rem;
  font-weight: 860;
  line-height: 1.45;
}

.admin-settings-route-card small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 680;
  line-height: 1.5;
}

.admin-settings-boundary-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-settings-boundary-list li {
  border: 1px solid rgba(37, 62, 51, 0.1);
  border-radius: 16px;
  padding: 10px 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.44);
  line-height: 1.55;
}

.admin-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: -moz-fit-content;
  width: fit-content;
  padding: 0 14px;
  color: var(--text);
  font-weight: 800;
}

.admin-refunds-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(0, 1.6fr);
  gap: 16px;
  min-height: 0;
}

.admin-refunds-list,
.admin-refund-detail {
  min-width: 0;
  max-height: min(68vh, 760px);
  overflow: auto;
}

.admin-refund-row {
  width: 100%;
  display: grid;
  gap: 4px;
  border: 1px solid rgba(37, 62, 51, 0.1);
  border-radius: 16px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.52);
  color: var(--text);
  text-align: left;
}

.admin-refund-row.active {
  border-color: rgba(201, 157, 74, 0.44);
  background: rgba(255, 247, 224, 0.74);
  box-shadow: inset 0 0 0 1px rgba(201, 157, 74, 0.16);
}

.admin-refund-row strong,
.admin-refund-row span,
.admin-refund-row small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.admin-refund-row span,
.admin-refund-row small {
  color: var(--muted);
}

.admin-refund-meta {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.admin-refund-meta div {
  border: 1px solid rgba(37, 62, 51, 0.1);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.48);
}

.admin-refund-meta dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.admin-refund-meta dd {
  margin: 3px 0 0;
  color: var(--text);
  font-weight: 820;
  overflow-wrap: anywhere;
}

.admin-refund-description {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.admin-refund-description h3 {
  margin: 0;
  font-size: 0.9rem;
}

.admin-refund-description p,
.admin-refund-description pre {
  margin: 0;
  border: 1px solid rgba(37, 62, 51, 0.1);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .admin-page-header {
    display: grid;
  }

  .admin-business-filter-row,
  .admin-billing-contract-strip,
  .admin-pricing-grid,
  .security-rule-filter-panel,
  .security-block-filter-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-pricing-table {
    min-width: 560px;
  }

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

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

/* Sidebar */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--sidebar-width);
  background:
    linear-gradient(180deg, rgba(16, 33, 25, 0.95), rgba(9, 20, 16, 0.94)),
    radial-gradient(circle at 50% 0%, rgba(207, 230, 220, 0.16), transparent 35%);
  border-right: 1px solid rgba(224, 238, 226, 0.12);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform var(--transition-base);
  padding: env(safe-area-inset-top) 12px env(safe-area-inset-bottom) 12px;
  color: var(--text-inverse);
  box-shadow: 18px 0 60px rgba(0, 0, 0, 0.22);
}

.sidebar.open {
  transform: translateX(0);
}

@media (min-width: 1024px) {
  .sidebar {
    position: relative;
    transform: none;
  }
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
  padding-inline: 10px;
}

.sidebar.collapsed .sidebar-nav-group + .sidebar-nav-group {
  margin-top: 10px;
  padding-top: 10px;
}

.sidebar.collapsed .sidebar-link {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 52px;
  min-height: 56px;
  margin-inline: auto;
  padding: 6px 0;
  gap: 0;
  overflow: hidden;
}

.sidebar.collapsed .sidebar-link-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  overflow: hidden;
  white-space: nowrap;
  line-height: 1;
  font-weight: 850;
}

/* 收起态短标签：让图标含义明确，同时保持紧凑。 */
.sidebar-link-short-label {
  display: none;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
  color: var(--muted-inverse);
  white-space: nowrap;
}

.sidebar.collapsed .sidebar-link-admin::before {
  display: none;
}

.sidebar.collapsed .sidebar-brand {
  justify-content: center;
  padding-inline: 0;
}

.sidebar.collapsed .sidebar-brand img {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.sidebar.collapsed .sidebar-nav {
  overflow-x: hidden;
  padding-inline: 0;
  scrollbar-gutter: auto;
}

.sidebar.collapsed .sidebar-link:hover {
  transform: none;
}

.sidebar.collapsed .sidebar-footer {
  padding-top: 12px;
}

.sidebar-footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar.collapsed .sidebar-footer-actions {
  flex-direction: column;
  gap: 8px;
}

.sidebar.collapsed .sidebar-footer .btn-secondary {
  flex: 0 0 42px;
  width: 42px;
  min-height: 42px;
  padding: 0;
  overflow: hidden;
}

.sidebar.collapsed .sidebar-footer .btn-secondary:not(:first-child) {
  font-size: 0;
}

.sidebar.collapsed .sidebar-footer .btn-secondary:not(:first-child)::after {
  content: "退";
  color: var(--text-inverse);
  font-size: 0.88rem;
  font-weight: 850;
  line-height: 1;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(0, 0, 0, 0.5);
}

@media (min-width: 1024px) {
  .sidebar-backdrop {
    display: none;
  }
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 8px 22px;
  border-bottom: 1px solid rgba(224, 238, 226, 0.12);
}

.sidebar-brand img {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 18px 0;
  scrollbar-gutter: stable;
}

.sidebar-nav ul {
  list-style: none;
  list-style-type: none;
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.sidebar-nav li {
  position: relative;
  list-style: none;
  list-style-type: none;
  margin: 0;
  padding: 0;
}

.sidebar-nav li::marker {
  content: "";
  font-size: 0;
}

.sidebar-nav li::before {
  content: none !important;
  display: none !important;
}

.sidebar-nav-group + .sidebar-nav-group {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(224, 238, 226, 0.10);
}

.sidebar-nav-title {
  margin: 0 8px 8px;
  color: rgba(224, 238, 226, 0.48);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.14em;
}

.sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 18px;
  color: var(--muted-inverse);
  font-weight: 650;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: color var(--transition-fast), transform var(--transition-fast), background var(--transition-fast);
}

.sidebar-link-icon,
.sidebar-footer-icon {
  position: relative;
  z-index: 1;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
}

.sidebar-link-icon svg,
.sidebar-footer-icon svg {
  width: 21px;
  height: 21px;
}

.sidebar-link-label,
.sidebar-footer-label {
  position: relative;
  z-index: 1;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.055);
  color: var(--text-inverse);
  transform: translateX(2px);
}

.sidebar-link-admin {
  min-height: 42px;
  padding-top: 10px;
  padding-bottom: 10px;
  border-radius: 15px;
  font-size: 0.92rem;
}

.sidebar-link-admin::before {
  content: none;
  display: none;
}

.sidebar-link.active {
  color: #fff8df;
}

.sidebar-bubble {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(201, 157, 74, 0.24), rgba(207, 230, 220, 0.12)),
    rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(232, 210, 153, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 12px 28px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}

.sidebar-footer {
  padding: 16px 0 0;
  border-top: 1px solid rgba(224, 238, 226, 0.12);
}

.sidebar-footer-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid rgba(224, 238, 226, 0.16);
  border-radius: 999px;
  background:
    radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.08), transparent 38%),
    rgba(255, 255, 255, 0.045);
  color: var(--text-inverse);
  font-weight: 850;
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}

.sidebar-footer-button:hover {
  transform: translateY(-1px);
  border-color: rgba(232, 210, 153, 0.32);
  background: rgba(232, 210, 153, 0.12);
}

.sidebar-collapse-button {
  flex: 0 0 94px;
}

.sidebar-collapse-button span {
  font-size: 1.05rem;
  line-height: 1;
}

.sidebar-logout-button {
  flex: 1;
  min-width: 0;
}

.sidebar.collapsed .sidebar-collapse-button {
  width: 44px;
  min-height: 44px;
  flex-basis: 44px;
}

.sidebar.collapsed .sidebar-footer-button {
  width: 44px;
  min-height: 44px;
  flex: 0 0 44px;
  padding: 0;
  border-radius: 18px;
}

.sidebar.collapsed .sidebar-footer-icon {
  width: 22px;
  height: 22px;
}

.sidebar.collapsed .sidebar-logout-button {
  color: #fff4d4;
  background: rgba(232, 210, 153, 0.1);
}

/* Account settings */
.account-page {
  width: min(980px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.account-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(232, 210, 153, 0.18);
  border-radius: 28px;
  padding: clamp(20px, 3vw, 32px);
  background:
    radial-gradient(circle at 84% 18%, rgba(201, 157, 74, 0.24), transparent 28%),
    linear-gradient(135deg, rgba(18, 35, 27, 0.96), rgba(32, 29, 18, 0.92));
  color: var(--text-inverse);
  box-shadow: 0 20px 58px rgba(0, 0, 0, 0.18);
}

.account-kicker {
  display: inline-flex;
  margin-bottom: 12px;
  color: #f2d98f;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.account-hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

.account-hero p {
  max-width: 420px;
  margin: 0;
  color: rgba(240, 248, 239, 0.70);
  line-height: 1.65;
}

.account-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(360px, 1.15fr);
  gap: 14px;
}

.account-card {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding: clamp(18px, 2.4vw, 26px);
}

.account-card h2 {
  margin: 4px 0 0;
  font-size: clamp(1.35rem, 2vw, 2rem);
  letter-spacing: -0.035em;
}

.account-username,
.account-help {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.account-badges,
.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.account-badges span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(201, 157, 74, 0.22);
  background: rgba(201, 157, 74, 0.10);
  color: var(--gold);
  font-size: 0.88rem;
  font-weight: 800;
}

.account-profile-card {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
}

.account-profile-main,
.account-badges,
.account-actions {
  grid-column: 2;
}

.account-avatar {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 20px;
  color: #102019;
  background:
    radial-gradient(circle at 32% 22%, #fff8d3, transparent 38%),
    linear-gradient(135deg, #e6d081, #c7e6d9);
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 900;
  box-shadow: 0 16px 34px rgba(20, 45, 34, 0.15);
}

.account-card-label {
  display: inline-flex;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.account-field {
  display: grid;
  gap: 8px;
  font-size: 0.92rem;
  color: var(--muted);
}

@media (max-width: 900px) {
  .account-hero {
    display: grid;
  }

  .account-grid {
    grid-template-columns: 1fr;
  }

  .knowledge-diagnostics-header,
  .knowledge-safety-strip,
  .knowledge-diagnostic-search {
    display: grid;
  }

  .knowledge-diagnostics-grid,
  .knowledge-queue-lists {
    grid-template-columns: 1fr;
  }
}

/* Top bar */
.top-bar {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

/* Loading bar */
.top-loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  z-index: 100;
  animation: loading-bar 1.2s infinite linear;
}

@keyframes loading-bar {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.route-module-fallback {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 120px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(232, 184, 109, 0.12), rgba(255, 255, 255, 0.04));
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 750;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: opacity var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
  box-shadow: none;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #f2e3ad, var(--gold));
  color: #152116;
  box-shadow: 0 12px 28px rgba(201, 157, 74, 0.25);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-color: var(--line);
}

.sidebar .btn-secondary {
  color: var(--text-inverse);
  border-color: rgba(255, 255, 255, 0.12);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-ghost {
  background: transparent;
  color: inherit;
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--panel-hover);
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
}

.btn-pending {
  position: relative;
}

.btn-pending::after {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* Cards / panels */
.panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 249, 242, 0.92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  color: var(--text);
  backdrop-filter: blur(20px);
}

.panel-title {
  font-weight: 800;
  margin-bottom: 12px;
}

/* Inputs */
.input,
.textarea,
.select {
  width: 100%;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(37, 62, 51, 0.16);
  border-radius: 18px;
  padding: 12px 14px;
  outline: none;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: rgba(201, 157, 74, 0.72);
  box-shadow: 0 0 0 4px rgba(201, 157, 74, 0.13);
}

.textarea {
  resize: vertical;
  min-height: 80px;
}

/* Empty / error states */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 16px;
  color: var(--muted);
  text-align: center;
}

.error-card {
  background: var(--danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius);
  padding: 16px;
  color: var(--danger);
}

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--line) 25%, var(--panel-hover) 50%, var(--line) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius-sm);
  animation: skeleton 1.2s infinite linear;
}

@keyframes skeleton {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@keyframes react-v2-page-enter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.992);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes chat-bubble-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes brief-card-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes thinking-dot {
  0%,
  80%,
  100% {
    opacity: 0.36;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@media (max-width: 700px) {
  .chat-thinking-bubble {
    max-width: 94%;
    padding: 12px 13px;
  }

  .brief-action-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    margin-inline: 0;
    padding: 15px;
    border-radius: 23px;
  }

  .brief-action-card .btn,
  .brief-question-custom .btn {
    width: 100%;
  }

  .brief-question-item {
    padding: 12px;
    border-radius: 19px;
  }

  .brief-question-options {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .brief-question-options button {
    justify-content: center;
    min-height: 42px;
    white-space: normal;
  }

  .brief-question-custom {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-list-row:hover {
    transform: none;
  }

  .artifact-card:hover {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .workspace-page,
  .history-page,
  .pro-mode-page,
  .admin-page,
  .chat-bubble,
  .chat-thinking-bubble,
  .brief-action-card,
  .top-loading-bar,
  .skeleton,
  .btn-pending::after,
  .chat-thinking-dots::before,
  .chat-thinking-dots::after,
  .chat-thinking-dots span,
  .chat-thinking-dots i {
    animation: none !important;
  }

  .project-list-row,
  .project-list-row::before,
  .artifact-card,
  .artifact-card::after,
  .chat-composer-row,
  .pro-tool-btn,
  .brief-question-options button {
    transition: none !important;
  }

  .project-list-row:hover,
  .chat-composer-row:focus-within,
  .artifact-card:hover,
  .pro-tool-btn:hover:not(:disabled),
  .brief-question-options button:hover:not(:disabled) {
    transform: none;
  }
}

/* Utility */
.hidden {
  display: none !important;
}

.text-muted {
  color: var(--muted);
}

.text-sm {
  font-size: 0.875rem;
}

.gap-2 {
  gap: 8px;
}

.flex {
  display: flex;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hover\:border-\[var\(--gold\)\]:hover {
  border-color: var(--gold);
}

.hover\:bg-\[var\(--panel-hover\)\]:hover {
  background-color: var(--panel-hover);
}

.hover\:text-\[var\(--text\)\]:hover {
  color: var(--text);
}

.hover\:text-red-500:hover {
  --tw-text-opacity: 1;
  color: rgb(239 68 68 / var(--tw-text-opacity, 1));
}

.hover\:underline:hover {
  text-decoration-line: underline;
}

.disabled\:opacity-50:disabled {
  opacity: 0.5;
}

.group:hover .group-hover\:opacity-100 {
  opacity: 1;
}

.data-\[state\=active\]\:border-\[var\(--gold\)\][data-state="active"] {
  border-color: var(--gold);
}

.data-\[state\=active\]\:text-\[var\(--gold\)\][data-state="active"] {
  color: var(--gold);
}

@media (min-width: 768px) {
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .md\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .md\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .lg\:grid-cols-\[360px_1fr\] {
    grid-template-columns: 360px 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.page-transition-enter {
  opacity: 0;
  transform: translateY(8px);
}

.page-transition-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 220ms ease, transform 220ms ease;
}

.page-transition-exit {
  opacity: 1;
}

.page-transition-exit-active {
  opacity: 0;
  transition: opacity 180ms ease;
}

/* View transitions progressive enhancement */
@supports (view-transition-name: none) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 220ms;
  }
}
