:root {
  --bg: #0b0d12;
  --bg-elevated: #11151d;
  --bg-panel: #161b24;
  --bg-soft: #1d2430;
  --ink: #eef2f7;
  --muted: #97a3b6;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --accent: #f06a3a;
  --accent-strong: #ff8b57;
  --accent-soft: rgba(240, 106, 58, 0.16);
  --success: #3fb789;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --globe-dot-color: rgba(120, 170, 255, 0.75);
  --globe-dot-active-color: rgba(180, 220, 255, 1);
  --globe-ocean-color: rgba(50, 90, 140, 0.12);
  --globe-satellite-bg: rgba(255, 255, 255, 0.08);
  --globe-satellite-text: rgba(255, 255, 255, 0.88);
  --message-globe-fit-height: clamp(330px, 48vh, 680px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(240, 106, 58, 0.14), transparent 26%),
    radial-gradient(circle at top right, rgba(67, 124, 255, 0.1), transparent 24%),
    linear-gradient(180deg, #080a0f 0%, #0d1016 100%);
  color: var(--ink);
  font-family: "Inter", "Segoe UI", sans-serif;
}

body {
  overflow: auto;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent);
}

.app-shell {
  position: relative;
  z-index: 1;
  height: 100vh;
  padding: 18px;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 14px;
  overflow: hidden;
  transition: grid-template-columns 180ms ease;
}

body.workspace-mode .app-shell {
  transition: none;
}

body.workspace-mode:not(.workspace-transitioning) .content-shell,
body.workspace-mode:not(.workspace-transitioning) .viewer-panel {
  transition: none;
}

.sidebar,
.panel,
.topbar-chat {
  border: 1px solid var(--line);
  background: rgba(17, 21, 29, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 10px 12px 12px;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  min-height: 0;
  overflow: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(168, 168, 168, 0.78) rgba(9, 11, 16, 0.98);
  transition: padding 180ms ease, gap 180ms ease;
}

.sidebar::-webkit-scrollbar {
  width: 10px;
}

.sidebar::-webkit-scrollbar-track {
  background: rgba(9, 11, 16, 0.98);
  border-radius: 999px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(168, 168, 168, 0.78);
  border: 2px solid rgba(9, 11, 16, 0.98);
  border-radius: 999px;
}

.sidebar-brand {
  padding-bottom: 0;
  border-bottom: 0;
}

.sidebar-brand > .eyebrow,
.sidebar-brand > h1:not(.foundfun-title),
.sidebar-copy {
  display: none;
}

.sidebar-dev-row {
  display: flex;
  justify-content: flex-start;
  margin: 0 0 4px;
}

.sidebar-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.foundfun-title {
  margin: 8px 0 10px;
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.catalog-dev-btn {
  border: 1px solid rgba(240, 106, 58, 0.38);
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(240, 106, 58, 0.14);
  color: #ffd1bf;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 140ms ease, transform 140ms ease, border-color 140ms ease;
}

.catalog-dev-btn:hover {
  transform: translateY(-1px);
  background: rgba(240, 106, 58, 0.22);
  border-color: rgba(240, 106, 58, 0.62);
}

.sidebar-collapse-btn {
  width: 26px;
  height: 26px;
  position: relative;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 0;
  line-height: 1;
  overflow: hidden;
  transition: background 140ms ease, transform 140ms ease, border-color 140ms ease;
}

.sidebar-collapse-btn::before {
  content: "";
  color: var(--ink);
  width: 18px;
  height: 16px;
  border: 1.5px solid currentColor;
  border-radius: 5px;
  opacity: 0.9;
  background:
    linear-gradient(
      90deg,
      transparent 0,
      transparent 6px,
      currentColor 6px,
      currentColor 7.5px,
      transparent 7.5px
    );
}

.sidebar-collapse-btn::after {
  content: "";
  position: absolute;
  color: var(--ink);
  width: 5px;
  height: 5px;
  border-left: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translate(4px, 0) rotate(45deg);
  opacity: 0.78;
}

body.sidebar-collapsed .sidebar-collapse-btn::after {
  transform: translate(-4px, 0) rotate(225deg);
}

.sidebar-collapse-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.06);
}

.legacy-sidebar-collapse-btn {
  display: none !important;
}

.sidebar-new-btn {
  width: 100%;
  justify-content: center;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 34px minmax(0, 1fr);
  padding-left: 8px;
}

body.sidebar-collapsed .sidebar {
  padding: 14px 2px;
  gap: 8px;
  overflow-x: hidden;
}

body.sidebar-collapsed .sidebar-brand {
  padding-bottom: 0;
  border-bottom: 0;
}

body.sidebar-collapsed .sidebar-brand-row {
  justify-content: center;
}

body.sidebar-collapsed .foundfun-title,
body.sidebar-collapsed .sidebar-dev-row,
body.sidebar-collapsed .catalog-dev-btn,
body.sidebar-collapsed .sidebar-new-btn,
body.sidebar-collapsed .sidebar-section,
body.sidebar-collapsed .sidebar-user-card,
body.sidebar-collapsed .debug-card {
  display: none !important;
}

body.sidebar-collapsed .sidebar-collapse-btn {
  width: 30px;
  height: 30px;
}

.sidebar-section {
  border-radius: 0;
  background: transparent;
  border: 0;
  border-top: 0;
  padding: 0;
}

.sidebar-section:has(#current-project-card) {
  display: none;
}

.sidebar-section:has(#project-list) > .section-head h3 {
  display: none;
}

.sidebar-section:has(#project-list) > .section-head {
  justify-content: flex-start;
  margin-bottom: 4px;
}

.sidebar-section:has(#project-list) {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-meta {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-user-card {
  position: relative;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}

.sidebar-user-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.14);
  pointer-events: none;
}

.sidebar-user-card:not(.is-auth-guest) {
  min-height: 48px;
  padding: 7px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.sidebar-user-card:not(.is-auth-guest)::after {
  top: -10px;
}

.sidebar-user-card:not(.is-auth-guest):hover,
.sidebar-user-card:not(.is-auth-guest):focus-visible {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  outline: none;
}

.sidebar-user-card.is-menu-open:not(.is-auth-guest) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 208, 138, 0.28);
}

.sidebar-user-card.is-menu-open:not(.is-auth-guest)::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 10px);
  height: 172px;
  z-index: 24;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(28, 34, 45, 0.96), rgba(14, 18, 28, 0.96)),
    rgba(12, 16, 24, 0.94);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
}

.sidebar-user-card.is-auth-guest .sidebar-user-action {
  margin-left: 0;
}

.sidebar-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.12);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.sidebar-user-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  pointer-events: none;
}

.sidebar-user-info strong {
  font-size: 12px;
  line-height: 1.15;
}

.sidebar-user-info span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-plan-teaser {
  width: fit-content;
  margin-top: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.1;
  cursor: not-allowed;
}

.sidebar-account-orders-btn {
  width: fit-content;
  margin-top: 6px;
  border: 1px solid rgba(88, 155, 255, 0.3);
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(88, 155, 255, 0.12);
  color: #d6e6ff;
  font-size: 10px;
  line-height: 1.1;
  cursor: pointer;
}

.sidebar-user-card:not(.is-auth-guest) .sidebar-account-orders-btn,
.sidebar-user-card:not(.is-auth-guest) .sidebar-plan-teaser,
.sidebar-user-card:not(.is-auth-guest) .sidebar-user-action {
  display: none;
}

.sidebar-user-card.is-menu-open:not(.is-auth-guest) .sidebar-account-orders-btn,
.sidebar-user-card.is-menu-open:not(.is-auth-guest) .sidebar-user-action {
  position: absolute;
  left: 10px;
  right: 10px;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: auto;
  height: 34px;
  margin: 0;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #eef2f7;
  font-size: 12px;
  line-height: 1;
  text-align: left;
  pointer-events: auto;
}

.sidebar-user-card.is-menu-open:not(.is-auth-guest) #account-profile-btn {
  bottom: calc(100% + 140px);
}

.sidebar-user-card.is-menu-open:not(.is-auth-guest) #account-orders-btn {
  bottom: calc(100% + 100px);
}

.sidebar-user-card.is-menu-open:not(.is-auth-guest) #account-addresses-btn {
  bottom: calc(100% + 60px);
}

.sidebar-user-card.is-menu-open:not(.is-auth-guest) .sidebar-user-action {
  bottom: calc(100% + 20px);
  color: #ffb4a8;
}

.sidebar-account-orders-btn:hover {
  background: rgba(88, 155, 255, 0.2);
  border-color: rgba(88, 155, 255, 0.46);
}

.sidebar-user-card.is-menu-open:not(.is-auth-guest) .sidebar-account-orders-btn:hover,
.sidebar-user-card.is-menu-open:not(.is-auth-guest) .sidebar-user-action:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: transparent;
}

.sidebar-plan-teaser:disabled {
  opacity: 0.82;
}

.sidebar-user-action {
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  cursor: pointer;
  font-size: 11px;
  white-space: nowrap;
}

.sidebar-user-action:hover {
  background: rgba(255, 255, 255, 0.14);
}

#auth-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(9, 14, 28, 0.62);
  backdrop-filter: blur(12px);
}

#auth-modal {
  position: fixed;
  inset: 0;
  z-index: 71;
  display: grid;
  place-items: center;
  padding: 24px;
}

#auth-modal[hidden],
#auth-modal-backdrop[hidden] {
  display: none;
}

#auth-modal [hidden] {
  display: none !important;
}

#catalog-dev-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 72;
  background: rgba(3, 5, 10, 0.72);
  backdrop-filter: blur(10px);
}

#catalog-dev-modal {
  position: fixed;
  inset: 0;
  z-index: 73;
  display: grid;
  place-items: center;
  padding: 24px;
}

#catalog-dev-modal[hidden],
#catalog-dev-modal-backdrop[hidden] {
  display: none;
}

#catalog-dev-modal-close {
  position: absolute;
  top: 24px;
  right: 24px;
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
}

.catalog-dev-modal-content {
  width: min(760px, 100%);
  border: 1px solid rgba(240, 106, 58, 0.2);
  border-radius: 28px;
  padding: 28px;
  background:
    radial-gradient(circle at top left, rgba(240, 106, 58, 0.2), transparent 38%),
    linear-gradient(145deg, rgba(18, 27, 45, 0.98), rgba(10, 14, 26, 0.98));
  color: #fff;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.42);
}

.catalog-dev-modal-content h2 {
  margin: 4px 0 10px;
}

.catalog-dev-copy {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.65;
}

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

.catalog-dev-section {
  min-height: 180px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.05);
}

.catalog-dev-section h3 {
  margin: 0 0 10px;
}

.catalog-dev-section p {
  min-height: 72px;
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.65;
}

#auth-modal-close {
  position: absolute;
  top: 24px;
  right: 24px;
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
}

.auth-modal-content {
  width: min(420px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 28px;
  padding: 28px;
  background:
    radial-gradient(circle at top left, rgba(255, 199, 102, 0.18), transparent 38%),
    linear-gradient(145deg, rgba(18, 27, 45, 0.96), rgba(10, 14, 26, 0.96));
  color: #fff;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.36);
}

.auth-modal-content h2 {
  margin: 4px 0 10px;
}

.auth-modal-content p {
  color: var(--muted);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 20px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.auth-field input,
.auth-field textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 12px 13px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  outline: none;
  font: inherit;
}

.auth-field textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.5;
}

