:root {
  --flank: 280px;
  --brand-left: 26px;
  --rail-left: 18px;
  --logo-size: 44px;
  --about-gap: 80px;
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

html[data-theme="light"] {
  --flank-bg: #f4f7fb;
  --main-bg: #ffffff;
  --surface: #f4f7fb;
  --surface-2: #ffffff;
  --text: #16223A;
  --subtext: #66748b;
  --stroke: rgba(22, 34, 58, 0.08);
  --primary: #16223A;
  --on-primary: #EEF3FB;
  --shadow: 0 24px 80px rgba(15, 23, 42, 0.12);
}

html[data-theme="dark"] {
  --flank-bg: #172033;
  --main-bg: #1d2940;
  --surface: #172033;
  --surface-2: #1d2940;
  --text: #EEF3FB;
  --subtext: #AAB6C9;
  --stroke: rgba(238, 243, 251, 0.08);
  --primary: #EEF3FB;
  --on-primary: #16223A;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body,
button,
input,
textarea,
label,
div,
span,
a {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-weight: 400;
}

body {
  background: var(--main-bg);
  color: var(--text);
  user-select: text;
}

button,
a,
input,
textarea {
  color: inherit;
}

button,
a {
  cursor: pointer;
}

button {
  border: 0;
  background: transparent;
}

input,
textarea {
  outline: none;
}

.app-shell {
  min-height: 100vh;
  background: var(--main-bg);
}

.topbar {
  display: grid;
  grid-template-columns: var(--flank) 1fr auto;
  align-items: start;
  min-height: 88px;
  background: var(--main-bg);
}

.lab-brand-row {
  width: var(--flank);
  min-height: 88px;
  background: var(--flank-bg);
  display: flex;
  align-items: flex-start;
  gap: var(--about-gap);
  padding: 18px 0 0 var(--brand-left);
}

.lab-logo-btn {
  width: var(--logo-size);
  height: var(--logo-size);
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: flex-start;
  justify-content: flex-start;
}

.lab-logo-sign {
  width: var(--logo-size);
  height: var(--logo-size);
  display: block;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

html[data-theme="light"] .lab-logo-sign,
body[data-theme="light"] .lab-logo-sign {
  background-image: url("./logo-sign-day-final.png?v=2");
}

html[data-theme="dark"] .lab-logo-sign,
body[data-theme="dark"] .lab-logo-sign {
  background-image: url("./logo-sign-night-final.png?v=2");
}

.lab-about-link {
  display: inline-flex;
  align-items: flex-start;
  justify-content: center;
  margin-top: 2px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  letter-spacing: 0.01em;
}

.topbar-spacer {
  min-height: 88px;
}

.topbar-actions {
  min-height: 88px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 18px 26px 0 0;
}

.theme-toggle-btn {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--stroke);
}

.theme-toggle-glyph {
  font-size: 22px;
  line-height: 1;
}

.body-shell {
  display: grid;
  grid-template-columns: var(--flank) 1fr;
  min-height: calc(100vh - 88px);
}

.left-rail {
  width: var(--flank);
  min-width: var(--flank);
  max-width: var(--flank);
  background: var(--flank-bg);
  padding: 22px 0 20px var(--rail-left);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sidebar-card,
.sidebar-user-shell {
  width: calc(var(--flank) - var(--rail-left));
}

.sidebar-card {
  display: grid;
  gap: 18px;
}

.sidebar-primary-link {
  height: 48px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 0 14px;
  background: transparent;
  color: var(--text);
}

.sidebar-primary-link:hover,
.sidebar-user-shell:hover {
  background: rgba(127, 127, 127, 0.06);
}

.sidebar-btn-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-block;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}

.sidebar-btn-icon-new {
  -webkit-mask-image: url("./new-chat-icon.svg?v=1");
  mask-image: url("./new-chat-icon.svg?v=1");
}

.sidebar-history-block {
  display: grid;
  gap: 10px;
}

.sidebar-history-title {
  font-size: 14px;
  color: var(--subtext);
}

.chat-history-list {
  display: grid;
  gap: 8px;
}

.history-empty {
  font-size: 13px;
  line-height: 1.45;
  color: var(--subtext);
}

.sidebar-user-shell {
  height: 52px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 0 14px;
  color: var(--text);
}

.account-entry-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.account-entry-svg {
  width: 24px;
  height: 24px;
}

.account-avatar-fallback {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  background: var(--primary);
  color: var(--on-primary);
}

.center-stage {
  background: var(--main-bg);
  padding: 0 26px 24px 24px;
  display: flex;
}

#chatViewportV34 {
  width: 100%;
  min-height: calc(100vh - 112px);
  display: flex;
  flex-direction: column;
}

.dialog-window {
  flex: 1 1 auto;
  background: transparent;
  box-shadow: none;
  padding: 0 0 18px 0;
}

.welcome-state {
  padding: 18px 0 8px 0;
}

.welcome-title {
  font-size: 32px;
  line-height: 1.05;
  font-weight: 400;
  margin-bottom: 8px;
}

.welcome-subtitle {
  font-size: 15px;
  line-height: 1.45;
  color: var(--subtext);
}

.chat-messages {
  padding-top: 10px;
}

.dialog-composer-surface {
  position: relative;
  min-height: 112px;
  border-radius: var(--radius-xl);
  padding: 18px 68px 18px 68px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
}

.dialog-composer-input {
  width: 100%;
  min-height: 56px;
  resize: none;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  line-height: 1.45;
  padding: 0;
}

.dialog-composer-input::placeholder {
  color: var(--subtext);
}

.dialog-composer-actions {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  height: 44px;
  pointer-events: none;
}

.dialog-bar-btn,
.dialog-bar-btn-primary {
  position: absolute;
  bottom: 0;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.dialog-bar-btn {
  left: 0;
  background: transparent;
  color: var(--text);
}

.dialog-bar-btn-primary {
  right: 0;
  background: var(--primary);
  color: var(--on-primary);
}

.ui-icon {
  width: 18px;
  height: 18px;
  display: block;
}

#dialogSendBtn {
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
  background-image: url("./send-idle-icon.svg?v=1");
}

#dialogSendBtn .ui-icon-send {
  display: none;
}

#dialogSendBtn.has-pending-input {
  background-image: none;
}

#dialogSendBtn.has-pending-input .ui-icon-send {
  display: block;
}

.composer-file-tray[hidden],
#chatMessages[hidden] {
  display: none !important;
}

.composer-file-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.file-chip {
  height: 32px;
  border-radius: 999px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  background: rgba(127, 127, 127, 0.08);
  color: var(--text);
  font-size: 13px;
}

.auth-modal[hidden],
#cookieBanner[hidden],
#cookieModal[hidden] {
  display: none !important;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
}

.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 22, 0.42);
  backdrop-filter: blur(8px);
}

.auth-modal-card {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(920px, calc(100vw - 48px));
  min-height: 180px;
  border-radius: 28px;
  padding: 30px 30px 26px 30px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  z-index: 3001;
}

.auth-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  font-size: 28px;
  line-height: 1;
  color: var(--subtext);
}

