/* Phantom · «Живой директор». Visual layer over the existing markup.
   Behaviour rules (editor modes, cadence toggles) stay in style.css / product-interface.css.
   Night = [data-theme=dark], day = [data-theme=light]. No inline styles: the app's CSP forbids them,
   dynamic values arrive through data-css and are applied by g-shell.js. */

@font-face { font-family: 'Rubik'; src: url('/fonts/rubik-cyrillic.woff2') format('woff2'); font-weight: 300 800; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Rubik'; src: url('/fonts/rubik-latin.woff2') format('woff2'); font-weight: 300 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2190-2199, U+2212, U+2215; }
/* Telegram previews: Roboto cut down to Latin, Cyrillic and common symbols (80 KB instead of 500 KB); the full files stay for chat screenshots */
@font-face { font-family: 'TG Roboto'; src: url('/fonts/tg-roboto-400.woff2') format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0020-007E, U+00A0-024F, U+02B0-02FF, U+0400-052F, U+1E00-1EFF, U+2000-206F, U+20A0-20CF, U+2100-215F, U+2190-21FF, U+2212-2215, U+2260-2265, U+25A0-25FF, U+2600-26FF; }
@font-face { font-family: 'TG Roboto'; src: url('/fonts/tg-roboto-500.woff2') format('woff2'); font-weight: 500 700; font-display: swap; unicode-range: U+0020-007E, U+00A0-024F, U+02B0-02FF, U+0400-052F, U+1E00-1EFF, U+2000-206F, U+20A0-20CF, U+2100-215F, U+2190-21FF, U+2212-2215, U+2260-2265, U+25A0-25FF, U+2600-26FF; }

/* ---------- tokens ---------- */
:root[data-theme] { --font: 'Rubik', system-ui, -apple-system, 'Segoe UI', sans-serif; --tg: 'TG Roboto', Roboto, system-ui, sans-serif; --spring: cubic-bezier(.3, 1.4, .5, 1); --ease: cubic-bezier(.2, .8, .2, 1); --r: 18px; --r-lg: 24px; }
:root[data-theme=dark] {
  --bg: #080914; --ink: #eef0ff; --ink-2: #c4c8e6; --muted: #8a8fb3; --faint: #5a5f85;
  --glass: rgba(255, 255, 255, .045); --glass-2: rgba(255, 255, 255, .08); --glass-3: rgba(255, 255, 255, .13); --chip: rgba(255, 255, 255, .08);
  --card: rgba(15, 17, 36, .82); --card-2: rgba(21, 24, 50, .94); --spot: rgba(160, 255, 220, .055); --hair: rgba(255, 255, 255, .045);
  --line: rgba(255, 255, 255, .08); --line-2: rgba(255, 255, 255, .16); --panel: #11132a; --panel-2: #181b38;
  --mint: #7cf0c4; --mint-2: #b6f8df; --on-mint: #052118; --mint-soft: rgba(124, 240, 196, .14);
  --pub: #6ee7b0; --queue: #8fb4ff; --review: #ffc46b; --plan: #7b80a8; --fail: #ff7a8a; --bubble-in: rgba(255, 255, 255, .08);
  --shadow: 0 24px 60px -30px rgba(0, 0, 0, .9); --shadow-pop: 0 40px 120px -30px rgba(0, 0, 0, .75), inset 0 0 0 1px rgba(255, 255, 255, .1);
  --say-bg: #f6f7ff; --say-ink: #12142a; --say-primary: #12142a; --say-btn: rgba(18, 20, 42, .07); --m-ring: #7cf0c4; --m-ring-bg: rgba(255, 255, 255, .12);
  /* legacy tokens used by style.css */
  --page: transparent; --paper: var(--card); --soft: var(--glass); --hover: var(--glass-2); --tint: var(--mint-soft); --accent: var(--mint); --hover-accent: var(--mint-2); --nav: transparent;
  color-scheme: dark;
}
:root[data-theme=light] {
  --bg: #e9f1ff; --ink: #11152b; --ink-2: #3a4063; --muted: #646b91; --faint: #a1a7c4;
  --glass: rgba(255, 255, 255, .6); --glass-2: rgba(255, 255, 255, .85); --glass-3: #ffffff; --chip: rgba(17, 21, 43, .06);
  --card: rgba(255, 255, 255, .82); --card-2: #ffffff; --spot: rgba(14, 166, 118, .07); --hair: rgba(255, 255, 255, .95);
  --line: rgba(17, 21, 43, .08); --line-2: rgba(17, 21, 43, .14); --panel: #ffffff; --panel-2: #f3f6fd;
  --mint: #0ea676; --mint-2: #37cf9c; --on-mint: #ffffff; --mint-soft: rgba(14, 166, 118, .12);
  --pub: #109e64; --queue: #2f6cf6; --review: #c97608; --plan: #9aa0bd; --fail: #d93549; --bubble-in: #eef2fa;
  --shadow: 0 24px 60px -34px rgba(30, 50, 110, .45); --shadow-pop: 0 40px 120px -30px rgba(30, 50, 110, .45), inset 0 0 0 1px rgba(17, 21, 43, .08);
  --say-bg: #11152b; --say-ink: #f4f6ff; --say-primary: #0ea676; --say-btn: rgba(255, 255, 255, .12); --m-ring: #0ea676; --m-ring-bg: rgba(17, 21, 43, .1);
  --page: transparent; --paper: var(--card); --soft: var(--glass); --hover: var(--glass-2); --tint: var(--mint-soft); --accent: var(--mint); --hover-accent: var(--mint-2); --nav: transparent;
  color-scheme: light;
}

/* ---------- base ---------- */
:root[data-theme] { font-family: var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); transition: background-color .8s, color .5s; }
button, input, select, textarea { font-family: var(--font); }
::selection { background: var(--mint-soft); }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.icon, .i { flex: none; display: block; }
.muted, .small.muted { color: var(--muted); }
a { color: var(--mint); }
h1, h2, h3 { color: var(--ink); text-wrap: balance; }
.eyebrow { letter-spacing: 0; text-transform: none; font-size: 12.5px; font-weight: 500; color: var(--muted); }
[hidden] { display: none !important; }

/* sky */
.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.sky-night, .sky-day { position: absolute; inset: 0; transition: opacity 1.2s var(--ease); }
.sky-night { background: radial-gradient(1200px 700px at 70% -10%, #1a1d48 0%, transparent 60%), radial-gradient(900px 600px at 0% 100%, #10243a 0%, transparent 60%), #080914; }
.sky-night canvas { position: absolute; inset: -30px; transition: transform .8s var(--ease); }
.sky-day { opacity: 0; overflow: hidden; background: radial-gradient(900px 500px at 85% -10%, #fff7da 0%, transparent 55%), linear-gradient(180deg, #cfe3ff 0%, #e7f0ff 45%, #f4f8ff 100%); }
:root[data-theme=light] .sky-night { opacity: 0; } :root[data-theme=light] .sky-day { opacity: 1; }
.sun { position: absolute; right: 8%; top: -120px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 236, 170, .95) 0%, rgba(255, 226, 140, .45) 35%, transparent 70%); transform: translateY(80px); transition: transform 1.6s var(--ease); }
:root[data-theme=light] .sun { transform: none; }
.cloud { position: absolute; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0)); filter: blur(2px); }
.cloud.c1 { width: 520px; height: 180px; top: 8%; left: -10%; animation: g-drift 110s linear infinite; }
.cloud.c2 { width: 380px; height: 140px; top: 32%; left: 40%; animation: g-drift 140s linear infinite -40s; opacity: .8; }
.cloud.c3 { width: 620px; height: 200px; top: 62%; left: 10%; animation: g-drift 170s linear infinite -90s; opacity: .7; }
.cloud.c4 { width: 300px; height: 110px; top: 18%; left: 70%; animation: g-drift 120s linear infinite -20s; opacity: .9; }
@keyframes g-drift { from { transform: translateX(-30vw); } to { transform: translateX(120vw); } }
.sky::after { content: ''; position: absolute; inset: 0; background-image: var(--grain); opacity: .045; mix-blend-mode: overlay; }
.tw { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff; box-shadow: 0 0 6px 1px rgba(200, 255, 235, .8); animation: g-tw 4s ease-in-out infinite; }
@keyframes g-tw { 0%, 100% { opacity: .15; transform: scale(.6); } 50% { opacity: 1; transform: scale(1.3); } }
.shoot { position: absolute; width: 180px; height: 1.6px; border-radius: 2px; background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(220, 255, 240, .95)); transform: rotate(-22deg); opacity: 0; }
.shoot.go { animation: g-shoot 1.25s cubic-bezier(.3, .6, .4, 1) forwards; }
@keyframes g-shoot { 0% { opacity: 0; translate: 0 0; } 12% { opacity: 1; } 100% { opacity: 0; translate: 340px 138px; } }

