:root {
  color-scheme: dark;
  --bg: #090807;
  --panel: rgba(250, 244, 231, 0.08);
  --panel-strong: rgba(255, 249, 237, 0.14);
  --line: rgba(255, 236, 196, 0.18);
  --text: #fff8eb;
  --muted: #c7bba5;
  --cyan: #ffd36a;
  --green: #9ff0b5;
  --violet: #ff9e80;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(rgba(255, 236, 196, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 236, 196, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 18% 0%, rgba(255, 211, 106, 0.2), transparent 30%),
    radial-gradient(circle at 82% 18%, rgba(255, 158, 128, 0.16), transparent 34%),
    var(--bg);
  background-size: 34px 34px, 34px 34px, auto, auto, auto;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
textarea,
a {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 64px;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(20, 16, 12, 0.82);
  backdrop-filter: blur(18px);
}

.brand,
.session,
.nav-action {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-size: 18px;
}

.nav-action {
  min-height: 40px;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  text-decoration: none;
  font-weight: 850;
  background: rgba(255, 255, 255, 0.075);
}

.mark {
  width: 28px;
  height: 28px;
  border: 2px solid var(--cyan);
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(255, 211, 106, 0.24), rgba(255, 158, 128, 0.12));
}

.session {
  color: var(--muted);
  font-size: 14px;
}

.session button,
.primary,
.secondary,
.primary-link {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 850;
  text-decoration: none;
}

.primary,
.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #020508;
  background: linear-gradient(135deg, #fff8eb, var(--cyan));
  box-shadow: 0 18px 46px rgba(255, 211, 106, 0.2);
}

.secondary,
.session button {
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  gap: 22px;
  align-items: center;
  min-height: 430px;
  padding: 52px 0 24px;
}

.eyebrow {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 780px;
  margin: 14px 0 18px;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero p,
.panel p,
.result p,
.pricing p {
  color: var(--muted);
  line-height: 1.62;
}

.model-note {
  display: block;
  margin-top: 10px;
  color: var(--green);
  font-weight: 750;
  line-height: 1.5;
}

.hero-copy p {
  max-width: 680px;
  font-size: 19px;
}

.hero-preview,
.panel,
.pricing article {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-preview {
  min-height: 330px;
  border-radius: 8px;
  padding: 22px;
  transform: rotate(1deg);
  background:
    linear-gradient(180deg, rgba(255, 248, 235, 0.14), rgba(255, 248, 235, 0.045)),
    rgba(22, 18, 13, 0.88);
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
}

.preview-header strong {
  color: var(--green);
}

.model-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  margin-top: 18px;
  padding: 0 14px;
  border: 1px solid rgba(126, 231, 255, 0.24);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(4, 8, 13, 0.46);
}

.model-strip strong {
  color: var(--cyan);
  font-size: 13px;
}

.artifact-list {
  display: grid;
  gap: 10px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.artifact-list li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 4px 12px;
  min-height: 56px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.artifact-list span {
  grid-row: span 2;
  color: var(--cyan);
  font-weight: 950;
}

.artifact-list small {
  color: var(--muted);
}

.pricing {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 0 18px 18px;
}

.pricing article {
  min-height: 160px;
  border-radius: 8px;
  padding: 20px;
}

.pricing .featured {
  border-color: rgba(255, 211, 106, 0.46);
  background: linear-gradient(135deg, rgba(255, 211, 106, 0.14), rgba(255, 255, 255, 0.06));
}

.pricing span,
.result span,
.memory-card span,
.launch-card span,
.section-title span {
  display: block;
  margin-bottom: 10px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.pricing strong {
  display: block;
  font-size: 34px;
}

.pricing-drawer {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.pricing-drawer summary {
  min-height: 54px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  color: var(--muted);
  cursor: pointer;
  font-weight: 950;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 0.78fr) minmax(0, 1.22fr);
  gap: 18px;
  align-items: start;
}

.panel {
  border-radius: 8px;
  padding: 22px;
}

.panel h2,
.result-hero h2 {
  margin: 8px 0 8px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.05;
}

textarea {
  width: 100%;
  min-height: 280px;
  margin: 12px 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.28);
  resize: vertical;
  outline: none;
}

textarea:focus {
  border-color: rgba(255, 211, 106, 0.72);
  box-shadow: 0 0 0 4px rgba(255, 211, 106, 0.1);
}

.input-panel .primary {
  width: 100%;
  min-height: 58px;
}

.advanced-drawer {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.advanced-drawer summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

.advanced-grid {
  display: grid;
  gap: 12px;
  padding: 0 14px 14px;
}

.advanced-grid .session {
  justify-content: space-between;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
}

.empty-state {
  display: grid;
  min-height: 520px;
  place-content: center;
  text-align: left;
  gap: 14px;
}

.empty-state h2,
.empty-state p {
  max-width: 560px;
}

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

.empty-checklist span {
  min-height: 54px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
}

.result {
  display: grid;
  gap: 14px;
}

.result-hero,
.memory-card,
.task-card,
.launch-card,
.result-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.055);
}

.result-hero {
  background: linear-gradient(135deg, rgba(255, 211, 106, 0.15), rgba(255, 158, 128, 0.1));
}

.result-hero strong {
  display: block;
  margin-top: 14px;
  border-left: 4px solid var(--cyan);
  padding: 10px 12px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.18);
}

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

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

