/* Soft payment-page style + light/dark themes */
:root,
[data-theme="light"] {
  color-scheme: light;
  --bg0: #e8eef5;
  --bg1: #dde6f0;
  --ink: #1a2433;
  --muted: #5a6a7d;
  --line: rgba(26, 36, 51, 0.12);
  --accent: #1fbfa5;
  --accent-deep: #149884;
  --accent2: #e87a45;
  --accent3: #4a8fe7;
  --danger: #d64545;
  --surface: rgba(245, 248, 252, 0.82);
  --surface-solid: #f3f6fa;
  --shadow: 0 16px 40px rgba(40, 60, 90, 0.1);
  --glow: rgba(31, 191, 165, 0.28);
  --input-bg: #eef2f7;
  --hero-grad: linear-gradient(120deg, #1a2433 0%, #149884 48%, #e87a45 100%);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg0: #0c1118;
  --bg1: #121925;
  --ink: #e6eef8;
  --muted: #8b9bb0;
  --line: rgba(230, 238, 248, 0.1);
  --accent: #2fd3a2;
  --accent-deep: #3de0b0;
  --accent2: #ff9a5c;
  --accent3: #6aa8ff;
  --danger: #ff6b6b;
  --surface: rgba(22, 30, 42, 0.78);
  --surface-solid: #161e2a;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  --glow: rgba(47, 211, 162, 0.25);
  --input-bg: #1a2330;
  --hero-grad: linear-gradient(120deg, #e6eef8 0%, #2fd3a2 45%, #ff9a5c 100%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body, "Manrope", "Segoe UI", sans-serif);
  --font-display: "Sora", "Segoe UI", sans-serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
  background:
    radial-gradient(800px 480px at 0% 0%, color-mix(in srgb, var(--accent3) 18%, transparent), transparent 55%),
    radial-gradient(700px 420px at 100% 10%, color-mix(in srgb, var(--accent2) 14%, transparent), transparent 50%),
    radial-gradient(600px 400px at 50% 100%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  overflow-x: hidden;
  transition: background .35s ease, color .25s ease;
}
a { color: inherit; }
button, input { font: inherit; }

.wrap { width: min(1080px, calc(100% - 40px)); margin: 0 auto; position: relative; z-index: 1; }

.mesh {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: meshShift 28s linear infinite;
}
[data-theme="light"] .mesh {
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(26,36,51,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26,36,51,0.04) 1px, transparent 1px);
}
@keyframes meshShift {
  from { transform: translateY(0); }
  to { transform: translateY(48px); }
}

.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(56px);
  opacity: 0.28;
  pointer-events: none;
  z-index: 0;
  animation: floaty 14s ease-in-out infinite alternate;
}
.blob-a { width: 260px; height: 260px; top: 6%; left: -50px; background: var(--accent3); }
.blob-b { width: 300px; height: 300px; top: 40%; right: -90px; background: var(--accent2); animation-delay: -5s; }
.blob-c { width: 240px; height: 240px; bottom: 8%; left: 28%; background: var(--accent); animation-delay: -8s; }
@keyframes floaty {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(20px, -26px) scale(1.06); }
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 8px;
  animation: rise .7s ease both;
}
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 1.15rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.brand-badge {
  display: inline-grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  color: #fff;
  font-size: 1rem;
  box-shadow: 0 8px 20px var(--glow);
  animation: pulse 2.6s ease-in-out infinite;
  object-fit: cover;
  padding: 0;
  flex-shrink: 0;
}
img.brand-badge {
  background: none;
  box-shadow: 0 8px 20px var(--glow);
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.nav-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(10px);
}
.theme-switch button {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 11px;
  cursor: pointer;
  font-size: .85rem;
  font-weight: 600;
  transition: .18s ease;
}
.theme-switch button.active {
  background: var(--surface-solid);
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
}
[data-theme="dark"] .theme-switch button.active {
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent3) 55%, var(--accent)));
  color: #04261c;
  font-weight: 700;
  box-shadow: 0 12px 28px var(--glow);
  position: relative;
  overflow: hidden;
}
[data-theme="dark"] .btn-primary { color: #042018; }
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.28) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: shimmer 3.2s ease-in-out infinite;
}
@keyframes shimmer {
  0%, 55% { transform: translateX(-120%); }
  75%, 100% { transform: translateX(120%); }
}
.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.btn-accent {
  background: linear-gradient(135deg, var(--accent2), #f0a060);
  color: #2a1200;
  font-weight: 700;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--accent2) 35%, transparent);
}
.btn-block { width: 100%; }

