/* ===== AT-RULES (kept as-is) ===== */
@keyframes bcspin{to{transform:rotate(360deg)}}

/* ===== STYLES (sorted) ===== */
#project-update-form {
  flex: 1;
  min-height: 0;
}

#project-update-form .textarea {
  flex: 1;
  min-height: 0;
  resize: none;
}

* {
  box-sizing: border-box;
}

.alert {
  background: #fff8d6;
  border: 1px solid #f1c40f;
  border-radius: 10px;
  font-size: 12px;
  margin-top: 8px;
  padding: 8px 10px;
}

/* ===== Audiences filter ===== */
.aud-filter {
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
  padding-bottom: 10px;
}

.aud-filter .btn {
  margin-top: 8px;
}

/* ===== ЦА. Выравнивание списка по верху ===== */
.audiences-left .panel-body{
  justify-content: flex-start;
}

/* ===== Продукты. Выравнивание списка по верху ===== */
.products-left .panel-body{
  justify-content: flex-start;
}

/* ===== Settings: do NOT stretch panel-body to full viewport ===== */
.panel-body.panel-body-auto{
  height: auto;
  justify-content: flex-start;
  padding: 14px 16px;
}

/* Расположение кнопок */
.b137-actions {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 14px;
}

.b137-actions__left {
  flex: 1;
}

.b137-actions__right {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ===== Brainstorm (ChatGPT-like) ===== */
.bc-bs {
  align-items: stretch;
  display: grid;
  flex: 1;
  gap: 16px;
  grid-template-columns: 360px 1fr;
  height: 100%;
  min-height: 0;
}

.bc-bs__left, .bc-bs__right {
  min-height: 0;
}

.bc-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 12px;
}

.bc-card__title {
  font-weight: 700;
  margin-bottom: 10px;
}

/* Chat full height with internal scroll */
.bc-chat {
  background: #F6F7F9;
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.bc-chat__composer {
  background: #F6F7F9;
  border-top: 1px solid rgba(255,255,255,.12);
  padding: 12px;
}

.bc-chat__composer-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 10px;
}

.bc-chat__empty {
  color: #fff;
  opacity: .85;
  padding: 18px;
}

.bc-chat__messages {
  background: #F6F7F9;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding: 16px;
}

.bc-chat__title {
  font-weight: 600;
}

.bc-chat__top {
  align-items: center;
  background: #1f2937;
  color: #fff;
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
}

.bc-chat__top-actions {
  display: flex;
  gap: 8px;
}

.bc-composer-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: space-between;
}

/* Composer one-line layout */
.bc-composer-row {
  align-items: flex-end;
  display: flex;
  gap: 12px;
}

/* ===== Brainstorm: collapsible create block ===== */
.bc-create {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
}

/* Collapsed state: body hidden, only title + Create + icon visible */
.bc-create--collapsed .bc-create__body {
  display: none;
}

/* Expanded state: top "Создать" button hidden */
.bc-create--expanded #bcCreateOpenBtn {
  display: none;
}

.bc-create__body {
  margin-top: 10px;
}

.bc-create__footer {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-top: 10px;
}

.bc-create__head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.bc-create__head-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.bc-create__title {
  font-weight: 700;
}

.bc-divider {
  background: var(--border);
  height: 1px;
  margin: 12px 0;
}

.bc-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bc-icon {
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 12px;
  padding: 0;
  text-decoration: underline;
}

/* Icon buttons */
.bc-iconbtn {
  align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  height: 32px;
  justify-content: center;
  padding: 0;
  width: 32px;
}

.bc-iconbtn svg {
  fill: #111827;
  height: 18px;
  width: 18px;
}

.bc-iconbtn--light {
  background: transparent;
  border-color: rgba(255,255,255,.25);
}

.bc-iconbtn--light svg {
  fill: #fff;
}

.bc-iconbtn--light:hover {
  background: rgba(255,255,255,.08);
}

.bc-iconbtn:hover {
  background: #f3f4f6;
}

.bc-input {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  width: 100%;
}

