#ai {
  --ai-accent: #5a2ba3;
  --ai-ink: #2c2040;
  --ai-muted: #514265;
  --ai-border: #dfd1ee;
}
#ai .ai-heading h2 { color: var(--ai-ink); }
#ai .ai-heading > p { max-width: 46ch; margin-top: .65em; color: #443450; }
.ai-workspace {
  margin-top: clamp(14px, 1.25cqw, 30px);
  padding: clamp(9px, .75cqw, 18px);
  border: 1px solid var(--ai-border);
  border-radius: clamp(18px, 1.35cqw, 30px);
  background: #fffaf7;
  box-shadow: 0 16px 40px #35203d2b;
}
.ai-workspace [hidden] { display: none !important; }
.ai-workspace .ai-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 4px;
  gap: 4px;
  border: 0;
  border-radius: 14px;
  background: #efe7f7;
}
.ai-workspace .ai-tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 42px;
  height: auto;
  border-radius: 10px;
  padding: 5px 4px;
  border: 1px solid transparent;
  background: #fffaf9;
  color: var(--ai-ink);
  font-size: clamp(13px, 1.02cqw, 20px);
  font-weight: 700;
  cursor: pointer;
  transition: border-color .18s ease, background-color .18s ease;
}
.ai-workspace .ai-tabs button[aria-selected="true"] {
  color: white;
  background: var(--ai-accent);
  border-color: var(--ai-accent);
  box-shadow: none;
}
.ai-tabs [data-icon] { width: 1.1em; height: 1.1em; flex: none; }
.ai-panel {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, .62cqw, 15px);
  padding: clamp(8px, .68cqw, 16px) 1px 0;
}
.ai-example { display: grid; grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr); gap: clamp(7px, .6cqw, 14px); }
.ai-input, .ai-result {
  min-width: 0;
  min-height: clamp(188px, 15cqw, 338px);
  padding: clamp(11px, 1cqw, 24px);
  border-radius: 13px;
  font-size: clamp(13px, .96cqw, 19px);
  line-height: 1.4;
}
.ai-input {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  background: linear-gradient(140deg, #2e2046, #483074);
  color: #fff;
}
.ai-input h3 { margin: 0; font-size: clamp(20px, 1.7cqw, 34px); line-height: 1.13; color: #fff; letter-spacing: -.025em; }
.ai-input p, .ai-input blockquote { margin: 0; color: #f0e8fa; }
.ai-input blockquote { border-left: 2px solid #bd98f3; padding-left: 9px; }
.ai-label { display: block; color: var(--ai-muted); font-size: .86em; font-weight: 750; }
.ai-input .ai-label { color: #e2cef9; }
.ai-result {
  display: grid;
  align-items: stretch;
  border: 1px solid var(--ai-border);
  background: linear-gradient(140deg, #f7f1fd, #eee3fa);
  color: var(--ai-ink);
}
.ai-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px;
  border: 1px dashed #a996bf;
  border-radius: 10px;
  color: var(--ai-muted);
  text-align: center;
}
.ai-placeholder > [data-icon] { width: clamp(23px, 2.2cqw, 43px); height: clamp(23px, 2.2cqw, 43px); margin-bottom: 3px; color: #764bb1; }
.ai-placeholder strong { color: var(--ai-ink); }
.ai-placeholder small { font-size: .88em; }
.ai-brand-example { grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr); }
.ai-brand-editor, .ai-request-editor { gap: clamp(7px, .65cqw, 15px); }
.ai-requests { display: grid; align-self: stretch; gap: 7px; }
.ai-requests button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid #ad96cf;
  border-radius: 9px;
  background: #fff9fc;
  color: var(--ai-ink);
  text-align: left;
  font: inherit;
  font-size: .94em;
  font-weight: 700;
  cursor: pointer;
}
.ai-requests button:hover { border-color: #ffdc9f; background: #fff0d4; }
.ai-requests button[aria-pressed="true"] { border-color: #ffd48b; background: #ffd48b; }
.ai-requests button strong { display: block; margin-bottom: 2px; color: #563383; font-weight: 850; }
.ai-requests [data-icon] { width: 1.15em; height: 1.15em; color: #623a98; }
#ai .ai-requests button:focus-visible { outline-color: #ffe4ac; }
.ai-result--layouts { display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.ai-brand-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ai-proof { display: grid; grid-template-rows: auto 1fr; gap: 6px; min-width: 0; margin: 0; }
.ai-proof figcaption { color: var(--ai-muted); font-size: .86em; font-weight: 750; }
.ai-brand-card {
  --brand-ink: #203976;
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 5 / 6;
  min-width: 0;
  border: 1px solid #d9cee8;
  border-radius: 9px;
  background: radial-gradient(ellipse at 48% 36%, #fffaf5, #e9dfef);
}
.ai-brand-card[data-brand-color="green"] { --brand-ink: #076347; }
.ai-brand-card[data-brand-color="burgundy"] { --brand-ink: #812037; }
.ai-brand-product {
  container-type: inline-size;
  display: grid;
  place-items: center;
  width: min(84%, 204px);
  aspect-ratio: 3 / 4;
  background: url("/assets/home-v2/ai/brand-mug.webp") center / contain no-repeat;
  color: var(--brand-ink);
}
.ai-brand-print {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4cqi;
  width: 56%;
  margin-top: 12cqi;
  text-align: center;
}
.ai-brand-logo {
  display: block;
  width: 30cqi;
  height: 22cqi;
  background: currentColor;
  clip-path: polygon(50% 1%, 98% 96%, 50% 75%, 2% 96%);
}
.ai-brand-logo--vector { width: 25cqi; height: 25cqi; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%, 50% 0, 50% 25%, 25% 50%, 50% 75%, 75% 50%, 50% 25%); }
.ai-brand-print strong { font-size: 8.6cqi; font-weight: 850; line-height: 1.12; overflow-wrap: anywhere; text-wrap: balance; text-transform: uppercase; }
.ai-brand-caption {
  position: absolute;
  top: calc(100% + 3cqi);
  width: 100%;
  padding-top: 2cqi;
  border-top: 1px solid currentColor;
  font-size: 7.5cqi;
  font-weight: 800;
  line-height: 1.08;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.ai-brand-placeholder { aspect-ratio: 5 / 6; min-height: 0; }
.ai-request-spinner {
  width: 27px;
  height: 27px;
  border: 2px solid #d8c9e7;
  border-top-color: var(--ai-accent);
  border-radius: 50%;
  animation: ai-request-spin .78s linear infinite;
}
@keyframes ai-request-spin { to { transform: rotate(360deg); } }
.ai-brand-switch { display: none; }
.ai-brand-outcome { display: grid; justify-items: start; gap: 5px; }
.ai-brand-outcome p { margin: 0; color: var(--ai-muted); font-size: .88em; }
.ai-response {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--ai-border);
  border-radius: 8px;
  background: #fffdfb;
}
.ai-response > [data-icon] {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #f0e6fb;
  color: var(--ai-accent);
}
.ai-response > [data-icon] svg { width: 15px; height: 15px; }
.ai-response strong { display: block; color: var(--ai-ink); font-size: .95em; }
.ai-response p { margin: 2px 0 0; color: var(--ai-muted); font-size: .88em; }
.ai-output > .ai-response { margin-bottom: 8px; }
.ai-brand-sheet-trigger { padding: 0; border: 0; background: transparent; cursor: pointer; }
.ai-brand-contact.button {
  min-height: 44px;
  padding: 5px 11px;
  border-radius: 8px;
  background: var(--ai-accent);
  color: #fff;
  font-size: .93em;
}
.ai-brand-contact.button:hover { background: #48207f; }
.ai-brand-contact [data-icon] { width: 1em; height: 1em; flex: none; }
#ai:has(#ai-layouts:not([hidden]) #ai-layout-result:not([hidden])) .ai-actions > .ai-scenario-contact { display: none; }
.ai-brand-dialog {
  width: min(620px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  margin: auto;
  padding: clamp(13px, 3vw, 24px);
  border: 1px solid var(--ai-border);
  border-radius: 16px;
  background: #fffaf7;
  color: var(--ai-ink);
}
.ai-brand-dialog::backdrop { background: #21152d99; }
.ai-brand-dialog-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.ai-brand-dialog-head h3 { margin: 0; font-size: clamp(20px, 3vw, 26px); }
.ai-brand-dialog-head button {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--ai-border);
  border-radius: 8px;
  background: #fff;
  color: var(--ai-accent);
  cursor: pointer;
}
.ai-brand-dialog-head [data-icon] { width: 20px; height: 20px; }
.ai-brand-specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin: 12px 0; }
.ai-brand-specs div { padding: 7px 9px; border: 1px solid var(--ai-border); border-radius: 7px; }
.ai-brand-specs dt { font-size: 12px; color: var(--ai-muted); }
.ai-brand-specs dd { margin: 2px 0 0; font-size: 14px; font-weight: 750; }
.ai-brand-card--sheet { width: min(100%, 305px); aspect-ratio: 1.14; margin: 0 auto; }
.ai-brand-card--sheet .ai-brand-product { width: min(70%, 188px); }
.ai-brand-card--sheet .ai-brand-print::after { content: ""; position: absolute; inset: -5px -3px; border: 1px dashed currentColor; pointer-events: none; }
.ai-brand-card--sheet .ai-brand-print:has([data-brand-caption]:not([hidden]))::after { bottom: -21cqi; }
.ai-brand-dialog > p { margin: 12px 0 0; color: var(--ai-muted); font-size: 13px; }
.ai-output { min-width: 0; align-self: center; }
.ai-output > .ai-label { margin-bottom: 8px; }
.ai-workspace [data-ai-output]:not([hidden]) { animation: ai-result-in .25s ease-out; }
@keyframes ai-result-in {
  from { opacity: .45; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
.ai-catalog-tabs { display: flex; flex-wrap: wrap; gap: 5px; }
.ai-catalog-tabs button {
  flex: 1 1 auto;
  min-height: 44px;
  padding: 5px 9px;
  border: 1px solid #d7c7e7;
  border-radius: 8px;
  background: #fffaf9;
  color: var(--ai-ink);
  font: inherit;
  font-size: clamp(12px, .93cqw, 18px);
  font-weight: 750;
  cursor: pointer;
}
.ai-catalog-tabs button:hover { border-color: var(--ai-accent); background: #f0e6fb; }
.ai-catalog-tabs button[aria-pressed="true"] { border-color: var(--ai-accent); background: var(--ai-accent); color: #fff; }
.ai-catalog-example, .ai-finance-example { grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr); }
.ai-catalog-cards { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ai-catalog-cards li {
  display: grid;
  grid-template-columns: clamp(66px, 6.4cqw, 120px) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 5px;
  border: 1px solid #e2d6ed;
  border-radius: 8px;
  background: #fffdfa;
}
.ai-catalog-cards img {
  display: block;
  width: 100%;
  height: clamp(52px, 4.8cqw, 90px);
  object-fit: cover;
  border-radius: 5px;
  background: #fff;
}
.ai-catalog-cards[data-sector="souvenirs"] img, .ai-catalog-cards[data-sector="property"] img { object-fit: contain; }
.ai-catalog-cards a { color: var(--ai-ink); font-weight: 800; line-height: 1.22; text-underline-offset: 2px; }
.ai-catalog-cards a:hover { text-decoration: underline; }
.ai-catalog-cards a [data-icon] { display: inline-block; width: .85em; height: .85em; }
.ai-catalog-cards small { display: block; margin: 2px 0; color: var(--ai-muted); font-size: .84em; }
.ai-catalog-cards b { font-size: .9em; color: #552a92; }
.ai-catalog-source { white-space: nowrap; font-size: .76em; color: var(--ai-muted); }
.ai-catalog-note { margin: 7px 0; color: var(--ai-muted); font-size: .83em; line-height: 1.35; }
.ai-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  max-width: 100%;
  padding: 5px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--ai-accent);
  color: #fff;
  font-weight: 800;
}
.ai-download:hover { background: #48207f; }
.ai-download small { font-size: .75em; }
.ai-download [data-icon] { width: 1em; height: 1em; flex: none; }
.ai-task {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  padding: 6px;
  border: 1px solid #e5daef;
  border-radius: 8px;
  background: #fffdfa;
}
.ai-list-icon {
  display: grid;
  place-items: center;
  align-self: center;
  width: clamp(23px, 1.75cqw, 34px);
  height: clamp(23px, 1.75cqw, 34px);
  border-radius: 6px;
  background: #f1e5fd;
  color: #5d3597;
}
.ai-list-icon svg { width: 60%; height: 60%; }
.ai-task strong { display: block; line-height: 1.2; }
.ai-task small { display: block; margin-top: 2px; color: var(--ai-muted); font-size: .85em; }
.ai-finance-summary, .ai-finance-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.ai-finance-summary strong {
  padding: 3px 7px;
  border-radius: 5px;
  background: #e2f1e6;
  color: #22533a;
  font-size: .92em;
}
.ai-finance-summary strong + strong { background: #ffe8c0; color: #613a0a; }
.ai-finance-controls { margin: 5px 0; }
.ai-finance-controls button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 36px;
  padding: 3px 7px;
  border: 1px solid #d3c0e5;
  border-radius: 7px;
  background: #fff;
  color: #432368;
  font: inherit;
  font-size: .87em;
  font-weight: 700;
  cursor: pointer;
}
.ai-finance-controls button:hover, .ai-finance-controls button[aria-pressed="true"] { background: #e6d7f4; border-color: #8b68ae; }
.ai-finance-controls button:disabled { color: #5d5266; background: #ece8ee; cursor: default; }
.ai-finance-controls [data-icon] { width: 1em; height: 1em; }
.ai-ledger-scroll { max-height: clamp(126px, 11cqw, 220px); overflow: auto; border: 1px solid #ded0ea; border-radius: 7px; background: #fff; }
.ai-ledger { width: 100%; border-spacing: 0; text-align: left; font-size: .84em; }
.ai-ledger th, .ai-ledger td { padding: 4px 5px; border-bottom: 1px solid var(--ai-border); }
.ai-ledger thead { position: sticky; top: 0; z-index: 1; background: #eee4f9; }
.ai-ledger td { font-variant-numeric: tabular-nums; }
.ai-ledger td:nth-child(2), .ai-ledger td:nth-child(3) { white-space: nowrap; }
.ai-ledger small { display: block; font-size: .87em; font-weight: 400; }
.ai-ledger tr[data-ai-ledger-row="review"] { background: #fff2da; color: #5a3d18; }
.ai-ledger tr[data-ai-confirmed] { background: #e9f5ec; color: #245238; }
.ai-ledger tr[data-ai-confirmed] [data-ai-ledger-status]::after { content: "Подтверждено"; display: block; font-weight: 700; }
.ai-finance-message { margin: 0; min-height: 1.3em; color: var(--ai-muted); font-size: .85em; }
.ai-panel-links { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; justify-content: space-between; }
.ai-panel-links small { color: var(--ai-muted); font-size: clamp(11px, .78cqw, 14px); }
.ai-sales-summary, .ai-sales-email {
  margin: 0;
  padding: 9px;
  border: 1px solid var(--ai-border);
  border-radius: 8px;
  background: #fffdfa;
}
.ai-sales-summary { display: grid; gap: 7px; }
.ai-sales-summary dt { color: var(--ai-muted); font-size: .82em; font-weight: 700; }
.ai-sales-summary dd { margin: 1px 0 0; }
.ai-sales-email strong { color: var(--ai-ink); }
.ai-sales-email p { margin: 6px 0 0; color: var(--ai-muted); }
.ai-status { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }
.ai-detail, .ai-actions > a { display: inline-flex; align-items: center; gap: 6px; width: fit-content; font-weight: 700; text-underline-offset: .2em; }
.ai-detail { min-height: 28px; color: #582b93; font-size: clamp(12px, .89cqw, 18px); }
.ai-detail:hover, .ai-actions > a:hover { text-decoration: underline; }
.ai-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px clamp(9px, .8cqw, 17px); margin-top: clamp(11px, .9cqw, 21px); }
.ai-actions .button, .ai-actions > a {
  min-height: 44px;
  border-radius: 999px;
  padding: 0 clamp(12px, 1cqw, 24px);
  font-size: clamp(13px, .97cqw, 19px);
}
.ai-actions .button { background: var(--ai-accent); color: white; }
.ai-actions .button:hover { background: #48207f; }
.ai-actions > a { background: #fffbf7; color: #482176; border: 1px solid #d6c3e8; }
.ai-actions small { display: block; flex-basis: 100%; color: #473758; font-size: clamp(11px, .72cqw, 14px); }
.ai-detail [data-icon], .ai-actions [data-icon] { width: 1em; height: 1em; flex: none; }
#ai :focus-visible { outline: 2px solid var(--ai-accent); outline-offset: 2px; }

.ai-interactive-host {
  padding: clamp(28px, 5vw, 76px) 0;
  background: #f7effb;
  scroll-margin-top: calc(var(--header-h, 76px) + 16px);
}
#ai.ai-interactive-standalone {
  position: relative;
  container-type: inline-size;
  width: 100%;
  padding: 0;
  color: var(--ai-ink);
  scroll-margin-top: calc(var(--header-h, 76px) + 16px);
}
#ai.ai-interactive-standalone .ai-heading h2 { margin: 0; font-size: clamp(28px, 5vw, 48px); line-height: 1.1; }
#ai.ai-interactive-standalone .ai-heading > p { font-size: clamp(15px, 2vw, 19px); }
.ai-interactive-standalone [data-icon] { display: inline-flex; align-items: center; justify-content: center; }
.ai-interactive-standalone [data-icon] .ui-icon { width: 100%; height: 100%; }
.ai-interactive-standalone :is(.ai-brand-contact,.ai-scenario-contact).button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }

@media (max-width: 980px) {
  #ai { padding: 20px clamp(10px, 3vw, 18px); }
  #ai .ai-heading { padding: 0 3px; }
  #ai .ai-heading h2 { font-size: clamp(30px, 5vw, 38px); }
}
@media (max-width: 540px) {
  .ai-example { grid-template-columns: 1fr; }
  .ai-brand-comparison { grid-template-columns: 1fr; }
  .ai-brand-card, .ai-brand-placeholder { aspect-ratio: 1.12; }
  .ai-brand-product { width: min(63%, 188px); }
  .ai-result--layouts[data-brand-view="before"] .ai-proof--after,
  .ai-result--layouts[data-brand-view="after"] .ai-proof--before { display: none; }
  .ai-brand-switch { display: flex; gap: 6px; }
  .ai-brand-switch button {
    flex: 1;
    min-height: 44px;
    border: 1px solid #d5c1e7;
    border-radius: 8px;
    background: #fffaf9;
    color: var(--ai-accent);
    font: inherit;
    font-weight: 750;
    cursor: pointer;
  }
  .ai-brand-switch button[aria-pressed="true"] { border-color: var(--ai-accent); background: var(--ai-accent); color: #fff; }
  .ai-brand-switch button:disabled { color: #6e6279; background: #ece7f1; cursor: default; }
  .ai-finance-controls button { min-height: 44px; }
  .ai-input, .ai-result { min-height: 0; }
  .ai-input { gap: 7px; }
  .ai-placeholder { min-height: 96px; }
  .ai-tabs [data-icon] { display: none; }
}