.auth-field input:focus,
.auth-field textarea:focus {
  border-color: rgba(255, 199, 102, 0.62);
  box-shadow: 0 0 0 3px rgba(255, 199, 102, 0.12);
}

.account-profile-form.is-readonly input[disabled] {
  opacity: 0.86;
  cursor: default;
}

.account-profile-form.is-readonly input:not([name="username"]) {
  color: rgba(255, 255, 255, 0.78);
}

.auth-inline-link {
  align-self: flex-end;
  border: 0;
  padding: 0;
  background: transparent;
  color: #ffd18a;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.auth-inline-link:hover,
.auth-inline-link:focus-visible {
  text-decoration: underline;
}

.auth-consent-field {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.auth-consent-field input {
  margin-top: 3px;
  accent-color: #ffd18a;
}

.auth-error {
  min-height: 18px;
  margin: 0;
  color: #ffb4a8;
  font-size: 13px;
}

.auth-error.is-success {
  color: #9fe6c8;
}

.auth-mode-toggle {
  width: 100%;
  margin-top: 14px;
  border: 0;
  background: transparent;
  color: #ffd18a;
  cursor: pointer;
}

.project-current {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
}

.project-current strong {
  font-size: 14px;
}

.project-current p,
.sidebar-empty,
.project-item-meta {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-height: 40px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(168, 168, 168, 0.78) transparent;
}

.project-list::-webkit-scrollbar {
  width: 8px;
}

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

.project-list::-webkit-scrollbar-thumb {
  background: rgba(168, 168, 168, 0.68);
  border-radius: 999px;
}

.project-item {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  width: 100%;
  min-height: 34px;
  padding: 0;
  border-radius: 0;
  border: 0;
  border-bottom: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  transition: color 140ms ease, background 140ms ease;
}

.project-item:hover {
  transform: none;
  background: transparent;
  color: #ffd08a;
  border-color: rgba(255, 208, 138, 0.24);
}

.project-item.active {
  border-bottom-color: transparent;
  background: transparent;
  color: var(--ink);
}

.project-item.active:hover {
  background: transparent;
  color: #ffffff;
}

.project-item-main {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  min-height: 34px;
  padding: 7px 28px 7px 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #eef2f7;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.project-item.active .project-item-main {
  padding-left: 8px;
  background: rgba(168, 168, 168, 0.16);
}

.project-item:hover .project-item-main,
.project-item:focus-within .project-item-main {
  background: rgba(255, 255, 255, 0.045);
}

.project-item.active:hover .project-item-main,
.project-item.active:focus-within .project-item-main {
  background: rgba(168, 168, 168, 0.22);
}

.project-item.is-renaming .project-item-main,
.project-item-main[hidden] {
  display: none;
}

.project-item-title {
  display: block;
  margin-bottom: 0;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-item.is-loading .project-item-main {
  background: rgba(88, 155, 255, 0.08);
  color: #dceaff;
}

.project-item.is-loading .project-item-title::after {
  content: " · 加载中";
  color: rgba(160, 202, 255, 0.86);
  font-size: 11px;
  font-weight: 500;
}

.project-item.is-renaming .project-item-menu-trigger {
  display: none;
}

.project-item-rename-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  min-height: 34px;
  padding: 7px 28px 7px 0;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  color: #eef2f7;
  outline: none;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
}

.project-item.active .project-item-rename-input {
  padding-left: 8px;
  background: rgba(168, 168, 168, 0.2);
}

.project-item-rename-input:focus {
  box-shadow: inset 0 0 0 1px rgba(255, 208, 138, 0.34);
}

.project-item-menu-trigger {
  position: absolute;
  right: 2px;
  top: 50%;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(238, 242, 247, 0.78);
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease, background 120ms ease, color 120ms ease;
}

.project-item:hover .project-item-menu-trigger,
.project-item:focus-within .project-item-menu-trigger {
  opacity: 1;
  pointer-events: auto;
}

.project-item-menu-trigger:hover,
.project-item-menu-trigger:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.project-item-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 1000;
  min-width: 112px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(18, 20, 26, 0.96);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.34);
}

.project-item-menu[hidden] {
  display: none;
}

.project-item-menu button {
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.project-item-menu button:hover,
.project-item-menu button:focus-visible {
  background: rgba(255, 255, 255, 0.1);
}

.project-item-menu button.danger {
  color: #ffb4aa;
}

.project-item-menu button.danger:hover,
.project-item-menu button.danger:focus-visible {
  background: rgba(255, 96, 96, 0.16);
  color: #ffd2cc;
}

.foundfun-confirm-root {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: grid;
  place-items: center;
  padding: 20px;
}

.foundfun-confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 16, 0.66);
  backdrop-filter: blur(10px);
}

.foundfun-confirm-dialog {
  position: relative;
  width: min(360px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 24px;
  padding: 22px;
  background:
    radial-gradient(circle at top left, rgba(255, 190, 112, 0.14), transparent 42%),
    linear-gradient(145deg, rgba(18, 24, 38, 0.98), rgba(10, 13, 23, 0.98));
  color: #f7f8fb;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.42);
  animation: message-in 150ms ease;
}

.foundfun-confirm-dialog h2 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.35;
}

.foundfun-confirm-dialog p {
  margin: 0;
  color: rgba(238, 242, 247, 0.72);
  font-size: 13px;
  line-height: 1.65;
}

