/*
 * Презентации нейросетью (26.11): слайды (те же доли и кегли, что в PowerPoint — Service\Pptx)
 * и рабочий блок страницы /create/prezentatsiya. Цвета слайда — переменные темы (--bg, --fg…),
 * которые slides.js ставит каждому слайду; интерфейс — переменные сайта («Закат»).
 */

/* ── Слайд ──────────────────────────────────────────────────────────── */
.sl { position: relative; width: 100%; aspect-ratio: 16 / 9; max-width: 100%; container-type: inline-size; overflow: hidden;
  background: var(--bg); color: var(--fg); font-family: Arial, Helvetica, sans-serif; line-height: 1.22; }
.sl[data-ratio="4:3"] { aspect-ratio: 4 / 3; }
.sl.is-hero { background: linear-gradient(135deg, var(--acc), var(--acc2)); }
.sl-box { position: absolute; margin: 0; padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.sl-box.a-b { justify-content: flex-end; }
.sl-box.a-ctr { justify-content: center; }
.sl-box p { margin: 0; }
.sl-box p + p { margin-top: .2em; }
ul.sl-box { list-style: none; }
ul.sl-box li { position: relative; padding-left: 1em; margin-top: .45em; }
ul.sl-box li:first-child { margin-top: 0; }
ul.sl-box li::before { content: '•'; position: absolute; left: 0; color: var(--acc); }
.sl-rect { position: absolute; display: block; }
.sl-rect.is-soft { background: var(--soft); }
.sl-pic { overflow: hidden; }
.sl-pic img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sl-pic-note { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted);
  font-size: calc(var(--pt) * 14); }
.sl-table table { width: 100%; border-collapse: collapse; }
.sl-table th, .sl-table td { padding: .35em .5em; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--soft); }
.sl-table th { background: var(--acc); color: #fff; font-weight: 700; }
.sl-table tr:nth-child(odd) td { background: var(--soft); }
.sl-chart svg { width: 100%; height: 100%; display: block; }
.sl-chart text { font-family: Arial, Helvetica, sans-serif; }
[contenteditable="true"] { outline: none; border-radius: 2px; cursor: text; }
[contenteditable="true"]:hover { box-shadow: 0 0 0 1px color-mix(in srgb, var(--acc) 45%, transparent); }
[contenteditable="true"]:focus { box-shadow: 0 0 0 2px var(--acc); }

/* Оформление тем — те же фигуры, что в PowerPoint (Pptx::decor). */
.sl-deco { position: absolute; display: block; }
.th-light .sl-deco { left: 0; top: 0; bottom: 0; width: 1.6%; background: linear-gradient(180deg, var(--acc), var(--acc2)); }
.th-biz .sl-deco { left: 0; right: 0; top: 0; height: 3.5%; background: var(--fg); }
.th-dark .sl-deco { left: 7%; width: 10%; top: 25.5%; height: 1%; background: var(--acc); }
.th-dark .sl-deco.is-cover { top: 68%; }
.th-nature .sl-deco { right: 0; top: 0; bottom: 0; width: 2.5%; background: var(--acc); }
.th-warm .sl-deco { left: 7%; top: 6%; width: 3%; aspect-ratio: 1; border-radius: 50%; background: var(--acc); }
.th-bright .sl-deco { left: 0; right: 0; top: 0; height: 2%; background: linear-gradient(90deg, var(--acc), var(--acc2)); }
.sl.is-hero .sl-deco { display: none; }

/* ── Рабочий блок ───────────────────────────────────────────────────── */
.slx { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; text-align: left; }
.slx-steps { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; flex-wrap: wrap; }
.slx-steps button { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 13.5px; color: var(--muted);
  background: var(--panel); border: 1px solid var(--line2); border-radius: 99px; padding: 6px 14px 6px 8px; cursor: pointer; }
.slx-steps b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--sunken);
  color: var(--fg); font-size: 12px; }
.slx-steps button[aria-current="step"] { color: var(--fg); border-color: var(--fg); }
.slx-steps button[aria-current="step"] b { background: var(--accent); color: var(--onAccent); }
.slx:not(.has-deck) .slx-steps li:not(:first-child) button { opacity: .5; cursor: default; }
.slx-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex;
  flex-direction: column; gap: 14px; min-width: 0; }
