* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #17181c;
  color: #f0f0f2;
}

.app {
  max-width: 640px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .app {
    max-width: 960px;
  }
}

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 56px;
  padding: 0 20px;
  background: #17181c;
  border-bottom: 1px solid #2a2b31;
}

.header h1 {
  font-size: 18px;
  margin: 0;
  white-space: nowrap;
}

.wallet {
  font-size: 14px;
  color: #b6631f;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 6px 10px;
  border-radius: 8px;
}

.wallet:hover {
  background: #202127;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Аватар в шапке и выпадающее меню аккаунта */
.account-menu {
  position: relative;
}

.avatar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: #b6631f;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.avatar-btn:hover,
.avatar-btn[aria-expanded="true"] {
  border-color: #e0a06a;
}

.avatar-btn:focus-visible,
.menu-item:focus-visible,
.account-dd-topup:focus-visible,
.profile-tab:focus-visible {
  outline: 2px solid #e0a06a;
  outline-offset: 2px;
}

.account-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 50;
  width: 280px;
  max-width: calc(100vw - 28px);
  padding: 6px;
  background: #202127;
  border: 1px solid #2a2b31;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.account-dd-head {
  padding: 10px 10px 12px;
  border-bottom: 1px solid #2a2b31;
  margin-bottom: 6px;
}

.account-dd-email {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-dd-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  font-size: 13px;
  color: #d9a441;
  font-weight: 600;
}

.account-dd-topup {
  padding: 5px 12px;
  border: 1px solid #b6631f;
  border-radius: 999px;
  background: none;
  color: #e0a06a;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.account-dd-topup:hover {
  background: #b6631f;
  color: #fff;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: none;
  color: #e6e6ea;
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.menu-item svg {
  width: 18px;
  height: 18px;
  flex: none;
  color: #9a9aa2;
}

.menu-item:hover {
  background: #2a2b31;
}

.menu-item.danger,
.menu-item.danger svg {
  color: #e5484d;
}

.menu-sep {
  height: 1px;
  margin: 6px 4px;
  background: #2a2b31;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Профиль */
.profile-screen {
  padding: 16px 20px 32px;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.avatar-lg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 50%;
  background: #b6631f;
  color: #fff;
  font-size: 24px;
  font-weight: 700;
}

.profile-title {
  margin: 0;
  font-size: 20px;
}

.profile-email {
  margin: 2px 0 0;
  color: #9a9aa2;
  font-size: 14px;
  word-break: break-all;
}

.profile-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  padding: 4px;
  background: #202127;
  border-radius: 10px;
}

.profile-tabs {
  overflow-x: auto;
  scrollbar-width: none;
}

.profile-tab {
  flex: 1 0 auto;
  padding: 0 14px;
  white-space: nowrap;
  min-height: 40px;
  border: none;
  border-radius: 8px;
  background: none;
  color: #9a9aa2;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.profile-tab.active {
  background: #b6631f;
  color: #fff;
}

.profile-card {
  margin-bottom: 16px;
  padding: 18px;
  background: #202127;
  border: 1px solid #2a2b31;
  border-radius: 12px;
}

.profile-balance-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-label {
  color: #9a9aa2;
  font-size: 13px;
}

.profile-balance {
  margin-top: 2px;
  font-size: 26px;
  font-weight: 700;
  color: #d9a441;
}

.profile-subtitle {
  margin: 0 0 12px;
  font-size: 16px;
}

.profile-history {
  padding: 4px 18px;
}

.history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #2a2b31;
}

.history-row:last-child {
  border-bottom: none;
}

.history-title {
  font-size: 14px;
  font-weight: 600;
}

.history-date,
.history-money {
  margin-top: 2px;
  color: #9a9aa2;
  font-size: 12px;
}

.history-amount {
  text-align: right;
  flex: none;
}

.history-tokens.history-out {
  color: #e5484d;
}

a.btn {
  display: inline-block;
  text-align: center;
  text-decoration: none;
}

.history-pending {
  margin-top: 2px;
  color: #d9a441;
  font-size: 12px;
}

.profile-hint.profile-pending-note {
  margin: -4px 0 20px;
}

.history-tokens {
  font-size: 14px;
  font-weight: 600;
  color: #4cb782;
}

.profile-form,
.profile-danger form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #9a9aa2;
}

.profile-field input {
  padding: 12px 14px;
  border: 1px solid #2a2b31;
  border-radius: 8px;
  background: #17181c;
  color: #f0f0f2;
  font-family: inherit;
  font-size: 15px;
}

.profile-field input:focus {
  outline: none;
  border-color: #b6631f;
}

.profile-hint {
  margin: 0;
  color: #9a9aa2;
  font-size: 13px;
  line-height: 1.5;
}

.profile-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #9a9aa2;
  cursor: pointer;
}

.profile-msg {
  margin: 0;
  font-size: 13px;
}

.profile-msg.error {
  color: #e5484d;
}

.profile-msg.ok {
  color: #4cb782;
}

.profile-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-danger {
  border-color: #4a2a2c;
}

.profile-danger .profile-hint {
  margin-bottom: 12px;
}

.profile-intro {
  margin-bottom: 14px;
}

.copy-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.copy-row input {
  flex: 1;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #2a2b31;
  border-radius: 8px;
  background: #17181c;
  color: #f0f0f2;
  font-family: inherit;
  font-size: 14px;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.profile-stat {
  padding: 14px 10px;
  background: #202127;
  border: 1px solid #2a2b31;
  border-radius: 12px;
  text-align: center;
}

.profile-stat-num {
  font-size: 22px;
  font-weight: 700;
  color: #d9a441;
}

.profile-stat-label {
  margin-top: 2px;
  color: #9a9aa2;
  font-size: 12px;
}

.connection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.connection-head .profile-subtitle {
  margin: 0;
}

.connection-status {
  padding: 3px 10px;
  border-radius: 999px;
  background: #2a2b31;
  color: #9a9aa2;
  font-size: 12px;
  font-weight: 600;
}

.connection-status.ok {
  background: rgba(76, 183, 130, 0.16);
  color: #4cb782;
}

.connection-card .profile-form {
  margin-top: 12px;
}

/* Окно «Активные сеансы» */
.modal {
  width: min(520px, calc(100vw - 28px));
  max-height: calc(100vh - 40px);
  padding: 18px;
  border: 1px solid #2a2b31;
  border-radius: 14px;
  background: #202127;
  color: #f0f0f2;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.modal-head h3 {
  margin: 0;
  font-size: 17px;
}

.modal-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: none;
  color: #9a9aa2;
  font-size: 16px;
  cursor: pointer;
}

.modal-close:hover {
  background: #2a2b31;
  color: #f0f0f2;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #2a2b31;
}

.session-row:last-child {
  border-bottom: none;
}

.session-device {
  font-size: 14px;
  font-weight: 600;
}

.badge {
  display: inline-block;
  white-space: nowrap;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(76, 183, 130, 0.16);
  color: #4cb782;
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
}

.btn.btn-danger {
  background: transparent;
  border: 1px solid #e5484d;
  color: #e5484d;
}

.btn.btn-danger:hover {
  background: #e5484d;
  color: #fff;
}

.btn:disabled {
  opacity: 0.6;
  cursor: default;
}

