/* Motion Studies Design System — Borderless, Tonal Surfaces, Nested Radii */
:root {
  --bg: #000000;
  --stage: #111111;
  --card: #171717;
  --surface: #222222;
  --surface-2: #262626;
  --fill-1: rgba(255, 255, 255, 0.05);
  --fill-2: rgba(255, 255, 255, 0.09);
  --fill-3: rgba(255, 255, 255, 0.14);
  --text: #ffffff;
  --text-2: rgba(255, 255, 255, 0.78);
  --muted: #9a9a9a;
  --muted-2: #828282;
  --inverse: #ffffff;
  --on-inverse: #000000;
  --green: #34d17a;
  --green-soft: rgba(52, 209, 122, 0.14);
  --orange: #ff9f0a;
  --orange-soft: rgba(255, 159, 10, 0.15);
  --red: #ff5a5f;
  --red-soft: rgba(255, 90, 95, 0.16);
  --purple: #c69bff;
  --purple-soft: rgba(198, 155, 255, 0.15);
  --rim: transparent;
  --sh: 0;

  --r-card: 28px;
  --r-sheet: 24px;
  --r-panel: 16px;
  --r-tile: 14px;
  --r-row: 12px;
  --r-pill: 999px;
  --spring: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);

  /* Rubber Dock (DesignBookmark Motion) */
  --dock-lead: 640 38;
  --dock-trail: 150 16;
  --dock-drag-lead: 1100 56;
  --dock-drag-trail: 320 26;
  --dock-open-w: 340 21;
  --dock-open-h: 230 21;
  --dock-close: 420 30;
  --dock-pop: 520 16;
  --dock-expanded-w: 400;
}

* { box-sizing: border-box; }

html {
  margin: 0;
  padding: 0;
  min-height: 100%;
  min-height: calc(100% + env(safe-area-inset-top, 0px));
  height: -webkit-fill-available;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg);
  overscroll-behavior: none;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--fill-3); border-radius: var(--r-pill); }

code, .mono-num {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
}
code {
  background: var(--fill-2);
  color: var(--text);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 12px;
}

a { color: var(--text); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Grainy Mesh Avatars (exact DesignBookmark Motion tokens) */
[data-av] {
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
    radial-gradient(70% 70% at var(--p1), var(--av-l) 0, transparent 70%),
    radial-gradient(60% 60% at var(--p2), var(--av-p) 0, transparent 70%),
    radial-gradient(75% 75% at var(--p3), var(--av-b) 0, transparent 72%),
    var(--av-a) !important;
  background-blend-mode: overlay, normal, normal, normal, normal !important;
}
[data-av="1"] { --av-l:#ff8fd0;--av-a:#ff3fa6;--av-b:#6a35ff;--av-p:#ffd3ec;--p1:12% 10%;--p2:92% 8%;--p3:88% 96%; }
[data-av="2"] { --av-l:#7fe3ff;--av-a:#2b8cff;--av-b:#5a35ff;--av-p:#cdf3ff;--p1:102.9% 65.6%;--p2:34.6% 107.4%;--p3:-5.9% 29.2%; }
[data-av="3"] { --av-l:#d6ff5a;--av-a:#22d39a;--av-b:#0a8a8f;--av-p:#efffb0;--p1:65.6% -2.9%;--p2:107.4% 65.4%;--p3:29.2% 105.9%; }
[data-av="4"] { --av-l:#ffb866;--av-a:#ff4a5e;--av-b:#c31f86;--av-p:#ffe0b8;--p1:34.4% 102.9%;--p2:-7.4% 34.6%;--p3:70.8% -5.9%; }
[data-av="5"] { --av-l:#fff27a;--av-a:#ffa51f;--av-b:#ff4a2e;--av-p:#fff3bf;--p1:-3.6% 62.9%;--p2:34.6% -7.4%;--p3:108.8% 40.1%; }
[data-av="6"] { --av-l:#7dffea;--av-a:#1fa8ff;--av-b:#3a3cff;--av-p:#c9fff5;--p1:90% 12%;--p2:92% 92%;--p3:4% 88%; }
[data-av="7"] { --av-l:#ffd3f1;--av-a:#c07bff;--av-b:#ff4f9a;--av-p:#f0dcff;--p1:62.9% 103.6%;--p2:-7.4% 65.4%;--p3:40.1% -8.8%; }
[data-av="8"] { --av-l:#c2ffd6;--av-a:#2fe08a;--av-b:#0a9a6a;--av-p:#e2ffec;--p1:37.1% -3.6%;--p2:107.4% 34.6%;--p3:59.9% 108.8%; }
[data-av="9"] { --av-l:#ffe3b5;--av-a:#ff8a6a;--av-b:#ff3f86;--av-p:#ffe6d8;--p1:10% 88%;--p2:8% 8%;--p3:96% 12%; }
[data-av="10"] { --av-l:#bfa0ff;--av-a:#5a3cff;--av-b:#1a1ab0;--av-p:#e0d2ff;--p1:103.6% 37.1%;--p2:65.4% 107.4%;--p3:-8.8% 59.9%; }
[data-av="11"] { --av-l:#f6ff86;--av-a:#8ae83a;--av-b:#1fb86a;--av-p:#fbffc8;--p1:-2.9% 34.4%;--p2:65.4% -7.4%;--p3:105.9% 70.8%; }
[data-av="12"] { --av-l:#ffa3cd;--av-a:#e03cff;--av-b:#6a2cff;--av-p:#ffd2ea;--p1:88% 90%;--p2:8% 92%;--p3:12% 4%; }

.brand-av {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  flex-shrink: 0;
}
.brand-av-xs {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  flex-shrink: 0;
}
.brand-av-lg {
  width: 48px;
  height: 48px;
  border-radius: 14px;
}
.brand-heart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 44%, #28282d 0%, #1c1c20 68%, #121214 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
  padding: 2px;
}
.brand-av-xs.brand-heart {
  padding: 1.5px;
}
.brand-av-lg.brand-heart {
  padding: 4px;
}
.brand-heart-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  transform: translateY(1px);
}
.mini-av {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

/* Login Screen */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border-radius: var(--r-card);
  padding: 28px;
  animation: motionPopIn 0.36s var(--spring);
}
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.login-brand h1 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.login-brand p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }
.login-hint { margin-top: 16px; font-size: 12px; color: var(--muted-2); line-height: 1.5; text-align: center; }

/* Borderless Forms & Buttons (Motion Studies) */
.field-group { margin-bottom: 14px; }
.field-group label { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
input[type="text"], input[type="password"], input[type="search"], input[type="number"], input[type="date"], select, textarea {
  width: 100%;
  padding: 10px 14px;
  border: 0;
  border-radius: var(--r-row);
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: background .16s ease;
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:focus, select:focus, textarea:focus {
  background: var(--surface-2);
}
select option { background: #262626; color: #fff; }
.input-sm { padding: 8px 11px !important; font-size: 13px !important; }
.row-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.checkbox-label { display: inline-flex !important; align-items: center; gap: 8px; margin-bottom: 0 !important; cursor: pointer; color: var(--text-2); }
.checkbox-label input { width: auto; accent-color: var(--inverse); }

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: 0;
  border-radius: var(--r-row);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.18s var(--spring), background 0.15s ease, opacity 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: scale(0.96); }
.btn-primary { background: var(--inverse); color: var(--on-inverse); border-radius: var(--r-pill); }
.btn-primary:hover { opacity: 0.92; text-decoration: none; }
.btn-outline { background: var(--fill-2); color: var(--text); }
.btn-outline:hover { background: var(--fill-3); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--fill-2); color: var(--text); text-decoration: none; }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-success { background: var(--green-soft); color: var(--green); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 10px; }
.btn-xs { padding: 5px 9px; font-size: 11px; border-radius: 8px; }
.btn-block { width: 100%; }

.form-error {
  background: var(--red-soft);
  color: var(--red);
  padding: 9px 12px;
  border-radius: var(--r-row);
  font-size: 13px;
  margin-bottom: 12px;
}

/* App Shell */
.app-shell {
  display: flex;
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  padding: 16px;
  gap: 16px;
  overflow: hidden;
  background: var(--stage);
}

/* Floating Nav Menu Popover (opens on hover/tap from top-right trigger) */
.nav-menu-anchor {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.menu-trigger-btn {
  appearance: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 11px 0 6px;
  border: 0;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s var(--spring);
}
.menu-trigger-btn:hover,
.nav-menu-anchor.is-open .menu-trigger-btn {
  background: var(--fill-3);
}
.menu-trigger-btn:active { transform: scale(0.95); }
.menu-trigger-ico { color: var(--text-2); flex-shrink: 0; }
.menu-alert-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 2px var(--card);
}
.menu-trigger-btn.has-alert {
  animation: menuAlertFlash 1.25s ease-in-out infinite;
}
.menu-trigger-btn.has-alert.has-urgent-alert {
  animation-duration: 0.85s;
}
.menu-trigger-btn.has-alert .menu-trigger-ico,
.menu-trigger-btn.has-alert .menu-trigger-label {
  color: #ffd4d6;
}
.menu-trigger-btn.has-alert .menu-alert-dot {
  animation: menuDotPulse 1.25s ease-in-out infinite;
}

.sidebar,
.sidebar.sidebar-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 248px;
  z-index: 650;
  background: var(--surface);
  border-radius: var(--r-sheet);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
  transform-origin: top right;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  will-change: transform, opacity;
}
.sidebar.sidebar-popover::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -14px;
  height: 14px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 2px 2px 4px;
}
.brand-title {
  flex: 1;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.015em;
  color: var(--text);
  white-space: nowrap;
  transition: opacity 0.16s ease;
}
.collapse-btn {
  appearance: none;
  border: 0;
  background: var(--fill-2);
  color: var(--text-2);
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.16s ease, color 0.16s ease;
}
.collapse-btn:hover { background: var(--fill-3); color: var(--text); }
.collapse-btn svg { transition: transform 0.32s var(--spring); }

.sidebar-nav {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-pill {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 40px;
  background: var(--fill-2);
  border-radius: 13px;
  pointer-events: none;
  z-index: 0;
}
.nav-btn {
  appearance: none;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: color 0.16s ease;
}
.nav-btn:hover,
.nav-btn.active { color: var(--text); }
.nav-ico { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 20px; }
.nav-label { flex: 1; white-space: nowrap; transition: opacity 0.16s ease; }

.nav-count {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  transition: opacity 0.16s ease;
}
.nav-count.green { background: var(--green-soft); color: var(--green); }
.nav-count.red { background: var(--red); color: #fff; }
.nav-count.alert-cnt { background: var(--red-soft); color: var(--red); }
.nav-count.muted-cnt { background: var(--fill-2); color: var(--muted); }

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted-2);
  flex-shrink: 0;
}
.dot.online { background: var(--green); }

/* Main Workspace */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: var(--card);
  border-radius: var(--r-card);
}

/* Top Bar */
.top-motion-bar {
  position: relative;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  gap: 12px;
  flex-shrink: 0;
  max-height: 76px;
  background: rgba(255, 255, 255, 0.02);
  transition: opacity 0.26s ease, transform 0.34s cubic-bezier(0.16, 1, 0.3, 1), max-height 0.32s ease, padding 0.32s ease;
}
.mobile-title { display: none; }
.top-bar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* Global Expanding Search (replaces Morph Island) */
.gsearch-anchor {
  position: relative;
  display: flex;
  align-items: center;
  z-index: 640;
}
.gsearch-bar {
  position: relative;
  height: 38px;
  width: 38px;
  border-radius: 999px;
  background: var(--surface);
  display: flex;
  align-items: center;
  overflow: hidden;
  will-change: width;
  transition: background 0.16s ease, box-shadow 0.2s ease;
}
.gsearch-bar:hover { background: var(--surface-2); }
.gsearch-anchor.is-open .gsearch-bar {
  background: var(--surface-2);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.gsearch-trigger {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-2);
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
  transition: color 0.15s ease;
}
.gsearch-trigger:hover { color: var(--text); }
.gsearch-ws-dot {
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 6px;
  height: 6px;
  box-shadow: 0 0 0 2px var(--surface);
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.gsearch-anchor.is-open .gsearch-ws-dot {
  opacity: 0;
  transform: scale(0.4);
}
.gsearch-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: transparent !important;
  border: 0 !important;
  padding: 0 6px 0 0 !important;
  font-size: 13.5px;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
}
.gsearch-input:focus { background: transparent !important; }
.gsearch-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.gsearch-kbd { flex-shrink: 0; margin-right: 6px; opacity: 0; pointer-events: none; }
.gsearch-clear {
  appearance: none;
  border: 0;
  background: var(--fill-2);
  color: var(--muted);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  margin-right: 7px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: background 0.14s ease, color 0.14s ease;
}
.gsearch-clear:hover { background: var(--fill-3); color: var(--text); }

.gsearch-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: min(540px, calc(100vw - 40px));
  max-height: min(68vh, 520px);
  overflow-y: auto;
  background: var(--surface);
  border-radius: 22px;
  padding: 10px;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.08);
  transform-origin: top left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 660;
  will-change: transform, opacity;
}
.gs-group { margin-bottom: 10px; }
.gs-group:last-child { margin-bottom: 0; }
.gs-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-2);
}
.gs-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.gs-item:hover,
.gs-item.is-active { background: var(--fill-2); }
.gs-thumb {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: contain;
  background: #fff;
  padding: 2px;
  flex-shrink: 0;
}
.gs-ico {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--fill-2);
  color: var(--text-2);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 14px;
}
.gs-main { flex: 1; min-width: 0; }
.gs-title {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gs-sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.gs-right {
  text-align: right;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}
.gs-empty,
.gs-loading {
  padding: 22px 14px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.top-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px;
  border: 0;
  border-radius: 10px;
  background: var(--fill-1);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.top-chip:hover { background: var(--fill-2); color: var(--text); text-decoration: none; }
.kbd-chip {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--fill-2);
  color: var(--text-2);
}

.icon-pill {
  appearance: none;
  background: var(--fill-1);
  border: 0;
  border-radius: 10px;
  height: 32px;
  width: 32px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.icon-pill:hover { background: var(--fill-2); color: var(--text); }
.icon-pill.muted-state { opacity: 0.45; }
.bell-btn.swinging svg { animation: bellSwing 0.5s ease; transform-origin: top center; }

/* Rubber Dock (DesignBookmark Motion) */
.rd-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 948;
}
.rd-ground {
  position: fixed;
  left: 50%;
  bottom: calc(5px + var(--safe-bottom));
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.62), transparent);
  filter: blur(7px);
  pointer-events: none;
  z-index: 949;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.rd-dock {
  position: fixed;
  left: 50%;
  bottom: calc(12px + var(--safe-bottom));
  width: 68px;
  height: 68px;
  border-radius: 34px;
  background: var(--surface-2);
  box-shadow: 0 20px 48px -18px rgba(0, 0, 0, 0.82), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  overflow: hidden;
  transform: translate3d(-50%, 42px, 0) scale(0.9);
  will-change: width, height, transform;
  z-index: 950;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.rd-tabs {
  position: absolute;
  left: 50%;
  bottom: 6px;
  height: var(--rd-tab, 56px);
  transform: translateX(-50%);
  touch-action: none;
  cursor: grab;
}
.rd-tabs.dragging { cursor: grabbing; }
.rd-icons {
  position: absolute;
  inset: 0;
  display: flex;
  gap: 4px;
}
.rd-icons > * {
  width: var(--rd-tab, 56px);
  height: var(--rd-tab, 56px);
  display: grid;
  place-items: center;
  flex: none;
  position: relative;
}
.rd-icons.base button {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted);
  cursor: inherit;
  border-radius: 28px;
  outline: none;
}
.rd-icons.top {
  pointer-events: none;
  color: var(--on-inverse);
}
.rd-icons svg {
  width: 22px;
  height: 22px;
  display: block;
  will-change: transform;
}
.rd-unread-dot,
.rd-alert-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 2px var(--surface-2), 0 0 8px rgba(255, 90, 95, 0.72);
  pointer-events: none;
  animation: rdAlertPulse 1.15s ease-in-out infinite;
}
.rd-icons.top .rd-alert-dot {
  box-shadow: 0 0 0 2px var(--inverse), 0 0 8px rgba(255, 90, 95, 0.72);
}
@keyframes rdAlertPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.32); opacity: 0.52; }
}
.rd-indicator {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--rd-tab, 56px);
  height: var(--rd-tab, 56px);
  border-radius: 28px;
  background: var(--inverse);
  pointer-events: none;
}
.rd-panels {
  position: absolute;
  left: 50%;
  top: 0;
  width: var(--rd-exp-w, 340px);
  bottom: 68px;
  transform: translateX(-50%);
  pointer-events: none;
}
.rd-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  padding: 18px 18px 8px;
  pointer-events: none;
}
.rd-panel.on { pointer-events: auto; }
.rd-it {
  opacity: 0;
  filter: blur(5px);
  transform: translate3d(var(--x, 0px), var(--y, 10px), 0) scale(0.98);
  transition: opacity 0.16s ease, transform 0.28s ease, filter 0.16s ease;
}
.rd-panel.on .rd-it {
  opacity: 1;
  filter: none;
  transform: none;
  transition:
    opacity 0.4s ease calc(var(--i, 0) * 45ms + 70ms),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1) calc(var(--i, 0) * 45ms + 70ms),
    filter 0.4s ease calc(var(--i, 0) * 45ms + 70ms);
}
.rd-prep .rd-it { transition: none !important; }

