:root {
  --bg: #06140e;
  --bg-2: #081c13;
  --panel: rgba(14, 40, 27, 0.86);
  --panel-solid: #0f2a1c;
  --panel-alt: #143420;
  --border: rgba(126, 255, 178, 0.13);
  --border-strong: rgba(126, 255, 178, 0.30);
  --text: #ecfff3;
  --muted: #8db7a0;
  --accent: #6ee7a0;
  --accent-2: #22c55e;
  --accent-deep: #0b6b3f;
  --bad: #fb7185;
  --bad-bg: rgba(244, 63, 94, 0.13);
  --warn: #fbbf24;
  --sky: #38bdf8;
  --orange: #fb923c;
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { color-scheme: dark; }
body {
  margin: 0;
  background:
    radial-gradient(1000px 520px at 100% -10%, rgba(74, 222, 128, 0.15), transparent 60%),
    radial-gradient(820px 520px at -10% 100%, rgba(20, 184, 166, 0.11), transparent 60%),
    linear-gradient(180deg, #06140e 0%, #071a12 55%, #05110c 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, sans-serif;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(126, 255, 178, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126, 255, 178, 0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 72%);
}
button, input { font: inherit; }
button { color: inherit; position: relative; }
[hidden] { display: none !important; }
::selection { background: rgba(110, 231, 160, 0.28); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- ambient background ---------- */
.ambient { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.orb { position: absolute; border-radius: 50%; filter: blur(34px); opacity: 0.5; animation: drift 18s var(--ease) infinite alternate; }
.o1 { width: 320px; height: 320px; right: -120px; top: 6%; background: radial-gradient(circle, rgba(34, 197, 94, 0.24), transparent 68%); }
.o2 { width: 280px; height: 280px; left: -140px; top: 58%; background: radial-gradient(circle, rgba(20, 184, 166, 0.18), transparent 68%); animation-delay: -6s; }
.o3 { width: 220px; height: 220px; right: 18%; bottom: -110px; background: radial-gradient(circle, rgba(251, 191, 36, 0.10), transparent 68%); animation-delay: -11s; }
.leaf { position: absolute; font-size: 5rem; opacity: 0.055; filter: blur(0.4px); animation: leafFloat 14s ease-in-out infinite alternate; }
.l1 { top: -2%; right: -3%; }
.l2 { top: 30%; left: -6%; font-size: 6rem; animation-delay: -3s; }
.l3 { bottom: 4%; right: 6%; font-size: 4rem; opacity: 0.075; animation-delay: -7s; }
.l4 { bottom: -4%; left: 10%; animation-delay: -5s; }
.l5 { top: 55%; right: 30%; font-size: 3.5rem; animation-delay: -9s; }
.spore { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); opacity: 0; box-shadow: 0 0 10px var(--accent); animation: sporeRise 11s linear infinite; }
.s1 { left: 16%; bottom: -2%; animation-delay: -2s; }
.s2 { left: 72%; bottom: -2%; animation-delay: -6s; animation-duration: 14s; }
.s3 { left: 42%; bottom: -2%; animation-delay: -9s; animation-duration: 16s; }
.s4 { left: 88%; bottom: -2%; animation-delay: -4s; animation-duration: 12s; }
.alarm-vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0;
  box-shadow: inset 0 0 140px rgba(251, 113, 133, 0.32);
  transition: opacity 0.6s var(--ease);
}
body.has-alarm .alarm-vignette { opacity: 1; animation: alarmVignette 2.4s ease-in-out infinite; }

/* ---------- shell ---------- */
.app-shell { position: relative; z-index: 2; max-width: 980px; margin: 0 auto; padding: 18px 16px 26px; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 4px 2px 16px; }
.brand-mark {
  position: relative; width: 52px; height: 52px; border-radius: 17px;
  background: linear-gradient(145deg, rgba(110, 231, 160, 0.95), #0d3b24 72%);
  display: grid; place-items: center; flex-shrink: 0; font-size: 1.45rem;
  box-shadow: 0 10px 26px rgba(34, 197, 94, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transform: perspective(600px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.35s var(--ease);
  overflow: hidden;
}
.brand-mark::before {
  content: ""; position: absolute; inset: -10px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25); opacity: 0.6;
  animation: breathe 3.2s ease-in-out infinite;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.28), transparent 70%);
  transform: translateX(-130%); animation: brandSheen 6s ease-in-out infinite;
}
.brand-bug { position: relative; z-index: 1; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3)); }
.brand-pulse { position: absolute; right: 7px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: #d9ffe7; box-shadow: 0 0 0 0 rgba(217, 255, 231, 0.55); animation: dotPulse 2s infinite; z-index: 2; }
.topbar-copy { flex: 1; min-width: 0; }
.topbar h1 { font-size: 1.14rem; margin: 0; letter-spacing: 0.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar p { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--muted); margin: 4px 0 0; font-variant-numeric: tabular-nums; }
.dot-sep { opacity: 0.4; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: dotPulse 2s infinite; flex-shrink: 0; }
.icon-button {
  position: relative; width: 46px; height: 46px; flex-shrink: 0; border-radius: 15px;
  background: linear-gradient(160deg, rgba(24, 60, 40, 0.95), rgba(11, 33, 22, 0.95));
  border: 1px solid var(--border); color: var(--text); cursor: pointer;
  display: grid; place-items: center; font-size: 1.12rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 20px rgba(0, 0, 0, 0.18);
  overflow: hidden; transition: scale 0.2s var(--spring), translate 0.2s var(--spring), border-color 0.2s;
}
.icon-button:hover { border-color: var(--border-strong); }
.icon-bell { display: inline-block; transition: transform 0.5s var(--spring); }
.icon-button:hover .icon-bell { transform: rotate(-14deg) scale(1.08); }
.notif-dot { position: absolute; top: 9px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--bad); border: 2px solid #0c2618; box-shadow: 0 0 10px rgba(251, 113, 133, 0.8); animation: dotPulse 1.4s infinite; }

/* ---------- navigation ---------- */
.bottom-nav {
  position: sticky; top: 7px; z-index: 20;
  display: flex; gap: 4px; overflow-x: auto; padding: 5px 4px 6px; margin-bottom: 18px;
  border: 1px solid rgba(126, 255, 178, 0.10); border-radius: 18px;
  background: rgba(6, 22, 15, 0.76);
  -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.045);
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.bottom-nav::-webkit-scrollbar { display: none; }
.nav-glider {
  position: absolute; left: 0; top: 0; width: 0; height: 0; border-radius: 13px; opacity: 0;
  background: linear-gradient(135deg, rgba(110, 231, 160, 0.20), rgba(34, 197, 94, 0.07));
  border: 1px solid var(--border-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10), 0 8px 20px rgba(0, 0, 0, 0.22);
  pointer-events: none; z-index: 0;
  transition: transform 0.46s var(--spring), width 0.34s var(--ease), height 0.34s var(--ease), opacity 0.2s;
}
.nav-item {
  position: relative; z-index: 1; flex: 0 0 auto; background: transparent; border: 0;
  color: var(--muted); padding: 10px 14px; border-radius: 13px; font-size: 0.82rem;
  white-space: nowrap; cursor: pointer; display: flex; align-items: center; gap: 6px;
  transition: color 0.2s, scale 0.2s var(--spring), translate 0.2s var(--spring);
  overflow: hidden;
}
.nav-item.selected { color: var(--accent); font-weight: 700; text-shadow: 0 0 18px rgba(110, 231, 160, 0.35); }
.nav-ico { display: inline-block; font-size: 1.02rem; transition: transform 0.38s var(--spring); }
.nav-item.selected .nav-ico { transform: translateY(-1px) scale(1.16) rotate(-3deg); }
.nav-item.is-pressing { scale: 0.92; translate: 0 2px; }

/* ---------- screens ---------- */
.screen { display: none; }
.screen.active { display: block; animation: screenIn 0.38s var(--ease) both; }
.screen.active > * { animation: riseIn 0.55s var(--ease) both; }
.screen.active > *:nth-child(2) { animation-delay: 0.045s; }
.screen.active > *:nth-child(3) { animation-delay: 0.09s; }
.screen.active > *:nth-child(4) { animation-delay: 0.135s; }
.screen.active > *:nth-child(5) { animation-delay: 0.18s; }
.screen.active > *:nth-child(6) { animation-delay: 0.225s; }

/* ---------- hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden; min-height: 218px;
  display: flex; align-items: center; padding: 30px 26px; margin-bottom: 16px;
  border-radius: 26px; border: 1px solid var(--border);
  background:
    radial-gradient(520px 240px at 92% -20%, rgba(110, 231, 160, 0.34), transparent 62%),
    radial-gradient(420px 240px at -8% 120%, rgba(34, 197, 94, 0.26), transparent 64%),
    linear-gradient(135deg, #103d27 0%, #0b2a1b 62%, #092317 100%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.4s var(--ease);
}
.hero::before {
  content: "🌿"; position: absolute; right: -18px; top: -28px; font-size: 8rem;
  opacity: 0.13; transform: rotate(-16deg); pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 20%, rgba(255, 255, 255, 0.06) 48%, transparent 70%);
  transform: translateX(-100%); animation: heroSheen 9s ease-in-out infinite;
}
.hero-text { position: relative; z-index: 3; max-width: 34rem; }
.hero-orbit { position: absolute; width: 310px; height: 310px; right: -58px; top: -80px; z-index: 1; opacity: 0.55; pointer-events: none; }
.hero-orbit i { position: absolute; border-radius: 50%; border: 1px dashed rgba(110, 231, 160, 0.26); inset: 0; animation: spin 28s linear infinite; }
.hero-orbit i:nth-child(2) { inset: 34px; border-style: solid; border-color: rgba(110, 231, 160, 0.13); animation-duration: 20s; animation-direction: reverse; }
.hero-orbit i:nth-child(3) { inset: 76px; border-color: rgba(34, 211, 238, 0.18); animation-duration: 14s; }
.hero-orbit i:nth-child(2)::before { content: ""; position: absolute; top: -4px; left: 50%; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 16px var(--accent); }
.hero-bug { position: absolute; right: 24px; bottom: 10px; font-size: 4.4rem; opacity: 0.18; z-index: 1; transform: rotate(-12deg); animation: bugHover 6s ease-in-out infinite; }
.eyebrow { color: var(--accent); font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.10em; margin: 0 0 8px; }
.hero h2 { margin: 0 0 18px; font-size: clamp(1.55rem, 4.2vw, 2.05rem); line-height: 1.08; letter-spacing: -0.02em; }
.hero h2 em {
  font-style: normal; background: linear-gradient(100deg, #d9ffe7, #6ee7a0 45%, #22d3ee);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.075); border: 1px solid var(--border); color: var(--accent);
  font-size: 0.78rem; font-weight: 700; line-height: 1; white-space: nowrap;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  transition: color 0.25s, border-color 0.25s, background 0.25s, transform 0.25s var(--spring);
}
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; box-shadow: 0 0 9px currentColor; }
.status-pill.bad { color: var(--bad); border-color: rgba(251, 113, 133, 0.55); background: rgba(251, 113, 133, 0.10); }
.status-pill.bad i { animation: dotPulse 1.2s infinite; }
.uptime-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 11px; border-radius: 999px;
  color: var(--muted); font-size: 0.72rem; font-variant-numeric: tabular-nums;
  border: 1px solid rgba(255, 255, 255, 0.07); background: rgba(0, 0, 0, 0.13);
}
.uptime-chip span { color: var(--text); font-weight: 600; }

/* ---------- notice ---------- */
.notice {
  position: relative; display: flex; gap: 12px; align-items: flex-start; overflow: hidden;
  background: linear-gradient(155deg, rgba(20, 52, 34, 0.95), rgba(12, 34, 23, 0.92));
  border: 1px solid var(--border); border-radius: 18px; padding: 15px 16px; margin-bottom: 16px;
  transition: border-color 0.35s, background 0.35s, box-shadow 0.35s;
}
.notice .check {
  width: 27px; height: 27px; border-radius: 50%; background: var(--accent); color: #06240f;
  display: grid; place-items: center; flex-shrink: 0; font-size: 0.82rem; font-weight: 900;
  box-shadow: 0 0 0 5px rgba(110, 231, 160, 0.08), 0 4px 12px rgba(34, 197, 94, 0.28);
  transition: background 0.25s, box-shadow 0.25s, transform 0.25s var(--spring);
}
.notice-copy { flex: 1; min-width: 0; }
.notice b { display: block; font-size: 0.92rem; }
.notice p { margin: 4px 0 0; color: var(--muted); font-size: 0.8rem; line-height: 1.42; }
.notice.is-alarm { border-color: rgba(251, 113, 133, 0.46); background: linear-gradient(155deg, rgba(63, 20, 29, 0.96), rgba(42, 14, 22, 0.94)); box-shadow: 0 0 0 1px rgba(251, 113, 133, 0.08), 0 18px 42px rgba(80, 10, 25, 0.2); }
.notice.is-alarm .check { background: var(--bad); color: #320610; animation: alarmPulse 1.5s ease-in-out infinite; box-shadow: 0 0 0 6px rgba(251, 113, 133, 0.10), 0 0 22px rgba(251, 113, 133, 0.4); }
.notice.is-alarm p { color: #ffc2cc; }
.notice-spark { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.16), transparent 65%); transform: translateX(-110%); }
.notice.is-alarm .notice-spark { opacity: 1; animation: noticeScan 2.8s ease-in-out infinite; }
.notice--compact { margin-bottom: 0; padding: 13px 14px; border-radius: 15px; }

/* ---------- metrics ---------- */
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(154px, 1fr)); gap: 13px; margin-bottom: 16px; }
.metric {
  position: relative; overflow: hidden; min-height: 148px; cursor: pointer;
  background: linear-gradient(158deg, rgba(18, 48, 32, 0.92), rgba(11, 31, 21, 0.90));
  border: 1px solid var(--border); border-radius: 19px; padding: 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 12px 30px rgba(0, 0, 0, 0.13);
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.35s var(--ease), translate 0.3s var(--spring), scale 0.22s var(--spring), border-color 0.25s, box-shadow 0.3s;
}
.metric::before, .sensor-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), rgba(110, 231, 160, 0.13), transparent 62%);
  transition: opacity 0.3s;
}
.metric:hover { border-color: var(--border-strong); translate: 0 -3px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055), 0 20px 42px rgba(0, 0, 0, 0.24); }
.metric:hover::before, .sensor-card:hover::before { opacity: 1; }
.metric.is-pressing { scale: 0.965; translate: 0 2px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 5px 14px rgba(0, 0, 0, 0.2); }
.metric > * { position: relative; z-index: 1; }
.metric-icon {
  font-size: 1.2rem; display: inline-grid; width: 37px; height: 37px; place-items: center;
  border-radius: 11px; background: rgba(110, 231, 160, 0.11); border: 1px solid rgba(110, 231, 160, 0.09);
}
.metric--temp .metric-icon { background: rgba(251, 146, 60, 0.14); border-color: rgba(251, 146, 60, 0.10); }
.metric--hum .metric-icon { background: rgba(56, 189, 248, 0.14); border-color: rgba(56, 189, 248, 0.10); }
.metric--spray .metric-icon { background: rgba(167, 139, 250, 0.14); border-color: rgba(167, 139, 250, 0.10); }
.metric-arrow { position: absolute; top: 17px; right: 15px; color: var(--muted); font-size: 0.9rem; opacity: 0.55; transition: transform 0.3s var(--spring), color 0.25s, opacity 0.25s; }
.metric:hover .metric-arrow { color: var(--accent); opacity: 1; transform: translate(2px, -2px); }
.metric p { color: var(--muted); font-size: 0.68rem; margin: 13px 0 5px; text-transform: uppercase; letter-spacing: 0.055em; font-weight: 700; }
.metric strong { font-size: clamp(1.25rem, 4vw, 1.55rem); display: block; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.metric small { display: block; margin-top: 7px; font-size: 0.74rem; font-weight: 600; }
.metric small.good, .good { color: var(--accent); }
.metric small.bad, .bad { color: var(--bad); }
.metric-note { color: var(--muted) !important; font-weight: 500 !important; }

/* ---------- panels ---------- */
.panel {
  position: relative; overflow: hidden; margin-bottom: 16px; padding: 18px;
  border: 1px solid var(--border); border-radius: 21px;
  background: linear-gradient(158deg, rgba(16, 45, 30, 0.88), rgba(9, 28, 19, 0.84));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 16px 38px rgba(0, 0, 0, 0.14);
}
.panel::before { content: ""; position: absolute; top: 0; left: 18px; right: 18px; height: 1px; background: linear-gradient(90deg, transparent, rgba(110, 231, 160, 0.24), transparent); pointer-events: none; }
.panel h3 { margin: 0; font-size: 0.98rem; letter-spacing: -0.01em; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.section-head .muted { margin-top: 4px; }
.muted { color: var(--muted); font-size: 0.82rem; line-height: 1.45; margin: 0; }
.mini-badge, .live-badge { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; font-size: 0.64rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; white-space: nowrap; }
.mini-badge { color: var(--muted); border: 1px solid var(--border); background: rgba(255, 255, 255, 0.035); }
.live-badge { color: var(--accent); border: 1px solid rgba(110, 231, 160, 0.24); background: rgba(110, 231, 160, 0.08); box-shadow: 0 0 16px rgba(110, 231, 160, 0.08); }
.live-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; margin-right: 5px; animation: dotPulse 2s infinite; }

/* ---------- activities ---------- */
.activity-list { margin-top: 10px; }
.activity { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-bottom: 1px solid rgba(126, 255, 178, 0.075); }
.activity:last-child { border-bottom: 0; padding-bottom: 2px; }
.activity-icon { width: 34px; height: 34px; flex-shrink: 0; display: grid; place-items: center; border-radius: 10px; background: rgba(110, 231, 160, 0.075); border: 1px solid rgba(110, 231, 160, 0.08); font-size: 0.92rem; }
.activity > div { flex: 1; min-width: 0; }
.activity b { font-size: 0.84rem; display: block; }
.activity p { margin: 3px 0 0; color: var(--muted); font-size: 0.76rem; line-height: 1.35; overflow-wrap: anywhere; }
.activity-ok { margin-left: auto; color: var(--accent); font-weight: 800; font-size: 0.78rem; }
.activity-ok--live { color: var(--accent); font-size: 0.56rem; animation: dotPulse 2s infinite; }

/* ---------- buttons ---------- */
button.primary, button.ghost { position: relative; overflow: hidden; cursor: pointer; border-radius: 13px; padding: 11px 16px; font-weight: 750; font-size: 0.84rem; touch-action: manipulation; }
button.primary {
  border: 1px solid rgba(255, 255, 255, 0.20); color: #052b17;
  background: linear-gradient(135deg, #a7f3c4 0%, #6ee7a0 45%, #34d399 100%);
  box-shadow: 0 4px 0 #08633a, 0 12px 24px rgba(34, 197, 94, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: translate 0.18s var(--spring), scale 0.18s var(--spring), box-shadow 0.18s var(--ease), filter 0.2s;
}
button.primary::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.44), transparent 68%);
  transform: translateX(-130%); transition: transform 0.55s var(--ease);
}
button.primary:hover { filter: brightness(1.04); }
button.primary:hover::after { transform: translateX(130%); }
button.primary.is-pressing, button.primary:active { translate: 0 3px; scale: 0.985; box-shadow: 0 1px 0 #08633a, 0 5px 12px rgba(34, 197, 94, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
button.ghost, .form-row button:not(.primary) {
  border: 1px solid var(--border); color: var(--text);
  background: linear-gradient(160deg, rgba(22, 55, 36, 0.95), rgba(14, 38, 25, 0.95));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 18px rgba(0, 0, 0, 0.10);
  transition: translate 0.18s var(--spring), scale 0.18s var(--spring), border-color 0.2s, background 0.2s, box-shadow 0.18s;
}
button.ghost:hover { border-color: var(--border-strong); background: linear-gradient(160deg, rgba(27, 66, 43, 0.98), rgba(15, 43, 28, 0.98)); }
button.ghost.is-pressing, button.ghost:active, .form-row button:not(.primary):active { translate: 0 2px; scale: 0.975; box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.25); }
button:disabled { cursor: not-allowed; opacity: 0.55; }
.text-button { position: relative; background: transparent; border: 0; color: var(--accent); font-size: 0.8rem; font-weight: 650; cursor: pointer; padding: 7px 5px; border-radius: 8px; overflow: hidden; transition: color 0.2s, scale 0.2s var(--spring); }
.text-button:hover { color: #b5ffd0; }
.text-button.is-pressing { scale: 0.94; }

/* ---------- press ripple ---------- */
.press-ripple {
  position: absolute; border-radius: 50%; pointer-events: none; z-index: 4;
  background: radial-gradient(circle, rgba(210, 255, 226, 0.38) 0%, rgba(110, 231, 160, 0.16) 38%, transparent 68%);
  transform: scale(0); opacity: 0.8; mix-blend-mode: screen;
  animation: rippleOut 0.68s var(--ease) forwards;
}
.is-pressing { --press: 1; }

/* ---------- forms ---------- */
.add-form { margin-top: 14px; }
.add-form label { display: block; font-size: 0.73rem; color: var(--muted); margin-bottom: 7px; font-weight: 600; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; }
.form-row > button { flex: 0 1 auto; }
.time-field {
  flex: 1; min-width: 138px; display: flex; align-items: center; gap: 8px;
  background: rgba(8, 26, 17, 0.75); border: 1px solid var(--border); border-radius: 13px; padding: 0 12px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.time-field:focus-within { border-color: rgba(110, 231, 160, 0.6); box-shadow: 0 0 0 3px rgba(110, 231, 160, 0.09); background: rgba(10, 32, 21, 0.9); }
.time-field > span { opacity: 0.7; font-size: 0.88rem; }
.time-field input { width: 100%; min-width: 0; background: transparent; border: 0; color: var(--text); padding: 11px 0; outline: 0; font-variant-numeric: tabular-nums; }
.time-field input::-webkit-calendar-picker-indicator { filter: invert(0.8); opacity: 0.65; cursor: pointer; }

/* ---------- schedules ---------- */
.schedule-list { margin: 14px 0 10px; display: flex; flex-direction: column; gap: 8px; }
.schedule-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: linear-gradient(160deg, rgba(20, 51, 33, 0.92), rgba(13, 37, 24, 0.9));
  border: 1px solid var(--border); border-radius: 13px; padding: 9px 11px 9px 14px;
  font-size: 0.88rem; animation: rowIn 0.38s var(--spring) both;
  transition: border-color 0.2s, background 0.2s, translate 0.2s var(--spring);
}
.schedule-row:hover { border-color: var(--border-strong); translate: 2px 0; }
.schedule-time { display: inline-flex; align-items: center; gap: 9px; font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: 0.02em; }
.schedule-time::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.schedule-row button { width: 30px; height: 30px; display: grid; place-items: center; background: transparent; border: 1px solid transparent; border-radius: 9px; color: var(--muted); font-size: 0.85rem; cursor: pointer; overflow: hidden; transition: color 0.2s, background 0.2s, scale 0.2s var(--spring); }
.schedule-row button:hover { color: var(--bad); background: var(--bad-bg); }
.schedule-row.is-removing { animation: rowOut 0.24s var(--ease) forwards; pointer-events: none; }
.schedule-empty { color: var(--muted); font-size: 0.8rem; padding: 12px; border: 1px dashed rgba(126, 255, 178, 0.15); border-radius: 12px; text-align: center; background: rgba(0, 0, 0, 0.08); }
.next-reminder { font-size: 0.74rem; color: var(--muted); margin: 9px 0 0; font-variant-numeric: tabular-nums; }
.next-reminder b { color: var(--accent); }
.feed-status { margin-top: 12px; }
.subheading { margin: 20px 0 2px; font-size: 0.88rem; }

/* ---------- automatic feeding ---------- */
.feed-schedule-card {
  display: flex; align-items: center; gap: 16px; margin-top: 15px; padding: 15px;
  border: 1px solid var(--border); border-radius: 16px;
  background:
    radial-gradient(260px 120px at 0% 100%, rgba(110, 231, 160, 0.10), transparent 70%),
    linear-gradient(150deg, rgba(20, 52, 34, 0.88), rgba(11, 32, 21, 0.84));
}
.feed-clock { display: flex; flex-direction: column; line-height: 0.95; font-size: 2.2rem; font-weight: 800; letter-spacing: -0.055em; color: var(--text); font-variant-numeric: tabular-nums; }
.feed-clock span { font-size: 0.58rem; letter-spacing: 0.14em; color: var(--accent); margin-top: 7px; font-weight: 800; }
.feed-next-block { flex: 1; min-width: 0; }
.feed-next-block > span { display: block; color: var(--muted); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.07em; font-weight: 700; }
.feed-next-block b { display: block; font-size: 1.06rem; margin-top: 3px; font-variant-numeric: tabular-nums; }
.feed-next-block small { display: block; color: var(--muted); font-size: 0.68rem; margin-top: 3px; line-height: 1.35; }
.feed-schedule-card .mini-badge { align-self: flex-start; }
.feed-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.feed-step {
  display: flex; gap: 8px; align-items: flex-start; padding: 10px 9px; min-height: 58px;
  border: 1px solid var(--border); border-radius: 12px; background: rgba(0, 0, 0, 0.10);
  opacity: 0.52; transition: opacity 0.25s, border-color 0.25s, background 0.25s, scale 0.25s var(--spring);
}
.feed-step > span {
  width: 20px; height: 20px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%;
  font-size: 0.62rem; font-weight: 800; color: var(--muted); background: rgba(255, 255, 255, 0.07);
}
.feed-step b { display: block; font-size: 0.72rem; line-height: 1.25; }
.feed-step small { display: block; color: var(--muted); font-size: 0.62rem; margin-top: 3px; line-height: 1.3; }
.feed-step.is-active { opacity: 1; border-color: rgba(110, 231, 160, 0.55); background: rgba(110, 231, 160, 0.10); box-shadow: 0 0 0 1px rgba(110, 231, 160, 0.08), 0 8px 20px rgba(0, 0, 0, 0.12); scale: 1.015; }
.feed-step.is-active > span { color: #052b17; background: var(--accent); box-shadow: 0 0 12px rgba(110, 231, 160, 0.5); }
.feed-step.is-done { opacity: 0.9; border-color: rgba(110, 231, 160, 0.22); }
.feed-step.is-done > span { color: var(--accent); background: rgba(110, 231, 160, 0.14); }
.feed-live { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: 13px; border: 1px solid var(--border); background: rgba(0, 0, 0, 0.12); }
.feed-live-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--muted); box-shadow: 0 0 0 4px rgba(141, 183, 160, 0.08); }
.feed-live > div { flex: 1; min-width: 0; }
.feed-live b { display: block; font-size: 0.8rem; }
.feed-live p { margin: 3px 0 0; color: var(--muted); font-size: 0.72rem; line-height: 1.35; }
.feed-live.is-active { border-color: rgba(110, 231, 160, 0.35); background: rgba(110, 231, 160, 0.07); }
.feed-live.is-active .feed-live-dot { background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: dotPulse 1.4s infinite; }
.feed-live.is-done .feed-live-dot { background: var(--accent); box-shadow: 0 0 8px rgba(110, 231, 160, 0.5); }
.data-rows { margin-top: 13px; display: flex; flex-direction: column; gap: 8px; }
.data-rows .relay-row { margin-top: 0; }

