/* Shexpir — AI interior designer.
   "Gallery night": full-bleed 3D stage, floating glass UI,
   emerald + brass identity on a deep studio backdrop. */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #151814;                 /* глубокая студия */
  --text: #eceae1;
  --text-soft: #a2a49a;
  --emerald: #3e7b5d;
  --emerald-deep: #2f5d46;
  --emerald-glow: rgba(78, 148, 110, 0.35);
  --brass: #c9a24b;
  --error: #d98a77;

  --glass: rgba(22, 26, 22, 0.58);
  --glass-strong: rgba(20, 24, 20, 0.78);
  --glass-soft: rgba(255, 255, 255, 0.05);
  --hairline: rgba(255, 255, 255, 0.09);
  --hairline-strong: rgba(255, 255, 255, 0.16);

  --font-display: "Unbounded", system-ui, sans-serif;
  --font-body: "Golos Text", system-ui, sans-serif;

  --r-lg: 24px;
  --r-md: 14px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --blur: blur(26px) saturate(1.35);
}

html, body { height: 100%; }

body {
  position: relative;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
}

button, input, select { font-family: var(--font-body); }

:focus-visible {
  outline: 2px solid var(--emerald);
  outline-offset: 2px;
  border-radius: 6px;
}

.hidden { display: none !important; }

/* ------------------------------------------------ сцена во весь экран */

#viewport { position: absolute; inset: 0; }
#scene3d { width: 100%; height: 100%; display: block; }

/* ------------------------------------------------------- верхняя панель */

#topbar {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 452px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
  z-index: 5;
}
#topbar > * { pointer-events: auto; }

/* Keep brand at left; center only the middle panel on wide screens */
@media (min-width: 1100px) {
  .header-actions {
    /* position fixed so it's centered relative to the viewport, not
       the topbar container (keeps brand at left) */
    position: fixed;
    left: 50%;
    top: 18px;
    transform: translateX(-50%);
    z-index: 999;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px 8px 8px;
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4c8d68, var(--emerald-deep));
  color: #f1efe6;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  box-shadow: 0 0 22px var(--emerald-glow);
}

.brand-text { display: flex; flex-direction: column; gap: 0; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.brand-tag { font-size: 11px; color: var(--text-soft); letter-spacing: 0.02em; }

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px;
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.header-actions > button, #render-btn, #lang-select {
  background: transparent;
  color: var(--text);
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.18s, color 0.18s, transform 0.12s;
}
.header-actions > button:hover, #render-btn:hover {
  background: var(--glass-soft);
  color: #fff;
}
.header-actions > button:active, #render-btn:active { transform: scale(0.96); }
#render-btn:disabled { opacity: 0.5; cursor: default; }
#rooms-btn.signed-in { color: #8fc7a8; }
#realism-btn.active { color: #e8c476; border-color: rgba(232, 196, 118, 0.55); }

/* DEBUG-панель денойза (в продакшен не идёт) */
#pt-debug {
  position: absolute;
  right: 14px;
  bottom: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(21, 24, 20, 0.72);
  border: 1px dashed rgba(232, 196, 118, 0.4);
  color: #cfc6a8;
  font-size: 11px;
}
#pt-debug input[type="range"] { width: 110px; accent-color: #e8c476; }

#pt-status {
  position: absolute;
  right: 14px;
  bottom: 12px;
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(21, 24, 20, 0.72);
  border: 1px solid rgba(232, 196, 118, 0.35);
  color: #e8c476;
  font-size: 11.5px;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

#menu-btn {
  display: none;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
}

#lang-select {
  appearance: none;
  color: var(--text-soft);
  padding-right: 10px;
  font-size: 12px;
}
#lang-select:hover { color: var(--text); }
#lang-select option { background: #1c201c; color: var(--text); }

#render-wrap { position: relative; }
#render-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--glass-strong);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 6px;
  min-width: 185px;
  box-shadow: var(--shadow);
}
#render-menu button {
  background: none;
  border: none;
  color: var(--text);
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s;
}
#render-menu button:hover { background: var(--glass-soft); }