.rd-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}
.rd-head.rd-head-summary {
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.rd-head-title-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.rd-head-title-col h3 {
  margin: 0;
}
.rd-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.rd-head small {
  font-size: 12px;
  color: var(--muted);
}
.rd-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.rd-tile {
  background: var(--fill-1);
  border-radius: 14px;
  padding: 11px 12px;
  min-width: 0;
}
.rd-tile small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 5px;
}
.rd-tile b {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.rd-tile b.green-val { color: var(--green); }
.rd-chart {
  height: 112px;
  background: var(--fill-1);
  border-radius: 14px;
  padding: 12px 12px 10px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
}
.rd-bar {
  flex: 1;
  height: var(--h, 20%);
  border-radius: 5px;
  background: var(--fill-3);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.2s ease;
}
.rd-bar.hi { background: var(--green); }
.rd-panel.on .rd-bar {
  transform: scaleY(1);
  transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) calc(var(--b, 0) * 35ms + 220ms);
}

.rd-field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  border-radius: 14px;
  background: var(--fill-1);
  padding: 0 12px;
  margin-bottom: 10px;
}
.rd-field svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
  flex: none;
}
.rd-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  color: var(--text);
  font-size: 16px;
  outline: none;
}
.rd-field input::-webkit-search-cancel-button { -webkit-appearance: none; }
.rd-clear-btn {
  appearance: none;
  border: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--fill-2);
  color: var(--muted);
  font-size: 11px;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
}
.rd-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.rd-chip {
  appearance: none;
  border: 0;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--fill-2);
  color: var(--text-2);
  cursor: pointer;
}
.rd-chip:active { transform: scale(0.95); }
.rd-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 196px;
  overflow-y: auto;
}
.rd-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 6px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.14s ease;
}
.rd-row:active,
.rd-row:hover { background: var(--fill-1); }
.rd-av {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  background: var(--fill-3);
}
.rd-row-tx { flex: 1; min-width: 0; }
.rd-row-tx b {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rd-row-tx span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rd-row time {
  font-size: 11px;
  color: var(--muted);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  flex: none;
}
.rd-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
  flex: none;
}

.rd-me {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 12px;
}
.rd-av-lg {
  width: 48px;
  height: 48px;
  font-size: 16px;
}
.rd-me-info { min-width: 0; flex: 1; }
.rd-me-info b {
  display: block;
  font-size: 15.5px;
  font-weight: 600;
}
.rd-ws-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.rd-set {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 44px;
  font-size: 14px;
  color: var(--text-2);
}
.rd-sw {
  width: 42px;
  height: 26px;
  border-radius: 999px;
  background: var(--fill-3);
  position: relative;
  border: 0;
  cursor: pointer;
  transition: background 0.25s;
}
.rd-sw::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), width 0.2s;
}
.rd-sw:active::after { width: 26px; }
.rd-sw[aria-checked="true"] { background: var(--green); }
.rd-sw[aria-checked="true"]::after { transform: translateX(16px); }
.rd-sw[aria-checked="true"]:active::after { transform: translateX(10px); }

.rd-foot-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.rd-act-btn {
  flex: 1;
  height: 38px;
  border-radius: 12px;
  border: 0;
  background: var(--fill-2);
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.rd-act-btn:hover { text-decoration: none; }
.rd-act-primary { background: var(--inverse); color: var(--on-inverse); }
.rd-act-danger { background: var(--red-soft); color: var(--red); flex: 0 0 auto; padding: 0 12px; }

.tab-panel {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px;
}
.tab-panel.active {
  display: block;
  animation: tabFadeIn 0.24s var(--spring);
}
#tab-chat.active { padding: 0; display: flex; flex-direction: column; overflow: hidden; }

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.panel-header h2 { margin: 0 0 4px; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.muted { color: var(--muted); font-size: 13px; margin: 0; }

/* Segmented Control — exact match to Day | Week | Month | Year on screenshot */
.segmented {
  position: relative;
  display: inline-flex;
  background: var(--surface);
  padding: 4px;
  border-radius: var(--r-panel);
  gap: 2px;
  flex-wrap: wrap;
}
.seg-glider {
  position: absolute;
  top: 4px;
  left: 0;
  height: calc(100% - 8px);
  background: var(--inverse);
  border-radius: var(--r-row);
  pointer-events: none;
  z-index: 1;
}
.seg-btn {
  appearance: none;
  position: relative;
  z-index: 2;
  border: 0;
  background: transparent;
  padding: 7px 14px;
  border-radius: var(--r-row);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  transition: color 0.16s ease;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active { color: var(--on-inverse); font-weight: 600; }
.segmented-sm .seg-btn { padding: 6px 10px; font-size: 12px; }

/* Borderless Tonal Cards */
.card {
  background: var(--fill-1);
  border-radius: var(--r-sheet);
  padding: 18px;
  margin-bottom: 16px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card h3 { margin: 0 0 12px; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.card-head h3 { margin: 0; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.kpi-card {
  background: var(--fill-1);
  border-radius: 20px;
  padding: 16px 18px;
  transition: background 0.18s ease;
}
.kpi-card:hover { background: var(--fill-2); }
.kpi-label { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.kpi-val { font-size: 26px; font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; }
.kpi-val.green-val { color: var(--green); }
.kpi-sub { font-size: 12.5px; color: var(--muted); font-weight: 500; margin-top: 5px; }

.traffic-analytics-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 14px;
}

/* Traffic Dashboard: Tab Pill + Users Split + Popular Products + SEO Analytics */
.tr-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.tr-top-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.tr-top-left h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.tr-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--text-2);
}

/* Tab Pill (DesignBookmark Motion) */
.tr-tp-wrap {
  max-width: 100%;
  overflow: hidden;
}
.tr-tp-tabs {
  position: relative;
  display: inline-flex;
  padding: 4px;
  border-radius: var(--r-pill);
  background: var(--surface);
  transform-origin: left center;
}
.tr-tp-tabs button {
  position: relative;
  z-index: 1;
  padding: 8px 15px;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.25s;
}
.tr-tp-tabs button:hover { color: var(--text); }
.tr-tp-tabs button[aria-selected="true"] {
  color: var(--on-inverse);
  font-weight: 600;
}
.tr-tp-pill {
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  border-radius: var(--r-pill);
  background: var(--inverse);
  will-change: transform, width;
  pointer-events: none;
}

.tr-page-view[hidden] { display: none !important; }

/* View 1: Users (Stat Card Left + Active Users Right) */
.tr-users-grid {
  display: grid;
  grid-template-columns: minmax(320px, 376px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.tr-users-grid .tr-visitors-card { margin-bottom: 0; }

/* 1. Stat Card */
.tr-stat-card {
  padding: 18px;
  border-radius: 24px;
  background: var(--surface);
  min-width: 0;
}
.tr-stat-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.tr-stat-lab { font-size: 13px; color: var(--muted); line-height: 18px; margin: 0; }
.tr-stat-big {
  font-size: 34px;
  line-height: 40px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  margin: 2px 0 0;
}
.tr-stat-delta {
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--green-soft);
  color: var(--green);
  white-space: nowrap;
}
.tr-stat-delta.is-neg { background: var(--red-soft); color: var(--red); }
.tr-stat-cw { position: relative; margin: 14px 0; }
.tr-stat-chart { display: block; width: 100%; height: 104px; overflow: visible; }
.tr-stat-dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(52, 209, 122, 0.22);
  will-change: transform;
  pointer-events: none;
}
.tr-stat-seg {
  position: relative;
  display: flex;
  padding: 3px;
  border-radius: var(--r-pill);
  background: var(--fill-1);
}
.tr-stat-seg button {
  position: relative;
  z-index: 1;
  flex: 1;
  padding: 7px 0;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s;
}
.tr-stat-seg button.on { color: var(--text); font-weight: 600; }
.tr-stat-pill {
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 3px;
  border-radius: var(--r-pill);
  background: var(--fill-3);
  pointer-events: none;
  will-change: transform, width;
}
.tr-kpi-mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}
.tr-kpi-tile {
  background: var(--fill-1);
  border-radius: 14px;
  padding: 10px 12px;
  min-width: 0;
}
.tr-kpi-lbl { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-kpi-num { font-size: 16px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-kpi-num.green-val { color: var(--green); }
.tr-kpi-num small { font-size: 12px; font-weight: 500; }

/* 2. Smooth Tab / Swipe Tabs */
.tr-smooth-card {
  padding: 16px;
  border-radius: 24px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  min-width: 0;
}
.st-head { display: flex; justify-content: center; }
.st-tablist {
  position: relative;
  display: inline-flex;
  max-width: 100%;
  border-radius: var(--r-pill);
  background: var(--fill-1);
  padding: 3px;
}
.st-tab {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: color 0.15s ease;
}
.st-tab:hover { color: var(--text); }
.st-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  padding: 3px;
  background: var(--inverse);
  pointer-events: none;
  will-change: clip-path;
  clip-path: inset(0 100% 0 0);
}
.st-overlay-lbl {
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--on-inverse);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}
.st-viewport {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: var(--fill-1);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}
.st-viewport[data-dragging] { cursor: grabbing; }
.st-track {
  display: flex;
  width: 400%;
  will-change: transform;
}
.st-panel {
  width: 25%;
  padding: 12px;
  min-height: 256px;
  max-height: 300px;
  overflow-y: auto;
  flex-shrink: 0;
}
.tr-list-stack { display: flex; flex-direction: column; gap: 7px; }
.tr-rank-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--surface);
  font-size: 12.5px;
  transition: background 0.14s ease;
}
.tr-rank-item:hover { background: var(--surface-2); }
.tr-rank-item img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  padding: 2px;
  flex-shrink: 0;
}
.tr-rank-ico {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--fill-2);
  color: var(--text-2);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 13px;
}
.tr-rank-main { flex: 1; min-width: 0; }
.tr-rank-title { font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-rank-sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.tr-funnel { display: flex; flex-direction: column; gap: 12px; padding: 4px 2px; }
.tr-funnel-step { display: flex; flex-direction: column; gap: 5px; }
.tr-funnel-top { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-2); }
.tr-funnel-top strong { color: var(--text); font-family: "JetBrains Mono", monospace; }
.tr-funnel-track { height: 7px; border-radius: 999px; background: var(--fill-2); overflow: hidden; }
.tr-funnel-bar { height: 100%; border-radius: 999px; background: var(--green); transition: width 0.5s var(--spring); }

