:root {
  color-scheme: light;
  --page: oklch(96.5% 0.012 91);
  --panel: oklch(99% 0.008 88);
  --panel-strong: oklch(94% 0.018 92);
  --ink: oklch(24% 0.035 77);
  --muted: oklch(50% 0.026 73);
  --soft: oklch(74% 0.032 78);
  --accent: oklch(58% 0.135 151);
  --accent-strong: oklch(45% 0.12 153);
  --accent-soft: oklch(89% 0.06 151);
  --blue: oklch(54% 0.12 245);
  --blue-soft: oklch(90% 0.045 245);
  --danger: oklch(54% 0.16 25);
  --shadow: 0 24px 70px oklch(32% 0.035 75 / 14%);
  --ring: 0 0 0 4px oklch(58% 0.135 151 / 18%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, oklch(88% 0.08 151 / 45%), transparent 34rem),
    radial-gradient(circle at 85% 12%, oklch(88% 0.07 245 / 38%), transparent 28rem),
    linear-gradient(135deg, var(--page), oklch(94% 0.018 72));
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 470px);
  gap: 28px;
  align-items: end;
}

.hero-copy {
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 5.8rem);
  line-height: 0.92;
  letter-spacing: -0.075em;
}

.lede {
  max-width: 650px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.search-panel {
  padding: 22px;
  border: 1px solid oklch(82% 0.03 83);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.search-panel label {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

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

.search-row input {
  min-width: 0;
  height: 52px;
  padding: 0 16px;
  border: 1px solid oklch(80% 0.028 78);
  border-radius: 18px;
  background: oklch(97.5% 0.01 87);
  color: var(--ink);
  outline: none;
}

.search-row input:focus {
  border-color: var(--accent);
  box-shadow: var(--ring);
}

.search-row button,
.more-button {
  border: 0;
  border-radius: 18px;
  background: var(--ink);
  color: oklch(97% 0.008 88);
  font-weight: 800;
  transition: transform 180ms ease-out, background 180ms ease-out, opacity 180ms ease-out;
}

.search-row button {
  min-width: 164px;
  padding: 0 18px;
}

.search-row button:hover,
.more-button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.search-row button:focus-visible,
.more-button:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.search-row button:disabled,
.more-button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.model-note {
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.status-card {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  margin-top: 22px;
  padding: 10px 14px;
  border: 1px solid oklch(84% 0.028 82);
  border-radius: 999px;
  background: oklch(98% 0.01 88 / 84%);
  color: var(--muted);
  backdrop-filter: blur(8px);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--soft);
}

.status-dot.busy {
  background: var(--blue);
  box-shadow: 0 0 0 6px oklch(54% 0.12 245 / 14%);
}

.status-dot.done {
  background: var(--accent);
}

.status-dot.error {
  background: var(--danger);
}

.empty-state {
  margin-top: 64px;
  padding: 54px 24px;
  text-align: center;
  border: 1px dashed oklch(78% 0.035 82);
  border-radius: 36px;
  background: oklch(98% 0.008 88 / 58%);
}

.empty-state.hidden {
  display: none;
}

.empty-orbit {
  position: relative;
  width: 170px;
  height: 92px;
  margin: 0 auto 20px;
}

.empty-orbit span {
  position: absolute;
  width: 58px;
  height: 58px;
  border: 1px solid oklch(75% 0.04 151);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 12px 26px oklch(32% 0.035 75 / 8%);
}

.empty-orbit span:nth-child(1) {
  left: 0;
  top: 26px;
}

.empty-orbit span:nth-child(2) {
  left: 56px;
  top: 0;
  background: var(--accent-soft);
}

.empty-orbit span:nth-child(3) {
  right: 0;
  top: 26px;
  background: var(--blue-soft);
}

.empty-state h2 {
  margin: 0;
  font-size: 1.45rem;
}

.empty-state p {
  margin: 10px auto 0;
  max-width: 500px;
  color: var(--muted);
  line-height: 1.55;
}

.tree {
  display: none;
  margin-top: 30px;
}

.tree.visible {
  display: block;
}

.tree-level {
  margin-top: 24px;
}

.choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.specific-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.specific-grid .offer {
  grid-template-columns: 96px minmax(0, 1fr);
  min-height: 112px;
  padding: 10px;
}

.specific-grid .offer .offer-description {
  -webkit-line-clamp: 2;
}

.specific-grid.is-empty {
  grid-template-columns: 1fr;
}

.tree-branch {
  min-width: 0;
}

.node-card {
  height: 100%;
  padding: 16px;
  border: 1px solid oklch(82% 0.026 82);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 18px 42px oklch(32% 0.035 75 / 10%);
}

.root-card {
  width: min(680px, 100%);
  margin: 0 auto;
  padding: 18px 22px;
  border-color: oklch(73% 0.06 151);
  background: linear-gradient(135deg, var(--panel), var(--accent-soft));
}

.node-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.node-source {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--accent-strong);
  letter-spacing: 0;
  text-transform: none;
}

.node-query {
  margin: 12px 0 0;
  font-size: 1.16rem;
  line-height: 1.18;
  letter-spacing: -0.03em;
}

.root-card .node-query {
  font-size: 1.45rem;
}

.node-angle {
  margin: 9px 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.48;
}

.offers {
  display: grid;
  gap: 9px;
}

.offer {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  min-height: 92px;
  padding: 8px;
  border: 1px solid oklch(86% 0.02 82);
  border-radius: 17px;
  color: inherit;
  text-decoration: none;
  background: oklch(97% 0.01 88);
  transition: border-color 180ms ease-out, transform 180ms ease-out;
}

.offer:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.offer.no-result {
  grid-template-columns: 1fr;
  align-items: center;
}

.offer-image {
  min-height: 76px;
  border-radius: 13px;
  background:
    linear-gradient(135deg, oklch(88% 0.04 151), oklch(91% 0.035 245)),
    var(--panel-strong);
  background-position: center;
  background-size: cover;
}

.offer-title,
.offer-meta,
.offer-description {
  margin: 0;
}

.offer-title {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-weight: 800;
  font-size: 0.9rem;
  line-height: 1.22;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.offer-meta {
  margin-top: 5px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
}

.offer-description {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.node-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}

.more-button {
  padding: 11px 14px;
  font-size: 0.92rem;
}

.result-count {
  color: var(--muted);
  font-size: 0.82rem;
}

.loading-card {
  min-height: 430px;
}

.skeleton {
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(
    90deg,
    oklch(92% 0.016 82),
    oklch(98% 0.008 88),
    oklch(92% 0.016 82)
  );
  background-size: 220% 100%;
  animation: shimmer 1.25s ease-out infinite;
}

.skeleton.title {
  width: 78%;
  height: 26px;
  margin-top: 22px;
}

.skeleton.text {
  width: 100%;
  height: 62px;
  margin-top: 14px;
}

.skeleton.offer-line {
  height: 92px;
  margin-top: 9px;
}

@keyframes shimmer {
  from {
    background-position: 120% 0;
  }
  to {
    background-position: -120% 0;
  }
}

@media (max-width: 900px) {
  .hero,
  .search-row {
    grid-template-columns: 1fr;
  }

  .search-row button {
    height: 52px;
  }

  .choices,
  .specific-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