.auth-sheet-head {
  margin-bottom: 22px;
  max-width: 640px;
}

.auth-sheet-title {
  font-size: 28px;
  line-height: 1.05;
  margin-bottom: 10px;
}

.auth-sheet-subtitle {
  font-size: 15px;
  line-height: 1.45;
  color: var(--subtext);
}

.auth-sheet-form {
  display: grid;
  gap: 18px;
}

.auth-sheet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.auth-sheet-label {
  display: grid;
  gap: 8px;
  font-size: 13px;
}

.auth-sheet-input {
  width: 100%;
  height: 56px;
  border-radius: 18px;
  padding: 0 16px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
}

.auth-consent-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 12px;
  align-items: start;
  font-size: 14px;
  line-height: 1.45;
  color: var(--subtext);
}

.auth-sheet-actions {
  display: flex;
  justify-content: flex-end;
}

.auth-submit-btn {
  min-width: 168px;
  height: 48px;
  padding: 0 18px;
  border-radius: 16px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 14px;
}

#cookieBanner {
  position: fixed;
  left: 24px;
  right: 24px;
  bottom: 24px;
  z-index: 3500;
}

.cookie-banner-card {
  max-width: 980px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  padding: 20px 20px 18px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
}

.cookie-banner-title {
  font-size: 20px;
  line-height: 1.1;
  font-weight: 600;
  margin-bottom: 10px;
}

.cookie-banner-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--subtext);
  max-width: 860px;
  margin-bottom: 16px;
}

.cookie-banner-actions,
.cookie-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.cookie-btn {
  height: 46px;
  padding: 0 16px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 500;
}

.cookie-btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}

.cookie-btn-secondary {
  background: var(--surface);
  color: var(--text);
}

#cookieModal {
  position: fixed;
  inset: 0;
  z-index: 3600;
}

.cookie-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 22, 0.42);
  backdrop-filter: blur(8px);
}

.cookie-modal-card {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(760px, calc(100vw - 40px));
  border-radius: var(--radius-lg);
  padding: 24px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  z-index: 3601;
}

.cookie-modal-title {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.1;
  margin-bottom: 12px;
}

.cookie-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 12px 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--subtext);
}

@media (max-width: 860px) {
  :root {
    --flank: 240px;
    --brand-left: 18px;
    --rail-left: 14px;
    --about-gap: 36px;
  }

  .auth-sheet-grid {
    grid-template-columns: 1fr;
  }

  .auth-modal-card {
    width: calc(100vw - 28px);
    padding: 22px 18px 18px;
  }

  .center-stage {
    padding: 0 14px 18px 14px;
  }
}

@media (max-width: 760px) {
  .body-shell {
    grid-template-columns: 1fr;
  }

  .left-rail {
    display: none;
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .lab-brand-row {
    width: auto;
    background: var(--main-bg);
    padding-left: 18px;
    gap: 22px;
  }

  #cookieBanner {
    left: 14px;
    right: 14px;
    bottom: 14px;
  }

  .cookie-banner-actions {
    flex-direction: column;
  }
}


/* LAB WELCOME CENTER V1 */

.dialog-window {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.welcome-state {
  width: 100% !important;
  min-height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  padding: 0 !important;
}

.welcome-title {
  margin: 0 !important;
}


/* LAB SEND IDLE FIX V2 */

#dialogSendBtn {
  background-color: transparent !important;
  background-image: url("./send-idle-icon.svg?v=1") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 18px 18px !important;
  color: var(--text) !important;
}

#dialogSendBtn .ui-icon-send {
  display: none !important;
}

#dialogSendBtn.has-pending-input {
  background-image: none !important;
  background-color: var(--primary) !important;
  color: var(--on-primary) !important;
}

#dialogSendBtn.has-pending-input .ui-icon-send {
  display: block !important;
}


/* LAB ABOUT DROPDOWN + TARIFFS V1 */

.about-menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: flex-start;
}

.about-dropdown[hidden] {
  display: none !important;
}

.about-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  min-width: 220px;
  border-radius: 18px;
  padding: 8px;
  box-shadow: var(--shadow);
  border: 1px solid var(--stroke);
  z-index: 3100;
}

html[data-theme="light"] .about-dropdown,
body[data-theme="light"] .about-dropdown {
  background: #ffffff;
}

html[data-theme="dark"] .about-dropdown,
body[data-theme="dark"] .about-dropdown {
  background: #1d2940;
}

.about-dropdown-item {
  width: 100%;
  min-height: 42px;
  border-radius: 12px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-size: 14px;
  text-decoration: none;
  color: var(--text);
  background: transparent;
}

.about-dropdown-item:hover {
  background: rgba(127, 127, 127, 0.08);
}

.tariffs-modal-card {
  width: min(980px, calc(100vw - 48px));
  min-height: 220px;
}

.tariffs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.tariff-card {
  border-radius: 20px;
  padding: 18px 18px 16px 18px;
  border: 1px solid var(--stroke);
  background: var(--surface);
}

.tariff-name {
  font-size: 18px;
  line-height: 1.15;
  font-weight: 600;
  margin-bottom: 8px;
}

.tariff-price {
  font-size: 15px;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 10px;
}

.tariff-desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--subtext);
}

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


/* LAB ATTACH ICON +20 V1 */
#dialogUploadBtn .ui-icon-attach {
  width: 21.6px !important;
  height: 21.6px !important;
}


/* LAB HEADER + SIDEBAR TYPE + SEND NIGHT FIX V1 */

/* 1) Sod.Go в topbar */
.lab-about-link {
  text-decoration: none !important;
  font-weight: 600 !important;
  font-size: 16px !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.lab-about-link::after {
  content: "▾" !important;
  display: inline-block !important;
  font-size: 12px !important;
  line-height: 1 !important;
  transform: translateY(1px) !important;
}

/* 2) Чуть крупнее тексты левого фланга */
#newChatBtn,
#sidebarUserShell,
.sidebar-history-title {
  font-size: 15px !important;
  line-height: 1.2 !important;
}

#newChatBtn span:last-child,
#sidebarUserShell .sidebar-user-name {
  font-size: 15px !important;
}

/* 3) В night idle убрать чёрный круг у send */
#dialogSendBtn {
  background-color: transparent !important;
  box-shadow: none !important;
}

#dialogSendBtn:not(.has-pending-input) {
  background-color: transparent !important;
  background-image: url("./send-idle-icon.svg?v=1") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 18px 18px !important;
  color: var(--text) !important;
}

#dialogSendBtn:not(.has-pending-input) .ui-icon-send {
  display: none !important;
}

#dialogSendBtn.has-pending-input {
  background-image: none !important;
  background-color: var(--primary) !important;
  color: var(--on-primary) !important;
}

#dialogSendBtn.has-pending-input .ui-icon-send {
  display: block !important;
}


/* LAB SIDEBAR SIZE + HISTORY CLEAN + SEND IDLE V2 */

/* тексты слева ещё чуть крупнее */
#newChatBtn,
#sidebarUserShell,
.sidebar-history-title {
  font-size: 16px !important;
  line-height: 1.2 !important;
}