/* 3. Notification Stack (Лента событий) */
.tr-notif-card {
  padding: 16px;
  border-radius: 24px;
  background: var(--surface);
  min-width: 0;
}
.ns-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.ns-head h3 { margin: 0; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.ns-count { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--fill-2); padding: 2px 7px; border-radius: 999px; }
.ns-toggle-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  font-family: inherit;
  padding: 4px 9px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}
.ns-toggle-btn:hover { background: var(--fill-2); color: var(--text); }
.ns-list {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  outline: none;
  transition: height 0.32s cubic-bezier(0.23, 1, 0.32, 1);
}
.ns-li {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  transform-origin: top center;
  transition: transform 0.32s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.28s cubic-bezier(0.23, 1, 0.32, 1);
}
.ns-swipe { touch-action: pan-y; will-change: transform, opacity; }
.ns-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.06);
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
}
.ns-card-inner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  flex: 1;
  transition: opacity 0.2s ease;
}
.ns-card-inner.is-muted { opacity: 0; }
.ns-ico {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 14px;
  background: var(--fill-2);
  color: var(--text);
}
.ns-ico-green { background: var(--green-soft); color: var(--green); }
.ns-ico-purple { background: var(--purple-soft); color: var(--purple); }
.ns-ico-orange { background: var(--orange-soft); color: var(--orange); }
.ns-ico-blue { background: rgba(62, 201, 255, 0.16); color: #3ec9ff; }
.ns-body { flex: 1; min-width: 0; }
.ns-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ns-title { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ns-time { font-size: 11px; color: var(--muted-2); flex-shrink: 0; font-family: "JetBrains Mono", monospace; }
.ns-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.ns-dismiss {
  appearance: none;
  position: absolute;
  top: -7px;
  right: -7px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 0;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.ns-card:hover .ns-dismiss,
.ns-dismiss:focus-visible { opacity: 1; }
.ns-dismiss:hover { background: var(--fill-3); color: var(--text); }
.ns-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* 4. Pull to Refresh Visitors */
.tr-visitors-card {
  background: var(--surface);
  border-radius: 24px;
  padding: 18px;
  overflow: hidden;
}
.tr-vis-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.tr-vis-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tr-vis-title h3 { margin: 0; font-size: 16px; font-weight: 600; }
.tr-ptr-updated { font-size: 12px; color: var(--muted); }
.tr-vis-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
  justify-content: flex-end;
}
.tr-vis-search { flex: 1; min-width: 210px; max-width: 340px; }
.tr-vis-search input[type="search"] { background: var(--fill-1); height: 38px; border-radius: 13px; }
.tr-vis-search input[type="search"]:focus { background: var(--fill-2); }
.tr-ptr-body {
  position: relative;
  min-height: 110px;
  overflow: hidden;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.tr-ptr-body.dragging { cursor: grabbing; }
.tr-ptr-list {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
  background: var(--surface);
  will-change: transform;
}
.tr-vis-row {
  display: grid;
  grid-template-columns: minmax(138px, 1fr) minmax(130px, 0.9fr) minmax(150px, 1.15fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 16px;
  background: var(--fill-1);
  cursor: pointer;
  transition: background 0.14s ease;
}
.tr-vis-row:hover { background: var(--fill-2); }
.tr-vis-row.is-fresh { animation: rowIn 0.65s cubic-bezier(0.16, 1, 0.3, 1) both; }
.tr-vis-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tr-vis-user-meta { min-width: 0; }
.tr-vis-name { font-weight: 600; font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-vis-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-vis-dev { min-width: 0; font-size: 12px; color: var(--muted); line-height: 1.45; }
.tr-vis-page { min-width: 0; }
.tr-vis-page-title { font-weight: 500; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-vis-page-url { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.tr-vis-stats { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tr-vis-actions { display: flex; align-items: center; gap: 6px; justify-content: flex-end; grid-column: 1 / -1; justify-content: space-between; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, 0.05); }

/* View 2: Popular Products & Database */
.tr-prod-hero,
.tr-prod-db-card {
  background: var(--surface);
  border-radius: 24px;
  padding: 18px;
}
.tr-prod-hero-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.tr-prod-hero-head h3 { margin: 0 0 4px; font-size: 16px; }
.tr-prod-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tr-prod-stat-chip {
  background: var(--fill-1);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  color: var(--text-2);
}
.tr-prod-stat-chip strong { color: var(--text); font-family: "JetBrains Mono", monospace; }
.tr-prod-top-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
}
.tr-prod-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  background: var(--fill-1);
  min-width: 0;
  transition: background 0.14s ease;
}
.tr-prod-card:hover { background: var(--fill-2); }
.tr-prod-card-rank {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}
.tr-prod-card img,
.tr-prod-row img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  padding: 3px;
  flex-shrink: 0;
}
.tr-prod-card-main { flex: 1; min-width: 0; }
.tr-prod-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tr-prod-card-meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.tr-prod-card-cnt {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}
.tr-prod-card-cnt strong { font-size: 16px; color: var(--green); }
.tr-prod-card-cnt span { font-size: 10.5px; color: var(--muted); }

.tr-prod-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.tr-prod-search-wrap { flex: 1; min-width: 210px; }
.tr-prod-search-wrap input[type="search"] {
  background: var(--fill-1);
  height: 38px;
  border-radius: 13px;
}
.tr-prod-add-panel {
  background: var(--fill-1);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 14px;
}
.tr-prod-add-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tr-prod-add-head input[type="search"] {
  flex: 1;
  background: var(--surface);
  height: 36px;
  border-radius: 11px;
}
.tr-prod-catalog-results {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
}
.tr-prod-db-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tr-prod-row {
  display: grid;
  grid-template-columns: auto minmax(180px, 1.5fr) auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 15px;
  background: var(--fill-1);
}
.tr-prod-row:hover { background: var(--fill-2); }
.tr-prod-row-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tr-prod-row-actions { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }

/* View 3: Sources & SEO Analytics */
.seo-card,
.seo-table-card {
  background: var(--surface);
  border-radius: 24px;
  padding: 18px;
}
.seo-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.seo-card-head h3 { margin: 0 0 4px; font-size: 17px; }
.seo-metrics-bar {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.seo-metric-btn {
  appearance: none;
  border: 0;
  background: var(--fill-1);
  border-radius: 14px;
  padding: 10px 12px;
  text-align: left;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: background 0.14s ease;
  min-width: 0;
}
.seo-metric-btn:hover { background: var(--fill-2); }
.seo-metric-btn.active { background: var(--fill-3); }
.seo-metric-top {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.seo-radio {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.seo-metric-btn.active .seo-radio { background: #7c5cff; }
.seo-metric-btn.active .seo-radio::after {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff;
}
.seo-metric-val {
  margin-top: 6px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.seo-metric-delta {
  font-size: 11px;
  font-weight: 600;
  color: var(--red);
}
.seo-metric-delta.good { color: var(--green); }

.seo-chart-wrap {
  position: relative;
  width: 100%;
  min-height: 210px;
  margin-bottom: 12px;
}
.seo-chart-svg {
  display: block;
  width: 100%;
  height: 220px;
  overflow: visible;
}
.seo-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 10;
  background: rgba(20, 20, 22, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text);
  min-width: 170px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}
.seo-tooltip-date { font-weight: 600; margin-bottom: 5px; font-size: 12px; color: var(--text); }
.seo-tooltip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  line-height: 1.55;
  color: var(--text-2);
}
.seo-tooltip-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 6px;
}

.seo-legend {
  display: flex;
  align-items: center;
  gap: 12px 18px;
  flex-wrap: wrap;
  padding-top: 6px;
}
.seo-chk {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 4px 6px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: inherit;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.14s, opacity 0.14s;
}
.seo-chk:hover { background: var(--fill-1); }
.seo-chk.is-off { opacity: 0.45; }
.seo-chk-box {
  width: 15px;
  height: 15px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}
.seo-chk-num { color: var(--text); font-weight: 600; }

.tr-seo-grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.tr-seo-grid-2 .seo-table-card { margin-bottom: 0; }
.seo-table-wrap { overflow-x: auto; }
.seo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.seo-table th,
.seo-table td {
  padding: 9px 10px;
  text-align: left;
  white-space: nowrap;
}
.seo-table th {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.seo-table tbody tr + tr td {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.seo-table td.num,
.seo-table th.num {
  text-align: right;
  font-family: "JetBrains Mono", monospace;
}
.seo-src-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
.seo-url-cell {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mini-chart {
  height: 168px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding-top: 16px;
}
.chart-bar-wrap {
  flex: 1;
  min-width: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}
.chart-bar {
  width: 100%;
  max-width: 24px;
  background: var(--fill-3);
  border-radius: 5px;
  min-height: 4px;
  transform-origin: bottom;
  animation: barGrow 0.4s var(--spring);
  transition: background 0.16s ease;
}
.chart-bar-wrap:hover .chart-bar { background: var(--inverse); }
.chart-bar-lbl { font-size: 10px; color: var(--muted-2); margin-top: 6px; white-space: nowrap; }

.compact-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 215px;
  overflow-y: auto;
}
.compact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--r-tile);
  background: var(--fill-1);
  font-size: 12.5px;
  transition: background 0.15s ease;
}
.compact-item:hover { background: var(--fill-2); }
.compact-item img { width: 36px; height: 36px; object-fit: contain; border-radius: 8px; background: #fff; padding: 2px; }
.compact-item .ci-main { flex: 1; min-width: 0; }
.compact-item .ci-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compact-item .ci-sub { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

/* Tables & Toolbars */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.search-box { flex: 1; min-width: 240px; max-width: 420px; }

/* Orders Expand Card & Toolbar */
.orders-card { padding: 18px; }
.orders-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.ord-toolbar-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 260px;
}
.ord-search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.ord-search-wrap svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2);
  pointer-events: none;
}
.ord-search-wrap input[type="search"] {
  padding: 0 14px 0 38px;
  height: 40px;
  border-radius: 14px;
  background: var(--surface-2);
}
.ord-search-wrap input[type="search"]:focus { background: var(--fill-3); }
.ord-toolbar-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
#orders-status-filter {
  height: 40px;
  line-height: 20px;
  border-radius: 14px;
  padding: 10px 12px;
  width: auto;
  min-width: 180px;
  background: var(--surface-2);
  cursor: pointer;
}
#orders-status-filter:focus { background: var(--fill-3); }
.ord-dates-group { display: inline-flex; align-items: center; gap: 6px; }
.ord-date-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 10px;
  border-radius: 14px;
  background: var(--surface-2);
  font-size: 12px;
  color: var(--muted);
}
.ord-date-field input[type="date"] {
  background: transparent;
  padding: 0;
  height: 100%;
  width: auto;
  font-size: 13px;
}
.ord-date-field input[type="date"]:focus { background: transparent; }
.ord-refresh-btn {
  height: 40px;
  border-radius: 14px;
  padding: 0 14px;
}
.ord-refresh-btn.spinning svg { animation: spin360 0.65s var(--spring); }
.ord-filter-toggle {
  height: 40px;
  border-radius: 14px;
  padding: 0 12px;
  flex-shrink: 0;
}
.ord-filter-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}
.ord-reset-btn { height: 40px; border-radius: 14px; }

.orders-expand-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}
.ord-ex {
  position: relative;
  width: 100%;
  height: 76px;
  border-radius: 20px;
  background: var(--surface);
  overflow: hidden;
  cursor: pointer;
  will-change: height, transform, opacity;
  transition: background 0.16s ease;
}
.ord-ex:hover,
.ord-ex.is-open { background: var(--surface-2); }
.ord-thumb {
  position: absolute;
  left: 12px;
  top: 12px;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  overflow: hidden;
  will-change: width, height, border-radius;
}
.ord-thumb-compact {
  position: absolute;
  inset: 0;
  background: #fff;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  will-change: opacity;
}
.ord-thumb-compact img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.ord-thumb-count {
  position: absolute;
  right: 3px;
  bottom: 3px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 999px;
}
.ord-thumb-banner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.14), rgba(0, 0, 0, 0.44));
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
}
.ord-banner-photos {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
}
.ord-banner-photos::-webkit-scrollbar { display: none; }
.ord-banner-tile {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 12px;
  background: #fff;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ord-banner-tile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.ord-qty-badge {
  position: absolute;
  right: 4px;
  bottom: 4px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 999px;
  line-height: 1;
}
.ord-banner-meta {
  flex-shrink: 0;
  text-align: right;
  padding: 6px 11px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: 12px;
  line-height: 1.35;
}
.ord-head {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
  min-width: 0;
  pointer-events: none;
}
.ord-t {
  font-size: 15px;
  font-weight: 600;
  line-height: 21px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}
