/* Redaktsiya visual refresh (v6). Loaded after every page stylesheet.

   This layer keeps the approved editor geometry and replaces the older green
   cabinet palette with the shipped brand tokens from palette-soft-orange-v2.
   Rules are prefixed with html[data-theme] so they win over the page
   stylesheets that base.html loads before this file. */

/* 1. Theme tokens ------------------------------------------------ */
html[data-theme="light"]{color-scheme:light}
html[data-theme="dark"]{
  color-scheme:dark;
  --ink:#f5f5f0;--muted:#bbb8c2;--line:#45424e;--canvas:#1f1e24;
  --surface:#2a2931;--surface-2:#33323b;--surface-3:#262530;--field:#26252c;
  --green:#f0906e;--accent-text:#f0906e;--mint:#3d2b26;--accent-soft:#3d2b26;
  --shadow:0 4px 18px #00000052;--ring:#f0906e;
}
html[data-theme]{accent-color:var(--brand)}
html[data-theme] body{background:var(--canvas);color:var(--ink)}
html[data-theme] a:focus-visible,html[data-theme] button:focus-visible,
html[data-theme] input:focus-visible,html[data-theme] select:focus-visible,
html[data-theme] textarea:focus-visible,html[data-theme] summary:focus-visible,
html[data-theme] [tabindex]:focus-visible{outline:3px solid var(--ring);outline-offset:3px}
html[data-theme] h1{letter-spacing:0;font-weight:680}
html[data-theme] h2,html[data-theme] h3{letter-spacing:0}

/* 2. Brand lockup and theme switch ------------------------------- */
.brand-lockup{display:inline-flex;align-items:center;gap:11px;text-decoration:none;min-width:0}
/* The tile is the drawn asset static/img/brand/mark.svg: flat #E65133 with the
   white italic mark and its dot. It keeps its own colour in both themes, so the
   element only carries the size for each lockup. */
.brand-mark{display:block;flex:0 0 auto;width:44px;height:44px}
.brand-words{display:grid;gap:1px;min-width:0;text-align:left}
.brand-name{font-family:Georgia,"Times New Roman",serif;font-weight:700;font-size:23px;line-height:1.06;color:var(--ink);letter-spacing:0}
.brand-descriptor{font-size:10.5px;line-height:1.3;color:var(--muted);letter-spacing:.2px}
.brand-lockup-sm .brand-mark{width:32px;height:32px}
.brand-lockup-sm .brand-name{font-size:17px}
.brand-lockup-sm .brand-descriptor{font-size:9px}
.brand-lockup-lg{gap:22px}
.brand-lockup-lg .brand-mark{width:96px;height:96px}
.brand-lockup-lg .brand-name{font-size:clamp(34px,4.4vw,58px)}
.brand-lockup-lg .brand-descriptor{font-size:clamp(13px,1.6vw,19px)}
.sidebar .brand-lockup .brand-name{color:var(--sidebar-ink)}
.sidebar .brand-lockup .brand-descriptor{color:var(--sidebar-muted)}
html[data-theme] .sidebar-brand{display:block;margin-bottom:6px}
html[data-theme] .public-brand{display:block}

.theme-switch{display:inline-flex;align-items:center;gap:2px;padding:3px;border:1px solid var(--line);
  border-radius:11px;background:var(--surface-2);position:relative}
.theme-switch button{display:inline-flex;align-items:center;gap:7px;min-height:32px;padding:5px 12px;
  border:0;border-radius:8px;background:transparent;color:var(--muted);font-size:12px;font-weight:600;white-space:nowrap;position:relative}
