/* ============================================================
   «Свои виджеты» — кабинет своих алертов (26.09.2026).
   Макеты: scratch-design/alerts-roulette-2026-09-25/boards (Main, AlertsStudio,
   AlertsEvents, AlertsCode, AlertOBS). Язык — графит кабинета (bot-graphite.css):
   нейтральные поверхности, без свечений; оранжевый — только действие и выбранное.
   Всё под префиксом aw-, токены — на .aw-root. Ширины: 1440+, 768–1100, 390.
   ============================================================ */

.aw-root {
  --aw-bg: #131417;
  --aw-card: #1c1f24;
  --aw-card-2: #22262c;
  --aw-sunken: #16181c;
  --aw-well: #131519;
  --aw-bd: #30343b;
  --aw-bd-soft: #292d33;
  --aw-bd-strong: #454b55;
  --aw-bd-input: #3a3f47;
  --aw-tx: #edf0f5;
  --aw-tx-2: #b4bcc8;
  --aw-tx-3: #8f98a6;
  --aw-ok: #7fc59f;
  --aw-ok-tx: #a9dcc0;
  --aw-warn: #e3b25e;
  --aw-warn-tx: #f0d39e;
  --aw-bad: #ef8f86;
  --aw-bad-tx: #f6c0ba;
  --aw-accent: #ff6a2b;
  --aw-accent-tx: #ffb18f;
  --aw-accent-bg: #ff6a2b17;
  --aw-on-accent: #1a0e07;
  --aw-r: 12px;
  --aw-r-ctl: 8px;
  --aw-font: var(--font-body, 'Onest', Inter, system-ui, sans-serif);
  --aw-mono: var(--font-mono, 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace);
  display: block;
  min-width: 0;
  color: var(--aw-tx);
  font: 400 13px/1.5 var(--aw-font);
  color-scheme: dark;
  /* openStudio() прокручивает к корню — шапка студии встаёт под липкую верхнюю панель кабинета, а не за неё. */
  scroll-margin-top: calc(var(--header-h, 56px) + 16px);
}
.aw-root [hidden] { display: none !important; }
.aw-root *, .aw-root *::before, .aw-root *::after { box-sizing: border-box; }
.aw-root button { font-family: inherit; }
.aw-root a { color: var(--aw-accent-tx); text-decoration: none; }
.aw-root a:hover { color: #ffc7ad; }
.aw-root code { font-family: var(--aw-mono); font-size: .92em; color: var(--aw-accent-tx); background: #ff6a2b14; border-radius: 4px; padding: 1px 5px; overflow-wrap: anywhere; }
.aw-root :focus-visible { outline: 2px solid #ff6a2b99; outline-offset: 2px; }
.aw { display: block; min-width: 0; }
.aw-ico { flex: none; }

/* ---- типографика и общие ---- */
.aw-h2 { margin: 0; font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: 0; }
.aw-h3 { margin: 0; font-size: 15px; line-height: 20px; font-weight: 600; letter-spacing: 0; }
.aw-lead { margin: 6px 0 0; font-size: 13.5px; line-height: 20px; color: var(--aw-tx-2); }
.aw-small { font-size: 12px; line-height: 1.5; color: var(--aw-tx-3); }
.aw-muted { color: var(--aw-tx-3); font-weight: 400; }
.aw-grow { flex: 1 1 auto; min-width: 0; }
.aw-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.aw-mono { font-family: var(--aw-mono); }
.aw-num { font-size: 12px; font-weight: 500; color: var(--aw-tx-3); }
.aw-vh { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.aw-note { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; font-size: 12px; line-height: 18px; color: var(--aw-tx-3); }
.aw-note > span { flex: 1 1 320px; min-width: 0; }
.aw-note .aw-ico { margin-top: 1px; color: var(--aw-tx-3); }
.aw-cn { font: 500 11.5px var(--aw-mono) !important; color: #d8dde5 !important; background: #ffffff0d !important; border: 1px solid var(--aw-bd); border-radius: 5px; padding: 1px 6px !important; }
.aw-link { padding: 0; border: 0; background: none; color: var(--aw-accent-tx); font: inherit; cursor: pointer; }
.aw-link:hover { color: #ffc7ad; text-decoration: underline; }
.aw-loading-line { display: flex; align-items: center; gap: 10px; margin: 0; padding: 18px 2px; color: var(--aw-tx-3); }
.aw-spinner { width: 16px; height: 16px; flex: none; border: 2px solid #ffffff26; border-top-color: var(--aw-accent); border-radius: 50%; animation: aw-spin .8s linear infinite; }
.aw-spinner.is-sm { width: 12px; height: 12px; border-width: 2px; }
@keyframes aw-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .aw-spinner { animation-duration: 2.4s; } }

/* ---- кнопки ---- */
.aw-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; flex: none;
  border: 1px solid var(--aw-bd-strong); border-radius: var(--aw-r-ctl); background: #272c33; color: var(--aw-tx);
  font: 600 13px var(--aw-font); white-space: nowrap; cursor: pointer; text-decoration: none; transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.aw-root a.aw-btn { color: var(--aw-tx); }
.aw-btn:hover { border-color: #5a616c; background: #2e343c; color: var(--aw-tx); }
.aw-btn.is-pri { border-color: var(--aw-accent); background: var(--aw-accent); color: var(--aw-on-accent); }
.aw-btn.is-pri:hover { background: #ff7f49; border-color: #ff7f49; color: var(--aw-on-accent); }
.aw-btn.is-ghost { border-color: transparent; background: transparent; color: var(--aw-tx-2); }
.aw-root a.aw-btn.is-ghost { color: var(--aw-tx-2); }
.aw-btn.is-ghost:hover { background: #ffffff0a; color: var(--aw-tx); }
.aw-btn.is-sm { height: 30px; padding: 0 10px; font-size: 12px; gap: 6px; }
.aw-btn.is-lg { height: 40px; padding: 0 16px; }
.aw-btn.is-danger { color: var(--aw-bad); }
.aw-btn:disabled, .aw-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.aw-iconbtn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; padding: 0;
  border: 1px solid transparent; border-radius: var(--aw-r-ctl); background: transparent; color: var(--aw-tx-3); cursor: pointer;
}
.aw-iconbtn:hover { background: #ffffff0a; color: var(--aw-tx); }
.aw-iconbtn.is-sm { width: 30px; height: 30px; }
.aw-iconbtn.is-bd { border-color: var(--aw-bd-strong); background: #272c33; color: var(--aw-tx-2); }
.aw-iconbtn[aria-pressed="true"] { color: var(--aw-accent-tx); }

/* ---- чипы, переключатели, сегменты ---- */
.aw-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; flex: none;
  border: 1px solid var(--aw-bd); border-radius: 999px; background: transparent; color: var(--aw-tx-2);
  font: 500 11.5px var(--aw-font); white-space: nowrap;
}
.aw-chip.is-tag { height: 22px; font-size: 11px; }
.aw-chip.is-on { border-color: #ff6a2b88; background: #ff6a2b14; color: var(--aw-accent-tx); }
.aw-chip.is-warn { border-color: #e3b25e44; background: #e3b25e14; color: var(--aw-warn-tx); }
.aw-chip.is-bad { border-color: #ef8f8644; background: #ef8f8612; color: var(--aw-bad-tx); }
.aw-chip.is-toggle, .aw-chip.is-btn { height: 30px; padding: 0 12px; font-size: 12.5px; cursor: pointer; }
.aw-chip.is-toggle:hover, .aw-chip.is-btn:hover { border-color: #5a616c; color: var(--aw-tx); }
.aw-chip.is-toggle:focus-within { outline: 2px solid #ff6a2b99; outline-offset: 2px; }
.aw-chips { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.aw-chips-wrap { display: flex; gap: 6px; flex-wrap: wrap; }

.aw-switch { position: relative; display: inline-flex; align-items: center; gap: 10px; flex: none; cursor: pointer; color: var(--aw-tx-2); font-size: 13px; }
.aw-switch input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.aw-sw { position: relative; width: 36px; height: 20px; flex: none; border: 1px solid var(--aw-bd-strong); border-radius: 999px; background: #2a2e35; transition: background-color .15s ease, border-color .15s ease; }
.aw-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: #9aa3b0; transition: left .15s ease, background-color .15s ease; }
.aw-switch input:checked + .aw-sw, .aw-ty input:checked + .aw-sw { border-color: var(--aw-accent); background: var(--aw-accent); }
.aw-switch input:checked + .aw-sw::after, .aw-ty input:checked + .aw-sw::after { left: 19px; background: #fff; }
.aw-switch input:focus-visible + .aw-sw, .aw-ty input:focus-visible + .aw-sw { outline: 2px solid #ff6a2b99; outline-offset: 2px; }
.aw-switch-lbl { min-height: 36px; }

.aw-seg { display: inline-flex; flex-wrap: wrap; padding: 3px; gap: 3px; border: 1px solid var(--aw-bd); border-radius: 10px; background: var(--aw-sunken); }
.aw-segi { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--aw-tx-2); font: 500 12.5px var(--aw-font); cursor: pointer; white-space: nowrap; }
.aw-segi:hover { color: var(--aw-tx); }
.aw-segi.is-on { background: #2d323a; color: var(--aw-tx); }
.aw-seg.is-sm { padding: 2px; gap: 2px; border-radius: 8px; }
.aw-seg.is-sm .aw-segi { height: 26px; padding: 0 8px; border-radius: 6px; font-size: 12px; }

.aw-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--aw-ok); }
.aw-dot.is-warn { width: 6px; height: 6px; background: var(--aw-warn); }
.aw-live, .aw-idle { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; flex: none; border-radius: 999px; font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.aw-live { border: 1px solid #7fc59f44; background: #7fc59f12; color: var(--aw-ok-tx); }
.aw-idle { border: 1px solid var(--aw-bd-input); color: var(--aw-tx-3); }
.aw-idle i { width: 7px; height: 7px; flex: none; border: 1.5px solid var(--aw-tx-3); border-radius: 50%; }

/* ---- поля ---- */
.aw-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.aw-lbl { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; line-height: 16px; color: var(--aw-tx-2); }
.aw-inp {
  display: flex; align-items: center; width: 100%; min-width: 0; height: 38px; padding: 0 12px;
  border: 1px solid var(--aw-bd-input); border-radius: var(--aw-r-ctl); background: var(--aw-sunken); color: var(--aw-tx);
  font: 400 13px var(--aw-font); outline: none;
}
.aw-inp:focus, .aw-inp:focus-within { border-color: #ff6a2b99; }
.aw-inp.is-bad { border-color: #ef8f86aa; }
select.aw-inp { padding-right: 8px; cursor: pointer; }
.aw-inp-wrap { position: relative; display: block; }
.aw-inp-wrap .aw-inp { padding-right: 30px; }
.aw-inp-wrap .aw-suf { position: absolute; top: 0; right: 12px; height: 38px; display: flex; align-items: center; pointer-events: none; }
.aw-suf { margin-left: auto; padding-left: 6px; color: var(--aw-tx-3); font-size: 12.5px; flex: none; }
.aw-bare { flex: 1 1 auto; width: 0; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--aw-tx); font: 400 13px var(--aw-font); }
.aw-bare.aw-mono { font: 500 12.5px var(--aw-mono); }
.aw-inp-num { gap: 6px; }
.aw-field-grow { flex: 1 1 auto; }
.aw-field-err { margin: 6px 0 0; font-size: 12px; line-height: 17px; color: var(--aw-bad); }
.aw-hint { margin: 10px 0 0; font-size: 12px; line-height: 18px; color: var(--aw-tx-3); }
.aw-hint > .aw-ico { vertical-align: -2px; margin-right: 2px; }
/* Условие базового варианта не меняется: выключенные чипы, площадка и «как сравнивать». */
.aw-chip.is-toggle.is-disabled { opacity: .5; cursor: not-allowed; }
.aw-chip.is-toggle.is-disabled:hover { border-color: var(--aw-bd); color: inherit; }
.aw-segi:disabled, select.aw-inp:disabled { opacity: .5; cursor: not-allowed; }
.aw-ds.is-locked [data-aw-base-lock] { margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--aw-bd-soft); border-radius: 10px; background: var(--aw-sunken); color: var(--aw-tx-2); }
.aw-range { width: 100%; height: 20px; margin: 0; accent-color: var(--aw-accent); cursor: pointer; }
.aw-kbd { display: inline-flex; align-items: center; height: 18px; padding: 0 5px; border: 1px solid var(--aw-bd-input); border-bottom-width: 2px; border-radius: 5px; font: 500 11px var(--aw-mono); color: var(--aw-tx-2); }

/* ---- баннеры ---- */
.aw-banner { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--aw-bd); border-radius: var(--aw-r); background: var(--aw-card); color: var(--aw-tx-2); font-size: 13px; line-height: 19px; }
.aw-banner > span:not(.aw-banner-acts) { flex: 1 1 280px; min-width: 0; }
.aw-banner b { font-weight: 600; color: var(--aw-tx); }
.aw-banner.is-warn { border-color: #e3b25e40; background: #e3b25e0f; color: var(--aw-warn-tx); }
.aw-banner.is-warn > .aw-ico { color: var(--aw-warn); }
.aw-banner.is-bad { border-color: #ef8f8659; background: #221a1c; color: var(--aw-bad-tx); }
.aw-banner.is-bad > .aw-ico { color: var(--aw-bad); }
.aw-banner.is-info > .aw-ico { color: var(--aw-tx-3); }
.aw-banner-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.aw-calm { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 14px 16px; border: 1px dashed var(--aw-bd-input); border-radius: var(--aw-r); color: var(--aw-tx-2); font-size: 13px; line-height: 19px; }
.aw-calm .aw-ico { margin-top: 2px; color: var(--aw-tx-3); }
.aw-drafts-note { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; }

/* ---- список: шапка, вкладки ---- */
.aw-pagehd { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 24px; margin: 0 0 14px; }
.aw-pagehd-copy { min-width: 0; flex: 1 1 420px; }
.aw-pagehd-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.aw-tabs, .aw-ctabs { display: flex; gap: 28px; margin: 0 0 20px; border-bottom: 1px solid var(--aw-bd-soft); overflow-x: auto; scrollbar-width: none; }
.aw-tabs::-webkit-scrollbar, .aw-ctabs::-webkit-scrollbar { display: none; }
.aw-tab {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 2px; flex: none; margin-bottom: -1px;
  border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--aw-tx-2);
  font: 500 14px var(--aw-font); cursor: pointer; white-space: nowrap;
}
.aw-tab:hover { color: var(--aw-tx); }
.aw-tab.is-on { color: var(--aw-tx); border-bottom-color: var(--aw-accent); }
.aw-mdot, .aw-edot, .aw-odot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.aw-mdot { background: var(--aw-warn); }
.aw-edot { background: var(--aw-bad); }
.aw-odot { background: var(--aw-ok); }

.aw-warnbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; min-height: 56px; margin: 0 0 20px; padding: 10px 10px 10px 13px; border: 1px solid #e3b25e40; border-radius: var(--aw-r); background: #e3b25e0f; }
.aw-warnbar-ico { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 8px; background: #e3b25e1f; color: var(--aw-warn); }
.aw-warnbar-txt { flex: 1 1 300px; min-width: 0; margin: 0; font-size: 13px; line-height: 18px; color: var(--aw-warn-tx); }
.aw-warnbar-txt b { font-weight: 600; color: #f7e2b8; overflow-wrap: anywhere; }

/* ---- карточки виджетов ---- */
.aw-card { min-width: 0; border: 1px solid var(--aw-bd); border-radius: var(--aw-r); background: var(--aw-card); }
.aw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.aw-wcard { display: flex; flex-direction: column; overflow: hidden; }
.aw-wcard.is-off .aw-thumb { filter: grayscale(.7); opacity: .7; }
/* Превью карточки (27.09.2026): постер темы (кадр её шаблона) или картинка «Свой код»; при наведении, фокусе и
   касании — живое превью в iframe поверх. Рамка 16:10 = центральные 800×500 холста 800×600, как у постера:
   подмена без скачка, высота карточки не зависит от загрузки. */
.aw-thumb, .aw-tthumb {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 10; flex: none; overflow: hidden; isolation: isolate;
  border-bottom: 1px solid var(--aw-bd-soft);
  background: radial-gradient(60% 70% at 50% 50%, color-mix(in srgb, var(--aw-accent-t, #ff6a2b) 8%, transparent), transparent 72%),
    radial-gradient(120% 90% at 50% 45%, #1b1e24, #111215 70%);
}
.aw-pv-art, .aw-poster, .aw-pv-live { position: absolute; inset: 0; width: 100%; height: 100%; }
.aw-pv-art { display: block; transition: opacity .25s ease; }
.aw-art-win { fill: #1a1d22; stroke: #ffffff17; stroke-width: 1.2; }
.aw-art-sep { fill: none; stroke: #ffffff12; stroke-width: 1.2; }
.aw-art-dot { fill: #ffffff26; }
.aw-art-bar { fill: #ffffff21; }
.aw-art-bar.is-dim { fill: #ffffff12; }
.aw-art-acc { fill: var(--aw-accent-t, #ff6a2b); opacity: .8; }
.aw-art-acc.is-dim { opacity: .35; }
.aw-art-code { fill: none; stroke: var(--aw-accent-t, #ff6a2b); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.aw-poster { display: block; object-fit: cover; opacity: 0; transition: opacity .25s ease; user-select: none; -webkit-user-drag: none; }
.aw-pv.has-poster .aw-poster { opacity: 1; }
.aw-pv.has-poster .aw-pv-art { opacity: 0; }
.aw-pv-live { overflow: hidden; opacity: 0; transition: opacity .3s ease; pointer-events: none; }
.aw-pv-frame { position: absolute; left: 0; top: 0; border: 0; background: transparent; transform-origin: 0 0; pointer-events: none; }
.aw-pv.is-live .aw-pv-live { opacity: 1; }
.aw-pv.is-live .aw-poster, .aw-pv.is-live .aw-pv-art { opacity: 0; }
.aw-pv-badge, .aw-pv-hint {
  position: absolute; z-index: 2; display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px;
  border: 1px solid #ffffff1c; border-radius: 999px; background: #0d0e10d9; color: var(--aw-tx-2);
  font: 600 10.5px/1 var(--aw-font); letter-spacing: .02em; white-space: nowrap; pointer-events: none;
}
.aw-pv-badge { left: 8px; top: 8px; opacity: 0; transform: translateY(-3px); transition: opacity .2s ease, transform .2s ease; }
.aw-pv-badge i { width: 6px; height: 6px; flex: none; border-radius: 50%; background: #ff5a4f; box-shadow: 0 0 0 3px #ff5a4f2e; }
.aw-pv.is-live .aw-pv-badge { opacity: 1; transform: none; }
/* Плитка темы маленькая: «живое» — только точкой, иначе метка закрывает сумму и имя (у «Космоса» — «500 ₽»). */
.aw-tcard .aw-pv-badge { left: 6px; top: 6px; height: 18px; padding: 0 5px; gap: 0; font-size: 0; }
.aw-pv-hint { right: 8px; bottom: 8px; display: none; gap: 4px; padding: 0 9px 0 6px; color: var(--aw-tx); }
.aw-pv-hint .aw-ico { color: var(--aw-accent-t, var(--aw-accent)); fill: currentColor; }
/* Сенсорный экран: наведения нет — подсказка, что картинку можно коснуться. */
@media (hover: none) {
  .aw-pv-hint { display: inline-flex; }
  .aw-pv.is-live .aw-pv-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .aw-pv-hint { display: none !important; }
  .aw-pv-art, .aw-poster, .aw-pv-live, .aw-pv-badge { transition: none; }
}
.aw-wbody { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; }
.aw-wname { display: flex; align-items: center; gap: 10px; min-height: 24px; }
.aw-wname b { flex: 1 1 auto; min-width: 0; font-size: 15px; line-height: 20px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aw-card-err { display: flex; align-items: flex-start; gap: 7px; margin: 0; padding: 7px 10px; border: 1px solid #ef8f8633; border-radius: 8px; background: #ef8f860f; color: var(--aw-bad-tx); font-size: 12px; line-height: 17px; }
.aw-card-err span { min-width: 0; overflow-wrap: anywhere; }
.aw-card-err .aw-ico { margin-top: 1px; color: var(--aw-bad); }
.aw-wfoot { display: flex; align-items: center; gap: 8px; margin-top: auto; min-height: 55px; padding: 8px 12px 8px 18px; border-top: 1px solid var(--aw-bd-soft); }
.aw-wfoot-time { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- меню «⋯» ---- */
.aw-menu-wrap { position: relative; flex: none; }
.aw-menu {
  position: absolute; z-index: 30; top: calc(100% + 6px); right: 0; min-width: 220px; padding: 6px;
  border: 1px solid var(--aw-bd); border-radius: 10px; background: #202328; box-shadow: 0 16px 40px #0000008c;
}
.aw-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--aw-tx); font: 500 13px var(--aw-font); text-align: left; cursor: pointer; white-space: nowrap; }
.aw-menu-item .aw-ico { color: var(--aw-tx-3); }
.aw-menu-item:hover, .aw-menu-item:focus-visible { background: #ffffff0d; outline: none; }
.aw-menu-item.is-danger, .aw-menu-item.is-danger .aw-ico { color: var(--aw-bad); }

/* ---- пустой список ---- */
.aw-empty { padding: 28px; }
.aw-empty-copy { max-width: 720px; }
.aw-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 20px 0; padding: 0; list-style: none; counter-reset: aw-step; }
.aw-steps li { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 14px 14px 14px 50px; border: 1px solid var(--aw-bd-soft); border-radius: 10px; background: var(--aw-sunken); counter-increment: aw-step; }
.aw-steps li::before { content: counter(aw-step); position: absolute; left: 14px; top: 13px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--aw-accent-bg); color: var(--aw-accent-tx); font-size: 12px; font-weight: 700; }
.aw-steps b { font-size: 13.5px; font-weight: 600; }
.aw-steps span { font-size: 12px; color: var(--aw-tx-3); }
.aw-steps.is-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }

/* ---- галерея: «Начать новый» ---- */
.aw-gallery-sec { margin-top: 28px; }
.aw-galhd { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 14px; }
.aw-starts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 18px; }
.aw-scard {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 16px; border: 1px dashed var(--aw-bd-input);
  border-radius: var(--aw-r); background: transparent; color: var(--aw-tx); text-align: left; cursor: pointer;
}
.aw-scard:hover { border-color: #ff6a2b88; background: #ff6a2b08; }
.aw-scard:disabled { opacity: .5; cursor: not-allowed; }
.aw-scard-ico { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--aw-accent-bg); color: var(--aw-accent-tx); }
.aw-scard-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.aw-scard-copy b { font-size: 14px; line-height: 18px; font-weight: 600; }
.aw-themes .aw-h3 { margin: 0 0 10px; font-size: 14px; }
.aw-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.aw-tcard { display: flex; flex-direction: column; min-width: 0; overflow: hidden; padding: 0; border: 1px solid var(--aw-bd); border-radius: var(--aw-r); background: var(--aw-card); color: var(--aw-tx); text-align: left; cursor: pointer; }
.aw-tcard:hover { border-color: #ff6a2b88; }
.aw-tcard:disabled { opacity: .5; cursor: not-allowed; }
.aw-tbody { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px 14px; }
.aw-tbody b { font-size: 13.5px; line-height: 18px; font-weight: 600; }
.aw-tchips { display: flex; flex-wrap: wrap; gap: 6px; }
.aw-tdesc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.aw-folder-link { margin: 14px 0 0; }

/* ---- окно (создание, выбор файла) ---- */
.aw-modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px 16px; }
.aw-scrim { position: absolute; inset: 0; background: #0b0c0ecc; }
.aw-modal-card {
  position: relative; display: flex; flex-direction: column; width: min(880px, 100%); max-height: calc(100vh - 48px); overflow: hidden;
  border: 1px solid var(--aw-bd); border-radius: 14px; background: #191b1f; box-shadow: 0 30px 80px #000000a6; outline: none;
}
.aw-modal-hd { display: flex; align-items: flex-start; gap: 12px; padding: 18px 16px 14px 24px; border-bottom: 1px solid var(--aw-bd-soft); }
.aw-modal-hd > div { flex: 1 1 auto; min-width: 0; }
.aw-modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 20px 24px; overscroll-behavior: contain; }
.aw-modal-body > .aw-field { margin: 0 0 18px; }
.aw-modal-ft { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding: 12px 24px; border-top: 1px solid var(--aw-bd-soft); background: #16181b; }
.aw-modal-ft .aw-small { display: inline-flex; align-items: center; gap: 6px; }
.aw-pick { min-height: 360px; }

/* ---- снэкбар ---- */
.aw-snack {
  position: fixed; z-index: 90; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px;
  max-width: min(720px, calc(100vw - 32px)); padding: 8px 8px 8px 16px; border: 1px solid var(--aw-bd-strong); border-radius: 10px; background: #23272d;
  color: var(--aw-tx); font-size: 13px; box-shadow: 0 16px 40px #0000008c;
}
.aw-snack > span { min-width: 0; overflow-wrap: anywhere; }

/* ============================================================
   Студия
   ============================================================ */
.aw-studio-hd { margin: 0 0 16px; }
.aw-back { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0; border: 0; background: none; color: var(--aw-tx-2); font: 500 12.5px var(--aw-font); cursor: pointer; }
.aw-back:hover { color: var(--aw-tx); }
.aw-titlebar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; min-height: 40px; margin-top: 6px; }
/* Имя по ширине текста, как заголовок на макете: статус OBS стоит сразу за ним. */
/* Отступ -8px — у обёртки, не у поля: иначе max-width: 100% срезает последние буквы. */
.aw-title-wrap { flex: 0 1 auto; min-width: 120px; max-width: min(460px, 100%); margin-left: -8px; }
.aw-title {
  box-sizing: border-box; width: auto; max-width: 100%; min-width: 120px; height: 38px; padding: 0 8px; margin: 0;
  border: 1px solid transparent; border-radius: var(--aw-r-ctl); field-sizing: content;
  background: transparent; color: var(--aw-tx); font: 650 22px/30px var(--aw-font); letter-spacing: 0; outline: none;
}
.aw-title:hover { border-color: var(--aw-bd); }
.aw-title:focus { border-color: #ff6a2b99; background: var(--aw-sunken); }
.aw-saved { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; flex: none; border: 1px solid var(--aw-bd); border-radius: 999px; font-size: 11.5px; color: var(--aw-tx-2); white-space: nowrap; }
.aw-saved .aw-ico { color: var(--aw-ok); }
.aw-saved.is-warn { border-color: #e3b25e44; background: #e3b25e14; color: var(--aw-warn-tx); }
.aw-saved.is-bad { border-color: #ef8f8644; background: #ef8f8612; color: var(--aw-bad-tx); }
.aw-saved.is-bad .aw-ico { color: var(--aw-bad); }

.aw-studio { display: grid; grid-template-columns: minmax(380px, 1.05fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.aw-studio-view[data-aw-tab-now="events"] .aw-studio,
.aw-studio-view[data-aw-tab-now="code"] .aw-studio { grid-template-columns: minmax(340px, .78fr) minmax(0, 1.22fr); }
.aw-lcol { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* превью */
.aw-pv { overflow: hidden; }
.aw-pv-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; min-height: 52px; padding: 8px 8px 8px 10px; border-bottom: 1px solid var(--aw-bd-soft); }
.aw-swc { width: 12px; height: 12px; flex: none; border: 1px solid #ffffff2e; border-radius: 3px; }
.aw-swc.is-check { background: conic-gradient(#b4bcc8 25%, #454b55 0 50%, #b4bcc8 0 75%, #454b55 0) 0 0 / 6px 6px; }
.aw-swc.is-dark { background: #0d0e10; }
.aw-swc.is-light { background: #f2f3f5; }
.aw-sz { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border: 1px solid var(--aw-bd); border-radius: 6px; background: #ffffff08; font: 500 12px var(--aw-mono); color: #d8dde5; white-space: nowrap; }
.aw-scale { white-space: nowrap; }
/* На «Событиях» и «Коде» превью уже — масштаб прячем, чтобы кнопки звука и перезапуска остались в строке. */
.aw-studio-view[data-aw-tab-now="events"] .aw-scale,
.aw-studio-view[data-aw-tab-now="code"] .aw-scale { display: none; }
/* В кабинете (слева меню) колонка превью уже, чем на стенде: по ширине самой карточки прячем масштаб,
   чтобы звук и перезапуск не уезжали на вторую строку (26.09.2026). */
.aw-pv { container: aw-pv / inline-size; }
@container aw-pv (max-width: 640px) { .aw-scale { display: none; } }
.aw-stage { position: relative; width: 100%; max-height: 62vh; overflow: hidden; background: conic-gradient(#25282e 25%, #1d2025 0 50%, #25282e 0 75%, #1d2025 0) 0 0 / 20px 20px; }
.aw-stage.is-dark { background: #0d0e10; }
.aw-stage.is-light { background: #eceef1; }
.aw-stage-frame { position: absolute; inset: 0; }
.aw-frame { position: absolute; top: 0; left: 0; border: 0; background: transparent; transform-origin: 0 0; color-scheme: light dark; }
.aw-stage-wait { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--aw-tx-3); font-size: 12.5px; pointer-events: none; }
.aw-pv-status { border-top: 1px solid var(--aw-bd-soft); }
.aw-pv-line { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 14px; font-size: 12.5px; color: var(--aw-tx-2); }
.aw-pulse { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--aw-tx-3); outline: 3px solid #ffffff12; }
.aw-pulse.is-ok { background: var(--aw-ok); outline-color: #7fc59f26; }
.aw-pulse.is-warn { background: var(--aw-warn); outline-color: #e3b25e26; }
.aw-pulse.is-bad { background: var(--aw-bad); outline-color: #ef8f8626; }
.aw-pv-st { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aw-pv-st b { font-weight: 600; color: var(--aw-tx); }
.aw-pv-ev { font-size: 12px; color: var(--aw-tx-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }
.aw-tbar { display: block; width: 110px; height: 4px; flex: none; overflow: hidden; border-radius: 4px; background: #2a2e35; }
.aw-tbar i { display: block; height: 100%; border-radius: 4px; background: var(--aw-ok); transition: width .3s linear; }
.aw-pv-err, .aw-pv-drop { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--aw-bd-soft); font-size: 12.5px; line-height: 18px; }
.aw-pv-err { background: #221a1c; color: var(--aw-bad-tx); }
.aw-pv-err > span { overflow-wrap: anywhere; font-family: var(--aw-mono); font-size: 12px; }
.aw-pv-err .aw-ico { color: var(--aw-bad); }
.aw-pv-drop { color: var(--aw-tx-2); }
.aw-pv-drop .aw-ico { color: var(--aw-tx-3); }

/* тестовые события */
.aw-test { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; border-top: 1px solid var(--aw-bd-soft); }
.aw-test-hd { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 2px; }
.aw-test-hd .aw-h3 { font-size: 14px; }
.aw-test-row { display: flex; align-items: flex-start; gap: 8px; }
.aw-test-cap { width: 64px; flex: none; padding-top: 6px; font-size: 12px; color: var(--aw-tx-3); }
.aw-test-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.aw-tchip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; flex: none;
  border: 1px solid var(--aw-bd-input); border-radius: 999px; background: #1f2328; color: #d8dde5;
  font: 500 12.5px var(--aw-font); white-space: nowrap; cursor: pointer;
}
.aw-tchip .aw-ico { color: var(--aw-tx-3); }
.aw-tchip:hover { border-color: #5a616c; color: var(--aw-tx); }
.aw-tchip:active { border-color: #ff6a2b88; background: #ff6a2b17; color: var(--aw-accent-tx); }
.aw-test-fields { display: grid; grid-template-columns: minmax(120px, 170px) minmax(90px, 120px) minmax(0, 1fr); gap: 12px; margin-top: 6px; }
.aw-test-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 6px; }

/* левая колонка: «Если сломался», шпаргалка */
.aw-aside { overflow: hidden; }
.aw-chd { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 0 16px; border-bottom: 1px solid var(--aw-bd-soft); }
.aw-chd .aw-h3 { font-size: 14px; }
.aw-chd a { font-size: 12.5px; }
.aw-obody { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; }
.aw-obody .aw-small { margin: 2px 0 0; }
.aw-opt { display: flex; align-items: flex-start; gap: 12px; padding: 8px 12px; border: 1px solid var(--aw-bd-soft); border-radius: 10px; cursor: pointer; }
.aw-opt:hover { border-color: var(--aw-bd-strong); }
.aw-opt.is-on { border-color: #ff6a2b66; background: #ff6a2b0d; }
.aw-opt:focus-within { outline: 2px solid #ff6a2b99; outline-offset: 2px; }
.aw-rdo { display: grid; place-items: center; width: 18px; height: 18px; flex: none; margin-top: 1px; border: 1.5px solid #5a616c; border-radius: 50%; }
.aw-opt.is-on .aw-rdo { border-color: var(--aw-accent); }
.aw-opt.is-on .aw-rdo::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--aw-accent); }
.aw-otitle { display: block; font-size: 13px; font-weight: 500; line-height: 18px; color: var(--aw-tx); }
.aw-ocap { display: block; font-size: 12px; line-height: 17px; color: var(--aw-tx-3); }
.aw-api { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); align-items: center; gap: 10px; min-height: 31px; padding: 4px 16px; }
.aw-api + .aw-api { border-top: 1px solid #24272d; }
.aw-api code { background: none; padding: 0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aw-api span { font-size: 12px; color: var(--aw-tx-2); }
.aw-evf { padding: 12px 16px; border-top: 1px solid var(--aw-bd-soft); }
.aw-evf .aw-lbl { margin-bottom: 8px; }
.aw-keys { display: flex; flex-wrap: wrap; gap: 5px; }
.aw-key { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border: 1px solid var(--aw-bd); border-radius: 5px; background: var(--aw-sunken); font: 500 11px var(--aw-mono); color: #d8dde5; }
.aw-tpl { padding: 12px 16px; border-top: 1px solid var(--aw-bd-soft); font-size: 12px; line-height: 18px; color: var(--aw-tx-2); }

/* консоль */
.aw-console { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.aw-ctabs { gap: 24px; margin: 0; padding: 0 20px; }
.aw-panel { display: flex; flex-direction: column; min-width: 0; }
.aw-cbody { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 18px 20px; }
.aw-cfoot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; min-height: 52px; padding: 8px 12px 8px 20px; border-top: 1px solid var(--aw-bd-soft); }
.aw-cf-note { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 7px; flex: 1 1 260px; min-width: 0; font-size: 12px; color: var(--aw-tx-3); }
.aw-empty-panel { display: flex; flex-direction: column; gap: 10px; padding: 18px; border: 1px dashed var(--aw-bd-input); border-radius: var(--aw-r); }
.aw-empty-panel .aw-small { margin: 0; }

.aw-sec { padding: 18px 0; border-top: 1px solid var(--aw-bd-soft); }
.aw-sec:first-child, .aw-cbody > .aw-banner + .aw-sec { border-top: 0; padding-top: 0; }
.aw-sec:last-child { padding-bottom: 0; }
.aw-sh { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 12px; }
.aw-sh .aw-small, .aw-sh > a, .aw-sh > .aw-live, .aw-sh > .aw-idle { margin-left: auto; }
.aw-sh > a { font-size: 12.5px; }
.aw-sec-lead { margin: -4px 0 12px; }

/* События */
.aw-don { display: flex; flex-direction: column; gap: 12px; margin-bottom: 10px; padding: 12px 14px; border: 1px solid var(--aw-bd); border-radius: 10px; background: #181b1f; }
.aw-don > .aw-small { margin: 0 0 0 44px; }
.aw-tline { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; }
.aw-tico { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 9px; background: #ffffff0a; color: var(--aw-tx-2); }
.aw-tname { display: block; font-size: 13.5px; font-weight: 600; line-height: 18px; color: var(--aw-tx); }
.aw-tcap { display: block; font-size: 12px; line-height: 16px; color: var(--aw-tx-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aw-tcap.is-warn { color: var(--aw-warn-tx); }
.aw-minamt { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--aw-tx-2); }
.aw-mini { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--aw-bd-input); border-radius: 8px; background: var(--aw-sunken); color: var(--aw-tx-3); }
.aw-mini .aw-bare { width: 72px; flex: none; font-size: 12.5px; }
.aw-srcs { display: flex; flex-wrap: wrap; gap: 8px; padding-left: 44px; }
.aw-src { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 11px 0 9px; border: 1px solid var(--aw-bd-input); border-radius: 8px; font-size: 12.5px; color: var(--aw-tx-2); cursor: pointer; }
.aw-src:focus-within { outline: 2px solid #ff6a2b99; outline-offset: 2px; }
.aw-box { display: grid; place-items: center; width: 16px; height: 16px; flex: none; border: 1.5px solid #5a616c; border-radius: 4px; color: var(--aw-on-accent); }
.aw-src.is-on { border-color: #ff6a2b66; background: #ff6a2b0f; color: var(--aw-tx); }
.aw-src.is-on .aw-box { border-color: var(--aw-accent); background: var(--aw-accent); }
.aw-types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.aw-ty { position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px 8px 10px; border: 1px solid var(--aw-bd-soft); border-radius: 10px; cursor: pointer; }
.aw-ty:hover { border-color: var(--aw-bd-strong); }
.aw-ty.is-off .aw-tname { color: var(--aw-tx-2); }
.aw-ty.is-off .aw-tico { color: var(--aw-tx-3); background: #ffffff06; }
.aw-yt { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 12px; }
/* «Какие события показывает этот виджет» (26.09.2026): заготовки, «Сейчас: …», мем-коины отдельным выключателем */
.aw-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.aw-evnow { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 12px; padding: 9px 12px; border: 1px solid var(--aw-bd-soft); border-radius: 10px; background: var(--aw-sunken); color: var(--aw-tx-2); font-size: 12.5px; line-height: 18px; }
.aw-evnow b { font-weight: 600; color: var(--aw-tx); overflow-wrap: anywhere; }
.aw-evnow .aw-ico { margin-top: 2px; flex: none; color: var(--aw-ok); }
.aw-evnow.is-warn { border-color: #e3b25e40; background: #e3b25e0f; color: var(--aw-warn-tx); }
.aw-evnow.is-warn .aw-ico { color: var(--aw-warn); }
.aw-types + .aw-don { margin: 10px 0 0; }
.aw-don.is-off > .aw-tline .aw-tname { color: var(--aw-tx-2); }
.aw-don.is-off > .aw-tline .aw-tico { color: var(--aw-tx-3); background: #ffffff06; }
.aw-don.is-off .aw-srcs, .aw-don.is-off .aw-minamt { opacity: .6; }
.aw-don > .aw-ty { min-height: 0; margin: 0; padding: 12px 0 0; border: 0; border-top: 1px solid var(--aw-bd-soft); border-radius: 0; }
.aw-cpreset { display: flex; flex-direction: column; gap: 8px; margin: 0 0 16px; }
.aw-cpreset > .aw-small { margin: 0; }
.aw-wevents { margin: 0; font-size: 12.5px; line-height: 18px; color: var(--aw-tx); overflow-wrap: anywhere; }
.aw-wevents-lbl { color: var(--aw-tx-3); }
.aw-wevents.is-warn { color: var(--aw-warn-tx); }
.aw-warnbar-how { display: block; margin-top: 2px; color: var(--aw-tx-2); }
.aw-g2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.aw-g3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; margin-bottom: 10px; }
.aw-vlist { display: flex; flex-direction: column; gap: 8px; }
.aw-vc { display: flex; align-items: center; gap: 8px; min-height: 60px; padding: 0 14px 0 4px; border: 1px solid var(--aw-bd); border-radius: 10px; background: var(--aw-card); }
.aw-vc.is-sel { border-color: #ff6a2b88; background: #ff6a2b0d; }
.aw-vc.is-off .aw-vname { color: var(--aw-tx-2); }
.aw-vc-open { display: flex; align-items: center; gap: 12px; flex: 1 1 auto; min-width: 0; min-height: 58px; padding: 0 8px; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; border-radius: 9px; }
.aw-vsw { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 8px; background: #ffffff0a; box-shadow: inset 0 0 0 1px #ffffff26; color: var(--aw-tx-3); font-size: 12px; font-weight: 600; }
.aw-vname { display: block; font-size: 13.5px; font-weight: 600; line-height: 18px; color: var(--aw-tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aw-vmeta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 4px; font-size: 12px; line-height: 18px; color: var(--aw-tx-3); }
.aw-vtag { display: inline-flex; align-items: center; min-height: 18px; padding: 0 7px; border-radius: 5px; background: #ffffff0d; color: var(--aw-tx-2); font-size: 11.5px; font-weight: 500; }
.aw-vtag.is-base { margin-left: 4px; vertical-align: 1px; }
.aw-vadd { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; width: 100%; min-height: 46px; margin-top: 8px; padding: 8px 14px; border: 1px dashed var(--aw-bd-input); border-radius: 10px; background: transparent; color: var(--aw-tx); font: 600 13px var(--aw-font); text-align: left; cursor: pointer; }
.aw-vadd:hover { border-color: #ff6a2b88; }
.aw-vadd .aw-ico { color: var(--aw-accent-tx); }
.aw-vadd .aw-muted { font-weight: 400; font-size: 12.5px; }

/* панель варианта */
.aw-drawer-wrap { position: fixed; inset: 0; z-index: 70; display: flex; justify-content: flex-end; }
.aw-drawer { position: relative; display: flex; flex-direction: column; width: min(560px, 100vw); height: 100%; border-left: 1px solid var(--aw-bd); background: #191b1f; box-shadow: -20px 0 60px #00000080; }
.aw-dhd { display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 10px 16px 10px 24px; border-bottom: 1px solid var(--aw-bd-soft); }
.aw-dcap { font-size: 12px; line-height: 16px; color: var(--aw-tx-3); }
.aw-dtitle { margin: 2px 0 0; font-size: 18px; font-weight: 650; line-height: 24px; overflow-wrap: anywhere; }
.aw-dbody { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 20px 24px 24px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #3a3f47 transparent; }
.aw-ds { padding: 18px 0; border-top: 1px solid var(--aw-bd-soft); }
.aw-ds:first-child { padding-top: 0; border-top: 0; }
.aw-dsh { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 0 0 14px; font-size: 14px; font-weight: 600; line-height: 20px; }
.aw-dsh .aw-small { margin-left: auto; font-weight: 400; }
.aw-g-show { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 16px; }
.aw-lrow { display: flex; align-items: baseline; justify-content: space-between; min-height: 18px; }
.aw-val { font-size: 13px; font-weight: 600; line-height: 18px; color: var(--aw-tx); white-space: nowrap; }
.aw-rscale { display: flex; justify-content: space-between; font-size: 11.5px; line-height: 16px; color: var(--aw-tx-3); }
.aw-asset { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; padding: 10px 12px; border: 1px solid var(--aw-bd); border-radius: 10px; background: var(--aw-sunken); }
.aw-aico { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 9px; background: #ffffff0a; color: var(--aw-tx-2); }
.aw-aname { display: block; font: 600 13px/18px var(--aw-mono); color: var(--aw-tx); overflow-wrap: anywhere; }
.aw-acap { display: block; font-size: 12px; line-height: 17px; color: var(--aw-tx-3); }
.aw-vol { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.aw-vol .aw-lbl { width: 76px; flex: none; }
.aw-vol .aw-val { width: 44px; text-align: right; }
.aw-ovr { overflow: hidden; border: 1px solid var(--aw-bd); border-radius: 10px; }
.aw-orow { display: grid; grid-template-columns: minmax(0, 166px) minmax(0, 1fr) 36px; align-items: center; gap: 12px; padding: 9px 8px 9px 14px; }
.aw-orow + .aw-orow { border-top: 1px solid var(--aw-bd-soft); }
.aw-oname { display: block; font-size: 13px; font-weight: 600; line-height: 18px; overflow-wrap: anywhere; }
.aw-ofrom { display: block; font-size: 12px; line-height: 17px; color: var(--aw-tx-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aw-colr { gap: 10px; padding: 0 12px 0 6px; }
.aw-colr input[type="color"] { width: 26px; height: 26px; flex: none; padding: 0; border: 1px solid #ffffff2e; border-radius: 6px; background: none; cursor: pointer; }
.aw-ovr-add { margin-top: 12px; max-width: 320px; }
/* flex: none — подвал не сжимается до 68px, когда кнопки переносятся во второй ряд: прокручивается .aw-dbody. */
.aw-dfoot { display: flex; flex: none; align-items: center; flex-wrap: wrap; gap: 8px; min-height: 68px; padding: 10px 24px; padding-bottom: max(10px, env(safe-area-inset-bottom)); border-top: 1px solid var(--aw-bd-soft); background: #16181b; }

/* Код */
.aw-tb { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--aw-bd-soft); }
.aw-mdot-sm { display: none; width: 6px; height: 6px; border-radius: 50%; background: var(--aw-warn); }
.aw-mdot-sm.is-on { display: inline-block; }
.aw-panel-code > [data-aw-js-banner] .aw-banner { margin: 12px 14px 0; }
.aw-code-hint { margin: 0; padding: 8px 14px; font-size: 12px; color: var(--aw-tx-3); border-bottom: 1px solid var(--aw-bd-soft); }
.aw-ed { position: relative; height: clamp(360px, 58vh, 720px); min-width: 0; background: var(--aw-well); }
.aw-code-box { position: absolute; inset: 0; min-width: 0; }
.aw-code-fallback {
  display: block; width: 100%; height: 100%; margin: 0; padding: 12px 16px; resize: none; border: 0; outline: 0;
  background: var(--aw-well); color: #d8dde5; font: 400 12.5px/22px var(--aw-mono); tab-size: 2; white-space: pre; overflow: auto;
}
.aw-code-fallback.has-error { box-shadow: inset 2px 0 0 var(--aw-bad); }
.aw-errbar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid #ef8f8659; background: #221a1c; color: var(--aw-bad-tx); }
.aw-errbar > .aw-ico { color: var(--aw-bad); }
.aw-errbar.is-json { font-size: 12.5px; }
.aw-sec .aw-errbar { border: 1px solid #ef8f8659; border-radius: 10px; }
.aw-emsg { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; line-height: 18px; }
.aw-emsg .aw-mono { font-size: 12.5px; font-weight: 600; color: var(--aw-bad-tx); overflow-wrap: anywhere; }
.aw-eline { font-size: 12.5px; color: var(--aw-bad); white-space: nowrap; }
.aw-ehint { margin-top: 2px; font-size: 12px; line-height: 17px; color: var(--aw-tx-2); }
.aw-cnote { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; min-height: 40px; padding: 6px 14px; border-top: 1px solid var(--aw-bd-soft); background: #181b1f; font-size: 12px; color: var(--aw-tx-3); }

/* Файлы */
.aw-ftable { display: flex; flex-direction: column; overflow: hidden; margin-bottom: 4px; border: 1px solid var(--aw-bd); border-radius: 10px; }
.aw-frow { display: grid; grid-template-columns: 44px minmax(0, 1.2fr) minmax(110px, 1fr) minmax(110px, 1fr) 30px 30px; align-items: center; gap: 10px; padding: 8px 10px; }
.aw-frow + .aw-frow { border-top: 1px solid var(--aw-bd-soft); }
.aw-frow .aw-field-err { grid-column: 3 / -1; margin: 0; }
.aw-fthumb { display: grid; place-items: center; width: 44px; height: 36px; overflow: hidden; border-radius: 7px; background: #ffffff0a; color: var(--aw-tx-3); }
.aw-fthumb img { width: 100%; height: 100%; object-fit: cover; }
.aw-fmeta { display: flex; flex-direction: column; min-width: 0; }
.aw-fmeta b { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aw-frow .aw-inp { height: 34px; }
.aw-files-empty { margin: 0 0 4px; }
.aw-lib { min-width: 0; }

/* OBS */
.aw-url { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; padding: 6px 6px 6px 12px; border: 1px solid var(--aw-bd-input); border-radius: var(--aw-r-ctl); background: var(--aw-sunken); }
.aw-url-ico { color: var(--aw-tx-3); display: inline-flex; }
.aw-url-code { flex: 1 1 240px; min-width: 0; padding: 0 !important; background: none !important; color: var(--aw-tx-2) !important; font-size: 12.5px !important; overflow-wrap: anywhere; }
.aw-url-code.is-masked { letter-spacing: .02em; }
.aw-sec > .aw-small { margin: 0 0 10px; }
.aw-mod-note { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px solid var(--aw-bd); border-radius: 10px; background: var(--aw-sunken); }
.aw-mod-note > .aw-ico { margin-top: 2px; color: var(--aw-tx-3); }
.aw-mod-note b { font-weight: 600; }
.aw-mod-note .aw-small { margin: 4px 0 0; }
.aw-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 18px; border: 1px solid var(--aw-bd); border-radius: var(--aw-r); }
.aw-fact { display: flex; align-items: flex-start; gap: 12px; padding: 16px; min-width: 0; }
.aw-fact + .aw-fact { border-left: 1px solid var(--aw-bd-soft); }
.aw-fact > .aw-ico { margin-top: 2px; color: var(--aw-tx-2); }
.aw-fact b { font-size: 13.5px; font-weight: 600; }
.aw-fact .aw-small { margin: 4px 0 0; }

/* ============================================================
   Ширины
   ============================================================ */
/* Колонка превью липнет под верхней панелью кабинета (--header-h) и не выше окна: если она длиннее,
   её низ (поля теста, «Отправить в OBS») прокручивается внутри колонки, а превью остаётся на виду. */
@media (min-width: 1100px) and (min-height: 820px) {
  .aw-lcol {
    position: sticky; top: calc(var(--header-h, 56px) + 16px);
    max-height: calc(100vh - var(--header-h, 56px) - 32px); overflow-y: auto; overscroll-behavior: contain;
    scrollbar-width: thin; scrollbar-color: #3a3f47 transparent;
  }
  /* Карточки колонки не сжимаются под max-height (у превью overflow: hidden) — колонка прокручивается. */
  .aw-lcol > * { flex-shrink: 0; }
}
@media (max-width: 1280px) {
  .aw-facts { grid-template-columns: minmax(0, 1fr); }
  .aw-fact + .aw-fact { border-left: 0; border-top: 1px solid var(--aw-bd-soft); }
}
/* планшет: 768–1100 — одна колонка, превью сверху */
@media (max-width: 1100px) {
  .aw-studio, .aw-studio-view[data-aw-tab-now] .aw-studio { grid-template-columns: minmax(0, 1fr); }
  .aw-stage { max-height: 56vh; }
  .aw-types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .aw-title-wrap { flex: 1 1 100%; }
}
@media (max-width: 900px) {
  .aw-steps { grid-template-columns: minmax(0, 1fr); }
  .aw-frow { grid-template-columns: 44px minmax(0, 1fr) 30px 30px; }
  .aw-frow .aw-field { grid-column: 2 / -1; }
  .aw-frow .aw-field-err { grid-column: 2 / -1; }
}
/* телефон: до 768 */
@media (max-width: 767px) {
  .aw-pagehd-actions { width: 100%; }
  .aw-pagehd-actions .aw-btn { flex: 1 1 auto; }
  .aw-grid { grid-template-columns: minmax(0, 1fr); }
  .aw-starts { grid-template-columns: minmax(0, 1fr); }
  .aw-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .aw-empty { padding: 18px; }
  .aw-steps.is-compact { grid-template-columns: minmax(0, 1fr); }
  .aw-titlebar > .aw-btn:not(.is-pri) { display: none; }
  .aw-ctabs { padding: 0 12px; gap: 18px; }
  .aw-cbody { padding: 16px 14px; }
  .aw-cfoot { padding: 8px 12px; }
  .aw-types, .aw-g2, .aw-g3, .aw-g-show { grid-template-columns: minmax(0, 1fr); }
  .aw-srcs, .aw-don > .aw-small { padding-left: 0; margin-left: 0; }
  .aw-test { padding: 12px; }
  .aw-test-row { flex-direction: column; gap: 6px; }
  .aw-test-cap { width: auto; padding-top: 0; }
  .aw-test-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 110px); }
  .aw-test-fields .aw-field-grow { grid-column: 1 / -1; }
  .aw-test-actions .aw-grow { display: none; }
  .aw-pv-ev, .aw-tbar, .aw-scale { display: none; }
  .aw-ed { height: 60vh; }
  .aw-orow { grid-template-columns: minmax(0, 1fr) 36px; }
  .aw-orow > :nth-child(2) { grid-column: 1 / 2; }
  .aw-drawer { width: 100vw; border-left: 0; }
  .aw-dhd, .aw-dbody, .aw-dfoot { padding-left: 16px; padding-right: 12px; }
  /* Телефон: «Готово» — первым рядом на всю ширину, остальные — под ним; ничего не уезжает за экран. */
  .aw-dfoot .aw-grow { display: none; }
  .aw-dfoot [data-aw-act="variant-close"].is-pri { flex: 1 1 100%; order: -1; justify-content: center; }
  .aw-dfoot .aw-btn:not(.is-pri) { flex: 1 1 auto; justify-content: center; }
  .aw-modal { padding: 0; }
  .aw-modal-card { width: 100%; max-height: 100vh; height: 100%; border-radius: 0; }
  .aw-modal-hd, .aw-modal-body, .aw-modal-ft { padding-left: 16px; padding-right: 16px; }
  .aw-snack { left: 16px; right: 16px; transform: none; }
  .aw-api { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
@media (max-width: 420px) {
  .aw-gallery { grid-template-columns: minmax(0, 1fr); }
  /* Темы на телефоне — строкой: превью 16:10 плиткой слева, название и описание справа. */
  .aw-tcard { flex-direction: row; align-items: center; }
  .aw-tcard .aw-tthumb { width: 44%; margin: 8px 0 8px 8px; border: 1px solid var(--aw-bd-soft); border-radius: 8px; }
  .aw-tcard .aw-tbody { flex: 1 1 auto; min-width: 0; padding: 10px 12px; }
  .aw-tcard .aw-tdesc { -webkit-line-clamp: 2; }
  /* На плитке подсказка короче — значком («живое» точкой — для плиток тем на любой ширине, выше). */
  .aw-tcard .aw-pv-hint { right: 6px; bottom: 6px; height: 22px; width: 22px; padding: 0; justify-content: center; font-size: 0; gap: 0; }
  .aw-seg .aw-segi { padding: 0 8px; }
  .aw-wfoot { flex-wrap: wrap; }
}