.ord-s {
  font-size: 13px;
  line-height: 19px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 2px 0 0;
}
.ord-price {
  position: absolute;
  right: 16px;
  top: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  will-change: transform;
  pointer-events: none;
}
.ord-sum {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.ord-chev {
  width: 18px;
  height: 18px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  will-change: transform;
}
.ord-more {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 184px;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
.ord-items-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.ord-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 11px;
  border-radius: 12px;
  background: var(--fill-1);
  font-size: 13px;
}
.ord-item-name { font-weight: 500; color: var(--text); min-width: 0; flex: 1; }
.ord-item-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  color: var(--text-2);
  font-size: 12.5px;
}
.ord-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.ord-meta-box {
  background: var(--fill-1);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  word-break: break-word;
}
.ord-meta-lbl {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-2);
  font-weight: 600;
  margin-bottom: 2px;
}
.ord-phone-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.ord-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ord-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 11px;
  border-radius: var(--r-pill);
  background: var(--fill-2);
  color: var(--text-2);
  white-space: nowrap;
  border: 0;
  font-family: inherit;
}
.ord-chip-btn {
  cursor: pointer;
  transition: background 0.15s, transform 0.16s var(--spring);
}
.ord-chip-btn:hover { background: var(--fill-3); color: var(--text); }
.ord-chip-btn:active { transform: scale(0.95); }
.ord-chip-green { background: var(--green-soft); color: var(--green); }
.ord-chip-green:hover { background: rgba(52, 209, 122, 0.24); color: var(--green); }
.ord-chip-red { background: var(--red-soft); color: var(--red); }
.ord-chip-red:hover { background: rgba(255, 90, 95, 0.24); color: var(--red); }
.ord-chip-amber { background: var(--orange-soft); color: var(--orange); }
.ord-chip-amber:hover { background: rgba(255, 159, 10, 0.24); color: var(--orange); }
.ord-go {
  margin-left: auto;
  appearance: none;
  border: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  background: var(--inverse);
  color: var(--on-inverse);
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.16s var(--spring), opacity 0.15s;
}
.ord-go:hover { opacity: 0.92; }
.ord-go:active { transform: scale(0.96); }
.ord-empty {
  text-align: center;
  padding: 36px 16px;
  color: var(--muted);
  font-size: 13px;
  background: var(--fill-1);
  border-radius: 18px;
}
.ord-status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: 13px; }
.data-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11.5px;
  color: var(--muted-2);
  font-weight: 500;
  white-space: nowrap;
}
.data-table tbody tr {
  background: var(--fill-1);
  transition: background 0.14s ease;
}
.data-table tbody tr:hover { background: var(--fill-2); }
.data-table td { padding: 12px; vertical-align: middle; }
.data-table tbody td:first-child { border-radius: 12px 0 0 12px; }
.data-table tbody td:last-child { border-radius: 0 12px 12px 0; }
.clickable-row { cursor: pointer; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.pill-green { background: var(--green-soft); color: var(--green); }
.pill-gray { background: var(--fill-2); color: var(--muted); }
.pill-purple { background: var(--purple-soft); color: var(--purple); }
.pill-amber { background: var(--orange-soft); color: var(--orange); }
.pill-red { background: var(--red-soft); color: var(--red); }

.ip-link {
  appearance: none;
  background: var(--fill-2);
  color: var(--text);
  border: 0;
  padding: 3px 8px;
  border-radius: 7px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11.5px;
  cursor: pointer;
  transition: background 0.14s ease;
}
.ip-link:hover { background: var(--fill-3); }

.copy-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: var(--fill-2);
  color: var(--muted);
  border-radius: 7px;
  padding: 3px 8px;
  font-size: 11px;
  cursor: pointer;
  margin-left: 6px;
  transition: background 0.16s, color 0.16s, transform 0.16s var(--spring);
}
.copy-chip:hover { background: var(--fill-3); color: var(--text); }
.copy-chip.copied { background: var(--green-soft); color: var(--green); transform: scale(1.04); }

.historical-ip-box {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--orange-soft);
  border-radius: var(--r-tile);
  font-size: 13px;
}

.thumb-stack { display: flex; align-items: center; gap: 5px; }
.thumb-stack img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  padding: 2px;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}

/* Chat Workspace (Pull to Refresh + Streaming Reply) */
.chat-workspace {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  gap: 10px;
  padding: 2px;
  background: transparent;
}
.chat-list-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--card);
  border-radius: 24px;
  overflow: hidden;
}
.ptr-head {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 18px 18px 10px;
  background: var(--card);
}
.ptr-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.ptr-head small {
  font-size: 12px;
  color: var(--muted);
  transition: opacity 0.2s ease;
  white-space: nowrap;
}
.ptr-controls {
  position: relative;
  z-index: 3;
  padding: 0 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--card);
}
.ptr-body {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.ptr-body.dragging { cursor: grabbing; }

.ptr-goo {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 120px;
  filter: url(#ptr-goo);
  pointer-events: none;
  z-index: 1;
}
.ptr-handle {
  position: absolute;
  left: 50%;
  top: 2px;
  width: 44px;
  height: 6px;
  margin-left: -22px;
  border-radius: 3px;
  background: var(--inverse);
}
.ptr-drop {
  position: absolute;
  left: 50%;
  top: 0;
  width: 32px;
  height: 32px;
  margin-left: -16px;
  border-radius: 50%;
  background: var(--inverse);
  will-change: transform, opacity;
}
.ptr-spin {
  position: absolute;
  left: 50%;
  top: 0;
  width: 32px;
  height: 32px;
  margin-left: -16px;
  padding: 6px;
  border-radius: 50%;
  background: var(--inverse);
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  color: var(--on-inverse);
  will-change: transform, opacity;
}
.ptr-spin svg {
  width: 100%;
  height: 100%;
  animation: spin360 0.8s linear infinite;
  display: block;
}

.ptr-scroll {
  position: relative;
  z-index: 2;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}
.ptr-list {
  padding: 6px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 100%;
  background: var(--card);
  will-change: transform;
}
.ptr-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.14s ease;
}
.ptr-row:hover { background: var(--fill-1); }
.ptr-row.active { background: var(--fill-2); }
.ptr-av {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: var(--fill-3);
}
.ptr-av .ptr-online {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--card);
}
.ptr-tx {
  flex: 1;
  min-width: 0;
}
.ptr-tx b {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ptr-tx span.cd-preview-txt {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ptr-row time {
  font-size: 11px;
  color: var(--muted-2);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  flex: none;
}
.ptr-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
  flex: none;
}
.ptr-row.new {
  animation: ptrRowIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes ptrRowIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.96); filter: blur(4px); max-height: 0; padding-top: 0; padding-bottom: 0; }
  to { opacity: 1; transform: none; filter: none; max-height: 84px; }
}

.chat-col-head {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-col-head.space-between { flex-direction: row; align-items: center; justify-content: space-between; }

.chat-thread-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--card);
  border-radius: 24px;
  overflow: hidden;
  position: relative;
}
.empty-state { margin: auto; text-align: center; padding: 32px; max-width: 360px; color: var(--muted); }
.empty-orb { display: flex; justify-content: center; margin-bottom: 14px; }