@media (max-width: 480px) {
  .profile-screen { padding: 14px 14px 28px; }
  .profile-tabs { gap: 2px; }
  /* «Реферальная программа» на узком экране переносится на две строки, чтобы все четыре вкладки помещались */
  .profile-tab { flex: 1 1 auto; padding: 0 6px; font-size: 13px; line-height: 1.15; white-space: normal; }
  .profile-balance-card { flex-direction: column; align-items: stretch; }
}

.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-box {
  width: 100%;
  max-width: 360px;
  background: #202127;
  border: 1px solid #2a2b31;
  border-radius: 12px;
  padding: 28px 24px;
  text-align: center;
}

.auth-box h1 {
  font-size: 22px;
  margin: 0 0 20px;
}

.auth-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  background: #17181c;
  border-radius: 8px;
  padding: 4px;
}

.auth-tab {
  flex: 1;
  padding: 8px;
  border: none;
  background: none;
  color: #9a9aa2;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
}

.auth-tab.active {
  background: #b6631f;
  color: #fff;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-form input {
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #2a2b31;
  background: #17181c;
  color: inherit;
  font-size: 15px;
  font-family: inherit;
}

.auth-error {
  margin-top: 14px;
  color: #e5484d;
  font-size: 13px;
}

.auth-info {
  margin-top: 14px;
  color: #9fd46a;
  font-size: 13px;
  line-height: 1.45;
}

.auth-hint {
  margin: 0 0 4px;
  color: #9a9aa2;
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
}

.auth-link {
  align-self: center;
  border: none;
  background: none;
  padding: 4px;
  color: #9a9aa2;
  font-family: inherit;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

.auth-link:hover { color: inherit; }

.verify-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  padding: 10px 16px;
  background: #2a211a;
  border-bottom: 1px solid #b6631f;
  color: #ffe2c6;
  font-size: 14px;
  text-align: center;
}

.verify-banner-btn {
  border: 1px solid #b6631f;
  background: none;
  color: inherit;
  font-family: inherit;
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.verify-banner-btn:disabled { opacity: .5; cursor: default; }

.orders-screen {
  padding: 16px 20px;
}

.orders-hint {
  color: #9a9aa2;
  margin-bottom: 16px;
}

.orders-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.orders-head .orders-hint { margin: 0; font-size: 16px; font-weight: 600; color: #e6e6ea; }
.orders-filter {
  background: #202127;
  color: #e6e6ea;
  border: 1px solid #2a2b31;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 14px;
  cursor: pointer;
}
.orders-filter:focus { outline: none; border-color: #b6631f; }

.orders-section {
  border: 1px solid #2a2b31;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
}
.orders-section-title { font-size: 15px; font-weight: 600; margin: 0 0 12px; color: #e6e6ea; }
.orders-group-count { color: #9a9aa2; font-weight: 400; font-size: 12px; margin-left: 6px; }

.order-thumb { position: relative; }
.order-play {
  position: absolute; inset: 0; margin: auto; width: 34px; height: 34px;
  border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
  padding-left: 2px; pointer-events: none;
}
.order-count {
  position: absolute; right: 6px; bottom: 6px; background: rgba(0, 0, 0, .65);
  color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px;
}

.result-viewer {
  position: fixed; inset: 0; z-index: 1000; background: rgba(8, 8, 10, .93);
  display: flex; align-items: center; justify-content: center;
}
.result-viewer.hidden { display: none; }
.result-viewer-stage {
  max-width: 92vw; max-height: 84vh; display: flex; align-items: center; justify-content: center;
}
.result-viewer-stage img, .result-viewer-stage video {
  max-width: 92vw; max-height: 84vh; border-radius: 8px; background: #000;
}
.result-viewer-bar {
  position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: flex-end;
  align-items: center; gap: 14px; padding: 12px 16px;
}
.result-viewer-download { color: #fff; font-size: 14px; text-decoration: none; border: 1px solid #55565e; border-radius: 8px; padding: 6px 12px; }
.result-viewer-close, .result-viewer-nav {
  background: rgba(255, 255, 255, .12); color: #fff; border: 0; border-radius: 50%;
  width: 38px; height: 38px; font-size: 20px; cursor: pointer;
}
.result-viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); font-size: 28px; line-height: 1; }
.result-viewer-prev { left: 12px; }
.result-viewer-next { right: 12px; }
.result-viewer-nav.hidden { display: none; }

.orders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.order-card {
  position: relative;
  background: #202127;
  border: 1px solid #2a2b31;
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.order-card:hover {
  border-color: #b6631f;
}

.order-status-dot {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  z-index: 1;
}

.order-status-dot.status-progress { background: #4a9eff; }
.order-status-dot.status-done { background: #34c759; }
.order-status-dot.status-failed { background: #e5484d; }

.order-thumb {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  background: #17181c;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 28px;
}

.order-thumb img, .order-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.order-agent-name {
  font-size: 13px;
  font-weight: 600;
}

.order-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #9a9aa2;
}

.main-tabs {
  flex: 1;
  display: flex;
  justify-content: center;
  align-self: stretch;
  gap: 2px;
}

.main-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #9a9aa2;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.main-tab svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.main-tab:hover {
  color: #f0f0f2;
}

.main-tab:focus-visible {
  outline: 2px solid #b6631f;
  outline-offset: -2px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: no-preference) {
  .main-tab { transition: color .15s ease, border-color .15s ease; }
}

.main-tab.active {
  color: #f0f0f2;
  border-bottom-color: #b6631f;
}

.main-tab.active svg {
  color: #b6631f;
}

.tab-placeholder {
  padding: 40px 20px;
  color: #9a9aa2;
}

.tab-placeholder h2 {
  color: #f0f0f2;
  margin: 0 0 8px;
}

.agents-section-title {
  margin: 0 0 4px;
  font-size: 18px;
}

.agent-picker .agents-section-title ~ .agents-section-title {
  margin-top: 32px;
}

.my-agents-empty {
  padding: 24px;
  border: 1px dashed #2a2b31;
  border-radius: 10px;
  color: #9a9aa2;
  font-size: 14px;
}

.agent-picker {
  padding: 20px;
}

.agent-picker-hint {
  color: #9a9aa2;
  margin-bottom: 16px;
}

.agent-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.agent-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  padding: 18px;
  background: #202127;
  border: 1px solid #2a2b31;
  border-radius: 10px;
  color: inherit;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s ease, transform .15s ease;
}

.agent-card:hover {
  border-color: #b6631f;
  transform: translateY(-2px);
}

.agent-icon {
  margin-bottom: 2px;
}

.agent-card strong {
  font-size: 16px;
}

.agent-card span {
  font-size: 13px;
  color: #9a9aa2;
  line-height: 1.4;
}

.chat-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
}

.hidden {
  display: none !important;
}

.topup-screen {
  padding: 20px;
}

.topup-hint {
  color: #9a9aa2;
  margin-bottom: 16px;
}

.package-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.package-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  background: #202127;
  border: 1px solid #2a2b31;
  border-radius: 10px;
}

.package-card.featured {
  border-color: #b6631f;
}

.package-name {
  font-size: 16px;
  font-weight: 600;
}

.package-price {
  font-size: 22px;
  font-weight: 700;
}

.package-tokens {
  font-size: 14px;
  color: #b6631f;
}

.package-bonus {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: #34c759;
  background: rgba(52, 199, 89, .12);
  padding: 2px 8px;
  border-radius: 6px;
  width: fit-content;
}

.package-bullets {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  font-size: 13px;
  color: #9a9aa2;
  line-height: 1.6;
}

.package-buy-btn {
  margin-top: 8px;
}

.payment-reveal {
  margin-top: 20px;
  padding: 16px;
  background: #202127;
  border: 1px solid #b6631f;
  border-radius: 10px;
}

.payment-card-number-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}

.payment-card-number-row code {
  font-size: 18px;
  background: #17181c;
  padding: 8px 12px;
  border-radius: 8px;
  letter-spacing: 1px;
}

.payment-id-hint,
.payment-contact {
  font-size: 13px;
  color: #9a9aa2;
  line-height: 1.5;
}

.payment-id-hint code {
  background: #17181c;
  padding: 2px 6px;
  border-radius: 4px;
}

.back-btn {
  align-self: flex-start;
  background: none;
  border: none;
  color: #9a9aa2;
  cursor: pointer;
  font-size: 14px;
  padding: 0 0 12px;
}

.messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding-bottom: 12px;
}

/* Стиль сообщений — по мотивам интерфейса Claude: у ассистента нет цветного
   пузыря (просто текст, как в диалоге с ИИ), у пользователя — лёгкий
   контрастный пузырь справа. */
.msg {
  max-width: 85%;
  line-height: 1.6;
  font-size: 15px;
  white-space: pre-wrap;
}

.msg-user {
  align-self: flex-end;
  background: #2a2b31;
  color: #f0f0f2;
  padding: 10px 14px;
  border-radius: 14px;
}

.msg-assistant {
  align-self: flex-start;
  background: none;
  color: #e4e4e7;
  padding: 2px 0;
}

.msg img, .msg video {
  max-width: 100%;
  border-radius: 8px;
  margin-top: 8px;
}

.quote-panel {
  background: #202127;
  border: 1px solid #b6631f;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
}

.quote-text {
  margin-bottom: 12px;
  font-size: 15px;
}

.quote-actions {
  display: flex;
  gap: 10px;
}

.hidden-file-input {
  display: none;
}


/* Форма и превью — рядом на широком экране (десктоп), одна колонка на
   телефоне, как у genosai «Фото Студия» (структура), не их бренд/цвета. */
.studio-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

@media (min-width: 768px) {
  .studio-layout {
    grid-template-columns: 1fr 1fr;
  }
}

.image-studio-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: #202127;
  border: 1px solid #2a2b31;
  border-radius: 12px;
}