.section-title strong {
  color: var(--green);
}

table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 8px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--text);
  font-size: 13px;
}

td:first-child {
  color: var(--cyan);
  font-weight: 900;
}

.actions {
  display: block;
}

.local-llm-card {
  display: grid;
  gap: 14px;
  margin: 22px 0;
}

.local-llm-card .panel-head {
  display: grid;
  gap: 6px;
}

.local-llm-card .panel-head h2 {
  margin: 0;
}

.token-drawer input,
.llm-search-row input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.22);
}

.token-drawer div {
  grid-template-columns: 1fr;
}

.llm-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.llm-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
  padding: 13px 14px;
  border: 1px solid rgba(159, 240, 181, 0.24);
  border-radius: 8px;
  color: var(--green);
  background: rgba(159, 240, 181, 0.06);
  font-weight: 850;
}

.hf-results {
  display: grid;
  gap: 12px;
  max-height: 460px;
  overflow-y: auto;
  padding-right: 8px;
}

.hf-empty,
.hf-model-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.hf-model-card {
  display: grid;
  gap: 10px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.hf-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.hf-title span {
  overflow-wrap: anywhere;
  font-size: 18px;
  font-weight: 950;
}

.hf-title strong,
.hf-badges span {
  border: 1px solid rgba(255, 211, 106, 0.26);
  border-radius: 8px;
  padding: 6px 8px;
  color: var(--cyan);
  background: rgba(255, 211, 106, 0.08);
  font-size: 12px;
}

.hf-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hf-file-list {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(255, 211, 106, 0.16);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
}

.hf-file-list > strong {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.hf-file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.hf-file-row span {
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 850;
}

.hf-file-row button {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  color: #090807;
  background: linear-gradient(135deg, var(--text), var(--cyan));
  font-size: 12px;
  font-weight: 950;
}

.download-progress {
  display: grid;
  gap: 8px;
}

.download-progress div {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.download-progress i {
  overflow: hidden;
  height: 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
}

.download-progress b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--green));
}

.export-drawer {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.export-drawer summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

.export-drawer div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 14px 14px;
}

.export-drawer button {
  width: 100%;
}

@media (max-width: 840px) {
  .hero,
  .workspace,
  .pricing,
  .result-grid,
  .empty-checklist,
  .llm-search-row,
  .hf-file-row {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 48px;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 22px, 1180px);
  }

  .topbar,
  .session {
    align-items: stretch;
  }

  .topbar {
    flex-direction: column;
  }

  .session,
  .session button {
    width: 100%;
    justify-content: center;
  }
}
