:root {
  --bg: #f6f1e8;
  --surface: #fffaf3;
  --surface-soft: #f3ede3;
  --line: #ded5c8;
  --line-strong: #cfc3b3;
  --ink: #181714;
  --muted: #746f68;
  --muted-2: #9b9388;
  --primary: #111111;
  --primary-dark: #ff6900;
  --red: #d33b32;
  --green: #247a45;
  --blue: #b15f00;
  --accent: #ff6900;
  --shadow: 0 20px 60px rgba(18, 18, 20, 0.08);
}

* {
  box-sizing: border-box;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 105, 0, 0.28) transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: rgba(255, 105, 0, 0.24);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 105, 0, 0.42);
  border: 2px solid transparent;
  background-clip: padding-box;
}

html {
  min-height: 100%;
}

[v-cloak] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

body:has(.app-view) {
  height: 100dvh;
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.auth-view,
.app-view {
  min-height: 100vh;
}

.auth-view {
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-shell {
  width: min(960px, 100%);
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 22px;
  align-items: stretch;
}

.auth-visual,
.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.auth-visual {
  padding: 48px;
  display: grid;
  align-content: center;
}

.brand-mark,
.rail-logo {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 0;
  line-height: 0;
  text-decoration: none !important;
}

.rail-logo:hover,
.rail-logo:focus,
.rail-logo:active,
.rail-logo.router-link-active,
.rail-logo.router-link-exact-active {
  text-decoration: none !important;
}

.rail-logo::before,
.rail-logo::after {
  content: none !important;
}

.rail-logo-seal {
  width: 40px;
  height: 40px;
}

.auth-visual h1 {
  margin: 34px 0 12px;
  font-size: 44px;
  line-height: 1.04;
}

.auth-visual p {
  margin: 0;
  max-width: 430px;
  color: var(--muted);
  line-height: 1.8;
}

.auth-card {
  padding: 28px;
  display: grid;
  gap: 16px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 4px;
  background: var(--surface-soft);
  border-radius: 14px;
}

.auth-tab {
  border: 0;
  border-radius: 11px;
  padding: 10px;
  background: transparent;
  color: var(--muted);
}

.auth-tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 4px 18px rgba(18, 18, 20, 0.08);
}

label {
  display: grid;
  gap: 7px;
}

label span {
  color: var(--muted);
  font-size: 13px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  color: var(--ink);
  outline: none;
}

input {
  height: 42px;
  padding: 0 13px;
}

textarea {
  padding: 13px 14px;
  resize: none;
}

input:focus,
textarea:focus {
  border-color: rgba(255, 105, 0, 0.45);
  box-shadow: 0 0 0 4px rgba(255, 105, 0, 0.1);
}

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

.check-row input {
  width: 16px;
  height: 16px;
}

.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px;
  gap: 8px;
}

.code-button {
  min-height: 42px;
  padding: 0 10px;
  white-space: nowrap;
}

.landing-view {
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(245, 245, 242, 0.94) 46%, var(--bg) 100%),
    var(--bg);
}

.landing-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1180px, calc(100% - 40px));
  min-height: 72px;
  margin: 0 auto;
  padding: 14px 0;
  backdrop-filter: blur(14px);
}

.landing-brand,
.landing-nav nav,
.landing-nav-actions,
.landing-hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.landing-brand {
  color: var(--ink);
  text-decoration: none;
}

.landing-brand strong {
  font-size: 18px;
}

.landing-nav nav {
  flex-wrap: wrap;
  justify-content: center;
}

.landing-nav nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}

.landing-nav nav a:hover {
  color: var(--ink);
}

.landing-nav-actions {
  justify-content: flex-end;
}

.landing-hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: min(760px, calc(100vh - 72px));
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 72px 0 96px;
  isolation: isolate;
}

.landing-hero::before {
  content: "";
  position: absolute;
  inset: 38px -24px 54px;
  z-index: -2;
  border: 1px solid rgba(31, 37, 35, 0.08);
  border-radius: 34px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.68)),
    repeating-linear-gradient(90deg, rgba(31, 37, 35, 0.04) 0 1px, transparent 1px 92px),
    repeating-linear-gradient(0deg, rgba(31, 37, 35, 0.035) 0 1px, transparent 1px 74px);
  box-shadow: 0 32px 90px rgba(18, 18, 20, 0.08);
}

.landing-hero-copy {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 22px;
  max-width: 620px;
  padding: 28px 0 28px 34px;
}

.landing-kicker,
.section-heading span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.landing-hero h1 {
  margin: 0;
  font-size: clamp(52px, 7vw, 96px);
  line-height: 0.98;
}

.landing-hero p,
.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.landing-link-button {
  min-height: 42px;
  text-decoration: none;
}

.landing-stat-row,
.preview-grid,
.benchmark-highlight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.landing-stat-row {
  max-width: 540px;
}

.landing-stat-row div,
.benchmark-highlight-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  padding: 14px;
}

.landing-stat-row strong,
.benchmark-highlight-card strong {
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

.landing-stat-row span,
.benchmark-highlight-card span,
.benchmark-highlight-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.landing-product-panel {
  position: absolute;
  right: 26px;
  top: 110px;
  z-index: 1;
  display: grid;
  gap: 14px;
  width: min(480px, 45%);
  border: 1px solid rgba(31, 37, 35, 0.1);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.86);
  padding: 18px;
  box-shadow: 0 28px 80px rgba(18, 18, 20, 0.12);
}

.preview-topbar {
  display: flex;
  gap: 7px;
}

.preview-topbar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(31, 37, 35, 0.16);
}

.preview-card,
.preview-grid div,
.preview-timeline {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
  padding: 14px;
}

.preview-card.featured {
  background: #fff7ed;
}

.preview-card small,
.preview-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.preview-card strong {
  display: block;
  margin: 8px 0;
  font-size: 30px;
}

.preview-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.preview-grid div {
  display: grid;
  gap: 8px;
}

.preview-grid strong {
  font-size: 24px;
}

.preview-timeline {
  display: grid;
  gap: 10px;
}

.preview-timeline div {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.preview-timeline i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(36, 122, 69, 0.12);
}

.landing-section {
  display: grid;
  gap: 22px;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 70px 0;
}

.section-heading {
  display: grid;
  gap: 10px;
  max-width: 760px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.1;
}

.landing-view .model-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.landing-model-card {
  display: grid;
  gap: 22px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  padding: 24px;
  box-shadow: var(--shadow);
}

.landing-model-card.highlight {
  border-color: rgba(255, 105, 0, 0.28);
  background: #fff9f1;
}

.landing-model-card span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.landing-model-card h3 {
  margin: 8px 0 10px;
  font-size: 28px;
}

.landing-model-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.landing-model-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.landing-model-card dl div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.landing-model-card dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.landing-model-card dd {
  margin: 0;
  color: var(--ink);
  font-weight: 900;
}

.benchmark-section {
  padding-top: 52px;
}

.benchmark-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.benchmark-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.benchmark-table th,
.benchmark-table td {
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  text-align: left;
  white-space: nowrap;
}

.benchmark-table th {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 900;
}

.benchmark-table tr:last-child td {
  border-bottom: 0;
}

.benchmark-table tr.own td {
  background: rgba(255, 105, 0, 0.045);
}

.drawdown-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  color: #0f5b36;
  background: rgba(36, 122, 69, 0.12);
  padding: 0 9px;
  font-weight: 800;
}

.feedback-section {
  padding-bottom: 42px;
}

.feedback-marquee {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  padding: 16px;
}

.feedback-track {
  display: flex;
  gap: 14px;
  width: max-content;
  animation: feedback-scroll 34s linear infinite;
}

.feedback-marquee:hover .feedback-track {
  animation-play-state: paused;
}

.feedback-card {
  display: grid;
  gap: 8px;
  width: 320px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  padding: 18px;
}

.feedback-card p {
  margin: 0;
  color: var(--ink);
  line-height: 1.7;
}

.feedback-card strong {
  margin-top: 6px;
}

.feedback-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.landing-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  color: var(--muted);
}

.landing-footer strong {
  color: var(--ink);
}

.auth-modal {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  border: 0;
  background: transparent;
  padding: 0;
}

.auth-modal::backdrop {
  background: rgba(18, 18, 20, 0.34);
  backdrop-filter: blur(5px);
}

