/* Dreame dashboard template: all styling remains renderer-specific. */
.dashboard-grid.grouped .dashboard-grid-group > .dashboard-tile.dashboard-template-dreame-overview,
.dashboard-grid.kiosk-gridstack .grid-stack-item-content > .dashboard-tile.dashboard-template-dreame-overview,
.app-card-size-preview > .dashboard-tile.dashboard-template-dreame-overview[data-card-scalable] {
    box-sizing:border-box;height:100%;min-height:0;overflow:hidden;gap:0;padding:13px 15px;
    background:var(--card-background,linear-gradient(150deg,#182639 0%,#101c2d 58%,#0b1726 100%));
    border:1px solid #415775;border-radius:16px;color:var(--card-text-color,#f0f4fb);
    box-shadow:inset 0 1px 0 rgba(188,211,244,.08),0 9px 24px rgba(0,0,0,.16)
}
/* The original two-tile dashboard retains the existing grouped renderer. */
.dashboard-grid.grouped .dashboard-grid-group > .dashboard-tile.dashboard-template-dreame-overview {
    height:21.8cm;min-height:21.8cm
}
.dashboard-template-dreame-overview [data-dashboard-template-body] {height:100%;min-height:0;min-width:0}
.dashboard-template-dreame-overview .dreame-card-layout {
    box-sizing:border-box;display:flex;flex-direction:column;height:100%;min-width:0;min-height:0;gap:10px;
    container:dreame-card / inline-size
}
.dashboard-template-dreame-overview .dreame-card-header {
    display:flex;align-items:center;gap:9px;flex:none;min-width:0;
    padding:1px 5px 9px;border-bottom:1px solid #3e516a
}
.dashboard-template-dreame-overview .dreame-card-icon {color:#68d968;font-size:22px;line-height:1}
.dashboard-template-dreame-overview .dreame-card-header h3 {
    font-size:clamp(16px,2.4cqi,20px);line-height:1.22;font-weight:750;
    margin:0;min-width:0;color:var(--card-title-color,#f4f7ff);overflow-wrap:anywhere
}
.dashboard-template-dreame-overview .dreame-card-body {
    flex:1 1 auto;min-height:0;min-width:0;display:grid;
    grid-template-columns:minmax(0,33%) minmax(0,67%);gap:10px
}
.dashboard-template-dreame-overview .dreame-card-fields,
.dashboard-template-dreame-overview .dreame-card-information {
    box-sizing:border-box;min-width:0;min-height:0;border:1px solid #40556f;
    border-radius:17px;background:linear-gradient(155deg,#1c2d43,#142235)
}
.dashboard-template-dreame-overview .dreame-card-fields {
    display:grid;grid-template-rows:repeat(4,minmax(0,1fr));gap:7px;
    padding:12px 11px;align-items:stretch
}
.dashboard-template-dreame-overview .dreame-card-field {
    min-height:0;min-width:0;display:flex;flex-direction:column;justify-content:center;
    gap:5px;color:var(--card-text-color,#31c4f0);font-weight:650;font-size:clamp(11px,1.6cqi,13px)
}
.dashboard-template-dreame-overview .dreame-card-select-wrap {position:relative;display:flex;align-items:center;min-width:0}
.dashboard-template-dreame-overview .dreame-card-svg {flex:none;display:block;stroke-width:1.8}
.dashboard-template-dreame-overview .dreame-card-select-wrap > .dreame-card-svg {
    position:absolute;left:11px;width:19px;height:19px;pointer-events:none;color:#dfeaf7;z-index:1
}
.dashboard-template-dreame-overview .dreame-card-field select {
    appearance:auto;color-scheme:dark;display:block;width:100%;min-width:0;height:40px;
    padding:0 20px 0 38px;border:1px solid #526784;border-radius:12px;
    background:linear-gradient(145deg,#273a52,#24344b);color:var(--card-text-color,#f1f4fa);
    font-family:inherit;font-weight:600;font-size:clamp(11px,1.65cqi,13px);line-height:1.15;cursor:pointer;text-overflow:ellipsis
}
/* Match native popup option colors with the dark selector background. */
.dashboard-template-dreame-overview .dreame-card-field select option {
    color:var(--card-text-color,#f1f4fa);background-color:#24344b;color-scheme:dark
}
.dashboard-template-dreame-overview .dreame-card-field select:focus-visible {outline:2px solid #4cc7f7;outline-offset:2px}
.dashboard-template-dreame-overview .dreame-card-field select:disabled {opacity:.65;cursor:default}
.dashboard-template-dreame-overview .dreame-card-information {
    display:flex;flex-direction:column;gap:8px;padding:10px
}
.dashboard-template-dreame-overview .dreame-card-hero {
    display:grid;grid-template-columns:minmax(0,51%) minmax(0,49%);align-items:center;
    flex:0 0 auto;min-width:0;height:125px;grid-template-rows:minmax(0,1fr);overflow:hidden;
    border-radius:16px;background:radial-gradient(ellipse at 28% 65%,#284861 0%,#203952 39%,#152840 100%)
}
.dashboard-template-dreame-overview .dreame-card-vacuum {
    display:block;width:100%;height:100%;max-height:100%;min-width:0;min-height:0;object-fit:contain;object-position:center;
    -webkit-mask-image:radial-gradient(ellipse 72% 64% at 50% 55%,#000 48%,transparent 100%);
    mask-image:radial-gradient(ellipse 72% 64% at 50% 55%,#000 48%,transparent 100%)
}
.dashboard-template-dreame-overview .dreame-card-hero-status {
    display:flex;flex-direction:column;align-items:flex-start;justify-content:center;
    min-width:0;min-height:0;max-height:100%;gap:6px;padding:7px 8px 7px 12px;
    border-left:1px solid #4bc3e5;color:#ccd9e9
}
.dashboard-template-dreame-overview .dreame-card-device-type {
    color:var(--card-text-color,#cad9ea);font-weight:650;font-size:clamp(11px,1.6cqi,15px);line-height:1.2
}
.dashboard-template-dreame-overview .dreame-card-indicator {
    display:inline-flex;align-items:center;gap:6px;min-height:25px;
    padding:3px 9px;border-radius:999px;border:1px solid #53d878;
    background:rgba(53,133,74,.18);color:#8af59c;font-weight:750;
    font-size:clamp(11px,1.55cqi,14px);line-height:1.2
}
.dashboard-template-dreame-overview .dreame-card-indicator .dreame-card-svg {width:16px;height:16px}
.dashboard-template-dreame-overview .dreame-card-indicator[data-dreame-availability="connected"] {
    border-color:#8daec8;color:#d0e6f5;background:#314c61
}
.dashboard-template-dreame-overview .dreame-card-indicator[data-dreame-availability="offline"] {
    border-color:#a17b7e;color:#f0b5ba;background:#4e2a35
}
.dashboard-template-dreame-overview .dreame-card-operating {
    color:var(--card-text-color,#aabbd0);font-size:clamp(10px,1.4cqi,12px);line-height:1.3;overflow-wrap:anywhere
}
.dashboard-template-dreame-overview .dreame-card-operating strong {color:var(--card-text-color,#e4edf9);font-weight:650}
.dashboard-template-dreame-overview .dreame-card-stats {
    display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr));
    gap:7px;min-height:0;min-width:0;flex:1 1 auto
}
.dashboard-template-dreame-overview .dreame-card-stat {
    box-sizing:border-box;display:flex;align-items:center;min-width:0;min-height:0;gap:8px;
    padding:6px 8px;border:1px solid #4c627c;border-radius:14px;
    background:linear-gradient(155deg,#23374f,#1a2a3f)
}
.dashboard-template-dreame-overview .dreame-card-stat-icon {
    flex:none;width:35px;min-width:0;height:34px;border-right:1px solid #7190ab;
    display:flex;align-items:center;justify-content:center;color:#83d8ef
}
.dashboard-template-dreame-overview .dreame-card-stat-icon .dreame-card-svg {width:21px;height:21px}
.dashboard-template-dreame-overview .dreame-card-stat-battery .dreame-card-stat-icon,
.dashboard-template-dreame-overview .dreame-card-stat-state .dreame-card-stat-icon {color:#7feb96}
.dashboard-template-dreame-overview .dreame-card-stat-dirty .dreame-card-stat-icon {color:#e0c69d}
.dashboard-template-dreame-overview .dreame-card-stat-content {
    display:flex;flex-direction:column;justify-content:center;min-width:0;gap:2px
}
.dashboard-template-dreame-overview .dreame-card-stat-label {color:var(--card-text-color,#c6d5e8);font-size:clamp(10px,1.42cqi,12px);line-height:1.25}
.dashboard-template-dreame-overview .dreame-card-stat strong {
    display:block;min-width:0;color:var(--card-text-color,#f2f6ff);font-weight:760;font-size:clamp(11px,1.7cqi,15px);
    line-height:1.2;overflow-wrap:anywhere
}
.dashboard-template-dreame-overview .dreame-card-actions {
    display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;flex:none
}
.dashboard-template-dreame-overview .dreame-card-actions button {
    min-width:0;min-height:61px;display:flex;flex-direction:column;align-items:center;justify-content:center;
    gap:4px;padding:6px 4px;border:1px solid #506985;border-radius:16px;
    background:linear-gradient(145deg,#243a54,#1c2d45);color:var(--card-text-color,#f0f4fc);
    font-family:inherit;font-weight:750;font-size:clamp(11px,1.65cqi,13px);line-height:1.2;cursor:pointer
}
.dashboard-template-dreame-overview .dreame-card-actions button .dreame-card-svg {width:20px;height:20px;fill:none}
.dashboard-template-dreame-overview .dreame-card-actions button:not(:disabled):hover {background:#2d4b69;border-color:#7cadd3}
.dashboard-template-dreame-overview .dreame-card-actions button:disabled {opacity:.5;cursor:not-allowed}
.dashboard-template-dreame-overview .dreame-card-message {margin:0;color:var(--card-text-color,#8bceef);font-size:11px;line-height:1.4;max-height:36px;overflow:auto}
.dashboard-template-dreame-overview .dreame-card-message[hidden] {display:none}
.dashboard-grid.editing .dashboard-template-dreame-overview .dreame-card-actions {pointer-events:none}

/* A narrower GridStack card reflows internally, never changes the core renderer. */
@container dreame-card (max-width:940px) {
    .dashboard-template-dreame-overview:not([data-card-scalable]) .dreame-card-body {grid-template-columns:minmax(0,35%) minmax(0,65%);gap:8px}
    .dashboard-template-dreame-overview:not([data-card-scalable]) .dreame-card-fields {padding:9px;gap:5px}
    .dashboard-template-dreame-overview:not([data-card-scalable]) .dreame-card-information {padding:8px;gap:6px}
    .dashboard-template-dreame-overview:not([data-card-scalable]) .dreame-card-stat {padding:5px;gap:6px}
    .dashboard-template-dreame-overview:not([data-card-scalable]) .dreame-card-stat-icon {width:28px;height:32px}
    .dashboard-template-dreame-overview:not([data-card-scalable]) .dreame-card-stat-icon .dreame-card-svg {width:19px;height:19px}
    .dashboard-template-dreame-overview:not([data-card-scalable]) .dreame-card-hero {height:105px}
    .dashboard-template-dreame-overview:not([data-card-scalable]) .dreame-card-actions {gap:6px}
    .dashboard-template-dreame-overview:not([data-card-scalable]) .dreame-card-actions button {min-height:55px}
}
@container dreame-card (max-width:690px) {
    .dashboard-template-dreame-overview:not([data-card-scalable]) .dreame-card-body {grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);gap:7px}
    .dashboard-template-dreame-overview:not([data-card-scalable]) .dreame-card-fields {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,auto);gap:5px;padding:8px}
    .dashboard-template-dreame-overview:not([data-card-scalable]) .dreame-card-field {gap:3px}
    .dashboard-template-dreame-overview:not([data-card-scalable]) .dreame-card-field select {height:34px;padding-left:33px}
    .dashboard-template-dreame-overview:not([data-card-scalable]) .dreame-card-select-wrap > .dreame-card-svg {left:9px;width:17px;height:17px}
    .dashboard-template-dreame-overview:not([data-card-scalable]) .dreame-card-hero {height:87px}
    .dashboard-template-dreame-overview:not([data-card-scalable]) .dreame-card-stats {gap:5px}
    .dashboard-template-dreame-overview:not([data-card-scalable]) .dreame-card-stat {padding:4px 5px}
    .dashboard-template-dreame-overview:not([data-card-scalable]) .dreame-card-actions button {min-height:50px;gap:3px}
    .dashboard-template-dreame-overview:not([data-card-scalable]) .dreame-card-actions button .dreame-card-svg {height:19px;width:19px}
}
@container dreame-card (max-width:440px) {
    .dashboard-template-dreame-overview:not([data-card-scalable]) .dreame-card-fields {grid-template-columns:repeat(2,minmax(0,1fr))}
    .dashboard-template-dreame-overview:not([data-card-scalable]) .dreame-card-hero-status {padding-left:8px;gap:3px}
    .dashboard-template-dreame-overview:not([data-card-scalable]) .dreame-card-operating {display:none}
    .dashboard-template-dreame-overview:not([data-card-scalable]) .dreame-card-stat-icon {display:none}
    .dashboard-template-dreame-overview:not([data-card-scalable]) .dreame-card-stat {padding:6px}
}

/* Inerte Katalogvorschau aus dem bestehenden Dreame-Renderer.
   Der Maßstab betrifft ausschließlich den Katalog, nicht die Dashboardkarte. */
.dashboard-compact-catalog .dreame-catalog-preview-frame {
    box-sizing:border-box;width:min(100%,310px);height:297px;flex:none;
    position:relative;overflow:hidden;pointer-events:none
}
.dashboard-compact-catalog .dreame-catalog-preview-frame > .dashboard-template-dreame-overview {
    box-sizing:border-box;display:block;width:560px;height:540px;min-width:560px;min-height:540px;
    max-width:none;max-height:none;position:absolute;top:0;left:0;
    padding:13px 15px;overflow:hidden;gap:0;
    border:1px solid #415775;border-radius:16px;color:#f0f4fb;
    background:linear-gradient(150deg,#182639 0%,#101c2d 58%,#0b1726 100%);
    transform:scale(.55);transform-origin:top left
}

/* Reuse the shared content host; native layout and factory accents stay local. */
.dashboard-template-dreame-overview {
    --card-content-padding:13px 15px;
    --card-content-justify:flex-start;
    --card-title-default:#f4f7ff;
    --card-action-background:linear-gradient(145deg,#243a54,#1c2d45);
    --card-action-hover:#2d4b69;
    --card-action-text:#f0f4fc;
}
.dashboard-template-dreame-overview[data-card-scalable] .dreame-card-layout {min-height:512px;}
.dashboard-template-dreame-overview[data-card-scalable] .dreame-card-body {
    min-height:min-content;grid-template-columns:minmax(0,33fr) minmax(0,67fr);
}
.dashboard-template-dreame-overview[data-card-scalable] .dreame-card-fields {grid-template-rows:repeat(4,minmax(min-content,1fr));}
.dashboard-template-dreame-overview[data-card-scalable] .dreame-card-stats {grid-template-rows:repeat(3,minmax(min-content,1fr));}