.chat-active-view { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.chat-thread-head {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.chat-peer-trigger {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  padding: 4px 8px 4px 4px;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.14s ease;
}
.chat-peer-trigger:hover { background: var(--fill-1); }
.chat-peer-info { flex: 1; min-width: 0; }
.chat-peer-name { display: flex; align-items: center; gap: 7px; font-size: 14.5px; }
.chat-peer-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-peer-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.chat-peer-sub .dot { flex-shrink: 0; }
.chat-thread-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.chat-act-btn {
  height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Streaming Reply переписка */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.msg-row {
  display: flex;
  flex-direction: column;
  max-width: 82%;
  font-size: 15px;
  line-height: 22px;
  will-change: transform, opacity;
}
.msg-row.visitor { align-self: flex-start; align-items: flex-start; }
.msg-row.operator { align-self: flex-end; align-items: flex-end; }
.msg-row.system { align-self: center; max-width: 90%; }

.msg-bubble {
  padding: 9px 14px;
  border-radius: 18px;
  line-height: 22px;
  word-wrap: break-word;
  white-space: pre-wrap;
  font-size: 15px;
  will-change: width, height, transform, opacity;
}
.msg-row.visitor .msg-bubble { background: var(--fill-2); color: var(--text); border-bottom-left-radius: 6px; }
.msg-row.operator .msg-bubble { background: var(--inverse); color: var(--on-inverse); font-weight: 500; border-bottom-right-radius: 6px; }
.msg-row.system .msg-bubble { background: var(--fill-1); color: var(--muted); font-size: 12px; line-height: 18px; border-radius: var(--r-pill); padding: 6px 14px; }

.msg-bubble.sr-anim {
  position: relative;
  overflow: hidden;
  padding: 0;
}
.sr-think {
  position: absolute;
  left: 14px;
  top: 9px;
  white-space: nowrap;
  font-size: 14px;
  line-height: 22px;
  font-weight: 500;
  background: linear-gradient(90deg, var(--muted-2) 20%, var(--text) 50%, var(--muted-2) 80%) 0 0 / 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: srShine 1.4s linear infinite;
  pointer-events: none;
}
@keyframes srShine { to { background-position: -200% 0; } }
.msg-bubble.sr-anim .sr-text {
  position: absolute;
  left: 14px;
  top: 9px;
  margin: 0;
}
.msg-bubble:not(.sr-anim) .sr-text {
  position: static;
  margin: 0;
}
.sr-wd {
  display: inline-block;
  will-change: transform, opacity, filter;
}

.msg-meta {
  font-size: 10.5px;
  color: var(--muted-2);
  opacity: 0.72;
  margin-top: 3px;
  padding: 0 4px;
  font-variant-numeric: tabular-nums;
}
.msg-img { max-width: 240px; max-height: 240px; border-radius: 12px; display: block; margin-top: 6px; cursor: pointer; }
.msg-bubble.is-product {
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 12px;
  white-space: normal;
  max-width: 310px;
  width: 100%;
}
.msg-prod-note {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-2);
  margin-bottom: 8px;
  white-space: pre-wrap;
}
.msg-product-card {
  display: flex;
  align-items: center;
  gap: 11px;
  white-space: normal;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.msg-product-card:hover .msg-prod-title { color: #fff; }
.msg-product-card img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 11px;
  background: #fff;
  padding: 3px;
  flex-shrink: 0;
  display: block;
}
.msg-prod-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.msg-prod-kicker {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.2;
}
.msg-prod-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.msg-prod-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}
.msg-prod-price {
  font-size: 14px;
  font-weight: 600;
  color: var(--green);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  white-space: nowrap;
}
.msg-prod-sku {
  font-size: 11px;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Индикаторы набора клиентом в списке диалогов, шапке и над полем ввода */
.prechat-typing-box {
  margin: 0 8px 8px;
  padding: 9px 11px;
  border-radius: var(--r-tile);
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.prechat-typing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.prechat-typing-txt {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}
.prechat-typing-txt span:last-child {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cd-typing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.peer-typing-pill {
  display: inline-flex;
  align-items: center;
  background: var(--green-soft);
  color: var(--green);
  border-radius: var(--r-pill);
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.client-typing-bar {
  height: 0;
  opacity: 0;
  overflow: hidden;
  will-change: height, opacity;
}
.client-typing-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 14px;
  background: var(--fill-1);
  min-height: 32px;
}
.client-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}
.client-typing-dots i {
  display: block;
  width: 5.5px;
  height: 5.5px;
  border-radius: 50%;
  background: var(--green);
  animation: gooBounce 1.1s infinite ease-in-out;
}
.client-typing-dots i:nth-child(2) { animation-delay: 0.16s; }
.client-typing-dots i:nth-child(3) { animation-delay: 0.32s; }
.client-typing-label {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  flex-shrink: 0;
}
.client-typing-preview {
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.quick-replies-popup {
  background: var(--surface);
  border-radius: 18px;
  margin: 0 14px 8px;
  max-height: 190px;
  overflow-y: auto;
}
.qr-item { padding: 9px 14px; cursor: pointer; transition: background 0.14s; }
.qr-item:hover { background: var(--fill-2); }
.qr-item strong { color: var(--green); margin-right: 8px; }

/* Operator Prompt Box (Motion Studies) */
.chat-composer {
  padding: 10px 14px calc(12px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.op-pb {
  position: relative;
  overflow: visible;
  width: 100%;
  padding: 8px 8px 8px 16px;
  background: var(--surface-2);
  border-radius: 24px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
}
#chat-input {
  flex: 1;
  min-width: 0;
  height: 22px;
  margin: 0 0 6px;
  padding: 0;
  border: 0;
  outline: none;
  resize: none;
  overflow: hidden;
  background: none;
  color: var(--text);
  font: 400 15px/22px Inter, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  caret-color: var(--text);
}
.op-send {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  outline: none;
  flex: none;
  position: relative;
  overflow: hidden;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--fill-3);
  color: var(--muted);
  display: grid;
  place-items: center;
  will-change: transform;
  transition: background 0.2s ease, color 0.2s ease;
}
.op-send.ready { background: var(--inverse); color: var(--on-inverse); }
.op-send i.op-arrow {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  will-change: transform;
}
.op-send svg { width: 16px; height: 16px; }

/* Compact Goo Menu next to Send Button */
.chat-goo {
  position: relative;
  width: 34px;
  height: 34px;
  flex: none;
  z-index: 25;
}
.chat-goo-layer,
.chat-goo-ui {
  position: absolute;
  left: calc(50% - 116px);
  top: calc(50% - 104px);
  width: 160px;
  height: 140px;
  pointer-events: none;
}
.chat-goo-layer { filter: url(#chat-goo-filter); }
.chat-goo-blob {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 999px;
  background: var(--object, #2c2c2c);
  will-change: transform;
}
.chat-goo-btn {
  position: absolute;
  left: 0;
  top: 0;
  border: 0;
  background: none;
  color: var(--text);
  display: grid;
  place-items: center;
  border-radius: 999px;
  cursor: pointer;
  pointer-events: auto;
  outline: none;
  touch-action: none;
  padding: 0;
}
.chat-goo-main { width: 34px; height: 34px; }
.chat-goo-main .chat-goo-plus {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  will-change: transform;
}
.chat-goo-main svg { width: 17px; height: 17px; display: block; }
.chat-goo-bub { width: 36px; height: 36px; }
.chat-goo-bub svg { width: 17px; height: 17px; display: block; }
.chat-goo-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 7px);
  transform: translate(-50%, 4px) scale(0.9);
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.14s, transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.chat-goo-btn.hover .chat-goo-tip {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

/* Client Modal (#chat-client-modal) */
.cc-dialog {
  width: 100%;
  max-width: 440px;
  border-radius: 22px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  padding: 0;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}
.cc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.cc-head-peer {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.cc-head-meta { min-width: 0; flex: 1; }
.cc-head-meta h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cc-head-sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.cc-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cc-seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  background: var(--fill-1);
  margin-bottom: 8px;
}
.cc-seg-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  padding: 7px 6px;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.14s ease, color 0.14s ease;
}
.cc-seg-btn.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}
.cc-ev-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  font-size: 13px;
}
.cc-ev-time {
  color: var(--muted-2);
  font-size: 11.5px;
  flex-shrink: 0;
}
.cc-ev-title {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-2);
}
.cc-ev-count {
  font-size: 11.5px;
  color: var(--muted);
  background: var(--fill-2);
  padding: 1px 7px;
  border-radius: 999px;
  flex-shrink: 0;
}
.cc-empty-row {
  padding: 12px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* Modals & Command Palette */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-dialog {
  background: var(--card);
  border-radius: var(--r-card);
  width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: motionPopIn 0.26s var(--spring);
}
.modal-lg { max-width: 960px; }
.modal-md { max-width: 560px; }
.modal-head {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--fill-1);
}
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.modal-close {
  appearance: none;
  border: 0;
  background: var(--fill-2);
  color: var(--text);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
}
.modal-close:hover { background: var(--fill-3); }
.modal-body { padding: 18px; overflow-y: auto; }

.cmd-dialog { max-width: 600px; align-self: flex-start; margin-top: 8vh; background: var(--surface); }
.cmd-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--fill-1);
}
.cmd-input-wrap input { background: transparent !important; padding: 4px 0 !important; font-size: 15px; }
.cmd-results { max-height: 380px; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-row);
  cursor: pointer;
  transition: background 0.12s;
}
.cmd-item:hover { background: var(--fill-2); }

/* Order Sheet (Borderless Tonal Layout) */
.order-sheet-box {
  background: var(--fill-1);
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 14px;
}
.order-sheet-head {
  background: var(--fill-2);
  padding: 10px 14px;
  font-weight: 600;
  font-size: 13px;
}
.order-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.order-grid-2 > div { padding: 12px 14px; line-height: 1.7; font-size: 13.5px; }
.order-items-table { width: 100%; border-collapse: collapse; }
.order-items-table th, .order-items-table td { padding: 10px 14px; text-align: left; vertical-align: middle; }
.order-items-table th { background: var(--fill-2); font-size: 12px; color: var(--muted); font-weight: 500; }
.order-items-table tbody tr + tr td { border-top: 1px solid rgba(255, 255, 255, 0.05); }
.order-items-table td.num, .order-items-table th.num { text-align: right; white-space: nowrap; font-family: "JetBrains Mono", monospace; }
.order-prod-cell { display: flex; align-items: center; gap: 10px; }
.order-prod-cell img { width: 48px; height: 48px; object-fit: contain; border-radius: 8px; background: #fff; padding: 2px; }

/* Order Detail Modal (.od-*) */
.od-dialog { max-width: 980px; border-radius: 28px; }
.od-head { padding: 16px 20px; gap: 14px; background: var(--fill-1); align-items: center; }
.od-head-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}
.od-head-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.od-head-av { width: 42px; height: 42px; font-size: 16px; border-radius: 14px; }
.od-head-text { min-width: 0; }
.od-head-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.od-head-title-row h3 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.015em; }
.od-head-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--muted);
}
.od-head-total {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}
.od-body {
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.od-quickbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.od-act-btn {
  appearance: none;
  height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.16s ease, transform 0.16s var(--spring);
}
.od-act-btn:hover { background: var(--surface-2); text-decoration: none; }
.od-act-btn:active { transform: scale(0.96); }
.od-act-primary { background: var(--inverse); color: var(--on-inverse); font-weight: 600; }
.od-act-primary:hover { background: var(--inverse); opacity: 0.92; }
.od-act-ymaps { background: rgba(255, 68, 51, 0.15); color: #ff6b5e; }
.od-act-ymaps:hover { background: rgba(255, 68, 51, 0.24); color: #ff857a; }

.od-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.od-main, .od-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.od-section {
  background: var(--fill-1);
  border-radius: 22px;
  padding: 16px;
}
.od-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.od-sec-head h3 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }

.od-prod-list { display: flex; flex-direction: column; gap: 8px; }
.od-prod-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--surface);
}
.od-prod-img-link { flex-shrink: 0; display: inline-flex; }
.od-prod-img {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background: #fff;
  padding: 4px;
  object-fit: contain;
}
.od-prod-info { flex: 1; min-width: 0; }
.od-prod-name {
  display: inline-block;
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--text);
}
.od-prod-opt { font-size: 12px; color: var(--muted); margin-top: 2px; }
.od-prod-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.od-sku-chip {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  color: var(--text-2);
  background: var(--fill-1);
  padding: 2px 7px;
  border-radius: 7px;
}
.od-prod-price { text-align: right; flex-shrink: 0; }
.od-prod-sum { font-size: 14.5px; font-weight: 600; margin-top: 2px; }