/* ---------- sensor cards ---------- */
.sensor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-bottom: 16px; }
.sensor-card {
  position: relative; overflow: hidden; padding: 16px; border-radius: 19px; border: 1px solid var(--border);
  background: linear-gradient(158deg, rgba(18, 48, 32, 0.92), rgba(11, 31, 21, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 12px 30px rgba(0, 0, 0, 0.13);
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.35s var(--ease), translate 0.3s var(--spring), border-color 0.25s, box-shadow 0.3s;
}
.sensor-card:hover { border-color: var(--border-strong); translate: 0 -2px; }
.sensor-card > *:not(.press-ripple) { position: relative; z-index: 1; }
.sensor-heading { display: flex; align-items: center; gap: 11px; }
.sensor-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: rgba(110, 231, 160, 0.08); font-size: 1rem; flex-shrink: 0; }
.sensor-heading > div { flex: 1; min-width: 0; }
.sensor-heading p { margin: 0; color: var(--muted); font-size: 0.74rem; }
.sensor-heading strong { font-size: 1.32rem; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.sensor-heading .status-pill { margin-left: auto; padding: 5px 8px; font-size: 0.66rem; }
.range { color: var(--muted); font-size: 0.72rem; margin: 12px 0 0; line-height: 1.4; }
.relay-row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding: 9px 11px; border-radius: 11px; border: 1px solid rgba(126, 255, 178, 0.09); background: rgba(0, 0, 0, 0.10); font-size: 0.76rem; color: var(--muted); }
.relay-row b { color: var(--text); font-size: 0.76rem; }

/* ---------- trend chart ---------- */
.trend-head { align-items: flex-start; }
.trend-tabs { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--border); border-radius: 12px; background: rgba(0, 0, 0, 0.13); flex-shrink: 0; }
.trend-tab { position: relative; overflow: hidden; border: 0; border-radius: 9px; padding: 7px 9px; color: var(--muted); background: transparent; font-size: 0.70rem; font-weight: 700; cursor: pointer; white-space: nowrap; transition: color 0.2s, background 0.25s, box-shadow 0.25s, scale 0.2s var(--spring); }
.trend-tab.is-active { color: var(--text); background: linear-gradient(150deg, rgba(34, 68, 45, 0.98), rgba(20, 48, 31, 0.98)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 10px rgba(0, 0, 0, 0.18); }
.trend-tab.is-pressing { scale: 0.93; }
.trend-wrap {
  position: relative; height: 176px; margin-top: 14px; overflow: hidden; border-radius: 15px;
  border: 1px solid rgba(126, 255, 178, 0.09);
  background:
    radial-gradient(360px 150px at 70% 0%, rgba(251, 146, 60, 0.055), transparent 70%),
    linear-gradient(180deg, rgba(5, 20, 12, 0.72), rgba(7, 24, 15, 0.35));
}
.trend-wrap canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.trend-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 0.78rem; pointer-events: none; text-align: center; padding: 20px; }
.trend-empty::before { content: "〰"; display: block; font-size: 1.7rem; color: rgba(110, 231, 160, 0.4); margin-bottom: 4px; }
.trend-tip {
  position: absolute; z-index: 3; pointer-events: none; padding: 6px 9px; border-radius: 9px;
  background: rgba(4, 18, 11, 0.94); border: 1px solid var(--border-strong); color: var(--text);
  font-size: 0.68rem; font-variant-numeric: tabular-nums; white-space: nowrap;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35); transform: translate(-50%, -115%);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.trend-tip b { color: var(--accent); }
