/* Scoped to interactive data tables; existing document layouts are untouched. */
.rt-controls { margin: 4px 0 8px; max-width: 100%; }
.rt-controls > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; padding: 6px 10px; border: 1px solid var(--line, #33434d); border-radius: 8px; color: var(--text, #edf2f7); font-size: 12px; font-weight: 650; list-style: none; }
.rt-controls > summary::before { content: '☷'; font-size: 16px; }
.rt-controls > summary::-webkit-details-marker { display: none; }
.rt-settings { max-width: 660px; margin-top: 8px; padding: 12px; border: 1px solid var(--line, #33434d); border-radius: 10px; background: var(--panel, #121b24); }
.rt-hint, .rt-status { margin: 0 0 10px; color: var(--muted, #96a5b4); font-size: 12px; line-height: 1.45; }
.rt-status:empty { display: none; }
.rt-status { margin: 8px 0 0; }
.rt-list { display: grid; gap: 4px; }
.rt-setting { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; padding: 6px 0; border-bottom: 1px solid var(--line, #33434d); }
.rt-controls .rt-visible { display: flex; align-items: center; gap: 8px; flex: 1 1 170px; margin: 0; font-size: 12px; min-width: 0; color: var(--text, #edf2f7); }
.rt-controls .rt-visible span { overflow-wrap: anywhere; }
.rt-controls .rt-visible input { appearance: auto; flex: 0 0 17px; width: 17px !important; min-width: 17px !important; min-height: 17px !important; height: 17px; padding: 0; margin: 0; accent-color: var(--accent, #35d1c8); }
.rt-setting-actions { display: flex; align-items: center; gap: 5px; }
.rt-controls .rt-button { background: var(--panel2, #1b2b34); border: 1px solid var(--line, #33434d); border-radius: 7px; padding: 6px 10px; min-width: 32px; min-height: 32px; color: var(--text, #edf2f7); font: inherit; font-size: 12px; cursor: pointer; }
.rt-controls .rt-button:disabled { opacity: .35; cursor: default; }
.rt-controls .rt-width { display: flex; align-items: center; gap: 5px; margin: 0 0 0 4px; font-size: 11px; color: var(--muted, #96a5b4); }
.rt-controls .rt-width input { width: 66px !important; max-width: 66px !important; min-width: 0 !important; min-height: 32px !important; margin: 0; padding: 5px; border: 1px solid var(--line, #33434d); border-radius: 6px; font-size: 12px; }
.rt-footer { display: flex; margin-top: 10px; }
.rt-scroll { width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
table.rt-table { table-layout: fixed !important; min-width: 0 !important; max-width: none !important; }
table.rt-table th { position: relative; white-space: normal !important; overflow-wrap: anywhere; padding-right: 17px; min-width: 0 !important; }
table.rt-table td { min-width: 0 !important; max-width: none; overflow-wrap: anywhere; }
table.rt-table [data-layout-column][hidden], table.rt-table col[hidden] { display: none !important; }
table.rt-table [data-layout-column] { overflow: hidden; }
table.rt-table [data-layout-column] :is(input,select,textarea) { max-width: 100%; }
.rt-drag { display: inline-block; border: 0; background: transparent; color: var(--muted, #96a5b4); font: inherit; font-size: 16px; line-height: 1; padding: 2px 4px 2px 0; margin-right: 3px; cursor: grab; vertical-align: middle; }
.rt-dragging { opacity: .45; }
.rt-drop { box-shadow: inset 3px 0 var(--accent, #35d1c8); }
.rt-resize { position: absolute; right: 0; top: 0; bottom: 0; width: 10px; cursor: col-resize; touch-action: none; }
.rt-resize::after { content: ''; position: absolute; top: 22%; bottom: 22%; right: 3px; border-right: 2px solid var(--line, #33434d); }
.rt-resize:hover::after, .rt-resize:focus::after { border-color: var(--accent, #35d1c8); }
.rt-controls :focus-visible, .rt-drag:focus-visible, .rt-resize:focus-visible, .rt-scroll:focus-visible { outline: 2px solid var(--accent, #35d1c8); outline-offset: 2px; }
@media (max-width: 620px) {
  .rt-settings { padding: 10px; }
  .rt-setting { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px; padding: 9px 0; }
  .rt-controls .rt-visible { min-height: 28px; }
  .rt-controls .rt-button { min-width: 40px; min-height: 40px; }
  .rt-controls .rt-width { margin-left: auto; }
  .rt-controls .rt-width > span:first-child { display: none; }
  .rt-controls .rt-width input { min-height: 40px !important; width: 54px !important; max-width: 54px !important; }
  .rt-controls > summary { min-height: 40px; }
}
@media print {
  .rt-controls, .rt-drag, .rt-resize { display: none !important; }
  .rt-scroll { overflow: visible; }
  table.rt-table { width: 100% !important; table-layout: auto !important; }
  table.rt-table th { width: auto !important; }
  table.rt-table col { width: auto !important; }
}