.foundfun-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.foundfun-confirm-button {
  min-width: 74px;
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  transition: transform 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.foundfun-confirm-button:hover,
.foundfun-confirm-button:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.foundfun-confirm-button.is-secondary {
  background: rgba(255, 255, 255, 0.1);
}

.foundfun-confirm-button.is-secondary:hover,
.foundfun-confirm-button.is-secondary:focus-visible {
  background: rgba(255, 255, 255, 0.16);
}

.foundfun-confirm-button.is-primary {
  background: linear-gradient(135deg, rgba(240, 106, 58, 0.95), rgba(255, 169, 96, 0.95));
  box-shadow: 0 10px 26px rgba(240, 106, 58, 0.25);
}

.foundfun-confirm-button.is-danger {
  background: linear-gradient(135deg, rgba(230, 86, 78, 0.96), rgba(255, 133, 107, 0.96));
  box-shadow: 0 10px 26px rgba(230, 86, 78, 0.26);
}

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

.mobile-workspace-bar,
.mobile-sidebar-backdrop {
  display: none;
}

.mobile-workspace-bar {
  min-width: 0;
}

.mobile-sidebar-menu-btn {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.mobile-sidebar-menu-btn::before {
  content: "";
  width: 18px;
  height: 14px;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  background: linear-gradient(currentColor, currentColor) center / 18px 2px no-repeat;
  opacity: 0.9;
}

.mobile-workspace-title {
  min-width: 0;
  display: grid;
  gap: 1px;
  text-align: center;
}

.mobile-workspace-title strong {
  font-size: 15px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.mobile-workspace-title span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-workspace-actions {
  width: 38px;
  height: 38px;
}

.topbar-chat {
  display: none !important;
  border-radius: 24px;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.workspace-title {
  margin: 6px 0 0;
  font-size: 24px;
}

.eyebrow {
  margin: 0;
  color: var(--accent-strong);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--ink);
  font-size: 13px;
}

.status-pill.muted {
  color: var(--muted);
}

.status-mode-pill {
  padding-right: 10px;
}

.status-mode-pill select {
  border: none;
  outline: none;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.status-mode-pill select option {
  color: #102336;
}

.status-button {
  cursor: pointer;
}

#status-app,
#status-version,
#hero-part-play-btn,
#debug-toggle,
#finalize-btn,
.chat-panel > .panel-head,
.quick-prompts {
  display: none !important;
}

.content-shell {
  --chat-column-min: 340px;
  --chat-column-width: clamp(360px, 32vw, 520px);
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(var(--chat-column-min), var(--chat-column-width));
  gap: 18px;
  overflow: hidden;
  transition: grid-template-columns 720ms cubic-bezier(0.22, 1, 0.36, 1),
    gap 720ms cubic-bezier(0.22, 1, 0.36, 1);
  transition-duration: 1000ms;
}

.content-shell::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: calc(var(--chat-column-width) + 9px);
  width: 1px;
  background: rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

.panel {
  min-width: 0;
  min-height: 0;
  height: 100%;
  border-radius: 26px;
  padding: 16px;
  overflow: hidden;
}

.chat-panel,
.viewer-panel {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto auto;
  grid-template-areas:
    "status"
    "messages"
    "sample"
    "progress"
    "globe"
    "composer";
  gap: 12px;
  align-items: stretch;
  font-size: 14px;
  line-height: 1.45;
  transform-origin: center center;
  transition:
    width 1000ms cubic-bezier(0.16, 1, 0.3, 1),
    max-width 1000ms cubic-bezier(0.16, 1, 0.3, 1),
    height 1000ms cubic-bezier(0.16, 1, 0.3, 1),
    padding 1000ms cubic-bezier(0.16, 1, 0.3, 1),
    border-radius 1000ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 1000ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 720ms ease,
    background 1000ms ease;
}

.viewer-panel {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: stretch;
  transform-origin: center center;
  transition:
    opacity 860ms ease,
    transform 1000ms cubic-bezier(0.16, 1, 0.3, 1);
}

.viewer-panel .panel-head {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head h2,
.section-head h3 {
  margin: 0 0 8px;
  font-size: 22px;
}

.panel-head p,
.metric-label,
.message-role,
.viewer-hint,
.summary-card,
.section-head span,
dt {
  color: var(--muted);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.prompt-chip,
.primary-btn,
.ghost-btn {
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.prompt-chip {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font: inherit;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.prompt-chip:hover,
.primary-btn:hover,
.ghost-btn:hover,
.status-button:hover {
  transform: translateY(-1px);
}

.chat-log {
  grid-area: messages;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 6px;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(168, 168, 168, 0.78) rgba(9, 11, 16, 0.98);
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

.chat-status-stack {
  grid-area: status;
  display: grid;
  gap: 12px;
}

.chat-panel > .progress-card {
  grid-area: progress;
}

.message-globe-shell {
  grid-area: globe;
  position: relative;
  min-height: min(300px, var(--message-globe-fit-height));
  height: var(--message-globe-fit-height);
  max-height: min(620px, calc(100vh - 136px));
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  opacity: 0.9;
  transition: opacity 180ms ease, border-color 180ms ease;
}

body:not(.landing-mode) .message-globe-shell,
.message-globe-shell.is-hidden-by-mode {
  display: none !important;
}

.message-globe-shell.is-input-focused,
.message-globe-shell.is-typing {
  opacity: 0.46;
}

.message-globe-shell.is-dragging {
  opacity: 1;
}

.message-globe-shell.is-dragging .message-globe-satellite {
  pointer-events: none;
}

#message-globe-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: transparent;
}

.message-globe-barrage {
  position: absolute;
  top: var(--message-globe-barrage-top-offset, 0);
  left: 0;
  right: 0;
  z-index: 40;
  height: var(--message-globe-barrage-height, calc(32px * var(--message-globe-barrage-rows, 3) + 8px));
  overflow: hidden;
  pointer-events: auto;
  background: transparent;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
}

.message-globe-barrage[hidden] {
  display: none;
}

.message-globe-barrage-row {
  height: 32px;
  overflow: hidden;
}

.message-globe-barrage-track {
  width: max-content;
  min-width: 200%;
  display: inline-flex;
  align-items: center;
  padding: 3px 0;
  animation: message-globe-barrage-scroll 28s linear infinite;
  will-change: transform;
}

.message-globe-barrage:hover .message-globe-barrage-track {
  animation-play-state: paused;
}

.message-globe-barrage-row.is-single .message-globe-barrage-track {
  min-width: 200%;
  animation-name: message-globe-barrage-scroll;
}

.message-globe-barrage-row.is-single .message-globe-barrage-segment {
  flex-basis: 100%;
  min-width: 100%;
  justify-content: center;
  padding: 0 min(14vw, 180px);
}

.message-globe-barrage-row.is-single .message-globe-barrage-segment[aria-hidden="true"] {
  display: inline-flex;
}

.message-globe-barrage-segment {
  flex: 0 0 max(100vw, 100%);
  min-width: max(100vw, 100%);
  display: inline-flex;
  align-items: center;
  justify-content: space-around;
  gap: min(24vw, 320px);
  padding: 0 min(16vw, 220px);
}

.message-globe-barrage-item {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  background: transparent;
  color: rgba(233, 242, 255, 0.78);
  font: inherit;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  max-width: min(360px, 72vw);
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  text-shadow:
    0 0 18px rgba(102, 166, 255, 0.34),
    0 10px 28px rgba(0, 0, 0, 0.34);
  transition: color 140ms ease, transform 140ms ease, text-shadow 140ms ease;
}

.message-globe-barrage-item.is-user-message {
  border: 1px solid rgba(170, 216, 255, 0.42);
  padding: 6px 12px;
  background:
    linear-gradient(135deg, rgba(78, 143, 220, 0.16), rgba(255, 255, 255, 0.05));
  color: rgba(244, 249, 255, 0.92);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 8px 22px rgba(16, 68, 128, 0.22),
    0 0 28px rgba(93, 170, 255, 0.16);
}

.message-globe-barrage-item:hover {
  color: rgba(255, 255, 255, 0.96);
  transform: translateY(-1px);
  text-shadow:
    0 0 24px rgba(130, 196, 255, 0.46),
    0 12px 32px rgba(0, 0, 0, 0.38);
}

.message-globe-satellites {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.message-globe-satellite {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: min(320px, 58vw);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 6px 11px;
  background: var(--globe-satellite-bg);
  color: var(--globe-satellite-text);
  font: inherit;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  pointer-events: auto;
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  transition: opacity 160ms ease, background 160ms ease, box-shadow 160ms ease;
  will-change: transform, opacity;
}

.message-globe-satellite.is-default {
  border-color: rgba(180, 220, 255, 0.24);
  padding: 8px 14px;
  background: rgba(12, 18, 32, 0.58);
  color: rgba(238, 246, 255, 0.96);
  font-size: clamp(13px, 1.25vw, 17px);
  font-weight: 680;
  letter-spacing: -0.02em;
  text-shadow: 0 0 18px rgba(130, 190, 255, 0.36);
  box-shadow:
    0 0 28px rgba(90, 150, 255, 0.16),
    0 18px 42px rgba(0, 0, 0, 0.24);
}

.message-globe-satellite:hover {
  background: rgba(255, 255, 255, 0.16);
  box-shadow:
    0 0 34px rgba(140, 205, 255, 0.22),
    0 20px 48px rgba(0, 0, 0, 0.3);
}

.message-globe-copy {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  pointer-events: none;
  text-align: center;
  transform: translateY(-1%);
}

.message-globe-copy-line {
  position: absolute;
  max-width: min(520px, 76%);
  color: rgba(247, 250, 255, 0.94);
  text-shadow:
    0 0 24px rgba(80, 146, 255, 0.42),
    0 14px 44px rgba(0, 0, 0, 0.46);
  letter-spacing: -0.02em;
}

.message-globe-copy-line.line-1 {
  font-size: clamp(28px, 4.8vw, 54px);
  font-weight: 720;
  line-height: 1.08;
}

.message-globe-copy-line.line-2 {
  margin-top: clamp(82px, 12vh, 138px);
  color: rgba(220, 235, 255, 0.82);
  font-size: clamp(14px, 1.8vw, 19px);
  font-weight: 560;
}

.message-globe-copy-line.line-3 {
  margin-top: clamp(132px, 18vh, 198px);
  color: rgba(190, 215, 255, 0.68);
  font-size: clamp(12px, 1.4vw, 16px);
  font-weight: 520;
}

.message-globe-detail {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 4;
  width: min(260px, calc(100% - 28px));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 13px 14px;
  background: rgba(9, 13, 24, 0.86);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
}

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

.message-globe-detail strong,
.message-globe-detail span {
  display: block;
  color: var(--ink);
  font-size: 12px;
}

.message-globe-detail p {
  margin: 7px 0;
  color: var(--ink);
  line-height: 1.55;
}

.message-globe-detail span {
  color: var(--muted);
}

.message-globe-detail-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  cursor: pointer;
}

.message-globe-fallback {
  position: absolute;
  inset: 18px;
  display: grid;
  place-items: center;
  gap: 6px;
  text-align: center;
  color: var(--globe-satellite-text);
  border-radius: 20px;
  background:
    radial-gradient(circle at center, rgba(120, 170, 255, 0.12), transparent 58%),
    rgba(255, 255, 255, 0.035);
}

.message-globe-fallback strong {
  font-size: 14px;
}

.message-globe-fallback p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

@keyframes message-globe-barrage-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .message-globe-barrage-track {
    animation: none;
    transform: translateX(0);
  }
}

.chat-log::-webkit-scrollbar {
  width: 12px;
}

.chat-log::-webkit-scrollbar-track {
  background: rgba(9, 11, 16, 0.98);
  border-radius: 999px;
}

.chat-log::-webkit-scrollbar-thumb {
  background: rgba(168, 168, 168, 0.78);
  border-radius: 999px;
  border: 2px solid rgba(9, 11, 16, 0.98);
}

.chat-log::-webkit-scrollbar-thumb:hover {
  background: rgba(188, 188, 188, 0.9);
}

.chat-log::-webkit-scrollbar-button {
  background: rgba(120, 120, 120, 0.85);
  height: 12px;
}

.chat-log::-webkit-scrollbar-corner {
  background: rgba(9, 11, 16, 0.98);
}

.message {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-width: min(88%, 680px);
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  animation: message-in 200ms ease both;
}

.message.user {
  align-self: flex-end;
  text-align: right;
  background: rgba(240, 106, 58, 0.14);
  border-color: rgba(240, 106, 58, 0.18);
}

.message.assistant,
.message.system {
  align-self: flex-start;
}

.message.assistant-thinking {
  color: rgba(246, 243, 234, 0.66);
  font-size: 13px;
  letter-spacing: 0.01em;
  animation: assistant-thinking-pulse 1.25s ease-in-out infinite;
}

@keyframes assistant-thinking-pulse {
  0%,
  100% {
    opacity: 0.58;
  }

  50% {
    opacity: 0.94;
  }
}

.message.process {
  align-self: flex-start;
  max-width: min(86%, 660px);
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.06);
}

.message.system {
  background: rgba(96, 114, 138, 0.12);
}

.message.system.warning {
  max-width: min(88%, 680px);
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(245, 181, 80, 0.1);
  border: 1px solid rgba(245, 181, 80, 0.22);
  color: rgba(255, 238, 204, 0.92);
}

.message.order-cta-message {
  gap: 10px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(240, 106, 58, 0.08);
  border: 1px solid rgba(240, 106, 58, 0.16);
}

.message.order-cta-message.is-stale {
  opacity: 0.62;
  background: rgba(130, 139, 153, 0.08);
  border-color: rgba(130, 139, 153, 0.16);
}

.order-cta-btn {
  align-self: flex-start;
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  background: linear-gradient(135deg, rgba(240, 106, 58, 0.95), rgba(255, 167, 97, 0.92));
  color: #15120f;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(240, 106, 58, 0.18);
}

.order-cta-btn:disabled {
  cursor: progress;
  opacity: 0.72;
}

.order-cta-message.is-stale .order-cta-btn:disabled {
  cursor: not-allowed;
  background: rgba(138, 148, 163, 0.38);
  color: rgba(246, 243, 234, 0.74);
  box-shadow: none;
}

.message.resource-download-cta-message {
  gap: 10px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(93, 154, 255, 0.08);
  border: 1px solid rgba(124, 176, 255, 0.18);
}

.resource-download-cta-message p {
  margin: 0;
  color: rgba(246, 243, 234, 0.82);
  line-height: 1.55;
}

.resource-download-cta-btn {
  align-self: flex-start;
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  background: linear-gradient(135deg, rgba(124, 176, 255, 0.95), rgba(170, 212, 255, 0.9));
  color: #101722;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(93, 154, 255, 0.18);
}

.resource-download-cta-btn:hover {
  transform: translateY(-1px);
}

.message.assistant,
.message.system {
  padding: 2px 0;
  border-color: transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.message.assistant-variant.ai-output,
.message.assistant-variant.system-output {
  color: #f6f3ea;
}

.message.assistant-variant {
  align-self: flex-start;
  padding: 2px 0;
  border-color: transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.assistant-variant-label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  opacity: 0.85;
}

.message.user {
  padding: 8px 12px;
  border-radius: 16px;
  background: rgba(240, 106, 58, 0.14);
  border-color: rgba(240, 106, 58, 0.18);
}

.message-role {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.message p:last-child {
  margin: 0;
  line-height: 1.48;
}

.process-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.process-link {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(240, 106, 58, 0.1);
  border: 1px solid rgba(240, 106, 58, 0.16);
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
}

.process-link:hover {
  background: rgba(240, 106, 58, 0.16);
}

.progress-card {
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 280ms ease, transform 280ms ease;
}

.summary-card {
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 280ms ease, transform 280ms ease;
}

.progress-card.is-finishing {
  opacity: 0;
  transform: translateY(-6px);
}

.viewer-stage > .progress-card,
.viewer-progress-card {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 8;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(10, 12, 17, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(12px);
}

.viewer-stage > .progress-card[hidden] {
  display: none;
}

.viewer-stage > .progress-card .progress-bar {
  height: 6px;
}

.viewer-panel-head-synced {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
  min-width: 0;
}

.viewer-panel-head-synced > h2 {
  margin: 0;
  flex: 0 0 auto;
  justify-self: start;
}

.viewer-panel-head-synced > .progress-card-inline {
  margin-left: auto;
  flex: 0 0 auto;
  width: min(100%, var(--viewer-main-width, 100%));
  max-width: min(100%, var(--viewer-main-width, 100%));
  min-width: 0;
  align-items: center;
}

.progress-card-inline {
  min-width: 0;
  padding: 8px 12px;
  border-radius: 14px;
  margin-left: 0;
}

.progress-meta-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#progress-percent {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.progress-card .section-head h3 {
  display: none;
}

.progress-card .section-head {
  justify-content: flex-end;
}

.run-card {
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.progress-bar {
  margin-top: 6px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  box-shadow: 0 8px 20px rgba(240, 106, 58, 0.25);
  transition: width 220ms ease;
}

.progress-stage {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.run-stage {
  margin: 12px 0 4px;
  font-size: 15px;
  font-weight: 600;
}

.run-detail {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.run-artifacts {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.run-artifact-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(240, 106, 58, 0.1);
  border: 1px solid rgba(240, 106, 58, 0.16);
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
}

.run-artifact-link:hover {
  background: rgba(240, 106, 58, 0.16);
}

.clarify-card {
  padding: 16px;
  border-radius: 20px;
  background: rgba(79, 117, 255, 0.1);
  border: 1px solid rgba(118, 146, 255, 0.2);
}

.brief-card {
  padding: 14px 0 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  height: auto;
  min-height: 0;
  max-height: calc((44px * 2) + 5px + 14px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: hidden;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(168, 168, 168, 0.78) rgba(9, 11, 16, 0.12);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 260ms ease, transform 260ms ease;
}

.brief-card > .section-head {
  display: none;
}

.brief-card-inline {
  margin-top: 2px;
  min-height: 0;
}

.brief-card.is-empty {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.12);
}

.brief-card.is-empty .parameter-form {
  display: none;
}

.brief-goal,
.brief-missing {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.brief-goal {
  display: none;
}

.brief-tags {
  display: none;
}

.brief-card::-webkit-scrollbar {
  width: 10px;
}

.brief-card::-webkit-scrollbar-track {
  background: rgba(9, 11, 16, 0.12);
  border-radius: 999px;
}

.brief-card::-webkit-scrollbar-thumb {
  background: rgba(168, 168, 168, 0.78);
  border-radius: 999px;
  border: 2px solid rgba(9, 11, 16, 0.12);
}

.brief-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(240, 106, 58, 0.1);
  border: 1px solid rgba(240, 106, 58, 0.16);
  color: var(--ink);
  font-size: 12px;
}

.parameter-form {
  --parameter-row-height: 44px;
  --parameter-row-gap: 5px;
  flex: 0 0 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  grid-template-rows: auto;
  grid-template-areas: "grid actions";
  align-items: start;
  gap: 6px;
  overflow: hidden;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.25;
  letter-spacing: 0;
}

.parameter-form input,
.parameter-form select,
.parameter-form button,
.generic-parameter-panel,
.generic-parameter-panel input,
.generic-parameter-panel select,
.generic-parameter-panel button {
  font-family: inherit;
}

.parameter-grid {
  grid-area: grid;
  min-height: 0;
  max-height: calc((var(--parameter-row-height) * 2) + var(--parameter-row-gap));
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  align-content: start;
  gap: 5px;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(168, 168, 168, 0.78) rgba(9, 11, 16, 0.12);
}

.parameter-grid::-webkit-scrollbar {
  width: 10px;
}

.parameter-grid::-webkit-scrollbar-track {
  background: rgba(9, 11, 16, 0.12);
  border-radius: 999px;
}

.parameter-grid::-webkit-scrollbar-thumb {
  background: rgba(168, 168, 168, 0.78);
  border-radius: 999px;
  border: 2px solid rgba(9, 11, 16, 0.12);
}

.parameter-field-internal {
  display: none !important;
}

.parameter-form.is-generic {
  grid-template-columns: minmax(0, 1fr) 200px;
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas: "generic actions";
}

.parameter-form.is-generic .parameter-grid,
.parameter-form.is-generic .parameter-shelf-section {
  display: none !important;
}

.parameter-form.is-generic.is-part-inspector {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "generic";
  --part-inspector-row-height: 34px;
  --part-inspector-row-gap: 4px;
}

.parameter-form.is-part-inspector .parameter-actions {
  display: none;
}

.parameter-form.is-part-inspector .parameter-grid,
.parameter-form.is-part-inspector .parameter-shelf-section {
  display: none !important;
}

.parameter-form.is-part-inspector .generic-parameter-panel {
  max-height: calc((var(--part-inspector-row-height) * 2) + var(--part-inspector-row-gap));
  gap: 0;
  padding-right: 2px;
  overscroll-behavior: contain;
}

.parameter-form.is-part-inspector .generic-parameter-group {
  gap: 0;
}

.parameter-form.is-part-inspector .generic-parameter-group-title {
  display: none;
}

.generic-parameter-panel {
  grid-area: generic;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(168, 168, 168, 0.78) rgba(9, 11, 16, 0.12);
}

.parameter-form.is-profile-frame-parameter-panel {
  grid-template-columns: minmax(0, 1fr) 200px;
  grid-template-rows: auto;
}

.generic-parameter-panel.is-profile-frame {
  max-height: calc((var(--parameter-row-height) * 2) + var(--parameter-row-gap));
  gap: 0;
  padding-right: 2px;
  overscroll-behavior: contain;
}

.generic-parameter-panel::-webkit-scrollbar {
  width: 10px;
}

.generic-parameter-panel::-webkit-scrollbar-track {
  background: rgba(9, 11, 16, 0.12);
  border-radius: 999px;
}

.generic-parameter-panel::-webkit-scrollbar-thumb {
  background: rgba(168, 168, 168, 0.78);
  border-radius: 999px;
  border: 2px solid rgba(9, 11, 16, 0.12);
}

.generic-parameter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.generic-parameter-group-title {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 180, 150, 0.94);
  letter-spacing: 0.04em;
}

.generic-parameter-panel.is-profile-frame .generic-parameter-group {
  gap: 0;
}

.generic-parameter-panel.is-profile-frame .generic-parameter-group-title {
  display: none;
}

.generic-parameter-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(166px, 1fr));
  gap: 6px;
}

.generic-parameter-panel.is-profile-frame .generic-parameter-items {
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 5px;
}

.generic-parameter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 12px;
  background: rgba(240, 106, 58, 0.08);
  border: 1px solid rgba(240, 106, 58, 0.16);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.generic-parameter-panel.is-profile-frame .generic-parameter-row {
  min-height: var(--parameter-row-height);
  gap: 6px;
  padding: 6px 8px;
  border-radius: 14px;
  background: rgba(240, 106, 58, 0.09);
  border-color: rgba(240, 106, 58, 0.18);
}

.generic-parameter-row:focus-within,
.generic-parameter-row:hover {
  border-color: rgba(255, 139, 87, 0.42);
  background: rgba(240, 106, 58, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 139, 87, 0.12);
}

.generic-parameter-label {
  min-width: 0;
  color: rgba(255, 180, 150, 0.92);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.generic-parameter-panel.is-profile-frame .generic-parameter-label {
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.04em;
}

.generic-parameter-control {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
}

.generic-parameter-input {
  width: auto;
  min-width: 46px;
  max-width: 110px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-align: right;
  appearance: none;
  -webkit-appearance: none;
}

.generic-parameter-panel.is-profile-frame .generic-parameter-input {
  min-width: 42px;
  max-width: 68px;
  height: 24px;
  font-size: 12px;
}

.generic-parameter-panel.is-profile-frame select.generic-parameter-input {
  max-width: 76px;
}

.generic-parameter-input:focus {
  outline: none;
}

.generic-parameter-input:disabled {
  opacity: 0.68;
  cursor: default;
}

.parameter-form.is-part-inspector .generic-parameter-items {
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  gap: var(--part-inspector-row-gap);
}

.parameter-form.is-part-inspector .generic-parameter-row {
  align-items: center;
  flex-direction: row;
  min-height: var(--part-inspector-row-height);
  gap: 5px;
  padding: 4px 6px;
  border-radius: 10px;
}

.parameter-form.is-part-inspector .generic-parameter-label {
  flex: 1 1 auto;
  max-width: none;
  font-size: 10.5px;
  line-height: 1.12;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.parameter-form.is-part-inspector .generic-parameter-control {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  justify-content: flex-end;
  align-items: center;
}

.parameter-form.is-part-inspector .generic-parameter-input {
  width: 100%;
  max-width: none;
  height: 20px;
  min-height: 20px;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  line-height: 1.15;
  word-break: normal;
}

.parameter-form.is-part-inspector .generic-parameter-row.is-long {
  grid-column: 1 / -1;
  flex-direction: column;
  gap: 5px;
}

.parameter-form.is-part-inspector .generic-parameter-row.is-long .generic-parameter-label {
  flex-basis: auto;
  max-width: none;
}

.parameter-form.is-part-inspector .generic-parameter-row.is-long .generic-parameter-control {
  width: 100%;
}

.generic-parameter-value {
  display: inline-block;
  width: auto;
  max-width: 118px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
  word-break: normal;
}

.parameter-form.is-part-inspector .generic-parameter-value {
  max-width: 98px;
  font-size: 11px;
  line-height: 1.15;
}

.parameter-form.is-part-inspector .generic-parameter-row.is-long .generic-parameter-label,
.parameter-form.is-part-inspector .generic-parameter-row.is-long .generic-parameter-value {
  max-width: none;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.generic-parameter-empty {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.parameter-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 14px;
  background: rgba(240, 106, 58, 0.09);
  border: 1px solid rgba(240, 106, 58, 0.18);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.parameter-field-wide {
  grid-column: span 1;
}

.parameter-label {
  font-size: 10px;
  line-height: 1.2;
  color: rgba(255, 180, 150, 0.92);
  letter-spacing: 0.04em;
  flex: 0 0 auto;
  white-space: nowrap;
}

.parameter-field-control {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}

.parameter-field input,
.parameter-field select {
  width: auto;
  min-width: 0;
  height: 24px;
  padding: 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
  cursor: pointer;
  text-align: right;
  flex: 0 1 auto;
  max-width: 100%;
}

.parameter-field input {
  cursor: text;
}

#param-width,
#param-height,
#param-depth {
  min-width: 48px;
}

#param-shelf-count {
  min-width: 34px;
}

.parameter-field select {
  min-width: 62px;
  padding-right: 14px;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255, 196, 171, 0.92) 50%),
    linear-gradient(135deg, rgba(255, 196, 171, 0.92) 50%, transparent 50%);
  background-position:
    calc(100% - 10px) calc(50% - 1px),
    calc(100% - 5px) calc(50% - 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.parameter-field:focus-within {
  border-color: rgba(255, 139, 87, 0.52);
  background: rgba(240, 106, 58, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 139, 87, 0.18);
}

.parameter-field input:focus,
.parameter-field select:focus {
  outline: none;
}

.parameter-unit {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  color: rgba(255, 196, 171, 0.9);
  white-space: nowrap;
}

.parameter-field input:disabled,
.parameter-field select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.brief-missing:empty {
  display: none;
}

.parameter-shelf-section {
  min-height: 0;
  display: contents;
}

.parameter-shelf-section[hidden] {
  display: none !important;
}

.parameter-shelf-head {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.parameter-shelf-head-meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.parameter-shelf-head strong {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 180, 150, 0.94);
  letter-spacing: 0.04em;
}

.parameter-shelf-list {
  min-height: 0;
  display: contents;
}

.parameter-layer-row,
.parameter-bottom-gap-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 14px;
  background: rgba(240, 106, 58, 0.09);
  border: 1px solid rgba(240, 106, 58, 0.18);
}

.parameter-layer-row.is-active,
.parameter-bottom-gap-row.is-active {
  border-color: rgba(88, 155, 255, 0.42);
  background: rgba(88, 155, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(88, 155, 255, 0.12);
}

.parameter-layer-select,
.parameter-bottom-gap-label {
  min-width: auto;
  padding: 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 180, 150, 0.92);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.04em;
  white-space: nowrap;
  writing-mode: horizontal-tb;
  cursor: pointer;
}

.parameter-bottom-gap-label {
  min-width: auto;
}

.parameter-layer-row.is-active .parameter-layer-select,
.parameter-bottom-gap-row.is-active .parameter-layer-select {
  color: rgba(180, 215, 255, 0.96);
}

.parameter-layer-value {
  font-size: 11px;
  line-height: 1.1;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}

.parameter-layer-input {
  width: auto;
  min-width: 42px;
  height: 24px;
  padding: 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  text-align: right;
}

.parameter-layer-input[readonly] {
  color: var(--muted);
  cursor: default;
}

.parameter-layer-input-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
}

.parameter-layer-input-wrap .parameter-unit {
  font-size: 10px;
}

.parameter-actions {
  grid-area: actions;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
}

.parameter-actions:empty {
  display: none;
}

.parameter-rebuild-btn {
  width: 100%;
  min-height: calc((var(--parameter-row-height) * 2) + var(--parameter-row-gap));
  padding: 10px 14px;
  white-space: nowrap;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

@media (max-width: 1320px) {
  .parameter-form {
    grid-template-columns: 1fr;
    grid-template-areas:
      "grid"
      "actions";
  }

  .parameter-rebuild-btn {
    min-height: 38px;
  }

  .parameter-form.is-generic {
    grid-template-columns: 1fr;
    grid-template-areas:
      "generic"
      "actions";
  }

  .parameter-form.is-generic.is-part-inspector {
    grid-template-areas: "generic";
  }
}

.parameter-rebuild-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: saturate(0.45);
}

.viewer-toolbar {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2;
  margin: 0;
}

.clarify-question {
  margin: 10px 0 0;
  color: var(--ink);
  line-height: 1.65;
}

.clarify-suggestions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.clarify-suggestion-btn {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.clarify-suggestion-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
}

.chat-form {
  grid-area: composer;
  align-self: end;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 20px;
  padding: 10px 12px 10px;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.chat-form:focus-within {
  border-color: rgba(240, 106, 58, 0.24);
  box-shadow: 0 0 0 1px rgba(240, 106, 58, 0.16);
  background: rgba(255, 255, 255, 0.045);
}

.chat-composer {
  position: relative;
  z-index: 2;
}

.chat-form textarea {
  width: 100%;
  min-height: calc(1.45em + 10px);
  max-height: min(180px, 28vh);
  resize: none;
  overflow-y: hidden;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 5px 68px 5px 3px;
  font: inherit;
  outline: none;
  line-height: 1.45;
  scrollbar-width: thin;
  scrollbar-color: rgba(168, 168, 168, 0.78) transparent;
}

.chat-form textarea::-webkit-scrollbar {
  width: 10px;
}

.chat-form textarea::-webkit-scrollbar-track {
  background: transparent;
}

.chat-form textarea::-webkit-scrollbar-thumb {
  background: rgba(168, 168, 168, 0.78);
  border-radius: 999px;
  border: 2px solid transparent;
}

.sample-structure-card {
  grid-area: sample;
  position: relative;
  min-height: 50px;
  max-height: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 5px 8px;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(240, 106, 58, 0.16);
  background:
    linear-gradient(180deg, rgba(240, 106, 58, 0.11), rgba(240, 106, 58, 0.05)),
    rgba(255, 255, 255, 0.025);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.sample-structure-card[hidden] {
  display: none !important;
}

.sample-structure-card:hover,
.sample-structure-card:focus-within {
  transform: translateY(-1px);
  border-color: rgba(240, 106, 58, 0.3);
  background:
    linear-gradient(180deg, rgba(240, 106, 58, 0.16), rgba(240, 106, 58, 0.08)),
    rgba(255, 255, 255, 0.035);
}

.sample-structure-card > div,
.sample-structure-card h3,
.sample-structure-card .eyebrow,
.sample-structure-card p:last-child {
  display: none;
}

.sample-structure-btn {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 6px 10px;
  border-color: transparent;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}

.chat-agent-status-line {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 10px;
  height: 10px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(112, 33, 33, 0.72) !important;
  box-shadow: 0 0 0 2px rgba(9, 11, 16, 0.55);
  color: transparent;
  overflow: hidden;
  text-indent: -999px;
  flex: 0 0 auto;
}

.chat-agent-status-line.is-llm {
  background: #ff3b30 !important;
  opacity: 1;
  box-shadow:
    0 0 0 2px rgba(9, 11, 16, 0.55),
    0 0 12px rgba(255, 59, 48, 0.72);
}

.chat-agent-status-line.is-fallback {
  background: rgba(112, 33, 33, 0.72) !important;
  opacity: 0.48;
  box-shadow: 0 0 0 2px rgba(9, 11, 16, 0.55);
}

.chat-agent-status-line.is-llm-fallback,
.chat-agent-status-line.is-llm-configured {
  background: rgba(112, 33, 33, 0.72) !important;
  opacity: 0.52;
  box-shadow: 0 0 0 2px rgba(9, 11, 16, 0.55);
}

.sample-structure-card.is-generating {
  cursor: wait;
  opacity: 0.78;
}

.chat-actions {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.primary-btn {
  padding: 12px 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: 0 14px 32px rgba(240, 106, 58, 0.2);
}

.ghost-btn {
  padding: 12px 18px;
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.secondary-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.secondary-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.secondary-btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
}

#finalize-btn {
  display: none !important;
}

.composer-send-btn,
.chat-actions button[type="submit"] {
  width: auto;
  min-width: 58px;
  height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #d8d8da 0%, #c7c7ca 100%);
  color: #2d3036;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.26);
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease;
}

.composer-send-btn:hover,
.chat-actions button[type="submit"]:hover {
  transform: translateY(-1px);
}

.composer-send-btn.is-generating,
.chat-actions button[type="submit"].is-generating {
  background: linear-gradient(180deg, #d8d8da 0%, #c7c7ca 100%);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.composer-arrow-icon {
  width: 32px;
  height: 32px;
  display: block;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2331363d' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 18V5.5'/%3E%3Cpath d='M6.5 11L12 5.5 17.5 11'/%3E%3C/svg%3E");
}

.composer-send-label {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  color: inherit;
  writing-mode: horizontal-tb;
  white-space: nowrap;
}

.composer-pause-icon {
  width: 15px;
  height: 15px;
  display: block;
  border-radius: 2px;
  background: currentColor;
}

.viewer-toolbar,
.level-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.viewer-toolbar {
  justify-content: flex-end;
}

.viewer-toolbar .viewer-hint,
.level-toolbar,
.viewer-meta {
  display: none !important;
}

.viewer-layout {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
}

.design-tree-panel {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 7;
  width: min(232px, 100%);
  max-height: 100%;
  min-height: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  padding: 0 4px 4px 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
  color: rgba(8, 10, 14, 0.94);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.76);
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
}

.design-tree-panel.is-collapsed {
  display: none;
  pointer-events: none;
}

.design-tree-overlay-collapse,
.design-tree-overlay-restore {
  display: none !important;
  border: 0;
  background: transparent;
  color: rgba(8, 10, 14, 0.94);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.78);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.design-tree-overlay-collapse {
  justify-self: end;
  width: 22px;
  height: 22px;
  padding: 0;
  line-height: 1;
  opacity: 0.74;
}

.design-tree-overlay-collapse:hover,
.design-tree-overlay-restore:hover {
  color: #0d47a1;
}

.design-tree-overlay-restore {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 7;
  padding: 4px 7px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
  font-size: 11px;
}

.viewer-main {
  min-width: 0;
  min-height: 0;
}

.design-tree-head {
  display: none;
}

.design-tree-head h3 {
  margin: 0;
  font-size: 16px;
}

.design-tree-scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(128, 128, 128, 0.68) transparent;
  cursor: pointer;
}

.design-tree-scroll::-webkit-scrollbar {
  width: 10px;
  background: transparent;
}

.design-tree-scroll::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 999px;
}

.design-tree-scroll::-webkit-scrollbar-thumb {
  background: rgba(128, 128, 128, 0.68);
  background-clip: content-box;
  border-radius: 999px;
  border: 2px solid transparent;
}

.design-tree-scroll::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
  background: transparent;
}

.design-tree-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.design-tree-assembly,
.design-tree-item {
  width: 100%;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: color 140ms ease, background 140ms ease;
}

.design-tree-assembly {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 0;
  background: transparent;
  font-weight: 700;
}

.design-tree-assembly:hover {
  color: #0d47a1;
  background: transparent;
}

.design-tree-toggle {
  width: 16px;
  height: 16px;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: transparent;
  color: inherit;
  font-weight: 800;
  line-height: 1;
}

.design-tree-assembly-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.design-tree-children {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-left: 14px;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.design-tree-part-node {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.design-tree-part-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 5px;
  align-items: stretch;
}

.design-tree-feature-toggle {
  width: 18px;
  min-width: 18px;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.design-tree-feature-toggle:disabled {
  opacity: 0.36;
  cursor: default;
}

.design-tree-item {
  padding: 5px 0;
  background: transparent;
}

.design-tree-item:hover,
.design-tree-item.active {
  color: #0d47a1;
  background: transparent;
}

.design-tree-item.active {
  box-shadow: inset 2px 0 0 rgba(88, 155, 255, 0.78);
  padding-left: 8px;
}

.design-tree-feature-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-left: 23px;
  padding-left: 9px;
  border-left: 1px dashed rgba(255, 255, 255, 0.13);
}

.design-tree-feature-item,
.design-tree-feature-empty {
  width: 100%;
  border-radius: 0;
  padding: 4px 0;
  font-size: 12px;
  text-align: left;
}

.design-tree-feature-item {
  border: 0;
  background: transparent;
  color: rgba(8, 10, 14, 0.84);
  cursor: pointer;
}

.design-tree-feature-item:hover,
.design-tree-feature-item.active {
  background: transparent;
  color: #0d47a1;
}

.design-tree-feature-item.active {
  box-shadow: inset 2px 0 0 rgba(47, 128, 255, 0.72);
  padding-left: 8px;
}

.design-tree-feature-empty {
  color: var(--muted);
  background: transparent;
}

.design-tree-empty {
  display: none;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.viewer-stage {
  position: relative;
  min-height: 0;
  max-height: 100%;
  height: 100%;
  border-radius: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 20% 12%, rgba(255, 255, 255, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(17, 21, 29, 0.8), rgba(10, 12, 17, 0.92));
}

.mesh-viewer-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.mesh-viewer-stage canvas,
#bookshelf-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

#bookshelf-canvas {
  cursor: grab;
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 255, 255, 0.06), transparent 32%),
    linear-gradient(180deg, rgba(16, 19, 26, 0.96), rgba(8, 10, 14, 0.96));
}

#bookshelf-canvas[hidden] {
  display: none;
}

.viewer-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  z-index: 3;
}

.viewer-stage.is-viewer-model-loading .viewer-overlay {
  z-index: 7;
  background: transparent;
  backdrop-filter: none;
}

.viewer-stage.is-viewer-model-loading .viewer-overlay p {
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(10, 12, 17, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(247, 241, 229, 0.88);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.viewer-overlay p {
  max-width: 34ch;
  margin: 0;
  white-space: pre-line;
  line-height: 1.8;
}

.viewer-overlay.hidden {
  display: none;
}

.dimension-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.dimension-overlay.hidden {
  display: none;
}

.dimension-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.dimension-label-layer {
  position: absolute;
  inset: 0;
}

.dimension-line {
  stroke: rgba(255, 190, 92, 0.98);
  stroke-width: 2.2;
  stroke-linecap: round;
}

.dimension-extension {
  stroke: rgba(255, 190, 92, 0.62);
  stroke-width: 1.4;
  stroke-linecap: round;
}

.dimension-tick {
  stroke: rgba(255, 190, 92, 0.98);
  stroke-width: 2;
  stroke-linecap: round;
}

.dimension-label {
  position: absolute;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(17, 21, 29, 0.88);
  border: 1px solid rgba(255, 190, 92, 0.28);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.26);
  color: #fff0cf;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

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

.metric-card {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.metric-card strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
}

.level-chip-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.level-chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.level-chip.active,
.level-chip:hover {
  background: rgba(240, 106, 58, 0.16);
  color: #fff;
  transform: translateY(-1px);
}

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

.summary-grid div {
  min-width: 0;
}

dt {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

dd {
  margin: 6px 0 0;
  font-size: 14px;
  word-break: break-word;
}

.debug-card {
  border-style: dashed;
}

.debug-diff-block {
  margin-top: 12px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.debug-title {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

.debug-diff-block pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink);
}

#sample-structure-modal-backdrop,
#order-modal-backdrop,
#resource-download-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(3, 5, 10, 0.72);
  backdrop-filter: blur(6px);
}

#sample-structure-modal,
#order-modal,
#resource-download-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 41;
  width: min(540px, calc(100vw - 32px));
  transform: translate(-50%, -50%);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(17, 21, 29, 0.98);
  box-shadow: var(--shadow);
  padding: 18px;
}

#order-modal {
  width: min(680px, calc(100vw - 32px));
  max-height: min(86vh, 760px);
  overflow-y: auto;
}

#sample-structure-modal[hidden],
#sample-structure-modal-backdrop[hidden],
#order-modal[hidden],
#order-modal-backdrop[hidden],
#resource-download-modal[hidden],
#resource-download-modal-backdrop[hidden] {
  display: none;
}

#sample-structure-modal-close,
#order-modal-close,
.resource-download-modal-close {
  margin-left: auto;
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  cursor: pointer;
}

.resource-download-modal-content {
  display: grid;
  gap: 12px;
}

.resource-download-modal-content h2 {
  margin: 0;
  font-size: 22px;
}

.resource-download-copy,
.resource-download-target {
  margin: 0;
  color: rgba(246, 243, 234, 0.72);
  line-height: 1.6;
}

.resource-download-form {
  display: grid;
  gap: 12px;
}

.resource-download-form label {
  display: grid;
  gap: 6px;
  color: rgba(246, 243, 234, 0.78);
  font-size: 13px;
}

.resource-download-form input {
  width: 100%;
  min-height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

.resource-download-form input:focus {
  border-color: rgba(124, 176, 255, 0.52);
  box-shadow: 0 0 0 3px rgba(124, 176, 255, 0.12);
}

.resource-download-error {
  min-height: 18px;
  margin: 0;
  color: rgba(255, 157, 134, 0.92);
  font-size: 13px;
}

.resource-download-error.is-success {
  color: rgba(151, 230, 181, 0.95);
}

.sample-structure-modal-card {
  display: grid;
  gap: 14px;
}

.sample-structure-modal-card + .sample-structure-modal-card {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sample-structure-preview {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(240, 106, 58, 0.14);
  background:
    radial-gradient(circle at 12% 14%, rgba(255, 255, 255, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(27, 33, 45, 0.96), rgba(14, 18, 25, 0.96));
  color: #ffd1bf;
  font-size: 13px;
  line-height: 1.7;
}

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

.sample-structure-metric {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.sample-structure-metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.sample-structure-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.sample-structure-actions {
  display: flex;
  justify-content: flex-end;
}

.order-confirm-card {
  display: grid;
  gap: 14px;
}

.order-confirm-card h3 {
  margin: 0;
  font-size: 22px;
}

.order-confirm-copy,
.order-confirm-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

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

.order-address-list {
  display: grid;
  gap: 10px;
}

.order-confirm-address {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.order-address-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
}

.order-address-option input {
  margin-top: 3px;
}

.order-address-option strong,
.order-address-option small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-address-option strong {
  color: var(--ink);
  font-size: 13px;
}

.order-address-option small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.order-address-card-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.order-confirm-metric {
  min-width: 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.order-confirm-metric span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.order-confirm-metric strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.order-confirm-metric:nth-child(7) {
  grid-column: 1 / -1;
}

.order-confirm-bom {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.order-confirm-bom-title {
  margin: 0 0 2px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.order-confirm-title-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.order-confirm-title-row h3 {
  margin: 0;
}

.order-confirm-title-row small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.order-confirm-bom-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--ink);
  font-size: 12px;
}

.order-confirm-bom-table th,
.order-confirm-bom-table td {
  padding: 8px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: top;
}

.order-confirm-bom-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: left;
}

.order-confirm-bom-table th:nth-child(2),
.order-confirm-bom-table th:nth-child(3),
.order-confirm-bom-table th:nth-child(4),
.order-confirm-bom-table td:nth-child(2),
.order-confirm-bom-table td:nth-child(3),
.order-confirm-bom-table td:nth-child(4) {
  text-align: right;
  white-space: nowrap;
}

.order-confirm-bom-table td:first-child {
  min-width: 0;
}

.order-confirm-bom-table td:first-child span,
.order-confirm-bom-table td:first-child small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-confirm-bom-table td:first-child small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.order-confirm-bom-table tbody tr:last-child td {
  border-bottom: 0;
}

.order-confirm-tools,
.order-confirm-fees {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.order-tool-option {
  display: grid;
  grid-template-columns: auto 58px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.order-tool-option input {
  margin-top: 3px;
}

.order-tool-thumb-btn {
  width: 58px;
  height: 58px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  cursor: zoom-in;
}

.order-tool-thumb-btn:hover,
.order-tool-thumb-btn:focus-visible {
  border-color: rgba(255, 209, 191, 0.42);
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 209, 191, 0.1);
}

.order-tool-thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: rgba(255, 255, 255, 0.92);
}

.order-tool-option strong,
.order-tool-option small {
  display: block;
  min-width: 0;
}

.order-tool-option strong {
  color: var(--ink);
  font-size: 13px;
}

.order-tool-option small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.order-tool-table th:first-child,
.order-tool-table td:first-child {
  width: 46px;
  text-align: center;
}

.order-tool-table th:nth-child(2),
.order-tool-table td:nth-child(2) {
  text-align: left;
  white-space: normal;
}

.order-tool-cell {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.order-tool-cell strong,
.order-tool-cell small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-tool-cell strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.order-tool-cell small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  white-space: normal;
}

.order-confirm-fees > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.order-confirm-fees span {
  color: var(--muted);
  font-size: 12px;
}

.order-confirm-fees strong {
  color: #ffd1bf;
  font-size: 13px;
  white-space: nowrap;
}

.order-tool-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 5, 10, 0.72);
  backdrop-filter: blur(12px);
}

.order-tool-preview-modal[hidden] {
  display: none;
}

.order-tool-preview-card {
  position: relative;
  width: min(680px, 92vw);
  max-height: min(760px, 88vh);
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(255, 209, 191, 0.12), transparent 42%),
    rgba(16, 20, 30, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.5);
}

.order-tool-preview-card img {
  width: 100%;
  max-height: 64vh;
  object-fit: contain;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
}

.order-tool-preview-card p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  text-align: center;
}

.order-tool-preview-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.48);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.order-tool-preview-close:hover,
.order-tool-preview-close:focus-visible {
  background: rgba(0, 0, 0, 0.68);
  outline: none;
}

.order-confirm-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 4px;
}

.order-confirm-footer > strong {
  color: #ffd1bf;
}

.order-submit-btn {
  flex: 0 0 auto;
}

.order-payment-attempt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.order-payment-attempt-actions[hidden] {
  display: none;
}

.order-payment-attempt-btn {
  min-height: 34px;
  padding: 8px 12px;
  font-size: 12px;
}

.order-progress-card,
.order-final-card {
  display: grid;
  gap: 14px;
}

.account-order-card {
  display: grid;
  gap: 14px;
}

.order-progress-card h3,
.order-final-card h3,
.account-order-card h3 {
  margin: 0;
  font-size: 22px;
}

.account-order-list {
  display: grid;
  gap: 10px;
}

.account-order-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.035);
}

