/* =========================================
   base.css (CLEAN)
   Single source of truth for:
   - global background (Home v2)
   - pinned nav
   - layout shell spacing
   - shared UI primitives
   ========================================= */

* { box-sizing: border-box; }

:root{
  --color-bg: #050608;
  --color-surface: #111217;
  --color-border: #262833;
  --color-text: #f5f5f5;
  --color-text-muted: #9ea2b8;
  --color-accent: #cfd9c6;
  --color-accent-soft: #d6e0cd;
  --color-focus: rgba(207,217,198,0.55);

  --radius-card: 18px;
  --radius-pill: 999px;

  --shadow-card: 0 14px 34px rgba(0,0,0,0.55);
  --shadow-card-hover: 0 18px 44px rgba(0,0,0,0.70);

  /* Shared aliases used throughout the existing UI */
  --accent: var(--color-accent);
  --accent-strong: #b8c8aa;
  --text: var(--color-text);
  --muted: var(--color-text-muted);
  --nav-h: 80px;
  --nav-top-gap: 12px;
  --bg-dark: var(--color-bg);
  --border: var(--color-border);
  --border-strong: rgba(255,255,255,0.14);
}

/* Global canvas */
html, body{
  margin: 0;
  padding: 0;
  height: auto;
  overflow-y: auto;
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 0 0, #222738 0, transparent 55%),
    radial-gradient(circle at 100% 100%, #181b24 0, transparent 55%),
    radial-gradient(circle at 0 100%, #151923 0, transparent 55%),
    var(--bg-dark);
}

/* stop images exploding layout */
img{ max-width: 100%; height: auto; display: block; }

/* =========================
   NAV (pinned) – modern, cohesive with site
   ========================= */

.il-nav{
  position: fixed;
  top: var(--nav-top-gap);
  left: 0;
  right: 0;
  z-index: 9999;
  background: transparent;
  box-shadow: none;
  border: 0;
  padding: 0 14px;
  transition: transform 0.22s ease, opacity 0.22s ease;
  will-change: transform;
}

.il-nav, .il-nav-inner{ overflow: visible; }

.mobile-logo-bar{
  display: none;
}

body.nav-hidden .il-nav{
  transform: translateY(calc(-100% - var(--nav-top-gap) - 6px));
  opacity: 0;
}

.il-nav-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 1.1rem;
  height: var(--nav-h);
  border-radius: 22px;
  background: rgba(17, 18, 23, 0.78);
  border: 1px solid rgba(38, 40, 51, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 18px 40px rgba(0,0,0,0.32);
}

/* Brand – compact */
.header-logo{
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.header-logo-mark{
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: rgba(255,255,255,0.95);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  transition: opacity 0.2s ease;
}

.header-logo-mark:hover{ opacity: 0.9; }

.header-logo-img{
  height: 76px;
  width: auto;
}

/* Centre nav – compact pill-style links */
.header-nav{
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
}

.header-nav a,
.header-nav summary{
  color: rgba(255,255,255,0.66);
  text-decoration: none;
  font-size: 0.81rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.34rem 0.62rem;
  height: 38px;
  display: inline-flex;
  align-items: center;
  position: relative;
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease;
  cursor: pointer;
}

.header-nav a:hover,
.header-nav summary:hover{
  color: rgba(255,255,255,0.92);
  background: rgba(255,255,255,0.04);
}

.header-nav a::after,
.header-nav summary::after{
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 4px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.18s ease, background 0.18s ease;
}

.header-nav a:hover::after,
.header-nav summary:hover::after{
  transform: scaleX(1);
  background: rgba(255,255,255,0.22);
}

.header-nav a.active,
.header-nav summary.active,
.header-nav .nav-group[open] > summary{
  color: rgba(255,255,255,0.96);
  background: rgba(255,255,255,0.05);
}

.header-nav a.active::after,
.header-nav summary.active::after,
.header-nav .nav-group[open] > summary::after{
  transform: scaleX(1);
  background: var(--accent);
}

.header-nav summary{
  list-style: none;
}

.header-nav summary::-webkit-details-marker{
  display: none;
}

.nav-group{
  position: relative;
}

.nav-group > summary{
  padding-right: 1.05rem;
}

.nav-group > summary::before{
  content: "";
  position: absolute;
  right: 2px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.8px solid rgba(255,255,255,0.7);
  border-bottom: 1.8px solid rgba(255,255,255,0.7);
  transform: translateY(-65%) rotate(45deg);
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.nav-group[open] > summary::before{
  transform: translateY(-25%) rotate(225deg);
  border-color: var(--accent);
}

.nav-submenu{
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 184px;
  padding: 0.5rem;
  border-radius: 16px;
  background: rgba(17, 18, 23, 0.98);
  border: 1px solid rgba(38, 40, 51, 0.96);
  box-shadow: 0 18px 38px rgba(0,0,0,0.52);
  z-index: 10000;
}

.nav-group[open] .nav-submenu{
  display: grid;
  gap: 0.2rem;
}

.nav-submenu a{
  height: auto;
  padding: 0.68rem 0.78rem;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255,255,255,0.84);
}

.nav-submenu a::after{
  display: none;
}

.nav-submenu a:hover{
  background: rgba(207,217,198,0.10);
  color: rgba(255,255,255,0.98);
}

.nav-submenu a.active{
  background: rgba(207,217,198,0.14);
  color: rgba(255,255,255,0.98);
}
.nav-toggle{
  display: none; /* shown below 960px */
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(38, 40, 51, 0.96);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.9);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.nav-toggle:hover{
  background: rgba(255,255,255,0.08);
  border-color: rgba(207,217,198,0.22);
}

.nav-toggle-icon{
  width: 18px;
  height: 14px;
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
}

.nav-toggle-icon span{
  display: block;
  height: 2px;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  opacity: 0.9;
}
.nav-scrim{
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9997;
  background: rgba(0,0,0,0.55);
}

.nav-scrim.open{ display: block; }

.nav-drawer{
  position: fixed;
  top: var(--nav-h);
  right: 0;
  bottom: 0;
  width: min(360px, 86vw);
  z-index: 9998;

  background: rgba(17, 18, 23, 0.98);
  backdrop-filter: blur(12px);
  border-left: 1px solid rgba(38, 40, 51, 0.96);
  box-shadow: -12px 0 40px rgba(0,0,0,0.55);

  padding: 1.25rem;
  overflow-y: auto;

  transform: translateX(105%);
  transition: transform 0.22s ease;
}

.nav-drawer.open{ transform: translateX(0); }

/* Right side */
.header-right{
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.header-utility-pills{
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.notification-menu{
  position: relative;
}

.notification-btn{
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(38, 40, 51, 0.96);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.92);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.notification-btn:hover{
  background: rgba(255,255,255,0.09);
  border-color: rgba(207,217,198,0.22);
}

.notification-btn-icon{
  font-size: 0.96rem;
  line-height: 1;
}

.notification-count{
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(207,217,198,0.16);
  color: #f3f7ef;
  border: 1px solid rgba(207,217,198,0.24);
  font-size: 0.67rem;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 8px 18px rgba(0,0,0,0.22),
    inset 0 1px 0 rgba(255,255,255,0.08);
}

.notification-panel{
  position: fixed;
  top: calc(var(--nav-top-gap) + var(--nav-h) + 12px);
  left: calc(50% + 520px);
  right: 6px;
  width: auto;
  max-width: 285px;
  height: min(74vh, 680px);
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: 10010;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(18px, 0, 0) scale(0.98);
  transition: opacity 0.22s ease, transform 0.24s ease;
}

.notification-panel.open{
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) scale(1);
}

.notification-dismiss-btn{
  border: 0;
  background: transparent;
  color: #cfd9c6;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.notification-dismiss-btn:hover{
  color: #eef4ea;
}

.notification-list{
  display: grid;
  gap: 0.55rem;
  padding: 18px 2px 20px;
}

.notification-summary-card{
  display: grid;
  gap: 0.35rem;
  padding: 0.95rem 1rem;
  border-radius: 22px;
  text-decoration: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.05)),
    rgba(207,217,198,0.08);
  border: 1px solid rgba(207,217,198,0.2);
  box-shadow:
    0 18px 30px rgba(0,0,0,0.18),
    inset 0 1px 0 rgba(255,255,255,0.12);
}

.notification-summary-eyebrow{
  color: rgba(255,255,255,0.56);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.notification-summary-title{
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.3;
}

.notification-summary-copy{
  color: rgba(255,255,255,0.72);
  font-size: 0.78rem;
  line-height: 1.45;
}

.notification-list-wrap{
  position: relative;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 6px 0 0;
  mask-image: linear-gradient(to bottom, transparent 0, rgba(0,0,0,1) 10%, rgba(0,0,0,1) 88%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, rgba(0,0,0,1) 10%, rgba(0,0,0,1) 88%, transparent 100%);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.notification-list-wrap::-webkit-scrollbar{
  width: 0;
  height: 0;
}

.notification-item{
  display: grid;
  gap: 0.4rem;
  padding: 0.9rem 0.95rem;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04)),
    rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow:
    0 18px 30px rgba(0,0,0,0.18),
    inset 0 1px 0 rgba(255,255,255,0.1);
  transform: translateY(var(--notification-card-y, 0)) scale(var(--notification-card-scale, 1));
  transform-origin: center center;
  opacity: var(--notification-card-opacity, 1);
  filter: blur(var(--notification-card-blur, 0));
  transition: transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.notification-item.is-unread{
  background:
    linear-gradient(180deg, rgba(207,217,198,0.18), rgba(255,255,255,0.05)),
    rgba(255,255,255,0.06);
  border-color: rgba(207,217,198,0.22);
}

.notification-item-main{
  text-decoration: none;
}

.notification-item-kind-label{
  display: inline-flex;
  align-items: center;
  align-self: start;
  padding: 0.18rem 0.48rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.62);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.notification-item-title{
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 800;
}

.notification-item-body{
  color: rgba(255,255,255,0.72);
  font-size: 0.79rem;
  line-height: 1.45;
  margin-top: 0.22rem;
}

.notification-item-meta{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 0.42rem;
  color: rgba(255,255,255,0.48);
  font-size: 0.72rem;
}

.notification-severity{
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.46rem;
  border-radius: 999px;
  font-weight: 800;
}

.notification-severity-high{
  background: rgba(248, 113, 113, 0.16);
  color: #fecaca;
}

.notification-severity-medium{
  background: rgba(250, 204, 21, 0.16);
  color: #fde68a;
}

.notification-item-kind-orders-arriving{
  background:
    linear-gradient(180deg, rgba(116, 214, 195, 0.14), rgba(255,255,255,0.04)),
    rgba(255,255,255,0.05);
  border-color: rgba(116, 214, 195, 0.16);
}

.notification-item-kind-orders-arriving .notification-item-kind-label{
  background: rgba(116, 214, 195, 0.12);
  border-color: rgba(116, 214, 195, 0.2);
  color: rgba(190, 249, 236, 0.92);
}

.notification-item-kind-orders-arriving .notification-severity-medium{
  background: rgba(116, 214, 195, 0.16);
  color: #bef9ec;
}

.notification-item-kind-order-bounce .notification-item-kind-label{
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.2);
  color: #fecaca;
}

.notification-empty{
  padding: 1rem 0.85rem;
  border-radius: 20px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.72);
  font-size: 0.82rem;
  line-height: 1.45;
}

@media (max-width: 960px){
  .notification-panel{
    left: 10px;
    right: 10px;
    width: auto;
    max-width: none;
    height: min(70vh, 620px);
  }
}

@media (min-width: 961px) and (max-width: 1360px){
  .notification-panel{
    left: auto;
    right: 10px;
    width: min(284px, calc(100vw - 20px));
    max-width: none;
    padding: 10px 10px 12px;
    border-radius: 26px;
    background: rgba(5, 6, 8, 0.9);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 20px 42px rgba(0,0,0,0.34);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}

@media (min-width: 768px) and (max-width: 1024px){
  .notification-panel{
    left: max(10px, calc(100vw - 458px));
    right: 10px;
    width: auto;
    max-width: none;
    padding: 10px 10px 12px;
    border-radius: 26px;
    background: rgba(5, 6, 8, 0.9);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 20px 42px rgba(0,0,0,0.34);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}

.signed-in-pill{
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.34);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(91, 33, 182, 0.24));
  color: #eff6ff;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.site-kind-pill{
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.site-kind-live{
  background: rgba(15, 23, 42, 0.78);
  border-color: rgba(255,255,255,0.18);
}

.site-kind-dev-test{
  background: rgba(30, 64, 175, 0.42);
  border-color: rgba(96, 165, 250, 0.4);
}

.site-kind-demo-training{
  background: rgba(91, 33, 182, 0.42);
  border-color: rgba(196, 181, 253, 0.36);
}

.site-kind-template{
  background: rgba(6, 95, 70, 0.34);
  border-color: rgba(52, 211, 153, 0.32);
}

.site-switcher{ position: relative; }

.site-btn,
.logout-btn{
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(38, 40, 51, 0.96);
  border-radius: 999px;
  padding: 0.38rem 0.68rem;
  font-size: 0.77rem;
  font-weight: 600;
  line-height: 1;
  min-height: 34px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.28rem;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
  text-decoration: none;
}

.site-btn:hover,
.logout-btn:hover{
  background: rgba(255,255,255,0.08);
  border-color: rgba(207,217,198,0.22);
  color: rgba(255,255,255,0.98);
}

.site-btn .caret{ font-size: 0.65rem; opacity: 0.8; }

.site-menu{
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: rgba(17, 18, 23, 0.98);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(38, 40, 51, 0.96);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  min-width: 160px;
  overflow: hidden;
  z-index: 99999;
}

.site-menu.open{ display: block; }

.site-menu a{
  display: block;
  padding: 0.6rem 1rem;
  text-decoration: none;
  color: rgba(255,255,255,0.9);
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.15s ease;
}

.site-menu a:hover{
  background: rgba(207,217,198,0.1);
}

/* Focus */
.header-nav a:focus-visible,
.header-nav summary:focus-visible,
.site-btn:focus-visible,
.logout-btn:focus-visible{
  outline: none;
  box-shadow: 0 0 0 2px rgba(207,217,198,0.35);
}

/* =========================
   Shared UI primitives
   ========================= */

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 42px;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.94);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform 0.14s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
}

