:root {
  --tf-n0: #1d1e24;
  --tf-n30: #ebeced;
  --tf-light-n30: #373d4b;
  --tf-light-bg: #23262b;
  --tf-n100: #7b8088;
  --tf-n200: #6d717b;
  --tf-n300: #5e636e;
  --tf-n400: #525763;
  --tf-n500: #434956;
  --tf-n700: #262d3b;
  --tf-primary: rgb(77, 107, 254);
  --tf-secondary: rgb(142, 51, 255);
  --tf-error: rgb(255, 86, 48);
  --tf-warning: rgb(255, 171, 0);
  --tf-success: rgb(34, 197, 94);
  --tf-info: rgb(0, 184, 217);
  --tf-border: rgba(77, 107, 254, 0.2);
  --tf-border-strong: rgba(77, 107, 254, 0.3);
  --tf-bg-soft: rgba(77, 107, 254, 0.05);
  --tf-bg-card: rgba(255, 255, 255, 0.92);
  --tf-bg-page: #fbfcff;
  --tf-shadow: 0 20px 55px rgba(38, 45, 59, 0.08);
  --tf-radius-xl: 24px;
  --tf-radius-lg: 20px;
  --tf-radius-md: 16px;
  --tf-radius-pill: 999px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", "Segoe UI", sans-serif;
  color: var(--tf-n500);
  background: var(--tf-bg-page);
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background-color: rgba(167, 167, 167, 0.12);
}

::-webkit-scrollbar-thumb {
  background-color: var(--tf-primary);
}

.theme-body {
  position: relative;
  overflow-x: hidden;
}

.theme-orbs {
  opacity: 0.32;
  pointer-events: none;
}

.theme-orb {
  position: fixed;
  width: 227px;
  height: 227px;
  border-radius: 50%;
  filter: blur(200px);
  z-index: 0;
}

.theme-orb-primary {
  top: -220px;
  left: -220px;
  background: rgba(77, 107, 254, 0.88);
}

.theme-orb-secondary {
  top: -260px;
  left: 30%;
  background: rgba(0, 184, 217, 0.75);
}

.theme-orb-info {
  top: 200px;
  left: 50%;
  background: rgba(255, 171, 0, 0.65);
}

.theme-orb-warning {
  top: 420px;
  left: -120px;
  background: rgba(255, 86, 48, 0.7);
}

.theme-orb-success {
  bottom: -160px;
  left: 12%;
  background: rgba(34, 197, 94, 0.7);
}

.tf-layout {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}

.tf-sidebar {
  width: 312px;
  min-width: 312px;
  background: rgba(255, 255, 255, 0.88);
  border-right: 1px solid var(--tf-border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  backdrop-filter: blur(18px);
}

.tf-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tf-brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(77, 107, 254, 1) 0%, rgba(142, 51, 255, 0.95) 100%);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: lowercase;
}

.tf-brand h1,
.tf-topbar h2,
.landing-hero-copy h3,
.tf-section-head h3,
.tf-machine-head h4,
.tf-panel-card h4 {
  margin: 0;
  color: var(--tf-n700);
  line-height: 1.2;
}

.tf-overline {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tf-n100);
}

.tf-muted {
  margin: 0;
  color: var(--tf-n300);
  line-height: 1.6;
}

.tf-sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tf-utility-row {
  display: flex;
  gap: 10px;
}

.tf-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tf-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 16px;
  color: var(--tf-n500);
  transition: 180ms ease;
}

.tf-nav-item:hover,
.tf-nav-item.is-active {
  background: var(--tf-bg-soft);
  color: var(--tf-primary);
}

.tf-sidebar-card,
.tf-panel-card,
.tf-machine-card,
.landing-side-card,
.tf-surface {
  background: var(--tf-bg-card);
  border: 1px solid var(--tf-border);
  border-radius: var(--tf-radius-xl);
  box-shadow: var(--tf-shadow);
}

.tf-sidebar-card,
.tf-panel-card,
.landing-side-card {
  padding: 20px;
}

.tf-stack-list {
  margin: 0;
  padding-left: 18px;
  color: var(--tf-n300);
  line-height: 1.7;
}

.tf-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  padding: 12px;
}

.tf-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  padding: 12px 24px;
  border-radius: var(--tf-radius-xl);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(235, 236, 237, 0.9);
  position: sticky;
  top: 12px;
  z-index: 10;
  box-shadow: 0 10px 25px rgba(38, 45, 59, 0.04);
  backdrop-filter: blur(18px);
}

.tf-topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.tf-status-pill,
.tf-suggestion-chip,
.landing-action-chip,
.status-pill,
.badge {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: var(--tf-radius-pill);
  border: 1px solid var(--tf-border);
  background: var(--tf-bg-soft);
  color: var(--tf-primary);
  font-size: 0.84rem;
  font-weight: 600;
}

.tf-status-pill.is-soft,
.status-pill-soft,
.badge-soft {
  background: rgba(255, 171, 0, 0.08);
  border-color: rgba(255, 171, 0, 0.25);
  color: #b37200;
}

