/* Shared shell for declarative tools (calculators, converters, student utilities). */
.dx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .85rem 1rem; }
.dx-field--wide { grid-column: 1 / -1; }
.dx-field[hidden] { display: none !important; }
.dx-field .form-label { font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.dx-field-error { color: var(--bs-danger, #b02a37); font-size: .82rem; min-height: 0; }
.dx-field-error:empty { display: none; }
.dx-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1.1rem; }
.dx-error { margin-top: .9rem; }
.dx-results { margin-top: 1.25rem; padding: 1rem 1.1rem; border-radius: .75rem; background: var(--bs-tertiary-bg, #f6f7f9); }
.dx-primary { display: flex; flex-direction: column; gap: .15rem; margin-bottom: .75rem; }
.dx-primary span { font-size: .85rem; color: var(--bs-secondary-color, #6c757d); }
.dx-primary strong { font-size: 1.6rem; line-height: 1.25; word-break: break-word; }
.dx-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .5rem 1rem; margin: 0 0 .75rem; }
.dx-list dt { font-weight: 500; font-size: .82rem; color: var(--bs-secondary-color, #6c757d); }
.dx-list dd { margin: 0; font-weight: 600; word-break: break-word; }
.dx-table-wrap { max-height: 420px; overflow: auto; margin-top: .5rem; }
.dx-table-title { font-size: .9rem; font-weight: 600; margin: .5rem 0 .35rem; }
.dx-table td, .dx-table th { white-space: nowrap; font-variant-numeric: tabular-nums; }
.dx-input-table td { padding: .2rem; }
.dx-input-table input, .dx-input-table select { min-width: 90px; }
.dx-remove { text-decoration: none; font-size: 1.1rem; line-height: 1; }
.dx-result-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.dx-formula { margin: 1rem 0 0; }
.dx-formula code { white-space: normal; word-break: break-word; }
.dx-keypad { display: grid; grid-template-columns: repeat(6, 1fr); gap: .35rem; margin-bottom: .9rem; max-width: 520px; }
.dx-key { border: 1px solid var(--bs-border-color, #dee2e6); background: var(--bs-body-bg, #fff); border-radius: .5rem; padding: .45rem 0; font-weight: 600; }
.dx-key--accent { background: var(--bs-primary, #0d6efd); color: #fff; border-color: transparent; }
[dir="rtl"] .dx-formula code, [dir="rtl"] .dx-table td { direction: ltr; unicode-bidi: plaintext; }
.dx-code { margin-top: .75rem; }
.dx-code pre, .wc-pre { max-height: 420px; overflow: auto; margin: .4rem 0 0; padding: .75rem .9rem; border-radius: .5rem; background: var(--bs-body-bg, #fff); border: 1px solid var(--bs-border-color, #dee2e6); font-size: .82rem; white-space: pre-wrap; word-break: break-word; }

/* Media shell (Family 04 image / GIF tools) */
.mx-drop { padding: .75rem; border: 2px dashed var(--bs-border-color, #dee2e6); border-radius: .75rem; }
.mx-drop.is-over { border-color: var(--bs-primary, #0d6efd); background: rgba(13, 110, 253, .04); }
.mx-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.mx-pane { margin: 0; }
.mx-pane canvas, .mx-pane img { display: block; max-width: 100%; max-height: 520px; height: auto; border-radius: .5rem;
  background: repeating-conic-gradient(#e9ecef 0% 25%, #fff 0% 50%) 50% / 16px 16px; }
.mx-text { max-height: 520px; overflow: auto; font-size: 7px; line-height: 1; letter-spacing: 0; background: #fff; padding: .5rem; border-radius: .5rem; }
.mx-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; margin-top: 1rem; }
.mx-tile { margin: 0; } .mx-tile canvas { max-width: 100%; height: auto; border-radius: .35rem; background: repeating-conic-gradient(#e9ecef 0% 25%, #fff 0% 50%) 50% / 12px 12px; }
.mx-report { margin-top: 1rem; } .mx-report th { width: 40%; }
.mx-hist { width: 100%; max-width: 512px; height: 140px; background: #111; border-radius: .35rem; }
.mx-swatches { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.mx-swatch { width: 74px; height: 54px; border: 1px solid rgba(0, 0, 0, .1); border-radius: .4rem; display: flex; align-items: flex-end; justify-content: center; padding: 0; }
.mx-swatch span { font-size: .68rem; background: rgba(255, 255, 255, .85); border-radius: .25rem; padding: 0 .25rem; margin-bottom: .2rem; font-family: ui-monospace, monospace; }

/* Web-check shell (Family 03 server checkers) */
.wc-head { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: baseline; justify-content: space-between; margin-bottom: .75rem; }
.wc-target { word-break: break-all; }
.wc-summary { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; margin-bottom: 1rem; }
.wc-score { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 96px; padding: .5rem .75rem; border-radius: .75rem; background: var(--bs-body-bg, #fff); border: 2px solid currentColor; }
.wc-score-value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.wc-score-label { font-size: .75rem; color: var(--bs-secondary-color, #6c757d); text-align: center; }
.wc-score--pass { color: #1a7f37; } .wc-score--warn { color: #9a6700; } .wc-score--fail { color: #b02a37; }
.wc-counts { display: flex; flex-wrap: wrap; gap: .4rem; }
.wc-badge { display: inline-block; flex: none; min-width: 5.5rem; text-align: center; padding: .15rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 600; line-height: 1.5; }
.wc-badge--pass { background: #dafbe1; color: #116329; } .wc-badge--warn { background: #fff4d4; color: #7d4e00; }
.wc-badge--fail { background: #ffe1e1; color: #8c1d18; } .wc-badge--info { background: #e7eef8; color: #2f4f73; }
.wc-section { margin: 0 0 1.1rem; }
.wc-item { display: flex; gap: .75rem; align-items: flex-start; padding: .55rem 0; border-bottom: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, .08)); }
.wc-item:last-child { border-bottom: 0; }
.wc-item-body { min-width: 0; flex: 1; }
.wc-item-label { font-size: .88rem; }
.wc-item-value { font-size: .9rem; word-break: break-word; white-space: pre-line; }
.wc-table, .wc-code { margin: 1rem 0; }
.wc-table-head { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; margin-bottom: .4rem; }
.wc-table .table-responsive { max-height: 460px; overflow: auto; background: var(--bs-body-bg, #fff); border-radius: .5rem; }
.wc-table td { font-size: .84rem; max-width: 520px; word-break: break-word; }
.wc-table th { font-size: .8rem; white-space: nowrap; position: sticky; top: 0; background: var(--bs-body-bg, #fff); }
.wc-note { margin: .5rem 0 0; }
.wc-serp { margin: 0 0 1.1rem; }
.wc-serp-card { max-width: 600px; padding: .75rem .9rem; border-radius: .6rem; background: #fff; border: 1px solid #dadce0; font-family: Arial, sans-serif; }
.wc-serp-url { font-size: .8rem; color: #202124; word-break: break-all; }
.wc-serp-title { font-size: 1.15rem; color: #1a0dab; line-height: 1.3; margin: .15rem 0; }
.wc-serp-desc { font-size: .85rem; color: #4d5156; line-height: 1.45; }
.wc-busy .spinner-border { vertical-align: -2px; }
[dir="rtl"] .wc-serp-card { direction: ltr; text-align: left; }

/* text-tool shell */
.tx-stats { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.tx-stat { display: inline-flex; gap: .4rem; align-items: baseline; padding: .3rem .6rem; border-radius: .5rem; background: var(--bs-tertiary-bg, #f3f4f6); font-size: .875rem; }
.tx-stat--list { display: block; width: 100%; }
.tx-stat-k { color: var(--bs-secondary-color, #6b7280); }
.tx-marks { white-space: pre-wrap; word-break: break-word; padding: .75rem; border-radius: .5rem; background: var(--bs-tertiary-bg, #f8fafc); max-height: 22rem; overflow: auto; font-size: .9rem; }
.tx-marks mark { background: #fde68a; color: inherit; padding: 0 1px; border-radius: 2px; }
.tx-table { max-height: 28rem; overflow: auto; margin-top: .75rem; }
#txOut { min-height: 8rem; }