.btn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.18);
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(0,0,0,0.24);
}

.btn:focus-visible{
  outline: none;
  box-shadow:
    0 0 0 3px rgba(207,217,198,0.16),
    0 14px 30px rgba(0,0,0,0.24);
}

.btn[disabled],
.btn[aria-disabled="true"]{
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary{
  background: linear-gradient(180deg, #f59d3d, #e67f14);
  border-color: rgba(255, 196, 125, 0.42);
  color: #fffaf3;
  box-shadow: 0 12px 28px rgba(201, 108, 18, 0.26);
}

.btn-primary:hover{
  background: linear-gradient(180deg, #f7a94f, #dd760d);
  border-color: rgba(255, 208, 151, 0.5);
  color: #ffffff;
  box-shadow: 0 16px 32px rgba(201, 108, 18, 0.34);
}

.btn-ghost,
.btn-secondary{
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.9);
}

.btn-ghost:hover,
.btn-secondary:hover{
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
}

.btn-edit,
.action-btn.edit-btn,
.action-btn.delete-btn,
.ledger-action-btn.edit-btn,
.ledger-action-btn.ledger-delete-btn,
.table-btn.edit-btn,
.table-btn.delete-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  min-height: 28px;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  line-height: 1;
  white-space: nowrap;
}

.btn-edit,
.action-btn.edit-btn,
.ledger-action-btn.edit-btn,
.table-btn.edit-btn{
  font-weight: 800;
  border: 1px solid #d7deea;
  background: #eef2f7;
  color: #111827;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}

.btn-edit:hover,
.action-btn.edit-btn:hover,
.ledger-action-btn.edit-btn:hover,
.table-btn.edit-btn:hover{
  background: #e2e8f0;
  color: #111827;
  box-shadow: 0 6px 16px rgba(15,23,42,0.12);
}

.btn-delete,
.btn.btn-danger,
.btn.danger,
.ledger-action-btn.ledger-delete-btn,
.action-btn.delete-btn,
.table-btn.delete-btn,
.delete-btn,
.danger-btn{
  font-weight: 500;
  border-color: rgba(255, 133, 133, 0.68);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.02) 24%, rgba(255,255,255,0) 25%),
    linear-gradient(180deg, #d92a3b 0%, #b11424 52%, #8f0d1c 100%);
  color: #fff8f8;
  text-shadow: 0 1px 0 rgba(91, 8, 16, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 232, 0.28),
    inset 0 -1px 0 rgba(96, 4, 16, 0.42),
    0 10px 22px rgba(69, 10, 10, 0.22);
}

.btn-delete:hover,
.btn.btn-danger:hover,
.btn.danger:hover,
.ledger-action-btn.ledger-delete-btn:hover,
.action-btn.delete-btn:hover,
.table-btn.delete-btn:hover,
.delete-btn:hover,
.danger-btn:hover{
  border-color: rgba(255, 153, 153, 0.78);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.2), rgba(255,255,255,0.03) 24%, rgba(255,255,255,0) 25%),
    linear-gradient(180deg, #e03144 0%, #bc1527 52%, #9b0f1f 100%);
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 236, 236, 0.34),
    inset 0 -1px 0 rgba(96, 4, 16, 0.46),
    0 14px 28px rgba(69, 10, 10, 0.28);
}