.hero {
  min-height: calc(100vh - 90px);
  display: grid;
  align-content: center;
  padding: 48px 0 72px;
  position: relative;
}
.hero-emoji {
  font-size: clamp(2.2rem, 5vw, 3rem);
  margin-bottom: 10px;
  animation: bounceIn .9s cubic-bezier(.2,.8,.2,1) both;
  display: flex;
  gap: 8px;
}
.hero-emoji span { display: inline-block; animation: wiggle 3s ease-in-out infinite; }
.hero-emoji span:nth-child(2) { animation-delay: .2s; }
.hero-emoji span:nth-child(3) { animation-delay: .4s; }
@keyframes wiggle {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-6px) rotate(6deg); }
}
@keyframes bounceIn {
  0% { opacity: 0; transform: scale(.7) translateY(10px); }
  60% { opacity: 1; transform: scale(1.06) translateY(-3px); }
  100% { transform: scale(1) translateY(0); }
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(3rem, 9vw, 6rem);
  line-height: 0.95;
  margin: 0 0 18px;
  letter-spacing: -0.03em;
  max-width: 10ch;
  background: var(--hero-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rise .8s ease both .05s;
}
.hero p {
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.55;
  margin: 0 0 28px;
  animation: rise .9s ease both .1s;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; animation: rise 1s ease both .16s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.section { padding: 64px 0; }
.section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin: 0 0 10px;
}
.section .lead { color: var(--muted); margin: 0 0 28px; max-width: 40rem; }

.trial-teaser {
  padding-top: 8px;
  padding-bottom: 24px;
}
.trial-teaser-inner {
  max-width: 40rem;
  padding: 8px 0 4px;
  border-top: 1px solid var(--line);
}
.trial-eyebrow {
  margin: 0 0 8px;
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: 0.02em;
  color: var(--accent2);
}
.trial-teaser h2 {
  margin: 0 0 10px;
}
.trial-teaser .lead {
  margin-bottom: 18px;
}

.benefits {
  display: grid;
  gap: 14px;
  margin: 0 0 22px;
}
@media (min-width: 720px) {
  .benefits { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1100px) {
  .benefits { grid-template-columns: 1fr 1fr 1fr; }
}
.benefit {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px 18px 18px;
  box-shadow: var(--shadow);
  animation: rise .7s ease both;
}
.benefit-ico { font-size: 1.6rem; line-height: 1; margin-bottom: 10px; }
.benefit h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.15rem;
}
.benefit p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}
.benefits-price {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ink);
}
.benefits-price b { color: var(--accent-deep); }

.plans { display: grid; gap: 16px; }
@media (min-width: 800px) { .plans { grid-template-columns: 1fr 1fr; } }
.plans.plans-single { grid-template-columns: 1fr; max-width: 36rem; }
.plan {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  animation: rise .7s ease both;
}
.plan:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}
.plan h3 { margin: 0 0 8px; font-family: var(--font-display); font-size: 1.4rem; }
.plan .desc {
  color: var(--ink);
  margin: 0 0 14px;
  font-weight: 650;
  font-size: 1.02rem;
  line-height: 1.45;
}
.plan .warn {
  color: var(--muted);
  font-size: .92rem;
  font-weight: 400;
  margin: 8px 0 0;
}
.plan ul { margin: 0 0 16px; padding-left: 0; list-style: none; }
.plan li { margin: 8px 0; }
.periods { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.period {
  border: 1px solid var(--line);
  background: var(--surface-solid);
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
  min-width: 110px;
  text-decoration: none;
  transition: .15s ease;
}
.period:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.period strong { display: block; color: var(--accent-deep); }
.period span { color: var(--muted); font-size: .85rem; }

.footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer a { text-decoration: none; font-weight: 600; }
.footer a:hover { color: var(--accent-deep); }

.panel {
  width: min(780px, calc(100% - 32px));
  margin: 28px auto 48px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 22px 22px 28px;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  animation: rise .6s ease both;
}
.card-plain { border-top: 1px solid var(--line); padding: 18px 0; }
.muted { color: var(--muted); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; gap: 12px; }
@media (min-width: 700px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.stat { font-size: 1.75rem; font-family: var(--font-display); margin: 4px 0 0; }
.input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  padding: 12px 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
  color-scheme: inherit;
}
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--glow);
}
/* hide default number spinners (white chrome on dark theme) */
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0; }
.tab {
  border: 1px solid var(--line);
  background: var(--surface-solid);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  transition: .15s ease;
}
.tab:hover { color: var(--ink); }
.tab.active {
  color: var(--ink);
  border-color: transparent;
  background: color-mix(in srgb, var(--accent) 22%, var(--surface-solid));
  font-weight: 700;
}
.hidden { display: none !important; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-all; }
.status-ok { color: var(--accent-deep); }
.status-bad { color: var(--danger); }
#devices.is-over,
#devicesSummary.is-over { color: var(--danger); font-weight: 700; }
.device-over-warn {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--danger) 40%, var(--line));
  background: color-mix(in srgb, var(--danger) 12%, var(--surface-solid));
  color: var(--danger);
  font-size: .86rem;
  line-height: 1.4;
  font-weight: 650;
}
.status-warn { color: var(--accent2); }

