/* Home-only refinements; retain the existing card layout and expanded actions. */
.home-devices { min-width: 0; }
.home-device-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.home-device-heading h3 { margin: 0 0 .2rem; font-size: 1.5rem; }
.home-device-heading p { margin: 0; color: #93a4b4; font-size: .85rem; }
.home-device-summary { display: inline-flex; align-items: center; gap: .45rem; color: #bfccd7; font-size: .8rem; white-space: nowrap; }
.home-online-dot { width: 7px; height: 7px; border-radius: 50%; background: #39d98a; flex: none; }
.home-summary-divider { color: #627382; margin: 0 .1rem; }
.home-devices #deviceControlsWrapper { gap: .7rem 1rem; padding: .75rem .85rem; box-shadow: none; margin: 0; background: #151d27; border-radius: 14px; }
.home-devices #deviceControlsWrapper .form-control { height: 2rem; min-height: 2rem; }
.home-devices #deviceControlsWrapper .btn-sm { height: 2rem; }
.home-devices .device-controls-search { flex: 1 1 13rem; }
.home-devices #deviceControlsWrapper .device-controls-search .form-control { width: 100%; min-width: 0; }
.home-devices .device-controls-actions { margin-left: auto; }
.home-device-list-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .65rem; margin: .85rem 0; color: #93a4b4; font-size: .75rem; }
.home-device-list-meta .device-controls-page { gap: .45rem; }
.home-device-list-meta .form-control { height: 1.8rem; min-height: 1.8rem; padding: .1rem .4rem; font-size: .75rem; width: 4rem; }
.home-device-list-meta #currentPageInput { width: 3.5rem; text-align: center; }
.home-device-list-meta .btn { width: 1.8rem; height: 1.8rem; padding: 0; display: grid; place-items: center; font-size: .65rem; }
.home-devices #deviceListDiv { gap: 1rem; align-items: flex-start; }
.app-shell .home-devices .device-card { border-radius: 16px; border-color: rgba(255,255,255,.09); box-shadow: 0 3px 10px rgba(0,0,0,.12); transition: border-color .18s ease, box-shadow .18s ease; }
.home-devices .device-card:hover { transform: none; border-color: rgba(125,211,252,.3); box-shadow: 0 6px 18px rgba(0,0,0,.2); }
.app-shell .home-devices .device-card.selected { border-color: #73bad9; box-shadow: 0 0 0 1px rgba(115,186,217,.22); }
.home-devices .device-card-head { gap: .6rem; grid-template-columns: auto minmax(0,1fr) auto; }
.home-devices .device-card-head-controls { display: flex; align-items: center; gap: .35rem; }
.home-devices .device-card-select { margin: 0; display: flex; align-items: center; }
.home-devices .device-card-toggle { display: grid; place-items: center; border: 0; padding: 0; width: 1.6rem; height: 1.8rem; border-radius: 6px; color: #9cafbe; background: transparent; }
.home-devices .device-card-toggle:hover { background: rgba(255,255,255,.07); color: #fff; }
.home-devices .device-card-toggle svg { transition: transform .18s ease; }
.home-devices .expanded .device-card-toggle svg { transform: rotate(180deg); }
.home-devices :is(button,input,select):focus-visible { outline: 2px solid #7dd3fc; outline-offset: 3px; }
.home-devices .device-chip { border-radius: 6px; background: rgba(255,255,255,.035); color: #aebdcc; }
.home-devices .device-chip-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-devices .device-chip > .oi { flex-shrink: 0; }
.home-devices .device-metrics { gap: .75rem .85rem; }
.home-devices .device-metric-top { font-size: .65rem; letter-spacing: .045em; color: #a9b7c4; }
.home-devices .device-metric-top > :last-child { color: #e0e8ef; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.home-devices .device-metric-track { height: .3rem; background: rgba(255,255,255,.065); }
.home-devices .device-metric-fill.ok { background: #70bace; }
.home-devices .offline .device-metric-fill { background: #607181; }
.home-devices .device-card.expanded .device-card-details-inner { max-height: min(38rem, 70vh); overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #425261 transparent; }
.home-devices .device-card.expanded .device-card-preview > .device-metrics { grid-template-columns: repeat(4, minmax(0,1fr)); }
.home-devices .expanded-metrics > .device-metric-note { grid-column: 1 / -1; }
.home-devices .device-actions-session { padding-top: .65rem; border-top: 1px solid rgba(255,255,255,.06); }
.home-device-empty { width: 100%; padding: 3rem 1rem; text-align: center; border: 1px dashed #334251; border-radius: 16px; color: #9aafbd; }
.home-device-empty > .oi { display: inline-block; font-size: 1.5rem; margin-bottom: 1rem; }
.home-device-empty h4 { font-size: 1rem; color: #e0e8ef; }
.home-device-empty p { font-size: .85rem; }
/* Expanded cards separate everyday controls, facts, and occasional editing. */
.home-devices .device-section { padding: .9rem 0; border-top: 1px solid rgba(255,255,255,.07); }
.home-devices .device-section-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.home-devices .device-section-heading h4 { margin: 0; color: #e6edf3; font-size: .8rem; font-weight: 650; letter-spacing: .01em; }
.home-devices .device-section-heading > span { font-size: .7rem; color: #91a2b2; }
.home-devices .device-connect-section .device-actions-session { border: 0; padding: 0 0 .7rem; margin: 0 0 .65rem; border-bottom: 1px solid rgba(255,255,255,.06); }
.home-devices .device-connect-section .device-actions-session > .device-action:not(.danger) { background: rgba(112,186,206,.12); color: #bce3ef; min-width: 6.25rem; justify-content: center; }
.home-devices .device-connect-section .device-actions { gap: .5rem; }
.home-devices .device-connect-section .device-tools { margin: 0; }
.home-devices .device-end-action { margin-left: auto; }
.home-devices .device-facts { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 1rem 1.25rem; margin: 0; }
.home-devices .device-facts > div { min-width: 0; }
.home-devices .device-facts dt { margin: 0 0 .25rem; color: #8fa1b1; font-size: .69rem; font-weight: 500; }
.home-devices .device-facts dd { margin: 0; font-size: .8rem; color: #dce5ed; overflow-wrap: anywhere; user-select: text; }
.home-devices .device-mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .75rem; }
.home-devices .device-fact-wide { grid-column: 1 / -1; }
.home-devices .device-update-label { display: inline-block; margin-left: .45rem; color: #dfbd70; font-size: .65rem; }
.home-devices .device-capacity { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: .75rem; margin-top: 1rem; }
.home-devices .device-capacity > div { padding: .7rem .8rem; border: 1px solid rgba(255,255,255,.06); border-radius: 10px; background: rgba(0,0,0,.1); min-width: 0; }
.home-devices .device-capacity > div > span:first-child { display: block; color: #91a2b2; font-size: .68rem; }
.home-devices .device-capacity strong { display: block; color: #e0e9f0; font-size: 1rem; font-weight: 600; margin: .25rem 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.home-devices .device-capacity small { font-size: .7rem; font-weight: 400; color: #91a2b2; }
.home-devices .device-capacity-hint { font-size: .68rem; color: #8093a4; }
.home-devices .device-disclosure { border-top: 1px solid rgba(255,255,255,.07); }
.home-devices .device-disclosure > summary { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .8rem 0; cursor: pointer; list-style: none; color: #d5e0e9; font-size: .78rem; font-weight: 550; }
.home-devices .device-disclosure > summary::-webkit-details-marker { display: none; }
.home-devices .device-disclosure > summary:hover { color: #bce3ef; }
.home-devices .device-disclosure > summary:focus-visible { outline: 2px solid #7dd3fc; outline-offset: 2px; border-radius: 6px; }
.home-devices .device-disclosure > summary small { display: block; font-size: .68rem; font-weight: 400; color: #8498a9; margin-top: .16rem; }
.home-devices .device-disclosure-chevron { color: #91a2b2; transition: transform .18s ease; }
.home-devices .device-disclosure[open] > summary .device-disclosure-chevron { transform: rotate(180deg); }
.home-devices .device-disclosure > .device-facts { padding: .2rem 0 1rem; }
.home-devices .device-editor { padding: .2rem 0 .8rem; min-width: 0; border: 0; }
.home-devices .device-editor .device-form { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: .85rem 1rem; }
.home-devices .device-editor .device-field { min-width: 0; }
.home-devices .device-editor .device-field label { text-transform: none; font-size: .73rem; font-weight: 500; letter-spacing: 0; color: #b8c8d5; }
.home-devices .device-editor .form-control { font-size: .8rem; padding: .45rem .6rem; }
.home-devices .device-editor .form-text { font-size: .67rem; color: #8498a9; }
.home-devices .device-editor .device-notes { min-height: 5rem; }
.home-devices .device-editor-footer { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding-top: .85rem; }
.home-devices .device-editor-footer > span { font-size: .68rem; color: #8fa1b1; }
.home-devices .device-editor-footer .btn { font-size: .75rem; }
.home-devices .device-maintenance .device-actions { padding: .2rem 0 .75rem; margin: 0; }
.home-devices .device-maintenance .danger { margin-left: auto; }
@media (max-width: 640px) {
    .home-devices .device-card.expanded .device-card-preview > .device-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .home-devices .device-editor .device-form { grid-template-columns: minmax(0,1fr); }
    .home-devices .device-facts { gap: .85rem .75rem; }
    .home-devices .device-end-action, .home-devices .device-maintenance .danger { margin-left: 0; }
    .home-device-heading { align-items: flex-start; flex-direction: column; gap: .6rem; }
    .home-devices .device-controls-field { flex: 1 1 100%; min-width: 0; }
    .home-devices .device-controls-field > span { width: 5.5rem; flex-shrink: 0; }
    .home-devices #deviceControlsWrapper .device-controls-field .form-control { flex: 1; width: 0; min-width: 0; }
    .home-device-list-meta .device-controls-page { margin-left: 0; flex-wrap: wrap; }
    .home-devices .device-card { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .home-devices .device-card, .home-devices .device-card * { transition: none !important; animation: none !important; }
    .home-devices .device-card.expanded .device-action { opacity: 1; transform: none; }
}
