/* ==========================================================================
   Nexvoryn theme (loaded LAST in every layout).
   One file re-skins the whole product: tokens first (so every page follows),
   then the shell, the components and the motion.

   Design language: flat colours, no gradients.
     Ink      #0F1B33   text and the dark surfaces (sidebar, dock, hero)
     Paper    #F4F6F8   page
     Emerald  #08805F   the one brand colour (bright on dark: #34D399)
     Amber    #F59E0B   attention (unread, offers)
   Type: Sora for titles and numbers, Inter for reading.
   ========================================================================== */

@font-face { font-family: "Sora"; font-style: normal; font-weight: 300 800; font-display: swap; src: url("../fonts/sora-var.woff2") format("woff2"); }

/* ---------- 1. tokens: light ---------- */
:root {
  --nx-display: "Sora", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --nx-ink: #0F1B33;
  --nx-ink-2: #17274B;
  --nx-bright: #34D399;
  --nx-azure: #34D399;
  --nx-ember: #F59E0B;
  --nx-on-bright: #062B20;
  --nx-grad: #34D399;
  --nx-night: #0F1B33;
  --nx-ease: cubic-bezier(.22, 1, .36, 1);

  --r-sm: 10px; --r-md: 12px; --r-lg: 16px; --r-xl: 20px; --r-sheet: 28px;
  --r-bubble: 20px; --r-bubbleTail: 6px; --r-composer: 28px; --r-fab: 22px;
  --radius: 16px;

  --ink: #0B1424; --ink-2: #0C1B3D;
  --teal: #08805F; --teal-dark: #06694E; --teal-tint: #DDF3EB; --mint: #0A8F6C;
  --sand: #F4F6F8; --chat-bg: #E6ECF5;
  --blue: #1F8FFF;
  --text: #0F1B33; --muted: #47526B; --border: #D9E0EC; --border-2: #0F1B3314;

  --bg: #F4F6F8;
  --surface: #FFFFFF; --surface-raised: #FFFFFF; --surface-sunken: #E6ECF5; --card: #FFFFFF;
  --divider: #E8EDF5; --hairline: #0F1B3312;
  --text-primary: #0F1B33; --text-secondary: #47526B; --text-muted: #5C6781;

  --accent: #08805F; --accent-strong: #066B50; --accent-soft: #DDF3EB; --accent-softer: #EEF9F5;
  --accent-text: #06694E; --on-accent: #FFFFFF; --ring: #08805F;
  --secondary: #F59E0B; --secondary-tint: #FEF3C7; --secondary-text: #92400E;

  --hero-gradient: #0F1B33;
  --hero-glow: transparent; --hero-glow-2: transparent;
  --on-hero: #FFFFFF; --on-hero-muted: #FFFFFFB8;

  --bubble-own: #08805F;
  --bubble-own-end: #08805F; --bubble-own-text: #FFFFFF; --bubble-own-time: #FFFFFFBF;
  --bubble-own-quote-bar: #A7F3D0; --bubble-own-quote-bg: #FFFFFF24; --bubble-own-link: #D1FAE5;
  --bubble-in: #FFFFFF; --bubble-in-text: #0F1B33; --bubble-in-time: #5C6781;
  --bubble-in-quote-bar: #08805F; --bubble-in-quote-bg: #08805F12; --bubble-in-link: #06694E;
  --bubble-shadow: 0 1px 2px rgba(15, 27, 51, .08);

  --pill-bg: #FFFFFFE0; --pill-text: #47526B; --pill-border: #0F1B3312;
  --wallpaper: #EAEEF3; --wallpaper-gradient: linear-gradient(#EAEEF3, #EAEEF3);
  --doodle: #0F1B33; --doodle-opacity: .045;

  --tick-sent: #8E99B0; --tick-delivered: #8E99B0; --tick-read: #1F8FFF;
  --tick-own-sent: #FFFFFFB3; --tick-own-delivered: #FFFFFFB3; --tick-own-read: #A7F3D0;
  --online-ring: #FFFFFF; --verified: #1F8FFF; --info: #1F8FFF; --info-tint: #E3F0FF; --info-text: #15589E;

  --scrim: #0B142499;
  --glass-bg: #FFFFFFC9; --glass-border: #0F1B3312;
  --skel-base: #E3E9F2; --skel-shine: #F6F9FD;

  --shadow: 0 6px 20px rgba(15, 27, 51, .07), 0 1px 2px rgba(15, 27, 51, .05);
  --shadow-pop: 0 24px 56px rgba(15, 27, 51, .2), 0 4px 12px rgba(15, 27, 51, .07);
  --shadow-e1: 0 1px 2px rgba(15, 27, 51, .05), 0 2px 6px rgba(15, 27, 51, .04);
  --shadow-e2: 0 6px 20px rgba(15, 27, 51, .07), 0 1px 2px rgba(15, 27, 51, .05);
  --shadow-e3: 0 24px 56px rgba(15, 27, 51, .2), 0 4px 12px rgba(15, 27, 51, .07);
  --shadow-fab: 0 10px 26px #08805F4D, 0 2px 6px rgba(15, 27, 51, .1);

  --avatar-1-bg: #DDF3EB; --avatar-1-fg: #06694E;
  --avatar-4-bg: #E3F0FF; --avatar-4-fg: #15589E;
  --avatar-6-bg: #E3E9F2; --avatar-6-fg: #3A455E;
}