#newChatBtn span:last-child,
#sidebarUserShell .sidebar-user-name {
  font-size: 16px !important;
}

/* убрать пустой текст под историей */
.history-empty {
  display: none !important;
}

/* idle send без круга вообще, и в light, и в dark */
#dialogSendBtn:not(.has-pending-input) {
  background: transparent !important;
  background-color: transparent !important;
  background-image: url("./send-idle-icon.svg?v=1") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 18px 18px !important;
  box-shadow: none !important;
  border: 0 !important;
  color: var(--text) !important;
}

#dialogSendBtn:not(.has-pending-input)::before,
#dialogSendBtn:not(.has-pending-input)::after {
  display: none !important;
  content: none !important;
}

#dialogSendBtn:not(.has-pending-input) .ui-icon-send {
  display: none !important;
}

html[data-theme="dark"] #dialogSendBtn:not(.has-pending-input),
body[data-theme="dark"] #dialogSendBtn:not(.has-pending-input),
html[data-theme="light"] #dialogSendBtn:not(.has-pending-input),
body[data-theme="light"] #dialogSendBtn:not(.has-pending-input) {
  background-color: transparent !important;
  box-shadow: none !important;
}


/* LAB ABOUT + SEND HARD FIX V3 */

/* Sod.Go чуть крупнее + нормальная стрелка */
.lab-about-link {
  text-decoration: none !important;
  font-weight: 600 !important;
  font-size: 18px !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.lab-about-link::after {
  content: "" !important;
  display: inline-block !important;
  width: 8px !important;
  height: 8px !important;
  border-right: 2px solid currentColor !important;
  border-bottom: 2px solid currentColor !important;
  transform: translateY(-1px) rotate(45deg) !important;
  flex: 0 0 8px !important;
}

/* Send idle: только иконка, вообще без круга */
#dialogSendBtn {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
}

#dialogSendBtn .send-idle-glyph {
  width: 18px !important;
  height: 18px !important;
  display: block !important;
  background-color: currentColor !important;
  -webkit-mask: url("./send-idle-icon.svg?v=1") no-repeat center / contain !important;
  mask: url("./send-idle-icon.svg?v=1") no-repeat center / contain !important;
  pointer-events: none !important;
}

#dialogSendBtn:not(.has-pending-input) {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  border: 0 !important;
  color: var(--text) !important;
}

#dialogSendBtn:not(.has-pending-input) .send-idle-glyph {
  display: block !important;
}

#dialogSendBtn:not(.has-pending-input) .ui-icon-send,
#dialogSendBtn:not(.has-pending-input) svg.ui-icon-send {
  display: none !important;
}

#dialogSendBtn.has-pending-input {
  background: var(--primary) !important;
  background-color: var(--primary) !important;
  background-image: none !important;
  box-shadow: none !important;
  border: 0 !important;
  color: var(--on-primary) !important;
}

#dialogSendBtn.has-pending-input .send-idle-glyph {
  display: none !important;
}

#dialogSendBtn.has-pending-input .ui-icon-send,
#dialogSendBtn.has-pending-input svg.ui-icon-send {
  display: block !important;
}


/* LAB LEGAL NOTE V1 */

.composer-legal-note {
  margin-top: 12px;
  padding: 0 6px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--subtext);
  text-align: center;
}

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

html[data-theme="light"] .composer-legal-note,
body[data-theme="light"] .composer-legal-note {
  color: #66748b;
}

html[data-theme="dark"] .composer-legal-note,
body[data-theme="dark"] .composer-legal-note {
  color: #AAB6C9;
}

html[data-theme="light"] .composer-legal-note a,
body[data-theme="light"] .composer-legal-note a {
  color: #16223A;
}

html[data-theme="dark"] .composer-legal-note a,
body[data-theme="dark"] .composer-legal-note a {
  color: #EEF3FB;
}


/* LAB LEFT FLANK PHOTO PASS V1 */
/* Не трогаем блок Войти */

.left-rail {
  padding-top: 22px !important;
  padding-left: 20px !important;
  padding-bottom: 24px !important;
}

html[data-theme="light"] .left-rail,
body[data-theme="light"] .left-rail {
  background: #f4f5f8 !important;
  box-shadow: inset -1px 0 0 rgba(22, 34, 58, 0.06) !important;
}

html[data-theme="dark"] .left-rail,
body[data-theme="dark"] .left-rail {
  box-shadow: inset -1px 0 0 rgba(238, 243, 251, 0.06) !important;
}

.sidebar-card {
  gap: 26px !important;
  padding-top: 58px !important;
}

/* Новый чат — чище и ближе к референсу */
#newChatBtn {
  width: 100% !important;
  min-height: 50px !important;
  padding: 0 14px !important;
  border-radius: 16px !important;
  justify-content: flex-start !important;
  gap: 14px !important;
  font-size: 16px !important;
  line-height: 1.2 !important;
}

html[data-theme="light"] #newChatBtn,
body[data-theme="light"] #newChatBtn {
  color: #16223A !important;
  background: transparent !important;
}

html[data-theme="light"] #newChatBtn:hover,
body[data-theme="light"] #newChatBtn:hover {
  background: rgba(22, 34, 58, 0.035) !important;
}

/* История чатов — отдельный мягкий блок */
.sidebar-history-block {
  width: 100% !important;
  border-radius: 22px !important;
  padding: 18px 18px 20px 18px !important;
  display: grid !important;
  gap: 12px !important;
}

html[data-theme="light"] .sidebar-history-block,
body[data-theme="light"] .sidebar-history-block {
  background: rgba(255, 255, 255, 0.68) !important;
  border: 1px solid rgba(22, 34, 58, 0.05) !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04) !important;
}

html[data-theme="dark"] .sidebar-history-block,
body[data-theme="dark"] .sidebar-history-block {
  background: rgba(255, 255, 255, 0.035) !important;
  border: 1px solid rgba(238, 243, 251, 0.05) !important;
}

.sidebar-history-title {
  font-size: 16px !important;
  line-height: 1.2 !important;
  letter-spacing: -0.01em !important;
}

html[data-theme="light"] .sidebar-history-title,
body[data-theme="light"] .sidebar-history-title {
  color: #66748b !important;
}

.chat-history-list {
  min-height: 36px !important;
}

/* Иконка нового чата — чуть аккуратнее */
.sidebar-btn-icon-new {
  opacity: 0.96 !important;
}

/* Верхний бренд-ряд тоже чуть ближе к фото */
.lab-brand-row {
  gap: 18px !important;
  padding-top: 20px !important;
  padding-left: 20px !important;
}

.lab-about-link {
  font-size: 17px !important;
  line-height: 1 !important;
}


/* LAB LEFT FLANK REBUILD V2 */
/* Войти не трогаем */

:root {
  --flank: 280px;
  --rail-pad-left: 20px;
}

.left-rail {
  width: var(--flank) !important;
  min-width: var(--flank) !important;
  max-width: var(--flank) !important;
  padding: 18px 0 24px var(--rail-pad-left) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
}