/* —— Apps / connect (cabinet) —— */
.os-pills {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 14px 0 16px;
}
.os-pill {
  border: 1px solid var(--line);
  background: var(--surface-solid);
  color: var(--muted);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 700;
  font-size: .9rem;
  min-height: 44px;
  transition: .15s ease;
}
.os-pill:hover { color: var(--ink); }
.os-pill.active {
  color: var(--ink);
  border-color: transparent;
  background: color-mix(in srgb, var(--accent) 22%, var(--surface-solid));
}
.app-clients {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.app-client {
  position: relative;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  color: var(--ink);
  border-radius: 18px;
  padding: 14px 14px 16px;
  cursor: pointer;
  min-height: 88px;
  transition: .15s ease;
  overflow: hidden;
}
.app-client:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.app-client.active {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 14%, var(--surface-solid));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}
.app-client .rec {
  position: absolute; top: 10px; right: 10px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
.app-client .ttl { font-weight: 800; font-size: 1rem; position: relative; z-index: 1; }
.app-client .wm {
  position: absolute; right: -6px; bottom: -10px;
  width: 72px; height: 72px; opacity: .12;
  color: var(--ink); pointer-events: none;
}
.app-client .wm svg { width: 100%; height: 100%; }
.app-steps { display: grid; gap: 12px; }
.app-step {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 20px;
  padding: 16px 16px 18px;
  backdrop-filter: blur(10px);
}
.app-step-h { display: flex; gap: 12px; align-items: flex-start; }
.app-step-ico {
  flex: 0 0 auto;
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 18%, var(--surface-solid));
  color: var(--accent-deep);
}
.app-step-ico svg { width: 20px; height: 20px; stroke: currentColor; fill: none; }
.app-step h3 { margin: 0 0 6px; font-size: 1.02rem; font-family: var(--font-display); }
.app-step p { margin: 0 0 12px; color: var(--muted); font-size: .92rem; line-height: 1.45; }
.app-step .btn-stack { display: flex; flex-wrap: wrap; gap: 8px; }
.app-step .btn-stack .btn { text-decoration: none; }
.info-list {
  margin: 8px 0 0;
  padding-left: 1.15rem;
  color: var(--muted);
  line-height: 1.55;
}
.info-list li { margin: 4px 0; }
.ref-stat {
  border: 1px solid var(--line);
  background: var(--surface-solid);
  border-radius: 16px;
  padding: 14px 16px;
}
.ref-stat .k { color: var(--muted); font-size: .85rem; margin-bottom: 4px; }
.ref-stat .v { font-size: 1.35rem; font-weight: 800; font-family: var(--font-display); }
.ref-hero {
  display: flex;
  gap: 16px;
  align-items: center;
  margin: 12px 0 16px;
  background:
    linear-gradient(135deg, rgba(59,164,232,.16), rgba(47,211,162,.1)),
    rgba(255,255,255,.03);
}
.ref-pct {
  flex: 0 0 auto;
  min-width: 88px;
  height: 88px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 800;
  color: #041316;
  background: linear-gradient(145deg, #2fd3a2, #3ba4e8);
}
.ref-hero-body strong { display: block; margin-bottom: 6px; font-size: 1.05rem; }
.ref-example {
  margin: 0;
  font-size: .98rem;
  font-weight: 650;
}
@media (max-width: 560px) {
  .ref-hero { flex-direction: column; align-items: flex-start; }
}

.login-box {
  min-height: 70vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 40px 16px;
}
.login-box > div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 28px 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  animation: rise .65s ease both;
}
.login-box h1 { font-family: var(--font-display); font-size: clamp(2rem, 6vw, 2.8rem); margin: 0 0 12px; }
.flash {
  border-left: 3px solid var(--accent);
  padding: 10px 12px;
  margin: 12px 0;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 0 12px 12px 0;
}
.error {
  border-left: 3px solid var(--danger);
  padding: 10px 12px;
  margin: 12px 0;
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  border-radius: 0 12px 12px 0;
}
.link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent3);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-btn:hover { opacity: 0.85; }
.forgot-row {
  display: flex;
  justify-content: flex-end;
  margin: 6px 0 0;
}
.forgot-btn {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  transition: color .15s ease;
}
.forgot-btn:hover {
  color: var(--accent3);
  text-decoration: none;
}
.forgot-btn:active { opacity: 0.8; }
.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 18px;
  color: var(--muted);
  font-size: .85rem;
}
.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* —— Mobile —— */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
}
/* Cabinet: no body side insets — header/shell go edge-to-edge */
body.cabinet-page {
  padding-left: 0;
  padding-right: 0;
  margin: 0;
  width: 100%;
  max-width: 100%;
}
.btn, .tab, .theme-switch button, .period {
  min-height: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.input {
  min-height: 48px;
  font-size: 16px; /* iOS: no zoom on focus */
}

@media (max-width: 720px) {
  .wrap {
    width: min(100% - 24px, 1080px);
  }
  .mesh { opacity: 0.18; background-size: 36px 36px; }
  .blob { opacity: 0.18; filter: blur(40px); }
  .blob-a, .blob-b, .blob-c { width: 180px; height: 180px; }

  .nav {
    padding: 14px 0 6px;
    gap: 10px;
    align-items: flex-start;
  }
  .brand { font-size: 1.05rem; }
  .brand-badge { width: 30px; height: 30px; border-radius: 10px; }
  .nav-actions {
    gap: 6px;
    justify-content: flex-end;
    max-width: 68%;
  }
  .btn {
    padding: 10px 12px;
    font-size: .92rem;
  }
  .btn .btn-text { display: none; }
  .nav-actions .btn-primary .btn-text { display: inline; }
  .theme-switch button { padding: 8px 10px; min-width: 40px; }

  .hero {
    min-height: auto;
    padding: 28px 0 40px;
    align-content: start;
  }
  .hero h1 {
    font-size: clamp(2.4rem, 14vw, 3.4rem);
    max-width: none;
  }
  .hero p {
    font-size: 1rem;
    margin-bottom: 20px;
  }
  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-cta .btn { width: 100%; }

  .section { padding: 40px 0 28px; }
  .section h2 { font-size: 1.55rem; }
  .plans { gap: 12px; }
  .plan { padding: 16px; border-radius: 18px; }
  .periods { gap: 8px; }
  .period {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
    text-align: center;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 22px 0 calc(28px + env(safe-area-inset-bottom));
    font-size: .9rem;
  }

  .panel {
    width: min(100% - 16px, 780px);
    margin: 12px auto 28px;
    padding: 16px 14px 22px;
    border-radius: 20px;
  }
  .panel h1 {
    font-size: 1.65rem !important;
  }
  .stat { font-size: 1.45rem; }
  .tabs {
    margin: 12px 0 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 10px 14px;
  }
  .grid2 { grid-template-columns: 1fr; gap: 0; }
  .row { gap: 8px; }
  .row .btn { flex: 1 1 auto; }
  .mono { font-size: .82rem; }

  .login-box {
    min-height: auto;
    padding: 16px 0 32px;
    align-items: start;
  }
  .login-box > div {
    width: 100% !important;
    max-width: none;
    padding: 20px 16px;
    border-radius: 20px;
  }
  .login-box h1 { font-size: 1.7rem; }
  .login-divider { margin: 22px 0 14px; }
}

@media (max-width: 380px) {
  .nav-actions .btn-ghost:not(#logoutBtn) { display: none; }
  .hero-emoji { font-size: 1.8rem; }
}

@media (max-width: 720px) and (prefers-reduced-motion: no-preference) {
  .btn-primary::after { animation-duration: 4.5s; }
  .blob { animation-duration: 18s; }
}

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


/* —— Support chat widget —— */
.udm-chat-fab {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 80;
  width: 56px; height: 56px; border: 0; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent3) 55%, var(--accent)));
  color: #042018; display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 12px 28px var(--glow);
  transition: transform .18s ease;
}
.udm-chat-fab:hover { transform: translateY(-2px) scale(1.04); }
.udm-chat-fab.is-open { transform: scale(0.96); opacity: .9; }
.udm-chat-panel {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: calc(16px + 68px + env(safe-area-inset-bottom));
  z-index: 81;
  width: min(360px, calc(100vw - 24px));
  height: min(520px, calc(100vh - 100px));
  display: flex; flex-direction: column;
  border-radius: 18px; overflow: hidden;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: udmChatIn .24s ease both;
}
@keyframes udmChatIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.udm-chat-panel--embed {
  position: relative !important;
  right: auto !important; bottom: auto !important;
  width: 100% !important;
  max-width: none;
  height: min(500px, calc(100vh - 210px)) !important;
  min-height: 360px;
  box-shadow: none; animation: none;
  border-radius: 16px;
}
.udm-chat-panel.hidden { display: none !important; }
.udm-chat-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-solid);
  flex-shrink: 0;
}
.udm-chat-head-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.udm-chat-head-text { min-width: 0; display: grid; gap: 2px; }
.udm-chat-avatar {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  color: #042018; font-size: .95rem;
  box-shadow: 0 4px 12px var(--glow);
}
.udm-chat-title {
  font-weight: 700; font-size: .98rem;
  font-family: var(--font-display); color: var(--ink); line-height: 1.15;
}
.udm-chat-status { font-size: .78rem; color: var(--muted); line-height: 1.2; margin: 0; }
.udm-chat-status--embed { padding: 12px 14px 0; flex-shrink: 0; }
.udm-chat-close {
  width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%;
  background: transparent; color: var(--ink); font-size: 1.1rem;
  cursor: pointer; flex-shrink: 0; line-height: 1;
  display: grid; place-items: center; padding: 0;
}
.udm-chat-body {
  position: relative;
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
}
.udm-chat-emoji {
  display: flex; gap: 6px; align-items: center;
  font-size: 1.2rem; line-height: 1;
}
.udm-chat-emoji span {
  display: inline-block;
  animation: wiggle 3s ease-in-out infinite;
}
.udm-chat-emoji span:nth-child(2) { animation-delay: .2s; }
.udm-chat-emoji span:nth-child(3) { animation-delay: .4s; }
.udm-chat-wave {
  display: inline-block;
  animation: udmWave 1.6s ease-in-out infinite;
  transform-origin: 70% 70%;
}
@keyframes udmWave {
  0%, 60%, 100% { transform: rotate(0); }
  20% { transform: rotate(14deg); }
  40% { transform: rotate(-6deg); }
}
.udm-chat-welcome {
  width: 100%;
  box-sizing: border-box;
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-solid));
  animation: bounceIn .55s cubic-bezier(.2,.8,.2,1) both;
}
.udm-chat-welcome-text {
  margin: 0;
  font-size: .92rem;
  line-height: 1.45;
  color: var(--ink);
}
.udm-chat-hint {
  margin: 0;
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.35;
}
.udm-chat-field {
  width: 100%; box-sizing: border-box;
  height: 44px;
  border: 1px solid var(--line); border-radius: 12px;
  padding: 0 14px; font: inherit;
  background: var(--input-bg); color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.udm-chat-field:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 70%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.udm-chat-start-btn {
  border: 0; border-radius: 12px; height: 44px; padding: 0 16px; width: 100%;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent3) 55%, var(--accent)));
  color: #042018; font: inherit; font-weight: 700; cursor: pointer;
  box-shadow: 0 8px 18px var(--glow);
}
.udm-chat-start-btn:disabled { opacity: .65; cursor: wait; }
.udm-chat-gate-cancel {
  border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .86rem;
  cursor: pointer; padding: 4px; justify-self: center;
}
.udm-chat-error { color: var(--danger); font-size: .85rem; }
.udm-chat-messages {
  flex: 1; overflow: auto;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 10px;
  align-content: flex-start;
}
.udm-chat-msg { max-width: 85%; display: grid; gap: 2px; animation: rise .25s ease both; }
.udm-chat-msg.is-visitor { align-self: flex-end; }
.udm-chat-msg.is-admin { align-self: flex-start; }
.udm-chat-bubble {
  padding: 10px 12px; border-radius: 14px;
  font-size: .9rem; line-height: 1.4;
  white-space: pre-wrap; word-break: break-word;
}
.udm-chat-msg.is-visitor .udm-chat-bubble {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent3) 45%, var(--accent)));
  color: #042018; border-bottom-right-radius: 4px;
}
.udm-chat-msg.is-admin .udm-chat-bubble {
  background: color-mix(in srgb, var(--input-bg) 80%, var(--surface-solid));
  color: var(--ink);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}