.bc-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: inherit;
  display: block;
  padding: 10px 12px;
  text-decoration: none;
}

.bc-item--active {
  background: #0078B9;
  border-color: #0078B9;
  color: #fff;
  outline: none;
}

.bc-item--active * {
  color: #fff;
}

.bc-item--active:hover {
  background: #0078B9;
}

.bc-item:hover {
  background: var(--panel);
}

.bc-item__meta {
  font-size: 12px;
  margin-top: 4px;
  opacity: .7;
}

.bc-item__title {
  font-weight: 600;
}

.bc-label {
  font-size: 12px;
  opacity: .85;
}

.bc-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  padding-right: 4px;
}

/* ===== Markdown (assistant messages) — compact & readable ===== */
.bc-md {
  font-size: 14px;
  line-height: 1.35;
}

/* Markdown typography inside assistant messages */
.bc-md :is(h1,h2,h3) {
  margin: 10px 0 6px;
}

.bc-md blockquote {
  border-left: 3px solid rgba(0,0,0,.12);
  margin: 6px 0;
  padding: 6px 10px;
}

.bc-md code {
  background: #f3f4f6;
  border-radius: 8px;
  padding: 2px 6px;
}

/* Headings */
.bc-md h1 {
  font-size: 20px;
  line-height: 1.20;
  margin: 10px 0 6px;
}

.bc-md h2 {
  font-size: 18px;
  line-height: 1.22;
  margin: 10px 0 6px;
}

.bc-md h3 {
  font-size: 16px;
  line-height: 1.25;
  margin: 8px  0 5px;
}

.bc-md li {
  margin: 2px 0;
}

.bc-md li > p {
  margin: 2px 0;
}

/* Первый абзац внутри шага (ol > li) делаем подзаголовком */
.bc-md ol > li > p:first-of-type {
  font-weight: 600;
  margin-bottom: 6px;
  margin-top: 0;
}

/* если внутри шага есть вложенный список — отделяем его от первой строки */
.bc-md ol > li > ul,
.bc-md ol > li > ol {
  font-weight: 400;
  margin-top: 6px;
}

/* и чтобы после вложенного списка не было лишней “дыры” */
.bc-md ol > li > ul:last-child,
.bc-md ol > li > ol:last-child {
  margin-bottom: 0;
}

/* Paragraphs */
.bc-md p {
  margin: 4px 0;
}

.bc-md p:empty {
  display: none;
}

.bc-md pre {
  background: #111827;
  border-radius: 12px;
  color: #fff;
  margin: 6px 0;
  overflow: auto;
  padding: 10px 12px;
}

.bc-md ul {
  margin: 8px 0 8px 18px;
}

/* Абзац после списка = новый смысловой блок */
.bc-md ul + p,
.bc-md ol + p {
  margin-top: 12px;
}

/* Lists */
.bc-md ul,
.bc-md ol {
  margin: 4px 0;
  padding-left: 18px;
}

.bc-msg {
  display: flex;
}

.bc-msg--ai {
  justify-content: flex-start;
}

/* Edit mode actions: slightly more visible */
.bc-msg--editing .bc-msg__actions {
  opacity: .9;
}

/* Message edit mode: keep bubble width like normal (not collapsed) */
.bc-msg--editing .bc-msg__bubble {
  width: min(78%, 720px);
}

/* safety: textarea must really stretch inside */
.bc-msg--editing .bc-textarea--edit {
  box-sizing: border-box;
  width: 100%;
}

.bc-msg--user {
  justify-content: flex-end;
}

/* User bubbles: green */
.bc-msg--user .bc-msg__bubble {
  background: #EFFDDE;
}

/* Actions in message bubbles */
.bc-msg__actions {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 8px;
  opacity: .75;
}

.bc-msg__actions:hover {
  opacity: 1;
}

.bc-msg__bubble {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  max-width: 78%;
  padding: 10px 12px;
}

.bc-msg__content {
  line-height: 1.35;
  white-space: pre-wrap;
}