.tf-primary-btn,
.choice-action,
.primary-nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 24px;
  border: 1px solid var(--tf-primary);
  border-radius: var(--tf-radius-pill);
  background: var(--tf-primary);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  transition: 180ms ease;
}

.tf-primary-btn:hover,
.choice-action:hover,
.primary-nav-cta:hover,
.tf-send-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(77, 107, 254, 0.24);
}

.tf-outline-btn,
.choice-action-ghost,
.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid var(--tf-border-strong);
  border-radius: var(--tf-radius-pill);
  background: #fff;
  color: var(--tf-n500);
  font-weight: 600;
}

.tf-full-width {
  width: 100%;
}

.tf-icon-btn,
.tf-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--tf-border);
  background: #fff;
  color: var(--tf-n500);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.tf-send-btn {
  background: var(--tf-primary);
  color: #fff;
  border-color: var(--tf-primary);
}

.landing-hero-panel {
  max-width: 1296px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
}

.landing-hero-copy,
.landing-chat-card {
  grid-column: 1 / 2;
}

.landing-side-stack {
  grid-column: 2 / 3;
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.landing-hero-copy {
  text-align: center;
  padding: 36px 20px 12px;
}

.landing-hello {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  color: var(--tf-n700);
  font-size: 1.1rem;
  font-weight: 600;
}

.landing-hero-copy h3 {
  margin: 0 auto 16px;
  max-width: 13ch;
  font-size: clamp(2rem, 4vw, 3.25rem);
}

.landing-lead {
  max-width: 760px;
  margin: 0 auto;
}

.landing-chat-card {
  max-width: 1090px;
  width: 100%;
  margin: 0 auto;
}

.landing-compose-card {
  width: 100%;
  padding: 16px;
  border-radius: var(--tf-radius-xl);
  background: var(--tf-bg-soft);
  border: 1px solid var(--tf-border);
}

.landing-compose-label {
  display: block;
  margin-bottom: 12px;
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--tf-n700);
}

.landing-compose-card textarea {
  width: 100%;
  min-height: 126px;
  resize: vertical;
  border: 0;
  border-radius: 14px;
  background: #fff;
  padding: 18px;
  color: var(--tf-n500);
  outline: none;
}

.landing-compose-card textarea::placeholder,
input::placeholder {
  color: var(--tf-n100);
}

.landing-compose-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 16px;
}

.landing-toolbar-left,
.landing-toolbar-right,
.tf-inline-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.landing-action-chip.search {
  color: var(--tf-secondary);
  border-color: rgba(142, 51, 255, 0.3);
  background: rgba(142, 51, 255, 0.08);
}

.landing-action-chip.qualify {
  color: #b37200;
  border-color: rgba(255, 171, 0, 0.3);
  background: rgba(255, 171, 0, 0.08);
}

.landing-chip-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 24px 0 0;
}

.tf-suggestion-chip {
  background: #fff;
  color: var(--tf-n500);
}

.landing-image-card {
  overflow: hidden;
  min-height: 280px;
  display: flex;
  align-items: end;
  justify-content: center;
  padding: 0;
  background: linear-gradient(180deg, rgba(77, 107, 254, 0.08), rgba(255, 255, 255, 0.95));
}

.landing-side-image {
  width: 100%;
  object-fit: cover;
}

.tf-section {
  max-width: 1296px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tf-section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
}

.tf-card-grid {
  display: grid;
  gap: 20px;
}

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

.tf-card-grid-triple {
  max-width: 1296px;
  margin: 0 auto;
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tf-machine-card {
  display: flex;
  gap: 18px;
  padding: 18px;
}

.tf-machine-visual {
  width: 84px;
  min-width: 84px;
  height: 84px;
  border-radius: 24px;
  background: var(--tf-bg-soft);
  border: 1px solid var(--tf-border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tf-machine-avatar {
  width: 62px;
  height: 62px;
  border-radius: 20px;
}

.tf-machine-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.tf-machine-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.tf-machine-head p,
.tf-panel-card p,
.tf-footer p {
  margin: 0;
  color: var(--tf-n300);
  line-height: 1.6;
}

.tf-footer {
  margin-top: auto;
  padding: 0 12px 8px;
  text-align: center;
}

.tf-footer span {
  color: var(--tf-primary);
}

@media (max-width: 1400px) {
  .landing-hero-panel,
  .tf-section,
  .tf-card-grid-triple {
    max-width: 1140px;
  }
}

@media (max-width: 1200px) {
  .landing-hero-panel {
    grid-template-columns: 1fr;
  }

  .landing-side-stack {
    grid-column: auto;
    grid-row: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tf-card-grid-triple {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 992px) {
  .tf-layout {
    flex-direction: column;
  }

  .tf-sidebar {
    width: 100%;
    min-width: 0;
  }

  .tf-main {
    padding: 0 12px 12px;
  }

  .tf-topbar,
  .tf-section-head,
  .tf-machine-head,
  .landing-compose-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .tf-card-grid-machines,
  .landing-side-stack {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .landing-hero-copy h3 {
    max-width: none;
    font-size: 2rem;
  }

  .tf-machine-card {
    flex-direction: column;
  }
}