.udm-chat-media {
  display: block; padding: 0; border: 0; background: transparent; cursor: zoom-in;
  border-radius: 14px; overflow: hidden; max-width: 100%;
}
.udm-chat-media img {
  display: block; max-width: min(100%, 260px); max-height: 280px;
  object-fit: cover; border-radius: 14px;
  background: color-mix(in srgb, var(--input-bg) 70%, #000);
}
.udm-chat-msg.is-visitor .udm-chat-media img {
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.udm-chat-time { font-size: .7rem; color: var(--muted); padding: 0 2px; }
.udm-chat-msg.is-visitor .udm-chat-time { text-align: right; }
.udm-chat-gate {
  position: absolute; inset: 0; z-index: 5;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 12px;
  background: color-mix(in srgb, var(--bg0) 50%, transparent);
  backdrop-filter: blur(5px);
}
.udm-chat-gate-card {
  width: 100%; display: grid; gap: 10px;
  padding: 14px; border-radius: 14px;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.udm-chat-gate-title {
  font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--ink);
}
.udm-chat-gate-sub { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.4; }
.udm-chat-tg-link {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 6px 0 0; padding: 8px 12px; border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--ink); font-weight: 700; font-size: .82rem;
  text-decoration: none; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.udm-chat-tg-link:hover { filter: brightness(1.05); }
.udm-chat-form {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
  background: var(--surface-solid);
  flex-shrink: 0;
}
.udm-chat-form .udm-chat-field {
  width: 100%;
  border-radius: 22px;
  padding: 0 16px;
}
.udm-chat-attach {
  width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%;
  background: var(--input-bg); color: var(--ink);
  display: grid; place-items: center; cursor: pointer; padding: 0;
}
.udm-chat-attach:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  color: var(--accent);
}
.udm-chat-send {
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent3) 55%, var(--accent)));
  color: #042018; display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 6px 14px var(--glow);
  padding: 0;
}
.udm-chat-send:hover { transform: scale(1.04); }
.udm-chat-lightbox {
  position: fixed; inset: 0; z-index: 10050;
  display: grid; place-items: center; padding: 20px;
  animation: udmLbIn .18s ease both;
}
.udm-chat-lightbox.hidden { display: none; }
.udm-chat-lightbox-backdrop {
  position: absolute; inset: 0; border: 0; padding: 0;
  background: rgba(3, 10, 9, .82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: zoom-out;
}
.udm-chat-lightbox-panel {
  position: relative; z-index: 1;
  max-width: min(96vw, 980px); max-height: 92vh;
  animation: udmLbPop .22s cubic-bezier(.2,.8,.2,1) both;
}
.udm-chat-lightbox-img {
  display: block; max-width: 96vw; max-height: 92vh;
  width: auto; height: auto;
  object-fit: contain; border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,.55);
  background: #0a1210;
  cursor: zoom-out;
}
@keyframes udmLbIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes udmLbPop {
  from { opacity: 0; transform: scale(.96); }
  to { opacity: 1; transform: scale(1); }
}
body.udm-chat-lb-open { overflow: hidden; }
.cab-support-card {
  margin: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
.cab-support-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  margin: 0 0 14px;
}
.cab-support-or { font-size: .9rem; }
.cab-tab-support .cab-title { margin-bottom: 12px; }
.cab-tab-support #hello[hidden] { display: none !important; }
@media (max-width: 520px) {
  .udm-chat-panel:not(.udm-chat-panel--embed) {
    right: 10px; left: 10px; width: auto;
    bottom: calc(12px + 64px + env(safe-area-inset-bottom));
    height: min(540px, calc(100vh - 92px));
  }
}

