:root {
  color-scheme: light;
  --page: #f7f4f1;
  --surface: #fff;
  --ink: #281d20;
  --subtle: #655753;
  --line: #e6dbd4;
  --brand: #982532;
  --brand-dark: #63202c;
  --brand-soft: #f7e9eb;
  --gold-soft: #f5eddf;
  --tinted-surface: #fbf8f5;
  --live: #22684c;
  --danger: #a73528;
  --font: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  font: 16px/1.45 var(--font);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); }
button, select { font: inherit; color: inherit; }
button, select, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: default; }
svg { width: 22px; height: 22px; flex: none; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, dl, dd { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #2566a7; outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner, .dashboard { max-width: 1560px; margin-inline: auto; padding-inline: clamp(16px, 3vw, 42px); }
.topbar-inner { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.brand { display: inline-flex; align-items: center; gap: clamp(10px, 1.2vw, 16px); min-height: 44px; flex: none; }
.brand img { display: block; width: 183px; height: auto; }
.brand-department {
  padding-inline-start: clamp(10px, 1.2vw, 16px); border-inline-start: 1px solid var(--line);
  color: var(--brand-dark); font-size: clamp(1.02rem, 1.75vw, 1.27rem);
  font-weight: 800; letter-spacing: -.04em; white-space: nowrap;
}
.toolbar { display: flex; align-items: center; gap: 8px; }
.connection { display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; margin-right: 6px; color: var(--subtle); border-radius: 100px; background: #f2eeeb; font-weight: 750; font-size: .83rem; white-space: nowrap; }
.connection i, .data-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.connection[data-tone="demo"] { background: var(--gold-soft); color: #725321; }
.connection[data-tone="live"] { background: #e8f3eb; color: var(--live); }
.icon-button, .button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); font-weight: 750; }
.icon-button { width: 44px; padding: 0; }
.icon-button svg { width: 20px; height: 20px; }
.button { padding: 0 14px; white-space: nowrap; font-size: .9rem; }
.button svg { width: 19px; height: 19px; }
.primary { background: var(--brand); color: white; border-color: var(--brand); }
.primary:disabled { opacity: .55; }
.secondary { background: var(--tinted-surface); }

.dashboard { padding-block: 16px; }
.kicker { color: var(--brand); font-weight: 800; font-size: .72rem; letter-spacing: .13em; }
.data-state {
  display: flex; justify-content: end; align-items: center; gap: 7px; margin-bottom: 9px;
  color: var(--subtle); font-size: .81rem; font-variant-numeric: tabular-nums;
}
.data-state[data-tone="live"] .data-dot { color: var(--live); }
.data-state[data-tone="demo"] .data-dot { color: #946c2d; }
#data-source { font-weight: 750; }
#updated:not(:empty)::before { content: "·"; margin-right: 6px; }

.sensor-grid, .work-grid, .education-grid { display: grid; gap: 13px; }
.sensor-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.work-grid { grid-template-columns: 1.06fr 1fr; margin-top: 14px; }
.education-grid { grid-template-columns: 1.06fr 1fr; margin-top: 14px; }
.sensor-card, .panel { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 2px 4px #502a2307; min-width: 0; }
.sensor-card { display: block; width: 100%; text-align: left; padding: 12px 15px 11px; }
.sensor-card[aria-pressed="true"] { border-color: var(--color); }
.sensor-top { display: flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: -.025em; }
.sensor-icon, .device-icon, .section-icon, .lesson-symbol { display: inline-grid; place-items: center; flex: none; }
.sensor-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--tint); color: var(--color); }
.sensor-icon > svg { width: 21px; height: 21px; }
.sensor-short { font-size: .72rem; color: var(--subtle); white-space: nowrap; font-weight: 650; }
.sensor-caption { display: flex; flex-direction: column; justify-content: center; line-height: 1.2; }
.sensor-category { margin-top: 2px; color: var(--color); font-size: .69rem; font-weight: 760; }
.sensor-reading { display: flex; align-items: baseline; gap: 5px; margin: 9px 0 10px; white-space: nowrap; }
.sensor-value { font-size: clamp(1.6rem, 3.2vw, 2.72rem); font-weight: 800; line-height: 1.07; letter-spacing: -.064em; font-variant-numeric: tabular-nums; }
.sensor-unit { color: var(--subtle); font-size: clamp(.72rem, 1.2vw, .91rem); font-weight: 650; }
.sensor-extra { display: block; margin-top: 3px; color: var(--subtle); font-size: .73rem; font-variant-numeric: tabular-nums; white-space: pre-line; }
.gauge { display: block; position: relative; height: 12px; margin-inline: 5px; }
.gauge::before { content: ""; position: absolute; top: 5px; inset-inline: 0; border-top: 1px solid #c9bbb5; }
.gauge-ticks { position: absolute; top: 2px; inset-inline: 0; display: flex; justify-content: space-between; }
.gauge-ticks i { width: 1px; height: 7px; background: #a99b95; }
.gauge-ticks i:nth-child(even) { transform: translateY(1px); height: 5px; }
.gauge-dot {
  display: block; position: absolute; top: 0; width: 11px; height: 11px;
  border: 2px solid #fff; border-radius: 50%; background: var(--color);
  box-shadow: 0 0 0 1px var(--color); transform: translateX(-50%); transition: left .25s ease;
}
.gauge-labels { display: flex; justify-content: space-between; color: var(--subtle); font-size: .74rem; margin-top: 5px; font-variant-numeric: tabular-nums; }

.panel { padding: 14px 15px; }
.section-head, .section-title { display: flex; align-items: center; gap: 8px; }
.section-head { min-height: 44px; justify-content: space-between; margin-bottom: 9px; }
.section-title { min-width: 0; }
.section-icon { width: 33px; height: 33px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); }
.section-icon svg { width: 20px; height: 20px; }
h2 { font-size: 1.15rem; font-weight: 800; letter-spacing: -.035em; }
.periods { display: flex; border-radius: 11px; background: #f4eeea; padding: 3px; }
.periods button { min-height: 44px; border: 0; border-radius: 8px; background: none; padding: 0 9px; font-size: .81rem; font-weight: 750; color: var(--subtle); white-space: nowrap; }
.periods button[aria-pressed="true"] { color: white; background: var(--brand); }
.chart-tools { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 4px; }
.select-label { position: relative; display: inline-flex; align-items: center; }
.select-label select { min-height: 44px; appearance: none; border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 0 27px 0 10px; font-weight: 700; font-size: .84rem; }
.select-label > span:last-child { position: absolute; right: 6px; pointer-events: none; }
.select-label svg { width: 17px; height: 17px; }
.legend { display: flex; flex-wrap: wrap; justify-content: end; align-items: center; gap: 3px 12px; font-size: .78rem; color: var(--subtle); }
.legend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.legend i { width: 13px; height: 4px; border-radius: 4px; background: var(--color); }
.chart-area { height: clamp(155px, 18.5vh, 240px); position: relative; }
canvas { display: block; width: 100%; height: 100%; }
#chart-empty { position: absolute; inset: 40% 8px auto; text-align: center; font-weight: 700; color: var(--subtle); font-size: .84rem; background: #fff; padding: 5px; }
.control-mode { font-size: .79rem; color: var(--brand); font-weight: 750; background: var(--brand-soft); padding: 4px 8px; border-radius: 7px; white-space: nowrap; }
.actuator-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.device-card { display: grid; justify-items: center; gap: 3px; text-align: center; padding: 9px 4px 5px; background: var(--tinted-surface); border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.device-card[data-on="true"] { background: #fcf2f2; border-color: #ecd4d6; }
.device-icon { width: 33px; height: 33px; color: var(--brand); }
.device-icon svg { width: 25px; height: 25px; }
.device-card h3, .shade-label h3 { font-size: .92rem; font-weight: 800; letter-spacing: -.04em; }
.device-state { color: var(--subtle); font-size: .82rem; font-weight: 700; line-height: 1.25; }
.device-card[data-on="true"] .device-state { color: var(--brand); }
.switch { display: grid; place-items: center; width: 60px; min-height: 44px; border: 0; border-radius: 10px; background: transparent; }
.switch-track { width: 45px; height: 25px; border-radius: 20px; position: relative; background: #837671; }
.switch[aria-checked="true"] .switch-track { background: var(--brand); }
.switch-track::after { content: ""; width: 19px; height: 19px; position: absolute; top: 3px; left: 3px; background: white; border-radius: 50%; transition: transform .18s ease; }
.switch[aria-checked="true"] .switch-track::after { transform: translateX(20px); }
.switch:disabled .switch-track { opacity: .5; }
.shade-control { background: var(--tinted-surface); border: 1px solid var(--line); border-radius: 12px; margin-top: 8px; padding: 7px; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.shade-label { display: flex; align-items: center; gap: 5px; min-width: 0; }
.shade-actions { display: grid; grid-template-columns: repeat(3, minmax(54px, 1fr)); gap: 5px; width: min(61%, 300px); }
.shade-actions button { min-height: 44px; padding: 0 4px; display: flex; align-items: center; justify-content: center; gap: 3px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; color: var(--brand); font-size: .83rem; font-weight: 750; white-space: nowrap; }
.shade-actions button svg { width: 17px; height: 17px; }
.shade-actions .stop { background: var(--brand-dark); color: white; border-color: var(--brand-dark); }
.shade-actions button:disabled { opacity: .5; }
.command-note { min-height: 18px; margin-top: 6px; color: var(--subtle); font-size: .76rem; }
.command-note[data-error="true"] { color: var(--danger); }

.education-panel { padding-top: 11px; padding-bottom: 11px; }
.education-panel .section-title { margin-bottom: 7px; }
.education-panel h2 { font-size: 1.02rem; }
.education-panel .section-icon { width: 29px; height: 29px; }
.education-panel .section-icon svg { width: 17px; height: 17px; }
.education-panel:first-child .section-icon { background: var(--gold-soft); color: #725321; }
.lesson-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
#sensor-lessons { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.lesson-button { display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 59px; padding: 4px 1px; font-size: .79rem; font-weight: 750; letter-spacing: -.04em; background: var(--tinted-surface); border: 1px solid var(--line); border-radius: 10px; }
.lesson-symbol { color: var(--color, var(--brand)); }

dialog { width: min(calc(100% - 26px), 490px); max-height: calc(100% - 26px); color: var(--ink); border: 1px solid var(--line); border-radius: 20px; padding: 22px; box-shadow: 0 18px 70px #411c2838; }
dialog::backdrop { background: #361a2675; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.dialog-head .section-icon { width: 42px; height: 42px; }
dialog h2 { font-size: 1.55rem; }
.lesson-text { margin: 16px 0 0; line-height: 1.65; white-space: pre-line; }
.lesson-facts { display: grid; gap: 8px; margin-top: 12px; padding: 12px; background: var(--brand-soft); border-radius: 10px; }
.lesson-facts > div { display: grid; grid-template-columns: 100px 1fr; gap: 5px; }
.lesson-facts dt, .setting-row p, #audio-progress { color: var(--subtle); font-size: .87rem; }
.lesson-facts dd { font-size: .9rem; font-weight: 750; overflow-wrap: anywhere; }
.audio-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 15px; }
#audio-progress { font-variant-numeric: tabular-nums; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { padding-bottom: 0; border: 0; }
.setting-row h3 { font-size: 1rem; }
.setting-row p { margin-top: 4px; }
.pressure-setting { flex-wrap: wrap; }
.pressure-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .87rem; }
.pressure-controls input {
  width: 7rem; min-height: 44px; padding: 0 9px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); color: inherit; font: inherit; font-variant-numeric: tabular-nums;
}
#sea-level-feedback, #altitude-feedback { font-weight: 700; }
.toast { position: fixed; z-index: 1; bottom: 14px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 24px); background: var(--brand-dark); color: white; padding: 10px 14px; border-radius: 10px; font-size: .9rem; box-shadow: 0 4px 25px #411c2832; }

@media (hover: hover) {
  .sensor-card:hover, .lesson-button:hover, .icon-button:hover, .secondary:hover { border-color: #bd9392; background: #faf1f1; }
  .primary:hover, .shade-actions .stop:hover:enabled { background: #781e2a; }
}
@media (max-width: 1000px) and (min-width: 821px) {
  .panel { padding-inline: 10px; }
  .periods button { padding-inline: 6px; }
  .sensor-card { padding-inline: 11px; }
  .sensor-short { display: block; }
}
@media (min-width: 821px) and (max-height: 720px) {
  .topbar-inner { min-height: 58px; }
  .brand img { width: 168px; }
  .dashboard { padding-block: 12px; }
  .sensor-card { padding-block: 9px; }
  .sensor-icon { width: 29px; height: 29px; }
  .sensor-reading { margin-block: 5px 7px; }
  .sensor-value { font-size: clamp(1.65rem, 3vw, 2.4rem); }
  .work-grid, .education-grid { margin-top: 10px; }
  .panel { padding-block: 9px; }
  .section-head { margin-bottom: 5px; }
  .chart-area { height: 143px; }
  .device-card { padding-top: 5px; gap: 2px; }
  .device-icon { width: 29px; height: 29px; }
  .lesson-button { min-height: 52px; }
}
@media (max-width: 820px) {
  .work-grid, .education-grid { grid-template-columns: 1fr; }
  .chart-area { height: 180px; }
  .sensor-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .sensor-value { font-size: clamp(1.45rem, 3.9vw, 2.5rem); }
}
@media (max-width: 680px) {
  .topbar-inner { flex-wrap: wrap; gap: 6px 14px; padding-block: 8px; }
}
@media (max-width: 500px) {
  #sensor-lessons { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .topbar-inner, .dashboard { padding-inline: 10px; }
  .toolbar { flex-wrap: wrap; }
  .brand img { width: 163px; }
  .dashboard { padding-top: 15px; }
  .sensor-card { padding: 9px 6px; }
  .sensor-top { gap: 4px; font-size: .81rem; }
  .sensor-icon { width: 25px; height: 25px; border-radius: 7px; }
  .sensor-icon svg { width: 17px; height: 17px; }
  .sensor-reading { gap: 3px; }
  .sensor-unit { font-size: .68rem; }
  .sensor-short { display: none; }
  .panel { padding-inline: 9px; }
  .section-title { gap: 5px; }
  .section-title h2 { font-size: .98rem; }
  .periods button { padding-inline: 5px; font-size: .75rem; }
  .legend { gap: 3px 6px; }
  .shade-actions button svg { display: none; }
}
@media (max-width: 356px) {
  .trend-panel .section-head { align-items: start; flex-direction: column; }
  .sensor-reading { flex-wrap: wrap; }
  .actuator-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .gauge-dot, .switch-track::after { transition: none; }
}

.view-toolbar {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.view-toolbar .data-state { margin-bottom: 0; margin-inline-start: auto; }
.view-mirror {
  display: inline-grid; place-items: center; min-height: 44px; padding-inline: 11px;
  border: 1px solid var(--line); border-radius: 8px; color: var(--brand-dark);
  background: var(--surface); font-size: .81rem; font-weight: 750; white-space: nowrap;
}
.view-switch { display: inline-flex; align-items: center; gap: 4px; padding: 3px; background: #efe7e2; border-radius: 9px; flex: none; }
.view-switch a {
  display: grid; place-items: center; min-height: 42px; padding-inline: 13px;
  border: 1px solid transparent; border-radius: 7px; color: var(--subtle); font-size: .84rem; font-weight: 760;
}
.view-switch a[aria-current] { border-color: #e4d6d0; background: var(--surface); color: var(--brand-dark); }
.dashboard[data-view="3d"] .monitor-layout {
  display: grid; grid-template-columns: minmax(0, 2.45fr) minmax(250px, 1fr); gap: 14px; align-items: stretch;
}
.dashboard[data-view="3d"] .sensor-grid { grid-template-columns: 1fr; gap: 8px; align-content: stretch; }
.dashboard[data-view="3d"] .sensor-card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: center; align-items: center; padding: 8px 12px 6px;
}
.dashboard[data-view="3d"] .sensor-reading { margin: 0; gap: 5px; }
.dashboard[data-view="3d"] .sensor-value { font-size: clamp(1.35rem, 2.35vw, 2.05rem); }
.dashboard[data-view="3d"] .gauge { grid-column: 1 / -1; margin-top: 4px; }
.dashboard[data-view="3d"] .gauge-labels { grid-column: 1 / -1; margin-top: 0; font-size: .68rem; }
.dashboard[data-view="3d"] .sensor-extra { grid-column: 1 / -1; }
.scene-panel { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; padding: 0; overflow: hidden; }
.scene-header, .scene-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; }
.scene-header > div:first-child { display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px 10px; }
.scene-version { color: var(--subtle); font-size: .73rem; font-weight: 700; white-space: nowrap; }
.scene-views { display: flex; gap: 4px; }
.scene-button {
  min-height: 44px; border: 1px solid var(--line); padding: 0 10px; background: var(--surface);
  border-radius: 8px; font-size: .78rem; font-weight: 750; color: var(--subtle); white-space: nowrap;
}
.scene-button[aria-pressed="true"] { color: var(--brand-dark); border-color: #e4bfc3; background: var(--brand-soft); }
.scene-background { margin-inline-end: 4px; }
.scene-background[aria-pressed="true"] { color: #315444; border-color: #c0d1c3; background: #eef4ec; }
.scene-button:disabled { opacity: .55; }
.scene-viewport { position: relative; min-height: clamp(320px, 44vh, 380px); overflow: hidden; background: #edf0eb; }
#farm-canvas { position: absolute; inset: 0; touch-action: none; cursor: grab; }
#farm-canvas:active { cursor: grabbing; }
#farm-canvas:focus-visible { outline-offset: -3px; }
.scene-feedback {
  position: absolute; inset: 50% 14px auto; transform: translateY(-50%); padding: 9px 12px; margin-inline: auto;
  max-width: 28rem; width: fit-content; background: #f8faf6f5; border: 1px solid #dce2db;
  border-radius: 8px; text-align: center; color: #41524b; font-weight: 680; font-size: .88rem;
}
.scene-overlay { position: absolute; inset: 0; pointer-events: none; }
.scene-marker, .scene-leader, .scene-anchor { position: absolute; }
.scene-leader { height: 1px; background: var(--marker-color); transform-origin: left; opacity: .72; }
.scene-anchor {
  width: 8px; height: 8px; border-radius: 50%; transform: translate(-50%, -50%);
  background: var(--marker-color); border: 1px solid #fff; box-shadow: 0 0 0 2px #ffffff91;
}
.scene-marker {
  z-index: 1; left: 0; top: 0; width: 106px; height: 44px; pointer-events: auto;
  padding: 0 6px; display: flex; gap: 5px; align-items: center; justify-content: center;
  border: 1px solid #cecfc5; border-radius: 8px; background: #fffffff2;
  color: var(--ink); font-size: .76rem; font-weight: 750; box-shadow: 0 2px 8px #26312822;
}
.scene-marker::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--marker-color); }
.scene-marker[data-selected="true"], .scene-marker[data-on="true"], .scene-marker:hover {
  border-color: var(--marker-color); color: var(--marker-color); background: #fff;
}
.scene-footer { border-top: 1px solid var(--line); }
.scene-footer p { color: var(--subtle); font-size: .76rem; }
.scene-inspection { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.scene-inspection .scene-views { flex-wrap: nowrap; }

@media (max-width: 900px) {
  .dashboard[data-view="3d"] .monitor-layout { grid-template-columns: 1fr; }
  .dashboard[data-view="3d"] .sensor-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .dashboard[data-view="3d"] .sensor-card { display: block; }
  .dashboard[data-view="3d"] .sensor-reading { margin-block: 5px; }
}
@media (max-width: 670px) {
  .dashboard[data-view="3d"] .sensor-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .scene-viewport { min-height: 288px; }
}
@media (max-width: 430px) {
  .view-toolbar { flex-wrap: wrap; }
  .view-toolbar .data-state { margin-inline-start: auto; }
  .scene-header, .scene-footer { padding-inline: 8px; }
  .scene-views { flex-wrap: wrap; justify-content: end; }
  .scene-background { margin-inline-end: 0; }
  .scene-button { padding-inline: 7px; }
  .scene-version { width: 100%; }
  .scene-footer p { font-size: .7rem; }
  .dashboard[data-view="3d"] .sensor-card { padding-inline: 7px; }
}

.dashboard-control-slot { display: contents; }
.dashboard[data-view="3d"] .work-grid { grid-template-columns: 1fr; }
.dashboard[data-view="3d"] .sensor-grid { align-self: start; grid-auto-rows: minmax(78px, auto); }
.scene-panel { grid-template-rows: auto minmax(0, 1fr) auto auto; }
.scene-control-slot .controls-panel {
  padding: 7px 12px 6px; border: 0; border-top: 1px solid var(--line); border-radius: 0;
  background: var(--tinted-surface); box-shadow: none;
}
.scene-control-slot .section-head { min-height: 28px; margin-bottom: 5px; }
.scene-control-slot .section-icon { width: 27px; height: 27px; }
.scene-control-slot .section-icon svg { width: 16px; height: 16px; }
.scene-control-slot .section-title h2 { font-size: .97rem; }
.scene-control-slot .device-card {
  grid-template-columns: minmax(0, 1fr) auto; justify-items: start; column-gap: 3px; padding: 5px 6px;
  text-align: left; background: var(--surface);
}
.scene-control-slot .device-card > .device-icon { display: none; }
.scene-control-slot .device-card h3 { align-self: end; font-size: .79rem; overflow-wrap: anywhere; }
.scene-control-slot .device-state { font-size: .72rem; }
.scene-control-slot .switch { grid-column: 2; grid-row: 1 / span 2; width: 46px; }
.scene-control-slot .switch-track { width: 40px; height: 23px; }
.scene-control-slot .switch-track::after { width: 17px; height: 17px; }
.scene-control-slot .switch[aria-checked="true"] .switch-track::after { transform: translateX(17px); }
.scene-control-slot .shade-control { margin-top: 5px; padding: 3px 5px; background: var(--surface); }
.scene-control-slot .command-note { min-height: 0; margin-top: 3px; }
.scene-control-slot .command-note:empty { display: none; }

@media (min-width: 901px) and (max-height: 850px) {
  .scene-viewport { min-height: clamp(240px, 40vh, 320px); }
}
@media (max-width: 560px) {
  .scene-control-slot .actuator-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scene-control-slot .controls-panel { padding-inline: 8px; }
}