.btn-danger-outline{
  border-color: rgba(248, 113, 113, 0.42);
  background: rgba(127, 29, 29, 0.12);
  color: #fecaca;
  box-shadow: 0 10px 24px rgba(69, 10, 10, 0.12);
}

.btn-danger-outline:hover{
  background: rgba(127, 29, 29, 0.22);
  border-color: rgba(248, 113, 113, 0.52);
  color: #fee2e2;
  box-shadow: 0 14px 30px rgba(69, 10, 10, 0.18);
}

.card{
  background: rgba(17, 18, 23, 0.86);
  border: 1px solid rgba(38, 40, 51, 0.96);
  border-radius: var(--radius-card);
  box-shadow: 0 14px 34px rgba(0,0,0,0.28);
}

.current-site-heading{
  text-align: center;
  margin: 0 0 0.9rem;
  color: rgba(255,255,255,0.92);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

@media (max-width: 760px){
  .btn{
    min-height: 40px;
    padding: 0.58rem 0.92rem;
    font-size: 0.86rem;
  }
}


/* =========================
   PAGE SHELL
   IMPORTANT:
   - Must NOT be a scroll container
   - Must be pushed down under fixed nav
   ========================= */

.page-shell{
  max-width: 980px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + var(--nav-top-gap) + 38px) 16px 28px;
  min-height: 100vh;
  background: transparent;
  overflow: visible;
  height: auto;
  transform: none;
}