/* ---------- 1b. tokens: dark (same two selectors aq.css uses) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #080F1C; --ink-2: #0B1838;
    --teal: #0A8F6C; --teal-dark: #6EE7B7; --teal-tint: #0E3B2E; --mint: #0E9382;
    --sand: #0B1424; --chat-bg: #060A14;
    --text: #EAF0FA; --muted: #A9B4CB; --border: #FFFFFF1A; --border-2: #FFFFFF14;
    --bg: #0B1424; --surface: #0E1525; --surface-raised: #162038; --surface-sunken: #0A101E; --card: #0F172A;
    --divider: #FFFFFF10; --hairline: #FFFFFF14;
    --text-primary: #EAF0FA; --text-secondary: #A9B4CB; --text-muted: #8491AB;
    --accent: #0A8F6C; --accent-strong: #087A5C; --accent-soft: #0E3B2E; --accent-softer: #0B2A22;
    --accent-text: #6EE7B7; --on-accent: #FFFFFF; --ring: #34D399;
    --secondary: #F59E0B; --secondary-tint: #3A2A08; --secondary-text: #FCD34D;
    --hero-gradient: #0F1B33;
    --hero-glow: transparent; --hero-glow-2: transparent;
    --bubble-own: #08805F; --bubble-own-end: #08805F;
    --bubble-own-quote-bar: #A7F3D0; --bubble-own-link: #D1FAE5;
    --bubble-in: #162038; --bubble-in-text: #EAF0FA; --bubble-in-time: #8E9BB6;
    --bubble-in-quote-bar: #6EE7B7; --bubble-in-quote-bg: #6EE7B71A; --bubble-in-link: #6EE7B7;
    --bubble-shadow: 0 1px 1px rgba(0, 0, 0, .3);
    --pill-bg: #162038E6; --pill-text: #A9B4CB; --pill-border: #FFFFFF14;
    --wallpaper: #0A111E; --wallpaper-gradient: linear-gradient(#0A111E, #0A111E);
    --doodle: #6EE7B7; --doodle-opacity: .05;
    --tick-sent: #7E8AA5; --tick-delivered: #7E8AA5; --tick-read: #5DAAFF; --tick-own-read: #A7F3D0;
    --online-ring: #0E1525; --verified: #5DAAFF;
    --scrim: #000000A6; --glass-bg: #0B1222D6; --glass-border: #FFFFFF14;
    --skel-base: #162038; --skel-shine: #22304F;
    --shadow-fab: 0 10px 28px #0A8F6C66, 0 0 0 1px rgba(255, 255, 255, .08);
    --avatar-1-bg: #0E3B2E; --avatar-1-fg: #A7F3D0;
    --avatar-6-bg: #1B2540; --avatar-6-fg: #C6D0E4;
  }
}
:root[data-theme="dark"] {
  --ink: #080F1C; --ink-2: #0B1838;
  --teal: #0A8F6C; --teal-dark: #6EE7B7; --teal-tint: #0E3B2E; --mint: #0E9382;
  --sand: #0B1424; --chat-bg: #060A14;
  --text: #EAF0FA; --muted: #A9B4CB; --border: #FFFFFF1A; --border-2: #FFFFFF14;
  --bg: #0B1424; --surface: #0E1525; --surface-raised: #162038; --surface-sunken: #0A101E; --card: #0F172A;
  --divider: #FFFFFF10; --hairline: #FFFFFF14;
  --text-primary: #EAF0FA; --text-secondary: #A9B4CB; --text-muted: #8491AB;
  --accent: #0A8F6C; --accent-strong: #087A5C; --accent-soft: #0E3B2E; --accent-softer: #0B2A22;
  --accent-text: #6EE7B7; --on-accent: #FFFFFF; --ring: #34D399;
  --secondary: #F59E0B; --secondary-tint: #3A2A08; --secondary-text: #FCD34D;
  --hero-gradient: #0F1B33;
  --hero-glow: transparent; --hero-glow-2: transparent;
  --bubble-own: #08805F; --bubble-own-end: #08805F;
  --bubble-own-quote-bar: #A7F3D0; --bubble-own-link: #D1FAE5;
  --bubble-in: #162038; --bubble-in-text: #EAF0FA; --bubble-in-time: #8E9BB6;
  --bubble-in-quote-bar: #6EE7B7; --bubble-in-quote-bg: #6EE7B71A; --bubble-in-link: #6EE7B7;
  --bubble-shadow: 0 1px 1px rgba(0, 0, 0, .3);
  --pill-bg: #162038E6; --pill-text: #A9B4CB; --pill-border: #FFFFFF14;
  --wallpaper: #0A111E; --wallpaper-gradient: linear-gradient(#0A111E, #0A111E);
  --doodle: #6EE7B7; --doodle-opacity: .05;
  --tick-sent: #7E8AA5; --tick-delivered: #7E8AA5; --tick-read: #5DAAFF; --tick-own-read: #A7F3D0;
  --online-ring: #0E1525; --verified: #5DAAFF;
  --scrim: #000000A6; --glass-bg: #0B1222D6; --glass-border: #FFFFFF14;
  --skel-base: #162038; --skel-shine: #22304F;
  --shadow-fab: 0 10px 28px #0A8F6C66, 0 0 0 1px rgba(255, 255, 255, .08);
  --avatar-1-bg: #0E3B2E; --avatar-1-fg: #A7F3D0;
  --avatar-6-bg: #1B2540; --avatar-6-fg: #C6D0E4;
}

/* public pages keep their own fallbacks: point them at the new palette */
body.pb {
  --pb-accent-text: var(--accent-text);
  --pb-brand: var(--bubble-own); --pb-brand-end: var(--bubble-own-end);
  --pb-hero: var(--hero-gradient);
  --pb-danger-tint: var(--danger-tint); --pb-danger-text: var(--danger-text);
  --pb-success-tint: var(--success-tint); --pb-success-text: var(--success-text);
  --pb-warning-tint: var(--warning-tint); --pb-warning-text: var(--warning-text);
  --pb-info-tint: var(--info-tint); --pb-info-text: var(--info-text);
  --pb-shadow-1: var(--shadow-e1); --pb-shadow-2: var(--shadow-e2); --pb-shadow-3: var(--shadow-e3); --pb-shadow-fab: var(--shadow-fab);
  --pb-r-card: var(--r-lg);
  --pb-mark-ink: #FFFFFF;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) body.pb {
    --pb-bg: var(--bg); --pb-surface: var(--surface); --pb-raised: var(--surface-raised); --pb-sunken: var(--surface-sunken);
    --pb-text: var(--text-primary); --pb-text-2: var(--text-secondary); --pb-text-3: var(--text-muted);
    --pb-border: var(--border); --pb-hairline: var(--hairline);
    --pb-accent-text: var(--accent-text); --pb-accent-soft: var(--accent-soft); --pb-accent-softer: var(--accent-softer);
    --pb-bubble-in: var(--bubble-in); --pb-bubble-in-text: var(--bubble-in-text);
    --pb-glass: var(--glass-bg);
    --pb-shadow-1: var(--shadow-e1); --pb-shadow-2: var(--shadow-e2); --pb-shadow-3: var(--shadow-e3);
  }
}