.dynamic-params {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
}

.param-item {
  flex: 1 1 140px;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.param-item-wide {
  flex-basis: 100%;
}

.param-toggle {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #9a9aa2;
  cursor: pointer;
}

.settings-row-pair {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.settings-row-pair-item {
  flex: 1;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-row-pair-item .settings-label {
  font-size: 13px;
  color: #9a9aa2;
}

.studio-title {
  font-size: 18px;
  margin: 0;
}

.studio-subtitle {
  font-size: 13px;
  color: #9a9aa2;
  margin: -4px 0 4px;
}

.form-label {
  font-size: 13px;
  color: #9a9aa2;
  font-weight: 600;
}

.form-select {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #2a2b31;
  background: #17181c;
  color: inherit;
  font-family: inherit;
  font-size: 14px;
}

.form-hint {
  font-size: 12px;
  color: #9a9aa2;
  margin: -6px 0 0;
}

.form-textarea {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #2a2b31;
  background: #17181c;
  color: inherit;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
}

.form-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-row-space-between {
  justify-content: space-between;
}

.link-btn {
  background: none;
  border: none;
  color: #9a9aa2;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.link-btn:hover {
  color: #f0f0f2;
}

.image-preview-area {
  border: 1px dashed #2a2b31;
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9a9aa2;
  font-size: 14px;
}

.progress-box {
  width: 80%;
  max-width: 320px;
}

.progress-label {
  margin-bottom: 8px;
  font-size: 14px;
  color: #f0f0f2;
}

.progress-track {
  height: 8px;
  background: #2a2b31;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: #b6631f;
  border-radius: 999px;
  transition: width .25s ease-out;
}

.image-preview-area img, .image-preview-area video {
  max-width: 100%;
  border-radius: 8px;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-label {
  font-size: 13px;
  color: #9a9aa2;
  min-width: 110px;
}

.pill-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #2a2b31;
  background: #17181c;
  color: #9a9aa2;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

.pill:hover {
  border-color: #b6631f;
}

.pill.active {
  background: #b6631f;
  border-color: #b6631f;
  color: #fff;
}

.settings-photo-btn {
  align-self: flex-start;
  font-size: 13px;
}

#mic-btn.recording {
  background: #e5484d;
  color: #fff;
  animation: mic-pulse 1s ease-in-out infinite;
}

@keyframes mic-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

.attachment-preview {
  font-size: 13px;
  color: #9a9aa2;
}

.attachment-preview-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.attachment-thumb {
  position: relative;
  width: 56px;
  height: 56px;
}

.attachment-thumb img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

.attachment-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  line-height: 16px;
  background: #17181c;
  border: 1px solid #2a2b31;
  border-radius: 50%;
  color: #9a9aa2;
  cursor: pointer;
  font-size: 12px;
  padding: 0;
}

.result-download-link {
  display: inline-block;
  margin-top: 6px;
  color: #b6631f;
  font-weight: 600;
  text-decoration: underline;
}

.btn {
  padding: 12px 18px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  background: #b6631f;
  color: #fff;
}

.btn-secondary {
  background: transparent;
  border: 1px solid #2a2b31;
  color: inherit;
}

@media (max-width: 480px) {
  .header, .agent-picker, .chat-screen { padding: 14px; }
}

/* Телефон и узкий экран: вкладки — нижняя панель с иконками (под большой палец). */
@media (max-width: 899px) {
  .header { padding: 0 14px; justify-content: space-between; }
  .main-tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    justify-content: space-around;
    gap: 0;
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #17181c;
    border-top: 1px solid #2a2b31;
  }
  .main-tab {
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 6px 2px;
    font-size: 11px;
    border-bottom: none;
    border-top: 2px solid transparent;
  }
  .main-tab.active { border-top-color: #b6631f; }
  .main-tab span { font-size: 10px; letter-spacing: -0.1px; }
  .app { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}

@media (min-width: 1100px) {
  .app { max-width: 1200px; }
}

/* --- Композер: общее поле ввода на всех вкладках -------------------------- */
.composer-wrap {
  position: sticky;
  bottom: 0;
  z-index: 15;
  margin-top: auto;
  padding: 10px 20px 16px;
  background: linear-gradient(to top, #17181c 75%, rgba(23, 24, 28, 0));
}

.composer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 860px;
  margin: 0 auto;
  padding: 14px 12px 10px 16px;
  background: #1d1e24;
  border: 1px solid #2a2b31;
  border-radius: 20px;
  transition: border-color .15s ease;
}

.composer:focus-within {
  border-color: #4a4b54;
}

.composer.is-disabled {
  opacity: .6;
}

.composer-input {
  width: 100%;
  max-height: 160px;
  padding: 2px 0;
  resize: none;
  overflow-y: auto;
  border: none;
  outline: none;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.45;
}

.composer-input::placeholder {
  color: #7d7e87;
}

.composer-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.composer-spacer {
  flex: 1;
}

.composer-btn {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #2a2b31;
  color: #b9bac2;
  cursor: pointer;
}

.composer-btn svg {
  width: 18px;
  height: 18px;
}

.composer-btn:hover:not(:disabled) {
  background: #34353c;
  color: #f0f0f2;
}

.composer-btn:focus-visible {
  outline: 2px solid #b6631f;
  outline-offset: 2px;
}

.composer-btn:disabled {
  opacity: .45;
  cursor: default;
}

.composer-send:not(:disabled) {
  background: #b6631f;
  color: #fff;
}

.composer-send:hover:not(:disabled) {
  background: #c8702a;
}

@media (max-width: 899px) {
  .composer-wrap {
    bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    padding: 8px 12px 10px;
  }
}

/* --- Вкладка «Видео» ------------------------------------------------------- */
.video-studio {
  padding: 16px 20px;
}

.video-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.video-form select,
.video-form textarea {
  max-width: 100%;
}

@media (min-width: 900px) {
  .video-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }

  .video-preview {
    position: sticky;
    top: 72px;
    min-height: 420px;
  }
}

.video-preview {
  flex-direction: column;
  gap: 8px;
  min-height: 260px;
}

.req {
  color: #e5484d;
}

.scenario-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.scenario-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  text-align: left;
  background: #17181c;
  border: 1px solid #2a2b31;
  border-radius: 10px;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
}

.scenario-card strong {
  font-size: 13px;
}

.scenario-card span {
  font-size: 12px;
  color: #9a9aa2;
  line-height: 1.3;
}

.scenario-card:hover:not(:disabled) {
  border-color: #b6631f;
}

.scenario-card.active {
  border-color: #b6631f;
  background: rgba(182, 99, 31, 0.12);
}

.scenario-card.soon {
  opacity: .5;
  cursor: default;
}

.scenario-card:focus-visible,
.dropzone:focus-visible {
  outline: 2px solid #b6631f;
  outline-offset: 2px;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  background: #17181c;
  border: 1px solid #2a2b31;
  border-radius: 10px;
}

.mode-btn {
  padding: 8px 10px;
  background: none;
  border: none;
  border-radius: 8px;
  color: #9a9aa2;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.mode-btn.active {
  background: #b6631f;
  color: #fff;
}

.mode-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.field-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.dropzone {
  display: grid;
  place-items: center;
  padding: 22px 14px;
  text-align: center;
  color: #9a9aa2;
  font-size: 13px;
  border: 1px dashed #3a3b42;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.dropzone:hover,
.dropzone.dragging {
  border-color: #b6631f;
  background: rgba(182, 99, 31, 0.08);
}

.frame-preview {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: #17181c;
  border: 1px solid #2a2b31;
  border-radius: 10px;
}

.frame-preview img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
}

.frame-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  font-size: 13px;
}