.auth-modal .auth-card {
  position: relative;
  gap: 11px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  border-radius: 22px;
  padding: 22px;
}

.auth-modal label {
  gap: 5px;
}

.auth-modal input {
  height: 38px;
}

.auth-modal .auth-tabs {
  padding: 3px;
}

.auth-modal .auth-tab {
  padding: 8px;
}

.auth-modal .primary-button,
.auth-modal .ghost-button,
.auth-modal .oauth-button,
.auth-modal .code-button {
  min-height: 38px;
}

.auth-modal .hint {
  font-size: 12px;
  line-height: 1.45;
}

.auth-modal .error-text:empty {
  display: none;
}

.auth-modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 36px;
}

.auth-modal-head div {
  display: grid;
  gap: 3px;
}

.auth-modal-head strong {
  font-size: 18px;
}

.auth-modal-head small {
  color: var(--muted);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 22px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--ink);
  background: #fff4e8;
}

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

.oauth-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
}

.oauth-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

@keyframes feedback-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(-50% - 7px));
  }
}

@media (max-width: 1040px) {
  .landing-product-panel {
    position: relative;
    top: auto;
    right: auto;
    width: 100%;
    max-width: 620px;
    margin: 24px 0 0 34px;
  }

  .landing-hero {
    align-items: start;
    padding-top: 50px;
  }
}

@media (max-width: 860px) {
  .landing-nav {
    width: min(100% - 24px, 1180px);
    align-items: stretch;
    flex-wrap: wrap;
  }

  .landing-nav nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
  }

  .landing-hero,
  .landing-section,
  .landing-footer {
    width: min(100% - 24px, 1180px);
  }

  .landing-hero {
    min-height: 0;
    padding: 34px 0 56px;
  }

  .landing-hero::before {
    inset: 16px 0 24px;
    border-radius: 24px;
  }

  .landing-hero-copy {
    padding: 20px;
  }

  .landing-product-panel {
    margin: 8px 20px 0;
    width: calc(100% - 40px);
  }

  .landing-view .model-card-grid,
  .benchmark-highlight-grid {
    grid-template-columns: 1fr;
  }

  .landing-stat-row {
    grid-template-columns: 1fr;
  }

  .landing-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 540px) {
  .landing-nav-actions {
    width: 100%;
  }

  .landing-nav-actions .ghost-button,
  .landing-nav-actions .primary-button,
  .landing-hero-actions .ghost-button,
  .landing-hero-actions .primary-button {
    flex: 1;
  }

  .landing-hero-actions,
  .oauth-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .landing-hero h1 {
    font-size: 46px;
  }

  .landing-hero p {
    font-size: 16px;
  }

  .landing-product-panel {
    margin: 0 12px;
    width: calc(100% - 24px);
    padding: 14px;
  }

  .preview-grid {
    grid-template-columns: 1fr;
  }

  .feedback-card {
    width: min(300px, calc(100vw - 68px));
  }

  .auth-modal .auth-card {
    padding: 20px;
  }

  .code-row {
    grid-template-columns: 1fr;
  }
}

.primary-button,
.ghost-button,
.icon-button,
.send-button,
.rail-button,
.pan-edge-toggle {
  border: 0;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

.icon-button,
.send-button,
.rail-logo,
.rail-button,
.session-action,
.attachment-remove,
.pan-edge-toggle {
  display: inline-grid;
  place-items: center;
  padding: 0;
  line-height: 0;
  text-align: center;
}

.ui-icon,
.handle-arrow {
  display: block;
  position: relative;
  width: 18px;
  height: 18px;
  color: currentColor;
  flex: 0 0 18px;
  pointer-events: none;
}

.ui-icon::before,
.ui-icon::after,
.handle-arrow::before {
  content: "";
  position: absolute;
  box-sizing: border-box;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.icon-menu::before {
  width: 15px;
  height: 12px;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  border-radius: 1px;
}

.icon-menu::after {
  width: 15px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.icon-close::before,
.icon-close::after,
.icon-plus::before,
.icon-plus::after {
  width: 15px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.icon-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.icon-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.icon-plus::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.icon-send::before {
  width: 18px;
  height: 18px;
  background: currentColor;
  clip-path: polygon(7% 51%, 94% 9%, 64% 91%, 51% 61%);
  transform: translate(-50%, -50%);
}

.icon-send::after {
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: var(--primary);
  transform: translate(-23%, -6%) rotate(-43deg);
}

.icon-collapse-left::before,
.icon-collapse-right::before {
  width: 10px;
  height: 10px;
  border-bottom: 2px solid currentColor;
  border-radius: 1px;
}

.icon-collapse-left::before {
  border-left: 2px solid currentColor;
  transform: translate(-36%, -50%) rotate(45deg);
}

.icon-collapse-right::before {
  border-right: 2px solid currentColor;
  transform: translate(-64%, -50%) rotate(-45deg);
}

.icon-collapse-left::after,
.icon-collapse-right::after {
  width: 12px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.icon-collapse-left::after {
  transform: translate(-34%, -50%);
}

.icon-collapse-right::after {
  transform: translate(-66%, -50%);
}

.icon-trash::before {
  width: 12px;
  height: 12px;
  top: 58%;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 3px 3px;
  background:
    linear-gradient(90deg, transparent 3px, currentColor 3px 4.5px, transparent 4.5px 7.5px, currentColor 7.5px 9px, transparent 9px);
}

.icon-trash::after {
  width: 15px;
  height: 7px;
  top: 25%;
  border-top: 2px solid currentColor;
  border-radius: 2px 2px 0 0;
  box-shadow: inset 0 2px 0 -1px currentColor;
}

.icon-archive::before {
  width: 16px;
  height: 12px;
  top: 56%;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.icon-archive::after {
  width: 8px;
  height: 2px;
  top: 48%;
  border-radius: 999px;
  background: currentColor;
}

.icon-restore::before {
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-left-color: transparent;
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(-32deg);
}

.icon-restore::after {
  width: 7px;
  height: 7px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
  border-radius: 1px;
  transform: translate(-85%, -73%) rotate(-18deg);
}

.icon-restore,
.icon-trash {
  background: currentColor;
  color: currentColor;
}

.icon-restore {
  -webkit-mask: url("data:image/svg+xml,%3Csvg%20viewBox%3D%270%200%2024%2024%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M3%2012a9%209%200%201%200%209-9%209.75%209.75%200%200%200-6.74%202.74L3%208%27/%3E%3Cpath%20d%3D%27M3%203v5h5%27/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg%20viewBox%3D%270%200%2024%2024%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M3%2012a9%209%200%201%200%209-9%209.75%209.75%200%200%200-6.74%202.74L3%208%27/%3E%3Cpath%20d%3D%27M3%203v5h5%27/%3E%3C/svg%3E") center / contain no-repeat;
}

.icon-trash {
  -webkit-mask: url("data:image/svg+xml,%3Csvg%20viewBox%3D%270%200%2024%2024%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M3%206h18%27/%3E%3Cpath%20d%3D%27M8%206V4a2%202%200%200%201%202-2h4a2%202%200%200%201%202%202v2%27/%3E%3Cpath%20d%3D%27M19%206l-1%2014a2%202%200%200%201-2%202H8a2%202%200%200%201-2-2L5%206%27/%3E%3Cpath%20d%3D%27M10%2011v6%27/%3E%3Cpath%20d%3D%27M14%2011v6%27/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg%20viewBox%3D%270%200%2024%2024%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272.2%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M3%206h18%27/%3E%3Cpath%20d%3D%27M8%206V4a2%202%200%200%201%202-2h4a2%202%200%200%201%202%202v2%27/%3E%3Cpath%20d%3D%27M19%206l-1%2014a2%202%200%200%201-2%202H8a2%202%200%200%201-2-2L5%206%27/%3E%3Cpath%20d%3D%27M10%2011v6%27/%3E%3Cpath%20d%3D%27M14%2011v6%27/%3E%3C/svg%3E") center / contain no-repeat;
}

.icon-restore::before,
.icon-restore::after,
.icon-trash::before,
.icon-trash::after {
  display: none;
}

.icon-settings::before {
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow:
    0 -6px 0 -4px currentColor,
    0 6px 0 -4px currentColor,
    6px 0 0 -4px currentColor,
    -6px 0 0 -4px currentColor,
    4px 4px 0 -4px currentColor,
    -4px -4px 0 -4px currentColor,
    4px -4px 0 -4px currentColor,
    -4px 4px 0 -4px currentColor;
}

.icon-settings::after {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.handle-arrow {
  width: 10px;
  height: 10px;
  transition: transform 0.2s ease;
}

.handle-arrow::before {
  width: 9px;
  height: 9px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  border-radius: 1px;
  transform: translate(-36%, -50%) rotate(45deg);
}

.pan-edge-toggle.expanded .handle-arrow {
  transform: rotate(180deg);
}

.primary-button,
.send-button {
  background: var(--primary);
  color: #fff;
  border-radius: 14px;
  font-weight: 700;
}

.primary-button {
  min-height: 42px;
  padding: 0 16px;
}

.primary-button.small,
.ghost-button.small {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 11px;
  font-size: 13px;
}

.primary-button:hover,
.send-button:hover {
  background: var(--primary-dark);
  box-shadow: 0 10px 24px rgba(255, 105, 0, 0.24);
}

.primary-button.danger {
  background: var(--red);
}

.primary-button.danger:hover {
  background: #b93232;
  box-shadow: 0 10px 24px rgba(230, 92, 92, 0.2);
}

.send-button:hover .icon-send::after {
  background: var(--primary-dark);
}

.primary-button:disabled,
.ghost-button:disabled,
.icon-button:disabled,
.send-button:disabled,
.rail-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

.ghost-button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
}

.ghost-button.subtle {
  border-color: rgba(34, 40, 38, 0.1);
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
}

.ghost-button.info {
  border-color: rgba(37, 99, 235, 0.22);
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
}

.ghost-button.warning {
  border-color: rgba(201, 130, 43, 0.26);
  background: rgba(201, 130, 43, 0.1);
  color: #8a5516;
}

.ghost-button.danger {
  border-color: rgba(230, 92, 92, 0.26);
  background: rgba(230, 92, 92, 0.08);
  color: var(--red);
}

.ghost-button.subtle:hover,
.ghost-button.info:hover,
.ghost-button.warning:hover,
.ghost-button.danger:hover {
  box-shadow: none;
  filter: brightness(0.98);
}

.loading-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.button-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-top-color: #fff;
  border-radius: 999px;
  animation: button-spin 0.72s linear infinite;
}

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

.hint,
.error-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}

.hint {
  color: var(--muted);
}

.error-text {
  color: var(--red);
  min-height: 20px;
}

.app-view {
  display: grid;
  grid-template-columns: minmax(300px, 364px) minmax(360px, 1fr) minmax(360px, 480px);
  gap: 12px;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  padding: 18px;
  transition: grid-template-columns 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.app-view.sidebar-collapsed {
  grid-template-columns: 64px minmax(360px, 1fr) minmax(360px, 480px);
}

.app-view.pan-collapsed {
  grid-template-columns: minmax(300px, 364px) minmax(360px, 1fr) 0;
}

.app-view.sidebar-collapsed.pan-collapsed {
  grid-template-columns: 64px minmax(360px, 1fr) 0;
}

.sidebar-shell,
.rail,
.drawer-panel,
.history-panel,
.chat-workspace,
.pan-panel {
  min-width: 0;
}

.drawer-panel {
  min-height: 0;
}

.sidebar-shell {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  height: 100%;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  transition: grid-template-columns 0.28s cubic-bezier(0.22, 1, 0.36, 1), background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.sidebar-shell.collapsed {
  grid-template-columns: 64px minmax(0, 0fr);
  background: var(--surface);
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.sidebar-shell.collapsed .history-panel {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-10px);
}

.sidebar-shell.collapsed .rail {
  border-right-color: transparent;
}

.rail {
  background: transparent;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-items: center;
  align-items: center;
  gap: 10px;
  padding: 12px 8px;
  transition: background 0.22s ease, border-color 0.22s ease;
}

.rail-logo {
  border: 0;
  flex: 0 0 40px;
  margin-bottom: 8px;
  padding: 0;
  background: transparent;
}

.rail-button {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--muted-2);
  font-size: 18px;
}

.rail-button:hover,
.rail-button.active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(18, 18, 20, 0.08);
}

.rail-button.bottom {
  margin-top: auto;
}

.rail-bottom-actions {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.chat-workspace,
.pan-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.history-panel {
  min-height: 0;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
  background: transparent;
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  transition: opacity 0.22s ease 0.06s, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0s;
}

.panel-header,
.chat-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-only {
  display: none;
}

.mobile-settings {
  display: none;
}

.panel-header.compact {
  align-items: start;
}

.eyebrow {
  display: block;
  color: var(--muted-2);
  font-size: 12px;
  letter-spacing: 0.08em;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 22px;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 15px;
}

.icon-button {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--ink);
}

.session-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow-y: auto;
  padding-right: 2px;
}

.session-item {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  background: var(--surface-soft);
  border-radius: 14px;
  padding: 10px 8px 10px 12px;
  text-align: left;
}

.session-item.active {
  border-color: rgba(255, 105, 0, 0.28);
  background: rgba(255, 105, 0, 0.07);
}

.session-main {
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  color: inherit;
}

.session-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 14px;
}

.session-date {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 12px;
}

.session-action {
  border: 0;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
}

.session-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.session-action:hover {
  background: #fff;
  color: var(--ink);
}

.session-action.danger:hover {
  color: var(--red);
}

.history-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--surface-soft);
  border-radius: 14px;
}