/* ------------------------------------------ чертёжный штамп проекта */

#stamp {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 5;
  display: flex;
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--hairline-strong);
  box-shadow: inset 0 0 0 3px transparent, inset 0 0 0 1px var(--hairline), var(--shadow);
  border-radius: 10px;
  overflow: hidden;
  animation: rise 0.6s cubic-bezier(0.2, 0.8, 0.3, 1) both 0.2s;
}

.stamp-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 18px 10px 15px;
  border-right: 1px solid var(--hairline);
}
.stamp-cell:last-child { border-right: none; }

.stamp-label {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 8px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.stamp-value { font-size: 14.5px; font-weight: 600; white-space: nowrap; }
.stamp-cost {
  color: var(--brass);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px rgba(201, 162, 75, 0.35);
}

#scene-hint {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  color: rgba(236, 234, 225, 0.4);
  font-size: 11px;
  letter-spacing: 0.03em;
  pointer-events: none;
  z-index: 4;
}

#item-info {
  position: absolute;
  left: 16px;
  top: 84px;
  z-index: 5;
  max-width: 250px;
  background: var(--glass-strong);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  padding: 13px 15px;
  line-height: 1.45;
  animation: rise 0.25s ease both;
}
#item-info h3 { font-size: 14px; margin-bottom: 3px; color: #a9d4bc; }
#item-info .dim { color: var(--text-soft); font-size: 12px; }
#item-info .price { margin-top: 5px; font-weight: 600; color: var(--brass); }
#item-info .iid { color: var(--text-soft); font-size: 10.5px; margin-top: 2px; }

/* --------------------------------------------------- плавающий чат */

#chat {
  position: absolute;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: 420px;
  display: flex;
  flex-direction: column;
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 6;
  /* без fill-mode: иначе финальный кейфрейм навсегда перебивает
     transform из body.chat-collapsed */
  animation: slide-in 0.55s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--hairline);
}

.chat-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4c8d68, var(--emerald-deep));
  color: #f1efe6;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  transition: box-shadow 0.3s;
}
.chat-head:has(.busy) .chat-avatar {
  animation: pulse 1.6s ease-in-out infinite;
}

.chat-title h1 { font-size: 15px; font-weight: 600; letter-spacing: 0.01em; }
.chat-title p { font-size: 12px; color: var(--text-soft); }
.chat-title p.busy { color: #8fc7a8; }

#chat-collapse {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: none;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--text-soft);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
#chat-collapse:hover { color: var(--text); border-color: var(--hairline-strong); }

/* Свёрнутый чат: панель уезжает вправо, остаётся плавающая кнопка */
#chat {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}
body.chat-collapsed #chat {
  transform: translateX(calc(100% + 32px));
  opacity: 0;
  pointer-events: none;
}

#chat-fab {
  position: absolute;
  right: 20px;
  bottom: 20px;
  z-index: 7;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--hairline-strong);
  background: linear-gradient(135deg, #4c8d68, var(--emerald-deep));
  color: #f1efe6;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px;
  cursor: pointer;
  box-shadow: 0 0 26px var(--emerald-glow), var(--shadow);
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.3, 1.3), opacity 0.2s ease;
}
body.chat-collapsed #chat-fab {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}
#chat-fab:hover { box-shadow: 0 0 36px var(--emerald-glow), var(--shadow); }
#chat-fab.unread::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--brass);
  border: 2px solid #1a1e1a;
}

#guest-hint {
  padding: 8px 18px;
  font-size: 12px;
  color: #a9d4bc;
  background: rgba(78, 148, 110, 0.10);
  border-bottom: 1px solid var(--hairline);
}

#messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--hairline-strong) transparent;
}

.msg {
  max-width: 92%;
  padding: 10px 14px;
  border-radius: 16px;
  line-height: 1.5;
  white-space: pre-wrap;
  animation: rise 0.25s ease both;
}
.msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #3e7b5d, #2c523e);
  color: #f1f0e8;
  border-bottom-right-radius: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}