.od-totals {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.od-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--text-2);
}
.od-total-row.is-grand {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.od-addr-stack { display: flex; flex-direction: column; gap: 10px; }
.od-addr-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.od-addr-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.od-addr-title { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13.5px; }
.od-addr-lines { font-size: 13.5px; line-height: 1.55; color: var(--text-2); word-break: break-word; }
.od-addr-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.od-map-toggle {
  appearance: none;
  border: 0;
  border-radius: 999px;
  height: 34px;
  padding: 0 13px;
  background: var(--fill-2);
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s var(--spring);
}
.od-map-toggle:hover { background: var(--fill-3); }
.od-map-toggle:active { transform: scale(0.96); }
.od-map-chev { transition: transform 0.3s var(--spring); }
.od-addr-card.is-open .od-map-toggle { background: var(--inverse); color: var(--on-inverse); }
.od-addr-card.is-open .od-map-chev { transform: rotate(180deg); }

.od-ymaps-link {
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  background: rgba(255, 68, 51, 0.14);
  color: #ff6b5e;
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.od-ymaps-link:hover { background: rgba(255, 68, 51, 0.24); color: #ff857a; text-decoration: none; }

.od-map-drawer {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.34s var(--spring), opacity 0.24s ease;
}
.od-addr-card.is-open .od-map-drawer { grid-template-rows: 1fr; opacity: 1; }
.od-map-inner { overflow: hidden; }
.od-map-stage {
  margin-top: 4px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
  height: 280px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.od-map-frame { width: 100%; height: 100%; border: 0; display: block; }
.od-ymap-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1e2126;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.od-ymap-viewport.dragging { cursor: grabbing; }
.od-ymap-tiles { position: absolute; inset: 0; pointer-events: none; }
.od-ymap-tile {
  position: absolute;
  width: 256px;
  height: 256px;
  display: block;
  pointer-events: none;
}
.od-ymap-pin {
  position: absolute;
  z-index: 4;
  min-width: 28px;
  min-height: 36px;
  transform: translate(-50%, -100%);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
}
.od-ymap-pin-lbl {
  margin-bottom: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(18, 18, 20, 0.9);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.od-ymap-controls {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.od-ymap-ctrl {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: rgba(23, 23, 25, 0.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  transition: background 0.14s ease, transform 0.14s var(--spring);
}
.od-ymap-ctrl:hover { background: rgba(40, 40, 44, 0.94); }
.od-ymap-ctrl:active { transform: scale(0.92); }
.od-ymap-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 6;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(23, 23, 25, 0.84);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
}
.od-ymap-badge:hover { background: rgba(23, 23, 25, 0.96); text-decoration: none; }
.od-ymap-notice {
  position: absolute;
  left: 10px;
  right: 52px;
  top: 10px;
  z-index: 6;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(23, 23, 25, 0.88);
  color: #ffd4d6;
  font-size: 11.5px;
}
.od-map-loading { font-size: 12.5px; color: var(--muted); }
.od-map-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--muted);
  flex-wrap: wrap;
}
.od-map-resolved { flex: 1; min-width: 0; word-break: break-word; }
.od-ymaps-foot-link { color: #ff6b5e; font-weight: 600; white-space: nowrap; }

.od-comment-card {
  background: var(--orange-soft);
  color: var(--text);
  border-radius: 18px;
  padding: 14px 16px;
  font-size: 13.5px;
}
.od-quick-statuses { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.od-quick-statuses .btn { flex: 1 1 auto; }

.od-kv-list { display: flex; flex-direction: column; gap: 8px; }
.od-kv-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 13px;
}
.od-kv-row:last-child { padding-bottom: 0; border-bottom: 0; }
.od-kv-row > span:first-child { color: var(--muted); flex-shrink: 0; }
.od-kv-row > *:last-child { text-align: right; word-break: break-word; }

.od-timeline { display: flex; flex-direction: column; gap: 10px; position: relative; }
.od-tl-item { display: flex; align-items: flex-start; gap: 10px; position: relative; }
.od-tl-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
  padding: 0;
}
.od-tl-dot.pill-amber { background: var(--orange); }
.od-tl-dot.pill-green { background: var(--green); }
.od-tl-dot.pill-red { background: var(--red); }
.od-tl-dot.pill-gray { background: var(--muted); }
.od-tl-body { flex: 1; min-width: 0; font-size: 12.5px; }
.od-tl-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.od-tl-comment { color: var(--muted); margin-top: 3px; line-height: 1.45; }

/* Timeline */
.timeline { display: flex; flex-direction: column; gap: 8px; }
.tl-item {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-tile);
  background: var(--fill-1);
  font-size: 12.5px;
}
.tl-time { color: var(--muted-2); font-size: 11px; white-space: nowrap; min-width: 82px; font-family: "JetBrains Mono", monospace; }
.tl-body { flex: 1; min-width: 0; }
.tl-body img { width: 38px; height: 38px; object-fit: contain; border-radius: 7px; background: #fff; padding: 2px; float: left; margin-right: 9px; }

/* Picker */
.picker-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.picker-meta {
  font-size: 12px;
  color: var(--muted);
}
.picker-stock-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--fill-1);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.picker-stock-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}
.picker-stock-chip.active {
  background: rgba(52, 199, 89, 0.16);
  border-color: rgba(52, 199, 89, 0.45);
  color: #5ee67e;
}
.picker-results {
  margin-top: 10px;
  max-height: min(62vh, 460px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
}
.picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--fill-1);
  border-radius: var(--r-tile);
}
.picker-item img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  padding: 2px;
  flex-shrink: 0;
}
.picker-item-title {
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.picker-status-badge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}
.picker-item-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.picker-item-sub {
  font-size: 11.5px;
  color: var(--muted-2);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.picker-old-price {
  text-decoration: line-through;
  opacity: 0.65;
  margin-right: 4px;
}
.picker-stock.in {
  color: var(--green);
  font-weight: 600;
}
.picker-stock.out {
  color: var(--muted-2);
}
.picker-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.picker-ext-link {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  transition: background 0.16s ease, color 0.16s ease;
}
.picker-ext-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}
.picker-more-btn {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--r-tile);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}
.picker-more-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}
.picker-empty {
  padding: 20px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* Settings */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.settings-wide { grid-column: 1 / -1; }
.pwa-guide { display: flex; flex-direction: column; gap: 12px; }
.pwa-step { background: var(--fill-1); padding: 14px; border-radius: var(--r-tile); }
.pwa-step ol { margin: 6px 0 0; padding-left: 18px; line-height: 1.6; font-size: 13px; color: var(--muted); }
.pwa-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.save-ok { color: var(--green); font-weight: 600; margin-left: 10px; }
.qr-admin-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.qr-admin-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--fill-1); border-radius: var(--r-tile); }
.qr-add-form { display: grid; grid-template-columns: 120px 200px 1fr auto; gap: 8px; }

/* Notification Stack */
.toast-container {
  position: fixed;
  top: calc(12px + max(var(--safe-top), var(--ios-top-pad, 0px)));
  left: 50%;
  transform: translateX(-50%);
  z-index: 2500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: min(360px, calc(100vw - 24px));
  pointer-events: none;
}
.toast {
  background: var(--surface-2);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 18px;
  cursor: pointer;
  font-size: 13px;
  pointer-events: auto;
  animation: motionToastIn 0.32s var(--spring);
}

.mobile-only { display: none; }

