/* ==========================================================================
   Raya Creates — admin
   ========================================================================== */

:root {
  --bg: #F6F4F1;
  --surface: #FFFFFF;
  --surface-2: #FBFAF8;
  --line: #E9E5E0;
  --line-2: #DCD6CF;
  --ink: #1C1A19;
  --ink-2: #4A4542;
  --muted: #8A837E;
  --pink: #E95170;
  --pink-ink: #C93A59;
  --pink-soft: #FDEEF1;
  --ok: #2F8F5B;
  --ok-soft: #E8F5EE;
  --warn: #A56A00;
  --warn-soft: #FFF5DD;
  --err: #C0203F;
  --err-soft: #FDECEF;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(28, 26, 25, .04), 0 4px 16px -8px rgba(28, 26, 25, .12);
  --shadow-lg: 0 24px 60px -20px rgba(28, 26, 25, .35);
  --side-w: 248px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
code, kbd { font: 12px/1.4 ui-monospace, "SF Mono", Consolas, monospace; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---------- Buttons ---------- */
.abtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font-weight: 500; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .15s, border-color .15s, box-shadow .15s, transform .15s;
}
.abtn:hover { border-color: var(--ink-2); }
.abtn:active { transform: translateY(1px); }
.abtn:disabled { opacity: .55; cursor: default; }
.abtn--primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.abtn--primary:hover { background: #000; border-color: #000; }
.abtn--danger { color: var(--err); }
.abtn--danger:hover { border-color: var(--err); background: var(--err-soft); }
.abtn--ghost { border-color: transparent; background: transparent; }
.abtn--sm { height: 30px; padding: 0 10px; font-size: 13px; }
.abtn kbd { padding: 1px 5px; border-radius: 4px; background: rgba(255, 255, 255, .16); font-size: 11px; opacity: .8; }
.icon-btn { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; transition: background-color .15s, color .15s; }
.icon-btn:hover { background: var(--bg); color: var(--ink); }
.icon-btn--danger:hover { background: var(--err-soft); color: var(--err); }

.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; }
.alert--ok { background: var(--ok-soft); color: var(--ok); }
.alert--error { background: var(--err-soft); color: var(--err); }

/* ---------- Auth ---------- */
.auth { display: grid; place-items: center; min-height: 100vh; padding: 24px; background: radial-gradient(1200px 600px at 20% -10%, #FBE3E9, transparent 60%), var(--bg); }
.auth__box { display: flex; flex-direction: column; gap: 16px; width: min(400px, 100%); padding: 40px 36px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); }
.auth__box img { margin-bottom: 8px; }
.auth__box h1 { font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.auth__box label, .pwform label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: 13px; }
.auth__box input, .pwform input { height: 42px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); }
.auth__box .abtn { height: 42px; }

/* ---------- Shell: sidebar + main ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 8px;
  padding: 22px 14px 14px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto;
}
.side__brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; text-decoration: none; }
.side__brand span { padding: 2px 8px; border-radius: 99px; background: var(--pink-soft); color: var(--pink-ink); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.side__nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side__group { margin: 18px 10px 6px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.side__link {
  position: relative; display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px;
  border: 0; border-radius: var(--radius-sm); background: none; color: var(--ink-2); font-weight: 500; text-align: left; text-decoration: none; cursor: pointer;
  transition: background-color .15s, color .15s;
}
.side__link span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side__link:hover { background: var(--bg); color: var(--ink); }
.side__link.is-active { background: var(--ink); color: #fff; }
.side__link.is-active .side__icon { stroke: #fff; }
.side__icon { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.side__count { flex: none !important; color: var(--muted); font-size: 12px; }
.side__link.is-active .side__count { color: rgba(255, 255, 255, .6); }
.side__badge { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--pink); color: #fff; font-size: 11px; line-height: 20px; text-align: center; }
.side__logout { padding-top: 10px; border-top: 1px solid var(--line); }
.side__progress { position: fixed; top: 0; left: 0; z-index: 100; height: 2px; width: 0; background: var(--pink); opacity: 0; pointer-events: none; transition: width .3s var(--ease), opacity .3s; }
.is-loading .side__progress { width: 70%; opacity: 1; transition: width 3s cubic-bezier(.1, .7, .3, 1), opacity .1s; }

.main { min-width: 0; padding: 36px clamp(20px, 3vw, 48px) 80px; transition: opacity .2s; }
.is-loading .main { opacity: .55; }
.main.is-entering { animation: enter .35s var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Page head ---------- */
.pagehead {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  margin: -36px calc(-1 * clamp(20px, 3vw, 48px)) 28px; padding: 28px clamp(20px, 3vw, 48px) 20px;
  background: rgba(246, 244, 241, .88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid transparent;
}
.pagehead h1 { font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.pagehead .muted { max-width: 640px; margin-top: 6px; }
.eyebrow { margin-bottom: 6px; color: var(--pink-ink); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.back { display: inline-block; margin-bottom: 8px; color: var(--muted); font-size: 13px; text-decoration: none; }
.back:hover { color: var(--ink); }
.savebar { display: flex; align-items: center; gap: 14px; flex: none; }
.savebar__status { font-size: 13px; color: var(--muted); }
.savebar__status.is-ok { color: var(--ok); }
.savebar__status.is-warn { color: var(--warn); }
.savebar__status.is-error { color: var(--err); }
.savebar__status:empty { display: none; }

/* ---------- Panels, stats, tiles ---------- */
.panel { margin-top: 28px; }
.panel__title { margin-bottom: 14px; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 20px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; transition: transform .2s var(--ease), box-shadow .2s; }
a.stat:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -14px rgba(28, 26, 25, .3); }
.stat__label { color: var(--muted); font-size: 13px; }
.stat__value { font-size: 34px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.stat__sub { color: var(--ink-2); font-size: 13px; }
.stat--action { padding: 0; background: var(--ink); border-color: var(--ink); }
.stat--action button { display: flex; flex-direction: column; justify-content: center; gap: 6px; width: 100%; height: 100%; min-height: 110px; padding: 20px 22px; border: 0; background: none; color: #fff; font-weight: 500; text-align: left; cursor: pointer; }
.stat__plus { font-size: 28px; line-height: 1; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; transition: border-color .15s, transform .2s var(--ease); }
.tile:hover { border-color: var(--ink-2); transform: translateY(-2px); }
.tile strong { font-weight: 600; }
.tile span { color: var(--muted); font-size: 13px; }
.mini-msgs { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.mini-msgs li + li { border-top: 1px solid var(--line); }
.mini-msgs a { display: grid; grid-template-columns: 160px 1fr auto; gap: 16px; padding: 14px 20px; text-decoration: none; }
.mini-msgs a:hover { background: var(--surface-2); }
.mini-msgs span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-msgs time { color: var(--muted); font-size: 12px; }
.mini-msgs .is-new strong::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--pink); vertical-align: 1px; }

/* ---------- Pills ---------- */
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 99px; background: var(--bg); color: var(--ink-2); font-size: 12px; font-weight: 500; }
.pill--ok { background: var(--ok-soft); color: var(--ok); }
.pill--pink { background: var(--pink-soft); color: var(--pink-ink); }

/* ---------- Project list (drag to reorder) ---------- */
.plist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.plist__item { display: flex; align-items: center; gap: 16px; padding: 12px 16px 12px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: box-shadow .2s, opacity .2s; }
.plist__item.is-draft .plist__thumb { opacity: .55; }
.plist__thumb { flex: none; width: 96px; aspect-ratio: 16 / 10; border-radius: var(--radius-sm); background: var(--bg); overflow: hidden; }
.plist__thumb img { width: 100%; height: 100%; object-fit: cover; }
.plist__info { flex: 1; min-width: 0; }
.plist__title { font-size: 15px; font-weight: 600; text-decoration: none; }
.plist__title:hover { color: var(--pink-ink); }
.plist__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
/* fixed slots for the buttons whose label flips (Скрий / Публикувай, На началната / Махни…), so every row lines up */
.plist__actions { display: grid; grid-template-columns: auto 104px 158px auto auto; gap: 6px; }
.plist__actions .abtn { width: 100%; justify-content: center; }

.drag {
  flex: none; align-self: stretch; width: 22px; border-radius: 6px; cursor: grab; touch-action: none;
  background: radial-gradient(circle, var(--line-2) 1.4px, transparent 1.6px) center / 8px 8px;
  transition: background-color .15s;
}
.drag:hover { background-color: var(--bg); }
.is-dragging { opacity: .35; }
.sort-ghost { position: fixed; z-index: 200; pointer-events: none; box-shadow: var(--shadow-lg) !important; transform: rotate(.6deg); cursor: grabbing; }
body.is-sorting, body.is-sorting * { cursor: grabbing !important; user-select: none; }

/* ---------- Help ---------- */
.help { margin-bottom: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.help summary { padding: 12px 18px; color: var(--ink-2); font-weight: 500; cursor: pointer; }
.markup-help { padding: 0 18px 16px; color: var(--ink-2); }
.markup-help table { margin: 10px 0; border-collapse: collapse; }
.markup-help td { padding: 5px 16px 5px 0; border-bottom: 1px solid var(--line); }
.markup-help code { padding: 2px 6px; border-radius: 4px; background: var(--bg); }

/* ---------- Editor workspace + live preview ---------- */
.workspace--preview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 44%); gap: 24px; align-items: start; }
.preview { position: sticky; top: 120px; display: flex; flex-direction: column; height: calc(100vh - 140px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.preview__bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.preview__live { display: inline-flex; align-items: center; gap: 8px; margin-right: auto; color: var(--ink-2); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.preview__live i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.preview.is-busy .preview__live i { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
.preview__frame { position: relative; flex: 1; background: var(--bg); overflow: hidden; }
.preview__frame iframe { position: absolute; top: 0; left: 0; width: 1440px; border: 0; transform-origin: 0 0; background: #fff; }
.preview__bar { flex-wrap: wrap; }
.preview--serp { height: auto; }
.serp { padding: 22px 20px 26px; font-family: Arial, sans-serif; }
.serp p { margin: 0; }
.serp__site { display: flex; align-items: center; gap: 10px; margin-bottom: 8px !important; }
.serp__site b { display: block; color: #202124; font-size: 14px; font-weight: 400; }
.serp__site small { display: block; color: #4d5156; font-size: 12px; }
.serp__icon { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); }
.serp__title { color: #1a0dab; font-size: 20px; line-height: 1.3; }
.serp__desc { margin-top: 4px !important; color: #4d5156; font-size: 14px; line-height: 1.58; }
.seg { display: inline-flex; padding: 2px; border-radius: var(--radius-sm); background: var(--bg); }
.seg button { height: 26px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 12px; font-weight: 500; cursor: pointer; }
.seg button.is-on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }

/* ---------- Editor fields ---------- */
#editor { display: flex; flex-direction: column; gap: 14px; }
.group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.group > summary, .group > legend { padding: 14px 18px; font-size: 15px; font-weight: 600; cursor: pointer; }
.group > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; }
.group > summary::after { content: ""; width: 8px; height: 8px; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(45deg); transition: transform .2s; }
.group[open] > summary::after { transform: rotate(-135deg); }
.group > summary::-webkit-details-marker { display: none; }
.group__body { display: flex; flex-direction: column; gap: 16px; padding: 4px 18px 18px; }
.group .group { box-shadow: none; background: var(--surface-2); }
fieldset.group { margin: 0; padding: 0 18px 16px; min-width: 0; }
fieldset.group > legend { padding: 14px 0 10px; float: left; width: 100%; cursor: default; }
fieldset.group > legend + * { clear: both; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { color: var(--ink-2); font-size: 13px; font-weight: 500; }
.field__hint { margin-top: -2px; color: var(--muted); font-size: 12px; }
.field input[type="text"], .field textarea, .field select, .arr__add select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); line-height: 1.5;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 76px; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 0; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(28, 26, 25, .08); }
.bi { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bi__col { position: relative; }
.bi__flag { position: absolute; top: 9px; right: 10px; z-index: 1; padding: 0 5px; border-radius: 4px; background: var(--bg); color: var(--muted); font-size: 10px; font-weight: 600; line-height: 18px; pointer-events: none; }
.bi__col input, .bi__col textarea { padding-right: 40px !important; }
.field--check { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.field--check input { width: 18px; height: 18px; accent-color: var(--ink); }
.field--inline { flex-direction: row; align-items: center; gap: 12px; }
.field--inline .field__label { flex: none; }
.field--inline select, .field--inline input { max-width: 260px; }
.swatch { flex: none; width: 30px; height: 30px; border: 1px solid var(--line-2); border-radius: 6px; }
.block-type { color: var(--pink-ink); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }

.img-field__row { display: flex; gap: 14px; align-items: flex-start; }
.img-field__preview { flex: none; display: grid; place-items: center; width: 132px; aspect-ratio: 4 / 3; border: 1px dashed var(--line-2); border-radius: var(--radius-sm); background: var(--surface-2); overflow: hidden; }
.img-field__preview img, .img-field__preview video { width: 100%; height: 100%; object-fit: contain; }
.img-field__controls { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.img-field__btns { display: flex; flex-wrap: wrap; gap: 6px; }

/* Repeatable items (drag to reorder) */
.arr { display: flex; flex-direction: column; gap: 8px; }
.arr__item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); transition: box-shadow .2s, border-color .2s; }
.arr__item[open] { border-color: var(--line-2); box-shadow: var(--shadow); }
.arr__item--block { border-left: 3px solid var(--pink); }
.arr__head { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 8px 6px 6px; list-style: none; cursor: pointer; }
.arr__head::-webkit-details-marker { display: none; }
.arr__head .drag { align-self: stretch; min-height: 30px; }
.arr__num { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--bg); color: var(--muted); font-size: 12px; font-weight: 600; }
.arr__title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.arr__tools { display: flex; gap: 2px; opacity: .5; transition: opacity .15s; }
.arr__head:hover .arr__tools, .arr__item[open] .arr__tools { opacity: 1; }
.arr__body { display: flex; flex-direction: column; gap: 14px; padding: 6px 14px 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.arr__add { display: flex; gap: 8px; margin-top: 10px; }
.arr__add select { width: auto; flex: 1; max-width: 420px; padding-block: 0; height: 30px; }

/* ---------- Media picker ---------- */
.modal { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 24px; background: rgba(28, 26, 25, .45); backdrop-filter: blur(4px); animation: enter .2s var(--ease); }
.modal__box { display: flex; flex-direction: column; width: min(960px, 100%); max-height: 86vh; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; padding: 20px; overflow-y: auto; }
.media-grid__item { display: flex; flex-direction: column; gap: 6px; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; transition: border-color .15s, transform .15s; }
.media-grid__item:hover { border-color: var(--ink); transform: translateY(-2px); }
.media-grid__item img, .media-grid__item video { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--bg); border-radius: 4px; }
.media-grid__item span { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Messages ---------- */
.empty { padding: 48px; border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--muted); text-align: center; }
.msgs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.msg { padding: 20px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.msg.is-new { border-left: 3px solid var(--pink); }
.msg__head { display: flex; align-items: center; gap: 12px; }
.msg__head > div { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.msg__head a { color: var(--muted); font-size: 13px; text-decoration: none; }
.msg__avatar { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--pink-soft); color: var(--pink-ink); font-weight: 600; }
.msg__date { color: var(--muted); font-size: 12px; }
.msg__body { margin: 14px 0 16px; color: var(--ink-2); white-space: normal; }
.msg__actions { display: flex; flex-wrap: wrap; gap: 6px; }

.pwform { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 12px; align-items: end; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.pwform .abtn { height: 42px; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .workspace--preview { grid-template-columns: 1fr; }
  .preview { position: relative; top: 0; height: 70vh; order: -1; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; z-index: 50; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .side__brand { padding: 0 8px 0 0; }
  .side__brand img { width: 96px; }
  .side__nav { flex-direction: row; flex: none; }
  .side__group { display: none; }
  .side__link { width: auto; }
  .side__logout { padding: 0 0 0 8px; border: 0; border-left: 1px solid var(--line); }
  .pagehead { position: static; flex-direction: column; align-items: flex-start; }
  .plist__item { flex-wrap: wrap; }
  .plist__actions { display: flex; flex-wrap: wrap; justify-content: flex-start; width: 100%; padding-left: 30px; }
  .plist__actions .abtn { width: auto; }
  .bi, .pwform { grid-template-columns: 1fr; }
  .mini-msgs a { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------- New project: starting structure ---------- */
.newproj { display: flex; gap: 8px; align-items: center; }
.newproj select { height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); font: inherit; }

/* ---------- Case study sections in the panel ---------- */
.arr__item.is-hidden > .arr__head { opacity: .5; }
.arr__item.is-hidden > .arr__head .arr__title::after { content: " · скрита"; color: var(--muted); }
.icon-btn[disabled] { opacity: .3; cursor: default; }

/* ---------- Preview: desktop / mobile ---------- */
.preview.is-mobile .preview__frame { display: flex; justify-content: center; background: var(--surface-2); }
.preview.is-mobile .preview__frame iframe { position: relative; flex: none; }

/* ---------- Named groups (shared texts, settings) ---------- */
.groups__bar { position: sticky; top: 96px; z-index: 3; margin-bottom: 12px; }
.groups__search { width: 100%; height: 42px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); font: inherit; box-shadow: var(--shadow); }
.group--named > summary { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.group__note { color: var(--muted); font-size: 12px; font-weight: 400; }
.group__global { margin: 0 0 14px; padding: 8px 12px; border-left: 3px solid var(--pink, #e95170); background: var(--surface-2); color: var(--ink-2); font-size: 13px; }
.field__used { margin: -2px 0 6px; color: var(--muted); font-size: 12px; }
.missing { margin-left: 8px; color: #c0392b; font-size: 11px; font-weight: 600; }
.bi .is-empty { border-color: #e7a3a3; background: #fff7f7; }

/* ---------- Identity previews ---------- */
.img-field__preview--logo { width: 260px; aspect-ratio: auto; display: grid; gap: 6px; padding: 6px; border-style: solid; }
.logo-on { display: grid; place-items: center; height: 54px; padding: 8px 14px; border-radius: 4px; }
.logo-on img { max-width: 100%; max-height: 37px; object-fit: contain; }
.logo-on--light { background: #FFFDFA; border: 1px solid var(--line); }
.logo-on--dark { background: #1E1E1E; }
.img-field__preview--tab { width: 260px; aspect-ratio: auto; padding: 10px 8px 0; background: #dee1e6; border-style: solid; place-items: end start; }
.tab-mock { display: flex; align-items: center; gap: 8px; width: 220px; height: 34px; padding: 0 10px; border-radius: 8px 8px 0 0; background: #fff; font: 12px/1 Arial, sans-serif; color: #333; }
.tab-mock img { width: 16px; height: 16px; object-fit: contain; }
.tab-mock span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tab-mock i { font-style: normal; color: #777; }
.img-field__preview { position: relative; }
.img-field__default { position: absolute; right: 6px; bottom: 4px; color: var(--muted); font-size: 10px; }
