/* KCC Compact UI 3.3.3 — additive UX refinement for both themes.
   Load AFTER app.css, app.light.css and app.compact.css.
   Does not alter API behavior, storage, SSH or backup operations. */

/* 1. Unified densities: clear hierarchy without oversized blocks. */
html {--kcc-refine-row-gap:4px;}
html body :is(.domain-list-scroll,.server-group-items){gap:4px;}
html body :is(.domain-list-pane,.account-list-pane,.server-list-pane){padding-inline:8px;}
html body :is(.domain-row,.domain-row.account-row,.domain-row.server-row){
  border-radius:8px;padding:7px 9px;min-height:0;
}
html body :is(.domain-row,.account-row,.server-row) .list-top{gap:7px;align-items:center;min-height:18px;}
html body :is(.domain-row,.account-row,.server-row) .item-title,
html body .server-row .domain-row-title strong{font-size:13px;line-height:1.3;font-weight:700;}
html body .kcc-row-summary{font-size:11.5px;line-height:1.35;margin-top:3px;overflow-wrap:anywhere;}
html body .server-row .server-row-main{display:grid;gap:3px;}
html body .server-row .domain-row-title{display:flex;flex-wrap:wrap;align-items:center;gap:5px;}
html body .server-row .kcc-row-summary{margin-top:0;}
html body .server-row .server-pin{width:24px;height:28px;min-width:24px;flex-basis:24px;font-size:16px;padding:0;}
html body .server-group-block{margin-bottom:9px;}
html body .server-group-head{padding:5px 3px 5px;}
html body .server-row .badge,html body .domain-row .badge,html body .account-row .badge{font-size:10.5px;padding:2px 6px;}

/* 2. Less padding and stronger labels across detail cards. */
html body :is(.domain-main-pane,.account-main-pane,.server-main-pane){padding:9px 11px;}
html body :is(.domain-info-grid,.server-detail-grid,.detail-grid){gap:5px;}
html body :is(.domain-info-grid,.server-detail-grid,.detail-grid) > .kv{padding:6px 9px;min-height:0;border-radius:7px;}
html body .kv b,html body .kv .kv-label b{font-size:11px;line-height:1.2;margin-bottom:2px;}
html body .kv > span,html body .kv > .kv-value,html body .kv .kv-label ~ span{font-size:13.5px;line-height:1.3;}
html body .domain-detail-section{margin-top:9px;padding-top:9px;}
html body .domain-section-title{font-size:10.5px;margin-bottom:5px;}
html body .domain-pane-head,html body .server-main-head{margin-bottom:7px;}

/* 3. Compact, consistent cPanel access lines. Preserve copy and reveal functions. */
html body .cpanel-access-list{gap:4px;margin-top:6px;}
html body .cpanel-access-row{padding:6px 9px;min-height:39px;gap:8px;border-radius:7px;}
html body .cpanel-access-row strong{font-size:12.5px;line-height:1.3;margin-top:2px;}
html body .cpanel-access-row .meta{font-size:10.5px;}
html body .cpanel-access-row .secondary{font-size:11.5px;padding:5px 8px;min-height:30px;}
html body .cpanel-access-buttons{gap:5px;}
html body #cpanelCopyAll{min-height:30px;padding:5px 9px;font-size:11.5px;}
html body .account-main-pane .detail-actions{margin-top:6px;padding-top:5px;}