/* —— Cabinet shell / drawer —— */
.cab-shell {
  display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; position: relative; z-index: 1;
  width: 100%; max-width: none; margin: 0;
}
.cab-sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 8px;
  padding: 0; padding-bottom: 12px;
  padding-top: env(safe-area-inset-top);
  background: var(--bg0);
  border-right: 1px solid var(--line); overflow: auto;
}
.cab-side-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.15rem;
  height: 60px;
  padding: 0 14px;
  padding-left: max(14px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: var(--bg0);
  box-sizing: border-box;
  flex-shrink: 0;
}
.cab-side-brand img {
  width: 30px; height: 30px; border-radius: 10px; flex-shrink: 0;
  object-fit: cover;
}
.cab-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; padding: 8px 12px; }
.cab-nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: .95rem;
  padding: 11px 12px; border-radius: 12px; cursor: pointer; text-decoration: none;
}
.cab-nav-item .ico { width: 1.4em; text-align: center; }
.cab-nav-item .cab-nav-badge {
  margin-left: auto;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 800;
  line-height: 1;
  background: var(--bad, #e85d5d);
  color: #fff;
}
.cab-nav-item:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--ink); }
.cab-nav-item.active {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 28%, transparent), color-mix(in srgb, var(--accent3) 22%, transparent));
  color: var(--ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}
