/* Шрифти лежать у папці fonts/ (PT Sans, PT Serif — ліцензія OFL), без запитів до сторонніх серверів */
/* pt-sans-cyrillic-ext-400-normal */
@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(fonts/pt-sans-cyrillic-ext-400-normal.woff2) format('woff2');
  unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}
/* pt-sans-cyrillic-400-normal */
@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(fonts/pt-sans-cyrillic-400-normal.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
/* pt-sans-latin-ext-400-normal */
@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(fonts/pt-sans-latin-ext-400-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
/* pt-sans-latin-400-normal */
@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(fonts/pt-sans-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
/* pt-sans-cyrillic-ext-700-normal */
@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(fonts/pt-sans-cyrillic-ext-700-normal.woff2) format('woff2');
  unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}
/* pt-sans-cyrillic-700-normal */
@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(fonts/pt-sans-cyrillic-700-normal.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
/* pt-sans-latin-ext-700-normal */
@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(fonts/pt-sans-latin-ext-700-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
/* pt-sans-latin-700-normal */
@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(fonts/pt-sans-latin-700-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
/* pt-sans-cyrillic-400-italic */
@font-face {
  font-family: 'PT Sans';
  font-style: italic;
  font-display: swap;
  font-weight: 400;
  src: url(fonts/pt-sans-cyrillic-400-italic.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
/* pt-sans-latin-400-italic */
@font-face {
  font-family: 'PT Sans';
  font-style: italic;
  font-display: swap;
  font-weight: 400;
  src: url(fonts/pt-sans-latin-400-italic.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
/* pt-serif-cyrillic-ext-700-normal */
@font-face {
  font-family: 'PT Serif';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(fonts/pt-serif-cyrillic-ext-700-normal.woff2) format('woff2');
  unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}
/* pt-serif-cyrillic-700-normal */
@font-face {
  font-family: 'PT Serif';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(fonts/pt-serif-cyrillic-700-normal.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
/* pt-serif-latin-ext-700-normal */
@font-face {
  font-family: 'PT Serif';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(fonts/pt-serif-latin-ext-700-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
/* pt-serif-latin-700-normal */
@font-face {
  font-family: 'PT Serif';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(fonts/pt-serif-latin-700-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* =========================================================
   Вишня — стилі
   Світлі «паперові» блоки на фото-тлі, червона шапка,
   смужка-вишивка. Без скла, світіння й градієнтів.
   Тема профілю/спільноти керується змінними
   --bg-image, --accent, --accent-dark (див. common.js).
   ========================================================= */

:root{
  color-scheme:light;
  --cherry:      #b3182f;
  --cherry-dark: #84111f;
  --cherry-soft: #fbe6e9;
  --cherry-ink:  var(--cherry);      /* вишневий для ТЕКСТУ (у темній темі світліший) */
  --leaf:        #6fa657;
  --leaf-dark:   #375c2b;

  --paper:   #ffffff;     /* картки */
  --page:    #ebe8e3;     /* колонка під картками */
  --text:    #26211d;
  --text-2:  #6b625a;
  --line:    #d9d2c7;
  --line-2:  #b7ad9f;
  --field:   #ffffff;
  --ink:     #1f1a17;     /* текст на кольорі акценту */
  --on-color:#ffffff;
  --mix-to:  #1c1612;     /* до чого «домішуємо» акцент для тексту-посилань */

  --ok:      #2a7a3b;
  --warn:    #8a6200;
  --info:    #265f98;
  --bad:     #b3182f;

  /* повідомлення, статуси */
  --err-text:var(--err-text);  --err-line:var(--err-line);  --tint-red:var(--tint-red);
  --ok-bg:#e2f1e1;     --ok-text:#1d5a2a;
  --sel:#e3dfd8;       --veil-soft:rgba(0,0,0,0.06);  --mark:#ffe58a;
  --btn-off-bg:#a39a8e; --btn-off-line:#8a8174;
  --st-new-fg:#6f5000;  --st-new-bg:#f6ebc6;
  --st-conf-fg:#1f4a78; --st-conf-bg:#dce9f6;
  --st-ship-fg:#1f5a35; --st-ship-bg:#dcf0e2;
  --st-done-fg:#17552a; --st-done-bg:#cfeadb;
  --st-bad-fg:#7a0f1d;  --st-bad-bg:var(--cherry-soft);
  --st-on-fg:#17552a;   --st-on-bg:#d6ecdc;

  /* шапка */
  --header-bg:var(--cherry);   --nav-bg:var(--cherry-dark);
  --on-header:#ffffff;         --nav-text:rgba(255,255,255,0.82);
  --nav-hover-bg:rgba(0,0,0,0.14);  --nav-active-line:#ffffff;
  --header-line:rgba(255,255,255,0.65);  --header-hover:rgba(255,255,255,0.16);
  --who-avatar-bg:#ffffff;     --who-avatar-text:var(--cherry);
  --badge-bg:#ffffff;          --badge-fg:var(--cherry-dark);
  --brand-fruit-top:#ffe1e5;   --brand-ring-top:var(--cherry);  --brand-green-top:#c9e6b4;
  --brand-auth:var(--cherry-dark);
  --strip-bg:#fbf7f0;
  --strip-img:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 7' shape-rendering='crispEdges'%3E%3Cg fill='%23b3182f'%3E%3Crect x='3' y='1' width='1' height='1'/%3E%3Crect x='2' y='2' width='1' height='1'/%3E%3Crect x='4' y='2' width='1' height='1'/%3E%3Crect x='1' y='3' width='1' height='1'/%3E%3Crect x='5' y='3' width='1' height='1'/%3E%3Crect x='2' y='4' width='1' height='1'/%3E%3Crect x='4' y='4' width='1' height='1'/%3E%3Crect x='3' y='5' width='1' height='1'/%3E%3C/g%3E%3Crect x='3' y='3' width='1' height='1' fill='%231f1a17'/%3E%3C/svg%3E");

  /* фон сторінки: фото + рівне затемнення */
  --veil:rgba(24,30,18,0.42);
  --body-base:#2b3322;

  /* Themable: overridden at runtime (personal profile theme / community theme) */
  --bg-image:    url('Vi.webp');
  --accent:      var(--leaf);
  --accent-dark: var(--leaf-dark);

  --font-ui:    'PT Sans', 'Trebuchet MS', Tahoma, sans-serif;
  --font-head:  'PT Serif', Georgia, 'Times New Roman', serif;
}

/* ---------- темна тема (перемикач у шапці; вибір зберігає theme.js) ---------- */
:root[data-theme="dark"]{
  color-scheme:dark;
  --cherry-soft:#40202a;
  --cherry-ink:#ff8798;
  --paper:   #1b2417;
  --page:    rgba(13,18,10,0.90);
  --text:    #f1e9d8;
  --text-2:  #a8a592;
  --line:    #34412c;
  --line-2:  #52614a;
  --field:   #222c1d;
  --mix-to:  #ffffff;

  --ok:#6fd08a; --warn:#e6bf5a; --info:#7fb4ea; --bad:#ff8798;

  --err-text:#ffb8c2;  --err-line:#7d3542;  --tint-red:#2d1b1e;
  --ok-bg:#1f3a25;     --ok-text:#a9e5b6;
  --sel:#2a3623;       --veil-soft:rgba(255,255,255,0.09);  --mark:#e2c25a;
  --btn-off-bg:#46503f; --btn-off-line:#363e31;
  --st-new-fg:#f0d27a;  --st-new-bg:#3b3216;
  --st-conf-fg:#a9cdf2; --st-conf-bg:#1d3550;
  --st-ship-fg:#a6e3b6; --st-ship-bg:#1d3a28;
  --st-done-fg:#9fe0b2; --st-done-bg:#1a4228;
  --st-bad-fg:#ffb8c2;  --st-bad-bg:#40202a;
  --st-on-fg:#a6e3b6;   --st-on-bg:#1d3a28;

  --header-bg:#141b10;   --nav-bg:#0e140b;
  --on-header:#f3ead9;   --nav-text:rgba(243,234,217,0.72);
  --nav-hover-bg:rgba(255,255,255,0.07);  --nav-active-line:#e8445a;
  --header-line:rgba(243,234,217,0.42);   --header-hover:rgba(243,234,217,0.12);
  --who-avatar-bg:var(--cherry);  --who-avatar-text:#ffffff;
  --badge-bg:#e0304a;    --badge-fg:#ffffff;
  --brand-fruit-top:#ffe1e5;  --brand-ring-top:#141b10;  --brand-green-top:#c9e6b4;   /* логотип такий самий, як у світлій темі */
  --brand-auth:#f3ead9;
  --strip-bg:#0e140b;
  --strip-img:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 7' shape-rendering='crispEdges'%3E%3Cg fill='%23b3182f'%3E%3Crect x='3' y='1' width='1' height='1'/%3E%3Crect x='2' y='2' width='1' height='1'/%3E%3Crect x='4' y='2' width='1' height='1'/%3E%3Crect x='1' y='3' width='1' height='1'/%3E%3Crect x='5' y='3' width='1' height='1'/%3E%3Crect x='2' y='4' width='1' height='1'/%3E%3Crect x='4' y='4' width='1' height='1'/%3E%3Crect x='3' y='5' width='1' height='1'/%3E%3C/g%3E%3Crect x='3' y='3' width='1' height='1' fill='%23f3ead9'/%3E%3C/svg%3E");

  --veil:rgba(5,8,4,0.68);
  --body-base:#0f150c;
}

*{ margin:0; padding:0; box-sizing:border-box; }

html{ -webkit-text-size-adjust:100%; text-size-adjust:100%; }

body{
  font-family:var(--font-ui);
  font-size:16px;
  line-height:1.4;
  color:var(--text);
  min-height:100vh;
  min-height:100dvh;
  overflow-x:hidden;
  background:
    linear-gradient(var(--veil), var(--veil)),
    var(--bg-image) center/cover fixed no-repeat;
  background-color:var(--body-base);
}

/* Сторінки на весь екран (чати, короткі відео) — шапка + контент
   рівно займають висоту вʼюпорту, без магічних calc(100vh - Npx),
   тож усе лишається справним незалежно від того, скільки рядків
   займає навігація на конкретному телефоні. */
body.fullscreen-page{
  display:flex;
  flex-direction:column;
  height:100vh;
  height:100dvh;
}
body.fullscreen-page > .topbar{ flex-shrink:0; }
body.fullscreen-page > main{ flex:1; min-height:0; }

a{ color:color-mix(in srgb, var(--accent) 60%, var(--mix-to)); text-decoration:none; }
a:hover{ text-decoration:underline; }

button{ font-family:inherit; }

::selection{ background:var(--cherry); color:#fff; }

:focus-visible{ outline:2px solid var(--cherry); outline-offset:2px; }
.topbar :focus-visible{ outline-color:var(--on-header); }

/* ---------- top bar ---------- */
.topbar{
  position:sticky; top:0; z-index:20;
  display:flex; align-items:center; flex-wrap:wrap;
  padding-top:env(safe-area-inset-top);
  background:var(--header-bg);
  color:var(--on-header);
}
/* смужка-вишивка під шапкою: ромби хрестиком, 1 піксель = 1 стібок */
.topbar::after{
  content:'';
  order:4; flex:0 0 100%; height:14px;
  background-color:var(--strip-bg);
  background-image:var(--strip-img);
  background-size:14px 14px;
  background-repeat:repeat-x;
  border-bottom:1px solid var(--line-2);
}
.brand{
  order:1;
  font-family:var(--font-head);
  font-weight:700;
  font-size:1.6rem;
  line-height:1;
  display:flex; align-items:center; gap:8px;
  flex-shrink:1;
  min-width:0;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
  padding:10px 0 9px calc(22px + env(safe-area-inset-left));
}
.brand svg{ width:26px; height:26px; flex-shrink:0; }
.brand .b-fruit{ fill:var(--brand-fruit, var(--cherry)); stroke:var(--brand-ring, #fff); stroke-width:1.2; }
.brand .b-stem{ stroke:var(--brand-stem, #4f7a3d); }
.brand .b-leaf{ fill:var(--brand-leaf, var(--leaf)); }
.topbar .brand{ --brand-fruit:var(--brand-fruit-top); --brand-ring:var(--brand-ring-top); --brand-stem:var(--brand-green-top); --brand-leaf:var(--brand-green-top); }

.nav-links{
  order:3; flex:0 0 100%;
  display:flex; align-items:stretch; gap:0;
  flex-wrap:wrap;
  background:var(--nav-bg);
  padding:0 calc(14px + env(safe-area-inset-right)) 0 calc(14px + env(safe-area-inset-left));
}
.nav-link{
  display:inline-flex; align-items:center; gap:6px;
  padding:8px 11px 6px;
  font-size:0.9rem;
  color:var(--nav-text);
  border-bottom:3px solid transparent;
  position:relative;
}
.nav-link svg{ width:15px; height:15px; }
.nav-link:hover{ color:var(--on-header); background:var(--nav-hover-bg); text-decoration:none; }
.nav-link.active{ color:var(--on-header); border-bottom-color:var(--nav-active-line); font-weight:700; }
.nav-badge{
  position:absolute; top:2px; right:-6px;
  min-width:16px; height:16px; padding:0 4px;
  border-radius:3px;
  background:var(--badge-bg);
  color:var(--badge-fg);
  font-size:0.68rem; font-weight:700;
  display:flex; align-items:center; justify-content:center;
  line-height:1;
}

.who{
  order:2; margin-left:auto;
  display:flex; align-items:center; gap:10px;
  font-size:0.95rem; color:var(--on-header);
  flex-shrink:0;
  padding:8px calc(20px + env(safe-area-inset-right)) 8px 12px;
}
.who .avatar{ width:34px; height:34px; flex-shrink:0; background:var(--who-avatar-bg); color:var(--who-avatar-text); }
.who a{ color:var(--on-header); }
.who span{ max-width:130px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.logout-btn{
  border:1px solid var(--header-line);
  background:transparent;
  color:var(--on-header);
  padding:4px 11px;
  border-radius:4px;
  font-family:var(--font-ui);
  font-size:0.88rem;
  cursor:pointer;
}
.logout-btn:hover{ background:var(--header-hover); text-decoration:none; }

/* перемикач теми */
.theme-toggle{
  width:32px; height:32px; flex-shrink:0; padding:0;
  display:inline-flex; align-items:center; justify-content:center;
  background:transparent; color:var(--on-header);
  border:1px solid var(--header-line); border-radius:4px; cursor:pointer;
}
.theme-toggle:hover{ background:var(--header-hover); }
.theme-toggle svg{ width:17px; height:17px; }
.theme-toggle .i-sun{ display:none; }
:root[data-theme="dark"] .theme-toggle .i-sun{ display:block; }
:root[data-theme="dark"] .theme-toggle .i-moon{ display:none; }
.theme-toggle.floating{
  position:fixed; top:12px; right:12px; z-index:60;
  background:var(--paper); color:var(--text); border-color:var(--line-2);
  box-shadow:0 2px 8px rgba(15,12,8,0.3);
}
.theme-toggle.floating:hover{ background:var(--page); }

/* На планшетах і телефонах пунктів навігації забагато, щоб влізти
   в один рядок. Тому нижче ~760px навігація прокручується
   горизонтально одним рядом (замість переносу на кілька рядків,
   який роздував висоту шапки). */
@media (max-width:760px){
  .brand{ padding-left:calc(14px + env(safe-area-inset-left)); font-size:1.45rem; }
  .who{ padding-right:calc(12px + env(safe-area-inset-right)); }
  .nav-links{
    flex-wrap:nowrap;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
    justify-content:flex-start;
    padding:0 6px;
  }
  .nav-links::-webkit-scrollbar{ display:none; }
  .nav-link{ flex-shrink:0; white-space:nowrap; padding:9px 11px 7px; }
  .who span{ display:none; }
  .topbar::after{ height:7px; background-size:7px 7px; }
}

/* ---------- generic wrapper ---------- */
.feed-wrap{
  max-width:640px;
  margin:0 auto;
  padding:14px 20px 80px;
  background:var(--page);
  border-left:1px solid var(--line-2);
  border-right:1px solid var(--line-2);
  min-height:calc(100vh - 100px);
  min-height:calc(100dvh - 100px);
}
@media (max-width:700px){
  .feed-wrap{ border-left:0; border-right:0; }
}
.page-title{
  font-family:var(--font-head);
  font-weight:700;
  font-size:1.6rem;
  line-height:1.2;
  margin:14px 0 4px;
}
.page-sub{
  color:var(--text-2);
  font-size:0.95rem;
  margin-bottom:16px;
}

/* ---------- search ---------- */
.search-box{
  position:relative;
  margin:12px 0 16px;
}
.search-box svg{
  position:absolute; left:12px; top:50%; transform:translateY(-50%);
  width:16px; height:16px; color:var(--text-2);
}
.search-box input{
  width:100%;
  background:var(--field);
  border:1px solid var(--line-2);
  border-radius:4px;
  padding:9px 12px 9px 36px;
  color:var(--text);
  font-family:var(--font-ui);
  font-size:1rem;
}
.search-box input::placeholder{ color:var(--text-2); }
.search-box input:focus{ outline:none; border-color:var(--accent-dark); box-shadow:0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }

/* ---------- composer ---------- */
.composer{
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:6px;
  padding:14px 16px 16px;
  margin:0 0 22px;
}
.composer-head{
  display:flex; align-items:center; gap:10px;
  margin-bottom:10px;
}
.composer textarea{
  width:100%;
  min-height:76px;
  resize:vertical;
  background:var(--field);
  border:1px solid var(--line-2);
  border-radius:4px;
  padding:10px 12px;
  color:var(--text);
  font-family:var(--font-ui);
  font-size:1rem;
  line-height:1.45;
}
.composer textarea::placeholder{ color:var(--text-2); }
.composer textarea:focus{ outline:none; border-color:var(--accent-dark); box-shadow:0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }

.composer-footer{
  display:flex; align-items:center; justify-content:space-between;
  margin-top:12px;
  gap:10px;
  flex-wrap:wrap;
}
.file-btn{
  display:inline-flex; align-items:center; gap:7px;
  border:1px dashed var(--line-2);
  color:var(--text-2);
  padding:6px 12px;
  border-radius:4px;
  cursor:pointer;
  font-size:0.92rem;
}
.file-btn:hover{ border-color:var(--text-2); color:var(--text); }
.file-btn input{ display:none; }

.publish-btn, .primary-btn{
  background:var(--cherry);
  color:#fff;
  border:1px solid var(--cherry-dark);
  border-bottom-width:2px;
  padding:8px 18px 7px;
  border-radius:4px;
  font-family:var(--font-ui);
  font-weight:700;
  font-size:0.98rem;
  cursor:pointer;
}
.publish-btn:hover, .primary-btn:hover{ background:var(--cherry-dark); }
.publish-btn:active, .primary-btn:active{ transform:translateY(1px); border-bottom-width:1px; padding-bottom:8px; }
.publish-btn:disabled, .primary-btn:disabled{ background:var(--btn-off-bg); border-color:var(--btn-off-line); cursor:not-allowed; transform:none; }

.secondary-btn{
  background:var(--paper);
  color:var(--text);
  border:1px solid var(--line-2);
  border-bottom-width:2px;
  padding:7px 16px 6px;
  border-radius:4px;
  font-family:var(--font-ui);
  font-weight:700;
  font-size:0.98rem;
  cursor:pointer;
}
.secondary-btn:hover{ border-color:var(--text-2); background:var(--page); }
.secondary-btn:active{ transform:translateY(1px); }

.file-preview{
  display:none;
  align-items:center; gap:10px;
  margin-top:10px;
  padding:7px 10px;
  background:var(--page);
  border-radius:4px;
  font-size:0.9rem;
  color:var(--text-2);
}
.file-preview.show{ display:flex; }
.file-preview img.thumb{ width:36px; height:36px; object-fit:cover; border-radius:3px; }
.file-preview .remove-file{
  margin-left:auto; cursor:pointer; color:var(--cherry-ink);
  background:none; border:none; font-size:0.88rem; font-family:inherit;
}

/* ---------- feed ---------- */
.feed{ position:relative; }
.empty-state{
  text-align:center;
  padding:34px 20px;
  color:var(--text-2);
  border:1px dashed var(--line-2);
  border-radius:6px;
  font-size:1rem;
}

.post{
  position:relative;
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:6px;
  padding:14px 16px 10px;
  margin-bottom:12px;
  scroll-margin-top:110px;
}
.post.highlight{ border-color:var(--cherry); outline:2px solid color-mix(in srgb, var(--cherry) 35%, transparent); }

.post-head{
  display:flex; align-items:center; gap:10px;
  margin-bottom:8px;
}
.avatar{
  width:38px; height:38px;
  border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:var(--cherry);
  color:#fff;
  font-family:var(--font-ui);
  font-weight:700;
  flex-shrink:0;
  overflow:hidden;
}
.avatar img{ width:100%; height:100%; object-fit:cover; }
.post-meta{ flex:1; min-width:0; }
.post-meta .name{ font-weight:700; font-size:1rem; }
.post-meta .name a{ color:var(--text); }
.post-meta .time{ font-size:0.82rem; color:var(--text-2); }

.post-text{
  font-size:1.02rem;
  line-height:1.5;
  white-space:pre-wrap;
  word-break:break-word;
  margin-bottom:8px;
}

.post-media img, .post-media video{
  width:100%;
  max-height:420px;
  object-fit:cover;
  border-radius:4px;
  display:block;
  margin-top:8px;
}
.post-media audio{ width:100%; margin-top:8px; }

.file-chip{
  display:flex; align-items:center; gap:10px;
  margin-top:8px;
  padding:9px 12px;
  background:var(--page);
  border:1px solid var(--line);
  border-radius:4px;
  font-size:0.92rem;
}
.file-chip svg{ flex-shrink:0; width:20px; height:20px; color:var(--text-2); }
.file-chip .fname{ flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.file-chip a{ color:var(--cherry-ink); font-weight:700; }

.post-actions{
  display:flex; align-items:center; gap:18px;
  margin-top:10px;
  padding-top:8px;
  border-top:1px solid var(--line);
}
.like-btn, .comment-toggle-btn, .copy-link-btn{
  background:none; border:none; cursor:pointer;
  display:flex; align-items:center; gap:6px;
  color:var(--text-2); font-size:0.92rem;
  font-family:var(--font-ui);
  padding:2px 0;
}
.like-btn svg, .comment-toggle-btn svg, .copy-link-btn svg{ width:16px; height:16px; }
.like-btn.liked{ color:var(--cherry-ink); }
.like-btn:hover, .comment-toggle-btn:hover{ color:var(--cherry-ink); }
.copy-link-btn{ margin-left:auto; }
.copy-link-btn:hover{ color:var(--text); }
.copy-link-btn.copied{ color:var(--ok); }

.delete-btn{
  margin-left:auto;
  background:none; border:none; cursor:pointer;
  color:var(--text-2); font-size:0.88rem;
  font-family:var(--font-ui);
}
.delete-btn:hover{ color:var(--cherry-ink); }

.block-btn{ color:var(--cherry-ink); border-color:var(--err-line); }
.block-btn:hover{ background:var(--cherry-soft); }
.block-btn.blocked{ color:var(--text); border-color:var(--line-2); }

.profile-reel-grid{
  display:grid; grid-template-columns:repeat(auto-fill, minmax(140px, 1fr));
  gap:10px;
}
.profile-reel-card{
  position:relative; display:block; aspect-ratio:9/16;
  border-radius:6px; overflow:hidden; background:#1f1b18;
  border:1px solid var(--line); text-decoration:none;
}
.profile-reel-card video, .profile-reel-card img{
  width:100%; height:100%; object-fit:cover; display:block; pointer-events:none;
}
.profile-reel-card .likes-badge{
  position:absolute; left:8px; bottom:8px; z-index:2;
  display:flex; align-items:center; gap:4px;
  background:rgba(20,16,12,0.72); color:#fff;
  padding:2px 7px; border-radius:3px; font-size:0.78rem;
}
.profile-reel-card .likes-badge svg{ width:11px; height:11px; }
.profile-reel-card .play-badge{
  position:absolute; top:8px; left:8px; z-index:2;
  color:#fff; filter:drop-shadow(0 1px 3px rgba(0,0,0,0.6));
}
.profile-reel-card .play-badge svg{ width:16px; height:16px; }
.profile-reel-card .reel-grid-delete{
  position:absolute; top:8px; right:8px; z-index:2;
  width:26px; height:26px; border-radius:50%;
  background:rgba(20,16,12,0.72); border:1px solid rgba(255,255,255,0.35);
  color:#fff; display:flex; align-items:center; justify-content:center;
  cursor:pointer;
}
.profile-reel-card .reel-grid-delete:hover{ background:var(--cherry); }
.profile-reel-card .reel-grid-delete svg{ width:13px; height:13px; }

/* ---------- comments ---------- */
.comments-section{
  display:none;
  margin-top:10px;
  padding-top:12px;
  border-top:1px solid var(--line);
}
.comments-section.open{ display:block; }
.comment-list{ display:flex; flex-direction:column; gap:12px; margin-bottom:12px; }
.comment{ display:flex; gap:9px; }
.comment .avatar{ width:28px; height:28px; font-size:0.78rem; }
.comment-body{
  flex:1;
  background:var(--page);
  border-radius:4px 10px 10px 10px;
  padding:7px 11px;
}
.comment-body .name{ font-weight:700; font-size:0.9rem; }
.comment-body .name a{ color:var(--text); }
.comment-body .text{ font-size:0.95rem; line-height:1.4; word-break:break-word; margin-top:1px; }
.comment-body .time{ font-size:0.76rem; color:var(--text-2); }
.comment-empty{ color:var(--text-2); font-size:0.9rem; padding:2px 0 8px; }

/* ---------- лайки й відповіді на коментарі (у стрічці, спільноті, */
/* коротких відео, відео, музиці, книгах — усюди однаково) ---------- */
.comment-thread{ display:flex; flex-direction:column; }
.comment-meta-row{ display:flex; align-items:center; gap:14px; margin-top:4px; }
.comment-like-btn, .comment-reply-btn, .comment-delete-btn{
  background:none; border:none; cursor:pointer; padding:0;
  display:flex; align-items:center; gap:4px;
  color:var(--text-2); font-size:0.8rem; font-family:var(--font-ui); font-weight:700;
}
.comment-like-btn svg, .comment-delete-btn svg{ width:13px; height:13px; }
.comment-like-btn.liked{ color:var(--cherry-ink); }
.comment-reply-btn:hover, .comment-like-btn:hover{ color:var(--text); }
.comment-delete-btn{ margin-left:auto; }
.comment-delete-btn:hover{ color:var(--cherry-ink); }
.comment-delete-btn:disabled{ opacity:0.5; cursor:default; }

.comment-reply-form-wrap{ display:none; margin:8px 0 0 38px; }
.comment-reply-form-wrap.open{ display:block; }
.comment-reply-form{ display:flex; gap:6px; }
.comment-reply-form input{
  flex:1; background:var(--field); border:1px solid var(--line-2);
  border-radius:4px; padding:6px 10px; color:var(--text);
  font-family:var(--font-ui); font-size:0.9rem;
}
.comment-reply-form input::placeholder{ color:var(--text-2); }
.comment-reply-form input:focus{ outline:none; border-color:var(--accent-dark); }
.comment-reply-form button{
  background:var(--accent-dark); color:#fff; border:none;
  padding:0 12px; border-radius:4px; font-weight:700; font-size:0.84rem; cursor:pointer;
}
.comment-reply-form button:hover{ background:var(--accent); color:var(--ink); }

.comment-replies-toggle{
  display:flex; align-items:center; gap:6px; margin:8px 0 0 38px;
  background:none; border:none; cursor:pointer; padding:0;
  color:var(--text-2); font-size:0.84rem; font-weight:700; font-family:var(--font-ui);
  align-self:flex-start;
}
.comment-replies-toggle:hover{ color:var(--text); }
.comment-replies-toggle .chev{ width:12px; height:12px; transition:transform .15s ease; }
.comment-replies-toggle.expanded .chev{ transform:rotate(180deg); }
.comment-replies{
  display:none; flex-direction:column; gap:12px;
  margin:12px 0 0 38px; padding-left:12px; border-left:2px solid var(--line);
}
.comment-replies.expanded{ display:flex; }
.comment-replies .comment-reply-form-wrap{ margin-left:0; }
.comment-replies .comment-replies-toggle{ margin-left:0; }

.comment-form{ display:flex; gap:6px; }
.comment-form input{
  flex:1;
  background:var(--field);
  border:1px solid var(--line-2);
  border-radius:4px;
  padding:8px 11px;
  color:var(--text);
  font-family:var(--font-ui);
  font-size:0.95rem;
}
.comment-form input::placeholder{ color:var(--text-2); }
.comment-form input:focus{ outline:none; border-color:var(--accent-dark); box-shadow:0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.comment-form button{
  background:var(--accent-dark);
  color:#fff;
  border:none;
  padding:0 14px;
  border-radius:4px;
  font-weight:700;
  font-size:0.9rem;
  cursor:pointer;
}
.comment-form button:hover{ background:var(--accent); color:var(--ink); }
.comment-form .sticker-btn{
  background:var(--field);
  border:1px solid var(--line-2);
  width:36px; height:36px; padding:0;
  border-radius:4px;
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0;
}
.comment-form .sticker-btn:hover{ background:var(--page); border-color:var(--text-2); color:inherit; }
.comment-form .sticker-btn svg{ width:16px; height:16px; color:var(--text-2); }

/* ---------- стікери (коментарі, чат, розділ стікерів) ---------- */
.sticker-box{
  position:relative;
  width:100px; height:100px;
  display:inline-flex; align-items:center; justify-content:center;
  border-radius:6px;
  overflow:visible;
}
.sticker-box img{ width:100%; height:100%; object-fit:contain; }
.comment-body .sticker-box{ width:72px; height:72px; margin:2px 0; }
.sticker-missing{ font-size:0.84rem; color:var(--text-2); font-style:italic; }
.sticker-save-btn{
  position:absolute; top:-6px; right:-6px;
  width:24px; height:24px; border-radius:50%;
  background:var(--paper); border:1px solid var(--line-2);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; color:var(--text);
  opacity:0; transform:scale(0.85); pointer-events:none;
  transition:opacity .15s ease, transform .15s ease;
}
.sticker-box.show-save .sticker-save-btn,
.sticker-box:hover .sticker-save-btn{ opacity:1; transform:scale(1); pointer-events:auto; }
.sticker-save-btn svg{ width:12px; height:12px; }
.sticker-save-btn.saved{ color:var(--ok); opacity:1; pointer-events:auto; }
.sticker-save-btn:disabled{ cursor:default; }
.sticker-box img{ cursor:pointer; }

.sticker-picker-panel{
  position:absolute;
  width:280px; max-width:calc(100vw - 20px); max-height:340px;
  background:var(--paper);
  border:1px solid var(--line-2);
  border-radius:6px;
  padding:10px;
  z-index:500;
  box-shadow:0 6px 18px rgba(30,20,10,0.28);
}
.sticker-picker-search{
  width:100%; box-sizing:border-box;
  background:var(--field);
  border:1px solid var(--line-2);
  border-radius:4px;
  padding:7px 10px;
  color:var(--text);
  font-family:var(--font-ui);
  font-size:0.9rem;
  margin-bottom:8px;
}
.sticker-picker-search::placeholder{ color:var(--text-2); }
.sticker-picker-search:focus{ outline:none; border-color:var(--accent-dark); }
.sticker-picker-grid{
  display:grid; grid-template-columns:repeat(4, 1fr); gap:6px;
  max-height:240px; overflow-y:auto;
}
.sticker-picker-item{
  background:var(--page);
  border:1px solid transparent;
  border-radius:4px;
  padding:4px;
  cursor:pointer;
  aspect-ratio:1;
}
.sticker-picker-item:hover{ border-color:var(--text-2); }
.sticker-picker-item img{ width:100%; height:100%; object-fit:contain; }
.sticker-picker-empty{
  grid-column:1 / -1;
  font-size:0.88rem; color:var(--text-2); text-align:center; padding:20px 8px; line-height:1.5;
}

/* ---------- auth pages ---------- */
.auth-wrap{
  min-height:100vh;
  display:flex; align-items:center; justify-content:center;
  padding:20px;
}
.auth-card{
  position:relative;
  width:100%; max-width:400px;
  background:var(--paper);
  border:1px solid var(--line-2);
  border-radius:6px;
  padding:42px 32px 30px;
  box-shadow:0 8px 28px rgba(15,12,8,0.35);
  overflow:hidden;
}
.auth-card::before{
  content:'';
  position:absolute; left:0; right:0; top:0; height:14px;
  background-color:var(--strip-bg);
  background-image:var(--strip-img);
  background-size:14px 14px;
  border-bottom:1px solid var(--line);
}
.auth-card .brand{ justify-content:center; margin-bottom:6px; padding:0; font-size:2rem; color:var(--brand-auth); overflow:visible; }
.auth-card .brand svg{ width:34px; height:34px; }
.auth-card h1{
  font-family:var(--font-head);
  font-weight:700;
  font-size:1.25rem;
  text-align:center;
  margin-bottom:22px;
  color:var(--text-2);
}
.field{ margin-bottom:14px; }
.field label{ display:block; font-size:0.92rem; font-weight:700; color:var(--text); margin-bottom:4px; }
.field input, .field select{
  width:100%;
  background:var(--field);
  border:1px solid var(--line-2);
  border-radius:4px;
  padding:9px 11px;
  color:var(--text);
  font-family:var(--font-ui);
  font-size:1rem;
}
.field select{ cursor:pointer; }
.field input:focus, .field select:focus{ outline:none; border-color:var(--accent-dark); box-shadow:0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.field .hint{ font-size:0.84rem; color:var(--text-2); margin-top:4px; }
.checkbox-field input[type="checkbox"]{
  width:16px; height:16px; padding:0; border-radius:3px; flex-shrink:0; accent-color:var(--cherry);
}
.auth-error{
  background:var(--cherry-soft);
  border:1px solid var(--err-line);
  color:var(--err-text);
  padding:9px 12px;
  border-radius:4px;
  font-size:0.92rem;
  margin-bottom:14px;
  display:none;
}
.auth-error.show{ display:block; }
.auth-submit{ width:100%; margin-top:4px; padding:10px 12px 9px; }
.auth-switch{
  text-align:center;
  margin-top:18px;
  font-size:0.95rem;
  color:var(--text-2);
}
.auth-switch button{
  background:none; border:none; color:var(--cherry-ink);
  cursor:pointer; font-weight:700; font-size:0.95rem; font-family:inherit;
  text-decoration:underline;
}

/* ---------- captcha ---------- */
.captcha-box{
  display:flex; justify-content:center; align-items:center;
  min-height:65px; margin:4px 0 14px;
}
.captcha-box.captcha-failed{
  min-height:0; padding:9px 12px; border-radius:4px;
  font-size:0.88rem; color:var(--err-text); text-align:center;
  background:var(--cherry-soft); border:1px solid var(--err-line);
}
.captcha-builtin{
  flex-direction:column; align-items:stretch; gap:8px;
  background:var(--page);
  border:1px solid var(--line); border-radius:4px;
  padding:10px; margin:4px 0 14px;
}
.captcha-label{ font-size:0.88rem; color:var(--text-2); }
.captcha-row{ display:flex; align-items:center; gap:8px; }
.captcha-img{
  display:block; flex:1; min-width:0; max-width:200px; height:auto; aspect-ratio:200/70;
  border-radius:3px; background:#f3ead9; user-select:none; -webkit-user-drag:none;
}
.captcha-img.loading{ opacity:0.4; }
.captcha-refresh{
  flex:0 0 auto; width:38px; height:38px; border-radius:4px; cursor:pointer;
  background:var(--paper); border:1px solid var(--line-2);
  color:var(--text); font-size:1.15rem; line-height:1;
}
.captcha-refresh:hover{ border-color:var(--text-2); }
.captcha-input{
  width:100%; box-sizing:border-box;
  background:var(--field); border:1px solid var(--line-2);
  border-radius:4px; padding:9px 11px; color:var(--text);
  font-family:var(--font-ui); font-size:1.05rem;
  letter-spacing:0.18em; text-transform:uppercase;
}
.captcha-input::placeholder{ letter-spacing:normal; text-transform:none; color:var(--text-2); font-size:0.95rem; }
.captcha-input:focus{ outline:none; border-color:var(--accent-dark); }
.captcha-note{ font-size:0.86rem; color:var(--text-2); min-height:0; }
.captcha-note:empty{ display:none; }
.captcha-note.bad{ color:var(--bad); }

/* ---------- profile ---------- */
.profile-hero{
  display:flex; align-items:center; gap:16px;
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:6px;
  padding:18px;
  margin:0 0 14px;
}
.profile-hero .avatar{
  width:76px; height:76px; font-size:1.7rem;
  flex-shrink:0;
}
.avatar-upload{ position:relative; }
.avatar-upload label{
  position:absolute; bottom:-2px; right:-2px;
  width:26px; height:26px;
  background:var(--cherry);
  border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
  border:2px solid var(--paper);
}
.avatar-upload label svg{ width:13px; height:13px; }
.avatar-upload input{ display:none; }
.profile-hero .name{ font-family:var(--font-head); font-weight:700; font-size:1.35rem; }
.profile-hero .joined{ font-size:0.9rem; color:var(--text-2); margin-top:3px; }
.profile-hero .profile-stats{ font-size:0.9rem; color:var(--text-2); margin-top:5px; }

.settings-card{
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:6px;
  padding:16px 18px 18px;
  margin-bottom:14px;
}
.settings-card h2{
  font-size:1.1rem;
  font-weight:700;
  padding-bottom:8px;
  margin-bottom:12px;
  border-bottom:1px solid var(--line);
  display:flex; align-items:center; gap:8px;
}
.settings-card h2 svg{ width:17px; height:17px; color:var(--text-2); }
.form-row{ display:flex; gap:10px; flex-wrap:wrap; align-items:flex-end; }
.form-row .field{ flex:1; min-width:160px; margin-bottom:0; }
.status-msg{
  font-size:0.9rem; margin-top:10px;
  padding:7px 11px; border-radius:4px;
  display:none;
}
.status-msg.show{ display:block; }
.status-msg.ok{ background:var(--ok-bg); color:var(--ok-text); display:block; }
.status-msg.err{ background:var(--cherry-soft); color:var(--err-text); display:block; }

.theme-row{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.theme-bg-preview{
  width:56px; height:56px; border-radius:4px; flex-shrink:0;
  background:var(--bg-image) center/cover no-repeat;
  border:1px solid var(--line-2);
}
input[type="color"]{
  width:44px; height:36px; padding:2px;
  border:1px solid var(--line-2); border-radius:4px;
  background:var(--field); cursor:pointer;
}
input[type="range"]{
  -webkit-appearance:none; appearance:none;
  width:100%; height:4px; border-radius:2px;
  background:var(--line-2); outline:none; cursor:pointer;
}
input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance:none; width:15px; height:15px; border-radius:50%;
  background:var(--accent); border:2px solid var(--ink); cursor:pointer; margin-top:-5.5px;
}
input[type="range"]::-moz-range-thumb{
  width:15px; height:15px; border-radius:50%;
  background:var(--accent); border:2px solid var(--ink); cursor:pointer;
}
input[type="range"]::-moz-range-track{ height:4px; border-radius:2px; background:var(--line-2); }
input[type="range"]:disabled{ opacity:0.4; cursor:not-allowed; }
.theme-hint{ font-size:0.86rem; color:var(--text-2); margin-top:6px; line-height:1.5; }

.tab-row{
  display:flex; gap:0; margin:0 0 14px;
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:6px;
  padding:0 6px;
  /* Розділів у профілі багато — вкладки гортаються вбік, а не вилазять за екран. */
  overflow-x:auto; scrollbar-width:none; -webkit-overflow-scrolling:touch;
}
.tab-row::-webkit-scrollbar{ display:none; }
.tab-row .tab-btn{ flex-shrink:0; white-space:nowrap; }
.tab-btn{
  background:transparent; border:none; border-bottom:3px solid transparent;
  color:var(--text-2); padding:10px 12px 8px; border-radius:0;
  font-family:var(--font-ui); font-size:0.98rem; cursor:pointer;
}
.tab-btn:hover{ color:var(--text); }
.tab-btn.active{ color:var(--text); font-weight:700; border-bottom-color:var(--accent-dark); }

/* ---------- communities ---------- */
.community-grid{
  display:flex; flex-direction:column; gap:12px;
  margin-top:8px;
}
.community-card{
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:6px;
  padding:14px 16px;
  cursor:pointer;
}
.community-card:hover{ border-color:var(--accent-dark); }
.community-card-head{ display:flex; align-items:center; gap:12px; }
.community-icon{
  width:44px; height:44px; border-radius:6px;
  background:var(--accent-dark);
  color:#fff;
  display:flex; align-items:center; justify-content:center;
  font-family:var(--font-head); font-weight:700; font-size:1.25rem;
  flex-shrink:0;
  overflow:hidden;
}
.community-icon img{ width:100%; height:100%; object-fit:cover; }
.community-card-head .cname{ font-weight:700; font-size:1.08rem; }
.community-card-head .cmeta{ font-size:0.86rem; color:var(--text-2); }
.community-desc{ font-size:0.95rem; color:var(--text-2); margin-top:8px; line-height:1.45; }
.community-card-foot{ display:flex; justify-content:space-between; align-items:center; margin-top:10px; }
.member-pill{
  font-size:0.84rem; color:var(--text-2);
  background:var(--page);
  padding:2px 8px; border-radius:3px;
}
.join-btn{
  background:var(--paper); border:1px solid var(--accent-dark);
  color:color-mix(in srgb, var(--accent) 60%, var(--mix-to)); padding:4px 14px; border-radius:4px;
  font-family:var(--font-ui);
  font-size:0.9rem; font-weight:700; cursor:pointer;
}
.join-btn:hover{ background:var(--page); }
.join-btn.joined{ background:var(--accent-dark); border-color:var(--accent-dark); color:#fff; }
.private-pill{
  font-size:0.74rem; font-weight:700; color:var(--text-2);
  background:var(--page); border:1px solid var(--line);
  padding:0 6px; border-radius:3px; margin-left:6px; vertical-align:middle;
}

/* ---------- групи: чат на кількох людей поверх community-detail ---------- */
.msg .group-msg-avatar{ width:30px; height:30px; border-radius:50%; overflow:hidden; flex-shrink:0; margin-right:8px; align-self:flex-end; }
.msg.theirs{ align-items:flex-end; }
.group-msg-sender{ font-size:0.82rem; font-weight:700; color:color-mix(in srgb, var(--accent) 60%, var(--mix-to)); margin-bottom:2px; }


.community-detail{
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:6px;
  padding:18px;
  margin:12px 0;
}
.community-detail-head{ display:flex; align-items:flex-start; gap:14px; }
.community-detail-head .info{ flex:1; }
.community-detail-head .cname{ font-family:var(--font-head); font-weight:700; font-size:1.3rem; }
.back-link{
  display:inline-flex; align-items:center; gap:6px;
  color:var(--text-2); font-size:0.92rem; margin-top:4px;
  cursor:pointer;
}
.back-link:hover{ color:var(--text); }
.back-link svg{ width:15px; height:15px; }

/* ---------- modal ---------- */
.modal-overlay{
  position:fixed; inset:0; z-index:50;
  background:rgba(22,16,10,0.62);
  display:none;
  align-items:center; justify-content:center;
  padding:20px;
}
.modal-overlay.show{ display:flex; }
.modal-card{
  width:100%; max-width:420px;
  max-height:92dvh; overflow-y:auto;
  background:var(--paper);
  border:1px solid var(--line-2);
  border-radius:6px;
  padding:22px;
  box-shadow:0 10px 30px rgba(15,12,8,0.4);
}
.modal-card h3{
  font-family:var(--font-head); font-size:1.2rem;
  margin-bottom:16px;
}
.modal-actions{ display:flex; gap:10px; justify-content:flex-end; margin-top:16px; }

/* ---------- notifications ---------- */
.notif-list{ display:flex; flex-direction:column; gap:8px; margin-top:8px; }
.notif-item{
  display:flex; gap:12px; align-items:flex-start;
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:6px;
  padding:11px 14px;
  cursor:pointer;
}
.notif-item:hover{ border-color:var(--text-2); }
.notif-item.unread{ border-color:var(--err-line); background:var(--tint-red); }
.notif-icon{
  width:34px; height:34px; border-radius:50%; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  background:var(--cherry);
}
.notif-icon svg{ width:16px; height:16px; }
.notif-icon.comment-type{ background:var(--leaf-dark); }
.notif-icon.follow-type{ background:#3b6ea5; }
.notif-body .txt{ font-size:0.98rem; line-height:1.4; }
.notif-body .txt b{ font-weight:700; }
.notif-body .snippet{ font-size:0.9rem; color:var(--text-2); margin-top:3px; font-style:italic; }
.notif-body .time{ font-size:0.8rem; color:var(--text-2); margin-top:4px; }
.notif-dot{
  width:8px; height:8px; border-radius:50%; background:var(--cherry);
  flex-shrink:0; margin-top:7px;
}
.notif-actions-row{ display:flex; justify-content:flex-end; margin:12px 0 6px; }
.link-btn{
  background:none; border:none; color:color-mix(in srgb, var(--accent) 60%, var(--mix-to));
  font-family:inherit;
  font-size:0.92rem; cursor:pointer; text-decoration:underline;
}

/* ---------- admin panel ---------- */
.admin-stats-row{ display:flex; gap:12px; margin:14px 0; flex-wrap:wrap; }
.admin-stat-card{
  background:var(--paper); border:1px solid var(--line); border-radius:6px;
  padding:12px 18px; flex:1; min-width:150px;
}
.admin-stat-num{ font-family:var(--font-head); font-size:1.9rem; font-weight:700; color:var(--text); }
.admin-stat-label{ font-size:0.9rem; color:var(--text-2); margin-top:2px; }

.admin-user-list{ display:flex; flex-direction:column; gap:8px; margin-top:14px; }
.admin-user-row{
  display:flex; align-items:center; gap:14px;
  background:var(--paper); border:1px solid var(--line); border-radius:6px;
  padding:10px 14px;
}
.admin-user-row.banned{ opacity:0.72; border-color:var(--err-line); }
.avatar-wrap{ position:relative; flex-shrink:0; }
.admin-user-info{ flex:1; min-width:0; }
.admin-user-info .name{ font-weight:700; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.admin-user-info .meta{ font-size:0.86rem; color:var(--text-2); margin-top:2px; }
.online-dot{
  position:absolute; bottom:0; right:0; width:11px; height:11px;
  border-radius:50%; background:#9b9288; border:2px solid var(--paper);
}
.online-dot.on{ background:#2e9e4f; }
.you-pill{
  font-size:0.76rem; font-weight:700; color:var(--text-2);
  background:var(--page); padding:1px 7px; border-radius:3px;
}
.banned-pill{ color:var(--cherry-ink); font-weight:700; }
.online-pill{ color:var(--ok); font-weight:700; }
.ad-pill{
  display:inline-block; font-size:0.74rem; font-weight:700; color:var(--cherry-ink);
  background:var(--cherry-soft); padding:1px 7px; border-radius:3px; margin-right:4px;
}
.ad-post{ border-style:dashed; border-color:var(--err-line); }
.ad-post-icon{
  width:40px; height:40px; border-radius:50%; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  background:var(--cherry-soft); color:var(--cherry-ink);
}
.ad-post-icon svg{ width:19px; height:19px; }

/* ---------- сторінка стікерів ---------- */
.stickers-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:14px; margin-bottom:6px; }
.sticker-add-btn{
  width:44px; height:44px; border-radius:6px; flex-shrink:0;
  background:var(--accent-dark); color:#fff;
  border:none; font-size:1.6rem; line-height:1; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
}
.sticker-add-btn:hover{ background:var(--accent); color:var(--ink); }

.sticker-gallery-grid{
  display:grid; grid-template-columns:repeat(auto-fill, minmax(140px, 1fr));
  gap:12px; margin-top:14px;
}
.sticker-gallery-item{
  background:var(--paper); border:1px solid var(--line); border-radius:6px;
  padding:12px; display:flex; flex-direction:column; align-items:center; gap:8px;
  text-align:center;
}
.sticker-gallery-item .sticker-box{ width:100px; height:100px; }
.sticker-gallery-name{ font-weight:700; font-size:0.95rem; word-break:break-word; }
.sticker-gallery-author{ font-size:0.84rem; color:var(--text-2); }
.sticker-gallery-actions{ display:flex; flex-direction:column; gap:6px; width:100%; }
.sticker-gallery-actions button, .sticker-gallery-item > button{ width:100%; font-size:0.84rem; padding:5px 10px; }

.sticker-source-panel{ margin-top:4px; }
.sticker-source-preview{ margin-top:10px; }
.sticker-source-preview img{ max-width:160px; max-height:160px; border-radius:6px; display:block; }
.draw-toolbar{ display:flex; align-items:center; gap:12px; margin-bottom:10px; }
.draw-toolbar input[type="range"]{ flex:1; }
#drawCanvas{
  width:100%; max-width:360px; aspect-ratio:1;
  background:#ffffff; border-radius:4px; border:1px solid var(--line-2);
  touch-action:none; cursor:crosshair; display:block; margin:0 auto;
}

/* ---------- чати ---------- */
.chats-wrap{ max-width:1100px; width:100%; margin:0 auto; padding:12px 20px 14px; box-sizing:border-box; }
.chats-layout{
  display:flex; height:100%;
  border:1px solid var(--line-2); border-radius:6px; overflow:hidden;
  background:var(--paper);
}
.chats-sidebar{
  width:320px; flex-shrink:0;
  border-right:1px solid var(--line);
  display:flex; flex-direction:column;
  padding:14px; box-sizing:border-box;
  overflow-y:auto;
}
.chats-sidebar-head{ font-family:var(--font-head); font-weight:700; font-size:1.3rem; margin-bottom:10px; }
.chats-search-results{
  display:none; flex-direction:column; gap:2px; margin:8px 0;
  max-height:220px; overflow-y:auto;
  border:1px solid var(--line); border-radius:4px; padding:4px;
  background:var(--page);
}
.chats-search-results.show{ display:flex; }
.chats-search-empty{ font-size:0.88rem; color:var(--text-2); padding:10px; text-align:center; }
.chats-list{ display:flex; flex-direction:column; gap:2px; margin-top:6px; flex:1; overflow-y:auto; }
.chat-list-item{ display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:4px; cursor:pointer; }
.chat-list-item:hover{ background:var(--page); }
.chat-list-item.active{ background:var(--sel); }
.chat-list-info{ flex:1; min-width:0; }
.chat-list-info .name{ font-weight:700; font-size:0.98rem; }
.chat-list-info .preview{ font-size:0.86rem; color:var(--text-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:1px; }
.chat-unread-badge{ background:var(--cherry); color:#fff; font-size:0.76rem; font-weight:700; padding:1px 6px; border-radius:3px; flex-shrink:0; }

.chat-panel{ flex:1; display:flex; flex-direction:column; min-width:0; background:var(--page); }
.chat-empty-state{ flex:1; display:flex; align-items:center; justify-content:center; color:var(--text-2); font-size:1rem; text-align:center; padding:30px; }
.chat-active{ flex:1; display:flex; flex-direction:column; min-height:0; }
.chat-active-head{ display:flex; align-items:center; gap:10px; padding:10px 14px; border-bottom:1px solid var(--line); background:var(--paper); flex-shrink:0; }
.chat-back-btn{ display:none; background:none; border:none; color:var(--text); cursor:pointer; padding:4px; flex-shrink:0; }
.chat-back-btn svg{ width:20px; height:20px; }
.chat-partner-link{ display:flex; align-items:center; gap:10px; text-decoration:none; color:inherit; flex:1; min-width:0; }
.chat-partner-link .name{ font-weight:700; }

.chat-head-menu-wrap{ position:relative; flex-shrink:0; }
.chat-head-menu{
  display:none; position:absolute; top:calc(100% + 6px); right:0; z-index:20;
  background:var(--paper); border:1px solid var(--line-2); border-radius:6px;
  min-width:220px; padding:4px; box-shadow:0 6px 18px rgba(30,20,10,0.28);
  flex-direction:column; gap:1px;
}
.chat-head-menu.show{ display:flex; }
.chat-head-menu-item{
  background:none; border:none; text-align:left; color:var(--text); cursor:pointer;
  padding:8px 10px; border-radius:3px; font-family:var(--font-ui); font-size:0.95rem;
}
.chat-head-menu-item:hover{ background:var(--page); }
.chat-head-menu-item:disabled{ opacity:0.5; cursor:default; }
.chat-head-menu-item.danger{ color:var(--cherry-ink); }

.chat-messages{ flex:1; overflow-y:auto; padding:14px; display:flex; flex-direction:column; gap:8px; }
.chat-date-divider{ display:flex; justify-content:center; margin:6px 0; }
.chat-date-divider span{
  font-size:0.8rem; font-weight:700; color:var(--text-2);
  background:var(--veil-soft);
  padding:2px 10px; border-radius:3px;
}
.msg{ display:flex; }
.msg.mine{ justify-content:flex-end; }
.msg.theirs{ justify-content:flex-start; }
.msg-bubble{
  max-width:70%;
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:3px 10px 10px 10px;
  padding:7px 11px;
}
.msg.mine .msg-bubble{ background:var(--accent-dark); border-color:var(--accent-dark); color:#fff; border-radius:10px 3px 10px 10px; }
.msg-text{ font-size:0.98rem; line-height:1.4; white-space:pre-wrap; word-break:break-word; }
.msg-foot{ display:flex; align-items:center; justify-content:flex-end; gap:6px; margin-top:3px; }
.msg-time{ font-size:0.74rem; color:var(--text-2); }
.msg-delete-btn{
  background:none; border:none; cursor:pointer; padding:0; display:flex;
  color:var(--text-2);
}
.msg.mine .msg-time, .msg.mine .msg-delete-btn{ color:rgba(255,255,255,0.78); }
.msg-delete-btn svg{ width:12px; height:12px; }
.msg-delete-btn:hover{ color:var(--cherry-ink); }
.msg.mine .msg-delete-btn:hover{ color:#fff; }
.msg-delete-btn:disabled{ opacity:0.5; cursor:default; }
.msg-media img, .msg-media video{ max-width:min(240px, 100%); max-height:280px; border-radius:4px; display:block; }
.msg-audio audio{ width:220px; max-width:60vw; }
.msg .sticker-box{ width:120px; height:120px; }

.chat-composer{ display:flex; align-items:center; gap:6px; padding:10px 14px; border-top:1px solid var(--line); background:var(--paper); flex-shrink:0; }
.chat-icon-btn{
  background:none; border:none; color:var(--text-2); cursor:pointer;
  width:34px; height:34px; border-radius:4px; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
}
.chat-icon-btn:hover{ background:var(--page); color:var(--text); }
.chat-icon-btn svg{ width:19px; height:19px; }
.chat-composer input[type="text"]{
  flex:1; background:var(--field); border:1px solid var(--line-2);
  border-radius:4px; padding:8px 11px; color:var(--text);
  font-family:var(--font-ui); font-size:0.98rem;
}
.chat-composer input[type="text"]::placeholder{ color:var(--text-2); }
.chat-composer input[type="text"]:focus{ outline:none; border-color:var(--accent-dark); }
.chat-send-btn{
  background:var(--accent-dark); color:#fff; border:none;
  width:36px; height:36px; border-radius:4px; flex-shrink:0; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
}
.chat-send-btn:hover{ background:var(--accent); color:var(--ink); }
.chat-send-btn svg{ width:16px; height:16px; }

.chat-file-preview{ display:flex; align-items:center; gap:8px; padding:7px 14px; font-size:0.88rem; color:var(--text-2); border-top:1px solid var(--line); background:var(--paper); }
.chat-file-preview .remove-file{ background:none; border:none; color:var(--cherry-ink); cursor:pointer; font-size:0.86rem; text-decoration:underline; }

.chat-recording-bar{ display:flex; align-items:center; gap:10px; padding:10px 14px; border-top:1px solid var(--line); background:var(--paper); }
.chat-recording-indicator{ flex:1; display:flex; align-items:center; gap:8px; font-size:0.95rem; }
.rec-dot{ width:10px; height:10px; border-radius:50%; background:var(--cherry); animation:rec-pulse 1s ease-in-out infinite; }
@keyframes rec-pulse{ 0%,100%{ opacity:1; } 50%{ opacity:0.3; } }

@media (max-width:760px){
  .chats-wrap{ padding:0; padding-bottom:env(safe-area-inset-bottom); }
  .chats-layout{ border-radius:0; border-left:0; border-right:0; position:relative; }
  .chats-sidebar{ width:100%; }
  .chat-panel{ display:none; }
  .chats-layout.chat-open .chats-sidebar{ display:none; }
  .chats-layout.chat-open .chat-panel{ display:flex; }
  .chat-back-btn{ display:flex; }
}

/* ---------- короткі відео (reels) ---------- */
.reels-page{
  max-width:560px;
  width:100%;
  margin:0 auto;
  padding:12px 20px 10px;
  display:flex;
  flex-direction:column;
  align-items:center;
  box-sizing:border-box;
  min-height:0;
  background:var(--page);
  border-left:1px solid var(--line-2);
  border-right:1px solid var(--line-2);
}

.reel-composer{
  width:100%;
  max-width:420px;
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:6px;
  padding:10px 14px;
  margin-bottom:10px;
  flex-shrink:0;
}
.reel-composer-head{ display:flex; align-items:center; gap:10px; }
.reel-composer-head strong{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.reel-composer-toggle{
  background:var(--paper);
  border:1px solid var(--line-2);
  border-bottom-width:2px;
  color:var(--text);
  padding:5px 12px 4px;
  border-radius:4px;
  font-family:var(--font-ui);
  font-size:0.9rem;
  font-weight:700;
  cursor:pointer;
  flex-shrink:0;
}
.reel-composer-toggle:hover{ border-color:var(--text-2); background:var(--page); }

.reel-composer-body{ display:none; margin-top:12px; }
.reel-composer-body.show{ display:block; }

.reel-type-tabs{ display:flex; gap:0; margin-bottom:12px; border-bottom:1px solid var(--line); }
.reel-type-tab{
  flex:1;
  background:none;
  border:none;
  border-bottom:3px solid transparent;
  color:var(--text-2);
  padding:7px 10px 6px;
  font-family:var(--font-ui);
  font-size:0.95rem;
  font-weight:700;
  cursor:pointer;
}
.reel-type-tab:hover{ color:var(--text); }
.reel-type-tab.active{ color:var(--text); border-bottom-color:var(--accent-dark); }

.reel-drop-zone{
  display:flex; flex-direction:column; align-items:center; gap:8px;
  border:1px dashed var(--line-2);
  border-radius:4px;
  padding:24px 14px;
  color:var(--text-2);
  font-size:0.95rem;
  cursor:pointer;
  text-align:center;
}
.reel-drop-zone:hover{ border-color:var(--text-2); color:var(--text); }
.reel-drop-zone input{ display:none; }

.reel-file-preview{ display:none; flex-direction:column; align-items:center; gap:10px; margin-top:12px; }
.reel-file-preview.show{ display:flex; }
.reel-file-preview video, .reel-file-preview img{
  max-width:100%; max-height:280px; border-radius:4px; display:none;
}
.reel-file-preview .remove-file{
  background:none; border:none; color:var(--cherry-ink);
  font-size:0.88rem; cursor:pointer; text-decoration:underline;
}

.reel-composer textarea{
  width:100%; min-height:56px; resize:vertical; margin-top:12px;
  background:var(--field);
  border:1px solid var(--line-2);
  border-radius:4px;
  padding:8px 11px;
  color:var(--text);
  font-family:var(--font-ui);
  font-size:1rem; line-height:1.45;
}
.reel-composer textarea::placeholder{ color:var(--text-2); }
.reel-composer textarea:focus{ outline:none; border-color:var(--accent-dark); }

.reel-composer-footer{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:12px; flex-wrap:wrap; }
.reel-hint{ font-size:0.82rem; color:var(--text-2); }

.reels-feed{
  width:100%;
  max-width:420px;
  flex:1;
  min-height:0;
  overflow-y:auto;
  scroll-snap-type:y mandatory;
  border-radius:8px;
  scrollbar-width:none;
}
.reels-feed::-webkit-scrollbar{ display:none; }

.reel-search{ width:100%; max-width:420px; margin:0 0 10px; flex-shrink:0; }
.reel-card[hidden], .reels-no-results[hidden]{ display:none !important; }
.reels-no-results{ scroll-snap-align:start; padding:40px 16px; }

.reel-card{
  position:relative;
  width:100%;
  height:100%;
  scroll-snap-align:start;
  scroll-snap-stop:always;
  border-radius:8px;
  overflow:hidden;
  background:#000;
  margin-bottom:12px;
  border:1px solid #000;
  color:#fff;
}
.reel-card.highlight{ border-color:var(--cherry); outline:2px solid var(--cherry); outline-offset:-2px; }

.reel-media-wrap{ position:absolute; inset:0; }
.reel-media{ width:100%; height:100%; object-fit:cover; display:block; cursor:pointer; }

.reel-pause-indicator{
  position:absolute; inset:0; z-index:2;
  display:flex; align-items:center; justify-content:center;
  pointer-events:none; opacity:0; transition:opacity 0.2s ease;
}
.reel-pause-indicator.show{ opacity:1; }
.reel-pause-indicator svg{
  width:64px; height:64px; color:rgba(255,255,255,0.92);
  filter:drop-shadow(0 3px 10px rgba(0,0,0,0.5));
}

.reel-mute-btn{
  position:absolute; top:12px; right:12px; z-index:3;
  width:36px; height:36px; border-radius:50%;
  background:rgba(20,16,12,0.65); border:1px solid rgba(255,255,255,0.35);
  color:#fff; display:flex; align-items:center; justify-content:center;
  cursor:pointer;
}
.reel-mute-btn svg{ width:16px; height:16px; }

.reel-overlay-bottom{
  position:absolute; left:0; right:70px; bottom:0; z-index:2;
  padding:34px 14px 18px;
  /* затемнення під підписом — лише щоб білий текст читався на будь-якому відео */
  background:linear-gradient(0deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.38) 55%, transparent 100%);
}
.reel-author{
  display:flex; align-items:center; gap:9px;
  text-decoration:none; color:#fff;
  margin-bottom:8px;
}
.reel-author .avatar{ width:34px; height:34px; border:2px solid #fff; }
.reel-author .name{ font-weight:700; font-size:0.98rem; }
.reel-caption{ font-size:0.95rem; line-height:1.4; white-space:pre-wrap; word-break:break-word; margin-bottom:6px; }
.reel-time{ font-size:0.8rem; color:rgba(255,255,255,0.78); }

.reel-actions{
  position:absolute; right:10px; bottom:18px; z-index:3;
  display:flex; flex-direction:column; align-items:center; gap:14px;
}
.reel-action-btn{
  background:rgba(20,16,12,0.65);
  border:1px solid rgba(255,255,255,0.3);
  color:#fff;
  width:46px; height:46px; border-radius:50%;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
  cursor:pointer;
  font-family:var(--font-ui);
}
.reel-action-btn svg{ width:19px; height:19px; }
.reel-action-btn span{ font-size:0.72rem; font-weight:700; }
.reel-action-btn:hover{ border-color:#fff; }
.reel-action-btn.liked{ color:#ff7d8d; border-color:#ff7d8d; }
.reel-action-btn.copied{ color:#7fe0a0; border-color:#7fe0a0; }
.reel-delete-btn{ color:rgba(255,255,255,0.75); }
.reel-delete-btn:hover{ color:#ff7d8d; border-color:#ff7d8d; }

.reel-comments{
  position:absolute; left:0; right:0; bottom:0; z-index:10;
  height:62%;
  background:var(--paper);
  color:var(--text);
  border-top:1px solid var(--line-2);
  border-radius:10px 10px 0 0;
  padding:12px 14px;
  display:flex; flex-direction:column;
  transform:translateY(100%);
  transition:transform .25s ease;
}
.reel-comments.open{ transform:translateY(0); }
.reel-comments-head{
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:10px; flex-shrink:0;
}
.reel-comments-close{
  background:none; border:none; color:var(--text-2);
  font-size:1.1rem; cursor:pointer; padding:4px;
}
.reel-comments-close:hover{ color:var(--text); }
.reel-comments .comment-list{ flex:1; overflow-y:auto; margin-bottom:10px; }
.reel-comments .comment-form{ flex-shrink:0; }

@media (max-width:760px){
  .reels-page{ padding:8px 8px 4px; padding-bottom:calc(4px + env(safe-area-inset-bottom)); max-width:none; border-left:0; border-right:0; }
  .reels-feed{ max-width:100%; border-radius:0; }
  .reel-card{ border-radius:0; border-left:none; border-right:none; margin-bottom:8px; }
  .reel-comments{ border-radius:8px 8px 0 0; }
}

/* ---------- loading ---------- */
.loading-msg{ text-align:center; color:var(--text-2); padding:30px; font-size:0.98rem; }

/* ---------- звичайні (довгі) відео — грід + сторінка перегляду ---------- */
.video-grid{
  display:grid; grid-template-columns:repeat(auto-fill, minmax(240px, 1fr));
  gap:16px; margin-top:8px;
}
.video-card{
  cursor:pointer; border-radius:6px; overflow:hidden;
  background:var(--paper); border:1px solid var(--line);
}
.video-card:hover{ border-color:var(--text-2); }
.video-card:hover .video-card-title{ text-decoration:underline; }
.video-card-thumb{ position:relative; width:100%; aspect-ratio:16/9; background:#1f1b18; }
.video-card-thumb img, .video-card-thumb video{ width:100%; height:100%; object-fit:cover; display:block; pointer-events:none; }
.video-card-thumb .play-badge{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  color:#fff; opacity:0;
  background:rgba(20,16,12,0.28);
}
.video-card-thumb .play-badge svg{ width:40px; height:40px; filter:drop-shadow(0 2px 8px rgba(0,0,0,0.5)); }
.video-card:hover .video-card-thumb .play-badge{ opacity:1; }
.video-card-info{ display:flex; gap:10px; padding:10px 12px 12px; }
.video-card-title{
  font-weight:700; font-size:1rem; line-height:1.3;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
  margin-bottom:3px;
}
.video-card-meta{ font-size:0.84rem; color:var(--text-2); }

.watch-layout{ max-width:900px; margin:14px auto 0; }
.watch-player-wrap{
  width:100%; aspect-ratio:16/9; background:#000;
  border-radius:6px; overflow:hidden; border:1px solid #000;
}
.watch-player-wrap video{ width:100%; height:100%; display:block; }
.watch-title{
  font-family:var(--font-head); font-weight:700; font-size:1.3rem;
  margin-top:14px; line-height:1.3;
}
.watch-meta-row{
  display:flex; align-items:center; gap:14px; flex-wrap:wrap;
  margin-top:8px; padding-bottom:12px; border-bottom:1px solid var(--line);
  font-size:0.92rem; color:var(--text-2);
}
.watch-description{
  font-size:1rem; line-height:1.55; color:var(--text);
  white-space:pre-wrap; word-break:break-word;
  background:var(--paper); border:1px solid var(--line);
  border-radius:6px; padding:12px 14px; margin-top:4px;
}

/* ---------- відео / товари в профілі ---------- */
.profile-video-grid{
  display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr));
  gap:12px;
}
.profile-video-card{
  display:block; border-radius:6px; overflow:hidden; text-decoration:none;
  background:var(--paper); border:1px solid var(--line); position:relative;
}
.profile-video-thumb{ position:relative; width:100%; aspect-ratio:16/9; background:#1f1b18; }
.profile-video-thumb img, .profile-video-thumb video{ width:100%; height:100%; object-fit:cover; display:block; }
.profile-video-thumb .play-badge{ position:absolute; top:8px; left:8px; color:#fff; filter:drop-shadow(0 1px 3px rgba(0,0,0,0.6)); }
.profile-video-thumb .play-badge svg{ width:18px; height:18px; }
.profile-video-info{ padding:8px 12px 10px; }
.profile-video-title{
  font-weight:700; font-size:0.95rem; line-height:1.3; color:var(--text);
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
  margin-bottom:2px;
}
.profile-video-meta{ font-size:0.8rem; color:var(--text-2); }
.profile-video-card .reel-grid-delete{
  position:absolute; top:8px; right:8px; z-index:2;
  width:26px; height:26px; border-radius:50%;
  background:rgba(20,16,12,0.72); border:1px solid rgba(255,255,255,0.35);
  color:#fff; display:flex; align-items:center; justify-content:center;
  cursor:pointer;
}
.profile-video-card .reel-grid-delete:hover{ background:var(--cherry); }
.profile-video-card .reel-grid-delete svg{ width:13px; height:13px; }

.profile-shop-grid{
  display:grid; grid-template-columns:repeat(auto-fill, minmax(160px, 1fr));
  gap:12px;
}
.profile-shop-card{
  display:flex; flex-direction:column; text-decoration:none;
  background:var(--paper); border:1px solid var(--line); border-radius:6px; overflow:hidden;
}
.profile-shop-add{
  align-items:center; justify-content:center; gap:6px; color:var(--text-2);
  min-height:160px; border-style:dashed;
}
.profile-shop-add:hover{ color:var(--text); border-color:var(--text-2); }
.profile-shop-thumb{ position:relative; width:100%; aspect-ratio:1; background:var(--page); }
.profile-shop-thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.profile-shop-noimg{ width:100%; height:100%; display:flex; align-items:center; justify-content:center; font-size:2rem; }
.profile-shop-title{ font-weight:700; font-size:0.92rem; padding:8px 10px 0; color:var(--text); }
.profile-shop-price{ font-size:0.9rem; color:var(--cherry-ink); font-weight:700; padding:2px 10px 10px; }
.promoted-badge, .sold-badge{
  position:absolute; top:8px; left:8px; z-index:2;
  font-size:0.74rem; font-weight:700; padding:2px 7px; border-radius:3px;
}
.promoted-badge{ background:var(--cherry); color:#fff; }
.sold-badge{ background:var(--ink); color:#fff; left:auto; right:8px; }

/* ---------- шопінг: магазин ---------- */
.shop-grid{
  display:grid; grid-template-columns:repeat(auto-fill, minmax(200px, 1fr));
  gap:14px; margin-top:8px;
}
.shop-card{
  cursor:pointer; border-radius:6px; overflow:hidden;
  background:var(--paper); border:1px solid var(--line);
}
.shop-card:hover{ border-color:var(--text-2); }
.shop-card:hover .shop-card-title{ text-decoration:underline; }
.shop-card-thumb{ position:relative; width:100%; aspect-ratio:1; background:var(--page); }
.shop-card-thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.shop-card-noimg{ width:100%; height:100%; display:flex; align-items:center; justify-content:center; font-size:2.2rem; }
.shop-card-info{ padding:9px 12px 11px; }
.shop-card-title{
  font-weight:700; font-size:0.95rem; line-height:1.3; color:var(--text);
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
  margin-bottom:3px;
}
.shop-card-price{ font-size:0.98rem; color:var(--cherry-ink); font-weight:700; }
.shop-card-meta{ font-size:0.8rem; color:var(--text-2); margin-top:2px; }

.category-pill{
  display:inline-block; font-size:0.8rem; font-weight:700; color:var(--text-2);
  background:var(--page); border:1px solid var(--line);
  padding:1px 8px; border-radius:3px;
}

.product-detail-layout{ display:grid; grid-template-columns:1.1fr 1fr; gap:28px; margin-top:12px; }
.product-gallery-main{
  width:100%; aspect-ratio:1; border-radius:6px; overflow:hidden;
  background:var(--paper); border:1px solid var(--line);
  display:flex; align-items:center; justify-content:center;
}
.product-gallery-main img{ width:100%; height:100%; object-fit:cover; display:block; }
.product-gallery-empty{ font-size:3rem; }
.product-gallery-thumbs{ display:flex; gap:8px; margin-top:10px; flex-wrap:wrap; }
.product-gallery-thumbs img{
  width:60px; height:60px; object-fit:cover; border-radius:4px; cursor:pointer;
  border:2px solid transparent; opacity:0.65;
}
.product-gallery-thumbs img.active{ border-color:var(--accent-dark); opacity:1; }

.product-info-col{ min-width:0; }
.product-detail-title{ font-family:var(--font-head); font-weight:700; font-size:1.45rem; line-height:1.25; }
.product-detail-price{ font-size:1.25rem; font-weight:700; color:var(--cherry-ink); margin-top:6px; }
.product-detail-desc{
  font-size:1rem; line-height:1.55; color:var(--text); white-space:pre-wrap; word-break:break-word;
  background:var(--paper); border:1px solid var(--line); border-radius:6px; padding:12px 14px; margin-top:4px;
}
.product-detail-actions{ display:flex; gap:10px; flex-wrap:wrap; margin-top:16px; }

.product-images-preview{ display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; }
.product-image-chip{ position:relative; width:64px; height:64px; border-radius:4px; overflow:hidden; }
.product-image-chip img{ width:100%; height:100%; object-fit:cover; display:block; }
.product-image-chip button{
  position:absolute; top:2px; right:2px; width:18px; height:18px; border-radius:50%;
  background:rgba(20,16,12,0.78); color:#fff; border:none; font-size:0.7rem; line-height:1; cursor:pointer;
}

.orders-list{ display:flex; flex-direction:column; gap:10px; margin-top:8px; }
.order-card{
  background:var(--paper); border:1px solid var(--line); border-radius:6px; padding:12px 16px;
}
.order-card-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.order-title{ font-weight:700; font-size:1.02rem; }
.order-status{
  font-size:0.8rem; font-weight:700; padding:1px 8px; border-radius:3px;
  background:var(--page); color:var(--text-2); flex-shrink:0;
}
.order-status.status-new{ color:var(--st-new-fg); background:var(--st-new-bg); }
.order-status.status-confirmed{ color:var(--st-conf-fg); background:var(--st-conf-bg); }
.order-status.status-shipped{ color:var(--st-ship-fg); background:var(--st-ship-bg); }
.order-status.status-completed{ color:var(--st-done-fg); background:var(--st-done-bg); }
.order-status.status-cancelled{ color:var(--st-bad-fg); background:var(--st-bad-bg); }
.order-meta{ font-size:0.88rem; color:var(--text-2); margin-top:4px; }
.order-actions{ display:flex; gap:8px; margin-top:10px; flex-wrap:wrap; }

.ad-cycle-pill{
  display:inline-block; margin-top:8px; font-size:0.8rem; font-weight:700;
  padding:1px 8px; border-radius:3px;
}
.ad-cycle-pill.on{ color:var(--st-on-fg); background:var(--st-on-bg); }
.ad-cycle-pill.off{ color:var(--st-new-fg); background:var(--st-new-bg); }

.promo-plans{ display:flex; gap:10px; flex-wrap:wrap; margin-top:8px; }
.promo-plan{
  display:flex; flex-direction:column; align-items:center; gap:4px;
  border:1px solid var(--line-2); border-radius:4px; padding:8px 16px;
  cursor:pointer; font-size:0.9rem; color:var(--text-2);
}
.promo-plan input{ display:none; }
.promo-plan strong{ color:var(--text); font-size:1rem; }
.promo-plan.active{ border-color:var(--cherry); box-shadow:inset 0 0 0 1px var(--cherry); color:var(--text); background:var(--tint-red); }
.promo-payment-box{
  margin-top:14px; padding:12px 14px; border-radius:4px;
  background:var(--tint-red); border:1px solid var(--err-line);
}
.promo-card-number{
  font-family:monospace; font-size:1.2rem; letter-spacing:1px; font-weight:700;
  color:var(--text); margin:4px 0;
}

@media (max-width:760px){
  .video-grid{ grid-template-columns:repeat(auto-fill, minmax(160px, 1fr)); gap:12px; }
  .watch-layout{ margin-top:10px; }
  .shop-grid{ grid-template-columns:repeat(auto-fill, minmax(140px, 1fr)); gap:12px; }
  .product-detail-layout{ grid-template-columns:1fr; gap:18px; }
  .music-grid{ grid-template-columns:repeat(auto-fill, minmax(130px, 1fr)); gap:12px; }
}

/* ---------- музика ---------- */
.music-grid{
  display:grid; grid-template-columns:repeat(auto-fill, minmax(160px, 1fr));
  gap:14px; margin-top:8px;
}
.music-card{
  cursor:pointer; border-radius:6px; overflow:hidden;
  background:var(--paper); border:1px solid var(--line);
  padding-bottom:10px;
}
.music-card:hover{ border-color:var(--text-2); }
.music-card:hover .music-card-title{ text-decoration:underline; }
.music-card-cover{ position:relative; width:100%; aspect-ratio:1; background:var(--page); }
.music-card-cover img{ width:100%; height:100%; object-fit:cover; display:block; }
.music-card-nocover{
  width:100%; height:100%; display:flex; align-items:center; justify-content:center;
  color:var(--text-2);
}
.music-card-nocover svg{ width:34%; height:34%; }
.music-card-cover .play-badge{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  color:#fff; opacity:0;
  background:rgba(20,16,12,0.3);
}
.music-card-cover .play-badge svg{ width:34px; height:34px; filter:drop-shadow(0 2px 8px rgba(0,0,0,0.5)); }
.music-card:hover .music-card-cover .play-badge{ opacity:1; }
.music-card-title{
  font-weight:700; font-size:0.95rem; line-height:1.3; padding:9px 12px 2px;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.music-card-meta{ font-size:0.8rem; color:var(--text-2); padding:0 12px; }

.music-player-layout{ max-width:520px; margin:14px auto 0; }
.music-player-cover{
  width:100%; aspect-ratio:1; border-radius:6px; overflow:hidden;
  background:var(--paper); border:1px solid var(--line);
  display:flex; align-items:center; justify-content:center;
  color:var(--text-2);
}
.music-player-cover img{ width:100%; height:100%; object-fit:cover; display:block; }
.music-player-cover svg{ width:30%; height:30%; }
.music-player-title{
  font-family:var(--font-head); font-weight:700; font-size:1.3rem;
  margin-top:14px; line-height:1.3;
}

/* ---------- книги ---------- */
.book-grid{
  display:grid; grid-template-columns:repeat(auto-fill, minmax(150px, 1fr));
  gap:18px; margin-top:8px;
}
.book-card{ cursor:pointer; }
.book-card:hover .book-card-title{ text-decoration:underline; }
.book-card-cover{
  width:100%; aspect-ratio:3/4; border-radius:3px 6px 6px 3px; overflow:hidden;
  background:var(--paper); border:1px solid var(--line-2);
  box-shadow:3px 3px 0 rgba(40,30,20,0.22);
}
.book-card-cover img{ width:100%; height:100%; object-fit:cover; display:block; }
.book-card-nocover{
  width:100%; height:100%; display:flex; align-items:center; justify-content:center; color:var(--text-2);
}
.book-card-nocover svg{ width:36%; height:36%; }
.book-card-title{
  font-weight:700; font-size:0.95rem; line-height:1.3; margin-top:8px;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.book-card-meta{ font-size:0.8rem; color:var(--text-2); margin-top:2px; }

.book-detail-layout{ display:grid; grid-template-columns:220px 1fr; gap:28px; margin-top:12px; }
.book-detail-cover{
  width:100%; aspect-ratio:3/4; border-radius:3px 6px 6px 3px; overflow:hidden;
  background:var(--paper); border:1px solid var(--line-2);
  box-shadow:4px 4px 0 rgba(40,30,20,0.22);
}
.book-detail-cover img{ width:100%; height:100%; object-fit:cover; display:block; }
.book-detail-title{ font-family:var(--font-head); font-weight:700; font-size:1.45rem; line-height:1.25; }
.book-detail-desc{
  font-size:1rem; line-height:1.55; color:var(--text); white-space:pre-wrap; word-break:break-word;
  background:var(--paper); border:1px solid var(--line); border-radius:6px; padding:12px 14px; margin:10px 0;
}
@media (max-width:600px){
  .book-detail-layout{ grid-template-columns:140px 1fr; gap:16px; }
  .book-detail-title{ font-size:1.2rem; }
}
@media (max-width:380px){
  .book-detail-layout{ grid-template-columns:1fr; }
  .book-detail-cover{ max-width:200px; margin:0 auto; }
}

/* ---------- монтаж відео ----------
   Редактор — робочий інструмент, тому його панелі темні
   (як у будь-якому відеомонтажі); решта сайту світла. */
.ed-wrap{ max-width:1320px; }
.ed-layout{ display:grid; grid-template-columns:minmax(0,1fr) 360px; gap:20px; margin-top:10px; align-items:start; }
.ed-stage{ min-width:0; }
.ed-side{ display:flex; flex-direction:column; gap:12px; min-width:0; position:sticky; top:110px; max-height:calc(100dvh - 124px); overflow-y:auto; padding-right:2px; }

.ed-toolbar, .ed-timeline, .ed-tabs, .ed-panel, .ed-inspector, .ed-preview-outer{
  --paper:#2a2521; --field:#38322c; --text:#f1ebe2; --text-2:#b8ada0;
  --line:#4d453d; --line-2:#645b51; --page:#332d28;
  --mix-to:#ffffff;
  color:var(--text);
}

.ed-toolbar{
  display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin-bottom:12px;
  background:var(--paper); border:1px solid #14100d; border-radius:6px; padding:7px 9px;
}
.ed-sep{ width:1px; height:22px; background:var(--line-2); margin:0 4px; }
.ed-spacer{ flex:1; }
.ed-tool{
  background:var(--field); border:1px solid var(--line-2); color:var(--text);
  border-radius:4px; padding:7px 11px; font:inherit; font-size:0.88rem; font-weight:700; cursor:pointer;
  min-height:34px; line-height:1; white-space:nowrap;
}
.ed-tool:hover:not(:disabled){ border-color:#a89d90; }
.ed-tool:disabled{ opacity:0.38; cursor:not-allowed; }
.ed-tool-danger:hover:not(:disabled){ border-color:#ff7d8d; color:#ffb3bd; }
.ed-tool-accent{ background:var(--accent); color:var(--ink); border-color:transparent; }

.ed-preview-outer{ display:flex; justify-content:center; background:#14100d; border-radius:6px; border:1px solid #000; padding:8px; }
.ed-preview-wrap{
  position:relative; background:#000; border-radius:3px; overflow:hidden;
  width:min(100%, 98vh); max-width:100%; aspect-ratio:16/9; touch-action:none;
}
.ed-preview-wrap canvas{ width:100%; height:100%; display:block; outline:none; cursor:default; }
.ed-preview-wrap canvas.grab{ cursor:grab; }
.ed-preview-wrap canvas.grabbing{ cursor:grabbing; }
.ed-preview-wrap canvas.pointer{ cursor:pointer; }
.ed-preview-empty{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  color:#b8ada0; font-size:0.98rem; text-align:center; padding:20px; background:#1a1613;
}
.ed-drop-hint{
  position:absolute; inset:8px; border:2px dashed var(--accent); border-radius:4px; display:none;
  align-items:center; justify-content:center; color:#fff; background:rgba(20,16,12,0.85); font-weight:700; z-index:3;
}
body.ed-dragging .ed-drop-hint{ display:flex; }

.ed-transport{ display:flex; align-items:center; gap:10px; margin:12px 0; }
.ed-transport input[type=range]{ flex:1; min-width:0; }
.editor-play-btn{
  width:42px; height:42px; border-radius:50%; flex-shrink:0;
  background:var(--accent); border:none; color:var(--ink);
  display:flex; align-items:center; justify-content:center; cursor:pointer;
}
.editor-play-btn:disabled{ opacity:0.4; cursor:not-allowed; }
.editor-play-btn svg{ width:18px; height:18px; }
.editor-time{ font-size:0.9rem; color:var(--text-2); white-space:nowrap; font-variant-numeric:tabular-nums; }

.editor-section-title{
  display:flex; align-items:center; gap:10px;
  font-family:var(--font-head); font-weight:700; font-size:1.1rem;
  margin:22px 0 10px;
}

/* ----- таймлайн ----- */
.ed-timeline{ background:var(--paper); border:1px solid #14100d; border-radius:6px; padding:10px 10px 8px; user-select:none; -webkit-user-select:none; }
.ed-tl-bar{ display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.ed-tl-title{ font-weight:700; }
.ed-tl-bar input[type=range]{ width:110px; }
.ed-tl-body{ display:flex; gap:0; }
.ed-tl-labels{ width:58px; flex-shrink:0; padding-top:26px; }
.ed-tl-label{
  display:flex; align-items:center; font-size:0.74rem; color:var(--text-2); font-weight:700;
  border-bottom:1px dashed rgba(255,255,255,0.08);
}
.ed-tl-scroll{ flex:1; min-width:0; overflow-x:auto; overflow-y:hidden; position:relative; border-radius:4px; background:#1a1613; scrollbar-width:thin; }
.ed-tl-inner{ position:relative; min-height:80px; touch-action:pan-x; }
.ed-ruler{ position:relative; height:26px; border-bottom:1px solid var(--line); cursor:pointer; }
.ed-tick{ position:absolute; top:0; bottom:0; border-left:1px solid rgba(255,255,255,0.2); font-size:0.68rem; color:var(--text-2); padding-left:4px; padding-top:6px; pointer-events:none; white-space:nowrap; }
.ed-tick.minor{ top:16px; border-left-color:rgba(255,255,255,0.1); }
.ed-row{ position:relative; border-bottom:1px dashed rgba(255,255,255,0.08); }
.ed-playhead{ position:absolute; top:0; bottom:0; width:2px; background:#ff5a6e; z-index:6; pointer-events:none; }
.ed-playhead::before{ content:''; position:absolute; top:0; left:-5px; width:12px; height:12px; background:#ff5a6e; clip-path:polygon(0 0,100% 0,50% 100%); }

.ed-block{
  position:absolute; top:3px; bottom:3px; border-radius:4px; overflow:hidden; cursor:grab;
  border:2px solid transparent; background:#2c3a24; color:#fff; font-size:0.76rem; font-weight:700;
  display:flex; align-items:center; padding:0 10px; box-shadow:0 1px 3px rgba(0,0,0,0.5); touch-action:none;
}
.ed-block.selected{ border-color:#ffd60a; z-index:4; }
.ed-block.dragging{ cursor:grabbing; opacity:0.88; z-index:5; }
.ed-block .ed-block-label{ position:relative; z-index:2; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; text-shadow:0 1px 3px #000; pointer-events:none; }
.ed-block canvas.wave{ position:absolute; inset:0; width:100%; height:100%; opacity:0.55; pointer-events:none; }
.ed-block.k-video{ background:#1f4a2c center/auto 100% repeat-x; }
.ed-block.k-image{ background:#2a4d6e center/auto 100% repeat-x; }
.ed-block.k-gif{ background:#5b3d7a center/auto 100% repeat-x; }
.ed-block.k-text{ background:#8a5a14; }
.ed-block.k-emoji, .ed-block.k-overlay{ background:#7a2f5a; }
.ed-block.k-music{ background:#1d5e66; }
.ed-block.k-sfx{ background:#7a4d1d; }
.ed-block.k-voice{ background:#7a1d3b; }
.ed-block.k-video::after, .ed-block.k-image::after, .ed-block.k-gif::after{ content:''; position:absolute; inset:0; background:linear-gradient(180deg,rgba(0,0,0,0.05),rgba(0,0,0,0.55)); pointer-events:none; }
.ed-handle{ position:absolute; top:0; bottom:0; width:12px; cursor:ew-resize; z-index:3; touch-action:none; }
.ed-handle.l{ left:0; } .ed-handle.r{ right:0; }
.ed-handle::after{ content:''; position:absolute; top:22%; bottom:22%; left:4px; width:3px; border-radius:2px; background:rgba(255,255,255,0.65); opacity:0; }
.ed-block:hover .ed-handle::after, .ed-block.selected .ed-handle::after{ opacity:1; }
.ed-insert-line{ position:absolute; top:0; bottom:0; width:3px; background:#ffd60a; z-index:7; pointer-events:none; }
.ed-tl-hint{ font-size:0.78rem; color:var(--text-2); margin-top:8px; }

/* ----- права колонка ----- */
.ed-tabs{ display:flex; gap:2px; background:var(--paper); border:1px solid #14100d; border-radius:6px; padding:3px; }
.ed-tab{
  flex:1; background:none; border:none; color:var(--text-2); font:inherit; font-size:0.84rem; font-weight:700;
  padding:8px 4px; border-radius:4px; cursor:pointer; white-space:nowrap;
}
.ed-tab:hover{ color:var(--text); }
.ed-tab.active{ background:var(--field); color:var(--text); box-shadow:inset 0 -3px 0 var(--accent); }
.ed-panel, .ed-inspector{ background:var(--paper); border:1px solid #14100d; border-radius:6px; padding:12px; }
.ed-panel[hidden]{ display:none; }
.ed-inspector:empty{ display:none; }
.ed-wide-btn{ width:100%; justify-content:center; text-align:center; }
.ed-textarea{
  width:100%; resize:vertical; background:var(--field); border:1px solid var(--line-2); border-radius:4px;
  padding:9px 11px; color:var(--text); font-family:var(--font-ui); font-size:1rem;
}
.ed-bin{ display:grid; grid-template-columns:repeat(2,1fr); gap:8px; max-height:300px; overflow-y:auto; }
.ed-bin-item{ background:var(--field); border:1px solid var(--line); border-radius:4px; overflow:hidden; display:flex; flex-direction:column; }
.ed-bin-thumb{ aspect-ratio:16/9; background:#14100d center/cover; display:flex; align-items:center; justify-content:center; font-size:1.6rem; position:relative; }
.ed-bin-thumb .badge{ position:absolute; right:4px; bottom:4px; background:rgba(0,0,0,0.75); border-radius:3px; padding:0 6px; font-size:0.7rem; }
.ed-bin-name{ font-size:0.78rem; padding:5px 8px 0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ed-bin-actions{ display:flex; gap:4px; padding:5px 6px 7px; flex-wrap:wrap; }
.ed-bin-actions button{ flex:1; background:var(--paper); border:1px solid var(--line-2); color:var(--text); border-radius:3px; font:inherit; font-size:0.74rem; padding:5px 4px; cursor:pointer; white-space:nowrap; }
.ed-bin-actions button:hover{ border-color:#a89d90; }
.ed-bin-actions .del:hover{ border-color:#ff7d8d; }

.ed-presets{ display:grid; grid-template-columns:repeat(3,1fr); gap:6px; margin-bottom:10px; }
.ed-preset{ border:1px solid var(--line-2); background:#14100d; color:#fff; border-radius:4px; padding:10px 4px; cursor:pointer; font-size:0.92rem; }
.ed-preset:hover{ border-color:#a89d90; }
.ed-emoji-grid{ display:grid; grid-template-columns:repeat(8,1fr); gap:4px; }
.ed-emoji-grid button{ background:var(--field); border:1px solid transparent; border-radius:4px; font-size:1.4rem; padding:4px 0; cursor:pointer; line-height:1.3; }
.ed-emoji-grid button:hover{ border-color:#a89d90; }
.ed-sfx-grid{ display:grid; grid-template-columns:repeat(2,1fr); gap:6px; }
.ed-sfx{ display:flex; align-items:center; gap:6px; background:var(--field); border:1px solid var(--line); border-radius:4px; padding:4px; }
.ed-sfx .play{ flex:1; display:flex; align-items:center; gap:6px; background:none; border:none; color:var(--text); font:inherit; font-size:0.84rem; cursor:pointer; text-align:left; padding:4px 6px; min-width:0; }
.ed-sfx .play span.t{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ed-sfx .add{ width:28px; height:28px; border-radius:4px; border:1px solid var(--line-2); background:var(--accent); color:var(--ink); font-weight:800; cursor:pointer; flex-shrink:0; }
.ed-rec-status{ display:flex; align-items:center; gap:8px; margin-top:10px; padding:7px 10px; border-radius:4px; background:rgba(179,24,47,0.25); border:1px solid var(--cherry); }
.ed-rec-status[hidden]{ display:none; }
.ed-rec-dot{ width:10px; height:10px; border-radius:50%; background:#ff3b50; animation:edPulse 1s infinite; }
@keyframes edPulse{ 50%{ opacity:0.25; } }

/* ----- інспектор ----- */
.ed-insp-title{ display:flex; align-items:center; gap:8px; font-weight:700; font-size:1.05rem; margin-bottom:10px; }
.ed-insp-title .nm{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:0.86rem; color:var(--text-2); font-weight:400; }
.ed-row2{ display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:10px; }
.ed-f{ display:block; margin-bottom:10px; }
.ed-f > span, .ed-row2 label > span{ display:flex; justify-content:space-between; font-size:0.8rem; color:var(--text-2); margin-bottom:4px; }
.ed-f input[type=range], .ed-row2 input[type=range]{ width:100%; }
.ed-f select, .ed-f input[type=number], .ed-f input[type=text], .ed-row2 select, .ed-row2 input[type=number]{ width:100%; }
.ed-f input[type=color], .ed-row2 input[type=color]{ width:100%; height:36px; padding:2px; }
.ed-chk{ display:flex; align-items:center; gap:7px; font-size:0.86rem; color:var(--text); margin-bottom:8px; cursor:pointer; }
.ed-chk input{ width:auto; }
.ed-seg{ display:flex; gap:4px; margin-bottom:10px; flex-wrap:wrap; }
.ed-seg button{ flex:1; min-width:34px; background:var(--field); border:1px solid var(--line-2); color:var(--text); border-radius:4px; padding:7px 6px; font:inherit; font-size:0.86rem; cursor:pointer; }
.ed-seg button.on{ border-color:var(--accent); background:color-mix(in srgb, var(--accent) 35%, #2a2521); }
.ed-actions{ display:flex; gap:6px; flex-wrap:wrap; margin-top:6px; }
.ed-actions button{ padding:6px 10px; font-size:0.84rem; }
.ed-insp-sec{ font-size:0.82rem; color:var(--text-2); margin:12px 0 6px; font-weight:700; border-bottom:1px solid var(--line); padding-bottom:3px; }
.ed-panel select, .ed-panel input[type=number], .ed-panel input[type=text], .ed-inspector select, .ed-inspector input[type=number], .ed-inspector input[type=text]{
  background:var(--field); border:1px solid var(--line-2); border-radius:4px; padding:7px 9px;
  color:var(--text); font-family:var(--font-ui); font-size:0.94rem;
}
.ed-panel select option, .ed-inspector select option{ background:#2a2521; color:#f1ebe2; }
.ed-panel select:focus, .ed-inspector select:focus, .ed-inspector input:focus, .ed-textarea:focus{ outline:none; border-color:var(--accent); }
.ed-inspector input[type=range], .ed-panel input[type=range]{ accent-color:var(--accent); }
.ed-inspector input[type=color], .ed-panel input[type=color]{ background:transparent; border:1px solid var(--line-2); border-radius:4px; cursor:pointer; }
.ed-panel .field label, .ed-panel .field{ margin-bottom:10px; }
.ed-panel .field label{ color:var(--text); }
.ed-help{ font-size:0.84rem; color:var(--text-2); line-height:1.55; }
.ed-help kbd{ background:var(--field); border:1px solid var(--line-2); border-radius:3px; padding:0 5px; font-family:inherit; font-size:0.78rem; }

.ed-toasts{ position:fixed; left:50%; transform:translateX(-50%); bottom:calc(18px + env(safe-area-inset-bottom)); display:flex; flex-direction:column; gap:8px; z-index:80; width:min(92vw,460px); pointer-events:none; }
.ed-toast{ background:#2a2521; color:#f1ebe2; border:1px solid #14100d; border-left:4px solid var(--accent); border-radius:4px; padding:9px 14px; font-size:0.92rem; box-shadow:0 6px 20px rgba(0,0,0,0.45); pointer-events:auto; }
.ed-toast.err{ border-left-color:#ff5a6e; }
body.ed-exporting .ed-layout .ed-tabs, body.ed-exporting .ed-layout .ed-inspector, body.ed-exporting .ed-toolbar,
body.ed-exporting .ed-timeline, body.ed-exporting .ed-transport{ pointer-events:none; opacity:0.5; }

.editor-progress-track{ width:100%; height:8px; border-radius:2px; background:var(--line); overflow:hidden; }
.editor-progress-fill{ height:100%; width:0%; background:var(--accent-dark); transition:width .2s ease; }

@media (max-width:1000px){
  .ed-layout{ grid-template-columns:1fr; }
  .ed-side{ position:static; max-height:none; overflow:visible; }
}
@media (max-width:560px){
  .ed-tool{ padding:7px 9px; }
  .ed-tl-labels{ width:44px; }
  .ed-tl-label{ font-size:0.66rem; }
  .ed-tl-bar input[type=range]{ width:70px; }
  .ed-emoji-grid{ grid-template-columns:repeat(6,1fr); }
  .ed-tab{ font-size:0.78rem; }
}

@media (max-width:480px){
  .feed-wrap{ padding:12px 12px 60px; }
  .auth-card{ padding:40px 22px 26px; }
  .profile-hero{ flex-direction:column; text-align:center; }
}

/* =======================================================
   Загальні мобільні покращення дотику й зручності введення
   ======================================================= */
@media (max-width:600px){
  /* iOS Safari сам збільшує масштаб сторінки, якщо шрифт поля
     менший за 16px — це виглядало як "смикання" екрана під час
     набору тексту. Повертаємо полям читабельний розмір саме на
     телефонах, не чіпаючи десктопну верстку. */
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="search"],
  input[type="number"],
  input:not([type]),
  textarea,
  select{
    font-size:16px !important;
  }

  /* Кнопки-іконки на телефоні мають бути зручними для пальця
     (мінімум ~40-44px), а не тільки для курсора миші. */
  .chat-icon-btn, .chat-send-btn{ width:40px; height:40px; }
  .reel-mute-btn{ width:40px; height:40px; }
  .reel-action-btn{ width:48px; height:48px; }
  .sticker-add-btn{ width:48px; height:48px; }
  .avatar-upload label{ width:30px; height:30px; }
  .like-btn, .comment-toggle-btn, .copy-link-btn, .delete-btn{ padding:6px 2px; }
  .comment-like-btn, .comment-reply-btn, .comment-delete-btn{ padding:4px 2px; }
  .reel-comments-close{ padding:8px; }

  /* Рядки в адмін-панелі: аватар + інформація + кнопки дій —
     на вузькому екрані переносимо дії на новий рядок замість
     стискання чи виходу за межі картки. */
  .admin-user-row{ flex-wrap:wrap; }
  .admin-user-info{ flex-basis:calc(100% - 54px); }
  .admin-user-row > button{ margin-top:4px; }

  /* Панелі, приклеєні знизу (композер чату, коментарі в reels),
     не повинні ховатися під смужкою жестів iPhone. */
  .chat-composer, .chat-recording-bar{ padding-bottom:calc(10px + env(safe-area-inset-bottom)); }
  .reel-comments{ padding-bottom:calc(12px + env(safe-area-inset-bottom)); }
}

/* ---------- люди (people.html) ---------- */
.people-stats{
  display:flex; align-items:center; gap:16px;
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:6px;
  padding:12px 18px;
  margin-bottom:8px;
}
.people-stats-icon{
  width:48px; height:48px; border-radius:50%; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  background:var(--page); color:var(--text-2);
}
.people-stats-icon svg{ width:24px; height:24px; }
.people-stats-number{
  font-family:var(--font-head); font-weight:700;
  font-size:1.9rem; line-height:1.1; color:var(--text);
}
.people-stats-label{ font-size:0.92rem; color:var(--text-2); margin-top:2px; }

.people-results-head{ font-size:0.9rem; color:var(--text-2); margin:0 2px 8px; min-height:1em; }
.people-list{ display:flex; flex-direction:column; gap:6px; }
.person-card{
  display:flex; align-items:center; gap:10px;
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:6px;
  padding:8px 12px;
}
.person-card:hover{ border-color:var(--text-2); }
.person-main{
  display:flex; align-items:center; gap:12px;
  flex:1; min-width:0; color:var(--text); text-decoration:none;
}
.person-avatar{ width:44px; height:44px; font-size:1.1rem; }
.person-info{ min-width:0; }
.person-name{
  font-weight:700; font-size:1.02rem;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.person-name mark{ background:var(--mark); color:#26211d; border-radius:2px; padding:0 1px; }
.person-you{
  font-size:0.76rem; font-weight:700; color:var(--text-2);
  border:1px solid var(--line); border-radius:3px; padding:0 6px; margin-left:4px;
}
.person-meta{ font-size:0.84rem; color:var(--text-2); margin-top:1px; }
.person-msg{
  flex-shrink:0; text-decoration:none;
  background:var(--paper);
  border:1px solid var(--line-2);
  border-bottom-width:2px;
  color:var(--text);
  padding:5px 12px 4px; border-radius:4px;
  font-size:0.9rem; font-weight:700;
}
.person-msg:hover{ border-color:var(--text-2); background:var(--page); text-decoration:none; }

/* ---------- гостьовий режим ---------- */
a.logout-btn{ display:inline-block; text-decoration:none; }
.guest-register-btn{ background:#fff; border-color:#fff; color:var(--cherry-dark); font-weight:700; }
.guest-register-btn:hover{ background:#f4ece8; }

.guest-wall-text{ color:var(--text-2); line-height:1.5; font-size:1rem; }
.guest-wall-actions{
  display:flex; flex-wrap:wrap; gap:10px; margin-top:16px;
}
.guest-wall-actions .publish-btn,
.guest-wall-actions .secondary-btn{
  display:inline-flex; align-items:center; justify-content:center;
  text-decoration:none; width:auto; flex:1 1 auto; text-align:center;
}
.guest-wall{ z-index:80; }

/* Плашка «Ви гість» — плаває знизу й не впливає на розмітку сторінки */
.guest-badge{
  position:fixed; left:50%; transform:translateX(-50%);
  bottom:calc(14px + env(safe-area-inset-bottom, 0px));
  z-index:40; max-width:calc(100vw - 24px);
  display:flex; align-items:center; gap:12px;
  padding:7px 8px 7px 14px;
  background:var(--paper);
  border:1px solid var(--line-2); border-radius:6px;
  font-size:0.92rem; color:var(--text);
  box-shadow:0 4px 14px rgba(30,20,10,0.3);
}
.guest-badge a{
  color:#fff; background:var(--cherry);
  padding:4px 11px; border-radius:4px;
  text-decoration:none; font-weight:700; white-space:nowrap;
}
.guest-badge a:hover{ background:var(--cherry-dark); }
.guest-badge button{
  background:none; border:none; color:var(--text-2);
  font-size:1.2rem; line-height:1; cursor:pointer; padding:0 4px;
}
.guest-badge button:hover{ color:var(--text); }

/* Заглушка на сторінках, які без акаунта не працюють */
.guest-gate{
  display:flex; align-items:center; justify-content:center;
  min-height:60vh; padding:24px 16px;
}
.guest-gate-card{
  width:100%; max-width:460px; text-align:center;
  background:var(--paper); border:1px solid var(--line);
  border-radius:6px; padding:26px 24px;
}
.guest-gate-card h2{
  font-family:var(--font-head); font-size:1.35rem; margin-bottom:10px;
}
.guest-gate-card p{ color:var(--text-2); line-height:1.5; font-size:1rem; }
.guest-gate-card .guest-wall-actions{ justify-content:center; }

/* Кнопка «Продовжити як гість» на сторінці входу */
.auth-guest{ margin-top:16px; text-align:center; }
.auth-guest-or{
  display:flex; align-items:center; gap:10px;
  color:var(--text-2); font-size:0.9rem; margin-bottom:12px;
}
.auth-guest-or::before, .auth-guest-or::after{
  content:''; flex:1; height:1px; background:var(--line);
}
.auth-guest-btn{ width:100%; }
.auth-guest .hint{ margin-top:8px; }

/* пошук у розділі відео: приховані картки/повідомлення не повинні перекриватись display із класу */
.video-card[hidden], .video-no-results[hidden]{ display:none !important; }
.video-no-results{ grid-column:1 / -1; }

/* ---- Вибір мови ---- */
.lang-select-wrap{ display:flex; justify-content:flex-end; margin-bottom:10px; }
.lang-select{
  background:var(--field); color:var(--text);
  border:1px solid var(--line-2); border-radius:4px;
  padding:5px 9px; font:inherit; font-size:0.92rem; cursor:pointer;
}
.lang-select:focus{ outline:none; border-color:var(--accent-dark); }
.lang-select option, #langSettingSelect option{ background:var(--paper); color:var(--text); }

/* ---- Скарга на публікацію (report-бот) ---- */
.report-btn{ opacity:0.75; }
.report-overlay{
  position:fixed; inset:0; z-index:1000; display:flex; align-items:center; justify-content:center;
  padding:16px; background:rgba(22,16,10,0.62);
}
.report-modal{
  width:100%; max-width:460px; max-height:90dvh; overflow:auto;
  background:var(--paper); border:1px solid var(--line-2); border-radius:6px;
  padding:18px; box-shadow:0 10px 30px rgba(15,12,8,0.4); display:flex; flex-direction:column; gap:8px;
  color:var(--text);
}
.report-modal h3{ font-family:var(--font-head); margin-bottom:2px; }
.report-modal p{ color:var(--text-2); font-size:0.95rem; margin-bottom:4px; }
.report-rule{
  text-align:left; padding:9px 11px; border-radius:4px; cursor:pointer;
  border:1px solid var(--line-2); background:var(--paper); color:var(--text);
  font:inherit; font-size:0.95rem; line-height:1.4;
}
.report-rule:hover:not(:disabled){ border-color:var(--cherry); background:var(--tint-red); }
.report-rule:disabled{ opacity:0.5; cursor:default; }
.report-msg{ min-height:1.2em; font-size:0.95rem; color:var(--ok); }

/* ---- Безкінечна прокрутка публікацій ---- */
.infinite-sentinel{ height:48px; display:flex; align-items:center; justify-content:center; }
.infinite-sentinel.loading::after{
  content:''; width:22px; height:22px; border-radius:50%;
  border:3px solid var(--line); border-top-color:var(--cherry);
  animation:infinite-spin .8s linear infinite;
}
@keyframes infinite-spin{ to{ transform:rotate(360deg); } }

/* ---- Загальні класи, що замінили довгі inline-стилі ---- */
.textarea-field{
  width:100%; resize:vertical;
  background:var(--field); border:1px solid var(--line-2); border-radius:4px;
  padding:10px 12px; color:var(--text);
  font-family:var(--font-ui); font-size:1rem; line-height:1.45;
}
.textarea-field:focus{ outline:none; border-color:var(--accent-dark); box-shadow:0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.textarea-field::placeholder{ color:var(--text-2); }
.rules-link{ display:block; text-align:center; margin-bottom:10px; font-size:0.9rem; color:var(--text-2); }

@media (prefers-reduced-motion:reduce){
  *, *::before, *::after{ animation-duration:0.01ms !important; animation-iteration-count:1 !important; transition-duration:0.01ms !important; }
}
