:root {
  color-scheme: dark;
  --bg: #0a0c11;
  --panel: #12151d;
  --panel-2: #181c27;
  --text: #f6f7fb;
  --muted: #8c94a8;
  --line: rgba(255, 255, 255, 0.075);
  --accent: #ff7a45;
  --accent-2: #ff4d6d;
  --green: #37d39b;
  --red: #ff5a5f;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --radius: 22px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(255, 122, 69, 0.13), transparent 60%),
    radial-gradient(700px 500px at 110% 10%, rgba(89, 112, 255, 0.12), transparent 60%),
    var(--bg);
  min-height: 100vh;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- 登录 ---------- */

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 20px;
  position: relative;
  overflow: hidden;
}

.login-glow {
  position: absolute;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 122, 69, 0.25), transparent 65%);
  filter: blur(30px);
  top: -180px;
  right: -180px;
  pointer-events: none;
}

.login-card {
  width: min(100%, 400px);
  padding: 30px 26px 24px;
  border-radius: 28px;
  background: rgba(18, 21, 29, 0.82);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  position: relative;
  z-index: 1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 24px rgba(255, 94, 88, 0.28);
}

.brand h1 {
  margin: 0;
  font-size: 23px;
  letter-spacing: 0.3px;
}

.brand p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label,
.field {
  display: grid;
  gap: 8px;
}

.login-form label > span,
.field > span,
.field-label {
  font-size: 13px;
  color: var(--muted);
}

input,
select {
  width: 100%;
  height: 50px;
  padding: 0 15px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  outline: none;
  transition: border-color 0.18s, background 0.18s;
}

input:focus,
select:focus {
  border-color: rgba(255, 122, 69, 0.65);
  background: rgba(255, 122, 69, 0.06);
}

input::placeholder {
  color: #5e6578;
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 22px, calc(100% - 14px) 22px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 38px;
}

.login-foot {
  margin: 22px 0 0;
  text-align: center;
  color: #5f6678;
  font-size: 12px;
}

.form-error {
  min-height: 18px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
}

/* ---------- 主框架 ---------- */

.app {
  width: min(100%, 640px);
  margin: 0 auto;
  padding: 0 18px calc(104px + var(--safe-bottom));
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 2px 14px;
  background: linear-gradient(180deg, rgba(10, 12, 17, 0.96) 55%, rgba(10, 12, 17, 0));
  backdrop-filter: blur(10px);
}

.topbar h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: 0.2px;
}

.subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  display: grid;
  place-items: center;
  transition: background 0.2s, transform 0.15s;
}

.icon-btn:active {
  transform: scale(0.94);
  background: rgba(255, 255, 255, 0.1);
}

.view {
  display: grid;
  gap: 22px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 11px;
}

.section-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #d9dde8;
}

.section-head span,
.section-head button {
  color: var(--muted);
  font-size: 12px;
}

.link-btn {
  border: none;
  background: none;
  padding: 4px;
  color: var(--accent) !important;
}

/* ---------- 首页概览 ---------- */

.overview {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border-radius: 26px;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(255, 122, 69, 0.18), transparent 55%),
    linear-gradient(160deg, #1a1e29, #12151d);
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

.overview::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -80px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 1px solid rgba(255, 122, 69, 0.16);
  box-shadow: 0 0 0 34px rgba(255, 122, 69, 0.035), 0 0 0 68px rgba(255, 122, 69, 0.02);
}

.overview-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.overview .kicker {
  color: var(--muted);
  font-size: 13px;
}

.overview .big {
  font-size: 42px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -1px;
  margin: 6px 0 0;
}

.overview .big small {
  font-size: 20px;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0;
}

.overview .weather {
  font-size: 28px;
  line-height: 1;
}

.overview-stats {
  display: flex;
  gap: 24px;
  margin-top: 22px;
  position: relative;
  z-index: 1;
}

.overview-stats div {
  display: grid;
  gap: 3px;
}

.overview-stats b {
  font-size: 17px;
  font-weight: 600;
}

.overview-stats span {
  color: var(--muted);
  font-size: 12px;
}

/* ---------- 设备 ---------- */

.room + .room {
  margin-top: 22px;
}

.device-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.device-card {
  position: relative;
  min-height: 142px;
  padding: 16px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, #1a1e29, #12151d);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.2s, background 0.3s;
}

