.device {
  position: relative;
  width: min(430px, 100%);
  padding: 14px 15px 13px;
  border: 7px solid #07090d;
  border-radius: 46px;
  background: linear-gradient(180deg, #f7f5ef 0%, #efede7 100%);
  box-shadow: 0 50px 110px rgba(0, 0, 0, .58), 0 0 0 1px rgba(255, 255, 255, .12), inset 0 0 0 1px #3b3e45;
  overflow: hidden;
}

.phone-speaker {
  display: block;
  width: 74px;
  height: 5px;
  margin: -3px auto 10px;
  border-radius: 99px;
  background: #17191e;
  box-shadow: inset 0 1px 2px #000;
}

.device-top { padding: 0 4px 12px; }
.app-identity { display: flex; align-items: center; gap: 9px; }
.app-identity > span:last-child { display: flex; flex-direction: column; }
.app-identity b { color: #111318; font-size: 12px; line-height: 1.1; letter-spacing: -.02em; }
.app-identity small { margin-top: 3px; color: #777b82; font-size: 8px; font-weight: 750; line-height: 1; text-transform: uppercase; letter-spacing: .1em; }
.mini-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: linear-gradient(145deg, #3269ff, #153cc5); color: #fff; font-size: 13px; font-weight: 900; box-shadow: 0 7px 15px rgba(31, 85, 255, .22); }
.demo-badge { display: flex; align-items: center; gap: 6px; padding: 6px 9px; border: 1px solid #d9d7d0; border-radius: 99px; background: #fff; color: #555961; font-size: 7px; font-weight: 900; letter-spacing: .13em; }
.demo-badge i { width: 6px; height: 6px; border-radius: 50%; background: #23b997; box-shadow: 0 0 0 3px rgba(35, 185, 151, .13); }

.device-status { display: grid; grid-template-columns: auto 1fr auto; gap: 11px; align-items: center; padding: 15px; border-radius: 20px; background: linear-gradient(130deg, #11141a, #171c25); color: #fff; box-shadow: 0 12px 28px rgba(15, 18, 23, .18); }
.automation-icon { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid rgba(143, 171, 255, .24); border-radius: 13px; background: rgba(65, 105, 255, .13); color: #90aaff; }
.automation-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.device-status small { display: block; color: #858d9b; font-size: 7px; font-weight: 850; line-height: 1.1; letter-spacing: .16em; }
.device-status strong { display: block; margin-top: 4px; font-size: 13px; line-height: 1.15; }
.device-status p { display: flex; align-items: center; gap: 6px; margin: 5px 0 0; color: #9da4af; font-size: 8px; line-height: 1; }
.device-status p i { width: 5px; height: 5px; border-radius: 50%; background: #24c49f; box-shadow: 0 0 0 3px rgba(36, 196, 159, .1); }
.device .switch { width: 43px; height: 25px; padding: 3px; }
.device .switch span:first-child { width: 19px; height: 19px; }
.device .switch.is-on span:first-child { transform: translateX(18px); }

.platform-context { display: flex; gap: 5px; padding: 11px 1px 9px; overflow: hidden; }
.platform-context span { flex: 1; padding: 6px 4px; border: 1px solid #dbd8d0; border-radius: 8px; background: rgba(255, 255, 255, .5); color: #85878b; text-align: center; font-size: 7px; font-weight: 850; letter-spacing: .03em; }
.platform-context span.active { border-color: #b8c7ff; background: #e8edff; color: #234fdf; box-shadow: inset 0 0 0 1px rgba(31, 85, 255, .05); }

.rule-panel { padding: 12px 13px 5px; border: 1px solid #dad7cf; border-radius: 17px; background: rgba(255, 255, 255, .72); box-shadow: 0 8px 24px rgba(19, 21, 25, .045); }
.rule-heading { display: flex; justify-content: space-between; align-items: center; padding-bottom: 2px; }
.rule-heading span { font-size: 9px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.rule-heading small { color: #777b82; font-size: 7px; font-weight: 750; }
.device .control-block { padding: 10px 0 7px; border-bottom: 1px solid #e5e2db; }
.device .control-block:last-child { border-bottom: 0; }
.device .control-block label { align-items: center; font-size: 9px; }
.device .control-block label > span { display: flex; align-items: center; gap: 7px; }
.device .control-block output { font-size: 9px; font-weight: 850; }
.rule-symbol { display: grid; place-items: center; width: 19px; height: 19px; border-radius: 6px; background: #eef1fb; color: #2552e7; font-style: normal; font-size: 9px; }
.device .control-block input[type=range] { height: 3px; margin: 12px 0 2px; }
.device .control-block input[type=range]::-webkit-slider-thumb { width: 14px; height: 14px; border-width: 4px; }
.device .range-labels { font-size: 7px; }

.device .request-ticket { margin-top: 10px; padding: 14px 14px 12px; border: 0; border-radius: 20px; background: linear-gradient(145deg, #121824 0%, #0d1118 100%); color: #fff; box-shadow: 0 16px 34px rgba(10, 14, 21, .23); overflow: hidden; }
.request-head { display: flex; justify-content: space-between; align-items: center; }
.request-head > span { display: flex; align-items: center; gap: 7px; color: #aeb7c8; font-size: 7px; font-weight: 900; letter-spacing: .16em; }
.request-head > span i { width: 6px; height: 6px; border-radius: 50%; background: #ffbd5b; box-shadow: 0 0 0 4px rgba(255, 189, 91, .09); animation: request-pulse 1.8s ease-in-out infinite; }
.countdown { display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid rgba(151, 173, 255, .28); border-radius: 50%; color: #9fb4ff; font-size: 8px; font-weight: 900; }
.request-metrics { display: grid; grid-template-columns: 1.35fr 1fr 1fr; align-items: end; margin-top: 10px; padding-bottom: 11px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.request-metrics > strong { font: 400 29px/1 var(--serif); letter-spacing: -.04em; }
.request-metrics > span { display: flex; flex-direction: column; padding-left: 11px; border-left: 1px solid rgba(255, 255, 255, .1); }
.request-metrics b { font-size: 10px; }
.request-metrics small { margin-top: 3px; color: #7f899b; font-size: 6px; }
.demo-route { position: relative; display: grid; grid-template-columns: 24px 1fr; gap: 3px 7px; margin-top: 10px; }
.device .demo-route p { grid-column: 2; margin: 0; padding: 0; border: 0; color: inherit; }
.demo-route p + p { margin-top: 3px; }
.demo-route small { display: block; color: #6f7a8e; font-size: 6px; font-weight: 850; letter-spacing: .12em; }
.demo-route b { display: block; margin-top: 1px; font-size: 9px; }
.route-line { grid-row: 1 / 3; position: relative; width: 20px; }
.route-line::before { content: ""; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 1px; background: linear-gradient(#6e91ff, #29b99c); }
.route-line i { position: absolute; left: 5px; width: 7px; height: 7px; border: 2px solid #83a0ff; border-radius: 50%; background: #111722; }
.route-line i:first-child { top: 4px; }
.route-line i:last-child { bottom: 4px; border-color: #26bd9e; }
.rule-checks { display: flex; gap: 6px; margin-top: 10px; }
.rule-checks span { flex: 1; padding: 6px 7px; border: 1px solid rgba(40, 191, 158, .16); border-radius: 7px; background: rgba(40, 191, 158, .08); color: #83dbc8; font-size: 7px; font-weight: 750; white-space: nowrap; }
.rule-checks i { margin-right: 3px; color: #36d3af; font-style: normal; }
.rule-checks span.failed { border-color: rgba(238, 159, 71, .2); background: rgba(238, 159, 71, .09); color: #efb570; }
.rule-checks span.failed i { color: #efaa5b; }
.device .request-ticket #match-state { display: flex; align-items: center; margin: 10px -14px -12px; padding: 10px 14px; border: 0; background: rgba(38, 191, 158, .1); color: #8ee2ce; }
.device .request-ticket #match-state > i { flex: 0 0 auto; width: 7px; height: 7px; margin-right: 8px; background: #26c29f; box-shadow: 0 0 0 4px rgba(38, 194, 159, .11); }
.device .request-ticket #match-state > span { display: flex; flex: 1; flex-direction: column; }
.device .request-ticket #match-state b { font-size: 9px; }
.device .request-ticket #match-state small { color: #73a99d; font-size: 6px; font-weight: 600; }
.device .request-ticket #match-state svg { width: 20px; height: 20px; padding: 4px; border-radius: 50%; background: rgba(39, 196, 161, .13); fill: none; stroke: #6fe1c7; stroke-width: 2.4; }
.device .request-ticket #match-state.no-match { background: rgba(232, 157, 66, .1); color: #efb36b; }
.device .request-ticket #match-state.no-match > i { background: #e89d42; box-shadow: 0 0 0 4px rgba(232, 157, 66, .11); }
.device .request-ticket #match-state.no-match small { color: #ac8358; }
.device .request-ticket #match-state.no-match svg { background: rgba(232, 157, 66, .12); stroke: #efb36b; }
.device .request-ticket #match-state.is-paused { background: rgba(126, 137, 158, .12); color: #aeb7c8; }
.device .request-ticket #match-state.is-paused > i { background: #778196; box-shadow: 0 0 0 4px rgba(119, 129, 150, .11); }
.device .request-ticket #match-state.is-paused small { color: #7f899b; }
.device .request-ticket #match-state.is-paused svg { background: rgba(126, 137, 158, .12); stroke: #aeb7c8; }
.device-footer { display: flex; justify-content: space-between; align-items: center; padding: 10px 5px 0; color: #767a80; font-size: 7px; }
.device-footer span { display: flex; align-items: center; gap: 6px; font-weight: 800; }
.device-footer i { width: 5px; height: 5px; border-radius: 50%; background: #25bd9d; }
.device-footer small { font-size: 7px; }

@keyframes request-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255, 189, 91, .08); }
  50% { box-shadow: 0 0 0 7px rgba(255, 189, 91, 0); }
}

@media (max-width: 620px) {
  .device { padding: 11px 12px 10px; border-width: 6px; border-radius: 38px; }
  .phone-speaker { margin-bottom: 8px; }
  .device-status { padding: 12px; }
  .rule-panel { padding: 10px 11px 4px; }
  .device .request-ticket { padding: 12px; }
  .device .request-ticket #match-state { margin: 9px -12px -12px; padding: 9px 12px; }
  .rule-checks span { padding: 5px 4px; font-size: 6.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .request-head > span i { animation: none; }
}