.msg.bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--hairline);
  border-bottom-left-radius: 6px;
}
.msg.bot.error { border-color: rgba(217, 138, 119, 0.5); color: var(--error); }
.msg.bot strong { color: #a9d4bc; }
.msg.bot code {
  font-size: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--hairline);
  border-radius: 5px;
  padding: 0 4px;
}

.msg.render { padding: 6px; background: rgba(255, 255, 255, 0.055); }
.msg.render img {
  display: block;
  max-width: 100%;
  border-radius: 12px;
  cursor: zoom-in;
}

.actions { align-self: flex-start; display: flex; flex-wrap: wrap; gap: 4px; max-width: 95%; }
.action-chip {
  font-size: 10.5px;
  color: #8fc7a8;
  background: rgba(78, 148, 110, 0.12);
  border: 1px solid rgba(78, 148, 110, 0.3);
  padding: 2px 9px;
  border-radius: 999px;
}
.action-chip.failed {
  color: var(--error);
  background: rgba(217, 138, 119, 0.08);
  border-color: rgba(217, 138, 119, 0.35);
}

.typing { align-self: flex-start; color: var(--text-soft); font-size: 12px; padding: 4px 2px; }
.typing::after { content: "…"; animation: dots 1.2s infinite; }
@keyframes dots { 0% { content: ""; } 33% { content: "."; } 66% { content: ".."; } 100% { content: "..."; } }

#suggestions { display: flex; flex-direction: column; gap: 7px; padding: 12px 16px; }

.chip {
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 11px 13px;
  cursor: pointer;
  font-size: 12.5px;
  line-height: 1.35;
  transition: border-color 0.18s, transform 0.18s, background 0.18s, box-shadow 0.18s;
}
.chip:hover {
  border-color: rgba(78, 148, 110, 0.55);
  background: rgba(78, 148, 110, 0.08);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.chip .swatch {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  border-radius: 5px;
  background: var(--sw, var(--emerald));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 0 10px color-mix(in srgb, var(--sw, var(--emerald)) 45%, transparent);
}

#chat-form {
  display: flex;
  gap: 8px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--hairline);
}
#chat-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: var(--text);
  padding: 11px 16px;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
#chat-input::placeholder { color: var(--text-soft); }
#chat-input:focus {
  border-color: rgba(78, 148, 110, 0.6);
  box-shadow: 0 0 0 3px rgba(78, 148, 110, 0.18);
}
#send-btn {
  width: 46px;
  background: linear-gradient(135deg, #4c8d68, var(--emerald-deep));
  color: #f1efe6;
  border: none;
  border-radius: 50%;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.2s;
  box-shadow: 0 0 18px var(--emerald-glow);
}
#send-btn:hover { box-shadow: 0 0 26px var(--emerald-glow); }
#send-btn:active { transform: scale(0.93); }
#send-btn:disabled { opacity: 0.5; cursor: default; box-shadow: none; }

/* --------------------------------------------------- модалка комнат */

#rooms-modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 8, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#rooms-panel {
  width: 372px;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--glass-strong);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--hairline-strong);
  border-radius: 22px;
  padding: 20px;
  box-shadow: var(--shadow);
  animation: rise 0.3s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}
#rooms-panel header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding: 0;
  border: none;
}
#rooms-panel h2 { font-size: 16px; font-weight: 600; }
#rooms-close {
  background: none;
  border: none;
  color: var(--text-soft);
  font-size: 15px;
  cursor: pointer;
}
#rooms-close:hover { color: var(--text); }

#auth-block input {
  width: 100%;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  color: var(--text);
  padding: 11px 13px;
  font-size: 13px;
  margin-bottom: 9px;
  outline: none;
  transition: border-color 0.18s;
}
#auth-block input:focus { border-color: rgba(78, 148, 110, 0.6); }

#rooms-panel .row { display: flex; gap: 8px; }
#rooms-panel .row button, #auth-signout {
  flex: 1;
  padding: 11px 12px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #4c8d68, var(--emerald-deep));
  color: #f1efe6;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: box-shadow 0.2s;
}
#rooms-panel .row button:hover { box-shadow: 0 0 20px var(--emerald-glow); }
#rooms-panel button.ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-soft);
  border: 1px solid var(--hairline);
}
#rooms-panel button.ghost:hover { color: var(--text); border-color: var(--hairline-strong); box-shadow: none; }