.device-card:active {
  transform: scale(0.98);
}

.device-card.on {
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(255, 122, 69, 0.2), transparent 60%),
    linear-gradient(160deg, #20222d, #15171f);
  border-color: rgba(255, 122, 69, 0.35);
}

.device-card.offline {
  opacity: 0.55;
}

.device-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dev-icon {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  color: #dfe3ec;
}

.device-card.on .dev-icon {
  background: linear-gradient(135deg, rgba(255, 122, 69, 0.9), rgba(255, 77, 109, 0.9));
  color: #fff;
  box-shadow: 0 8px 18px rgba(255, 90, 88, 0.25);
}

.dev-icon svg {
  width: 20px;
  height: 20px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4b5263;
}

.dot.live {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(55, 211, 155, 0.12);
}

.dev-name {
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dev-meta {
  margin-top: -8px;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-card-bottom {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.sensor-reading {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.sensor-reading b {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.sensor-reading span {
  font-size: 12px;
  color: var(--muted);
}

.switch {
  width: 46px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 99px;
  border: none;
  padding: 0;
  background: #2b303d;
  position: relative;
  transition: background 0.22s ease;
}

.switch::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.switch.on {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.switch.on::after {
  transform: translateX(18px);
}

.switch.small {
  width: 42px;
  height: 26px;
}

.switch.small::after {
  width: 20px;
  height: 20px;
}

.switch.small.on::after {
  transform: translateX(16px);
}

/* ---------- 场景 ---------- */

.scene-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.scene-card {
  min-height: 112px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(125, 148, 255, 0.14), transparent 60%),
    linear-gradient(160deg, #1a1e29, #12151d);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  transition: transform 0.15s;
}

.scene-card:active {
  transform: scale(0.98);
}

.scene-card .emoji {
  font-size: 28px;
}

.scene-card b {
  font-size: 15px;
  font-weight: 600;
}

.scene-card small {
  color: var(--muted);
  font-size: 12px;
}

.add-card {
  min-height: 88px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
  display: grid;
  place-items: center;
  gap: 6px;
  color: var(--muted);
}

.scene-grid .add-card {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
}

.add-card svg {
  width: 26px;
  height: 26px;
}

/* ---------- 自动化 ---------- */

.auto-list {
  display: grid;
  gap: 12px;
}

.auto-card {
  padding: 16px 16px 15px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, #191d27, #12151d);
  display: grid;
  gap: 10px;
}

.auto-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auto-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
}

.auto-title .badge {
  width: 32px;
  height: 32px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: rgba(255, 122, 69, 0.12);
  color: var(--accent);
}

.auto-title .badge svg {
  width: 17px;
  height: 17px;
}

.auto-desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.auto-desc b {
  color: #d9dde8;
  font-weight: 500;
}

.auto-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #5f6678;
  font-size: 11px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 10px;
}

.text-btn {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 12px;
  padding: 2px 0;
}

.text-btn.danger {
  color: #ff7b7f;
}

/* ---------- 我的 ---------- */

.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(150deg, #1c202b, #12151d);
}

.avatar {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.profile-card h2 {
  margin: 0;
  font-size: 18px;
}

.profile-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.list-card {
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.028);
  overflow: hidden;
}

.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  min-height: 56px;
}

.list-row:last-child {
  border-bottom: none;
}

.list-row .row-main {
  flex: 1;
  min-width: 0;
}

.list-row .row-title {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-row .row-sub {
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-row .chev {
  color: #5f6678;
}

.list-row .chev svg {
  width: 18px;
  height: 18px;
}

.event-row {
  align-items: flex-start;
}

.event-dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: #4b5263;
  flex: 0 0 auto;
}

.event-dot.automation {
  background: var(--accent);
}

.event-dot.online {
  background: var(--green);
}

.event-dot.offline,
.event-dot.error {
  background: var(--red);
}

.event-message {
  font-size: 13px;
  line-height: 1.55;
}

.event-time {
  color: #5f6678;
  font-size: 11px;
  margin-top: 2px;
}

.hint {
  color: #5f6678;
  font-size: 12px;
  line-height: 1.7;
  padding: 0 4px;
}

.hint code {
  display: inline-block;
  max-width: 100%;
  margin-top: 6px;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: #aab3c7;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-all;
}

/* ---------- 底部导航 ---------- */

.tabbar {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 640px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px 14px calc(8px + var(--safe-bottom));
  background: rgba(10, 12, 17, 0.88);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.tab {
  border: none;
  background: none;
  color: #6f7789;
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 7px 0 5px;
  font-size: 11px;
  transition: color 0.18s;
}

.tab.active {
  color: var(--text);
}

.tab.active svg {
  color: var(--accent);
}

.tab svg {
  width: 22px;
  height: 22px;
}

/* ---------- 弹层 ---------- */

.sheet {
  position: fixed;
  inset: auto 0 0;
  margin: 0 auto;
  width: min(100%, 640px);
  max-width: none;
  max-height: 92vh;
  padding: 0;
  border: none;
  border-radius: 26px 26px 0 0;
  background: #12151d;
  color: var(--text);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.sheet[open] {
  animation: sheet-in 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sheet::backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
}

@keyframes sheet-in {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
}

.sheet-inner {
  padding: 10px 20px calc(24px + var(--safe-bottom));
  overflow-y: auto;
  max-height: 92vh;
}

.grabber {
  width: 38px;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.16);
  margin: 8px auto 18px;
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.sheet-head h2 {
  margin: 0;
  font-size: 20px;
}

.sheet-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.close-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.close-btn svg {
  width: 17px;
  height: 17px;
}

.big-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  margin-bottom: 18px;
}

.big-toggle .state-text {
  font-size: 20px;
  font-weight: 600;
}

.big-toggle .state-sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.prop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.prop {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.032);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.prop span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 5px;
}

.prop b {
  font-size: 17px;
  font-weight: 500;
}

.chart-box {
  padding: 16px 14px 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 18px;
}

.chart-box header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0 2px 8px;
}

.chart-box header b {
  font-size: 13px;
}

.chart-box header span {
  color: var(--muted);
  font-size: 11px;
}

.chart-box canvas {
  width: 100%;
  height: 120px;
  display: block;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  margin-bottom: 16px;
}

.segmented button {
  height: 40px;
  border: none;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  transition: background 0.18s, color 0.18s;
}

.segmented button.active {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.day {
  height: 38px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 12px;
}

.day.active {
  background: rgba(255, 122, 69, 0.16);
  border-color: rgba(255, 122, 69, 0.4);
  color: #ffb493;
}

.day.today {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}

.btn {
  height: 50px;
  padding: 0 18px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.055);
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.15s, filter 0.2s;
}

.btn:active {
  transform: scale(0.98);
}

.btn.primary {
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 10px 24px rgba(255, 92, 89, 0.22);
}

.btn.ghost {
  background: transparent;
}

.btn.danger {
  color: #ff8084;
  border-color: rgba(255, 90, 95, 0.25);
  background: rgba(255, 90, 95, 0.06);
}

.btn.block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
}

.credentials {
  margin-top: 16px;
  padding: 14px;
  border-radius: 14px;
  background: #0b0e14;
  border: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  line-height: 1.7;
  color: #b8c0d4;
  white-space: pre-wrap;
  word-break: break-all;
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 9px;
  padding: 5px 9px;
  font-size: 11px;
  font-family: inherit;
}

.notice-box {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 122, 69, 0.08);
  border: 1px solid rgba(255, 122, 69, 0.18);
  color: #ffb493;
  font-size: 12px;
  line-height: 1.65;
  margin-bottom: 16px;
}

.check-list {
  display: grid;
  gap: 8px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 13px;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  margin: 0;
}

.empty {
  padding: 42px 20px;
  text-align: center;
  border-radius: 22px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  color: var(--muted);
}

.empty .emoji {
  font-size: 34px;
  display: block;
  margin-bottom: 10px;
}

.empty p {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.7;
}

.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(96px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 100;
  display: grid;
  gap: 8px;
  width: min(88vw, 420px);
  pointer-events: none;
}

.toast {
  padding: 12px 16px;
  border-radius: 13px;
  background: rgba(30, 34, 45, 0.96);
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  font-size: 13px;
  text-align: center;
  animation: toast-in 0.2s ease;
}

.toast.good {
  border-color: rgba(55, 211, 155, 0.3);
}

.toast.bad {
  border-color: rgba(255, 90, 95, 0.35);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (max-width: 380px) {
  .app {
    padding-left: 14px;
    padding-right: 14px;
  }

  .device-grid,
  .scene-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 720px) {
  .device-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .scene-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