/* logo */
.logo-mark { width: 42px; height: 42px; border-radius: 14px; display: inline-grid; place-items: center; background: linear-gradient(150deg, var(--mint-2), var(--mint)); box-shadow: 0 10px 30px -8px rgba(124, 240, 196, .55); flex: none; }
.logo-mark::before { content: ''; width: 24px; height: 26px; background: #fff; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 3.2c-6 0-10.2 4.4-10.2 10.3v14.1c0 .8.9 1.2 1.5.7l2.2-1.8 2.6 2.1c.4.3.9.3 1.3 0L16 26.5l2.6 2.1c.4.3.9.3 1.3 0l2.6-2.1 2.2 1.8c.6.5 1.5.1 1.5-.7V13.5C26.2 7.6 22 3.2 16 3.2zM12.4 11.8a1.7 2.2 0 1 0 0 4.4 1.7 2.2 0 1 0 0-4.4zm7.2 0a1.7 2.2 0 1 0 0 4.4 1.7 2.2 0 1 0 0-4.4z' fill-rule='evenodd'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 3.2c-6 0-10.2 4.4-10.2 10.3v14.1c0 .8.9 1.2 1.5.7l2.2-1.8 2.6 2.1c.4.3.9.3 1.3 0L16 26.5l2.6 2.1c.4.3.9.3 1.3 0l2.6-2.1 2.2 1.8c.6.5 1.5.1 1.5-.7V13.5C26.2 7.6 22 3.2 16 3.2zM12.4 11.8a1.7 2.2 0 1 0 0 4.4 1.7 2.2 0 1 0 0-4.4zm7.2 0a1.7 2.2 0 1 0 0 4.4 1.7 2.2 0 1 0 0-4.4z' fill-rule='evenodd'/%3E%3C/svg%3E") center / contain no-repeat; }
.brand-text { font-weight: 600; font-size: 18px; letter-spacing: -.02em; color: var(--ink); display: inline-flex; align-items: baseline; gap: 6px; }
.brand-text small { font-size: 12px; font-weight: 500; color: var(--muted); }
.wordmark { display: inline-flex !important; align-items: center; gap: 11px; text-decoration: none !important; color: var(--ink); }

/* ---------- controls ---------- */
body button { border: 0; background: var(--glass-2); color: var(--ink); border-radius: 13px; font-weight: 500; box-shadow: inset 0 0 0 1px var(--line); transition: background .2s, transform .25s var(--spring), box-shadow .2s, color .2s; }
body button:hover { background: var(--glass-3); }
body button:active:not(:disabled) { transform: scale(.97); }
body button.primary, :root[data-theme] button.primary { background: linear-gradient(160deg, var(--mint-2), var(--mint)); color: var(--on-mint); box-shadow: 0 12px 34px -14px rgba(124, 240, 196, .75); font-weight: 600; border: 0; }
body button.primary:hover { filter: brightness(1.04); background: linear-gradient(160deg, var(--mint-2), var(--mint)); }
body button.subtle { background: transparent; box-shadow: none; color: var(--muted); }
body button.subtle:hover { background: var(--glass); color: var(--ink); }
body button.danger { color: var(--fail); }
body button:disabled { opacity: .5; }
body button.arm { background: linear-gradient(160deg, #ffd27a, #ffb347) !important; color: #2a1800 !important; box-shadow: 0 0 0 4px rgba(255, 196, 107, .25) !important; }
body input, body select, body textarea { border: 0; border-radius: 13px; background: var(--glass-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .2s, background .2s; }
body input::placeholder, body textarea::placeholder { color: var(--faint); }
body input:focus, body select:focus, body textarea:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--mint), 0 0 0 4px var(--mint-soft); }
body select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%238a8fb3' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
body label { color: var(--muted); font-weight: 500; }
body input[type=checkbox], body input[type=radio] { accent-color: var(--mint); box-shadow: none; }

/* ---------- login ---------- */
.login { position: relative; z-index: 1; min-height: 100vh; background: transparent; grid-template-columns: minmax(0, 1.25fr) minmax(380px, 1fr); }
.login-copy { position: relative; background: transparent; padding: 48px clamp(32px, 7vw, 104px); display: flex; flex-direction: column; border: 0; }
.login-copy .wordmark { margin-bottom: 0; }
.login-hero { margin: auto 0; max-width: 640px; padding-bottom: 80px; }
.login-kicker { margin: 0 0 18px; font-size: 16px; font-weight: 500; color: var(--mint); }
.login-copy h1 { font-weight: 600; font-size: clamp(38px, 4.2vw, 62px); line-height: 1.03; letter-spacing: -.035em; margin: 0 0 22px; color: var(--ink); }
:root[data-theme=dark] .login-copy h1 { background: linear-gradient(180deg, #fff, #b8bde6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-copy .login-lead { color: var(--muted); font-size: 18px; line-height: 1.55; margin: 0; }
.login-perch { position: absolute; right: 12%; bottom: 14%; width: 150px; height: 190px; }
.login-orbit, .login-glimpse { display: none; }
.login-form { position: relative; z-index: 2; align-self: center; justify-self: center; width: 380px; max-width: 88%; gap: 16px; padding: 30px; border-radius: 28px; background: var(--card); box-shadow: var(--shadow-pop); backdrop-filter: blur(18px); }
.login-form h2 { font-size: 28px; font-weight: 600; letter-spacing: -.02em; margin: 0; }
.login-form-note { margin: -8px 0 6px; color: var(--muted); }
.login-form label { display: grid; gap: 8px; font-size: 13.5px; }
.login-form input { height: 50px; padding: 0 16px; font-size: 15px; }
.login-form .primary { height: 50px; font-size: 15px; margin-top: 6px; }
.login-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.theme-switch, .sidebar-tools button { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- shell ---------- */
#app.shell { position: relative; z-index: 1; }
/* The classic studio layout keeps its dark navigation column in both themes. */
body:not(.product-mode) .sidebar { background: rgba(10, 16, 28, .92); color: #dce6ee; backdrop-filter: blur(14px); }
body:not(.product-mode) .sidebar .brand-text { color: #fff; }
body:not(.product-mode) .sidebar .nav-item { color: #c7d2e0; }
body.product-mode .shell { position: relative; z-index: 1; display: grid; grid-template-columns: 78px minmax(0, 1fr); min-height: 100vh; background: transparent; }
body.product-mode.director-open .shell, body.product-mode[data-product-view=account] .shell { grid-template-columns: 78px minmax(0, 1fr); }
body.product-mode .sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 0 16px; background: transparent; border: 0; z-index: 12; }
body.product-mode .sidebar > .wordmark { padding: 0; margin-bottom: 10px; }
body.product-mode .sidebar > .wordmark .brand-text, body.product-mode .sidebar .sidebar-label, body.product-mode .sidebar-bottom .pilot-tag, body.product-mode .sidebar-bottom > p { display: none; }
body.product-mode .project-picker { position: relative; display: grid; grid-template-columns: 1fr; gap: 4px; justify-items: center; margin: 0 0 14px; width: 78px; }
body.product-mode .project-picker > button { width: 30px; height: 30px; min-height: 30px; padding: 0; border-radius: 10px; display: grid; place-items: center; color: var(--muted); background: transparent; box-shadow: none; }
body.product-mode .project-picker > button:hover { background: var(--glass); color: var(--ink); }
body.product-mode #project-dropdown { position: relative; }
body.product-mode #project-label { list-style: none; display: flex; justify-content: center; align-items: center; gap: 0; width: 46px; height: 46px; padding: 0; border: 0; border-radius: 15px; cursor: pointer; background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line-2); }
body.product-mode #project-label::-webkit-details-marker { display: none; }
body.product-mode #project-label .project-ava { font-weight: 700; font-size: 18px; color: var(--ink); }
body.product-mode #project-label .project-name, body.product-mode #project-label > span[aria-hidden]:not(.project-ava) { display: none; }
body.product-mode #project-menu { position: absolute; left: 56px; top: 0; z-index: 40; min-width: 240px; padding: 6px; border-radius: 16px; background: var(--panel); box-shadow: var(--shadow-pop); }
body.product-mode #project-menu button { display: flex; justify-content: space-between; width: 100%; padding: 10px 12px; border-radius: 11px; background: transparent; box-shadow: none; text-align: left; }
body.product-mode #project-menu button:hover { background: var(--glass-2); }
body.product-mode .sidebar nav { display: flex; flex-direction: column; align-items: center; gap: 4px; }
body.product-mode .nav-item { position: relative; display: grid; place-items: center; width: 48px; height: 48px; min-height: 48px; padding: 0; border-radius: 16px; background: transparent; box-shadow: none; color: var(--faint); font-size: 0; }
body.product-mode .nav-item .nav-icon { width: 22px; height: 22px; display: grid; place-items: center; color: inherit; }
body.product-mode .nav-item .nav-icon svg { width: 22px; height: 22px; }
body.product-mode .nav-item:hover { background: var(--glass); color: var(--ink-2); }
body.product-mode .nav-item.active { background: var(--glass-2); color: var(--mint); box-shadow: inset 0 0 0 1px var(--line); font-weight: 400; }
body.product-mode .nav-item .nav-label { position: absolute; left: 58px; top: 50%; transform: translate(-4px, -50%); padding: 6px 10px; border-radius: 9px; background: var(--panel-2); color: var(--ink); font-size: 13px; white-space: nowrap; opacity: 0; pointer-events: none; transition: .15s; box-shadow: var(--shadow); z-index: 30; }
body.product-mode .nav-item:hover .nav-label { opacity: 1; transform: translate(0, -50%); }
body.product-mode .nav-item .badge-dot { position: absolute; right: 9px; top: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--fail); box-shadow: 0 0 0 3px var(--bg); }
body.product-mode .sidebar-bottom { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; border: 0; }
body.product-mode .product-status { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; padding: 0; }
body.product-mode .workspace-name { display: none; }
body.product-mode .balance-compact { display: grid; place-items: center; width: 46px; height: 46px; min-height: 46px; padding: 0; border-radius: 50%; background: linear-gradient(150deg, var(--mint-2), var(--mint)); color: var(--on-mint); font-size: 0; box-shadow: none; }
body.product-mode .balance-compact::before { content: attr(data-initial); font-size: 16px; font-weight: 700; }
body.product-mode .balance-compact > * { display: none; }
body.product-mode .sidebar-tools { display: flex; flex-direction: column; gap: 2px; }
body.product-mode .sidebar-tools button { width: 44px; height: 44px; min-height: 44px; padding: 0; justify-content: center; border-radius: 14px; font-size: 0; gap: 0; }
body.product-mode .chat-jump { display: none !important; }

/* page */
body.product-mode main { position: relative; max-width: none; width: 100%; padding: 18px 34px 170px; margin: 0; }
/* Every block of a page sits in one 1040px column (id selector: old rules reset margins with shorthands). */
body.product-mode #main > * { max-width: 1040px; margin-left: max(0px, calc((100% - 1040px) / 2)); margin-right: auto; }
@media (min-width: 901px) and (max-width: 1500px) { body.product-mode main { padding-right: 150px; } }
body.product-mode .page-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin: 10px auto 22px; }
body.product-mode .page-top .eyebrow { display: none; }
body.product-mode h1 { font-size: 46px; line-height: 1.02; font-weight: 600; letter-spacing: -.035em; margin: 0 0 6px; }
:root[data-theme=dark] body.product-mode main h1 { background: linear-gradient(180deg, #fff, #b8bde6); -webkit-background-clip: text; background-clip: text; color: transparent; }
body.product-mode .page-top p { font-size: 16px; color: var(--muted); margin: 0; }
body.product-mode h2 { font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
body.product-mode h3 { font-weight: 600; }
body.product-mode .actions { gap: 8px; }
:where(body.product-mode) button { min-height: 42px; padding: 0 16px; }
body.product-mode .panel, body.product-mode details.panel, body.product-mode .settings-card, body.product-mode .channel-card, body.product-mode .source-card, body.product-mode .persona-card, body.product-mode .story-rubric, body.product-mode .subscription-row, body.product-mode .topic-card { background: radial-gradient(420px circle at var(--mx, -999px) var(--my, -999px), var(--spot), transparent 45%), var(--card); border: 0; border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 var(--hair); }
body.product-mode .panel { padding: 22px 24px; }
body.product-mode .panel p { color: var(--muted); }
body.product-mode details.panel > summary { list-style: none; display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
body.product-mode details.panel > summary::-webkit-details-marker { display: none; }
body.product-mode details.panel > summary::before { content: ''; width: 7px; height: 7px; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(-45deg); transition: transform .25s var(--ease); margin-right: 4px; }
body.product-mode details.panel[open] > summary::before { transform: rotate(45deg); }
body.product-mode .product-tabs { position: relative; display: flex; width: fit-content; flex-wrap: wrap; gap: 2px; padding: 4px; margin-top: 0; margin-bottom: 22px; border: 0; border-radius: 16px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); }
body.product-mode .product-tabs button { min-height: 38px; padding: 0 16px; margin: 0; border: 0; border-radius: 12px; background: transparent; box-shadow: none; color: var(--muted); }
body.product-mode .product-tabs button[aria-selected=true], body.product-mode .product-tabs button.active { background: var(--glass-3); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line-2); }
body.product-mode .empty { background: var(--card); border: 1.5px dashed var(--line-2); border-radius: 28px; color: var(--muted); }
body.product-mode .notice { border: 0; border-radius: 14px; background: var(--glass); color: var(--ink-2); }
body.product-mode .error-box, body.product-mode .job-status.error { border: 0; border-radius: 14px; background: rgba(255, 122, 138, .1); color: var(--fail); }
body.product-mode .badge { background: var(--glass-2); color: var(--muted); border-radius: 8px; }
body.product-mode table { border-collapse: collapse; }
body.product-mode th { font-size: 13px; font-weight: 500; color: var(--muted); text-align: left; }
body.product-mode td, body.product-mode th { border-color: var(--line) !important; }
body.product-mode tr:hover td { background: var(--glass); }
body.product-mode .library-grid, body.product-mode .asset-grid { gap: 14px; }
body.product-mode .material-card, body.product-mode .asset-card, body.product-mode .video-tile, body.product-mode .chat-story-select { border: 0; border-radius: 20px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; transition: transform .3s var(--spring), box-shadow .2s; }
body.product-mode .material-card:hover, body.product-mode .asset-card:hover, body.product-mode .video-tile:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px var(--line-2), var(--shadow); }
body.product-mode .dropzone { border: 2px dashed var(--line-2); border-radius: 20px; background: transparent; }
body.product-mode label.tag-choice { border: 0; border-radius: 12px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); }
body.product-mode label.tag-choice:has(input:checked) { background: var(--mint-soft); box-shadow: inset 0 0 0 1.5px var(--mint); color: var(--ink); }
body.product-mode .wallet-address { background: var(--glass); border-radius: 14px; }

/* ---------- calendar ---------- */
.gtop { position: sticky; top: 0; z-index: 8; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 10px 0 12px; margin-bottom: 8px; }
.gtop::before { content: ''; position: absolute; inset: -18px -40px 0; z-index: -1; background: linear-gradient(var(--bg) 55%, transparent); opacity: .92; pointer-events: none; }
.chans { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; min-height: 38px; padding: 0 14px 0 5px; border-radius: 19px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.chip:hover { transform: translateY(-1px); }
.chip.on { background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line-2), 0 10px 30px -16px rgba(124, 240, 196, .5); color: var(--ink); }
.chip .cav, .tgh .cav, .sv-head .cav { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; background: linear-gradient(150deg, #ffb37a, #ff7f9e); flex: none; }
.chip .cav.c1 { background: linear-gradient(150deg, #7fd3ff, #4f7dff); } .chip .cav.c2 { background: linear-gradient(150deg, #c39bff, #7b5cff); } .chip .cav.c3 { background: linear-gradient(150deg, #8ff0c4, #2fb37f); }
.tgh .cav.c1, .sv-head .cav.c1 { background: linear-gradient(150deg, #7fd3ff, #4f7dff); } .tgh .cav.c2, .sv-head .cav.c2 { background: linear-gradient(150deg, #c39bff, #7b5cff); } .tgh .cav.c3, .sv-head .cav.c3 { background: linear-gradient(150deg, #8ff0c4, #2fb37f); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--review); }
.weeknav { display: flex; align-items: center; gap: 6px; }
.weeknav > button { width: 36px; min-height: 36px; height: 36px; padding: 0; border-radius: 12px; display: grid; place-items: center; background: transparent; box-shadow: none; color: var(--muted); }
.weeknav > button:hover { background: var(--glass); color: var(--ink); }
.week { position: relative; display: flex; gap: 2px; padding: 4px; border-radius: 18px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.week .ind { position: absolute; top: 4px; bottom: 4px; left: 0; border-radius: 14px; background: linear-gradient(160deg, rgba(124, 240, 196, .22), rgba(124, 240, 196, .08)); box-shadow: inset 0 0 0 1px rgba(124, 240, 196, .35); }
:root[data-theme=light] .week .ind { background: #fff; box-shadow: 0 4px 14px -4px rgba(30, 50, 110, .25), inset 0 0 0 1px rgba(14, 166, 118, .35); }
.week button { position: relative; z-index: 1; width: 62px; min-height: 0; height: auto; padding: 7px 0 8px; border-radius: 14px; display: grid; justify-items: center; gap: 2px; background: transparent; box-shadow: none; color: var(--muted); }
.week button:hover { background: transparent; color: var(--ink-2); }
.week button small { font-size: 12px; }
.week button b { font-size: 19px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.week button.on b, .week button.on small { color: var(--ink); }
.week button.today small { color: var(--mint); font-size: 11px; letter-spacing: -.01em; }
.week button.past b { color: var(--faint); }
.week .dt { display: flex; gap: 3px; height: 5px; }
.week .dt i { width: 5px; height: 5px; border-radius: 50%; }
.range { font-size: 13.5px; margin-left: 4px; white-space: nowrap; color: var(--muted); }
.bg-published { background: var(--pub); } .bg-approved, .bg-sending { background: var(--queue); } .bg-review { background: var(--review); } .bg-plan, .bg-draft { background: var(--plan); } .bg-failed { background: var(--fail); }
.s-published { color: var(--pub); } .s-approved, .s-sending { color: var(--queue); } .s-review { color: var(--review); } .s-plan, .s-draft { color: var(--plan); } .s-failed { color: var(--fail); }
.dayhead { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin: 14px 0 20px; }
.dayhead h1::first-letter { text-transform: uppercase; }
.dayhead .sub { margin: 8px 0 0; color: var(--muted); font-size: 16px; }
.dh-acts { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.gbtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 15px; font-weight: 600; white-space: nowrap; }
.gbtn .icon, .gbtn svg { width: 18px; height: 18px; }
.gbtn.ghosty { background: transparent; box-shadow: none; color: var(--muted); }
.gbtn.ghosty:hover { background: var(--glass); color: var(--ink); }
.gbtn.done { background: var(--mint-soft); color: var(--pub); box-shadow: none; cursor: default; transform: none !important; }
.gbtn.busy { cursor: wait; }
.gbtn.sm { height: 36px; min-height: 36px; padding: 0 13px; border-radius: 12px; font-size: 14px; }
.pipe { display: flex; align-items: center; margin: 0 0 22px; padding: 14px 18px; border-radius: 20px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 var(--hair); overflow-x: auto; }
.pipe em { flex: 1; min-width: 18px; height: 2px; margin: 0 10px; border-radius: 2px; background: var(--line-2); }
.pipe em.done { background: linear-gradient(90deg, var(--mint), color-mix(in srgb, var(--mint) 55%, transparent)); }
.ps { display: flex; align-items: center; gap: 9px; white-space: nowrap; color: var(--faint); }
.ps i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 2px var(--line-2); flex: none; }
.ps i svg { width: 15px; height: 15px; }
.ps b { font-weight: 500; font-size: 14px; }
.ps small { font-size: 12.5px; color: var(--muted); }
.ps.past { color: var(--ink-2); } .ps.past i { background: var(--mint-soft); box-shadow: inset 0 0 0 2px var(--mint); color: var(--mint); }
.ps.cur { color: var(--ink); } .ps.cur b { font-weight: 600; }
.ps.cur i { background: var(--mint); box-shadow: 0 0 0 5px var(--mint-soft); color: var(--on-mint); animation: g-cur 2s infinite; }
.pipe.done .ps.cur i { animation: none; }
.ps.bad i { background: var(--fail); box-shadow: 0 0 0 5px rgba(255, 122, 138, .18); } .ps.bad small { color: var(--fail); }
@keyframes g-cur { 0%, 100% { box-shadow: 0 0 0 4px var(--mint-soft); } 50% { box-shadow: 0 0 0 9px transparent; } }
.gwork { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; padding: 12px 16px; border-radius: 16px; background: var(--mint-soft); color: var(--ink-2); }
.gwork .spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--mint); border-top-color: transparent; animation: g-spin .8s linear infinite; flex: none; }
.gwork span { flex: 1; }
@keyframes g-spin { to { transform: rotate(360deg); } }
.gerr { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 18px; padding: 12px 16px; border-radius: 16px; background: rgba(255, 122, 138, .1); color: var(--fail); }
.cards { display: grid; gap: 12px; }
.gcard { border-radius: var(--r-lg); background: radial-gradient(420px circle at var(--mx, -999px) var(--my, -999px), var(--spot), transparent 45%), var(--card); box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 var(--hair); transition: box-shadow .3s, background .3s; overflow: hidden; }
.gcard:hover { background: radial-gradient(420px circle at var(--mx, -999px) var(--my, -999px), var(--spot), transparent 45%), var(--card-2); }
.gcard[open] { background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line-2), var(--shadow); }
.gcard.review { box-shadow: inset 0 0 0 1px rgba(255, 196, 107, .4), inset 0 1px 0 var(--hair), 0 0 44px -26px rgba(255, 196, 107, .7); }
.gcard.failed { box-shadow: inset 0 0 0 1px rgba(255, 122, 138, .5), inset 0 1px 0 var(--hair), 0 0 54px -26px rgba(255, 122, 138, .8); }
.gcard.plan { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-2); }
.card-row { list-style: none; display: grid; grid-template-columns: 62px 120px minmax(0, 1fr) auto 26px; gap: 18px; align-items: center; padding: 13px 16px 13px 12px; cursor: pointer; }
.card-row::-webkit-details-marker { display: none; }
.card-row time { font-size: 21px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.gcard.published .card-row time { color: var(--faint); }
.th { width: 120px; height: 84px; border-radius: 15px; overflow: hidden; display: block; background: var(--glass-2); }
.th img, .th video { width: 100%; height: 100%; object-fit: cover; display: block; }
.th.txt { display: flex; flex-direction: column; gap: 4px; padding: 11px 12px; font: 400 11.5px/1.38 var(--tg); color: var(--ink-2); background: linear-gradient(160deg, rgba(130, 150, 255, .16), rgba(130, 150, 255, .05)); -webkit-mask-image: linear-gradient(#000 58%, transparent 98%); mask-image: linear-gradient(#000 58%, transparent 98%); }
.th.txt b { font-weight: 500; font-size: 12.5px; color: var(--ink); }
:root[data-theme=light] .th.txt { background: linear-gradient(160deg, #eef1ff, #f7f8ff); }
.th.vo { display: grid; place-items: center; background: linear-gradient(160deg, rgba(106, 179, 243, .2), rgba(106, 179, 243, .06)); color: #6ab3f3; }
.th.vo svg { width: 70px; height: 34px; }
.th.poll { display: grid; align-content: center; gap: 5px; padding: 9px 10px; background: linear-gradient(160deg, rgba(106, 179, 243, .16), rgba(106, 179, 243, .05)); font-family: var(--tg); }
.th.poll b { font-size: 11.5px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th.poll span { display: block; height: 16px; border-radius: 6px; background: rgba(127, 140, 180, .14); padding-left: 7px; font-size: 11px; line-height: 16px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th.plan { display: grid; place-items: center; color: var(--faint); background: repeating-linear-gradient(135deg, var(--glass) 0 8px, transparent 8px 16px); }
.th.plan svg { width: 26px; height: 26px; }
.th.repost { display: grid; place-items: center; color: var(--mint); background: var(--mint-soft); }
.th.repost svg { width: 28px; height: 28px; }
.tt b { display: block; font-size: 17.5px; font-weight: 600; letter-spacing: -.01em; }
.tt span { display: block; color: var(--muted); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.st { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.st i { width: 8px; height: 8px; border-radius: 50%; }
:root[data-theme=dark] .st i { box-shadow: 0 0 12px currentColor; }
.chev { color: var(--faint); transition: transform .35s var(--spring); display: grid; place-items: center; }
.chev svg { width: 20px; height: 20px; }
.gcard[open] .chev { transform: rotate(90deg); color: var(--ink); }
.card-detail { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 26px; padding: 0 18px 18px 92px; align-items: start; }
.tg { border-radius: 18px; overflow: hidden; box-shadow: 0 18px 50px -28px rgba(0, 0, 0, .8); background: #0e1621 url('/telegram-wallpaper-dark.svg') center / cover; }
:root[data-theme=light] .tg { background: #d9e7cb url('/telegram-wallpaper.svg') center / cover; }
.tgh { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #17212b; color: #fff; font-family: var(--tg); }
:root[data-theme=light] .tgh { background: #fff; color: #000; box-shadow: 0 1px 0 rgba(0, 0, 0, .06); }
.tgh .cav { width: 36px; height: 36px; font-size: 15px; }
.tgh b { display: block; font-weight: 500; font-size: 15px; } .tgh small { color: #6d8193; font-size: 12.5px; }
.tgb { padding: 16px 14px 18px 18px; }
.bub { position: relative; max-width: 360px; border-radius: 16px 16px 16px 5px; background: #182533; color: #f3f6fa; font-family: var(--tg); box-shadow: 0 1px 1.5px rgba(0, 0, 0, .25); overflow: hidden; }
:root[data-theme=light] .bub { background: #fff; color: #000; box-shadow: 0 1px 1px rgba(0, 0, 0, .12); }
.bub .bm img, .bub .bm video { display: block; width: 100%; max-height: 420px; object-fit: cover; }
.bub .bm { display: grid; gap: 2px; }
.bub .bm.n2 { grid-template-columns: 1fr 1fr; }
.bub .tx { padding: 7px 12px; font-size: 15px; line-height: 1.38; white-space: pre-wrap; overflow-wrap: anywhere; }
.bub .tx b, .bub .tx strong { font-weight: 500; }
.bub .tx a { color: #6ab3f3; }
.bub .tx blockquote { margin: 6px 0; padding: 4px 10px; border-left: 3px solid #6ab3f3; background: rgba(106, 179, 243, .1); border-radius: 4px; }
.bub .tg-meta { display: flex; justify-content: flex-end; align-items: center; gap: 4px; margin: 0 10px 5px; font-size: 12px; color: #6d8193; }
.bub .tg-meta svg { width: 13px; height: 13px; }
.bub .bt { display: block; margin: 0 6px 6px; padding: 9px; border-radius: 10px; text-align: center; background: rgba(106, 179, 243, .12); color: #6ab3f3; font-weight: 500; font-size: 14px; text-decoration: none; }
:root[data-theme=light] .bub .bt { color: #2481cc; background: rgba(36, 129, 204, .1); }
.bub .pl { padding: 9px 12px; font-size: 15px; }
.bub .pl b { display: block; font-weight: 500; margin-bottom: 6px; }
.bub .pl small { display: block; color: #6d8193; font-size: 13px; margin: -4px 0 6px; }
.bub .pl div { display: flex; align-items: center; gap: 9px; padding: 5px 0; }
.bub .pl div::before { content: ''; width: 17px; height: 17px; border-radius: 50%; border: 1.5px solid #6d8193; flex: none; }
.bub .vo { display: flex; align-items: center; gap: 10px; padding: 10px 12px; color: #6ab3f3; }
.bub .vo .pb { width: 40px; height: 40px; border-radius: 50%; background: #6ab3f3; color: #fff; display: grid; place-items: center; flex: none; }
.bub .vo svg.wave { width: 170px; height: 26px; }
.bub .fw { padding: 10px 12px; font-size: 14px; }
.bub .fw b { display: block; color: #6ab3f3; font-weight: 500; margin-bottom: 4px; }
.bub.circle { width: 240px; background: transparent; box-shadow: none; }
.bub.circle .bm img, .bub.circle .bm video { width: 240px; height: 240px; border-radius: 50%; }
.bub.circle .tg-meta { margin: 4px 0 0; }
.planx { padding: 14px; border-radius: 14px; border: 1.5px dashed rgba(255, 255, 255, .25); color: #dfe6f0; max-width: 340px; }
:root[data-theme=light] .planx { border-color: rgba(0, 0, 0, .2); color: #334; }
.planx b { display: block; font-weight: 600; margin-bottom: 4px; }
.facts { display: grid; gap: 14px; align-content: start; }
.why { display: flex; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--mint-soft); color: var(--ink-2); font-size: 14px; line-height: 1.45; }
.why .gh { width: 20px; height: 22px; flex: none; margin-top: 1px; background: var(--mint); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 3.2c-6 0-10.2 4.4-10.2 10.3v14.1c0 .8.9 1.2 1.5.7l2.2-1.8 2.6 2.1c.4.3.9.3 1.3 0L16 26.5l2.6 2.1c.4.3.9.3 1.3 0l2.6-2.1 2.2 1.8c.6.5 1.5.1 1.5-.7V13.5C26.2 7.6 22 3.2 16 3.2zM12.4 11.8a1.7 2.2 0 1 0 0 4.4 1.7 2.2 0 1 0 0-4.4zm7.2 0a1.7 2.2 0 1 0 0 4.4 1.7 2.2 0 1 0 0-4.4z' fill-rule='evenodd'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 3.2c-6 0-10.2 4.4-10.2 10.3v14.1c0 .8.9 1.2 1.5.7l2.2-1.8 2.6 2.1c.4.3.9.3 1.3 0L16 26.5l2.6 2.1c.4.3.9.3 1.3 0l2.6-2.1 2.2 1.8c.6.5 1.5.1 1.5-.7V13.5C26.2 7.6 22 3.2 16 3.2zM12.4 11.8a1.7 2.2 0 1 0 0 4.4 1.7 2.2 0 1 0 0-4.4zm7.2 0a1.7 2.2 0 1 0 0 4.4 1.7 2.2 0 1 0 0-4.4z' fill-rule='evenodd'/%3E%3C/svg%3E") center / contain no-repeat; }
.err { display: flex; gap: 8px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 122, 138, .1); color: var(--fail); font-size: 14px; white-space: pre-wrap; }
.facts dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.facts dt { font-size: 12.5px; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 500; }
.facts .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.facts .post-translation button { min-height: 36px; padding: 0 13px; border-radius: 12px; font-size: 14px; }
.facts .post-translation .translation-body { border: 0; border-radius: 14px; background: var(--glass); color: var(--ink-2); }
.hist { margin-top: 2px; padding-top: 14px; border-top: 1px solid var(--line); }
.hist h4 { margin: 0 0 10px; font-size: 13px; font-weight: 500; color: var(--muted); }
.hr { position: relative; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 0 0 12px; font-size: 14px; color: var(--ink-2); }
.hr::before { content: ''; position: absolute; left: 4px; top: 12px; bottom: -2px; width: 1.5px; background: var(--line-2); }
.hr:last-child::before { display: none; }
.hr i { width: 10px; height: 10px; border-radius: 50%; background: var(--plan); box-shadow: 0 0 0 3px var(--card-2); transform: translateY(1px); }
.hr time { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.hr.ok i { background: var(--pub); } .hr.bad i { background: var(--fail); } .hr.bad span { color: var(--fail); }
.hr.now i { background: var(--review); animation: g-cur 2s infinite; } .hr.now span { color: var(--ink); font-weight: 500; }
.hr.next i { background: transparent; box-shadow: inset 0 0 0 2px var(--queue); } .hr.next span { color: var(--queue); }
.nowline { position: relative; display: grid; grid-template-columns: 62px 18px auto 1fr; align-items: center; gap: 0 12px; padding: 0 16px 0 12px; height: 26px; }
.nowline time { font-size: 13px; font-weight: 600; color: var(--mint); text-align: right; font-variant-numeric: tabular-nums; }
.nowline i { width: 10px; height: 10px; margin: 0 auto; border-radius: 50%; background: var(--mint); animation: g-cur 2s infinite; }
.nowline span { font-size: 12.5px; font-weight: 600; color: var(--mint); }
.nowline em { height: 1.5px; border-radius: 2px; background: linear-gradient(90deg, var(--mint), transparent); }
.slotrow { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-lg); border: 1.5px dashed var(--line-2); color: var(--ink-2); }
.slotrow .sl-ic { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--mint-soft); color: var(--mint); flex: none; }
.slotrow .sl-ic svg { width: 20px; height: 20px; }
.slotrow b { display: block; font-weight: 600; color: var(--ink); } .slotrow small { display: block; color: var(--muted); font-size: 13.5px; }
.slotrow .grow { flex: 1; min-width: 0; }
.emptyday { padding: 46px 30px; border-radius: 30px; text-align: center; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); display: grid; justify-items: center; gap: 10px; }
.emptyday b { font-size: 24px; font-weight: 600; }
.emptyday p { margin: 0 0 8px; max-width: 470px; color: var(--muted); }
.ed-perch { display: block; height: 118px; width: 140px; }
.gcard.flashok { animation: g-flashok 1s var(--ease); }
@keyframes g-flashok { 0% { box-shadow: inset 0 0 0 2px var(--pub), 0 0 0 0 rgba(110, 231, 176, .55); } 100% { box-shadow: inset 0 0 0 1px var(--line), 0 0 0 24px transparent; } }
.shake { animation: g-shake .55s; }
@keyframes g-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
/* drag to change time */
body.dnd, body.dnd * { cursor: grabbing !important; user-select: none; }
.cards.sorting .gcard { transition: transform .26s cubic-bezier(.3, 1.3, .5, 1); }
.cards.sorting .nowline { opacity: .35; }
.gcard.dragging { position: relative; z-index: 5; transition: none !important; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .7), inset 0 0 0 1.5px var(--mint) !important; background: var(--card-2) !important; }
.gcard.dragging .card-row time { color: var(--mint); }
.gcard.bad { box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .7), inset 0 0 0 1.5px var(--fail) !important; }
.gcard.bad .card-row time { color: var(--fail); }
.gcard[data-movable] .card-row { cursor: grab; }
.gcard[open] .card-row { cursor: pointer; }
#main img { -webkit-user-drag: none; }

/* ---------- director drawer ---------- */
body.product-mode .chat-panel, body.product-mode #chat { position: fixed !important; top: 0; right: 0; bottom: 0; z-index: 40; display: flex; flex-direction: column; width: min(460px, 100%); height: 100vh; max-height: none; background: var(--panel); border: 0; box-shadow: none; transform: translateX(105%); visibility: hidden; transition: transform .5s var(--ease), visibility 0s .5s, box-shadow .5s; }
body.product-mode.director-open .chat-panel, body.product-mode.director-open #chat { display: flex; transform: none; visibility: visible; box-shadow: -40px 0 90px -20px rgba(0, 0, 0, .55), inset 1px 0 0 var(--line); transition: transform .5s var(--ease), box-shadow .5s; }
body.product-mode .chat-head { display: flex; align-items: center; gap: 12px; padding: 18px 18px 14px 20px; border-bottom: 1px solid var(--line); min-height: 108px; position: relative; }
body.product-mode .chat-head .chat-person { display: flex; align-items: center; gap: 12px; }
body.product-mode .chat-head .dr-slot { width: 72px; height: 80px; flex: none; }
body.product-mode .chat-head .phantom-mark { display: none; }
body.product-mode .chat-person h3 { font-size: 18px; margin: 0; }
body.product-mode .chat-person small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
body.product-mode .chat-close { position: static; margin-left: auto; width: 38px; height: 38px; min-height: 38px; padding: 0; border-radius: 12px; display: grid; place-items: center; background: transparent; box-shadow: none; color: var(--muted); }
body.product-mode .chat-close:hover { background: var(--glass); color: var(--ink); }
body.product-mode .chat-messages { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
body.product-mode .chat-messages > * { flex-shrink: 0; }
body.product-mode .message { max-width: 88%; margin: 0; padding: 11px 14px; border-radius: 18px; font-size: 14.5px; line-height: 1.5; animation: g-rise .35s var(--spring); }
body.product-mode .message.user { align-self: flex-end; background: linear-gradient(160deg, var(--mint-2), var(--mint)); color: var(--on-mint); border-radius: 18px 18px 6px 18px; margin: 0; }
body.product-mode .message.assistant { align-self: flex-start; background: var(--bubble-in); color: var(--ink-2); border-radius: 18px 18px 18px 6px; padding: 11px 14px; }
body.product-mode .message-name { display: none; }
body.product-mode .message-context { font-size: 12px; opacity: .75; margin: 0 0 4px; background: none; padding: 0; }
body.product-mode .message-files a { display: inline-flex; margin: 8px 6px 0 0; padding: 6px 10px; border-radius: 10px; background: var(--glass); color: inherit; font-size: 13px; }
@keyframes g-rise { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
body.product-mode .chat-confirmation { margin-top: 10px; }
body.product-mode .chat-empty h2 { font-size: 20px; }
body.product-mode #chat-status:not(:empty) { margin: 0 14px 8px; }
body.product-mode .chat-compose { margin: 0 14px 14px; padding: 6px 6px 8px; border: 0; border-radius: 18px; background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line); }
body.product-mode .chat-compose:focus-within { box-shadow: inset 0 0 0 1.5px var(--mint); }
body.product-mode .chat-compose textarea { min-height: 54px; max-height: 180px; border: 0; background: transparent; box-shadow: none; padding: 10px 10px 4px; font-size: 14.5px; resize: none; }
body.product-mode .chat-compose textarea:focus { box-shadow: none; }
body.product-mode .chat-compose-footer { display: flex; align-items: center; gap: 2px; margin: 0; padding: 0 2px; }
body.product-mode .chat-compose-footer button { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; height: 38px; padding: 0 10px; border-radius: 12px; background: transparent; box-shadow: none; color: var(--muted); font-size: 13px; }
body.product-mode .chat-compose-footer button:hover { background: var(--glass); color: var(--ink); }
body.product-mode .chat-compose-footer button.primary { margin-left: auto; width: 40px; padding: 0; justify-content: center; background: linear-gradient(160deg, var(--mint-2), var(--mint)); color: var(--on-mint); }
body.product-mode .chat-compose-footer button.primary span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
body.product-mode #chat-hint { padding: 6px 10px 0; font-size: 11.5px; color: var(--faint); }
body.product-mode .context-chip, body.product-mode .attachment-chip { display: inline-flex; align-items: center; gap: 6px; margin: 6px 6px 0; padding: 5px 6px 5px 10px; border-radius: 10px; background: var(--mint-soft); color: var(--mint); font-size: 12.5px; font-weight: 600; }
body.product-mode .context-chip button, body.product-mode .attachment-chip button { min-height: 22px; height: 22px; width: 22px; padding: 0; background: transparent; box-shadow: none; color: inherit; }
body.product-mode .rec-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--fail); }

/* ---------- ask bar ---------- */
.askbar { position: fixed; left: calc(50% + 39px); bottom: 22px; transform: translateX(-50%); z-index: 20; width: min(600px, calc(100% - 140px)); display: flex; align-items: center; gap: 8px; padding: 7px 7px 7px 8px; border-radius: 22px; background: var(--panel); box-shadow: var(--shadow), inset 0 0 0 1px var(--line-2); transition: box-shadow .2s, opacity .3s; }
.askbar:focus-within { box-shadow: var(--shadow), inset 0 0 0 1.5px var(--mint), 0 0 0 5px var(--mint-soft); }
body.director-open .askbar, body:not(.product-mode) .askbar { opacity: 0; pointer-events: none; }
@media (min-width: 901px) and (max-width: 1500px) { .askbar { left: calc(50% - 19px); } }
.askbar .ask-open { width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 14px; display: grid; place-items: center; color: var(--muted); background: transparent; box-shadow: none; flex: none; }
.askbar .ask-open:hover { background: var(--glass); color: var(--ink); }
.askbar .hint { color: var(--mint); font-weight: 600; font-size: 14px; white-space: nowrap; }
.askbar input { flex: 1; min-width: 0; height: 42px; padding: 0; border: 0; background: transparent; box-shadow: none !important; color: var(--ink); font-size: 15px; }
.askbar .send { width: 42px; height: 42px; min-height: 42px; padding: 0; border-radius: 15px; display: grid; place-items: center; background: linear-gradient(160deg, var(--mint-2), var(--mint)); color: var(--on-mint); box-shadow: none; flex: none; }
.askkbd { flex: none; padding: 3px 8px; border-radius: 8px; background: var(--glass-2); color: var(--muted); font: 500 12px var(--font); cursor: pointer; }
.askbar:focus-within .askkbd { display: none; }
.ask-slot { display: none; }
.results { position: absolute; left: 0; right: 0; bottom: calc(100% + 10px); display: none; padding: 6px; border-radius: 20px; background: var(--panel); box-shadow: var(--shadow), inset 0 0 0 1px var(--line-2); }
.askbar.has-results:focus-within .results { display: grid; gap: 2px; }
.res { display: flex; align-items: center; gap: 12px; min-height: 0; height: auto; padding: 8px 10px; border-radius: 13px; text-align: left; background: transparent; box-shadow: none; }
.res:hover, .res.sel { background: var(--glass-2); }
.res .ri { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--glass); color: var(--muted); flex: none; overflow: hidden; }
.res .ri img { width: 100%; height: 100%; object-fit: cover; }
.res .grow { flex: 1; min-width: 0; }
.res b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res small { color: var(--muted); font-size: 12.5px; }
.res-foot { display: flex; justify-content: space-between; padding: 6px 10px 4px; color: var(--faint); font-size: 12px; }
.res-foot kbd { display: inline-block; min-width: 20px; padding: 1px 5px; margin-right: 3px; border-radius: 6px; background: var(--glass-2); color: var(--muted); font: 600 11px var(--font); text-align: center; }

/* ---------- dialogs, toast, menus ---------- */
body dialog#modal { width: min(660px, calc(100% - 24px)); max-height: calc(100% - 40px); padding: 26px; border: 0; border-radius: 28px; background: var(--panel); color: var(--ink); box-shadow: var(--shadow-pop); }
body dialog#modal[open] { animation: g-pop .4s var(--spring); }
@keyframes g-pop { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
body dialog::backdrop { background: rgba(4, 5, 14, .55); backdrop-filter: blur(4px); }
:root[data-theme=light] body dialog::backdrop { background: rgba(40, 60, 120, .22); }
body .dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
body .dialog-head h2 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
body .dialog-head button { width: 38px; height: 38px; min-height: 38px; padding: 0; border-radius: 12px; display: grid; place-items: center; background: transparent; box-shadow: none; color: var(--muted); font-size: 22px; }
body .dialog-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; border: 0; padding: 0; }
body #modal-content form { display: grid; gap: 14px; }
body #modal-content label { display: grid; gap: 7px; font-size: 13px; }
body #modal-content input, body #modal-content select, body #modal-content textarea { min-height: 46px; padding: 11px 14px; }
body .toast { position: fixed; left: calc(50% + 39px); top: 22px; bottom: auto; transform: translate(-50%, 0); z-index: 90; display: flex; align-items: center; gap: 14px; max-width: min(560px, calc(100% - 32px)); padding: 12px 18px; border-radius: 15px; background: linear-gradient(160deg, var(--mint-2), var(--mint)); color: var(--on-mint); font-weight: 600; box-shadow: 0 20px 50px -10px rgba(14, 166, 118, .45); transition: opacity .3s, transform .35s var(--spring); }
body .toast.hidden { display: flex !important; opacity: 0; transform: translate(-50%, -14px); pointer-events: none; }
body .toast.error { background: linear-gradient(160deg, #ffb3bc, #ff7a8a); color: #2b0509; }
.menu-me { position: fixed; z-index: 45; width: 270px; padding: 8px; border-radius: 20px; background: var(--panel); box-shadow: var(--shadow-pop); display: grid; gap: 2px; animation: g-pop .3s var(--spring); }
.menu-me .mm-head { display: flex; align-items: center; gap: 12px; padding: 8px 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-me .mm-ava { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(150deg, var(--mint-2), var(--mint)); color: var(--on-mint); font-weight: 700; }
.menu-me b { display: block; font-weight: 600; } .menu-me small { color: var(--muted); font-size: 12.5px; }
.menu-me button { display: flex; align-items: center; gap: 12px; min-height: 42px; height: 42px; padding: 0 10px; border-radius: 12px; text-align: left; background: transparent; box-shadow: none; color: var(--ink-2); }
.menu-me button:hover { background: var(--glass-2); color: var(--ink); }
.krow { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.krow:last-child { border-bottom: 0; }
.krow kbd { min-width: 40px; padding: 5px 10px; border-radius: 9px; background: var(--glass-2); box-shadow: inset 0 -2px 0 var(--line-2), inset 0 0 0 1px var(--line); font: 600 13px var(--font); text-align: center; color: var(--ink); }
.krow b { font-weight: 500; color: var(--ink-2); }

/* subscriber view */
.svwrap { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 28px; align-items: stretch; }
dialog#modal:has(.svwrap) { width: min(980px, calc(100% - 24px)); }
.sv-phone { height: min(660px, calc(100vh - 120px)); border-radius: 44px; padding: 11px; background: linear-gradient(160deg, #2a2d3c, #12131c 40%, #232634); box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .8), inset 0 0 0 1px rgba(255, 255, 255, .08); }
.sv-screen { position: relative; height: 100%; border-radius: 34px; overflow: hidden; display: flex; flex-direction: column; background: #0e1621 url('/telegram-wallpaper-dark.svg') center / cover; font-family: var(--tg); }
:root[data-theme=light] .sv-screen { background: #d9e7cb url('/telegram-wallpaper.svg') center / cover; }
.sv-status { display: flex; justify-content: space-between; align-items: center; padding: 12px 24px 4px 30px; color: #fff; font: 600 14px var(--font); background: #17212b; }
:root[data-theme=light] .sv-status { background: #fff; color: #000; }
.sv-head { display: flex; align-items: center; gap: 10px; padding: 6px 12px 10px; background: #17212b; color: #fff; }
:root[data-theme=light] .sv-head { background: #fff; color: #000; }
.sv-head .cav { width: 38px; height: 38px; }
.sv-head b { display: block; font-weight: 500; font-size: 15px; } .sv-head small { color: #6d8193; font-size: 12.5px; }
.sv-feed { flex: 1; overflow-y: auto; padding: 10px 10px 18px; display: flex; flex-direction: column; gap: 8px; scrollbar-width: none; }
.sv-feed > * { flex-shrink: 0; }
.sv-date { align-self: center; margin: 4px 0; padding: 4px 11px; border-radius: 12px; background: rgba(10, 18, 28, .45); color: #fff; font-size: 13px; }
.sv-msg .bub { max-width: 100%; }
.sv-msg.arrive { animation: g-svin .6s cubic-bezier(.3, 1.4, .5, 1) both; transform-origin: left bottom; }
@keyframes g-svin { from { opacity: 0; transform: translateY(26px) scale(.86); } to { opacity: 1; transform: none; } }
.sv-side { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.sv-time { display: flex; align-items: baseline; gap: 12px; }
.sv-time b { font-size: 56px; font-weight: 600; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.sv-time small { color: var(--muted); font-size: 14px; }
.sv-track input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; padding: 0; background: transparent; box-shadow: none !important; cursor: pointer; }
.sv-track input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--mint) var(--p, 100%), var(--line-2) var(--p, 100%)); }
.sv-track input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px var(--mint), 0 6px 14px rgba(0, 0, 0, .35); }
.sv-scale { display: flex; justify-content: space-between; color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.sv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sv-list li { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 12px; color: var(--muted); }
.sv-list li.lit { color: var(--ink); }
.sv-list li span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Fantom stage ---------- */
.stage { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.stage .mascot svg { pointer-events: auto; cursor: grab; touch-action: none; }
.stage .mascot.dragging svg { cursor: grabbing; }
.aura { position: fixed; inset: 0; z-index: 59; pointer-events: none; mix-blend-mode: screen; background: radial-gradient(300px circle at var(--ax, -500px) var(--ay, -500px), rgba(124, 240, 196, .085), transparent 70%); }
:root[data-theme=light] .aura { opacity: 0; }
body:not(.product-mode) .stage .mascot svg { cursor: pointer; }

/* view transition for day / night */
html.vt .sky-night, html.vt .sky-day, html.vt .sun, html.vt body { transition: none !important; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 9999; }

/* ---------- responsive ---------- */
@media (min-width: 901px) and (max-width: 1100px) { .weeknav { flex-wrap: wrap; } .wk-tools { max-width: 100%; flex-wrap: wrap; } }
@media (max-width: 1100px) { .card-detail { grid-template-columns: 1fr; padding-left: 18px; } .range { display: none; } .svwrap { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  body.product-mode .shell, body.product-mode.director-open .shell { display: block; }
  body.product-mode .sidebar { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 25; flex-direction: row; justify-content: space-around; padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); background: var(--panel); box-shadow: 0 -1px 0 var(--line); }
  body.product-mode .sidebar > .wordmark, body.product-mode .project-picker, body.product-mode .sidebar-bottom { display: none; }
  body.product-mode .sidebar nav { flex-direction: row; justify-content: space-around; width: 100%; overflow-x: auto; scrollbar-width: none; }
  body.product-mode .nav-item { width: 46px; height: 46px; min-height: 46px; flex: none; }
  body.product-mode .nav-item .nav-label { display: none; }
  body.product-mode main { padding: 10px 16px 210px; }
  body.product-mode h1 { font-size: 34px; }
  .askbar { left: 50%; width: calc(100% - 24px); bottom: 80px; padding-left: 4px; }
  .askbar .hint, .askbar .ask-open, .askkbd { display: none; }
  .ask-slot { display: block; width: 46px; height: 46px; flex: none; }
  body .toast { left: 50%; }
  .weeknav { width: 100%; display: grid; grid-template-columns: 28px minmax(0, 1fr) 28px; gap: 4px; }

  .weeknav > button { width: 28px; min-height: 40px; height: 40px; border-radius: 10px; }
  .week { min-width: 0; justify-content: space-between; } .week button { width: auto; flex: 1; min-width: 0; padding: 6px 0 7px; }
  .week button b { font-size: 17px; }
  .week button.today small { font-size: 0; } .week button.today small::after { content: attr(data-short); font-size: 11.5px; }
  body.product-mode .sidebar > .wordmark { display: none !important; }
  .chans { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; }
  .card-row { grid-template-columns: 48px 70px minmax(0, 1fr) 18px; gap: 10px; } .card-row .st { grid-column: 3; grid-row: 2; margin-top: -6px; } .th { width: 70px; height: 58px; } .card-row time { font-size: 16px; } .tt b { font-size: 15.5px; }
  .card-detail { padding: 0 12px 14px; } .facts dl { grid-template-columns: 1fr; }
  .pipe { padding: 12px; } .ps:not(.cur) b { display: none; } .ps small { display: none; } .pipe em { min-width: 8px; margin: 0 6px; }
  .dh-acts { width: 100%; gap: 6px; flex-wrap: nowrap; } .dh-acts .gbtn.ghosty { width: 42px; padding: 0; font-size: 0; gap: 0; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); } .dh-acts .gbtn:not(.ghosty) { flex: 1; min-width: 0; padding: 0 12px; font-size: 14px; }
  .nowline { grid-template-columns: 48px 14px auto 1fr; padding: 0 12px 0 0; }
  body.product-mode .chat-panel, body.product-mode #chat { width: 100%; }
  .login { display: block; } .login-copy { padding: 30px 24px; } .login-hero { padding-bottom: 20px; } .login-perch { display: none; } .login-form { margin: 0 auto 40px; }
  body.modal-open .stage { opacity: 0; pointer-events: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- port additions: calendar bits ---------- */
.gday { display: block; }
.gbtn .spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: g-spin .8s linear infinite; }
.gbtn.only { width: 36px; padding: 0; }
.gbtn.only .icon { width: 18px; height: 18px; }
a.gbtn { text-decoration: none !important; color: var(--ink); background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line); }
a.gbtn:hover { background: var(--glass-3); }
.wk-tools { display: inline-flex; align-items: center; gap: 2px; margin-left: 4px; position: relative; }
.wk-tools .date-control { position: relative; display: inline-flex; margin: 0; }
.wk-tools .date-control input { position: absolute; left: 0; bottom: 0; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; opacity: 0; pointer-events: none; }
.wk-tools .date-trigger { position: relative; width: 36px; height: 36px; min-height: 36px; padding: 0; border-radius: 12px; background: transparent; box-shadow: none; font-size: 0; color: var(--muted); }
.wk-tools .date-trigger::before { content: ''; position: absolute; inset: 8px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round'%3E%3Crect x='3.5' y='5' width='17' height='15.5' rx='3'/%3E%3Cpath d='M3.5 10h17M8 3v4M16 3v4M8 14h2M14 14h2M8 17h2'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round'%3E%3Crect x='3.5' y='5' width='17' height='15.5' rx='3'/%3E%3Cpath d='M3.5 10h17M8 3v4M16 3v4M8 14h2M14 14h2M8 17h2'/%3E%3C/svg%3E") center / contain no-repeat; }
.wk-tools .date-trigger:hover { background: var(--glass); color: var(--ink); }
body .calendar-popover { padding: 12px; border: 0; border-radius: 20px; background: var(--panel); color: var(--ink); box-shadow: var(--shadow-pop); }
body .calendar-popover button { min-height: 34px; border-radius: 10px; background: transparent; box-shadow: none; }
body .calendar-popover button:hover { background: var(--glass-2); }
body .calendar-popover [aria-pressed=true] { background: linear-gradient(160deg, var(--mint-2), var(--mint)); color: var(--on-mint); }
body .calendar-popover .calendar-grid span { color: var(--muted); font-size: 12px; }
.ed-acts { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.daynote { display: flex; gap: 10px; margin: -6px 0 18px; padding: 12px 16px; border-radius: 16px; background: var(--glass); color: var(--ink-2); font-size: 14.5px; line-height: 1.5; }
.daynote .gh, .why .gh { width: 20px; height: 22px; flex: none; margin-top: 1px; background: var(--mint); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 3.2c-6 0-10.2 4.4-10.2 10.3v14.1c0 .8.9 1.2 1.5.7l2.2-1.8 2.6 2.1c.4.3.9.3 1.3 0L16 26.5l2.6 2.1c.4.3.9.3 1.3 0l2.6-2.1 2.2 1.8c.6.5 1.5.1 1.5-.7V13.5C26.2 7.6 22 3.2 16 3.2zM12.4 11.8a1.7 2.2 0 1 0 0 4.4 1.7 2.2 0 1 0 0-4.4zm7.2 0a1.7 2.2 0 1 0 0 4.4 1.7 2.2 0 1 0 0-4.4z' fill-rule='evenodd'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 3.2c-6 0-10.2 4.4-10.2 10.3v14.1c0 .8.9 1.2 1.5.7l2.2-1.8 2.6 2.1c.4.3.9.3 1.3 0L16 26.5l2.6 2.1c.4.3.9.3 1.3 0l2.6-2.1 2.2 1.8c.6.5 1.5.1 1.5-.7V13.5C26.2 7.6 22 3.2 16 3.2zM12.4 11.8a1.7 2.2 0 1 0 0 4.4 1.7 2.2 0 1 0 0-4.4zm7.2 0a1.7 2.2 0 1 0 0 4.4 1.7 2.2 0 1 0 0-4.4z' fill-rule='evenodd'/%3E%3C/svg%3E") center / contain no-repeat; }
.okline { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--pub); font-size: 14px; font-weight: 500; }
.okline .icon { width: 17px; height: 17px; }
.gerr .icon, .err .icon { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.gerr span, .err span { white-space: pre-wrap; }
/* While a day is being prepared: previews, Фантом's question, a paused preparation and the week's progress. */
.bg-staged { background: var(--mint); } .s-staged { color: var(--mint); }
.tt small.rel { display: block; margin-top: 4px; font-size: 13px; color: var(--faint); }
.daynote.ask { margin-top: 0; background: var(--mint-soft); }
.daynote.ask b { display: block; margin-bottom: 2px; color: var(--ink); font-weight: 600; }
.pipe.stopped .ps.cur i, .pipe.question .ps.cur i { animation: none; }
.wk-tools .wk-prep { margin-right: 4px; color: var(--mint); background: var(--mint-soft); }
body.product-mode .gday .week-preparation { display: block; margin: 0 0 18px; padding: 12px 16px 14px; border: 0; border-radius: 16px; background: var(--glass); color: var(--ink-2); font-size: 14px; }
body.product-mode .gday .week-preparation header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; }
body.product-mode .gday .week-preparation strong { color: var(--ink); font-size: 15px; font-weight: 600; }
body.product-mode .gday .week-preparation ul { display: grid; gap: 4px; margin: 6px 0 0; padding: 0; list-style: none; }
body.product-mode .gday .week-preparation li button { min-height: 0; padding: 0; border: 0; background: none; box-shadow: none; color: var(--ink); font: inherit; font-weight: 500; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
body.product-mode .gday .week-preparation li button:hover { text-decoration-color: currentColor; }
body.product-mode .gday .week-preparation .notice-close { width: 32px; height: 32px; min-height: 32px; padding: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; }
body.product-mode .gday .week-preparation .notice-close:hover { background: var(--glass-2); color: var(--ink); }
body.product-mode .gday .week-preparation p { margin: 8px 0 0; }
.th.round { border-radius: 50%; width: 84px; justify-self: center; }
.th.plan.round { width: 84px; }
.cards > .slotrow { margin: 2px 0; }
.facts .notice.visual-request { display: grid; gap: 6px; justify-items: start; margin: 0; padding: 12px 14px; border-radius: 16px; background: var(--glass); color: var(--ink-2); }
.facts .notice.visual-request p { margin: 0; }
.facts .notice { white-space: pre-wrap; }
.facts > .small { margin: 0; }
.facts .job-status, .facts .error-box { margin: 0; }
/* Telegram bubble details */
.bub .rp { margin: 8px 10px 0; padding: 4px 9px; border-left: 3px solid #6ab3f3; border-radius: 4px; background: rgba(106, 179, 243, .1); font-size: 13px; line-height: 1.35; }
.bub .rp b { display: block; color: #6ab3f3; font-weight: 500; }
.bub .rp span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .85; }
.bub .bm.empty { width: 240px; height: 240px; border-radius: 50%; display: grid; place-items: center; align-content: center; gap: 8px; background: rgba(106, 179, 243, .14); color: #8fb7d9; font-size: 13px; }
.bub .bm.empty .icon { width: 34px; height: 34px; }
.bub .bm video[data-g=vplay] { cursor: pointer; }
.bub .tx .muted { color: #6d8193; }
.bub .tx p { margin: 0; }
.bub .bm audio, .bub .tx audio { width: 100%; }
.bub .document-file { color: #6ab3f3; }
.vo .pb { border: 0; padding: 0; min-height: 0; cursor: pointer; box-shadow: none; }
.vo .pb .icon { width: 18px; height: 18px; }
.vo svg.wave { width: 170px; height: 26px; }
.vo.playing svg.wave rect { animation: g-wave .9s ease-in-out infinite alternate; transform-origin: center; transform-box: fill-box; }
.vo.playing svg.wave rect:nth-child(3n) { animation-delay: -.3s; } .vo.playing svg.wave rect:nth-child(3n+1) { animation-delay: -.6s; }
@keyframes g-wave { from { transform: scaleY(.45); } to { transform: scaleY(1); } }
.vo.pending { color: #8fb7d9; font-size: 14px; }
.vo.pending .pb { background: rgba(106, 179, 243, .2); color: #6ab3f3; cursor: default; }
.vtx { max-width: 360px; margin-top: 8px; padding: 9px 12px; border-radius: 12px; background: rgba(0, 0, 0, .28); color: #dfe6f0; font: 14px/1.45 var(--tg); white-space: pre-wrap; }
:root[data-theme=light] .vtx { background: rgba(255, 255, 255, .8); color: #223; }
.vtx summary { cursor: pointer; color: #6ab3f3; font-weight: 500; list-style: none; }
.vtx summary::-webkit-details-marker { display: none; }
.vtx[open] summary { margin-bottom: 4px; }
.sv-batt { color: currentColor; }
.sv-list li time { font-variant-numeric: tabular-nums; }
/* chat bits */
body.product-mode .message-time { display: block; margin-top: 4px; font-size: 11px; opacity: .55; text-align: right; }
body.product-mode .message.user .message-time { color: var(--on-mint); }
body.product-mode[data-product-view=account] #chat { display: flex; }
body.product-mode .sidebar-tools [data-action=logout] { display: none; }
body.product-mode .link-receipt { margin-top: 8px; padding: 8px 10px; border-radius: 12px; background: var(--glass); font-size: 12.5px; }
body.product-mode .chat-empty { padding: 8px 4px; color: var(--muted); }
body.product-mode .chat-empty .prompt { min-height: 0; padding: 10px 12px; border-radius: 14px; text-align: left; }
.stage .mascot[hidden] { display: none !important; }
.aura[hidden] { display: none; }
@media (max-width: 900px) {
  body.product-mode .sidebar-bottom { display: flex; margin: 0; flex: none; }
  body.product-mode .sidebar-bottom .sidebar-tools { display: none; }
  body.product-mode .balance-compact { width: 40px; height: 40px; min-height: 40px; }
  .mascot { --say-bottom: 150px; }

  .range { display: none; }
  .gtop { position: relative; gap: 10px; }
  .gtop::before { display: none; }
  .th.round { width: 58px; }
  .ed-perch { display: none; }
  .emptyday { padding: 34px 20px; }
  .svwrap { grid-template-columns: 1fr; }
  .sv-phone { height: 520px; }
}
body .date-control { border: 0; border-radius: 13px; background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line); }
body .date-control:focus-within { box-shadow: inset 0 0 0 1.5px var(--mint), 0 0 0 4px var(--mint-soft); }
body .date-control input, body .date-control input:focus { background: transparent; box-shadow: none; }
body.product-mode .wk-tools .date-control { width: auto; height: auto; border: 0; background: transparent; box-shadow: none; }
body input[type=file] { padding: 7px; font-size: 13.5px; color: var(--muted); }
body input[type=file]::file-selector-button { margin-right: 12px; padding: 8px 14px; border: 0; border-radius: 10px; background: var(--glass-3); color: var(--ink); font: 600 13.5px var(--font); cursor: pointer; }
body.product-mode .wallpaper-mini { overflow: hidden; min-height: 0; border: 0; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line-2); }

/* ---------- drag to change time ---------- */
.gcard.saving { opacity: .78; }
.gcard[data-movable] .card-row time { position: relative; }
.gcard[data-movable] .card-row time::before { content: ''; position: absolute; left: -6px; top: 50%; width: 8px; height: 14px; transform: translateY(-50%); opacity: 0; transition: opacity .2s; background: radial-gradient(circle, var(--faint) 1.2px, transparent 1.6px) 0 0 / 4px 4.6px; }
.gcard[data-movable]:not([open]) .card-row:hover time::before { opacity: .9; }
body.dnd .gcard.dragging .card-row time::before { opacity: 0; }
/* ---------- «Отложенный пост» dialog ---------- */
body #modal-content .calendar-composer { gap: 16px; }
body #modal-content .composer-meta { margin: -10px 0 0; color: var(--muted); font-size: 14px; }
body #modal-content .composer-formats { gap: 8px; }
body #modal-content .composer-formats legend { margin-bottom: 8px; padding: 0; font-size: 13px; font-weight: 500; color: var(--muted); }
body #modal-content label.composer-format { position: relative; display: flex; flex-direction: row; align-items: center; gap: 12px; min-height: 0; padding: 12px 14px; border: 0; border-radius: 16px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); cursor: pointer; transition: background .2s, box-shadow .2s; }
body #modal-content label.composer-format:hover { background: var(--glass-2); }
body #modal-content label.composer-format:has(input:checked) { background: var(--mint-soft); box-shadow: inset 0 0 0 1.5px var(--mint); color: var(--ink); }
body #modal-content label.composer-format:has(input:focus-visible) { outline: 2px solid var(--mint); outline-offset: 2px; }
body #modal-content .composer-format input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
body #modal-content .composer-format::before { content: ''; flex: none; width: 40px; height: 40px; border-radius: 13px; background: var(--glass-2); transition: background .2s; }
body #modal-content .composer-format:has(input:checked)::before { background: var(--mint); }
body #modal-content .composer-format::after { content: ''; position: absolute; left: 23px; top: 50%; width: 22px; height: 22px; transform: translateY(-50%); background: var(--muted); -webkit-mask: var(--fmt) center / contain no-repeat; mask: var(--fmt) center / contain no-repeat; }
body #modal-content .composer-format:has(input:checked)::after { background: var(--on-mint); }
body #modal-content .composer-format span { display: grid; gap: 2px; }
body #modal-content .composer-format strong { font-weight: 600; font-size: 15px; }
body #modal-content .composer-format small { color: var(--muted); font-size: 12.5px; }
body #modal-content .composer-format:has(input[value=text]) { --fmt: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M5 6h14M5 11h14M5 16h9'/%3E%3C/svg%3E"); }
body #modal-content .composer-format:has(input[value=voice_script]) { --fmt: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M4 10v4M8 7v10M12 4v16M16 8v8M20 11v2'/%3E%3C/svg%3E"); }
body #modal-content .composer-format:has(input[value=plain_video_note]) { --fmt: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M10 9.2v5.6l4.6-2.8z' fill='%23000'/%3E%3C/svg%3E"); }
body #modal-content .composer-format:has(input[value=video_note]) { --fmt: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Crect x='10' y='7' width='4' height='7' rx='2'/%3E%3Cpath d='M8.5 12.5a3.5 3.5 0 0 0 7 0M12 16v1.5'/%3E%3C/svg%3E"); }
body #modal-content .composer-format:has(input[value=poll]) { --fmt: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M5 19V12M12 19V5M19 19v-9'/%3E%3C/svg%3E"); }
body #modal-content .calendar-composer details { padding: 0; border: 0; border-radius: 16px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); }
body #modal-content .calendar-composer details > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 13px 16px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
body #modal-content .calendar-composer details > summary::-webkit-details-marker { display: none; }
body #modal-content .calendar-composer details > summary::before { content: ''; width: 7px; height: 7px; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(-45deg); transition: transform .25s var(--ease); margin-right: 2px; }
body #modal-content .calendar-composer details[open] > summary::before { transform: rotate(45deg); }
body #modal-content .calendar-composer details[open] { display: grid; gap: 12px; padding: 0 16px 16px; }
body #modal-content .calendar-composer details[open] > summary { margin: 0 -16px; }
body #modal-content .calendar-composer > p.small:not(.composer-meta) { margin: 0; color: var(--faint); font-size: 12.5px; }
body #modal-content .calendar-composer > button[data-action=compose-draft] { align-self: flex-start; }
body #modal-content .calendar-composer p:empty { display: none; }

/* ---------- Личные сюжеты: list ---------- */
/* Project rules: each rule in plain words, the full text one click away, quiet actions on the right. */
body.product-mode .rules-panel .rules-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
body.product-mode .rules-panel .rules-toolbar label { width: min(320px, 100%); }
body.product-mode .rules-panel .rules-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
body.product-mode .rules-panel .rule-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 16px; padding: 14px 16px; border: 0; border-radius: 16px; background: var(--glass); transition: background .2s; }
body.product-mode .rules-panel .rule-card:hover { background: var(--glass-2); }
body.product-mode .rules-panel .rule-card details { min-width: 0; }
body.product-mode .panel.rules-panel .rule-card details > summary { display: block; padding: 0; list-style: none; cursor: pointer; }
body.product-mode .panel.rules-panel .rule-card details > summary::-webkit-details-marker { display: none; }
body.product-mode .panel.rules-panel .rule-card details > summary::before, body.product-mode .rules-panel .rule-title::after { content: none; display: none; }
body.product-mode .rules-panel .rule-title { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
body.product-mode .rules-panel .rule-preview, body.product-mode .rules-panel .rule-full { color: var(--ink); font-size: 15px; font-weight: 400; line-height: 1.5; }
body.product-mode .rules-panel .rule-full { margin: 0; }
body.product-mode .rules-panel .rule-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 2px; }
body.product-mode .rules-panel .rule-actions button { min-height: 34px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; box-shadow: none; color: var(--ink-2); font-size: 13.5px; font-weight: 500; }
body.product-mode .rules-panel .rule-actions button:hover { background: var(--glass-2); color: var(--ink); }
body.product-mode .rules-panel .rule-actions button.danger { color: var(--fail); }
body.product-mode .rules-panel .rules-empty { margin: 8px 0 0; }
@media (max-width: 700px) {
  body.product-mode .rules-panel .rules-toolbar { flex-direction: column; align-items: stretch; }
  body.product-mode .rules-panel .rules-toolbar label { width: 100%; }
  body.product-mode .rules-panel .rule-card { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  body.product-mode .rules-panel .rule-actions { justify-content: start; margin-left: -12px; }
}
.rb-card { display: grid; grid-template-columns: 116px minmax(0, 1fr) auto; gap: 22px; align-items: center; margin-bottom: 14px; }
body.product-mode .rb-card { padding: 20px 22px; }
.rb-stack { position: relative; width: 116px; height: 100px; }
.rb-stack img { position: absolute; top: 6px; width: 70px; height: 88px; object-fit: cover; border-radius: 14px; box-shadow: 0 12px 26px -12px rgba(0, 0, 0, .7), 0 0 0 2px var(--card-2); transition: transform .45s var(--spring); }
.rb-stack img:nth-child(1) { left: 0; transform: rotate(-8deg); z-index: 3; }
.rb-stack img:nth-child(2) { left: 22px; transform: rotate(1deg); z-index: 2; }
.rb-stack img:nth-child(3) { left: 44px; transform: rotate(9deg); z-index: 1; }
.rb-card:hover .rb-stack img:nth-child(1) { transform: rotate(-14deg) translate(-6px, -2px); }
.rb-card:hover .rb-stack img:nth-child(3) { transform: rotate(15deg) translate(8px, -2px); }
.rb-stack-empty { position: absolute; inset: 6px 20px; border-radius: 16px; border: 1.5px dashed var(--line-2); }
.rb-card.off .rb-stack { filter: saturate(.35); opacity: .8; }
.rb-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rb-head h2 { margin: 0; font-size: 21px; }
.rb-state { padding: 3px 10px; border-radius: 99px; background: var(--mint-soft); color: var(--pub); font-size: 12.5px; font-weight: 600; }
.rb-card.off .rb-state { background: var(--glass-2); color: var(--muted); }
.rb-rhythm { margin: 6px 0 0; color: var(--ink-2) !important; font-weight: 500; }
.rb-progress { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.rb-progress progress { -webkit-appearance: none; appearance: none; width: 180px; height: 6px; border: 0; border-radius: 6px; background: var(--line-2); overflow: hidden; }
.rb-progress progress::-webkit-progress-bar { background: var(--line-2); border-radius: 6px; }
.rb-progress progress::-webkit-progress-value { background: linear-gradient(90deg, var(--mint-2), var(--mint)); border-radius: 6px; }
.rb-progress progress::-moz-progress-bar { background: var(--mint); border-radius: 6px; }
.rb-progress small { color: var(--muted); font-size: 13px; }
.rb-next { margin: 8px 0 0; font-size: 14px; }
.rb-acts { display: flex; flex-direction: column; gap: 6px; }
.rb-empty { margin-top: 4px; }
body.product-mode .story-list-top p { max-width: 640px; }
/* ---------- Личные сюжеты: editor ---------- */
.rb-form { gap: 18px; }
.rb-toggle { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 14px 16px; border-radius: 18px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); }
.rb-toggle > small { margin: -2px 0 0 56px; }
:is(#modal-content, #main) label.rb-switch { display: flex; flex-direction: row; align-items: center; gap: 12px; color: var(--ink); font-size: 15px; cursor: pointer; }
.rb-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.rb-switch span { position: relative; flex: none; width: 44px; height: 26px; border-radius: 13px; background: var(--line-2); transition: background .25s; }
.rb-switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); transition: transform .3s var(--spring); }
.rb-switch input:checked + span { background: var(--mint); }
.rb-switch input:checked + span::after { transform: translateX(18px); }
.rb-switch input:focus-visible + span { outline: 2px solid var(--mint); outline-offset: 2px; }
.rb-switch b { font-weight: 600; }
.rb-ready { display: flex; flex-wrap: wrap; gap: 6px; margin-left: 56px; }
.rb-req { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 6px; border-radius: 99px; background: rgba(255, 122, 138, .1); color: var(--fail); font-size: 12.5px; font-weight: 500; }
.rb-req i { width: 16px; height: 16px; border-radius: 50%; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0zm2.6 4.2L8 6.8 5.4 4.2 4.2 5.4 6.8 8l-2.6 2.6 1.2 1.2L8 9.2l2.6 2.6 1.2-1.2L9.2 8l2.6-2.6z'/%3E%3C/svg%3E") center / contain; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0zm2.6 4.2L8 6.8 5.4 4.2 4.2 5.4 6.8 8l-2.6 2.6 1.2 1.2L8 9.2l2.6 2.6 1.2-1.2L9.2 8l2.6-2.6z'/%3E%3C/svg%3E") center / contain; }
.rb-req.ok { background: var(--mint-soft); color: var(--pub); }
.rb-req.ok i { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0zm3.4 4.6L7 9 4.6 6.6 3.4 7.8 7 11.4l5.6-5.6z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0zm3.4 4.6L7 9 4.6 6.6 3.4 7.8 7 11.4l5.6-5.6z'/%3E%3C/svg%3E"); }
.rb-form .story-cadence { display: grid; gap: 12px; min-width: 0; margin: 0; padding: 0; border: 0; }
.rb-form .story-cadence legend, .rb-label { margin-bottom: 8px; padding: 0; font-size: 13px; font-weight: 500; color: var(--muted); }
.rb-chips, .rb-days { display: flex; flex-wrap: wrap; gap: 6px; }
:is(#modal-content, #main) label.rb-chip, :is(#modal-content, #main) label.rb-day { position: relative; display: inline-flex; flex-direction: row; gap: 0; cursor: pointer; }
.rb-chip input, .rb-day input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.rb-chip span { padding: 8px 14px; border-radius: 12px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); font-size: 14px; font-weight: 500; transition: background .2s, box-shadow .2s, color .2s; }
.rb-chip:hover span { background: var(--glass-2); }
.rb-chip input:checked + span { background: var(--mint-soft); box-shadow: inset 0 0 0 1.5px var(--mint); color: var(--ink); }
.rb-day span { display: grid; place-items: center; width: 46px; height: 40px; border-radius: 12px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); font-size: 14px; font-weight: 600; transition: background .2s, color .2s; }
.rb-day input:checked + span { background: linear-gradient(160deg, var(--mint-2), var(--mint)); box-shadow: none; color: var(--on-mint); }
.rb-chip input:focus-visible + span, .rb-day input:focus-visible + span { outline: 2px solid var(--mint); outline-offset: 2px; }
body.product-mode .story-cadence:has(input[name=cadence][value=custom]:checked) .cadence-days { display: flex; }
body.product-mode .story-cadence:has(input[name=cadence][value=monthly]:checked) .cadence-month { display: grid; }
body.product-mode .story-cadence:has(input[name=cadence][value=interval]:checked) .cadence-interval { display: grid; }
.rb-form .cadence-month { max-width: 200px; }
.rb-times { display: grid; gap: 8px; }
.rb-time-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rb-time { display: inline-flex; align-items: center; gap: 2px; height: 38px; padding: 0 4px 0 14px; border-radius: 12px; background: var(--mint-soft); color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.rb-time button { width: 28px; height: 28px; min-height: 28px; padding: 0; border-radius: 9px; background: transparent; box-shadow: none; color: var(--muted); font-size: 17px; }
.rb-time button:hover { background: var(--glass-2); color: var(--ink); }
.rb-time-new { display: inline-flex; align-items: center; gap: 6px; }
:is(#modal-content, #main) .rb-time-new input { width: 118px; min-height: 38px; height: 38px; padding: 0 10px; }
.rb-summary { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--mint-soft); color: var(--ink); font-weight: 500; line-height: 1.45; }
.rb-summary::before { content: ''; width: 20px; height: 22px; flex: none; background: var(--mint); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 3.2c-6 0-10.2 4.4-10.2 10.3v14.1c0 .8.9 1.2 1.5.7l2.2-1.8 2.6 2.1c.4.3.9.3 1.3 0L16 26.5l2.6 2.1c.4.3.9.3 1.3 0l2.6-2.1 2.2 1.8c.6.5 1.5.1 1.5-.7V13.5C26.2 7.6 22 3.2 16 3.2zM12.4 11.8a1.7 2.2 0 1 0 0 4.4 1.7 2.2 0 1 0 0-4.4zm7.2 0a1.7 2.2 0 1 0 0 4.4 1.7 2.2 0 1 0 0-4.4z' fill-rule='evenodd'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 3.2c-6 0-10.2 4.4-10.2 10.3v14.1c0 .8.9 1.2 1.5.7l2.2-1.8 2.6 2.1c.4.3.9.3 1.3 0L16 26.5l2.6 2.1c.4.3.9.3 1.3 0l2.6-2.1 2.2 1.8c.6.5 1.5.1 1.5-.7V13.5C26.2 7.6 22 3.2 16 3.2zM12.4 11.8a1.7 2.2 0 1 0 0 4.4 1.7 2.2 0 1 0 0-4.4zm7.2 0a1.7 2.2 0 1 0 0 4.4 1.7 2.2 0 1 0 0-4.4z' fill-rule='evenodd'/%3E%3C/svg%3E") center / contain no-repeat; }
.rb-chapters { display: grid; gap: 4px; }
.rb-ch-head { display: flex; align-items: center; gap: 8px; }
.rb-ch-head .spacer { flex: 1; }
.rb-ch-list { list-style: none; display: grid; gap: 10px; margin: 8px 0 0; padding: 0; counter-reset: none; }
.rb-ch { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; padding: 12px; border-radius: 16px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); animation: g-rise .3s var(--spring); }
.rb-ch-n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--mint-soft); color: var(--mint); font-weight: 700; font-size: 14px; }
.rb-ch-body { display: grid; gap: 8px; min-width: 0; }
:is(#modal-content, #main) .rb-ch-body input, :is(#modal-content, #main) .rb-ch-body textarea { min-height: 40px; padding: 9px 12px; font-size: 14px; }
.rb-ch-title { font-weight: 600; }
:is(#modal-content, #main) .rb-ch-facts { min-height: 72px; resize: vertical; }
.rb-ch-tools { display: flex; flex-direction: column; gap: 4px; }
.rb-ch-tools button { width: 30px; height: 30px; min-height: 30px; padding: 0; border-radius: 9px; background: transparent; box-shadow: none; color: var(--muted); font-size: 15px; }
.rb-ch-tools button:hover { background: var(--glass-2); color: var(--ink); }
.rb-ch:first-child [data-rb=up], .rb-ch:last-child [data-rb=down] { visibility: hidden; }
.rb-ch-empty { display: none; margin: 4px 0 0; }
.rb-no-chapters .rb-ch-empty { display: block; }
.rb-photo-acts { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin-top: 10px; }
.rb-photo-acts .dropzone { flex: 1; min-width: 220px; margin: 0; padding: 14px; }
.rb-photo-acts .gbtn { height: auto; min-height: 48px; }
body .story-photo-grid { gap: 10px; }
body .story-photo { border: 0; border-radius: 14px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); }
body .story-photo span { color: var(--muted); font-size: 11.5px; }
body .story-photo:has(input:not(:checked)) img { opacity: .4; filter: grayscale(1); }
/* other app dialogs in the night/day look */
body dialog.asset-picker, body dialog.cost-confirmation { border: 0; border-radius: 24px; background: var(--panel); color: var(--ink); box-shadow: var(--shadow-pop); padding: 22px; }
body dialog.asset-picker[open], body dialog.cost-confirmation[open] { animation: g-pop .35s var(--spring); }
@media (max-width: 900px) {
  .rb-card { grid-template-columns: 84px minmax(0, 1fr); gap: 14px; }
  .rb-stack { width: 84px; height: 84px; } .rb-stack img { width: 54px; height: 70px; } .rb-stack img:nth-child(2) { left: 14px; } .rb-stack img:nth-child(3) { left: 28px; }
  .rb-acts { grid-column: 1 / -1; flex-direction: row; }
  .rb-progress progress { width: 120px; }
  .rb-ready, .rb-toggle > small { margin-left: 0; }
}
/* The generic #modal-content label rule outranks the old mode/cadence rules, so they are restated at id level. */
#modal-content .story-editor[data-editor-mode=settings] .story-content-field { display: none; }
#modal-content .story-editor[data-editor-mode=content] form > :not(.story-content-field):not(.actions) { display: none; }
:is(#modal-content, #main) .story-cadence .cadence-month { display: none; }
:is(#modal-content, #main) .story-cadence:has(input[name=cadence][value=monthly]:checked) .cadence-month { display: grid; }
:is(#modal-content, #main) label.check { display: flex; flex-direction: row; align-items: center; gap: 10px; color: var(--ink-2); font-size: 14px; }
:is(#modal-content, #main) label.check input { flex: none; width: 18px; height: 18px; min-height: 0; padding: 0; }

/* ---------- new channel wizard ---------- */
.wz-steps { list-style: none; display: flex; align-items: center; gap: 0; margin: 0 0 18px; padding: 14px 18px; border-radius: 20px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); overflow-x: auto; }
.wz-steps li { display: flex; align-items: center; gap: 10px; color: var(--faint); white-space: nowrap; font-weight: 500; }
.wz-steps li + li::before { content: ''; width: 46px; height: 2px; margin: 0 14px; border-radius: 2px; background: var(--line-2); }
.wz-steps li.done + li::before, .wz-steps li.done + li.cur::before { background: var(--mint); }
.wz-steps i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--line-2); font-style: normal; font-size: 13px; font-weight: 700; flex: none; }
.wz-steps i .icon { width: 15px; height: 15px; }
.wz-steps li.done { color: var(--ink-2); } .wz-steps li.done i { background: var(--mint-soft); box-shadow: inset 0 0 0 2px var(--mint); color: var(--mint); }
.wz-steps li.cur { color: var(--ink); font-weight: 600; } .wz-steps li.cur i { background: var(--mint); box-shadow: 0 0 0 5px var(--mint-soft); color: var(--on-mint); }
body.product-mode .wz-card { display: grid; gap: 16px; padding: 24px 26px; animation: g-rise .4s var(--spring); }
.wz-card h2 { margin: 0; font-size: 22px; }
.wz-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--line); }
.wz-ok { display: flex; align-items: center; gap: 10px; margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--mint-soft); color: var(--ink) !important; font-weight: 500; }
.wz-ok .icon { color: var(--pub); }
.wz-howto { list-style: none; counter-reset: wz; display: grid; gap: 10px; margin: 0; padding: 0; }
.wz-howto li { counter-increment: wz; position: relative; display: grid; gap: 2px; padding: 12px 14px 12px 52px; border-radius: 16px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); }
.wz-howto li::before { content: counter(wz); position: absolute; left: 14px; top: 12px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--mint-soft); color: var(--mint); font-weight: 700; font-size: 13px; }
.wz-howto b { font-weight: 600; } .wz-howto span { color: var(--muted); font-size: 14px; }
.wz-card .channel-connection { display: grid; gap: 10px; }
.wz-card .channel-connection h3 { display: none; }
.wz-done { justify-items: center; text-align: center; padding-top: 18px; }
.wz-done .ed-perch { height: 110px; }
.wz-summary { list-style: none; display: grid; gap: 8px; margin: 0; padding: 0; text-align: left; }
.wz-summary li { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.wz-summary li i { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--line-2); }
.wz-summary li.ok { color: var(--ink-2); } .wz-summary li.ok i { background: var(--mint); box-shadow: none; color: var(--on-mint); }
.wz-summary li i .icon { width: 13px; height: 13px; }
@media (max-width: 900px) { .wz-steps li span { display: none; } .wz-steps li.cur span { display: inline; } .wz-steps li + li::before { width: 18px; margin: 0 8px; } .wz-done .ed-perch { display: none; } }
.wz-card .channel-connection > p { display: none; }
/* The rubric editor inside a dialog is not a card in a card. */
body.product-mode .panel.story-editor { padding: 0; background: transparent; box-shadow: none; }
@media (max-width: 900px) {
  body dialog#modal { padding: 18px; }
  .rb-card { align-items: start; }
  body.product-mode .story-cadence:has(input[name=cadence][value=custom]:checked) .rb-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  :is(#modal-content, #main) label.rb-day { display: block; }
  .rb-day span { width: 100%; min-width: 0; padding: 0; }
}

/* ---------- Материалы ---------- */
.mt-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.mt-tags { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.mt-tags .chip, .mt-tags .chip.on { padding: 0 14px; gap: 6px; }
.mt-tags .chip .muted { font-weight: 500; }
.chip.ghost { background: transparent; box-shadow: none; color: var(--muted); }
.chip.ghost .icon { width: 17px; height: 17px; }
.mt-search input { width: 270px; max-width: 100%; height: 38px; min-height: 38px; padding: 0 14px 0 40px; border-radius: 19px; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8fb3' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='m20 20-4.2-4.2'/%3E%3C/svg%3E") 14px center / 18px no-repeat; }
.mt-search.wide { margin-bottom: 14px; }
.mt-note { margin: -4px 0 12px; }
.linkish { min-height: 0 !important; height: auto; padding: 0 !important; border-radius: 0; background: none !important; box-shadow: none !important; color: var(--mint); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; align-items: start; }
.mt { position: relative; margin: 0; border-radius: 20px; overflow: hidden; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); transition: transform .3s var(--spring), box-shadow .2s; }
.mt:hover { transform: translateY(-3px); box-shadow: var(--shadow), inset 0 0 0 1px var(--line-2); }
.mt.sel { box-shadow: 0 0 0 3px var(--mint), var(--shadow); }
.mt-open { position: relative; display: block; width: 100%; min-height: 0; height: auto; padding: 0; border-radius: 0; background: var(--glass-2); box-shadow: none; cursor: zoom-in; }
.mt-open:hover { background: var(--glass-2); }
.mt-open img, .mt-open video { display: block; width: 100%; object-fit: cover; }
.mt-open :is(img, video) { aspect-ratio: 4 / 3; }
.mt-file { display: grid; place-items: center; align-content: center; gap: 6px; aspect-ratio: 4 / 3; color: var(--muted); }
.mt-file .icon { width: 34px; height: 34px; }
.mt-file small { font-weight: 700; letter-spacing: .04em; }
.vbadge { position: absolute; left: 10px; top: 10px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 6px; border-radius: 10px; background: rgba(0, 0, 0, .62); color: #fff; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.vbadge .icon { width: 13px; height: 13px; }
:is(#main, #modal-content) label.mcheck { position: absolute; right: 10px; top: 10px; display: block; width: 30px; height: 30px; cursor: pointer; opacity: 0; transition: opacity .2s; }
.mcheck input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.mcheck span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(0, 0, 0, .35); color: transparent; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .85); transition: background .2s, color .2s; }
.mcheck span .icon { width: 16px; height: 16px; stroke-width: 2.6; }
.mt:hover .mcheck, .mt.sel .mcheck, .mcheck:has(input:focus-visible) { opacity: 1; }
.mcheck input:checked + span { background: var(--mint); color: var(--on-mint); box-shadow: none; }
.mcheck input:focus-visible + span { outline: 2px solid var(--mint); outline-offset: 2px; }
.mt figcaption { display: grid; gap: 2px; padding: 10px 12px 12px; }
.mt figcaption b { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt figcaption > span { color: var(--muted); font-size: 12.5px; }
.mt-acts { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.mt-pages { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 6px 0 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.mt-pages .gbtn { width: 36px; padding: 0; }
.mt-empty { margin-top: 6px; }
body.product-mode .mt-circles { padding: 0; margin-bottom: 18px; overflow: hidden; }
body.product-mode .mt-circles > summary { padding: 14px 18px; gap: 12px; }
body.product-mode .mt-circles > summary::before { order: 3; margin-left: auto; }
.mt-circles-ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--mint-soft); color: var(--mint); flex: none; }
.mt-circles summary > span:not(.mt-circles-ic) { display: grid; gap: 1px; }
.mt-circles summary small { color: var(--muted); font-weight: 400; font-size: 13px; }
body.product-mode .mt-circles[open] { padding-bottom: 16px; }
.mt-circles .dropzone, .mt-circles .mgrid { margin: 0 18px 14px; }
.mt-circles .mgrid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.selbar { position: fixed; left: calc(50% + 39px); bottom: 96px; z-index: 21; display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 18px; border-radius: 18px; background: var(--panel); box-shadow: var(--shadow), inset 0 0 0 1px var(--line-2); transform: translate(-50%, 30px); opacity: 0; pointer-events: none; transition: transform .35s var(--spring), opacity .25s; white-space: nowrap; }
.selbar.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.selbar b { margin-right: 6px; font-variant-numeric: tabular-nums; }
@media (min-width: 901px) and (max-width: 1500px) { .selbar { left: calc(50% - 19px); } }
.mt-drop { position: fixed; inset: 14px 14px 14px 92px; z-index: 30; display: grid; place-items: center; border-radius: 28px; border: 2px dashed var(--mint); background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(6px); color: var(--ink); font-size: 22px; font-weight: 600; pointer-events: none; opacity: 0; transition: opacity .2s; }
.mt-drop.show { opacity: 1; }
body.product-mode .tag-settings-list .tag-choice { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
body.product-mode .tag-settings-list .tag-choice:last-child { border-bottom: 0; }
@media (max-width: 900px) {
  .mgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .mt { border-radius: 16px; }
  .mt-search, .mt-search input { width: 100%; }
  .mcheck, :is(#main, #modal-content) label.mcheck { opacity: 1; }
  .selbar { left: 50%; bottom: 150px; padding-left: 14px; max-width: calc(100% - 20px); overflow-x: auto; }
  .mt-drop { inset: 10px; }
  .mt-circles .mgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
body dialog.asset-picker header.actions { justify-content: space-between; margin-bottom: 14px; }
body dialog.asset-picker header.actions h2 { margin: 0; font-size: 22px; }
body dialog.asset-picker header.actions button { width: 38px; height: 38px; min-height: 38px; padding: 0; border-radius: 12px; background: transparent; box-shadow: none; color: var(--muted); font-size: 22px; }
body dialog.asset-picker .upload-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
body dialog.asset-picker .upload-previews article { display: grid; gap: 4px; }
body dialog.asset-picker .upload-previews :is(img, video) { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; }
body dialog.asset-picker form { display: grid; gap: 12px; }

/* ---------- Репосты ---------- */
body.product-mode .rp-board { padding: 18px 20px 14px; }
.rp-scheme { display: block; width: 100%; height: auto; font-family: var(--font); overflow: visible; }
.rp-scheme.v { display: none; }
.nd rect { fill: var(--card-2); stroke: var(--line-2); stroke-width: 1.2; }
.nd-ava { fill: #ff8f8a; } .nd-ava.c1 { fill: #6a9dff; } .nd-ava.c2 { fill: #9b7cff; } .nd-ava.c3 { fill: #3fc48f; }
.nd-ini { fill: #fff; font-size: 16px; font-weight: 700; }
.nd-name { fill: var(--ink); font-size: 15px; font-weight: 600; }
.nd-meta { fill: var(--muted); font-size: 12.5px; }
.lk { cursor: pointer; }
.lk-hit { fill: none; stroke: transparent; stroke-width: 22; }
.lk-line { fill: none; stroke-width: 2.4; stroke-linecap: round; transition: stroke-width .2s; }
.lk.on .lk-line { stroke: var(--mint); stroke-dasharray: 10 8; animation: rp-flow 1.1s linear infinite; }
.lk.off .lk-line { stroke: var(--faint); stroke-dasharray: 3 7; }
@keyframes rp-flow { to { stroke-dashoffset: -18; } }
.lk-dot { fill: var(--mint-2); }
:root[data-theme=dark] .lk-dot { filter: drop-shadow(0 0 6px rgba(124, 240, 196, .9)); }
.arrow-on { fill: var(--mint); } .arrow-off { fill: var(--faint); }
.lk-label { fill: var(--ink-2); font-size: 13.5px; font-weight: 600; paint-order: stroke; stroke: var(--card-2); stroke-width: 7px; stroke-linejoin: round; }
.lk:hover .lk-line, .lk:focus .lk-line { stroke-width: 3.6; }
.lk:hover .lk-label { fill: var(--ink); }
.rp-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.rp-legend i { display: inline-block; width: 24px; margin-right: 6px; vertical-align: middle; border-top: 2.4px dashed var(--mint); }
.rp-legend .off i { border-top: 2.4px dotted var(--faint); }
.rp-list { display: grid; gap: 12px; margin-top: 14px; }
body.product-mode .rp-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 20px; align-items: start; }
body.product-mode .rp-card.cur { box-shadow: inset 0 0 0 1.5px var(--mint), var(--shadow); }
.rp-route { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; }
.rp-route .cav { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(150deg, #ffb37a, #ff7f9e); color: #fff; font-size: 12px; font-weight: 700; }
.rp-route .cav.c1 { background: linear-gradient(150deg, #7fd3ff, #4f7dff); } .rp-route .cav.c2 { background: linear-gradient(150deg, #c39bff, #7b5cff); } .rp-route .cav.c3 { background: linear-gradient(150deg, #8ff0c4, #2fb37f); }
.rp-route b { font-weight: 600; }
.rp-arrow { color: var(--mint); } .rp-arrow .icon { width: 18px; height: 18px; }
.rp-card.off .rp-arrow { color: var(--faint); }
.rp-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.rp-head h3 { margin: 0; font-size: 18px; }
.rp-state { padding: 3px 10px; border-radius: 99px; background: var(--mint-soft); color: var(--pub); font-size: 12.5px; font-weight: 600; }
.rp-card.off .rp-state { background: var(--glass-2); color: var(--muted); }
.rp-what { margin: 6px 0 0; color: var(--muted) !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; font-size: 13px; }
.rp-time { padding: 3px 9px; border-radius: 8px; background: var(--glass-2); color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.rp-acts { display: flex; flex-direction: column; gap: 6px; }
.rp-card .err { margin: 10px 0 0; }
body.product-mode .rp-editor { margin-top: 16px; }
body.product-mode .rp-editor > form.panel { padding: 0; background: transparent; box-shadow: none; }
body.product-mode .source-card .actions { gap: 6px; flex-wrap: wrap; }
@media (max-width: 900px) {
  .rp-scheme.h { display: none; } .rp-scheme.v { display: block; max-width: 420px; margin: 0 auto; }
  body.product-mode .rp-card { grid-template-columns: 1fr; } .rp-acts { flex-direction: row; flex-wrap: wrap; }
}
body.product-mode .rp-editor form > .actions:first-of-type { justify-content: flex-end; }
body.product-mode .rp-editor form > .actions:first-of-type h3 { display: none; }

/* ---------- Переписки ---------- */
.cs-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 18px; align-items: start; }
.cs-layout:not(:has(.cs-list)) { grid-template-columns: minmax(0, 1fr); }
.cs-list { position: sticky; top: 16px; display: grid; gap: 8px; }
body.product-mode button.cs-card { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 0; height: auto; padding: 11px 12px; border: 0; border-radius: 18px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); text-align: left; }
body.product-mode button.cs-card:hover { background: var(--card-2); }
body.product-mode button.cs-card.on { background: var(--card-2); box-shadow: inset 0 0 0 1.5px var(--mint); }
.cs-ava { display: grid; place-items: center; flex: none; width: 42px; height: 42px; overflow: hidden; border-radius: 50%; background: linear-gradient(150deg, #ffb37a, #ff7f9e); color: #fff; font-weight: 700; font-size: 16px; }
.cs-ava img, img.cs-ava { width: 100%; height: 100%; object-fit: cover; }
.cs-card-text { display: grid; gap: 2px; min-width: 0; }
.cs-card-text b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-card-text small { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.cs-empty { margin: 0; }
.cs-stage { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 26px; align-items: start; margin-bottom: 18px; }
.cs-phone { height: 560px; padding: 10px; border-radius: 42px; background: linear-gradient(160deg, #2a2d3c, #12131c 40%, #232634); box-shadow: 0 40px 90px -36px rgba(0, 0, 0, .8), inset 0 0 0 1px rgba(255, 255, 255, .08); }
.cs-screen { position: relative; display: flex; flex-direction: column; height: 100%; overflow: hidden; border-radius: 33px; background: #0e1621 url('/telegram-wallpaper-dark.svg') center / cover; font-family: var(--tg); }
:root[data-theme=light] .cs-screen { background: #d9e7cb url('/telegram-wallpaper.svg') center / cover; }
.cs-wall { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cs-head { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; padding: 16px 14px 10px; background: #17212b; color: #fff; }
:root[data-theme=light] .cs-head { background: #fff; color: #000; }
.cs-head .cs-ava { width: 38px; height: 38px; font-size: 15px; }
.cs-head b { display: block; font-weight: 500; font-size: 15px; }
.cs-head small { display: block; color: #6d8193; font-size: 12.5px; }
.cs-chat { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 6px; flex: 1; overflow-y: auto; padding: 10px 10px 16px; scrollbar-width: none; }
.cs-chat > * { flex-shrink: 0; }
.cs-date { align-self: center; margin: 4px 0; padding: 3px 10px; border-radius: 12px; background: rgba(10, 18, 28, .45); color: #fff; font-size: 12.5px; }
.cs-b { position: relative; max-width: 82%; padding: 7px 11px 19px; border-radius: 16px; font-size: 14.5px; line-height: 1.35; overflow-wrap: anywhere; box-shadow: 0 1px 1px rgba(0, 0, 0, .2); }
.cs-b.in { align-self: flex-start; border-bottom-left-radius: 5px; background: #182533; color: #f3f6fa; }
.cs-b.out { align-self: flex-end; border-bottom-right-radius: 5px; background: #2b5278; color: #fff; }
:root[data-theme=light] .cs-b.in { background: #fff; color: #000; }
:root[data-theme=light] .cs-b.out { background: #effdde; color: #000; }
.cs-b i { position: absolute; right: 9px; bottom: 4px; font-style: normal; font-size: 11px; opacity: .6; }
.cs-b img, .cs-b video { display: block; width: 100%; margin-bottom: 4px; border-radius: 12px; }
.cs-hide { display: none !important; }
.cs-pop { animation: g-svin .5s cubic-bezier(.3, 1.4, .5, 1) both; transform-origin: left bottom; }
.cs-b.out.cs-pop { transform-origin: right bottom; }
.cs-typing { display: flex; gap: 4px; padding: 11px 13px; }
.cs-typing span { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .5; animation: cs-dot 1s infinite; }
.cs-typing span:nth-child(2) { animation-delay: .15s; } .cs-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes cs-dot { 0%, 100% { transform: translateY(0); opacity: .35; } 50% { transform: translateY(-4px); opacity: .9; } }
.cs-about { display: grid; gap: 10px; align-content: start; }
.cs-about h2 { margin: 0; font-size: 26px; }
.cs-about p { margin: 0; }
.cs-about .gbtn { justify-self: start; }
body.product-mode .cs .chat-story-workspace { padding: 20px 22px; }
body.product-mode .cs .chat-story-workspace > .page-top h2 { font-size: 18px; }
body.product-mode .cs .chat-story-episode { margin-top: 12px; padding: 0; border-radius: 18px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); }
body.product-mode .cs .chat-story-episode > summary { list-style: none; display: grid; gap: 2px; padding: 14px 16px; cursor: pointer; }
body.product-mode .cs .chat-story-episode > summary::-webkit-details-marker { display: none; }
body.product-mode .cs .chat-story-episode > summary small { color: var(--muted); font-weight: 400; }
body.product-mode .cs .chat-story-episode[open] { padding-bottom: 14px; }
body.product-mode .cs .chat-story-episode > :not(summary) { margin-left: 16px; margin-right: 16px; }
body.product-mode .cs .chat-workshop-part h3 { margin: 10px 0 4px; font-size: 13px; font-weight: 500; color: var(--muted); }
body.product-mode .cs .chat-story-footer { margin-top: 14px; }
body.product-mode .cs details[data-chat-details] > summary { cursor: pointer; }
@media (max-width: 900px) {
  .cs-layout { grid-template-columns: minmax(0, 1fr); }
  .cs-list { position: static; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  body.product-mode button.cs-card { width: auto; flex: none; max-width: 240px; }
  .cs-stage { grid-template-columns: minmax(0, 1fr); }
  .cs-phone { height: 480px; max-width: 340px; width: 100%; justify-self: center; }
}
body.product-mode .cs .chat-story-workspace details:not(.chat-story-episode) > summary { list-style: none; display: flex; align-items: center; gap: 10px; font-weight: 600; }
body.product-mode .cs .chat-story-workspace details:not(.chat-story-episode) > summary::-webkit-details-marker { display: none; }
body.product-mode .cs .chat-story-workspace details:not(.chat-story-episode) > summary::before { content: ''; width: 7px; height: 7px; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(-45deg); transition: transform .25s var(--ease); }
body.product-mode .cs .chat-story-workspace details[open]:not(.chat-story-episode) > summary::before { transform: rotate(45deg); }

/* ---------- Видео ---------- */
.vd-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
body.product-mode .vd-form { display: grid; gap: 4px; padding: 10px 22px 20px; }
.vd-step { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.vd-n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--mint-soft); color: var(--mint); font-weight: 700; font-size: 14px; }
.vd-body { display: grid; gap: 10px; min-width: 0; }
.vd-body > b { font-weight: 600; font-size: 15.5px; }
.vd-src { display: grid; grid-template-columns: 120px minmax(0, 1fr); align-items: center; gap: 14px; }
.vd-src video { width: 120px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; background: var(--glass-2); }
.vd-src-name { font-weight: 500; }
.vd-src-empty { grid-column: 1 / -1; display: grid; gap: 2px; padding: 16px; border-radius: 16px; border: 1.5px dashed var(--line-2); color: var(--ink-2); font-weight: 500; }
.vd-src-empty small { color: var(--muted); font-weight: 400; }
.vd-src-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.vd-upload { position: relative; overflow: hidden; cursor: pointer; }
.vd-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.vd-row { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; }
.vd-row label:not(.check) { display: grid; gap: 6px; min-width: 200px; }
.vd-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; }
.vd-ready h2 { margin: 6px 0 12px; font-size: 20px; }
.vd-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
body.product-mode button.vd-card { position: relative; display: grid; gap: 0; min-height: 0; height: auto; padding: 0; overflow: hidden; border-radius: 18px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); text-align: left; transition: transform .3s var(--spring), box-shadow .2s; }
body.product-mode button.vd-card:hover { transform: translateY(-3px); box-shadow: var(--shadow), inset 0 0 0 1px var(--line-2); }
.vd-card :is(img, video) { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.vd-play { position: absolute; left: 50%; top: 32%; display: grid; place-items: center; width: 44px; height: 44px; margin-left: -22px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; font-size: 15px; opacity: .9; }
.vd-card-text { display: grid; gap: 2px; padding: 10px 12px 12px; }
.vd-card-text b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vd-card-text small { color: var(--muted); font-size: 12.5px; }
.vd-empty { padding: 34px 22px; }
body dialog.video-detail { width: min(760px, calc(100% - 24px)); border: 0; border-radius: 24px; background: var(--panel); color: var(--ink); box-shadow: var(--shadow-pop); padding: 22px; }
body dialog.video-detail header.actions { justify-content: space-between; }
body dialog.video-detail .generated-video { width: 100%; border-radius: 16px; }
@media (max-width: 1100px) { .vd-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) { .vd-src { grid-template-columns: 90px minmax(0, 1fr); } .vd-src video { width: 90px; } }
.vd-upload, label.gbtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); font-weight: 600; }
label.gbtn:hover { background: var(--glass-3); }

/* ---------- Проект ---------- */
body.product-mode .pj-name { display: flex; align-items: end; gap: 10px; padding: 16px 20px; }
body.product-mode .pj-name label { flex: 1; display: grid; gap: 6px; }
.pj-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 14px; }
.pj-author-head { display: flex; align-items: center; gap: 14px; }
.pj-author-head .cs-ava { width: 52px; height: 52px; font-size: 20px; }
.pj-author-head h2 { margin: 0; font-size: 20px; }
.pj-author-head p { margin: 2px 0 0; }
.pj-voice { margin: 14px 0 0; padding: 12px 14px; border-radius: 14px; background: var(--glass); color: var(--ink-2) !important; font-style: italic; }
.pj-phrases { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pj-phrases span { padding: 4px 10px; border-radius: 99px; background: var(--mint-soft); color: var(--ink); font-size: 13px; }
.pj-avoid { margin: 12px 0 0; font-size: 14px; }
.pj-avoid b { color: var(--ink-2); font-weight: 600; }
body.product-mode .pj-grid .persona-card { margin: 0; }
body.product-mode .pj-grid .persona-card > summary { font-size: 16px; }
body.product-mode .pj-topics { margin-top: 14px; }
.pj-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.pj-head h2 { margin: 0 0 4px; font-size: 20px; }
.pj-head p { margin: 0; max-width: 640px; }
.pj-topic-list { display: grid; gap: 8px; }
body.product-mode details.pj-topic { padding: 0; border-radius: 16px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); }
details.pj-topic > summary { list-style: none; display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 20px; align-items: center; gap: 12px; padding: 13px 16px; cursor: pointer; }
details.pj-topic > summary::-webkit-details-marker { display: none; }
details.pj-topic > summary b { font-weight: 600; }
.pj-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--plan); }
.pj-topic.done .pj-dot { background: var(--pub); } .pj-topic.ask .pj-dot { background: var(--review); } .pj-topic.open .pj-dot { background: var(--queue); }
.pj-state { font-size: 13px; font-weight: 600; color: var(--muted); }
.pj-topic.done .pj-state { color: var(--pub); } .pj-topic.ask .pj-state { color: var(--review); }
details.pj-topic[open] .chev { transform: rotate(90deg); color: var(--ink); }
.pj-topic-body { display: grid; gap: 10px; padding: 0 16px 16px 40px; }
.pj-topic-body p { margin: 0; color: var(--ink-2) !important; }
.pj-questions { margin: 0; padding-left: 18px; color: var(--review); }
.pj-topic-body .acts { display: flex; flex-wrap: wrap; gap: 6px; }
.pj-empty { margin-top: 6px; }
/* memory and promises */
body.product-mode #channel-memory .memory-row { display: grid; gap: 2px; padding: 12px 14px 12px 32px; margin: 0 0 8px; border: 0; border-radius: 14px; background: var(--glass); position: relative; }
body.product-mode #channel-memory .memory-row::before { content: ''; position: absolute; left: 14px; top: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--review); }
body.product-mode #channel-memory .memory-row p { margin: 0; color: var(--ink) !important; font-weight: 500; }
body.product-mode #channel-memory .memory-row .small { color: var(--muted); }
body.product-mode #channel-memory h3 { margin: 18px 0 10px; font-size: 16px; }
@media (max-width: 1100px) { .pj-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) { body.product-mode .pj-name { flex-wrap: wrap; } .pj-head { flex-wrap: wrap; } .pj-topic-body { padding-left: 16px; } }

/* ---------- Настройки и оплата ---------- */
body.product-mode .ac-channel { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 14px 16px; margin: 0 0 10px; border-radius: 18px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); }
.ac-channel .cav { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(150deg, #ffb37a, #ff7f9e); color: #fff; font-weight: 700; font-size: 17px; }
.ac-channel .cav.c1 { background: linear-gradient(150deg, #7fd3ff, #4f7dff); } .ac-channel .cav.c2 { background: linear-gradient(150deg, #c39bff, #7b5cff); } .ac-channel .cav.c3 { background: linear-gradient(150deg, #8ff0c4, #2fb37f); }
.ac-main strong { font-size: 16px; }
.ac-main p { margin: 2px 0 0; }
.ac-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ac-tag { padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: var(--glass-2); color: var(--muted); }
.ac-tag.ok { background: var(--mint-soft); color: var(--pub); }
.ac-tag.warn { background: rgba(255, 196, 107, .14); color: var(--review); }
.ac-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
body.product-mode .ac-metrics .panel { display: grid; gap: 6px; }
.ac-metrics strong { font-size: 40px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.ac-metrics strong small { font-size: 16px; font-weight: 500; color: var(--muted); }
.ac-balance { background: radial-gradient(500px circle at 0% 0%, var(--mint-soft), transparent 60%), var(--card) !important; }
.ac-storage progress { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border: 0; border-radius: 6px; background: var(--line-2); overflow: hidden; }
.ac-storage progress::-webkit-progress-bar { background: var(--line-2); }
.ac-storage progress::-webkit-progress-value { background: linear-gradient(90deg, var(--mint-2), var(--mint)); }
.ac-storage progress::-moz-progress-bar { background: var(--mint); }
.ac-wallet { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
body.product-mode .ac-wallet code { padding: 10px 14px; border-radius: 12px; background: var(--glass-2); color: var(--ink); font-family: var(--font); word-break: break-all; }
body.product-mode .product-table { width: 100%; }
body.product-mode .product-table th, body.product-mode .product-table td { padding: 11px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
body.product-mode .product-table td small { display: block; color: var(--muted); font-size: 12.5px; }
body.product-mode .product-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
body.product-mode .product-table .num.plus { color: var(--pub); font-weight: 600; }
body.product-mode .product-table-wrap { overflow-x: auto; }
@media (max-width: 900px) {
  body.product-mode .ac-channel { grid-template-columns: 40px minmax(0, 1fr); } .ac-channel .actions { grid-column: 1 / -1; }
  .ac-metrics { grid-template-columns: minmax(0, 1fr); } .ac-metrics strong { font-size: 32px; }
}
/* service admin: tables and panels in the same look */
body.product-mode[data-product-view=account] #main details.panel > summary { font-size: 16px; }
body.product-mode .pj-grid .persona-card:not([open]) { padding: 14px 22px; }
body.product-mode .pj-grid .persona-card > summary .muted { display: none; }
@media (max-width: 900px) { .cs .page-top .wallpaper-mini { display: none; } }
/* director chat: day separators */
body.product-mode .chat-day { display: flex; justify-content: center; margin: 6px 0 2px; animation: none; }
body.product-mode .chat-day span { padding: 3px 12px; border-radius: 12px; background: var(--glass-2); color: var(--muted); font-size: 12px; font-weight: 500; }
/* all posts */
.tl-chans { margin: 0 0 14px; }
.tl-chans .chip { padding-right: 14px; }
.tl-chans .chip:first-child { padding-left: 14px; }
body.product-mode .tl-list { display: grid; gap: 4px; margin-bottom: 14px; }
.tl-list h2 { margin: 0 0 6px; font-size: 19px; }
.tl-day { margin: 14px 0 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
.tl-day:first-of-type { margin-top: 4px; }
body.product-mode button.tl-row { display: grid; grid-template-columns: 52px 46px minmax(0, 1fr) auto; align-items: center; gap: 14px; width: 100%; min-height: 0; height: auto; padding: 8px 12px; border-radius: 14px; background: transparent; box-shadow: none; text-align: left; }
body.product-mode button.tl-row:hover { background: var(--glass); }
.tl-row time { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-2); text-align: right; }
.tl-row img, .tl-ic { width: 46px; height: 36px; border-radius: 10px; object-fit: cover; }
.tl-ic { display: grid; place-items: center; background: var(--glass-2); color: var(--muted); }
.tl-ic .icon { width: 18px; height: 18px; }
.tl-text { display: grid; gap: 1px; min-width: 0; }
.tl-text b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-text small { color: var(--muted); font-size: 12.5px; }
body.product-mode .tag-settings-list .tag-choice { border: 0; border-radius: 0; background: transparent; padding: 14px 0; }
body.product-mode .tag-settings-list .tag-choice p { margin: 4px 0 0; }
@media (max-width: 900px) {
  body.product-mode button.tl-row { grid-template-columns: 44px 40px minmax(0, 1fr); column-gap: 12px; row-gap: 3px; }
  .tl-row time, .tl-row img, .tl-row .tl-ic { grid-row: span 2; }
  .tl-row .st { grid-column: 3; }
  body.product-mode .panel.tl-list { padding: 18px 8px 10px; }
  .tl-list h2, .tl-day { padding: 0 12px; }
}
@media (max-width: 900px) {
  .wk-tools { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 2px; margin: 2px 0 0; }
  .wk-tools .gbtn.only, .wk-tools .wk-today { width: auto; padding: 0 8px; gap: 5px; flex: none; font-size: 13px; }
  .wk-tools .gbtn.only::after { content: attr(data-short); font-size: 13px; font-weight: 500; }
  .wk-tools .date-control { flex: none; }
  .wk-tools .date-trigger { width: auto; padding: 0 8px 0 31px; font-size: 0; color: var(--muted); }
  .wk-tools .date-trigger::before { inset: 9px auto 9px 8px; width: 18px; }
  .wk-tools .date-trigger::after { content: 'Дата'; font-size: 13px; font-weight: 500; }
}

/* nested disclosures inside panels (repost editor, author, promises archive) use the same chevron */
body.product-mode .panel details:not([class]) > summary { list-style: none; display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; color: var(--ink-2); }
body.product-mode .panel details:not([class]) > summary::-webkit-details-marker { display: none; }
body.product-mode .panel details:not([class]) > summary::before { content: ''; width: 7px; height: 7px; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(-45deg); transition: transform .25s var(--ease); margin-right: 2px; }
body.product-mode .panel details[open]:not([class]) > summary::before { transform: rotate(45deg); }

/* ---------- 24-hour time field and file picker (controls.js) ---------- */
body .time-control { position: relative; display: flex; align-items: center; }
body .time-control input { width: 100%; padding-right: 48px; font-variant-numeric: tabular-nums; }
body .time-trigger { position: absolute; right: 6px; top: 50%; width: 34px; height: 34px; min-height: 34px; padding: 0; border: 0; border-radius: 10px; background: transparent; box-shadow: none; color: var(--muted); transform: translateY(-50%); }
body .time-trigger::before { content: ''; position: absolute; inset: 8px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 7.5V12l3 2'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 7.5V12l3 2'/%3E%3C/svg%3E") center / contain no-repeat; }
body .time-trigger:hover { background: var(--glass-2); color: var(--ink); }
body .time-popover { position: fixed; margin: 0; width: 236px; max-height: 262px; overflow-y: auto; padding: 8px; border: 0; border-radius: 18px; background: var(--panel); color: var(--ink); box-shadow: var(--shadow-pop); scrollbar-width: thin; }
body .time-popover:popover-open { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
body .time-popover button { min-height: 34px; height: 34px; padding: 0; border: 0; border-radius: 10px; background: transparent; box-shadow: none; color: var(--ink-2); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
body .time-popover button:hover, body .time-popover button:focus-visible { background: var(--glass-2); color: var(--ink); outline: none; }
body .time-popover button[aria-pressed=true] { background: linear-gradient(160deg, var(--mint-2), var(--mint)); color: var(--on-mint); }
body label:has(> .file-native) { position: relative; }
body .file-native { position: absolute; left: 0; bottom: 0; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; opacity: 0; pointer-events: none; }
body .file-picker { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 46px; padding: 6px 14px 6px 6px; border-radius: 14px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; font-weight: 500; cursor: pointer; transition: box-shadow .2s; }
body .file-pick { display: inline-flex; flex: none; align-items: center; gap: 8px; height: 34px; padding: 0 14px 0 12px; border-radius: 10px; background: var(--chip); color: var(--ink); font-weight: 600; white-space: nowrap; transition: background .2s; }
body .file-pick::before { content: ''; width: 16px; height: 16px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4M7 9l5-5 5 5M5 20h14'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4M7 9l5-5 5 5M5 20h14'/%3E%3C/svg%3E") center / contain no-repeat; }
body .file-picker:hover .file-pick { background: var(--line-2); }
body .file-names { min-width: 0; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
body .file-picker.chosen .file-names { color: var(--ink); }
body .file-native:focus-visible + .file-picker { box-shadow: inset 0 0 0 1.5px var(--mint), 0 0 0 4px var(--mint-soft); }

/* chat wallpaper: a labelled button with a small swatch instead of a bare tile */
body.product-mode .wallpaper-mini { display: inline-flex; align-items: center; gap: 9px; width: auto; height: 44px; min-height: 44px; padding: 0 14px 0 7px; overflow: hidden; border: 0; border-radius: 14px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); font-size: 14px; font-weight: 600; white-space: nowrap; }
body.product-mode .wallpaper-mini:hover { background: var(--glass-2); color: var(--ink); }
body.product-mode .wallpaper-mini img { width: 30px; height: 30px; border-radius: 9px; object-fit: cover; box-shadow: inset 0 0 0 1px var(--line); }

/* dialogs: no empty gap above the buttons; the buttons stay in view while a long form scrolls */
body dialog#modal { --dlg-pad: 26px; }
body #modal-content #form-error:empty { display: none; }
body #modal-content form > .dialog-footer { position: sticky; bottom: calc(var(--dlg-pad) * -1); z-index: 3; margin: 4px calc(var(--dlg-pad) * -1) calc(var(--dlg-pad) * -1); padding: 18px var(--dlg-pad) var(--dlg-pad); background: linear-gradient(to bottom, transparent, var(--panel) 18px); }
body.product-mode #modal-content details:not([class]) > summary { list-style: none; display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-weight: 600; cursor: pointer; }
body.product-mode #modal-content details:not([class]) > summary::-webkit-details-marker { display: none; }
body.product-mode #modal-content details:not([class]) > summary::before { content: ''; width: 7px; height: 7px; margin-right: 2px; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(-45deg); transition: transform .25s var(--ease); }
body.product-mode #modal-content details[open]:not([class]) > summary::before { transform: rotate(45deg); }
@media (max-width: 900px) {
  body dialog#modal { --dlg-pad: 18px; }
  body #modal-content .composer-formats { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  body #modal-content label.composer-format { padding: 9px 12px; }
  body #modal-content .composer-format::before { width: 36px; height: 36px; border-radius: 12px; }
  body #modal-content .composer-format::after { left: 19px; width: 20px; height: 20px; }
}

/* the card thumbnail's wave keeps its own size (the Telegram bubble's wave is wider) */
.th.vo svg.wave { width: 70px; height: 34px; }
@media (max-width: 900px) { .th.vo svg.wave { width: 52px; height: 28px; } }

/* channel memory: a rule reads as one line with its buttons on the right */
body.product-mode #channel-memory > .actions { margin-bottom: 12px; }
body.product-mode #channel-memory .memory-row:has(> .actions) { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; }
body.product-mode #channel-memory .memory-row:has(> .actions)::before { top: 50%; margin-top: -4px; background: var(--mint); }
body.product-mode #channel-memory .memory-row > .actions { grid-column: 2; grid-row: 1; margin: 0; }
body.product-mode #channel-memory .memory-row > details { grid-column: 1 / -1; }
body.product-mode #channel-memory .memory-row > .actions button { min-height: 32px; height: 32px; padding: 0 12px; font-size: 13px; }

/* forms: «Сохранить» sits under the fields at its own width, not stretched across the card */
body.product-mode :is(#main, #modal-content) .stack > button { align-self: flex-start; justify-self: start; }
body.product-mode .panel.stack > h2 { margin-bottom: 0; }

/* small chips inside cards stay visible on a white card too */
.rp-time, .rp-card.off .rp-state { background: var(--chip); }
body #modal-content #calendar-media-preview:empty, body #modal-content #calendar-compose-status:empty { display: none; }
body.product-mode :is(#modal-content, #main) .actions:empty { display: none; }
/* page header: the description wraps, the buttons stay at the top right */
body.product-mode .page-top > div:first-child { flex: 1 1 240px; min-width: 0; }
body.product-mode .page-top > .actions { flex: none; }
body.product-mode :is(#main, #modal-content) p.error:empty { display: none; }
body.product-mode .channel-connection { gap: 10px; }
body.product-mode .channel-connection > :is(h3, p) { margin: 0; }
body.product-mode .channel-connection > h3 { margin-top: 6px; }
body.product-mode .channel-connection > .actions { margin-top: 4px; }
body.product-mode .channel-publishing { gap: 10px; }
body.product-mode .channel-publishing > :is(h3, p) { margin: 0; }
body.product-mode .channel-publishing > h3 { margin-top: 6px; }
:is(#modal-content, #main) label.rb-switch:has(input:disabled) { color: var(--muted); cursor: not-allowed; }
.rb-switch input:disabled + span { opacity: .5; }
body #modal-content form > p { margin: 0; }
#material-filters.wide:has(+ #material-results .mt-none) { display: none; }
/* phones: tabs stay one row and scroll sideways instead of wrapping into a lumpy block */
@media (max-width: 900px) {
  /* #main > * sets max-width with an id, so the cap is restated at the same level */
  body.product-mode .product-tabs, body.product-mode #main > .product-tabs { max-width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  body.product-mode .product-tabs::-webkit-scrollbar { display: none; }
  body.product-mode .product-tabs button { flex: none; padding: 0 11px; font-size: 14px; white-space: nowrap; }
}

/* wordmark: «SMM» in the same face, no letter-spacing (style.css spaced it out) */
.brand-text small { display: inline; margin: 0; letter-spacing: 0; text-transform: none; }
/* login card: the day/night switch stays on one line */
.login-form .theme-switch { flex: none; white-space: nowrap; }

/* first run of a new team: three steps */
.emptyday.fr { text-align: left; align-items: stretch; }
.emptyday.fr > b, .emptyday.fr > p { text-align: center; }
.fr-steps { display: grid; gap: 10px; width: min(640px, 100%); margin: 18px auto 0; padding: 0; list-style: none; }
.fr-step { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); text-align: left; }
.fr-step.next { background: var(--mint-soft); box-shadow: inset 0 0 0 1.5px var(--mint); }
.fr-n { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--glass-2); color: var(--muted); font-weight: 700; }
.fr-step.next .fr-n { background: var(--mint); color: var(--on-mint); }
.fr-step b { display: block; color: var(--ink); font-size: 16px; font-weight: 600; }
.fr-step p { margin: 2px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
@media (max-width: 900px) { .fr-step { grid-template-columns: 30px minmax(0, 1fr); } .fr-step > .gbtn { grid-column: 2; justify-self: start; } .fr-n { width: 30px; height: 30px; } }
/* login: the wordmark follows the theme (style.css painted it white for the old dark sidebar) */
#login .wordmark .brand-text { color: var(--ink); }
@media (max-width: 900px) { #login .login-hero { margin-top: 22px; } }

/* narrow desktop: the day's steps fit without scrolling — the hint goes first, then the done steps' names */
@media (min-width: 901px) and (max-width: 1320px) { .pipe .ps small { display: none; } .pipe em { margin: 0 8px; } }
@media (min-width: 901px) and (max-width: 1100px) { .pipe .ps.past b { display: none; } }

/* ---------- dialogs on <body>: library picker, upload, wallpaper ---------- */
body dialog.asset-picker { width: min(860px, calc(100% - 24px)); }
body dialog.asset-picker .asset-filters { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 8px; margin-bottom: 14px; }
body dialog.asset-picker .asset-filters:not(:has(select)) { grid-template-columns: minmax(0, 1fr); }
body dialog.asset-picker .asset-card { display: grid; align-content: start; gap: 4px; padding: 8px 8px 12px; border: 0; border-radius: 18px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); text-align: left; height: auto; min-height: 0; }
body dialog.asset-picker .asset-card:hover { background: var(--glass-2); }
body dialog.asset-picker .asset-card.selected { background: var(--mint-soft); box-shadow: inset 0 0 0 1.5px var(--mint); }
body dialog.asset-picker .asset-card :is(img, video) { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; margin-bottom: 6px; }
body dialog.asset-picker .asset-card strong { padding: 0 4px; font-size: 14px; font-weight: 600; line-height: 1.3; }
body dialog.asset-picker .asset-card small { padding: 0 4px; color: var(--muted); font-size: 12.5px; font-weight: 400; line-height: 1.4; }
body dialog.asset-picker footer.actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
body dialog.asset-picker footer.actions .spacer { flex: 1; }
body dialog.asset-picker footer.actions span:not(.spacer) { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
body dialog.asset-picker details > summary, body dialog.wallpaper-dialog details > summary { list-style: none; display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-weight: 600; cursor: pointer; }
body dialog.asset-picker details > summary::-webkit-details-marker { display: none; }
body dialog.asset-picker details > summary::before { content: ''; width: 7px; height: 7px; margin-right: 2px; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(-45deg); transition: transform .25s var(--ease); }
body dialog.asset-picker details[open] > summary::before { transform: rotate(45deg); }
body dialog.asset-picker form > .dialog-footer { margin-top: 4px; }
body dialog.asset-picker .upload-previews small { color: var(--muted); }
body dialog.wallpaper-dialog { width: min(620px, calc(100% - 24px)); border: 0; border-radius: 24px; background: var(--panel); color: var(--ink); box-shadow: var(--shadow-pop); padding: 22px; }
body dialog.wallpaper-dialog[open] { animation: g-pop .35s var(--spring); }
body dialog.wallpaper-dialog header.actions { display: flex; align-items: center; margin-bottom: 16px; }
body dialog.wallpaper-dialog header.actions .spacer { flex: 1; }
body dialog.wallpaper-dialog header.actions h2 { margin: 0; font-size: 22px; }
body dialog.wallpaper-dialog header.actions button { width: 38px; height: 38px; min-height: 38px; padding: 0; border: 0; border-radius: 12px; background: transparent; box-shadow: none; color: var(--muted); font-size: 22px; }
body dialog.wallpaper-dialog .wp-body { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 20px; align-items: start; }
body.product-mode dialog.wallpaper-dialog .wallpaper-preview { width: 180px; margin: 0; border-radius: 22px; box-shadow: inset 0 0 0 1px var(--line), 0 18px 40px -24px rgba(0, 0, 0, .7); }
body dialog.wallpaper-dialog .wp-side { display: grid; gap: 14px; }
body dialog.wallpaper-dialog .wp-side p { margin: 0; line-height: 1.5; }
body dialog.wallpaper-dialog .wp-side label { display: grid; gap: 7px; font-size: 13px; font-weight: 500; color: var(--muted); }
body dialog.wallpaper-dialog .wp-side > button { justify-self: start; }
@media (max-width: 560px) { body dialog.wallpaper-dialog .wp-body { grid-template-columns: 1fr; } body.product-mode dialog.wallpaper-dialog .wallpaper-preview { width: 150px; justify-self: center; } body dialog.asset-picker .asset-filters { grid-template-columns: 1fr; } }
/* date popover: the chosen day stays inside its column */
body .calendar-popover .calendar-grid { gap: 2px; }
body .calendar-popover .calendar-grid button { min-width: 0; padding: 0; }
body .calendar-popover .calendar-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
body .calendar-popover [data-today]:not([aria-pressed=true]) { box-shadow: inset 0 0 0 1.5px var(--mint); color: var(--ink); font-weight: 700; }
body dialog.asset-picker .asset-card > * { margin: 0; }

/* a button that is saving shows a small spinner instead of just fading out */
button[aria-busy=true] { position: relative; color: transparent !important; opacity: 1 !important; cursor: progress; }
button[aria-busy=true]::after { content: ''; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--ink); animation: g-spin .7s linear infinite; }
button.primary[aria-busy=true]::after, .gbtn.primary[aria-busy=true]::after { border-color: rgba(4, 30, 20, .25); border-top-color: var(--on-mint); }
button[aria-busy=true] > * { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { button[aria-busy=true]::after { animation-duration: 2s; } }
/* author form: the name gets its own row, so a one-line field does not sit beside a tall one */
body.product-mode #persona-form .form-grid > label:has(> input[name=name]) { grid-column: 1 / -1; }

/* a very long channel name does not stretch its chip across the row */
.chip .chip-name { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) { .chip .chip-name { max-width: 180px; } }
/* phones: the channel avatar stays at the top of its row */
@media (max-width: 900px) { body.product-mode .ac-channel { align-items: start; } }

/* while the page loads: the logo breathes in the middle of the sky (only if loading takes a moment) */
.boot { position: fixed; inset: 0; z-index: 5; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); font-size: 15px; font-weight: 500; opacity: 0; pointer-events: none; animation: g-boot .5s .35s ease forwards; }
.boot .logo-mark { width: 54px; height: 54px; border-radius: 17px; animation: g-breathe 1.6s ease-in-out infinite; }
body:has(#login:not(.hidden)) .boot, body:has(#app:not(.hidden)) .boot { display: none; }
@keyframes g-boot { to { opacity: 1; } }
@keyframes g-breathe { 50% { transform: scale(.92); opacity: .82; } }
@media (prefers-reduced-motion: reduce) { .boot .logo-mark { animation: none; } }
.boot .logo-mark::before { width: 30px; height: 32px; }

/* phones: in «Как увидят подписчики» the clock and «Прокрутить день» come first, the phone below is shorter */
@media (max-width: 900px) {
  .svwrap .sv-side { order: -1; gap: 12px; }
  body .svwrap .sv-phone { height: min(460px, 56vh); border-radius: 36px; padding: 9px; }
  .sv-time b { font-size: 40px; }
  .sv-list { display: none; }
}

/* dialogs: empty status lines take no room; section titles sit close to what they name */
body #modal-content [role=status]:empty { display: none; }
body #modal-content .stack > h3 { margin: 0; }
body.product-mode #chat-hint:empty { display: none; }

/* tables keep readable columns: on a narrow screen they scroll inside their card instead of breaking words */
body.product-mode .product-table td button, body.product-mode .product-table td .gbtn { white-space: nowrap; margin: 0 4px 4px 0; }
body.product-mode .product-table td { overflow-wrap: normal; word-break: normal; }
@media (max-width: 900px) {
  body.product-mode .product-table:not(.adm-teams):has(th:nth-child(5)) { min-width: 560px; }
  body.product-mode .product-table-wrap { margin: 0 -8px; padding: 0 8px; scrollbar-width: thin; }
}
/* the route «откуда → куда» stays one line; long names shorten instead of wrapping under the arrow */
.rp-route { flex-wrap: nowrap; min-width: 0; }
.rp-route b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-route .cav, .rp-route .rp-arrow { flex: none; }

/* desktop: once the page scrolls, the sticky channels-and-week header hides what passes under it;
   the sides fade out so no box edge shows against the sky. At rest the soft original fade stays. */
@media (min-width: 901px) {
  .gtop::before { -webkit-mask: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent); mask: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
  .scrolled .gtop::before { inset: -18px -40px -20px; background: linear-gradient(var(--bg) calc(100% - 20px), transparent); opacity: 1; -webkit-mask: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent); mask: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
}

/* ---------- Phantom chat: a failed answer reads like a message, with a clear next step ---------- */
body.product-mode #chat-status .job-status { margin: 4px 18px 12px; padding: 14px 16px; border-radius: 18px; font-size: 14px; line-height: 1.5; }
body.product-mode #chat-status .job-status.error { background: color-mix(in srgb, var(--fail) 10%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fail) 28%, transparent); color: var(--ink); }
body.product-mode #chat-status .job-status.error > p:first-child { margin: 0 0 8px; color: var(--fail); font-weight: 600; font-size: 14.5px; }
body.product-mode #chat-status .job-error-help { margin: 0 0 10px; }
body.product-mode #chat-status .job-error-help > summary { list-style: none; display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-weight: 600; cursor: pointer; }
body.product-mode #chat-status .job-error-help > summary::-webkit-details-marker { display: none; }
body.product-mode #chat-status .job-error-help > summary::before { content: ''; width: 7px; height: 7px; margin-right: 2px; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(-45deg); transition: transform .25s var(--ease); }
body.product-mode #chat-status .job-error-help[open] > summary::before { transform: rotate(45deg); }
body.product-mode #chat-status .job-error-help p { margin: 8px 0 0; color: var(--muted); font-size: 13.5px; }
body.product-mode #chat-status .job-status button { min-height: 34px; height: 34px; padding: 0 14px; border: 0; border-radius: 11px; background: var(--chip); box-shadow: none; color: var(--ink); font-size: 13.5px; font-weight: 600; }
body.product-mode #chat-status .job-status button:hover { background: var(--line-2); }
body.product-mode #chat-status .job-status button[data-action=retry-chat] { background: linear-gradient(160deg, var(--mint-2), var(--mint)); color: var(--on-mint); }
body.product-mode #chat-status .job-status:not(.error) { display: flex; align-items: center; gap: 10px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); }
body.product-mode #chat-status .job-status:not(.error) button { margin-left: auto; }

/* native checkboxes and radios take the brand colour wherever no custom control replaces them */
body.product-mode input[type=checkbox], body.product-mode input[type=radio] { accent-color: var(--mint); width: 18px; height: 18px; min-height: 0; padding: 0; flex: none; }
/* chat stories rhythm: the switch on its own line, the two numbers side by side */
body.product-mode .review-rule .chat-story-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
body.product-mode .review-rule .chat-story-check { grid-column: 1 / -1; font-size: 14.5px; font-weight: 500; color: var(--ink); }
body.product-mode .review-rule > p.small { margin: 4px 0 12px; color: var(--muted); }

/* ---------- Управление сервисом: flat documents, plain tables, status dots ---------- */
body.product-mode .adm-doc { padding: 4px 24px; }
.adm-doc > .adm-sec, .adm-detail > .adm-sec { padding: 20px 0; }
.adm-doc > .adm-sec + .adm-sec, .adm-detail > .adm-sec + .adm-sec { border-top: 1px solid var(--line); }
.adm-doc h2 { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.adm-doc h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 14px; font-weight: 600; color: var(--muted); }
.adm-doc p { margin: 0 0 12px; }
.adm-doc p.muted:last-child { margin-bottom: 0; }
.adm-dot { display: inline-block; flex: none; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; vertical-align: 1px; background: var(--faint); }
.adm-dot.ok { background: var(--pub); } .adm-dot.warn { background: var(--review); } .adm-dot.bad { background: var(--fail); } .adm-dot.off { background: var(--faint); }
.adm-warn { color: var(--review); }
.adm-alert { display: flex; align-items: center; margin: -6px 0 16px; color: var(--ink-2); }
/* teams: search + chips, then the table */
.adm-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 18px 0 14px; }
body.product-mode .adm-search { flex: 1 1 280px; max-width: 420px; min-height: 40px; }
.adm-chips { flex: 0 1 auto; }
body.product-mode .adm-teams { margin-bottom: 8px; }
body.product-mode .adm-teams th { color: var(--muted); font-size: 13px; font-weight: 500; }
body.product-mode .adm-teams td { vertical-align: middle; padding-top: 13px; padding-bottom: 13px; }
body.product-mode .adm-teams td small { margin-top: 2px; }
.adm-row { cursor: pointer; transition: background .15s; }
.adm-row:hover, .adm-row.open { background: var(--glass); }
.adm-row:focus-visible { outline: 2px solid var(--mint); outline-offset: -2px; }
.adm-row > td:first-child { border-radius: 12px 0 0 12px; }
.adm-row > td:last-child { border-radius: 0 12px 12px 0; }
.adm-row.open > td { border-bottom-color: transparent; }
.adm-chev { width: 28px; }
.adm-chev::after { content: ''; display: block; width: 7px; height: 7px; margin: 0 auto; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(-45deg); transition: transform .25s var(--ease); }
.adm-row.open .adm-chev::after { transform: rotate(45deg); }
body.product-mode .adm-more > td { padding: 0 0 6px; background: var(--glass); border-radius: 0 0 14px 14px; }
.adm-detail { padding: 0 20px 4px; }
.adm-detail > .adm-sec { padding: 16px 0; }
.adm-line { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.adm-line + .adm-line { border-top: 1px solid var(--line); }
.adm-main { display: grid; gap: 2px; min-width: 0; flex: 1; }
.adm-main small, .adm-line small { color: var(--muted); font-size: 13px; }
.adm-line form { flex: none; margin: 0; }
.adm-foot { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 0 12px; border-top: 1px solid var(--line); }
/* forms in a row and form grids */
.adm-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
body.product-mode .adm-inline :is(input, select) { width: auto; min-height: 38px; height: 38px; padding: 0 12px; }
body.product-mode .adm-inline input[type=number] { width: 140px; }
body.product-mode .adm-inline .adm-wide, body.product-mode .adm-inline input[name=password], body.product-mode .adm-inline input[name=reference] { flex: 1 1 220px; }
.adm-line .adm-inline { margin: 0; }
.adm-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: end; margin: 0 0 14px; }
.adm-fields-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.adm-fields > label { display: grid; gap: 7px; font-size: 13px; font-weight: 500; color: var(--muted); }
.adm-fields > .actions { align-self: end; }
.adm-fields textarea { font-size: 13px; }
.adm-more-settings { margin: 4px 0 14px; }
.adm-more-settings > summary { list-style: none; display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-weight: 600; cursor: pointer; }
.adm-more-settings > summary::-webkit-details-marker { display: none; }
.adm-more-settings > summary::before { content: ''; width: 7px; height: 7px; margin-right: 2px; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(-45deg); transition: transform .25s var(--ease); }
.adm-more-settings[open] > summary::before { transform: rotate(45deg); }
.adm-more-settings[open] > summary { margin-bottom: 14px; }
/* connections: one line per service */
.adm-svc-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 16px; }
.adm-svc-head h2 { margin-bottom: 2px; }
.adm-svc-head p { margin: 0; }
.adm-svc-state { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: flex-end; color: var(--ink-2); font-weight: 500; }
.adm-state { display: inline-flex; align-items: center; white-space: nowrap; }
.adm-svc > form, .adm-svc > .adm-list { margin-top: 16px; }
.adm-status { display: flex; align-items: center; font-weight: 600; color: var(--ink); }
.adm-empty { padding: 6px 0 22px; }
@media (max-width: 900px) {
  body.product-mode .adm-doc { padding: 2px 16px; }
  .adm-fields, .adm-fields-4 { grid-template-columns: minmax(0, 1fr); }
  .adm-svc-head { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .adm-svc-state { justify-content: flex-start; }
  .adm-line { flex-wrap: wrap; }
  .adm-detail { padding: 0 12px 4px; }
  body.product-mode .adm-search { max-width: none; }
}
.adm-fields-credit { grid-template-columns: minmax(0, 1.3fr) minmax(0, .8fr) minmax(0, 1.2fr) minmax(0, 1.2fr) auto; }
body.product-mode button.adm-alert { display: inline-flex; align-items: center; width: auto; min-height: 0; height: auto; margin: -6px 0 16px; padding: 6px 12px 6px 10px; border: 0; border-radius: 12px; background: transparent; box-shadow: none; color: var(--ink-2); font-weight: 500; }
body.product-mode button.adm-alert:hover { background: var(--glass); color: var(--ink); }
.adm-line > .adm-main { flex: 0 1 260px; }
.adm-line > .adm-inline { flex: 1 1 380px; justify-content: flex-end; }
.adm-line > form:not(.adm-inline) { margin-left: auto; }
@media (max-width: 900px) { .adm-fields-credit { grid-template-columns: minmax(0, 1fr); } .adm-line > .adm-inline { justify-content: flex-start; } }
.adm-line > .adm-main { flex: 1 1 auto; }
.adm-line > .adm-main:has(+ .adm-inline) { flex: 0 1 260px; }
/* a visually hidden label inside a scrolling table stays inside it (it used to widen the phone page) */
body.product-mode .product-table-wrap { position: relative; }
/* phones: the team table becomes a list of rows with labels; the open team's details take the full width */
@media (max-width: 900px) {
  body.product-mode .page-top > .actions { flex: 1 1 100%; justify-content: flex-start; flex-wrap: wrap; }
  body.product-mode table.adm-teams { min-width: 0; }
  .adm-teams thead { display: none; }
  .adm-teams, .adm-teams > tbody, .adm-teams tr.adm-more, .adm-teams tr.adm-more > td { display: block; width: 100%; }
  .adm-teams tr.adm-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 24px; grid-template-areas: "name name chev" "status status status" "channels paid paid" "balance balance balance"; gap: 6px 12px; padding: 12px 8px; border-bottom: 1px solid var(--line); }
  body.product-mode .adm-teams tr.adm-row > td { padding: 0; border: 0; text-align: left; }
  .adm-teams tr.adm-row > td:nth-child(1) { grid-area: name; }
  .adm-teams tr.adm-row > td:nth-child(2) { grid-area: status; }
  .adm-teams tr.adm-row > td:nth-child(3) { grid-area: channels; }
  .adm-teams tr.adm-row > td:nth-child(4) { grid-area: paid; }
  .adm-teams tr.adm-row > td:nth-child(5) { grid-area: balance; }
  .adm-teams tr.adm-row > td.adm-chev { grid-area: chev; align-self: center; width: 24px; }
  .adm-teams tr.adm-row > td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 1px; color: var(--muted); font-size: 12px; font-weight: 500; }
  .adm-teams tr.adm-row > td:nth-child(2)::before { display: none; }
  .adm-teams tr.adm-row > td:nth-child(3) small { display: inline; margin-left: 4px; }
  .adm-teams tr.adm-row > td:nth-child(3) small::before { content: '· '; }
  .adm-row > td:first-child, .adm-row > td:last-child { border-radius: 0; }
  .adm-row { border-radius: 14px; }
  body.product-mode .adm-more > td { border-radius: 0 0 14px 14px; }
}

/* team rows: the row itself is highlighted, never each cell (a tap on a phone left a sticky hover per cell) */
body.product-mode .adm-teams tr.adm-row:hover > td { background: none; }
@media (max-width: 900px) {
  /* style.css limited header buttons to 140px on narrow screens, which stacked them */
  body.product-mode .page-top > .actions { max-width: none; }
  .adm-row[data-id=owner] > td:nth-child(5) { display: none; }
  .adm-teams tr.adm-row[data-id=owner] { grid-template-areas: "name name chev" "status status status" "channels paid paid"; }
  /* lines inside an open team: dot and text stay together, a form goes full width under them */
  .adm-line { flex-wrap: wrap; row-gap: 10px; }
  .adm-line > .adm-main, .adm-line > .adm-main:has(+ .adm-inline) { flex: 1 1 0; }
  .adm-line > .adm-inline { flex: 1 1 100%; justify-content: flex-start; }
  .adm-line > form:not(.adm-inline) { flex: 1 1 100%; margin-left: 16px; }
  body.product-mode .adm-inline :is(input, select) { flex: 1 1 100%; width: 100%; }
  body.product-mode .adm-inline input[type=number] { width: 100%; }
}
/* confirmations: a clear question, the consequence in plain words, and a red button when something gets switched off */
body dialog.cost-confirmation { width: min(460px, calc(100% - 24px)); }
body dialog.cost-confirmation > h2 { margin: 0 0 10px; font-size: 20px; line-height: 1.3; }
body dialog.cost-confirmation > p { margin: 0; color: var(--ink-2); line-height: 1.55; }
body dialog.cost-confirmation .dialog-footer { margin-top: 20px; }
body dialog.cost-confirmation .dialog-footer button { min-height: 40px; height: 40px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--chip); box-shadow: none; color: var(--ink); font-weight: 600; }
body dialog.cost-confirmation .dialog-footer button.primary { background: linear-gradient(160deg, var(--mint-2), var(--mint)); color: var(--on-mint); }
body dialog.cost-confirmation .dialog-footer button.danger { background: var(--fail); color: #fff; }
/* ---------- Комментарии и источники рубрик ---------- */
body.product-mode #comments-section { gap: 24px; }
.cm-channel { max-width: 540px; }
.cm-settings > p { margin: 18px 0; }
.cm-settings form { margin-top: 24px; }
.cm-journal > p { margin: 12px 0 22px; }
.cm-journal h2 { margin: 0; }
.cm-search { flex: 1; min-width: 180px; }
.cm-table { width: 100%; }
.cm-table small { display: block; margin-top: 7px; color: var(--muted); }
.cm-table .cm-row td { cursor: pointer; }
.cm-table .cm-row[aria-expanded=true] td { background: var(--glass-2); }
.cm-row td:first-child { width: 23%; }
.cm-row td:nth-child(2) { width: 42%; }
.cm-row td:last-child { width: 30px; color: var(--muted); }
.cm-excerpt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.cm-detail { padding: 22px 8px; min-width: 0; }
.cm-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.cm-detail .actions { flex-wrap: wrap; }
.cm-detail .st { white-space: normal; }
.rb-source-content { margin: 0; border: 0; padding: 0; min-width: 0; }
.rb-source-content > * + * { margin-top: 20px; }
.poll-discussion { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
@media (max-width: 900px) {
  .cm-journal { min-width: 0; }
  .cm-journal .adm-tools { align-items: stretch; }
  .cm-journal .product-table-wrap { overflow-x: auto; }
  .cm-table { min-width: 580px; }
  .cm-detail { max-width: min(100%, calc(100vw - 82px)); padding: 18px 0; }
}

.cm-table .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

body.product-mode .cm-search .adm-search { flex: none; width: 100%; max-width: none; }
.rb-form > fieldset[data-rubric-kind=live] { border: 0; padding: 0; margin: 0; min-width: 0; }
.rb-form #rubric-preview { background: transparent; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 18px 0 0; }
.rb-form #rubric-preview > .tg { margin-top: 14px; }
.rb-form { grid-template-columns: minmax(0, 1fr); }
.rb-form > button { white-space: normal; max-width: 100%; justify-self: start; }
.rb-form > fieldset[data-rubric-kind=live] { display: grid; grid-template-columns: minmax(0, 1fr); }
.rb-form > fieldset[data-rubric-kind=live] > label { min-width: 0; grid-template-columns: minmax(0, 1fr); }

/* A running chat task keeps its description across the full drawer width. */
body.product-mode #chat-status .chat-job-wait:not(.error) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 16px;
  align-items: center;
}
body.product-mode #chat-status .chat-job-wait .chat-job-stage { display: contents; }
body.product-mode #chat-status .chat-job-wait .chat-job-stage > span {
  grid-column: 1 / -1;
  overflow-wrap: break-word;
  word-break: normal;
}
body.product-mode #chat-status .chat-job-wait .chat-job-bar { grid-area: 2 / 1 / 3 / -1; min-width: 0; }
body.product-mode #chat-status .chat-job-wait .chat-job-timing { grid-area: 3 / 1; min-width: 0; overflow-wrap: break-word; }
body.product-mode #chat-status .chat-job-wait .chat-job-stage > button { grid-area: 3 / 2; margin-left: 0; min-height: 38px; height: 38px; }


/* Director replies read as paragraphs and day sections, without changing conversation data. */
.director-reply { white-space: normal; }
.director-reply p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.director-reply p + p { margin-top: 14px; }
.director-reply .director-day { margin-top: 18px; }
.director-reply .director-day:first-child { margin-top: 0; }
.director-reply .director-day + p { margin-top: 18px; }
.director-reply h4 { margin: 0 0 7px; font-size: 1em; font-weight: 600; color: var(--ink); }

.m-say { translate: var(--say-shift-x, 0px) var(--say-shift-y, 0px); }
.m-say .m-txt { display: block; overflow-wrap: anywhere; }
.m-say.m-scrollable { max-height: var(--say-max-height); overflow-y: auto; border-radius: var(--r); }

/* ---------- Переписки: публикация этапа и скрытые пояснения ---------- */
.cs-about .cs-disclosure > summary { display: inline-flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; font-weight: 500; cursor: pointer; list-style: none; }
.cs-about .cs-disclosure > summary::-webkit-details-marker { display: none; }
.cs-about .cs-disclosure > summary::before { content: ''; width: 7px; height: 7px; flex: none; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(-45deg); transition: transform .2s var(--ease); }
.cs-about .cs-disclosure[open] > summary::before { transform: rotate(45deg); }
.cs-disclosure { min-width: 0; }
.cs-source-text { margin: 12px 0; color: var(--ink-2); font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
body.product-mode .cs .chat-story-episode { border-radius: 0; background: none; box-shadow: none; border-top: 1px solid var(--line); }
body.product-mode .cs .chat-story-episode > summary { grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; padding-left: 0; padding-right: 0; }

body.product-mode .cs .chat-story-episode > summary > strong, body.product-mode .cs .chat-story-episode > summary > small { grid-column: 1; }
body.product-mode .cs .chat-story-episode > summary::after { content: ''; grid-column: 2; grid-row: 1 / 3; width: 8px; height: 8px; align-self: center; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(45deg); transition: transform .2s var(--ease); }
body.product-mode .cs .chat-story-episode[open] > summary::after { transform: rotate(225deg); }
body.product-mode .cs .chat-story-episode > :not(summary) { margin-left: 0; margin-right: 0; }
.cs-stage-post { padding: 8px 0 16px; }
.cs-stage-post > .tg { max-width: 480px; }
.cs-stage-post + .cs-stage-post { border-top: 1px solid var(--line); padding-top: 16px; }
.cs-stage-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 12px; }
.chat-story-episode > .cs-disclosure { padding: 12px 0; border-top: 1px solid var(--line); }
.chat-story-episode > .cs-disclosure > summary { color: var(--muted); font-size: 13px; }
.cs-disclosure .chat-story-gallery { margin-top: 12px; }
@media (prefers-reduced-motion: reduce) {
  .cs-about .cs-disclosure > summary::before, body.product-mode .cs .chat-story-episode > summary::after { transition: none; }
}
.cs-about .cs-source-text { margin-top: 12px; }
#chat-stories-section .cs-disclosure, #chat-stories-section .chat-story-episode { margin-top: 0; }
#chat-stories-section .cs-disclosure > summary, #chat-stories-section .chat-story-episode > summary { margin-bottom: 0; }

/* Search tags without changing selection; long descriptions leave room for row actions. */
body.product-mode .tag-search { max-width: 340px; width: 100%; margin-bottom: 14px; }
body.product-mode .tag-settings-list .tag-choice { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
body.product-mode .tag-settings-list .tag-choice > div { min-width: 0; overflow-wrap: anywhere; }
body.product-mode .tag-settings-list .tag-choice > .actions { flex-wrap: nowrap; justify-content: flex-end; }
body.product-mode #circle-library.mt-circles > summary { margin: 0; padding: 14px 18px; }
body.product-mode .rp-title { border: 0; box-shadow: none; background: transparent; padding: 0; min-height: 36px; text-align: left; color: inherit; font: inherit; }
body.product-mode .rp-examples > .source-card { border: 0; border-radius: 0; box-shadow: none; background: transparent; border-top: 1px solid var(--line); padding: 18px 0; }
body.product-mode #persona-form { gap: 0; }
body.product-mode #persona-form .persona-field { border-bottom: 1px solid var(--line); padding: 0; }
body.product-mode #persona-form .persona-field > summary { display: flex; align-items: center; gap: 12px; margin: 0; padding: 16px 0; font-size: 15px; list-style: none; }
body.product-mode #persona-form .persona-field > summary::-webkit-details-marker { display: none; }
body.product-mode #persona-form .persona-field > summary::before { content: ''; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); flex: none; }
body.product-mode #persona-form .persona-field[open] > summary::before { transform: rotate(45deg); }
body.product-mode #persona-form .persona-field > .stack { padding-bottom: 18px; }
body.product-mode #persona-form .persona-field button { justify-self: start; }
body.product-mode #persona-form > button { margin-top: 18px; }
.m-say .m-say-in { padding-right: 38px; }
.m-say .m-acts button { min-height: 36px; height: auto; }
@media (max-width: 900px) {
  body.product-mode .tag-settings-list .tag-choice { grid-template-columns: minmax(0, 1fr); }
  body.product-mode .tag-settings-list .tag-choice > .actions { justify-content: flex-start; }
}

/* Clickable controls remain distinct from draggable card bodies. */
button:enabled:where(:not([aria-busy=true])), a[href], summary, [data-action]:where(:not(:disabled):not([aria-disabled=true])) { cursor: pointer; }
.gcard[data-movable] .card-row .chev { cursor: pointer; }
.rp-disclosure:not([hidden]) { display: grid; gap: 20px; }
.stage .mascot svg { cursor: pointer; }
.stage .mascot.dragging svg { cursor: grabbing; }
.rp-card { position: relative; }
.rp-card-toggle, .rp-card-toggle:hover { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; border-radius: inherit; background: transparent; box-shadow: none; transform: none; }
.rp-card .rp-acts { position: relative; }

/* Keyboard focus follows the mascot's silhouette; pointer clicks have no browser frame. */
.stage .mascot svg:focus { outline: none; }
.stage .mascot svg:focus-visible { outline: 2px solid var(--mint); outline-offset: 6px; border-radius: 50%; }
.bub.circle { overflow: visible; border-radius: 0; }
.cm-connection-steps { margin: 18px 0; padding-left: 22px; color: var(--muted); }
.cm-connection-steps li + li { margin-top: 8px; }

/* ---------- Calendar discussion context ---------- */
body.product-mode .context-copy { display: grid; gap: 3px; min-width: 0; }
body.product-mode .context-channel { color: var(--ink-2); }

/* Персональное обучение: панель можно закрыть, не блокируя работу с экраном. */
.phantom-guide { position: relative; margin-bottom: 16px; background: var(--panel); box-shadow: var(--shadow); }
.phantom-guide-head { display: flex; align-items: center; gap: 10px; }
.phantom-guide-head strong { flex: 1; }
.phantom-guide-head button { min-width: 36px; min-height: 36px; padding: 0; font-size: 22px; }
.phantom-guide .actions { flex-wrap: wrap; }