.account-order-item strong,
.account-order-item span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-order-item strong {
  color: var(--ink);
  font-size: 13px;
}

.account-order-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.account-order-item b {
  color: #ffd1bf;
  font-size: 13px;
  white-space: nowrap;
}

.account-order-detail .order-confirm-footer {
  flex-wrap: wrap;
}

.account-address-form {
  display: grid;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(88, 155, 255, 0.15);
  background: rgba(88, 155, 255, 0.055);
}

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

.account-address-grid label,
.account-address-default {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.account-address-grid input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--ink);
  font: inherit;
}

.account-address-wide {
  grid-column: 1 / -1;
}

.account-address-default {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.account-address-list {
  display: grid;
  gap: 10px;
}

.account-address-item {
  display: grid;
  gap: 10px;
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.035);
}

.account-address-item strong,
.account-address-item span {
  display: block;
  min-width: 0;
}

.account-address-item strong {
  color: var(--ink);
  font-size: 13px;
}

.account-address-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.account-address-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.order-progress-bar {
  width: 100%;
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.order-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f06a3a, #ffd08a);
  box-shadow: 0 0 22px rgba(240, 106, 58, 0.32);
  transition: width 420ms ease;
}

.order-progress-meta,
.order-final-total,
.order-final-id {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.order-progress-meta strong,
.order-final-total strong,
.order-final-id strong {
  color: var(--ink);
}

.order-progress-meta span,
.order-final-total span,
.order-final-id span {
  color: var(--muted);
  font-size: 12px;
}

.order-progress-detail {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.order-progress-steps,
.order-final-vendors,
.order-final-dimensions {
  display: grid;
  gap: 10px;
}

.order-progress-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
}

.order-progress-step span {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.order-progress-step strong {
  color: inherit;
  font-size: 13px;
}

.order-progress-step.is-active {
  border-color: rgba(240, 106, 58, 0.36);
  background: rgba(240, 106, 58, 0.13);
  color: #ffd1bf;
}

.order-progress-step.is-active span,
.order-progress-step.is-done span {
  background: rgba(240, 106, 58, 0.2);
  color: #ffd1bf;
}

.order-progress-step.is-done {
  color: rgba(236, 242, 255, 0.82);
}

.order-vendor-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.035);
}

