/* JKA Dealer Portal v1.6.32 — Setup & Recovery toolbox organization
   Final setup-only layer: compact tool launcher, single-open accordion, responsive spacing. */

body.setup-page .setup-dashboard{max-width:1500px;margin:0 auto;width:100%}
body.setup-page .setup-page-head{margin-bottom:1rem!important}
body.setup-page .setup-tool-intro{
  display:flex;align-items:center;justify-content:space-between;gap:1rem;
  margin:0 0 1rem;padding:.85rem 1rem;border:1px solid var(--ha-border,rgba(255,255,255,.12));
  border-radius:.9rem;background:var(--ha-surface,#151b23);color:var(--ha-text,#e6eaf0)
}
body.setup-page .setup-tool-intro>div{display:flex;align-items:center;gap:.75rem;min-width:0}
body.setup-page .setup-tool-intro>div>i{display:grid;place-items:center;width:36px;height:36px;flex:0 0 36px;border-radius:.7rem;background:rgba(216,182,52,.12);color:var(--ha-accent,#d8b634)}
body.setup-page .setup-tool-intro span{display:grid;gap:.12rem;min-width:0}
body.setup-page .setup-tool-intro strong{font-size:.9rem;line-height:1.2}
body.setup-page .setup-tool-intro small{color:var(--ha-muted,#aab4bf);font-size:.72rem;line-height:1.35}
body.setup-page .setup-tool-intro .button{white-space:nowrap;margin:0!important}

body.setup-page .setup-tool-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.8rem;align-items:start}
body.setup-page details.setup-tool-card{
  min-width:0;margin:0!important;border:1px solid var(--ha-border,rgba(255,255,255,.12));
  border-radius:.95rem;background:var(--ha-surface,#151b23);overflow:hidden;color:var(--ha-text,#e6eaf0);
  box-shadow:none!important
}
body.setup-page details.setup-tool-card[open]{grid-column:1/-1;border-color:var(--ha-border-strong,rgba(255,255,255,.2))}
body.setup-page details.setup-tool-card>summary{
  list-style:none;cursor:pointer;display:grid;grid-template-columns:42px minmax(0,1fr) auto 20px;
  align-items:center;gap:.75rem;padding:.9rem 1rem;min-height:78px;user-select:none
}
body.setup-page details.setup-tool-card>summary::-webkit-details-marker{display:none}
body.setup-page details.setup-tool-card>summary:hover{background:rgba(216,182,52,.035)}
body.setup-page details.setup-tool-card>summary:focus-visible{outline:3px solid rgba(216,182,52,.32);outline-offset:-3px}
body.setup-page .setup-tool-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:.78rem;background:rgba(216,182,52,.1);color:var(--ha-accent,#d8b634);font-size:.95rem}
body.setup-page .setup-tool-summary-copy{display:grid;gap:.12rem;min-width:0}
body.setup-page .setup-tool-summary-copy .eyebrow{margin:0!important;font-size:.58rem!important;letter-spacing:.11em!important}
body.setup-page .setup-tool-summary-copy strong{font-size:.92rem;line-height:1.25;color:var(--ha-text,#e6eaf0)}
body.setup-page .setup-tool-summary-copy small{font-size:.69rem;line-height:1.4;color:var(--ha-muted,#aab4bf);max-width:78ch}
body.setup-page .setup-tool-state{display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;padding:.32rem .55rem;border-radius:999px;background:rgba(216,182,52,.09);border:1px solid rgba(216,182,52,.2);color:var(--ha-accent,#d8b634);font-size:.61rem;font-weight:800;letter-spacing:.04em}
body.setup-page .setup-tool-chevron{color:var(--ha-muted,#aab4bf);transition:transform .18s ease}
body.setup-page details.setup-tool-card[open] .setup-tool-chevron{transform:rotate(180deg)}
body.setup-page .setup-tool-body{border-top:1px solid var(--ha-border,rgba(255,255,255,.12));padding:1rem 1.05rem 1.05rem;min-width:0}
body.setup-page .setup-tool-body>p:first-child{margin-top:0}
body.setup-page .setup-tool-body>p:last-child{margin-bottom:0}
body.setup-page .setup-tool-actions{margin-top:.8rem!important}
body.setup-page .setup-section-title{margin-top:1rem!important}
body.setup-page .setup-section-title:first-child{margin-top:0!important}

body.setup-page .setup-email-moved-note{
  display:flex;align-items:flex-start;gap:.7rem;margin:.95rem 0;padding:.75rem .82rem;border-radius:.78rem;
  border:1px solid rgba(25,135,84,.24);background:rgba(25,135,84,.07)
}
body.setup-page .setup-email-moved-note>i{margin-top:.14rem;color:#38b487}
body.setup-page .setup-email-moved-note>div{display:grid;gap:.12rem;min-width:0}
body.setup-page .setup-email-moved-note strong{font-size:.78rem}
body.setup-page .setup-email-moved-note span{font-size:.69rem;line-height:1.45;color:var(--ha-muted,#aab4bf)}
body.setup-page .setup-email-moved-note a{font-weight:700}
body.setup-page .setup-restore-zone{margin-top:1rem;padding-top:1rem;border-top:1px solid var(--ha-border,rgba(255,255,255,.12))}
body.setup-page .setup-restore-zone h3{font-size:.9rem;margin:0 0 .65rem}
body.setup-page .setup-backups{margin-top:.75rem!important}
body.setup-page .setup-footnote{margin-top:1rem!important}

/* Health results can be long; keep the tool compact until opened, then readable. */
body.setup-page details[data-setup-tool="health"] .setup-health{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.55rem}
body.setup-page details[data-setup-tool="health"] .health-item{margin:0!important;min-width:0}

/* Light theme harmonization. */
[data-bs-theme="light"] body.setup-page .setup-tool-intro,
[data-bs-theme="light"] body.setup-page details.setup-tool-card{background:#fff;color:#17212b;border-color:#dbe2e8}
[data-bs-theme="light"] body.setup-page .setup-tool-summary-copy strong{color:#17212b}
[data-bs-theme="light"] body.setup-page .setup-tool-summary-copy small,
[data-bs-theme="light"] body.setup-page .setup-tool-intro small,
[data-bs-theme="light"] body.setup-page .setup-email-moved-note span{color:#66727f}
[data-bs-theme="light"] body.setup-page details.setup-tool-card>summary:hover{background:#fbfaf3}

@media(max-width:991.98px){
  body.setup-page .setup-tool-grid{grid-template-columns:1fr}
  body.setup-page details.setup-tool-card[open]{grid-column:auto}
  body.setup-page details[data-setup-tool="health"] .setup-health{grid-template-columns:1fr}
}
@media(max-width:767.98px){
  body.setup-page .setup-tool-intro{align-items:stretch;flex-direction:column;padding:.75rem}
  body.setup-page .setup-tool-intro .button{width:100%;text-align:center}
  body.setup-page details.setup-tool-card>summary{grid-template-columns:38px minmax(0,1fr) 18px;gap:.62rem;padding:.78rem;min-height:70px}
  body.setup-page .setup-tool-icon{width:38px;height:38px}
  body.setup-page .setup-tool-state{grid-column:2;justify-self:start;margin-top:.25rem}
  body.setup-page .setup-tool-chevron{grid-column:3;grid-row:1/3}
  body.setup-page .setup-tool-body{padding:.82rem}
}
@media(max-width:480px){
  body.setup-page .setup-tool-summary-copy small{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
  body.setup-page .setup-tool-body .grid{grid-template-columns:1fr!important}
  body.setup-page .setup-button-row{display:grid!important;grid-template-columns:1fr!important}
  body.setup-page .setup-button-row button,
  body.setup-page .setup-tool-actions button{width:100%!important}
}