.history-tabs button {
  border: 0;
  border-radius: 10px;
  min-height: 34px;
  background: transparent;
  color: var(--muted);
}

.history-tabs button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 5px 18px rgba(18, 18, 20, 0.08);
}

.chat-workspace {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.chat-topbar {
  padding: 18px 22px 10px;
}

.chat-messages {
  min-height: 0;
  overflow-y: auto;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.welcome-empty {
  margin: auto;
  color: var(--muted);
  text-align: center;
}

.chat-msg {
  max-width: min(760px, 92%);
  border-radius: 18px;
  padding: 12px 15px;
  line-height: 1.7;
  font-size: 14px;
}

.chat-user {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 6px;
  white-space: pre-wrap;
}

.chat-ai {
  align-self: flex-start;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-bottom-left-radius: 6px;
}

.chat-ai:has(.chat-trace-panel) {
  width: min(760px, 92%);
}

.chat-md p,
.chat-md ul,
.chat-md ol,
.chat-md blockquote {
  margin-top: 7px;
  margin-bottom: 7px;
}

.chat-md h1,
.chat-md h2,
.chat-md h3 {
  margin: 14px 0 8px;
  font-size: 16px;
}

.chat-md table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.chat-md th,
.chat-md td {
  border: 1px solid var(--line);
  padding: 5px 7px;
}

.chat-md pre {
  overflow: auto;
  background: #f6f8fa;
  border-radius: 12px;
  padding: 12px;
}

.chat-answer-block:first-child :first-child {
  margin-top: 0;
}

.chat-answer-block:last-child :last-child {
  margin-bottom: 0;
}

.chat-activity-panel {
  margin-bottom: 10px;
  display: inline-flex;
  flex-wrap: wrap;
  width: min(100%, 520px);
  max-width: 100%;
  align-items: center;
  gap: 8px 12px;
  color: #239467;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.5;
}

.activity-pill {
  display: inline-flex;
  width: fit-content;
  min-width: 72px;
  max-width: 100%;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(84, 184, 126, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  padding: 7px 10px;
  color: var(--muted);
  font-size: 12px;
}

.activity-label {
  color: #18a166;
  overflow-wrap: anywhere;
}

.activity-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #54b87e;
  box-shadow: 0 0 0 4px rgba(84, 184, 126, 0.12);
  animation: activityPulse 1.12s ease-in-out infinite;
}

.activity-wave {
  position: relative;
  width: 22px;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(84, 184, 126, 0.12);
}

.activity-wave span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 45%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(84, 184, 126, 0), rgba(84, 184, 126, 0.78));
  animation: activityWave 1.05s ease-in-out infinite;
}

.activity-dots {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}

.activity-dots span {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(84, 184, 126, 0.7);
  animation: activityDots 1.2s ease-in-out infinite;
}

.activity-dots span:nth-child(2) {
  animation-delay: 0.14s;
}

.activity-dots span:nth-child(3) {
  animation-delay: 0.28s;
}

.chat-activity-panel.error {
  color: #b43d34;
}

.chat-activity-panel.error .activity-label {
  color: #b43d34;
}