.frame-info strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.frame-info span {
  color: #9a9aa2;
  font-size: 12px;
}

.frame-remove {
  top: 6px;
  right: 6px;
}

.form-warn {
  margin: 0;
  font-size: 12px;
  color: #d9a441;
}

.form-warn.error {
  color: #e5484d;
}

.shots {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shot-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 78px 28px;
  gap: 8px;
  align-items: start;
}

.shot-num {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-top: 8px;
  border-radius: 50%;
  background: #2a2b31;
  font-size: 12px;
  font-weight: 700;
}

.shot-prompt {
  min-height: 0;
}

.shot-remove {
  margin-top: 6px;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  color: #9a9aa2;
  cursor: pointer;
  border-radius: 50%;
}

.shot-remove:hover:not(:disabled) {
  background: #2a2b31;
  color: #f0f0f2;
}

.shot-remove:disabled {
  opacity: .3;
  cursor: default;
}

#video-shots-total.over {
  color: #e5484d;
}

.price-line {
  margin: 0;
  font-size: 13px;
  color: #b9bac2;
}

.create-reason {
  min-height: 1.2em;
  margin: 0;
  text-align: right;
}

.video-empty-icon {
  font-size: 40px;
  opacity: .7;
}

.video-preview p {
  margin: 0;
}

.video-error {
  color: #e5484d;
  max-width: 420px;
  line-height: 1.5;
}

.confirm-card {
  width: 100%;
  max-width: 420px;
  text-align: left;
}

.confirm-card h3 {
  margin: 0 0 8px;
}

.confirm-list {
  margin: 0 0 12px;
  padding-left: 18px;
  color: #b9bac2;
  font-size: 14px;
  line-height: 1.6;
}

.confirm-price {
  margin: 0 0 12px !important;
  color: #f0f0f2;
  font-weight: 600;
}

.video-result {
  width: 100%;
  max-height: 60vh;
  border-radius: 10px;
  background: #000;
}

.result-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
}

