/* Prime Shield admin — v11 "Riyadh Night" layer (login methods, posts studio, editor, stories, mail, AI tools, accounts, demo).
   Loaded after admin.css: remaps the v9 admin tokens to the Riyadh Night tokens (v10.2) so every admin screen shares the site look.
   RTL first (logical properties), touch targets ≥ 44px, phones first (390×844), no inline styles (CSP style-src 'self'). */
:root {
  --ps-night-0: #070F1C; --ps-night-1: #0A1424; --ps-night-2: #10203A; --ps-night-3: #182D4E; --ps-steel: #2B3F5E;
  --ps-text: #F4F7FB; --ps-lead: #D5DFEC; --ps-muted: #B4C3D8; --ps-muted-2: #8FA3BF;
  --ps-lime: #E1E428; --ps-volt: #FDFD18; --ps-lime-soft: #F2F48A; --ps-teal: #2FD3C6; --ps-sky: #38B6FF; --ps-amber: #FFB547; --ps-on-lime: #0A0F05;
  --ps-stone-0: #F4F1EA; --ps-stone-1: #EAE5DA; --ps-ink: #0E1726; --ps-ink-2: #33415A;
  --g-lime: linear-gradient(270deg, #E1E428, #FDFD18);
  --glass-bg: linear-gradient(135deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .03));
  --glass-bd: rgba(255, 255, 255, .13);
  --glass-shadow: 0 30px 60px -30px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .1);
  --sh-lime: 0 12px 32px -12px rgba(225, 228, 40, .6);
  --t-fast: 180ms; --t-ui: 240ms; --ease: cubic-bezier(.2, .7, .2, 1);
  /* the v9 admin tokens, remapped */
  --black: #0A1424; --charcoal: #0B1628; --graphite: #10203A; --graphite-2: #152846; --graphite-3: #1B3254;
  --line: rgba(180, 195, 216, .16); --line-2: rgba(180, 195, 216, .28); --lime: #E1E428; --lime-hi: #FDFD18; --lime-ink: #0A0F05;
  --fg: #F4F7FB; --fg-2: #D5DFEC; --muted: #B4C3D8; --faint: #8FA3BF;
  --ok: #7BE0A0; --warn: #FFB547; --bad: #FF8A7A; --info: #7CCBFF;
  --r-s: 10px; --r-m: 16px; --r-l: 24px; --r-xl: 30px;
  --bar-h: 64px;
}
body {
  background: #0A1424;
  background-image: none;
  font-size: 16px;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 520px at 85% -10%, rgba(29, 53, 93, .9), rgba(29, 53, 93, 0) 65%),
    radial-gradient(620px 380px at 8% 105%, rgba(47, 211, 198, .07), rgba(47, 211, 198, 0) 60%),
    radial-gradient(520px 340px at 70% 60%, rgba(225, 228, 40, .045), rgba(225, 228, 40, 0) 60%),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, .018) 0 1px, transparent 1px 46px),
    linear-gradient(180deg, #0B1628, #0A1424 55%, #0B1730);
}
.noscript { padding: 24px; }
.side { background: rgba(7, 15, 28, .82); border-inline-end: 1px solid var(--line); }
.top { background: rgba(10, 20, 36, .78); }
.card, .col-card, .hero-card, dialog, .stat { background: var(--glass-bg), #0E1C33; border-color: var(--glass-bd); }
.hero-card { background: radial-gradient(700px 300px at 90% 0%, rgba(225, 228, 40, .1), rgba(225, 228, 40, 0) 60%), var(--glass-bg), #0E1C33; }
.btn--primary { background: var(--g-lime); color: var(--ps-on-lime); border-color: transparent; box-shadow: var(--sh-lime); }
.btn--primary:hover { filter: brightness(1.04); }
:focus-visible { outline: 2px solid var(--ps-lime); outline-offset: 2px; }
input, select, textarea { font-size: 16px; }


[hidden] { display: none !important; }       /* components set display; the hidden attribute must still win */
/* v9 surfaces → Riyadh Night */
.login { background: var(--glass-bg), #0E1C33; border-color: var(--glass-bd); box-shadow: var(--glass-shadow); }
.login .demo-hint { color: var(--ps-on-lime); margin: 0 0 16px; }
.input, input[type="text"], input[type="search"], input[type="password"], input[type="number"], input[type="date"], input[type="time"], input[type="url"],
input[type="email"], input[type="tel"], select, textarea { background: #0B1729; border-color: rgba(180, 195, 216, .28); min-height: 44px; border-radius: 12px; }
input:hover, select:hover, textarea:hover { border-color: rgba(180, 195, 216, .5); }
input:focus, select:focus, textarea:focus { background: #0E1C33; }
input[readonly] { background: #0A1424; }
select option { background: #0E1C33; }
.ed-busy[hidden] { display: none; }
.ltr-num { unicode-bidi: plaintext; }
.search input[type="search"], .search input { padding-inline-start: 40px; }
.search svg { inset-inline-start: 13px; width: 18px; height: 18px; }

/* ---------------------------------------------------------------- shared bits */
.v11 { --gap: 16px; }
.v11-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 18px; }
.v11-head h1 { margin: 2px 0 0; font: 800 clamp(26px, 3vw, 36px)/1.2 var(--f-display); }
.v11-head p { margin: 6px 0 0; color: var(--muted); max-width: 70ch; }
.v11-head .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.hl { background: linear-gradient(90deg, rgba(225, 228, 40, .9), rgba(253, 253, 24, .9)) no-repeat 0 100% / 100% .14em; padding-bottom: .04em; }
.glass { background: var(--glass-bg), #0E1C33; border: 1px solid var(--glass-bd); border-radius: var(--r-l); box-shadow: var(--glass-shadow); }
.panel { background: var(--glass-bg), #0E1C33; border: 1px solid var(--glass-bd); border-radius: var(--r-l); padding: 18px; }
.panel + .panel { margin-top: 14px; }
.panel > h2, .panel > h3 { margin: 0 0 12px; font-size: 17px; font-weight: 700; }
.panel > h2 small, .panel > h3 small { font-weight: 500; color: var(--muted); font-size: 13px; margin-inline-start: 6px; }
.stack { display: grid; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.muted-s { color: var(--muted); font-size: 13.5px; }
.note { font-size: 13.5px; color: var(--muted); margin: 6px 0 0; }
.ai-note { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--ps-lime-soft); background: rgba(225, 228, 40, .07); border: 1px solid rgba(225, 228, 40, .25); border-radius: 12px; padding: 9px 12px; }
.ai-note svg { flex: none; margin-top: 2px; }
.btn { min-height: 44px; border-radius: 14px; }
.btn--sm { min-height: 36px; }
.btn--lg { min-height: 52px; font-size: 17px; }
.btn--block { width: 100%; justify-content: center; }
.btn--lime-ghost { border-color: rgba(225, 228, 40, .45); color: var(--ps-lime); background: rgba(225, 228, 40, .06); }
.icon-btn { min-width: 44px; min-height: 44px; }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 600; border: 1px solid var(--line-2); color: var(--fg-2); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .9; }
.pill.ok { color: var(--ok); border-color: rgba(123, 224, 160, .4); }
.pill.wait { color: var(--ps-amber); border-color: rgba(255, 181, 71, .4); }
.pill.bad { color: var(--bad); border-color: rgba(255, 138, 122, .45); }
.pill.info { color: var(--info); border-color: rgba(124, 203, 255, .4); }
.pill.lime { color: var(--ps-lime); border-color: rgba(225, 228, 40, .45); }
.pill.plain::before { display: none; }
.chips-x { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: 0 -2px; scroll-snap-type: x proximity; }
.chips-x::-webkit-scrollbar { display: none; }
.chip-b { flex: none; scroll-snap-align: start; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); color: var(--fg-2); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.chip-b:hover { border-color: var(--line-2); background: rgba(255, 255, 255, .07); }
.chip-b[aria-pressed="true"], .chip-b[aria-selected="true"], .chip-b[aria-current="true"] { background: var(--ps-lime); color: var(--ps-on-lime); border-color: transparent; }
.chip-b .n { font-family: var(--f-mono); font-size: 12px; opacity: .8; }
.chip-b svg { width: 18px; height: 18px; }
.tabs-v11 { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: 0 0 16px; overflow-x: auto; scrollbar-width: none; }
.tabs-v11 button { flex: none; min-height: 46px; padding: 0 14px; border: 0; background: none; color: var(--muted); font-weight: 700; cursor: pointer; border-bottom: 3px solid transparent; }
.tabs-v11 button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--ps-lime); }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13.5px; font-weight: 600; color: var(--fg-2); }
.field input, .field select, .field textarea { width: 100%; }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.empty-v11 { text-align: center; padding: 34px 16px; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--r-l); }
.empty-v11 b { display: block; color: var(--fg); font-size: 17px; margin-bottom: 4px; }
.kbd { font-family: var(--f-mono); font-size: 12px; border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 6px; }
.sw { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; min-height: 44px; }
.sw input { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 999px; background: var(--ps-steel); position: relative; margin: 0; flex: none; cursor: pointer; transition: background var(--t-fast); border: 1px solid var(--line-2); }
.sw input::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform var(--t-fast) var(--ease); }
.sw input:checked { background: var(--ps-lime); }
.sw input:checked::after { background: var(--ps-on-lime); transform: translateX(18px); }
html[dir="rtl"] .sw input:checked::after { transform: translateX(-18px); }
.sw input:disabled { opacity: .45; cursor: not-allowed; }
.sw input:focus-visible { outline: 2px solid var(--ps-lime); outline-offset: 3px; }
.progress { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--g-lime); border-radius: inherit; transition: width var(--t-ui) var(--ease); }
.spin-s { width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, .25); border-top-color: var(--ps-lime); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; flex: none; }