@media (max-width: 760px){
  .page-shell{ padding: calc(var(--nav-h) + var(--nav-top-gap) + 112px) 12px 22px; }
}

/* =========================
   Global radial quick menu
   ========================= */

.radial-menu-root{
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 10010;
}

.radial-menu-launcher{
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 52px;
  width: 52px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.12);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.05)),
    rgba(10, 12, 18, 0.7);
  color: rgba(255,255,255,0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    0 22px 44px rgba(0,0,0,0.42),
    inset 0 1px 0 rgba(255,255,255,0.12),
    inset 0 -12px 24px rgba(0,0,0,0.16);
  cursor: pointer;
  overflow: hidden;
  transition: width 0.22s ease, padding 0.22s ease, gap 0.22s ease, border-radius 0.22s ease, transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.radial-menu-launcher:hover{
  transform: translateY(-1px);
  border-color: rgba(207,217,198,0.24);
  box-shadow:
    0 26px 50px rgba(0,0,0,0.48),
    inset 0 1px 0 rgba(255,255,255,0.14),
    inset 0 -12px 24px rgba(0,0,0,0.16);
}

.radial-menu-launcher:focus-visible,
.radial-menu-close:focus-visible,
.radial-menu-item:focus-visible{
  outline: none;
  box-shadow: 0 0 0 2px rgba(207,217,198,0.34);
}

.radial-menu-launcher-ring{
  position: relative;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.16);
  background:
    radial-gradient(circle at 30% 28%, rgba(255,255,255,0.18), transparent 50%),
    radial-gradient(circle at 70% 75%, rgba(125, 211, 252, 0.12), transparent 48%),
    rgba(255,255,255,0.05);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.16),
    inset 0 -8px 16px rgba(0,0,0,0.22);
}

.radial-menu-launcher-ring span{
  position: absolute;
  inset: 50% auto auto 50%;
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 0 10px rgba(255,255,255,0.16);
}

.radial-menu-launcher-ring span:nth-child(1){ transform: translateY(-12px); }
.radial-menu-launcher-ring span:nth-child(2){ transform: translate(10px, 6px); }
.radial-menu-launcher-ring span:nth-child(3){ transform: translate(-10px, 6px); }

.radial-menu-launcher-copy{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  text-align: left;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  transform: translateX(-8px);
  transition: max-width 0.22s ease, opacity 0.16s ease, transform 0.22s ease;
}

.radial-menu-launcher-copy strong{
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
}

.radial-menu-launcher-copy span{
  display: none;
}

.radial-menu-root.open .radial-menu-launcher{
  width: 150px;
  padding: 0.62rem 0.82rem 0.62rem 0.72rem;
  gap: 0.62rem;
  border-radius: 999px;
}