#auth-block button.oauth {
  width: 100%;
  padding: 11px 12px;
  margin-bottom: 9px;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}
#auth-block button.oauth:hover { border-color: var(--hairline-strong); background: rgba(255, 255, 255, 0.1); }
#auth-block .oauth-or { text-align: center; margin: 3px 0 9px; }

#rooms-panel .hint { color: var(--text-soft); font-size: 12.5px; line-height: 1.5; margin-bottom: 12px; }
#rooms-panel .error { color: var(--error); font-size: 12.5px; margin-top: 9px; }

#scan-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 12px; }
.scan-item {
  text-align: left;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 11px 13px;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  line-height: 1.4;
  transition: border-color 0.18s, background 0.18s;
}
.scan-item:hover { border-color: rgba(78, 148, 110, 0.55); background: rgba(78, 148, 110, 0.08); }
.scan-item .meta { color: var(--text-soft); font-size: 11.5px; }

/* --------------------------------------- embed-режим (iOS WebView) */

/* Авторизация, выбор комнат и язык живут в нативном приложении */
body.embed-ios #rooms-btn,
body.embed-ios #lang-select { display: none !important; }

/* ------------------------------------------- wizard дизайн-брифа */

#brief-modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 8, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 21;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#brief-panel {
  width: 400px;
  max-width: calc(100vw - 24px);
  max-height: 84vh;
  overflow-y: auto;
  background: var(--glass-strong);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--hairline-strong);
  border-radius: 22px;
  padding: 20px;
  box-shadow: var(--shadow);
  animation: rise 0.3s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}
#brief-panel header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding: 0;
  border: none;
}
#brief-panel h2 { font-size: 16px; font-weight: 600; }
#brief-close {
  background: none;
  border: none;
  color: var(--text-soft);
  font-size: 15px;
  cursor: pointer;
}
#brief-close:hover { color: var(--text); }

#brief-steps { min-height: 180px; }
#brief-steps h3 { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
#brief-steps .hint { color: var(--text-soft); font-size: 12.5px; line-height: 1.5; margin-bottom: 12px; }

.brief-options { display: flex; gap: 8px; margin-bottom: 12px; }
.brief-options.wrap { flex-wrap: wrap; }
.brief-option {
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}
.brief-option:hover { border-color: rgba(78, 148, 110, 0.55); }
.brief-option.selected {
  border-color: rgba(78, 148, 110, 0.85);
  background: rgba(78, 148, 110, 0.16);
}
.brief-option.pill { padding: 5px 10px; font-size: 12px; border-radius: 999px; }

.brief-keep-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 12.5px;
}
.brief-pills { display: flex; gap: 5px; }

.brief-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  color: var(--text);
  padding: 11px 13px;
  font-size: 13px;
  margin: 6px 0 12px;
  outline: none;
  resize: none;
  font-family: inherit;
  transition: border-color 0.18s;
}
.brief-input:focus { border-color: rgba(78, 148, 110, 0.6); }

.brief-packs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pack-card {
  text-align: left;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 11px 13px;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}
.pack-card:hover { border-color: rgba(78, 148, 110, 0.55); }
.pack-card.selected {
  border-color: rgba(78, 148, 110, 0.85);
  background: rgba(78, 148, 110, 0.12);
}
.pack-swatches { display: flex; gap: 4px; margin-bottom: 7px; }
.pack-swatches .swatch {
  width: 14px; height: 14px;
  border-radius: 4px;
  background: var(--sw);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.pack-name { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.pack-desc { font-size: 11px; color: var(--text-soft); line-height: 1.45; }

.brief-summary p { font-size: 12.5px; line-height: 1.6; color: var(--text); }

#brief-dots { display: flex; gap: 5px; justify-content: center; margin: 14px 0; }
.brief-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--hairline-strong);
  transition: background 0.2s;
}
.brief-dot.active { background: #4c8d68; }
.brief-dot.done { background: rgba(78, 148, 110, 0.5); }

#brief-panel .row { display: flex; gap: 8px; }
#brief-panel .row button {
  flex: 1;
  padding: 11px 12px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #4c8d68, var(--emerald-deep));
  color: #f1efe6;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: box-shadow 0.2s;
}
#brief-panel .row button:hover { box-shadow: 0 0 20px var(--emerald-glow); }
#brief-panel .row button:disabled { opacity: 0.45; cursor: default; box-shadow: none; }
#brief-panel button.ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-soft);
  border: 1px solid var(--hairline);
}
#brief-panel button.ghost:hover { color: var(--text); border-color: var(--hairline-strong); box-shadow: none; }