html[data-theme="light"] .left-rail,
body[data-theme="light"] .left-rail {
  background: #f4f5f8 !important;
  box-shadow: inset -1px 0 0 rgba(22, 34, 58, 0.06) !important;
}

.lab-brand-row {
  width: calc(var(--flank) - var(--rail-pad-left)) !important;
  min-height: 86px !important;
  padding: 18px 0 0 var(--rail-pad-left) !important;
  gap: 16px !important;
  align-items: center !important;
}

.lab-logo-btn {
  width: 44px !important;
  height: 44px !important;
}

.lab-about-link {
  font-size: 18px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
}

.sidebar-card {
  width: calc(var(--flank) - var(--rail-pad-left)) !important;
  padding-top: 62px !important;
  display: grid !important;
  gap: 24px !important;
}

#newChatBtn {
  width: calc(var(--flank) - var(--rail-pad-left)) !important;
  min-height: 52px !important;
  padding: 0 14px !important;
  margin: 0 !important;
  border-radius: 16px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 14px !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
  transform: none !important;
}

html[data-theme="light"] #newChatBtn,
body[data-theme="light"] #newChatBtn {
  background: transparent !important;
  color: #16223A !important;
}

html[data-theme="light"] #newChatBtn:hover,
body[data-theme="light"] #newChatBtn:hover {
  background: rgba(22, 34, 58, 0.035) !important;
}

.sidebar-btn-icon-new {
  width: 18px !important;
  height: 18px !important;
  flex: 0 0 18px !important;
}

.sidebar-history-block {
  width: calc(var(--flank) - var(--rail-pad-left)) !important;
  min-height: 82px !important;
  padding: 20px 18px !important;
  border-radius: 22px !important;
  display: grid !important;
  align-items: start !important;
  gap: 10px !important;
}

html[data-theme="light"] .sidebar-history-block,
body[data-theme="light"] .sidebar-history-block {
  background: rgba(255,255,255,0.72) !important;
  border: 1px solid rgba(22, 34, 58, 0.05) !important;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.04) !important;
}

html[data-theme="dark"] .sidebar-history-block,
body[data-theme="dark"] .sidebar-history-block {
  background: rgba(255,255,255,0.035) !important;
  border: 1px solid rgba(238, 243, 251, 0.05) !important;
}

.sidebar-history-title {
  font-size: 16px !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
  margin: 0 !important;
}

html[data-theme="light"] .sidebar-history-title,
body[data-theme="light"] .sidebar-history-title {
  color: #16223A !important;
}

.chat-history-list {
  min-height: 0 !important;
}

#sidebarUserShell {
  width: calc(var(--flank) - var(--rail-pad-left)) !important;
  min-height: 52px !important;
  padding: 0 14px !important;
  margin: 0 !important;
  border-radius: 16px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
}

#sidebarUserShell .sidebar-user-name {
  font-size: 16px !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
}


/* LAB LEFT FLANK UNIFIED V3 */
/* цель: верх с логотипом и нижний rail должны стать одним цельным флангом */

:root {
  --flank: 280px !important;
  --rail-pad-left: 20px !important;
}

/* общая геометрия */
.topbar {
  display: grid !important;
  grid-template-columns: var(--flank) 1fr auto !important;
  min-height: 88px !important;
  background: var(--main-bg) !important;
}

.body-shell {
  display: grid !important;
  grid-template-columns: var(--flank) 1fr !important;
  gap: 0 !important;
}

/* верхняя левая часть = тот же фланг */
.lab-brand-row {
  width: var(--flank) !important;
  min-width: var(--flank) !important;
  max-width: var(--flank) !important;
  min-height: 88px !important;
  padding: 20px 0 0 var(--rail-pad-left) !important;
  margin: 0 !important;
  display: flex !important;
  align-items: flex-start !important;
  gap: 18px !important;
  box-shadow: inset -1px 0 0 rgba(22, 34, 58, 0.06) !important;
}

html[data-theme="light"] .lab-brand-row,
body[data-theme="light"] .lab-brand-row {
  background: #f4f5f8 !important;
  box-shadow: inset -1px 0 0 rgba(22, 34, 58, 0.06) !important;
}

html[data-theme="dark"] .lab-brand-row,
body[data-theme="dark"] .lab-brand-row {
  background: #172033 !important;
  box-shadow: inset -1px 0 0 rgba(238, 243, 251, 0.06) !important;
}

/* нижняя левая часть = тот же фланг */
.left-rail {
  width: var(--flank) !important;
  min-width: var(--flank) !important;
  max-width: var(--flank) !important;
  padding: 18px 0 24px var(--rail-pad-left) !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  box-shadow: inset -1px 0 0 rgba(22, 34, 58, 0.06) !important;
}

html[data-theme="light"] .left-rail,
body[data-theme="light"] .left-rail {
  background: #f4f5f8 !important;
  box-shadow: inset -1px 0 0 rgba(22, 34, 58, 0.06) !important;
}

html[data-theme="dark"] .left-rail,
body[data-theme="dark"] .left-rail {
  background: #172033 !important;
  box-shadow: inset -1px 0 0 rgba(238, 243, 251, 0.06) !important;
}

/* внутренние блоки низа */
.sidebar-card,
#sidebarUserShell {
  width: calc(var(--flank) - var(--rail-pad-left)) !important;
  margin: 0 !important;
}

.sidebar-card {
  padding-top: 62px !important;
  gap: 24px !important;
}

/* ничего не центрируем */
#newChatBtn,
#sidebarUserShell {
  justify-content: flex-start !important;
  transform: none !important;
  margin-left: 0 !important;
}

/* верхний брендовый ряд не должен быть уже фланга */
.lab-logo-btn,
.lab-about-link {
  flex: 0 0 auto !important;
}


/* LAB LEFT FLANK REQUEST PASS V4 */

/* 1) Sod.Go +20% */
.lab-about-link {
  font-size: 21.6px !important;
  line-height: 1 !important;
  font-weight: 600 !important;
}

/* стрелку рядом тоже чуть крупнее */
.lab-about-link::after {
  width: 10px !important;
  height: 10px !important;
  border-right: 2px solid currentColor !important;
  border-bottom: 2px solid currentColor !important;
}

/* 2) Новый чат вверх на 40px */
#newChatBtn {
  transform: translateY(-40px) !important;
}

/* чтобы после подъема не было лишней дыры в раскладке */
.sidebar-card {
  gap: 0 !important;
}

/* 3) История чатов без оболочки */
.sidebar-history-block {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  min-height: 0 !important;
  margin-top: -18px !important;
}

/* 4) Новая иконка для История чатов */
.sidebar-history-title {
  display: inline-flex !important;
  align-items: center !important;
  gap: 12px !important;
  font-size: 16px !important;
  line-height: 1.2 !important;
}

.sidebar-history-title::before {
  content: "" !important;
  display: inline-block !important;
  width: 18px !important;
  height: 18px !important;
  flex: 0 0 18px !important;
  background-color: currentColor !important;
  -webkit-mask: url("./history-list-icon.svg?v=1") no-repeat center / contain !important;
  mask: url("./history-list-icon.svg?v=1") no-repeat center / contain !important;
}


