/* ProFolio — интерфейс платформы. */
:root {
  --paper: #F5F6F4;
  --surface: #FFFFFF;
  --ink: #171A21;
  --graphite: #5B6170;
  --line: #DADDE2;
  --blue: #1D4E9E;
  --blue-deep: #163D7C;
  --blue-wash: #E6EDF8;
  --ishkor: #2E9C99;
  --ishkor-wash: #E2F3F2;
  --danger: #B4362C;
  --display: "Unbounded", system-ui, sans-serif;
  --text: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 16px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 16px/1.55 var(--text); color: var(--ink); background: var(--paper); }
img { max-width: 100%; display: block; }
a { color: var(--blue); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(28px, 4vw, 40px); }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
p { margin: 0 0 1em; }
small, .muted { color: var(--graphite); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Кнопки и поля ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 500 15px/1 var(--text); padding: 13px 20px; border-radius: var(--r);
  border: 1px solid transparent; background: var(--blue); color: #fff; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: background .15s;
}
.btn:hover { background: var(--blue-deep); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface); border-color: var(--graphite); }
.btn.danger { background: transparent; color: var(--danger); border-color: #E8C4C0; }
.btn.danger:hover { background: #FBEFEE; }
.btn.small { padding: 9px 14px; font-size: 14px; }
.btn.wide { width: 100%; }
button.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--graphite); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

label { display: block; font-weight: 500; font-size: 14px; margin-bottom: 6px; }
.field { margin-bottom: 18px; }
.field small { display: block; margin-top: 6px; font-size: 13px; line-height: 1.45; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number],
input[type=tel], input[type=url], select, textarea {
  width: 100%; font: 400 15px/1.4 var(--text); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); padding: 11px 13px;
}
textarea { min-height: 96px; resize: vertical; }
/* iPhone увеличивает страницу при фокусе на поле со шрифтом меньше 16px */
@media (max-width: 820px) {
  input[type=text], input[type=email], input[type=password], input[type=date], input[type=number],
  input[type=tel], input[type=url], select, textarea, .lr input { font-size: 16px; }
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-wash); }
input[type=color] { width: 52px; height: 42px; padding: 3px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 15px; margin-bottom: 12px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--blue); flex: none; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .row2 { grid-template-columns: 1fr; } }