.radial-menu-root.open .radial-menu-launcher .radial-menu-launcher-copy{
  max-width: 82px;
  opacity: 1;
  transform: translateX(0);
}

.radial-menu-panel{
  position: absolute;
  left: -18px;
  bottom: -18px;
  width: 330px;
  height: 330px;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, 18px, 0) scale(0.88);
  transform-origin: 56px calc(100% - 56px);
  transition: opacity 0.22s ease, transform 0.24s ease;
}

.radial-menu-root.open .radial-menu-panel{
  pointer-events: auto;
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.radial-menu-plate,
.radial-menu-ring{
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.radial-menu-plate{
  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,0.16), transparent 34%),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.08), rgba(255,255,255,0.02) 38%, rgba(7,9,14,0.78) 70%),
    rgba(7,9,14,0.72);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow:
    0 32px 64px rgba(0,0,0,0.48),
    inset 0 2px 0 rgba(255,255,255,0.1),
    inset 0 -30px 40px rgba(0,0,0,0.24);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transform: perspective(900px) rotateX(16deg);
}

.radial-menu-ring{
  inset: 26px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.02),
    0 0 0 1px rgba(0,0,0,0.12);
  opacity: 0.85;
}

.radial-menu-item{
  position: absolute;
  top: 50%;
  left: 50%;
  width: 106px;
  height: 84px;
  margin: -42px 0 0 -53px;
  border-radius: 8px;
  text-decoration: none;
  color: rgba(255,255,255,0.96);
  transform:
    rotate(calc((360deg / var(--radial-count)) * var(--radial-index)))
    translateY(-124px)
    rotate(calc((360deg / var(--radial-count)) * var(--radial-index) * -1));
  transition: transform 0.18s ease, filter 0.18s ease;
}

.radial-menu-item-inner{
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.4rem;
  width: 100%;
  height: 100%;
  padding: 0.8rem 0.78rem 0.72rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.04) 34%, rgba(255,255,255,0.03) 100%),
    rgba(12, 15, 21, 0.7);
  box-shadow:
    0 16px 28px rgba(0,0,0,0.32),
    inset 0 1px 0 rgba(255,255,255,0.12),
    inset 0 -12px 18px rgba(0,0,0,0.18);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.radial-menu-item:hover{
  transform:
    rotate(calc((360deg / var(--radial-count)) * var(--radial-index)))
    translateY(-132px)
    rotate(calc((360deg / var(--radial-count)) * var(--radial-index) * -1));
  filter: brightness(1.06);
}

.radial-menu-item.is-current .radial-menu-item-inner,
.radial-menu-item:hover .radial-menu-item-inner{
  border-color: rgba(207,217,198,0.28);
}

.radial-menu-tag{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.9);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.radial-menu-text{
  display: flex;
  flex-direction: column;
  gap: 0.14rem;
  min-width: 0;
}

.radial-menu-text strong{
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.05;
}

.radial-menu-text span{
  font-size: 0.67rem;
  line-height: 1.08;
  color: rgba(255,255,255,0.62);
}

.radial-menu-close{
  position: absolute;
  top: 50%;
  left: 50%;
  width: 68px;
  height: 68px;
  margin: -34px 0 0 -34px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, rgba(255,255,255,0.18), transparent 46%),
    linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0.05)),
    rgba(18, 20, 28, 0.86);
  color: rgba(255,255,255,0.94);
  box-shadow:
    0 16px 28px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.12),
    inset 0 -12px 22px rgba(0,0,0,0.18);
  cursor: pointer;
  transform: perspective(900px) rotateX(16deg);
}

.radial-menu-close span{
  display: inline-block;
  font-size: 2rem;
  line-height: 1;
  transform: rotate(45deg);
}

@media print{
  .radial-menu-root{
    display: none !important;
  }
}

/* Mobile: show hamburger, hide centre nav (in header only), compact right side */
@media (max-width: 960px){
  .il-nav-inner .header-nav{ display: none; }
  .nav-toggle{ display: flex; }
  .il-nav{
    padding: 0 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
  }
  .mobile-logo-bar{
    display: flex;
    justify-content: center;
    width: 100%;
    pointer-events: auto;
  }
  .mobile-logo-mark{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
  }
  .mobile-logo-img{
    height: 70px;
    width: auto;
  }
  .header-logo{ display: none; }
  .il-nav-inner{ gap: 0.75rem; padding: 0 0.9rem; border-radius: 18px; }
  .header-utility-pills{ gap: 0.4rem; }
  .site-btn, .logout-btn{ padding: 0.38rem 0.64rem; font-size: 0.75rem; min-height: 34px; }
  .signed-in-pill{ padding: 0.38rem 0.62rem; font-size: 0.7rem; }
  .site-kind-pill{ padding: 0.38rem 0.62rem; font-size: 0.7rem; }
  .environment-pill{ padding: 0.38rem 0.6rem; font-size: 0.7rem; }
  .nav-scrim{ top: calc(var(--nav-h) + 78px); }
  .nav-drawer{ top: calc(var(--nav-h) + 78px); }

  .radial-menu-root{
    left: 14px;
    bottom: 14px;
  }

  .radial-menu-launcher{
    min-height: 48px;
    width: 48px;
    padding: 0;
  }

  .radial-menu-panel{
    left: -10px;
    bottom: 56px;
    width: 286px;
    height: 286px;
    transform-origin: 48px calc(100% - 34px);
  }

  .radial-menu-item{
    width: 92px;
    height: 76px;
    margin: -38px 0 0 -46px;
    transform:
      rotate(calc((360deg / var(--radial-count)) * var(--radial-index)))
      translateY(-108px)
      rotate(calc((360deg / var(--radial-count)) * var(--radial-index) * -1));
  }

  .radial-menu-item:hover{
    transform:
      rotate(calc((360deg / var(--radial-count)) * var(--radial-index)))
      translateY(-114px)
      rotate(calc((360deg / var(--radial-count)) * var(--radial-index) * -1));
  }

  .radial-menu-item-inner{
    padding: 0.68rem 0.65rem;
  }

  .radial-menu-text strong{
    font-size: 0.72rem;
  }

  .radial-menu-text span{
    font-size: 0.62rem;
  }

  .radial-menu-close{
    width: 60px;
    height: 60px;
    margin: -30px 0 0 -30px;
  }
}