/* 4. Reduce visual noise in infrastructure but keep full diagnostic available. */
html body .domain-infra-section .infra-health-summary{padding:8px 10px;margin:0 0 7px;gap:8px;border-radius:8px;}
html body .domain-infra-section .infra-health-summary-icon{flex-basis:23px;width:23px;height:23px;font-size:13px;}
html body .domain-infra-section .infra-health-summary-text strong{font-size:12.5px;}
html body .domain-infra-section .infra-health-summary-text small{font-size:11px;line-height:1.3;}
html body .kcc-infra-quick{display:flex;flex-wrap:wrap;gap:5px;margin-bottom:5px;}
html body .kcc-infra-pill{display:inline-flex;align-items:center;gap:5px;border:1px solid var(--line);border-radius:6px;padding:3px 7px;font-size:11px;line-height:1.3;font-weight:600;}
html body .kcc-infra-pill i{display:inline-block;width:6px;height:6px;flex:0 0 6px;border-radius:50%;background:#8191a7;}
html body .kcc-infra-pill.ready i{background:#14a36b;}
html body .kcc-infra-pill.warning i{background:#d9951d;}
html body .kcc-infra-pill.error i{background:#d44458;}
html body .kcc-infra-details,html body .kcc-more-details{margin-top:7px;}
html body .kcc-infra-details > summary,html body .kcc-more-details > summary{
  display:list-item;list-style:revert;cursor:pointer;padding:6px 9px;
  font-size:11.5px;font-weight:650;border-radius:7px;line-height:1.35;
  border:1px solid var(--line);color:var(--muted);user-select:none;
}
html body .kcc-infra-details > summary:hover,html body .kcc-more-details > summary:hover{color:var(--text);}
html body .kcc-infra-details[open] > summary,html body .kcc-more-details[open] > summary{margin-bottom:8px;}
html body .kcc-more-details > .domain-info-grid{margin-top:7px;}
html body .kcc-infra-details .infra-flow{margin-bottom:8px;}
html body .kcc-infra-details .infra-cards{margin-top:6px;}
html[data-kcc-theme="light"] body .kcc-infra-pill{background:#f9fbff;border-color:#e2eaf4;color:#30415d;}
html[data-kcc-theme="light"] body .kcc-infra-pill.ready{background:#f0faf4;border-color:#d4ecdf;}
html[data-kcc-theme="light"] body .kcc-infra-pill.warning{background:#fffbef;border-color:#f4e4ba;}
html[data-kcc-theme="light"] body .kcc-infra-pill.error{background:#fff4f5;border-color:#f1d8dc;}
html[data-kcc-theme="light"] body .kcc-infra-details > summary,
html[data-kcc-theme="light"] body .kcc-more-details > summary{background:#f8fafd;border-color:#e3eaf3;color:#485d78;}
html[data-kcc-theme="dark"] body .kcc-infra-pill{background:#101f34;color:#b9cce4;border-color:#29405c;}
html[data-kcc-theme="dark"] body .kcc-infra-details > summary,
html[data-kcc-theme="dark"] body .kcc-more-details > summary{background:#111e31;border-color:#29405c;color:#a9bdd5;}

/* 5. All action buttons use the same compact baseline; primary contrast protected. */
html body :is(.content,.detail-sheet,.confirm-sheet) :is(
  .domain-action,.server-action-list > button,.server-action-list > a,
  .cpanel-access-row button,.server-access-row button
){border-radius:7px;}
html body .domain-action-list{gap:5px;}
html body .domain-action{gap:6px;padding:6px 9px;min-height:34px;}
html body .domain-action strong{font-size:12px;line-height:1.2;}
html body .domain-action small{font-size:10.5px;line-height:1.25;}
html body .detail-actions{gap:6px;flex-wrap:wrap;}
html body .server-action-list{display:flex;gap:6px;flex-wrap:wrap;}
html body .server-action-list > :is(button,a){flex:0 1 auto;white-space:normal;}
html[data-kcc-theme="light"] body :is(button.primary,.domain-action.primary,.action-link):not(.danger),
html[data-kcc-theme="dark"] body :is(button.primary,.domain-action.primary,.action-link):not(.danger){color:#fff!important;-webkit-text-fill-color:#fff!important;}
html body .domain-action.primary :is(strong,small,span),html body .primary :is(strong,small,span){color:inherit!important;-webkit-text-fill-color:inherit!important;}

/* 6. Preserve sensible touch sizes and layouts on narrow screens. */
@media(max-width:700px){
  html body :is(.domain-row,.account-row,.server-row){padding:8px 9px;}
  html body .cpanel-access-row{flex-direction:column;align-items:stretch;gap:6px;padding:9px;}
  html body .cpanel-access-row .secondary{min-height:40px;}
  html body .cpanel-access-buttons{display:flex;width:100%;}
  html body .cpanel-access-buttons button{flex:1;}
  html body .domain-action{min-height:42px;}
  html body .kcc-infra-pill{font-size:11px;}
}