/* LAB HISTORY LIKE NAV V5 */

.sidebar-history-block {
  width: calc(var(--flank) - var(--rail-pad-left)) !important;
  min-height: 52px !important;
  padding: 0 14px !important;
  margin: 0 !important;
  border-radius: 16px !important;
  display: grid !important;
  align-content: start !important;
  gap: 8px !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  transition: background-color 140ms ease !important;
}

.sidebar-history-block:hover {
  background: rgba(127, 127, 127, 0.04) !important;
}

.sidebar-history-title {
  min-height: 52px !important;
  padding: 0 !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
  color: var(--text) !important;
}

.chat-history-list {
  padding: 0 0 6px 30px !important;
  min-height: 0 !important;
}

.history-empty {
  display: none !important;
}


/* LAB HISTORY UP -30 V1 */
.sidebar-history-block {
  margin-top: -30px !important;
}


/* LAB DIALOG WINDOW -80 V1 */
#chatViewportV34 {
  min-height: calc(100vh - 192px) !important;
}

.dialog-window {
  min-height: calc(100vh - 192px) !important;
  flex: 0 0 calc(100vh - 192px) !important;
}


/* LAB FIT ONE SCREEN V1 */
/* весь shell влезает в один экран, окно диалога короче */

html, body {
  height: 100vh !important;
  overflow: hidden !important;
}

.app-shell {
  height: 100vh !important;
  min-height: 100vh !important;
  overflow: hidden !important;
}

.topbar {
  height: 88px !important;
  min-height: 88px !important;
  max-height: 88px !important;
}

.body-shell {
  height: calc(100vh - 88px) !important;
  min-height: calc(100vh - 88px) !important;
  max-height: calc(100vh - 88px) !important;
  overflow: hidden !important;
}

.left-rail {
  height: calc(100vh - 88px) !important;
  min-height: calc(100vh - 88px) !important;
  max-height: calc(100vh - 88px) !important;
  overflow: hidden !important;
}

.center-stage {
  height: calc(100vh - 88px) !important;
  min-height: calc(100vh - 88px) !important;
  max-height: calc(100vh - 88px) !important;
  overflow: hidden !important;
  padding-top: 0 !important;
  padding-bottom: 14px !important;
}

#chatViewportV34 {
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
}

.dialog-window {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  overflow: hidden !important;
  padding-bottom: 10px !important;
}

/* как раз делает окно диалога визуально короче */
.welcome-state,
#chatMessages {
  min-height: 0 !important;
  height: 100% !important;
}

#dialogComposerShell {
  flex: 0 0 auto !important;
  margin-top: 8px !important;
}

.dialog-composer-surface {
  min-height: 96px !important;
}

.composer-legal-note {
  margin-top: 8px !important;
  padding-bottom: 0 !important;
}


/* LAB RESPONSIVE HEIGHT FIX V1 */
/* убираем жесткий fullscreen-fit и делаем нормальную адаптацию по высоте */

html, body {
  height: auto !important;
  min-height: 100dvh !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

.app-shell {
  height: auto !important;
  min-height: 100dvh !important;
  overflow: visible !important;
}

.topbar {
  height: 88px !important;
  min-height: 88px !important;
  max-height: none !important;
}

.body-shell {
  height: auto !important;
  min-height: calc(100dvh - 88px) !important;
  max-height: none !important;
  overflow: visible !important;
}

.left-rail {
  height: auto !important;
  min-height: calc(100dvh - 88px) !important;
  max-height: none !important;
  overflow: visible !important;
}

.center-stage {
  height: auto !important;
  min-height: calc(100dvh - 88px) !important;
  max-height: none !important;
  overflow: visible !important;
  padding-top: 0 !important;
  padding-bottom: 16px !important;
}

#chatViewportV34 {
  height: auto !important;
  min-height: calc(100dvh - 128px) !important;
  max-height: none !important;
  overflow: visible !important;
  display: flex !important;
  flex-direction: column !important;
}

.dialog-window {
  flex: 1 1 auto !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  padding-bottom: 12px !important;
}

.welcome-state,
#chatMessages {
  height: auto !important;
  min-height: 0 !important;
}

#dialogComposerShell {
  flex: 0 0 auto !important;
  margin-top: 8px !important;
}

.dialog-composer-surface {
  min-height: 96px !important;
}

.composer-legal-note {
  margin-top: 8px !important;
}

/* для более низких экранов чуть ужимаем вертикальный воздух */
@media (max-height: 900px) {
  .welcome-title {
    font-size: 28px !important;
  }

  .dialog-window {
    padding-bottom: 8px !important;
  }

  .dialog-composer-surface {
    min-height: 90px !important;
  }

  .center-stage {
    padding-bottom: 10px !important;
  }

  .composer-legal-note {
    margin-top: 6px !important;
    font-size: 11px !important;
  }
}

@media (max-height: 820px) {
  .topbar {
    height: 80px !important;
    min-height: 80px !important;
  }

  .body-shell,
  .left-rail,
  .center-stage {
    min-height: calc(100dvh - 80px) !important;
  }

  #chatViewportV34 {
    min-height: calc(100dvh - 116px) !important;
  }

  .welcome-title {
    font-size: 26px !important;
  }

  .dialog-composer-surface {
    min-height: 86px !important;
  }
}


/* LAB_CHAT_CONTAIN_FIX_V1 */
#chatMessages {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
  padding-right: 2px;
}

#chatMessages .chat-message {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0 0 14px 0;
  box-sizing: border-box;
}

#chatMessages .chat-message-bubble {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

#chatMessages .chat-message-bubble pre {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  white-space: pre-wrap !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow-x: hidden;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  font: inherit;
}


/* LAB_DIALOG_CENTER_FIX_V1 */
#chatViewportV34 {
  width: 100% !important;
  max-width: 980px !important;
  margin: 0 auto !important;
}

.dialog-window {
  display: block !important;
  width: 100% !important;
  max-width: 980px !important;
  margin: 0 auto !important;
}

#welcomeState,
#chatMessages,
#dialogComposerShell {
  width: 100% !important;
  max-width: 980px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

#chatMessages {
  text-align: left !important;
}


/* LAB_CHATGPT_ROLELESS_V1 */
#chatMessages .chat-message {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 0 18px 0 !important;
}

#chatMessages .chat-message-user {
  display: flex !important;
  justify-content: flex-end !important;
}

#chatMessages .chat-message-user .chat-message-bubble {
  width: auto !important;
  min-width: 0 !important;
  max-width: min(720px, 78%) !important;
  margin-left: auto !important;
  padding: 14px 18px !important;
  border-radius: 22px !important;
  background: rgba(127, 127, 127, 0.12) !important;
  border: 0 !important;
  box-shadow: none !important;
}

#chatMessages .chat-message-user .chat-message-bubble pre {
  margin: 0 !important;
  width: auto !important;
  max-width: 100% !important;
  white-space: pre-wrap !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  font: inherit !important;
}