@media (max-width: 980px){
  .nav-drawer .header-nav{
    align-items: stretch;
    justify-content: flex-start;
    flex-direction: column;
    gap: 0.2rem;
  }

  .nav-drawer .header-nav a,
  .nav-drawer .header-nav summary{
    justify-content: space-between;
    width: 100%;
    padding: 0.8rem 0.4rem;
    height: auto;
  }

  .nav-drawer .header-nav a::after,
  .nav-drawer .header-nav summary::after{
    left: 0.4rem;
    right: 0.4rem;
    bottom: 0.2rem;
  }

  .nav-drawer .nav-group{
    width: 100%;
  }

  .nav-drawer .nav-submenu{
    position: static;
    transform: none;
    min-width: 0;
    margin: 0.15rem 0 0.35rem;
    background: rgba(255,255,255,0.03);
    box-shadow: none;
  }

  .nav-drawer .nav-submenu a{
    padding: 0.75rem 0.8rem;
  }
}

/* =========================
   Remove number input spinners (global)
   ========================= */

/* Chrome, Edge, Safari */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button{
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type=number]{
  -moz-appearance: textfield;
}

/* =========================
   Global support chat
   ========================= */

.support-chat-root{
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 10020;
}

body.support-chat-open{
  overflow: hidden;
}

