:root {
  --bg: #eef2f9;
  --surface: #ffffff;
  --surface-soft: #f7f9fd;
  --line: #e2e9f4;
  --line-strong: #cfd9e8;
  --text: #0d1a2d;
  --muted: #66758e;
  --muted-2: #8a97ab;
  --primary: #2563eb;
  --primary-deep: #1d4ed8;
  --violet: #7c3aed;
  --green: #0da36a;
  --green-soft: #e7f8f0;
  --red: #e04848;
  --red-soft: #fdecec;
  --amber: #e79a13;
  --amber-soft: #fff6e3;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(13, 26, 45, .05), 0 6px 18px -10px rgba(13, 26, 45, .18);
  --shadow-md: 0 2px 4px rgba(13, 26, 45, .04), 0 18px 40px -18px rgba(13, 26, 45, .25);
  --shadow-lg: 0 40px 80px -30px rgba(4, 12, 28, .45);
  --font: "Inter", "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
  --mono: "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
svg { display: block; }
::selection { background: rgba(37, 99, 235, .18); }

/* ---------------- 通用控件 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, opacity .18s;
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb 55%, #6d28d9);
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(37, 99, 235, .65);
}
.btn.primary:hover { box-shadow: 0 12px 26px -10px rgba(37, 99, 235, .75); }
.btn.ghost { border-color: var(--line-strong); background: var(--surface); }
.btn.ghost:hover { border-color: #b9c6da; background: #fff; }
.btn.soft { background: rgba(37, 99, 235, .08); color: var(--primary); }
.btn.soft:hover { background: rgba(37, 99, 235, .14); }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.danger:hover { background: #fbdede; }
.btn.block { width: 100%; }
.btn.lg { height: 48px; border-radius: 14px; font-size: 15px; }
.btn[aria-busy="true"] { pointer-events: none; opacity: .7; }
.btn.spin svg { animation: spin 1s linear infinite; }

.icon-btn {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--muted);
  transition: all .18s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface-soft); }
.icon-btn.danger:hover { color: var(--red); border-color: #f3c4c4; background: var(--red-soft); }

.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-size: 13px; font-weight: 600; color: #40506a; }
.input, .select {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  outline: none;
  font-size: 14px;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.input::placeholder { color: #a4afc1; }
.input:focus, .select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}
.input.mono { font-family: var(--mono); letter-spacing: .04em; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2366758e' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }

.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.hint { font-size: 12px; color: var(--muted); line-height: 1.6; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--primary); }

/* ---------------- 启动占位 ---------------- */
.boot {
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: radial-gradient(1000px 600px at 70% 10%, #dbe7ff 0%, transparent 60%), var(--bg);
}
.boot-logo { width: 68px; height: 68px; border-radius: 20px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, #3b82f6, #6d28d9); box-shadow: 0 20px 40px -16px rgba(59, 130, 246, .8);
  animation: bootPulse 1.7s ease-in-out infinite; }
.boot-text { color: var(--muted); font-size: 14px; letter-spacing: .06em; }
@keyframes bootPulse { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-6px) scale(1.04); } }

/* ---------------- 登录页 ---------------- */
.auth { min-height: 100dvh; display: grid; grid-template-columns: 1.06fr 1fr; background: #0a1120; }
.auth-brand {
  position: relative; overflow: hidden;
  padding: clamp(32px, 5vw, 72px);
  display: flex; flex-direction: column; justify-content: space-between;
  color: #fff;
  background:
    radial-gradient(900px 500px at 15% 12%, rgba(59, 130, 246, .38), transparent 60%),
    radial-gradient(800px 600px at 90% 80%, rgba(124, 58, 237, .35), transparent 62%),
    linear-gradient(150deg, #0a1428 0%, #0b1220 55%, #0a0f1d 100%);
}
.auth-brand::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse at 40% 45%, #000 20%, transparent 72%);
  pointer-events: none;
}
.auth-brand > * { position: relative; z-index: 1; }
.brand-row { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, #3b82f6, #7c3aed);
  box-shadow: 0 10px 24px -8px rgba(99, 102, 241, .9);
}
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: .02em; }
.brand-sub { font-size: 11px; color: rgba(255,255,255,.5); letter-spacing: .18em; text-transform: uppercase; margin-top: 3px; }

