:root {
  --paper: #f4f1e7;
  --surface: #fffdf7;
  --surface-soft: #ebe5d6;
  --ink: #24231f;
  --muted: #6d695f;
  --line: #d8d0bd;
  --lime: #a3df2f;
  --lime-soft: rgba(163, 223, 47, 0.18);
  --steel: #52636a;
  --clay: #a65d35;
  --shadow: 0 22px 70px rgba(36, 35, 31, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(244, 241, 231, 0.96), rgba(244, 241, 231, 0.98)),
    var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

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

button,
input {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 74px;
  padding: 10px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(216, 208, 189, 0.78);
  background: rgba(244, 241, 231, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 206px;
}

.wordmark {
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

.brand small {
  color: var(--ink);
  font-size: 11px;
  font-weight: 720;
  letter-spacing: 0;
  opacity: 0.68;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 680;
  white-space: nowrap;
}

.nav a:hover {
  border-color: var(--line);
  background: rgba(255, 253, 247, 0.72);
  color: var(--ink);
}

.screen {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(14px, 2.2vh, 24px);
  width: min(1180px, 100%);
  min-height: calc(100svh - 126px);
  margin: 0 auto;
  padding: clamp(22px, 4vh, 44px) clamp(18px, 4vw, 56px) 18px;
}

.intro {
  display: grid;
  justify-items: center;
  text-align: center;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
p {
  margin-top: 0;
}

h1 {
  max-width: 860px;
  margin-bottom: 14px;
  font-size: clamp(28px, 3.8vw, 48px);
  line-height: 1.04;
  letter-spacing: 0;
}

.lead {
  max-width: 800px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(14px, 1.15vw, 16px);
}

.chat-card {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  min-height: 360px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.78);
  box-shadow: var(--shadow);
}

.askbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.askbar input {
  width: 100%;
  min-height: 58px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  outline: none;
}

.askbar input:focus {
  border-color: var(--ink);
  background: var(--surface);
}

.askbar button {
  min-width: 132px;
  min-height: 58px;
  border: 1px solid var(--ink);
  background: var(--lime);
  color: var(--ink);
  font-weight: 850;
  cursor: pointer;
}

.askbar button:hover {
  transform: translateY(-1px);
}

.legal-consent {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.legal-consent input {
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 1px 0 0;
  padding: 0;
  accent-color: var(--ink);
}

.legal-consent a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.priority {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.priority span {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 9px 14px;
  background: rgba(244, 241, 231, 0.92);
  color: var(--muted);
  font-size: 13px;
}

.priority b {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 1px solid rgba(36, 35, 31, 0.2);
  color: var(--ink);
  font-size: 12px;
}

.partner-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(163, 223, 47, 0.14);
}

.partner-banner span {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.partner-banner p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.partner-banner a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  font-weight: 780;
  white-space: nowrap;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  padding: 16px;
  overflow-y: auto;
}

.message {
  width: min(820px, 100%);
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.message.user {
  align-self: flex-end;
  width: min(720px, 92%);
  border-color: rgba(36, 35, 31, 0.3);
  background: var(--ink);
  color: var(--paper);
}

.message.assistant {
  align-self: flex-start;
}

.message strong {
  display: block;
  margin-bottom: 8px;
}

.message p {
  margin-bottom: 10px;
}

.message p:last-child {
  margin-bottom: 0;
}

.notice {
  padding: 9px 10px;
  border: 1px solid rgba(166, 93, 53, 0.34);
  background: rgba(166, 93, 53, 0.08);
  color: var(--clay);
  font-size: 13px;
}

.visual-card {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin: 13px 0;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(244, 241, 231, 0.72);
  color: var(--ink);
}

.visual-figure {
  display: grid;
  place-items: center;
  min-height: 96px;
  border: 1px solid rgba(36, 35, 31, 0.16);
  background: var(--surface);
  color: var(--ink);
}

.visual-figure img {
  width: 100%;
  height: 96px;
  display: block;
  object-fit: cover;
}

.visual-figure svg {
  width: 100%;
  max-width: 170px;
  height: auto;
}

.visual-card b {
  display: block;
  margin-bottom: 5px;
}

.visual-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.visual-link {
  display: inline-flex;
  margin-top: 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 760;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sources {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.source {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.source b {
  display: block;
  margin-bottom: 3px;
}

.source span {
  color: var(--muted);
  font-size: 13px;
}

.badge {
  align-self: start;
  padding: 4px 7px;
  border: 1px solid rgba(111, 168, 0, 0.36);
  background: var(--lime-soft);
  color: #4f7400;
  font-size: 12px;
  font-style: normal;
  font-weight: 780;
  white-space: nowrap;
}

.feedback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.feedback span {
  margin-right: 2px;
  color: var(--muted);
  font-size: 13px;
}

.feedback button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 720;
}

.feedback button:hover:not(:disabled) {
  border-color: var(--ink);
  background: var(--surface);
}

.feedback button:disabled {
  cursor: default;
  opacity: 0.54;
}

.feedback.feedback-saved {
  color: #4f7400;
}

.business-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.business-strip article {
  min-height: 104px;
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.64);
}

.business-strip span {
  display: block;
  margin-bottom: 7px;
  color: var(--clay);
  font-size: 12px;
  font-weight: 820;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.business-strip p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.business-strip a,
.footer a {
  color: var(--ink);
  font-weight: 760;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-page {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 58px) clamp(18px, 4vw, 56px) 64px;
}

.legal-page h1 {
  max-width: 760px;
  text-align: left;
}

.legal-page h2 {
  margin: 34px 0 10px;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
}

.legal-page p {
  max-width: 820px;
  color: var(--muted);
}

.legal-page a {
  color: var(--ink);
  font-weight: 760;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.cookie-notice {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(520px, calc(100vw - 36px));
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 18px 46px rgba(36, 35, 31, 0.16);
}

.cookie-notice[hidden] {
  display: none;
}

.cookie-notice p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.cookie-notice button {
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid var(--ink);
  background: var(--lime);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .screen {
    min-height: auto;
  }

  .priority,
  .business-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
  }

  .screen {
    padding-top: 22px;
  }

  h1 {
    font-size: 28px;
  }

  .askbar {
    grid-template-columns: 1fr;
  }

  .askbar button {
    width: 100%;
  }

  .source {
    grid-template-columns: 1fr;
  }

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

  .partner-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .cookie-notice {
    align-items: stretch;
    flex-direction: column;
  }

  .footer {
    flex-direction: column;
  }
}