.cab-side-foot { display: grid; gap: 4px; padding: 8px 12px 4px; border-top: 1px solid var(--line); }
.cab-main { min-width: 0; padding: 0 0 28px; overflow: visible; }
.cab-top {
  display: flex; align-items: center; gap: 10px;
  height: 60px;
  padding: 0 14px;
  padding-right: max(14px, env(safe-area-inset-right));
  position: sticky; top: 0; z-index: 60;
  width: 100%; max-width: none; margin: 0; box-sizing: border-box;
  background: var(--bg0);
  border-bottom: 1px solid var(--line);
  overflow: visible;
  flex-shrink: 0;
}
.cab-top .brand {
  flex: 1; min-width: 0; overflow: visible;
  font-size: 1.15rem; gap: 10px;
}
.cab-top .brand-badge,
.cab-top img.brand-badge {
  width: 30px; height: 30px; border-radius: 10px;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--glow) 70%, transparent);
  animation: none;
  margin-left: 0;
}
.cab-menu-btn {
  display: none;
  width: 44px; height: 44px; flex-shrink: 0;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-solid); color: var(--ink);
  padding: 0; margin: 0;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
}
.cab-menu-btn span {
  display: block; width: 18px; height: 2px; border-radius: 2px;
  background: var(--ink); flex-shrink: 0;
}
.cab-title { font-family: var(--font-display); font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 4px 0 8px; }
.cab-overlay { display: none; position: fixed; inset: 0; z-index: 40; background: rgba(8, 12, 18, .45); }
.cabinet-page .udm-chat-fab { display: none !important; }
.cabinet-page .cab-panel.panel {
  width: min(780px, calc(100% - 48px));
  margin: 20px auto 32px;
}
@media (max-width: 980px) {
  #navDevices { display: none !important; }
  .cab-shell { grid-template-columns: 1fr; }
  .cab-menu-btn { display: inline-flex !important; }
  .cab-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); z-index: 70;
    transform: translateX(-105%); transition: transform .22s ease; box-shadow: 16px 0 40px rgba(0,0,0,.25);
    background: var(--surface-solid);
  }
  .cab-shell.is-open .cab-sidebar { transform: translateX(0); }
  .cab-shell.is-open .cab-overlay { display: block; }
  .cab-main {
    padding: 0 0 calc(20px + env(safe-area-inset-bottom));
    overflow-x: hidden;
  }
  .cab-top {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 10px;
    height: calc(56px + env(safe-area-inset-top));
    width: 100%;
    max-width: none;
    margin: 0;
    padding: env(safe-area-inset-top) 12px 0;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    box-sizing: border-box;
    background: color-mix(in srgb, var(--bg0) 92%, transparent);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .cab-menu-btn {
    width: 40px; height: 40px;
    border-radius: 12px;
    gap: 4px;
    box-shadow: none;
    justify-self: start;
  }
  .cab-menu-btn span { width: 16px; height: 2px; }
  .cab-side-brand {
    height: 56px;
    font-size: .95rem;
  }
  .cab-top .brand {
    justify-self: start;
    align-self: center;
    flex: 0 1 auto;
    font-size: 1rem;
    font-weight: 750;
    gap: 8px;
    line-height: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .cab-top .brand-badge,
  .cab-top img.brand-badge {
    width: 28px; height: 28px; border-radius: 9px;
    box-shadow: 0 4px 10px color-mix(in srgb, var(--glow) 55%, transparent);
  }
  .cab-top .nav-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    flex-shrink: 0;
    gap: 0;
    margin: 0;
    padding: 0;
  }
  .cab-top .theme-switch {
    height: 40px;
    padding: 3px;
    border-radius: 12px;
    gap: 2px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
  }
  .cab-top .theme-switch button {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    padding: 0;
    margin: 0;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    line-height: 1;
  }
  .cabinet-page .cab-panel.panel {
    width: auto;
    max-width: none;
    margin: 10px 12px 18px;
    padding: 14px 12px 18px;
    border-radius: 18px;
    box-sizing: border-box;
  }
  .cabinet-page .cab-title {
    font-size: 1.55rem;
    margin: 0 0 4px;
    line-height: 1.15;
  }
  .cabinet-page #hello {
    margin: 0 0 12px;
    font-size: .9rem;
  }
  .cabinet-page .os-pills {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px;
    margin: 10px 0 14px;
  }
  .cabinet-page .os-pill {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 10px 8px;
    box-sizing: border-box;
    white-space: nowrap;
  }
  .cabinet-page .app-clients {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .cabinet-page .app-client {
    min-height: 78px;
    padding: 12px;
    border-radius: 14px;
  }
  .cabinet-page .app-step {
    border-radius: 16px;
    padding: 14px;
  }
  .cabinet-page .row .btn {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
  }
  .cabinet-page .device-actions .btn {
    flex: 1 1 100%;
  }
  .cabinet-page .device-row {
    flex-wrap: wrap;
  }
  .cabinet-page .device-unlink-one {
    margin-left: auto;
  }
}