.chat-activity-panel.error .activity-pill {
  border-color: rgba(230, 92, 92, 0.18);
}

.chat-activity-panel.error .activity-dot,
.chat-activity-panel.error .activity-dots span {
  background: #e65c5c;
}

.chat-activity-panel.error .activity-wave {
  background: rgba(230, 92, 92, 0.12);
}

.chat-activity-panel.error .activity-wave span {
  background: linear-gradient(90deg, rgba(230, 92, 92, 0), rgba(230, 92, 92, 0.78));
}

.chat-trace-panel {
  margin-bottom: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 105, 0, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
}

.chat-trace-toggle {
  width: 100%;
  min-height: 40px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 9px 12px;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.chat-trace-toggle:hover {
  background: rgba(255, 105, 0, 0.05);
}

.trace-title {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.trace-summary {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.trace-caret {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.18s ease;
}

.chat-trace-panel:not(.collapsed) .trace-caret {
  transform: rotate(225deg);
}

.chat-trace-steps {
  position: relative;
  display: grid;
  gap: 0;
  border-top: 1px solid rgba(255, 105, 0, 0.16);
  padding: 10px 12px 14px 10px;
}

.chat-trace-step {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  border-radius: 10px;
  padding: 7px 4px 7px 0;
  font-size: 12px;
}

.chat-trace-step::before,
.chat-trace-step::after {
  content: "";
  position: absolute;
  left: 10px;
  z-index: 0;
  width: 2px;
  border-radius: 999px;
  background: rgba(255, 105, 0, 0.14);
}

.chat-trace-step::before {
  top: 0;
  height: 10px;
}

.chat-trace-step::after {
  top: 23px;
  bottom: 0;
}

.chat-trace-step:first-child::before,
.chat-trace-step:last-child::after {
  display: none;
}

.chat-trace-step.is-running::before,
.chat-trace-step.is-running::after {
  background: rgba(255, 105, 0, 0.18);
}

.chat-trace-step.is-completed::before,
.chat-trace-step.is-completed::after {
  background: rgba(84, 184, 126, 0.18);
}

.chat-trace-step.is-error::before,
.chat-trace-step.is-error::after {
  background: rgba(230, 92, 92, 0.18);
}

.trace-dot {
  position: relative;
  z-index: 1;
  justify-self: center;
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.95);
  background: rgba(145, 151, 163, 0.7);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.78),
    0 0 0 5px rgba(145, 151, 163, 0.08),
    0 1px 4px rgba(31, 37, 35, 0.08);
}

.chat-trace-step.is-pending {
  opacity: 0.68;
}

.chat-trace-step.is-pending .trace-dot {
  background: #fff;
  border-color: rgba(145, 151, 163, 0.65);
  box-shadow: 0 0 0 3px rgba(145, 151, 163, 0.08);
}

.chat-trace-step.is-running .trace-dot {
  background: #54b87e;
  box-shadow:
    0 0 0 3px rgba(84, 184, 126, 0.14),
    0 0 0 6px rgba(255, 105, 0, 0.05);
  animation: tracePulse 1.15s ease-in-out infinite;
}

.chat-trace-step.is-completed .trace-dot {
  background: #54b87e;
  box-shadow:
    0 0 0 3px rgba(84, 184, 126, 0.12),
    0 1px 4px rgba(31, 37, 35, 0.08);
}

.chat-trace-step.is-error .trace-dot {
  background: #e65c5c;
  box-shadow:
    0 0 0 3px rgba(230, 92, 92, 0.12),
    0 1px 4px rgba(31, 37, 35, 0.08);
}

.trace-step-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.trace-step-copy strong {
  color: var(--ink);
  font-size: 12px;
}

.trace-step-copy span,
.trace-step-copy small {
  min-width: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.chat-usage-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  margin-top: 8px;
  color: rgba(31, 37, 35, 0.46);
  font-size: 11px;
  line-height: 1.4;
}

.usage-help {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  color: rgba(31, 37, 35, 0.52);
  background: rgba(31, 37, 35, 0.08);
  font-size: 10px;
  font-weight: 900;
  cursor: help;
}

.usage-help::after {
  content: attr(aria-label);
  position: absolute;
  left: calc(100% + 8px);
  bottom: -7px;
  z-index: 5;
  width: max-content;
  max-width: 240px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  white-space: normal;
  box-shadow: 0 12px 36px rgba(18, 18, 20, 0.12);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
}

.usage-help:hover::after,
.usage-help:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.session-delete-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

@keyframes tracePulse {
  0%,
  100% {
    box-shadow:
      0 0 0 3px rgba(84, 184, 126, 0.14),
      0 0 0 6px rgba(255, 105, 0, 0.04);
  }
  50% {
    box-shadow:
      0 0 0 4px rgba(84, 184, 126, 0.2),
      0 0 0 8px rgba(255, 105, 0, 0.06);
  }
}

@keyframes activityPulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(84, 184, 126, 0.12);
    transform: scale(0.94);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(84, 184, 126, 0.07);
    transform: scale(1);
  }
}

@keyframes activityWave {
  0% {
    transform: translateX(-100%);
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateX(230%);
    opacity: 0.45;
  }
}

@keyframes activityDots {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.composer-shell {
  padding: 0 22px 18px;
}

.composer {
  min-height: 58px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: end;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 8px;
  box-shadow: 0 12px 36px rgba(18, 18, 20, 0.1);
}

.composer textarea {
  border: 0;
  min-height: 40px;
  max-height: 160px;
  box-shadow: none;
}

.composer textarea:focus {
  box-shadow: none;
}

.send-button {
  width: 42px;
  height: 42px;
}

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.attachment-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 260px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 5px 8px;
  font-size: 12px;
}

.attachment-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-remove {
  border: 0;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
}