.support-chat-launcher{
  position: relative;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 50%;
  background: rgba(255,255,255,0.96);
  color: #111827;
  padding: 0;
  min-height: 54px;
  width: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  box-shadow: 0 14px 34px rgba(15,23,42,0.14);
  cursor: pointer;
  overflow: hidden;
  transition: width 0.22s ease, padding 0.22s ease, gap 0.22s ease, border-radius 0.22s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.support-chat-launcher:hover{
  transform: translateY(-1px);
  box-shadow: 0 22px 48px rgba(15,23,42,0.18);
}

.support-chat-launcher-mark,
.support-chat-avatar{
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex: 0 0 36px;
  background:
    radial-gradient(circle at 30% 26%, rgba(191, 219, 254, 0.95), transparent 30%),
    radial-gradient(circle at 42% 36%, rgba(59, 130, 246, 0.9), transparent 52%),
    linear-gradient(145deg, #2563eb 0%, #1d4ed8 52%, #1e3a8a 100%);
  color: #fff;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.14),
    0 8px 18px rgba(15,23,42,0.22);
}

.support-chat-launcher-mark::before,
.support-chat-avatar::before{
  content: "";
  position: absolute;
  left: 8px;
  top: 9px;
  width: 19px;
  height: 14px;
  border-radius: 8px;
  background:
    radial-gradient(circle, #24324a 0 1.3px, transparent 1.6px) 5px 7px / 1px 1px no-repeat,
    radial-gradient(circle, #24324a 0 1.3px, transparent 1.6px) 10px 7px / 1px 1px no-repeat,
    radial-gradient(circle, #24324a 0 1.3px, transparent 1.6px) 15px 7px / 1px 1px no-repeat,
    #ffffff;
}

.support-chat-launcher-mark::after,
.support-chat-avatar::after{
  content: "";
  position: absolute;
  left: 12px;
  top: 19px;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: #ffffff;
  transform: rotate(45deg);
}

.support-chat-launcher-dot,
.support-chat-avatar-dot{
  position: absolute;
  top: 3px;
  right: 3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 2px #ffffff;
  z-index: 2;
}

.support-chat-launcher-spark,
.support-chat-avatar-glyph{
  display: none;
}

.support-chat-launcher-copy{
  display: grid;
  text-align: left;
  gap: 0.12rem;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  transform: translateX(-8px);
  transition: max-width 0.22s ease, opacity 0.16s ease, transform 0.22s ease;
}

.support-chat-launcher-copy strong{
  font-size: 0.84rem;
  line-height: 1.1;
}

.support-chat-launcher-copy span{
  display: none;
}

.support-chat-unread-badge{
  min-width: 20px;
  height: 20px;
  padding: 0 0.34rem;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  position: absolute;
  top: -3px;
  right: -3px;
  box-shadow: 0 10px 20px rgba(15,23,42,0.16);
}

.support-chat-unread-badge[hidden]{
  display: none !important;
}

.support-chat-root.open .support-chat-launcher{
  width: 154px;
  padding: 0.64rem 0.82rem 0.64rem 0.72rem;
  gap: 0.58rem;
  border-radius: 999px;
}

.support-chat-root.open .support-chat-launcher .support-chat-launcher-copy{
  max-width: 88px;
  opacity: 1;
  transform: translateX(0);
}

@media (hover: hover){
  .radial-menu-launcher:hover,
  .radial-menu-launcher:focus-visible{
    width: 150px;
    padding: 0.62rem 0.82rem 0.62rem 0.72rem;
    gap: 0.62rem;
    border-radius: 999px;
  }

  .radial-menu-launcher:hover .radial-menu-launcher-copy,
  .radial-menu-launcher:focus-visible .radial-menu-launcher-copy{
    max-width: 82px;
    opacity: 1;
    transform: translateX(0);
  }

  .support-chat-launcher:hover,
  .support-chat-launcher:focus-visible{
    width: 154px;
    padding: 0.64rem 0.82rem 0.64rem 0.72rem;
    gap: 0.58rem;
    border-radius: 999px;
  }

  .support-chat-launcher:hover .support-chat-launcher-copy,
  .support-chat-launcher:focus-visible .support-chat-launcher-copy{
    max-width: 88px;
    opacity: 1;
    transform: translateX(0);
  }
}

.support-chat-scrim{
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.support-chat-panel{
  position: fixed;
  right: 22px;
  bottom: 94px;
  width: min(402px, calc(100vw - 24px));
  max-height: min(82vh, 760px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  gap: 0.85rem;
  padding: 1rem;
  border-radius: 28px;
  border: 1px solid rgba(15,23,42,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.98));
  box-shadow: 0 28px 70px rgba(15,23,42,0.2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s ease;
  color: #111827;
  overflow: hidden;
  overscroll-behavior: contain;
}

.support-chat-handle{
  display: none;
  width: 44px;
  height: 5px;
  margin: -0.15rem auto 0.05rem;
  border-radius: 999px;
  background: rgba(148,163,184,0.6);
}

.support-chat-root.open .support-chat-scrim{
  opacity: 1;
  pointer-events: auto;
}

.support-chat-root.open .support-chat-panel{
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.support-chat-head,
.support-chat-head-brand,
.support-chat-head-actions,
.support-chat-meta,
.support-chat-actions{
  display: flex;
  align-items: center;
}

.support-chat-head{
  justify-content: space-between;
  gap: 0.8rem;
}

.support-chat-head-brand{
  gap: 0.78rem;
  align-items: flex-start;
}

.support-chat-head-actions{
  gap: 0.55rem;
  flex-shrink: 0;
}

.support-chat-title{
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.2;
}

.support-chat-subtitle{
  margin-top: 0.18rem;
  font-size: 0.82rem;
  color: #6b7280;
}

.support-chat-status-pill,
.support-chat-page{
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0.28rem 0.66rem;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 700;
}

.support-chat-status-pill{
  background: rgba(15,23,42,0.06);
  color: #374151;
}

.support-chat-status-pill.is-open{
  background: rgba(34,197,94,0.12);
  color: #166534;
}

.support-chat-status-pill.is-off{
  background: rgba(148,163,184,0.18);
  color: #475569;
}

.support-chat-close{
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,0.08);
  background: rgba(15,23,42,0.04);
  color: #374151;
  font-size: 1.35rem;
  cursor: pointer;
}

.support-chat-meta{
  flex-wrap: wrap;
  gap: 0.45rem;
}

.support-chat-page{
  background: rgba(15,23,42,0.05);
  color: #4b5563;
}

.support-chat-body{
  min-height: 0;
  min-width: 0;
  display: grid;
  gap: 0.55rem;
  overflow-x: hidden;
}

.support-chat-messages{
  min-height: 240px;
  max-height: 40vh;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  display: grid;
  gap: 0.7rem;
  padding: 0.2rem 0.1rem 0.2rem 0;
}

.support-chat-message{
  padding: 0.86rem 0.95rem;
  border-radius: 20px;
  border: 1px solid rgba(15,23,42,0.08);
  max-width: 86%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.support-chat-message p{
  margin: 0;
  color: #111827;
  font-size: 0.92rem;
  line-height: 1.48;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.support-chat-message-assistant{
  background: #ffffff;
  justify-self: start;
}

.support-chat-message-user{
  background: #eef2ff;
  border-color: rgba(79,70,229,0.14);
  justify-self: end;
}

.support-chat-message-system{
  background: rgba(15,23,42,0.06);
  border-color: rgba(15,23,42,0.08);
  justify-self: center;
  max-width: 82%;
}

.support-chat-message-system p,
.support-chat-message-system .support-chat-message-meta{
  color: #475569;
  text-align: center;
}

.support-chat-message-meta{
  margin-top: 0.45rem;
  font-size: 0.73rem;
  color: #6b7280;
}

.support-chat-attachment{
  display: inline-flex;
  align-items: center;
  margin-top: 0.5rem;
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.support-chat-typing{
  min-height: 20px;
  font-size: 0.78rem;
  color: #6b7280;
  padding-left: 0.15rem;
}

.support-chat-suggestions{
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.support-chat-chip{
  border: 1px solid rgba(15,23,42,0.08);
  background: #ffffff;
  color: #374151;
  border-radius: 999px;
  padding: 0.48rem 0.72rem;
  font-size: 0.77rem;
  cursor: pointer;
}

.support-chat-form{
  display: grid;
  gap: 0.55rem;
}

.support-chat-upload-row{
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.support-chat-upload{
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,0.08);
  background: #ffffff;
  color: #374151;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.support-chat-action{
  min-height: 38px;
  padding: 0 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,0.08);
  background: #ffffff;
  color: #374151;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.support-chat-file{
  max-width: 100%;
  font-size: 0.76rem;
  color: #6b7280;
}

.support-chat-label{
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
}

.support-chat-input{
  width: 100%;
  resize: none;
  border-radius: 18px;
  border: 1px solid rgba(15,23,42,0.08);
  background: #ffffff;
  color: #111827;
  padding: 0.9rem 1rem;
  font: inherit;
  min-height: 56px;
  max-height: 140px;
}

.support-chat-input:focus-visible,
.support-chat-send:focus-visible,
.support-chat-chip:focus-visible,
.support-chat-launcher:focus-visible,
.support-chat-action:focus-visible,
.support-chat-close:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.14);
}

.support-chat-actions{
  justify-content: space-between;
  gap: 0.8rem;
}

.support-chat-note{
  margin: 0;
  color: #6b7280;
  font-size: 0.73rem;
  line-height: 1.4;
}

.support-chat-send{
  border: 1px solid rgba(15,23,42,0.08);
  background: #f3f4f6;
  color: #111827;
  border-radius: 999px;
  min-height: 40px;
  min-width: 78px;
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.support-chat-send:disabled{
  opacity: 0.62;
  cursor: wait;
}

@media (max-width: 760px){
  .support-chat-root{
    right: 12px;
    left: auto;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
  }

  .support-chat-launcher{
    width: 50px;
    min-height: 50px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 14px 32px rgba(15,23,42,0.18);
  }

  .support-chat-panel{
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-height: 100dvh;
    height: min(100dvh, 100%);
    padding: max(0.75rem, env(safe-area-inset-top, 0px)) 0.75rem calc(env(safe-area-inset-bottom, 0px) + 0.75rem);
    border-radius: 28px 28px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    gap: 0.65rem;
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
    transform: translateY(24px);
    box-shadow: 0 -18px 50px rgba(15,23,42,0.24);
    background:
      linear-gradient(180deg, rgba(255,255,255,0.995), rgba(248,250,252,0.985));
  }

  .support-chat-handle{
    display: block;
  }

  .support-chat-head{
    align-items: center;
    gap: 0.7rem;
  }

  .support-chat-head-brand{
    min-width: 0;
    align-items: center;
  }

  .support-chat-head-brand > div{
    min-width: 0;
  }

  .support-chat-title{
    font-size: 1rem;
  }

  .support-chat-subtitle{
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .support-chat-head-actions{
    gap: 0.42rem;
  }

  .support-chat-status-pill{
    display: none;
  }

  .support-chat-action,
  .support-chat-close{
    min-height: 40px;
    height: 40px;
  }

  .support-chat-action{
    padding: 0 0.8rem;
    font-size: 0.8rem;
  }

  .support-chat-meta{
    flex-wrap: nowrap;
    gap: 0.45rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.1rem;
    scrollbar-width: none;
  }

  .support-chat-meta::-webkit-scrollbar{
    display: none;
  }

  .support-chat-page{
    flex: 0 0 auto;
    min-height: 28px;
    font-size: 0.7rem;
    white-space: nowrap;
  }

  .support-chat-body{
    gap: 0.4rem;
  }

  .support-chat-messages{
    min-height: 0;
    max-height: none;
    padding: 0.2rem 0;
    gap: 0.55rem;
  }

  .support-chat-message{
    max-width: min(84%, 21rem);
    padding: 0.72rem 0.84rem;
    border-radius: 18px;
  }

  .support-chat-message-system{
    max-width: 92%;
  }

  .support-chat-message p{
    font-size: 0.9rem;
    line-height: 1.42;
  }

  .support-chat-message-meta{
    margin-top: 0.38rem;
    font-size: 0.69rem;
  }

  .support-chat-suggestions{
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0 0.15rem;
    margin: 0 -0.1rem;
    scrollbar-width: none;
  }

  .support-chat-suggestions::-webkit-scrollbar{
    display: none;
  }

  .support-chat-chip{
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0.52rem 0.82rem;
    white-space: nowrap;
  }

  .support-chat-form{
    gap: 0.5rem;
    padding-top: 0.1rem;
  }

  .support-chat-label{
    display: none;
  }

  .support-chat-input{
    min-height: 52px;
    max-height: 132px;
    border-radius: 20px;
    padding: 0.82rem 0.95rem;
    font-size: 16px;
    line-height: 1.35;
  }

  .support-chat-upload-row{
    justify-content: space-between;
    gap: 0.5rem;
  }

  .support-chat-upload{
    min-height: 36px;
    padding: 0 0.82rem;
  }

  .support-chat-file{
    max-width: 48%;
  }

  .support-chat-actions{
    align-items: stretch;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.65rem;
  }

  .support-chat-send{
    width: auto;
    min-width: 84px;
    min-height: 52px;
    padding: 0 1.05rem;
    align-self: end;
  }

  .support-chat-note{
    font-size: 0.68rem;
    line-height: 1.35;
    max-height: 3.7em;
    overflow: hidden;
  }
}

@media (max-width: 480px){
  .support-chat-root{
    right: 10px;
    left: auto;
  }

  .support-chat-panel{
    padding-left: 0.68rem;
    padding-right: 0.68rem;
  }

  .support-chat-avatar,
  .support-chat-launcher-mark{
    width: 38px;
    height: 38px;
  }

  .support-chat-message{
    max-width: 88%;
  }

  .support-chat-actions{
    grid-template-columns: 1fr;
  }

  .support-chat-send{
    width: 100%;
  }

  .support-chat-file{
    max-width: 100%;
  }
}




