/* стилі розділу кабінету «Сайт» (Сторінки, Соцмережі) — cabinet-site.css
   Світла тема: текст #1f1f1f, другорядний #8a8a8f, лінії #e6e6ea, головна кнопка #3D3D3D, успіх #65A362.
   Кольори задані тут явно — розділ виглядає однаково, хоч би що було в cabinet.css. */
.sp { --s-text: #1f1f1f; --s-muted: #8a8a8f; --s-line: #e6e6ea; --s-soft: #F3F4F6; --s-soft-2: #E8E9EE;
  --s-dark: #3D3D3D; --s-dark-hi: #262626; --s-ok: #65A362; --s-ok-hi: #568f53; --s-bad: #d64545; --s-link: #3a67c9;
  color: var(--s-text); font-family: "Manrope", "Inter", system-ui, sans-serif; }
.sp *, .sp *::before, .sp *::after { box-sizing: border-box; }

/* кнопки розділу */
.sbtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 8px;
  border: 1px solid transparent; font-family: inherit; font-weight: 700; font-size: 14px; line-height: 1.2; cursor: pointer; text-decoration: none;
  white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.sbtn--dark { background: var(--s-dark); color: #fff; }
.sbtn--dark:hover { background: var(--s-dark-hi); color: #fff; }
.sbtn--ok { background: var(--s-ok); color: #fff; }
.sbtn--ok:hover { background: var(--s-ok-hi); color: #fff; }
.sbtn--ghost { background: #fff; color: var(--s-text); border-color: var(--s-line); }
.sbtn--ghost:hover { border-color: #c9cad1; background: var(--s-soft); color: var(--s-text); }
.sbtn--sm { padding: 7px 12px; font-size: 13px; }
.sbtn:focus-visible, .sp a:focus-visible, .sp summary:focus-visible { outline: 2px solid var(--s-dark); outline-offset: 2px; }

/* заголовок сторінки */
.sp-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid var(--s-line); }
.sp-head__back { display: none; color: var(--s-muted); font-weight: 600; font-size: 14px; text-decoration: none; flex-basis: 100%; }
.sp-head__t { display: grid; gap: 4px; flex: 1; min-width: 0; }
.sp-head h1 { margin: 0; font-size: clamp(24px, 2.6vw, 32px); font-weight: 700; letter-spacing: -.01em; color: var(--s-text); }
.sp-head__url { color: var(--s-muted); font-size: 13.5px; overflow-wrap: anywhere; }
.sp-head__acts { display: flex; gap: 8px; flex-wrap: wrap; }

.sp-pub { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 16px 0 0; padding: 10px 12px 10px 16px;
  border-radius: 10px; background: #f1f7f0; border: 1px solid #d6e8d4; font-size: 14px; color: var(--s-text); }
.sp-pub b { color: #3f7a3c; }

/* дві колонки: дерево | форма */
.sp-cols { display: grid; grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); align-items: start; margin-top: 0; }
.sp-tree { border-right: 1px solid var(--s-line); padding: 18px 16px 24px 0; position: sticky; top: 0; max-height: 100vh; overflow-y: auto; }
.sp-tree ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.tr { position: relative; display: flex; align-items: center; gap: 4px; }
.tr__link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 8px; color: var(--s-text);
  text-decoration: none; font-size: 15.5px; line-height: 1.3; transition: background .12s; }
.tr__link:hover { background: var(--s-soft); color: var(--s-text); }
.tr--d1 .tr__link { padding-left: 34px; }
.tr--d2 .tr__link { padding-left: 54px; }
.tr__link--home { font-weight: 600; }
.tr__chev { width: 18px; height: 18px; flex: none; position: relative; }
.tr__chev::before { content: ""; position: absolute; left: 5px; top: 3px; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
.tr.on .tr__link { background: var(--s-soft-2); font-weight: 700; }
.tr.is-hidden .tr__link, .sp-tree__legend .is-hidden { color: #a9a9ae; }
.tr__link--group { color: var(--s-muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding-top: 14px; cursor: default; }
.tr__link--group:hover { background: none; }
.tr__ic { font-size: 14px; }
.tr__lock { font-size: 11px; opacity: .55; }
.tr__dot { color: #e0952b; font-size: 11px; }
.tr__link .tr__lock, .tr__link .tr__dot { margin-left: auto; }
.tr__link .tr__lock + .tr__dot { margin-left: 4px; }
.sp-tree__legend { margin: 18px 10px 0; color: var(--s-muted); font-size: 12.5px; line-height: 1.6; }

/* ＋ нова сторінка */
.tr__add { position: static; }
.tr__add > summary { list-style: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; cursor: pointer;
  color: var(--s-muted); font-size: 16px; font-weight: 700; transition: background .12s, color .12s; }
.tr__add > summary::-webkit-details-marker { display: none; }
.tr__add > summary:hover, .tr__add[open] > summary { background: var(--s-dark); color: #fff; }
.tr__new { position: absolute; z-index: 5; left: 24px; right: 0; top: calc(100% + 4px); display: grid; gap: 8px; padding: 12px; background: #fff;
  border: 1px solid var(--s-line); border-radius: 10px; box-shadow: 0 12px 30px -10px rgba(20, 20, 30, .25); }
.tr__new input[name=title] { width: 100%; padding: 9px 11px; border: 1px solid #d4d5db; border-radius: 8px; font: inherit; font-size: 14px; color: var(--s-text); background: #fff; }
.tr__new input[name=title]:focus { outline: none; border-color: var(--s-dark); box-shadow: 0 0 0 3px rgba(61, 61, 61, .12); }
.tr__kinds { display: flex; gap: 14px; font-size: 13.5px; color: var(--s-text); }
.tr__kinds label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.tr__kinds input { accent-color: var(--s-dark); }

/* форма сторінки */
.sp-form { padding: 8px 0 0 32px; min-width: 0; max-width: 760px; }
.sf-group { border-bottom: 1px solid var(--s-line); padding: 6px 0 18px; }
.sf-group > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 16px 0 12px; cursor: pointer;
  font-size: 20px; font-weight: 700; color: var(--s-text); }
.sf-group > summary::-webkit-details-marker { display: none; }
.sf-group > summary::before { content: "›"; display: inline-grid; place-items: center; width: 18px; font-size: 22px; line-height: 1; transition: transform .15s; }
.sf-group[open] > summary::before { transform: rotate(90deg); }
.sf-field { display: grid; gap: 6px; margin: 0 0 18px; }
.sf-field__l { display: flex; justify-content: space-between; gap: 10px; font-size: 14.5px; font-weight: 600; color: var(--s-text); }
.sf-count { color: var(--s-muted); font-weight: 500; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.sf-count.is-over { color: #c77700; }
.sf-field input, .sf-field select, .sf-field textarea, .soc__main input {
  width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid #d4d5db; border-radius: 8px; background: #fff; color: var(--s-text);
  font: inherit; font-size: 15px; transition: border-color .15s, box-shadow .15s; }
.sf-field textarea { resize: vertical; min-height: 84px; }
.sf-field input:hover, .sf-field select:hover, .sf-field textarea:hover, .soc__main input:hover { border-color: #b9bac2; }
.sf-field input:focus, .sf-field select:focus, .sf-field textarea:focus, .soc__main input:focus { outline: none; border-color: var(--s-dark); box-shadow: 0 0 0 3px rgba(61, 61, 61, .12); }
.sf-field__h { color: var(--s-muted); font-size: 13px; line-height: 1.45; }
.sf-field__e { color: var(--s-bad); font-size: 13px; font-weight: 600; }
.sf-field.is-err input, .sf-field.is-err textarea, .soc__row.is-err input { border-color: var(--s-bad); }
.sf-note { color: var(--s-muted); font-size: 13.5px; line-height: 1.55; margin: 0 0 16px; }

.sf-addr { display: flex; align-items: stretch; border: 1px solid #d4d5db; border-radius: 8px; overflow: hidden; background: #fff; }
.sf-addr:focus-within { border-color: var(--s-dark); box-shadow: 0 0 0 3px rgba(61, 61, 61, .12); }
.sf-addr__pre, .sf-addr__post { display: flex; align-items: center; padding: 0 2px 0 12px; background: var(--s-soft); color: var(--s-muted); font-size: 14px; white-space: nowrap; }
.sf-addr__post { padding: 0 12px 0 0; background: #fff; }
.sf-addr input { border: 0 !important; box-shadow: none !important; border-radius: 0; min-width: 0; flex: 1; padding-left: 4px; }
.sf-addr.is-ro { background: var(--s-soft); min-height: 42px; }
.sf-addr.is-ro .sf-addr__pre { padding-right: 12px; overflow-wrap: anywhere; white-space: normal; }

/* перемикач «Відображати» тощо */
.sf-toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; margin: 0; cursor: pointer; border-top: 1px solid #f0f0f3; }
.sf-toggle__text { display: grid; gap: 2px; }
.sf-toggle__text b { font-size: 14.5px; font-weight: 600; }
.sf-toggle__text small { color: var(--s-muted); font-size: 13px; }
.sf-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sf-toggle__sw { position: relative; flex: none; width: 42px; height: 24px; border-radius: 999px; background: #d4d5db; transition: background .2s; }
.sf-toggle__sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.sf-toggle input:checked + .sf-toggle__sw { background: var(--s-ok); }
.sf-toggle input:checked + .sf-toggle__sw::after { transform: translateX(18px); }
.sf-toggle input:focus-visible + .sf-toggle__sw { outline: 2px solid var(--s-dark); outline-offset: 2px; }

.sf-kids { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.sf-kids a { color: var(--s-text); font-weight: 600; text-decoration: none; }
.sf-kids a:hover { text-decoration: underline; }
.sf-kids small { color: var(--s-muted); }

/* сніпет Google */
.snip { display: grid; gap: 3px; padding: 14px 16px; margin: 0 0 18px; border: 1px solid var(--s-line); border-radius: 10px; background: #fff; font-family: Arial, sans-serif; }
.snip__url { color: #2f6d3a; font-size: 13px; overflow-wrap: anywhere; }
.snip__t { color: #1a0dab; font-size: 19px; font-weight: 400; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snip__d { margin: 0; color: #4d5156; font-size: 14px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.snip__d.is-empty { color: #a9a9ae; font-style: italic; }

/* липкий низ форми */
.sf-foot { position: sticky; bottom: 0; z-index: 3; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 0; margin-top: 4px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, .85), #fff 30%); border-top: 1px solid var(--s-line); }
.sf-del { margin-left: auto; border: 0; background: none; color: var(--s-bad); font-family: inherit; font-weight: 600; font-size: 14px; cursor: pointer; padding: 8px 4px; }
.sf-del:hover { text-decoration: underline; }

/* соцмережі */
.soc { max-width: 860px; }
.soc__list { list-style: none; margin: 8px 0 18px; padding: 0; }
.soc__row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 150px; gap: 16px; align-items: start; padding: 18px 0; border-bottom: 1px solid var(--s-line); }
.soc__ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--c); color: #fff; font-weight: 800; font-size: 14px; letter-spacing: .02em; }
.soc__main { display: grid; gap: 6px; min-width: 0; }
.soc__l { font-weight: 700; font-size: 15px; }
.soc__h { color: var(--s-muted); font-size: 13px; line-height: 1.45; }
.soc__state { display: grid; gap: 4px; justify-items: start; padding-top: 30px; font-size: 13.5px; }
.soc__on { color: #3f7a3c; font-weight: 700; }
.soc__on::before { content: "● "; color: var(--s-ok); }
.soc__off { color: var(--s-muted); }
.soc__state a { color: var(--s-link); text-decoration: none; font-weight: 600; }
.soc__state a:hover { text-decoration: underline; }

/* телефон: дерево й форма — окремими екранами */
@media (max-width: 860px) {
  .sp-cols { grid-template-columns: 1fr; }
  .sp-tree { position: static; max-height: none; border-right: 0; padding-right: 0; border-bottom: 1px solid var(--s-line); }
  .sp-form { padding: 8px 0 0; }
  .sp--detail .sp-tree { display: none; }
  .sp--detail .sp-head__back { display: inline-block; }
  .sp-head { align-items: flex-start; }
  .sp-head__acts { width: 100%; }
  .sp-head__acts .sbtn { flex: 1; }
  .sf-foot .sbtn { flex: 1; }
  .sf-foot { position: static; }
  .sf-del { margin-left: 0; }
  .soc__row { grid-template-columns: 40px minmax(0, 1fr); }
  .soc__state { grid-column: 2; padding-top: 0; grid-auto-flow: column; gap: 12px; }
}
