/* Text Cleaner — локальные стили */
.tc-presets { position: relative; padding: 16px 16px 0; overflow-x: auto; scrollbar-width: none; }
.tc-presets::-webkit-scrollbar { display: none; }
.tc-presets .segmented { flex-wrap: nowrap; }
.tc-presets .segmented label { display: inline-flex; align-items: center; padding: 8px 14px; font-size: 14px; cursor: pointer; white-space: nowrap; }
.tc-io { max-width: none; min-height: 300px; }
.tc-hl { overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--canvas); }
.tc-hl[hidden] { display: none; }
.tc-hl mark { background: var(--warn-tint); color: var(--warn); border-radius: 3px; padding: 0 1px; font-weight: 700; }
.tc-hl-toggle { display: inline-flex; align-items: center; gap: 6px; margin-right: 6px; cursor: pointer; }
.tc-hl-toggle input { width: 16px; height: 16px; accent-color: var(--blue); margin: 0; }
.tc-options { border-top: 1px solid var(--border); }
.tc-options > summary { display: none; }
.tc-groups { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 24px; padding: 14px 16px 16px; }
.tc-group { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.tc-group legend { font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 0; margin-bottom: 6px; }
.tc-group label { display: inline-flex; align-items: flex-start; gap: 8px; font-size: 14px; cursor: pointer; line-height: 1.35; }
.tc-group input[type="checkbox"], .tc-group input[type="radio"] { width: 18px; height: 18px; accent-color: var(--blue); margin: 0; flex: none; }
.tc-group .field { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; font-size: 14px; }
.tc-group .segmented label { align-items: center; }
.tc-text input { width: 100%; height: 36px; padding: 0 10px; font: 400 14px var(--mono); color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.tc-text input:focus { outline: none; border-color: var(--blue); box-shadow: var(--focus); }
.tc-hint { margin: -4px 0 0 26px; }
.tc-group .field + .tc-hint { margin-left: 0; }
.tc-warn { margin: 0; color: var(--warn); background: var(--warn-tint); padding: 6px 10px; border-radius: 8px; }
.tc-warn[hidden] { display: none; }
.tc-reset { align-self: flex-start; margin-top: 4px; }
.tc-tip { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--muted); position: relative; cursor: help; flex: none; }
.tc-tip:hover::after, .tc-tip:focus::after { content: attr(data-tip); position: absolute; left: 0; top: calc(100% + 6px); width: 240px; padding: 8px 10px; background: var(--ink); color: var(--surface); border-radius: 8px; font-weight: 400; font-size: 13px; line-height: 1.4; z-index: 5; }
@media (max-width: 1100px) { .tc-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 768px) {
  .tc-presets { padding: 12px 12px 0; }
  .tc-presets .segmented label { padding: 0 14px; min-height: 44px; }
  .tc-io { min-height: 180px; }
  .tc-options > summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; padding: 12px; font-weight: 600; list-style: none; min-height: 44px; }
  .tc-options > summary::-webkit-details-marker { display: none; }
  .tc-options > summary::after { content: "+"; color: var(--muted); font-weight: 400; }
  .tc-options[open] > summary::after { content: "−"; }
  .tc-groups { grid-template-columns: minmax(0, 1fr); padding: 0 12px 14px; }
  .tc-tip:hover::after, .tc-tip:focus::after { left: auto; right: 0; width: 220px; }
}
@media (max-width: 399px) { .tc-hl-toggle { display: none; } }
/* mobile: Input → Preset → Options → Output (SITEWIDE §3 / ТЗ §15) */
@media (max-width: 768px) {
  .tc-form { display: flex; flex-direction: column; }
  .tc-form > .tool-grid { display: contents; }
  .tc-form .pane:first-child { order: 1; }
  .tc-presets { order: 2; }
  .tc-options { order: 3; margin-top: 12px; }
  .tc-form .pane + .pane { order: 4; }
  .tc-form > .notice { order: 5; }
}