.order-vendor-card span,
.order-final-dimensions span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

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

.order-vendor-card strong,
.order-final-dimensions strong {
  display: block;
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.order-vendor-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.order-vendor-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  border: 1px solid rgba(255, 208, 138, 0.26);
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(255, 208, 138, 0.1);
  color: #ffd1bf;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.order-vendor-heading .order-vendor-status {
  display: inline-flex;
  margin-bottom: 0;
}

.order-vendor-logistics {
  display: block;
  margin-top: 6px;
  color: rgba(238, 242, 247, 0.64);
  font-size: 11px;
  line-height: 1.45;
}

.order-vendor-card b {
  align-self: center;
  color: #ffd1bf;
  white-space: nowrap;
}

.order-final-action-block {
  display: grid;
  gap: 9px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(88, 155, 255, 0.16);
  background: rgba(88, 155, 255, 0.06);
}

.order-final-action-block .secondary-btn {
  justify-self: start;
}

.order-final-id {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(88, 155, 255, 0.1);
  border: 1px solid rgba(88, 155, 255, 0.2);
}

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

.order-final-dimensions div {
  min-width: 0;
  padding: 11px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.055);
}

.order-final-total {
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(240, 106, 58, 0.18), rgba(255, 208, 138, 0.1));
  border: 1px solid rgba(240, 106, 58, 0.24);
}