.slx-ta textarea { width: 100%; box-sizing: border-box; min-height: 110px; resize: vertical; font: inherit; font-size: 15px; line-height: 1.5;
  color: var(--fg); background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; padding: 12px 14px; }
.slx-ta textarea:focus, .slx input[type="text"]:focus, .slx select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.slx-files { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.slx-attach { font: inherit; font-size: 13.5px; color: var(--fg); background: none; border: 1px dashed var(--line2); border-radius: 10px;
  padding: 6px 12px; cursor: pointer; }
.slx-attach small { color: var(--muted); }
.sl-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; background: var(--sunken); border-radius: 99px; padding: 4px 6px 4px 12px; }
.sl-chip.is-loading { padding-right: 12px; color: var(--muted); }
.sl-chip-x { border: 0; background: none; font: inherit; font-size: 16px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.slx-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.slx-seg { display: inline-flex; background: var(--sunken); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.slx-seg button { font: inherit; font-size: 13.5px; color: var(--dim); background: none; border: 0; border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.slx-seg button[aria-pressed="true"] { background: var(--panel); color: var(--fg); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.slx-seg.is-mini button { padding: 4px 9px; font-size: 12.5px; }
.slx-sel { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.slx select, .slx input[type="text"] { font: inherit; font-size: 13.5px; color: var(--fg); background: var(--panel); border: 1px solid var(--line2);
  border-radius: 9px; padding: 6px 10px; min-width: 0; }
.slx-more summary { cursor: pointer; color: var(--accentText); font-size: 13.5px; }
.slx-adv { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 12px; }
.slx-f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.slx-l { font-size: 12.5px; color: var(--muted); }
.slx-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; }
.slx-go { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.slx-hint { font-size: 12.5px; color: var(--muted); margin: 0; }
.slx-link { font: inherit; font-size: 13.5px; color: var(--accentText); background: none; border: 0; padding: 4px 0; cursor: pointer; text-align: left; }
.slx-btn { font: inherit; font-size: 13px; color: var(--fg); background: var(--panel); border: 1px solid var(--line2); border-radius: 9px;
  padding: 6px 11px; cursor: pointer; }
.slx-btn:hover { border-color: var(--accent); }
.slx-btn:disabled, .slx .btn:disabled { opacity: .5; cursor: default; }
.slx button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.slx-head { display: flex; flex-direction: column; gap: 2px; }
.slx-plan { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sl-pl { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; border: 1px solid var(--line);
  border-radius: 10px; padding: 6px 8px; }
.sl-pl-n { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted); text-align: right; }
.sl-pl-t { width: 100%; box-sizing: border-box; border-color: transparent !important; }
.sl-pl-t:hover { border-color: var(--line2) !important; }
.sl-pl-l { font-size: 12.5px !important; }
.sl-pl-a { display: inline-flex; gap: 2px; }
.sl-pl-a button { font: inherit; font-size: 13px; width: 28px; height: 28px; border-radius: 7px; border: 1px solid transparent; background: none;
  color: var(--muted); cursor: pointer; }
.sl-pl-a button:hover:not(:disabled) { border-color: var(--line2); color: var(--fg); }
.sl-pl-a button:disabled { opacity: .3; cursor: default; }
@media (max-width: 640px) {
  .sl-pl { grid-template-columns: 22px minmax(0, 1fr); }
  .sl-pl-l, .sl-pl-a { grid-column: 2; }
}
.slx-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.slx-themes.is-mini { display: flex; flex-wrap: wrap; gap: 6px; }
.sl-th { font: inherit; font-size: 12.5px; color: var(--dim); background: var(--panel); border: 1px solid var(--line2); border-radius: 10px;
  overflow: hidden; padding: 0; cursor: pointer; text-align: left; }
.sl-th i { display: block; aspect-ratio: 16 / 9; max-width: 100%; background: var(--bg); position: relative; }
.sl-th i::before { content: ''; position: absolute; left: 14%; top: 34%; width: 56%; height: 9%; background: var(--fg); border-radius: 2px; }
.sl-th i::after { content: ''; position: absolute; left: 14%; top: 56%; width: 40%; height: 6%; background: var(--acc); border-radius: 2px; }
.sl-th.th-light i { box-shadow: inset 5px 0 0 var(--acc); }
.sl-th.th-biz i { box-shadow: inset 0 5px 0 var(--fg); }
.sl-th.th-nature i { box-shadow: inset -6px 0 0 var(--acc); }
.sl-th.th-bright i { background: linear-gradient(135deg, var(--acc), var(--acc2)); }
.sl-th.th-bright i::before, .sl-th.th-bright i::after { background: #fff; }
.sl-th span { display: block; padding: 4px 8px; }
.sl-th[aria-pressed="true"] { border: 2px solid var(--accent); }
.slx-themes.is-mini .sl-th { width: 64px; }
.slx-themes.is-mini .sl-th span { display: none; }
.slx-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.slx-saved { font-size: 12.5px; color: var(--muted); margin-left: auto; }
.slx-work { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; }
.slx-thumbs { display: flex; flex-direction: column; gap: 8px; max-height: 640px; overflow-y: auto; padding: 2px; }
.sl-thumb { padding: 0; border: 1px solid var(--line2); border-radius: 6px; overflow: hidden; background: none; cursor: pointer; flex: none; }
.sl-thumb[aria-current="true"] { outline: 2px solid var(--accent); outline-offset: 1px; }
.sl-thumb .sl { pointer-events: none; }
/* Картинка рисуется (30.11): область на месте картинки — справа, где она встанет, и значок на миниатюре. */
.sl-thumb { position: relative; }
.sl-thumb-wait { position: absolute; right: 5px; top: 5px; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center;
  font-size: 10px; color: var(--accentText); background: var(--panel); border: 2px solid var(--accentLine); border-top-color: var(--accent);
  animation: slSpin 1s linear infinite; }
.slx-big { position: relative; }
.sl-wait { position: absolute; top: 30%; bottom: 12%; right: 6%; width: 46%; border-radius: 12px; overflow: hidden; pointer-events: none;
  background: linear-gradient(100deg, var(--sunken) 30%, var(--accentSoft) 50%, var(--sunken) 70%); background-size: 250% 100%;
  animation: slShimmer 1.6s ease-in-out infinite; border: 1px dashed var(--accentLine); display: grid; place-items: center; }
.sl-wait-in { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px; text-align: center; }
.sl-wait-in b { font-size: 16px; color: var(--fg); }
.sl-wait-sec { font-family: 'JetBrains Mono', monospace; font-size: 12.5px; color: var(--accentText); }
.sl-wait-note { font-size: 12px; color: var(--muted); max-width: 240px; line-height: 1.4; }
.sl-wait-spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--accentLine); border-top-color: var(--accent);
  animation: slSpin 1s linear infinite; }
@keyframes slSpin { to { transform: rotate(360deg); } }
@keyframes slShimmer { 0% { background-position: 100% 0; } 100% { background-position: -150% 0; } }
@media (prefers-reduced-motion: reduce) { .sl-wait, .sl-wait-spin, .sl-thumb-wait { animation: none; } }
.slx-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.slx-big .sl { border: 1px solid var(--line2); border-radius: 10px; }
.slx-nav { display: flex; gap: 10px; align-items: center; justify-content: center; font-size: 13px; color: var(--muted); }
.slx-tools { display: flex; flex-direction: column; gap: 10px; }
.slx-redo { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.slx-own { display: inline-flex; gap: 6px; flex: 1 1 260px; min-width: 0; }
.slx-own input { flex: 1; }
.slx-add { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; background: var(--sunken); border-radius: 10px; padding: 10px; }
.slx-add input { flex: 1 1 260px; }
.slx-add .slx-hint { flex-basis: 100%; }
.slx-gen .slx-f { flex-basis: 100%; }
.slx-gen textarea { font: inherit; font-size: 14px; color: var(--fg); background: var(--panel); border: 1px solid var(--line2); border-radius: 10px;
  padding: 8px 10px; resize: vertical; }
.slx-picall { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; background: var(--accentSoft); border: 1px solid var(--accentLine);
  border-radius: 12px; padding: 10px 12px; font-size: 13.5px; }
.slx-picall > span { flex: 1 1 240px; min-width: 0; }
.slx-genst { margin: 0; font-size: 13px; color: var(--dim); }
.slx-notes { display: flex; flex-direction: column; gap: 6px; }
.slx-notes textarea { font: inherit; font-size: 14px; color: var(--fg); background: var(--sunken); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 12px; resize: vertical; }
.slx-dl { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; border-top: 1px solid var(--line); padding-top: 14px; }
.slx-dl .slx-hint { flex-basis: 100%; }
@media (max-width: 760px) {
  .slx-work { grid-template-columns: 1fr; }
  .slx-thumbs { flex-direction: row; overflow-x: auto; max-height: none; }
  .sl-thumb { width: 120px; }
  .slx-panel { padding: 14px; }
}
.slx.is-busy .slx-panel { opacity: .6; pointer-events: none; }
.slx-notice { margin: 0; padding: 10px 14px; border-radius: 10px; background: var(--sunken); color: var(--fg); font-size: 14px; }
.slx-notice.is-error { background: var(--dangerSoft); color: var(--danger); }
.slx-mine { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.slx-mine ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.slx-mine li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sl-mine-o { font: inherit; font-size: 14px; color: var(--fg); background: none; border: 0; padding: 4px 0; cursor: pointer; text-align: left; flex: 1 1 200px; min-width: 0; }
.sl-mine-o:hover { color: var(--accentText); }
.sl-mine-n { font-size: 12.5px; color: var(--muted); }
.sl-mine-x { font: inherit; font-size: 12.5px; color: var(--muted); background: none; border: 0; cursor: pointer; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Показ во весь экран. */
.sl-show { position: fixed; inset: 0; z-index: 1000; background: #000; display: flex; align-items: center; justify-content: center; }
.sl-show-f { width: min(100vw, calc(100vh * 16 / 9)); max-width: 100%; }
.sl-show-h { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); color: rgba(255, 255, 255, .55); font: 12px Arial, sans-serif; }

/* Скрытое скрыто, даже если у блока свой display (шаги, «Мои презентации», окно входа). */
.slx [hidden], .slx-panel[hidden] { display: none !important; }
/* Поля титульного слайда — во всю ширину, строкой. */
.slx-adv .slx-f[data-sl-fields] { grid-column: 1 / -1; }

/* ── Правка презентаций, 30.11: панель рядом со слайдом, макеты миниатюрами, кнопки на картинке, отмена ── */
.slx-work { grid-template-columns: 130px minmax(0, 1fr) 290px; }
.slx-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; max-height: 820px; overflow-y: auto; padding-right: 2px; }
.slx-sec { display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.slx-sec:last-child { border-bottom: 0; }
.slx-sec .slx-own { flex: none; }
.slx-sec .slx-btn { padding: 6px 10px; }
.slx-side .slx-add { flex-direction: column; align-items: stretch; }
.slx-side .slx-add input, .slx-side .slx-add textarea { width: 100%; box-sizing: border-box; }
.slx-gen textarea { font: inherit; font-size: 14px; color: var(--fg); background: var(--panel); border: 1px solid var(--line2); border-radius: 9px; padding: 8px 10px; resize: vertical; }
.slx-gen .slx-link { align-self: flex-start; }
/* Макеты: миниатюры того же слайда. */
.slx-lays { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sl-lay { display: flex; flex-direction: column; gap: 4px; padding: 4px; border: 1px solid var(--line2); border-radius: 8px; background: var(--panel); cursor: pointer; font: inherit; text-align: left; }
.sl-lay:hover { border-color: var(--accent); }
.sl-lay[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.sl-lay-m { display: block; border-radius: 5px; overflow: hidden; pointer-events: none; }
.sl-lay-n { font-size: 11.5px; color: var(--dim); padding: 0 2px; }
/* Лента: перетаскивание и «+» между слайдами. */
.slx-thumbs { gap: 2px; }
.sl-thumb.is-drag { opacity: .45; }
.sl-thumb.is-over { outline: 2px dashed var(--accent); outline-offset: 2px; }
.sl-thumb-add { height: 14px; border: 0; background: none; color: transparent; font-size: 13px; line-height: 1; cursor: pointer; border-radius: 6px; flex: none; }
.sl-thumb-add:hover, .sl-thumb-add:focus-visible { color: var(--accentText); background: var(--accentSoft); }
/* Картинка: кнопки на ней самой (на телефоне — видны всегда). */
.sl-picbar { position: absolute; display: flex; flex-direction: column; justify-content: space-between; padding: 6px; box-sizing: border-box;
  pointer-events: none; opacity: 0; transition: opacity .15s; }
.slx-big:hover .sl-picbar, .sl-picbar:focus-within { opacity: 1; }
@media (hover: none) { .sl-picbar { opacity: 1; } }
.sl-pb-tools, .sl-pb-vars, .sl-pb-pos { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; pointer-events: auto; }
.sl-pb-vars { align-self: center; align-items: center; gap: 6px; background: rgba(20, 10, 14, .7); color: #fff; border-radius: 999px; padding: 3px 6px; font-size: 12px; }
.sl-pb-pos { align-self: flex-start; }
.sl-pb { font: inherit; font-size: 12px; line-height: 1.2; padding: 5px 9px; border-radius: 999px; border: 0; cursor: pointer;
  background: rgba(20, 10, 14, .72); color: #fff; }
.sl-pb:hover, .sl-pb.is-on { background: var(--accent); color: var(--onAccent); }
.sl-picadd { position: absolute; top: 8px; right: 8px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; opacity: 0; transition: opacity .15s; }
.slx-big:hover .sl-picadd, .sl-picadd:focus-within { opacity: 1; }
@media (hover: none) { .sl-picadd { opacity: 1; } }
.sl-picadd-m { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; overflow: hidden; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }
.sl-picadd-m[hidden] { display: none; }
.sl-picadd-m button { font: inherit; font-size: 13px; text-align: left; padding: 8px 12px; border: 0; background: none; color: var(--fg); cursor: pointer; }
.sl-picadd-m button:hover { background: var(--sunken); }
/* Меню у выделенного текста. */
.sl-selmenu { position: fixed; z-index: 60; display: flex; gap: 2px; padding: 4px; background: var(--fg); border-radius: 10px; box-shadow: 0 10px 28px rgba(0, 0, 0, .25); }
.sl-selmenu[hidden] { display: none; }
.sl-selmenu button { font: inherit; font-size: 12.5px; padding: 5px 9px; border: 0; border-radius: 7px; background: none; color: var(--bg); cursor: pointer; }
.sl-selmenu button:hover { background: var(--accent); color: var(--onAccent); }
/* Отмена и «Сохранено». */
.slx-undo { display: inline-flex; gap: 6px; margin-left: auto; }
.slx-undo .slx-btn { padding: 5px 10px; font-size: 12.5px; }
.slx-saved { margin-left: 0; font-weight: 500; }
.slx-saved.is-saving { color: var(--muted); }
.slx-saved.is-saved { color: var(--ok); }
.slx-saved.is-error { color: var(--danger); }
/* Предпросмотр команды на всю презентацию. */
.slx-preview { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--accentSoft); border: 1px solid var(--accentLine); font-size: 14px; }
.slx-preview[hidden] { display: none; }
.slx-preview > span { flex: 1 1 260px; }
.slx.is-preview .slx-side { opacity: .5; pointer-events: none; }
.slx-genst .slx-link { font-size: inherit; }
@media (max-width: 1100px) {
  .slx-work { grid-template-columns: 130px minmax(0, 1fr); }
  .slx-side { grid-column: 1 / -1; max-height: none; overflow: visible; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .slx-sec { border-bottom: 0; }
  .slx-lays { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .slx-work { grid-template-columns: 1fr; }
  .slx-side { display: flex; }
  .slx-undo { margin-left: 0; }
  .sl-thumb-add { height: auto; width: 14px; }
}
.slx-side { overflow-x: hidden; }
.slx-side .slx-gen .slx-f, .slx-side .slx-add .slx-hint { flex-basis: auto; }
.slx-side .slx-sel { display: flex; justify-content: space-between; }
.slx-side .slx-sel select { flex: 1; min-width: 0; max-width: 190px; }
.slx-side .slx-own input { min-width: 0; }
