/* Native pan/scroll remains available. Existing drag-handle rules can override
   this zero-specificity default (do not replace it with touch-action:none). */
:where(html[data-mw-touch-fixed], html[data-mw-touch-fixed] *) { touch-action: pan-x pan-y; }
html[data-mw-touch-fixed] body :is(input:not([type=checkbox]):not([type=radio]), textarea, select, [contenteditable=true]),
html[data-mw-touch-fixed] body #root :is(input:not([type=checkbox]):not([type=radio]), textarea, select, [contenteditable=true]) {
  font-size: max(16px, 1em) !important;
}

/* A readable minimum for actual text, including fixed-pixel legacy widgets.
   Inheritance, not repeated multiplication, prevents nested text ballooning. */
html[data-mw-reading-scale] body :where(div, p, span:not(.anticon), a, li, label, legend, td, th, button, input, textarea, select, option, summary, blockquote, strong, em, small) {
  font-size: max(1em, var(--mw-reading-size)) !important;
}
html[data-mw-reading-scale] body :where(h1, h2, h3, h4, h5, h6) { font-size: max(1.2em, var(--mw-reading-size)) !important; }
html[data-mw-reading-scale] :where(p, td, th, label, .ant-alert-message, .ant-alert-description, .ant-modal-title) { overflow-wrap: anywhere; }
html[data-mw-reading-scale] :where(.ant-btn, .ant-tag, .tw-sections button, .tw-subsections button) { height: auto; min-height: 32px; white-space: normal; line-height: 1.4; }
html[data-mw-reading-scale] #root .ant-btn { height: auto !important; min-height: 32px !important; white-space: normal !important; line-height: 1.4 !important; padding-block: 6px !important; }
html[data-mw-reading-scale] .ant-tabs-nav-list { max-width: none; }
html[data-mw-reading-scale] .ant-dropdown-menu-item { height: auto; line-height: 1.4; white-space: normal; }
html[data-mw-reading-scale] .ant-dropdown { max-width: calc(100vw - 16px); }
html[data-mw-reading-scale] .ant-select-selector { height: auto !important; min-height: 34px; }
html[data-mw-reading-scale] .ant-select-single .ant-select-selector .ant-select-selection-item { white-space: normal; line-height: 1.5; }
html[data-mw-reading-scale] .ant-layout-header { min-height: 60px; height: auto; line-height: 1.4; }
html[data-mw-reading-scale] .mw-mobile-bottom-nav { overflow-x: auto; height: auto; min-height: 76px; border-radius: 18px; }
html[data-mw-reading-scale] .mw-mobile-bottom-nav__item { flex: 1 0 auto; min-width: max-content; padding: 6px 12px; }
html[data-mw-reading-scale] .mw-mobile-bottom-nav--labels .mw-mobile-bottom-nav__label { width: auto; }

.mw-reading-dialog { box-sizing: border-box; margin: auto; width: min(460px, calc(100vw - 24px)); max-height: min(85dvh, 700px); overflow: auto; padding: 20px; border: 1px solid #d8e4dc; border-radius: 10px; background: #fff; color: #1e1e30; font: 14px/1.5 'Plus Jakarta Sans', sans-serif; }
.mw-reading-dialog::backdrop { background: #15241d66; }
.mw-reading-dialog h2 { margin: 0 0 8px; font-size: 20px; }
.mw-reading-dialog p { margin: 8px 0 12px; }
.mw-reading-dialog fieldset { border: 0; padding: 0; margin: 14px 0; }
.mw-reading-dialog legend { font-weight: 600; margin-bottom: 8px; }
.mw-reading-dialog fieldset label { display: flex; align-items: center; gap: 10px; padding: 8px 10px; min-height: 40px; border: 1px solid #d8e4dc; border-radius: 6px; margin-bottom: 6px; cursor: pointer; }
.mw-reading-dialog input { accent-color: #47735c; }
.mw-reading-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.mw-reading-actions button { min-height: 40px; padding: 6px 12px; border: 1px solid #c4d5ca; border-radius: 6px; background: #fff; color: #315a44; font: inherit; cursor: pointer; }
.mw-reading-actions button[type=submit] { background: #47735c; color: #fff; }
.mw-reading-dialog :focus-visible { outline: 3px solid #47735c; outline-offset: 2px; }
@media (max-width: 600px) {
  html[data-mw-reading-scale] .ant-form .ant-row > .ant-col { flex: 0 0 100%; max-width: 100%; }
}
@media print { .mw-reading-dialog { display: none !important; } }
