/* Roboto лежит в сборке: сайт работает без интернета. Лицензия SIL OFL 1.1 — roboto-LICENSE.txt. */
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("roboto-cyrillic-wght-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("roboto-latin-ext-wght-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("roboto-latin-wght-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* KEDVI. Палитра: #261A66 — основа, #EF5F18 — главные действия, #FFFFFF — текст и иконки.
   Компоновка, размеры и отступы — по утверждённым макетам. */
:root {
  color-scheme: dark;
  --violet: #261A66;
  --orange: #EF5F18;
  --white: #FFFFFF;
  --deep: #150D40;
  --text: #FFFFFF;
  --muted: rgba(255,255,255,.68);
  --line: rgba(255,255,255,.11);
  --line-strong: rgba(255,255,255,.20);
  --surface: rgba(255,255,255,.05);
  --surface-2: rgba(255,255,255,.10);
  --field: rgba(255,255,255,.045);
  --panel: linear-gradient(165deg, rgba(255,255,255,.085), rgba(255,255,255,.035));
  --radius: 18px;
  --control: 44px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--deep); }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  color: var(--text); font: 15px/1.45 "Roboto", "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(1000px 640px at 50% 18%, rgba(74,54,176,.40), transparent 72%),
    radial-gradient(760px 520px at -8% 104%, rgba(239,95,24,.08), transparent 70%),
    linear-gradient(170deg, #190F49 0%, var(--violet) 48%, #1A1050 100%) fixed;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 28px; line-height: 1.15; }
h2 { font-size: 20px; line-height: 1.25; }
h3 { font-size: 24px; line-height: 1.2; }
p { overflow-wrap: anywhere; }
small { font-size: 13px; }
.muted { color: var(--muted); }
.icon { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }

/* Поля и кнопки */
button, input, select, textarea { font: inherit; color: inherit; }
button, select, summary, .icon-button { cursor: pointer; }
button { border: 0; background: none; padding: 0; border-radius: 12px; }
input, select, textarea {
  width: 100%; min-height: var(--control); padding: 10px 16px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--field); transition: border-color .15s, background .15s;
}
input::placeholder, textarea::placeholder { color: rgba(255,255,255,.42); }
input:hover, select:hover, textarea:hover { border-color: rgba(255,255,255,.34); }
textarea { min-height: 150px; resize: vertical; display: block; line-height: 1.5; padding: 14px 16px 30px; }
select {
  appearance: none; padding-right: 40px; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
}
select option { background: var(--violet); color: var(--white); }
select optgroup { background: var(--violet); color: rgba(255,255,255,.62); font-style: normal; font-weight: 600; }
label { display: grid; gap: 8px; font-size: 15px; }
:is(button, a, input, textarea, select, [tabindex]):focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }
.primary, .outline, .quiet, .ghost, .danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--control); padding: 0 20px; border-radius: 12px; font-weight: 600; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s;
}
.primary { background: linear-gradient(180deg, #FF7A38, var(--orange)); color: var(--violet); font-weight: 700; box-shadow: 0 10px 30px -14px rgba(239,95,24,.9); }
.primary:hover { background: linear-gradient(180deg, #FF8A4E, #F56B25); }
.primary:active { transform: translateY(1px); }
.primary:disabled { opacity: .6; cursor: default; }
.big { min-height: 56px; border-radius: 14px; font-size: 17px; }
.outline { border: 1px solid var(--line-strong); background: var(--surface); }
.outline:hover, .ghost:hover { border-color: rgba(255,255,255,.42); background: var(--surface-2); }
.ghost { border: 1px solid var(--line-strong); min-height: 38px; padding: 0 14px; font-size: 14px; }
.ghost.done { border-color: transparent; background: var(--surface-2); color: var(--muted); }
.quiet { color: var(--muted); padding: 0 14px; font-weight: 500; }
.quiet:hover { color: var(--white); background: var(--surface-2); }
.danger { background: rgba(255,255,255,.1); border: 1px solid var(--line-strong); }
.danger:hover { background: #C6381A; border-color: #C6381A; }
.wide { width: 100%; }
.icon-button {
  display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 12px;
  color: var(--white); background: transparent; transition: background .15s, color .15s, border-color .15s;
}
.icon-button:hover { background: var(--surface-2); }
.badge { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.counter { font-size: 13px; color: rgba(255,255,255,.5); font-variant-numeric: tabular-nums; }

/* Шапка */
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 24px;
  padding: 0 clamp(16px, 2.6vw, 40px); height: 76px;
  background: rgba(24,15,72,.86); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.brand-group { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 32px; height: 32px; flex: none; }
.brand { font-size: 28px; font-weight: 600; letter-spacing: .02em; line-height: 1; }
.tagline { color: var(--muted); font-size: 16px; padding-left: 16px; margin-left: 4px; border-left: 1px solid var(--line-strong); white-space: nowrap; }
#nav { display: flex; gap: 6px; flex: 1; min-width: 0; justify-content: center; }
.nav-link { padding: 0 24px; height: 42px; border-radius: 999px; font-size: 17px; white-space: nowrap; transition: background .15s; }
.nav-link:hover { background: var(--surface); }
.nav-link[aria-current="true"] { background: linear-gradient(180deg, rgba(255,255,255,.26), rgba(255,255,255,.13)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.account-group { display: flex; align-items: center; gap: 14px; }
.pill { display: inline-flex; align-items: center; gap: 10px; height: 42px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); white-space: nowrap; font-size: 16px; transition: background .15s, border-color .15s; }
button.pill:hover { background: var(--surface-2); border-color: rgba(255,255,255,.42); }
a.pill { color: var(--white); text-decoration: none; }
.account-group a.pill:hover { background: var(--surface-2); }
button.pill[aria-current="true"] { background: linear-gradient(180deg, rgba(255,255,255,.26), rgba(255,255,255,.13)); border-radius: 999px; border-color: transparent; }
#balance { font-size: 14px; }
#balance strong { font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; margin-right: -4px; }
#balance .icon { color: var(--orange); }
.profile-link { display: flex; align-items: center; gap: 8px; padding-left: 14px; border-left: 1px solid var(--line-strong); border-radius: 0; height: 42px; }
.profile-link .icon { width: 18px; height: 18px; color: var(--muted); }
.avatar {
  display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 50%;
  background: linear-gradient(140deg, #FF8A4C, var(--orange)); color: var(--violet); font-weight: 800; font-size: 17px;
}
.profile-link[aria-current="true"] .avatar { box-shadow: 0 0 0 2px var(--white); }
.avatar.big { width: 64px; height: 64px; font-size: 26px; }

/* Сетка: слева разделы, по центру материалы, справа панель */
main {
  flex: 1; width: 100%; max-width: 1720px; margin: 0 auto; padding: 28px clamp(16px, 1.8vw, 28px) 44px;
  display: grid; gap: 28px; align-items: start;
}
main[data-layout="three"] { grid-template-columns: 224px minmax(0, 1fr) 400px; }
main[data-layout="two"] { grid-template-columns: 224px minmax(0, 1fr); }
main[data-layout="single"] { grid-template-columns: minmax(0, 1fr); }
main[data-layout="single"] #workspace { width: 100%; max-width: 1240px; margin: 0 auto; }
main[data-page="Проекты"][data-layout="three"] { grid-template-columns: 224px minmax(0, 1fr) clamp(380px, 31vw, 500px); }
#workspace { min-width: 0; padding-top: 6px; }
.workspace-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; min-height: 46px; }
#subtitle { margin-top: 8px; max-width: 560px; }
#subtitle:empty { display: none; }
#head-actions { display: flex; gap: 12px; flex: none; }
main:is([data-page="Видео"], [data-page="Изображения"], [data-page="Аудио"]) h1 { font-size: 20px; }
main:is([data-page="Видео"], [data-page="Изображения"], [data-page="Аудио"]) #subtitle { font-size: 14px; margin-top: 4px; }
main[data-page="Тарифы"] .workspace-head { justify-content: center; text-align: center; margin: 22px 0 36px; }
main[data-page="Тарифы"] h1 { font-size: 42px; }
main[data-page="Тарифы"] #subtitle { font-size: 18px; max-width: none; margin-top: 14px; }
.panel, .card, .strip, .plan { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.panel { padding: 26px 24px 24px; position: sticky; top: 104px; max-height: calc(100vh - 128px); overflow: auto; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; }
.panel-head h2 { font-size: 22px; }
.panel-tools { display: flex; gap: 2px; margin-right: -8px; }
.panel form { display: grid; gap: 20px; }
.prompt-field, .read-field.tall .read-box { position: relative; }
.prompt-field .counter, .read-box .counter { position: absolute; right: 14px; bottom: 10px; pointer-events: none; }
.rows, #provider-fields { display: grid; gap: 14px; }
.row-field { grid-template-columns: 112px minmax(0, 1fr); align-items: center; gap: 12px; }
#provider-fields input[type="checkbox"] { width: 20px; min-height: 20px; accent-color: var(--orange); }
.cost { font-size: 14px; color: var(--muted); }
#provider-price:not(:empty) { color: var(--white); font-weight: 600; }
#provider-price:empty, .provider-notes:empty, #provider-mode-field[hidden] { display: none; }
.provider-notes { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.file-field { display: grid; gap: 8px; min-width: 0; font-size: 15px; }
.file-field .file-pick { justify-self: start; min-height: 40px; border: 1px dashed var(--line-strong); border-radius: 12px; }
.file-field .file-pick:disabled { opacity: .45; cursor: default; }
.file-list { display: grid; gap: 6px; list-style: none; margin: 0; padding: 0; }
.file-list:empty { display: none; }
.file-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0;
  padding: 8px 6px 8px 12px; border-radius: 10px; background: var(--field); font-size: 13px; }
.file-list li span { min-width: 0; overflow-wrap: anywhere; }
.file-list li button { flex: none; min-height: 32px; padding: 0 10px; font-size: 13px; }
.file-hint { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.remote-error { font-size: 12px; color: var(--orange); overflow-wrap: anywhere; }
.remote-error:empty { display: none; }
#generate, #provider-run { min-height: 56px; border-radius: 14px; font-size: 17px; }
output { display: block; color: #FFB48C; font-size: 14px; }
output:empty { display: none; }

/* Левая панель */
#sidebar { position: sticky; top: 104px; display: grid; gap: 2px; max-height: calc(100vh - 128px); overflow: auto; padding: 2px; margin: -2px; }
.eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.45); padding: 4px 14px 6px; }
#project-list + .side-link + .eyebrow { margin-top: 18px; }
#project-list { display: grid; gap: 2px; }
#project-menu { display: grid; gap: 8px; }
.side-link {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px; padding: 8px 14px;
  text-align: left; border-radius: 10px; color: var(--muted); overflow-wrap: anywhere; transition: color .15s, background .15s;
}
.side-link .icon { width: 20px; height: 20px; }
.side-link:hover { color: var(--white); background: var(--surface); }
.side-link[aria-current="true"] { color: var(--white); background: var(--surface-2); font-weight: 600; }
.side-link[aria-current="true"] .icon { color: var(--orange); }
.add-project { color: rgba(255,255,255,.5); }
.side-box {
  display: flex; align-items: center; gap: 14px; width: 100%; height: 50px; padding: 0 18px; text-align: left; font-size: 17px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); transition: background .15s, border-color .15s;
}
.side-box:hover { background: var(--surface-2); border-color: var(--line-strong); }
.side-box[aria-current="true"] { background: linear-gradient(180deg, rgba(255,255,255,.24), rgba(255,255,255,.12)); border-color: rgba(255,255,255,.18); }
.side-box .icon { color: var(--orange); }

/* Результаты */
.feed { display: grid; gap: 30px; max-width: 840px; }
.library-grid { display: grid; gap: 28px 24px; align-items: start; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
.media-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 14px; align-items: start; }
.player { position: relative; border-radius: 14px; overflow: hidden; background: #0E0930; border: 1px solid var(--line-strong); }
.player video, .frame { display: block; width: 100%; aspect-ratio: 16 / 10.400; object-fit: cover; background: #0E0930; }
.frame { border-radius: 14px; border: 1px solid var(--line-strong); }
.play-overlay {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: grid; place-items: center;
  width: 84px; height: 84px; border-radius: 50%; color: var(--white);
  background: rgba(38,26,102,.58); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.4); transition: background .15s, transform .15s;
}
.play-overlay:hover { background: var(--orange); color: var(--violet); border-color: var(--orange); transform: translate(-50%, -50%) scale(1.05); }
.play-overlay .icon { width: 34px; height: 34px; fill: currentColor; stroke-width: 1; margin-left: 4px; }
.audio-frame { aspect-ratio: auto; min-height: 92px; display: flex; align-items: center; gap: 14px; padding: 0 22px; color: var(--muted); }
.audio-frame .icon { width: 32px; height: 32px; color: var(--orange); }
.media-tools { display: grid; gap: 10px; padding-top: 6px; }
.media-tools .icon-button { border: 1px solid var(--line-strong); background: var(--surface); }
.media-tools .icon-button:hover { border-color: rgba(255,255,255,.42); background: var(--surface-2); }
.result-info { display: grid; gap: 6px; padding: 16px 58px 0 4px; }
.meta { font-size: 14px; }
.result-actions { display: flex; align-items: center; gap: 4px 18px; flex-wrap: wrap; margin-top: 2px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; color: var(--muted); }
.check input { width: 16px; min-height: 16px; height: 16px; padding: 0; accent-color: var(--orange); }
.mark { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); padding: 4px 6px; border-radius: 8px; }
.mark .icon { width: 16px; height: 16px; }
.mark:hover, .mark[aria-pressed="true"] { color: var(--white); }
.mark[aria-pressed="true"] .icon { fill: var(--orange); stroke: var(--orange); }
.section-title { margin: 36px 0 16px; }
.empty-state { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 72px 24px; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.library-grid .empty-state { grid-column: 1 / -1; }
.empty-state .icon { width: 36px; height: 36px; color: rgba(255,255,255,.5); margin-bottom: 6px; }
.empty-state p { max-width: 420px; }
#provider-jobs { display: grid; gap: 12px; margin-bottom: 20px; }
.card { padding: 18px; display: grid; gap: 8px; justify-items: start; }
.card button { min-height: 38px; padding: 0 14px; border: 1px solid var(--line-strong); }

/* Библиотека */
.library-filters { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-bottom: 30px; }
.search { position: relative; display: block; flex: 1 1 260px; max-width: 420px; }
.search .icon { position: absolute; left: 14px; top: 11px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 46px; }
.chips, #picker-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--field); border: 1px solid var(--line); overflow: auto; }
.chips button, #picker-tabs button { min-height: 34px; padding: 0 16px; border-radius: 10px; color: var(--muted); white-space: nowrap; }
.chips button:hover, #picker-tabs button:hover { color: var(--white); }
.chips button[aria-pressed="true"], #picker-tabs button[aria-selected="true"] { background: var(--surface-2); color: var(--white); }

/* Списки карточек */
.note-list { display: grid; gap: 20px; }
.note-card {
  position: relative; display: flex; align-items: flex-start; gap: 24px; padding: 16px 64px 16px 16px; cursor: pointer;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); transition: border-color .15s, box-shadow .15s;
}
.note-card:hover { border-color: var(--line-strong); }
.note-card[aria-pressed="true"] { border-color: var(--orange); box-shadow: 0 0 0 1px var(--orange), 0 14px 44px -22px rgba(239,95,24,.75); background: linear-gradient(165deg, rgba(255,255,255,.13), rgba(255,255,255,.06)); }
.note-card .cover { width: 172px; height: 128px; flex: none; object-fit: cover; border-radius: 12px; display: block; }
.note-person .cover { height: 164px; }
.note-card-text { display: grid; gap: 8px; min-width: 0; padding-top: 6px; }
.note-card-text h2 { font-size: 22px; }
.note-card-text p { color: rgba(255,255,255,.82); line-height: 1.5; }
.note-person .note-card-text p { -webkit-line-clamp: 3; }
.note-card .more { position: absolute; top: 12px; right: 12px; }
.note-pin { padding: 0; min-height: 176px; overflow: hidden; align-items: stretch; }
.note-pin .cover { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 0; }
.note-pin .note-card-text { position: relative; align-self: flex-end; width: 100%; padding: 60px 20px 16px; background: linear-gradient(180deg, transparent, rgba(16,9,52,.86)); }
.note-pin .more { background: rgba(23,15,69,.55); backdrop-filter: blur(4px); }
.art { display: grid; place-items: center; background: linear-gradient(140deg, rgba(255,255,255,.12), rgba(239,95,24,.12)); color: rgba(255,255,255,.4); }
.art .icon { width: 40px; height: 40px; }
.art.cover, .art.detail-photo { display: grid; }
.more .icon { stroke-width: 2.800; }
.note-board.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 84px 16px; gap: 18px; }
.note-board.empty p { max-width: 380px; }
.add-tile {
  display: grid; place-content: center; justify-items: center; gap: 8px; width: 148px; aspect-ratio: 1;
  border: 1px dashed rgba(255,255,255,.4); border-radius: var(--radius); background: var(--surface); transition: border-color .15s, background .15s;
}
.add-tile:hover { border-color: var(--orange); background: var(--surface-2); }
.add-tile .icon { width: 28px; height: 28px; color: var(--orange); }
.menu { position: fixed; z-index: 30; display: grid; gap: 2px; min-width: 232px; padding: 6px; border-radius: 14px; border: 1px solid var(--line-strong); background: #2E2180; box-shadow: 0 20px 60px rgba(7,3,32,.6); }
.menu button { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: 10px; text-align: left; }
.menu button:hover, .menu button:focus-visible { background: var(--surface-2); outline: 0; }
.menu .icon { width: 20px; height: 20px; color: var(--muted); }

/* Панель карточки справа */
#detail { display: grid; gap: 20px; }
.read-field { display: grid; gap: 10px; }
.read-label { font-size: 16px; }
.read-box { min-height: 48px; padding: 11px 18px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--field); font-size: 17px; }
.read-field:first-of-type .read-box { font-size: 19px; }
.read-field.tall .read-box { min-height: 170px; padding: 16px 18px 34px; white-space: pre-wrap; line-height: 1.5; }
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.photo-grid img, .photo-add { width: 100%; aspect-ratio: 1 / .940; object-fit: cover; border-radius: 12px; display: block; }
.photo-add { display: grid; place-content: center; justify-items: center; gap: 6px; text-align: center; line-height: 1.3; padding: 6px; border: 1px dashed rgba(255,255,255,.45); background: transparent; transition: border-color .15s, background .15s; }
.photo-add:hover { border-color: var(--orange); background: var(--surface); }
.photo-add span { max-width: 80px; }
.detail-photo { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 12px; display: block; }
#detail h3 { margin-top: 10px; }
.thumbs, .photo-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs button { width: 60px; height: 60px; border-radius: 10px; overflow: hidden; border: 2px solid transparent; opacity: .7; }
.thumbs button[aria-pressed="true"] { border-color: var(--orange); opacity: 1; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.note-description { white-space: pre-wrap; line-height: 1.6; font-size: 16px; color: rgba(255,255,255,.9); }
#detail > .primary { margin-top: 12px; }
.only-narrow { display: none; }

/* Тарифы */
.test-banner { display: block; width: fit-content; max-width: 100%; margin: -14px auto 30px; padding: 7px 16px; border-radius: 999px; text-align: center; font-size: 14px; color: var(--muted); border: 1px solid var(--line); background: var(--field); }
.pricing { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: stretch; }
.plan { display: flex; flex-direction: column; gap: 12px; padding: 30px 30px 26px; min-width: 0; }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; }
.plan h2 { font-size: 28px; }
.plan-about { min-height: 44px; font-size: 16px; }
.plan.featured { border-color: var(--orange); background: linear-gradient(165deg, rgba(239,95,24,.17), rgba(255,255,255,.05) 58%); box-shadow: 0 0 0 1px var(--orange), 0 24px 70px -26px rgba(239,95,24,.7); margin: -6px 0; padding-top: 36px; padding-bottom: 32px; }
.plan-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--violet); background: var(--orange); border-radius: 10px; padding: 6px 12px; white-space: nowrap; }
.plan-tag .icon { width: 15px; height: 15px; fill: currentColor; stroke-width: 0; }
.plan-amount { color: var(--muted); font-size: 20px; margin-top: 4px; }
.plan-amount strong { color: var(--white); font-size: 34px; line-height: 1.1; font-variant-numeric: tabular-nums; margin-right: 4px; }
.plan-pill { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 16px; }
.plan-pill .icon { color: var(--orange); }
.plan ul { list-style: none; margin: 14px 0 24px; padding: 0 0 0 6px; display: grid; gap: 12px; font-size: 15px; }
.plan li { display: flex; gap: 14px; align-items: flex-start; }
.plan li .icon { width: 20px; height: 20px; color: var(--orange); margin-top: 1px; }
.plan > button { margin-top: auto; width: 100%; }
.strip { display: flex; align-items: center; gap: 22px; padding: 22px 30px; margin-top: 24px; }
.strip > div { flex: 1; min-width: 0; display: grid; gap: 4px; }
.pricing + .strip { margin-top: 36px; }
.topup-form { display: flex; gap: 12px; }
.topup-form input { width: 130px; }
.faq h2 { white-space: nowrap; }
.faq > p { flex: 1; min-width: 0; padding-left: 24px; }
.faq-mark { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; font-weight: 700; font-size: 18px; color: var(--orange); border: 2px solid var(--orange); }
.faq-item { display: grid; gap: 4px; padding: 14px 0; border-top: 1px solid var(--line); }
.faq-item:first-child { border-top: 0; padding-top: 0; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
.stat strong { font-size: 30px; font-variant-numeric: tabular-nums; }

/* Окна */
dialog { padding: 0; width: min(560px, calc(100% - 32px)); max-height: min(88vh, 860px); color: var(--text); border: 1px solid var(--line-strong); border-radius: 20px; background: linear-gradient(165deg, #2F2280, #1E1458); box-shadow: 0 30px 90px rgba(7,3,32,.6); }
dialog[open] { display: flex; flex-direction: column; }
dialog.small { width: min(440px, calc(100% - 32px)); }
dialog::backdrop { background: rgba(12,7,42,.72); backdrop-filter: blur(3px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 16px 6px 24px; }
#dialog-body { display: grid; gap: 16px; padding: 12px 24px 24px; overflow: auto; }
.note-editor { display: grid; gap: 18px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 16px; margin-top: 12px; }
#dialog-body > button { justify-self: start; min-height: var(--control); padding: 0 20px; border: 1px solid var(--line-strong); font-weight: 600; }
.upload { display: grid; gap: 10px; }
.upload-previews { display: flex; flex-wrap: wrap; gap: 12px; }
.upload-photo, .upload-tile { position: relative; width: 108px; height: 108px; border-radius: 14px; }
.upload-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; display: block; }
.upload-photo .icon-button { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; background: rgba(23,15,69,.78); }
.upload-photo .icon { width: 14px; height: 14px; stroke-width: 2.2; }
.upload-tile { display: grid; place-content: center; justify-items: center; gap: 6px; text-align: center; font-size: 13px; line-height: 1.25; padding: 8px; border: 1px dashed rgba(255,255,255,.45); cursor: pointer; }
.upload-tile:hover { border-color: var(--orange); background: var(--surface); }
.upload-tile span { max-width: 72px; }
.upload-tile input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; padding: 0; }
.upload-tile:focus-within { outline: 2px solid var(--white); outline-offset: 2px; }

/* Выдвижная панель быстрого выбора */
.drawer { margin: 0 0 0 auto; width: min(460px, 100%); height: 100vh; max-height: 100vh; border-radius: 20px 0 0 20px; border-width: 0 0 0 1px; }
#picker-tabs { margin: 8px 20px 4px; }
#picker-tabs button { flex: 1; }
#picker-list { flex: 1; overflow: auto; display: grid; gap: 12px; align-content: start; padding: 12px 20px 20px; }
.picker-add { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 16px; border: 1px dashed rgba(255,255,255,.4); border-radius: 14px; }
.picker-add:hover { border-color: var(--orange); background: var(--surface); }
.picker-add .icon { color: var(--orange); }
.picker-item { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.picker-item-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.picker-item-head strong { font-size: 17px; }
.picker-item-head small { color: var(--muted); white-space: nowrap; }
.picker-item p { color: var(--muted); font-size: 14px; -webkit-line-clamp: 3; }
.picker-item .ghost { justify-self: start; }
.photo-strip img { width: 76px; height: 76px; object-fit: cover; border-radius: 10px; }
.empty-note { padding: 8px 4px; }
.drawer-foot { display: flex; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); }

/* Уведомление и подвал */
#notice { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 40; width: max-content; max-width: min(560px, calc(100% - 32px)); padding: 12px 18px; border-radius: 12px; background: var(--white); color: var(--violet); font-weight: 600; box-shadow: 0 12px 40px rgba(7,3,32,.5); }
#notice:empty { display: none; }
footer { display: flex; gap: 6px 22px; flex-wrap: wrap; padding: 18px clamp(16px, 2.6vw, 40px); border-top: 1px solid var(--line); }
footer button, footer a { color: rgba(255,255,255,.5); font-size: 13px; text-decoration: none; }
footer button:hover, footer a:hover { color: var(--white); }

/* Невысокий экран: форма помещается целиком */
@media (max-height: 840px) and (min-width: 901px) {
  .panel { padding: 20px 22px; top: 96px; max-height: calc(100vh - 112px); }
  .panel form { gap: 14px; }
  .rows { gap: 10px; }
  #composer textarea { min-height: 112px; }
  #generate { min-height: 50px; }
  #detail { gap: 14px; }
  .read-field.tall .read-box { min-height: 120px; }
}
/* Ноутбук */
@media (max-width: 1500px) {
  .tagline { display: none; }
}
@media (max-width: 1320px) {
  .nav-link { padding: 0 16px; font-size: 16px; }
  main[data-layout="three"], main[data-page="Проекты"][data-layout="three"] { grid-template-columns: 208px minmax(0, 1fr) 348px; gap: 22px; }
  main[data-layout="two"] { grid-template-columns: 208px minmax(0, 1fr); }
  .note-card .cover { width: 132px; height: 104px; }
  .note-person .cover { height: 132px; }
  .note-card { gap: 18px; }
}
@media (max-width: 1100px) {
  #nav { justify-content: flex-start; }
  .nav-link { padding: 0 12px; }
}
/* Узкий экран: одна колонка без горизонтальной прокрутки страницы */
@media (max-width: 900px) {
  .topbar { height: auto; flex-wrap: wrap; gap: 6px 12px; padding-top: 10px; padding-bottom: 8px; }
  .brand-group { flex: 1; }
  .brand { font-size: 22px; }
  .brand-mark { width: 26px; height: 26px; }
  #nav { order: 3; flex-basis: 100%; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; }
  #nav::-webkit-scrollbar { display: none; }
  .nav-link { height: 38px; }
  .pill { height: 38px; padding: 0 12px; font-size: 14px; }
  .profile-link { padding-left: 0; border-left: 0; }
  .profile-link .icon { display: none; }
  .avatar { width: 38px; height: 38px; }
  .account-group { gap: 8px; }
  main[data-layout], main[data-page="Проекты"][data-layout="three"] { grid-template-columns: minmax(0, 1fr); gap: 18px; padding-top: 16px; }
  #sidebar, .panel { position: static; max-height: none; }
  #sidebar { display: block; }
  .eyebrow { padding: 0 2px 6px; }
  #project-list + .side-link + .eyebrow { margin-top: 12px; }
  #project-list, #project-menu { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
  #project-list { margin-bottom: 6px; }
  .side-link, .side-box { width: auto; flex: none; white-space: nowrap; }
  .side-link { background: var(--surface); border: 1px solid var(--line); }
  .side-box { height: 42px; padding: 0 14px; font-size: 15px; gap: 10px; }
  .add-project { border-style: dashed; }
  #settings, #detail { order: 2; }
  #workspace { order: 3; padding-top: 0; }
  .only-narrow { display: grid; }
  .workspace-head { min-height: 0; flex-wrap: wrap; }
  h1, main[data-page="Тарифы"] h1 { font-size: 26px; }
  main[data-page="Тарифы"] #subtitle { font-size: 15px; }
  main[data-page="Тарифы"] .workspace-head { margin: 8px 0 30px; }
  .pricing { grid-template-columns: minmax(0, 1fr); }
  .plan.featured { margin: 0; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip { flex-wrap: wrap; padding: 20px; }
  .faq > p { flex-basis: 100%; order: 3; padding-left: 0; }
  .faq .outline { order: 4; width: 100%; }
  .topup-form { width: 100%; }
  .topup-form input { flex: 1; width: auto; }
  .test-banner { border-radius: 14px; }
  .drawer { border-radius: 0; border-width: 0; }
}
@media (max-width: 520px) {
  #balance { font-size: 0; gap: 6px; }
  #balance strong { font-size: 14px; margin: 0; }
  .note-card { gap: 14px; padding: 12px 52px 12px 12px; }
  .note-card .cover { width: 92px; height: 92px; }
  .note-person .cover { height: 112px; }
  .note-card-text h2 { font-size: 18px; }
  .note-pin { padding: 0; min-height: 150px; }
  .note-pin .cover { width: 100%; height: 100%; }
  .pill { padding: 0 10px; }
  .topbar { gap: 6px 8px; }
  .brand-group { gap: 8px; min-width: 0; }
  .note-card .more { top: 6px; right: 6px; }
  .add-note { width: 100%; }
  #head-actions { width: 100%; flex-wrap: wrap; }
  .row-field { grid-template-columns: 104px minmax(0, 1fr); }
  .dialog-actions { gap: 12px; }
  .dialog-actions > * { flex: 1; }
  .result-info { padding-right: 4px; }
  .media-row { grid-template-columns: minmax(0, 1fr) 40px; gap: 10px; }
  .media-tools .icon-button { width: 40px; height: 40px; }
  .play-overlay { width: 56px; height: 56px; top: 44%; }
  .play-overlay .icon { width: 24px; height: 24px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

#provider-jobs .api-media-row { justify-self:stretch; width:100%; min-width:0; margin-top:14px; }
.api-media-row > :first-child { min-width:0; }
#provider-jobs .api-media-row > .media-tools { padding:0; justify-items:stretch; }
#provider-jobs .api-media-row > .media-tools > .icon-button {
  display:grid; place-items:center; width:100%; height:auto; min-height:0; aspect-ratio:1; padding:0;
}
#provider-jobs .api-media-row > .media-tools > .icon-button > .icon {
  display:block; width:20px; height:20px; margin:0;
}
.api-player { width:100%; margin-bottom:12px; }
.api-player video { display:block; width:100%; height:auto; aspect-ratio:16 / 9; object-fit:contain; }
#provider-jobs .api-player .api-play { position:absolute; inset:50% auto auto 50%; transform:translate(-50%,-50%); width:56px; height:56px; padding:0; border-radius:50%; background:#120c36ba; }
#results:has(> #provider-jobs) .empty-state { display:none; }
.api-artifact { display:block; width:100%; max-width:100%; min-width:0; }
img.api-artifact { height:auto; border-radius:12px; }

/* ==========================================================================
   Утверждённые визуальные правки (интерактивное превью KEDVI, 30.11):
   шапка с логотипом-орбитой, значок токена, видео с действиями при наведении,
   компактная панель «Создать видео», вкладки «Библиотека» / «Проекты».
   ========================================================================== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Шапка */
.topbar { min-height: 84px; height: auto; background: linear-gradient(100deg, rgba(26,18,76,.94), rgba(54,39,79,.94) 55%, rgba(40,29,77,.94)); border-bottom-color: rgba(163,145,190,.19); }
.topbar .brand { display: flex; align-items: center; flex: none; padding: 0; border-radius: 10px; }
.topbar .brand img { display: block; width: 147px; height: 56px; object-fit: contain; }
.nav-link, .account-group .pill, .library-link { border: 1px solid transparent; font-weight: 600; transition: background .15s, border-color .15s; }
.nav-link:hover, .nav-link:focus-visible, .nav-link[aria-current="true"],
.account-group button.pill:hover, .account-group button.pill[aria-current="true"],
.library-link:hover, .library-link:focus-visible, .library-link[aria-current="true"] {
  background: linear-gradient(rgba(255,255,255,.22), rgba(255,255,255,.125)); border-color: rgba(255,255,255,.21); box-shadow: none;
}
.account-group .pill { border-radius: 999px; background: transparent; border-color: transparent; }
.library-link { width: 42px; height: 42px; border-radius: 999px; }
.library-link .icon { width: 20px; height: 20px; }

/* Значок токена: звезда KEDVI, по центру строки цифр */
.token-star { width: 15px; height: 15px; flex: none; fill: currentColor; stroke: none; display: block; }
.tokens { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; white-space: nowrap; }
.tokens strong { font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; }
.tokens .token-star, #balance .token-star { color: #FFB078; }
#balance { gap: 6px; font-size: 16px; }
#balance .token-star { width: 17px; height: 17px; }
#balance strong { display: block; margin: 0; line-height: 1; font-size: 16px; font-weight: 600; }
.primary .tokens .token-star { color: currentColor; width: 14px; height: 14px; }
.primary .tokens { margin-left: 6px; }

/* Сетка без левой колонки: проекты — во вкладке «Проекты» */
main[data-layout="gen"] { grid-template-columns: minmax(0, 1fr) 245px; gap: 14px; padding-right: clamp(10px, 1.5vw, 22px); }
main[data-layout="detail"] { grid-template-columns: minmax(0, 1fr) clamp(360px, 31vw, 500px); }
main[data-layout="single"] #workspace { width: 100%; max-width: 1320px; margin: 0 auto; }
main[data-page="Видео"] .feed { max-width: none; }
/* Видео: панель стоит вровень с первым роликом и прокручивается вместе с лентой — кнопка запуска всегда достижима. */
main[data-page="Видео"] #settings { position: static; max-height: none; overflow: visible; }
#title:empty { display: none; }
#crumbs:empty { display: none; }
#crumbs { margin-bottom: 10px; }
.workspace-head:has(#title:empty):has(#subtitle:empty) { min-height: 0; margin-bottom: 18px; }

/* Компактная панель «Создать …» */
#settings { padding: 9px; display: flex; flex-direction: column; border-radius: 14px; background: rgba(32,22,67,.71); top: 96px; max-height: calc(100vh - 112px); }
#settings form { display: flex; flex-direction: column; gap: 7px; }
#settings #provider-controls:not([hidden]) { flex: 1 0 auto; display: flex; flex-direction: column; }
#settings #provider-form { flex: 1 0 auto; }
#settings h2, #settings .panel-head h2 { font-size: 17px; margin: 1px 2px 2px; }
#settings .panel-head { min-height: 0; }
#settings .tabs { display: flex; gap: 3px; padding: 3px; border-radius: 9px; background: rgba(23,16,51,.6); }
#settings .tabs button { flex: 1; padding: 6px 8px; line-height: 14px; font-size: 12px; border-radius: 7px; color: #DBD0F1; white-space: nowrap; }
#settings .tabs button:hover:not(:disabled) { color: var(--white); }
#settings .tabs button[aria-pressed="true"] { background: rgba(154,124,221,.2); color: var(--white); }
#settings .tabs button:disabled { opacity: .4; cursor: default; }
.frames { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 5px; border: 1px solid rgba(168,140,220,.27); background: rgba(138,106,192,.1); border-radius: 12px; }
.frames[data-count="1"], .frames[data-count="3"] > .frame-slot:last-child { grid-column: 1 / -1; }
.frames[data-count="1"] { grid-template-columns: minmax(0, 1fr); }
.frame-slot { position: relative; min-width: 0; display: grid; gap: 4px; align-content: start; }
.frame-slot .frame { position: relative; display: grid; place-items: center; align-content: center; gap: 2px; width: 100%; min-height: 55px; aspect-ratio: auto;
  overflow: hidden; padding: 3px; border-radius: 8px; border: 1px dashed rgba(187,163,237,.4); background: rgba(21,14,46,.35); color: var(--white); text-align: center; }
.frame-slot .frame:hover:not(:disabled) { border-color: #FF995F; }
.frame-slot .frame:disabled { opacity: .5; cursor: default; }
.frame-slot .plus { font-size: 19px; line-height: 1; color: #FFC29E; }
.frame-slot strong { font-size: 10px; font-weight: 500; line-height: 1.2; }
.frame-slot small { font-size: 10px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frame-slot .frame.has-file { border-style: solid; }
.frame-slot .frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.frame-slot .frame.has-file:has(img) strong { position: relative; align-self: end; margin-top: 20px; background: rgba(33,20,55,.87); padding: 2px 6px; border-radius: 5px; }
.frame-remove.icon-button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; background: rgba(23,15,69,.8); }
.frame-remove .icon { width: 12px; height: 12px; stroke-width: 2.2; }
.frame-slot .file-list li { padding: 2px 2px 2px 6px; font-size: 10px; border-radius: 6px; }
.frame-slot .file-list .icon-button { width: 20px; height: 20px; }
.frame-slot .file-list .icon { width: 11px; height: 11px; }
.prompt-box { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 5px 8px; border-radius: 10px; border: 1px solid rgba(165,139,222,.21); background: rgba(152,117,213,.125); }
#settings .prompt-box { flex: 1 0 auto; min-height: 112px; }
.prompt-box:focus-within, .pick:focus-within { outline: 1px solid #FF995F; }
.prompt-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.prompt-head label { display: block; font-size: 10px; line-height: 12px; color: #CFC0ED; }
.cards-link { font-size: 10px; line-height: 12px; padding: 1px 6px; border-radius: 6px; color: #CFC0ED; }
.cards-link:hover, .cards-link:focus-visible { color: var(--white); background: rgba(255,255,255,.1); }
.prompt-box textarea { flex: 1 0 88px; min-height: 88px; padding: 0 0 16px; border: 0; border-radius: 0; background: transparent; resize: none; font-size: 12px; line-height: 15px; outline: none; }
.prompt-box textarea:hover { border: 0; }
.prompt-box .counter { position: absolute; right: 8px; bottom: 4px; font-size: 10px; pointer-events: none; }
#settings .fields, #settings .rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; align-items: start; }
#settings .rows { grid-template-columns: minmax(0, 1fr); }
#settings .fields:empty { display: none; }
.pick { display: block; min-width: 0; padding: 5px 8px; border-radius: 10px; border: 1px solid rgba(165,139,222,.21); background: rgba(152,117,213,.125); font-size: 10px; line-height: 12px; color: #CFC0ED; }
.pick.span-2 { grid-column: 1 / -1; }
.pick select, .pick input:not([type="checkbox"]), .pick textarea { display: block; width: 100%; min-height: 0; height: 17px; margin: 2px 0 0; padding: 0 16px 0 0; border: 0; border-radius: 0;
  background-color: transparent; background-position: right 0 center; background-size: 13px; color: var(--white); font-size: 12px; line-height: 15px; outline: none; }
.pick textarea { height: auto; min-height: 48px; padding: 0; resize: vertical; }
.pick select:hover, .pick input:hover { border: 0; }
.pick.switch { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 34px; }
.pick.switch input { width: 15px; height: 15px; min-height: 0; margin: 0; padding: 0; accent-color: var(--orange); }
.pick .remote-error { display: block; margin-top: 3px; font-size: 10px; }
#settings .cost, #settings .provider-notes { font-size: 11px; line-height: 1.35; margin: 0 2px; }
#settings #provider-price:not(:empty) { font-weight: 500; }
#settings #generate, #settings #provider-run { display: inline-flex; align-items: center; justify-content: center; min-height: 0; height: 30px; padding: 0 9px; border-radius: 8px; font-size: 12px; font-weight: 600; flex: none; }
#settings #generate .icon { width: 15px; height: 15px; }
#settings output { font-size: 11px; margin: 0 2px; }
#settings .badge { font-size: 10px; padding: 1px 7px; }

/* Видео: действия и панель управления — при наведении */
.player { border-radius: 14px; background: #120E24; border-color: rgba(255,255,255,.12); }
.player video { aspect-ratio: 16 / 9; object-fit: contain; cursor: pointer; background: #120E24; }
.player .play-overlay { width: 54px; height: 54px; border-color: rgba(255,255,255,.27); background: rgba(26,19,43,.5); }
.player .play-overlay .icon { width: 22px; height: 22px; margin-left: 3px; }
.player-bar { position: absolute; inset: auto 0 0; display: flex; align-items: center; gap: 7px; padding: 21px 10px 8px;
  background: linear-gradient(transparent, rgba(19,13,37,.91)); opacity: 0; pointer-events: none; transition: opacity .14s; }
.player:hover .player-bar, .player:focus-within .player-bar { opacity: 1; pointer-events: auto; }
.player-bar button { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; color: var(--white); }
.player-bar button:hover { background: rgba(255,255,255,.12); }
.player-bar .icon { width: 17px; height: 17px; }
.player-bar input[type="range"] { flex: 1; min-width: 0; min-height: 0; height: 16px; padding: 0; border: 0; background: none; accent-color: var(--orange); }
.player-bar small { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--white); font-size: 12px; }
.media-actions { position: absolute; right: 12px; top: 12px; display: grid; gap: 6px; opacity: 0; pointer-events: none; transition: opacity .14s; }
.player:hover .media-actions, .player:focus-within .media-actions { opacity: 1; pointer-events: auto; }
.media-actions .icon-button { width: 32px; height: 32px; border-radius: 50%; background: rgba(24,16,41,.33); backdrop-filter: blur(4px); }
.media-actions .icon-button:hover, .media-actions .icon-button:focus-visible { background: rgba(34,23,57,.68); }
.media-actions .icon { width: 18px; height: 18px; stroke-width: 1.65; }
.media-actions [aria-pressed="true"] .icon { fill: #FF8545; stroke: #FF8545; }
@media (hover: none) { .player-bar, .media-actions { opacity: 1; pointer-events: auto; } }
.tooltip { position: relative; }
.tooltip::after { content: attr(data-tip); position: absolute; top: 50%; right: calc(100% + 7px); transform: translateY(-50%); opacity: 0; pointer-events: none;
  background: #171127; color: var(--white); padding: 6px 9px; border-radius: 7px; white-space: nowrap; font-size: 12px; font-weight: 400; line-height: 1.2; z-index: 6; transition: opacity .12s; }
.tooltip:hover::after, .tooltip:focus-visible::after { opacity: 1; }
.account-group .tooltip::after, .material-label .tooltip::after { top: calc(100% + 7px); right: 0; transform: none; }
.player-status { display: grid; place-content: center; justify-items: center; gap: 6px; aspect-ratio: 16 / 9; padding: 24px; text-align: center; }
.player-status.failed strong { color: #FFB48C; }
.player-status p { max-width: 460px; color: var(--muted); font-size: 14px; }
.result-video .result-info { padding: 8px 4px 0; gap: 3px; }
.result-video .prompt { font-size: 14px; }
.meta .tokens { margin-left: 2px; }
.feed .card .meta { display: inline-flex; align-items: center; gap: 4px; }
#provider-jobs { gap: 30px; margin-bottom: 30px; }
main[data-page="Видео"] .empty-state.video-slot { aspect-ratio: 16 / 9; align-content: center; padding: 24px; }
dialog.viewer { width: min(960px, calc(100% - 32px)); }
dialog.viewer #dialog-body { gap: 10px; }
.viewer-image { display: block; width: 100%; max-height: 72vh; object-fit: contain; border-radius: 12px; background: #120E24; }
.settings-list { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 18px; margin: 0; }
.settings-list dt { color: var(--muted); }
.settings-list dd { margin: 0; overflow-wrap: anywhere; }

/* Библиотека и проекты */
.collection-nav { display: flex; gap: 22px; }
.collection-nav button { padding: 5px 0; border-radius: 0; color: #D9CDEB; font-size: 22px; font-weight: 600; transition: color .15s, text-shadow .15s; }
.collection-nav button[aria-current="true"] { color: var(--white); }
.collection-nav button:hover, .collection-nav button:focus-visible { color: var(--white); text-shadow: 0 0 12px rgba(255,255,255,.6); outline-offset: 4px; }
.history, .project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 12px; }
.history #provider-jobs { display: contents; }
.history:has(> #provider-jobs > *) > .empty-state { display: none; }
.history > .empty-state { grid-column: 1 / -1; }
.tile, .project-tile { overflow: hidden; min-width: 0; border: 1px solid rgba(154,131,204,.3); background: rgba(34,23,69,.69); border-radius: 14px; }
.tile figure { position: relative; margin: 0; aspect-ratio: 16 / 9; background: #2E2258; overflow: hidden; }
.tile figure[role="button"] { cursor: pointer; }
.tile figure > img, .tile figure > video { display: block; width: 100%; height: 100%; object-fit: cover; }
.tile figure .placeholder { display: grid; place-items: center; height: 100%; padding: 8px; text-align: center; color: #CFC0EA; font-size: 13px; }
.tile-play { position: absolute; left: 50%; top: 50%; width: 38px; height: 38px; transform: translate(-50%, -50%); border-radius: 50%; background: rgba(26,19,43,.55); border: 1px solid rgba(255,255,255,.3); pointer-events: none; }
.tile-play::after { content: ""; position: absolute; left: 15px; top: 11px; border-style: solid; border-width: 8px 0 8px 12px; border-color: transparent transparent transparent var(--white); }
.project-tag { position: absolute; bottom: 8px; left: 8px; max-width: calc(100% - 16px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: rgba(22,13,50,.85); color: #F3ECFF; padding: 3px 7px; border-radius: 6px; font-size: 11px; }
.material-label { position: relative; padding: 10px 40px 11px 10px; font-size: 13px; }
.material-label small { display: block; margin-bottom: 3px; color: var(--muted); font-size: 12px; }
.material-label p { line-height: 1.35; }
.material-label .icon-button { position: absolute; right: 4px; top: 6px; width: 32px; height: 32px; }
.material-label .icon { width: 17px; height: 17px; }
.project-tile { aspect-ratio: 1; display: grid; align-content: end; justify-items: start; gap: 4px; padding: 14px; text-align: left; transition: border-color .15s, background .15s; }
.project-tile:hover, .project-tile:focus-visible { border-color: rgba(255,255,255,.34); background: rgba(46,32,92,.8); }
.project-tile .icon { width: 26px; height: 26px; color: #FF965E; margin-bottom: 4px; }
.project-tile strong { font-size: 15px; overflow-wrap: anywhere; }
.project-tile small { color: var(--muted); font-size: 12px; }
.project-tile.new { border-style: dashed; background: rgba(255,255,255,.03); align-content: center; justify-items: center; text-align: center; }
.project-tile.loose { background: rgba(255,255,255,.04); }
.project-back { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px 6px 6px; border-radius: 999px; color: #D9CDEB; font-weight: 600; }
.project-back:hover, .project-back:focus-visible { color: var(--white); background: linear-gradient(rgba(255,255,255,.2), rgba(255,255,255,.1)); }
.project-back .icon { width: 18px; height: 18px; }
.catalog-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.project-search { flex: 1 1 240px; max-width: 420px; min-height: 40px; padding: 8px 14px; border-radius: 10px; }
.catalog-top .primary { min-height: 40px; }
.project-tabs { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 18px; }
.project-tabs button { min-height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(121,101,169,.4); background: rgba(49,38,88,.6); }
.project-tabs button:hover { border-color: rgba(255,255,255,.34); }
.project-tabs button[aria-pressed="true"] { background: rgba(152,117,213,.27); border-color: #AE94E7; }
.choices { display: grid; gap: 6px; max-height: 50vh; overflow: auto; }
.choices label { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--field); font-size: 14px; cursor: pointer; }
.choices input { width: 16px; height: 16px; min-height: 0; margin-top: 2px; padding: 0; flex: none; accent-color: var(--orange); }
.choices span { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.choices small { color: var(--muted); font-size: 12px; }

@media (max-width: 1100px) {
  main[data-layout="gen"] { grid-template-columns: minmax(0, 1fr) 245px; }
}
@media (max-width: 900px) {
  .topbar { min-height: 0; }
  .topbar .brand { flex: 1; justify-content: flex-start; }
  .topbar .brand img { width: 126px; height: 48px; }
  main[data-layout] { grid-template-columns: minmax(0, 1fr); padding-right: clamp(16px, 1.8vw, 28px); }
  #settings { position: static; max-height: none; margin-top: 0 !important; min-height: 0 !important; order: 2; }
  #settings .prompt-box textarea { min-height: 110px; }
  #settings .tabs button { font-size: 12px; }
  .collection-nav button { font-size: 20px; }
}
@media (max-width: 520px) {
  #balance { font-size: 14px; }
  #balance strong { font-size: 14px; }
  .account-group .pill { padding: 0 8px; }
  .account-group { gap: 4px; }
  .profile-link { gap: 0; }
  .topbar .brand { min-width: 0; }
  .topbar .brand img { width: 108px; height: 41px; }
  .library-link { width: 36px; height: 36px; }
  .media-actions { right: 6px; top: 6px; gap: 4px; }
  .media-actions .icon-button { width: 30px; height: 30px; }
  .player .play-overlay { top: 50%; width: 48px; height: 48px; }
  .history { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .material-label { padding: 8px 34px 9px 8px; font-size: 12px; }
}
@media (max-width: 390px) {
  .topbar .brand img { width: 100px; height: 38px; }
  .nav-link { padding: 0 10px; font-size: 15px; }
}
