/* A fixed instrument palette keeps the glass display legible in both app themes. */
.dev.ac-device {
  --ac-housing: #e9ebe7;
  --ac-ink: #1d2929;
  --ac-muted: #465652;
  --ac-edge: #bdc7c0;
  --ac-screen-ink: #ecf9f8;
  align-self: start;
  min-width: 0;
  padding: clamp(12px, 2vw, 19px);
  color: var(--ac-ink);
  border: 1px solid #bdc7c0;
  border-radius: 21px;
  background: linear-gradient(145deg, #f5f6f2, var(--ac-housing) 65%, #e1e5df);
  box-shadow: inset 0 1px 0 #fff, 0 4px 14px #192d2910;
}
.dev.ac-device::before { display: none; }
.dev.ac-device .top .device-name,
.dev.ac-device .top .device-history { color: var(--ac-ink); }
.dev.ac-device .top .meta { color: var(--ac-muted); }
.dev.ac-device .top .device-glyph {
  color: #35544f; background: #dce6df; border-color: #bccbc2;
}
.dev.ac-device .top .del {
  color: var(--ac-muted); background: transparent; border-color: var(--ac-edge);
}
.dev.ac-device .controls:not(:empty) { padding-top: 0; margin-top: 12px; border: 0; }
.ac-remote {
  --ac-accent: #a3e7da;
  display: grid; gap: 15px; min-width: 0;
  color: var(--ac-ink); font-family: inherit;
}
.ac-remote[data-mode="heat"] { --ac-accent: #ffd3a9; }
.ac-remote[data-mode="fan"] { --ac-accent: #c9dcef; }
.ac-display {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: end; gap: 0 10px;
  padding: 16px 19px 20px;
  border: 1px solid #162527; border-radius: 14px;
  color: var(--ac-screen-ink); background: linear-gradient(122deg, #172526, #1c3235 63%, #2e484b);
  box-shadow: inset 0 1px 2px #8fb6af35, 0 1px 0 white;
}
.ac-display::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  inset: 0 0 0 30%;
  background: repeating-radial-gradient(ellipse at 125% -30%, transparent 0 12px, #b4e1da18 13px, transparent 14px 22px);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 60%);
  mask-image: linear-gradient(90deg, transparent, black 60%);
}
.ac-display-top {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 6px 12px; margin-bottom: 15px;
  color: #c9d6d4; font-size: .75rem; line-height: 1.35;
}
.ac-mode-indicator {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--ac-accent); font-weight: 650;
}
.ac-remote .ic-svg { width: 18px; height: 18px; flex: none; margin: 0; }
.ac-target-label, .ac-field-label {
  font-size: .74rem; font-weight: 600; line-height: 1.4; letter-spacing: .015em;
}
.ac-target-label { display: block; color: #bdcfcc; }
.ac-degrees {
  display: flex; align-items: flex-start; gap: 3px; color: var(--ac-screen-ink);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.ac-degrees strong { font-size: 4.45rem; line-height: .98; font-weight: 450; letter-spacing: -.076em; }
.ac-degrees small { margin-top: .33em; font-size: 1.18rem; line-height: 1.2; font-weight: 500; }
.ac-temp-keys {
  grid-column: 2; grid-row: 2 / span 2; align-self: end;
  display: inline-flex; align-items: stretch; justify-self: end;
  overflow: hidden; border: 1px solid #a0bdb959; border-radius: 16px;
  background: #233a3c; box-shadow: inset 0 1px 0 #ffffff14;
}
.ac-remote button {
  -webkit-appearance: none; appearance: none; touch-action: manipulation;
  font: inherit; cursor: pointer;
}
.ac-temp-keys .ac-key {
  display: grid; place-content: center; min-width: 45px; min-height: 46px;
  padding: 0 9px; color: #f0f8f6; background: transparent; border: 0;
  font-size: 1.48rem; font-weight: 400; line-height: 1;
}
.ac-key + .ac-key { box-shadow: inset 1px 0 #a0bdb940; }
.ac-settings { display: grid; gap: 10px; min-width: 0; }
.ac-field { display: grid; gap: 6px; min-width: 0; }
.ac-field-label { display: inline-flex; align-items: center; gap: 6px; color: var(--ac-muted); }
.ac-fixed-choice { font-size: .88rem; font-weight: 650; color: var(--ac-ink); }
.ac-choices {
  display: flex; flex-wrap: wrap; align-items: stretch; gap: 3px; padding: 3px;
  background: #d9dfd9; border: 1px solid #c3ccc4; border-radius: 12px;
}
.ac-choices button {
  flex: 1 1 40px; min-width: 0; min-height: 44px; padding: 5px 6px;
  border: 1px solid transparent; border-radius: 9px; background: transparent;
  color: #35473f; font-size: .8125rem; font-weight: 550; overflow-wrap: anywhere;
}
.ac-choices button[aria-pressed="true"] {
  color: #172f2b; background: #fafbf8; border-color: #b4c2b9;
  box-shadow: 0 1px 3px #20352d24; font-weight: 700;
}
.ac-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ac-actions button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 13px; min-height: 46px; border-radius: 12px;
  font-size: .86rem; line-height: 1.3; font-weight: 650;
}
.ac-send { flex: 2 1 auto; background: #23453e; border: 1px solid #1b3933; color: #f4faf6; }
.ac-power { flex: 1 1 auto; background: #f3f5f1; border: 1px solid var(--ac-edge); color: var(--ac-ink); }
.ac-feedback { margin: -3px 1px 0; color: var(--ac-muted); font-size: .76rem; line-height: 1.45; }
.ac-remote button:focus-visible { outline: 2px solid #00736d; outline-offset: 2px; }
.ac-temp-keys button:focus-visible { outline-color: var(--ac-accent); outline-offset: -4px; }
.ac-remote button:disabled { opacity: .45; cursor: default; }
@media (hover: hover) {
  .ac-key:not(:disabled):hover { background: #3a5153; }
  .ac-choices button:not(:disabled):hover { background: #eff3ee; }
  .ac-send:not(:disabled):hover { background: #2d564d; }
  .ac-power:not(:disabled):hover { background: #fff; }
}
@media (max-width: 360px) {
  .ac-display { padding: 14px; gap: 0 5px; }
  .ac-degrees strong { font-size: 3.75rem; }
}
@media (forced-colors: active) {
  .ac-display, .ac-choices button[aria-pressed="true"], .ac-remote button { border: 1px solid ButtonText; }
  .ac-choices button[aria-pressed="true"] { outline: 2px solid Highlight; outline-offset: -3px; }
}
