@font-face { font-family: "Golos Text"; font-weight: 400; font-display: swap; src: url("../assets/fonts/golos-text-cyrillic-400-normal.woff2") format("woff2"); unicode-range: U+0400-045F, U+2116; }
@font-face { font-family: "Golos Text"; font-weight: 400; font-display: swap; src: url("../assets/fonts/golos-text-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20BD; }
@font-face { font-family: "Golos Text"; font-weight: 600; font-display: swap; src: url("../assets/fonts/golos-text-cyrillic-600-normal.woff2") format("woff2"); unicode-range: U+0400-045F, U+2116; }
@font-face { font-family: "Golos Text"; font-weight: 600; font-display: swap; src: url("../assets/fonts/golos-text-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20BD; }

:root {
  --bg: #F6F4EF; --card: #fff; --line: #E4DED3; --line-strong: #CFC7B8; --ink: #163A2F; --muted: #5F6C66;
  --red: #B3203A; --gold: #C9A24A; --ok: #2E7D4F; --soft: #F1EEE7;
  --r: 10px; --h: 40px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 14px/1.5 "Golos Text", system-ui, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--ink); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 20px; }
h1 { font-size: 22px; line-height: 1.25; margin: 0 0 16px; }
h2 { font-size: 16px; line-height: 1.3; margin: 0 0 6px; }
p { margin: 0; }
.muted { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-bottom: 14px; }
.err { color: var(--red); font-weight: 600; }

/* кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--h); border: 1px solid var(--ink); border-radius: var(--r); background: var(--ink); color: #fff; padding: 0 18px; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .15s, border-color .15s; }
.btn:hover { background: #0F2A22; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { border-color: var(--ink); background: #fff; }
.btn.small { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.danger { background: #fff; color: var(--red); border-color: #E7C2C9; }
.btn.danger:hover { background: #FBEAED; border-color: var(--red); }
.link { border: 0; background: none; padding: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* поля */
input, select, textarea { min-height: var(--h); border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 12px; background: #fff; min-width: 0; color: var(--ink); font-size: 14px; }
textarea { padding: 9px 12px; }
select { padding-right: 32px; appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23163A2F' stroke-width='1.6' fill='none'/%3E%3C/svg%3E") no-repeat right 12px center; cursor: pointer; }
input::placeholder, textarea::placeholder { color: #98A29D; }
input:hover, select:hover, textarea:hover { border-color: #B5AC9B; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(22, 58, 47, .12); }
input[type="checkbox"] { min-height: 0; width: 18px; height: 18px; accent-color: var(--ink); vertical-align: -3px; margin: 0 8px 0 0; }
input[type="color"] { width: 100%; padding: 4px; cursor: pointer; }
label { display: inline-flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
label > input, label > select, label > textarea, label > .dt-text { width: 100%; }
label.row { flex-direction: row; align-items: center; color: var(--ink); font-size: 14px; }

/* вход */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; display: grid; gap: 14px; padding: 28px; }
.login-card h1 { margin: 0 0 4px; }
.login-card label { display: flex; }
.login-card .btn { margin-top: 4px; }
.login-brand { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--muted); }
.login-brand svg { width: 20px; height: 20px; color: var(--ink); }

/* шапка */
.top { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 20; }
.top-in { max-width: 1180px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 20px; }
.who { display: grid; min-width: 0; }
.who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who a { color: #CFE0D9; font-size: 12px; }
.tabs { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: none; color: #CFE0D9; padding: 8px 14px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.tabs button:hover:not(:disabled) { color: #fff; background: rgba(255,255,255,.08); }
.tabs button:disabled { opacity: .4; cursor: default; }
.tabs button[aria-current="true"] { background: rgba(255,255,255,.16); color: #fff; font-weight: 600; }
.top .link { color: #CFE0D9; white-space: nowrap; }
.top .link:hover { color: #fff; }

.flash { position: sticky; top: 68px; z-index: 15; background: #E7F3EC; border: 1px solid #BFDCCB; color: var(--ok); padding: 12px 16px; border-radius: var(--r); font-weight: 600; margin-bottom: 14px; box-shadow: 0 6px 18px rgba(22, 58, 47, .08); }
.flash.bad { background: #FBEAED; border-color: #EBC5CC; color: var(--red); }

.bar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.bar-note { align-self: center; margin-left: auto; color: var(--muted); font-size: 13px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.inline input { flex: 1 1 180px; }
.inline select { flex: 0 0 auto; }
.inline + .muted { margin: 12px 0 0; }
.empty { text-align: center; padding: 40px 20px; }
.empty b { display: block; font-size: 16px; margin-bottom: 4px; }
.empty .muted { margin: 0; }

/* заявки */
.order { display: grid; grid-template-columns: 130px minmax(0, 1.3fr) minmax(0, 1fr) 170px; gap: 20px; align-items: start; }
.order.is-cancelled { background: #FBFAF7; }
.order.is-cancelled .o-when, .order.is-cancelled .o-what, .order.is-cancelled .o-who, .order.is-cancelled .sum { opacity: .55; }
.o-when b { display: block; font-size: 17px; line-height: 1.25; }
.o-when span { display: block; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.o-when small, .o-what p, .o-who p { color: var(--muted); font-size: 13px; }
.o-what b, .o-who b { display: block; font-size: 15px; margin-bottom: 2px; }
.o-what dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 10px 0 0; font-size: 13px; }
.o-what dt { color: var(--muted); }
.o-what dd { margin: 0; }
.o-who a { display: inline-block; font-weight: 600; font-variant-numeric: tabular-nums; margin-bottom: 2px; }
.o-side { display: grid; gap: 8px; justify-items: end; }
.o-side .sum { font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.st-select { width: 100%; min-height: 34px; border-radius: 999px; font-size: 13px; font-weight: 600; border-color: transparent; }
.st-select.st-new { background-color: #FFF3D6; color: #7A5700; }
.st-select.st-confirmed { background-color: #E2F0FF; color: #1D4F8C; }
.st-select.st-done { background-color: #E7F3EC; color: #24653F; }
.st-select.st-cancelled { background-color: #EFEDE8; color: #6B6B6B; }
.o-paid { flex-direction: row; align-items: center; gap: 0; font-size: 13px; color: var(--ink); cursor: pointer; white-space: nowrap; }
.o-paid input { margin-right: 6px; }
.o-del { border: 0; background: none; padding: 4px 0; color: var(--muted); font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.o-del:hover { color: var(--red); }
.st { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; vertical-align: 1px; }
.st-new { background: #FFF3D6; color: #7A5700; } .st-confirmed { background: #E2F0FF; color: #1D4F8C; }
.st-done { background: #E7F3EC; color: #24653F; } .st-cancelled { background: #EFEDE8; color: #6B6B6B; }
.st-warn { background: #FBEAED; color: var(--red); }

/* расписание */
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.card-head h2 { margin: 0; }
.day-name { align-self: center; font-weight: 600; }
#tab-schedule .card > h2:not(:first-child) { margin-top: 24px; }
#tab-schedule .card form { margin-bottom: 4px; }
.slot-row { display: grid; grid-template-columns: 52px 1fr 110px 84px; gap: 12px; align-items: center; min-height: 44px; border-bottom: 1px solid var(--soft); }
.slot-row:last-child { border-bottom: 0; }
.slot-row b { font-variant-numeric: tabular-nums; }
.slot-row span { font-size: 13px; color: var(--muted); }
.slot-row .btn { justify-self: end; }
.meter { height: 8px; border-radius: 4px; background: #EEE9DF; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--ok); border-radius: 4px; }
.meter i.mid { background: #E0A92E; } .meter i.full { background: var(--red); }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; padding: 6px 0; border-bottom: 1px solid var(--soft); }
.list-row:last-child { border-bottom: 0; }

/* редакторы таблиц */
.ed { overflow-x: auto; }
.ed table { width: 100%; border-collapse: collapse; }
.ed th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 400; padding: 0 6px 6px; white-space: nowrap; }
.ed td { padding: 4px 6px; vertical-align: middle; }
.ed th:first-child, .ed td:first-child { padding-left: 0; }
.ed td input, .ed td select, .ed td .dt-text { width: 100%; }
.ed td.num input, .ed td.num select { width: 110px; }
.ed td.del-cell { width: 40px; padding-right: 0; }
.ed .del { width: 36px; height: 36px; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.ed .del:hover { color: var(--red); background: #FBEAED; }
.ed .add { margin-top: 10px; }
.ed-empty { color: var(--muted); font-size: 13px; padding: 4px 0; }
.ed td input[data-k="text"], .ed td input[data-k="a"] { min-width: 320px; }
.matrix td input { width: 120px; }
.matrix td:first-child { font-weight: 600; white-space: nowrap; padding-right: 16px; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; align-items: end; }
.fields label { display: flex; }
.card > .fields + .muted, .card > .fields + .btn { margin-top: 14px; }

/* панель сохранения */
.save-bar { position: sticky; bottom: 0; z-index: 10; display: flex; align-items: center; gap: 16px; margin: 4px -20px 14px; padding: 12px 20px; background: var(--bg); border-top: 1px solid var(--line); box-shadow: 0 -8px 20px rgba(22, 58, 47, .06); }
.dirty-note { display: none; color: #8A6300; font-size: 13px; font-weight: 600; }
.save-bar.is-dirty .dirty-note { display: inline; }
.save-link { margin-left: auto; font-size: 13px; }

/* агентства */
.agency-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px auto; gap: 16px; align-items: center; }
.agency-row small { display: block; margin-top: 2px; }
.ag-count { color: var(--muted); }
.ag-count b { color: var(--ink); font-size: 16px; }
.acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

#siteForm textarea { width: 100%; }
#siteForm .fields label:has(textarea) { grid-column: 1 / -1; }

/* окно с данными входа */
.cred { border: 0; border-radius: 16px; padding: 24px; width: min(460px, calc(100vw - 32px)); color: var(--ink); box-shadow: 0 20px 60px rgba(22, 58, 47, .25); }
.cred::backdrop { background: rgba(22, 58, 47, .45); }
.cred h3 { margin: 0 0 6px; font-size: 18px; }
.cred textarea { width: 100%; resize: none; margin-bottom: 14px; line-height: 1.5; }
.cred .acts { justify-content: flex-start; }

/* выбор даты */
.dt-text { width: 130px; font-variant-numeric: tabular-nums; }
.dt-text.bad { border-color: var(--red); }
.dt-pop { position: absolute; z-index: 50; width: 264px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; box-shadow: 0 10px 30px rgba(22, 58, 47, .16); }
.dt-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.dt-head button { border: 0; background: none; font-size: 20px; line-height: 1; padding: 6px 10px; border-radius: 8px; cursor: pointer; color: var(--ink); }
.dt-head button:hover { background: var(--bg); }
.dt-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.dt-grid i { font-style: normal; font-size: 11px; color: var(--muted); padding: 4px 0; }
.dt-grid button { border: 0; background: none; padding: 7px 0; border-radius: 8px; cursor: pointer; color: var(--ink); font: inherit; font-variant-numeric: tabular-nums; }
.dt-grid button:hover { background: var(--bg); }
.dt-grid button.today { box-shadow: inset 0 0 0 1px var(--gold); }
.dt-grid button.on { background: var(--ink); color: #fff; }

/* уведомления */
.notify-row { display: flex; gap: 10px; align-items: baseline; margin: 0 0 10px; }
.notify-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.notify-acts:empty { display: none; }
.notify-acts p { flex-basis: 100%; margin: 4px 0 0; }

@media (max-width: 960px) {
  .order { grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1fr); }
  .o-side { grid-column: 1 / -1; grid-template-columns: auto 180px auto; align-items: center; justify-content: start; justify-items: start; gap: 16px; padding-top: 14px; border-top: 1px solid var(--soft); }
}
@media (max-width: 860px) {
  .grid2 { grid-template-columns: 1fr; }
  .top-in { flex-wrap: wrap; gap: 6px 16px; padding-bottom: 6px; }
  .tabs { order: 3; flex-basis: 100%; margin: 0 -8px; }
  .top .link { margin-left: auto; }
  .flash { top: 110px; }
  .agency-row { grid-template-columns: 1fr auto; }
  .agency-row .acts { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 600px) {
  .wrap { padding: 14px; }
  .card { padding: 16px; }
  .order { grid-template-columns: 1fr; gap: 12px; }
  .o-when { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
  .o-when small { flex-basis: 100%; }
  .o-side { grid-template-columns: auto 1fr; }
  .o-side .o-del { grid-column: 1 / -1; justify-self: start; }
  .bar-note { flex-basis: 100%; margin-left: 0; }
  .bar label { flex: 1 1 130px; }
  .slot-row { grid-template-columns: 50px 1fr auto; gap: 10px; }
  .slot-row .meter { display: none; }
  .save-bar { margin: 4px -14px 14px; padding: 12px 14px; flex-wrap: wrap; gap: 8px 14px; }
  .fields { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* картинки */
.design-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.design-grid h3 { margin: 6px 0 4px; font-size: 15px; }
.img-box { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.img-prev { position: relative; width: 160px; height: 96px; border: 1px dashed var(--line-strong); border-radius: 12px; display: grid; place-items: center; background: #FBF7F1; overflow: hidden; }
.img-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.img-hero .img-prev { width: 200px; height: 112px; padding: 0; }
.img-hero .img-prev img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; }
.img-logo .img-prev { padding: 10px; }
.img-prev span { color: var(--muted); font-size: 13px; text-align: center; padding: 0 6px; }
.img-prev .img-tag { position: absolute; left: 6px; bottom: 6px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.9); color: var(--ink); font-size: 11px; }
.img-char { flex-wrap: nowrap; gap: 8px; }
.img-char .img-prev { width: 52px; height: 52px; border-radius: 10px; }
.img-char .img-prev img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; }
.img-char .img-prev span { font-size: 10px; }
.img-char .acts { flex-wrap: nowrap; }
.file-btn { flex-direction: row; color: var(--ink); font-size: 13px; }
.fields label.wide { grid-column: 1 / -1; }
.fields textarea { width: 100%; }
@media (max-width: 860px) { .design-grid { grid-template-columns: 1fr; } }

/* Вход: ссылки на восстановление пароля и регистрацию */
.login-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; margin-top: 4px; }
.login-brand svg { width: 22px; height: 22px; }

/* Плашка оплаты и проверки страницы */
.bill { display: flex; align-items: center; justify-content: space-between; gap: 10px 18px; flex-wrap: wrap; padding: 12px 16px; border-radius: 12px; margin-bottom: 14px; border: 1px solid; font-size: 14px; }
.bill.info { background: #EEF4FF; border-color: #CBDCF7; color: #1D3F73; }
.bill.warn { background: #FFF3D6; border-color: #F0D89A; color: #6B4C00; }
.bill.bad { background: #FBEAED; border-color: #EBC5CC; color: #7E1428; }
.bill .btn { flex: none; }

/* Портфолио в настройках */
.pf-acts { justify-content: flex-start; margin: 14px 0 10px; }
.pf-url { margin-bottom: 12px; }
.pf-progress { font-weight: 600; color: var(--ink); margin-bottom: 10px; }
.pf-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.pf-list > .muted { grid-column: 1 / -1; margin: 0; }
.pf-cell { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--soft); }
.pf-prev { position: relative; aspect-ratio: 4 / 3; background: #1C2C52; display: grid; place-items: center; }
.pf-prev img, .pf-prev video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-tag { position: absolute; left: 8px; top: 8px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.pf-btns { display: flex; }
.pf-btns button { flex: 1; border: 0; border-top: 1px solid var(--line); background: #fff; min-height: 34px; cursor: pointer; font-size: 15px; }
.pf-btns button + button { border-left: 1px solid var(--line); }
.pf-btns button:disabled { color: #C5C0B6; cursor: default; }
.pf-btns .pf-del { color: var(--red); font-size: 18px; }

/* Настройки сервиса (владелец) */
.owner-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 22px; margin: 12px 0 16px; }
.owner-grid h3 { font-size: 14px; margin: 0 0 6px; }
.owner-grid > div { display: flex; flex-direction: column; gap: 8px; }
.owner-grid .muted { margin: 0; }
.owner .acts { justify-content: flex-start; }
.bad-text { color: var(--red) !important; }
.cron { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.cron summary { cursor: pointer; font-weight: 600; }
.cron ol { margin: 10px 0; padding-left: 20px; }
.cron .inline input { font-family: ui-monospace, monospace; font-size: 12px; }
.cron .muted { margin-top: 10px; }
@media (max-width: 960px) { .owner-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .owner-grid { grid-template-columns: 1fr; } .bill .btn { width: 100%; } }

/* Списки в виде карточек: обычный текст, поля открываются по «Изменить» */
.re-list { display: grid; gap: 8px; margin-top: 12px; }
.re-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.re-item:hover { border-color: var(--line-strong); }
.re-item.is-open { display: block; background: var(--soft); border-color: var(--line-strong); padding: 16px; }
.re-thumb { width: 56px; height: 56px; border-radius: 10px; overflow: hidden; background: var(--soft); flex: none; display: grid; place-items: center; }
.re-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.re-thumb i { font-style: normal; font-size: 11px; color: var(--muted); text-align: center; line-height: 1.2; }
.re-text { flex: 1; min-width: 0; display: grid; gap: 3px; }
.re-text b { font-size: 15px; font-weight: 600; }
.re-text b.re-empty { color: var(--muted); font-weight: 400; font-style: italic; }
.re-sub { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.re-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.re-chip { font-size: 12px; color: var(--muted); background: var(--soft); border-radius: 999px; padding: 3px 10px; }
.re-text .re-chip b { color: var(--ink); font-weight: 600; font-size: 12px; }
.re-acts { display: flex; align-items: center; gap: 6px; flex: none; }
.re-item.is-open .re-acts { margin-top: 14px; justify-content: flex-start; }
.re-x { width: 34px; height: 34px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.re-x:hover { color: var(--red); background: #FBEAED; }
.re-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; align-items: end; }
.re-form label { display: flex; }
.re-form label.wide, .re-form .re-photo { grid-column: 1 / -1; }
.re-photo { display: grid; gap: 6px; }
.re-label { font-size: 13px; color: var(--muted); }
.ed > .re-form { margin-top: 10px; }
textarea.auto, #siteForm textarea, #settingsForm textarea { resize: none; overflow: hidden; line-height: 1.5; min-height: 64px; }
#siteForm textarea { min-height: 64px; }

/* Тексты главной: свёрнутые блоки с тем, что сейчас на сайте */
.fold { padding: 0; }
.fold > summary { list-style: none; display: flex; align-items: center; gap: 16px; padding: 16px 20px; cursor: pointer; }
.fold > summary::-webkit-details-marker { display: none; }
.fold-t { font-weight: 600; font-size: 15px; flex: none; }
.fold-p { flex: 1; min-width: 0; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fold-btn { flex: none; font-size: 13px; font-weight: 600; border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 12px; }
.fold[open] .fold-btn { background: var(--ink); color: #fff; border-color: var(--ink); }
.fold > .fields { padding: 0 20px 20px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
@media (max-width: 600px) {
  .re-item { flex-wrap: wrap; }
  .re-acts { width: 100%; justify-content: flex-end; }
  .re-item.is-open .re-acts .btn { flex: 1; }
  .fold-p { display: none; }
}
.mx-cards { display: none; }
@media (max-width: 600px) {
  .matrix table { display: none; }
  .mx-cards { display: grid; gap: 12px; margin-top: 10px; }
  .mx-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; }
  .mx-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 14px; align-items: center; gap: 8px; font-size: 14px; }
  .mx-row input { width: 100%; }
  .mx-row i { font-style: normal; color: var(--muted); }
  .fold > .fields { grid-template-columns: 1fr; }
}

.mail-box { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.mail-box h3 { font-size: 14px; margin: 0 0 6px; }
.mail-box .inline { max-width: 560px; }
#mailRes { margin-top: 8px; }

/* ===================== Новый вид кабинета: боковое меню, крупные заголовки, карточки ===================== */
@font-face { font-family: "Manrope"; font-weight: 400; font-display: swap; src: url("../assets/fonts/manrope-cyrillic-400-normal.woff2") format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Manrope"; font-weight: 400; font-display: swap; src: url("../assets/fonts/manrope-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+2000-206F,U+20BD,U+2212; }
@font-face { font-family: "Manrope"; font-weight: 600; font-display: swap; src: url("../assets/fonts/manrope-cyrillic-600-normal.woff2") format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Manrope"; font-weight: 600; font-display: swap; src: url("../assets/fonts/manrope-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+2000-206F,U+20BD,U+2212; }
@font-face { font-family: "Manrope"; font-weight: 700; font-display: swap; src: url("../assets/fonts/manrope-cyrillic-700-normal.woff2") format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Manrope"; font-weight: 700; font-display: swap; src: url("../assets/fonts/manrope-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+2000-206F,U+20BD,U+2212; }
@font-face { font-family: "Manrope"; font-weight: 800; font-display: swap; src: url("../assets/fonts/manrope-cyrillic-800-normal.woff2") format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Manrope"; font-weight: 800; font-display: swap; src: url("../assets/fonts/manrope-latin-800-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+2000-206F,U+20BD,U+2212; }
:root {
  --bg: #F3F5F2; --card: #fff; --line: #E3E8E4; --line-strong: #CBD5CF; --ink: #173B2F; --text: #1A2621; --muted: #66746D;
  --mint: #E3F2EA; --mint-ink: #1F7A4D; --soft: #F2F5F3; --r: 10px; --h: 42px;
}
body { font-family: "Manrope", system-ui, sans-serif; color: var(--text); background: var(--bg); }
input, select, textarea { color: var(--text); border-radius: 10px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn { border-radius: 10px; }
.btn.small { border-radius: 9px; min-height: 34px; }
.card { border-radius: 16px; border-color: var(--line); box-shadow: 0 1px 2px rgba(23, 59, 47, .04); padding: 22px 22px; }

/* каркас */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.shell[hidden] { display: none; }
.side { position: sticky; top: 0; height: 100vh; background: var(--ink); color: #fff; display: flex; flex-direction: column; padding: 22px 12px 0; overflow: hidden; z-index: 20; }
.side-head { display: flex; align-items: center; gap: 12px; padding: 0 8px 22px; }
.side-logo { width: 44px; height: 44px; border-radius: 12px; background: rgba(255, 255, 255, .08); display: grid; place-items: center; flex: none; overflow: hidden; }
.side-logo img { width: 30px; height: 30px; object-fit: contain; }
.side .who { display: grid; min-width: 0; }
.side .who b { font-size: 16px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side .who small { font-size: 12px; color: rgba(255, 255, 255, .6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side .tabs { display: grid; gap: 2px; margin: 0; overflow: visible; }
.side .tabs button, .side-link { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: none; color: rgba(255, 255, 255, .78); padding: 11px 12px; border-radius: 10px; font: 600 14px/1.2 "Manrope", sans-serif; text-align: left; cursor: pointer; text-decoration: none; }
.side .tabs svg, .side-link svg { width: 20px; height: 20px; flex: none; }
.side .tabs button:hover:not(:disabled), .side-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side .tabs button[aria-current="true"] { background: rgba(255, 255, 255, .14); color: #fff; }
.side .tabs button:disabled { opacity: .35; }
.side-foot { margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .1); display: grid; gap: 2px; }
.side-art { margin: auto -12px 0; height: 210px; flex: none; background: url("../assets/img/winter-m.webp") center 70% / cover no-repeat; -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 55%); mask-image: linear-gradient(180deg, transparent 0, #000 55%); opacity: .55; }
@media (max-height: 760px) { .side-art { display: none; } }

.shell > .wrap { max-width: 1240px; width: 100%; margin: 0; padding: 22px 32px 40px; }
.page-head { margin: 8px 0 22px; }
.page-head h1 { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 4px; }
.page-head p { color: var(--muted); font-size: 15px; }
.flash { top: 16px; border-radius: 12px; }

/* плашка оплаты */
.bill { border-radius: 14px; padding: 12px 14px 12px 16px; font-size: 14px; margin-bottom: 8px; }
.bill.info { background: var(--mint); border-color: #CBE6D7; color: #1E4A37; }
.bill::before { content: ""; width: 22px; height: 22px; flex: none; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='3.5' y='5' width='17' height='15.5' rx='3'/%3E%3Cpath d='M3.5 10h17M8 3v4M16 3v4'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='3.5' y='5' width='17' height='15.5' rx='3'/%3E%3Cpath d='M3.5 10h17M8 3v4M16 3v4'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; }
.bill > span { flex: 1; min-width: 200px; }
.bill .btn { background: var(--ink); border-color: var(--ink); color: #fff; }

/* шапка карточки-редактора */
.ed-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 6px; }
.ed-ico { width: 38px; height: 38px; border-radius: 11px; background: var(--mint); color: var(--ink); display: grid; place-items: center; flex: none; }
.ed-ico svg { width: 20px; height: 20px; }
.ed-title { flex: 1; min-width: 0; }
.ed-title h2 { font-size: 18px; font-weight: 800; margin: 2px 0 3px; }
.ed-title .muted { margin: 0; }
.ed-head > .btn { flex: none; background: var(--soft); border-color: transparent; }
.ed-head > .btn:hover { background: var(--mint); }
.ed .add-bottom { margin-top: 12px; }
.ed { overflow: visible; }

/* строки */
.re-list { gap: 10px; margin-top: 16px; }
.re-item { gap: 14px; padding: 12px 14px; border-radius: 14px; border-color: var(--line); }
.re-item.is-off .re-thumb, .re-item.is-off .re-text b { opacity: .5; }
.re-item.is-drag { opacity: .4; }
.re-item.is-over { border-color: var(--ink); box-shadow: 0 0 0 2px rgba(23, 59, 47, .15); }
.re-drag { color: #A7B3AD; cursor: grab; display: grid; place-items: center; width: 18px; flex: none; }
.re-drag svg { width: 18px; height: 18px; }
.re-thumb { width: 60px; height: 60px; border-radius: 12px; }
.re-ico { background: var(--mint); color: var(--ink); }
.re-ico svg { width: 30px; height: 30px; }
.re-text b { font-size: 16px; font-weight: 700; }
.re-chip { background: var(--soft); }
.re-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--mint-ink); background: var(--mint); border-radius: 999px; padding: 3px 10px 3px 8px; }
.re-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.re-status.is-off { color: #7C857F; background: #EEF0EE; }
.re-more { position: relative; }
.re-dots { width: 36px; height: 34px; border: 1px solid transparent; border-radius: 9px; background: none; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.re-dots:hover, .re-dots[aria-expanded="true"] { background: var(--soft); color: var(--text); }
.re-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 210px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 34px rgba(23, 59, 47, .16); padding: 6px; display: grid; }
.re-menu button { border: 0; background: none; text-align: left; padding: 9px 12px; border-radius: 8px; font: 600 14px "Manrope", sans-serif; color: var(--text); cursor: pointer; }
.re-menu button:hover { background: var(--soft); }
.re-menu button.danger { color: var(--red); }

/* программы — карточками в ряд */
.ed-grid .re-list { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.ed-grid .re-item:not(.is-open) { display: grid; grid-template-columns: auto auto minmax(0, 1fr); grid-template-rows: auto auto; align-items: start; }
.ed-grid .re-item:not(.is-open) .re-drag { grid-column: 1; grid-row: 1 / 3; align-self: center; }
.ed-grid .re-item:not(.is-open) .re-thumb { grid-column: 2; grid-row: 1 / 3; width: 76px; height: 76px; }
.ed-grid .re-item:not(.is-open) .re-text { grid-column: 3; grid-row: 1; }
.ed-grid .re-item:not(.is-open) .re-acts { grid-column: 3; grid-row: 2; justify-content: flex-start; width: auto; }
.ed-grid .re-item.is-open { grid-column: 1 / -1; }

/* базовые цены: строка на состав */
.mx { display: grid; gap: 10px; margin-top: 16px; }
.mx-line { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; }
.mx-line.is-off { opacity: .55; }
.mx-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mx-who b { font-weight: 700; }
.mx-ava { width: 40px; height: 40px; border-radius: 10px; background: var(--soft); display: grid; place-items: center; overflow: hidden; flex: none; color: var(--ink); }
.mx-ava img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.mx-ava svg { width: 20px; height: 20px; }
.mx-cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.mx-cell { display: grid; gap: 5px; font-size: 13px; }
.mx-in { position: relative; display: block; }
.mx-in input { width: 100%; padding-right: 30px; font-weight: 600; }
.mx-in i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--muted); pointer-events: none; }
.matrix table, .mx-cards { display: none !important; }

/* сохранение */
.save-bar { border-radius: 14px; }
.save-bar .btn { min-height: 46px; padding: 0 22px; font-size: 15px; }

/* вход */
.login { background: var(--bg); }
.login-card { border-radius: 18px; }
.login-brand { color: var(--text); font-weight: 800; font-size: 17px; gap: 10px; }
.login-brand img { width: 40px; height: auto; }

/* планшет и телефон: меню сверху строкой */
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 14px; gap: 8px 12px; }
  .side-head { padding: 0; flex: 1; min-width: 0; }
  .side-logo { width: 36px; height: 36px; border-radius: 10px; }
  .side-logo img { width: 24px; height: 24px; }
  .side-foot { margin: 0; padding: 0; border: 0; display: flex; gap: 4px; }
  .side-link { width: auto; padding: 8px 10px; }
  .side-link span { display: none; }
  .side .tabs { order: 3; width: 100%; display: flex; overflow-x: auto; scrollbar-width: none; gap: 4px; }
  .side .tabs::-webkit-scrollbar { display: none; }
  .side .tabs button { width: auto; flex: none; padding: 8px 12px; }
  .side .tabs svg { width: 18px; height: 18px; }
  .side-art { display: none; }
  .shell > .wrap { padding: 16px 16px 40px; }
  .page-head h1 { font-size: 26px; }
  .flash { top: 120px; }
  .mx-line { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  /* иконка и заголовок в строку, кнопка — отдельной строкой ниже на всю ширину */
  .ed-head { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px 12px; }
  .ed-head > .btn { grid-column: 1 / -1; justify-self: stretch; justify-content: center; }
  .ed-grid .re-list { grid-template-columns: 1fr; }
  .re-drag { display: none; }
  .mx-cells { grid-template-columns: 1fr 1fr; }
}
.card > h2, .card-head h2 { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.card h3 { font-weight: 700; }

#hoursCard .acts { margin-top: 18px; }
@media (max-width: 600px) { #hoursCard .acts .btn { width: 100%; justify-content: center; } }

.o-online { display: inline-block; padding: 3px 8px; border-radius: 8px; background: #E1EFE7; color: #1E6B43; font-size: 12px; font-weight: 700; }
.yk-box { margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.yk-box h3 { margin: 0 0 4px; font-size: 15px; }
.inline-copy { width: 100%; margin: 6px 0; font-size: 13px; }
.o-online { white-space: nowrap; }
.img-person .img-prev, .img-bimg .img-prev { height: 120px; background: #14213D; border-style: solid; }
.img-person .img-prev .img-tag, .img-bimg .img-prev .img-tag { background: rgba(255,255,255,.92); }
.design-grid .row { margin-top: 10px; }
.side-back { display: flex; align-items: center; gap: 10px; width: 100%; margin: 0 0 14px; padding: 10px 12px; border: 1px solid rgba(255,255,255,.25); border-radius: 12px; background: rgba(255,255,255,.08); color: #fff; font: 700 14px/1.2 inherit; font-family: inherit; cursor: pointer; text-align: left; }
.side-back:hover { background: rgba(255,255,255,.16); }
.side-back svg { width: 18px; height: 18px; flex: none; }
/* сообщение поверх страницы, без прокрутки наверх */
.flash { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); width: min(560px, calc(100vw - 32px)); margin: 0; z-index: 60; box-shadow: 0 12px 30px rgba(22, 58, 47, .18); }
.field-bad { border-color: var(--red) !important; box-shadow: 0 0 0 3px rgba(179, 32, 58, .18) !important; }
#sideHome { cursor: pointer; border-radius: 12px; }
#sideHome:hover .who b { text-decoration: underline; text-underline-offset: 3px; }
/* плитки портфолио одинаковой высоты */
.pf-list { align-items: start; }
.pf-prev { min-height: 0; overflow: hidden; }
.pf-prev img, .pf-prev video { position: absolute; inset: 0; }
.pf-cat { display: block; width: 100%; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 7px 8px; font: inherit; font-size: 13px; background: #fff; min-height: 0; }
.pf-cat:focus { outline: 2px solid var(--ink); outline-offset: -2px; }
.pf-cover-ed { border-top: 1px solid var(--line); background: #fff; }
.pf-cover-ed .pf-cat { border-top: 0; border-bottom: 1px solid var(--line); }
.pf-cover-btns { display: flex; }
.pf-cover-up, .pf-cover-del { flex: 1; padding: 7px 6px; font-size: 12px; font-weight: 700; text-align: center; cursor: pointer; background: #fff; border: 0; color: var(--ink); font-family: inherit; }
.pf-cover-del { border-left: 1px solid var(--line); color: var(--red); }
.pf-cover-up:hover, .pf-cover-del:hover { background: var(--soft); }