.order-final-total strong {
  color: #ffd1bf;
  font-size: 22px;
}

.modal-shell {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.is-busy .prompt-chip,
.is-busy .primary-btn,
.is-busy .ghost-btn,
.is-busy .status-button,
.is-busy .project-item {
  opacity: 0.65;
  pointer-events: none;
}

.is-busy .composer-send-btn {
  opacity: 1;
  pointer-events: auto;
}

.is-busy .chat-actions button[type="submit"] {
  opacity: 1;
  pointer-events: auto;
}

@keyframes message-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.landing-mode {
  overflow: hidden;
}

body.landing-mode .app-shell {
  grid-template-columns: 236px minmax(0, 1fr);
  place-items: stretch;
  padding: 18px;
}

body.sidebar-collapsed.landing-mode .app-shell {
  grid-template-columns: 34px minmax(0, 1fr);
  padding-left: 8px;
}

body.landing-mode .topbar-chat,
body.landing-mode .chat-status-stack,
body.landing-mode .chat-log,
body.landing-mode .sample-structure-card,
body.landing-mode .quick-prompts,
body.landing-mode .chat-panel > .panel-head {
  display: none !important;
}

body.landing-mode .main-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

body.landing-mode .content-shell {
  width: min(1120px, calc(100% - 48px));
  flex: 0 0 auto;
  min-height: auto;
  height: auto;
  max-height: none;
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  overflow: visible;
}

body.landing-mode .content-shell::after {
  display: none;
}

body.landing-mode .chat-panel {
  width: min(1040px, calc(100vw - 40px));
  flex: 0 0 auto;
  align-self: center;
  height: max-content;
  max-height: none;
  min-height: auto;
  justify-self: center;
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 52px;
  padding: 0;
  overflow: visible;
  position: relative;
  transform: translateY(clamp(10px, 2vh, 24px));
  border-radius: 34px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

body.landing-mode .viewer-panel {
  display: none;
  grid-column: 1 / 2;
  grid-row: 1;
  order: initial;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-42px) scale(0.96);
}

body.landing-mode .chat-panel::before {
  content: none;
  display: none;
}

.landing-prompt-title {
  display: none;
}

body.landing-mode .landing-prompt-title {
  display: none;
  grid-area: landing-title;
  position: static;
  z-index: 5;
  max-width: 100%;
  color: var(--ink);
  text-align: center;
  font-size: clamp(20px, 3.1vw, 34px);
  line-height: 1.16;
  font-weight: 620;
  letter-spacing: -0.026em;
  pointer-events: none;
}

body.landing-mode .chat-form {
  width: 100%;
  min-height: 0;
  border-radius: 30px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.045);
}

