/* Форма десяти видов ops и отдельные настройки вида (ответ дизайнера 13.11.2026, docs/design/ops-handoff/current).
 * Цвета — только static/skins.css (копия tokens/skins.css дизайнера, design_assets.py). Здесь: как его роли ложатся на
 * роли стилей ops, настройки (стекло, шрифт, e-ink, иконки, движение) и форма каждого вида из windows/ops-skins.css.
 * Набор Pink Sparkle (вид pink и sky, html[data-kit="sparkle"]) — skin-sparkle.css; небо Pink Sparkle (phase, weather)
 * сюда не входит: его подключит отдельный модуль через window.happyinSkin.subscribe (static/skin.js). */

/* ─── мост: роли дизайнера → роли ops (app.css, chat.css, app-*.css) ───
   app.css задаёт свои цвета только странице без вида (:root:not([data-skin])), поэтому здесь не спорит никто. */
html[data-skin] {
  --hair: var(--line);
  --dim: var(--text2);
  --accent: var(--acc);
  --danger: var(--hot);
  --good: var(--ok);
  --tint: var(--panel2);
  --ink: var(--text);
  --font: var(--body);
  --font-display: var(--head);
  --font-ui: var(--body);
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
}
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }
html[data-skin] :is(h1, h2) { font-family: var(--head); letter-spacing: var(--headls, normal); }
html[data-skin] :is(code, kbd, pre, samp) { font-family: var(--mono); }
html[data-skin] .num, html[data-skin] .sum { font-family: var(--num); }

/* ─── Подложки (настройка glass; дизайнер: solid 100, light 88, glass 72; по умолчанию sky 78, остальные 100) ─── */
html[data-glass="solid"] { --glass: 100%; --glassblur: 0px; }
html[data-glass="light"] { --glass: 88%; --glassblur: 4px; }
html[data-glass="glass"] { --glass: 72%; --glassblur: 8px; }
html[data-skin] .card {
  background: color-mix(in srgb, var(--panel) var(--glass, 100%), transparent);
  -webkit-backdrop-filter: blur(var(--glassblur, 0px)); backdrop-filter: blur(var(--glassblur, 0px));
}
html[data-skin] .app-tabs { background: var(--navbg); }

/* ─── Шрифт (настройка font): пиксельные заголовки, Lexend и Atkinson Hyperlegible для чтения ─── */
html[data-font="pixel"] { --head: 'Pixelify Sans', monospace; --headls: .06em; }
html[data-font="lexend"] { --body: 'Lexend', Inter, sans-serif; --head: 'Lexend', Inter, sans-serif; --num: 'Lexend', Inter, sans-serif; --headls: normal; }
html[data-font="atkinson"] { --body: 'Atkinson Hyperlegible', Inter, sans-serif; --head: 'Atkinson Hyperlegible', Inter, sans-serif; --num: 'Atkinson Hyperlegible', Inter, sans-serif; --headls: normal; }

/* ─── Экран e-ink (настройка ink): фильтр поверх любого вида; SVG-фильтры #ink-* вставляет skin.js.
   Фильтр на корне не ломает position: fixed. Экран чернил перерисовывается медленно — без движения и теней. ─── */
