/* Customizable Home — premium dark (PREVIEW) */
.hc-greet {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3, 12px);
}
.hc-greet-text { min-width: 0; flex: 1; }
.hc-edit-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface, #18181b);
  border: 1px solid var(--border, #27272a);
  color: var(--text-subtle, #d4d4d8);
  border-radius: var(--radius-pill, 999px);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  min-height: 40px;
}
.hc-edit-btn:hover, .hc-edit-btn:focus-visible {
  border-color: var(--accent, #2dd4bf);
  color: var(--accent, #2dd4bf);
  outline: none;
}
.hc-edit-label { display: none; }
@media (min-width: 480px) {
  .hc-edit-label { display: inline; }
}

/* When custom home is painted, hide legacy static hub blocks + ux quick/panels */
#screen-home.hc-ready .hc-legacy,
#screen-home.hc-ready #ft-quick,
#screen-home.hc-ready #ux-home > :not(#ux-home-banner) {
  display: none !important;
}
/* [FIX] V1-02: keep the new-plant "Finish setting up … n of 4" banner (inside #ux-home) visible on custom Home */
#screen-home.hc-ready #ux-home-banner:empty { display: none; }

.hc-root { margin-top: var(--space-4, 16px); }
.hc-widgets {
  display: flex;
  flex-direction: column;
  gap: var(--space-3, 12px);
  margin-bottom: var(--space-5, 20px);
}
.hc-widget {
  background: var(--surface, #18181b);
  border: 1px solid var(--border, #27272a);
  border-radius: var(--radius-md, 12px);
  padding: 14px 16px;
}
.hc-widget h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted, #a1a1aa);
  display: flex;
  align-items: center;
  gap: 8px;
}
.hc-widget h3 .grow { flex: 1; }
.hc-widget .hc-w-value {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text, #fafafa);
}
.hc-widget .hc-w-sub {
  font-size: 13px;
  color: var(--muted, #a1a1aa);
  margin-top: 4px;
}
.hc-widget.tap { cursor: pointer; }
.hc-widget.tap:hover { border-color: var(--border-strong, #3f3f46); }
.hc-widget.alert-strip {
  border-color: rgba(239, 68, 68, 0.45);
  background: #1a1214;
}
.hc-widget .hc-alert-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  border-top: 1px solid var(--border, #27272a);
}
.hc-widget .hc-alert-row:first-of-type { border-top: 0; padding-top: 0; }
.hc-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hc-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.hc-line .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill, 999px);
  background: var(--surface-inset, #111113);
  color: var(--muted);
}
.hc-tag.green { color: #86efac; background: rgba(34,197,94,.12); }
.hc-tag.red { color: #fecaca; background: rgba(239,68,68,.14); }
.hc-tag.amber { color: #fcd34d; background: rgba(245,158,11,.14); }
.hc-tag.gray { color: var(--muted); }

#hc-actions .hub-card.danger,
#hc-actions .hub-card.hc-sos {
  border-color: rgba(239, 68, 68, 0.55);
}
#hc-actions .hub-card.hc-sos strong { color: #fecaca; }
#hc-actions .hub-card.locked { opacity: 0.7; }

/* Editor sheet */
.hc-editor {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.hc-editor.hidden { display: none; }
.hc-editor-card {
  width: 100%;
  max-width: 560px;
  max-height: min(92vh, 820px);
  overflow: auto;
  background: var(--bg, #0a0a0b);
  border: 1px solid var(--border, #27272a);
  border-radius: 16px 16px 0 0;
  padding: 16px 16px calc(16px + var(--safe-bottom, 0px));
  box-shadow: var(--shadow-popover, 0 16px 40px rgb(0 0 0 / 35%));
}
@media (min-width: 720px) {
  .hc-editor { align-items: center; padding: 24px; }
  .hc-editor-card {
    border-radius: var(--radius-lg, 16px);
    max-height: 85vh;
  }
}
.hc-editor-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.hc-editor-head h2 {
  flex: 1;
  margin: 0;
  font-size: 20px;
  font-weight: 650;
}
.hc-editor-lead { margin: 0 0 14px; font-size: 14px; }
.hc-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  background: var(--surface-inset, #111113);
  padding: 4px;
  border-radius: var(--radius-md, 12px);
}
.hc-tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 550;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.hc-tab.active {
  background: var(--surface, #18181b);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--border);
}
.hc-pane.hidden { display: none; }
.hc-edit-list { display: flex; flex-direction: column; gap: 8px; }
.hc-edit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface, #18181b);
  border: 1px solid var(--border, #27272a);
  border-radius: var(--radius-md, 12px);
  padding: 10px 12px;
}
.hc-edit-row .hc-ico {
  width: 28px;
  text-align: center;
  flex: 0 0 auto;
}
.hc-edit-row .grow { flex: 1; min-width: 0; }
.hc-edit-row strong { display: block; font-size: 14px; font-weight: 600; }
.hc-edit-row .hint { font-size: 12px; color: var(--muted); }
.hc-edit-row .hc-ord {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hc-edit-row .hc-ord button,
.hc-edit-row .hc-rm {
  background: var(--surface-inset, #111113);
  border: 1px solid var(--border);
  color: var(--text-subtle);
  border-radius: 8px;
  width: 32px;
  height: 28px;
  cursor: pointer;
  font-size: 12px;
  padding: 0;
}
.hc-edit-row .hc-rm { width: auto; padding: 0 10px; height: 36px; color: #fecaca; }
.hc-edit-row .hc-toggle {
  appearance: none;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: #3f3f46;
  border: 0;
  position: relative;
  cursor: pointer;
  flex: 0 0 auto;
}
.hc-edit-row .hc-toggle.on { background: var(--accent, #2dd4bf); }
.hc-edit-row .hc-toggle::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: left .15s ease;
}
.hc-edit-row .hc-toggle.on::after { left: 21px; }
.hc-add-btn { margin-top: 12px; }
.hc-picker {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 12px);
  background: var(--surface-raised, #1f1f23);
  max-height: 240px;
  overflow: auto;
}
.hc-picker.hidden { display: none; }
.hc-picker button {
  display: flex;
  width: 100%;
  text-align: left;
  gap: 10px;
  align-items: center;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  cursor: pointer;
}
.hc-picker button:last-child { border-bottom: 0; }
.hc-picker button:hover { background: var(--surface-inset, #111113); }
.hc-picker .hint { font-size: 12px; color: var(--muted); }
.hc-editor-foot {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  background: var(--bg, #0a0a0b);
}
.hc-editor-foot .btn-primary { flex: 1; }
.hc-empty {
  color: var(--muted);
  font-size: 14px;
  padding: 12px 4px;
}
