:root {
  --bg: #0c0527;
  --surface: #190d3f;
  --surface-2: #221452;
  --surface-3: #31126e;
  --text: #fdf3ff;
  --muted: #cfb9ff;
  --accent: #ff7a00;
  --accent-2: #ff2f92;
  --accent-3: #00d4ff;
  --ok: #12f59b;
  --warning: #ffd83d;
  --border: rgba(255, 255, 255, 0.24);
  --shadow: 0 14px 45px rgba(0, 0, 0, 0.33);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 8% 10%, #5312b8 0%, transparent 38%),
    radial-gradient(circle at 90% 15%, #ff2f92 0%, transparent 32%),
    radial-gradient(circle at 50% 92%, #00a2c5 0%, transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  line-height: 1.45;
  padding: 2rem clamp(1rem, 3vw, 2.5rem);
  overflow-x: hidden;
}

.background-shape {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(36px);
  opacity: 0.5;
}

.shape-1 {
  width: 280px;
  height: 280px;
  background: #ff7a00;
  top: -90px;
  right: -70px;
}

.shape-2 {
  width: 240px;
  height: 240px;
  background: #00d4ff;
  bottom: -80px;
  left: -70px;
}

.shape-3 {
  width: 210px;
  height: 210px;
  background: #ff2f92;
  top: 50%;
  left: 45%;
}

h1,
h2,
h3,
h4 {
  font-family: "Bricolage Grotesque", sans-serif;
  margin: 0;
}

p {
  margin: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.4rem;
  animation: fadeIn 0.5s ease;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(255, 47, 146, 0.4);
}

.eyebrow {
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-3);
  font-size: 0.78rem;
  margin-bottom: 0.2rem;
}

.control-stack {
  display: grid;
  gap: 0.5rem;
  width: min(460px, 100%);
}

.status-pill {
  background: linear-gradient(120deg, rgba(255, 47, 146, 0.2), rgba(0, 212, 255, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  font-size: 0.84rem;
  color: var(--text);
  box-shadow: var(--shadow);
}

.delivery-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
}

.delivery-row input {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(6, 3, 18, 0.6);
  color: var(--text);
  padding: 0.68rem 0.85rem;
  font: inherit;
}

.status-text {
  font-size: 0.82rem;
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.1rem;
  align-items: start;
}

.main-content,
.history-panel {
  background: linear-gradient(145deg, rgba(31, 16, 71, 0.88), rgba(13, 7, 35, 0.87));
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.main-content {
  padding: 1.2rem;
}

.history-panel {
  padding: 1rem;
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow: auto;
}

.panel {
  display: none;
  animation: rise 0.32s ease;
}

.panel.active {
  display: block;
}

.panel h2 {
  margin-bottom: 0.4rem;
}

.panel p {
  color: var(--muted);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.6rem;
}

.panel-head.compact {
  margin-bottom: 0.85rem;
}

.search-form {
  margin-top: 1rem;
  display: flex;
  gap: 0.6rem;
}

.suggestions {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.45rem;
}

.suggestions p {
  font-size: 0.84rem;
  color: var(--muted);
}

.suggestions-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.suggestion-chip {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  padding: 0.24rem 0.62rem;
  cursor: pointer;
}

.suggestion-chip:hover {
  background: rgba(255, 255, 255, 0.15);
}

.search-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(6, 3, 18, 0.6);
  color: var(--text);
  padding: 0.82rem 0.95rem;
  font: inherit;
}

.search-form button,
.primary,
.ghost-btn {
  border-radius: 14px;
  border: 1px solid transparent;
  font: inherit;
  cursor: pointer;
}

.search-form button,
.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: white;
  padding: 0.75rem 1rem;
  font-weight: 700;
}

.primary.small {
  padding: 0.46rem 0.75rem;
  font-size: 0.84rem;
}

.primary.wide {
  margin-top: 1.1rem;
  width: 100%;
}

.search-form button:hover,
.primary:hover {
  filter: brightness(1.08);
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-color: var(--border);
  padding: 0.5rem 0.72rem;
}

.ghost-btn.small {
  padding: 0.34rem 0.58rem;
  font-size: 0.81rem;
}

.helper {
  margin: 0.2rem 0 0.95rem;
}

.criteria-list {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.criteria-item {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 0.55rem 0.62rem;
  background: rgba(255, 255, 255, 0.07);
}

.criteria-title {
  font-size: 0.86rem;
  color: #f7e8ff;
  margin-bottom: 0.2rem;
}

.criteria-values {
  font-size: 0.84rem;
  color: var(--muted);
}

.card-grid,
.result-grid {
  display: grid;
  gap: 0.84rem;
}

.card-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

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

.secondary {
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
}

.card {
  background: linear-gradient(160deg, rgba(44, 19, 97, 0.95), rgba(20, 9, 50, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 18px;
  padding: 0.95rem;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.22);
}

.question-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.question-name {
  font-size: 1.07rem;
  margin-bottom: 0.26rem;
}

.question-desc {
  font-size: 0.92rem;
}

.options-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.48rem;
}

.option-chip {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  padding: 0.34rem 0.7rem;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 0.87rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.option-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-chip:has(input:checked) {
  background: linear-gradient(120deg, rgba(255, 122, 0, 0.5), rgba(255, 47, 146, 0.52));
  border-color: rgba(255, 255, 255, 0.55);
}

.product-card {
  display: flex;
  flex-direction: column;
  gap: 0.56rem;
}

.product-head {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
}

.overline {
  font-size: 0.74rem;
  color: #a5dcff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.product-name {
  font-size: 1.1rem;
}

.product-brand,
.price-range,
.official-price {
  font-size: 0.9rem;
  color: #decfff;
}

.official-link {
  display: inline-flex;
  width: fit-content;
  color: #7effe6;
  font-size: 0.84rem;
  text-decoration: none;
}

.score-badge {
  min-width: 62px;
  text-align: center;
  font-weight: 700;
  border-radius: 12px;
  padding: 0.35rem 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.42);
  color: #09141a;
  background: linear-gradient(120deg, #22f8c8, #00d4ff);
  align-self: flex-start;
}

.meter-wrap {
  display: grid;
  gap: 0.2rem;
}

.meter-wrap span {
  font-size: 0.82rem;
  color: var(--muted);
}

.meter {
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
}

.fit-block,
.review-block {
  display: grid;
  gap: 0.3rem;
  font-size: 0.9rem;
}

.review-details {
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 12px;
  padding: 0.5rem 0.6rem;
  background: rgba(255, 255, 255, 0.06);
}

.review-details summary {
  cursor: pointer;
  font-weight: 700;
  color: #c9f7ff;
  margin-bottom: 0.35rem;
}

.review-details[open] summary {
  margin-bottom: 0.45rem;
}

.review-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  margin-top: 0.3rem;
}

.review-links a {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 0.22rem 0.56rem;
  background: rgba(0, 212, 255, 0.16);
  color: #e3fbff;
  text-decoration: none;
  font-size: 0.8rem;
}

.stars {
  color: var(--warning);
  font-weight: 600;
}

.price-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.2rem;
}

.price-tools label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.84rem;
  color: var(--muted);
}

