:root {
  color-scheme: light dark;
  --bg: var(--tg-theme-secondary-bg-color, #f2f4f7);
  --surface: var(--tg-theme-bg-color, #ffffff);
  --surface-soft: color-mix(in srgb, var(--surface) 92%, var(--accent));
  --text: var(--tg-theme-text-color, #18222d);
  --muted: var(--tg-theme-hint-color, #6d7883);
  --accent: var(--tg-theme-button-color, #3390ec);
  --accent-text: var(--tg-theme-button-text-color, #ffffff);
  --border: color-mix(in srgb, var(--muted) 22%, transparent);
  --danger: #e85b5b;
  --success: #3aaa67;
  --pro: #b87800;
  --primary: #3390ec;
  --button-link: #1876c6;
  --default-button: #e9edf1;
  --button-link: #1876c6;
  --shadow: 0 10px 30px rgba(30, 51, 71, 0.08);
  --radius-panel: 18px;
  --radius-control: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

:root[data-theme="light"] {
  --bg: #f2f4f7;
  --surface: #ffffff;
  --text: #18222d;
  --muted: #6d7883;
  --accent: #3390ec;
  --accent-text: #ffffff;
  --border: rgba(109, 120, 131, .22);
  --default-button: #e9edf1;
  --shadow: 0 10px 30px rgba(30, 51, 71, .08);
}

:root[data-theme="dark"] {
  --bg: #111820;
  --surface: #19232d;
  --text: #f2f5f7;
  --muted: #98a6b3;
  --accent: #3390ec;
  --accent-text: #ffffff;
  --border: rgba(255, 255, 255, .10);
  --default-button: #273440;
  --button-link: #5aabf4;
  --shadow: 0 10px 30px rgba(0, 0, 0, .16);
}

* { box-sizing: border-box; }
html { max-width: 100%; overflow-x: clip; background: var(--bg); overscroll-behavior: contain; }
body { max-width: 100%; margin: 0; min-width: 0; overflow-x: clip; color: var(--text); background: var(--bg); font-size: 15px; line-height: 1.45; }
body.sheet-open, body.emoji-modal-open, body.guide-open { overflow: hidden; }
.consent-blocker[hidden] { display: none; }
.consent-blocker { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; background: #0f1721; color: #f6f8fb; }
.consent-blocker > div { width: min(430px, 100%); padding: 24px; background: #182431; border: 1px solid #314357; border-radius: 20px; text-align: center; }
.consent-blocker h1 { margin: 8px 0; }
.consent-blocker p { color: #aebccc; }
.consent-blocker button { width: 100%; min-height: 48px; color: #fff; background: #3390ec; border: 0; border-radius: 13px; font-weight: 750; }
button, input, textarea, select { font: inherit; }
button, label { touch-action: manipulation; }
button { color: inherit; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app-header { min-height: 64px; padding: max(8px, env(safe-area-inset-top)) 16px 8px; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 10px; background: color-mix(in srgb, var(--surface) 94%, transparent); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(18px); }
.icon-button { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.icon-button:hover { background: var(--surface-soft); }
.header-title { min-width: 0; display: flex; flex-direction: column; }
.header-title strong { font-size: 16px; letter-spacing: -0.01em; }
.header-title span { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 5px; }
.header-title i { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
.channel-pill { min-width: 44px; min-height: 44px; max-width: 190px; padding: 5px 8px 5px 5px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); cursor: pointer; }
.channel-pill svg { width: 16px; height: 16px; transform: rotate(90deg); color: var(--muted); }
.channel-avatar { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: linear-gradient(145deg, #5db6ff, #287dcc); color: #fff; font-weight: 700; }
.channel-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.channel-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; font-size: 13px; }

.app-shell { width: min(1120px, 100%); min-width: 0; margin: 0 auto; padding: 16px; }
.editor-toolbar { width: min(560px, 100%); margin: 0 auto 8px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: stretch; gap: 8px; }
.editor-mode-label { min-width: 0; min-height: 48px; padding: 7px 11px; display: flex; justify-content: center; flex-direction: column; background: color-mix(in srgb, var(--muted) 9%, transparent); border-radius: 13px; }
.editor-mode-label strong { font-size: 13px; }
.editor-mode-label small { color: var(--muted); font-size: 10px; }
.theme-toggle { width: 48px; height: 48px; flex: 0 0 48px; padding: 0; display: grid; place-items: center; color: var(--text); background: transparent; border: 1px solid transparent; border-radius: 50%; cursor: pointer; transition: background 180ms ease, border-color 180ms ease, opacity 180ms ease; }
.theme-toggle:hover { background: var(--surface-soft); }
.theme-toggle:focus-visible { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 30%, transparent); outline-offset: 2px; }
.theme-toggle:active { opacity: .72; }
.theme-toggle svg { width: 22px; height: 22px; color: var(--accent); }
.language-toggle { width: 44px; height: 48px; padding: 0; display: grid; place-items: center; justify-self: end; color: var(--accent); background: transparent; border: 1px solid var(--border); border-radius: 13px; font-size: 11px; font-weight: 850; letter-spacing: .04em; cursor: pointer; transition: background 180ms ease, border-color 180ms ease, opacity 180ms ease; }
.language-toggle:hover { background: var(--surface-soft); border-color: color-mix(in srgb, var(--accent) 38%, var(--border)); }
.language-toggle:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 2px; }
.language-toggle:active { opacity: .72; }
.onboarding-hint { width: min(560px, 100%); min-height: 62px; margin: -4px auto 16px; padding: 8px 10px; display: flex; align-items: center; gap: 10px; color: var(--text); text-align: left; background: color-mix(in srgb, var(--accent) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); border-radius: 14px; cursor: pointer; transition: background 180ms ease, border-color 180ms ease, opacity 180ms ease; }
.onboarding-hint:hover { background: color-mix(in srgb, var(--accent) 11%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 48%, var(--border)); }
.onboarding-hint:active { opacity: .72; }
.onboarding-hint-icon { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-radius: 11px; }
.onboarding-hint > span:nth-child(2) { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.onboarding-hint strong { font-size: 13px; }
.onboarding-hint small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.onboarding-hint-action { color: var(--accent); font-size: 12px; font-weight: 750; }
.billing-banner { width: 100%; min-width: 0; min-height: 48px; margin: 0; padding: 5px 8px; display: flex; align-items: center; gap: 8px; color: var(--text); text-align: left; background: color-mix(in srgb, var(--pro) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--pro) 42%, var(--border)); border-radius: 13px; cursor: pointer; transition: background 180ms ease, border-color 180ms ease, color 180ms ease; }
.billing-banner[hidden], .admin-entry[hidden] { display: none; }
.billing-banner:hover { background: color-mix(in srgb, var(--pro) 15%, var(--surface)); border-color: color-mix(in srgb, var(--pro) 58%, var(--border)); }
.billing-banner-icon { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; color: var(--pro); background: color-mix(in srgb, var(--pro) 16%, var(--surface)); border-radius: 10px; }
.billing-banner > span:nth-child(2) { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.billing-banner small { color: var(--muted); font-size: 11px; }
.billing-banner > span:last-child { color: var(--pro); font-size: 12px; font-weight: 750; }
.billing-banner.is-active { background: color-mix(in srgb, var(--success) 9%, var(--surface)); border-color: color-mix(in srgb, var(--success) 35%, var(--border)); }
.billing-banner.is-active .billing-banner-icon, .billing-banner.is-active > span:last-child { color: var(--success); }
.billing-banner.is-urgent { background: color-mix(in srgb, #ef7d32 12%, var(--surface)); border-color: color-mix(in srgb, #ef7d32 58%, var(--border)); }
.billing-banner.is-urgent .billing-banner-icon, .billing-banner.is-urgent > span:last-child { color: #d95d13; }
.billing-banner.is-expired { color: #fff; background: #e54848; border-color: #e54848; }
.billing-banner.is-expired .billing-banner-icon { color: #fff; background: rgba(255,255,255,.16); }
.billing-banner.is-expired small, .billing-banner.is-expired > span:last-child { color: #fff; }
.admin-entry { width: min(560px, 100%); min-height: 58px; margin: -4px auto 16px; padding: 7px 10px; display: flex; align-items: center; gap: 10px; color: var(--text); text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; cursor: pointer; }
.admin-entry-icon { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; color: #fff; background: #182b3d; border-radius: 11px; }
.analytics-entry .admin-entry-icon { background: linear-gradient(145deg, var(--accent), #6c6ff7); }
.admin-entry > span:nth-child(2) { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.admin-entry strong { font-size: 13px; }
.admin-entry small { color: var(--muted); font-size: 11px; }
.admin-entry-chevron { width: 18px; height: 18px; color: var(--muted); }

.workspace { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.editor-column { min-width: 0; display: grid; gap: 16px; }
.panel, .preview-panel { min-width: 0; max-width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-panel); box-shadow: var(--shadow); }
.panel { padding: 18px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-heading.compact { margin-bottom: 4px; }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
h1, h2 { margin: 3px 0 0; font-size: 20px; line-height: 1.2; letter-spacing: -0.025em; }
.counter, .count-badge { color: var(--muted); font-size: 12px; }
.counter b { color: var(--text); }
.count-badge { min-width: 28px; height: 28px; display: grid; place-items: center; border-radius: 999px; background: var(--bg); font-weight: 700; }
.section-note { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.field-label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 650; }
textarea, .main-input, .button-field input, .button-field select { width: 100%; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-control); outline: 0; transition: border 160ms ease, box-shadow 160ms ease; }
textarea { min-height: 132px; padding: 13px 14px; line-height: 1.5; resize: vertical; }
textarea:focus, .main-input:focus, .button-field input:focus, .button-field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.main-input { height: 48px; padding: 0 13px; }
.main-input:disabled { color: var(--muted); background: color-mix(in srgb, var(--muted) 8%, var(--surface)); cursor: not-allowed; opacity: .72; }
.field-help { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; }
.schedule-control { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.schedule-panel .schedule-control { margin-top: 0; padding-top: 0; border-top: 0; }
.target-disclosure > summary { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; list-style: none; }
.target-disclosure > summary::-webkit-details-marker { display: none; }
.target-disclosure > summary::after { content: "⌄"; color: var(--muted); font-size: 24px; }
.target-disclosure[open] > summary::after { transform: rotate(180deg); }
.target-disclosure > summary .section-heading { margin-bottom: 0; }
.target-disclosure-fields { padding-top: 14px; }
.schedule-toggle { min-height: 48px; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.schedule-icon { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 38px; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border-radius: 11px; }
.schedule-icon svg { width: 20px; height: 20px; }
.schedule-toggle > span:nth-child(2) { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.schedule-toggle strong { font-size: 13px; }
.schedule-toggle small { color: var(--muted); font-size: 11px; }
.schedule-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.schedule-toggle i { width: 42px; height: 24px; padding: 3px; display: flex; align-items: center; flex: 0 0 42px; border-radius: 999px; background: var(--border); transition: background 160ms ease; }
.schedule-toggle i::after { content: ""; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,.18); transition: transform 160ms ease; }
.schedule-toggle input:checked + i { background: var(--accent); }
.schedule-toggle input:checked + i::after { transform: translateX(18px); }
.schedule-fields { min-width: 0; margin: 10px 0 2px 48px; }
.schedule-fields[hidden] { display: none; }
.schedule-fields .main-input { min-width: 0; max-width: 100%; display: block; }
.schedule-date-time { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.schedule-date-time label { min-width: 0; color: var(--muted); font-size: 11px; font-weight: 650; }
.schedule-date-time label span { display: block; margin-bottom: 5px; }
.schedule-date-time input { font-size: 16px; }
.text-format-toolbar { margin-bottom: 8px; padding: 5px; display: flex; flex-wrap: wrap; gap: 4px; background: color-mix(in srgb, var(--muted) 10%, transparent); border: 1px solid var(--border); border-radius: 12px; }
.text-format-toolbar button { min-width: 44px; min-height: 44px; padding: 0 9px; display: grid; place-items: center; color: var(--text); background: var(--surface); border: 1px solid transparent; border-radius: 9px; cursor: pointer; transition: background 160ms ease, border-color 160ms ease, opacity 160ms ease; }
.text-format-toolbar button.is-active,
.text-format-toolbar button[aria-pressed="true"] { color: var(--accent-text); background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 24%, transparent), inset 0 -2px 0 rgba(0, 0, 0, .12); }
@media (hover: hover) and (pointer: fine) {
  .text-format-toolbar button:hover { background: var(--surface-soft); border-color: var(--border); }
  .text-format-toolbar button.is-active:hover,
  .text-format-toolbar button[aria-pressed="true"]:hover { color: var(--accent-text); background: var(--accent); border-color: var(--accent); }
}
.text-format-toolbar button:active { opacity: .7; }
.text-format-toolbar code { font-size: 12px; }
.text-format-toolbar button svg { width: 18px; height: 18px; }
.text-format-toolbar button.has-label { display: flex; gap: 6px; }
.text-format-toolbar button.has-label span { font-size: 11px; font-weight: 700; }
.rich-format-toolbar { margin-top: 10px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.rich-format-toolbar button { width: 100%; min-width: 0; font-size: 11px; }
.rich-format-toolbar button.has-label { grid-column: span 3; justify-content: center; }
.spoiler-symbol { padding: 2px 4px; color: transparent; background: color-mix(in srgb, var(--muted) 42%, var(--surface)); border-radius: 4px; font-size: 9px; }
.telegram-text-editor { min-height: 148px; padding: 13px 14px; overflow-wrap: anywhere; color: var(--text); white-space: pre-wrap; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-control); outline: 0; font-size: 16px; line-height: 1.5; transition: border 160ms ease, box-shadow 160ms ease; }
.telegram-text-editor:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.telegram-text-editor:empty::before { color: var(--muted); content: attr(data-placeholder); pointer-events: none; }
.telegram-text-editor [data-entity="spoiler"], .preview-content [data-entity="spoiler"] { padding-inline: 2px; color: transparent; background: color-mix(in srgb, var(--muted) 45%, var(--surface)); border-radius: 3px; }
.telegram-text-editor blockquote, .preview-content blockquote { margin: 7px 0; padding: 4px 0 4px 11px; border-left: 3px solid var(--accent); }
.telegram-text-editor blockquote[data-expandable="true"]::after, .preview-content blockquote[data-expandable="true"]::after { content: "…"; margin-left: 5px; color: var(--muted); }
.telegram-text-editor pre, .preview-content pre { margin: 7px 0; padding: 9px 10px; overflow-x: auto; background: var(--bg); border-radius: 8px; font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; }
.telegram-text-editor code, .preview-content code { padding: 1px 4px; background: var(--bg); border-radius: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.telegram-text-editor a, .preview-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.counter.is-over-limit { color: var(--danger); }
.text-link-backdrop { position: fixed; inset: 0; z-index: 94; background: rgba(10, 18, 27, .56); backdrop-filter: blur(3px); }
.text-link-dialog { width: min(440px, calc(100% - 24px)); padding: 18px; position: fixed; left: 50%; top: 50%; z-index: 95; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: 0 24px 72px rgba(10, 25, 40, .34); transform: translate(-50%, -50%); }
.text-link-dialog[hidden], .text-link-backdrop[hidden] { display: none; }
.text-link-dialog-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.text-link-dialog-header > div { min-width: 0; flex: 1; }
.text-link-dialog-header h2 { margin: 2px 0 0; font-size: 20px; }
.text-link-selection { margin: 0 0 14px; padding: 10px 12px; overflow: hidden; color: var(--muted); background: var(--bg); border-radius: 10px; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.text-link-selection strong { color: var(--text); }
.text-link-dialog > label { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 700; }
.text-link-dialog > input { width: 100%; height: 48px; padding: 0 12px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 11px; outline: 0; }
.text-link-dialog > input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.text-link-actions { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.text-link-actions button { min-height: 46px; padding: 0 12px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 11px; font-weight: 750; cursor: pointer; }
#applyTextLink { color: var(--accent-text); background: var(--accent); border-color: var(--accent); }
.rich-field { margin-top: 14px; }
.custom-emoji-delivery-note { min-height: 48px; margin-top: 10px; padding: 9px 10px; display: flex; align-items: flex-start; gap: 9px; color: var(--text); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border)); border-radius: 11px; }
.custom-emoji-delivery-note > svg { width: 18px; height: 18px; margin-top: 1px; flex: 0 0 18px; color: var(--accent); }
.custom-emoji-delivery-note > span { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.custom-emoji-delivery-note strong { font-size: 11px; }
.custom-emoji-delivery-note small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.existing-media-limit-note { min-width: 0; margin: 0 0 14px; padding: 11px 12px; display: flex; align-items: flex-start; gap: 10px; color: var(--text); background: color-mix(in srgb, var(--pro) 11%, var(--surface)); border: 1px solid color-mix(in srgb, var(--pro) 42%, var(--border)); border-radius: 13px; }
.existing-media-limit-note[hidden] { display: none; }
.existing-media-limit-note > svg { width: 20px; height: 20px; margin-top: 1px; flex: 0 0 20px; color: var(--pro); }
.existing-media-limit-note > span { min-width: 0; display: grid; gap: 3px; }
.existing-media-limit-note strong { font-size: 12px; }
.existing-media-limit-note small { color: var(--muted); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.rich-composer-toolbar button:disabled, .rich-tool-menu button:disabled { opacity: .35; cursor: not-allowed; }
.support-entry { width: 100%; min-height: 52px; margin-top: 8px; padding: 7px 9px; display: flex; align-items: center; gap: 9px; color: var(--text); text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; cursor: pointer; transition: background-color 180ms ease, border-color 180ms ease, opacity 180ms ease; touch-action: manipulation; }
.support-entry:hover { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 28%, var(--border)); }
.support-entry:active { opacity: .72; }
.support-entry:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 32%, transparent); outline-offset: 2px; }
.support-entry-icon { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 32px; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border-radius: 9px; }
.support-entry-icon svg { width: 17px; height: 17px; }
.support-entry > span:nth-child(2) { min-width: 0; display: flex; flex: 1; flex-direction: column; gap: 1px; }
.support-entry strong { font-size: 11px; }
.support-entry small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.support-entry-chevron { width: 16px; height: 16px; flex: 0 0 16px; color: var(--muted); }
.sr-only { width: 1px; height: 1px; padding: 0; margin: -1px; position: absolute; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.rich-panel, .rich-composer { min-width: 0; max-width: 100%; }
.rich-composer { width: 100%; overflow: visible; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 1px 3px rgba(22, 43, 63, .06); }
.rich-text-workspace { position: relative; padding-bottom: 12px; background-color: #d9e6e4; background-image: radial-gradient(circle at 12px 12px, rgba(255,255,255,.35) 1px, transparent 1.5px), radial-gradient(circle at 35px 35px, rgba(80,125,122,.08) 1px, transparent 1.5px); background-size: 48px 48px; border-radius: 15px 15px 0 0; }
.rich-composer-toolbar { width: 100%; min-width: 0; min-height: 58px; padding: 6px; display: flex; align-items: center; gap: 4px; position: sticky; top: 64px; z-index: 19; background: color-mix(in srgb, var(--surface) 96%, transparent); border-bottom: 1px solid var(--border); backdrop-filter: blur(18px); }
.rich-tool-strip { min-width: 0; display: flex; flex: 1 1 0; align-items: center; gap: 4px; overflow: visible; scrollbar-width: none; }
.rich-tool-strip::-webkit-scrollbar { display: none; }
.rich-tool-menu-wrap { position: relative; flex: 0 0 44px; }
.rich-toolbar-action { width: 44px; height: 44px; min-width: 44px; padding: 0; display: grid; place-items: center; flex: 0 0 44px; color: var(--text); background: var(--surface-soft); border: 1px solid transparent; border-radius: 50%; cursor: pointer; transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, opacity 180ms ease; }
.rich-toolbar-action svg { width: 20px; height: 20px; }
.rich-toolbar-action:hover { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); border-color: var(--border); }
.rich-toolbar-action:active { opacity: .72; }
.rich-toolbar-action.is-active, .rich-toolbar-action[aria-expanded="true"], .rich-toolbar-action.has-media { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 38%, var(--border)); }
.rich-tool-menu { width: max-content; min-width: 210px; max-width: min(280px, calc(100vw - 24px)); max-height: min(520px, calc(100dvh - 24px)); padding: 6px; display: grid; gap: 1px; overflow-x: hidden; overflow-y: auto; position: absolute; top: calc(100% + 6px); left: 0; z-index: 45; color: var(--text); background: color-mix(in srgb, var(--surface) 96%, transparent); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 16px 44px rgba(8, 20, 32, .28); backdrop-filter: blur(18px); }
.rich-tool-menu-wrap.is-right-aligned .rich-tool-menu { right: 0; left: auto; }
#richMediaMenu { width: 218px; min-width: 0; padding: 8px; }
#richMediaMenu .rich-menu-file { min-height: 54px; padding: 8px; grid-template-columns: 38px minmax(0, 1fr); gap: 10px; background: color-mix(in srgb, var(--accent) 5%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--border)); border-radius: 12px; }
#richMediaMenu .rich-menu-file:hover { background: color-mix(in srgb, var(--accent) 11%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 32%, var(--border)); }
#richMediaMenu .rich-menu-file svg { width: 38px; height: 38px; padding: 9px; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-radius: 10px; }
#richMediaMenu .rich-menu-file span { min-width: 0; overflow: hidden; font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
.rich-composer-toolbar .rich-tool-menu.rich-format-toolbar { margin: 0; grid-template-columns: 1fr; }
.rich-tool-menu[hidden] { display: none; }
.rich-tool-menu-head { min-height: 44px; margin: -6px -6px 4px; padding: 6px 6px 6px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: -6px; z-index: 1; background: color-mix(in srgb, var(--surface) 98%, transparent); border-bottom: 1px solid var(--border); border-radius: 16px 16px 0 0; }
.rich-tool-menu-head strong { font-size: 13px; }
.rich-tool-menu .rich-tool-menu-head button { width: 36px; min-height: 36px; padding: 0; display: grid; grid-template-columns: 1fr; place-items: center; border-radius: 50%; }
.rich-tool-menu .rich-tool-menu-head button svg { width: 18px; height: 18px; }
.rich-tool-menu button, .rich-menu-file { width: 100%; min-height: 44px; padding: 7px 10px; display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: center; gap: 8px; color: var(--text); text-align: left; background: transparent; border: 0; border-radius: 10px; font-size: 13px; font-weight: 700; cursor: pointer; }
.rich-tool-menu button:hover, .rich-menu-file:hover { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.rich-tool-menu button:active, .rich-menu-file:active { opacity: .68; }
.rich-tool-menu button.is-active, .rich-tool-menu button[aria-pressed="true"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 11%, var(--surface)); }
.rich-tool-menu button svg, .rich-menu-file svg { width: 18px; height: 18px; }
.rich-tool-menu hr { width: calc(100% - 16px); height: 1px; margin: 4px 8px; background: var(--border); border: 0; }
.rich-tool-menu .menu-symbol { width: 26px; display: inline-grid; place-items: center; color: var(--muted); font-size: 12px; font-style: normal; font-weight: 750; }
.rich-menu-file { position: relative; }
.rich-menu-file input { width: 1px; height: 1px; position: absolute; overflow: hidden; opacity: 0; pointer-events: none; clip-path: inset(50%); }
.rich-text-heading { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.rich-text-heading .field-label { margin-bottom: 0; }
.rich-quick-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.rich-quick-buttons button { min-height: 52px; padding: 6px 10px; display: flex; align-items: center; justify-content: flex-start; gap: 8px; color: var(--text); text-align: left; background: color-mix(in srgb, var(--accent) 4%, var(--surface)); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 1px 2px rgba(30, 51, 71, .06); cursor: pointer; transition: background-color 180ms ease, border-color 180ms ease, opacity 180ms ease; }
.rich-quick-buttons button:hover { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 32%, var(--border)); }
.rich-quick-buttons button:active { opacity: .72; }
.rich-quick-buttons button:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 22%, transparent); outline-offset: 2px; }
.rich-quick-buttons button > span:last-child { min-width: 0; display: grid; gap: 1px; }
.rich-quick-buttons strong { font-size: 12px; line-height: 1.2; }
.rich-quick-buttons small { overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.rich-quick-icon { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-radius: 9px; }
.rich-quick-buttons button:last-child .rich-quick-icon { color: var(--success); background: color-mix(in srgb, var(--success) 12%, var(--surface)); }
.rich-quick-buttons #addOrdinaryButton { grid-column: 1 / -1; }
.rich-quick-buttons #addOrdinaryButton .rich-quick-icon { color: var(--muted); background: color-mix(in srgb, var(--muted) 12%, var(--surface)); }
.rich-quick-buttons #addRichInlineButton .rich-quick-icon { color: var(--success); background: color-mix(in srgb, var(--success) 12%, var(--surface)); }
.rich-quick-buttons svg { width: 17px; height: 17px; }
.optional-label { color: var(--muted); font-weight: 500; }
.rich-text-editor { width: calc(100% - 24px); max-width: 328.4px; min-height: 176px; margin: 12px auto 0; padding: 13px; box-sizing: border-box; overflow-wrap: anywhere; white-space: pre-wrap; color: #18222d; background: #efffde; border: 0; border-radius: 15px 15px 15px 4px; box-shadow: 0 2px 5px rgba(45, 74, 76, .14); outline: 0; font-size: 16px; line-height: 1.35; }
.rich-text-editor:focus { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 26%, transparent); }
.rich-text-editor:empty::before { color: var(--muted); content: attr(data-placeholder); pointer-events: none; }
.rich-text-editor.is-article-block-only { min-height: 0; }
.rich-text-editor > div:not([contenteditable="false"]) { min-height: 1.35em; }
.rich-text-editor.is-article-block-only .rich-article-block-marker { line-height: 1.25; }
.rich-text-editor [data-rich-format="spoiler"], .preview-content [data-rich-format="spoiler"] { padding-inline: 2px; color: transparent; background: color-mix(in srgb, var(--muted) 45%, var(--surface)); border-radius: 3px; }
.rich-text-editor mark, .preview-content mark { color: inherit; background: color-mix(in srgb, #ffd54a 45%, transparent); border-radius: 3px; }
.rich-text-editor sub, .preview-content sub, .button-rich-text-editor sub { font-size: .72em; line-height: 0; vertical-align: -.3em; }
.rich-text-editor sup, .preview-content sup, .button-rich-text-editor sup { font-size: .72em; line-height: 0; vertical-align: .52em; }
.article-blocks-builder { margin: 8px 0; padding: 9px; background: color-mix(in srgb, var(--accent) 4%, var(--surface)); border: 1px solid var(--border); border-radius: 12px; }
.article-blocks-inline-title { margin-bottom: 7px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; }
.article-blocks-inline-title strong { color: var(--text); font-size: 11px; }
.article-block-palette { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.article-block-palette button { min-height: 38px; padding: 6px 4px; display: flex; align-items: center; justify-content: center; color: var(--text); text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; font-size: 10px; font-weight: 700; cursor: pointer; transition: background 160ms ease, border-color 160ms ease, opacity 160ms ease; }
.article-block-palette button:hover { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 38%, var(--border)); }
.article-block-palette button:active { opacity: .72; }
.article-block-palette strong { font-size: 12px; }
.article-block-palette small { margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.25; }
.article-block-editor { display: none; }
.editor-content-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.editor-content-heading .field-label { margin: 0; }
.editor-content-heading > button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 8px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; cursor: pointer; font-size: 13px; }
.editor-content-heading > button:hover { color: var(--danger); background: var(--surface-soft); }
.editor-content-heading svg { width: 16px; height: 16px; }
.clear-editor-dialog { width: min(420px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 24px; border: 1px solid var(--border); border-radius: 22px; color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
.clear-editor-dialog::backdrop { background: rgba(0, 0, 0, .6); }
.clear-editor-dialog h2 { margin: 16px 0 10px; font-size: 21px; line-height: 1.25; }
.clear-editor-dialog p { margin: 0 0 24px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.clear-editor-icon { width: 44px; height: 44px; display: grid; place-items: center; color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, var(--surface)); border-radius: 13px; }
.clear-editor-actions { display: flex; gap: 10px; }
.clear-editor-actions button { flex: 1; min-height: 46px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft); cursor: pointer; font-weight: 600; }
.clear-editor-actions .clear-editor-confirm { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); background: color-mix(in srgb, var(--danger) 12%, var(--surface)); }
.clear-editor-actions button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.rich-article-block-marker { min-height: 38px; margin: 5px 0; padding: 6px 7px; display: block; color: inherit; white-space: normal; background: rgba(255, 255, 255, .2); border: 1px solid rgba(52, 94, 137, .24); border-radius: 9px; font-size: 11px; cursor: default; }
.rich-article-block-marker::before { content: none; }
.rich-article-block-marker:not(.is-table) { min-height: 52px; padding-right: 94px; position: relative; }
.rich-article-block-marker:not(.is-table) .rich-article-block-head { min-height: 16px; }
.rich-article-block-marker:not(.is-table) .rich-article-block-actions { position: absolute; top: 5px; right: 6px; gap: 4px; }
.rich-article-block-marker:not(.is-table) .rich-article-block-actions button { width: 40px; height: 40px; }
.rich-article-block-marker.is-table { padding: 0; position: relative; background: transparent; border: 0; }
.rich-article-block-marker:is(.is-heading, .is-math) { min-height: 48px; padding-top: 4px; padding-bottom: 4px; }
.rich-article-block-marker:is(.is-heading, .is-math, .is-divider) .rich-article-block-head { display: contents; }
.rich-article-block-marker:is(.is-heading, .is-math, .is-divider) .rich-article-block-head > span:first-child { display: none; }
.rich-article-block-marker:is(.is-heading, .is-math) .rich-article-block-preview { min-height: 38px; display: flex; align-items: center; }
.rich-article-block-marker.is-heading .rich-article-block-preview > * { margin: 0; font-size: 14px; line-height: 1.25; }
.rich-article-block-marker.is-math .rich-preview-math { min-width: 0; margin: 0; padding: 0; border: 0; background: transparent; overflow-wrap: anywhere; }
.rich-article-block-marker.is-divider { min-height: 44px; padding: 0 52px 0 0; background: transparent; border: 0; }
.rich-article-block-marker.is-divider .rich-article-block-preview { min-height: 44px; display: flex; align-items: center; }
.rich-article-block-marker.is-divider .rich-preview-divider { width: 100%; height: 1px; margin: 0; background: var(--muted); }
.rich-article-block-marker.is-divider .rich-article-block-actions { top: 0; right: 0; }
.rich-article-block-marker.is-divider .rich-article-block-actions button { width: 44px; height: 44px; }
.rich-article-block-marker.is-media { min-height: 0; padding: 0; background: transparent; border: 0; }
.rich-media-card { min-height: 74px; padding: 8px; display: grid; grid-template-columns: 68px minmax(0, 1fr) 44px; align-items: center; gap: 9px; color: var(--text); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border)); border-radius: 12px; }
.rich-media-card img, .rich-media-card video { width: 68px; max-width: 100%; height: 56px; object-fit: cover; border-radius: 8px; }
.rich-media-card:has(audio) { grid-template-columns: minmax(0, 1fr) 44px; }
.rich-media-card audio { width: 100%; max-width: none; grid-column: 1 / -1; }
.rich-media-card:has(audio) .rich-media-card-name { grid-column: 1; }
.rich-media-card:has(audio) > .is-danger { grid-column: 2; }
.rich-media-card-name { min-width: 0; overflow: hidden; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.rich-media-size { grid-column: 1 / -1; min-width: 0; display: grid; gap: 6px; font-size: 12px; }
.rich-media-size select { width: 100%; min-width: 0; height: 44px; padding: 0 10px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; font-size: 16px; }
.rich-media-size small { color: var(--muted); font-size: 11px; }
.rich-media-spoiler { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 13px; cursor: pointer; }
.rich-media-spoiler input { width: 20px; height: 20px; accent-color: var(--accent); }
.rich-preview-media.is-spoiler { filter: blur(14px); }
.rich-media-card-name .rich-media-reselect { margin-top: 5px; padding: 0; display: block; color: var(--accent); background: transparent; border: 0; cursor: pointer; font: inherit; font-size: 11px; text-decoration: underline; }
.rich-media-card > .is-danger { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; color: var(--danger); background: transparent; border: 0; border-radius: 9px; cursor: pointer; }
.rich-media-card > .is-danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.rich-media-card button svg { width: 17px; height: 17px; }
.rich-media-missing { color: var(--danger); font-size: 12px; line-height: 1.25; }
@media (pointer: fine) {
  .rich-article-block-marker.is-divider { min-height: 28px; padding-right: 36px; }
  .rich-article-block-marker.is-divider .rich-article-block-preview { min-height: 28px; }
  .rich-article-block-marker.is-divider .rich-article-block-actions button { width: 28px; height: 28px; border-radius: 6px; }
  .rich-article-block-marker.is-divider .rich-article-block-actions svg { width: 14px; height: 14px; }
}
.rich-article-block-marker.is-table .rich-article-block-head { padding-inline: 1px; }
.rich-article-block-head { min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rich-article-block-head > span:first-child { min-width: 0; display: flex; align-items: baseline; gap: 5px; }
.rich-article-block-head small { color: var(--muted); font-size: 10px; font-weight: 600; }
.rich-article-block-head strong { color: var(--accent); font-size: 11px; font-weight: 750; }
.rich-article-block-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.rich-article-block-actions button { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; color: var(--accent); background: var(--surface); border: 1px solid var(--border); border-radius: 9px; font-size: 15px; font-weight: 800; cursor: pointer; transition: background 160ms ease, border-color 160ms ease, opacity 160ms ease; }
.rich-article-block-actions button:active { opacity: .68; }
.rich-article-block-actions button.is-danger { color: var(--danger); background: color-mix(in srgb, var(--danger) 5%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 24%, var(--border)); }
.rich-article-block-actions svg { width: 17px; height: 17px; }
.rich-article-block-actions [data-inline-block-settings] svg { transition: transform 180ms ease; }
.rich-article-block-actions [data-inline-block-settings].is-open svg { transform: rotate(90deg); }
.rich-block-inline-settings { margin-top: 7px; padding-top: 10px; border-top: 1px solid var(--border); }
.rich-block-inline-settings[hidden] { display: none; }
.rich-article-block-preview { font-size: 14px; line-height: 1.25; }
.rich-article-block-preview > .rich-preview-block:first-child { margin-top: 0; }
.rich-article-block-preview > .rich-preview-block:last-child { margin-bottom: 0; }
.rich-table-canvas { position: relative; min-width: 100%; }
.rich-table-inline-grid table { width: 100%; table-layout: fixed; }
.rich-table-inline-grid { border-color: rgba(52, 94, 137, .42); }
.rich-table-inline-grid td { padding: 0; border-color: rgba(52, 94, 137, .42); }
.rich-table-inline-grid tr:first-child td { background: rgba(52, 94, 137, .08); }
.rich-table-inline-grid input { min-height: 100%; padding: 10px 5px; font-size: 16px; font-weight: inherit; line-height: 1.35; }
.rich-table-inline-grid tr:first-child input { font-weight: 800; }
.rich-table-resizer { display: block; position: absolute; z-index: 3; touch-action: none; user-select: none; }
.rich-table-resizer::after { content: ""; display: block; position: absolute; background: color-mix(in srgb, var(--accent) 55%, var(--border)); border-radius: 999px; transition: background 120ms ease, box-shadow 120ms ease; }
.rich-table-resizer.is-column { width: 24px; inset-block: 0; z-index: 4; transform: translateX(-50%); cursor: col-resize; }
.rich-table-resizer.is-column::after { width: 2px; inset-block: 0; left: 11px; }
.rich-table-resizer.is-row { height: 24px; inset-inline: 0; transform: translateY(-50%); cursor: row-resize; }
.rich-table-resizer.is-row::after { height: 2px; inset-inline: 0; top: 11px; }
.rich-table-resizer:hover::after, .rich-table-resizer:focus-visible::after, .rich-table-resizer.is-dragging::after { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
body.is-resizing-column, body.is-resizing-column * { cursor: col-resize !important; }
body.is-resizing-row, body.is-resizing-row * { cursor: row-resize !important; }
.rich-table-popover { width: 100%; margin-top: 8px; padding: 12px; position: relative; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 13px; box-shadow: none; }
.rich-table-popover[hidden] { display: none; }
.rich-table-popover > strong { display: block; margin-bottom: 9px; font-size: 11px; }
.rich-table-popover > label { margin-top: 8px; display: grid; gap: 5px; color: var(--muted); font-size: 10px; }
.rich-table-popover > label span { display: grid; grid-template-columns: minmax(0, 1fr) 52px; align-items: center; gap: 8px; }
.rich-table-popover input[type="range"] { width: 100%; accent-color: var(--accent); }
.rich-table-popover output { color: var(--text); text-align: right; font-size: 10px; }
.rich-table-popover-actions { margin-top: 11px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.rich-table-popover-actions button, .rich-table-remove { min-height: 38px; padding: 6px 8px; color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border)); border-radius: 8px; font-size: 10px; font-weight: 750; cursor: pointer; }
.rich-table-popover-actions button:disabled { opacity: .4; cursor: default; }
.rich-table-popover small { margin-top: 8px; display: block; color: var(--muted); font-size: 9px; line-height: 1.35; }
.article-block-card { padding: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 13px; }
.article-block-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.article-block-card-head strong { flex: 1; font-size: 13px; }
.article-block-card-head button { width: 44px; height: 44px; display: grid; place-items: center; color: var(--danger); background: transparent; border: 0; border-radius: 9px; cursor: pointer; }
.article-block-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.article-block-field { min-width: 0; display: grid; gap: 5px; }
.article-block-field.is-wide { grid-column: 1 / -1; }
.article-block-field label { font-size: 11px; font-weight: 700; }
.article-block-field input, .article-block-field select, .article-block-field textarea { width: 100%; min-width: 0; padding: 9px 10px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 9px; }
.article-block-field input, .article-block-field select { min-height: 44px; }
.article-block-field textarea { min-height: 88px; }
.article-block-checks { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 12px; }
.article-block-checks label { min-height: 44px; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.article-table-grid { max-width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.article-table-grid table { width: 100%; min-width: 280px; border-collapse: collapse; }
.article-table-grid td { min-width: 118px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.article-table-grid tr:last-child td { border-bottom: 0; }
.article-table-grid td:last-child { border-right: 0; }
.article-table-grid input { width: 100%; min-height: 44px; padding: 8px 10px; color: var(--text); background: transparent; border: 0; border-radius: 0; outline: 0; }
.article-table-grid input:focus { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent); }
.article-table-tools { margin-top: 7px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.article-table-tools button { min-height: 38px; padding: 5px 8px; color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border)); border-radius: 8px; font-size: 10px; font-weight: 700; cursor: pointer; }
.article-table-tools button:disabled { opacity: .4; cursor: default; }
.rich-preview-block { margin: 8px 0; }
.rich-preview-divider { height: 2px; margin: 10px 2px; background: rgba(24, 34, 45, .28); border-radius: 999px; }
.rich-preview-table { width: 100%; overflow: hidden; border-radius: 9px; }
.rich-preview-table table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 16px; line-height: 1.35; }
.rich-preview-table td, .rich-preview-table th { min-width: 0; padding: 10px 5px; overflow-wrap: anywhere; word-break: normal; text-align: left; vertical-align: middle; }
.rich-preview-table th { font-weight: 800; }
.rich-preview-table.is-bordered { border: 1px solid rgba(52, 94, 137, .42); }
.rich-preview-table.is-bordered td, .rich-preview-table.is-bordered th { border: 1px solid rgba(52, 94, 137, .42); }
.rich-preview-table.is-bordered th { background: rgba(52, 94, 137, .08); }
.rich-preview-table.is-striped tr:nth-child(even) { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.rich-preview-table.is-compact td, .rich-preview-table.is-compact th { padding: 7px 8px; }
.rich-preview-table caption { padding: 0 0 5px; color: var(--muted); text-align: left; font-size: 10px; }
.rich-preview-list { margin: 7px 0; padding-left: 22px; font-size: 12px; }
.rich-preview-details { padding: 8px 10px; background: var(--bg); border-radius: 8px; font-size: 12px; }
.rich-preview-quote { padding: 5px 9px; border-left: 3px solid var(--accent); font-size: 12px; }
.rich-preview-math { padding: 8px; overflow-x: auto; background: var(--bg); border-radius: 8px; font: 12px ui-monospace, monospace; }
.rich-preview-media, .rich-preview-block video { width: 100%; max-width: 100%; max-height: 230px; object-fit: cover; border-radius: 9px; }
.rich-button-anchor { min-height: 28px; margin: 5px 2px; padding: 4px 9px; display: inline-flex; align-items: center; color: var(--accent); background: color-mix(in srgb, var(--accent) 11%, var(--surface)); border: 1px dashed color-mix(in srgb, var(--accent) 55%, var(--border)); border-radius: 8px; font-size: 11px; font-weight: 750; white-space: nowrap; }
.rich-inline-button-marker { min-height: 30px; margin: 0 3px; padding: 4px 10px; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; color: #293743; background: #e4e9ed; border-radius: 9px; font-size: 14px; font-weight: 750; line-height: 1.25; white-space: nowrap; }
.rich-inline-button-marker.primary { color: #fff; background: #3390ec; }
.rich-inline-button-marker.success { color: #fff; background: #35a866; }
.rich-inline-button-marker.danger { color: #fff; background: #df5959; }
.custom-emoji-inline { display: inline-block; width: 1.35em; height: 1.35em; vertical-align: -.28em; white-space: nowrap; }
.custom-emoji-inline img { display: block; width: 100%; height: 100%; object-fit: contain; }
.custom-emoji-preview { width: 1.35em; height: 1.35em; object-fit: contain; vertical-align: -.28em; }
.emoji-picker-toggle { width: 100%; min-height: 44px; margin-top: 8px; padding: 0 12px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); border-radius: 11px; font-weight: 700; cursor: pointer; }
.emoji-picker-toggle svg { width: 20px; height: 20px; }
.emoji-modal-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(12, 20, 28, .52); backdrop-filter: blur(3px); }
.emoji-picker { width: min(560px, calc(100% - 24px)); max-height: min(720px, calc(100dvh - 24px)); padding: 16px; display: flex; flex-direction: column; overflow: hidden; position: fixed; left: 50%; bottom: 12px; z-index: 91; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: 0 24px 70px rgba(10, 22, 34, .32); transform: translateX(-50%); }
.emoji-picker[hidden], .emoji-modal-backdrop[hidden] { display: none; }
.emoji-modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 12px; }
.emoji-modal-header h2 { margin-top: 2px; font-size: 20px; }
.emoji-modal-header .icon-button { flex: 0 0 44px; background: var(--bg); }
.emoji-target-status { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.emoji-target-status strong { color: var(--text); }
.emoji-categories { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding-bottom: 8px; }
.emoji-categories button { width: 100%; min-width: 0; min-height: 36px; padding: 0 8px; overflow: hidden; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.emoji-categories button[aria-selected="true"] { color: var(--accent-text); background: var(--accent); border-color: var(--accent); }
.emoji-grid { min-height: 140px; max-height: min(400px, 48dvh); flex: 1 1 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); align-content: start; gap: 7px; overflow-y: scroll; padding: 2px 6px 2px 2px; overscroll-behavior: contain; scrollbar-color: color-mix(in srgb, var(--muted) 55%, transparent) transparent; scrollbar-width: thin; scrollbar-gutter: stable; touch-action: pan-y; }
.emoji-grid::-webkit-scrollbar { width: 8px; }
.emoji-grid::-webkit-scrollbar-track { background: transparent; }
.emoji-grid::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 55%, transparent); border: 2px solid var(--surface); border-radius: 999px; }
.emoji-choice-wrap { min-width: 0; height: 50px; position: relative; display: block; }
.emoji-grid .emoji-choice-main { width: 100%; min-width: 44px; height: 50px; padding: 0; display: grid; place-items: center; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; font-size: 24px; cursor: pointer; touch-action: manipulation; }
.emoji-grid .emoji-choice-main:active { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.emoji-grid .emoji-favorite-toggle { width: 26px; height: 26px; padding: 0; position: absolute; top: 1px; right: 1px; display: grid; place-items: center; color: var(--muted); background: color-mix(in srgb, var(--surface) 86%, transparent); border: 0; border-radius: 8px; cursor: pointer; }
.emoji-grid .emoji-favorite-toggle[aria-pressed="true"] { color: var(--pro); }
.emoji-grid .emoji-favorite-toggle svg { width: 14px; height: 14px; }
.emoji-empty { grid-column: 1 / -1; margin: auto; padding: 24px; color: var(--muted); font-size: 12px; line-height: 1.45; text-align: center; }
.emoji-grid img { width: 34px; height: 34px; object-fit: contain; }
.emoji-tools { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 10px; }
.emoji-tools button { min-height: 44px; padding: 0 12px; display: flex; align-items: center; justify-content: center; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; font-size: 12px; font-weight: 650; cursor: pointer; }
.emoji-tools button:last-child { width: 44px; padding: 0; }
.emoji-tools svg { width: 19px; height: 19px; }
.emoji-modal-footer { margin-top: 12px; padding-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--border); }
.emoji-modal-footer span { color: var(--muted); font-size: 12px; font-weight: 650; }
.emoji-modal-footer > div { min-width: 0; display: grid; gap: 3px; }
.emoji-modal-footer .emoji-sync-status { font-size: 10px; font-weight: 500; line-height: 1.3; }
.emoji-modal-footer button { min-width: 132px; min-height: 46px; padding: 0 18px; color: var(--accent-text); background: var(--accent); border: 0; border-radius: 12px; font-weight: 750; cursor: pointer; }
.rich-preview-title { display: block; margin: 4px 5px 8px; font-size: 18px; line-height: 1.2; }
.rich-preview-art { display: block; margin: 8px 5px; overflow-x: auto; white-space: pre; color: #18222d; font-size: 13px; line-height: 1.25; }
.media-picker { min-height: 70px; margin-top: 12px; padding: 11px; display: flex; align-items: center; gap: 11px; border: 1px dashed color-mix(in srgb, var(--accent) 42%, var(--border)); border-radius: 14px; background: color-mix(in srgb, var(--accent) 5%, var(--surface)); cursor: pointer; }
.rich-media-picker { margin: 12px 0 0; }
.rich-existing-media-control { margin: 10px 0 0; min-height: 54px; padding: 9px 11px; display: grid; grid-template-columns: 36px minmax(0, 1fr) 20px; align-items: center; gap: 10px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; cursor: pointer; }
.rich-existing-media-control[hidden] { display: none; }
.rich-existing-media-control:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.rich-existing-media-control span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.rich-existing-media-control strong { font-size: 13px; line-height: 1.25; }
.rich-existing-media-control small { color: var(--muted); font-size: 11px; line-height: 1.25; }
.rich-existing-media-icon { width: 36px; height: 36px; display: grid; place-items: center; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 10px; }
.rich-existing-media-icon svg, .rich-existing-media-chevron { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.rich-existing-media-chevron { color: var(--muted); transform: rotate(-90deg); }
.media-picker input { position: absolute; opacity: 0; pointer-events: none; }
.media-icon { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 44px; color: var(--accent); background: color-mix(in srgb, var(--accent) 13%, var(--surface)); border-radius: 12px; }
.media-picker > span:nth-of-type(2) { min-width: 0; display: flex; flex-direction: column; }
.media-picker strong { font-size: 13px; }
.media-picker small { color: var(--muted); font-size: 11px; }
.media-action { margin-left: auto; color: var(--accent); font-size: 12px; font-weight: 700; }

.button-editor-list { display: grid; gap: 12px; }
.button-card { padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: color-mix(in srgb, var(--bg) 45%, var(--surface)); }
.button-card.is-rich { padding: 8px 10px; }
.button-card.is-rich .button-card-head { min-height: 32px; }
.button-card.is-rich .button-fields, .button-card.is-rich .button-meta-grid { gap: 7px; }
.button-card.is-rich .access-rule-grid { gap: 7px; padding-top: 7px; }
.button-card-head { min-height: 36px; display: flex; align-items: center; gap: 8px; }
.grip { width: 30px; height: 30px; display: grid; place-items: center; color: var(--muted); cursor: grab; }
.button-card-title { flex: 1; font-size: 13px; font-weight: 700; }
.button-kind-badge { padding: 3px 7px; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border)); border-radius: 999px; font-size: 9px; font-weight: 800; letter-spacing: .02em; }
.button-kind-badge.is-ordinary { color: var(--muted); background: var(--surface); border-color: var(--border); }
.remove-button { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.remove-button:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 9%, transparent); }
.button-fields { display: grid; gap: 10px; }
.button-field label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 11px; font-weight: 650; }
.button-field input, .button-field select { height: 44px; padding: 0 11px; font-size: 13px; }
.emoji-input-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 8px; position: relative; }
.button-rich-text-editor { width: 100%; min-width: 0; max-width: 100%; height: 44px; min-height: 44px; max-height: 44px; padding: 9px 11px; contain: paint; overflow-x: auto; overflow-y: hidden; color: var(--text); caret-color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-control); font-size: 13px; line-height: 24px; white-space: nowrap; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.button-rich-text-editor::-webkit-scrollbar { display: none; }
.button-rich-text-editor:empty::before { color: var(--muted); content: attr(data-placeholder); pointer-events: none; }
.button-rich-text-editor:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); outline: 0; }
.button-rich-text-editor .custom-emoji-inline { width: 1.8em; height: 1.8em; display: inline-block; vertical-align: -.48em; }
.button-rich-text-editor .custom-emoji-inline img { display: block; }
.button-caret-proxy { display: none; width: 2px; height: 22px; position: absolute; z-index: 2; pointer-events: none; background: var(--text); border-radius: 2px; animation: button-caret-blink 1s steps(1, end) infinite; }
.button-caret-proxy.is-hidden { visibility: hidden; }
@keyframes button-caret-blink { 50% { opacity: 0; } }
.custom-emoji-channel-warning { margin: -2px 0 12px; padding: 10px 11px; overflow-wrap: anywhere; color: #8a5a00; background: #fff4d6; border: 1px solid #f1cc74; border-radius: 11px; font-size: 11px; line-height: 1.4; }
.custom-emoji-channel-warning strong { color: inherit; }
.button-emoji-trigger { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; color: var(--accent); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.button-emoji-trigger svg { width: 20px; height: 20px; }
.button-emoji-trigger img { width: 34px; height: 34px; object-fit: contain; }
.button-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.button-meta-grid.is-single { grid-template-columns: 1fr; }
.access-rule-grid { display: grid; gap: 10px; padding-top: 10px; grid-column: 1 / -1; border-top: 1px solid var(--border); }
.tracking-setting { position: relative; }
.tracking-toggle { min-height: 52px; padding: 8px 10px; display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; cursor: pointer; }
.tracking-toggle input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.tracking-toggle span { min-width: 0; display: grid; gap: 2px; }
.tracking-toggle strong { font-size: 12px; }
.tracking-toggle small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.tracking-example summary { width: 44px; height: 44px; position: absolute; top: 4px; right: 4px; display: grid; place-items: center; list-style: none; color: var(--muted); font-size: 12px; font-weight: 800; cursor: pointer; }
.tracking-example summary::-webkit-details-marker { display: none; }
.tracking-example summary::before { width: 24px; height: 24px; display: grid; place-items: center; content: "?"; border: 1px solid var(--border); border-radius: 50%; }
.tracking-example[open] summary { color: var(--accent); }
.tracking-example[open] summary::before { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.tracking-example p { margin: 6px 3px 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.tracking-setting .tracking-toggle { padding-right: 48px; }
.access-rule-note { grid-column: 1 / -1; color: var(--muted); font-size: 10px; }
.rich-position-field { grid-column: 1 / -1; }
.rich-position-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.rich-insert-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.rich-insert-actions button { min-height: 44px; padding: 0 12px; color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); border-radius: 10px; font-size: 11px; font-weight: 700; cursor: pointer; }
.rich-insert-actions button[data-action="place-inline"] { color: var(--success); background: color-mix(in srgb, var(--success) 8%, var(--surface)); border-color: color-mix(in srgb, var(--success) 35%, var(--border)); }
.rich-position-field > small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.add-button { width: 100%; min-height: 48px; margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--accent); border: 1px dashed color-mix(in srgb, var(--accent) 48%, var(--border)); border-radius: 13px; background: transparent; font-weight: 700; cursor: pointer; }
.add-button[hidden] { display: none; }
.add-button:disabled { opacity: .45; cursor: not-allowed; }
.button-add-actions { margin-top: 12px; padding-top: 11px; display: grid; grid-template-columns: 1fr; gap: 8px; border-top: 1px solid var(--border); }
.button-add-actions[hidden] { display: none; }
.button-add-actions + .button-editor-list:not(:empty) { margin-top: 12px; }
.ordinary-button-add-heading { min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ordinary-button-add-heading strong { color: var(--text); font-size: 11px; }
.ordinary-button-add-heading small { color: var(--muted); font-size: 9px; }
.button-add-actions button { min-width: 0; min-height: 58px; padding: 8px 10px; display: flex; align-items: center; gap: 8px; color: var(--accent); text-align: left; background: color-mix(in srgb, var(--accent) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); border-radius: 12px; cursor: pointer; transition: background 180ms ease, border-color 180ms ease, opacity 180ms ease; }
.button-add-actions button.is-ordinary { color: var(--text); background: var(--surface); border-color: var(--border); }
.button-add-actions button:active { opacity: .72; }
.button-add-actions svg { width: 20px; height: 20px; flex: 0 0 20px; }
.button-add-actions span { min-width: 0; display: flex; flex-direction: column; }
.button-add-actions strong { font-size: 12px; }
.button-add-actions small { color: var(--muted); font-size: 9px; line-height: 1.25; }
.rich-buttons-slot:empty { display: none; }
.rich-buttons-slot .buttons-panel { padding: 12px; background: color-mix(in srgb, var(--bg) 48%, var(--surface)); border: 0; border-top: 1px solid var(--border); border-radius: 0; box-shadow: none; }
.rich-buttons-slot .buttons-panel .section-heading { min-height: 36px; margin-bottom: 4px; }
.rich-buttons-slot .buttons-panel .section-heading .eyebrow { display: none; }
.rich-buttons-slot .buttons-panel .section-heading h2 { font-size: 14px; }
.rich-buttons-slot .buttons-panel .section-note { margin: 0 0 10px; font-size: 10px; }
.preview-panel { overflow: hidden; }
.preview-heading { min-height: 50px; padding: 0 15px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.preview-heading span { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 750; }
.preview-heading svg { width: 18px; height: 18px; color: var(--accent); }
.preview-heading small { color: var(--muted); font-size: 11px; }
.telegram-stage { width: min(393px, 100%); min-height: 285px; margin-inline: auto; padding: 14px; box-sizing: border-box; overflow: hidden; background-color: #d9e6e4; background-image: radial-gradient(circle at 12px 12px, rgba(255,255,255,.35) 1px, transparent 1.5px), radial-gradient(circle at 35px 35px, rgba(80,125,122,.08) 1px, transparent 1.5px); background-size: 48px 48px; }
.telegram-date { width: max-content; margin: 0 auto 10px; padding: 3px 9px; color: #fff; background: rgba(79, 112, 115, 0.48); border-radius: 999px; font-size: 11px; font-weight: 650; }
.telegram-post { width: 89%; margin-right: auto; padding: 8px; color: #18222d; background: #efffde; border-radius: 15px 15px 15px 4px; box-shadow: 0 2px 5px rgba(45, 74, 76, .14); }
.telegram-author { margin: 0 5px 4px; color: #9a4dcc; font-size: 15px; font-weight: 650; line-height: 1.25; }
.preview-media { min-height: 92px; margin-bottom: 8px; display: grid; place-items: center; align-content: center; gap: 4px; overflow: hidden; color: #6f7f7d; background: linear-gradient(135deg, #dce9e7, #c7dad7); border-radius: 10px; font-size: 11px; }
.preview-media img, .preview-media video { width: 100%; max-height: 210px; object-fit: cover; display: block; }
.preview-voice { min-height: 64px; padding: 9px 10px; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 9px; background: color-mix(in srgb, #3390ec 9%, #efffde); border-radius: 12px; }
.preview-media img + .preview-voice, .preview-media video + .preview-voice { margin-top: 6px; }
.preview-voice audio { display: none; }
.preview-voice-play { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; color: #fff; background: #3390ec; border: 0; border-radius: 50%; font-size: 14px; cursor: pointer; }
.preview-voice-wave { height: 30px; display: flex; align-items: center; gap: 2px; overflow: hidden; }
.preview-voice-wave i { width: 2px; height: var(--wave); flex: 0 0 2px; background: #71aedd; border-radius: 999px; }
.preview-voice small { color: #658392; font-size: 10px; font-variant-numeric: tabular-nums; }
.preview-media:not(.is-empty) { min-height: 0; display: block; }
.preview-media.is-empty { display: none; }
.preview-content { margin: 0 5px 9px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.35; }
.preview-content.is-rich { white-space: normal; }
.rich-preview-paragraph { display: block; margin-bottom: 8px; white-space: pre-wrap; }
.title-formatting { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 14px; }
.title-formatting button { min-height: 44px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); cursor: pointer; font-size: 12px; }
.title-formatting button[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 18%, var(--bg)); border-color: var(--accent); font-weight: 700; }
.title-formatting button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rich-preview-paragraph.is-placeholder { color: #6f7f7d; }
.preview-inline-button { min-height: 30px; margin: 0 3px; padding: 4px 10px; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; color: #293743; background: #e4e9ed; border-radius: 9px; font-size: 14px; font-weight: 750; line-height: 1.25; }
.preview-inline-button.primary { color: #fff; background: #3390ec; }
.preview-inline-button.success { color: #fff; background: #35a866; }
.preview-inline-button.danger { color: #fff; background: #df5959; }
.preview-content .preview-button-row { margin: 5px 0; }
.preview-buttons { display: grid; gap: 4px; }
.preview-button-row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
.preview-button-row:not(.align-stretch) { display: flex; }
.preview-button-row.align-left { justify-content: flex-start; }
.preview-button-row.align-center { justify-content: center; }
.preview-button-row.align-right { justify-content: flex-end; }
.preview-button-row:not(.align-stretch) .preview-button { min-width: 92px; max-width: 100%; }
.preview-button { min-height: 40px; padding: 8px 10px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: #e4e9ed; color: #293743; font-size: 15px; font-weight: 700; line-height: 1.25; text-align: center; }
.preview-buttons .preview-button-row.align-stretch .preview-button:not(.primary):not(.success):not(.danger) { color: var(--button-link); background: transparent; }
.preview-button .custom-emoji-inline { width: 2em; height: 2em; vertical-align: -.55em; }
.preview-button img { width: 100%; height: 100%; object-fit: contain; vertical-align: middle; }
.preview-button.primary { color: #fff; background: #3390ec; }
.preview-button.success { color: #fff; background: #35a866; }
.preview-button.danger { color: #fff; background: #df5959; }
.telegram-post footer { height: 18px; display: flex; align-items: center; justify-content: flex-end; gap: 2px; color: #6a8b72; font-size: 10px; }
.telegram-post footer svg { width: 14px; height: 14px; }

:root[data-theme="dark"] .telegram-stage { background-color: #090b0f; background-image: radial-gradient(circle at 12px 12px, rgba(104, 126, 160, .12) 1px, transparent 1.5px), radial-gradient(circle at 35px 35px, rgba(74, 91, 119, .10) 1px, transparent 1.5px); }
:root[data-theme="dark"] .rich-text-workspace { background-color: #090b0f; background-image: radial-gradient(circle at 12px 12px, rgba(104, 126, 160, .12) 1px, transparent 1.5px), radial-gradient(circle at 35px 35px, rgba(74, 91, 119, .10) 1px, transparent 1.5px); }
:root[data-theme="dark"] .rich-text-editor { color: #f4f5f7; background: #202938; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
:root[data-theme="dark"] .rich-article-block-marker { background: rgba(255, 255, 255, .025); border-color: rgba(91, 126, 190, .42); }
:root[data-theme="dark"] .rich-article-block-marker.is-table { background: transparent; border: 0; }
:root[data-theme="dark"] .rich-table-inline-grid, :root[data-theme="dark"] .rich-table-inline-grid td { border-color: rgba(91, 126, 190, .62); }
:root[data-theme="dark"] .rich-table-inline-grid tr:first-child td { background: rgba(91, 105, 175, .18); }
:root[data-theme="dark"] .telegram-date { background: rgba(68, 68, 76, .82); }
:root[data-theme="dark"] .telegram-post { color: #f4f5f7; background: #202938; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
:root[data-theme="dark"] .telegram-author { color: #c27bea; }
:root[data-theme="dark"] .rich-preview-table.is-bordered { border-color: rgba(91, 126, 190, .62); }
:root[data-theme="dark"] .rich-preview-table.is-bordered td, :root[data-theme="dark"] .rich-preview-table.is-bordered th { border-color: rgba(91, 126, 190, .62); }
:root[data-theme="dark"] .rich-preview-table.is-bordered th { background: rgba(91, 105, 175, .18); }
:root[data-theme="dark"] .telegram-post footer { color: #8299ad; }
:root[data-theme="dark"] .rich-preview-paragraph.is-placeholder { color: #91a0ad; }

.publish-dock { min-height: 76px; margin-top: 16px; padding: 10px max(16px, calc((100vw - 1088px) / 2)) calc(10px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; gap: 16px; background: color-mix(in srgb, var(--surface) 94%, transparent); border-top: 1px solid var(--border); backdrop-filter: blur(18px); }
.validation-status { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.validation-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.publish-actions { min-width: 0; display: flex; align-items: center; gap: 8px; }
.publish-button { min-width: 170px; min-height: 50px; padding: 0 22px; display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--accent-text); background: var(--accent); border: 0; border-radius: 14px; font-weight: 750; cursor: pointer; box-shadow: 0 7px 18px color-mix(in srgb, var(--accent) 28%, transparent); }
.publish-button-secondary { color: var(--accent); background: var(--surface); border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--border)); box-shadow: none; }
.publish-button[hidden] { display: none; }
.publish-button:active { opacity: .82; }
.publish-button:disabled { opacity: .65; cursor: wait; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(17, 26, 35, .24); }
.connect-sheet { width: min(520px, calc(100% - 24px)); max-height: calc(100vh - 24px); overflow-y: auto; padding: 8px 18px calc(20px + env(safe-area-inset-bottom)); position: fixed; left: 50%; bottom: 12px; z-index: 61; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: 0 22px 60px rgba(17, 35, 52, .24); transform: translateX(-50%); }
.sheet-handle { width: 40px; height: 4px; margin: 1px auto 12px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 35%, transparent); }
.sheet-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-heading h2 { font-size: 21px; }
.sheet-note { margin: 10px 0 16px; color: var(--muted); font-size: 13px; }
.connect-guide-button { width: 100%; min-height: 62px; margin: 0 0 12px; padding: 8px 10px; display: flex; align-items: center; gap: 10px; color: var(--text); text-align: left; background: color-mix(in srgb, var(--accent) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border)); border-radius: 13px; cursor: pointer; }
.connect-guide-button > svg:first-child { width: 24px; height: 24px; flex: 0 0 24px; color: var(--accent); }
.connect-guide-button > span { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.connect-guide-button strong { font-size: 13px; }
.connect-guide-button small { margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.connect-guide-button:active { opacity: .72; }
.connect-options { display: grid; gap: 10px; }
.saved-chats { display: grid; gap: 8px; margin-bottom: 12px; }
.saved-label { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.empty-chats { margin: 0; padding: 10px; color: var(--muted); background: var(--bg); border-radius: 12px; font-size: 12px; }
.saved-chat { min-height: 58px; padding: 7px; display: flex; align-items: center; gap: 10px; text-align: left; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 13px; }
.saved-chat > span:nth-child(2) { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.saved-chat small { color: var(--muted); }
.saved-chat > svg { color: var(--success); opacity: 0; }
.saved-chat.is-selected > svg { opacity: 1; }
.favorite-chat { width: 100%; margin-bottom: 8px; }
.refresh-chats { width: 100%; margin: 0 0 10px; padding: 8px; color: var(--accent); background: transparent; border: 1px dashed color-mix(in srgb, var(--accent) 35%, var(--border)); border-radius: 10px; font-size: 12px; font-weight: 700; }
.refresh-chats:disabled { opacity: .55; }
.channel-avatar.favorite { display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #9b7cff, #6752d9); }
.channel-avatar.favorite svg { width: 20px; height: 20px; }
.connect-by-link { margin: 14px 0 0; padding: 12px; background: color-mix(in srgb, var(--accent) 6%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border)); border-radius: 14px; }
.connect-by-link label { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 750; }
.connect-by-link > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.connect-by-link input { min-width: 0; height: 42px; padding: 0 10px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; outline: 0; }
.connect-by-link button { min-height: 42px; padding: 0 12px; color: var(--accent-text); background: var(--accent); border: 0; border-radius: 10px; font-size: 12px; font-weight: 700; }
.connect-by-link small { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; }
.connect-option { width: 100%; min-height: 70px; padding: 10px 12px; display: flex; align-items: center; gap: 12px; color: var(--text); text-align: left; text-decoration: none; background: color-mix(in srgb, var(--bg) 55%, var(--surface)); border: 1px solid var(--border); border-radius: 15px; cursor: pointer; }
.connect-option:active { transform: scale(.99); }
.connect-option:disabled { opacity: .62; cursor: wait; }
.connect-icon { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; color: #fff; border-radius: 13px; }
.connect-icon.channel { background: linear-gradient(145deg, #5db6ff, #287dcc); }
.connect-icon.group { background: linear-gradient(145deg, #54c988, #2d9b61); }
.connect-icon.combined { background: linear-gradient(145deg, #4dadff, #2676d7); }
.connect-option-main { border-color: color-mix(in srgb, var(--accent) 38%, var(--border)); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.connect-option > span:nth-child(2) { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.connect-option strong { font-size: 14px; }
.connect-option small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.option-chevron { width: 17px; height: 17px; color: var(--muted); }
.permissions-note { margin: 8px 2px 0; color: var(--muted); font-size: 11px; }
.guide-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(10, 18, 27, .56); backdrop-filter: blur(3px); }
.onboarding-guide { width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 18px; position: fixed; left: 50%; top: 50%; z-index: 71; overflow-y: auto; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: 0 24px 72px rgba(10, 25, 40, .32); transform: translate(-50%, -50%); }
.guide-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.guide-header h2 { font-size: 21px; }
.guide-progress-row { margin: 16px 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; color: var(--muted); font-size: 11px; font-weight: 700; }
.guide-progress { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
.guide-progress span { height: 4px; background: color-mix(in srgb, var(--muted) 20%, transparent); border-radius: 999px; transition: background 180ms ease; }
.guide-progress span.is-complete { background: var(--accent); }
.guide-card { padding: 18px; background: color-mix(in srgb, var(--bg) 60%, var(--surface)); border: 1px solid var(--border); border-radius: 17px; }
.guide-icon { width: 48px; height: 48px; display: grid; place-items: center; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-radius: 14px; }
.guide-icon svg { width: 25px; height: 25px; }
.guide-card h3 { margin: 14px 0 6px; font-size: 19px; line-height: 1.25; letter-spacing: -.02em; }
.guide-card > p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.guide-steps { margin: 16px 0 0; padding: 0; display: grid; gap: 10px; list-style: none; counter-reset: guide-step; }
.guide-steps li { min-height: 32px; padding-left: 42px; position: relative; color: var(--text); font-size: 14px; line-height: 1.45; counter-increment: guide-step; }
.guide-steps li::before { content: counter(guide-step); width: 28px; height: 28px; display: grid; place-items: center; position: absolute; left: 0; top: -3px; color: var(--accent); background: color-mix(in srgb, var(--accent) 11%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border)); border-radius: 9px; font-size: 12px; font-weight: 800; }
.guide-card .guide-tip { margin-top: 14px; padding: 10px 12px; color: var(--text); background: color-mix(in srgb, var(--success) 9%, var(--surface)); border-left: 3px solid var(--success); border-radius: 9px; font-size: 12px; }
.guide-footer { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.guide-footer > div { display: flex; gap: 8px; }
.guide-footer button { min-height: 44px; padding: 0 16px; border-radius: 12px; font-weight: 700; cursor: pointer; }
.guide-skip { color: var(--muted); background: transparent; border: 0; }
.guide-secondary { color: var(--accent); background: var(--surface); border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--border)); }
.guide-primary { min-width: 110px; color: var(--accent-text); background: var(--accent); border: 1px solid var(--accent); }
.guide-footer button:active { opacity: .72; }
.practical-tour { width: min(340px, calc(100% - 24px)); padding: 14px; position: fixed; z-index: 90; color: var(--text); background: var(--surface); border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--border)); border-radius: 16px; box-shadow: 0 18px 48px rgba(10, 25, 40, .28); }
.practical-tour::before { content: ""; width: 14px; height: 14px; position: absolute; left: var(--tour-arrow-left, 50%); background: var(--surface); border: solid color-mix(in srgb, var(--accent) 38%, var(--border)); transform: translateX(-50%) rotate(45deg); }
.practical-tour.is-below-target::before { top: -8px; border-width: 1px 0 0 1px; }
.practical-tour.is-above-target::before { bottom: -8px; border-width: 0 1px 1px 0; }
.practical-tour.is-complete::before { display: none; }
.practical-tour.is-complete { transform: translate(-50%, -50%); }
.practical-tour-step { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.practical-tour-step button { width: 44px; height: 44px; margin: -10px -8px -6px 0; display: grid; place-items: center; color: var(--muted); background: transparent; border: 0; border-radius: 50%; cursor: pointer; }
.practical-tour-step button svg { width: 18px; height: 18px; }
.practical-tour h3 { margin: 7px 0 5px; font-size: 18px; line-height: 1.25; }
.practical-tour p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.practical-tour-actions { margin-top: 12px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.practical-tour-actions button { min-height: 44px; padding: 0 15px; border-radius: 11px; font-weight: 700; cursor: pointer; }
#skipPracticalTour { color: var(--muted); background: transparent; border: 0; }
#nextPracticalTour { color: var(--accent-text); background: var(--accent); border: 0; }
#nextPracticalTour:disabled { opacity: .45; cursor: default; }
.practical-tour-target { position: relative; z-index: 31; outline: 2px solid color-mix(in srgb, var(--accent) 72%, transparent) !important; outline-offset: 4px; box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 9%, transparent) !important; }
.billing-sheet { z-index: 63; }
html.billing-open { overflow: hidden; }
html.billing-open body { overflow: hidden; }
#billingSheet { max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; }
#billingSheet .billing-features { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
#billingSheet .billing-features li { min-height: 44px; padding: 8px; gap: 6px; }
#billingSheet .billing-features small { display: none; }
#billingSheet .billing-features strong { font-size: 12px; }
#billingSheet .billing-card-plans small { white-space: normal; overflow-wrap: anywhere; }
.billing-success { padding: 18px 4px; text-align: center; }
.billing-success > svg { width: 48px; height: 48px; color: var(--success); }
.billing-success h3 { margin: 12px 0 8px; font-size: 22px; }
.billing-success p { margin: 0 0 20px; color: var(--muted); }
.billing-success .publish-button { width: 100%; }
#billingSuccess[hidden], #billingOffer[hidden] { display: none; }
.billing-features { margin: 0; padding: 0; display: grid; gap: 8px; list-style: none; }
.billing-features li { min-height: 58px; padding: 9px 10px; display: flex; align-items: center; gap: 10px; background: color-mix(in srgb, var(--bg) 48%, var(--surface)); border: 1px solid var(--border); border-radius: 13px; }
.billing-features li > svg { width: 22px; height: 22px; flex: 0 0 22px; color: var(--success); }
.billing-features li > span { display: flex; flex-direction: column; }
.billing-features strong { font-size: 13px; }
.billing-features small { color: var(--muted); font-size: 11px; }
.billing-price { width: 100%; min-height: 58px; margin: 10px 0; padding: 10px 12px; display: flex; align-items: center; justify-content: center; gap: 8px; color: #18222d; background: #f5b51b; border: 0; border-radius: 13px; cursor: pointer; box-shadow: 0 7px 18px color-mix(in srgb, #f5b51b 25%, transparent); transition: background 180ms ease, opacity 180ms ease, transform 180ms ease; }
.billing-price strong { font-size: 24px; letter-spacing: -.03em; white-space: nowrap; }
.billing-price span { color: #3e3320; font-size: 12px; font-weight: 700; }
.billing-price:hover { background: #ffc537; }
.billing-price:active { opacity: .82; transform: scale(.99); }
.billing-price:disabled { opacity: .65; cursor: wait; }
.billing-price[hidden] { display: none; }
.billing-stars-buy { min-height: 50px; color: var(--accent-text); background: var(--accent); border: 0; box-shadow: none; }
.billing-stars-buy strong { font-size: 18px; }
.billing-stars-buy span { color: inherit; }
.billing-stars-buy:hover { background: color-mix(in srgb, var(--accent) 90%, var(--text)); }
.billing-stars-buy:disabled { cursor: not-allowed; }
.billing-method-choice { margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; border: 0; }
.billing-method-choice legend { margin-bottom: 8px; font-size: 13px; font-weight: 750; }
.billing-method-choice label { min-width: 0; cursor: pointer; }
.billing-method-choice input { position: absolute; opacity: 0; pointer-events: none; }
.billing-method-choice label > span { height: 100%; min-height: 68px; padding: 10px; display: flex; flex-direction: column; justify-content: center; gap: 4px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; transition: background 180ms ease, border-color 180ms ease; }
.billing-method-choice strong { font-size: 13px; }
.billing-method-choice small { color: var(--muted); font-size: 11px; }
.billing-method-choice input:checked + span { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border: 2px solid var(--accent); padding: 9px; }
.billing-method-choice input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 2px; }
.billing-agreements { margin: 0 0 10px; display: grid; gap: 8px; }
.billing-agreements[hidden], .billing-card-form[hidden] { display: none; }
.billing-agreements label { min-height: 44px; padding: 8px 10px; display: flex; align-items: flex-start; gap: 9px; color: var(--muted); background: color-mix(in srgb, var(--bg) 48%, var(--surface)); border: 1px solid var(--border); border-radius: 11px; font-size: 11px; cursor: pointer; }
.billing-agreements input { width: 20px; height: 20px; margin: 0; flex: 0 0 20px; accent-color: var(--accent); }
.billing-agreements a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.billing-card-form .billing-buy { width: 100%; margin-top: 8px; }
.billing-card-form { margin-top: 10px; padding: 12px; background: color-mix(in srgb, var(--accent) 6%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--border)); border-radius: 13px; }
.billing-card-form > strong { display: block; font-size: 15px; }
.billing-card-hint { margin: 3px 0 10px; color: var(--muted); font-size: 12px; }
.billing-card-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.billing-card-plans label { min-width: 0; min-height: 58px; cursor: pointer; }
.billing-card-plans input { position: absolute; opacity: 0; pointer-events: none; }
.billing-card-plans span { height: 100%; padding: 8px 5px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; text-align: center; transition: border-color 180ms ease, background 180ms ease, color 180ms ease; }
.billing-card-plans b { color: var(--text); font-size: 12px; }
.billing-card-plans small { margin-top: 2px; font-size: 11px; white-space: nowrap; }
.billing-card-plans input:checked + span { color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); border-color: var(--accent); }
.billing-card-plans input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 2px; }
.billing-card-form .field-label { margin-top: 10px; }
.billing-card-form .main-input { min-height: 44px; }
.billing-legal { margin: 10px 4px 0; color: var(--muted); font-size: 10px; text-align: center; }
.billing-legal code { color: var(--text); }
.support-sheet { z-index: 63; }
.support-sheet:not([hidden]) { display: flex; flex-direction: column; overflow: hidden; }
.support-note { margin-bottom: 10px; }
.support-messages { min-height: 180px; max-height: min(44dvh, 400px); margin: 10px 0; padding: 10px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; overscroll-behavior: contain; background: color-mix(in srgb, var(--bg) 68%, var(--surface)); border: 1px solid var(--border); border-radius: 13px; }
.support-empty { margin: auto; padding: 20px; color: var(--muted); font-size: 12px; text-align: center; }
.support-message { max-width: 86%; padding: 8px 10px; align-self: flex-start; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 12px 12px 12px 4px; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.support-message.is-user { align-self: flex-end; color: var(--accent-text); background: var(--accent); border-color: var(--accent); border-radius: 12px 12px 4px 12px; }
.support-message p { margin: 0; white-space: pre-wrap; }
.support-message time { margin-top: 4px; display: block; color: var(--muted); font-size: 9px; text-align: right; }
.support-message.is-user time { color: color-mix(in srgb, var(--accent-text) 76%, transparent); }
.support-form { flex: 0 0 auto; }
.support-form > label { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 750; }
.support-form > div { display: grid; grid-template-columns: minmax(0, 1fr) 48px; align-items: end; gap: 7px; }
.support-form textarea { width: 100%; min-height: 48px; max-height: 140px; padding: 11px 12px; resize: vertical; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; outline: 0; font: inherit; font-size: 16px; line-height: 1.4; }
.support-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.support-form button { width: 48px; height: 48px; display: grid; place-items: center; color: var(--accent-text); background: var(--accent); border: 0; border-radius: 12px; cursor: pointer; transition: opacity 180ms ease; touch-action: manipulation; }
.support-form button svg { width: 21px; height: 21px; }
.support-form button:active { opacity: .72; }
.support-form button:disabled { opacity: .5; cursor: wait; }
.support-form > small { min-height: 14px; margin-top: 4px; display: block; color: var(--muted); font-size: 10px; }
.toast { min-width: 230px; max-width: calc(100% - 32px); padding: 12px 16px; position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 80; color: #fff; background: rgba(24,34,45,.96); border-radius: 12px; text-align: center; font-size: 13px; opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: opacity 180ms ease, transform 180ms ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.tracked-destination { min-height: 100vh; padding: 32px 22px; display: grid; place-content: center; justify-items: center; text-align: center; }
.tracked-destination h1 { margin-top: 8px; font-size: 25px; }
.tracked-destination p { max-width: 340px; margin: 10px 0 20px; color: var(--muted); }
.tracked-destination button { min-width: 220px; min-height: 50px; color: var(--accent-text); background: var(--accent); border: 0; border-radius: 14px; font-weight: 750; }
.tracked-destination .tracked-secondary { margin-top: 9px; color: var(--accent); background: var(--surface); border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--border)); }
.tracked-icon { width: 58px; height: 58px; margin-bottom: 16px; display: grid; place-items: center; color: #fff; background: var(--success); border-radius: 18px; }
.tracked-icon.subscription { background: var(--accent); font-size: 28px; font-weight: 800; }
.tracked-icon svg { width: 30px; height: 30px; }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }

@media (min-width: 860px) {
  body { padding-bottom: 98px; }
  .app-header { padding-inline: max(24px, calc((100vw - 1120px) / 2)); }
  .app-shell { padding: 24px; }
  .editor-toolbar { margin-left: 0; }
  .onboarding-hint { margin-left: 0; }
  .billing-banner { margin-left: 0; }
  .workspace { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); align-items: start; gap: 24px; }
  .target-panel, .editor-column { grid-column: 1; }
  .preview-panel { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 88px; }
  .publish-dock { margin-top: 0; position: fixed; inset: auto 0 0; z-index: 30; }
  .telegram-stage { min-height: 540px; padding: 18px 14px; }
  .rich-text-editor { width: 324.85px; }
  .button-fields { grid-template-columns: 1fr 1fr; }
  .button-meta-grid { grid-column: 1 / -1; }
  .access-rule-grid { grid-template-columns: 1fr 1fr; }
  .emoji-picker { top: 50%; bottom: auto; transform: translate(-50%, -50%); }
}

@media (max-width: 560px) {
  input, textarea, select, [contenteditable="true"] { font-size: 16px; }
  .app-shell, .workspace, .editor-column, .panel, .rich-composer, .rich-buttons-slot, .buttons-panel, .button-card, .button-fields, .button-field, .emoji-input-row, .button-meta-grid, .access-rule-grid { min-width: 0; max-width: 100%; }
  .channel-name { display: none; }
  .channel-pill { padding-right: 5px; }
  .editor-toolbar { width: calc(100% - 8px); margin-bottom: 8px; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; }
  .editor-mode-label { display: none; }
  .theme-toggle { width: 44px; height: 44px; }
  .language-toggle { height: 44px; border-radius: 12px; }
  .onboarding-hint, .admin-entry { width: calc(100% - 8px); min-height: 44px; margin: 0 auto 8px; padding: 5px 8px; gap: 8px; border-radius: 12px; }
  .billing-banner { min-height: 44px; border-radius: 12px; }
  .onboarding-hint-icon, .billing-banner-icon, .admin-entry-icon { width: 32px; height: 32px; flex-basis: 32px; border-radius: 9px; }
  .onboarding-hint-icon svg, .billing-banner-icon svg, .admin-entry-icon svg { width: 17px; height: 17px; }
  .onboarding-hint strong, .billing-banner strong, .admin-entry strong { font-size: 11px; }
  .onboarding-hint small, .admin-entry small { display: none; }
  .billing-banner small { display: block; overflow: hidden; font-size: 9px; white-space: nowrap; text-overflow: ellipsis; }
  .billing-banner > span:last-child { font-size: 10px; }
  .admin-entry-chevron { width: 15px; height: 15px; }
  .panel { padding: 15px; }
  .schedule-fields { margin-left: 0; }
  .schedule-date-time { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .schedule-date-time label { font-size: 12px; }
  .schedule-date-time .main-input { width: 100%; height: 48px; box-sizing: border-box; -webkit-appearance: none; appearance: none; text-align: left; }
  .schedule-date-time input::-webkit-date-and-time-value { min-height: 1.5em; text-align: left; }
  .rich-tool-strip { width: 100%; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); flex-basis: auto; gap: 4px; overflow: visible; }
  .rich-tool-menu-wrap { width: auto; min-width: 0; }
  .rich-toolbar-action { width: 100%; height: 42px; min-width: 0; }
  .rich-toolbar-action svg { width: 18px; height: 18px; }
  .preview-panel { width: 100%; margin-inline: 0; }
  .telegram-stage { min-height: 0; padding: 12px; }
  .telegram-post { width: 89%; }
  .preview-media { min-height: 64px; }
  .rich-text-heading { align-items: stretch; flex-direction: column; }
  .rich-quick-buttons { width: 100%; }
  .validation-status { display: none; }
  .publish-actions { width: 100%; }
  .publish-button { width: auto; min-width: 0; padding-inline: 10px; flex: 1 1 0; }
  .publish-button span { min-width: 0; overflow-wrap: anywhere; }
  .rich-position-actions { grid-template-columns: 1fr; }
  .rich-insert-actions { grid-template-columns: 1fr; }
  .emoji-picker { width: auto; height: min(520px, calc(100dvh - 16px)); max-height: calc(100dvh - 16px); padding: 12px; inset: auto 8px max(8px, env(safe-area-inset-bottom)); transform: none; border-radius: 18px; }
  .emoji-modal-header { padding-bottom: 8px; }
  .emoji-modal-header h2 { font-size: 17px; }
  .emoji-categories { gap: 5px; padding-bottom: 6px; }
  .emoji-categories button { min-height: 34px; padding-inline: 10px; }
  .emoji-grid { min-height: 0; max-height: none; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
  .emoji-choice-wrap, .emoji-grid .emoji-choice-main { height: 46px; }
  .emoji-tools { padding-top: 8px; }
  .emoji-modal-footer { margin-top: 8px; padding-top: 8px; }
  .button-field input, .button-field select, .button-rich-text-editor { font-size: 16px; }
  @supports (-webkit-touch-callout: none) {
    .button-rich-text-editor { caret-color: transparent; }
    .button-rich-text-editor:focus ~ .button-caret-proxy { display: block; }
  }
  .onboarding-hint-action { display: none; }
  .text-link-dialog { padding: 16px; }
  .article-block-fields { grid-template-columns: 1fr; }
  .article-block-field.is-wide, .article-block-checks { grid-column: 1; }
  .onboarding-guide { width: 100%; max-height: calc(100dvh - 8px); padding: 16px 14px calc(16px + env(safe-area-inset-bottom)); top: auto; bottom: 0; border-radius: 22px 22px 0 0; transform: translateX(-50%); }
  .guide-card { padding: 15px; }
  .guide-footer { align-items: stretch; flex-direction: column-reverse; }
  .guide-footer > div { width: 100%; }
  .guide-footer > div button { flex: 1; }
  .guide-skip { width: 100%; }
  .practical-tour { width: calc(100% - 24px); }
  .billing-sheet { width: 100%; max-height: calc(100dvh - 8px); bottom: 0; border-radius: 22px 22px 0 0; }
  .support-sheet { width: 100%; height: min(680px, calc(100dvh - 8px)); max-height: calc(100dvh - 8px); bottom: 0; border-radius: 22px 22px 0 0; }
  .support-messages { max-height: none; flex: 1 1 auto; }
  .billing-features { gap: 6px; }
  .billing-features li { min-height: 50px; padding-block: 7px; }
  .billing-price { align-items: center; flex-direction: column; gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
  .practical-tour-target { animation: none !important; }
}

/* Emoji picker search */
.emoji-search { min-height: 44px; margin-bottom: 8px; display: flex; align-items: stretch; gap: 6px; }
.emoji-search-field { min-width: 0; flex: 1 1 auto; }
.emoji-search input { width: 100%; height: 44px; padding: 0 12px; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 10px; }
.emoji-search input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.emoji-search button { width: 44px; min-width: 44px; padding: 0; color: var(--muted); background: var(--bg); border: 1px solid var(--border); border-radius: 10px; font-size: 22px; line-height: 1; cursor: pointer; }
.emoji-search button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.emoji-search button[hidden] { display: none; }