/* Карточка брифа в чате */
.msg.brief-card h4 { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.msg.brief-card p { font-size: 12.5px; line-height: 1.55; }
.brief-card-actions { display: flex; gap: 8px; margin-top: 10px; }
.brief-card-actions button {
  flex: 1;
  padding: 9px 11px;
  border-radius: 11px;
  border: none;
  background: linear-gradient(135deg, #4c8d68, var(--emerald-deep));
  color: #f1efe6;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: box-shadow 0.2s;
}
.brief-card-actions button:hover { box-shadow: 0 0 18px var(--emerald-glow); }
.brief-card-actions button.ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-soft);
  border: 1px solid var(--hairline);
}

/* --------------------------------------------------------- моушен */

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes slide-in {
  from { opacity: 0; transform: translateX(26px); }
  to { opacity: 1; transform: none; }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--emerald-glow); }
  50% { box-shadow: 0 0 0 9px rgba(78, 148, 110, 0); }
}

/* ------------------------------------------------------ адаптация */

@media (max-width: 900px) {
  #topbar { top: 10px; left: 10px; right: 10px; }
  .brand { padding: 6px 12px 6px 6px; }
  .brand-mark { width: 32px; height: 32px; font-size: 14px; }
  .brand-tag { display: none; }
  .brand-name { font-size: 12px; }

  /* Бургер: кнопки прячутся в вертикальное меню */
  #menu-btn { display: grid; }
  /* Keep brand anchored to the top so expanding the menu doesn't push it down */
  .brand { align-self: flex-start; }
  /* If menu is open, align topbar contents to the start to avoid vertical centering */
  #topbar:has(.header-actions.open) { align-items: flex-start; }
  .header-actions:not(.open) > *:not(#menu-btn) { display: none; }
  .header-actions.open {
    flex-direction: column;
    align-items: stretch;
    border-radius: 20px;
    padding: 8px;
    gap: 2px;
    background: var(--glass-strong);
  }
  .header-actions.open #menu-btn { justify-self: end; margin-left: auto; }
  .header-actions.open > button,
  .header-actions.open #render-btn,
  .header-actions.open #lang-select {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 14px;
  }
  .header-actions.open #render-wrap { display: block; }
  .header-actions.open #render-menu { position: static; margin-top: 2px; box-shadow: none; }

  #chat {
    top: auto;
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    height: 52vh;
    animation: none;
  }

  /* Штамп: сетка 2x2 на всю ширину экрана */
  #stamp {
    left: 10px;
    right: 10px;
    bottom: calc(52vh + 20px);
    display: grid;
    grid-template-columns: 1fr 1fr;
    transform: none;
  }
  body.chat-collapsed #stamp { bottom: 10px; right: 86px; }
  .stamp-cell { padding: 8px 12px 7px; border-right: none; min-width: 0; }
  .stamp-cell:nth-child(odd) { border-right: 1px solid var(--hairline); }
  .stamp-cell:nth-child(-n+2) { border-bottom: 1px solid var(--hairline); }
  .stamp-label { font-size: 7.5px; }
  .stamp-value { font-size: 13px; overflow: hidden; text-overflow: ellipsis; }

  #chat-fab { right: 14px; bottom: 14px; width: 52px; height: 52px; }

  #scene-hint, #suggestions { display: none; }
  #item-info { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