/* IMPORTANT: Markdown is HTML -> no pre-wrap, иначе "простыня" */
.bc-msg__content.bc-md {
  white-space: normal;
}

.bc-msg__meta {
  font-size: 12px;
  margin-top: 6px;
  opacity: .65;
  white-space: nowrap;
}

.bc-muted {
  font-size: 13px;
  opacity: .65;
}

.bc-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bc-spinner {
  animation: bcspin .8s linear infinite;
  border: 2px solid rgba(255,255,255,.25);
  border-radius: 50%;
  border-top-color: #fff;
  height: 14px;
  width: 14px;
}

.bc-textarea {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  resize: vertical;
  width: 100%;
}

.bc-textarea--chat {
  flex: 1;
  font-size: 15px;
  line-height: 1.3;
  max-height: 140px;
  min-height: 88px;
  resize: none;
}

.bc-textarea--edit {
  border-color: #111827;
}

.bc-toggle {
  align-items: center;
  display: flex;
  font-size: 13px;
  gap: 10px;
  opacity: .8;
}

.bc-toggles {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

/* Wait indicator */
.bc-wait {
  align-items: center;
  background: rgba(0,0,0,.08);
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 12px;
  color: #111;
  display: none;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px 10px;
}

.bc-warn {
  background: #fff3cd;
  border: 1px solid #ffe69c;
  border-radius: 12px;
  color: #664d03;
  margin-bottom: 12px;
  padding: 10px;
}

.brand {
  font-weight: 700;
}

.brand-sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.brand-title {
  font-weight: 800;
}


.btn {
  background: #111827;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  padding: 10px 14px;
}

/* Кнопка Удалить*/
.btn-danger {
  background: #d32f2f;
  border: 1px solid #d32f2f;
  color: #fff;
}

.btn-danger:hover {
  filter: brightness(0.95);
}

.btn-ghost {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: #111827;
}

.btn-ghost:hover {
  background: var(--panel);
}

/* Buttons */
.btn-outline {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  padding: 8px 12px;
}

.btn-outline:hover {
  background: #f3f4f6;
}

/* Кнопка Белая */
.btn-white {
  background: #fff;
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 12px;
  color: #111827;
  cursor: pointer;
  padding: 8px 12px;
}

.btn-white:hover {
  background: #f3f4f6;
}

/* ===== Card wrapper (grey rounded container like in mock) ===== */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
}

/* Make inner panel look like clean white sheet inside card */
.card .panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.chat {
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  min-height: 70vh;
  overflow: hidden;
}

.chat-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
}

.chat-input {
  align-items: flex-end;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  padding: 12px;
  position: relative;
}

.chat-input textarea {
  border: 1px solid var(--border);
  border-radius: 12px;
  flex: 1;
  font-size: 14px;
  max-height: 160px;
  min-height: 44px;
  padding: 10px 12px;
  resize: vertical;
}

.chat-messages {
  background: #fff;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
  padding: 16px;
}

.chat-title {
  font-weight: 600;
}

/* старый .container в шаблонах больше не нужен, но пусть не мешает */
.container {
  margin: 0;
  max-width: none;
  padding: 0;
}

/* Make content area full height so pages can stretch */
.content {
  display: flex;
  flex: 1;
  flex-direction: column;
  height: auto !important;
  min-height: 0;
  padding: 16px;
}

