:root {
  color-scheme: light;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
    sans-serif;
  background-color: #f5f7fb;
  color: #101828;
  line-height: 1.5;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #f8fbff, #f1f5ff 45%, #eef2ff);
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  line-height: 1.2;
  color: #0f172a;
}

p {
  margin: 0;
  color: #475467;
}

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

.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
  background: rgba(248, 250, 255, 0.85);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  padding: 1rem 2rem;
}

.site-nav__brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: #4338ca;
}

.site-nav__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.site-nav__links a {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.92rem;
  color: #475467;
  transition: background 0.2s, color 0.2s;
}

.site-nav__links a:hover,
.site-nav__links a.active {
  background: rgba(79, 70, 229, 0.12);
  color: #312e81;
}

.hero {
  padding: 3.5rem 1rem 2rem;
  text-align: center;
}

.hero--tight {
  padding-top: 2rem;
}

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

.hero__eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6366f1;
  margin-bottom: 0.5rem;
}

.hero__subtitle {
  margin-top: 1rem;
  font-size: 1.1rem;
}

.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.main--grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.panel {
  width: 100%;
  background: #fff;
  border-radius: 18px;
  padding: 1.75rem;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
}

.panel__header {
  margin-bottom: 1rem;
}

.feature-panel__body {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.feature-panel__body--grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.6rem;
}

.chip-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.08);
  color: #4338ca;
  font-weight: 600;
  transition: background 0.2s, transform 0.2s;
}

.chip-link:hover {
  background: rgba(79, 70, 229, 0.16);
  transform: translateY(-1px);
}

.order-form__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-weight: 500;
  color: #1d2939;
}

.field textarea {
  min-height: 110px;
  border-radius: 12px;
  border: 1px solid #d0d5dd;
  padding: 0.75rem 1rem;
  resize: vertical;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #f9fafb;
}

.field textarea:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  background: #fff;
}

.order-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.order-form__actions button {
  border: none;
  border-radius: 999px;
  padding: 0.85rem 1.8rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.order-form__actions button:first-of-type {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.order-form__actions button:first-of-type:hover {
  transform: translateY(-1px);
}

.order-form__actions .ghost {
  background: rgba(99, 102, 241, 0.08);
  color: #4f46e5;
}

.order-form__hint {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: #475467;
}

.status-message {
  margin-top: 1.5rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: #eef2ff;
  color: #3730a3;
  font-weight: 500;
  display: none;
}

.status-message.error {
  background: #fee2e2;
  color: #b42318;
}

.status-message.visible {
  display: block;
}

.result-card {
  margin-top: 1.25rem;
  padding: 1rem 1.2rem;
  border-radius: 14px;
  background: #f9fafb;
  border: 1px solid #e4e7ec;
}

.result-card h3 {
  margin-bottom: 0.4rem;
  font-size: 1.05rem;
}

.result-card p {
  font-weight: 500;
  color: #111;
}

.tree-visual {
  min-height: 360px;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid #e4e7ec;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 1rem;
}

.placeholder {
  color: #98a2b3;
  font-style: italic;
}

svg.tree-svg {
  width: 100%;
  height: 100%;
}

.tree-node {
  fill: #fff;
  stroke: #4c1d95;
  stroke-width: 2;
}

.tree-text {
  font-size: 0.85rem;
  font-weight: 600;
  fill: #1d2939;
}

.tree-link {
  stroke: #c7d2fe;
  stroke-width: 2;
}

.tree-explanation {
  border: 1px solid #e4e7ec;
  border-radius: 16px;
  padding: 1.25rem;
  background: #fdfcff;
}

.tree-explanation ul {
  padding-left: 1.1rem;
  margin: 1rem 0 0;
  display: grid;
  gap: 0.35rem;
}

.tree-explanation li {
  list-style: none;
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  padding: 0.65rem 0.9rem;
  background: #fff;
}

.tree-explanation li .node-name {
  font-weight: 600;
  color: #4c1d95;
}

.panel.dual-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.list-steps {
  margin: 0;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.list-steps li {
  background: #f8fafc;
  border: 1px dashed #cbd5f5;
  border-radius: 12px;
  padding: 0.55rem 0.75rem;
  list-style: decimal;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.result-card.small {
  margin-top: 0;
}

.search-panel {
  display: grid;
  gap: 1rem;
}

.search-target {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.search-target label {
  flex: 1;
}

.search-target input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #d0d5dd;
  padding: 0.7rem 1rem;
  font-size: 1rem;
  transition: border 0.2s;
}

.search-target input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.footer {
  text-align: center;
  padding: 2rem 1rem 3rem;
  font-size: 0.9rem;
  color: #94a3b8;
}

@media (min-width: 900px) {
  .main {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: min-content;
  }

  .panel.visual-panel {
    grid-column: span 2;
  }

  .panel.explanation-panel {
    grid-column: span 2;
  }
}

.main--grid .panel {
  min-height: 260px;
}

.panel.avl-shell {
  padding: 0;
  background: transparent;
  box-shadow: none;
}

@media (max-width: 600px) {
  .order-form__actions {
    flex-direction: column;
  }

  .order-form__actions button {
    width: 100%;
  }

  .site-nav {
    padding: 0.85rem 1rem;
  }
}

