:root{color-scheme:dark;--bg:#10141b;--surface:#19212b;--surface2:#212c38;--text:#eff5f9;--muted:#a8b7c6;--line:#324151;--accent:#4da8ff;--danger:#f58b8b;--radius:14px;font-family:Inter,system-ui,-apple-system,"Segoe UI",Arial,sans-serif}*{box-sizing:border-box}body{background:var(--bg);color:var(--text);margin:0;font-size:15px;line-height:1.5}a{color:var(--accent);text-decoration:none}a:hover{text-decoration:underline}button,input,textarea{font:inherit}button{cursor:pointer;border:0}.header{display:flex;align-items:center;justify-content:space-between;gap:22px;padding:18px clamp(18px,3vw,40px);border-bottom:1px solid var(--line);background:#151d27;flex-wrap:wrap}.brand{display:flex;align-items:center;gap:12px}.brand strong{display:block;font-size:21px;letter-spacing:-.04em}.brand small{display:block;color:var(--muted);font-size:11px;line-height:1.25}.mark{font-size:22px;letter-spacing:-.08em;font-weight:900;background:#357ec7;color:#fff;border-radius:12px;padding:6px 10px}.header nav{display:flex;gap:8px;flex-wrap:wrap}.header nav a{border-radius:10px;padding:10px 12px;color:var(--muted)}.header nav a:hover,.header nav a.current{background:var(--surface2);color:#fff;text-decoration:none}.logout button{background:transparent;color:var(--muted);padding:9px 12px}.layout{max-width:1500px;margin:0 auto;padding:36px clamp(16px,3vw,45px) 70px;min-height:70vh}.section-head{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:24px}h1{font-size:clamp(27px,3.2vw,36px);letter-spacing:-.045em;margin:0 0 3px}h2{font-size:18px;letter-spacing:-.02em;margin:0 0 16px}.eyebrow{color:#83c3ff;font-weight:800;letter-spacing:.16em;font-size:10px;margin:0 0 8px}.muted{color:var(--muted)}p{margin:8px 0 12px}.card{background:var(--surface);border:1px solid var(--line);padding:24px;border-radius:var(--radius)}.metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:24px}.metrics:has(.card:not(.stat)){grid-template-columns:repeat(3,minmax(0,1fr))}.stat span{display:block;color:var(--muted);font-size:13px}.stat strong{display:block;font-size:36px;letter-spacing:-.04em;margin-top:8px}.button,.primary,.secondary{display:inline-flex;align-items:center;justify-content:center;border-radius:9px;padding:11px 15px;font-weight:700}.button:hover{text-decoration:none}.primary{background:var(--accent);color:#0e1923}.primary:hover{background:#80c3ff}.secondary{background:#293b4d;color:#e1ecfa;border:1px solid #4b6075}.text-danger{background:none;color:var(--danger);text-decoration:underline;padding:8px 0}.notice{border:1px solid #38698c;background:#183248;color:#d6eeff;padding:12px 16px;border-radius:10px;margin-bottom:20px}.list{padding:0;overflow:hidden}.table-scroll{overflow-x:auto}table{width:100%;border-collapse:collapse;min-width:670px}th{text-align:left;font-size:11px;text-transform:uppercase;letter-spacing:.1em;color:#9cafbf;background:#1b2734}th,td{padding:17px 20px;border-bottom:1px solid var(--line);vertical-align:middle}tr:last-child td{border-bottom:0}td a{color:var(--text)}.block{display:block}.nowrap{white-space:nowrap}.pill{display:inline-block;border:1px solid #44657c;background:#213d50;color:#cbebff;font-size:12px;border-radius:50px;padding:3px 10px;white-space:nowrap}.platform{display:inline-block;font-size:10px;font-weight:800;padding:4px 6px;border:1px solid #4b6075;border-radius:6px;margin:2px}.empty{padding:22px}.editor-grid{display:grid;grid-template-columns:minmax(0,2fr) minmax(270px,1fr);gap:20px}.sidebar{display:flex;flex-direction:column;gap:16px}form label{display:block;color:var(--muted);font-weight:650;margin:0 0 18px;font-size:13px}input[type=text],input[type=password],input[type=datetime-local],input:not([type]),textarea{width:100%;margin-top:6px;display:block;color:#f5f8fb;background:#121a24;border:1px solid #435466;border-radius:9px;padding:12px;font-size:14px;outline-offset:3px}textarea{resize:vertical;line-height:1.6;min-height:80px}textarea:focus,input:focus{border-color:var(--accent)}fieldset{border:0;margin:0;padding:0;min-width:0}fieldset:disabled{opacity:.75}.platform-picker{padding:4px 0 18px;margin-bottom:16px;border-bottom:1px solid var(--line)}.platform-picker strong{display:block;margin-bottom:8px}.tick{display:inline-flex;align-items:center;gap:6px;margin-right:14px!important;color:var(--text)!important}.tick input{accent-color:#68b8ff}.back{font-size:13px;display:inline-block;margin-bottom:11px}.hint{font-size:12px;color:var(--muted);margin-top:10px}.archive{margin-top:26px;padding-top:12px;border-top:1px solid var(--line)}.login{max-width:460px;margin:clamp(20px,8vh,100px) auto}.login h1{margin-bottom:14px}.login input{margin:10px 0 20px}.month-nav{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:22px 0}.calendar{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));border:1px solid var(--line);border-radius:12px;overflow:hidden;background:var(--surface)}.day-name{text-align:center;background:var(--surface2);color:var(--muted);font-weight:800;padding:12px 4px}.day{border-top:1px solid var(--line);border-right:1px solid var(--line);padding:12px;min-height:102px;overflow-wrap:anywhere}.day:nth-child(7n){border-right:0}.day.outside{color:#778696;background:#151c25}.day strong{font-size:12px}.event{display:block;background:#24415a;color:#d5e9fd;border-radius:6px;font-size:11px;line-height:1.3;margin-top:8px;padding:6px}.event:hover{background:#305979}footer{font-size:12px;text-align:center;color:#8ca0b2;padding:22px 16px;border-top:1px solid var(--line)}@media(max-width:950px){.editor-grid{grid-template-columns:1fr}.metrics,.metrics:has(.card:not(.stat)){grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:620px){.layout{padding-top:24px}.metrics,.metrics:has(.card:not(.stat)){grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.stat{padding:16px}.card{padding:16px}.stat strong{font-size:30px}.header{padding:12px}.header nav{order:3;width:100%;justify-content:space-around}.header nav a{padding:8px}.calendar .day{padding:4px;min-height:73px}.day-name{font-size:11px}.event{font-size:9px;padding:3px}.section-head .button{width:100%}}
/* CRM-style trusted-device login */
.login .remember{display:flex;align-items:center;gap:9px;font-size:14px;line-height:1.45;margin:0 0 22px!important;color:var(--text)!important}
.login .remember input{flex:none;width:17px;height:17px;margin:0;accent-color:var(--accent)}
/* Account management */
.inline-action{display:inline-block;margin:0 0 7px}
.account-password{margin-top:8px;font-size:13px;min-width:155px}
.account-password summary{cursor:pointer;color:var(--accent)}
.account-password form{margin-top:12px;min-width:190px}
.account-password label{font-size:12px}
.account-password input{max-width:260px}

/* Publication illustration panel */
.post-illustration img{display:block;width:100%;height:auto;max-height:600px;object-fit:contain;border-radius:10px;border:1px solid var(--line);background:#141a21}
.post-illustration a{display:block;margin:8px 0 10px}
.post-illustration a:hover img{border-color:var(--accent)}
.post-illustration p{overflow-wrap:anywhere}

/* Audience preview for MAX / VK / Pikabu: approximate platform layout, full text. */
.preview-launch{white-space:nowrap;gap:8px}
.list-preview-link{display:inline-block;font-size:12px;font-weight:650;color:var(--accent);margin-top:7px}
.post-preview-dialog{position:fixed;inset:0;margin:auto;padding:0;width:min(930px,calc(100vw - 28px));height:min(96dvh,920px);max-width:none;max-height:none;border:1px solid #42556b;border-radius:18px;background:#131d28;color:#e9f2fa;box-shadow:0 24px 90px #000b;overflow:hidden}
.post-preview-dialog::backdrop{background:rgba(4,9,17,.78);backdrop-filter:blur(4px)}
.preview-dialog-shell{height:100%;display:flex;flex-direction:column;min-height:0}
.preview-topbar{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:19px 23px 10px}
.preview-topbar h2{font-size:clamp(18px,2.4vw,24px);margin:0;line-height:1.25}
.preview-topbar .eyebrow{margin:0 0 6px}
.preview-close{flex:none;background:#243447;color:#e9f2fa;border:1px solid #455d74;border-radius:50%;width:36px;height:36px;display:grid;place-items:center;font-size:26px;line-height:1}
.preview-close:hover{background:#36536c}
.preview-controls{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:10px 23px}
.preview-tabs,.preview-modes{display:flex;gap:5px;padding:4px;border:1px solid #3c526a;border-radius:11px;background:#1b2b3d}
.preview-tabs button,.preview-modes button{padding:8px 12px;border-radius:7px;background:transparent;color:#b6c9da;font-size:13px;font-weight:750}
.preview-tabs button.is-active,.preview-modes button.is-active{background:#4b9be2;color:#081724}
.preview-help{font-size:12px;color:#a9bbc9;padding:0 23px;margin:1px 0 11px}
.preview-warning{margin:0 23px 10px;padding:10px 12px;border-radius:8px;border:1px solid #b68c40;background:#41331d;color:#ffde9b;font-size:12px}
.preview-warning[hidden]{display:none}
.preview-stage{flex:1;overflow:auto;min-height:0;padding:21px 18px 35px;background:repeating-linear-gradient(45deg,#182534,#182534 8px,#1c2c3e 8px,#1c2c3e 16px);display:flex;justify-content:center;align-items:flex-start}
.preview-viewport{width:100%;max-width:690px;min-width:0;transition:max-width .16s ease}
.preview-viewport.is-mobile{max-width:390px}
.audience-card{color-scheme:light;color:#242b35;background:#fff;border:1px solid #e4e7ee;border-radius:13px;box-shadow:0 14px 35px #0003;overflow:hidden;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;font-size:14px;line-height:1.52}
.audience-author-row{display:flex;align-items:center;gap:11px;padding:16px 18px 9px;background:#fff;color:#1b2532}
.audience-author-row strong{font-size:14px;line-height:1.2;display:block}
.audience-author-row small{font-size:11px;color:#7d8999;line-height:1.4;display:block;margin-top:4px}
.audience-avatar{flex:none;width:42px;height:42px;border-radius:50%;background:#456bd4;color:white;display:grid;place-items:center;font-size:22px;font-weight:800}
.audience-menu{margin-left:auto;font-size:22px;color:#a3b2be;align-self:flex-start}
.audience-content{display:flex;flex-direction:column;padding:12px 18px 4px;gap:10px}
.audience-title{font-size:26px;line-height:1.25;color:#1c2b38;margin:0 0 6px;overflow-wrap:anywhere}
.audience-title[hidden],.audience-picture[hidden]{display:none!important}
.audience-text{font-size:14px;line-height:1.62;white-space:pre-wrap;overflow-wrap:anywhere;word-break:normal}
.audience-text p{margin:0 0 12px;white-space:pre-wrap}
.audience-text h2{font-size:20px;line-height:1.3;margin:14px 0 10px;color:inherit}
.audience-text h3{font-size:17px;line-height:1.35;margin:12px 0 7px;color:inherit}
.audience-text code{padding:1px 4px;border-radius:3px;background:#edf1f5}
.audience-text a{color:#2178cc;text-decoration:none;overflow-wrap:anywhere}
.audience-text a:hover{text-decoration:underline}
.audience-text .mock-empty{color:#8793a0;font-style:italic}
.audience-picture{margin:0 0 12px;max-width:100%}
.audience-picture img{display:block;width:100%;height:auto;max-height:none;object-fit:contain;border-radius:5px;background:#edf0f5}
.audience-actions{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;padding:14px 18px;border-top:1px solid #e6e8ee;font-size:12px;color:#66788d;background:#fff}
.audience-card[data-platform="max"] .audience-avatar{background:linear-gradient(155deg,#2a95ff,#1264cc)}
.audience-card[data-platform="max"] .audience-picture{order:1}
.audience-card[data-platform="max"] .audience-text{order:2}
.audience-card[data-platform="max"] .audience-content{gap:8px}
.audience-card[data-platform="max"] .audience-text{color:#202a38}
.audience-card[data-platform="vk"] .audience-avatar{background:#0077ff}
.audience-card[data-platform="vk"] .audience-text{order:1}
.audience-card[data-platform="vk"] .audience-picture{order:2}
.audience-card[data-platform="vk"] .audience-author-row{padding-bottom:5px}
.audience-card[data-platform="pikabu"]{border-radius:9px}
.audience-card[data-platform="pikabu"] .audience-avatar{background:#fb942b}
.audience-card[data-platform="pikabu"] .audience-author-row{background:#fff}
.audience-card[data-platform="pikabu"] .audience-title{order:1}
.audience-card[data-platform="pikabu"] .audience-picture{order:2}
.audience-card[data-platform="pikabu"] .audience-text{order:3}
.audience-card[data-platform="pikabu"] .audience-text{font-size:15px;line-height:1.68}
@media(max-width:650px){
  .post-preview-dialog{width:100vw;height:100dvh;border-radius:0;border:0}
  .preview-topbar{padding:12px 14px 6px}
  .preview-controls{padding:8px 12px;gap:8px}
  .preview-tabs,.preview-modes{gap:0}
  .preview-tabs button,.preview-modes button{padding:7px 9px;font-size:12px}
  .preview-help{padding:0 14px}
  .preview-warning{margin:0 14px 8px}
  .preview-stage{padding:12px 9px 28px}
  .preview-viewport,.preview-viewport.is-mobile{max-width:100%}
  .audience-content{padding:9px 13px 2px}
  .audience-title{font-size:23px}
  .audience-author-row{padding:12px 13px 7px}
  .audience-actions{padding:12px 13px}
}


/* Long publication bodies: expand individually only when their text overflows. */
.editor-textarea-expandable.is-expanded {
  overflow-y: hidden !important;
  resize: none;
  max-height: none;
}
.editor-textarea-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 7px 0 8px;
  padding: 7px 11px;
  border: 1px solid #4b6075;
  border-radius: 8px;
  background: #26384a;
  color: #cde8ff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
}
.editor-textarea-toggle[hidden] { display: none !important; }
.editor-textarea-toggle:hover,
.editor-textarea-toggle:focus-visible {
  background: #345169;
  color: #fff;
}


/* Appearance switcher in the footer. The stored preference only affects portal chrome. */
.portal-footer{display:flex;justify-content:center;align-items:center;gap:16px 22px;flex-wrap:wrap}
.portal-theme-toggle{display:inline-flex;align-items:center;gap:8px;justify-content:center;padding:8px 13px;border-radius:9px;color:var(--text);background:var(--surface2);border:1px solid var(--line);font-size:12px;font-weight:750;cursor:pointer;white-space:nowrap}
.portal-theme-toggle:hover,.portal-theme-toggle:focus-visible{border-color:var(--accent);outline-offset:2px}
.portal-theme-toggle [data-theme-icon]{font-size:17px;line-height:1}

/* The audience preview deliberately retains its own platform look in both themes. */
:root[data-theme="light"]{
  color-scheme:light;
  --bg:#f2f5fa;
  --surface:#ffffff;
  --surface2:#eaf0f7;
  --text:#172638;
  --muted:#54687d;
  --line:#cdd8e4;
  --accent:#0969bf;
  --danger:#b42338;
}
:root[data-theme="light"] .header{background:#ffffff}
:root[data-theme="light"] .header nav a:hover,
:root[data-theme="light"] .header nav a.current{color:#16364f}
:root[data-theme="light"] .mark{background:#176eae;color:#fff}
:root[data-theme="light"] .eyebrow{color:#1266a5}
:root[data-theme="light"] .primary{background:#126eae;color:#fff}
:root[data-theme="light"] .primary:hover{background:#08568c}
:root[data-theme="light"] .secondary,
:root[data-theme="light"] .editor-textarea-toggle{
  color:#163a58;background:#e7f1fb;border-color:#adc5dd
}
:root[data-theme="light"] .secondary:hover,
:root[data-theme="light"] .editor-textarea-toggle:hover,
:root[data-theme="light"] .editor-textarea-toggle:focus-visible{
  color:#063456;background:#cce5f8
}
:root[data-theme="light"] .notice{background:#e7f4ff;border-color:#9ac6e7;color:#12405c}
:root[data-theme="light"] th{background:#ebf0f7;color:#4a6074}
:root[data-theme="light"] td a{color:#173f66}
:root[data-theme="light"] .list-preview-link{color:#0969bf}
:root[data-theme="light"] .pill{background:#e5f2ff;border-color:#abc9df;color:#185079}
:root[data-theme="light"] .platform{border-color:#acbbca;color:#34546b;background:#f6f9fc}
:root[data-theme="light"] input[type=text],
:root[data-theme="light"] input[type=password],
:root[data-theme="light"] input[type=datetime-local],
:root[data-theme="light"] input:not([type]),
:root[data-theme="light"] textarea,
:root[data-theme="light"] select{
  background:#fff;color:#172638;border-color:#adbecf
}
:root[data-theme="light"] input::placeholder,
:root[data-theme="light"] textarea::placeholder{color:#64778b;opacity:1}
:root[data-theme="light"] .tick input{accent-color:#116aaf}
:root[data-theme="light"] .day.outside{background:#edf1f6;color:#738397}
:root[data-theme="light"] .event{background:#e0efff;color:#194b76}
:root[data-theme="light"] .event:hover{background:#c8e5ff}
:root[data-theme="light"] footer{color:#526a82}
:root[data-theme="light"] .post-illustration img{background:#f2f5f9}
:root[data-theme="light"] .post-preview-dialog{
  color:#213b55;background:#fff;border-color:#c6d4e3;box-shadow:0 24px 80px #14263835
}
:root[data-theme="light"] .preview-close{
  color:#264357;background:#e6eef6;border-color:#bad0e3
}
:root[data-theme="light"] .preview-close:hover{background:#d3e5f3}
:root[data-theme="light"] .preview-tabs,
:root[data-theme="light"] .preview-modes{background:#edf3f9;border-color:#c0d0df}
:root[data-theme="light"] .preview-tabs button,
:root[data-theme="light"] .preview-modes button{color:#37516a}
:root[data-theme="light"] .preview-tabs button.is-active,
:root[data-theme="light"] .preview-modes button.is-active{color:#fff;background:#176eb0}
:root[data-theme="light"] .preview-help{color:#62758b}
:root[data-theme="light"] .preview-warning{background:#fff5df;color:#845000;border-color:#e4c07b}
:root[data-theme="light"] .preview-stage{
  background:repeating-linear-gradient(45deg,#edf2f8,#edf2f8 8px,#e5ecf5 8px,#e5ecf5 16px)
}
@media(max-width:620px){
  .portal-footer{flex-direction:column;gap:10px}
}