/* Form: strictly one column, inputs full width */
.form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Кнопки "Удалить", "Отмена", "Сохранить" */
.form-actions {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.form-actions__right {
  display: flex;
  gap: 10px;
}

/* Флаг "Активен" — справа сверху */
.form-field {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}

.form-wrap {
  max-width: 720px;
}

.htmx-indicator {
  display: none;
}

.htmx-request .bc-wait {
  display: flex;
}

.htmx-request .htmx-indicator {
  display: inline-block;
}

/* ===== b137 forms (prompts editor) ===== */
.input, .textarea {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-sizing: border-box;
  font-size: 14px;
  padding: 10px 12px;
  width: 100%;
}

.layout {
  display: grid;
  gap: 16px;
  grid-template-columns: 320px 1fr;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list li {
  border-radius: 10px;
  padding: 8px;
}

.list li.active {
  background: #fff;
  border: 1px solid var(--border);
}

.list li:hover {
  background: #fff;
}

.main {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 0;
}

.msg-bubble {
  background: var(--assistant);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 75%;
  padding: 10px 12px;
  white-space: pre-wrap;
}

.msg-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

.msg-row {
  display: flex;
  justify-content: flex-start;
}

.msg-row-user {
  justify-content: flex-end;
}

.msg-user {
  background: var(--user);
}


/* ===== b137 prompt edit: fixed layout (no overflow, proper stacking) ===== */
.b137-prompt-edit .panel-body{
  height: auto;              
  justify-content: flex-start; 
}

/* Форма должна занимать доступную высоту карточки */
.b137-prompt-edit .form{
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Поля: label над input/textarea (как на правильном скрине) */
.b137-prompt-edit .form-field{
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

/* Текст промпта: растягиваем, но без выезда за экран */
.b137-prompt-edit textarea.textarea{
  flex: 1;
  min-height: 0;
  resize: none;
}

/* b137 prompt edit: allow the prompt field to take remaining height */
.b137-prompt-edit .form-field--grow{
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.b137-prompt-edit .form-field--grow .textarea{
  flex: 1;
  min-height: 0;
  resize: none;
}

.content > .b137-prompt-edit{
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.content > .b137-prompt-edit .panel{
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.content > .b137-prompt-edit .panel-body{
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: auto;
}


/* Меню занимает всё пространство между project-switcher и footer */
.nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  padding-top: 12px;
}

.nav__item {
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text);
  display: block;
  padding: 10px 10px;
}

.nav__item.active {
  background: var(--panel);
  border-color: var(--border);
  font-weight: 600;
}

.nav__item:hover {
  background: var(--panel);
}

.panel-body {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 8px 12px;
}

.panel-title {
  font-weight: 600;
  padding: 10px 12px;
}

/* ===== Project switcher in sidebar ===== */
.project-switcher {
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
  margin-top: 10px;
  padding-bottom: 12px;
  padding-top: 10px;
}

.project-switcher__actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.project-switcher__actions .btn {
  border-radius: 10px;
  padding: 8px 10px;
}

.project-switcher__label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

/* actions like in your mock: bottom-right */
.projects-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-top: 12px;
}

/* ===== Projects layout ===== */
.projects-grid {
  align-items: stretch;
  display: grid;
  flex: 1;
  gap: 16px;
  grid-template-columns: 360px 1fr;
  min-height: 0;
}

/* ===== Projects: full height columns + textarea stretch ===== */
.projects-left .card,
.projects-right .card {
  height: 100%;
}

.projects-left .panel,
.projects-right .panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.projects-left .panel-body,
.projects-right .panel-body {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.projects-left__title,
.projects-right__title {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

/* make list clickable (full row hit-area) */
.projects-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.projects-list li a {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  display: block;
  padding: 10px 12px;
  text-decoration: none;
}

.projects-list li a:hover {
  background: var(--panel);
}

.projects-list li.active a {
  background: var(--panel);
  border-color: var(--border);
  font-weight: 600;
}

/* editor form takes full height, textarea grows */
.projects-right .form {
  display: flex;
  flex: 1;
  flex-direction: column;
}

/* textarea can grow */
.projects-right .panel-body {
  flex: 1;
  min-height: 0;
}

.projects-right .textarea {
  flex: 1;
  min-height: 220px;
  resize: none;
}

.radio {
  align-items: center;
  color: var(--text);
  display: flex;
  font-size: 13px;
  gap: 8px;
  margin: 6px 0;
}

.radio input {
  transform: translateY(1px);
}

.select {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  width: 100%;
}

/* ===== App Shell (Left menu like ChatGPT) ===== */
.shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar .panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 12px;
}

/* Sidebar layout: keep footer visible and restore separators */
.sidenav {
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 20;
}

/* УБИРАЕМ разделитель под брендом */
.sidenav__brand {
  border-bottom: 0;
  padding: 14px 14px 10px 14px;

  /* фикс: бренд всегда поверх и не “пропадает” */
  position: sticky;
  top: 0;
  z-index: 30;
  background: #fff;
}

/* Footer прижимаем вниз */
.sidenav__footer {
  border-top: 1px solid var(--border);
  margin-top: auto;
  padding: 10px;
  padding-top: 12px;
}

.spinner {
  color: var(--muted);
  font-size: 12px;
  margin-left: 8px;
}

/* Растягиваем текстовое поле */
.textarea {
  flex: 1;
  min-height: 200px;
  resize: vertical;
}

.topbar {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  height: 56px;
  justify-content: space-between;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar__title {
  font-weight: 600;
}

.w-100 {
  width: 100%;
}

/* marked часто вкладывает <p> внутрь <li> */
/* Blocks */
.bc-md hr {
  margin: 8px 0;
}

/* ===== "Шаги" (OL) как отдельные абзацы ===== */
/* расстояние между шагами (1., 2., 3. ...) */
.bc-md ol > li {
  font-weight: 600;
  margin: 12px 0;
}

:root {
  --assistant: #ffffff;
  --bg: #ffffff;
  --border: #e6e8ee;
  --muted: #6b7280;
  --panel: #f6f7f9;
  --text: #111827;
  --user: #dcfce7;
}

a {
  color: inherit;
  text-decoration: none;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Arial;
  margin: 0;
}

/* ===== Stories UI helpers (missing in current CSS) ===== */

/* Small pill (used on dashboard) */
.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--border);
  font-size: 13px;
}

/* Simple vertical stack */
.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Grid helpers (2 columns) */
.grid {
  display: grid;
  gap: 16px;
  align-items: start;
}
.grid-2 {
  grid-template-columns: 1fr 1fr;
}

/* Basic field styling (label + input) */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.label {
  font-size: 12px;
  color: var(--muted);
}

/* Tables: current CSS doesn't style <table> at all */
.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.table th,
.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 14px;
  vertical-align: top;
}

.table thead th {
  background: var(--panel);
  font-weight: 600;
}

.table tbody tr:hover td {
  background: #fafafa;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

/* ===== Settings layout ===== */

.settings-wrap {
  max-width: 768px;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-grid {
  display: grid;
  gap: 16px;
}

.settings-grid.cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.settings-grid.cols-1 {
  grid-template-columns: 1fr;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 13px;
  color: var(--muted);
}

.settings-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 10px;
}

/* =========================
   Toast notifications
   ========================= */
.toast-stack{
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(720px, calc(100vw - 24px));
  pointer-events: none;
}

.toast{
  pointer-events: auto;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  animation: toastIn .18s ease-out;
}

.toast__text{
  font-size: 14px;
  line-height: 1.35;
}

.toast__close{
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  opacity: .65;
  padding: 2px 6px;
  border-radius: 8px;
}
.toast__close:hover{ opacity: 1; background: var(--panel); }

/* SUCCESS */
.toast--ok{
  background: #eaf6ee;
  border-left: 6px solid #2e7d32;
  border-color: #cfe8d6;
  color: #0f3d2e;
}

/* WARNING */
.toast--warn{
  background: #fff7e0;
  border-left: 6px solid #f1c40f;
  border-color: #f6e4a6;
  color: #5c4a00;
}

/* ERROR */
.toast--err{
  background: #fdecea;
  border-left: 6px solid #d32f2f;
  border-color: #f5c6c3;
  color: #611a15;
}

@keyframes toastIn{
  from{ transform: translateY(-8px); opacity: 0; }
  to{ transform: translateY(0); opacity: 1; }
}

.dash-row{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 900px){
  .dash-row{
    grid-template-columns: 1fr;
  }
}

.table-scroll{
  max-height: 520px;
  overflow-y: auto;
}