body.landing-mode .chat-form textarea {
  height: calc(1.65em + 12px);
  min-height: calc(1.65em + 12px);
  max-height: calc(4.95em + 12px);
  font-size: 16px;
  padding-right: 88px;
}

body.landing-mode .message-globe-shell {
  height: var(--message-globe-fit-height);
  min-height: min(330px, var(--message-globe-fit-height));
  max-height: min(700px, calc(100vh - 128px));
  opacity: 0.94;
}

@media (max-width: 760px) {
  .message-globe-shell {
    height: var(--message-globe-fit-height);
    min-height: min(220px, var(--message-globe-fit-height));
    max-height: calc(100vh - 150px);
  }

  .message-globe-satellite {
    max-width: min(220px, 72vw);
    font-size: 11px;
    padding: 5px 8px;
  }

  .message-globe-satellite.is-default {
    font-size: 12px;
    padding: 6px 10px;
  }

  .message-globe-barrage {
    top: var(--message-globe-barrage-top-offset, 0);
    height: var(--message-globe-barrage-height, calc(29px * var(--message-globe-barrage-rows, 3) + 6px));
  }

  .message-globe-barrage-row {
    height: 29px;
  }

  .message-globe-barrage-track {
    animation-duration: 24s;
  }

  .message-globe-barrage-segment {
    gap: min(36vw, 220px);
    padding: 0 min(18vw, 140px);
  }

  .message-globe-barrage-row.is-single .message-globe-barrage-segment {
    padding: 0 min(12vw, 120px);
  }

  .message-globe-barrage-item {
    font-size: 12px;
    padding: 5px 8px;
    max-width: min(260px, 78vw);
  }

  .message-globe-copy-line.line-1 {
    font-size: clamp(22px, 8vw, 32px);
  }

  .message-globe-copy-line.line-2 {
    margin-top: 74px;
  }

  .message-globe-copy-line.line-3 {
    margin-top: 118px;
  }
}

body.workspace-mode .content-shell {
  grid-template-columns: minmax(0, 1fr) minmax(var(--chat-column-min), var(--chat-column-width));
  grid-template-rows: minmax(0, 1fr);
}

body.workspace-mode .viewer-panel {
  order: 1;
}

body.workspace-mode .chat-panel {
  order: 2;
  transform: translateX(0) scale(1);
  opacity: 1;
}

body.workspace-mode .viewer-panel {
  opacity: 1;
  transform: translateX(0) scale(1);
}

body.workspace-transitioning .content-shell {
  width: 100%;
  min-height: 0;
}

body.workspace-transitioning .chat-panel::before {
  animation: landingTitleFadeOut 420ms ease forwards;
}

body.workspace-transitioning .viewer-panel {
  display: grid;
  animation: viewerRevealFromLanding 860ms cubic-bezier(0.16, 1, 0.3, 1) 140ms both;
}

body.workspace-transitioning .brief-card-inline {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

body.workspace-transitioning .chat-panel {
  animation: chatDockToRight 1000ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes viewerRevealFromLanding {
  from {
    opacity: 0;
    transform: translateX(-48px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes chatDockToRight {
  from {
    transform: translateX(0) scale(1);
  }
  48% {
    transform: translateX(min(30vw, 340px)) scale(0.965);
  }
  68% {
    transform: translateX(min(20vw, 220px)) scale(0.985);
  }
  to {
    transform: translateX(0) scale(1);
  }
}

@keyframes landingTitleFadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
    max-height: 92px;
  }
  to {
    opacity: 0;
    transform: translateY(-16px);
    max-height: 0;
  }
}

@media (max-width: 1380px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  body.landing-mode .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .content-shell {
    --chat-column-min: 330px;
    --chat-column-width: clamp(350px, 31vw, 480px);
    grid-template-columns: minmax(0, 1fr) minmax(var(--chat-column-min), var(--chat-column-width));
    grid-template-rows: minmax(0, 1fr);
  }

  .content-shell::after {
    display: none;
  }

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

}

@media (max-height: 780px) and (min-width: 981px) {
  .app-shell {
    padding: 12px;
    gap: 12px;
  }

  body.sidebar-collapsed .app-shell,
  body.sidebar-collapsed.landing-mode .app-shell {
    grid-template-columns: 34px minmax(0, 1fr);
    padding-left: 8px;
  }

  .content-shell {
    gap: 12px;
  }

  .chat-panel {
    gap: 9px;
    font-size: 13px;
  }

  .viewer-panel {
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 9px;
  }

  .chat-form {
    border-radius: 18px;
    padding: 8px 10px;
  }

  .chat-form textarea {
    max-height: min(132px, 22vh);
    line-height: 1.4;
  }
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .app-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
    grid-template-columns: 1fr;
    padding: 14px;
  }

  body.sidebar-collapsed .app-shell {
    grid-template-columns: 1fr;
  }

  body.landing-mode .app-shell,
  body.sidebar-collapsed.landing-mode .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    order: 2;
  }

  .main-shell {
    order: 1;
  }

  .topbar-chat {
    flex-direction: column;
  }

  .main-shell,
  .content-shell,
  .panel,
  .sidebar {
    overflow: visible;
  }

  .status-strip {
    justify-content: flex-start;
  }

  .viewer-meta,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .viewer-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr);
  }

  .viewer-panel-head-synced {
    flex-direction: column;
    align-items: stretch;
  }

  .viewer-panel-head-synced > h2 {
    justify-self: start;
  }

  .viewer-panel-head-synced > .progress-card-inline {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
  }

  .sample-structure-card {
    flex-direction: column;
    align-items: stretch;
  }

  .sample-structure-btn {
    width: 100%;
  }

  .sample-structure-summary {
    grid-template-columns: 1fr;
  }

  body.workspace-mode .content-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(360px, 0.72fr) minmax(360px, 0.58fr);
  }

  .content-shell::after {
    display: none;
  }

  body.workspace-mode .viewer-panel,
  body.workspace-mode .chat-panel {
    order: initial;
  }
}

