:root {
  --bg: #000000;
  --ink: #F4F4F4;
  --muted: #B0B0B0;
  --accent: #FF7301;
  --accent-soft: #FF9A4D;
  --ember: #B8320A;
  --on-accent: #000000;
  --panel: #0C0C0C;
  --panel-soft: #121212;
  --line: rgba(255, 115, 1, 0.4);
  --danger: #C4564A;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  background: #000000;
  color: var(--ink);
  color-scheme: dark;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

body {
  position: relative;
  overflow-x: hidden;
}

/* Как ChatAmbienceBackground: тёплый верх, чёрный низ, мягкие оранжевые пятна. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    #4A220C 0%,
    #3A1A0A 6%,
    #2A1409 12%,
    #1F1008 20%,
    #1A0E08 28%,
    #140C08 38%,
    #100A07 48%,
    #0C0806 58%,
    #080504 68%,
    #050302 78%,
    #030201 88%,
    #000000 100%
  );
}

#smoke {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.app {
  position: relative;
  z-index: 2;
  width: min(520px, 100%);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 20px clamp(16px, 4vw, 24px) calc(48px + env(safe-area-inset-bottom, 0px));
}

.rise {
  animation: rise 0.45s var(--ease) both;
}

.rise-2 { animation-delay: 0.06s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.header { margin-bottom: 16px; }

.brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

h1, .gate-card h2, .variants-title, .block-head h3, .variant-card h3 {
  margin: 0;
  font-family: inherit;
  font-weight: 700;
  letter-spacing: 0;
  text-shadow: none;
  text-transform: none;
}

h1, .gate-card h2 {
  font-size: 20px;
  line-height: 1.2;
  color: var(--accent);
}

.brand-tagline {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}

.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 16px;
}

.result.panel { margin-top: 8px; }

#result[hidden] {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

#result:not([hidden]) { display: block; }

.composer-main { min-width: 0; }

.prompt-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

label.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

input[type="text"],
input[type="search"] {
  width: 100%;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 12px;
  padding: 14px 16px;
  font: inherit;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.35;
  outline: none;
}

input::placeholder { color: var(--muted); }

input:focus { border-color: var(--accent); }

button {
  font-family: inherit;
  letter-spacing: 0;
  cursor: pointer;
  border: 0;
}

.cta {
  width: 100%;
  height: 50px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
}

.cta:disabled { opacity: 0.55; cursor: wait; }

.ghost {
  width: 100%;
  height: 50px;
  background: transparent;
  color: var(--accent);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
}

.selection-dock {
  margin-top: 12px;
  padding: 12px;
  background: var(--panel-soft);
  border-radius: 12px;
}

.selection-dock-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.ghost-link {
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  padding: 0;
}

.selection-chips { gap: 6px; }

.picker-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.picker-accordion,
.picker-sub {
  border: 1px solid rgba(255, 115, 1, 0.22);
  background: var(--panel-soft);
  border-radius: 12px;
}

.picker-accordion:not([open]) > :not(summary),
.picker-sub:not([open]) > :not(summary) {
  display: none;
}

.picker-accordion > summary,
.picker-sub > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.picker-accordion > summary::-webkit-details-marker,
.picker-sub > summary::-webkit-details-marker {
  display: none;
}

.picker-accordion > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.picker-accordion[open] > summary {
  border-bottom: 1px solid rgba(255, 115, 1, 0.18);
}

.picker-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.picker-label::before {
  content: "▸";
  color: var(--accent-soft);
  transition: transform 0.2s var(--ease);
}

.picker-accordion[open] .picker-label::before { transform: rotate(90deg); }

.picker-badge {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
}

.picker-badge.has-value { color: var(--accent-soft); }

.picker-body { padding: 10px 12px 14px; }

.picker-groups {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.picker-sub > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  font-size: 15px;
  font-weight: 400;
  color: var(--ink);
}

.sub-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sub-label img { height: 14px; width: auto; }

.sub-label::before {
  content: "›";
  color: var(--muted);
}

.picker-sub[open] .sub-label::before {
  transform: rotate(90deg);
  display: inline-block;
}

.sub-chips { padding: 8px 10px 10px; }

.picker-empty {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.flavor-dot,
.ingredient-chip .ing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.ingredient-chip .ing-dot { background: var(--accent); }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--panel-soft);
  border: 1px solid transparent;
  color: var(--ink);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
}

.chip img { height: 16px; width: auto; }
.chip small { color: var(--muted); font-size: 12px; font-weight: 400; }

.chip.active,
.chip.picked {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.chip.active small,
.chip.picked small { color: var(--on-accent); }

.flavor-lists,
.ingredient-lists {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.results-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 115, 1, 0.18);
}

.results-block:first-of-type {
  margin-top: 8px;
  padding-top: 0;
  border-top: 0;
}

.block-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}

.block-head h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
}

.block-kicker {
  color: var(--muted);
  font-size: 12px;
}

.error {
  min-height: 1.2em;
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 12px;
}

.mix-status {
  margin: 0;
  font-size: 12px;
  color: var(--accent-soft);
}

.mix-status.loading { animation: pulse-glow 1.2s ease-in-out infinite; }
.mix-status.done { color: var(--muted); }

.mix-timing {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 115, 1, 0.18);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.mix-timing strong { color: var(--accent-soft); font-weight: 600; }

@keyframes pulse-glow {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.bowl-svg {
  display: block;
  transform-origin: 50% 60%;
  filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.5));
}

.bowl-seg {
  cursor: pointer;
  transform-origin: center;
  transition: filter 0.28s var(--ease);
}

.bowl-seg:hover,
.bowl-seg.active {
  filter: brightness(1.12) drop-shadow(0 0 6px rgba(255, 115, 1, 0.45));
}

.variants-board { padding-top: 4px; }

.variants-title {
  margin: 0 0 6px;
  font-size: 20px;
  color: var(--accent);
}

.variants-mode {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--accent-soft);
}

.variants-mode span {
  color: var(--muted);
  margin-right: 6px;
}

.variants-intro,
.variant-desc,
.tagline {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.35;
}

.tagline { color: var(--accent-soft); }

.notes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
}

.note {
  border: 1px solid var(--line);
  color: var(--accent-soft);
  border-radius: 12px;
  padding: 4px 8px;
  font-size: 12px;
}

.parts {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.35;
}

.parts li { margin-bottom: 8px; }
.parts strong { color: var(--accent); }

.variants-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.variant-card {
  position: relative;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.variant-badge {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.variant-bowl-wrap {
  display: grid;
  place-items: center;
  margin: 4px 0 10px;
  min-height: 148px;
}

.variant-bowl {
  width: 160px;
  height: 160px;
  filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.5));
}

.variant-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.strength {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.strength-bar {
  flex: 1;
  height: 8px;
  background: #1A1A1A;
  border-radius: 12px;
  overflow: hidden;
}

.strength-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.8s var(--ease);
}

.variant-strength strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  min-width: 28px;
}

.variant-tooltip {
  margin: 0 0 8px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.3s var(--ease), max-height 0.35s var(--ease);
}

.variant-tooltip.show {
  opacity: 1;
  max-height: 80px;
}

.variant-tooltip h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 0 clamp(16px, 4vw, 24px);
  background: transparent;
}

.gate.hidden { display: none; }

.gate-card {
  width: min(520px, 100%);
  padding: 24px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  text-align: left;
}

.stamp {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
}

.gate-card p {
  margin: 8px 0 16px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.35;
}

.gate-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

html.embed,
html.embed body {
  min-height: 100%;
  min-height: 100dvh;
  background: #000000;
}


html.embed .header {
  display: none;
}

html.embed .app {
  width: 100%;
  max-width: 520px;
  min-height: 100%;
  padding-top: calc(48px + env(safe-area-inset-top, 0px));
}