#chatMessages .chat-message-assistant {
  display: block !important;
}

#chatMessages .chat-message-assistant .chat-message-bubble {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

#chatMessages .chat-message-assistant .chat-message-bubble pre {
  margin: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  white-space: pre-wrap !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  font: inherit !important;
}


/* LAB_PENDING_FILES_REMOVE_V2 */
.file-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding-right: 8px !important;
}

.file-chip-name {
  min-width: 0;
}

.file-chip-remove {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--subtext);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 16px;
  line-height: 1;
  padding: 0;
}

.file-chip-remove:hover {
  background: rgba(127, 127, 127, 0.12);
  color: var(--text);
}


/* LAB_MESSAGE_ACTIONS_V1 */
#chatMessages .chat-message-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

#chatMessages .chat-message-user .chat-message-actions {
  justify-content: flex-end;
}

#chatMessages .chat-message-assistant .chat-message-actions {
  justify-content: flex-start;
}

#chatMessages .chat-action-btn,
#chatMessages .chat-action-icon {
  border: 0;
  background: transparent;
  color: var(--subtext);
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  opacity: 0.84;
}

#chatMessages .chat-action-icon {
  font-size: 14px;
  line-height: 1;
}

#chatMessages .chat-action-btn:hover,
#chatMessages .chat-action-icon:hover,
#chatMessages .chat-action-btn.is-active,
#chatMessages .chat-action-icon.is-active {
  color: var(--text);
  opacity: 1;
}


/* LAB_MESSAGE_ICON_ACTIONS_V2 */
#chatMessages .chat-message-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

#chatMessages .chat-message-user .chat-message-actions {
  justify-content: flex-end;
}

#chatMessages .chat-message-assistant .chat-message-actions {
  justify-content: flex-start;
}

#chatMessages .chat-action-icon-btn {
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  color: var(--subtext);
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.9;
}

#chatMessages .chat-action-icon {
  width: 17px;
  height: 17px;
  display: block;
}

#chatMessages .chat-action-icon-btn:hover,
#chatMessages .chat-action-icon-btn.is-active {
  color: var(--text);
  opacity: 1;
}

#chatMessages .chat-action-vote {
  color: var(--subtext) !important;
}

#chatMessages .chat-action-vote:hover,
#chatMessages .chat-action-vote.is-active {
  color: var(--subtext) !important;
  opacity: 1;
}


/* LAB_USER_ACTIONS_UNDER_TEXT_V1 */
#chatMessages .chat-message-user {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
}

#chatMessages .chat-message-user .chat-message-bubble {
  flex: 0 0 auto !important;
}

#chatMessages .chat-message-user .chat-message-actions {
  width: auto !important;
  align-self: flex-end !important;
  justify-content: flex-end !important;
  margin-top: 8px !important;
}


/* LAB_COPY_CHECK_ALIVE_V1 */
#chatMessages .chat-action-icon-btn {
  width: 28px !important;
  height: 28px !important;
  opacity: 0.96 !important;
}

#chatMessages .chat-action-icon {
  width: 19px !important;
  height: 19px !important;
}

#chatMessages .chat-action-copy-btn {
  position: relative;
}

#chatMessages .chat-action-copy-btn .chat-action-copy-icon,
#chatMessages .chat-action-copy-btn .chat-action-check-icon {
  position: absolute;
  inset: 0;
  margin: auto;
}

#chatMessages .chat-action-copy-btn .chat-action-check-icon {
  display: none;
}

#chatMessages .chat-action-copy-btn.is-active .chat-action-copy-icon {
  display: none;
}

#chatMessages .chat-action-copy-btn.is-active .chat-action-check-icon {
  display: block;
}

#chatMessages .chat-action-vote {
  opacity: 0.96 !important;
}


/* LAB_INLINE_EDIT_V1 */
#chatMessages .chat-message-user .chat-action-edit-save,
#chatMessages .chat-message-user .chat-action-edit-cancel {
  display: none !important;
}

#chatMessages .chat-message-user.is-editing .chat-action-edit-btn,
#chatMessages .chat-message-user.is-editing .chat-action-copy-btn {
  display: none !important;
}

#chatMessages .chat-message-user.is-editing .chat-action-edit-save,
#chatMessages .chat-message-user.is-editing .chat-action-edit-cancel {
  display: inline-flex !important;
}

#chatMessages .chat-inline-editor {
  width: 100% !important;
  min-height: 96px !important;
  resize: vertical;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  margin: 0;
  font: inherit;
  line-height: inherit;
  box-sizing: border-box;
}\n

/* LAB_WELCOME_TITLE_SHIFT_V1 */
.welcome-state {
  justify-content: flex-start !important;
  align-items: center !important;
  padding-top: 18px !important;
}

.welcome-title {
  transform: translateY(-18px) !important;
}
\n


/* LAB_GENERATED_FILE_CARD_V2 */
#chatMessages .chat-message-generated-file {
  display: flex;
  justify-content: flex-start;
  width: 100%;
  margin: 4px 0 10px 0;
}

#chatMessages .generated-file-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: auto;
  max-width: min(420px, 100%);
  min-width: 0;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(127, 127, 127, 0.06);
  border: 1px solid rgba(127, 127, 127, 0.10);
}

#chatMessages .generated-file-head {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#chatMessages .generated-file-title {
  min-width: 0;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#chatMessages .generated-file-ext {
  flex: 0 0 auto;
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.08em;
  opacity: 0.62;
}

#chatMessages .generated-file-meta {
  display: none !important;
}

#chatMessages .chat-message-generated-file .chat-message-actions {
  margin-top: 0;
  margin-left: auto;
  flex: 0 0 auto;
  justify-content: flex-end;
}

#chatMessages .chat-message-generated-file .chat-action-download {
  text-decoration: none !important;
}