.auth-copy h1 { font-size: clamp(34px, 3.7vw, 54px); line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
.auth-copy h1 span { background: linear-gradient(100deg, #7dd3fc, #a78bfa 60%, #f0abfc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-copy p { margin-top: 20px; max-width: 460px; color: rgba(232, 240, 255, .62); font-size: 15px; line-height: 1.9; }
.auth-points { list-style: none; margin: 34px 0 0; padding: 0; display: grid; gap: 14px; max-width: 470px; }
.auth-points li { display: flex; align-items: center; gap: 12px; font-size: 14px; color: rgba(232, 240, 255, .78); }
.auth-points .tick { width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center; background: rgba(59, 130, 246, .2); color: #93c5fd; border: 1px solid rgba(147, 197, 253, .22); }
.auth-models { display: flex; gap: 10px; flex-wrap: wrap; }
.auth-model { padding: 9px 15px; border-radius: 999px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.05); font-size: 13px; color: rgba(255,255,255,.75); backdrop-filter: blur(6px); }

.auth-panel { display: grid; place-items: center; padding: 28px; background: var(--bg); position: relative; overflow: hidden; }
.auth-panel::before { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(147,197,253,.5), transparent 66%); top: -220px; right: -200px; }
.auth-card { position: relative; width: min(420px, 100%); background: var(--surface); border: 1px solid rgba(255,255,255,.7); border-radius: 26px; box-shadow: var(--shadow-md); padding: 34px; }
.auth-mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 26px; }
.auth-tabs { display: flex; padding: 4px; background: var(--surface-soft); border-radius: 12px; margin-bottom: 26px; border: 1px solid var(--line); }
.auth-tabs button { flex: 1; height: 38px; border: 0; border-radius: 9px; background: transparent; font-size: 14px; font-weight: 600; color: var(--muted); transition: all .2s; }
.auth-tabs button.active { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }
.auth-form { display: grid; gap: 17px; }
.auth-form .field { gap: 8px; }
.auth-error { display: none; padding: 11px 14px; border-radius: 10px; background: var(--red-soft); color: #b23b3b; font-size: 13px; line-height: 1.5; }
.auth-error.show { display: block; animation: shake .3s ease; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 46px; }
.password-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: transparent; color: var(--muted-2); display: grid; place-items: center; border-radius: 8px; }
.password-toggle:hover { color: var(--text); background: var(--surface-soft); }
.auth-foot { margin-top: 26px; text-align: center; font-size: 12px; color: var(--muted-2); line-height: 1.7; }
.auth-note { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: #f1f6ff; color: #4b6382; font-size: 12px; line-height: 1.7; }

/* ---------------- 应用框架 ---------------- */
.app-shell { min-height: 100dvh; display: flex; flex-direction: column; background:
  radial-gradient(900px 420px at 12% -8%, #e0ebff 0%, transparent 58%),
  radial-gradient(760px 420px at 100% 0%, #ede4ff 0%, transparent 55%), var(--bg); }
.topbar { position: sticky; top: 0; z-index: 40; border-bottom: 1px solid rgba(226, 233, 244, .8); background: rgba(247, 249, 253, .82); backdrop-filter: blur(14px) saturate(1.4); }
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 0 24px; height: 66px; display: flex; align-items: center; gap: 18px; }
.topbar .brand { display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: 15px; }
.topbar .brand .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
.topnav { display: flex; align-items: center; gap: 4px; margin-left: 14px; }
.topnav a { padding: 8px 14px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--muted); transition: all .18s; }
.topnav a:hover { color: var(--text); background: rgba(13, 26, 45, .05); }
.topnav a.active { color: var(--primary); background: rgba(37, 99, 235, .09); }
.topbar-spacer { flex: 1; }
.userbox { display: flex; align-items: center; gap: 11px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; background: linear-gradient(140deg, #60a5fa, #7c3aed); box-shadow: 0 6px 14px -6px rgba(99, 102, 241, .8); }
.username { font-size: 13.5px; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-btn { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); display: grid; place-items: center; transition: all .18s; }
.logout-btn:hover { color: var(--red); border-color: #f0c9c9; background: var(--red-soft); }

.page { width: 100%; max-width: 1180px; margin: 0 auto; padding: 34px 24px 72px; flex: 1; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; letter-spacing: -.02em; font-weight: 800; margin-top: 6px; }
.page-head .sub { margin-top: 8px; color: var(--muted); font-size: 14px; }
.page-head .actions { display: flex; gap: 10px; }

/* ---------------- 概览 ---------------- */
.overview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 6px; }
.stat-card .label { font-size: 12px; font-weight: 600; color: var(--muted); }
.stat-card .value { font-size: 28px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.stat-card .value small { font-size: 13px; font-weight: 600; color: var(--muted-2); margin-left: 4px; }
.stat-card .value.online { color: var(--green); }
.stat-card .value.offline { color: var(--muted); }
.stat-card .value.pending { color: var(--amber); }

.bind-card { grid-column: 1 / -1; background: linear-gradient(135deg, #0f1e38, #16264a 55%, #231a4a); border-radius: var(--radius); padding: 20px 22px; color: #fff; box-shadow: 0 20px 40px -24px rgba(10, 22, 45, .8); position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(250px, 1fr) minmax(430px, 1.55fr); grid-template-rows: auto auto; align-items: center; column-gap: 26px; row-gap: 7px; }
.bind-card::after { content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%; right: -90px; top: -110px; background: radial-gradient(circle, rgba(124,58,237,.55), transparent 70%); }
.bind-card .bc-title { grid-column: 1; grid-row: 1; font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; position: relative; z-index: 1; }
.bind-card .bc-sub { grid-column: 1; grid-row: 2; font-size: 12px; color: rgba(230,238,255,.55); position: relative; z-index: 1; line-height: 1.6; }
.bind-form { grid-column: 2; grid-row: 1 / span 2; display: grid; grid-template-columns: minmax(0, 1fr) 128px auto; gap: 8px; position: relative; z-index: 1; }
.bind-form .input, .bind-form .select { height: 44px; border: 1px solid rgba(255,255,255,.18); background-color: rgba(255,255,255,.08); color: #fff; border-radius: 10px; }
.bind-form .input::placeholder { color: rgba(255,255,255,.4); }
.bind-form .input:focus, .bind-form .select:focus { border-color: rgba(147,197,253,.8); box-shadow: 0 0 0 3px rgba(59,130,246,.25); background-color: rgba(255,255,255,.12); }
.bind-form .select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; background-size: 14px 14px; }
.bind-form .select option { color: #0d1a2d; background: #fff; }
.bind-form .btn { height: 44px; background: #fff; color: #14213d; box-shadow: none; }
.bind-form .btn:hover { background: #e8f0ff; }

/* ---------------- 设备列表 ---------------- */
.notice-stack { display: grid; gap: 10px; margin: 0 0 20px; }
.pending-banner, .rejected-banner { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 14px; border: 1px solid #f0dfb5; background: linear-gradient(100deg, #fffaf0, #fffdf7); box-shadow: var(--shadow-sm); }
.rejected-banner { border-color: #f2cccc; background: linear-gradient(100deg, #fff7f7, #fffdfd); }
.pending-banner .pb-icon, .rejected-banner .pb-icon { width: 36px; height: 36px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--amber-soft); color: var(--amber); }
.rejected-banner .pb-icon { background: var(--red-soft); color: var(--red); }
.pending-banner .pb-body, .rejected-banner .pb-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pending-banner .pb-body b, .rejected-banner .pb-body b { font-size: 13px; font-weight: 700; }
.pending-banner .pb-body span, .rejected-banner .pb-body span { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.pending-banner .btn { margin-left: auto; flex: none; height: 34px; font-size: 12px; }
.btn-sm { height: 32px; padding: 0 11px; border-radius: 9px; font-size: 12px; gap: 5px; }

.section-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 14px; gap: 14px; }
.section-head h2 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.section-head .count { color: var(--muted); font-weight: 500; margin-left: 6px; }
.section-head .refresh { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--muted); font-size: 12.5px; padding: 6px 8px; border-radius: 8px; }
.section-head .refresh:hover { background: rgba(13,26,45,.05); color: var(--text); }
.section-head .refresh.spin svg { animation: spin 1s linear infinite; }

.device-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(276px, 1fr)); gap: 16px; }
.device-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); transition: transform .22s ease, box-shadow .22s ease, border-color .22s; display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.device-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, #3b82f6, #8b5cf6); opacity: 0; transition: opacity .22s; }
.device-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #d6e0f0; }
.device-card:hover::before { opacity: 1; }
.dc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.model-badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 7px; background: rgba(37, 99, 235, .08); color: var(--primary); font-size: 11.5px; font-weight: 700; letter-spacing: .02em; }
.model-badge.violet { background: rgba(124, 58, 237, .09); color: #6d28d9; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--muted); }
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: #b7c1d1; display: inline-block; }
.status-pill.online { color: var(--green); }
.status-pill.online i { background: var(--green); box-shadow: 0 0 0 4px rgba(13, 163, 106, .12); animation: breathe 2.4s ease-in-out infinite; }
.status-pill.offline { color: var(--muted-2); }
.status-pill.offline i { background: #aab6c7; }
@keyframes breathe { 0%,100% { box-shadow: 0 0 0 3px rgba(13,163,106,.10); } 50% { box-shadow: 0 0 0 6px rgba(13,163,106,.05); } }

.dc-title { font-size: 18px; font-weight: 700; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-code { font-family: var(--mono); font-size: 11.5px; line-height: 1.3; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: -3px; }
.dc-channels { display: flex; gap: 5px; align-items: center; }
.dc-channels span { flex: 1; height: 5px; border-radius: 3px; background: linear-gradient(90deg, #dbeafe, #ede9fe); }
.dc-channels span.lit { background: linear-gradient(90deg, #60a5fa, #7c3aed); }
.dc-meta { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); }
.dc-actions { display: flex; gap: 8px; margin-top: 2px; }
.dc-actions .btn { flex: 1; height: 38px; font-size: 13px; }

.empty { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 38px 24px; text-align: center; background: rgba(255,255,255,.55); }
.empty .empty-icon { width: 56px; height: 56px; margin: 0 auto 13px; border-radius: 18px; display: grid; place-items: center; background: #fff; box-shadow: var(--shadow-sm); color: var(--primary); }
.empty h3 { font-size: 17px; font-weight: 700; }
.empty p { margin: 8px auto 0; color: var(--muted); font-size: 13.5px; max-width: 360px; line-height: 1.8; }

/* ---------------- 定时 / 自动化 ---------------- */
.tool-entry { display: flex; align-items: center; gap: 15px; margin-top: 30px; padding: 18px 20px; cursor: pointer; transition: transform .18s, box-shadow .18s, border-color .18s; }
.tool-entry:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #cdd9ea; }
.tool-entry-icon { width: 50px; height: 50px; flex: none; border-radius: 15px; display: grid; place-items: center; color: #fff; background: linear-gradient(140deg, #3b82f6, #7c3aed); box-shadow: 0 12px 24px -12px rgba(99,102,241,.8); }
.tool-entry-main { flex: 1; min-width: 0; }
.tool-entry-main h3 { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.tool-entry-sub { margin-top: 5px; font-size: 12px; color: var(--muted); }
.tool-entry-arrow { color: var(--muted-2); flex: none; }
.tool-entry:hover .tool-entry-arrow { color: var(--primary); }

.tools-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(9,17,32,.48); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 22px; animation: fadeIn .18s ease; }
.tools-sheet { width: min(780px, 100%); max-height: min(88vh, 820px); background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; animation: popIn .22s cubic-bezier(.2,.9,.3,1.2); }
.tools-sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 22px 24px 0; }
.tools-sheet-head h2 { margin-top: 5px; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.tools-sheet-head .icon-btn { flex: none; }
.tools-tabs { display: flex; gap: 4px; margin: 18px 24px 0; padding: 4px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 12px; }
.tools-tabs button { flex: 1; height: 40px; border: 0; border-radius: 9px; background: transparent; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 13px; font-weight: 700; color: var(--muted); }
.tools-tabs button span { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: rgba(13,26,45,.06); display: inline-grid; place-items: center; font-size: 10.5px; }
.tools-tabs button.active { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }
.tools-tabs button.active span { background: rgba(37,99,235,.1); color: var(--primary); }
.tools-sheet-body { padding: 16px 24px 24px; overflow-y: auto; }
.tools-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; font-size: 12px; color: var(--muted); }
.tools-sheet-body .rule-list { gap: 9px; }
.tools-sheet-body .rule-empty { padding: 34px 20px; }

.tools-title { margin-top: 30px; }
.tools-title .hint { font-weight: 400; }
.tools-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tool-panel { align-self: start; }
.tool-panel .panel-head { padding: 17px 20px 0; }
.tool-panel .panel-body { padding: 14px 20px 20px; }
.rule-list { display: grid; gap: 9px; }
.rule-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) 38px 32px; align-items: center; gap: 11px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); transition: border-color .18s, background .18s; }
.rule-item:hover { border-color: #cdd9ea; background: #fbfcff; }
.rule-icon { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: rgba(37,99,235,.08); color: var(--primary); }
.rule-icon.auto { background: rgba(124,58,237,.09); color: #6d28d9; }
.rule-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.rule-title { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 12.5px; font-weight: 700; }
.rule-time { font-family: var(--mono); font-size: 14px; letter-spacing: .02em; }
.rule-days { font-size: 11px; font-weight: 600; color: var(--muted); background: #fff; border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; }
.rule-flow { font-size: 12px; font-weight: 700; line-height: 1.4; }
.rule-sub { font-size: 11px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.state-badge { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 5px; }
.state-badge.on { background: var(--green-soft); color: var(--green); }
.state-badge.off { background: var(--red-soft); color: var(--red); }
.rule-del { width: 32px; height: 32px; flex: none; border: 0; background: transparent; }
.rule-empty { border: 1px dashed var(--line-strong); border-radius: 12px; padding: 22px 14px; text-align: center; color: var(--primary); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rule-empty span { font-size: 13px; font-weight: 700; color: #40506a; }
.rule-empty small { font-size: 11px; color: var(--muted-2); line-height: 1.6; }

.switch { position: relative; width: 38px; height: 22px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; border-radius: 999px; background: #d5deec; transition: background .2s; }
.switch .slider::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; top: 3px; left: 3px; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked + .slider { background: linear-gradient(135deg, #34d399, #0da36a); }
.switch input:checked + .slider::after { transform: translateX(16px); }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 3px rgba(37,99,235,.25); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 4px; }
.weekday-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.weekday { display: inline-flex; align-items: center; gap: 5px; padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: 9px; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; transition: all .15s; background: #fff; }
.weekday input { accent-color: var(--primary); }
.weekday:has(input:checked) { border-color: var(--primary); background: rgba(37,99,235,.06); color: var(--primary); }
.auto-rule { display: grid; grid-template-columns: 34px 1fr 104px; align-items: center; gap: 8px; margin-top: 10px; }
.auto-key { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.auto-rule .select { height: 42px; }

/* ---------------- 账户 / 支持 ---------------- */
.account-title { margin-top: 30px; }
.account-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; }
.account-panel .panel-body { padding: 20px; }
.account-head { display: flex; align-items: center; gap: 13px; }
.account-avatar { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 19px; font-weight: 800; color: #fff; background: linear-gradient(140deg, #60a5fa, #7c3aed); box-shadow: 0 10px 20px -10px rgba(99,102,241,.8); flex: none; }
.account-name { min-width: 0; flex: 1; }
.account-name h3 { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.account-name p { margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.account-meta { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--muted); }
.support-panel { background: linear-gradient(135deg, #f0f7ff, #faf7ff); border-color: #dce7f7; }
.support-body { display: flex; align-items: flex-start; gap: 13px; padding: 20px; }
.support-icon { width: 44px; height: 44px; border-radius: 13px; background: #fff; color: var(--primary); display: grid; place-items: center; box-shadow: var(--shadow-sm); flex: none; }
.support-copy h3 { font-size: 15px; font-weight: 800; }
.support-copy p { margin-top: 5px; font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.support-phone { display: inline-block; margin-top: 8px; font-size: 20px; font-weight: 800; letter-spacing: .02em; color: var(--primary); font-variant-numeric: tabular-nums; }
.support-wx { margin-left: 7px; font-size: 11px; color: var(--muted); }

/* ---------------- 绑定凭证 ---------------- */
.proof-or { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--muted-2); font-size: 11px; }
.proof-or::before, .proof-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.proof-upload { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px dashed var(--line-strong); border-radius: 12px; cursor: pointer; background: var(--surface-soft); transition: all .18s; }
.proof-upload:hover { border-color: var(--primary); background: #f7faff; }
.proof-upload-icon { width: 38px; height: 38px; border-radius: 10px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; color: var(--primary); flex: none; }
.proof-upload-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.proof-upload-text b { font-size: 13px; }
.proof-upload-text small { font-size: 11px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proof-preview-wrap { margin-top: 12px; text-align: center; }
.proof-preview-wrap img { max-width: 100%; max-height: 180px; border-radius: 10px; border: 1px solid var(--line); }

/* ---------------- 多动作编辑 ---------------- */
.action-editor { display: grid; gap: 8px; margin-bottom: 9px; }
.action-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px 32px; gap: 7px; align-items: center; }
.action-row .select { height: 40px; padding-left: 10px; padding-right: 30px; font-size: 12px; }
.action-row .icon-btn { width: 32px; height: 32px; }
.auto-action { grid-template-columns: minmax(0, 1.15fr) minmax(0, .72fr) 82px 32px; }
.add-action-btn { width: 100%; border-style: dashed; }

/* ---------------- 头像 / 图标库 ---------------- */
.avatar-picker { display: flex; flex-wrap: wrap; gap: 9px; }
.avatar-choice { width: 42px; height: 42px; border-radius: 50%; border: 2px solid transparent; display: grid; place-items: center; color: #fff; cursor: pointer; opacity: .85; }
.avatar-choice:hover { opacity: 1; transform: translateY(-1px); }
.avatar-choice.selected { border-color: var(--text); box-shadow: 0 0 0 3px rgba(37,99,235,.15); opacity: 1; }
.icon-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-top: 14px; }
.icon-choice { height: 62px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-soft); color: #40506a; display: grid; place-items: center; cursor: pointer; transition: all .16s; }
.icon-choice:hover { border-color: var(--primary); color: var(--primary); background: #f7faff; }
.icon-choice.selected { border-color: var(--primary); color: var(--primary); background: rgba(37,99,235,.07); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.account-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-left: auto; }
.account-actions .btn { height: 32px; }
.account-contact { flex-basis: 100%; }
.dc-title-row { display: flex; align-items: center; gap: 10px; }
.dc-title-text { min-width: 0; }
.device-icon-btn { width: 40px; height: 40px; flex: none; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); color: var(--primary); display: grid; place-items: center; cursor: pointer; transition: all .18s; }
.device-icon-btn:hover { border-color: var(--primary); background: #f4f8ff; }
.hero-icon { cursor: pointer; border: 0; padding: 0; }
.hero-icon:hover { filter: brightness(1.05); transform: translateY(-2px); }

/* ---------------- 设备详情 ---------------- */
.back-link { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 18px; padding: 6px 10px 6px 6px; border-radius: 9px; transition: all .18s; }
.back-link:hover { color: var(--text); background: rgba(13,26,45,.05); }

.device-hero { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.device-hero .hero-icon { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; color: #fff; background: linear-gradient(140deg, #3b82f6, #6d28d9); box-shadow: 0 14px 30px -12px rgba(59, 130, 246, .7); flex: none; }
.device-hero h1 { font-size: 25px; font-weight: 800; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.device-hero .hero-sub { display: flex; align-items: center; gap: 10px; margin-top: 7px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.device-hero .hero-sub .dot-sep { color: var(--line-strong); }
.device-hero .hero-sub .mono { color: var(--muted-2); }
.hero-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.offline-banner { display: none; align-items: flex-start; gap: 10px; border: 1px solid #f3dfae; background: var(--amber-soft); color: #8a5a06; border-radius: 14px; padding: 12px 16px; font-size: 13px; line-height: 1.65; margin-bottom: 18px; }
.offline-banner.show { display: flex; animation: fadeUp .25s ease; }

.device-layout { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 18px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 0; }
.panel-head h2 { font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.panel-head .accent { width: 4px; height: 16px; border-radius: 2px; background: linear-gradient(180deg, #3b82f6, #7c3aed); display: inline-block; }
.panel-body { padding: 18px 22px 22px; }
.panel + .panel { margin-top: 16px; }

.relay-grid { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 12px; }
.relay-tile {
  position: relative; border: 1px solid var(--line); background: var(--surface-soft);
  border-radius: 16px; padding: 16px 14px; min-height: 128px;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 10px;
  transition: transform .18s ease, box-shadow .2s ease, background .2s ease, border-color .2s;
  overflow: hidden; text-align: left;
}
.relay-tile:hover { transform: translateY(-2px); border-color: #cdd9ea; box-shadow: 0 12px 24px -16px rgba(13, 26, 45, .35); }
.relay-tile:active { transform: scale(.985); }
.relay-tile .rt-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #fff; color: #94a3b8; border: 1px solid var(--line); transition: all .2s; }
.relay-tile .rt-text { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.relay-tile .rt-name { font-size: 13px; font-weight: 700; line-height: 1.2; }
.relay-tile .rt-state { font-size: 11.5px; color: var(--muted-2); font-weight: 600; letter-spacing: .02em; }
.relay-tile.on { border-color: transparent; background: linear-gradient(150deg, #10b981, #059669 65%, #047857); color: #fff; box-shadow: 0 16px 30px -18px rgba(5, 150, 105, .8); }
.relay-tile.on .rt-icon { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.22); }
.relay-tile.on .rt-name { color: #fff; }
.relay-tile.on .rt-state { color: rgba(255,255,255,.78); }
.relay-tile.pending { opacity: .65; pointer-events: none; }
.relay-tile.jog .rt-icon { background: rgba(245, 158, 11, .12); color: var(--amber); border-color: rgba(245, 158, 11, .25); }
.relay-tile.jog .rt-state { color: var(--amber); }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: var(--surface-soft); padding: 5px; border-radius: 13px; border: 1px solid var(--line); }
.segmented button { border: 0; background: transparent; border-radius: 9px; padding: 10px 4px 9px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); transition: all .2s; }
.segmented button svg { width: 17px; height: 17px; }
.segmented button.active { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }
.mode-desc { margin-top: 12px; font-size: 12px; color: var(--muted); line-height: 1.7; min-height: 40px; }
.mode-desc b { color: #40506a; }

.all-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.all-btn { height: 46px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 13.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: all .18s; }
.all-btn:hover:not(:disabled) { border-color: #b9c6da; background: var(--surface-soft); }
.all-btn.on { background: var(--green-soft); border-color: transparent; color: var(--green); }
.all-btn.off { background: var(--red-soft); border-color: transparent; color: var(--red); }
.all-btn:disabled { opacity: .38; cursor: not-allowed; }
.all-hint { margin-top: 10px; font-size: 11.5px; color: var(--muted-2); line-height: 1.65; }

.jog-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.jog-stepper { display: flex; align-items: center; gap: 4px; background: var(--surface-soft); border: 1px solid var(--line); padding: 4px; border-radius: 12px; }
.jog-stepper button { width: 40px; height: 38px; border: 0; border-radius: 9px; background: #fff; box-shadow: var(--shadow-sm); color: #40506a; display: grid; place-items: center; transition: all .15s; }
.jog-stepper button:hover:not(:disabled) { color: var(--primary); }
.jog-stepper button:active:not(:disabled) { transform: scale(.93); }
.jog-stepper button:disabled { opacity: .35; cursor: not-allowed; }
.jog-value { width: 74px; text-align: center; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.jog-value small { font-size: 11px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.jog-label { font-size: 12.5px; color: var(--muted); line-height: 1.6; }

.info-list { display: grid; gap: 1px; }
.info-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.info-row:last-child { border-bottom: 0; padding-bottom: 2px; }
.info-row .k { font-size: 12.5px; color: var(--muted); flex: none; padding-top: 1px; }
.info-row .v { font-size: 12.5px; font-weight: 600; text-align: right; word-break: break-all; line-height: 1.5; }
.info-row .v.mono { font-size: 11.5px; font-weight: 500; color: #40506a; }
.copy-btn { margin-left: 6px; border: 0; background: transparent; color: var(--muted-2); padding: 1px; border-radius: 4px; vertical-align: -2px; }
.copy-btn:hover { color: var(--primary); }
.signal { display: inline-flex; align-items: flex-end; gap: 2.5px; height: 14px; margin-right: 6px; vertical-align: -2px; }
.signal span { width: 3px; border-radius: 1px; background: #dbe3ef; }
.signal span:nth-child(1) { height: 5px; } .signal span:nth-child(2) { height: 8px; } .signal span:nth-child(3) { height: 11px; } .signal span:nth-child(4) { height: 14px; }
.signal.s2 span:nth-child(-n+1), .signal.s3 span:nth-child(-n+2), .signal.s4 span:nth-child(-n+3), .signal.s5 span:nth-child(-n+4) { background: var(--green); }
.signal.s1 span:nth-child(-n+1) { background: var(--red); }

.danger-row { display: flex; gap: 10px; }
.danger-row .btn { flex: 1; height: 40px; font-size: 13px; }

.skeleton { position: relative; overflow: hidden; background: #e9eef7; border-radius: 8px; color: transparent !important; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* ---------------- 弹窗 / 提示 ---------------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(9, 17, 32, .48); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 22px; animation: fadeIn .18s ease; }
.modal { width: min(460px, 100%); background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 26px; animation: popIn .22s cubic-bezier(.2,.9,.3,1.2); }
.modal h3 { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.modal p { margin-top: 9px; font-size: 13px; color: var(--muted); line-height: 1.75; }
.modal .modal-field { margin-top: 18px; }
.modal-actions { margin-top: 24px; display: flex; justify-content: flex-end; gap: 10px; }
.modal-actions .btn { min-width: 88px; }
.modal .danger-text { color: var(--red); font-weight: 700; }
.model-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.model-option { display: flex; align-items: center; gap: 10px; padding: 13px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); cursor: pointer; transition: all .18s; }
.model-option:hover { border-color: #b9c6da; background: var(--surface-soft); }
.model-option input { accent-color: var(--primary); width: 16px; height: 16px; flex: none; }
.model-option span { display: flex; flex-direction: column; gap: 2px; }
.model-option b { font-size: 14px; }
.model-option small { font-size: 11.5px; color: var(--muted); }
.model-option:has(input:checked) { border-color: var(--primary); background: rgba(37, 99, 235, .06); box-shadow: 0 0 0 3px rgba(37, 99, 235, .08); }

.toasts { position: fixed; z-index: 200; left: 50%; bottom: 26px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: min(92vw, 460px); }
.toast { display: flex; align-items: flex-start; gap: 10px; background: #101c30; color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 13px; line-height: 1.55; box-shadow: 0 18px 40px -18px rgba(0,0,0,.55); animation: toastIn .24s ease; max-width: 100%; }
.toast.out { animation: toastOut .2s ease forwards; }
.toast svg { flex: none; margin-top: 1px; }
.toast.success svg { color: #34d399; }
.toast.error svg { color: #f87171; }
.toast.info svg { color: #93c5fd; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(.97); } }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } }
@keyframes popIn { from { opacity: 0; transform: translateY(12px) scale(.97); } }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
  .overview { grid-template-columns: repeat(4, 1fr); }
  .bind-card { grid-column: 1 / -1; }
  .device-layout { grid-template-columns: 1fr; }
  .side { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
  .side .panel + .panel { margin-top: 0; }
}
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-panel { min-height: 100dvh; background: #0a1120; }
  .auth-panel::before { display: none; }
  .auth-card { border-radius: 22px; }
  .auth-mobile-brand { display: flex; }
  .auth-mobile-brand .brand-name { color: var(--text); }
  .auth-mobile-brand .brand-sub { color: var(--muted-2); }
}
@media (max-width: 720px) {
  .topbar-inner { padding: 0 16px; height: 60px; gap: 10px; }
  .topnav { display: none; }
  .username { display: none; }
  .page { padding: 24px 16px 60px; }
  .page-head h1 { font-size: 23px; }
  .overview { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px 16px; }
  .stat-card .value { font-size: 24px; }
  .bind-card { display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 16px; }
  .bind-form { grid-column: auto; grid-row: auto; grid-template-columns: 1fr; gap: 9px; }
  .bind-card .bc-sub { margin-bottom: 2px; }
  .device-grid { grid-template-columns: 1fr; }
  .side { grid-template-columns: 1fr; }
  .device-hero { gap: 13px; }
  .device-hero h1 { font-size: 21px; }
  .hero-actions { margin-left: 0; width: 100%; }
  .relay-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .relay-tile { min-height: 112px; }
  .panel-head { padding: 17px 17px 0; }
  .panel-body { padding: 15px 17px 18px; }
  .page-head .actions { width: auto; }
  .page-head .actions .btn { flex: none; }
  .tools-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .auto-rule { grid-template-columns: 32px 1fr 96px; }
  .pending-banner { flex-wrap: wrap; }
  .pending-banner .pb-body { flex: 1; }
  .pending-banner .btn { margin-left: 48px; width: calc(100% - 48px); }
  .account-grid { grid-template-columns: 1fr; }
  .auto-action { grid-template-columns: 1fr 1fr 32px; }
  .auto-action .auto-target-device { grid-column: 1 / -1; }
  .account-head { flex-wrap: wrap; }
  .account-actions { margin-left: 0; width: 100%; }
  .tools-overlay { padding: 10px; }
  .tools-sheet { max-height: 92vh; }
  .tools-sheet-head { padding: 18px 18px 0; }
  .tools-tabs { margin: 14px 18px 0; }
  .tools-sheet-body { padding: 14px 18px 18px; }
}
@media (max-width: 380px) {
  .relay-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .relay-tile { padding: 13px 12px; min-height: 104px; }
  .relay-tile .rt-icon { width: 34px; height: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
