:root {
  --bg: #f6f6f7; --card: #fff; --text: #1b1c1f; --muted: #70737a; --line: #e6e6e9;
  --accent: #3a3d42; --accent-soft: #ececee; --on-accent: #fff;
  --warn: #9a6200; --warn-soft: #fdf1da; --bad: #b3362d; --bad-soft: #fbe9e7; --info: #2c5c9e; --info-soft: #e8f0fb;
  --grid: #dadce0; --bar: #f8f9fa; --select: #1a73e8;
  color-scheme: light;
}
:root { --hover-cell: #f3f8ff; --planned: #f4f4f5; }
/* тёмная тема включается кнопкой в панели; без зелёного, только нейтральные тона */
:root[data-theme="dark"] {
  --bg: #0f0f10; --card: #18181a; --text: #ededee; --muted: #9a9aa0; --line: #2c2c30;
  --accent: #e4e4e7; --accent-soft: #2a2a2e; --on-accent: #18181a;
  --warn: #eab656; --warn-soft: #33290f; --bad: #f08a80; --bad-soft: #361c19; --info: #8db6ee; --info-soft: #19263a;
  --grid: #2e2e32; --bar: #1f1f22; --select: #8ab4f8;
  --hover-cell: #232327; --planned: #202023;
  color-scheme: dark;
}
:root[data-theme="dark"] aside nav a { color: #b9b9bf; }
:root[data-theme="dark"] aside nav a:hover { color: var(--text); }
:root[data-theme="dark"] aside nav a.on { color: #fff; background: #333338; border-color: #4a4a50; box-shadow: none; }
:root[data-theme="dark"] button.back, :root[data-theme="dark"] :root[data-theme="dark"] button.tariff:hover { box-shadow: none; }

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 7px 14px; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
button.link { border: 0; background: none; padding: 2px 6px; color: var(--accent); }
button.danger { color: var(--bad); }
input, select, textarea { width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.shell { display: grid; grid-template-columns: 280px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); height: 100vh; height: 100dvh; background: var(--bg); }
main { background: var(--card); min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px 0 0; overflow: auto; }
main > .head, main > .toolbar, main > .summary, main > .grid, main > .card { margin: 0 16px; }

aside { display: flex; flex-direction: column; min-height: 0; margin: 10px; padding: 18px 12px 12px; border-radius: 22px; border: 1px solid var(--line); background: var(--card); box-shadow: 0 6px 24px rgb(24 25 28 / .07); color: #54565c; }
aside .brand { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 10px 8px; font-size: 21px; font-weight: 800; color: var(--accent); }
aside .brand small { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
aside nav { flex: 1; min-height: 0; overflow: auto; margin: 0 -8px; padding: 0 8px 8px; }
aside .group { margin-top: 14px; }
aside h3 { margin: 0 0 6px; padding: 0 12px; font-size: 12px; font-weight: 600; color: var(--muted); }
aside nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 2px; border-radius: 99px; border: 1px solid transparent; color: inherit; text-decoration: none; font-size: 14px; }
aside nav a:hover { color: var(--text); background: var(--accent-soft); }
aside nav a.on { color: #fff; font-weight: 600; background: linear-gradient(180deg, #4b4f56, #33363b); border-color: #6b7078; box-shadow: 0 2px 6px rgb(30 32 36 / .25); }
aside svg { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
aside footer { display: flex; align-items: center; gap: 4px; margin-top: 8px; padding: 10px 4px 0 12px; border-top: 1px solid var(--line); color: var(--text); font-weight: 600; }
aside footer span { flex: 1; }
aside footer a, aside footer button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 99px; background: none; color: var(--muted); }
aside footer a:hover, aside footer button:hover { color: var(--accent); background: var(--accent-soft); }
.head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
h1 { font-size: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar input[type=search] { width: 260px; text-overflow: ellipsis; }
.toolbar select, .toolbar input[type=date] { width: auto; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.summary { color: var(--muted); font-size: 12px; }

.sheet { flex: 1 0 240px; min-height: 0; overflow: auto; border-top: 1px solid var(--grid); }
.sheet table { border-collapse: separate; border-spacing: 0; font-size: 13px; }
.sheet th, .sheet td { border-right: 1px solid var(--grid); border-bottom: 1px solid var(--grid); height: 28px; padding: 0; white-space: nowrap; background: var(--card); }
.sheet thead th { position: sticky; z-index: 2; background: var(--bar); font-weight: 400; color: var(--muted); }
.letters th { top: 0; height: 22px; font-size: 11px; text-align: center; }
.sheet .names th { top: 22px; font-weight: 600; color: var(--text); text-align: left; padding: 0 8px; }
.sheet .gutter { position: sticky; left: 0; z-index: 1; min-width: 44px; padding: 0; background: var(--bar); color: var(--muted); font-weight: 400; font-size: 11px; text-align: center; }
.sheet thead .gutter, .sheet .names .gutter { z-index: 3; padding: 0; }
.gutter button { width: 100%; height: 27px; border: 0; border-radius: 0; background: none; padding: 0; font-size: 11px; color: var(--muted); }
.gutter button:hover { background: var(--accent-soft); color: var(--accent); }
.sheet td { min-width: 112px; }
.sheet td.narrow { min-width: 68px; }
.sheet td.wide-col { min-width: 200px; }
.sheet td.num { font-variant-numeric: tabular-nums; text-align: right; }
.ro { padding: 0 8px; }
.sheet .cell { width: 100%; min-width: 100%; height: 27px; border: 0; border-radius: 0; background: transparent; padding: 0 8px; text-align: inherit; }
.sheet select.cell { appearance: none; cursor: cell; }
.sheet .cell:focus { outline: 2px solid var(--select); outline-offset: -2px; background: var(--card); }
.sheet .cell.done { background: var(--accent-soft); }
.sheet td > input[type=checkbox] { display: block; margin: 0 auto; }
.sheet tfoot td, .sheet tfoot th { position: sticky; bottom: 0; background: var(--bar); font-weight: 600; padding: 0 8px; z-index: 2; }
.sheet td.empty { padding: 0 8px; text-align: left; color: var(--muted); }
/* всё в таблицах по центру */
.sheet th, .sheet td, .sheet .names th, .sheet td.num, .sheet td.empty { text-align: center; }
.sheet .cell { text-align: center; text-align-last: center; }

/* видно, что ячейку можно изменить */
.sheet input.cell { cursor: text; }
.sheet select.cell { cursor: pointer; }
.sheet .cell:hover { box-shadow: inset 0 0 0 1px var(--select); background: var(--hover-cell); }
.sheet select.cell:hover { appearance: auto; }

.title { display: flex; align-items: center; gap: 12px; min-height: 40px; }
button.back { display: grid; place-items: center; flex: none; width: 40px; height: 40px; padding: 0; border-radius: 99px; background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 2px 6px rgb(30 32 36 / .25); }
button.back svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }


aside nav { display: flex; flex-direction: column; }
aside .group.bottom { margin-top: auto; padding-top: 14px; }
aside footer small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
.team-head { margin: 8px 16px 0; }
button.member { text-align: left; border-radius: 8px; }

/* планировщик */
.grid.plan { padding-bottom: 16px; }
.grid.plan section { display: flex; flex-direction: column; gap: 8px; }
.grid.plan p { margin: 0; }
.grid.plan p.text { white-space: pre-line; }
.grid.plan ol { margin: 0; padding-left: 22px; line-height: 1.7; }
.grid.plan .bottom { margin-top: auto; }
.grid.plan .actions { justify-content: stretch; }
.grid.plan .actions button { flex: 1; }
a.video { color: var(--accent); }
main > .sheet:not(:last-child) { flex: none; max-height: 60vh; }
.timetable td.planned { background: var(--planned); }
.timetable button.add { width: 100%; min-height: 36px; border: 1px dashed transparent; background: none; color: var(--muted); font-size: 12px; padding: 4px; }
.timetable td.planned button.add { border-color: var(--accent); color: var(--accent); }
.timetable button.add:hover { border-color: var(--accent); color: var(--accent); }
.sheet td button.link:disabled { opacity: .3; cursor: default; }

/* очень мягкий градиент фона в обеих темах */
:root {
  --page-bg: linear-gradient(135deg, #f1f1f3 0%, #fcfcfd 45%, #eef0f4 100%);
  --panel-bg: linear-gradient(180deg, #ffffff 0%, #f5f5f7 100%);
}
:root[data-theme="dark"] {
  --page-bg: linear-gradient(135deg, #1b1b21 0%, #101012 48%, #191721 100%);
  --panel-bg: linear-gradient(180deg, #1d1d21 0%, #151518 100%);
}
body, .shell { background: var(--page-bg); }
main { background: transparent; }
aside { background: var(--panel-bg); }
.login { background: var(--page-bg); }

/* логотип: без плашки, вариант по теме */
.logo { display: block; height: auto; margin: 0 auto; }
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
aside .brand { justify-content: center; padding: 0 0 4px; }
aside .brand .logo { width: 150px; }
@media (max-width: 760px) { aside .brand .logo { width: 110px; } }

/* экран входа */
.login { position: relative; overflow: hidden; }
.login::before, .login::after { content: ''; position: absolute; width: 760px; height: 760px; border-radius: 50%; animation: drift 12s ease-in-out infinite alternate; will-change: transform; }
.login::before { top: -360px; left: -280px; background: radial-gradient(closest-side, rgb(232 170 80 / .26), transparent); }
.login::after { bottom: -380px; right: -300px; background: radial-gradient(closest-side, rgb(120 130 170 / .22), transparent); animation-delay: -6s; }
.login form { position: relative; z-index: 1; width: min(400px, 100%); padding: 36px 32px 26px; border-radius: 24px; box-shadow: 0 24px 60px rgb(20 20 25 / .14); text-align: center; animation: rise .5s ease-out both; }
.login form > * + * { margin-top: 14px; }
.login h1 { font-size: 22px; margin-top: 22px; }
.login form > .sub { margin-top: 4px; }
.login label { text-align: left; }
.login input { height: 46px; border-radius: 12px; padding: 0 14px; transition: border-color .2s, box-shadow .2s; }
.login input:focus { outline: none; border-color: #d9a04a; box-shadow: 0 0 0 4px rgb(217 160 74 / .18); }
.login .secret { position: relative; margin-top: 4px; }
.login .secret input { padding-right: 92px; font-size: 14px; color: var(--text); }
.login .secret .eye { position: absolute; top: 7px; right: 7px; width: auto; height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: none; font-size: 12px; color: var(--muted); }
.login .secret .eye:hover { background: var(--accent-soft); color: var(--text); }
.login .error { margin-top: 8px; }
.login button.primary { height: 46px; margin-top: 4px; border-radius: 12px; font-size: 15px; transition: transform .15s, box-shadow .2s; }
.login button.primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 22px rgb(30 32 36 / .22); }
.login button.primary:disabled { opacity: .7; cursor: default; }
.login-logo .logo { width: 200px; }
.login form.leaving { animation: leave .45s ease-in forwards; }
.login form.shake { animation: shake .35s; }

/* переход со входа в платформу */
.shell.enter aside { animation: from-left .6s cubic-bezier(.2, .8, .2, 1) both; }
.shell.enter main { animation: rise .6s .15s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes from-left { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
@keyframes leave { to { opacity: 0; transform: scale(1.06); } }
@keyframes drift { to { transform: translate(60px, 40px) scale(1.12); } }
@keyframes shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(7px); } 75% { transform: translateX(-4px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* таблица занятий по группам: в 1.2 раза крупнее расписания */
.timetable.big table { font-size: 14px; min-width: 860px; }
.timetable.big th, .timetable.big td { height: 54px; padding: 5px; }
.timetable.big thead th { height: 36px; }
.timetable.big th:first-child { width: 100px; }
.timetable.big .sub { font-size: 12px; }
.timetable.big button.add, .timetable.big .slot { min-height: 43px; margin: 0; font-size: 14px; border-radius: 10px; }

/* «Янтарная ночь»: тарифы целиком в градиенте, по сайту — только мелкие акценты */
:root { --gold: #d6a008; --gold-bright: #ffd63c; --gold-deep: #7a5a04; --night: #0b0a07; }
.tariffs { flex: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 18px; padding-bottom: 24px; }
.tariff { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; min-height: 340px; padding: 28px 26px 24px; overflow: hidden; isolation: isolate; border: 1px solid rgb(255 214 60 / .22); border-radius: 24px; color: #fff; text-align: left; background: var(--night); box-shadow: 0 14px 34px rgb(11 10 7 / .22); }
.tariff.tone-0 { background: radial-gradient(95% 75% at 96% 4%, #ffd63c 0%, rgb(214 160 8 / .8) 38%, transparent 76%), radial-gradient(90% 65% at 4% 96%, rgb(214 160 8 / .7), transparent 72%), radial-gradient(75% 60% at 55% 55%, rgb(122 90 4 / .9), transparent 78%), var(--night); }
.tariff.tone-1 { background: radial-gradient(90% 70% at 4% 6%, rgb(240 184 20 / .95), transparent 72%), radial-gradient(100% 75% at 100% 98%, #ffd63c 0%, rgb(214 160 8 / .7) 36%, transparent 72%), radial-gradient(70% 55% at 72% 28%, rgb(122 90 4 / .95), transparent 76%), var(--night); }
.tariff.tone-2 { background: radial-gradient(95% 72% at 45% -8%, #ffd63c 0%, rgb(214 160 8 / .8) 34%, transparent 72%), radial-gradient(80% 65% at 100% 78%, rgb(214 160 8 / .65), transparent 72%), radial-gradient(75% 60% at 0% 80%, rgb(122 90 4 / .95), transparent 74%), var(--night); }
/* зерно поверх градиента */
.tariff::after { content: ''; position: absolute; inset: 0; z-index: -1; background: url('/grain.png'); opacity: .45; pointer-events: none; }
/* затемнение снизу, чтобы текст читался на любом участке */
.tariff::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 25%, rgb(11 10 7 / .3) 52%, rgb(11 10 7 / .6)); }
button.tariff:hover { border-color: var(--gold-bright); transform: translateY(-4px); box-shadow: 0 22px 44px rgb(122 90 4 / .3); }
.tariff .kind { padding: 5px 14px; border-radius: 99px; background: rgb(11 10 7 / .6); border: 1px solid rgb(255 214 60 / .45); color: var(--gold-bright); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.tariff b { margin-top: auto; padding-top: 52px; font-size: 44px; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; text-shadow: 0 2px 12px rgb(0 0 0 / .45); }
.tariff h3 { margin: 0; min-height: 2.6em; font-size: 17px; line-height: 1.3; text-shadow: 0 1px 8px rgb(0 0 0 / .5); }
.tariff .facts { display: flex; flex-wrap: wrap; gap: 6px 18px; width: 100%; padding-top: 14px; border-top: 1px solid rgb(255 255 255 / .18); font-size: 13px; color: #fff4cc; text-shadow: 0 1px 6px rgb(0 0 0 / .6); }
.tariff .facts strong { color: #fff; }
.tariff .more { padding: 7px 16px; border-radius: 99px; background: rgb(11 10 7 / .65); font-size: 13px; font-weight: 600; color: var(--gold-bright); }

/* золотые акценты: немного, только там, где нужен взгляд */
:root { --select: var(--gold); }
:root[data-theme="dark"] { --select: var(--gold-bright); }
h1 { position: relative; }
.title h1::after { content: ''; position: absolute; left: 0; bottom: -4px; width: 28px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--gold-bright), var(--gold)); }
aside nav a.on svg { color: var(--gold-bright); }
aside nav a.on { box-shadow: inset 0 -2px 0 var(--gold), 0 2px 6px rgb(30 32 36 / .2); }
.tabs button.on { border-color: var(--gold); box-shadow: inset 0 -2px 0 var(--gold); }
:focus-visible { outline-color: var(--gold); }
button.member:hover { border-color: var(--gold); }
.timetable td.planned button.add { border-color: var(--gold); }
.grid.groups h2.number::after { content: ''; display: block; width: 22px; height: 3px; margin-top: 3px; border-radius: 3px; background: var(--gold); }

@media (max-width: 760px) { .tariff { min-height: 280px; } .tariff b { font-size: 36px; } }

.help { margin: 0 16px; padding: 8px 12px; border-radius: 10px; border-left: 3px solid var(--gold); background: var(--card); font-size: 13px; color: var(--muted); }
.help b { color: var(--text); }

/* карточки месяцев: сплошные цвета, без градиентов */
.months { flex: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; padding-bottom: 24px; }
button.month { display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 20px 22px 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); text-align: left; transition: border-color .2s, transform .15s, box-shadow .2s; }
button.month:hover { border-color: var(--gold); transform: translateY(-3px); box-shadow: 0 12px 28px rgb(24 25 28 / .1); }
.month-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.month .date { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; width: 50px; height: 50px; border-radius: 14px; background: var(--accent-soft); line-height: 1.1; }
.month .date b { font-size: 18px; }
.month .date small { font-size: 10px; color: var(--muted); }
.month.now .date { background: var(--gold); color: #17140a; }
.month.now .date small { color: #17140a; }
.month .name { flex: 1; font-size: 17px; font-weight: 700; }
.month .tag { padding: 2px 10px; border: 1px solid var(--gold); border-radius: 99px; font-size: 11px; color: var(--muted); }
.month .label { font-size: 12px; color: var(--muted); }
.month .amount { margin-top: -8px; font-size: 32px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.month progress { width: 100%; height: 6px; border: 0; border-radius: 99px; overflow: hidden; background: var(--accent-soft); -webkit-appearance: none; appearance: none; }
.month progress::-webkit-progress-bar { background: var(--accent-soft); }
.month progress::-webkit-progress-value { background: var(--gold); border-radius: 99px; }
.month progress::-moz-progress-bar { background: var(--gold); }
.month .facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.month .facts span { display: flex; flex-direction: column; font-size: 11px; color: var(--muted); }
.month .facts strong { font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.month .open { align-self: flex-end; font-size: 12px; font-weight: 600; color: var(--muted); }
button.month:hover .open { color: var(--text); }

/* воздух между заголовком, фильтрами и таблицей */
main:not(.narrow) { gap: 14px; padding-top: 18px; }
.sheet { margin: 4px 16px 14px; border: 1px solid var(--grid); border-radius: 12px; background: var(--card); }
@media (max-width: 760px) { .sheet { margin: 0 8px 8px; } }

/* ---------- студия бренда ---------- */
main.studio > * { flex: none; width: min(100% - 40px, 1120px); margin-left: auto; margin-right: auto; }
.amber { position: relative; isolation: isolate; overflow: hidden; color: #fff; background: #0b0a07; }
.amber::after { content: ''; position: absolute; inset: 0; z-index: -1; background: url('/grain.png'); opacity: .42; pointer-events: none; }
.amber.tone-corner { background: radial-gradient(85% 90% at 98% 0%, rgb(255 214 60 / .8), transparent 68%), radial-gradient(70% 90% at 0% 100%, rgb(122 90 4 / .95), transparent 70%), #0b0a07; }
.amber.tone-wave { background: radial-gradient(75% 90% at 0% 0%, rgb(214 160 8 / .85), transparent 68%), radial-gradient(80% 90% at 100% 100%, rgb(255 214 60 / .75), transparent 66%), #0b0a07; }
.amber.tone-calm { background: radial-gradient(80% 90% at 100% 0%, rgb(122 90 4 / .95), transparent 72%), radial-gradient(60% 80% at 0% 100%, rgb(122 90 4 / .55), transparent 70%), #0b0a07; }
.hero { padding: 40px 40px 36px; border-radius: 26px; }
.hero img { display: block; width: 150px; height: auto; }
.hero .headline { margin-top: 28px; font-size: clamp(30px, 4.6vw, 58px); font-weight: 900; font-style: italic; line-height: 1.05; letter-spacing: -.02em; }
.hero .headline em { color: #ffd63c; }
.hero p { max-width: 56ch; margin: 14px 0 0; color: #fff4cc; font-size: 16px; }
.filters { position: sticky; top: -18px; z-index: 4; padding: 10px 0; background: var(--bg); }
.shelf { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.shelf h2 { font-size: 28px; font-weight: 900; font-style: italic; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
button.tpl { display: flex; flex-direction: column; gap: 8px; padding: 12px 12px 16px; border-radius: 20px; background: var(--card); text-align: left; }
button.tpl:hover { border-color: var(--gold); transform: translateY(-3px); box-shadow: 0 14px 30px rgb(24 25 28 / .14); }
.shot { display: grid; place-items: center; height: 320px; border-radius: 14px; background: var(--accent-soft); }
.shot canvas { border-radius: 8px; box-shadow: 0 8px 22px rgb(0 0 0 / .22); }
.shot.post canvas { width: 224px; height: 280px; }
.shot.story canvas { width: 163px; height: 290px; }
button.tpl b { padding: 4px 6px 0; font-size: 16px; }
button.tpl > .sub { padding: 0 6px; min-height: 2.9em; }
.meta { display: flex; gap: 6px; padding: 0 6px; }
.meta span { padding: 3px 10px; border-radius: 99px; background: var(--accent-soft); font-size: 11px; color: var(--muted); }
.covers, .logos { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.covers { padding-bottom: 8px; }
.covers figure, .logos figure { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 0; }
.covers img { width: 150px; height: 150px; border-radius: 50%; }
.chip { padding: 6px 14px; border: 1px solid var(--line); border-radius: 99px; background: var(--card); color: var(--text); font-size: 12px; font-weight: 600; text-decoration: none; }
.chip:hover { border-color: var(--gold); }
.card.block { padding: 24px; border-radius: 20px; }
.card.block h2 { font-size: 18px; }
.card.block > p { margin: 4px 0 18px; }
.plate { display: grid; place-items: center; width: 100%; height: 160px; border-radius: 16px; border: 1px solid var(--line); }
.plate.night { background: #0b0a07; }
.plate.light { background: #fff; }
.plate img { width: 70%; max-width: 230px; height: auto; }
.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-top: 18px; }
.rules div { display: flex; flex-direction: column; padding: 14px 16px; border-radius: 14px; background: var(--accent-soft); }
.rules b { font-size: 18px; }
.rules span { font-size: 12px; color: var(--muted); }
.swatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.swatches > div { display: flex; align-items: flex-end; height: 190px; padding: 16px; border-radius: 16px; }
.colours { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
button.colour { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 0 0 10px; overflow: hidden; border-radius: 14px; text-align: left; }
button.colour b, button.colour code { padding: 0 12px; }
button.colour code { font-size: 11px; color: var(--muted); }
button.colour[data-copied]::after { content: attr(data-copied); position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: 8px; background: #000; color: #fff; font-size: 11px; }
.paint { display: block; width: 100%; height: 80px; margin-bottom: 8px; }
.c-0b0a07 { background: #0b0a07; } .c-d6a008 { background: #d6a008; } .c-ffd63c { background: #ffd63c; } .c-7a5a04 { background: #7a5a04; } .c-3a3d42 { background: #3a3d42; } .c-f6f6f7 { background: #f6f6f7; } .c-ffffff { background: #fff; }
.type { display: flex; flex-direction: column; gap: 4px; font-family: Montserrat, -apple-system, "Segoe UI", sans-serif; }
.type .big { font-size: 38px; font-weight: 900; font-style: italic; line-height: 1.1; }
.type .mid { margin-top: 18px; font-size: 22px; font-weight: 700; }
.type > .sub { margin-bottom: 14px; }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; padding-bottom: 24px; }
.stage { display: grid; place-items: center; padding: 20px; border-radius: 20px; background: var(--accent-soft); }
.stage canvas { width: 100%; height: auto; max-width: 480px; border-radius: 10px; box-shadow: 0 18px 44px rgb(0 0 0 / .28); }
.stage.story canvas { max-width: 360px; }
.panel { display: flex; flex-direction: column; gap: 12px; border-radius: 18px; }
@media (max-width: 1000px) { .editor { grid-template-columns: minmax(0, 1fr); } .hero { padding: 26px 22px; } }

.badge { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: 12px; white-space: nowrap; background: var(--line); }
.badge.ok { background: var(--accent-soft); color: var(--accent); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.empty { padding: 24px; text-align: center; color: var(--muted); }
.grid { flex: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sub { color: var(--muted); font-size: 12px; }
.timetable { flex: none; margin: 0 16px; overflow-x: auto; border: 1px solid var(--grid); border-radius: 10px; }
.timetable table { width: 100%; min-width: 760px; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
.timetable th, .timetable td { border: 1px solid var(--grid); padding: 4px; text-align: center; vertical-align: middle; }
.timetable thead th, .timetable tbody th { background: var(--bar); font-weight: 600; }
.timetable th:first-child { width: 68px; }
.slot { display: block; width: 100%; margin: 2px 0; padding: 5px 4px; background: var(--accent-soft); border: 0; font-size: 12px; }
.grid.groups { flex: none; padding-bottom: 16px; }
.grid.groups section { display: flex; flex-direction: column; gap: 8px; }
.grid.groups h2.number { font-size: 18px; color: var(--accent); }
.grid.groups h3 { margin: 0; font-size: 14px; }
.grid.groups ol { margin: 0; padding-left: 22px; line-height: 1.8; }
.grid.groups p { margin: 0; }
.grid.groups .toolbar { margin-top: auto; }

dialog { border: 1px solid var(--line); border-radius: 16px; padding: 0; width: min(560px, calc(100vw - 24px)); background: var(--card); color: var(--text); }
dialog::backdrop { background: rgb(0 0 0 / .4); }
dialog { max-height: 90vh; }
dialog form { padding: 20px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
label { display: block; font-size: 12px; color: var(--muted); }
label > input, label > select, label > textarea { margin-top: 4px; font-size: 14px; color: var(--text); }
.wide { grid-column: 1 / -1; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.checks label { display: flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; color: var(--text); }
.checks input, td input[type=checkbox] { width: auto; }
.actions { display: flex; gap: 8px; justify-content: flex-end; }
.actions .left { margin-right: auto; }
.error { color: var(--bad); min-height: 1.4em; margin: 6px 0; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login form { width: min(340px, 100%); padding: 28px; }
.login form > * + * { margin-top: 12px; }
.login button { width: 100%; }

/* панель посвободнее */
.shell { grid-template-columns: 256px minmax(0, 1fr); }
aside nav a { gap: 11px; padding: 8px 12px; font-size: 13.5px; white-space: nowrap; }
aside svg { width: 18px; height: 18px; }
aside .group { margin-top: 8px; }
aside button.category { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; margin-bottom: 2px; padding: 9px 12px; border: 0; border-radius: 10px; background: none; font-size: 12px; font-weight: 600; color: var(--muted); text-align: left; }
aside button.category:hover { background: var(--accent-soft); color: var(--text); }
aside button.category svg { transition: transform .2s; transform: rotate(-90deg); }
aside .group.open button.category svg { transform: none; }
aside .group:not(.open):not(.bottom) a { display: none; }
aside .group.bottom { border-top: 1px solid var(--line); }

/* страницы из карточек: по центру, а не по краям экрана */
main.narrow { padding-top: 22px; gap: 16px; }
main.narrow > * { width: min(100% - 40px, 920px); margin-left: auto; margin-right: auto; }

/* команда */
.roles { display: flex; flex-direction: column; gap: 14px; padding-bottom: 24px; }
.card.role { padding: 18px 20px; border-radius: 16px; }
.role-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.role-head button { flex: none; }
.person { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 8px; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; text-align: left; }
button.person:hover { background: var(--accent-soft); }
.person .avatar { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); font-weight: 600; }
.person .who { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.person .edit { font-size: 12px; color: var(--muted); }
.role .none { padding: 10px 8px 2px; border-top: 1px solid var(--line); }

/* панель можно скрыть */
.shell { grid-template-columns: 292px minmax(0, 1fr); grid-template-areas: none; position: relative; }
.shell aside { grid-column: 1; grid-row: 1; min-width: 0; overflow: hidden; transition: opacity .25s, transform .35s cubic-bezier(.2, .8, .2, 1), visibility .35s; }
.shell main { grid-column: 2; grid-row: 1; }
.shell.collapsed { grid-template-columns: 0 minmax(0, 1fr); }
.shell.collapsed aside { position: absolute; width: 264px; top: 0; bottom: 0; left: 0; opacity: 0; visibility: hidden; transform: translateX(-110%); pointer-events: none; }
.shell.collapsed main { padding-left: 48px; }
aside .brand { position: relative; }
.hide-panel { position: absolute; top: -8px; right: -2px; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--muted); }
.hide-panel:hover { background: var(--accent-soft); color: var(--text); }
.reopen { position: absolute; z-index: 5; top: 12px; left: 10px; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border-radius: 12px; box-shadow: 0 4px 14px rgb(24 25 28 / .12); opacity: 0; visibility: hidden; transform: translateX(-12px); transition: opacity .25s, transform .3s, visibility .3s; }
.shell.collapsed .reopen { opacity: 1; visibility: visible; transform: none; transition-delay: .15s; }
.reopen svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hide-panel svg { width: 18px; height: 18px; }

aside nav a, aside nav a.on { white-space: normal; line-height: 1.3; font-size: 13px; font-weight: 500; gap: 10px; padding: 8px 11px; min-height: 36px; }
main { scrollbar-gutter: stable; }
aside nav a span { min-width: 0; overflow-wrap: anywhere; }

/* мягкие переходы */
main.fade > * { animation: appear .26s ease-out both; }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }
aside .group.reveal a { animation: soft-in .3s ease-out both; }
dialog[open] { animation: soft-in .25s ease-out; }
button, nav a, button.card, .slot { transition: background-color .2s, color .2s, border-color .2s, box-shadow .2s, transform .15s; }
@keyframes soft-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 760px) {
  .shell, .shell.collapsed { grid-template-columns: minmax(0, 1fr); }
  .shell aside { grid-column: 1; grid-row: 1; }
  .shell main { grid-column: 1; grid-row: 2; }
  .shell.collapsed { grid-template-rows: 0 minmax(0, 1fr); }
  .shell.collapsed main { padding-left: 0; padding-top: 56px; }
  aside button.category { display: none; }
  aside .group:not(.open):not(.bottom) a { display: flex; }
  aside .group.bottom { border-top: 0; }
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  aside { margin: 6px; padding: 10px; border-radius: 16px; }
  aside .brand { font-size: 17px; }
  aside nav { display: flex; flex-direction: row; gap: 4px; flex: none; }
  aside .group.bottom { margin: 0; padding: 0; }
  aside .group { margin: 0; display: flex; gap: 4px; }
  aside h3 { display: none; }
  aside nav a { white-space: nowrap; margin: 0; }
  aside footer { margin-top: 6px; padding-top: 6px; }
  .fields { grid-template-columns: 1fr; }
  .toolbar input[type=search] { width: 100%; }
}