/* ---------- 2. motion ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: nx-vt-out .14s ease-in both; }
::view-transition-new(root) { animation: nx-vt-in .28s var(--nx-ease) both; }
@keyframes nx-vt-out { to { opacity: 0; } }
@keyframes nx-vt-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes nx-rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes nx-pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); } 100% { transform: none; opacity: 1; } }
@keyframes nx-drift-a { 0%, 100% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(-8%, 10%, 0) scale(1.18); } }
@keyframes nx-drift-b { 0%, 100% { transform: translate3d(0, 0, 0) scale(1.1); } 50% { transform: translate3d(12%, -8%, 0) scale(.92); } }
@keyframes nx-sheen { from { transform: translateX(-130%) skewX(-18deg); } to { transform: translateX(260%) skewX(-18deg); } }
@keyframes nx-breathe { 0%, 100% { box-shadow: 0 0 0 0 #34D39966; } 60% { box-shadow: 0 0 0 6px #34D39900; } }
@keyframes nx-sheet-up { from { transform: translateY(36px); opacity: 0; } }
@keyframes nx-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes nx-line { from { transform: scaleX(0); } }

/* ---------- 3. type ---------- */
.app-body .app-brand-name, .app-body .app-title,
.pg > .pg-head h1, .pg .pg-h2, .pg .pg-h3, .pg .pg-stat-value,
.sh-word, .sh-sheet h1, .sh-sheet h2, .ins h1, .ins h2, .ins h3,
.guest-body h1, .guest-body h2, .center-card h1, .dialog h2, .sheet h2, .cl-name, .il-titlerow h1 {
  font-family: var(--nx-display); letter-spacing: -.025em;
}
::selection { background: #34D39955; color: inherit; }

/* ---------- 4. app shell ---------- */
.app-body { --w-side: 236px; --w-top-h: 56px; --w-pad: 28px; --w-maxw: 1180px; font-size: 14.5px; }
.app-body .app { background: var(--bg); }
.app-body .app-col::before { display: none; }

/* sidebar: night panel. Its lights are part of the background, so nothing can scroll sideways or grow the list. */
.app-body .app-side {
  --w-text: #FFFFFF; --w-text-2: #B4C0D9; --w-muted: #7F8DAB;
  --w-sunken: rgba(255, 255, 255, .06); --w-surface: rgba(255, 255, 255, .05);
  --w-border: rgba(255, 255, 255, .09); --w-hairline: rgba(255, 255, 255, .08); --w-divider: rgba(255, 255, 255, .08);
  --w-accent-soft: rgba(37, 217, 189, .14); --w-accent-text: #6EE7B7; --w-accent: #34D399; --w-press: rgba(255, 255, 255, .08);
  border-right: 0; overflow-x: hidden; scrollbar-width: none;
  background: #0F1B33;
}
.app-body .app-side::-webkit-scrollbar { display: none; }
.app-body .app-brand { padding: 14px 14px 10px; gap: 10px; }
.app-body .app-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--nx-grad); box-shadow: 0 6px 18px -4px #34D39966; }
.app-body .app-mark svg { width: 26px; height: 26px; }
.app-body .app-mark .nx-n { fill: none; stroke: #fff; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.app-body .app-mark .nx-dot { fill: #F59E0B; }
.app-body .app-brand-name { font-size: 15.5px; font-weight: 700; }
.app-body .app-brand-sub { font-size: 11.5px; margin-top: 1px; }
.app-body .app-nav { gap: 0; padding: 4px 10px 10px; }
.app-body .nav-group-items { display: flex; flex-direction: column; gap: 1px; }
.app-body .nav-group.is-closed:not(.has-active) .nav-group-items { display: none; }
.app-body .nav-label {
  display: flex; align-items: center; justify-content: space-between; width: 100%; height: 28px; margin-top: 10px; padding: 0 8px 0 10px;
  border: 0; border-radius: 8px; background: none; color: #6F7FA0; font: 600 11.5px/1 var(--w-font); letter-spacing: .02em; cursor: pointer; text-align: left;
}
.app-body .nav-label:hover { color: #B4C0D9; }
.app-body .nav-label svg { transition: transform .25s var(--nx-ease); opacity: .7; }
.app-body .nav-group.is-closed:not(.has-active) .nav-label svg { transform: rotate(-90deg); }
.app-body .nav-group.has-active .nav-label svg { display: none; }
.app-body .nav-item { min-height: 34px; padding: 0 8px 0 10px; gap: 10px; border-radius: 9px; font-size: 13.5px; font-weight: 500; letter-spacing: 0; transition: background-color .18s, color .18s; }
.app-body .nav-ico svg { width: 18px; height: 18px; }
.app-body .nav-item[aria-current="page"] { background: rgba(255, 255, 255, .09); color: #fff; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.app-body .nav-item[aria-current="page"]::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--nx-bright); box-shadow: 0 0 12px 1px #34D39999; }
.app-body .nav-item[aria-current="page"] .nav-ico { color: var(--nx-bright); }
.app-body .nav-item .nav-badge { min-width: 18px; height: 18px; font-size: 11px; line-height: 18px; }
.app-body .app-side-foot { margin: 0 10px 10px; padding: 8px 10px; gap: 10px; border-radius: 12px; box-shadow: none; position: sticky; bottom: 10px; background: #14223F; box-shadow: 0 -14px 18px -6px #0F1B33, 0 0 0 1px rgba(255, 255, 255, .07); }
.app-body .app-me-av { background: var(--nx-grad); padding: 1.5px; }
.app-body .app-me-av .avatar { width: 30px; height: 30px; font-size: 11.5px; border-color: #0F1B33; }
.app-body .app-side-foot .who b { font-size: 13px; } .app-body .app-side-foot .who span { font-size: 11.5px; }

/* top bar */
.app-body .app-top { border-bottom-color: transparent; background: color-mix(in srgb, var(--bg) 76%, transparent); }
.app-body .app-top.is-scrolled { background: var(--glass-bg); border-bottom-color: var(--glass-border); box-shadow: 0 10px 30px -24px rgba(15, 27, 51, .5); }
.app-body .app-title { font-size: 16px; font-weight: 600; }
.app-body .app-search { flex-basis: 360px; }
.app-body .app-search input { height: 38px; min-height: 38px; border-radius: 10px; font-size: 14px; }
.app-body .app-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #34D39933; }
.app-body .app-user-btn .avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px #34D39966; }
.app-body .app-user-menu { border-radius: 14px; animation: nx-rise .2s var(--nx-ease) backwards; }
.app-body .app-online .dot:not(.is-off) { animation: nx-breathe 2.4s ease-out infinite; }
.app-body .page { padding: 4px var(--w-pad) 48px; }
.app-body .pg:not(.pg-modal):not(.rpd-wrap):not(.pg-embed) { gap: 16px; }

/* phones: drawer rows stay finger sized, the tab bar is a slim floating dock */
@media (max-width: 899px) {
  .app-body { --w-top-h: 52px; --w-pad: 14px; --w-tabs-h: 74px; font-size: 15px; }
  .app-body .nav-item { min-height: 42px; font-size: 14.5px; }
  .app-body .nav-label { height: 32px; font-size: 12px; }
  .app-body .page { padding-bottom: calc(28px + var(--w-tabs-h) + env(safe-area-inset-bottom)); }
  .app-body .app-tabs {
    left: 10px; right: 10px; bottom: calc(8px + env(safe-area-inset-bottom)); height: 58px; padding: 6px 4px;
    border: 1px solid rgba(255, 255, 255, .1); border-radius: 20px; background: rgba(15, 27, 51, .92);
    -webkit-backdrop-filter: saturate(1.6) blur(22px); backdrop-filter: saturate(1.6) blur(22px);
    box-shadow: 0 16px 36px -10px rgba(11, 20, 36, .55), 0 2px 8px rgba(11, 20, 36, .22), inset 0 1px 0 rgba(255, 255, 255, .08);
  }
  .app-body .app-tab { justify-content: center; gap: 2px; color: rgba(255, 255, 255, .6); font-size: 10px; line-height: 12px; border-radius: 14px; }
  .app-body .app-tab-ic { width: 42px; height: 28px; border-radius: 14px; transition: background .3s var(--nx-ease), transform .3s var(--nx-ease); }
  .app-body .app-tab-ic svg { width: 20px; height: 20px; }
  .app-body .app-tab:active .app-tab-ic { transform: scale(.88); }
  .app-body .app-tab.is-on { color: #fff; }
  .app-body .app-tab.is-on .app-tab-ic { background: var(--nx-grad); color: var(--nx-on-bright); box-shadow: 0 5px 14px #34D39955; }
  .app-body .app-tab:focus-visible { outline: 2px solid var(--nx-bright); outline-offset: -2px; }
  .app-body .app-tab-badge { box-shadow: 0 0 0 2px #0F1B33; }
}

/* ---------- 5. page header ---------- */
.pg > .pg-head { padding: 12px 0 0; gap: 10px 20px; }
.pg > .pg-head h1 { font-size: 26px; line-height: 32px; font-weight: 650; }
.pg > .pg-head .pg-sub { margin-top: 4px; font-size: 14px; line-height: 20px; }
.pg-head .pg-hero-meta { margin-top: 10px; gap: 6px; }
.pg-hero-chip { min-height: 26px; padding: 0 10px; font-size: 12.5px; }
@media (max-width: 899px) {
  .pg > .pg-head { padding-top: 6px; }
  .pg > .pg-head h1 { font-size: 23px; line-height: 28px; }
  .pg > .pg-head .pg-sub { font-size: 13.5px; line-height: 19px; }
  .pg-head > .pg-actions .btn { min-height: 38px; padding: 0 12px; border-radius: 10px; font-size: 13.5px; }
}

/* the hero: one night banner with the greeting, then every number in a single strip */
.pg > .pg-head.pg-head--card {
  margin-top: 8px; padding: 22px 24px 20px; border-radius: 20px; gap: 14px 20px;
  background: var(--hero-gradient);
  box-shadow: 0 24px 50px -28px rgba(11, 20, 36, .75), inset 0 1px 0 rgba(255, 255, 255, .07);
}
.pg > .pg-head.pg-head--card::before, .pg > .pg-head.pg-head--card h1 { font-size: 24px; line-height: 30px; }
.pg > .pg-head.pg-head--card .pg-sub { font-size: 13.5px; }
.pg .pg-head--card .pg-stats { margin-top: 2px; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); }
.pg .pg-head--card .pg-stat {
  position: relative; gap: 2px; padding: 10px 12px; border-radius: 12px;
  background: rgba(255, 255, 255, .055); border: 1px solid rgba(255, 255, 255, .08);
  -webkit-backdrop-filter: none; backdrop-filter: none;
  transition: transform .25s var(--nx-ease), background-color .25s, border-color .25s;
}
.pg .pg-head--card .pg-stat--wide { grid-column: auto; }
.pg-head--card a.pg-stat:hover, .pg-head--card .pg-stat--link:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .18); }
.pg .pg-head--card .pg-stat-value { font-size: 21px; line-height: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pg .pg-head--card .pg-stat-label { display: flex; align-items: flex-start; gap: 6px; font-size: 11.5px; line-height: 15px; color: rgba(255, 255, 255, .7); }
.pg .pg-head--card .pg-stat-label::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: 4.5px; border-radius: 50%; background: #34D399; box-shadow: 0 0 8px #34D39999; }
.pg .pg-head--card .pg-stat:nth-child(4n+2) .pg-stat-label::before { background: #93C5FD; box-shadow: 0 0 8px #93C5FD99; }
.pg .pg-head--card .pg-stat:nth-child(4n+3) .pg-stat-label::before { background: #FBBF24; box-shadow: 0 0 8px #FBBF2499; }
.pg .pg-head--card .pg-stat:nth-child(4n+4) .pg-stat-label::before { background: #C4B5FD; box-shadow: 0 0 8px #C4B5FD99; }
@media (max-width: 899px) {
  .pg > .pg-head.pg-head--card { margin-top: 2px; padding: 18px 16px 14px; border-radius: 18px; gap: 12px; }
  .pg > .pg-head.pg-head--card h1 { font-size: 21px; line-height: 26px; }
  /* a ledger: label on the left, number on the right, two to a line */
  .pg .pg-head--card .pg-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; margin-top: 0; padding-top: 4px; border-top: 1px solid rgba(255, 255, 255, .1); }
  .pg .pg-head--card .pg-stat { flex-direction: row-reverse; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; padding: 6px 0; border: 0; border-bottom: 1px solid rgba(255, 255, 255, .07); border-radius: 0; background: none; }
  .pg .pg-head--card .pg-stat:nth-last-child(-n+2) { border-bottom: 0; }
  .pg-head--card a.pg-stat:hover, .pg-head--card .pg-stat--link:hover { transform: none; background: none; }
  .pg .pg-head--card .pg-stat--wide { grid-column: auto; }
  .pg .pg-head--card .pg-stat-value { font-size: 17px; line-height: 22px; flex: none; }
  .pg .pg-head--card .pg-stat-label { font-size: 12px; line-height: 15px; }
}

/* ---------- 6. cards, numbers, tables ---------- */
.pg .pg-card, .app-body .pg-card { padding: 18px; border-radius: 16px; border-color: var(--hairline); box-shadow: 0 1px 2px rgba(15, 27, 51, .04), 0 10px 26px -20px rgba(15, 27, 51, .3); }
.pg .pg-card--flush { padding: 0; }
.pg .pg-card-head { margin-bottom: 10px; }
.pg .pg-h2 { font-size: 17px; line-height: 22px; font-weight: 600; }
.pg .pg-h3 { font-size: 15.5px; line-height: 20px; font-weight: 600; }
.pg .pg-sub--sm { font-size: 13.5px; line-height: 19px; margin-bottom: 12px; }
.pg .pg-cols { gap: 16px; }
.pg .pg-stats { gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.pg .pg-stat { padding: 12px 14px; border-radius: 14px; }
.pg .pg-stat-value { font-size: 22px; line-height: 26px; }
.pg .pg-stat-label { font-size: 12.5px; }
.pg .pg-table th { padding: 8px 10px; font-size: 12px; }
.pg .pg-table td { padding: 7px 10px; font-size: 14px; }
.pg .pg-table .avatar { width: 32px; height: 32px; font-size: 12px; }
.pg .pg-table select, .pg .pg-table .input { min-height: 34px; height: 34px; padding-top: 0; padding-bottom: 0; font-size: 13.5px; border-radius: 9px; }
.pg .pg-table .btn { min-height: 32px; padding: 0 12px; font-size: 13px; }
.pg .pg-toggle { min-height: 48px; padding: 9px 0; }
.pg .pg-toggle-title { font-size: 14.5px; } .pg .pg-toggle-hint { font-size: 12.5px; }
@media (max-width: 899px) { .pg .pg-card, .app-body .pg-card { padding: 14px; border-radius: 16px; } }

/* ---------- 7. buttons, chips, fields ---------- */
.app-body .btn { min-height: 38px; padding: 0 14px; border-radius: 10px; font-size: 14px; line-height: 18px; gap: 7px; transition: transform .18s var(--nx-ease), box-shadow .22s var(--nx-ease), background-color .18s, color .18s, border-color .18s; }
.app-body .btn svg { width: 17px; height: 17px; }
.app-body .btn-primary, .btn-primary, .pb-btn-primary { position: relative; overflow: hidden; isolation: isolate; background: var(--bubble-own); box-shadow: 0 8px 18px -8px #08805FB3, inset 0 1px 0 rgba(255, 255, 255, .25); }
.app-body .btn-primary:hover, .pb-btn-primary:hover { box-shadow: 0 12px 24px -10px #08805FCC, inset 0 1px 0 rgba(255, 255, 255, .25); transform: translateY(-1px); }
.app-body .btn-primary:active:not(:disabled), .pb-btn-primary:active { transform: scale(.97); }
.app-body .btn-hero { background: var(--nx-grad); color: var(--nx-on-bright); border-color: transparent; font-weight: 700; box-shadow: 0 8px 20px -8px #34D39999; }
.app-body .btn-hero:hover { background: var(--nx-grad); color: var(--nx-on-bright); transform: translateY(-1px); box-shadow: 0 12px 26px -10px #34D399B3; }
.app-body .btn-glass { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); color: #fff; }
.app-body .btn-glass:hover { background: rgba(255, 255, 255, .15); color: #fff; border-color: rgba(255, 255, 255, .28); }
.pb-btn { border-radius: 12px; }

.app-body .input, .app-body .field input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), .app-body .field select, .app-body .pg select { min-height: 40px; font-size: 14.5px; border-width: 1px; border-radius: 10px; padding-left: 12px; }
.app-body textarea.input, .app-body .field textarea, .app-body .pg textarea { font-size: 14.5px; border-width: 1px; border-radius: 10px; padding: 10px 12px; min-height: 84px; }
.app-body .field { margin-bottom: 12px; }
.app-body .field > label, .pg .field > label, .pg .pg-label { font-size: 12.5px; margin-bottom: 5px; }
.app-body .input:focus, .app-body .field input:focus, .app-body .field select:focus, .app-body .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #34D39933; }
@media (max-width: 899px) {
  /* 16px text keeps iPhones from zooming into a field */
  .app-body .input, .app-body .field input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), .app-body .field select, .app-body .pg select { min-height: 44px; font-size: 16px; }
  .app-body textarea.input, .app-body .field textarea, .app-body .pg textarea { font-size: 16px; }
  .app-body .btn { min-height: 40px; }
}

.chip { min-height: 30px; font-size: 13px; }
.chip.is-on, .chip[aria-pressed="true"], .chip[aria-selected="true"], .chip.active,
.app-body .chip.is-on, .app-body .chip[aria-pressed="true"], .app-body .chip[aria-selected="true"] { background: var(--nx-ink); border-color: var(--nx-ink); color: #fff; }
:root[data-theme="dark"] .chip.is-on, :root[data-theme="dark"] .chip[aria-pressed="true"], :root[data-theme="dark"] .chip[aria-selected="true"] { background: var(--nx-grad); border-color: transparent; color: var(--nx-on-bright); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .chip.is-on, :root:not([data-theme="light"]) .chip[aria-pressed="true"], :root:not([data-theme="light"]) .chip[aria-selected="true"] { background: var(--nx-grad); border-color: transparent; color: var(--nx-on-bright); }
}
.fab, .app-body .fab { border-radius: 16px; background: var(--nx-grad); color: var(--nx-on-bright); box-shadow: 0 14px 26px -10px #34D399B3, 0 2px 6px rgba(15, 27, 51, .14); transition: transform .25s var(--nx-ease), box-shadow .25s; }
.fab:hover, .app-body .fab:hover { transform: translateY(-2px); }
.sheet { border-radius: var(--r-sheet) var(--r-sheet) 0 0; }
.toast { border-radius: 12px; }

/* ---------- 8. sign in and the other public pages ---------- */
.sh { background: var(--nx-night); }
.sh::before, .sh::after, .sh-hero::after { display: none; }
.sh-hero { color: #fff; min-height: clamp(210px, 34dvh, 300px); }
.pb a.sh-brand, .pb a.sh-brand:hover, .pb a.sh-brand:visited { color: #fff; }
.sh-tile { width: 68px; height: 68px; border-radius: 20px; background: var(--nx-grad); box-shadow: 0 18px 44px -10px #34D39980, inset 0 1px 0 rgba(255, 255, 255, .4); animation: nx-float 6s ease-in-out infinite; }
.sh-tile svg { width: 44px; height: 44px; }
.sh-word { font-size: 26px; }
.sh-sub, .sh-tagline { color: rgba(255, 255, 255, .72); }
.sh-sheet { animation: nx-sheet-up .55s var(--nx-ease) backwards; box-shadow: 0 -24px 60px -20px rgba(11, 20, 36, .6); }
.sh-foot { background: var(--pb-surface); }
@media (min-width: 900px) {
  .sh-tile { width: 60px; height: 60px; border-radius: 18px; } .sh-tile svg { width: 38px; height: 38px; }
  .sh-sheet { border-color: transparent; box-shadow: 0 40px 90px -30px rgba(11, 20, 36, .8), 0 0 0 1px rgba(255, 255, 255, .08); }
  .sh-foot { background: none; color: rgba(255, 255, 255, .6); }
  .pb .sh-foot a, .pb .sh-foot a:hover { color: rgba(255, 255, 255, .78); }
}
.pb-tile, .ins-tile, .sh-tile { background: var(--nx-grad); }

/* ---------- 9. customer chat + calls ---------- */
.guest-body { background: var(--bg); }
.cl-page, body.cl-page { --cl-deep: #080F1C; }
body.cl-page { background: #080F1C; }
.cl-av:not(.has-img), .cl-peeroff-av:not(.has-img) { background: #08805F !important; color: #fff !important; }
.cl-bgav:not(.has-img) { background: #0B4A66 !important; }

/* ---------- 10. first paint ---------- */
.pg > .pg-head, .pg > .pg-card, .pg > section, .pg > .pg-cols > * > .pg-card, .pg > .pg-cols > * > section { animation: nx-rise .45s var(--nx-ease) backwards; }
.pg > :nth-child(2), .pg > .pg-cols > * > :nth-child(2) { animation-delay: .05s; }
.pg > :nth-child(3), .pg > .pg-cols > * > :nth-child(3) { animation-delay: .1s; }
.pg > :nth-child(n+4) { animation-delay: .15s; }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  .app-body *, .app-body *::before, .app-body *::after, .sh, .sh *, .sh::before, .sh::after, .sh-sheet, .sh-tile { animation: none !important; }
  .app-body .btn-primary:hover { transform: none; }
}

/* ---------- 11. compact lists ---------- */
/* hero numbers: the number first, its label under it, so a long label never pushes a number down */
@media (min-width: 900px) { .pg .pg-head--card .pg-stat { flex-direction: column; justify-content: flex-start; } }

/* inbox rows */
.app-body .inbox23 .crow { min-height: 0; padding: 0 14px; gap: 11px; }
.app-body .inbox23 .crow .crow-main { padding: 8px 0; gap: 1px; }
.app-body .inbox23 .crow .av23 { width: 42px !important; height: 42px !important; }
.app-body .inbox23 .crow .av23-face { width: 40px !important; height: 40px !important; font-size: 13.5px; }
.app-body .inbox23 .crow .crow-l1 { line-height: 20px; }
.app-body .inbox23 .crow .crow-name { font-size: 14.5px; line-height: 20px; }
.app-body .inbox23 .crow .crow-l2, .app-body .inbox23 .crow .crow-prev { font-size: 13px; line-height: 18px; }
.app-body .inbox23 .crow .crow-staff { margin-top: 0; font-size: 11.5px; line-height: 14px; font-weight: 500; }
.app-body .inbox23 .il-titlerow h1 { font-size: 24px; line-height: 30px; }
.app-body .inbox23 .il-search input, .app-body .inbox23 .il-search { min-height: 40px; }

/* tables on phones: a tight card per row, values two to a line */
@media (max-width: 760px) {
  .pg .pg-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-auto-flow: dense; gap: 8px 12px; margin-bottom: 8px; padding: 10px 12px; border-radius: 14px; }
  .pg .pg-table td { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 2px; width: auto; min-width: 0; padding: 0; text-align: left; font-size: 13.5px; }
  .pg .pg-table td::before { font-size: 11px; line-height: 14px; }
  .pg .pg-table td:first-child, .pg .pg-table td[data-label="Actions"], .pg .pg-table td:has(select), .pg .pg-table td:has(.btn) { grid-column: 1 / -1; }
  .pg .pg-table td:first-child { padding-top: 0; }
  .pg .pg-table td[data-label="Actions"] { flex-direction: row; align-items: center; gap: 8px; }
  .pg .pg-table select { width: 100%; }
}

/* ---------- 12. flat brand marks ---------- */
.app-body .app-mark, .sh-tile, .pb-tile, .ins-tile { background: #08805F; box-shadow: none; }
.app-body .app-me-av { background: #34D399; }
.fab, .app-body .fab { background: #08805F; color: #fff; box-shadow: 0 10px 22px -8px rgba(8, 128, 95, .7), 0 2px 6px rgba(15, 27, 51, .14); }
.app-body .btn-primary, .btn-primary, .pb-btn-primary { box-shadow: 0 6px 14px -8px rgba(8, 128, 95, .8); }
.app-body .btn-primary:hover, .pb-btn-primary:hover { background: #066B50; box-shadow: 0 8px 18px -8px rgba(8, 128, 95, .9); }
.pg > .pg-head.pg-head--card { box-shadow: 0 16px 34px -22px rgba(15, 27, 51, .7); }
.pg .pg-head--card .pg-stat { background: #17274B; border-color: #22345E; }
.pg .pg-head--card a.pg-stat:hover, .pg .pg-head--card .pg-stat--link:hover { background: #1D3059; border-color: #2C4273; }
@media (max-width: 899px) { .pg .pg-head--card .pg-stat { background: none; } }
.sh-tile { animation: none; }

/* ============ 13. sign-in scene: chats, orders and reviews circle the mark (flat colours, transform only) ============ */
.sh[data-shell="auth"] .sh-hero { position: relative; overflow: hidden; }
.sh[data-shell="auth"] .sh-brand { position: relative; }
.sh[data-shell="auth"] .sh-tile, .sh[data-shell="auth"] .sh-word, .sh[data-shell="auth"] .sh-sub, .sh[data-shell="auth"] .sh-tagline { position: relative; z-index: 2; }
.sh[data-shell="auth"] .sh-tile { width: 64px; height: 64px; border-radius: 19px; animation: nx-pop .7s var(--nx-ease) backwards; }
.nxa { --r1: 78px; --r2: 124px; --tile: 64px; --box: calc(var(--r2) * 2 + 64px); position: absolute; left: 50%; top: calc(var(--tile) / 2); width: var(--box); height: var(--box); translate: -50% -50%; z-index: 1; pointer-events: none;
  /* on phones the name sits right under the mark: what circles fades out before it reaches the text */
  -webkit-mask-image: linear-gradient(#000 0, #000 calc(50% + 22px), transparent calc(50% + 54px)); mask-image: linear-gradient(#000 0, #000 calc(50% + 22px), transparent calc(50% + 54px)); }
.nxa-ring { position: absolute; left: 50%; top: 50%; translate: -50% -50%; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .1); animation: nxa-ring .9s var(--nx-ease) backwards; }
.nxa-ring--1 { width: calc(var(--r1) * 2); height: calc(var(--r1) * 2); }
.nxa-ring--2 { width: calc(var(--r2) * 2); height: calc(var(--r2) * 2); border-style: dashed; border-color: rgba(255, 255, 255, .14); animation-delay: .12s; }
.nxa-pulse { position: absolute; left: 50%; top: 50%; width: var(--tile); height: var(--tile); translate: -50% -50%; border-radius: 30%; border: 1.5px solid #34D399; opacity: 0; animation: nxa-pulse 3.6s ease-out 1s infinite; }
.nxa-pulse--2 { animation-delay: 2.8s; }
.nxa-orbit { position: absolute; left: 50%; top: 50%; width: 0; height: 0; animation: nxa-turn 46s linear infinite; }
.nxa-orbit--2 { animation-duration: 66s; animation-direction: reverse; }
.nxa-chip { position: absolute; left: 0; top: 0; width: 0; height: 0; transform: rotate(var(--a)) translateX(var(--r)) rotate(calc(var(--a) * -1)); }
.nxa-orbit--1 .nxa-chip { --r: var(--r1); } .nxa-orbit--2 .nxa-chip { --r: var(--r2); }
.nxa-chip b { position: absolute; left: -17px; top: -17px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: inherit; color: inherit; animation: nxa-back 46s linear infinite, nxa-in .7s var(--nx-ease) var(--d, 0s) backwards; }
.nxa-orbit--2 .nxa-chip b { animation-duration: 66s, .7s; animation-direction: reverse, normal; }
.nxa-chip svg, .nxa-note i svg { width: 17px; height: 17px; }
.nxa-chip--emerald { background: #08805F; color: #fff; } .nxa-chip--amber { background: #FBBF24; color: #3A2500; }
.nxa-chip--white { background: #fff; color: #0F1B33; } .nxa-chip--ink { background: #17274B; color: #34D399; }
.nxa-chip--ink b { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.nxa-note { display: none; }
@keyframes nxa-turn { to { transform: rotate(360deg); } }
@keyframes nxa-back { to { rotate: -360deg; } }
@keyframes nxa-in { from { scale: 0; opacity: 0; } }
@keyframes nxa-ring { from { scale: .6; opacity: 0; } }
@keyframes nxa-pulse { 0% { scale: .9; opacity: .55; } 70%, 100% { scale: 2.5; opacity: 0; } }
@keyframes nxa-note { 0% { opacity: 0; translate: 0 14px; scale: .94; } 4%, 30% { opacity: 1; translate: 0 0; scale: 1; } 34%, 100% { opacity: 0; translate: 0 -10px; scale: .98; } }

@media (min-width: 1080px) {
  /* two halves: the scene on ink, the form on paper */
  .sh[data-shell="auth"] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: 1fr auto; padding: 0; background: var(--pb-bg); }
  .sh[data-shell="auth"] .sh-hero { grid-column: 1; grid-row: 1 / -1; min-height: 100dvh; padding: 40px 32px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #0F1B33; text-align: center; }
  .sh[data-shell="auth"] .sh-brand { display: grid; place-items: center; width: 400px; height: 400px; max-width: 100%; }
  .sh[data-shell="auth"] .sh-tile { width: 88px; height: 88px; border-radius: 26px; } .sh[data-shell="auth"] .sh-tile svg { width: 54px; height: 54px; }
  .sh[data-shell="auth"] .sh-word { position: absolute; left: 50%; bottom: -14px; translate: -50% 100%; font-size: 30px; }
  .sh[data-shell="auth"] .sh-tagline { margin-top: 74px; max-width: 20ch; font: 600 27px/1.22 var(--nx-display); letter-spacing: -.03em; color: #fff; text-wrap: balance; }
  .sh[data-shell="auth"] .sh-sub { order: 3; margin-top: 12px; }
  .sh[data-shell="auth"] .nxa { --r1: 122px; --r2: 196px; --tile: 88px; top: 50%; -webkit-mask-image: none; mask-image: none; }
  .sh[data-shell="auth"] .nxa-chip b { left: -21px; top: -21px; width: 42px; height: 42px; border-radius: 13px; } .sh[data-shell="auth"] .nxa-chip svg { width: 20px; height: 20px; }
  .nxa-note { position: absolute; z-index: 3; display: flex; align-items: center; gap: 10px; width: max-content; max-width: 218px; padding: 8px 13px 8px 8px; border-radius: 14px; background: #fff; color: #0F1B33; text-align: left; box-shadow: 0 16px 34px -16px rgba(0, 0, 0, .6); opacity: 0; animation: nxa-note 12s var(--nx-ease) 1.4s infinite; }
  .nxa-note i { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; }
  .nxa-note span { display: grid; min-width: 0; } .nxa-note b { font: 600 13px/1.3 var(--pb-font, Inter, sans-serif); } .nxa-note small { color: #5B6478; font: 400 12px/1.35 var(--pb-font, Inter, sans-serif); }
  .nxa-note--1 { right: calc(50% + 84px); top: calc(50% - 236px); }
  .nxa-note--2 { left: calc(50% + min(104px, 25vw - 232px)); top: calc(50% - 58px); animation-delay: 5.4s; }
  .nxa-note--3 { right: calc(50% + 108px); top: calc(50% + 104px); animation-delay: 9.4s; }
  .sh[data-shell="auth"] .sh-sheet { grid-column: 2; grid-row: 1; align-self: center; justify-self: center; margin: 40px 24px 0; }
  .sh[data-shell="auth"] .sh-foot { grid-column: 2; grid-row: 2; justify-content: center; gap: 16px; padding: 18px 24px 22px; background: none; color: var(--pb-text-2); }
  .pb .sh[data-shell="auth"] .sh-foot a, .pb .sh[data-shell="auth"] .sh-foot a:hover { color: var(--pb-text-2); }
}
@media (prefers-reduced-motion: reduce) { .nxa-pulse { display: none; } .nxa-note--1 { opacity: 1; } }