.device-actions {
  margin: 12px 0 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.device-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.device-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  cursor: pointer;
}
.device-row:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}
.device-check {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.device-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.device-title {
  font-weight: 600;
  color: var(--ink);
}
.device-meta {
  font-size: .86rem;
}
.device-unlink-one {
  flex-shrink: 0;
  padding: 8px 12px !important;
  height: auto !important;
  min-height: 0;
}

.guide-hero h3 { margin: 0 0 6px; }
.guide-steps {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.guide-step {
  display: flex;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
}
.guide-n {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-family: var(--font-display);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
}
.guide-body { min-width: 0; flex: 1; }
.guide-body h3 {
  margin: 2px 0 8px;
  font-size: 1.05rem;
  font-family: var(--font-display);
}
.guide-body p { margin: 0 0 10px; line-height: 1.45; }
.guide-body .info-list { margin: 0 0 10px; }
.guide-body .row { margin-top: 4px; }

/* Modern modal dialogs */
body.udm-modal-open { overflow: hidden; }
.udm-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 20px;
  box-sizing: border-box;
}
.udm-modal[hidden] { display: none !important; }
.udm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 18, .55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: udmFade .18s ease;
}
.udm-modal-card {
  position: relative;
  width: min(420px, 100%);
  padding: 22px 20px 18px;
  border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  background: var(--surface-solid);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .35);
  animation: udmPop .2s ease;
}
html[data-theme="light"] .udm-modal-card {
  background: #fff;
  box-shadow: 0 24px 64px rgba(20, 30, 50, .18);
}
.udm-modal-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  line-height: 1.25;
  color: var(--ink);
}
.udm-modal-text {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.45;
}
.udm-modal-text[hidden] { display: none !important; }
.udm-modal-input-wrap { margin: 0 0 16px; }
.udm-modal-input {
  width: 100%;
  box-sizing: border-box;
}
.udm-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.udm-modal-actions .btn {
  min-width: 110px;
  justify-content: center;
}
.udm-modal-actions .btn.hidden { display: none !important; }
@keyframes udmFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes udmPop {
  from { opacity: 0; transform: translateY(10px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 520px) {
  .udm-modal { align-items: end; padding: 12px; }
  .udm-modal-card {
    width: 100%;
    border-radius: 22px 22px 18px 18px;
    padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
  }
  .udm-modal-actions { flex-direction: column-reverse; }
  .udm-modal-actions .btn { width: 100%; min-width: 0; }
}

/* Cabinet notices */
.notices-list { display: grid; gap: 10px; }
.notice-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: color-mix(in srgb, var(--card, transparent) 80%, transparent);
  transition: border-color .15s, background .15s;
}
.notice-item.unread {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  box-shadow: inset 3px 0 0 var(--accent);
}
.notice-item .notice-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
}
.notice-item .notice-title { font-weight: 750; margin: 0; font-size: 1.02rem; }
.notice-item .notice-dot {
  flex-shrink: 0;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); margin-top: 6px;
}
.notice-item:not(.unread) .notice-dot { display: none; }
.notice-item .notice-body { margin: 8px 0 0; color: var(--muted); line-height: 1.45; }
.notice-item .notice-meta { margin-top: 10px; font-size: .8rem; color: var(--muted); }
.notice-item .notice-actions { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
