/* Shared, scoped typography for the storefront, preview and editor. */
/* Product-only accordions: explicit editor headings and legacy Requirements. */
.product-description .offer-requirements { margin: 30px 0; background: #1a304e; border: 1px solid #385479; border-radius: 11px; overflow: hidden; }
.product-description .offer-requirements > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; padding: 18px 21px; list-style: none; font-family: var(--font-display); font-size: clamp(18px, 2.5vw, 20px); font-weight: 800; }
.product-description .offer-requirements > summary::-webkit-details-marker { display: none; }
.product-description .offer-requirements > summary .ico { flex-shrink: 0; width: 22px; height: 22px; color: #b5c7df; transition: transform .18s ease; }
.product-description .offer-requirements[open]:not([data-expanded="false"]) > summary .ico { transform: rotate(180deg); }
.product-description .offer-requirements > summary:focus-visible { outline: 2px solid #93c5fd; outline-offset: -4px; border-radius: 10px; }
.product-description .offer-requirements-panel { overflow: hidden; }
.product-description .offer-requirements-content { padding: 0 21px 22px; color: #d5e1f3; line-height: 1.75; }
@media (max-width: 540px) { .product-description .offer-requirements > summary { padding: 15px; } .product-description .offer-requirements-content { padding: 0 15px 16px; } }
@media (prefers-reduced-motion: reduce) { .product-description .offer-requirements > summary .ico { transition: none; } }
.rich-content, .rte .ql-editor { --guide-accent: #2563eb; color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.8; overflow-wrap: anywhere; min-width: 0; }
.rich-content > :first-child, .rte .ql-editor > :first-child { margin-top: 0; }
.rich-content > :last-child { margin-bottom: 0; }
.article .a-toc { max-height: calc(100dvh - 110px); overflow-y: auto; scrollbar-width: thin; }
.rich-content p { margin: 0 0 1.15em; }
.rich-content h2, .rich-content h3, .rich-content h4, .rte .ql-editor h2, .rte .ql-editor h3, .rte .ql-editor h4 { color: var(--guide-accent); font-family: var(--font-display); font-weight: 800; line-height: 1.4; margin: 1.7em 0 .75em; scroll-margin-top: 90px; }
.rich-content h2, .rte .ql-editor h2 { font-size: clamp(22px, 3vw, 29px); border-left: 3px solid var(--guide-accent); padding-left: 12px; }
.rich-content h3, .rte .ql-editor h3 { font-size: clamp(19px, 2.5vw, 23px); }
.rich-content h4, .rte .ql-editor h4 { font-size: 17px; }
.rich-content a, .rte .ql-editor a { color: var(--guide-accent); text-decoration: underline; text-underline-offset: 3px; }
.rich-content ul, .rich-content ol { padding-left: 1.6em; margin: 1em 0; }
.rich-content li { margin: .3em 0; }
.rich-content li::marker { color: var(--guide-accent); }
.rich-content blockquote, .rte .ql-editor blockquote { border-left: 3px solid var(--guide-accent); margin: 1.4em 0; padding: 14px 18px; color: var(--text2); background: rgba(37,99,235,.05); border-radius: 0 8px 8px 0; }
.rich-content hr, .rte .ql-editor hr { border: 0; height: 1px; background: var(--line2); margin: 26px 0; }
.rich-content img, .rte .ql-editor img { max-width: 100%; height: auto; object-fit: contain; vertical-align: middle; border-radius: 8px; }
.a-body.rich-content { font-size: 16px; }
.rich-content pre { max-width: 100%; overflow: auto; padding: 14px; background: var(--bg); border-radius: 8px; }
.rich-content code { background: rgba(255,255,255,.06); padding: 2px 5px; border-radius: 4px; }
.rich-content .ql-align-center { text-align: center; }
.rich-content .ql-align-right { text-align: right; }
.rich-content .rt-callout, .rte .ql-editor .rt-callout { --callout: #74b9ff; position: relative; margin: 18px 0; padding: 14px 18px; border: 1px solid color-mix(in srgb, var(--callout) 30%, transparent); border-left: 3px solid var(--callout); border-radius: 10px; background: color-mix(in srgb, var(--callout) 7%, var(--card)); color: var(--text); }
.rich-content .rt-callout::before, .rte .ql-editor .rt-callout::before { content: 'Важно'; display: block; margin-bottom: 7px; color: var(--callout); font-family: var(--font); font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.rich-content .rt-callout[data-kind="tip"], .rte .ql-editor .rt-callout[data-kind="tip"], .rich-content .rt-callout[data-kind="important"], .rte .ql-editor .rt-callout[data-kind="important"] { --callout: #2563eb; }
.rich-content .rt-callout[data-kind="warning"], .rte .ql-editor .rt-callout[data-kind="warning"] { --callout: #ffd43b; }
.rich-content .rt-callout[data-kind="benefits"], .rte .ql-editor .rt-callout[data-kind="benefits"] { --callout: #60a5fa; }
.rich-content .rt-callout[data-kind="tip"]::before, .rte .ql-editor .rt-callout[data-kind="tip"]::before { content: 'Совет'; }
.rich-content .rt-callout[data-kind="warning"]::before, .rte .ql-editor .rt-callout[data-kind="warning"]::before { content: 'Внимание'; }
.rich-content .rt-callout[data-kind="benefits"]::before, .rte .ql-editor .rt-callout[data-kind="benefits"]::before { content: 'Преимущества'; }
[lang="en"] .rich-content .rt-callout::before { content: 'Important'; }
[lang="en"] .rich-content .rt-callout[data-kind="tip"]::before { content: 'Tip'; }
[lang="en"] .rich-content .rt-callout[data-kind="warning"]::before { content: 'Warning'; }
[lang="en"] .rich-content .rt-callout[data-kind="benefits"]::before { content: 'Benefits'; }
.rich-content .rt-table-wrap { display: block; width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; margin: 22px 0; border: 1px solid var(--line2); border-radius: 10px; background: var(--card); scrollbar-width: thin; scrollbar-color: #3b82f6 var(--card); }
.rich-content table, .rte .ql-editor table { border-collapse: collapse; width: 100%; min-width: 440px; white-space: normal; font-size: 14px; line-height: 1.6; }
.rich-content th, .rich-content td, .rte .ql-editor th, .rte .ql-editor td { padding: 12px 16px; border-bottom: 1px solid var(--line2); border-right: 1px solid var(--line2); text-align: left; vertical-align: top; min-width: 120px; }
.rich-content th, .rte .ql-editor th { color: var(--guide-accent); background: #2563eb0d; font-weight: 800; }
.rich-content tr:last-child td, .rte .ql-editor tr:last-child td { border-bottom: 0; }
.rich-content th:last-child, .rich-content td:last-child { border-right: 0; }
.rich-content tbody tr:nth-child(even) { background: #ffffff02; }
.rich-content caption { padding: 12px 16px; color: var(--text2); text-align: left; font-weight: 700; }
.rich-content .rt-table-wrap:focus-visible { outline: 2px solid var(--guide-accent); outline-offset: 3px; }
.rte .rte-table-embed { max-width: 100%; overflow-x: auto; margin: 16px 0; border: 1px solid var(--line2); border-radius: 8px; cursor: pointer; }
.rte .rte-table-embed::after { content: 'Нажмите, чтобы редактировать таблицу'; display: block; padding: 5px 10px; font-family: var(--font); font-size: 11px; color: var(--muted); }
.rte .rte-table-embed:focus-visible { outline: 2px solid var(--accent); }
.rte .rte-table-dialog { width: min(900px, calc(100% - 24px)); }
.rte [data-editor-table-grid] { max-width: 100%; overflow-x: auto; margin: 12px 0; }
.rte [data-editor-table-grid] [contenteditable="true"]:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--bg); }

/* Give editors an unmistakable visual cue without affecting normal headings. */
.rte[data-editor-accordion="1"] .ql-editor h2[data-accordion-heading="1"],
.rte[data-editor-accordion="1"] .ql-editor h3[data-accordion-heading="1"],
.rte[data-editor-accordion="1"] .ql-editor h4[data-accordion-heading="1"] {
  background: #1a304e; border: 1px solid #385479; border-left: 3px solid #60a5fa;
  padding: 12px 15px; border-radius: 9px; color: #eef5ff;
}
.rte[data-editor-accordion="1"] .ql-editor [data-accordion-heading="1"]::after {
  content: '▾  Accordion'; font: 600 11px var(--font);
  margin-left: 12px; color: #93c5fd; white-space: nowrap;
}
.rte[data-editor-accordion="1"] .ql-editor p[data-accordion-end="1"]::before {
  content: '↳ Завершить Accordion здесь'; display: block; color: #93c5fd;
  font: 600 11px var(--font); margin-bottom: 4px;
}
.rte[data-editor-accordion="1"] [data-rte-action="accordion-heading"] {
  border-color: #385479; color: #c3ddff; background: #1a304e; font-size: 12px;
}
/* The same editor enhances an ordinary named textarea. */
.rte { min-width: 0; width: 100%; margin: 0; }
.rte [hidden] { display: none !important; }
.rte-label { display: block; font-weight: 600; margin-bottom: 7px; }
.rte [data-editor-ui] { border: 1px solid var(--line2); border-radius: 12px; background: #111c30; }
.rte-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px; padding: 10px; border-bottom: 1px solid var(--line2); background: #152239; border-radius: 12px 12px 0 0; }
.rte-group { display: flex; gap: 3px; flex-wrap: wrap; align-items: center; min-height: 36px; }
.rte-toolbar button, .rte-dialog-head button { display: inline-flex; justify-content: center; align-items: center; gap: 5px; width: auto; min-width: 34px; height: 36px; padding: 6px 8px; border: 1px solid transparent; border-radius: 7px; background: rgba(255,255,255,.035); color: var(--text); cursor: pointer; font: inherit; font-size: 14px; }
.rte-toolbar button:hover, .rte-toolbar button[aria-pressed="true"], .rte-dialog-head button:hover { color: var(--accent); border-color: rgba(37,99,235,.3); background: rgba(37,99,235,.09); }
.rte button:focus-visible, .rte-color:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.rte-toolbar .dropdown { min-width: 100px; }
.rte-toolbar .dropdown > .small { font-size: 10px; line-height: 1.2; }
.rte-toolbar .dropdown-trigger { min-height: 36px; max-width: 180px; height: 36px; font-size: 12px; }
.rte-toolbar .dropdown-menu { min-width: 170px; z-index: 35; }
.rte-toolbar .dropdown-option { font-size: 12px; }
.rte-toolbar .rte-swatch { --swatch: #2563eb; width: 23px; min-width: 23px; height: 25px; padding: 0; border: 5px solid #152239; border-radius: 50%; background: var(--swatch); box-shadow: 0 0 0 1px var(--line2); }
.rte-color { display: inline-grid; place-items: center; position: relative; width: 32px; height: 36px; overflow: hidden; margin: 0; border-radius: 6px; background: rgba(255,255,255,.04); font-weight: 800; cursor: pointer; }
.rte-color input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; padding: 0; }
.rte-marker { color: #ffd43b; }
.rte .ql-container.ql-snow { border: 0; font-family: var(--font); }
.rte .ql-editor { min-height: 260px; max-height: 650px; padding: 20px; background: #0c1628; caret-color: var(--accent); }
.rte .ql-editor:focus { outline: 1px solid rgba(37,99,235,.35); outline-offset: -1px; }
.rte .ql-editor.ql-blank::before { color: var(--muted); left: 20px; right: 20px; }
.rte .ql-editor p { margin-bottom: .7em; }
.rte .ql-editor img { cursor: pointer; }
.rte .ql-editor img:hover { outline: 2px solid var(--accent); outline-offset: 3px; }
.rte .ql-snow .ql-tooltip { display: none; }
.rte-status { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; padding: 9px 12px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); }
.rte-help { margin: 0; padding: 0 12px 10px; font-weight: 400; line-height: 1.5; }
.rte-draft { display: grid; gap: 8px; padding: 12px; background: rgba(37,99,235,.07); border-bottom: 1px solid var(--line2); font-size: 12px; }
.rte-dialog, .rte-preview { color: var(--text); background: #152239; border: 1px solid var(--line2); border-radius: 12px; padding: 22px; width: min(540px, calc(100% - 24px)); max-height: calc(100dvh - 32px); overflow: auto; box-shadow: 0 24px 90px #0009; }
.rte-dialog::backdrop, .rte-preview::backdrop { background: rgba(0,0,0,.75); }
.rte-preview { width: min(860px, calc(100% - 24px)); }
.rte-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.rte-dialog-head h3 { margin: 0; font-size: 17px; }
.rte-dialog .dropdown { width: 100%; }
.rte-dialog [data-editor-dialog-status] { margin: 0; }
.rte-preview [data-editor-preview-content] { padding: 6px 0; }
@media (max-width: 720px) {
  .rte-toolbar { gap: 5px; padding: 7px; }
  .rte-toolbar button { min-width: 38px; height: 40px; }
  .rte-toolbar .dropdown-trigger { height: 40px; max-width: 145px; }
  .rte .ql-editor { min-height: 230px; max-height: 55dvh; padding: 14px; font-size: 16px; }
  .rte .ql-editor.ql-blank::before { left: 14px; right: 14px; }
  .rte-dialog, .rte-preview { padding: 16px; }
  .rich-content .rt-callout, .rte .ql-editor .rt-callout { padding: 12px 14px; }
}