.alert { padding: 12px 14px; border-radius: var(--r); margin-bottom: 18px; font-size: 15px; }
.alert.err { background: #FBEFEE; color: #8A2A22; }
.alert.ok { background: var(--ishkor-wash); color: #1C6765; }

/* ---------- Лендинг ---------- */
.land-top { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1180px; margin: 0 auto; padding: 22px 24px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none;
  font: 700 19px/1 var(--display); letter-spacing: -0.02em; }
.logo .mark { width: 28px; height: 28px; color: var(--blue); }
/* Логотип ProFolio: уголки видоискателя + PRO folio */
.pf-logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.pf-mark { position: relative; width: 30px; height: 30px; flex: none; }
.pf-mark i { position: absolute; width: 9px; height: 9px; border: 2.5px solid currentColor; }
.pf-mark i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; }
.pf-mark i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; }
.pf-mark i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; }
.pf-mark i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; }
.pf-mark em { position: absolute; inset: 0; display: grid; place-items: center; font: 900 13px/1 Montserrat, sans-serif; font-style: normal; }
.pf-word { font: 200 22px/1 Montserrat, sans-serif; letter-spacing: -.01em; white-space: nowrap; }
.pf-word b { font-weight: 900; font-size: 19px; letter-spacing: .06em; margin-right: 3px; }
.land-nav { display: flex; align-items: center; gap: 26px; }
.land-nav a { color: var(--ink); text-decoration: none; font-size: 15px; }
.land-nav a:hover { color: var(--blue); }
.land-nav .langs { display: flex; gap: 2px; }
.langs a { font-size: 13px; padding: 4px 7px; border-radius: 6px; color: var(--graphite); text-decoration: none; }
.langs a[aria-current] { background: var(--ink); color: #fff; }
@media (max-width: 820px) { .land-nav .hide-m { display: none; } .land-nav { gap: 14px; } }

.hero { max-width: 1180px; margin: 0 auto; padding: 40px 24px 0; display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(36px, 5.4vw, 68px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.02; margin-bottom: 24px; }
.hero .lead { font-size: 19px; color: #3A3F4B; max-width: 34em; margin-bottom: 28px; }
.hero .cta-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero .note { margin-top: 14px; font-size: 14px; color: var(--graphite); }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; gap: 36px; padding-top: 16px; } }

/* Демонстрация: экран телефона с галереей и отбором */
.demo { position: relative; aspect-ratio: 6 / 5; }
.demo-sheet { position: absolute; inset: 0 14% 8% 0; background: var(--surface); border-radius: var(--r-lg);
  border: 1px solid var(--line); padding: 18px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.demo-head { display: flex; justify-content: space-between; align-items: baseline; }
.demo-head b { font: 500 15px/1.2 var(--display); }
.demo-head span { font-size: 12px; color: var(--graphite); }
.demo-grid { flex: 1; display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; grid-template-rows: 1fr 1fr; gap: 6px; }
.demo-grid i { border-radius: var(--r-sm); position: relative; background-size: cover; background-position: center; }
.demo-grid i:nth-child(1) { grid-row: span 2; }
.demo-grid i.on::after { content: ""; position: absolute; right: 7px; top: 7px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--ishkor) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 20s-7-4.4-7-9.6A3.9 3.9 0 0 1 12 8a3.9 3.9 0 0 1 7 2.4C19 15.6 12 20 12 20z' fill='%23fff'/%3E%3C/svg%3E") center/14px no-repeat; }
.demo-phone { position: absolute; right: 0; bottom: 0; width: 38%; aspect-ratio: 9 / 18; background: var(--ink);
  border-radius: 26px; padding: 8px; box-shadow: 0 30px 60px -30px rgba(23, 26, 33, .55); }
.demo-phone .scr { height: 100%; border-radius: 19px; background: #fff; overflow: hidden; display: flex; flex-direction: column; }
.demo-phone .scr .pscr { flex: 1; background-size: cover; background-position: center; }
.demo-phone .scr .bar { padding: 10px 12px 14px; font-size: 11px; line-height: 1.35; }
.demo-phone .scr .bar b { display: block; font-size: 12px; margin-bottom: 6px; }
.demo-phone .scr .send { display: block; text-align: center; background: var(--blue); color: #fff; border-radius: 8px; padding: 7px; font-weight: 500; }
/* Фотографии в демо — нейтральные градиенты-«плёнки», без чужих снимков */
.f1 { background-image: linear-gradient(160deg, #C9B79C 0%, #8D6E55 55%, #3E2F27 100%); }
.f2 { background-image: linear-gradient(200deg, #A9C2D6 0%, #5E7F9C 60%, #2C3A4D 100%); }
.f3 { background-image: linear-gradient(140deg, #E4D7C5 0%, #B79B83 70%, #6B5546 100%); }
.f4 { background-image: linear-gradient(180deg, #9FB8A5 0%, #557563 70%, #2A3C33 100%); }
.f5 { background-image: linear-gradient(120deg, #D7C9D6 0%, #92788F 65%, #4A3A4B 100%); }
.f6 { background-image: linear-gradient(170deg, #E9E2D3 0%, #C2A57E 50%, #6E5233 100%); }

.section { max-width: 1180px; margin: 0 auto; padding: 110px 24px 0; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.split h2 { font-size: clamp(26px, 3.2vw, 38px); font-weight: 700; letter-spacing: -0.025em; }
.split p { font-size: 17px; color: #3A3F4B; max-width: 34em; }
.ticks { list-style: none; padding: 0; margin: 22px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; }
.ticks li { padding-left: 26px; position: relative; font-size: 15px; }
.ticks li::before { content: ""; position: absolute; left: 0; top: .45em; width: 14px; height: 8px; border-left: 2px solid var(--ishkor); border-bottom: 2px solid var(--ishkor); transform: rotate(-45deg); }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; gap: 28px; } .ticks { grid-template-columns: 1fr; } }

/* Схема блоков сайта */
.blocks-demo { display: grid; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; }
.blocks-demo div { border-radius: var(--r-sm); padding: 12px 14px; font-size: 13px; color: var(--graphite); background: var(--paper); display: flex; justify-content: space-between; }
.blocks-demo .bd-hero { height: 128px; color: #fff; align-items: flex-end; background: linear-gradient(160deg, #C9B79C, #3E2F27); font: 500 16px/1.2 var(--display); }
.blocks-demo .bd-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0; background: none; }
.blocks-demo .bd-grid i { aspect-ratio: 4/5; border-radius: var(--r-sm); }
.blocks-demo b { color: var(--ink); font-weight: 500; }

/* Последовательность съёмки — это реальный порядок шагов */
.flow { list-style: none; padding: 0; margin: 28px 0 0; counter-reset: s; display: grid; grid-template-columns: repeat(5, 1fr); border-top: 2px solid var(--ink); }
.flow li { counter-increment: s; padding: 18px 18px 0 0; font-size: 15px; line-height: 1.45; }
.flow li::before { content: counter(s); display: block; font: 700 30px/1 var(--display); color: var(--blue); margin-bottom: 12px; }
@media (max-width: 900px) { .flow { grid-template-columns: 1fr; border-top: 0; } .flow li { border-top: 1px solid var(--line); padding: 16px 0; display: grid; grid-template-columns: 44px 1fr; } .flow li::before { margin: 0; font-size: 22px; } }

.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 28px; max-width: 860px; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; }
.plan.pro { background: var(--ink); color: #fff; border-color: var(--ink); }
.plan h3 { font-size: 18px; margin-bottom: 6px; }
.plan .price { font: 700 26px/1.2 var(--display); letter-spacing: -0.02em; margin-bottom: 18px; }
.plan ul { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 8px; font-size: 15px; }
.plan.pro .btn { background: #fff; color: var(--ink); }
.plan.pro .btn:hover { background: var(--blue-wash); }
@media (max-width: 720px) { .plans { grid-template-columns: 1fr; } }

.land-foot { max-width: 1180px; margin: 110px auto 0; padding: 28px 24px 40px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 16px; font-size: 14px; color: var(--graphite); flex-wrap: wrap; }

/* ---------- Вход / регистрация ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 40px 16px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .logo { margin-bottom: 36px; }
.auth-card h1 { font-size: 28px; margin-bottom: 24px; }
.auth-card .alt { margin-top: 20px; font-size: 15px; color: var(--graphite); }
.slug-input { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.slug-input input { border: 0; border-radius: 0; min-width: 0; }
.slug-input input:focus { box-shadow: none; }
.slug-input:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-wash); }
.slug-input span { padding: 11px 13px 11px 0; color: var(--graphite); white-space: nowrap; font-size: 15px; align-self: center; }

/* ---------- Кабинет ---------- */
body.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh;
  background: linear-gradient(to right, var(--surface) 235px, var(--line) 235px, var(--line) 236px, var(--paper) 236px); }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 22px 16px; display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100vh; }
.side .logo { padding: 0 8px; }
.side-nav { display: grid; gap: 2px; }
.side-nav a { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: var(--r); color: var(--ink); text-decoration: none; font-weight: 500; font-size: 15px; }
.side-nav a:hover { background: var(--paper); }
.side-nav a[aria-current] { background: var(--blue-wash); color: var(--blue-deep); }
.count { background: var(--blue); color: #fff; border-radius: 10px; font-size: 12px; padding: 1px 7px; }
.side-foot { margin-top: auto; display: grid; gap: 16px; padding: 0 8px; }
.meter-bar { height: 5px; border-radius: 3px; background: var(--paper); overflow: hidden; margin-bottom: 6px; }
.meter-bar span { display: block; height: 100%; background: var(--ishkor); }
.meter small { font-size: 12px; }
.side-row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.side-row form { margin: 0; }
.main { padding: 32px clamp(16px, 3.5vw, 44px) 80px; max-width: 1240px; width: 100%; }
@media (max-width: 860px) {
  /* minmax(0, …) — иначе длинная строка меню растягивает страницу шире экрана */
  body.app { grid-template-columns: minmax(0, 1fr); background: var(--paper); }
  .side { min-width: 0; position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-nav { display: flex; overflow-x: auto; order: 3; width: 100%; min-width: 0; -webkit-overflow-scrolling: touch; }
  .side-nav a { white-space: nowrap; gap: 6px; }
  .side-foot { margin: 0 0 0 auto; display: flex; padding: 0; }
  .side-foot .meter { display: none; }
  .side-row { gap: 12px; }
  .main { padding-top: 22px; }
}

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head h1 { margin: 0; font-size: 30px; }
.page-head .sub { color: var(--graphite); margin-top: 6px; font-size: 15px; }
.crumb { font-size: 14px; color: var(--graphite); text-decoration: none; display: inline-block; margin-bottom: 10px; }
.crumb:hover { color: var(--blue); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; margin-bottom: 20px; }
.panel h2 { font-size: 18px; margin-bottom: 16px; }

/* Список галерей */
.g-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 24px 20px; }
.g-card { text-decoration: none; color: inherit; display: block; }
.g-card .cov { aspect-ratio: 4 / 3; border-radius: var(--r); background: #E7E9EC center/cover no-repeat; margin-bottom: 12px; position: relative; overflow: hidden; }
.g-card .cov.empty { display: grid; place-items: center; color: var(--graphite); font-size: 13px; border: 1px dashed var(--line); background: var(--surface); }
.g-card:hover .cov { outline: 2px solid var(--blue); outline-offset: 2px; }
.g-card h3 { font: 500 16px/1.3 var(--text); margin: 0 0 4px; }
.g-card .meta { font-size: 13px; color: var(--graphite); display: flex; gap: 12px; flex-wrap: wrap; }
.tag { position: absolute; left: 10px; top: 10px; background: rgba(23, 26, 33, .78); color: #fff; font-size: 12px; padding: 3px 9px; border-radius: 20px; }
.tag + .tag { left: auto; right: 10px; }

.new-g { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 12px; align-items: end; }
.new-g .field { margin: 0; }
@media (max-width: 900px) { .new-g { grid-template-columns: 1fr 1fr; } .new-g .field:first-child { grid-column: span 2; } }

.empty-state { padding: 48px 24px; text-align: center; border: 1px dashed var(--line); border-radius: var(--r-lg); color: var(--graphite); max-width: 640px; margin: 0 auto; }

/* Вкладки */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--graphite); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; white-space: nowrap; }
.tabs a[aria-current] { color: var(--ink); border-color: var(--ink); }

.linkbox { display: flex; gap: 8px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 6px 6px 14px; max-width: 560px; }
.linkbox code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 14px/1.4 var(--text); color: var(--ink); }

/* Загрузка */
.drop { border: 1.5px dashed #B9BFC9; border-radius: var(--r-lg); padding: 30px 20px; text-align: center; color: var(--graphite); cursor: pointer; background: var(--surface); transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--blue); background: var(--blue-wash); color: var(--blue-deep); }
.drop b { display: block; color: var(--ink); font-weight: 500; margin-bottom: 4px; }
.progress { margin-top: 14px; display: none; }
.progress.on { display: block; }
.progress .bar { height: 6px; background: var(--paper); border-radius: 3px; overflow: hidden; }
.progress .bar span { display: block; height: 100%; width: 0; background: var(--blue); transition: width .2s; }
.progress small { display: block; margin-top: 6px; }

.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 20px; }
.ph { position: relative; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; background: #E7E9EC; cursor: grab; }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph.dragging { opacity: .4; }
.ph .ph-tools { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; gap: 4px; padding: 6px; background: linear-gradient(transparent, rgba(0,0,0,.6)); opacity: 0; transition: opacity .15s; }
.ph:hover .ph-tools, .ph:focus-within .ph-tools { opacity: 1; }
.ph-tools button { background: rgba(255,255,255,.92); border: 0; border-radius: 6px; font: 500 12px/1 var(--text); padding: 6px 8px; cursor: pointer; color: var(--ink); }
.ph-tools button.del { color: var(--danger); }
.ph .is-hidden { position: absolute; right: 6px; top: 6px; background: var(--danger); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.ph .is-cover { position: absolute; left: 6px; top: 6px; background: var(--ishkor); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.ph .name { position: absolute; left: 6px; top: 6px; font-size: 11px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); max-width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: none; }
@media (hover: none) { .ph .ph-tools { opacity: 1; } }

/* Отборы */
.sel { border-top: 1px solid var(--line); padding: 20px 0; }
.sel:first-child { border-top: 0; padding-top: 0; }
.sel-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.sel-head b { font-size: 17px; }
.sel-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; margin: 12px 0; }
.sel-thumbs figure { margin: 0; }
.sel-thumbs img { aspect-ratio: 1; object-fit: cover; border-radius: var(--r-sm); width: 100%; }
.sel-thumbs figcaption { font-size: 11px; color: var(--graphite); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; }
.sel-thumbs .cm { font-size: 12px; color: var(--ink); background: var(--ishkor-wash); border-radius: 4px; padding: 3px 5px; margin-top: 3px; white-space: normal; }
.lr { display: flex; gap: 8px; }
.lr input { font-size: 13px; }

/* Таблица заявок */
.inq { display: grid; gap: 12px; }
.inq-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; display: grid; grid-template-columns: 1fr auto; gap: 8px 20px; }
.inq-item.new { border-left: 4px solid var(--blue); }
.inq-item h3 { font: 500 17px/1.3 var(--text); margin: 0; }
.inq-item .when { font-size: 13px; color: var(--graphite); }
.inq-item p { grid-column: 1 / -1; margin: 0; white-space: pre-wrap; }
.inq-item .acts { display: flex; gap: 8px; grid-column: 1 / -1; }
.inq-item .acts form { margin: 0; }

/* Сайт: страницы */
.pages-list { display: grid; gap: 8px; }
.page-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.page-row a.t { flex: 1; color: var(--ink); text-decoration: none; font-weight: 500; }
.page-row a.t:hover { color: var(--blue); }
.page-row .u { color: var(--graphite); font-size: 13px; }
.page-row form { margin: 0; }
.icon-btn { width: 32px; height: 32px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; color: var(--graphite); }
.icon-btn:hover { color: var(--ink); border-color: var(--graphite); }
.icon-btn svg { width: 14px; height: 14px; }
.site-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; align-items: start; }
@media (max-width: 1000px) { .site-grid { grid-template-columns: 1fr; } }
.theme-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-pick label { border: 1px solid var(--line); border-radius: var(--r); padding: 10px; cursor: pointer; font-weight: 400; margin: 0; }
.theme-pick input { position: absolute; opacity: 0; }
.theme-pick label:has(input:checked) { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-wash); }
.theme-pick label:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
.sw { height: 42px; border-radius: 6px; margin-bottom: 8px; display: flex; align-items: flex-end; padding: 6px; gap: 4px; }
.sw i { width: 30%; height: 60%; border-radius: 3px; }
.sw-svet { background: #FBFBF9; border: 1px solid var(--line); } .sw-svet i { background: #D9D4CB; }
.sw-noch { background: #16171B; } .sw-noch i { background: #3B3E46; }
.sw-galereya { background: #EDEBE6; } .sw-galereya i { background: #FFFFFF; }
.fp { font-size: 22px; line-height: 1; margin-bottom: 6px; }
.fp-klassika { font-family: "Cormorant Garamond", Georgia, serif; }
.fp-grotesk { font-family: "Unbounded", sans-serif; font-size: 18px; }
.fp-minimal { font-family: "Manrope", sans-serif; font-weight: 600; }

/* Редактор блоков */
.editor { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.blk { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.blk > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; }
.blk > summary::-webkit-details-marker { display: none; }
.blk > summary .bt { font-weight: 500; }
.blk > summary .bp { color: var(--graphite); font-size: 14px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blk > summary .chev { width: 16px; height: 16px; color: var(--graphite); transition: transform .15s; flex: none; }
.blk[open] > summary .chev { transform: rotate(90deg); }
.blk[open] > summary { border-bottom: 1px solid var(--line); }
.blk-body { padding: 18px 16px 16px; }
.blk-tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.blk-tools form { margin: 0; }
.blk-tools .spacer { flex: 1; }
.add-blk { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.add-blk select { width: auto; min-width: 240px; }

.img-pick { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; }
.img-pick label { margin: 0; flex: none; cursor: pointer; }
.img-pick input { position: absolute; opacity: 0; }
.img-pick .opt { width: 92px; height: 70px; border-radius: var(--r-sm); background: var(--paper) center/cover no-repeat; border: 2px solid transparent; display: grid; place-items: center; font-size: 12px; color: var(--graphite); font-weight: 400; text-align: center; }
.img-pick input:checked + .opt { border-color: var(--blue); }
.img-pick input:focus-visible + .opt { outline: 2px solid var(--blue); outline-offset: 2px; }
.img-pick .up { border: 1px dashed var(--line); background: var(--surface); }

/* Тост */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: var(--r); font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.err-page { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 24px; }
.err-page b { font: 700 72px/1 var(--display); color: var(--blue); display: block; margin-bottom: 12px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
@media (max-width: 520px) { .new-g { grid-template-columns: 1fr; } .new-g .field:first-child { grid-column: auto; } }

/* ---------- Админ-панель ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; color: inherit; text-decoration: none; display: block; }
a.tile:hover { border-color: var(--blue); }
.tile .tl { display: block; font-size: 14px; color: var(--graphite); margin-bottom: 8px; }
.tile b { display: block; font: 700 30px/1.1 var(--display); letter-spacing: -0.02em; }
.tile small { display: block; margin-top: 6px; font-size: 13px; color: var(--graphite); }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th { text-align: left; font-weight: 500; font-size: 13px; color: var(--graphite); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl a { color: var(--ink); font-weight: 500; text-decoration: none; }
.tbl a:hover { color: var(--blue); text-decoration: underline; }
.panel .tbl th:first-child, .panel .tbl td:first-child { padding-left: 0; }
.panel .tbl th:last-child, .panel .tbl td:last-child { padding-right: 0; }
.panel[style*="padding:0"] .tbl th:first-child, .panel[style*="padding:0"] .tbl td:first-child { padding-left: 20px; }
.panel[style*="padding:0"] .tbl th:last-child, .panel[style*="padding:0"] .tbl td:last-child { padding-right: 20px; }
.pill { display: inline-block; font-size: 12px; font-weight: 500; padding: 1px 8px; border-radius: 10px; background: var(--blue-wash); color: var(--blue-deep); vertical-align: 2px; }
.pill.bad { background: #FBEFEE; color: #8A2A22; }
.filters { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.filters input { flex: 1; min-width: 220px; }
.filters select { width: auto; }
.danger-zone { border-color: #E8C4C0; }
.danger-zone p { color: var(--graphite); max-width: 46em; }
/* Регистрации по дням: один ряд, один цвет, подсказка при наведении */
.bars { display: flex; align-items: flex-end; gap: 2px; height: 140px; border-bottom: 1px solid var(--line); }
.bar-col { flex: 1; height: 100%; display: flex; align-items: flex-end; position: relative; cursor: default; }
.bar-col i { display: block; width: 100%; min-height: 2px; background: var(--blue); border-radius: 4px 4px 0 0; }
.bar-col:hover i, .bar-col:focus i { background: var(--blue-deep); }
.bar-col .tip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 12px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; opacity: 0; pointer-events: none; z-index: 2; }
.bar-col:hover .tip, .bar-col:focus .tip { opacity: 1; }
.bars-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--graphite); margin-top: 6px; }
.imp-bar { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; font-size: 14px; }
.imp-bar form { margin: 0; }
.imp-bar .btn { background: #fff; color: var(--ink); }

/* Карточки выбора темы и шрифтов */
.themes-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.fonts-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.th-card { display: flex; flex-direction: column; gap: 6px; padding: 8px !important; }
.th-mini { display: grid; gap: 6px; padding: 10px; border-radius: 6px; border: 1px solid rgba(0,0,0,.08); height: 118px; align-content: start; overflow: hidden; }
.th-h { font-size: 17px; line-height: 1; }
.th-img { display: block; height: 34px; background: linear-gradient(160deg, #C9B79C, #6E5440); }
.th-lines { display: grid; gap: 4px; } .th-lines i { display: block; height: 3px; width: 100%; border-radius: 2px; }
.th-btn { justify-self: start; font: 500 10px/1 var(--text); padding: 5px 9px; }
.th-mini[style*="text-align:center"] .th-btn { justify-self: center; }
.th-name { font-size: 14px; font-weight: 500; }
.th-pv { font-size: 12px; color: var(--graphite); }
.th-pv:hover { color: var(--blue); }
.fp-sample { font-size: 26px; line-height: 1.1; padding-top: 6px; color: var(--ink); }
.fp-text { font-size: 13px; color: var(--graphite); }

.bg-pick { grid-template-columns: repeat(3, 1fr); }
.bg-sw { display: grid; place-items: center; height: 64px; border-radius: 6px; border: 1px solid rgba(0,0,0,.08); position: relative; overflow: hidden; }
.bg-sw-color input[type=color] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.bg-sw-color::after { content: ""; width: 22px; height: 22px; border-radius: 50%; background: conic-gradient(#E05A47, #E8C547, #5DB37E, #4A8FD9, #9B6CD6, #E05A47); box-shadow: 0 0 0 2px #fff; pointer-events: none; }
.bg-sw-empty { font-size: 12px; color: var(--graphite); background: var(--paper); padding: 6px; text-align: center; line-height: 1.3; }
.th-card:has(input[name=bg_mode]:disabled) { opacity: .7; cursor: default; }
@media (max-width: 520px) { .bg-pick { grid-template-columns: 1fr; } }
.txt-sw b { font: 600 26px/1 var(--display); }
.bg-pick:has(input[name=text_mode]) { grid-template-columns: repeat(2, 1fr); }

/* Telegram */
.tg-box { display: flex; gap: 14px; align-items: flex-start; background: #EAF4FB; border-radius: var(--r-lg); padding: 16px; margin: 4px 0 20px; }
.tg-box svg { width: 28px; height: 28px; color: #229ED9; flex: none; margin-top: 2px; }
.tg-box b { display: block; margin-bottom: 4px; }
.tg-box p { margin: 0; font-size: 14px; color: #33475B; }
.tg-btn { background: #229ED9; margin-top: 12px; }
.tg-btn:hover { background: #1A86BA; }
.file-in { width: 100%; font: 14px var(--text); padding: 10px; border: 1px dashed #B9BFC9; border-radius: var(--r); background: var(--surface); }
/* Уведомления в кабинете */
.notice { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 12px 14px; border-radius: var(--r); margin-bottom: 10px; background: var(--blue-wash); color: var(--blue-deep); font-size: 15px; }
.notice.warn { background: #FFF4E0; color: #7A4A00; }
.notice form { margin: 0; flex: none; }
.notice button { background: none; border: 0; color: inherit; font: 500 14px var(--text); cursor: pointer; text-decoration: underline; padding: 0; }
.plan-chip { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 6px; }
.plan-chip b { font-weight: 600; }

.plans-edit { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; margin-bottom: 18px; }
.plans-edit .panel { margin: 0; }
.aud .check { margin-bottom: 8px; }