/* LAB_MOBILE_PASS_V1 */
@media (max-width: 760px) {
  html,
  body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .app-shell,
  .body-shell,
  #heroWorkspace,
  .center-stage,
  #chatViewportV34,
  .dialog-window,
  #chatMessages,
  #dialogComposerShell {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .body-shell {
    display: block !important;
  }

  .left-rail {
    display: none !important;
  }

  .topbar {
    grid-template-columns: 1fr auto !important;
    min-height: 68px !important;
    height: 68px !important;
    max-height: 68px !important;
    padding: 0 14px !important;
  }

  .topbar-spacer {
    display: none !important;
  }

  .topbar-actions {
    gap: 8px !important;
  }

  .center-stage {
    padding: 0 10px 14px 10px !important;
    min-height: calc(100dvh - 68px) !important;
    height: auto !important;
    overflow: visible !important;
  }

  #chatViewportV34 {
    min-height: calc(100dvh - 92px) !important;
    height: auto !important;
    overflow: visible !important;
  }

  .dialog-window {
    display: block !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 0 0 8px 0 !important;
    overflow: visible !important;
  }

  .welcome-state {
    display: block !important;
    text-align: left !important;
    padding: 10px 2px 6px 2px !important;
    min-height: 0 !important;
    transform: none !important;
  }

  .welcome-title {
    font-size: 22px !important;
    line-height: 1.15 !important;
    margin: 0 !important;
  }

  #chatMessages {
    padding-top: 4px !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
  }

  #chatMessages .chat-message {
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 12px !important;
  }

  #chatMessages .chat-message-user .chat-message-bubble,
  #chatMessages .chat-message-assistant .chat-message-bubble {
    max-width: 100% !important;
    width: 100% !important;
  }

  #chatMessages .chat-message-user {
    padding-left: 18% !important;
  }

  #chatMessages .chat-message-assistant,
  #chatMessages .chat-message-generated-file {
    padding-right: 0 !important;
  }

  #chatMessages .chat-message-user .chat-message-bubble pre,
  #chatMessages .chat-message-assistant .chat-message-bubble pre {
    font-size: 15px !important;
    line-height: 1.5 !important;
  }

  #chatMessages .chat-message-actions {
    gap: 10px !important;
  }

  #chatMessages .chat-action-icon-btn {
    width: 24px !important;
    height: 24px !important;
  }

  #chatMessages .chat-action-icon {
    width: 18px !important;
    height: 18px !important;
  }

  #dialogComposerShell {
    margin-top: 6px !important;
  }

  .dialog-composer-surface {
    min-height: 88px !important;
    padding: 14px 52px 14px 14px !important;
    border-radius: 18px !important;
  }

  .dialog-composer-input {
    min-height: 44px !important;
    font-size: 16px !important;
    line-height: 1.45 !important;
  }

  .dialog-composer-actions {
    right: 10px !important;
    bottom: 10px !important;
    gap: 8px !important;
  }

  .composer-file-tray {
    gap: 6px !important;
    margin-bottom: 8px !important;
  }

  .file-chip {
    max-width: 100% !important;
    min-height: 30px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
  }

  .file-chip-name {
    max-width: 160px !important;
  }

  #chatMessages .generated-file-card {
    max-width: 100% !important;
    width: 100% !important;
    justify-content: space-between !important;
  }

  #chatMessages .generated-file-title {
    max-width: 160px !important;
  }

  .composer-legal-note {
    margin-top: 6px !important;
    font-size: 11px !important;
    line-height: 1.35 !important;
  }
}

/* LAB_SCROLL_ISOLATION_V2 */
html,
body {
  height: 100dvh !important;
  overflow: hidden !important;
}

.app-shell {
  height: 100dvh !important;
  min-height: 100dvh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.topbar {
  flex: 0 0 auto !important;
  z-index: 50 !important;
}

.body-shell {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.left-rail,
.center-stage,
#heroWorkspace,
#chatViewportV34 {
  min-height: 0 !important;
}

.center-stage,
#heroWorkspace,
#chatViewportV34 {
  display: flex !important;
  flex-direction: column !important;
}

#heroWorkspace,
#chatViewportV34 {
  flex: 1 1 auto !important;
  overflow: hidden !important;
}

.dialog-window {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

#chatMessages {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch !important;
}

#dialogComposerShell {
  flex: 0 0 auto !important;
}

/* LAB_VIEWPORT_WIDTH_RESET_V1 */

/* сам viewport и окно не должны быть узкой центральной колонкой */
#chatViewportV34,
.dialog-window {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* scroll-area тоже на всю ширину окна */
#chatMessages {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box !important;
  background: transparent !important;
}

/* shell под composer не должен быть отдельным визуальным блоком */
#dialogComposerShell {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* а вот видимые сущности остаются аккуратными и ограниченными по ширине */
#chatMessages .chat-message,
#dialogComposerShell .dialog-composer-surface,
.composer-legal-note,
.welcome-state {
  width: min(1080px, 100%) !important;
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

/* у сообщений сохраняем нормальные боковые поля */
#chatMessages .chat-message {
  padding-left: 14px !important;
  padding-right: 14px !important;
}

/* composer и legal note без общей оболочки */
#dialogComposerShell .dialog-composer-surface {
  display: block !important;
}

.composer-legal-note {
  margin-top: 8px !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* LAB_CHATVIEWPORT_CONTENTS_V1 */

/* по диагностике прямоугольная оболочка — это box самого #chatViewportV34 */
#chatViewportV34 {
  display: contents !important;
  width: auto !important;
  max-width: none !important;
  min-height: 0 !important;
  height: auto !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

#chatViewportV34::before,
#chatViewportV34::after {
  content: none !important;
  display: none !important;
}

/* реальными flex-элементами теперь становятся дети viewport */
#heroWorkspace {
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.dialog-window {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

#dialogComposerShell {
  flex: 0 0 auto !important;
}

/* LAB_WELCOME_KILL_V1 */
#welcomeState[hidden],
.welcome-state[hidden],
html.dialog-started #welcomeState,
body.dialog-started #welcomeState,
html.dialog-started .welcome-state,
body.dialog-started .welcome-state,
html.dialog-started #welcomeState *,
body.dialog-started #welcomeState *,
html.dialog-started .welcome-state *,
body.dialog-started .welcome-state * {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  content: none !important;
}


/* FORCE_CHAT_THEME_FIX_V1 */
html[data-theme="dark"] #forceChatMessages,
body[data-theme="dark"] #forceChatMessages {
  color: #EEF3FB !important;
}

html[data-theme="dark"] #forceChatMessages .force-chat-row[data-role="user"] .force-chat-bubble,
body[data-theme="dark"] #forceChatMessages .force-chat-row[data-role="user"] .force-chat-bubble {
  background: #355C9A !important;
  color: #EEF3FB !important;
  -webkit-text-fill-color: #EEF3FB !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
}

html[data-theme="dark"] #forceChatMessages .force-chat-row[data-role="assistant"] .force-chat-bubble,
body[data-theme="dark"] #forceChatMessages .force-chat-row[data-role="assistant"] .force-chat-bubble {
  background: #24324A !important;
  color: #EEF3FB !important;
  -webkit-text-fill-color: #EEF3FB !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
}

html[data-theme="light"] #forceChatMessages,
body[data-theme="light"] #forceChatMessages {
  color: #16223A !important;
}

html[data-theme="light"] #forceChatMessages .force-chat-row[data-role="user"] .force-chat-bubble,
body[data-theme="light"] #forceChatMessages .force-chat-row[data-role="user"] .force-chat-bubble {
  background: rgba(61,115,255,0.10) !important;
  color: #16223A !important;
  -webkit-text-fill-color: #16223A !important;
  border: 1px solid rgba(127,127,127,0.14) !important;
}

html[data-theme="light"] #forceChatMessages .force-chat-row[data-role="assistant"] .force-chat-bubble,
body[data-theme="light"] #forceChatMessages .force-chat-row[data-role="assistant"] .force-chat-bubble {
  background: rgba(255,255,255,0.92) !important;
  color: #16223A !important;
  -webkit-text-fill-color: #16223A !important;
  border: 1px solid rgba(127,127,127,0.14) !important;
}

/* CHAT_FONT_BUMP_V1 */
#chatMessages .chat-message-bubble pre,
#chatMessages .chat-inline-editor {
  font-size: 17px !important;
  line-height: 1.58 !important;
}