.pan-slot {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.pan-panel {
  display: block;
  gap: 0;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 18px 30px;
}

.pan-drawer {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  transition: opacity 0.24s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.app-view.pan-collapsed .pan-drawer {
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.pan-card {
  padding: 0;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.pan-card + .pan-card {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.board-card {
  display: grid;
  align-content: start;
}

.pan-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 14px 0;
}

.qimen-board {
  width: 100%;
  min-height: 396px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(132px, 1fr));
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.empty-board {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.palace {
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: clamp(7px, 1.4vw, 12px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 4px;
}

.palace:nth-child(3n) {
  border-right: 0;
}

.palace:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.palace-head,
.palace-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: clamp(10px, 1.2vw, 12px);
}

.marks {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mark {
  border-radius: 999px;
  background: var(--surface-soft);
  padding: 1px 5px;
  color: var(--muted);
}

.mark-horse {
  background: #fee2e2;
  color: var(--red);
}

.mark-empty {
  background: #fff2df;
  color: var(--blue);
}

.palace-main {
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px;
  align-items: start;
}

.triplet {
  display: grid;
  gap: 2px;
  font-weight: 800;
  line-height: 1.08;
}

.top-god {
  color: var(--red);
  font-size: clamp(15px, 1.8vw, 20px);
}

.star {
  color: var(--accent);
  font-size: clamp(15px, 1.8vw, 20px);
}

.bottom-god {
  color: var(--muted-2);
  font-size: clamp(12px, 1.4vw, 15px);
}

.gans {
  display: grid;
  justify-items: end;
  gap: 3px;
  font-weight: 800;
}

.gan-line {
  display: flex;
  gap: 3px;
}

.gan {
  min-width: 1.2em;
  text-align: center;
  color: var(--ink);
}

.door {
  color: var(--blue);
  font-weight: 900;
  font-size: clamp(14px, 1.7vw, 19px);
}

.info-grid {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.info-row strong {
  color: var(--ink);
  font-weight: 700;
}

.settings-dialog {
  border: 0;
  border-radius: 22px;
  padding: 0;
  box-shadow: var(--shadow);
  max-height: calc(100dvh - 36px);
  background: transparent;
}

.settings-dialog::backdrop {
  background: rgba(18, 18, 20, 0.32);
}

.settings-card {
  width: min(420px, 90vw);
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
}

.wide-dialog .settings-card {
  width: min(980px, 94vw);
}

.dialog-header,
.section-title-row,
.billing-actions-row,
.inline-form-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dialog-header,
.section-title-row {
  justify-content: space-between;
}

.dialog-header h2,
.section-title-row h3,
.account-form h3 {
  margin: 0;
}

.billing-summary-grid,
.plan-grid,
.account-profile {
  display: grid;
  gap: 10px;
}

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

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

.billing-summary-grid article,
.plan-card,
.account-profile div {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  padding: 14px;
}

.billing-summary-grid span,
.account-profile span,
.plan-card p {
  color: var(--muted);
  font-size: 12px;
}

.billing-summary-grid strong,
.account-profile strong,
.plan-card strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 20px;
  overflow-wrap: anywhere;
}

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

.plan-tier {
  width: fit-content;
  border-radius: 999px;
  background: rgba(255, 105, 0, 0.12);
  color: var(--primary-dark);
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.billing-actions-row {
  flex-wrap: wrap;
}

.billing-actions-row input,
.plan-card input,
.account-form input,
.inline-form-row input {
  min-width: 0;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  padding: 0 11px;
}

.billing-table {
  display: grid;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  padding: 8px;
}

.billing-table.compact {
  max-height: 170px;
}

.billing-row {
  display: grid;
  grid-template-columns: 150px 100px 80px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 10px;
  background: var(--surface);
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
}

.billing-table.compact .billing-row {
  grid-template-columns: 150px 100px 100px 1fr 34px;
}

.billing-row.header {
  color: var(--ink);
  font-weight: 800;
}

.billing-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.billing-row strong {
  color: var(--green);
}

.billing-row strong.negative {
  color: var(--red);
}

.account-form {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.inline-form-row {
  align-items: stretch;
}

.inline-form-row input {
  flex: 1;
}

.inline-error {
  border: 1px solid rgba(211, 59, 50, 0.2);
  border-radius: 12px;
  background: rgba(211, 59, 50, 0.08);
  color: var(--red);
  padding: 10px 12px;
  font-size: 13px;
}

.compact-tabs {
  width: 180px;
  grid-template-columns: repeat(3, 1fr);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.drawer-backdrop {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(17, 17, 20, 0.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.pan-edge-toggle {
  position: absolute;
  top: 50%;
  left: -28px;
  right: auto;
  z-index: 45;
  width: 28px;
  height: 76px;
  transform: translateY(-50%);
  border-radius: 999px 0 0 999px;
  border: 1px solid var(--line);
  border-right: 0;
  background: var(--surface);
  color: var(--muted);
  box-shadow: -10px 12px 24px rgba(18, 18, 20, 0.06);
  transition: right 0.28s cubic-bezier(0.22, 1, 0.36, 1), transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

.pan-edge-toggle::after {
  content: "";
  position: absolute;
  top: 1px;
  right: -1px;
  bottom: 1px;
  width: 2px;
  background: inherit;
  pointer-events: none;
}

.pan-edge-toggle:hover {
  border-color: rgba(255, 105, 0, 0.24);
  background: #fff7ed;
  color: var(--primary);
  transform: translateY(-50%);
  box-shadow: -12px 16px 28px rgba(255, 105, 0, 0.14);
}

.app-view.pan-collapsed .pan-edge-toggle {
  left: auto;
  right: -18px;
}

@keyframes panelFadeIn {
  from {
    opacity: 0;
    transform: translateX(-6px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 1180px) {
  .app-view {
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr) minmax(320px, 380px);
  }

  .app-view.sidebar-collapsed {
    grid-template-columns: 64px minmax(0, 1fr) minmax(320px, 380px);
  }

  .app-view.pan-collapsed {
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr) 0;
  }

  .app-view.sidebar-collapsed.pan-collapsed {
    grid-template-columns: 64px minmax(0, 1fr) 0;
  }

  .pan-panel {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
}

@media (max-width: 820px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    padding: 28px;
  }

  .auth-visual h1 {
    font-size: 34px;
  }

  .app-view {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr);
    grid-auto-rows: 0;
    padding: 10px;
  }

  .app-view.sidebar-collapsed,
  .app-view.pan-collapsed,
  .app-view.sidebar-collapsed.pan-collapsed {
    grid-template-columns: 1fr;
  }

  .app-view:not(.pan-collapsed) .pan-edge-toggle {
    right: 0;
  }

  .pan-slot {
    position: fixed;
    inset: 0;
    z-index: 45;
    height: 0;
    min-height: 0;
    pointer-events: none;
  }

  .sidebar-shell {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    width: min(88vw, 360px);
    min-height: 100vh;
    grid-template-columns: 1fr;
    border-radius: 0 22px 22px 0;
    transform: translateX(-105%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .rail {
    display: none;
  }

  .rail-button.bottom {
    margin-top: auto;
  }

  .rail-bottom-actions {
    margin-top: auto;
  }

  .sidebar-shell.open {
    width: min(88vw, 380px);
    grid-template-columns: 1fr;
    transform: translateX(0);
  }

  .sidebar-shell.collapsed .history-panel,
  .sidebar-shell:not(.open) .history-panel {
    display: flex;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }

  .history-panel {
    height: 100%;
    max-height: none;
  }

  .chat-workspace {
    height: 100%;
    min-height: 0;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    grid-row: 1;
  }

  .mobile-workspace-nav {
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 72px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 10px 12px;
  }

  .mobile-workspace-nav .rail-logo {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    margin: 0;
  }

  .mobile-workspace-nav .rail-logo-seal {
    width: 48px;
    height: 48px;
  }

  .mobile-workspace-nav .rail-bottom-actions {
    display: flex;
    flex-direction: row;
    gap: 8px;
    margin: 0 0 0 auto;
  }

  .mobile-workspace-nav .rail-button {
    width: 48px;
    min-width: 48px;
    height: 48px;
    border-radius: 18px;
  }

  .chat-topbar {
    align-items: center;
    justify-content: flex-start;
    flex-direction: row;
    padding: 10px 18px 4px;
  }

  .chat-topbar .mobile-menu-button {
    display: none;
  }

  .mobile-only {
    display: flex;
  }

  .drawer-panel {
    position: fixed;
    top: 0;
    bottom: 0;
    z-index: 40;
    width: min(88vw, 360px);
    min-height: 100vh;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .sidebar-shell.history-drawer {
    width: min(88vw, 360px);
  }

  .sidebar-shell.history-drawer.open {
    width: min(88vw, 360px);
  }

  .history-drawer {
    left: 0;
    transform: translateX(-105%);
  }

  .history-drawer.open {
    transform: none;
  }

  .pan-drawer {
    right: 0;
    grid-column: auto;
    width: min(94vw, 430px);
    transform: translateX(105%);
    overflow-y: auto;
    padding: 10px 20px 24px 10px;
  }

  .app-view.pan-collapsed .pan-drawer {
    opacity: 1;
    overflow-y: auto;
    pointer-events: auto;
  }

  .pan-drawer.open {
    transform: translateX(0);
    pointer-events: auto;
  }

  body:has(.pan-drawer.open) .pan-edge-toggle {
    right: min(94vw, 430px);
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-50%);
    border-color: var(--line);
    background: var(--surface);
    color: var(--muted);
    box-shadow: -10px 12px 24px rgba(18, 18, 20, 0.08);
  }

  body:has(.pan-drawer.open) .pan-edge-toggle:hover {
    border-color: rgba(255, 105, 0, 0.24);
    background: #fff7ed;
    color: var(--primary);
    transform: translateY(-50%);
    box-shadow: -12px 16px 28px rgba(255, 105, 0, 0.14);
  }

  .pan-panel {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    padding-bottom: 24px;
  }

  .qimen-board {
    aspect-ratio: auto;
    min-height: 0;
    grid-template-rows: repeat(3, minmax(112px, auto));
    max-width: 520px;
    margin: 0 auto;
  }

  .drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(17, 17, 20, 0.32);
  }

  .pan-edge-toggle {
    position: fixed;
    left: auto;
    right: 0;
    pointer-events: auto;
    width: 18px;
    height: 78px;
    border-radius: 999px 0 0 999px;
    padding: 0;
    font-size: 14px;
  }

  .mobile-settings {
    display: grid;
    gap: 8px;
    margin-top: auto;
  }

  .billing-summary-grid,
  .plan-grid {
    grid-template-columns: 1fr;
  }

  .billing-row,
  .billing-table.compact .billing-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .billing-row.header {
    display: none;
  }

  .billing-actions-row,
  .inline-form-row,
  .section-title-row {
    align-items: stretch;
    flex-direction: column;
  }

  .compact-tabs {
    width: 100%;
  }
}

@media (max-width: 460px) {
  .auth-view {
    padding: 10px;
  }

  .auth-card,
  .auth-visual,
  .history-panel,
  .chat-workspace,
  .pan-card {
    border-radius: 18px;
  }

  .chat-messages {
    padding: 14px;
  }

  .composer-shell {
    padding: 0 12px 14px;
  }

  .palace {
    padding: 6px;
    gap: 3px;
  }

  .top-god,
  .star {
    font-size: 13px;
  }

  .bottom-god,
  .gans,
  .palace-head,
  .palace-foot {
    font-size: 11px;
  }

  .door {
    font-size: 12px;
  }

  .triplet {
    gap: 1px;
    line-height: 1.05;
  }

  .palace-main {
    gap: 2px;
  }

  .mark {
    padding: 0 4px;
  }
}

.admin-view {
  min-height: 100dvh;
  background: #f4f2ee;
  color: #1f2523;
  padding: 24px;
  overflow: auto;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1480px;
  margin: 0 auto 18px;
}

.admin-header h1 {
  margin: 4px 0 0;
  font-size: 28px;
}

.admin-error {
  max-width: 1480px;
  margin: 0 auto 16px;
  padding: 12px 14px;
  border: 1px solid rgba(194, 57, 52, 0.2);
  border-radius: 8px;
  background: #fff4f2;
  color: #9d2f2a;
}

.admin-grid,
.admin-layout {
  max-width: 1480px;
  margin: 0 auto;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.admin-stat,
.admin-panel {
  border: 1px solid rgba(34, 40, 38, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 40px rgba(31, 37, 35, 0.08);
}

.admin-stat {
  padding: 16px;
}

.admin-stat span,
.admin-info-grid span {
  display: block;
  color: #68706c;
  font-size: 12px;
}

.admin-stat strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.admin-panel {
  padding: 16px;
  min-width: 0;
}

.chart-panel {
  max-width: 1480px;
  margin: 0 auto 14px;
}

.chart-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background: #eeece7;
}

.chart-tabs button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 7px 10px;
  color: #565e5a;
  cursor: pointer;
}

.chart-tabs button.active {
  background: #1f2523;
  color: #fff;
}

.admin-chart {
  width: 100%;
  height: 340px;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 14px;
}

.admin-search,
.quick-create {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.admin-search {
  grid-template-columns: minmax(0, 1fr) auto;
}

.quick-create input,
.admin-search input {
  width: 100%;
  border: 1px solid rgba(34, 40, 38, 0.14);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.admin-user-list {
  display: grid;
  gap: 8px;
  max-height: 560px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(31, 37, 35, 0.28) transparent;
}

.admin-user-list::-webkit-scrollbar,
.admin-history::-webkit-scrollbar {
  width: 8px;
}

.admin-user-list::-webkit-scrollbar-thumb,
.admin-history::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(31, 37, 35, 0.24);
}

.admin-user-item {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 1px solid rgba(34, 40, 38, 0.1);
  border-radius: 8px;
  background: #fbfaf7;
  padding: 11px;
  text-align: left;
  cursor: pointer;
}

.admin-user-item.active,
.admin-user-item:hover {
  border-color: rgba(46, 102, 92, 0.45);
  background: #eef6f2;
}

.admin-user-item small,
.history-row span,
.message-row span {
  color: #78817d;
  font-size: 12px;
}

.admin-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.admin-info-grid div {
  border-radius: 8px;
  background: #f7f5f1;
  padding: 12px;
}

.admin-info-grid strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.admin-history {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
  max-height: 620px;
  overflow: auto;
}

.history-row,
.message-row {
  border-top: 1px solid rgba(34, 40, 38, 0.1);
  padding: 10px 0;
}

.message-row p {
  margin: 6px 0;
  color: #313735;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.admin-empty {
  color: #78817d;
  padding: 16px 0;
}

.admin-empty.large {
  display: grid;
  min-height: 340px;
  place-items: center;
}

@media (max-width: 980px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-layout,
  .admin-history,
  .admin-info-grid {
    grid-template-columns: 1fr;
  }
}

/* Lovart-inspired public landing refresh */
body:has(.landing-view) {
  background: #100f09;
}

.landing-view {
  --landing-ink: #f7f3e8;
  --landing-muted: rgba(247, 243, 232, 0.64);
  --landing-line: rgba(247, 243, 232, 0.12);
  --landing-card: rgba(255, 255, 255, 0.08);
  --landing-card-strong: rgba(255, 255, 255, 0.14);
  color: var(--landing-ink);
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 105, 0, 0.32), transparent 32rem),
    radial-gradient(circle at 10% 42%, rgba(36, 122, 69, 0.16), transparent 24rem),
    linear-gradient(180deg, #100f09 0%, #15140e 48%, #100f09 100%);
}

.landing-announcement {
  display: grid;
  place-items: center;
  min-height: 48px;
  padding: 10px 18px;
  color: #fff;
  background: linear-gradient(90deg, #111111, #ff6900);
  font-weight: 900;
  text-align: center;
}

.landing-nav {
  top: 0;
  min-height: 74px;
  width: min(1180px, calc(100% - 56px));
  color: var(--landing-ink);
}

.landing-brand,
.landing-brand strong,
.landing-nav nav a {
  color: var(--landing-ink);
}

.landing-brand .brand-mark {
  width: 38px;
  height: 38px;
}

.landing-nav nav {
  gap: 38px;
}

.landing-nav nav a {
  opacity: 0.72;
}

.landing-nav nav a:hover {
  color: #fff;
  opacity: 1;
}

.landing-nav-actions .ghost-button,
.landing-nav-actions .primary-button,
.landing-hero-actions .ghost-button,
.landing-hero-actions .primary-button,
.landing-footer .ghost-button {
  min-height: 44px;
  border-radius: 999px;
  padding: 0 20px;
}

.landing-nav-actions .ghost-button,
.landing-hero-actions .ghost-button,
.landing-footer .ghost-button {
  border-color: var(--landing-line);
  color: var(--landing-ink);
  background: rgba(255, 255, 255, 0.06);
}

.landing-nav-actions .primary-button,
.landing-hero-actions .primary-button {
  color: #100f09;
  background: var(--landing-ink);
}

.landing-nav-actions .primary-button:hover,
.landing-hero-actions .primary-button:hover {
  color: #100f09;
  background: #fff;
  box-shadow: 0 18px 42px rgba(255, 255, 255, 0.18);
}

.landing-hero {
  align-items: start;
  width: min(1180px, calc(100% - 56px));
  min-height: auto;
  padding: 74px 0 88px;
}

.landing-hero::before {
  inset: 116px 6% auto;
  height: 260px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  filter: blur(70px);
  box-shadow: none;
  animation: landing-glow-breathe 7s ease-in-out infinite;
}

.landing-hero::after {
  content: "";
  position: absolute;
  inset: 28px 0 auto;
  z-index: -1;
  height: 520px;
  opacity: 0.3;
  background:
    linear-gradient(90deg, transparent 0 47%, rgba(255, 255, 255, 0.18) 48% 52%, transparent 53%),
    repeating-linear-gradient(90deg, transparent 0 86px, rgba(255, 255, 255, 0.06) 87px 88px),
    repeating-linear-gradient(0deg, transparent 0 64px, rgba(255, 255, 255, 0.05) 65px 66px);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent);
}

.landing-hero-copy {
  justify-items: center;
  max-width: 900px;
  margin: 0 auto;
  padding: 0;
  text-align: center;
}

.landing-kicker,
.section-heading span {
  color: rgba(247, 243, 232, 0.72);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.landing-hero h1 {
  max-width: 980px;
  color: var(--landing-ink);
  font-family: "Times New Roman", "Noto Serif SC", serif;
  font-size: clamp(64px, 9vw, 128px);
  font-weight: 500;
  line-height: 0.92;
  text-wrap: balance;
}

.landing-hero p,
.section-heading p {
  max-width: 760px;
  color: var(--landing-muted);
  font-size: 18px;
}

.landing-hero-actions {
  justify-content: center;
}

.landing-stat-row {
  width: min(760px, 100%);
  max-width: none;
  margin-top: 6px;
}

.landing-stat-row div,
.benchmark-highlight-card {
  border-color: var(--landing-line);
  background: var(--landing-card);
  backdrop-filter: blur(14px);
}

.landing-stat-row strong,
.benchmark-highlight-card strong {
  color: var(--landing-ink);
}

.landing-stat-row span,
.benchmark-highlight-card span,
.benchmark-highlight-card small {
  color: var(--landing-muted);
}

.landing-product-panel {
  position: relative;
  top: auto;
  right: auto;
  width: min(1080px, 100%);
  margin: 58px auto 0;
  border-color: rgba(247, 243, 232, 0.16);
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(229, 226, 199, 0.38), rgba(77, 96, 83, 0.22)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 22px);
  padding: clamp(18px, 3vw, 34px);
  box-shadow: 0 34px 110px rgba(0, 0, 0, 0.36);
  animation: landing-panel-float 6.5s ease-in-out infinite;
}

.landing-product-panel::before {
  content: "";
  position: absolute;
  inset: clamp(52px, 6vw, 82px) clamp(14px, 4vw, 52px) clamp(18px, 3vw, 42px);
  z-index: 0;
  border: 1px solid rgba(247, 243, 232, 0.12);
  border-radius: 22px;
  background: rgba(16, 15, 9, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

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

.preview-topbar {
  padding: 0 0 8px;
}

.preview-topbar span {
  background: rgba(247, 243, 232, 0.32);
}

.preview-card,
.preview-grid div,
.preview-timeline {
  border-color: rgba(247, 243, 232, 0.12);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px);
}

.preview-card.featured {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(255, 105, 0, 0.34), rgba(255, 255, 255, 0.07)),
    rgba(255, 255, 255, 0.06);
}

.preview-card.featured::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  transform: translateX(-120%);
  animation: landing-scan 4.8s ease-in-out infinite;
}

.preview-card small,
.preview-card p,
.preview-grid span,
.preview-timeline div {
  color: var(--landing-muted);
}

.preview-card strong,
.preview-grid strong {
  color: var(--landing-ink);
}

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

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

.preview-timeline i {
  background: #5ee082;
  box-shadow: 0 0 0 4px rgba(94, 224, 130, 0.14), 0 0 18px rgba(94, 224, 130, 0.4);
  animation: landing-dot-pulse 1.8s ease-in-out infinite;
}

.landing-section {
  width: min(1180px, calc(100% - 56px));
  padding: 82px 0;
}

.section-heading {
  justify-items: center;
  max-width: none;
  text-align: center;
}

.section-heading h2 {
  color: var(--landing-ink);
  font-family: "Times New Roman", "Noto Serif SC", serif;
  font-weight: 500;
}

.landing-model-card,
.benchmark-table-wrap,
.feedback-marquee {
  border-color: var(--landing-line);
  background: var(--landing-card);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(16px);
}

.landing-model-card {
  transition: transform 0.28s ease, border-color 0.28s ease, background 0.28s ease;
}

.landing-model-card:hover {
  border-color: rgba(247, 243, 232, 0.3);
  background: rgba(255, 255, 255, 0.11);
  transform: translateY(-6px);
}

.landing-model-card.highlight {
  border-color: rgba(154, 105, 255, 0.42);
  background: rgba(255, 105, 0, 0.2);
}

.landing-model-card h3,
.landing-model-card dd {
  color: var(--landing-ink);
}

.landing-model-card p,
.landing-model-card dt {
  color: var(--landing-muted);
}

.landing-model-card dl div {
  border-top-color: var(--landing-line);
}

.benchmark-table {
  color: var(--landing-ink);
}

.benchmark-table th {
  color: var(--landing-muted);
  background: rgba(255, 255, 255, 0.08);
}

.benchmark-table th,
.benchmark-table td {
  border-bottom-color: var(--landing-line);
}

.benchmark-table tr.own td {
  background: rgba(154, 105, 255, 0.12);
}

.drawdown-pill {
  color: #c8f6d8;
  background: rgba(94, 224, 130, 0.16);
}

.feedback-marquee {
  background: rgba(255, 255, 255, 0.06);
}

.feedback-card {
  border-color: var(--landing-line);
  background: rgba(255, 255, 255, 0.1);
}

.feedback-card p,
.feedback-card strong {
  color: var(--landing-ink);
}

.feedback-card span {
  color: var(--landing-muted);
}

.landing-footer {
  width: min(1180px, calc(100% - 56px));
  border-top-color: var(--landing-line);
  color: var(--landing-muted);
}

.landing-footer strong {
  color: var(--landing-ink);
}

@keyframes landing-panel-float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes landing-glow-breathe {
  0%, 100% {
    opacity: 0.68;
    transform: scale(0.98);
  }
  50% {
    opacity: 1;
    transform: scale(1.04);
  }
}

@keyframes landing-scan {
  0%, 45% {
    transform: translateX(-120%);
  }
  75%, 100% {
    transform: translateX(120%);
  }
}

@keyframes landing-dot-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.18);
  }
}

@media (max-width: 1040px) {
  .landing-product-panel {
    margin: 42px auto 0;
  }

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

@media (max-width: 860px) {
  .landing-announcement {
    font-size: 13px;
  }

  .landing-nav,
  .landing-hero,
  .landing-section,
  .landing-footer {
    width: min(100% - 24px, 1180px);
  }

  .landing-nav nav {
    gap: 18px;
  }

  .landing-hero {
    padding: 48px 0 56px;
  }

  .landing-hero-copy {
    padding: 0;
  }

  .landing-hero h1 {
    font-size: clamp(54px, 18vw, 84px);
  }

  .landing-stat-row,
  .preview-grid,
  .preview-timeline {
    grid-template-columns: 1fr;
  }

  .landing-product-panel {
    width: 100%;
    margin: 36px auto 0;
  }

  .landing-product-panel::before {
    inset: 48px 10px 10px;
  }

  .landing-view .model-card-grid,
  .benchmark-highlight-grid {
    grid-template-columns: 1fr;
  }
}

/* Scroll-linked landing motion */
.landing-view {
  --scroll-progress: 0;
  --hero-copy-y: 0px;
  --hero-copy-opacity: 1;
  --panel-y: 0px;
  --panel-scale: 1;
  --panel-tilt: 0deg;
  --grid-shift: 0px;
  --grid-y: 0px;
  --glow-left-x: 16%;
  --glow-right-y: 22%;
  position: relative;
  isolation: isolate;
  background-position:
    50% calc(18% + var(--grid-shift)),
    10% calc(42% - var(--grid-shift)),
    0 0;
}

.landing-view::before,
.landing-view::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.landing-view::before {
  opacity: 0.28;
  background:
    linear-gradient(115deg, transparent 0 34%, rgba(247, 243, 232, 0.08) 35% 36%, transparent 37%),
    repeating-linear-gradient(90deg, transparent 0 118px, rgba(247, 243, 232, 0.045) 119px 120px);
  transform: translateY(var(--grid-y));
}

.landing-view::after {
  opacity: 0.24;
  background:
    radial-gradient(circle at var(--glow-left-x) 18%, rgba(247, 243, 232, 0.2), transparent 12rem),
    radial-gradient(circle at 74% var(--glow-right-y), rgba(154, 105, 255, 0.22), transparent 18rem);
  filter: blur(8px);
}

.landing-motion-ready .reveal-block {
  opacity: 0;
  filter: blur(14px);
  transform: translateY(54px) scale(0.985);
  transition:
    opacity 0.84s cubic-bezier(0.19, 1, 0.22, 1),
    filter 0.84s cubic-bezier(0.19, 1, 0.22, 1),
    transform 0.84s cubic-bezier(0.19, 1, 0.22, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

.landing-motion-ready .reveal-block.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0) scale(1);
}

.landing-motion-ready .landing-hero-copy.is-visible {
  opacity: var(--hero-copy-opacity);
  transform: translateY(var(--hero-copy-y));
}

.landing-announcement span {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.landing-announcement span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.16);
  animation: landing-announcement-pulse 1.9s ease-in-out infinite;
}

.landing-product-panel {
  overflow: hidden;
  transform-style: preserve-3d;
  perspective: 1200px;
  animation:
    landing-panel-materialize 0.9s cubic-bezier(0.19, 1, 0.22, 1) both,
    landing-panel-float 7.2s ease-in-out 0.9s infinite;
}

.preview-orbit {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.preview-orbit span {
  position: absolute;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(247, 243, 232, 0.14);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(247, 243, 232, 0.12), transparent 62%);
  filter: blur(0.2px);
  animation: landing-orbit-drift 10s ease-in-out infinite;
}

.preview-orbit span:nth-child(1) {
  top: 16%;
  left: 7%;
}

.preview-orbit span:nth-child(2) {
  right: 10%;
  bottom: 12%;
  width: 128px;
  height: 128px;
  animation-delay: -3s;
}

.preview-orbit span:nth-child(3) {
  right: 31%;
  top: 40%;
  width: 92px;
  height: 92px;
  animation-delay: -6s;
}

.preview-floating-note {
  position: absolute;
  z-index: 2;
  display: grid;
  gap: 2px;
  min-width: 118px;
  border: 1px solid rgba(247, 243, 232, 0.18);
  border-radius: 18px;
  background: rgba(16, 15, 9, 0.72);
  padding: 12px 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
  animation: landing-note-float 5.4s ease-in-out infinite;
}

.preview-floating-note span {
  color: rgba(247, 243, 232, 0.58);
  font-size: 11px;
  font-weight: 800;
}

.preview-floating-note strong {
  color: var(--landing-ink);
  font-size: 18px;
}

.preview-floating-note.note-pan {
  top: 76px;
  right: clamp(16px, 4vw, 58px);
}

.preview-floating-note.note-risk {
  left: clamp(16px, 4vw, 58px);
  bottom: 36px;
  animation-delay: -2.4s;
}

.preview-card.featured,
.preview-grid div,
.preview-timeline {
  transform: translateZ(18px);
}

.preview-grid div {
  position: relative;
  overflow: hidden;
  animation: landing-metric-bob 6.2s ease-in-out infinite;
}

.preview-grid div:nth-child(2) {
  animation-delay: -1.2s;
}

.preview-grid div:nth-child(3) {
  animation-delay: -2.4s;
}

.preview-grid div:nth-child(4) {
  animation-delay: -3.6s;
}

.preview-grid div::after {
  content: "";
  position: absolute;
  inset: auto 12px 12px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(94, 224, 130, 0.92), rgba(247, 243, 232, 0.2));
  transform-origin: left center;
  animation: landing-meter-fill 3.8s ease-in-out infinite;
}

.preview-timeline {
  position: relative;
  overflow: hidden;
}

.preview-timeline::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(94, 224, 130, 0.42), transparent);
  transform: translateY(-50%);
}

.preview-timeline div {
  position: relative;
  z-index: 1;
}

.preview-timeline div:nth-child(2) i {
  animation-delay: -0.55s;
}

.preview-timeline div:nth-child(3) i {
  animation-delay: -1.1s;
}

.landing-model-card,
.benchmark-highlight-card,
.feedback-card {
  position: relative;
  overflow: hidden;
}

.landing-model-card::before,
.benchmark-highlight-card::before,
.feedback-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(115deg, transparent, rgba(247, 243, 232, 0.12), transparent);
  transform: translateX(-120%);
  transition: opacity 0.28s ease;
}

.landing-model-card:hover::before,
.benchmark-highlight-card:hover::before,
.feedback-card:hover::before {
  opacity: 1;
  animation: landing-card-glint 1.15s ease;
}

.benchmark-table-wrap.is-visible .benchmark-table tbody tr {
  animation: landing-row-rise 0.62s cubic-bezier(0.19, 1, 0.22, 1) both;
}

.benchmark-table-wrap.is-visible .benchmark-table tbody tr:nth-child(1) {
  animation-delay: 120ms;
}

.benchmark-table-wrap.is-visible .benchmark-table tbody tr:nth-child(2) {
  animation-delay: 190ms;
}

.benchmark-table-wrap.is-visible .benchmark-table tbody tr:nth-child(3) {
  animation-delay: 260ms;
}

.benchmark-table-wrap.is-visible .benchmark-table tbody tr:nth-child(4) {
  animation-delay: 330ms;
}

.benchmark-table-wrap.is-visible .benchmark-table tbody tr:nth-child(5) {
  animation-delay: 400ms;
}

@keyframes landing-panel-float {
  0%, 100% {
    transform: translate3d(0, var(--panel-y), 0) scale(var(--panel-scale)) rotateX(var(--panel-tilt));
  }
  50% {
    transform: translate3d(0, calc(var(--panel-y) - 12px), 0) scale(var(--panel-scale)) rotateX(var(--panel-tilt));
  }
}

@keyframes landing-panel-materialize {
  from {
    opacity: 0;
    clip-path: inset(14% 10% round 30px);
    filter: blur(18px);
  }
  to {
    opacity: 1;
    clip-path: inset(0 round 30px);
    filter: blur(0);
  }
}

@keyframes landing-announcement-pulse {
  0%, 100% {
    transform: scale(0.9);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.16);
    opacity: 1;
  }
}

@keyframes landing-orbit-drift {
  0%, 100% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.5;
  }
  50% {
    transform: translate3d(22px, -18px, 0) scale(1.08);
    opacity: 0.82;
  }
}

@keyframes landing-note-float {
  0%, 100% {
    transform: translate3d(0, 0, 36px);
  }
  50% {
    transform: translate3d(0, -10px, 36px);
  }
}

@keyframes landing-metric-bob {
  0%, 100% {
    transform: translateZ(18px) translateY(0);
  }
  50% {
    transform: translateZ(18px) translateY(-7px);
  }
}

@keyframes landing-meter-fill {
  0%, 100% {
    transform: scaleX(0.42);
    opacity: 0.58;
  }
  50% {
    transform: scaleX(0.92);
    opacity: 1;
  }
}

@keyframes landing-card-glint {
  from {
    transform: translateX(-120%);
  }
  to {
    transform: translateX(120%);
  }
}

@keyframes landing-row-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1040px) {
  .preview-floating-note {
    display: none;
  }
}

@media (max-width: 860px) {
  .landing-motion-ready .reveal-block,
  .landing-motion-ready .reveal-block.is-visible {
    transform: translateY(34px) scale(0.99);
  }

  .landing-motion-ready .reveal-block.is-visible {
    transform: translateY(0) scale(1);
  }

  .landing-motion-ready .landing-hero-copy.is-visible {
    transform: translateY(0);
  }

  .preview-orbit {
    display: block;
    opacity: 0.55;
  }

  .preview-grid div::after {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-view::before,
  .landing-view::after,
  .landing-announcement span::before,
  .landing-product-panel,
  .preview-orbit span,
  .preview-floating-note,
  .preview-card.featured::after,
  .preview-grid div,
  .preview-grid div::after,
  .preview-timeline i,
  .feedback-track {
    animation: none !important;
  }

  .landing-motion-ready .reveal-block,
  .landing-motion-ready .reveal-block.is-visible,
  .landing-motion-ready .landing-hero-copy.is-visible {
    opacity: 1;
    filter: none;
    transform: none;
    transition: none;
  }
}

/* Legal and footer refinement */
.landing-footer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(18px, 3vw, 38px);
}

.landing-footer > strong {
  white-space: nowrap;
}

.landing-footer > span {
  min-width: 0;
  line-height: 1.75;
}

.landing-footer-actions {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  justify-content: flex-end;
  white-space: nowrap;
}

.auth-modal .legal-consent-group {
  gap: 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 2px 0 4px;
}

.auth-modal .check-row {
  align-items: center;
  gap: 7px;
  min-height: 24px;
  color: rgba(24, 23, 20, 0.62);
  font-size: 12.5px;
  line-height: 1.35;
}

.auth-modal .check-row input[type='checkbox'] {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin: 0;
  padding: 0;
  border-radius: 4px;
  accent-color: #111111;
  box-shadow: none;
}

.auth-modal .check-row input[type='checkbox']:focus-visible {
  outline: 2px solid rgba(255, 105, 0, 0.36);
  outline-offset: 2px;
}

.auth-modal .legal-check-row {
  align-items: center;
  gap: 7px;
  min-height: 24px;
  color: rgba(24, 23, 20, 0.62);
  font-size: 12.5px;
  line-height: 1.35;
}

.auth-modal .legal-check-row input {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #111111;
}

.auth-modal .legal-check-row span {
  min-width: 0;
}

.auth-modal .legal-check-row button {
  color: #a84d08;
  font-weight: 800;
}

@media (max-width: 720px) {
  .landing-footer {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 10px;
  }

  .landing-footer-actions {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }

  .landing-footer-actions .ghost-button {
    flex: 0 1 auto;
    min-width: 0;
    padding-inline: 14px;
  }
}
