.clean-room-devices {
    --cr-ink: #102f3b;
    --cr-muted: #60757c;
    --cr-line: #dce7e8;
    --cr-surface: #f3f7f7;
    --cr-teal: #0d7378;
    --cr-mint: #13a08c;
    color: var(--cr-ink);
    background: var(--cr-surface);
}

.clean-room-devices,
.clean-room-devices * { box-sizing: border-box; }

.clean-room-devices__container {
    width: min(calc(100% - 40px), 1180px);
    margin: 0 auto;
}

.clean-room-devices__hero {
    color: #fff;
    background:
        radial-gradient(circle at 84% 12%, rgba(19, 160, 140, .30), transparent 31%),
        linear-gradient(120deg, #0b3541 0%, #0c5360 60%, #0d7378 100%);
}

.clean-room-devices__hero-inner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 48px;
    min-height: 300px;
    padding-top: 64px;
    padding-bottom: 70px;
}

.clean-room-devices__eyebrow {
    color: #b7eee3;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.clean-room-devices__eyebrow--dark { color: var(--cr-teal); }

.clean-room-devices__hero h1 {
    margin: 16px 0 14px;
    color: #fff;
    font-size: clamp(38px, 5vw, 58px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -.035em;
}

.clean-room-devices__hero p {
    max-width: 760px;
    margin: 0;
    color: #d7e6e8;
    font-size: 16px;
    line-height: 1.7;
}

.clean-room-devices__freshness {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 12px;
    min-width: 215px;
    padding: 15px 17px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 10px;
    background: rgba(4, 43, 52, .36);
}

.clean-room-devices__live-dot {
    width: 11px;
    height: 11px;
    border: 3px solid rgba(183, 238, 227, .28);
    border-radius: 50%;
    background: #76e2c9;
    box-sizing: content-box;
}

.clean-room-devices__freshness small,
.clean-room-devices__freshness strong { display: block; }
.clean-room-devices__freshness small { color: #acd0d2; font-size: 11px; }
.clean-room-devices__freshness strong { margin-top: 4px; color: #fff; font-size: 14px; }

.clean-room-devices__summary { transform: translateY(-28px); }

.clean-room-devices__summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--cr-line);
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 16px 38px rgba(13, 60, 68, .12);
}

.clean-room-devices__summary-item {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 96px;
    padding: 18px 20px;
    border-right: 1px solid var(--cr-line);
}

.clean-room-devices__summary-item:last-child { border-right: 0; }

.clean-room-devices__summary-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 10px;
    color: var(--cr-teal);
    background: #e7f5f1;
    font-size: 10px;
    font-weight: 900;
}

.clean-room-devices__summary-icon--good { color: #16704f; background: #e5f5ed; }
.clean-room-devices__summary-icon--warn { color: #ad5b36; background: #fff0e8; font-size: 18px; }
.clean-room-devices__summary-item strong { display: block; color: var(--cr-ink); font-size: 23px; line-height: 1.1; }
.clean-room-devices__summary-item span:last-child { display: block; margin-top: 4px; color: var(--cr-muted); font-size: 11px; }

.clean-room-devices__content { padding: 15px 0 76px; }

.clean-room-devices__toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 25px;
}

.clean-room-devices__toolbar h2 {
    margin: 8px 0 0;
    color: #183e4b;
    font-size: clamp(26px, 3vw, 35px);
    line-height: 1.2;
}

.clean-room-devices__filters {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border-radius: 8px;
    background: #e7edef;
}

.clean-room-devices__filters button {
    min-height: 38px;
    padding: 8px 14px;
    border: 0;
    border-radius: 6px;
    color: #53676e;
    background: transparent;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.clean-room-devices__filters button.is-active {
    color: #fff;
    background: var(--cr-teal);
    box-shadow: 0 3px 10px rgba(13, 115, 120, .18);
}

.clean-room-devices__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 18px;
}

.clean-room-device {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--cr-line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 6px 22px rgba(16, 53, 65, .055);
}

.clean-room-device__header {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 21px 22px 17px;
}

.clean-room-device__icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 11px;
    color: var(--cr-teal);
    background: #e7f5f1;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .03em;
}

.clean-room-device__location {
    display: block;
    margin-bottom: 3px;
    color: #758990;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.clean-room-device__heading h3 {
    margin: 0;
    color: #183e4b;
    font-size: 18px;
    line-height: 1.28;
}

.clean-room-device__status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.clean-room-device__status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.clean-room-device__status--online { color: #16704f; background: #e5f5ed; }
.clean-room-device__status--partial { color: #9c6720; background: #fff1d9; }
.clean-room-device__status--offline { color: #a64d45; background: #fae9e7; }

.clean-room-device__meta {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 22px;
    border-top: 1px solid #edf2f3;
    border-bottom: 1px solid #edf2f3;
    color: #6c8087;
    background: #f9fbfb;
    font-size: 10px;
}

.clean-room-device__metrics { padding: 5px 22px 14px; }

.clean-room-metric {
    padding: 14px 0;
    border-bottom: 1px solid #e6edef;
}

.clean-room-metric:last-child { border-bottom: 0; }
.clean-room-metric--inactive { opacity: .78; }
.clean-room-metric--offline { opacity: .66; }

.clean-room-metric__value-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 18px;
}

.clean-room-metric__name { color: #4f656d; font-size: 13px; line-height: 1.35; }
.clean-room-metric__value-row strong { color: #123f4c; font-size: 17px; text-align: right; }
.clean-room-metric--offline .clean-room-metric__value-row strong { color: #8a9a9f; }

.clean-room-metric__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 5px;
    color: #85959a;
    font-size: 10px;
}

.clean-room-metric__history { flex: 0 0 auto; }
.clean-room-metric__history summary { color: var(--cr-teal); font-size: 11px; font-weight: 800; cursor: pointer; list-style: none; }
.clean-room-metric__history summary::-webkit-details-marker { display: none; }
.clean-room-metric__history[open] { width: 100%; margin-top: 10px; }
.clean-room-metric__history[open] summary { text-align: right; }
.clean-room-metric__chart {
    position: relative;
    width: 100%;
    height: 210px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e5edef;
}

.clean-room-metric__loading,
.clean-room-metric__empty { display: block; color: #758990; text-align: center; }
.clean-room-metric__empty { display: none; }
.clean-room-devices__empty,
.clean-room-devices__no-filter-results {
    padding: 30px;
    border: 1px dashed #bcd0d3;
    border-radius: 11px;
    color: #60757c;
    background: #fff;
    text-align: center;
}
.clean-room-devices__empty strong,
.clean-room-devices__empty span { display: block; }
.clean-room-devices__empty strong { margin-bottom: 7px; color: #183e4b; font-size: 19px; }
.clean-room-devices__no-filter-results { display: none; }

@media (max-width: 980px) {
    .clean-room-devices__hero-inner { align-items: flex-start; flex-direction: column; gap: 25px; }
    .clean-room-devices__summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .clean-room-devices__summary-item:nth-child(2) { border-right: 0; }
    .clean-room-devices__summary-item:nth-child(-n+2) { border-bottom: 1px solid var(--cr-line); }
}

@media (max-width: 760px) {
    .clean-room-devices__hero-inner { min-height: 0; padding-top: 48px; padding-bottom: 56px; }
    .clean-room-devices__toolbar { align-items: flex-start; flex-direction: column; }
    .clean-room-devices__filters { width: 100%; }
    .clean-room-devices__filters button { flex: 1 1 33.333%; }
    .clean-room-devices__grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    .clean-room-devices__container { width: min(calc(100% - 26px), 1180px); }
    .clean-room-devices__summary-grid { grid-template-columns: 1fr; }
    .clean-room-devices__summary-item { min-height: 82px; border-right: 0; border-bottom: 1px solid var(--cr-line); }
    .clean-room-devices__summary-item:nth-child(3) { border-bottom: 1px solid var(--cr-line); }
    .clean-room-devices__summary-item:last-child { border-bottom: 0; }
    .clean-room-devices__filters { flex-direction: column; }
    .clean-room-device__header { grid-template-columns: 44px minmax(0, 1fr); padding: 18px; }
    .clean-room-device__icon { width: 44px; height: 44px; }
    .clean-room-device__status { grid-column: 1 / -1; justify-self: start; }
    .clean-room-device__meta { align-items: flex-start; flex-direction: column; padding-right: 18px; padding-left: 18px; }
    .clean-room-device__metrics { padding-right: 18px; padding-left: 18px; }
}