#dialogComposerInput {
  font-size: 17px !important;
  line-height: 1.58 !important;
}

@media (max-width: 768px) {
  #chatMessages .chat-message-bubble pre,
  #chatMessages .chat-inline-editor,
  #dialogComposerInput {
    font-size: 16px !important;
    line-height: 1.55 !important;
  }
}

/* CHAT_FONT_BUMP_V2 */
#chatMessages .chat-message-bubble pre,
#chatMessages .chat-inline-editor {
  font-size: 19px !important;
  line-height: 1.62 !important;
}

#dialogComposerInput {
  font-size: 19px !important;
  line-height: 1.62 !important;
}

@media (max-width: 768px) {
  #chatMessages .chat-message-bubble pre,
  #chatMessages .chat-inline-editor,
  #dialogComposerInput {
    font-size: 18px !important;
    line-height: 1.58 !important;
  }
}

/* CHAT_FONT_BUMP_V3 */
#chatMessages .chat-message-bubble pre,
#chatMessages .chat-inline-editor {
  font-size: 21px !important;
  line-height: 1.64 !important;
}

#dialogComposerInput {
  font-size: 21px !important;
  line-height: 1.64 !important;
}

@media (max-width: 768px) {
  #chatMessages .chat-message-bubble pre,
  #chatMessages .chat-inline-editor,
  #dialogComposerInput {
    font-size: 19px !important;
    line-height: 1.60 !important;
  }
}

/* ASSISTANT_TEXT_BUMP_V4 */
#chatMessages .chat-message-assistant .chat-message-bubble,
#chatMessages .chat-message-assistant .chat-message-bubble pre,
#chatMessages .chat-message-assistant,
#forceChatMessages .force-chat-row[data-role="assistant"] .force-chat-bubble,
#forceChatMessages .force-chat-row[data-role="assistant"] .force-chat-bubble pre {
  font-size: 24px !important;
  line-height: 1.68 !important;
}

#chatMessages .chat-message-user .chat-message-bubble,
#chatMessages .chat-message-user .chat-message-bubble pre,
#forceChatMessages .force-chat-row[data-role="user"] .force-chat-bubble,
#forceChatMessages .force-chat-row[data-role="user"] .force-chat-bubble pre {
  font-size: 20px !important;
  line-height: 1.58 !important;
}

#dialogComposerInput {
  font-size: 21px !important;
  line-height: 1.60 !important;
}

@media (max-width: 768px) {
  #chatMessages .chat-message-assistant .chat-message-bubble,
  #chatMessages .chat-message-assistant .chat-message-bubble pre,
  #chatMessages .chat-message-assistant,
  #forceChatMessages .force-chat-row[data-role="assistant"] .force-chat-bubble,
  #forceChatMessages .force-chat-row[data-role="assistant"] .force-chat-bubble pre {
    font-size: 20px !important;
    line-height: 1.60 !important;
  }

  #chatMessages .chat-message-user .chat-message-bubble,
  #chatMessages .chat-message-user .chat-message-bubble pre,
  #forceChatMessages .force-chat-row[data-role="user"] .force-chat-bubble,
  #forceChatMessages .force-chat-row[data-role="user"] .force-chat-bubble pre,
  #dialogComposerInput {
    font-size: 18px !important;
    line-height: 1.56 !important;
  }
}

/* ASSISTANT_TEXT_BUMP_V5 */
#chatMessages .chat-message-assistant .chat-message-bubble,
#chatMessages .chat-message-assistant .chat-message-bubble pre,
#chatMessages .chat-message-assistant,
#forceChatMessages .force-chat-row[data-role="assistant"] .force-chat-bubble,
#forceChatMessages .force-chat-row[data-role="assistant"] .force-chat-bubble pre {
  font-size: 22px !important;
  line-height: 1.66 !important;
}

#chatMessages .chat-message-user .chat-message-bubble,
#chatMessages .chat-message-user .chat-message-bubble pre,
#forceChatMessages .force-chat-row[data-role="user"] .force-chat-bubble,
#forceChatMessages .force-chat-row[data-role="user"] .force-chat-bubble pre {
  font-size: 19px !important;
  line-height: 1.56 !important;
}

#dialogComposerInput {
  font-size: 19px !important;
  line-height: 1.58 !important;
}

@media (max-width: 768px) {
  #chatMessages .chat-message-assistant .chat-message-bubble,
  #chatMessages .chat-message-assistant .chat-message-bubble pre,
  #chatMessages .chat-message-assistant,
  #forceChatMessages .force-chat-row[data-role="assistant"] .force-chat-bubble,
  #forceChatMessages .force-chat-row[data-role="assistant"] .force-chat-bubble pre {
    font-size: 19px !important;
    line-height: 1.58 !important;
  }

  #chatMessages .chat-message-user .chat-message-bubble,
  #chatMessages .chat-message-user .chat-message-bubble pre,
  #forceChatMessages .force-chat-row[data-role="user"] .force-chat-bubble,
  #forceChatMessages .force-chat-row[data-role="user"] .force-chat-bubble pre,
  #dialogComposerInput {
    font-size: 17px !important;
    line-height: 1.54 !important;
  }
}

/* CHAT_FONT_TUNE_V6 */
#chatMessages .chat-message-assistant .chat-message-bubble,
#chatMessages .chat-message-assistant .chat-message-bubble pre,
#chatMessages .chat-message-assistant,
#forceChatMessages .force-chat-row[data-role="assistant"] .force-chat-bubble,
#forceChatMessages .force-chat-row[data-role="assistant"] .force-chat-bubble pre {
  font-size: 20px !important;
  line-height: 1.62 !important;
}

#chatMessages .chat-message-user .chat-message-bubble,
#chatMessages .chat-message-user .chat-message-bubble pre,
#forceChatMessages .force-chat-row[data-role="user"] .force-chat-bubble,
#forceChatMessages .force-chat-row[data-role="user"] .force-chat-bubble pre {
  font-size: 18px !important;
  line-height: 1.54 !important;
}

#dialogComposerInput {
  font-size: 18px !important;
  line-height: 1.56 !important;
}

@media (max-width: 768px) {
  #chatMessages .chat-message-assistant .chat-message-bubble,
  #chatMessages .chat-message-assistant .chat-message-bubble pre,
  #chatMessages .chat-message-assistant,
  #forceChatMessages .force-chat-row[data-role="assistant"] .force-chat-bubble,
  #forceChatMessages .force-chat-row[data-role="assistant"] .force-chat-bubble pre {
    font-size: 18px !important;
    line-height: 1.56 !important;
  }

  #chatMessages .chat-message-user .chat-message-bubble,
  #chatMessages .chat-message-user .chat-message-bubble pre,
  #forceChatMessages .force-chat-row[data-role="user"] .force-chat-bubble,
  #forceChatMessages .force-chat-row[data-role="user"] .force-chat-bubble pre,
  #dialogComposerInput {
    font-size: 16px !important;
    line-height: 1.50 !important;
  }
}