.trend-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 11px; color: var(--muted); font-size: 0.69rem; font-variant-numeric: tabular-nums; }
.trend-meta b { color: var(--text); font-size: 0.8rem; padding: 4px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); }

/* ---------- cycle card ---------- */
.cycle-card {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 20px;
  padding: 18px; margin-bottom: 16px; border-radius: 22px; border: 1px solid var(--border);
  background:
    radial-gradient(340px 200px at 8% 100%, rgba(34, 211, 238, 0.12), transparent 65%),
    linear-gradient(145deg, rgba(18, 50, 33, 0.94), rgba(10, 29, 19, 0.92));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.055);
}
.cycle-card::after { content: ""; position: absolute; width: 160px; height: 160px; border-radius: 50%; right: -50px; top: -70px; border: 1px dashed rgba(110, 231, 160, 0.16); animation: spin 22s linear infinite; pointer-events: none; }
.cycle-ring { position: relative; width: 120px; height: 120px; flex-shrink: 0; }
.cycle-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.cycle-ring circle { fill: none; stroke-width: 8; stroke-linecap: round; }
.cycle-bg { stroke: rgba(126, 255, 178, 0.10); }
.cycle-arc { stroke: url(#ringGrad); stroke-dasharray: 326.73; stroke-dashoffset: 326.73; transition: stroke-dashoffset 1s linear; filter: drop-shadow(0 0 6px rgba(110, 231, 160, 0.5)); }
.cycle-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.cycle-center b { font-size: 1.22rem; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.cycle-center span { color: var(--muted); font-size: 0.56rem; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 4px; max-width: 70px; line-height: 1.25; }
.cycle-copy { flex: 1; min-width: 0; position: relative; z-index: 1; }
.cycle-copy h3 { margin: 0 0 5px; font-size: 1rem; }
.cycle-copy .eyebrow { margin-bottom: 5px; font-size: 0.62rem; }
.cycle-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.cycle-badges span { font-size: 0.64rem; color: var(--muted); padding: 4px 8px; border-radius: 999px; border: 1px solid var(--border); background: rgba(255, 255, 255, 0.035); font-variant-numeric: tabular-nums; }
.cycle-card.is-spraying .cycle-ring { animation: ringPulse 1.5s ease-in-out infinite; }
.cycle-card.is-spraying .cycle-arc { filter: drop-shadow(0 0 12px rgba(34, 211, 238, 0.8)); }

/* ---------- settings ---------- */
.setting-list { padding: 4px 12px; }
.setting-item { display: flex; align-items: center; gap: 12px; padding: 13px 2px; border-bottom: 1px solid rgba(126, 255, 178, 0.075); transition: background 0.2s, padding-left 0.25s var(--ease); }
.setting-item:last-child { border-bottom: 0; }
.setting-icon { width: 35px; height: 35px; flex-shrink: 0; display: grid; place-items: center; border-radius: 10px; background: rgba(110, 231, 160, 0.07); border: 1px solid rgba(126, 255, 178, 0.07); font-size: 0.9rem; }
.setting-item > div { flex: 1; min-width: 0; }
.setting-item b { font-size: 0.85rem; display: block; }
.setting-item p { margin: 3px 0 0; color: var(--muted); font-size: 0.73rem; line-height: 1.38; }
.setting-chevron { margin-left: auto; color: var(--muted); font-size: 1.1rem; opacity: 0.55; }
.setting-item.is-highlight { animation: settingHighlight 1.2s var(--ease); }
.logout { position: relative; overflow: hidden; width: 100%; background: var(--bad-bg); border: 1px solid rgba(251, 113, 133, 0.55); color: var(--bad); font-weight: 750; border-radius: 14px; padding: 13px; cursor: pointer; margin-top: 4px; transition: scale 0.2s var(--spring), translate 0.2s var(--spring), background 0.2s, box-shadow 0.2s; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045); }
.logout:hover { background: rgba(244, 63, 94, 0.2); }
.logout.is-pressing { scale: 0.98; translate: 0 2px; }

/* ---------- switches ---------- */
.switch { position: relative; display: inline-block; width: 46px; height: 25px; flex-shrink: 0; margin-left: auto; transition: scale 0.2s var(--spring); }
.switch:active { scale: 0.92; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: rgba(126, 255, 178, 0.10); border: 1px solid rgba(126, 255, 178, 0.13); border-radius: 999px; transition: background 0.28s, border-color 0.28s, box-shadow 0.28s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 17px; height: 17px; left: 3px; top: 3px; background: #e8fff0; border-radius: 50%; transition: transform 0.38s var(--spring), background 0.25s; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.28); }
.switch input:checked + span { background: linear-gradient(120deg, #34d399, #22c55e); border-color: rgba(110, 231, 160, 0.65); box-shadow: 0 0 16px rgba(34, 197, 94, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.switch input:checked + span::before { transform: translateX(21px); background: #fff; }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- modal ---------- */
.sheet {
  width: min(560px, calc(100vw - 28px)); max-height: min(76vh, 640px); padding: 0; overflow: hidden;
  color: var(--text); background: #0a2317; border: 1px solid var(--border-strong); border-radius: 24px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6); margin: auto;
}
.sheet[open] { animation: sheetIn 0.45s var(--spring) both; }
.sheet::backdrop { background: rgba(2, 10, 7, 0.72); -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px); animation: backdropIn 0.3s ease both; }
.sheet-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 18px 14px; background: linear-gradient(180deg, #0d2b1c 80%, rgba(13, 43, 28, 0.94)); border-bottom: 1px solid var(--border); }
.sheet-head .eyebrow { margin-bottom: 4px; font-size: 0.62rem; }
.sheet-head h2 { margin: 0; font-size: 1.05rem; }
.sheet-close { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: rgba(255, 255, 255, 0.05); color: var(--text); cursor: pointer; font-size: 0.8rem; overflow: hidden; transition: scale 0.2s var(--spring), background 0.2s; }
.sheet-close:hover { background: rgba(251, 113, 133, 0.14); color: var(--bad); }
.sheet-close.is-pressing { scale: 0.9; }
.event-list { overflow-y: auto; max-height: calc(min(76vh, 640px) - 78px); padding: 10px 18px 20px; overscroll-behavior: contain; }
.event { position: relative; display: flex; gap: 11px; padding: 11px 0; border-bottom: 1px solid rgba(126, 255, 178, 0.075); }
.event:last-child { border-bottom: 0; }
.event-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; background: var(--accent); box-shadow: 0 0 8px rgba(110, 231, 160, 0.55); }
.event--warn .event-dot { background: var(--warn); box-shadow: 0 0 8px rgba(251, 191, 36, 0.55); }
.event--alarm .event-dot { background: var(--bad); box-shadow: 0 0 9px rgba(251, 113, 133, 0.7); animation: dotPulse 1.3s infinite; }
.event-copy { flex: 1; min-width: 0; }
.event-copy b { display: block; font-size: 0.8rem; line-height: 1.4; overflow-wrap: anywhere; font-weight: 600; }
.event-copy span { display: block; color: var(--muted); font-size: 0.68rem; margin-top: 3px; font-variant-numeric: tabular-nums; }
.event-empty { padding: 30px 10px; text-align: center; color: var(--muted); font-size: 0.82rem; }

/* ---------- toasts ---------- */
.toast-stack { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; width: min(430px, calc(100vw - 26px)); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px;
  border-radius: 14px; border: 1px solid var(--border-strong);
  background: rgba(8, 30, 19, 0.96); box-shadow: 0 16px 42px rgba(0, 0, 0, 0.42);
  animation: toastIn 0.45s var(--spring) both; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.toast.is-leaving { animation: toastOut 0.24s var(--ease) both; }
.toast-icon { width: 25px; height: 25px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: rgba(110, 231, 160, 0.14); color: var(--accent); font-size: 0.7rem; font-weight: 900; }
.toast--warn { border-color: rgba(251, 191, 36, 0.45); }
.toast--warn .toast-icon { color: var(--warn); background: rgba(251, 191, 36, 0.13); }
.toast--alarm { border-color: rgba(251, 113, 133, 0.5); }
.toast--alarm .toast-icon { color: var(--bad); background: rgba(251, 113, 133, 0.14); }
.toast-text { flex: 1; font-size: 0.78rem; line-height: 1.35; }
.toast-close { width: 28px; height: 28px; flex-shrink: 0; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 0.72rem; overflow: hidden; }
.toast-close:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }

/* ---------- page titles / misc ---------- */
.page-title { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.mini-icon { width: 42px; height: 42px; border-radius: 13px; background: linear-gradient(150deg, rgba(25, 60, 40, 0.95), rgba(12, 35, 23, 0.95)); border: 1px solid var(--border); display: grid; place-items: center; font-size: 1.08rem; flex-shrink: 0; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); }
.page-title h2 { margin: 0; font-size: 1.1rem; letter-spacing: -0.015em; }
.page-title p { margin: 3px 0 0; color: var(--muted); font-size: 0.78rem; line-height: 1.35; }
.info-card { border: 1px solid var(--border); border-radius: 16px; padding: 14px; background: linear-gradient(155deg, rgba(18, 48, 32, 0.82), rgba(10, 29, 19, 0.78)); font-size: 0.8rem; color: var(--muted); line-height: 1.5; }
.footnote { color: var(--muted); font-size: 0.72rem; text-align: center; margin: 12px 0 2px; line-height: 1.5; }

/* ---------- account, role and read-only mode ---------- */
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.logout-button {
  height: 42px; padding: 0 13px; border-radius: 13px; border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(22, 55, 36, 0.95), rgba(14, 38, 25, 0.95));
  color: var(--muted); font-size: 0.7rem; font-weight: 750; cursor: pointer;
  transition: color 0.2s, border-color 0.2s, scale 0.2s var(--spring), background 0.2s;
}
.logout-button:hover { color: var(--text); border-color: var(--border-strong); background: rgba(244, 63, 94, 0.12); }
.logout-button.is-pressing { scale: 0.94; }
.role-badge {
  display: inline-flex; align-items: center; max-width: 18ch; overflow: hidden; text-overflow: ellipsis;
  padding: 3px 7px; border-radius: 999px; border: 1px solid rgba(110, 231, 160, 0.22);
  background: rgba(110, 231, 160, 0.08); color: var(--accent);
  font-size: 0.64rem; font-weight: 800; letter-spacing: 0.035em; white-space: nowrap;
}
body.role-resident .role-badge { color: var(--warn); border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.08); }
.readonly-banner {
  display: flex; gap: 11px; align-items: flex-start; margin: 0 0 16px; padding: 13px 15px;
  border: 1px solid rgba(251, 191, 36, 0.38); border-radius: 16px;
  background: linear-gradient(140deg, rgba(61, 45, 12, 0.70), rgba(35, 28, 10, 0.76));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
  animation: riseIn 0.42s var(--ease) both;
}
.readonly-banner > span { font-size: 1rem; line-height: 1.2; }
.readonly-banner b { display: block; color: var(--warn); font-size: 0.82rem; }
.readonly-banner p { margin: 3px 0 0; color: #e9cf93; font-size: 0.75rem; line-height: 1.4; }
[data-control]:disabled { opacity: 0.45; cursor: not-allowed; filter: saturate(0.45); }
.switch input:disabled + span { cursor: not-allowed; opacity: 0.55; }
body.role-resident .switch:has(input:disabled) { opacity: 0.55; cursor: not-allowed; }

/* ---------- health strip ---------- */
.health-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-bottom: 16px; }
.health-item {
  display: flex; gap: 8px; align-items: center; min-width: 0; padding: 10px 11px;
  border: 1px solid var(--border); border-radius: 13px; background: rgba(12, 36, 23, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}
.health-icon { width: 27px; height: 27px; flex-shrink: 0; display: grid; place-items: center; border-radius: 8px; background: rgba(110, 231, 160, 0.07); font-size: 0.75rem; }
.health-item > div { min-width: 0; }
.health-item span:not(.health-icon) { display: block; color: var(--muted); font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.07em; font-weight: 700; }
.health-item b { display: block; margin-top: 2px; font-size: 0.7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.health-item b.good { color: var(--accent); }
.health-item b.bad { color: var(--bad); }

/* ---------- sensor meters ---------- */
.sensor-meter { height: 5px; margin-top: 13px; border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, 0.075); }
.sensor-meter span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #34d399, #22d3ee); transition: width 0.7s var(--ease), background 0.3s; }
.sensor-meter--hum span { background: linear-gradient(90deg, #22d3ee, #38bdf8); }
.sensor-meter span.is-alert { background: linear-gradient(90deg, #fb7185, #f59e0b); }

/* ---------- login ---------- */
.login-screen {
  position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column;
  justify-content: center; align-items: center; overflow-y: auto;
  padding: max(18px, env(safe-area-inset-top, 0px)) 18px max(18px, env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(900px 600px at 88% 2%, rgba(34, 197, 94, 0.16), transparent 58%),
    radial-gradient(720px 560px at 4% 98%, rgba(20, 184, 166, 0.13), transparent 62%),
    linear-gradient(145deg, #04110b 0%, #071a12 50%, #04100b 100%);
}
.login-screen[hidden] { display: none !important; }
.login-screen::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: 0.42;
  background-image:
    linear-gradient(rgba(126, 255, 178, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126, 255, 178, 0.045) 1px, transparent 1px);
  background-size: 54px 54px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 0%, transparent 74%);
  mask-image: radial-gradient(ellipse at 50% 40%, #000 0%, transparent 74%);
}
.login-shell {
  position: relative; z-index: 1; width: min(1120px, 100%);
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(330px, 398px);
  gap: clamp(24px, 5vw, 62px); align-items: center; padding: 18px 10px;
}
.login-visual { min-width: 0; animation: loginCardIn 0.65s var(--ease) both; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 34px; }
.login-brand .brand-mark { width: 46px; height: 46px; border-radius: 14px; font-size: 1.25rem; }
.login-brand b { display: block; font-size: 0.95rem; letter-spacing: -0.015em; }
.login-brand span { display: block; color: var(--muted); font-size: 0.66rem; margin-top: 2px; letter-spacing: 0.06em; text-transform: uppercase; }
.login-visual > .eyebrow { margin-bottom: 10px; }
.login-visual h1 { margin: 0 0 16px; font-size: clamp(2rem, 4.5vw, 3.3rem); line-height: 1.02; letter-spacing: -0.045em; max-width: 11ch; }
.login-visual h1 em { font-style: normal; background: linear-gradient(100deg, #d9ffe7, #6ee7a0 46%, #22d3ee); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.login-lead { color: var(--muted); font-size: 0.88rem; line-height: 1.55; max-width: 42ch; margin: 0 0 24px; }
.login-chart-card {
  padding: 14px 15px 12px; border: 1px solid var(--border); border-radius: 19px;
  background: linear-gradient(150deg, rgba(18, 50, 33, 0.92), rgba(8, 28, 18, 0.82));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.login-chart-head, .login-chart-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.login-chart-head { color: var(--muted); font-size: 0.69rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.login-chart-head > span:first-child { display: inline-flex; align-items: center; gap: 7px; }
.login-live { color: var(--accent); font-size: 0.58rem; letter-spacing: 0.12em; padding: 3px 7px; border-radius: 999px; border: 1px solid rgba(110, 231, 160, 0.25); background: rgba(110, 231, 160, 0.08); }
.login-chart { display: block; width: 100%; height: 142px; margin: 8px 0 2px; overflow: visible; }
.login-grid { fill: none; stroke: rgba(126, 255, 178, 0.10); stroke-width: 1; stroke-dasharray: 3 7; }
.login-area { fill: url(#loginAreaGrad); }
.login-line { fill: none; stroke: url(#loginLineGrad); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 7px rgba(110, 231, 160, 0.5)); stroke-dasharray: 700; stroke-dashoffset: 700; animation: drawLine 2.8s var(--ease) 0.35s forwards; }
.login-dot { fill: #d9ffe7; stroke: #06140e; stroke-width: 2; filter: drop-shadow(0 0 8px rgba(110, 231, 160, 0.9)); }
.login-chart-foot { color: var(--muted); font-size: 0.61rem; padding-top: 6px; }
.login-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 13px; }
.login-stats > div { padding: 10px 11px; border: 1px solid var(--border); border-radius: 12px; background: rgba(9, 28, 18, 0.62); }
.login-stats b { display: block; font-size: 1rem; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.login-stats span { display: block; color: var(--muted); font-size: 0.6rem; margin-top: 2px; }
.login-card {
  position: relative; z-index: 1; width: 100%; padding: 25px;
  border: 1px solid rgba(126, 255, 178, 0.20); border-radius: 25px;
  background: linear-gradient(160deg, rgba(19, 50, 33, 0.94), rgba(7, 25, 16, 0.92));
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.075);
  -webkit-backdrop-filter: blur(22px) saturate(1.2); backdrop-filter: blur(22px) saturate(1.2);
  animation: loginCardIn 0.7s var(--spring) 0.05s both;
}
.login-card::before { content: ""; position: absolute; inset: 0 18px auto; height: 1px; background: linear-gradient(90deg, transparent, rgba(110, 231, 160, 0.5), transparent); }
.login-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 7px; }
.login-card-brand { display: none; align-items: center; gap: 8px; margin-bottom: 18px; color: var(--text); font-size: 0.78rem; font-weight: 800; letter-spacing: -0.01em; }
.login-card-brand span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: rgba(110, 231, 160, 0.12); font-size: 0.85rem; }
.login-lock { width: 42px; height: 42px; display: grid; place-items: center; flex-shrink: 0; border-radius: 13px; background: rgba(110, 231, 160, 0.10); border: 1px solid rgba(110, 231, 160, 0.13); font-size: 1.05rem; }
.login-card-head .eyebrow { font-size: 0.61rem; margin-bottom: 3px; }
.login-card h2 { margin: 0; font-size: 1.25rem; letter-spacing: -0.025em; }
.login-sub { color: var(--muted); font-size: 0.79rem; line-height: 1.45; margin: 0 0 19px; }
.login-card form label { display: block; color: var(--muted); font-size: 0.68rem; font-weight: 700; margin: 13px 0 6px; letter-spacing: 0.03em; }
.select-field, .password-field {
  display: flex; align-items: center; gap: 9px; min-height: 48px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 13px; background: rgba(3, 18, 10, 0.55);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.select-field:focus-within, .password-field:focus-within { border-color: rgba(110, 231, 160, 0.65); box-shadow: 0 0 0 3px rgba(110, 231, 160, 0.10); background: rgba(5, 24, 14, 0.75); }
.select-field > span, .password-field > span { opacity: 0.68; font-size: 0.84rem; }
.select-field select, .password-field input { width: 100%; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--text); font-size: 0.86rem; padding: 13px 0; }
.select-field select { cursor: pointer; }
.select-field select option { background: #0d2b1c; color: var(--text); }
.password-field button { flex-shrink: 0; border: 0; border-radius: 7px; padding: 5px 6px; background: transparent; color: var(--accent); cursor: pointer; font-size: 0.68rem; font-weight: 700; }
.password-field button:hover { background: rgba(110, 231, 160, 0.08); }
.login-error { margin-top: 12px; padding: 9px 11px; border-radius: 10px; border: 1px solid rgba(251, 113, 133, 0.42); background: rgba(251, 113, 133, 0.10); color: #ffc2cc; font-size: 0.72rem; line-height: 1.35; }
.login-error[hidden] { display: none !important; }
.login-submit { width: 100%; margin-top: 18px; min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; }
.login-spinner { width: 15px; height: 15px; border-radius: 50%; border: 2px solid rgba(5, 43, 23, 0.25); border-top-color: #052b17; animation: spin 0.7s linear infinite; display: none; }
.login-card.is-loading .login-spinner { display: inline-block; }
.login-card.is-loading .login-submit { pointer-events: none; opacity: 0.75; }
.login-role-note { display: flex; flex-direction: column; gap: 2px; margin-top: 16px; padding: 10px 11px; border-radius: 11px; border: 1px solid var(--border); background: rgba(0, 0, 0, 0.12); }
.login-role-note b { color: var(--text); font-size: 0.7rem; }
.login-role-note span { color: var(--muted); font-size: 0.67rem; line-height: 1.35; }
.login-role-note.is-readonly { border-color: rgba(251, 191, 36, 0.3); background: rgba(251, 191, 36, 0.07); }
.login-role-note.is-readonly b { color: var(--warn); }
.login-security { color: var(--muted); font-size: 0.63rem; line-height: 1.4; text-align: center; margin: 14px 0 0; }
.login-cloud { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 0.61rem; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(126, 255, 178, 0.08); }
.login-cloud span { color: var(--accent); }
.login-footer { position: relative; z-index: 1; color: var(--muted); font-size: 0.64rem; text-align: center; margin: 20px 0 0; }
.login-card.shake { animation: loginShake 0.42s var(--ease); }
.app-shell[hidden] { display: none !important; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .login-shell { grid-template-columns: minmax(0, 460px); justify-content: center; gap: 0; }
  .login-visual { display: none; }
  .login-card-brand { display: flex; }
}
@media (max-width: 640px) {
  .app-shell { padding: 14px 12px 24px; }
  .topbar { gap: 10px; }
  .topbar-actions { gap: 6px; }
  .logout-button { height: 42px; padding: 0 10px; font-size: 0.66rem; }
  .health-strip { grid-template-columns: 1fr 1fr; }
  .hero { min-height: 200px; padding: 24px 20px; border-radius: 22px; }
  .hero h2 { font-size: clamp(1.45rem, 7.4vw, 1.85rem); }
  .hero-bug { font-size: 3.4rem; right: 14px; }
  .hero-orbit { right: -110px; }
  .sensor-grid { grid-template-columns: 1fr; }
  .cycle-card { gap: 14px; padding: 15px; }
  .cycle-ring { width: 102px; height: 102px; }
  .cycle-copy h3 { font-size: 0.92rem; }
  .trend-head { flex-direction: column; }
  .trend-tabs { width: 100%; }
  .trend-tab { flex: 1; }
  .panel { padding: 16px; }
  .timestamp { display: none; }
  .login-screen { justify-content: flex-start; padding: 16px 12px 22px; }
  .login-shell { padding: 10px 0; }
  .login-card { padding: 21px 19px; border-radius: 21px; }
  .login-visual h1 { font-size: 1.8rem; }
  .login-chart-card, .login-stats { display: none; }
  .login-visual { display: none; }
  .login-footer { margin-top: 16px; }
}
@media (max-width: 400px) {
  .topbar h1 { font-size: 1.02rem; }
  .logout-button { width: 40px; padding: 0; overflow: hidden; color: transparent; position: relative; }
  .logout-button::after { content: "⎋"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 1rem; }
  .role-badge { max-width: 11ch; }
  .metric p { font-size: 0.62rem; }
  .metric strong { font-size: 1.2rem; }
  .feed-schedule-card { flex-wrap: wrap; gap: 10px 14px; }
  .feed-clock { font-size: 1.9rem; }
  .feed-next-block { flex-basis: 100%; order: 3; }
  .feed-schedule-card .mini-badge { margin-left: auto; }
  .cycle-card { align-items: flex-start; }
  .cycle-ring { width: 92px; height: 92px; }
  .cycle-center b { font-size: 1rem; }
}
@media (hover: hover) and (pointer: fine) {
  .nav-item:hover { color: var(--text); }
}

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html:not(.motion-on) *, html:not(.motion-on) *::before, html:not(.motion-on) *::after {
    animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important; scroll-behavior: auto !important;
  }
}
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after {
  animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important; scroll-behavior: auto !important;
}

/* ---------- keyframes ---------- */
@keyframes screenIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes riseIn { from { opacity: 0; translate: 0 13px; scale: 0.992; } to { opacity: 1; translate: 0 0; scale: 1; } }
@keyframes rippleOut { 0% { transform: scale(0); opacity: 0.72; } 70% { opacity: 0.24; } 100% { transform: scale(1); opacity: 0; } }
@keyframes rowIn { from { opacity: 0; transform: translateY(7px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes rowOut { to { opacity: 0; transform: translateX(24px) scale(0.96); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(18px) scale(0.94); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px) scale(0.94); } }
@keyframes sheetIn { from { opacity: 0; transform: translateY(26px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes dotPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.82); } }
@keyframes alarmPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.13); } }
@keyframes breathe { 0%, 100% { transform: scale(0.92); opacity: 0.4; } 50% { transform: scale(1.08); opacity: 0.75; } }
@keyframes brandSheen { 0%, 62% { transform: translateX(-130%); } 82%, 100% { transform: translateX(130%); } }
@keyframes heroSheen { 0%, 68% { transform: translateX(-100%); } 88%, 100% { transform: translateX(100%); } }
@keyframes drift { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(-24px, 26px, 0) scale(1.12); } }
@keyframes leafFloat { from { transform: translateY(0) rotate(-4deg); } to { transform: translateY(-18px) rotate(5deg); } }
@keyframes sporeRise { 0% { transform: translateY(0) scale(0.7); opacity: 0; } 12% { opacity: 0.5; } 80% { opacity: 0.12; } 100% { transform: translateY(-86vh) translateX(22px) scale(1.2); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bugHover { 0%, 100% { transform: rotate(-12deg) translateY(0); } 50% { transform: rotate(-8deg) translateY(-6px); } }
@keyframes ringPulse { 0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(34, 211, 238, 0)); } 50% { transform: scale(1.035); filter: drop-shadow(0 0 12px rgba(34, 211, 238, 0.26)); } }
@keyframes noticeScan { 0% { transform: translateX(-110%); } 55%, 100% { transform: translateX(110%); } }
@keyframes alarmVignette { 0%, 100% { opacity: 0.55; } 50% { opacity: 0.95; } }
@keyframes settingHighlight { 0%, 100% { background: transparent; } 30% { background: rgba(110, 231, 160, 0.10); } }
@keyframes drawLine { to { stroke-dashoffset: 0; } }
@keyframes loginCardIn { from { opacity: 0; translate: 0 18px; scale: 0.975; } to { opacity: 1; translate: 0 0; scale: 1; } }
@keyframes loginShake { 0%, 100% { transform: translateX(0); } 22% { transform: translateX(-7px); } 44% { transform: translateX(6px); } 66% { transform: translateX(-4px); } 84% { transform: translateX(3px); } }

/* ---------- segmented control (animated state) ---------- */
.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.control-group-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.seg-control {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 4px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
  overflow: hidden;
}
.seg-glider {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(110, 231, 160, 0.92), rgba(34, 197, 94, 0.75));
  box-shadow: 0 6px 18px rgba(34, 197, 94, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: transform 0.38s var(--spring), background 0.3s, box-shadow 0.3s;
  z-index: 0;
  pointer-events: none;
}
.seg-control[data-active="close"] .seg-glider,
.seg-control[data-active="off"] .seg-glider {
  transform: translateX(100%);
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.55), rgba(71, 85, 105, 0.65));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.seg-control[data-active="open"] .seg-glider,
.seg-control[data-active="on"] .seg-glider {
  transform: translateX(0);
}
.seg-control.is-pending .seg-glider {
  animation: segPulse 0.9s ease-in-out infinite;
}
.seg-btn {
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 12px 10px;
  border-radius: 11px;
  cursor: pointer;
  transition: color 0.25s, transform 0.2s var(--spring);
}
.seg-btn.is-active {
  color: #042410;
}
.seg-control[data-active="close"] .seg-btn[data-seg="close"],
.seg-control[data-active="off"] .seg-btn[data-seg="off"] {
  color: var(--text);
}
.seg-btn:disabled,
.seg-btn.is-locked {
  opacity: 0.45;
  cursor: not-allowed;
}
.seg-btn.is-pressing { transform: scale(0.96); }
.seg-hint {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.seg-hint.is-live { color: var(--accent); }
.seg-hint.is-busy { color: var(--warn); }

@keyframes segPulse {
  0%, 100% { opacity: 1; filter: brightness(1); }
  50% { opacity: 0.72; filter: brightness(1.15); }
}

.danger {
  background: linear-gradient(160deg, rgba(251, 113, 133, 0.95), rgba(190, 24, 93, 0.9));
  color: #fff;
  border: 1px solid rgba(251, 113, 133, 0.55);
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(190, 24, 93, 0.28);
  transition: transform 0.2s var(--spring), filter 0.2s;
}
.danger:hover { filter: brightness(1.06); }
.danger:disabled { opacity: 0.5; cursor: not-allowed; }

.dev-panel {
  border-color: rgba(56, 189, 248, 0.28);
  background: linear-gradient(155deg, rgba(12, 40, 55, 0.9), rgba(8, 28, 22, 0.92));
}
.dev-panel .live-badge {
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.35);
}
body.role-development .dev-panel { display: block; }
body:not(.role-development) .dev-panel { display: none !important; }