.price-tools select {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(8, 4, 25, 0.8);
  color: var(--text);
  padding: 0.2rem 0.36rem;
}

.best-price-output {
  display: grid;
  gap: 0.4rem;
}

.best-offer {
  border: 1px solid rgba(18, 245, 155, 0.5);
  border-radius: 12px;
  padding: 0.55rem;
  background: rgba(18, 245, 155, 0.12);
  font-size: 0.86rem;
}

.offer-list {
  display: grid;
  gap: 0.32rem;
}

.offer-item {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.84rem;
}

.offer-item a {
  color: #8af8ff;
  text-decoration: none;
}

.chat-box {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  padding: 0.6rem;
  display: grid;
  gap: 0.45rem;
  background: rgba(7, 4, 20, 0.62);
}

.chat-messages {
  display: grid;
  gap: 0.35rem;
  max-height: 220px;
  overflow: auto;
}

.chat-msg {
  border-radius: 10px;
  padding: 0.42rem 0.52rem;
  font-size: 0.84rem;
}

.chat-msg.user {
  background: rgba(0, 212, 255, 0.22);
}

.chat-msg.assistant {
  background: rgba(255, 122, 0, 0.2);
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.4rem;
}

.chat-input {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(6, 3, 18, 0.7);
  color: var(--text);
  padding: 0.5rem 0.62rem;
}

.links-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.links-wrap a {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 0.24rem 0.6rem;
  background: rgba(255, 255, 255, 0.08);
  color: #eff3ff;
  text-decoration: none;
  font-size: 0.82rem;
}

.sources-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.source-link {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 0.25rem 0.62rem;
  background: rgba(0, 212, 255, 0.18);
  color: #d3f7ff;
  text-decoration: none;
  font-size: 0.84rem;
}

.note-box {
  margin-top: 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 216, 61, 0.62);
  padding: 0.75rem;
  color: #fff4be;
  background: rgba(255, 216, 61, 0.13);
  font-size: 0.9rem;
}

.history-list {
  display: grid;
  gap: 0.6rem;
}

.history-item {
  text-align: left;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
  padding: 0.62rem;
  cursor: pointer;
}

.history-item strong {
  display: block;
  margin-bottom: 0.18rem;
}

.history-item small,
.history-empty {
  color: var(--muted);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@media (max-width: 1040px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .history-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
  }

  .delivery-row,
  .search-form,
  .chat-form {
    grid-template-columns: 1fr;
    display: grid;
  }

  .price-tools {
    flex-direction: column;
    align-items: flex-start;
  }
}