html[data-ink="carta"] { filter: url(#ink-carta); }
html[data-ink="kaleido"] { filter: url(#ink-kaleido); }
html[data-ink="spectra"] { filter: url(#ink-spectra); }
html:is([data-ink], [data-skin="eink"]) *, html:is([data-ink], [data-skin="eink"]) *::before, html:is([data-ink], [data-skin="eink"]) *::after {
  animation: none !important; transition: none !important; text-shadow: none !important;
}
html[data-ink] .card { box-shadow: none !important; }
#ink-filters { position: absolute; width: 0; height: 0; }

/* ─── Движение (настройка motion=static): ничего не двигается ─── */
html[data-motion="static"] { --icanim: paused; }
html[data-motion="static"] *, html[data-motion="static"] *::before, html[data-motion="static"] *::after {
  animation-play-state: paused !important; transition: none !important;
}

/* ─── Иконки: <i class="ic" data-ic="…">; адреса файлов — icons.css. Линейная — маска цвета текста,
   пиксельная — картинка без сглаживания. Пиксельные по умолчанию в sky, anime, pink (skin.js ставит data-icons). ─── */
.ic {
  display: inline-block; flex: none; width: 1.15em; height: 1.15em; vertical-align: -.2em;
  background: currentColor; -webkit-mask: var(--ic-l) center / contain no-repeat; mask: var(--ic-l) center / contain no-repeat;
  animation-play-state: var(--icanim, running);
}
html[data-icons="pixel"] .ic {
  width: 16px; height: 16px; vertical-align: -3px;
  background: var(--ic-p) center / contain no-repeat; -webkit-mask: none; mask: none; image-rendering: pixelated;
}
html[data-icons="pixel"] .ic.ic-34 { width: 34px; height: 34px; background-image: var(--ic-3); }
.app-tab .ic { margin-right: 6px; }
button.primary .ic { animation: ic-float 2.4s ease-in-out infinite; animation-play-state: var(--icanim, running); }
.ic[data-ic="bell"] { animation: ic-ring 2.6s ease-in-out infinite; animation-play-state: var(--icanim, running); }
:is(a, button, summary):hover > .ic[data-ic="bell"] { animation: ic-ring .9s ease-in-out infinite; }

/* ─── Ширина: горизонтальной прокрутки нет нигде. Вкладки шапки переносятся на вторую строку, луна прячется. ─── */
html, body { max-width: 100%; overflow-x: clip; }
html[data-skin] .app-tabs { flex-wrap: wrap; height: auto; row-gap: 4px; }
/* В режиме «ряды» (static/app-nav.js) переносится сам список вкладок, а полоса — нет: иначе «Обновить», «Скриншот» и
   шестерёнка уходят строкой под ряды. Кнопки справа стоят на уровне первого ряда (владелица 13.11.2026: «настройки
   всегда должны оставаться на месте»). */
html[data-skin] .app-tabs[data-nav-mode="rows"] { flex-wrap: nowrap; align-items: flex-start; }
/* луна «Ночного неба» в полосе вкладок (skin-sparkle.css, .app-tabs::before): на узком окне вкладки переносятся */
@media (max-width: 1199px) { html[data-skin] .app-tabs::before { display: none; } }
html[data-skin] :is(pre, table) { max-width: 100%; }
html[data-skin] pre { overflow-x: auto; }
html[data-skin] :is(td, th) { overflow-wrap: anywhere; }

/* ════════ форма видов (windows/ops-skins.css: .w → body, .btn.p → button.primary, .h1/.h2 → h1/h2,
   .onav a[aria-current] → .app-tab[aria-current="page"]) ════════ */

/* Pink Sparkle: остальное — skin-sparkle.css */
html[data-skin="pink"] body {
  background-image:
    radial-gradient(circle, #FF8FC1 0 1.2px, transparent 1.8px), radial-gradient(circle, #FFC2DC 0 1px, transparent 1.6px),
    radial-gradient(circle, #FFD25A 0 1px, transparent 1.6px);
  background-position: 12% 18%, 63% 41%, 37% 77%; background-size: 220px 180px, 260px 210px, 300px 240px;
}
html[data-skin="pink"] button.primary { box-shadow: 3px 3px 0 #7A2E5F; }
html[data-skin="pink"] button.primary:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #7A2E5F; }
html[data-skin="pink"] h1, html[data-skin="pink"] .screen-name { background: linear-gradient(90deg, #D42A74 0%, #9A5AE0 55%, #3D6FD8 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
html[data-skin="pink"] :is(.num, .sum, .big) { color: var(--stat); }
@keyframes ops-glit {
  0%, 100% { border-color: #FF8FC1; box-shadow: 0 0 0 1px rgba(255, 143, 193, .35), 0 0 10px rgba(255, 143, 193, .30); }
  50% { border-color: #9FC2FF; box-shadow: 0 0 0 1px rgba(159, 194, 255, .35), 0 0 12px rgba(178, 150, 255, .40); }
}
html[data-kit="sparkle"] .app-tab[aria-current="page"] { position: relative; animation: ops-glit 3.6s ease-in-out infinite; }

/* Модерн и Модерн · тёмный: как программа SMM — радиусы 8/5, без теней, выбранная вкладка серая с синей полоской */
html:is([data-skin="modern"], [data-skin="mdark"]) { --r: 8px; --lift: none; --lift-2: 0 8px 24px rgba(0, 0, 0, .14); }
html:is([data-skin="modern"], [data-skin="mdark"]) .card { border-radius: 8px; box-shadow: none; }
html:is([data-skin="modern"], [data-skin="mdark"]) :is(button, input, select, textarea) { border-radius: 5px; }
html:is([data-skin="modern"], [data-skin="mdark"]) button.primary { box-shadow: none; }
html[data-skin="modern"] button.primary:hover { background: #0C5A9E; border-color: #0C5A9E; }
html:is([data-skin="modern"], [data-skin="mdark"]) h1, html:is([data-skin="modern"], [data-skin="mdark"]) .screen-name { font-size: 26px; line-height: 34px; font-weight: 600; letter-spacing: 0; }
html:is([data-skin="modern"], [data-skin="mdark"]) h2 { font-size: 16px; line-height: 22px; font-weight: 600; }
html[data-skin="modern"] .app-tab[aria-current="page"] { background: #E6E6E6; box-shadow: inset 3px 0 0 #0F6CBD; }
html[data-skin="mdark"] .app-tab[aria-current="page"] { background: #383838; box-shadow: inset 3px 0 0 #4BA0EE; }

/* Холст · Linen: тёплый лён, лёгкое переплетение, радиус 8 */
html[data-skin="canvas"] { --r: 8px; }
html[data-skin="canvas"] body {
  background-image: repeating-linear-gradient(0deg, rgba(90, 75, 50, .03) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(90, 75, 50, .024) 0 1px, transparent 1px 4px);
}
html[data-skin="canvas"] .card { border-radius: 8px; box-shadow: 0 1px 2px rgba(40, 38, 32, .06); }
html[data-skin="canvas"] h1, html[data-skin="canvas"] .screen-name { font-weight: 600; letter-spacing: -.005em; }
html[data-skin="canvas"] button.primary { box-shadow: none; }
html[data-skin="canvas"] .app-tab[aria-current="page"] { background: #E5DFD3; box-shadow: inset 0 0 0 1px #4A5C6E; }

/* Туман · Mist и Тушь · Ink (из языковой читалки) */
html[data-skin="mist"] .card { border-radius: 10px; box-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
html[data-skin="mist"] h1, html[data-skin="mist"] .screen-name { font-weight: 600; color: #E1E5EC; }
html[data-skin="mist"] h2 { color: #C9D3E0; }
html[data-skin="mist"] .app-tab[aria-current="page"] { background: #2A3444; box-shadow: inset 0 0 0 1px #92B0D0; }
html[data-skin="graphite"] .card { border-radius: 8px; }
html[data-skin="graphite"] h1, html[data-skin="graphite"] .screen-name { font-weight: 600; }
html[data-skin="graphite"] .app-tab[aria-current="page"] { background: #2A2D33; box-shadow: inset 0 0 0 1px #8AB0E0; }

/* E-ink: экран не светится, а отражает — без теней и движения, только тонкие линии */
html[data-skin="eink"] body { background-image: none; }
html[data-skin="eink"] :is(.card, table) { box-shadow: none; border-radius: 6px; }
html[data-skin="eink"] h1, html[data-skin="eink"] .screen-name { font-family: 'Instrument Serif', Georgia, serif; font-style: italic; font-weight: 400; font-size: 26px; letter-spacing: -.01em; }
html[data-skin="eink"] h2 { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .09em; color: #64635F; }
html[data-skin="eink"] button.primary { box-shadow: none; }
html[data-skin="eink"] a { text-decoration: none; border-bottom: 1px solid #A9A7A3; }
html[data-skin="eink"] .app-tabs { border-bottom: 1px solid #A9A7A3; }
html[data-skin="eink"] .app-tab { border-bottom: 0; }
html[data-skin="eink"] .app-tab[aria-current="page"] { background: #B9B8B4; box-shadow: inset 0 0 0 1px #6A6965; }

/* Аниме: скринтон-точки, жирный контур, «печатная» тень, маркер под заголовком */
html[data-skin="anime"] body { background-image: radial-gradient(circle, rgba(255, 61, 139, .12) 1.2px, transparent 1.6px); background-size: 12px 12px; }
html[data-skin="anime"] .card { border: 2px solid #2B2440; border-radius: 12px; box-shadow: 3px 3px 0 #2B2440; }
html[data-skin="anime"] button { border: 2px solid #2B2440; box-shadow: 2px 2px 0 #2B2440; border-radius: 8px; }
html[data-skin="anime"] h1, html[data-skin="anime"] .screen-name { background: linear-gradient(transparent 62%, #FFE45C 62%); padding: 0 4px; font-weight: 800; width: fit-content; }
html[data-skin="anime"] .app-tabs { border-bottom: 2px solid #2B2440; }
html[data-skin="anime"] .app-tab[aria-current="page"] { box-shadow: 2px 2px 0 #2B2440, inset 0 0 0 2px #2B2440; }

/* Рейка: тёмная основа ops без изменений формы — только токены skins.css */

/* ─── Отдельные настройки в шестерёнке ─── */
.skin-prefs { display: grid; gap: 6px; }
.skin-prefs label { display: grid; grid-template-columns: 1fr minmax(8rem, 1.2fr); align-items: center; gap: .5rem; font-size: .85rem; color: var(--text2); }
.skin-prefs select { width: 100%; height: 1.9rem; font-size: .85rem; }

/* No-connection strip (designer SysStates 6), created by app-shell.js setLive(false). */
.app-offline-ban {
  position: sticky; top: 0; z-index: 50;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 14px; font-size: 13px;
  background: color-mix(in srgb, var(--warn, #d97706) 14%, var(--panel, Canvas));
  border-bottom: 1px solid color-mix(in srgb, var(--warn, #d97706) 50%, var(--line, GrayText));
}
.app-offline-ban[hidden] { display: none; }
.app-offline-ban b { color: var(--warn, #d97706); }
.app-offline-ban button { margin-left: auto; }

/* Sky settings of Pink Sparkle (templates/_skin.html, static/skin-sky.js): shown only in that view. */
.skin-pref-sky { display: none; }
html[data-skin="pink"]:not([data-ink]) .skin-pref-sky { display: grid; }

/* Update notice (static/update-notice.js, web/release.go): a card in the bottom-right corner after a deploy.
   Every page loads this sheet through skinhead, so the card has one look everywhere; colours are skin tokens. */
.update-notice {
  position: fixed; right: 16px; bottom: 16px; z-index: 1000; max-width: min(360px, calc(100vw - 32px)); box-sizing: border-box;
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px; padding: 12px 12px 12px 14px;
  background: var(--panel, Canvas); color: var(--text, CanvasText); font-size: 13px; line-height: 1.35;
  border: 1px solid var(--line, GrayText); border-left: 4px solid var(--acc, Highlight); border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .28);
}
.update-notice[hidden] { display: none; }
.update-notice b { grid-column: 1; font-weight: 700; }
.update-notice span { grid-column: 1; color: var(--text2, inherit); }
.update-notice button { font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; border-radius: 7px; padding: 6px 12px; box-shadow: none; }
.update-notice .update-notice-go { grid-column: 2; grid-row: 1 / span 2; background: var(--accbg, Highlight); color: var(--accfg, HighlightText); border: 0; }
.update-notice .update-notice-later { grid-column: 1 / -1; justify-self: start; padding: 2px 0; background: transparent; color: var(--text3, inherit); border: 0; }
.update-notice button:focus-visible { outline: 2px solid var(--acc, Highlight); outline-offset: 2px; }