/* ---------------------------------------------------------------- demo banner */
body.has-demo { --demo-h: 40px; padding-top: var(--demo-h); }
.demo-banner { position: fixed; top: 0; inset-inline: 0; z-index: 90; height: var(--demo-h, 40px); display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 0 12px; overflow: hidden; white-space: nowrap; background: repeating-linear-gradient(135deg, #E1E428 0 14px, #D6D91F 14px 28px); color: var(--ps-on-lime);
  font-weight: 800; font-size: 14px; text-align: center; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); }
.demo-banner small { font-weight: 600; opacity: .85; display: none; }
@media (min-width: 720px) { .demo-banner small { display: inline; } }
body.has-demo .side { top: var(--demo-h); height: calc(100vh - var(--demo-h)); }
body.has-demo .top { top: var(--demo-h); }
body.has-demo .login-wrap { min-height: calc(100vh - var(--demo-h)); }
.v11-dlg .demo-pill, .ed-top .demo-pill { font-size: 11.5px; }

/* ---------------------------------------------------------------- login (v11) */
.login-v11 { width: min(460px, 100%); }
.login-v11 .login { width: 100%; }
.login-v11 form { gap: 12px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-inline-end: 52px; }
.pw-wrap .icon-btn { position: absolute; inset-inline-end: 2px; top: 50%; transform: translateY(-50%); border: 0; background: none; }
.or-line { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 13px; margin: 6px 0; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.method { display: grid; gap: 6px; }
.method .btn { width: 100%; justify-content: center; min-height: 52px; font-weight: 700; background: rgba(255, 255, 255, .04); }
.method .btn svg { width: 22px; height: 22px; }
.method.off .btn { opacity: .55; cursor: not-allowed; }
.method .how { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.otp { display: grid; gap: 14px; }
.otp-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; direction: ltr; }
.otp-boxes input { text-align: center; font: 700 24px/1 var(--f-mono); padding: 0; height: 58px; border-radius: 14px; caret-color: var(--ps-lime); }
.otp-boxes input:focus { border-color: var(--ps-lime); box-shadow: 0 0 0 3px rgba(225, 228, 40, .25); }
.otp .row { justify-content: space-between; }
.demo-hint { font-size: 13px; color: var(--ps-on-lime); background: var(--ps-lime-soft); border-radius: 12px; padding: 8px 12px; font-weight: 600; }

/* ---------------------------------------------------------------- phone bottom tab bar */
.tabbar { display: none; }
@media (max-width: 900px) {
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset-inline: 0; bottom: 0; z-index: 40; height: calc(var(--bar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom); background: rgba(7, 15, 28, .96); border-top: 1px solid var(--line); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11.5px; font-weight: 600; text-decoration: none; min-height: 44px; }
  .tabbar a svg { width: 24px; height: 24px; }
  .tabbar a[aria-current="page"] { color: var(--ps-lime); }
  .tabbar a.new { color: var(--ps-on-lime); }
  .tabbar a.new span.plus { width: 46px; height: 46px; border-radius: 16px; background: var(--g-lime); display: grid; place-items: center; box-shadow: var(--sh-lime); margin-top: -4px; }
  .tabbar a.new span.plus svg { width: 26px; height: 26px; }
  .tabbar a.new .lbl { color: var(--fg-2); }
  .has-tabbar .content { padding-bottom: calc(var(--bar-h) + 28px + env(safe-area-inset-bottom)); }
  .has-tabbar .toasts { bottom: calc(var(--bar-h) + 14px + env(safe-area-inset-bottom)); }
}
/* sticky action bar (composer / editors): above the tab bar on phones */
.actbar { position: sticky; bottom: 0; z-index: 30; margin: 18px -2px 0; padding: 12px; display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap;
  background: rgba(10, 20, 36, .94); border: 1px solid var(--glass-bd); border-radius: 20px; box-shadow: 0 -12px 40px -20px rgba(0, 0, 0, .8); }
.actbar .state { margin-inline-end: auto; color: var(--muted); font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
@media (max-width: 900px) {
  .actbar { position: fixed; inset-inline: 0; bottom: calc(var(--bar-h) + env(safe-area-inset-bottom)); margin: 0; border-radius: 18px 18px 0 0; border-bottom: 0; padding: 10px 12px; }
  .actbar .state { display: none; }
  .actbar .btn { flex: 1 1 0; justify-content: center; min-height: 48px; padding-inline: 8px; }
  .has-actbar .content { padding-bottom: calc(var(--bar-h) + 104px + env(safe-area-inset-bottom)); }
}

/* ---------------------------------------------------------------- dashboard strip */
.v11-dash { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 18px; }
.v11-dash a { display: grid; gap: 6px; padding: 16px; border-radius: 22px; background: var(--glass-bg), #0E1C33; border: 1px solid var(--glass-bd); color: var(--fg); text-decoration: none; min-height: 96px; transition: border-color var(--t-ui), transform var(--t-ui) var(--ease); }
.v11-dash a:hover { border-color: rgba(225, 228, 40, .45); transform: translateY(-2px); }
.v11-dash a b { font-size: 16px; }
.v11-dash a span { color: var(--muted); font-size: 13px; }
.v11-dash a svg { width: 26px; height: 26px; color: var(--ps-lime); }
.v11-dash a.primary { background: var(--g-lime); color: var(--ps-on-lime); border-color: transparent; }
.v11-dash a.primary span, .v11-dash a.primary svg { color: var(--ps-on-lime); }
@media (max-width: 900px) { .v11-dash { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------------------------------------------------------------- posts list */
.posts-tools { display: grid; gap: 12px; margin-bottom: 14px; }
.post-list { display: grid; gap: 12px; }
.post-sec-title { display: flex; align-items: center; gap: 8px; margin: 16px 0 8px; font-size: 14px; color: var(--muted); font-weight: 700; }
.post-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px; border-radius: 20px; background: var(--glass-bg), #0E1C33; border: 1px solid var(--glass-bd); }
.post-row.pinned { border-color: rgba(225, 228, 40, .45); }
.post-row .th { width: 96px; height: 96px; border-radius: 14px; overflow: hidden; background: var(--ps-night-3); position: relative; display: grid; place-items: center; }
.post-row .th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-row .th .txt { padding: 8px; font-size: 11.5px; line-height: 1.35; color: var(--ps-on-lime); background: var(--g-lime); width: 100%; height: 100%; overflow: hidden; }
.post-row .th .kind { position: absolute; inset-inline-end: 6px; bottom: 6px; width: 26px; height: 26px; border-radius: 8px; background: rgba(7, 15, 28, .8); display: grid; place-items: center; color: #fff; }
.post-row .th .kind svg { width: 16px; height: 16px; }
.post-row .body { min-width: 0; display: grid; gap: 6px; }
.post-row .body .t { font-weight: 600; color: var(--fg); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.5; text-decoration: none; }
.post-row .body .t:hover { color: var(--ps-lime); }
.post-row .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--muted); }
.post-row .acts { display: flex; gap: 6px; align-items: center; }
.pin-badge { display: inline-flex; align-items: center; gap: 4px; color: var(--ps-on-lime); background: var(--ps-lime); border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 700; }
.pin-badge svg { width: 13px; height: 13px; }
.xp-dots { display: inline-flex; gap: 4px; }
.xp-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--ps-steel); display: inline-block; }
.xp-dots i.ok { background: var(--ok); } .xp-dots i.bad { background: var(--bad); } .xp-dots i.wait { background: var(--ps-amber); }
.menu-pop { position: absolute; z-index: 50; min-width: 220px; padding: 6px; border-radius: 16px; background: #0E1C33; border: 1px solid var(--line-2); box-shadow: 0 24px 60px rgba(0, 0, 0, .55); display: grid; }
.menu-pop button { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border: 0; background: none; border-radius: 10px; text-align: start; cursor: pointer; font-weight: 600; color: var(--fg-2); }
.menu-pop button:hover, .menu-pop button:focus-visible { background: rgba(255, 255, 255, .07); color: var(--fg); }
.menu-pop button.danger { color: var(--bad); }
@media (max-width: 560px) {
  .post-row { grid-template-columns: 76px minmax(0, 1fr) auto; gap: 10px; padding: 10px; }
  .post-row .th { width: 76px; height: 76px; }
}

/* ---------------------------------------------------------------- composer */
.composer { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.composer .side-col { position: sticky; top: 76px; display: grid; gap: 14px; }
@media (max-width: 1100px) { .composer { grid-template-columns: 1fr; } .composer .side-col { position: static; } }
.type-switch .chip-b svg { width: 18px; height: 18px; }
.pair-v11 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 760px) { .pair-v11 { grid-template-columns: 1fr; } }
.lang-box { display: grid; gap: 8px; }
.lang-box .lh { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 14px; }
.lang-box .lh .cnt { font-family: var(--f-mono); font-size: 12px; color: var(--faint); font-weight: 400; }
.lang-box textarea { min-height: 150px; resize: vertical; line-height: 1.7; }
.ai-bar { display: flex; gap: 6px; flex-wrap: wrap; }
.ai-bar .btn { min-height: 38px; padding: 0 11px; font-size: 13.5px; border-radius: 999px; }
.ai-bar .btn svg { width: 16px; height: 16px; color: var(--ps-lime); }
.ai-out { border: 1px solid rgba(225, 228, 40, .3); border-radius: 16px; padding: 12px; background: rgba(225, 228, 40, .04); display: grid; gap: 10px; }
.ai-out .v { white-space: pre-wrap; line-height: 1.7; padding: 10px; border-radius: 12px; background: rgba(7, 15, 28, .5); }
.ai-out .row .btn { min-height: 38px; }
.drop-v11 { display: grid; place-items: center; gap: 10px; text-align: center; padding: 26px 16px; border: 2px dashed rgba(225, 228, 40, .35); border-radius: 22px; background: rgba(225, 228, 40, .03); transition: border-color var(--t-fast), background var(--t-fast); }
.drop-v11.over { border-color: var(--ps-lime); background: rgba(225, 228, 40, .09); }
.drop-v11 b { font-size: 16px; }
.drop-v11 .row { justify-content: center; }
.media-strip { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 8px; scroll-snap-type: x proximity; }
.m-item { flex: none; width: 150px; display: grid; gap: 6px; scroll-snap-align: start; }
.m-item .th { position: relative; width: 150px; height: 150px; border-radius: 16px; overflow: hidden; background: var(--ps-night-3); border: 1px solid var(--line); }
.m-item .th img, .m-item .th video { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-item .th .badge-s { position: absolute; top: 6px; inset-inline-start: 6px; background: rgba(7, 15, 28, .82); color: #fff; border-radius: 8px; padding: 2px 7px; font-size: 11.5px; font-weight: 700; }
.m-item .th .up { position: absolute; inset-inline: 8px; bottom: 8px; }
.m-item .tools { display: flex; gap: 4px; justify-content: space-between; }
.m-item .tools .icon-btn { min-width: 36px; min-height: 36px; width: 36px; height: 36px; border-radius: 10px; }
.m-item .tools .icon-btn svg { width: 17px; height: 17px; }
.embed-card { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 10px; border-radius: 16px; border: 1px solid var(--line-2); background: rgba(7, 15, 28, .5); align-items: center; }
.embed-card .ph { width: 120px; aspect-ratio: 16 / 10; border-radius: 10px; background: var(--ps-night-3); overflow: hidden; display: grid; place-items: center; color: var(--muted); }
.embed-card .ph img { width: 100%; height: 100%; object-fit: cover; }
.embed-card b { display: block; overflow: hidden; text-overflow: ellipsis; }
.when-box { display: grid; gap: 10px; }
.when-box .f2 input { min-height: 46px; }
.tz { font-size: 12.5px; color: var(--muted); }
.xp-list { display: grid; gap: 8px; }
.xp-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 52px; padding: 6px 10px; border-radius: 14px; background: rgba(7, 15, 28, .45); border: 1px solid var(--line); }
.xp-row .ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, .06); }
.xp-row .ico svg { width: 18px; height: 18px; }
.xp-row .nm { display: grid; line-height: 1.3; min-width: 0; }
.xp-row .nm small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.xp-row .res a { font-size: 13px; }

/* ---------------------------------------------------------------- preview (phone / desktop) */
.pv-tools { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 14px; }
.pv-stage { display: grid; place-items: center; padding: 10px 0; }
.pv-phone { width: min(390px, 100%); border-radius: 38px; padding: 12px; background: #050B15; border: 1px solid var(--line-2); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.pv-phone .scr { border-radius: 28px; overflow: hidden; background: #0A1424; max-height: 70vh; overflow-y: auto; }
.pv-desk { width: min(720px, 100%); border-radius: 18px; overflow: hidden; border: 1px solid var(--line-2); background: #0A1424; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.pv-desk .bar { height: 30px; display: flex; gap: 6px; align-items: center; padding: 0 12px; background: #0F1D33; }
.pv-desk .bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--ps-steel); }
.pv-desk .scr { padding: 22px; max-height: 66vh; overflow-y: auto; }
.pcard { border-radius: 22px; background: linear-gradient(135deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .025)), #0E1C33; border: 1px solid rgba(255, 255, 255, .13); overflow: hidden; color: var(--ps-text); }
.pcard .ph { display: flex; gap: 10px; align-items: center; padding: 12px 14px; }
.pcard .av { width: 42px; height: 42px; border-radius: 50%; padding: 2px; background: var(--g-lime); flex: none; }
.pcard .av img { width: 100%; height: 100%; border-radius: 50%; background: #0A1424; display: block; padding: 5px; }
.pcard .who { display: grid; line-height: 1.3; min-width: 0; }
.pcard .who b { font-size: 15px; }
.pcard .who small { color: var(--ps-muted); font-size: 12.5px; }
.pcard .media { position: relative; background: #050B15; }
.pcard .media img, .pcard .media video { display: block; width: 100%; height: auto; max-height: 72vh; object-fit: cover; }
.pcard .media .fx { position: absolute; inset: 0; pointer-events: none; }
.pcard .media .dots { position: absolute; bottom: 10px; inset-inline: 0; display: flex; gap: 5px; justify-content: center; }
.pcard .media .dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .5); }
.pcard .media .dots i.on { background: var(--ps-lime); }
.pcard .txt { padding: 12px 14px 4px; white-space: pre-wrap; line-height: 1.8; font-size: 15.5px; overflow-wrap: anywhere; }
.pcard .txt .tag, .pcard .txt a { color: var(--ps-lime); }
.pcard .txt.big { margin: 0; padding: 34px 22px; font: 800 22px/1.5 var(--f-display); background: radial-gradient(500px 260px at 80% 0%, rgba(225, 228, 40, .18), rgba(225, 228, 40, 0) 60%), linear-gradient(160deg, #10203A, #182D4E); }
.pcard .loc { display: inline-flex; gap: 6px; align-items: center; margin: 4px 14px 0; font-size: 12.5px; color: var(--ps-muted); border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px; padding: 3px 10px; }
.pcard .acts { display: flex; gap: 6px; padding: 10px 10px 12px; border-top: 1px solid rgba(255, 255, 255, .08); margin-top: 10px; }
.pcard .acts span { display: inline-flex; gap: 6px; align-items: center; padding: 6px 10px; border-radius: 999px; color: var(--ps-muted); font-size: 13px; }
.pcard .acts svg { width: 18px; height: 18px; }
.pcard .emb { margin: 8px 14px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .14); overflow: hidden; }
.pcard .emb .eh { display: flex; gap: 8px; align-items: center; padding: 10px 12px; font-size: 13.5px; }

/* ---------------------------------------------------------------- dialogs v11 (sheets on phones) */
dialog.v11-dlg { width: min(760px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border-radius: 26px; }
dialog.v11-dlg.wide { width: min(1080px, calc(100vw - 24px)); }
dialog.v11-dlg .d-body { max-height: calc(100dvh - 170px); overflow-y: auto; }
@media (max-width: 640px) {
  dialog.v11-dlg { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: 26px 26px 0 0; }
  dialog.v11-dlg .d-body { max-height: calc(92dvh - 150px); }
  dialog.v11-dlg .d-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  dialog.v11-dlg .d-foot .btn { flex: 1 1 0; justify-content: center; }
}

/* ---------------------------------------------------------------- share kit */
.share-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.share-grid a, .share-grid button { display: grid; justify-items: center; gap: 6px; padding: 12px 6px; min-height: 84px; border-radius: 18px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); color: var(--fg-2); font-size: 12.5px; font-weight: 600; text-decoration: none; cursor: pointer; text-align: center; }
.share-grid a:hover, .share-grid button:hover { border-color: rgba(225, 228, 40, .45); color: var(--fg); text-decoration: none; }
.share-grid .ico { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: rgba(255, 255, 255, .07); }
.share-grid .ico svg { width: 22px; height: 22px; }
.share-native { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 20px; background: var(--g-lime); color: var(--ps-on-lime); border: 0; width: 100%; font-weight: 800; font-size: 16px; cursor: pointer; min-height: 60px; text-align: start; }
.share-native small { display: block; font-weight: 600; font-size: 12.5px; opacity: .8; }
.share-native svg { width: 26px; height: 26px; flex: none; }
.qr-box { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 14px; align-items: center; }
.qr-box .qr { background: #fff; border-radius: 14px; padding: 6px; width: 140px; height: 140px; }
.qr-box .qr svg { width: 100%; height: 100%; display: block; }
.dl-row { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 420px) { .share-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .qr-box { grid-template-columns: 110px minmax(0, 1fr); } .qr-box .qr { width: 110px; height: 110px; } }

/* ---------------------------------------------------------------- pins manager */
.pin-list { display: grid; gap: 8px; }
.pin-item { display: grid; grid-template-columns: 44px 56px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px; border-radius: 16px; background: rgba(7, 15, 28, .55); border: 1px solid var(--line); touch-action: none; user-select: none; -webkit-user-select: none; }
.pin-item.drag { border-color: var(--ps-lime); box-shadow: 0 16px 40px rgba(0, 0, 0, .5); position: relative; z-index: 2; background: #12233F; }
.pin-item .grip { width: 44px; height: 44px; display: grid; place-items: center; cursor: grab; color: var(--muted); border-radius: 12px; border: 0; background: none; }
.pin-item .grip:active { cursor: grabbing; }
.pin-item .th { width: 56px; height: 56px; border-radius: 12px; overflow: hidden; background: var(--ps-night-3); }
.pin-item .th img { width: 100%; height: 100%; object-fit: cover; }
.pin-item .n { font-family: var(--f-mono); color: var(--ps-lime); font-weight: 700; }
.pin-item .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pin-item .ud { display: flex; gap: 4px; }

/* ---------------------------------------------------------------- editor (image) — full-screen dialog */
dialog.ed { width: 100vw; height: 100dvh; max-width: 100vw; max-height: 100dvh; margin: 0; padding: 0; border: 0; border-radius: 0; background: #060D19; color: var(--fg); }
dialog.ed::backdrop { background: #060D19; }
.ed-wrap { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.ed-top { display: flex; align-items: center; gap: 8px; padding: 8px 10px; padding-top: calc(8px + env(safe-area-inset-top)); border-bottom: 1px solid var(--line); background: #08111F; }
.ed-top h2 { margin: 0; font-size: 16px; flex: 1; text-align: center; }
.ed-main { display: grid; grid-template-columns: minmax(0, 1fr) 360px; min-height: 0; }
.ed-stage { position: relative; display: grid; place-items: center; min-height: 0; overflow: hidden; padding: 16px; touch-action: none;
  background: repeating-conic-gradient(#0C1729 0% 25%, #0A1424 0% 50%) 50% / 24px 24px; }
.ed-stage canvas.view { max-width: 100%; max-height: 100%; display: block; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.ed-crop { position: absolute; border: 2px solid var(--ps-lime); box-shadow: 0 0 0 9999px rgba(6, 13, 25, .62); touch-action: none; cursor: move; }
.ed-crop::before, .ed-crop::after { content: ""; position: absolute; pointer-events: none; border: 0 solid rgba(255, 255, 255, .35); }
.ed-crop::before { inset: 33.33% 0; border-width: 1px 0; }
.ed-crop::after { inset: 0 33.33%; border-width: 0 1px; }
.ed-crop .hd { position: absolute; width: 44px; height: 44px; margin: -22px; touch-action: none; }
.ed-crop .hd::after { content: ""; position: absolute; inset: 14px; border-radius: 50%; background: var(--ps-lime); box-shadow: 0 0 0 3px rgba(6, 13, 25, .7); }
.ed-crop .hd.nw { left: 0; top: 0; cursor: nwse-resize; } .ed-crop .hd.ne { left: 100%; top: 0; cursor: nesw-resize; }
.ed-crop .hd.sw { left: 0; top: 100%; cursor: nesw-resize; } .ed-crop .hd.se { left: 100%; top: 100%; cursor: nwse-resize; }
.ed-ov { position: absolute; cursor: move; touch-action: none; padding: 4px; border: 1px dashed transparent; border-radius: 8px; }
.ed-ov.sel { border-color: var(--ps-lime); }
.ed-panel { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; border-inline-start: 1px solid var(--line); background: #08111F; }
.ed-tabs { display: grid; grid-template-columns: repeat(5, 1fr); border-bottom: 1px solid var(--line); }
.ed-tabs button { min-height: 58px; border: 0; background: none; color: var(--muted); font-size: 12.5px; font-weight: 700; display: grid; justify-items: center; gap: 3px; align-content: center; cursor: pointer; border-bottom: 3px solid transparent; }
.ed-tabs button svg { width: 22px; height: 22px; }
.ed-tabs button[aria-selected="true"] { color: var(--ps-lime); border-bottom-color: var(--ps-lime); }
.ed-body { overflow-y: auto; padding: 14px; display: grid; gap: 14px; align-content: start; }
.ed-bottom { display: flex; gap: 10px; padding: 10px 12px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #08111F; align-items: center; }
.ed-bottom .grow { color: var(--muted); font-size: 13px; }
.flt-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.flt { display: grid; gap: 5px; justify-items: center; border: 0; background: none; color: var(--fg-2); font-size: 12px; font-weight: 600; cursor: pointer; padding: 0; text-align: center; }
.flt canvas { width: 100%; aspect-ratio: 1; border-radius: 14px; border: 2px solid transparent; display: block; background: var(--ps-night-3); }
.flt[aria-pressed="true"] canvas { border-color: var(--ps-lime); box-shadow: 0 0 0 3px rgba(225, 228, 40, .25); }
.flt[aria-pressed="true"] { color: var(--ps-lime); }
.sl { display: grid; gap: 4px; }
.sl .lh { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; font-weight: 600; }
.sl .lh output { font-family: var(--f-mono); font-size: 12.5px; color: var(--ps-lime); min-width: 3ch; text-align: end; }
.sl input[type="range"] { width: 100%; }
input[type="range"] { -webkit-appearance: none; appearance: none; height: 32px; background: transparent; cursor: pointer; padding: 0; border: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--ps-steel), var(--ps-steel)); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--ps-steel); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--ps-lime); margin-top: -10px; border: 3px solid #08111F; box-shadow: 0 0 0 1px rgba(225, 228, 40, .6); }
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--ps-lime); border: 3px solid #08111F; }
input[type="range"]:focus-visible { outline: 2px solid var(--ps-lime); outline-offset: 2px; border-radius: 8px; }
.aspect-row .chip-b { min-width: 58px; justify-content: center; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { width: 36px; height: 36px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .25); cursor: pointer; }
.swatches button[aria-pressed="true"] { border-color: var(--ps-lime); box-shadow: 0 0 0 3px rgba(225, 228, 40, .3); }
.sw-c0 { background: #F4F7FB; } .sw-c1 { background: #E1E428; } .sw-c2 { background: #FDFD18; } .sw-c3 { background: #2FD3C6; } .sw-c4 { background: #38B6FF; }
.sw-c5 { background: #FFB547; } .sw-c6 { background: #0A1424; } .sw-c7 { background: #0E1726; } .sw-c8 { background: #F4F1EA; }
.ed-busy { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(6, 13, 25, .55); z-index: 5; }
@media (max-width: 900px) {
  .ed-main { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .ed-stage { padding: 10px; }
  .ed-panel { border-inline-start: 0; border-top: 1px solid var(--line); grid-template-rows: auto auto; max-height: 46dvh; }
  .ed-panel .ed-tabs { order: 2; border-bottom: 0; border-top: 1px solid var(--line); }
  .ed-panel .ed-body { order: 1; max-height: calc(46dvh - 58px); }
  .flt-grid { display: flex; overflow-x: auto; gap: 10px; padding-bottom: 4px; }
  .flt-grid .flt { flex: none; width: 76px; }
}


/* editor canvas wrapper + overlay layer (sizes set by JS) */
.ed-cv { position: relative; flex: none; }
.ed-cv canvas.view { width: 100%; height: 100%; max-width: none; max-height: none; }
.ed-layer { position: absolute; inset: 0; }
.ed-ov img { display: block; pointer-events: none; }
.ed-ov-t { display: inline-flex; align-items: center; gap: .3em; line-height: 1.32; white-space: pre; text-align: center; text-shadow: 0 .04em .25em rgba(0, 0, 0, .45); }
.ed-ov-t.pill-bg { padding: .28em .5em; border-radius: .6em; text-shadow: none; }
.ed-ov-t svg { width: 1.05em; height: 1.05em; flex: none; }
.ed-ov:focus-visible { outline: 2px solid var(--ps-lime); outline-offset: 2px; }
.vt-tabs { grid-template-columns: repeat(4, 1fr); }
.vt-cover { max-width: 100%; max-height: 220px; border-radius: 12px; display: block; }
.vt-stage { padding: 12px; }

/* ---------------------------------------------------------------- video tools */
.vt { display: grid; gap: 14px; }
.vt-player { position: relative; border-radius: 18px; overflow: hidden; background: #000; max-height: 56dvh; display: grid; place-items: center; }
.vt-player video { max-width: 100%; max-height: 56dvh; display: block; }
.vt-player .fx { position: absolute; inset: 0; pointer-events: none; }
.vt-time { position: relative; height: 64px; border-radius: 14px; overflow: hidden; background: var(--ps-night-3); direction: ltr; }
.vt-time .frames { position: absolute; inset: 0; display: flex; }
.vt-time .frames canvas { flex: 1 1 0; min-width: 0; height: 100%; display: block; object-fit: cover; }
.vt-time .sel { position: absolute; top: 0; bottom: 0; border: 3px solid var(--ps-lime); border-radius: 10px; box-shadow: 0 0 0 9999px rgba(6, 13, 25, .6); pointer-events: none; }
.vt-time .ph { position: absolute; top: -2px; bottom: -2px; width: 3px; background: #fff; border-radius: 2px; pointer-events: none; }
.vt-ranges { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------------------------------------------------------------- stories */
.st-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .st-layout { grid-template-columns: 1fr; } }
.st-stage { position: relative; width: min(360px, 100%); aspect-ratio: 9 / 16; margin-inline: auto; border-radius: 26px; overflow: hidden; background: linear-gradient(160deg, #10203A, #070F1C); border: 1px solid var(--line-2); box-shadow: 0 30px 80px rgba(0, 0, 0, .55); }
.st-stage canvas, .st-stage video, .st-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.st-stage .bars { position: absolute; top: 10px; inset-inline: 10px; display: flex; gap: 4px; z-index: 3; }
.st-stage .bars i { flex: 1; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .35); }
.st-stage .bars i.on { background: #fff; }
.st-stage .linkst { position: absolute; bottom: 9%; left: 50%; transform: translateX(-50%); z-index: 3; background: #fff; color: #0A1424; border-radius: 999px; padding: 8px 16px; font-weight: 800; font-size: 14px; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; max-width: 86%; overflow: hidden; text-overflow: ellipsis; }
.st-items { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 8px; }
.st-item { flex: none; width: 74px; display: grid; gap: 4px; justify-items: center; font-size: 12px; color: var(--muted); }
.st-item button.th { width: 74px; aspect-ratio: 9 / 16; border-radius: 12px; overflow: hidden; border: 2px solid transparent; padding: 0; background: var(--ps-night-3); cursor: pointer; }
.st-item button.th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-item button.th[aria-pressed="true"] { border-color: var(--ps-lime); }
.st-item .add { display: grid; place-items: center; color: var(--ps-lime); border: 2px dashed rgba(225, 228, 40, .45); }
.story-ring { width: 64px; height: 64px; border-radius: 50%; padding: 3px; background: conic-gradient(var(--ps-lime), var(--ps-teal), var(--ps-lime)); flex: none; }
.story-ring.off { background: var(--ps-steel); }
.story-ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid #0A1424; display: block; background: #0A1424; }
.story-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; border-radius: 18px; background: var(--glass-bg), #0E1C33; border: 1px solid var(--glass-bd); }

/* ---------------------------------------------------------------- accounts */
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.acc { display: grid; gap: 10px; padding: 16px; border-radius: 22px; background: var(--glass-bg), #0E1C33; border: 1px solid var(--glass-bd); align-content: start; }
.acc .hd { display: flex; align-items: center; gap: 10px; }
.acc .hd .ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: rgba(255, 255, 255, .07); flex: none; }
.acc .hd .ico svg { width: 24px; height: 24px; }
.acc .hd b { font-size: 16px; }
.acc .need { font-size: 13.5px; color: var(--muted); margin: 0; }
.acc .last { font-size: 13px; color: var(--fg-2); border-top: 1px solid var(--line); padding-top: 8px; display: grid; gap: 4px; }

/* ---------------------------------------------------------------- mail */
.mail-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.mail-layout .pv-col { position: sticky; top: 76px; }
@media (max-width: 1100px) { .mail-layout { grid-template-columns: 1fr; } .mail-layout .pv-col { position: static; } }
.rcpt { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px; align-items: start; }
.rcpt > span { padding-top: 12px; font-weight: 700; font-size: 13.5px; color: var(--fg-2); }
.tok-in { position: relative; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 48px; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 12px; background: rgba(7, 15, 28, .55); }
.tok-in:focus-within { border-color: var(--ps-lime); }
.tok-in input { flex: 1 1 140px; min-width: 120px; border: 0 !important; background: none !important; box-shadow: none !important; padding: 6px 4px; min-height: 34px; outline: none; }
.tok { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 999px; background: rgba(225, 228, 40, .12); border: 1px solid rgba(225, 228, 40, .35); font-size: 13.5px; direction: ltr; max-width: 100%; }
.tok.bad { background: rgba(255, 138, 122, .12); border-color: rgba(255, 138, 122, .5); }
.tok button { width: 26px; height: 26px; border-radius: 50%; border: 0; background: none; color: inherit; cursor: pointer; display: grid; place-items: center; }
.tok button svg { width: 14px; height: 14px; }
.ac-list { position: absolute; z-index: 30; top: 100%; inset-inline: 0; margin-top: 4px; background: #0E1C33; border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 20px 50px rgba(0, 0, 0, .55); padding: 4px; max-height: 260px; overflow-y: auto; }
.ac-list button { display: grid; width: 100%; text-align: start; border: 0; background: none; padding: 8px 10px; border-radius: 10px; cursor: pointer; color: var(--fg); min-height: 44px; }
.ac-list button small { color: var(--muted); direction: ltr; text-align: start; }
.ac-list button[aria-selected="true"], .ac-list button:hover { background: rgba(255, 255, 255, .07); }
.blk-list { display: grid; gap: 10px; }
.blk { border: 1px solid var(--line); border-radius: 16px; background: rgba(7, 15, 28, .45); }
.blk .bh { display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 12px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--muted); }
.blk .bh .grow { color: var(--fg-2); }
.blk .bh .icon-btn { min-width: 36px; min-height: 36px; width: 36px; height: 36px; border-radius: 10px; }
.blk .bb { padding: 10px 12px 12px; display: grid; gap: 8px; }
.blk .bb textarea { min-height: 84px; }
.fmt-bar { display: flex; gap: 6px; }
.fmt-bar .btn { min-height: 34px; padding: 0 10px; font-size: 13px; }
.kv-row { display: grid; grid-template-columns: 1fr 1.4fr 36px; gap: 6px; }
.add-blk { display: flex; gap: 6px; flex-wrap: wrap; }
.add-blk .btn { min-height: 38px; font-size: 13.5px; border-radius: 999px; }
.mail-frame { width: 100%; border: 0; display: block; background: #fff; border-radius: 14px; height: 70vh; min-height: 480px; }
.mail-frame-wrap { display: grid; place-items: center; background: #E9EDF3; border-radius: 18px; padding: 12px; }
.mail-frame-wrap.phone .mail-frame { width: 375px; max-width: 100%; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.tpl-grid button { display: grid; gap: 4px; text-align: start; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); color: var(--fg); cursor: pointer; min-height: 72px; }
.tpl-grid button[aria-pressed="true"] { border-color: var(--ps-lime); background: rgba(225, 228, 40, .07); }
.tpl-grid button small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.att-list { display: grid; gap: 6px; }
.att-list .att { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 12px; border: 1px solid var(--line); font-size: 13.5px; min-height: 44px; }
.log-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 16px; border: 1px solid var(--line); background: rgba(7, 15, 28, .45); }
.log-row .s { display: grid; min-width: 0; }
.log-row .s b, .log-row .s small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-row .s small { color: var(--muted); }


.mail-img-th { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
.story-ring .ini { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; background: #0A1424; border: 3px solid #0A1424; color: var(--ps-lime); font-weight: 800; }
.log-row .story-ring { width: 44px; height: 44px; }
button.log-row { width: 100%; text-align: start; color: inherit; font: inherit; cursor: pointer; }
button.log-row:hover { border-color: var(--line-2); background: rgba(255, 255, 255, .04); }
.pv-phone-btn { display: none; }
@media (max-width: 1100px) { .pv-phone-btn { display: inline-flex; } .mail-layout .pv-col { display: none; } }
.confirm-msg { white-space: pre-line; margin: 0; line-height: 1.7; }

/* ---------------------------------------------------------------- AI tools */
.ai-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .ai-cards { grid-template-columns: 1fr; } }
.ai-card { display: grid; gap: 8px; padding: 18px; border-radius: 24px; text-decoration: none; color: var(--fg); background: radial-gradient(400px 200px at 90% 0%, rgba(225, 228, 40, .12), rgba(225, 228, 40, 0) 60%), var(--glass-bg), #0E1C33; border: 1px solid var(--glass-bd); min-height: 150px; }
.ai-card:hover { border-color: rgba(225, 228, 40, .5); text-decoration: none; }
.ai-card svg { width: 30px; height: 30px; color: var(--ps-lime); }
.ai-card b { font-size: 18px; }
.ai-card span { color: var(--muted); font-size: 14px; }
.stepper { display: flex; gap: 6px; margin: 0 0 16px; flex-wrap: wrap; }
.stepper span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 700; }
.stepper span i { font-style: normal; font-family: var(--f-mono); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .08); font-size: 12px; }
.stepper span.on { color: var(--ps-on-lime); background: var(--ps-lime); border-color: transparent; }
.stepper span.on i { background: rgba(10, 15, 5, .15); }
.stepper span.done { color: var(--ok); border-color: rgba(123, 224, 160, .4); }
.evi { display: grid; gap: 6px; font-size: 13.5px; }
.evi .e { padding: 8px 10px; border-radius: 12px; background: rgba(7, 15, 28, .5); border: 1px solid var(--line); }
.evi .e b { font-family: var(--f-mono); font-size: 12.5px; color: var(--ps-lime); margin-inline-end: 6px; }
.diff2 { display: grid; gap: 10px; }
.diff2 .d { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.diff2 .d .p { padding: 8px 12px; font-family: var(--f-mono); font-size: 12.5px; color: var(--ps-lime); background: rgba(255, 255, 255, .03); border-bottom: 1px solid var(--line); }
.diff2 .d .cols { display: grid; grid-template-columns: 1fr 1fr; }
.diff2 .d .cols > div { padding: 10px 12px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.7; min-width: 0; }
.diff2 .d .cols .b { background: rgba(255, 138, 122, .06); border-inline-end: 1px solid var(--line); }
.diff2 .d .cols .a { background: rgba(123, 224, 160, .06); }
.diff2 .d .cols small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
@media (max-width: 640px) { .diff2 .d .cols { grid-template-columns: 1fr; } .diff2 .d .cols .b { border-inline-end: 0; border-bottom: 1px solid var(--line); } }

/* ---------------------------------------------------------------- phones: general */
@media (max-width: 560px) {
  .content { padding: 16px 14px; }
  .f2 { grid-template-columns: 1fr; }
  .v11-head h1 { font-size: 26px; }
  .panel { padding: 14px; border-radius: 20px; }
  .top { min-height: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; }
}