.theme-switch button:hover{color:var(--ink)}
.theme-switch button[aria-pressed="true"],
html[data-theme="light"] .theme-switch button[data-theme-set="light"],
html[data-theme="dark"] .theme-switch button[data-theme-set="dark"]{background:var(--surface);color:var(--ink);box-shadow:0 1px 2px #12171414}
.theme-switch svg{width:15px;height:15px;flex:0 0 auto}
html[data-theme="dark"] .theme-switch button[aria-pressed="true"]{background:var(--surface-3);box-shadow:none;border:1px solid var(--line)}
.theme-switch-compact button{padding:5px 9px}

/* 3. Application shell ----------------------------------------- */
html[data-theme] .skip-link{background:var(--surface);color:var(--ink);border:1px solid var(--line)}
html[data-theme] .sidebar{background:var(--navy);color:var(--sidebar-ink);border-right:1px solid var(--sidebar-line)}
html[data-theme] .environment-label{color:var(--sidebar-muted)}
html[data-theme] .status-dot{background:var(--brand)}
html[data-theme] .nav-link{color:#c9c6cf;border-radius:10px;font-size:12.5px}
html[data-theme] .nav-link:hover{background:#2f2e36;color:#fff}
html[data-theme] .nav-link.is-current{background:#34323b;color:#fff;border-color:#45424e}
html[data-theme] .nav-link.is-current .nav-symbol{color:var(--brand)}
html[data-theme] .nav-symbol{color:#9a97a3}
html[data-theme] .project-nav-title{color:var(--sidebar-ink)}
html[data-theme] .project-nav-divider{background:var(--sidebar-line)}
html[data-theme] .sidebar-note{border-top:1px solid var(--sidebar-line)}
html[data-theme] .sidebar-note p{color:#e6e4ea}
html[data-theme] .sidebar-muted{color:var(--sidebar-muted)}
html[data-theme] .sidebar .tiny-label{color:var(--sidebar-muted)}
html[data-theme] .profile-caption,html[data-theme] .profile-email{color:var(--sidebar-muted)}
html[data-theme] .logout-button,html[data-theme] .sidebar-login{color:var(--sidebar-ink)}
html[data-theme] .logout-button:hover,html[data-theme] .sidebar-login:hover{color:var(--brand)}
html[data-theme] .nav-badge{background:#a63c24}
html[data-theme] .nav-link.is-current .nav-badge{background:#f0e5e1;color:#8f3a24}
html[data-theme] .topbar{background:var(--surface);border-bottom:1px solid var(--line)}
html[data-theme] .topbar-context{color:var(--muted)}
html[data-theme] .topbar-tools{display:flex;align-items:center;gap:12px}
html[data-theme] .beta-pill{background:var(--accent-soft);border-color:#e8cfc7;color:var(--accent-text)}
html[data-theme="dark"] .beta-pill{border-color:#5a3f36;color:#f0b6a3}
html[data-theme] .page-footer{border-top:1px solid var(--line);color:var(--muted)}
html[data-theme] .page-footer a{color:var(--accent-text);font-weight:600}

/* 4. Shared controls ------------------------------------------- */
html[data-theme] .button{border-radius:9px;font-size:12.5px;min-height:42px}
html[data-theme] .button-primary{background:var(--accent-strong);color:#fff}
html[data-theme] .button-primary:hover{background:var(--accent-strong-hover)}
html[data-theme] .button-secondary{background:var(--surface);border-color:var(--line);color:var(--ink)}
html[data-theme] .button-secondary:hover{background:var(--surface-2);border-color:var(--muted)}
html[data-theme] .button-light{background:var(--surface);color:var(--ink);border-color:var(--line)}
html[data-theme] .button-quiet{color:var(--muted)}
html[data-theme] .button-quiet:hover{background:var(--surface-2);color:var(--ink)}
html[data-theme] .text-link,html[data-theme] .text-button{color:var(--accent-text)}
html[data-theme] .back-link{color:var(--muted)}
html[data-theme] .back-link:hover{color:var(--ink)}
html[data-theme] .danger{color:#b03a26}
html[data-theme="dark"] .danger{color:#f0a08b}
html[data-theme] .badge{border-radius:6px;font-weight:600}
html[data-theme] .badge-active{background:var(--accent-soft);color:var(--accent-text)}
html[data-theme] .badge-suspended,html[data-theme] .badge-pending{background:#fdf0d8;color:#8a6118}
html[data-theme] .badge-closed,html[data-theme] .badge-neutral{background:var(--surface-3);color:var(--muted)}
html[data-theme] .badge-beta{background:var(--surface-3);color:var(--muted)}
html[data-theme="dark"] .badge-suspended,html[data-theme="dark"] .badge-pending{background:#3d3524;color:#f0cf9a}
html[data-theme="dark"] .badge-active{color:#f7bfae}
html[data-theme] .messages .message{background:var(--accent-soft);border:1px solid #e8cfc7;color:#8f2f1d}
html[data-theme] .messages .message.error{background:#fdece8;border-color:#f0cec4;color:#a33d26}
html[data-theme] .messages .message.warning{background:#fdf3e2;border-color:#eddfc2;color:#8a6520}
html[data-theme="dark"] .messages .message{background:#3d2b26;border-color:#5a3f36;color:#f6c3b2}
html[data-theme="dark"] .messages .message.error{background:#3d2620;border-color:#5d3a30;color:#f3ab93}
html[data-theme="dark"] .messages .message.warning{background:#38301f;border-color:#57492f;color:#efd39b}

/* 5. Surfaces, panels and forms ------------------------------- */
html[data-theme] .panel,html[data-theme] .project-card,html[data-theme] .auth-panel,
html[data-theme] .form-panel,html[data-theme] .invitation-result,html[data-theme] .platform-compare,
html[data-theme] .settings-summary,html[data-theme] .editorial-compose-panel,
html[data-theme] .editorial-action-panel,html[data-theme] .preview-canvas,
html[data-theme] .compose-tip,html[data-theme] .editorial-margin-note,html[data-theme] .empty-paper,
html[data-theme] .next-step-card,html[data-theme] .flow-paper,html[data-theme] .platform-panel{
  background:var(--surface);border-color:var(--line);color:var(--ink)}
html[data-theme] .panel,html[data-theme] .project-card{border-radius:var(--radius);box-shadow:var(--shadow)}
html[data-theme] .panel-heading{border-color:var(--line)}
html[data-theme] .tiny-label{color:var(--muted)}
html[data-theme] .eyebrow{color:var(--muted)}
html[data-theme] .lead,html[data-theme] .muted{color:var(--muted)}
html[data-theme] .summary-strip,html[data-theme] .desk-summary,html[data-theme] .operator-callout,
html[data-theme] .notice,html[data-theme] .empty-state,html[data-theme] .editorial-overview,
html[data-theme] .editorial-trial,html[data-theme] .editorial-checklist,html[data-theme] .next-step-card{
  background:var(--surface-2);border:1px solid var(--line);color:var(--ink)}
html[data-theme] .summary-strip>div+div,html[data-theme] .desk-summary>div+div,
html[data-theme] .panel-footnote,html[data-theme] .quota-list{border-color:var(--line)}
html[data-theme] .metric-label,html[data-theme] .desk-metric-note,html[data-theme] .event-meta,
html[data-theme] .table-subtitle,html[data-theme] .form-hint,html[data-theme] .helptext,
html[data-theme] .panel-footnote{color:var(--muted)}
html[data-theme] .metric-value,html[data-theme] .metric-text{color:var(--accent-text)}
html[data-theme] .desk-metric-note a,html[data-theme] .table-title:hover{color:var(--accent-text)}
html[data-theme] .empty-state{border-style:dashed}
html[data-theme] .empty-icon{background:var(--surface-3);color:var(--accent-text)}
html[data-theme] .notice-mark{border-color:var(--muted);color:var(--muted)}
html[data-theme] .notice.warning,html[data-theme] .desk-alert{background:#fdf6e6;border-color:#eddfc2;color:#7d6a49}
html[data-theme] .notice.warning p{color:#7d6a49}
html[data-theme="dark"] .notice.warning,html[data-theme="dark"] .desk-alert{background:#38301f;border-color:#57492f;color:#efd39b}
html[data-theme="dark"] .notice.warning p{color:#efd39b}
html[data-theme] .panel-footnote{background:var(--surface-2)}
html[data-theme] th{background:var(--surface-2);color:var(--muted)}
html[data-theme] td{border-top:1px solid var(--line)}
html[data-theme] tbody tr:hover{background:var(--surface-2)}
html[data-theme] .stack-form label,html[data-theme] .field-label{color:var(--ink)}
html[data-theme] .stack-form input:not([type=checkbox]):not([type=hidden]),
html[data-theme] .stack-form select,html[data-theme] .stack-form textarea,
html[data-theme] .copy-field input,html[data-theme] .desk-search input,html[data-theme] .desk-search select,
html[data-theme] .role-form select,html[data-theme] .feedback-form textarea{
  background:var(--field);border:1px solid var(--line);color:var(--ink)}
html[data-theme] .stack-form input::placeholder,html[data-theme] textarea::placeholder{color:var(--muted)}
html[data-theme] .stack-form input[readonly]{background:var(--surface-3);color:var(--muted)}
html[data-theme] .errorlist{background:#fdece8;border-color:#f0cec4;color:#a33d26}
html[data-theme="dark"] .errorlist{background:#3d2620;border-color:#5d3a30;color:#f3ab93}
html[data-theme] .form-footnote{border-top:1px solid var(--line);color:var(--muted)}
html[data-theme] .form-footnote strong{color:var(--ink)}
html[data-theme] .form-aside{color:var(--muted)}
html[data-theme] .form-aside h2,html[data-theme] .form-aside h3{color:var(--ink)}
html[data-theme] .form-actions{border-top:1px solid var(--line)}
html[data-theme] hr{border-top:1px solid var(--line)}

/* 6. Projects, team and settings ------------------------------ */
html[data-theme] .project-monogram{background:var(--accent-soft);color:var(--accent-text)}
html[data-theme] .project-card:hover{border-color:var(--brand)}
html[data-theme] .card-bottom{border-top:1px solid var(--line);color:var(--muted)}
html[data-theme] .card-bottom>span:last-child{color:var(--accent-text)}
html[data-theme] .operator-callout h2{color:var(--ink)}
html[data-theme] .operator-callout p{color:var(--muted)}
html[data-theme] .operator-callout .tiny-label{color:var(--accent-text)}
html[data-theme] .count-label{border:1px solid var(--line);color:var(--muted)}
html[data-theme] .member-row{border-top:1px solid var(--line)}
html[data-theme] .avatar{background:var(--surface-3);color:var(--accent-text)}
html[data-theme] .member-role,html[data-theme] .you-label{color:var(--muted)}
html[data-theme] .you-label{background:var(--surface-3)}
html[data-theme] .feature-check{background:var(--accent-soft);color:var(--accent-text)}
html[data-theme] .feature-off{background:var(--surface-3);color:var(--muted)}
html[data-theme] .quota-list dd{color:var(--ink)}
html[data-theme] .coming-label{border-top:1px solid var(--line);color:var(--muted)}
html[data-theme] .role-guide,html[data-theme] .role-guide h3,html[data-theme] .role-guide dt{color:var(--muted)}
html[data-theme] .section-tabs{border-bottom:1px solid var(--line)}
html[data-theme] .section-tabs a[aria-current=page]{color:var(--accent-text);border-bottom-color:var(--brand)}
html[data-theme] .event{border-top:1px solid var(--line)}
html[data-theme] .event-dot{background:var(--brand)}
html[data-theme] .event-meta>span{color:var(--muted)}

/* 7. Workdesk -------------------------------------------------- */
html[data-theme] .desk-meta{color:var(--muted)}
html[data-theme] .desk-mode{background:var(--surface-2);border:1px solid var(--line);color:var(--muted)}
html[data-theme] .desk-summary{border-radius:var(--radius)}
html[data-theme] .desk-metric-note,html[data-theme] .desk-status,html[data-theme] .desk-note,
html[data-theme] .desk-row-meta,html[data-theme] .desk-row-kind,html[data-theme] .desk-empty-inline,
html[data-theme] .desk-preview-meta,html[data-theme] .desk-schedule-label{color:var(--muted)}
html[data-theme] .desk-list-title{color:var(--muted)}
html[data-theme] .desk-row{border-top:1px solid var(--line);border-left:3px solid transparent}
html[data-theme] .desk-row:hover{background:var(--surface-2)}
html[data-theme] .desk-row.is-selected{background:var(--accent-soft);border-left-color:var(--brand)}
html[data-theme="dark"] .desk-row.is-selected{background:#3a2b27}
html[data-theme] .desk-dot{background:var(--brand)}
html[data-theme] .desk-row{display:flex;gap:11px;align-items:flex-start}
html[data-theme] .desk-row-body{display:grid;gap:3px;min-width:0;flex:1}
html[data-theme] .desk-thumb{flex:0 0 auto;width:42px;height:42px;border-radius:9px;object-fit:cover;background:var(--surface-3);border:1px solid var(--line)}
html[data-theme] .desk-thumb-empty{display:block}
html[data-theme] .desk-schedule-row{border-top:1px solid var(--line)}
html[data-theme] .desk-schedule-row time{color:var(--accent-text)}
html[data-theme] .desk-schedule-row.is-overdue{background:#fdf7ea}
html[data-theme="dark"] .desk-schedule-row.is-overdue{background:#332c1f}
html[data-theme] .desk-preview-meta{border-bottom:1px solid var(--line)}
html[data-theme] .desk-preview-viewer{border-top:1px solid var(--line)}
html[data-theme] .desk-preview-tabs button{background:var(--surface);border:1px solid var(--line);color:var(--muted)}
html[data-theme] .desk-preview-tabs button[aria-selected="true"]{background:var(--accent-soft);border-color:var(--brand);color:var(--accent-text)}
html[data-theme="dark"] .desk-preview-tabs button[aria-selected="true"]{color:#f7bfae}
html[data-theme] .news-platform{color:var(--muted);font-size:10px;font-weight:600}
html[data-theme] .desk-jump{color:var(--accent-text)}

/* 8. Editorial list, compose and feedback --------------------- */
html[data-theme] .news-row{border-top:1px solid var(--line)}
html[data-theme] .news-row:hover{background:var(--surface-2)}
html[data-theme] .news-cover,html[data-theme] .news-icon{background:var(--surface-3);color:var(--accent-text)}
html[data-theme] .news-excerpt,html[data-theme] .news-meta{color:var(--muted)}
html[data-theme] .news-row-arrow{color:var(--accent-text)}
html[data-theme] .editorial-empty,html[data-theme] .feedback-history{border-color:var(--line);background:transparent}
html[data-theme] .empty-paper{background:var(--surface-2)}
/* Editor and flow links follow the brand; platform copy keeps the network's
   own link colour so a Telegram post never reads as an app-branded link. */
html[data-theme] .flow-text a{color:var(--accent-text)}
html[data-theme] .skin-telegram .skin-text a{color:#1072a8}
html[data-theme="dark"] .skin-telegram .skin-text a{color:#7cc4e8}
html[data-theme] .flow-text blockquote{border-left:3px solid var(--line);color:var(--muted)}
html[data-theme] .flow-text code,html[data-theme] .skin-text code{background:var(--surface-3)}
html[data-theme] .editorial-progress .step-current>span,html[data-theme] .compose-mark{background:var(--accent-soft);color:var(--accent-text)}
html[data-theme] .feedback-kind{background:var(--surface-3);color:var(--muted)}
html[data-theme] .editorial-route{background:var(--surface-2);border:1px solid var(--line)}
html[data-theme] .editorial-quota meter::-webkit-meter-optimum-value{background:var(--brand)}
html[data-theme] .editorial-quota meter::-moz-meter-bar{background:var(--brand)}
html[data-theme] .editorial-status-draft,html[data-theme] .editorial-status-review,
html[data-theme] .editorial-status-approved,html[data-theme] .editorial-status-queued,
html[data-theme] .editorial-status-simulated{background:var(--surface-3);color:var(--muted)}
html[data-theme] .editorial-status-review{background:var(--accent-soft);color:var(--accent-text)}
html[data-theme] .editorial-status-approved{background:#e6f0e6;color:#2f6b3f}
html[data-theme="dark"] .editorial-status-approved{background:#28352a;color:#a9d8b4}
html[data-theme] .editorial-status-queued{background:#e8eef7;color:#33548a}
html[data-theme="dark"] .editorial-status-queued{background:#252d3a;color:#a8c3ea}
html[data-theme] .editorial-status-simulated{background:#eef0ea;color:#5c6650}
html[data-theme="dark"] .editorial-status-simulated{background:#2c2f27;color:#c3cbb4}

/* 9. Publication flow and adaptation -------------------------- */
html[data-theme] .flow-heading .flow-context,html[data-theme] .flow-muted{color:var(--muted)}
html[data-theme] .flow-alert{background:#fdf6e6;border:1px solid #eddfc2;color:#7d6a49}
html[data-theme="dark"] .flow-alert{background:#38301f;border-color:#57492f;color:#efd39b}
html[data-theme] .flow-disclosure{border:1px solid var(--line);background:var(--surface)}
html[data-theme] .flow-disclosure>summary{color:var(--ink)}
html[data-theme] .flow-disclosure>summary span{color:var(--muted)}
html[data-theme] .platform-toolbar,html[data-theme] .platform-tab-choice{background:var(--surface);border-color:var(--line)}
html[data-theme] .platform-tab-choice button{color:var(--muted)}
html[data-theme] .platform-tab-choice button[aria-selected=true]{background:var(--accent-soft);color:var(--accent-text)}
html[data-theme] .variant-rich-shell,html[data-theme] .variant-rich-editor,html[data-theme] .variant-fields input,
html[data-theme] .variant-fields textarea{background:var(--field);border-color:var(--line);color:var(--ink)}
html[data-theme] .variant-rich-toolbar button{background:var(--surface-2);border-color:var(--line);color:var(--ink)}
html[data-theme] .variant-preview-note{color:var(--muted)}
html[data-theme] .platform-compare-head h2{color:var(--ink)}
html[data-theme] .platform-compare-note{color:var(--muted)}
html[data-theme] .publish-settings,html[data-theme] .publish-mode{background:var(--surface-2);border-color:var(--line)}
html[data-theme] .publication-result .flow-success-mark{background:var(--accent-soft);color:var(--accent-text)}
html[data-theme] .publication-links{border-top:1px solid var(--line)}
html[data-theme] .flow-schedule input,html[data-theme] .queue-form input{background:var(--field);border-color:var(--line);color:var(--ink)}

/* 10. Calendar and connections -------------------------------- */
html[data-theme] .calendar-grid,html[data-theme] .calendar-shell,html[data-theme] .calendar-panel,
html[data-theme] .selected-date-panel,html[data-theme] .calendar-toolbar,
html[data-theme] .connection-card,html[data-theme] .connection-form{background:var(--surface);border-color:var(--line);color:var(--ink)}
html[data-theme] .calendar-cell,html[data-theme] .calendar-day{background:var(--surface);border-color:var(--line);color:var(--ink)}
html[data-theme] .calendar-cell.is-outside,html[data-theme] .calendar-day.is-outside{background:var(--surface-2);color:var(--muted)}
html[data-theme] .calendar-cell.is-selected,html[data-theme] .calendar-day.is-selected{border-color:var(--brand)}
html[data-theme] .calendar-event,html[data-theme] .calendar-entry{background:var(--accent-soft);color:var(--accent-text)}
html[data-theme] .connection-status,html[data-theme] .connection-meta{color:var(--muted)}

/* 11. Platform skins: keep network colours, follow the theme --- */
html[data-theme] .platform-skin{background:var(--surface);border-color:var(--line)}
html[data-theme] .skin-head{border-bottom:1px solid var(--line)}
html[data-theme] .skin-identity strong{color:var(--ink)}
html[data-theme] .skin-handle{color:var(--muted)}
html[data-theme] .skin-badge{background:var(--surface-2);border-color:var(--line);color:var(--muted)}
html[data-theme] .skin-text{background:transparent;color:var(--ink)}
html[data-theme] .skin-foot{border-top:1px solid var(--line)}
html[data-theme] .skin-actions,html[data-theme] .skin-time{color:var(--muted)}
html[data-theme] .skin-media{background:var(--surface-3)}
html[data-theme] .skin-carousel{background:var(--surface-3)}
html[data-theme] .skin-carousel-button{background:var(--surface);border-color:var(--line);color:var(--ink)}
html[data-theme] .skin-carousel-pos{color:var(--muted)}
html[data-theme] .skin-media-empty{background:var(--surface-2);border-color:var(--line);color:var(--muted)}
html[data-theme] .skin-telegram .skin-avatar{background:#1879ae}
html[data-theme] .skin-vk .skin-avatar{background:#3d70ab}
html[data-theme] .skin-instagram .skin-avatar{background:#c02a5f}
html[data-theme] .skin-telegram{background:#f4fbfe;border-color:#d3e9f4}
html[data-theme] .skin-telegram .skin-text{background:#fff}
html[data-theme="dark"] .skin-telegram{background:#1b2a33;border-color:#2d4753}
html[data-theme="dark"] .skin-telegram .skin-text{background:#152229;color:#eef6fa}
html[data-theme="dark"] .skin-telegram .skin-identity strong{color:#eef6fa}
html[data-theme="dark"] .skin-telegram .skin-handle,html[data-theme="dark"] .skin-telegram .skin-time,
html[data-theme="dark"] .skin-telegram .skin-actions{color:#a9c2cd}
html[data-theme="dark"] .skin-telegram .skin-head,html[data-theme="dark"] .skin-telegram .skin-foot{border-color:#2d4753}
html[data-theme="dark"] .skin-vk{background:#222222;border-color:#3a3a3a}
html[data-theme="dark"] .skin-vk .skin-identity strong{color:#f2f2f2}
html[data-theme="dark"] .skin-vk .skin-handle,html[data-theme="dark"] .skin-vk .skin-time,
html[data-theme="dark"] .skin-vk .skin-actions{color:#b5b5b5}
html[data-theme="dark"] .skin-vk .skin-head,html[data-theme="dark"] .skin-vk .skin-foot{border-color:#3a3a3a}
html[data-theme="dark"] .skin-instagram{background:#1d1a20;border-color:#332e36}
html[data-theme="dark"] .skin-instagram .skin-identity strong{color:#f2eef2}
html[data-theme="dark"] .skin-instagram .skin-handle,html[data-theme="dark"] .skin-instagram .skin-time,
html[data-theme="dark"] .skin-instagram .skin-actions{color:#b3aab6}
html[data-theme="dark"] .skin-instagram .skin-head,html[data-theme="dark"] .skin-instagram .skin-foot{border-color:#332e36}

/* 12. Legacy green accents that live in page stylesheets ------- */
html[data-theme] .material-filters a{background:var(--surface-3);color:var(--muted)}
html[data-theme] .material-filters a[aria-current]{background:var(--accent-strong);color:#fff}
html[data-theme] .material-filters a[aria-current] .filter-count{color:#fff}
html[data-theme] .filter-count{color:var(--muted)}
html[data-theme] .post-images img{background:var(--surface-3)}
html[data-theme] .notice-mark{background:var(--surface)}
html[data-theme] .success-mark{background:var(--accent-soft);color:var(--accent-text)}
html[data-theme] .error-number{color:var(--brand)}
html[data-theme] .invite-mark{background:var(--brand);color:#fff}
html[data-theme] .invitation-recipient{background:var(--surface-2)}
html[data-theme] .form-footnote strong{color:var(--ink)}
html[data-theme] .table-title:hover{color:var(--accent-text)}
html[data-theme] .event-dot{background:var(--brand)}
html[data-theme] .button-light{background:var(--surface);color:var(--ink);border:1px solid var(--line)}
html[data-theme] .compact{background:transparent}
html[data-theme] .news-platform{background:var(--surface-3);color:var(--muted);border:1px solid var(--line)}
html[data-theme] .connection-platform-name,html[data-theme] .connection-address,
html[data-theme] .connection-meta,html[data-theme] .connection-status{color:var(--muted)}

/* 13. Publication flow --------------------------------------- */
html[data-theme] .flow-back{color:var(--muted)}
html[data-theme] .flow-back:hover{color:var(--ink)}
html[data-theme] .flow-mode{color:var(--muted)}
html[data-theme] .flow-steps li{color:var(--muted)}
html[data-theme] .flow-steps li:not(:last-child)::after{background:var(--line)}
html[data-theme] .flow-steps li>span,html[data-theme] .flow-steps li>a>span{border-color:var(--line)}
html[data-theme] .flow-steps .is-current{color:var(--ink)}
html[data-theme] .flow-steps .is-current>span,html[data-theme] .flow-steps .is-current>a>span{background:var(--accent-strong);border-color:var(--accent-strong);color:#fff}
html[data-theme] .flow-steps .is-done>span,html[data-theme] .flow-steps .is-done>a>span{background:var(--accent-soft);border-color:var(--accent-soft);color:var(--accent-text)}
html[data-theme] .flow-text{color:var(--ink)}
html[data-theme] .flow-paper .button-quiet,html[data-theme] .flow-actions .button-quiet{background:transparent;border-color:transparent;color:var(--muted)}
html[data-theme] .flow-feedback-form .button-secondary{background:var(--surface);border-color:var(--line);color:var(--ink)}
html[data-theme] .flow-heading h1{color:var(--ink)}
html[data-theme] .flow-context{color:var(--muted)}
html[data-theme] .flow-metadata dt,html[data-theme] .flow-metadata dd{color:var(--ink)}
html[data-theme] .flow-feedback-item .flow-muted{color:var(--muted)}
html[data-theme] .flow-compose .flow-actions{background:var(--canvas)}
html[data-theme] .platform-toolbar-hint{color:var(--muted)}
html[data-theme] .publish-form,html[data-theme] .publish-inline{background:var(--surface);border-color:var(--line)}
html[data-theme] .publish-settings,html[data-theme] .publish-mode,html[data-theme] .publish-mode legend{color:var(--ink)}
html[data-theme] .publication-result-preview h2,html[data-theme] .publication-links h3{color:var(--ink)}
html[data-theme] .publication-links{background:var(--surface-2);border-top:1px solid var(--line)}
html[data-theme] .publication-links p,html[data-theme] .publication-links li span{color:var(--muted)}
html[data-theme] .publication-links a{color:var(--accent-text)}
html[data-theme] .flow-success-mark{background:var(--accent-soft);color:var(--accent-text)}

/* 14b. News list, sources and connections --------------------- */
html[data-theme] .news-meta>span{color:var(--muted)}
html[data-theme] .news-meta a,html[data-theme] .news-source-link{color:var(--accent-text)}
html[data-theme] .connection-info h3{color:var(--ink)}
html[data-theme] .connection-info small{color:var(--muted)}
html[data-theme] .connection-row{border-color:var(--line)}
html[data-theme] .connection-counter{background:var(--surface-2);border-color:var(--line);color:var(--accent-text)}
html[data-theme] .connection-counter>span{color:var(--muted)}
html[data-theme] .connection-stage{background:var(--surface-2);border-color:var(--line);color:var(--muted)}
html[data-theme] .connection-stage strong{color:var(--ink)}
html[data-theme] .connection-stage p{color:var(--muted)}
html[data-theme] .connection-stage-icon{color:var(--accent-text)}
html[data-theme] .connection-stage-tag{background:var(--surface-3);border:1px solid var(--line);color:var(--muted)}
html[data-theme] .connection-help h3{color:var(--ink)}
html[data-theme] .connection-help p{color:var(--muted)}
html[data-theme] .connection-inactive-control button{background:var(--surface-3);border-color:var(--line);color:var(--muted)}
html[data-theme] .connection-inactive-control span{color:var(--muted)}
html[data-theme] .connection-add summary{background:var(--surface-2)}
html[data-theme] .connection-platform{background:var(--surface-3);color:var(--accent-text)}
html[data-theme] .connection-empty-icon{background:var(--surface-2);border-color:var(--line);color:var(--muted)}
html[data-theme] .source-rules form{background:var(--surface-2)}
html[data-theme] .source-rules input:not([type=checkbox]),html[data-theme] .source-rules select{background:var(--field);border-color:var(--line);color:var(--ink)}
html[data-theme] .next-step-card{background:var(--surface-2);border-color:var(--line)}
html[data-theme] .next-step-card h2{color:var(--ink)}
html[data-theme] .next-step-card p,html[data-theme] .next-step-card .tiny-label{color:var(--muted)}
html[data-theme] .flow-field label span,html[data-theme] .editor-caption,
html[data-theme] .flow-save-note,html[data-theme] .editor-media-count,
html[data-theme] .editor-section-heading h2 span,html[data-theme] .subtle-label{color:var(--muted)}
html[data-theme] .source-access-note{color:var(--muted)}
html[data-theme] .source-access-note strong{color:var(--ink)}
html[data-theme] .material-feedback summary,html[data-theme] .feedback-history>h3{color:var(--muted)}
html[data-theme] .platform-workspace{background:var(--surface);border-color:var(--line)}
html[data-theme] .flow-confirm span{color:var(--ink)}
html[data-theme] .editor-caption .is-over{color:#b03a26}
html[data-theme="dark"] .editor-caption .is-over{color:#f0a08b}

/* 15. Calendar ------------------------------------------------ */
html[data-theme] .calendar-panel{background:var(--surface);border-color:var(--line);box-shadow:var(--shadow)}
html[data-theme] .calendar-weekdays{background:var(--surface-2);border-bottom:1px solid var(--line)}
html[data-theme] .calendar-weekdays>span{color:var(--muted)}
html[data-theme] .calendar-weekdays .weekend{color:var(--muted)}
html[data-theme] .calendar-day{background:var(--surface);border-color:var(--line);color:var(--ink)}
html[data-theme] .calendar-day:hover{background:var(--surface-2)}
html[data-theme] .calendar-day.outside-month,
html[data-theme] .calendar-day.outside-month:hover,
html[data-theme] .calendar-day.unavailable-day:hover{background:var(--surface-3)}
html[data-theme] .calendar-day.selected-day{background:var(--accent-soft);box-shadow:inset 0 0 0 1px var(--brand)}
html[data-theme="dark"] .calendar-day.selected-day{background:#3a2b27}
html[data-theme] .day-number{color:var(--muted)}
html[data-theme] .outside-month .day-number{color:var(--muted);opacity:.55}
html[data-theme] .today-day .day-number{background:var(--accent-strong);color:#fff}
html[data-theme] .day-count{color:var(--muted)}
html[data-theme] .calendar-summary{color:var(--muted)}
html[data-theme] .calendar-summary strong{color:var(--ink)}
html[data-theme] .calendar-summary .calendar-summary-total{color:var(--muted)}
html[data-theme] .month-arrows{border-color:var(--line);background:var(--surface)}
html[data-theme] .month-arrows>*{color:var(--ink)}
html[data-theme] .month-arrows a:hover{background:var(--surface-2)}
html[data-theme] .month-arrows [aria-disabled=true]{color:var(--muted);opacity:.5}
html[data-theme] .calendar-today,html[data-theme] .calendar-zone,
html[data-theme] .calendar-selection-link{color:var(--muted)}
html[data-theme] .calendar-filter select{color:var(--ink);background:var(--field);border-color:var(--line)}
html[data-theme] .calendar-notice{background:var(--surface-2);border-color:var(--line);color:var(--muted)}
html[data-theme] .calendar-notice strong{color:var(--ink)}
html[data-theme] .calendar-scheduler-note{border-left-color:var(--brand);color:var(--muted)}
html[data-theme] .calendar-event{background:var(--accent-soft);border-left-color:var(--brand);color:var(--accent-text)}
html[data-theme] .calendar-more{color:var(--accent-text)}
html[data-theme] .unplanned-title{color:var(--ink)}
html[data-theme] .calendar-popover{background:var(--surface);border-color:var(--line);color:var(--ink);box-shadow:var(--shadow)}
html[data-theme] .calendar-popover small{color:var(--muted)}
html[data-theme] .calendar-popover>span{color:var(--accent-text)}
html[data-theme] .platform-chip{background:var(--surface-3);color:var(--accent-text)}
html[data-theme] .selected-date-panel h2,html[data-theme] .unplanned-panel h2{color:var(--ink)}
html[data-theme] .selected-date-panel .tiny-label,html[data-theme] .unplanned-panel .tiny-label{color:var(--muted)}
html[data-theme] .day-material-time{color:var(--accent-text)}
html[data-theme] .day-material h3,html[data-theme] .unplanned-item h3{color:var(--ink)}
html[data-theme] .day-material-status,html[data-theme] .day-material p,
html[data-theme] .unplanned-status,html[data-theme] .unplanned-count{color:var(--muted)}
html[data-theme] .day-material-open,html[data-theme] .unplanned-action,
html[data-theme] .calendar-empty-add{color:var(--accent-text)}
html[data-theme] .calendar-empty-add>span{border:1px dashed var(--line);background:var(--surface-2);color:var(--accent-text)}
html[data-theme] .calendar-empty-add:hover>span{background:var(--accent-soft);border-color:var(--brand)}
html[data-theme] .calendar-day-empty h3{color:var(--ink)}
html[data-theme] .calendar-day-empty p{color:var(--muted)}
html[data-theme="dark"] .event-review{background:#3a3020;border-color:#6b5a34;color:#efd39b}
html[data-theme="dark"] .event-approved{background:#28352a;border-color:#4a6b4f;color:#b3d9ba}
html[data-theme="dark"] .event-queued{background:#252d3a;border-color:#456079;color:#b6cfe8}
html[data-theme="dark"] .event-blocked{background:#3a2a24;border-color:#6b4a3a;color:#eeb69c}
html[data-theme="dark"] .event-simulated{background:#28332c;border-color:#4a6350;color:#b8d4bf}

/* 14. Reduced-motion and print --------------------------------- */
@media (prefers-reduced-motion:reduce){html[data-theme] .desk-live{transition:none}}
@media (max-width:680px){
  html[data-theme] .topbar{padding-left:16px;padding-right:16px}
  html[data-theme] .topbar-tools{gap:8px;flex:0 0 auto}
  html[data-theme] .topbar-context{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  html[data-theme] .theme-switch button{padding:6px 9px}
  .theme-switch-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
}
@media (max-width:520px){
  html[data-theme] .beta-pill{display:none}
  html[data-theme] .nav-link{font-size:10.5px}
}