@media (max-width: 768px) {
  body.landing-mode {
    overflow: hidden;
  }

  body.landing-mode .app-shell,
  body.landing-mode.sidebar-collapsed .app-shell {
    height: var(--foundfun-visual-height, 100dvh);
    min-height: var(--foundfun-visual-height, 100dvh);
    width: 100vw;
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
    overflow: hidden;
  }

  body.landing-mode .main-shell {
    height: var(--foundfun-visual-height, 100dvh);
    min-height: 0;
    padding: 0 10px;
    overflow: hidden;
  }

  body.landing-mode .content-shell {
    width: min(100%, 720px);
  }

  body.landing-mode .chat-panel {
    width: min(100%, 720px);
    gap: clamp(8px, 2vh, 14px);
  }

  body.landing-mode .chat-form {
    min-height: 34px;
    border-radius: 14px;
    padding: 4px 8px;
  }

  body.landing-mode .chat-form textarea {
    height: 30px;
    min-height: 30px;
    max-height: min(88px, 18vh);
    padding-right: 58px;
    font-size: 13px;
    line-height: 1.34;
  }

  body.landing-mode .chat-actions button[type="submit"],
  body.landing-mode .chat-actions .ghost-btn {
    min-height: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: 10px;
    font-size: 11px;
    line-height: 1;
  }

  body.landing-mode .chat-form:focus-within,
  body.workspace-mode .chat-form:focus-within {
    border-color: rgba(240, 106, 58, 0.18);
    box-shadow: none;
    background: rgba(255, 255, 255, 0.04);
  }

  body.landing-mode .sidebar {
    position: fixed;
    z-index: 90;
    top: 0;
    left: 0;
    width: auto;
    height: 52px;
    padding: max(10px, env(safe-area-inset-top)) 12px 6px;
    border-right: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  body.landing-mode .sidebar-brand {
    padding: 0;
  }

  body.landing-mode .sidebar-brand-row {
    display: flex !important;
    align-items: center;
    gap: 6px;
  }

  body.landing-mode .foundfun-title {
    display: block !important;
    margin: 0;
    border-radius: 12px;
    padding: 6px 8px;
    font-size: 24px;
    cursor: default;
    order: 1;
  }

  body.landing-mode .sidebar-collapse-btn,
  body.workspace-mode .sidebar-collapse-btn {
    display: grid !important;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--ink);
  }

  body.landing-mode .sidebar-collapse-btn {
    order: 0;
  }

  body.landing-mode .legacy-sidebar-collapse-btn,
  body.workspace-mode .legacy-sidebar-collapse-btn,
  body.landing-mode.mobile-sidebar-open .legacy-sidebar-collapse-btn,
  body.workspace-mode.mobile-sidebar-open .legacy-sidebar-collapse-btn {
    display: none !important;
  }

  body.landing-mode .sidebar-collapse-btn::before,
  body.workspace-mode .sidebar-collapse-btn::before {
    width: 18px;
    height: 14px;
    border: 0;
    border-top: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    border-radius: 0;
    background: linear-gradient(currentColor, currentColor) center / 18px 2px no-repeat;
    opacity: 0.9;
  }

  body.landing-mode .sidebar-collapse-btn::after,
  body.workspace-mode .sidebar-collapse-btn::after {
    display: none;
  }

  body.landing-mode .sidebar-collapse-btn:active,
  body.workspace-mode .sidebar-collapse-btn:active {
    background: rgba(255, 255, 255, 0.08);
  }

  body.landing-mode .sidebar-dev-row,
  body.landing-mode .catalog-dev-btn,
  body.landing-mode .sidebar-new-btn,
  body.landing-mode .sidebar-section,
  body.landing-mode .sidebar-user-card,
  body.landing-mode .debug-card {
    display: none !important;
  }

  body.landing-mode.mobile-sidebar-open .sidebar {
    width: min(86vw, 318px);
    max-width: 318px;
    height: var(--foundfun-visual-height, 100dvh);
    padding: max(14px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
    background: rgba(9, 11, 16, 0.98);
    border-right: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 28px 0 70px rgba(0, 0, 0, 0.38);
    overflow-y: auto;
  }

  body.landing-mode.mobile-sidebar-open .mobile-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: block;
    background: rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(2px);
  }

  body.landing-mode.mobile-sidebar-open .sidebar-collapse-btn,
  body.landing-mode.mobile-sidebar-open .foundfun-title,
  body.landing-mode.mobile-sidebar-open .sidebar-dev-row,
  body.landing-mode.mobile-sidebar-open .catalog-dev-btn,
  body.landing-mode.mobile-sidebar-open .sidebar-new-btn,
  body.landing-mode.mobile-sidebar-open .sidebar-section,
  body.landing-mode.mobile-sidebar-open .sidebar-user-card {
    display: revert !important;
  }

  body.landing-mode.mobile-sidebar-open .sidebar-dev-row,
  body.landing-mode.mobile-sidebar-open .sidebar-brand-row,
  body.landing-mode.mobile-sidebar-open .section-head {
    display: flex !important;
  }

  body.landing-mode.mobile-sidebar-open .debug-card {
    display: none !important;
  }

  body.workspace-mode {
    overflow: hidden;
  }

  body.workspace-mode .app-shell,
  body.workspace-mode.sidebar-collapsed .app-shell {
    height: var(--foundfun-visual-height, 100dvh);
    min-height: var(--foundfun-visual-height, 100dvh);
    width: 100vw;
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
    overflow: hidden;
  }

  body.workspace-mode .main-shell {
    order: 1;
    height: var(--foundfun-visual-height, 100dvh);
    min-height: 0;
    grid-template-rows: 52px minmax(0, 1fr);
    overflow: hidden;
  }

  body.workspace-mode .mobile-workspace-bar {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 8px;
    height: 52px;
    padding: max(6px, env(safe-area-inset-top)) 10px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(9, 11, 16, 0.94);
    backdrop-filter: blur(14px);
    z-index: 60;
  }

  body.workspace-mode .mobile-workspace-title {
    gap: 0;
  }

  body.workspace-mode .mobile-workspace-title strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.workspace-mode .mobile-workspace-title span {
    display: none;
  }

  body.workspace-mode .content-shell {
    --mobile-viewer-height: clamp(245px, 48vh, 430px);
    height: 100%;
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(220px, var(--mobile-viewer-height)) minmax(0, 1fr);
    gap: 0;
    overflow: hidden;
  }

  body.workspace-mode .viewer-panel {
    order: 1;
    min-height: 0;
    padding: 8px 10px 6px;
    border-radius: 0;
    grid-template-rows: minmax(0, 1fr);
    background: rgba(9, 11, 16, 0.16);
  }

  body.workspace-mode .viewer-layout,
  body.workspace-mode .viewer-main,
  body.workspace-mode .viewer-stage {
    min-height: 0;
    height: 100%;
  }

  body.workspace-mode .viewer-toolbar,
  body.workspace-mode .level-toolbar {
    display: none !important;
  }

  body.workspace-mode .brief-card-inline,
  body.workspace-mode .viewer-meta {
    display: none !important;
  }

  body.workspace-mode .chat-panel {
    order: 2;
    min-height: 0;
    padding: 9px 10px max(9px, env(safe-area-inset-bottom));
    border-radius: 18px 18px 0 0;
    background: rgba(14, 17, 24, 0.96);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    grid-template-rows: auto minmax(0, 1fr) auto auto auto auto;
    gap: 8px;
    font-size: 13px;
    line-height: 1.48;
    overflow: hidden;
  }

  body.workspace-mode .chat-log {
    min-height: 0;
    gap: 7px;
    padding-right: 4px;
    overscroll-behavior: contain;
  }

  body.workspace-mode .message {
    max-width: 96%;
  }

  body.workspace-mode .chat-status-stack {
    gap: 8px;
  }

  body.workspace-mode .progress-card,
  body.workspace-mode .run-card,
  body.workspace-mode .clarify-card {
    border-radius: 14px;
    padding: 10px;
  }

  body.workspace-mode .chat-form {
    min-height: 44px;
    padding: 6px 8px;
    border-radius: 16px;
  }

  body.landing-mode .chat-actions,
  body.workspace-mode .chat-actions {
    top: 50%;
    right: 7px;
    bottom: auto;
    transform: translateY(-50%);
    gap: 5px;
  }

  body.workspace-mode .chat-form textarea {
    min-height: 28px;
    max-height: min(88px, 18vh);
    font-size: 16px;
    line-height: 1.38;
    padding-right: 62px;
  }

  body.workspace-mode .chat-actions {
    gap: 5px;
  }

  body.workspace-mode .chat-actions button[type="submit"],
  body.workspace-mode .chat-actions .ghost-btn {
    min-height: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: 10px;
    font-size: 11px;
    line-height: 1;
  }

  body.workspace-mode .sample-structure-card {
    min-height: 42px;
    max-height: 48px;
    padding: 4px 6px;
    border-radius: 13px;
  }

  body.workspace-mode .sample-structure-btn {
    min-height: 30px;
    padding: 5px 8px;
    font-size: 12px;
  }

  #order-modal {
    width: calc(100vw - 14px);
    max-height: calc(var(--foundfun-visual-height, 100dvh) - 18px);
    padding: 12px;
    border-radius: 18px;
  }

  #order-modal-close {
    position: sticky;
    top: 0;
    z-index: 2;
    margin-bottom: 8px;
    background: rgba(17, 21, 29, 0.96);
  }

  .order-confirm-card {
    gap: 10px;
  }

  .order-confirm-card h3 {
    font-size: 18px;
    line-height: 1.25;
  }

  .order-confirm-copy,
  .order-confirm-note {
    font-size: 12px;
    line-height: 1.55;
  }

  .order-confirm-summary {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .order-confirm-metric,
  .order-confirm-bom,
  .order-address-option {
    padding: 10px;
    border-radius: 13px;
  }

  .order-confirm-bom {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .order-confirm-bom-table {
    min-width: 430px;
    font-size: 11px;
  }

  .order-confirm-footer {
    position: sticky;
    bottom: -12px;
    z-index: 2;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin: 0 -12px -12px;
    padding: 10px 12px 12px;
    background: rgba(17, 21, 29, 0.98);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .order-submit-btn {
    width: 100%;
  }

  body.workspace-mode .sidebar {
    position: fixed;
    z-index: 90;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(86vw, 318px);
    max-width: 318px;
    height: var(--foundfun-visual-height, 100dvh);
    padding: max(14px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
    background: rgba(9, 11, 16, 0.98);
    border-right: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 28px 0 70px rgba(0, 0, 0, 0.38);
    overflow-y: auto;
    transform: translateX(-104%);
    transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  body.workspace-mode.mobile-sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.workspace-mode.mobile-sidebar-open .mobile-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: block;
    background: rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(2px);
  }

  body.workspace-mode.mobile-sidebar-open .mobile-sidebar-menu-btn {
    background: rgba(255, 255, 255, 0.08);
  }

  body.workspace-mode.mobile-sidebar-open .foundfun-title,
  body.workspace-mode.mobile-sidebar-open .sidebar-dev-row,
  body.workspace-mode.mobile-sidebar-open .catalog-dev-btn,
  body.workspace-mode.mobile-sidebar-open .sidebar-new-btn,
  body.workspace-mode.mobile-sidebar-open .sidebar-section,
  body.workspace-mode.mobile-sidebar-open .sidebar-user-card {
    display: revert !important;
  }

  body.workspace-mode.mobile-sidebar-open .debug-card {
    display: none !important;
  }

  body.workspace-mode.mobile-sidebar-open .sidebar-dev-row,
  body.workspace-mode.mobile-sidebar-open .sidebar-brand-row,
  body.workspace-mode.mobile-sidebar-open .section-head {
    display: flex !important;
  }

  body.landing-mode.mobile-sidebar-open .sidebar-collapse-btn,
  body.workspace-mode.mobile-sidebar-open .sidebar-collapse-btn {
    display: grid !important;
  }

  body.landing-mode .legacy-sidebar-collapse-btn,
  body.workspace-mode .legacy-sidebar-collapse-btn,
  body.landing-mode.mobile-sidebar-open .legacy-sidebar-collapse-btn,
  body.workspace-mode.mobile-sidebar-open .legacy-sidebar-collapse-btn {
    display: none !important;
  }
}

@media (max-width: 480px) {
  body.workspace-mode .mobile-workspace-bar {
    height: 50px;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    padding-left: 8px;
    padding-right: 8px;
  }

  body.workspace-mode .mobile-sidebar-menu-btn,
  body.workspace-mode .mobile-workspace-actions {
    width: 36px;
    height: 36px;
  }

  body.workspace-mode .content-shell {
    --mobile-viewer-height: clamp(220px, 45vh, 360px);
  }

  body.workspace-mode .chat-panel {
    padding-left: 8px;
    padding-right: 8px;
  }
}
.topology-face-card {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 18;
  width: min(320px, calc(100% - 36px));
  border: 1px solid rgba(91, 101, 113, 0.18);
  border-radius: 18px;
  background: rgba(255, 252, 245, 0.92);
  box-shadow: 0 18px 42px rgba(52, 39, 25, 0.18);
  backdrop-filter: blur(12px);
  color: #2d3440;
  padding: 14px 16px;
  font-size: 12px;
  display: none !important;
}

.topology-face-card[hidden] {
  display: none;
}

.topology-face-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: #7a6855;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topology-face-card-title button {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: rgba(45, 52, 64, 0.08);
  color: #4a5360;
  cursor: pointer;
}

.topology-face-card strong {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  color: #162130;
}

.topology-face-card dl {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 6px 10px;
  margin: 0;
}

.topology-face-card dt {
  color: #8a7968;
}

.topology-face-card dd {
  margin: 0;
  color: #27313f;
  word-break: break-all;
}

.topology-face-card p {
  margin: 10px 0 0;
  color: #7a6855;
}

.topology-face-error {
  color: #b54830 !important;
}