.result-actions .btn {
  text-decoration: none;
  padding: 10px 16px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-group .form-textarea {
  width: 100%;
}

/* Неактивный композер (раздел без чата) — тонкая строка-подсказка, не съедает экран. */
.composer.is-disabled .composer-row {
  display: none;
}

.composer.is-disabled {
  padding: 10px 16px;
}

/* Прозрачная зона над композером не должна перехватывать клики; кликабельна только сама карточка. */
.composer-wrap {
  pointer-events: none;
}

.composer {
  pointer-events: auto;
}

/* Элемент в фокусе / прокрученный в вид не прячется под закреплённым композером и нижней панелью. */
html {
  scroll-padding-bottom: 150px;
}

.upload-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ref-preview {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: #17181c;
  border: 1px solid #2a2b31;
  border-radius: 10px;
}

.ref-preview video {
  width: 120px;
  max-height: 80px;
  border-radius: 8px;
  background: #000;
  object-fit: cover;
}

.scenario-badge {
  align-self: flex-start;
  margin-top: 2px;
  padding: 1px 8px;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  color: #d9a441;
  background: rgba(217, 164, 65, 0.14);
  border-radius: 999px;
}

/* История: контейнер — обычный столбец разделов (не сетка), внутри раздела карточки идут в одну строку */
#orders-grid { display: block; }
.orders-section .orders-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.orders-section .order-card { flex: 0 0 160px; width: 160px; }

/* --- Вкладка «Музыка» ------------------------------------------------------- */
.form-input {
  width: 100%;
  background: #17181c;
  color: #e6e6ea;
  border: 1px solid #2a2b31;
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
}
.form-input:focus, .form-textarea:focus { outline: none; border-color: #b6631f; }
.btn-small { padding: 6px 12px; font-size: 13px; }

/* Переключатели: крупная зона нажатия (≥44px), состояние видно и без цвета — по положению ползунка */
.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 44px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.switch {
  appearance: none; -webkit-appearance: none; flex: 0 0 auto;
  width: 44px; height: 26px; border-radius: 999px; background: #33343b; position: relative;
  cursor: pointer; transition: background .2s ease; border: 0; margin: 0;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #e6e6ea; transition: transform .2s ease;
}
.switch:checked { background: #b6631f; }
.switch:checked::after { transform: translateX(18px); }
.switch:focus-visible, .pill:focus-visible, .segmented button:focus-visible, .range:focus-visible {
  outline: 2px solid #ffb877; outline-offset: 2px;
}

/* Плавное раскрытие расширенного режима */
.collapsible { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .28s ease; }
.collapsible.open { grid-template-rows: 1fr; }
.collapsible-inner { overflow: hidden; min-height: 0; display: flex; flex-direction: column; gap: 16px; }
.collapsible.open .collapsible-inner { padding: 4px 0 8px; }
@media (prefers-reduced-motion: reduce) { .collapsible, .switch, .switch::after { transition: none; } }

.segmented { display: flex; gap: 6px; }
.segmented button {
  flex: 1; min-height: 40px; border-radius: 8px; border: 1px solid #2a2b31; background: #17181c;
  color: #e6e6ea; font: inherit; font-size: 14px; cursor: pointer;
}
.segmented button[aria-checked="true"] { background: #b6631f; border-color: #b6631f; color: #fff; font-weight: 600; }
.segmented + .form-label { margin-top: 10px; display: block; }

.range { width: 100%; accent-color: #b6631f; margin: 6px 0 2px; }
.pill[aria-pressed="true"] { background: #b6631f; border-color: #b6631f; color: #fff; }

.music-examples, .tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.music-example, .tag-btn {
  background: transparent; border: 1px dashed #4a4b54; color: #b9b9c1; border-radius: 999px;
  padding: 5px 11px; font: inherit; font-size: 12px; cursor: pointer;
}
.music-example:hover, .tag-btn:hover { border-color: #b6631f; color: #fff; }
.music-lyrics { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.5; }

.music-result-title { margin: 0 0 12px; font-size: 18px; }
.music-track {
  display: flex; gap: 12px; align-items: center; background: #202127; border: 1px solid #2a2b31;
  border-radius: 12px; padding: 10px; margin-bottom: 10px;
}
.music-cover { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; flex: 0 0 auto; background: #17181c; }
.music-track-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.music-track-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.music-track audio { width: 100%; height: 36px; }
.music-lyrics-view { margin-top: 12px; }
.music-lyrics-view summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }
.music-lyrics-view pre { white-space: pre-wrap; font: inherit; font-size: 14px; line-height: 1.6; margin: 0; color: #d0d0d6; }
.order-note { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.65); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; }

/* Панель справа на вкладке «Музыка»: пока нет результата — сценарии и советы */
.video-preview:has(.music-hub) { justify-content: flex-start; align-items: stretch; text-align: left; position: static; }
.music-hub { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.music-hub-title { margin: 0; font-size: 16px; color: #f0f0f2; }
.music-cats { margin: 0; }
.music-scenarios { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.music-scenario {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left;
  background: #202127; border: 1px solid #2a2b31; border-radius: 10px; padding: 11px 12px; cursor: pointer;
  color: #e6e6ea; font: inherit; min-height: 44px; transition: border-color .15s ease, transform .15s ease;
}
.music-scenario:hover { border-color: #b6631f; }
.music-scenario.active { border-color: #b6631f; box-shadow: 0 0 0 1px #b6631f inset; background: #2a211a; }
.music-scenario.active .music-scenario-hint { color: #d9a878; }
.music-scenario:active { transform: scale(.985); }
.music-scenario:focus-visible { outline: 2px solid #ffb877; outline-offset: 2px; }
.music-scenario-title { font-size: 14px; font-weight: 600; }
.music-scenario-hint { font-size: 12px; color: #9a9aa2; }
.music-tips { background: #17181c; border: 1px solid #2a2b31; border-radius: 10px; padding: 8px 12px; }
.music-tips summary { cursor: pointer; font-size: 13px; font-weight: 600; color: #d8d8de; min-height: 24px; }
.music-tips ul { margin: 8px 0 2px; padding-left: 18px; font-size: 13px; line-height: 1.55; color: #b9b9c1; text-align: left; }
.music-tips li + li { margin-top: 4px; }
.music-tips-inline { margin-top: 8px; }
.flash { color: #ffb877 !important; transition: color .3s ease; }
@media (prefers-reduced-motion: reduce) { .music-scenario { transition: none; } }

/* --- Презентации ------------------------------------------------------------- */
.pres-shell { max-width: 1100px; margin: 0 auto; padding: 0 16px 40px; }
.pres-list { margin-bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.pres-projects { display: flex; flex-wrap: wrap; gap: 8px; }
.pres-project { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; background: #202127; border: 1px solid #2a2b31; border-radius: 10px; padding: 9px 12px; color: #e6e6ea; cursor: pointer; font: inherit; text-align: left; }
.pres-project:hover { border-color: #b6631f; }
.pres-project-title { font-size: 14px; font-weight: 600; }
.pres-wizard { background: #17181c; border: 1px solid #2a2b31; border-radius: 12px; padding: 16px; }
.pres-steps { list-style: none; margin: 0 0 18px; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.pres-step { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #7d7e88; background: #202127; border: 1px solid #2a2b31; border-radius: 999px; padding: 4px 10px 4px 5px; }
.pres-step-n { display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center; border-radius: 50%; background: #2a2b31; font-size: 11px; }
.pres-step.active { color: #fff; border-color: #b6631f; }
.pres-step.active .pres-step-n { background: #b6631f; }
.pres-step.done { color: #b9b9c1; }
.pres-step.done .pres-step-n { background: #34c759; color: #0b1f10; }
.pres-h { margin: 0 0 6px; font-size: 18px; }
.pres-view { display: flex; flex-direction: column; gap: 14px; }
.pres-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.pres-style .dropzone { min-height: 44px; }
.pres-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pres-table-wrap { overflow-x: auto; border: 1px solid #2a2b31; border-radius: 10px; }
.pres-table { border-collapse: collapse; width: 100%; min-width: 860px; font-size: 13px; }
.pres-table th { text-align: left; padding: 8px 10px; background: #202127; color: #b9b9c1; font-weight: 600; border-bottom: 1px solid #2a2b31; }
.pres-table td { padding: 6px; vertical-align: top; border-bottom: 1px solid #23242a; }
.pres-table th:nth-child(1), .pres-n { width: 36px; text-align: center; color: #9a9aa2; }
.pres-table th:nth-child(2), .pres-table td:nth-child(2) { width: 18%; }
.pres-table th:nth-child(3), .pres-table td:nth-child(3) { width: 30%; }
.pres-cell { width: 100%; min-height: 0; resize: vertical; font-size: 13px; line-height: 1.45; padding: 7px 8px; overflow: hidden; }
.pres-test-img { width: 100%; max-width: 760px; border-radius: 10px; border: 1px solid #2a2b31; background: #000; }
.pres-slide-title { margin: 0; font-weight: 600; }
.pres-progress { width: 100%; max-width: 520px; }
.pres-indeterminate { width: 40% !important; animation: pres-slide 1.4s ease-in-out infinite; }
@keyframes pres-slide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
@media (prefers-reduced-motion: reduce) { .pres-indeterminate { animation: none; width: 60% !important; } }
.pres-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.pres-grid.acceptance { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.pres-card { display: flex; flex-direction: column; gap: 6px; background: #202127; border: 1px solid #2a2b31; border-radius: 10px; padding: 8px; }
.pres-card.failed { border-color: #e5484d; }
.pres-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; background: #000; display: block; }
.pres-card-wait { aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; background: #17181c; border-radius: 6px; font-size: 22px; color: #7d7e88; }
.pres-card-title { font-size: 13px; font-weight: 600; }

.msg.pres-chat { max-width: 100%; width: 100%; background: #17181c; border: 1px solid #2a2b31; padding: 14px; }

.pres-brief { display: grid; gap: 6px; margin: 0 0 12px; }
.pres-brief-row { display: grid; grid-template-columns: 160px 1fr; gap: 10px; font-size: 13px; border-bottom: 1px solid #23242a; padding-bottom: 6px; }
.pres-brief-row dt { color: #9a9aa2; }
.pres-brief-row dd { margin: 0; color: #e6e6ea; }
@media (max-width: 560px) { .pres-brief-row { grid-template-columns: 1fr; gap: 2px; } }

.pres-quality { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.pres-quality-card { border: 1px solid #2a2b31; border-radius: 12px; padding: 12px; background: #202127; cursor: pointer; display: flex; flex-direction: column; gap: 8px; }
.pres-quality-card:hover { border-color: #6b4a2a; }
.pres-quality-card.active { border-color: #b6631f; box-shadow: 0 0 0 1px #b6631f inset; background: #2a211a; }
.pres-quality-card:focus-visible { outline: 2px solid #ffb877; outline-offset: 2px; }
.pres-quality-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.pres-quality-tag { font-size: 11px; color: #d9a878; border: 1px solid #5a4530; border-radius: 999px; padding: 1px 8px; }
.pres-quality-price { margin-left: auto; font-size: 13px; font-weight: 600; color: #ffb877; }
.pres-quality-imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pres-quality-imgs img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; background: #000; display: block; }

.pres-questions { background: #202127; border: 1px solid #2a2b31; border-radius: 10px; padding: 12px 14px; }
.pres-questions ol { margin: 8px 0 0; padding-left: 20px; font-size: 14px; line-height: 1.6; color: #d0d0d6; }
.pres-dictation-field { position: relative; }
.pres-dictation-field textarea, .pres-dictation-field input { padding-right: 52px; }
.pres-mic { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid #3a3b44; background: #17181c; color: #e6e6ea; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.pres-mic:hover:not(:disabled) { border-color: #b6631f; }
.pres-mic:disabled { opacity: .4; cursor: not-allowed; }
.pres-mic.recording { background: #b6231f; border-color: #e5484d; color: #fff; animation: pres-pulse 1.2s ease-in-out infinite; }
.pres-mic:focus-visible { outline: 2px solid #ffb877; outline-offset: 2px; }
@keyframes pres-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .5); } 50% { box-shadow: 0 0 0 8px rgba(229, 72, 77, 0); } }
@media (prefers-reduced-motion: reduce) { .pres-mic.recording { animation: none; } }
.pres-mic-note { min-height: 1.2em; display: block; }
.pres-answer { min-height: 180px; }

.pres-style .form-label { display: block; margin-bottom: 4px; }

.pres-table { min-width: 1080px; }
.pres-table th:nth-child(3), .pres-table td:nth-child(3) { width: 22%; }
.pres-table th:nth-child(4), .pres-table td:nth-child(4) { width: 24%; }
.pres-log { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; padding-bottom: 90px; }
.pres-log:empty { display: none; }
.pres-msg { display: flex; }
.pres-msg-user { justify-content: flex-end; }
.pres-msg-text { max-width: 80%; padding: 8px 12px; border-radius: 12px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.pres-msg-user .pres-msg-text { background: #3a2a1a; color: #f2e4d6; }
.pres-msg-assistant .pres-msg-text { background: #202127; color: #e6e6ea; border: 1px solid #2a2b31; }
.pres-msg-action .pres-msg-text { background: transparent; color: #7fd69a; font-size: 13px; padding: 0 12px; }
.pres-proposal { display: flex; flex-direction: column; gap: 8px; align-self: flex-start; max-width: 80%; background: #17181c; border: 1px solid #5a4530; border-radius: 12px; padding: 10px 12px; font-size: 14px; }

.pres-table { min-width: 1280px; }
.pres-table th:nth-child(2), .pres-table td:nth-child(2) { width: 14%; }
.pres-table th:nth-child(3), .pres-table td:nth-child(3) { width: 19%; }
.pres-table th:nth-child(4), .pres-table td:nth-child(4) { width: 21%; }
.pres-table th:nth-child(5), .pres-table td:nth-child(5) { width: 17%; }
.pres-table { min-width: 1120px; }
.pres-table th:nth-child(6), .pres-table td:nth-child(6) { width: 20%; }
.pres-table td:nth-child(6) textarea { font-size: 12px; color: #9a9aa2; }
/* Подсказка под полосой прогресса не должна наезжать на неё (у .form-hint отрицательный верхний отступ) */
.pres-progress .progress-label { margin-bottom: 10px; }
.pres-progress .form-hint { margin: 10px 0 0; }

/* Поле с голосовым вводом: растягивается на всю ширину, микрофон — внутри поля у правого края */
.pres-dictation { width: 100%; }
.pres-dictation-field { width: 100%; }
.pres-dictation-field textarea, .pres-dictation-field input { display: block; width: 100%; box-sizing: border-box; }
.pres-dictation-field.is-input .pres-mic { top: 50%; transform: translateY(-50%); width: 32px; height: 32px; right: 6px; }
.pres-dictation-field.is-input input { padding-right: 46px; }
.pres-decision { background: #2a211a; border: 1px solid #b6631f; border-radius: 12px; padding: 14px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.pres-decision .form-hint { margin: 0; }
.pres-decision-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.meetings-record-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.meetings-speaker-sample { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 6px 0; }
.meetings-speaker-sample .form-hint { margin: 0; }
.pres-redo { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding-top: 4px; }
.pres-redo .pres-dictation { align-self: stretch; }
.pres-shell { padding-bottom: 110px; }

/* --- Лента этапов (как чат): пройденное остаётся на экране --- */
.pres-steps-holder { position: sticky; top: 56px; z-index: 6; background: #17181c; padding: 8px 0 10px; margin: 0 0 8px; border-bottom: 1px solid #23242a; }
.pres-steps-holder .pres-steps { margin: 0; }
.pres-thread { display: flex; flex-direction: column; gap: 14px; padding-bottom: 20px; }
.pres-section { border: 1px solid #2a2b31; border-radius: 12px; padding: 14px; background: #1b1c21; }
.pres-section.past { background: #17181c; border-color: #23242a; }
.pres-turn { display: flex; flex-direction: column; gap: 10px; }
.pres-turn-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pres-turn-head .pres-h { margin: 0; }
.pres-chip { font-size: 12px; color: #7fd69a; border: 1px solid #2f6b46; border-radius: 999px; padding: 2px 10px; }
.pres-section.past .pres-h { font-size: 15px; color: #c9c9d0; }
.pres-fold { border: 1px solid #23242a; border-radius: 10px; padding: 8px 12px; }
.pres-fold summary { cursor: pointer; font-size: 13px; color: #b9b9c1; }
.pres-fold[open] summary { margin-bottom: 8px; }
.pres-table-past td { font-size: 12.5px; line-height: 1.45; color: #cfcfd6; white-space: pre-wrap; }
.pres-table-past .pres-muted { color: #7d7e88; font-size: 12px; }
.pres-test-img-past { max-width: 420px; }
.pres-section.past .pres-card-title { font-size: 12.5px; }
.pres-turn > .pres-msg-user { align-self: flex-end; max-width: 100%; }

/* Значок «копировать» под репликами чата: всегда виден (на телефоне нет наведения), зона нажатия 40px */
.copy-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 32px; padding: 0; background: transparent; border: 0; border-radius: 8px; color: #8b8c96; cursor: pointer; }
.copy-btn:hover { color: #e6e6ea; background: #23242a; }
.copy-btn:focus-visible { outline: 2px solid #ffb877; outline-offset: 1px; }
.copy-btn.copied { color: #7fd69a; }
.msg-tools { display: flex; margin: -4px 0 4px; }
.msg-tools-user, .pres-msg-wrap-user .msg-tools { justify-content: flex-end; }
.pres-msg-wrap { display: flex; flex-direction: column; }
.pres-msg-wrap-user { align-items: flex-end; }
.msg-cost { align-self: center; margin-left: 6px; font-size: 12px; color: #8b8c96; }

/* --- Презентации: боковая панель диалогов + лента --- */
.pres-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; max-width: 1500px; margin: 0 auto; padding: 0 16px; }
.pres-layout.side-collapsed { grid-template-columns: minmax(0, 1fr); }
.pres-layout.side-collapsed .pres-side { display: none; }
.pres-side { position: sticky; top: 72px; align-self: start; max-height: calc(100vh - 150px); overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px; background: #17181c; border: 1px solid #2a2b31; border-radius: 14px; }
.pres-new { width: 100%; }
.pres-search { width: 100%; }
.pres-items { display: flex; flex-direction: column; gap: 4px; }
.pres-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; background: transparent; border: 1px solid transparent; border-radius: 10px; padding: 9px 11px; color: #e6e6ea; cursor: pointer; font: inherit; }
.pres-item:hover { background: #202127; }
.pres-item.active { background: #2a211a; border-color: #b6631f; }
.pres-item:focus-visible { outline: 2px solid #ffb877; outline-offset: 1px; }
.pres-item-title { font-size: 13.5px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pres-item-meta { font-size: 11.5px; color: #8b8c96; }
.pres-items-empty { padding: 6px 4px; }
.pres-main { min-width: 0; }
.pres-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.pres-side-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; background: #202127; border: 1px solid #2a2b31; border-radius: 10px; color: #d8d8de; font: inherit; font-size: 13px; cursor: pointer; }
.pres-side-toggle:hover { border-color: #b6631f; }
.pres-main .studio-title, .pres-main .studio-subtitle { margin-left: 0; }
@media (max-width: 899px) {
  .pres-layout { grid-template-columns: minmax(0, 1fr); padding: 0 12px; }
  .pres-layout .pres-side { display: none; position: static; max-height: 50vh; }
  .pres-layout.side-open .pres-side { display: flex; }
}
.pres-main { padding-bottom: 110px; }

/* --- Презентации: удаление из списка --- */
.pres-item-row { position: relative; display: flex; align-items: stretch; border-radius: 10px; }
.pres-item-row .pres-item { flex: 1; min-width: 0; padding-right: 38px; }
.pres-item-row:hover { background: #202127; }
.pres-item-row.active { background: #2a211a; }
.pres-item-row.active .pres-item { border-color: #b6631f; }
.pres-item-row .pres-item:hover { background: transparent; }
.pres-item-row .pres-item.active { background: transparent; }
.pres-item-del { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: #c4c5cf; cursor: pointer; font-size: 17px; opacity: 0; }
.pres-item-row:hover .pres-item-del, .pres-item-del:focus-visible { opacity: 1; }
.pres-item-del:hover { background: #3a1f1f; color: #ff8a8a; }
@media (hover: none) { .pres-item-del { opacity: .8; } }

/* --- Презентации: кнопка отправки в поле брифа; на шаге брифа нижняя строка ввода скрыта --- */
.pres-dictation-field:not(.is-input) .pres-answer { padding-right: 60px; padding-bottom: 56px; }
.pres-send { position: absolute; bottom: 8px; right: 8px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: #c8631a; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.pres-send:hover:not(:disabled) { background: #e07620; }
.pres-send:disabled { background: #2a2b31; color: #6b6c76; cursor: not-allowed; }
.pres-send:focus-visible { outline: 2px solid #ffb877; outline-offset: 2px; }
body.pres-brief-stage #composer-wrap { display: none !important; }
.pres-studio { padding-bottom: 130px; }
body.pres-brief-stage .pres-studio { padding-bottom: 24px; }

/* --- Плашка «Вам начислено N токенов» после регистрации --- */
.welcome-bonus.pay-error { background: #2a1a1c; border-color: #e5484d; color: #ffd4d6; }
.welcome-bonus { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 60; max-width: min(92vw, 460px); padding: 14px 20px; border-radius: 14px; background: #2a211a; border: 1px solid #b6631f; color: #ffe2c6; font-weight: 600; text-align: center; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); }

/* Согласие на обработку персональных данных: галочка при регистрации и окно для прежних аккаунтов */
.auth-form .auth-consent,
.auth-box > .auth-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: #9a9aa2;
  cursor: pointer;
}
.auth-form .auth-consent input,
.auth-box > .auth-consent input {
  width: auto;
  flex: none;
  margin: 2px 0 0;
  padding: 0;
}
.auth-consent a { color: inherit; text-decoration: underline; }
.consent-gate-text {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.5;
  color: #b5b5bd;
}
#consent-gate-accept { margin-top: 14px; width: 100%; }
.auth-consent { text-align: left; }
/* Окно согласия перекрывает всё приложение, пока согласие не дано */
#consent-gate {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: #17181c;
  overflow-y: auto;
}

/* Печать «Under construction» поверх экрана агента, который ещё в разработке (наискосок, не мешает вводу) */
.chat-screen { position: relative; }
.construction-stamp-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.construction-stamp {
  position: absolute;
  left: 50%;
  top: 36%;
  z-index: 20;
  transform: translate(-50%, -50%) rotate(-15deg);
  pointer-events: none;
  user-select: none;
  max-width: 96%;
  filter: url(#stamp-rough) drop-shadow(0 8px 22px rgba(0, 0, 0, .45));
}
.construction-stamp-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 30px 14px;
  border: 5px double #e08a3c;
  border-radius: 14px;
  color: #f0a052;
  background: rgba(23, 24, 28, .55);
  box-shadow: inset 0 0 0 2px rgba(224, 138, 60, .22);
  text-transform: uppercase;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}
.construction-stamp-title {
  font-size: clamp(22px, 6.4vw, 54px);
  line-height: 1.05;
  letter-spacing: .12em;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .35);
}
.construction-stamp-sub {
  font-size: clamp(10px, 2.3vw, 15px);
  letter-spacing: .34em;
  opacity: .88;
}
/* «Строительная лента» сверху и снизу */
.construction-stamp-tape {
  align-self: stretch;
  height: 9px;
  border-radius: 3px;
  background: repeating-linear-gradient(-45deg, #e08a3c 0 10px, rgba(224, 138, 60, .12) 10px 20px);
}

/* Профиль, вкладка «API»: ключи */
.apikey-new { border-color: #b6631f; }
.apikey-secret { display: flex; gap: 10px; align-items: center; margin: 6px 0 12px; }
.apikey-secret code {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 10px 12px;
  border-radius: 8px;
  background: #17181c;
  border: 1px solid #2a2b31;
  font-size: 13px;
  user-select: all;
}
.apikey-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid #2a2b31; }
.apikey-row:first-child { border-top: 0; }
.apikey-revoked { opacity: .55; }
.apikey-row code { font-size: 12px; }
.profile-hint a, .profile-intro a { color: #e0a060; text-decoration: underline; }

/* --- Вкладка «Текст/Программирование» --- */
.tab-label-short { display: none; }
@media (max-width: 899px) {
  .tab-label-full { display: none; }
  .tab-label-short { display: inline; }
}
.text-tab #attach-btn { display: none; }  /* картинки в чат пока не прикрепляем */

.text-studio { box-sizing: border-box; width: 100%; max-width: 900px; margin: 0 auto; padding: 0 20px 24px; }  /* ширина задана явно: в колонке с автополями блок иначе тянется по самой длинной строке кода */
.text-topbar { position: sticky; top: 56px; z-index: 10; display: flex; justify-content: flex-end; align-items: center; height: 52px; pointer-events: none; background: linear-gradient(to bottom, #17181c 65%, rgba(23, 24, 28, 0)); }
.text-topbar > * { pointer-events: auto; }
.text-new { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px 6px 10px; background: #1d1e24; border: 1px solid #2a2b31; border-radius: 999px; color: #b9bac2; font: inherit; font-size: 13px; cursor: pointer; }
.text-new svg { width: 15px; height: 15px; }
.text-new:hover { background: #26272d; color: #f0f0f2; }
.text-new:focus-visible { outline: 2px solid #b6631f; outline-offset: 2px; }

.text-log { display: flex; flex-direction: column; gap: 22px; }
.text-empty { max-width: 420px; margin: 12vh auto 0; text-align: center; }
.text-empty h2 { margin: 0 0 8px; font-size: 26px; font-weight: 600; color: #f0f0f2; }
.text-empty p { margin: 0; font-size: 14px; line-height: 1.5; color: #8b8c96; }

.text-msg { display: flex; flex-direction: column; }
.text-msg-user { align-items: flex-end; }
.text-bubble { max-width: 80%; padding: 10px 16px; background: #26272d; border: 1px solid #33343b; border-radius: 20px; color: #f0f0f2; font-size: 15px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.text-answer { font-size: 15.5px; line-height: 1.7; color: #e8e8ec; overflow-wrap: anywhere; }
.text-par { white-space: pre-wrap; }
.text-par + .text-par, .text-par + .text-code-box, .text-code-box + .text-par, .text-code-box + .text-code-box { margin-top: 12px; }
.text-heading { display: block; margin: 6px 0 2px; font-size: 16.5px; }
.text-regen svg { width: 16px; height: 16px; }
.text-log, .text-msg, .text-answer { min-width: 0; }
.text-code-box { max-width: 100%; }
.text-inline-code { padding: 1px 6px; background: #1d1e24; border: 1px solid #2a2b31; border-radius: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; }
.text-code-box { background: #121316; border: 1px solid #2a2b31; border-radius: 12px; overflow: hidden; }
.text-code-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 2px 14px; background: #1a1b20; border-bottom: 1px solid #2a2b31; font-size: 12px; color: #8b8c96; }
.text-code { margin: 0; padding: 14px; overflow-x: auto; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; line-height: 1.55; white-space: pre; color: #e6e6ea; }
.text-meta { display: flex; align-items: center; margin: 6px 0 0 -10px; }
.text-meta-note { margin-left: 6px; font-size: 12px; color: #8b8c96; }
.text-note { align-self: center; max-width: 92%; text-align: center; font-size: 12.5px; color: #c9a36b; }

.text-dots { display: inline-flex; gap: 5px; padding: 10px 0; }
.text-dots span { width: 7px; height: 7px; border-radius: 50%; background: #8b8c96; animation: text-dot 1.2s infinite ease-in-out; }
.text-dots span:nth-child(2) { animation-delay: .15s; }
.text-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes text-dot { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .text-dots span { animation: none; opacity: .6; } }
.text-slow { display: block; font-size: 12.5px; color: #8b8c96; }
.text-error { padding: 12px 14px; background: #2a1a1a; border: 1px solid #5a2a2a; border-radius: 14px; font-size: 14px; line-height: 1.5; color: #f0c4c4; }
.text-error .btn { margin-left: 10px; }

/* Выбор модели живёт в строке ввода: значок справа и список над строкой */
.composer { position: relative; }
.text-model-slot { flex: 0 1 auto; min-width: 0; }
.text-model-btn { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; height: 36px; padding: 0 10px 0 8px; background: transparent; border: 0; border-radius: 18px; color: #d8d8de; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.text-model-btn:hover { background: #2a2b31; }
.text-model-btn:focus-visible { outline: 2px solid #b6631f; outline-offset: 2px; }
.text-model-btn svg { flex: 0 0 auto; width: 15px; height: 15px; color: #8b8c96; }
#text-model-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-model-dot { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: #8b8c96; }
.text-model-dot[data-vendor="Claude"] { background: #d97757; }
.text-model-dot[data-vendor="ChatGPT"] { background: #19c37d; }
.text-model-menu { position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 30; width: min(360px, 100%); max-height: min(70vh, 480px); overflow-y: auto; padding: 6px; background: #1d1e24; border: 1px solid #34353c; border-radius: 16px; box-shadow: 0 12px 32px rgba(0, 0, 0, .45); }
.text-model-group { padding: 8px 10px 4px; font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: #8b8c96; }
.text-model-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; background: transparent; border: 0; border-radius: 10px; color: #e6e6ea; font: inherit; text-align: left; cursor: pointer; }
.text-model-item:hover, .text-model-item:focus-visible { background: #2a2b31; outline: none; }
.text-model-item[aria-selected="true"] { background: #2a211a; box-shadow: inset 0 0 0 1px #b6631f; }
.text-model-item-main { display: flex; flex: 1; flex-direction: column; gap: 1px; min-width: 0; }
.text-model-item-name { font-size: 14px; font-weight: 600; }
.text-model-item-tag { font-size: 12.5px; color: #8b8c96; }
.text-model-item-price { flex: 0 0 auto; font-size: 12.5px; color: #c9a36b; }
.text-model-foot { padding: 8px 10px 4px; font-size: 12px; line-height: 1.4; color: #8b8c96; }

@media (max-width: 899px) {
  .text-studio { padding: 0 12px 16px; }
  .text-bubble { max-width: 88%; }
  .text-empty { margin-top: 8vh; }
}
