/* Shared simple-DMTA settings (`pages::simple_settings`). Prefix classes with .xr-ss- .
   The shaping-cell classes (.xr-ss-cell, .xr-ss-bad-cell, .xr-ss-cellbox, .xr-ss-eff)
   are shared with `pages::simple_node::sections` -- do not rename them. */

/* Page shell: head, tab strip, the actions row, one card per tab. */
.xr-ss { display: flex; flex-direction: column; gap: var(--sp-3); }
.xr-ss-head { display: flex; flex-direction: column; gap: var(--sp-1); }
/* The compact caption under a title / at the top of a card (muted, capped). */
.xr-ss-caption { margin: 0; color: var(--text-secondary); font-size: 12px; max-width: 76ch; }

.xr-ss-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border-default); }
.xr-ss-tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px; cursor: pointer; color: inherit; }
.xr-ss-tab.is-active { border-bottom-color: var(--accent); font-weight: 600; }

/* The page actions row (version meta, import, history, save): one grid, all
   controls on the shared 32px control height (button / .xr-cfield pill). */
.xr-ss-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.xr-ss-meta { color: var(--text-secondary); font-size: 12px; font-variant-numeric: tabular-nums; }
.xr-ss-warn { color: var(--danger); font-size: 12px; }
.xr-ss-grow { flex: 1 1 auto; }

/* The tab's card: the shared card surface around a plain form (no table, so no
   `.xr-results` frame). */
.xr-ss-card { background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.xr-ss-body { position: relative; }
.xr-ss-card-head { padding: 10px var(--sp-4); border-bottom: 1px solid var(--border-default); }
.xr-ss-pad { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); }

/* The ISP matrix is a custom form field: let its card span the whole form row
   (the 180px label column would hang the card beside it) -- the field label
   becomes the section title above the card. */
.xr-ss .xr-crud-field:has(> .xr-crud-control > .xr-ss-isp) { grid-template-columns: 1fr; }
.xr-ss .xr-crud-field:has(> .xr-crud-control > .xr-ss-isp) > .xr-crud-label { padding-top: 0; }

/* The ISP card's panel row: the "Advanced" pill and the right-hand button share
   the toolbar's 30px controls (`.xr-results-toolbar` sizes the cfields). */
.xr-ss-check { display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; font-size: 12px; font-weight: 600; color: var(--text-secondary); cursor: pointer; white-space: nowrap; }
.xr-ss-isp .xr-results-toolbar .xr-panel-more .xr-btn { height: 30px; padding-top: 0; padding-bottom: 0; }

/* "+ ISP": a full-width add-row under the table, in the quiet empty-state look. */
.xr-ss-add { display: flex; align-items: center; justify-content: center; width: 100%; height: auto; padding: 9px var(--sp-3); border: 0; border-top: 1px dashed var(--border-default); border-radius: 0; background: transparent; color: var(--text-secondary); font-weight: 600; cursor: pointer; }
.xr-ss-add:not(:disabled):hover { background: var(--bg-hover); color: var(--text-primary); border-top-color: var(--border-strong); }

/* `cell_class` tints: !important beats the table zebra/hover backgrounds. */
td.xr-ss-default-td { background: var(--bg-surface-sunken) !important; }
.xr-ss-domains { width: 100%; min-width: 220px; }
.xr-ss-diff { max-height: 50vh; overflow: auto; white-space: pre-wrap; font-size: 12px; background: var(--bg-surface-sunken); padding: var(--sp-2); border-radius: var(--radius-sm); }
.xr-ss-probe { border: 1px solid var(--border-default); border-radius: var(--radius-sm); padding: var(--sp-2) var(--sp-3); }
.xr-ss-muted { color: var(--text-secondary); font-size: var(--fs-body); }
.xr-ss-in_sync { color: var(--positive); }
.xr-ss-behind { color: var(--warning-fg); }
.xr-ss-differs, .xr-ss-no_central { color: var(--danger); }
.xr-ss-results li { margin-bottom: var(--sp-2); }
.xr-ss-restart { margin-top: 4px; color: var(--warning-fg); display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.xr-ss-cellbox { display: flex; flex-direction: column; gap: 2px; min-width: 110px; }
.xr-ss-cell { width: 120px; }
.xr-ss-cell::placeholder { color: var(--text-secondary); font-style: italic; }
.xr-ss-bad-cell { border-color: var(--danger) !important; background: var(--negative-soft-bg); }
.xr-ss-eff { color: var(--text-secondary); font-size: var(--fs-label); font-style: italic; white-space: nowrap; }
.xr-ss-groups { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-3); }
.xr-ss-groups .is-active { background: var(--bg-surface-sunken); font-weight: 600; }
.xr-ss-front { display: grid; gap: var(--sp-3); }
.xr-ss-upstream { display: grid; grid-template-columns: minmax(100px, 160px) minmax(180px, 1fr); align-items: center; gap: var(--sp-2); }
.xr-ss-front-json { width: 100%; font-family: monospace; }
.xr-ss-upstream input, .xr-ss-front-json { padding: var(--sp-2); border: 1px solid var(--border-default); border-radius: var(--radius-sm); background: var(--bg-surface); color: var(--text-primary); font-size: var(--fs-body); }
.xr-ss-recovery { max-width: 420px; }
.xr-ss-recovery summary { cursor: pointer; }

/* One page, a section per setting (no tabs). */
.xr-ss-section { margin-top: var(--sp-5); }
.xr-ss-section > h2 { margin: 0 0 var(--sp-2); font-size: 1.1rem; }
.xr-ss-adv-toggle { margin-right: var(--sp-2); }

/* Summary cards + side panel (the page stays short; editors open in the panel). */
.xr-ss-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--sp-3); margin-top: var(--sp-3); }
.xr-ss-card2 { border: 1px solid var(--border-default); border-radius: var(--radius-md, 8px); padding: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-2); background: var(--bg-surface, transparent); }
.xr-ss-card2 h3 { margin: 0; font-size: 1rem; }
.xr-ss-headline { margin: 0; font-weight: 600; }
.xr-ss-facts { margin: 0; padding-left: 1.1em; color: var(--text-secondary, inherit); font-size: 0.85rem; flex: 1; }
.xr-ss-advlist { list-style: none; margin: var(--sp-2) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.xr-ss-advrow { display: flex; align-items: center; gap: var(--sp-3); }
.xr-ss-advrow b { min-width: 9em; }
.xr-modal.xr-ss-drawer { width: min(1100px, 96vw); max-width: 1100px; max-height: 92vh; overflow: auto; }
.xr-ss-drawer-body h2 { margin: 0 0 var(--sp-2); }
.xr-ss-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); }
