.content { padding-top: 24px; padding-bottom: 56px; display: flex; flex-direction: column; gap: 12px; }
.card { max-width: none; background: var(--surface); border-radius: 24px; padding: 20px 22px; box-shadow: none; }

.device { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.dev-ico { width: 52px; height: 52px; flex: none; }
.dev-main { flex: 1; min-width: 180px; }
.dev-name { display: flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-4); flex: none; }
.dot.ready { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.dot.connecting, .dot.reconnecting { background: var(--orange); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .35; } }
.dev-meta { margin-top: 4px; display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--text-3); }
.dev-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  height: 40px; padding: 0 16px; border-radius: 12px; font-size: 14px; font-weight: 600;
  background: var(--surface-2); color: var(--text); display: inline-flex; align-items: center; gap: 6px;
  transition: background .15s, transform .15s, opacity .15s;
}
.btn:hover { background: var(--hover); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { filter: brightness(.95); }
.btn.danger { color: var(--red); }
.btn.rec { color: var(--red); }
.btn.rec.on { background: var(--red); color: #fff; }
.btn.rec.on::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: blink 1s infinite; }
.btn:focus-visible, .seg button:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.notice { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 16px; background: var(--orange-soft); color: var(--text); font-size: 14px; }
.notice strong { font-weight: 700; }

.controls { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.ctl { display: flex; align-items: center; gap: 8px; }
.ctl > span { font-size: 13px; font-weight: 600; color: var(--text-3); }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button { height: 30px; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text-3); transition: background .15s, color .15s; }
.seg button[aria-pressed="true"] { background: var(--hover); color: var(--text); }
.seg button:disabled { opacity: .5; }
.leds { display: flex; gap: 14px; flex-wrap: wrap; }
.led { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; }
.led input { width: 96px; accent-color: var(--blue); }
.led b { width: 26px; text-align: right; color: var(--text-2); font-weight: 600; }
.ctl-actions { display: flex; gap: 8px; margin-left: auto; }

.vitals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.vital { background: var(--surface); border-radius: 20px; padding: 16px 20px 14px; min-width: 0; display: grid; grid-template-columns: 1fr auto; align-items: baseline; row-gap: 4px; }
.vital > span { font-size: 13px; font-weight: 600; color: var(--text-3); white-space: nowrap; }
.vital em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--text-4); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vital em.warn { color: var(--orange); }
.vital strong { grid-column: 1 / -1; font-size: 34px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.15; white-space: nowrap; }
.vital strong small { font-size: 14px; font-weight: 600; color: var(--text-3); margin-left: 4px; letter-spacing: 0; }
.tiles { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.tile { background: var(--surface); border-radius: 18px; padding: 14px 16px; min-width: 0; }
.tile span { display: block; font-size: 12px; font-weight: 600; color: var(--text-3); white-space: nowrap; }
.tile strong { display: block; margin-top: 6px; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile strong small { font-size: 13px; font-weight: 600; color: var(--text-3); margin-left: 2px; }
.tile.warn strong { color: var(--orange); }

.chart-card { padding: 16px 18px 12px; }
.chart-head { display: flex; align-items: center; gap: 10px; margin: 0 2px 8px; }
.chart-head h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); }
.legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.chart-head .note { margin-left: auto; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
canvas.chart { display: block; width: 100%; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.log { font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text-2); max-height: 220px; overflow: auto; letter-spacing: 0; }
.log div { display: flex; gap: 12px; }
.log time { color: var(--text-4); flex: none; }
.log b { color: var(--text); font-weight: 600; flex: none; }
details.card summary { cursor: pointer; font-size: 15px; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 8px; }
details.card summary::-webkit-details-marker { display: none; }
details.card summary::after { content: "›"; margin-left: auto; color: var(--text-3); transform: rotate(90deg); transition: transform .15s; }
details.card[open] summary::after { transform: rotate(-90deg); }
details.card[open] summary { margin-bottom: 10px; }

@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 16px; border-radius: 20px; }
  .controls { gap: 12px; }
}
@media (max-width: 480px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vitals { gap: 8px; }
  .vital { padding: 12px 12px 10px; grid-template-columns: 1fr; }
  .vital em { text-align: left; grid-row: 3; }
  .vital strong { font-size: 24px; }
  .vital strong small { font-size: 12px; margin-left: 2px; }
}