@keyframes gooBounce {
  0%, 80%, 100% { transform: translateY(0) scale(0.85); opacity: 0.55; }
  40% { transform: translateY(-4px) scale(1.15); opacity: 1; }
}
@keyframes bellSwing {
  0% { transform: rotate(0); }
  20% { transform: rotate(16deg); }
  40% { transform: rotate(-14deg); }
  60% { transform: rotate(10deg); }
  80% { transform: rotate(-6deg); }
  100% { transform: rotate(0); }
}
@keyframes spin360 { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes menuAlertFlash {
  0%, 100% {
    background: rgba(255, 90, 95, 0.22);
    box-shadow: 0 0 0 0 rgba(255, 90, 95, 0.65);
  }
  50% {
    background: rgba(255, 90, 95, 0.58);
    box-shadow: 0 0 0 6px rgba(255, 90, 95, 0);
  }
}
@keyframes menuDotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.72; }
}
@keyframes barGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes tabFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes msgPop { from { opacity: 0; transform: translateY(8px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes motionPopIn { from { opacity: 0; transform: scale(0.95) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes motionToastIn { from { opacity: 0; transform: translateY(-12px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 1180px) {
  .tr-users-grid { grid-template-columns: minmax(290px, 340px) minmax(0, 1fr); }
  .seo-metrics-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1020px) {
  .tr-users-grid { grid-template-columns: minmax(0, 1fr); }
  .tr-seo-grid-2 { grid-template-columns: minmax(0, 1fr); }
  .tr-prod-row { grid-template-columns: auto minmax(0, 1fr); }
  .tr-prod-row-badges,
  .tr-prod-row-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

@media (max-width: 960px) {
  .tr-vis-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .tr-vis-actions { justify-content: stretch; border-top: 0; padding-top: 0; }
  .tr-vis-actions .btn { flex: 1; }
}

@media (max-width: 1120px) {
  .traffic-analytics-row { grid-template-columns: 1fr; }
  .chat-workspace { grid-template-columns: 260px minmax(0, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  html {
    min-height: 100lvh;
    min-height: var(--app-h, 100dvh);
    background: var(--bg);
    overflow: hidden;
  }
  body {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--app-h, 100dvh);
    width: 100%;
    overflow: hidden;
    background: var(--bg);
  }
  .login-screen {
    min-height: var(--app-h, 100dvh);
    height: var(--app-h, 100dvh);
    padding: calc(20px + max(var(--safe-top), var(--ios-top-pad, 0px))) 20px calc(20px + var(--safe-bottom));
  }
  .app-shell {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    padding: 0;
    gap: 0;
    width: 100%;
    height: var(--app-h, 100dvh);
    min-height: var(--app-h, 100dvh);
    background: var(--bg);
  }
  .main-area {
    border-radius: 0;
    background: var(--bg);
    flex: 1;
    height: 100%;
    min-height: 0;
    padding-top: max(10px, var(--safe-top), var(--ios-top-pad, 0px));
  }
  .rd-ground {
    bottom: calc(5px + var(--safe-bottom) - var(--ios-pwa-gap, 0px));
  }
  .rd-dock {
    bottom: calc(10px + var(--safe-bottom) - var(--ios-pwa-gap, 0px));
  }
  .mobile-only { display: inline-flex; }
  .hide-sm { display: none; }

  /* На мобильном верхняя панель плавно трансформируется и уходит в нижний Rubber Dock */
  .top-motion-bar {
    max-height: 0 !important;
    min-height: 0 !important;
    height: 0 !important;
    padding: 0 12px !important;
    margin: 0 !important;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translateY(-16px) scale(0.96);
    border: 0;
  }

  /* Нижний Rubber Dock */
  .rd-dock {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  .rd-ground {
    opacity: 1;
    visibility: visible;
  }
  .rd-backdrop:not([hidden]) { display: block !important; }
  body.mobile-chat-kb .rd-dock,
  body.mobile-chat-kb .rd-ground {
    opacity: 0;
    pointer-events: none;
    transform: translate3d(-50%, 92px, 0) !important;
  }

  /* Защита от авто-зума iOS Safari при фокусе на поля ввода */
  input[type="text"],
  input[type="search"],
  input[type="password"],
  input[type="number"],
  textarea,
  select {
    font-size: 16px;
  }

  .tab-panel { padding: 12px 12px calc(100px + var(--safe-bottom)); }
  #tab-chat.active { padding: 8px 8px calc(90px + var(--safe-bottom)); }
  body.mobile-chat-kb #tab-chat.active { padding-bottom: calc(8px + var(--safe-bottom)); }

  /* Диалоги (Pull to Refresh + Переписка + Bottom-Sheet карточки клиента) */
  .chat-workspace { grid-template-columns: 1fr; }
  .chat-workspace.has-active-chat .chat-list-col { display: none; }
  .chat-workspace:not(.has-active-chat) .chat-thread-col { display: none; }
  .chat-list-col,
  .chat-thread-col {
    border-radius: 22px;
    background: var(--card);
  }
  .chat-thread-head { padding: 8px 10px; gap: 6px; }
  #chat-back-btn { padding: 0 8px; height: 32px; font-size: 14px; }
  .cc-backdrop {
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    height: var(--app-h, 100dvh);
    padding: calc(max(20px, var(--safe-top), var(--ios-top-pad, 0px)) + 14px) 0 0;
    align-items: flex-end;
  }
  .cc-dialog {
    width: 100%;
    max-width: 100%;
    border-radius: 24px 24px 0 0;
    max-height: calc(var(--app-h, 100dvh) - max(20px, var(--safe-top), var(--ios-top-pad, 0px)) - 14px);
  }

  .order-grid-2 { grid-template-columns: 1fr; }
  .qr-add-form { grid-template-columns: 1fr; }

  /* Трафик (мобильный вид) */
  .tr-top-bar { gap: 10px; margin-bottom: 12px; }
  .tr-top-left h2 { font-size: 18px; }
  .tr-tp-wrap { width: 100%; }
  .tr-tp-tabs { width: 100%; display: flex; }
  .tr-tp-tabs button {
    flex: 1 1 auto;
    padding: 7px 6px;
    font-size: 11.5px;
    text-align: center;
  }
  .tr-stat-card,
  .tr-visitors-card,
  .tr-prod-hero,
  .tr-prod-db-card,
  .seo-card,
  .seo-table-card {
    padding: 14px;
    border-radius: 22px;
  }
  .tr-stat-big { font-size: 28px; line-height: 34px; }
  .seo-metrics-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seo-metric-val { font-size: 17px; }
  .tr-vis-controls { width: 100%; justify-content: stretch; }
  #visitors-filter { width: 100%; display: flex; flex-wrap: nowrap; }
  #visitors-filter .seg-btn {
    flex: 1 1 auto;
    padding: 6px 5px;
    font-size: 11px;
    white-space: nowrap;
    text-align: center;
  }
  .tr-vis-search { width: 100%; min-width: 0; max-width: none; }
  #tr-prod-sort { width: 100%; display: flex; flex-wrap: nowrap; }
  #tr-prod-sort .seg-btn { flex: 1 1 auto; padding: 6px 4px; font-size: 11px; text-align: center; }
  #tr-prod-add-btn { width: 100%; }

  /* Заказы и Настройки (мобильный вид) */
  #tab-orders .panel-header,
  #tab-settings .panel-header {
    gap: 12px;
    margin-bottom: 12px;
  }
  #tab-orders .panel-header h2,
  #tab-settings .panel-header h2 {
    font-size: 19px;
  }
  #tab-settings .card {
    padding: 14px;
    border-radius: 22px;
  }
  #orders-tab-switch {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  #orders-tab-switch::-webkit-scrollbar { display: none; }
  #orders-tab-switch .seg-btn {
    flex: 1 1 auto;
    padding: 7px 6px;
    font-size: 11px;
    letter-spacing: -0.01em;
    white-space: nowrap;
    text-align: center;
  }
  .orders-card { padding: 14px; border-radius: 22px; }
  .orders-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 12px;
  }
  .ord-toolbar-main { width: 100%; min-width: 0; }
  .ord-search-wrap { min-width: 0; }
  .ord-refresh-btn { padding: 0 12px; flex-shrink: 0; }
  .ord-toolbar-filters { display: none; }
  .ord-toolbar-filters.open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    animation: tabFadeIn 0.2s var(--spring);
  }
  #orders-status-filter { width: 100%; min-width: 0; }
  .ord-dates-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }
  .ord-date-field { width: 100%; justify-content: space-between; }
  .ord-date-field input[type="date"] { flex: 1; min-width: 0; }

  .modal-backdrop,
  .cc-backdrop,
  .sp-backdrop {
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    height: var(--app-h, 100dvh);
    padding: calc(max(20px, var(--safe-top), var(--ios-top-pad, 0px)) + 14px) 0 0;
    align-items: flex-end;
  }
  .modal-dialog,
  .od-dialog,
  .cc-dialog,
  .sp-dialog {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    border-radius: 24px 24px 0 0;
    max-height: calc(var(--app-h, 100dvh) - max(20px, var(--safe-top), var(--ios-top-pad, 0px)) - 14px);
  }
  .modal-head {
    padding: 16px 16px 12px;
    flex-shrink: 0;
  }
  .modal-close {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }
  .modal-body,
  .cc-body {
    padding: 14px 14px calc(28px + max(14px, var(--safe-bottom)));
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .order-sheet-box { overflow-x: auto; }
  .ord-status-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .od-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  #tab-orders .panel-header p.muted,
  #tab-settings .panel-header p.muted {
    display: none;
  }
  .od-dialog {
    position: relative;
    border-radius: 24px 24px 0 0;
    max-height: calc(var(--app-h, 100dvh) - max(20px, var(--safe-top), var(--ios-top-pad, 0px)) - 14px);
  }
  .od-dialog::before {
    content: "";
    display: block;
    width: 38px;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    margin: 8px auto 0;
    flex-shrink: 0;
  }
  .od-head {
    padding: 10px 14px 12px;
    align-items: flex-start;
    gap: 10px;
    touch-action: none;
  }
  .od-head-av {
    width: 36px;
    height: 36px;
    font-size: 14px;
    border-radius: 12px;
  }
  .od-head-title-row h3 {
    font-size: 15.5px;
  }
  .od-head-main { flex-direction: column; align-items: flex-start; gap: 4px; }
  .od-head-total { font-size: 18px; }
  .od-body { padding: 12px 12px calc(30px + max(16px, var(--safe-bottom))); gap: 12px; }
  .od-section { padding: 13px; border-radius: 18px; }
  .od-prod-card { flex-wrap: wrap; }
  .od-prod-img { width: 52px; height: 52px; }
  .od-prod-price {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: left;
  }
  .od-map-stage { height: 230px; }
  .ord-price {
    right: 12px;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
  }
  .ord-price .pill { font-size: 10.5px; padding: 2px 7px; }
  .ord-chev { display: none; }
  .ord-meta-grid { grid-template-columns: 1fr; }
  .ord-item-row { flex-direction: column; align-items: flex-start; gap: 3px; }
  .orders-pagination {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    text-align: center;
  }
  .orders-pagination > div { display: flex; gap: 8px; }
  .orders-pagination .btn { flex: 1; min-height: 38px; }
}

@media (max-width: 480px) {
  .hide-xs { display: none; }
  .menu-trigger-btn { padding: 0 8px 0 5px; }
  .st-tab, .st-overlay-lbl { padding: 6px 4px; font-size: 11.5px; }
  .ord-banner-meta { display: none; }
  .ord-row .ord-go {
    width: 100%;
    margin-left: 0;
    margin-top: 4px;
    padding: 10px 16px;
    text-align: center;
  }
}

/* ---------------- Stack Panel Modal (#settings-modal, Kokonut UI style) ---------------- */
.sp-dialog {
  width: 100%;
  max-width: 420px;
  border-radius: 22px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  padding: 0;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}
.sp-panel {
  position: relative;
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.sp-header {
  position: relative;
  z-index: 10;
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  background: var(--card);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.sp-back {
  position: relative;
  z-index: 10;
  max-width: 34%;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13.5px;
  padding: 6px 8px 6px 4px;
  border-radius: 10px;
  cursor: pointer;
  transition: opacity 0.18s ease, background 0.15s ease, color 0.15s ease;
}
.sp-back[hidden] { display: none; }
.sp-back:hover { background: var(--fill-2); color: var(--text); }
.sp-back span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sp-title-slot {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.sp-title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 52%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  transform-origin: left center;
  will-change: transform, opacity;
}
.sp-close {
  position: relative;
  z-index: 10;
  margin-left: auto;
  width: 28px;
  height: 28px;
  font-size: 13px;
}
.sp-body {
  position: relative;
  overflow: hidden;
  transition: height 0.36s cubic-bezier(0.22, 1, 0.36, 1);
  max-height: calc(88vh - 52px);
}
.sp-page {
  width: 100%;
  background: var(--card);
  will-change: transform;
}
.sp-page-under {
  position: absolute;
  inset: 0 0 auto 0;
  pointer-events: none;
  z-index: 1;
}
.sp-page-under[hidden] { display: none; }
.sp-shade {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
}
.sp-page-top {
  position: relative;
  z-index: 2;
  max-height: calc(88vh - 52px);
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.sp-page-top.has-depth {
  box-shadow: -8px 0 24px -10px rgba(0, 0, 0, 0.55);
}
.sp-page-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 14px 12px 18px;
}
.sp-sec-title {
  margin: 0 0 6px;
  padding: 0 12px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
}
.sp-sec-footer {
  margin: 6px 0 0;
  padding: 0 12px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted-2);
}
.sp-group {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
}
.sp-group > li + li {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.sp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  background: transparent;
  border: 0;
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  text-align: left;
}
.sp-row-btn {
  cursor: pointer;
  transition: background 0.14s ease;
}
.sp-row-btn:hover,
.sp-row-btn:focus-visible,
.sp-row-btn:active {
  background: var(--fill-2);
  outline: none;
}
.sp-row-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sp-row-label.danger { color: var(--red); }
.sp-row-label.accent { color: var(--green); font-weight: 500; }
.sp-row-detail {
  max-width: 46%;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
  color: var(--muted);
}
.sp-chev {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--muted-2);
  margin-right: -3px;
}
.sp-check {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text);
}
.sp-check.invisible { visibility: hidden; }
.sp-toggle {
  position: relative;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  transition: background 0.2s ease;
}
.sp-toggle.on { background: var(--green); }
.sp-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.22s cubic-bezier(0.23, 1, 0.32, 1);
}
.sp-toggle.on .sp-toggle-knob { transform: translateX(16px); }
.sp-field-row {
  padding: 9px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sp-field-row label {
  font-size: 11.5px;
  color: var(--muted);
}
.sp-field-row input,
.sp-field-row textarea {
  background: transparent;
  border: 0;
  padding: 2px 0;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  width: 100%;
  outline: none;
  resize: vertical;
  border-radius: 0;
}
.sp-field-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
}
.sp-field-inline input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  padding: 6px 0;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
}
.sp-inline-btn {
  border: 0;
  border-radius: 10px;
  padding: 6px 12px;
  background: var(--fill-3);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.sp-inline-btn:hover { background: var(--inverse); color: var(--on-inverse); }
.sp-submit-btn {
  width: 100%;
  min-height: 42px;
  border-radius: 13px;
  border: 0;
  background: var(--inverse);
  color: var(--on-inverse);
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}
.sp-submit-btn:hover { opacity: 0.92; }
.sp-submit-btn:active { transform: scale(0.985); }
.sp-note-row {
  padding: 11px 12px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
}
.sp-form-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

@media (max-width: 780px) {
  .sp-backdrop {
    padding: calc(max(20px, var(--safe-top), var(--ios-top-pad, 0px)) + 14px) 0 0;
    align-items: flex-end;
  }
  .sp-dialog {
    max-width: 100%;
    border-radius: 24px 24px 0 0;
    max-height: calc(var(--app-h, 100dvh) - max(20px, var(--safe-top), var(--ios-top-pad, 0px)) - 14px);
  }
  .sp-body, .sp-page-top {
    max-height: calc(var(--app-h, 100dvh) - max(20px, var(--safe-top), var(--ios-top-pad, 0px)) - 66px);
  }
  .sp-page-content {
    padding-bottom: calc(28px + max(14px, var(--safe-bottom)));
  }
}

/* ---------------- Order Open Flight, Gooey Bubble Loader & Impact Animations ---------------- */
.ord-go {
  position: relative;
  overflow: hidden;
  transform-origin: center center;
  will-change: transform;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease;
}
.ord-go:hover { transform: scale(1.04, 0.97); }
.ord-go:active { transform: scale(0.88, 1.12); }
.ord-go.is-launching {
  animation: ordGoRecoil 0.52s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes ordGoRecoil {
  0% { transform: scale(0.84, 1.18); }
  28% { transform: scale(1.18, 0.78) translateY(-2px); }
  58% { transform: scale(0.94, 1.06); }
  100% { transform: scale(1, 1); }
}

.od-fx-stage {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1320;
  overflow: hidden;
}
.od-fx-goo {
  position: absolute;
  inset: 0;
  filter: url(#od-goo);
  pointer-events: none;
}
.od-fx-anchor,
.od-fx-flyer,
.od-fx-droplet {
  position: absolute;
  left: 0;
  top: 0;
  background: var(--inverse);
  border-radius: 999px;
  transform-origin: center center;
  will-change: transform, width, height, opacity;
}

#order-modal {
  transition: background-color 0.24s ease, backdrop-filter 0.24s ease;
}
#order-modal.is-closing {
  background-color: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  pointer-events: none;
}
.od-dialog {
  animation: none !important;
  transform-origin: center center;
  will-change: transform, opacity;
}

/* Gooey Bubble Loader внутри #order-modal-body */
.od-loader-wrap {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 36px 16px;
}
.od-goo-orb-stage {
  width: 132px;
  height: 96px;
  position: relative;
  filter: url(#od-goo);
  display: grid;
  place-items: center;
}
.od-orb-core {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--inverse);
  animation: odCoreSquish 1.15s ease-in-out infinite;
}
.od-orb-dot {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--inverse);
}
.od-orb-dot.d1 { animation: odDotShoot1 1.15s cubic-bezier(0.34, 1.56, 0.64, 1) infinite; }
.od-orb-dot.d2 { animation: odDotShoot2 1.15s cubic-bezier(0.34, 1.56, 0.64, 1) infinite 0.18s; }
.od-orb-dot.d3 { animation: odDotShoot3 1.15s cubic-bezier(0.34, 1.56, 0.64, 1) infinite 0.36s; }
.od-loader-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  animation: odLoaderBreath 1.4s ease-in-out infinite;
}
.od-skel-pills {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.od-skel-pill {
  height: 32px;
  border-radius: 999px;
  background: var(--fill-2);
  animation: odSkelBubble 1.3s ease-in-out infinite;
}
.od-skel-pill:nth-child(2) { animation-delay: 0.14s; }
.od-skel-pill:nth-child(3) { animation-delay: 0.28s; }
.od-skel-card {
  width: min(520px, 100%);
  height: 82px;
  border-radius: 20px;
  background: var(--fill-1);
  animation: odSkelBubble 1.3s ease-in-out infinite 0.18s;
}
@keyframes odCoreSquish {
  0%, 100% { transform: scale(1, 1); }
  25% { transform: scale(1.18, 0.84); }
  55% { transform: scale(0.86, 1.16); }
  80% { transform: scale(1.08, 0.92); }
}
@keyframes odDotShoot1 {
  0%, 100% { transform: translate(0, 0) scale(0.65); }
  45% { transform: translate(-42px, -10px) scale(1.08, 0.86); }
  75% { transform: translate(-18px, -4px) scale(0.85, 1.12); }
}
@keyframes odDotShoot2 {
  0%, 100% { transform: translate(0, 0) scale(0.65); }
  45% { transform: translate(42px, -10px) scale(1.08, 0.86); }
  75% { transform: translate(18px, -4px) scale(0.85, 1.12); }
}
@keyframes odDotShoot3 {
  0%, 100% { transform: translate(0, 0) scale(0.65); }
  45% { transform: translate(0, 34px) scale(0.86, 1.12); }
  75% { transform: translate(0, 14px) scale(1.12, 0.84); }
}
@keyframes odLoaderBreath {
  0%, 100% { opacity: 0.65; transform: scale(0.98); }
  50% { opacity: 1; transform: scale(1.03); }
}
@keyframes odSkelBubble {
  0%, 100% { opacity: 0.45; transform: scale(0.98, 1.02); }
  50% { opacity: 0.9; transform: scale(1.02, 0.98); }
}

/* Каскадные bubble-растяжения с ударом внутри #order-modal */
.od-head-left.is-revealing .od-head-av,
.od-head-left.is-revealing .od-head-title-row .pill,
.od-head-main.is-revealing .od-head-total {
  animation: odHeadPop 0.56s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.od-head-left.is-revealing .od-head-title-row .pill { animation-delay: 80ms; }
.od-head-main.is-revealing .od-head-total { animation-delay: 110ms; }

@keyframes odHeadPop {
  0% { opacity: 0; transform: scale(0.55, 1.32) translateY(10px); }
  52% { opacity: 1; transform: scale(1.14, 0.88) translateY(-2px); }
  78% { transform: scale(0.96, 1.03); }
  100% { opacity: 1; transform: none; }
}

.od-body.is-revealing .od-quickbar .od-act-btn {
  animation: odPillBubblePop 0.52s cubic-bezier(0.22, 1, 0.36, 1) calc(var(--od-i, 0) * 38ms) both;
}
@keyframes odPillBubblePop {
  0% { opacity: 0; transform: translate3d(0, 18px, 0) scale(0.62, 1.34); filter: blur(4px); }
  54% { opacity: 1; transform: translate3d(0, -3px, 0) scale(1.09, 0.89); filter: none; }
  78% { transform: translate3d(0, 1px, 0) scale(0.97, 1.03); }
  100% { opacity: 1; transform: none; filter: none; }
}

.od-body.is-revealing .od-section,
.od-body.is-revealing .od-comment-card {
  animation: odSectionStrike 0.6s cubic-bezier(0.22, 1, 0.36, 1) calc(var(--od-i, 0) * 52ms) both;
}
@keyframes odSectionStrike {
  0% { opacity: 0; transform: translate3d(0, 30px, 0) scale(0.9, 1.12); filter: blur(6px); }
  56% { opacity: 1; transform: translate3d(0, -4px, 0) scale(1.024, 0.968); filter: none; }
  80% { transform: translate3d(0, 1.5px, 0) scale(0.994, 1.008); }
  100% { opacity: 1; transform: none; filter: none; }
}

.od-body.is-revealing .od-prod-card,
.od-body.is-revealing .od-total-row,
.od-body.is-revealing .od-addr-card,
.od-body.is-revealing .od-kv-row,
.od-body.is-revealing .od-tl-item {
  animation: odRowBubbleIn 0.52s cubic-bezier(0.22, 1, 0.36, 1) calc(var(--od-i, 0) * 40ms + 70ms) both;
}
@keyframes odRowBubbleIn {
  0% { opacity: 0; transform: translate3d(0, 16px, 0) scale(0.92, 1.1); filter: blur(4px); }
  56% { opacity: 1; transform: translate3d(0, -2px, 0) scale(1.035, 0.96); filter: none; }
  82% { transform: translate3d(0, 1px, 0) scale(0.992, 1.008); }
  100% { opacity: 1; transform: none; filter: none; }
}

.od-body.is-revealing .od-prod-img {
  animation: odThumbBounce 0.62s cubic-bezier(0.22, 1, 0.36, 1) calc(var(--od-i, 0) * 40ms + 110ms) both;
}
@keyframes odThumbBounce {
  0% { opacity: 0; transform: scale(0.65) rotate(-6deg); }
  55% { opacity: 1; transform: scale(1.1, 0.92) rotate(2deg); }
  82% { transform: scale(0.97, 1.03) rotate(0deg); }
  100% { opacity: 1; transform: none; }
}

.od-body.is-revealing .od-tl-dot {
  animation: odDotPing 0.72s ease-out calc(var(--od-i, 0) * 40ms + 180ms) both;
}
@keyframes odDotPing {
  0% { transform: scale(0.6); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.45); }
  50% { transform: scale(1.22); box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.14); }
  100% { transform: scale(1); box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
}

/* Интерактивные растяжения и удары внутри открытой модалки */
.od-act-btn,
.od-map-toggle,
.quick-ost,
.copy-chip,
#order-status-form button[type="submit"] {
  transition: background 0.16s ease, color 0.16s ease, transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}
.od-act-btn:hover,
.od-map-toggle:hover,
.quick-ost:hover,
.copy-chip:hover,
#order-status-form button[type="submit"]:hover {
  transform: translateY(-1px) scale(1.03, 0.98);
}
.od-act-btn:active,
.od-map-toggle:active,
.quick-ost:active,
.copy-chip:active,
#order-status-form button[type="submit"]:active {
  transform: scale(0.89, 1.1) !important;
}
.od-impact-pulse {
  animation: odImpactPulse 0.44s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes odImpactPulse {
  0% { transform: scale(0.92, 1.08); }
  40% { transform: scale(1.06, 0.93); }
  72% { transform: scale(0.985, 1.015); }
  100% { transform: none; }
}
.od-map-drawer {
  transition: grid-template-rows 0.44s cubic-bezier(0.34, 1.38, 0.64, 1), opacity 0.24s ease;
}

/* ---------------- Custom Duotone Icon System ---------------- */
.ui-svg {
  display: inline-block;
  vertical-align: -0.16em;
  flex-shrink: 0;
}
.modal-close,
.gsearch-clear,
.rd-clear-btn,
.ns-dismiss {
  display: inline-grid;
  place-items: center;
  padding: 0;
}
.live-dot-sm {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 5px;
  vertical-align: 1px;
  flex-shrink: 0;
}
#tr-stat-delta {
  display: inline-flex;
  align-items: center;
}

/* Тонированные стеклянные медальоны в универсальном поиске */
.gs-ico {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.18s ease, box-shadow 0.18s ease;
}
.gs-ico-traffic {
  background: rgba(52, 209, 122, 0.13);
  color: #3ce085;
  box-shadow: inset 0 0 0 1px rgba(52, 209, 122, 0.2);
}
.gs-ico-chat {
  background: rgba(255, 106, 213, 0.13);
  color: #ff7be0;
  box-shadow: inset 0 0 0 1px rgba(255, 106, 213, 0.22);
}
.gs-ico-orders {
  background: rgba(255, 159, 10, 0.14);
  color: #ffb340;
  box-shadow: inset 0 0 0 1px rgba(255, 159, 10, 0.22);
}
.gs-ico-settings {
  background: rgba(198, 155, 255, 0.14);
  color: #d0afff;
  box-shadow: inset 0 0 0 1px rgba(198, 155, 255, 0.22);
}
.gs-ico-visitor {
  background: rgba(62, 201, 255, 0.14);
  color: #5cd3ff;
  box-shadow: inset 0 0 0 1px rgba(62, 201, 255, 0.22);
}
.gs-item:hover .gs-ico,
.gs-item.is-active .gs-ico {
  transform: scale(1.07);
}
.gs-ico-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--surface-2);
}
.gs-ext-lbl {
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* Иконки рейтинга в списках, досье и комментариях */
.tr-ico-blue { background: rgba(62, 201, 255, 0.14); color: #5cd3ff; }
.tr-ico-green { background: rgba(52, 209, 122, 0.14); color: #3ce085; }
.tl-ev-ico {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--fill-2);
  color: var(--text-2);
  margin-right: 5px;
  vertical-align: -5px;
}
.tl-ev-green { background: var(--green-soft); color: var(--green); }
.tl-ev-purple { background: var(--purple-soft); color: var(--purple); }
.tl-ev-orange { background: var(--orange-soft); color: var(--orange); }
.tl-ev-red { background: var(--red-soft); color: var(--red); }
.tl-ev-blue { background: rgba(62, 201, 255, 0.14); color: #5cd3ff; }
.rate-chip {
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 6px;
  margin-left: 5px;
  vertical-align: -3px;
}
.rate-chip.up { background: var(--green-soft); color: var(--green); }
.rate-chip.down { background: var(--red-soft); color: var(--red); }
.ord-comm-line {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--text-2);
  margin-top: 3px;
}
.ord-comm-line .ui-svg {
  margin-top: 2px;
  color: var(--muted);
}

/* Переключатель магазина (Интим / Эрос) */
.store-switch-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 2px 2px 4px;
}
.store-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 13px;
  background: var(--fill-1);
}
.store-sw-btn {
  appearance: none;
  border: 0;
  height: 30px;
  padding: 0 10px;
  border-radius: 9px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.16s ease, color 0.16s ease, transform 0.14s var(--spring);
}
.store-sw-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.store-sw-btn:active {
  transform: scale(0.96);
}
.store-sw-btn.active {
  background: var(--text);
  color: #0b0b0c;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.store-sw-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  flex-shrink: 0;
}
.store-sw-dot.urgent {
  background: var(--red);
  box-shadow: 0 0 0 2px rgba(255, 69, 58, 0.25);
  animation: rdAlertPulse 1.15s ease-in-out infinite;
}
.store-switch-domain {
  font-size: 11px;
  padding: 0 4px;
  text-align: center;
}
.store-switcher-sm {
  width: 158px;
}
.store-switcher-sm .store-sw-btn {
  height: 27px;
  font-size: 12px;
  padding: 0 8px;
}

/* Фильтр наличия и остатки в базе товаров */
.tr-prod-instock-chk {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--fill-1);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}
.tr-prod-instock-chk input {
  width: 15px;
  height: 15px;
  accent-color: var(--green);
  cursor: pointer;
}
.tr-prod-old-price {
  text-decoration: line-through;
  opacity: 0.55;
  margin-right: 4px;
}
.tr-prod-stock {
  font-weight: 600;
}
.tr-prod-stock.in {
  color: var(--green);
}
.tr-prod-stock.out {
  color: var(--red);
}
.tr-prod-row img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  padding: 2px;
  flex-shrink: 0;
}
@media (max-width: 900px) {
  .tr-prod-row {
    grid-template-columns: auto 1fr;
  }
  .tr-prod-row-badges,
  .tr-prod-row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}
