/* Square UI Dashboard 2 tokens (shadcn + Cliento accents). */

:root {
  --sh-bg: #fafafa;
  --sh-card: #ffffff;
  --sh-sidebar: #ffffff;
  --sh-fg: #171717;
  --sh-muted: #737373;
  --sh-border: #e5e5e5;
  --sh-hover: #f5f5f5;
  --sh-active: #f0f0f0;
  --sh-green: #059669;
  --sh-red: #dc2626;
  --sh-amber: #b45309;
  --sh-violet: #6e3ff3;
  --sh-pink: #e255f2;
  --sh-cyan: #35b9e9;
  --sh-blue: #375dfb;
  --sh-radius: 10px;
  --sh-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  --sh-grid: #f4f4f5;
  --sh-axis: #a1a1aa;
}

html.dark {
  --sh-bg: #0a0a0a;
  --sh-card: #171717;
  --sh-sidebar: #171717;
  --sh-fg: #fafafa;
  --sh-muted: #a3a3a3;
  --sh-border: rgba(255, 255, 255, 0.1);
  --sh-hover: rgba(255, 255, 255, 0.05);
  --sh-active: rgba(255, 255, 255, 0.08);
  --sh-green: #34d399;
  --sh-red: #f87171;
  --sh-amber: #fbbf24;
  --sh-grid: #27272a;
  --sh-axis: #71717a;
  --sh-shadow: none;
}

* { box-sizing: border-box; }

.sh-body {
  margin: 0;
  background: var(--sh-bg);
  color: var(--sh-fg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.sh-app {
  display: flex;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
}

.sh-i {
  width: 18px; height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* ---- Sidebar ---- */
.sh-sidebar {
  width: 248px;
  flex-shrink: 0;
  background: var(--sh-sidebar);
  border-right: 1px solid var(--sh-border);
  padding: 22px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 20;
}

.sh-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 4px 10px;
  text-decoration: none;
  color: inherit;
}
.sh-logo__img {
  width: 200px;
  height: auto;
  display: block;
  object-fit: contain;
}
.sh-logo:hover .sh-logo__img { opacity: 0.92; }

.sh-nav { display: flex; flex-direction: column; gap: 2px; }

.sh-nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  min-height: 38px;
  border-radius: 8px;
  color: var(--sh-muted);
  text-decoration: none;
  font-weight: 500;
}
button.sh-nav__item {
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.sh-nav__item:hover { background: var(--sh-hover); color: var(--sh-fg); }
.sh-nav__item.is-active { background: var(--sh-active); color: var(--sh-fg); }
.sh-nav__item.is-active .sh-i:last-child { margin-left: auto; opacity: 0.5; }
.sh-nav__item--sub { padding-left: 36px; font-size: 13px; }

.sh-nav-group { border: 0; }
.sh-nav-group summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  min-height: 38px;
  border-radius: 8px;
  color: var(--sh-muted);
  cursor: pointer;
  font-weight: 500;
  list-style: none;
}
.sh-nav-group summary::-webkit-details-marker { display: none; }
.sh-nav-group summary:hover { background: var(--sh-hover); color: var(--sh-fg); }

.sh-badge {
  margin-left: auto;
  background: rgba(110, 63, 243, 0.12);
  color: var(--sh-violet);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
}

.sh-sidebar__bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-top: 1px solid var(--sh-border);
  padding-top: 10px;
}
.sh-sidebar__user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 2px 8px;
}
.sh-account {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  color: var(--sh-fg);
  text-decoration: none;
  font-size: 13px;
  font-weight: 550;
  padding: 6px 10px;
  border: 1px solid var(--sh-border);
  border-radius: 8px;
}
.sh-account:hover { background: var(--sh-hover); }
.sh-account .sh-i { width: 16px; height: 16px; }

/* The desktop sidebar stays in the existing flex layout. On mobile the
   same navigation opens over the full-width page and traps focus in JS. */
.sh-mobile-bar, .sh-sidebar .sh-sidebar-close, .sh-nav-overlay { display: none; }

@media (max-width: 860px) {
  .sh-app { height: 100dvh; }
  .sh-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(288px, calc(100vw - 56px));
    height: 100dvh;
    z-index: 50;
    transform: translateX(-100%);
    visibility: hidden;
    pointer-events: none;
  }
  .sh-menu-open .sh-sidebar {
    transform: none;
    visibility: visible;
    pointer-events: auto;
  }
  .sh-sidebar .sh-sidebar-close { display: inline-flex; align-self: flex-end; }
  .sh-mobile-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 12px 16px;
    border-bottom: 1px solid var(--sh-border);
    background: var(--sh-card);
    flex-shrink: 0;
  }
  .sh-mobile-bar__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sh-menu-open .sh-nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    border: 0;
    background: rgba(0, 0, 0, .45);
    cursor: pointer;
  }
  .sh-menu-open .sh-main { overflow: hidden; }
  .sh-main [id] { scroll-margin-top: 76px; }
}

/* ---- Main ---- */
.sh-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.sh-search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--sh-border);
  border-radius: 8px;
  padding: 6px 10px;
  background: var(--sh-card);
  color: var(--sh-muted);
  min-width: 220px;
}
.sh-search input {
  border: none;
  outline: none;
  background: transparent;
  color: var(--sh-fg);
  font: inherit;
  width: 100%;
}
.sh-search--table { min-width: 160px; }

.sh-iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border: 1px solid var(--sh-border);
  border-radius: 8px;
  background: var(--sh-card);
  color: var(--sh-fg);
  cursor: pointer;
}
.sh-iconbtn:hover { background: var(--sh-hover); }

.sh-flash { padding: 20px 20px 0; display: flex; flex-direction: column; gap: 8px; }
.sh-flash__ok, .sh-flash__err {
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  border: 1px solid var(--sh-border);
}
.sh-flash__ok { background: rgba(5, 150, 105, 0.08); color: var(--sh-green); }
.sh-flash__err { background: rgba(220, 38, 38, 0.08); color: var(--sh-red); }

.sh-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}
.sh-content--chat {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.sh-content--chat .an-tabs,
.sh-content--chat .sh-welcome { flex-shrink: 0; }

.sh-welcome {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.sh-welcome h2 { margin: 0 0 6px; font-size: 22px; font-weight: 650; }
.sh-welcome__sub { margin: 0; color: var(--sh-muted); max-width: 640px; }
.sh-welcome__sub a { color: inherit; text-decoration: underline; }
.sh-welcome__actions { display: flex; gap: 8px; flex-wrap: wrap; overflow: visible; margin-left: auto; }
.sh-welcome__account { flex-shrink: 0; }

.sh-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border: 1px solid var(--sh-border);
  border-radius: 8px;
  background: var(--sh-card);
  color: var(--sh-fg);
  text-decoration: none;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
.sh-btn:hover { background: var(--sh-hover); }
.sh-btn--primary {
  background: var(--sh-fg);
  color: var(--sh-bg);
  border-color: var(--sh-fg);
}
.sh-btn--primary:hover { opacity: 0.9; background: var(--sh-fg); }
.sh-btn--tiny { padding: 4px 8px; font-size: 12px; }
.sh-btn--danger { color: var(--sh-red); }
.sh-btn--warn { color: var(--sh-amber); border-color: rgba(180, 83, 9, 0.3); }
.sh-btn--ok { color: var(--sh-green); border-color: rgba(5, 150, 105, 0.3); }
.sh-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.sh-kpis {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  background: var(--sh-card);
  border: 1px solid var(--sh-border);
  border-radius: 12px;
  box-shadow: var(--sh-shadow);
  padding: 8px 0;
}
.sh-kpi { padding: 16px 22px; }
.sh-kpi__rule { width: 1px; background: var(--sh-border); margin: 10px 0; }
.sh-kpi__label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--sh-muted);
  font-size: 13px;
  font-weight: 500;
}
.sh-kpi__label .sh-i { width: 16px; height: 16px; }
.sh-kpi__value { font-size: 28px; font-weight: 650; margin: 14px 0 10px; letter-spacing: -0.03em; line-height: 1; }
.sh-kpi__sub { font-size: 13px; font-weight: 500; }

.sh-up { color: var(--sh-green); }
.sh-down { color: var(--sh-red); }
.sh-muted { color: var(--sh-muted); }

.sh-card {
  background: var(--sh-card);
  border: 1px solid var(--sh-border);
  border-radius: 12px;
  box-shadow: var(--sh-shadow);
  display: flex;
  flex-direction: column;
}
.sh-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px 0;
}
.sh-card__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 550;
}
.sh-iconbox {
  width: 32px; height: 32px;
  border: 1px solid var(--sh-border);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sh-muted);
}
.sh-card__foot {
  padding: 10px 18px 14px;
  color: var(--sh-muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sh-count {
  background: var(--sh-active);
  border-radius: 20px;
  font-size: 11.5px;
  padding: 1px 8px;
  color: var(--sh-muted);
  font-weight: 600;
}

.sh-charts {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
}

.sh-donut-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 18px 8px;
}
.sh-donut { position: relative; width: 220px; height: 220px; flex-shrink: 0; }
.sh-donut canvas { display: block; width: 220px !important; height: 220px !important; }
.sh-donut__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  line-height: 1.2;
}
.sh-donut__center b { font-size: 20px; }
.sh-donut__center span { color: var(--sh-muted); font-size: 12px; }

.sh-card--bars { min-width: 0; }
.sh-chart-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--sh-muted);
  font-size: 12px;
}
.sh-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 2px;
}
.sh-dot--violet { background: #6e3ff3; }
.sh-dot--pink { background: #e255f2; }

.sh-bars-layout {
  display: flex;
  gap: 24px;
  padding: 16px 18px 18px;
  min-height: 240px;
}
.sh-bars-meta { width: 220px; flex-shrink: 0; }
.sh-bars-total { font-size: 28px; font-weight: 650; letter-spacing: -0.03em; }
.sh-bars-sub { color: var(--sh-muted); font-size: 13px; margin-top: 6px; }
.sh-callout {
  margin-top: 18px;
  background: var(--sh-hover);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}
.sh-callout span { color: var(--sh-muted); font-size: 12px; line-height: 1.45; }
.sh-callout__dots { display: flex; gap: 4px; margin-top: 6px; }
.sh-callout__dots i {
  flex: 1; height: 2px; border-radius: 2px;
  background: color-mix(in srgb, var(--sh-muted) 30%, transparent);
}
.sh-callout__dots i.is-on { background: var(--sh-fg); }
.sh-bars-canvas { flex: 1; min-width: 0; height: 240px; }

.sh-table-tools { display: flex; align-items: center; gap: 8px; }
.sh-card--table .sh-card__head { padding: 16px 18px; border-bottom: 1px solid var(--sh-border); flex-wrap: wrap; }
.sh-table-wrap { overflow-x: auto; }
.sh-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.sh-table th {
  text-align: left;
  color: var(--sh-muted);
  font-weight: 500;
  font-size: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--sh-border);
  background: var(--sh-bg);
  white-space: nowrap;
}
.sh-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--sh-border);
  white-space: nowrap;
}
.sh-table tbody tr:hover { background: var(--sh-hover); }
.sh-table a:not(.sh-btn) { color: inherit; text-decoration: none; }
.sh-table a:not(.sh-btn):hover { text-decoration: underline; }
.sh-dim { color: var(--sh-muted); }
.sh-mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; }
.sh-table td.sh-copy { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }

.sh-client { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 600; }
.sh-client:hover span:last-child { text-decoration: underline; }

.sh-avatar {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.sh-av-1 { background: #6e3ff3; }
.sh-av-2 { background: #35b9e9; }
.sh-av-3 { background: #e255f2; }
.sh-av-4 { background: #f59e0b; }
.sh-av-5 { background: #10b981; }

.sh-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 20px;
  padding: 2px 9px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid transparent;
}
.sh-pill-green { color: var(--sh-green); background: rgba(5, 150, 105, 0.1); border-color: rgba(5, 150, 105, 0.25); }
.sh-pill-red { color: var(--sh-red); background: rgba(220, 38, 38, 0.1); border-color: rgba(220, 38, 38, 0.25); }
.sh-pill-amber { color: var(--sh-amber); background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.3); }
.sh-pill-violet { color: var(--sh-violet); background: rgba(110, 63, 243, 0.1); border-color: rgba(110, 63, 243, 0.25); }

.sh-kpis--1 { grid-template-columns: 1fr; max-width: 360px; }
.sh-kpis--2 { grid-template-columns: 1fr auto 1fr; }
.sh-kpis--3 { grid-template-columns: 1fr auto 1fr auto 1fr; }
.sh-kpis--4 { grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; }
.sh-kpis--5 { grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr auto 1fr; }

.an-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.an-tabs a {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--sh-border);
  color: var(--sh-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
}
.an-tabs a:hover { background: var(--sh-hover); color: var(--sh-fg); }
.an-tabs a.is-active {
  background: var(--sh-fg);
  color: var(--sh-bg);
  border-color: var(--sh-fg);
}
.an-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.an-filters label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--sh-muted);
  font-size: 13px;
}
.an-filters select {
  border: 1px solid var(--sh-border);
  border-radius: 8px;
  background: var(--sh-card);
  color: var(--sh-fg);
  font: inherit;
  padding: 6px 8px;
}

.sh-calwrap { position: relative; display: inline-block; }
.sh-calbtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--sh-border);
  border-radius: 8px;
  background: var(--sh-card);
  color: var(--sh-fg);
  font: inherit;
  padding: 7px 12px;
  cursor: pointer;
}
.sh-calbtn:hover, .sh-calwrap.is-open .sh-calbtn { background: var(--sh-hover); }
.sh-calbtn .sh-i { width: 16px; height: 16px; color: var(--sh-muted); }
.sh-calpop {
  position: fixed;
  z-index: 50;
  background: var(--sh-card);
  border: 1px solid var(--sh-border);
  border-radius: 12px;
  box-shadow: var(--sh-shadow), 0 12px 40px rgba(0, 0, 0, 0.12);
  padding: 12px;
  min-width: 280px;
}
.sh-cal__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.sh-cal__navbtn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--sh-border);
  border-radius: 8px;
  background: transparent;
  color: var(--sh-fg);
  cursor: pointer;
}
.sh-cal__navbtn:hover { background: var(--sh-hover); }
.sh-cal__months { display: flex; gap: 18px; }
.sh-cal__caption { font-weight: 600; font-size: 13px; margin-bottom: 8px; text-align: center; }
.sh-cal__week, .sh-cal__days { display: grid; grid-template-columns: repeat(7, 32px); gap: 2px; }
.sh-cal__week span {
  text-align: center;
  font-size: 11px;
  color: var(--sh-muted);
  padding: 4px 0;
}
.sh-cal__day {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--sh-fg);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.sh-cal__day:hover:not(:disabled) { background: var(--sh-hover); }
.sh-cal__day.is-empty { visibility: hidden; }
.sh-cal__day.is-off, .sh-cal__day:disabled { color: var(--sh-muted); opacity: 0.4; cursor: default; }
.sh-cal__day.is-today { box-shadow: inset 0 0 0 1px var(--sh-violet); }
.sh-cal__day.is-mid { background: color-mix(in srgb, var(--sh-violet) 14%, transparent); border-radius: 0; }
.sh-cal__day.is-start, .sh-cal__day.is-end {
  background: var(--sh-violet);
  color: #fff;
}
.sh-cal__day.is-start { border-radius: 8px 0 0 8px; }
.sh-cal__day.is-end { border-radius: 0 8px 8px 0; }
.sh-cal__day.is-start.is-end { border-radius: 8px; }
.sh-cal__foot { display: flex; justify-content: flex-end; margin-top: 10px; }
.sh-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  list-style: none;
  margin: 0;
  padding: 0 16px 16px;
}
.sh-chart-legend li { display: flex; align-items: center; gap: 6px; color: var(--sh-muted); font-size: 12px; }
.sh-chart-legend i { width: 8px; height: 8px; border-radius: 99px; display: inline-block; }

@media (max-width: 719px) {
  .sh-cal__months.is-dual .sh-cal__month:last-child { display: none; }
}
.an-pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.an-pill {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--sh-border);
  color: var(--sh-muted);
  text-decoration: none;
  font-size: 12px;
}
.an-pill.is-on, .an-pill:hover { background: var(--sh-active); color: var(--sh-fg); }

.an-legacy .card {
  background: var(--sh-card);
  border: 1px solid var(--sh-border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}
.an-legacy .button {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--sh-border);
  background: var(--sh-card);
  color: var(--sh-fg);
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}
.an-legacy .button:hover { background: var(--sh-hover); }
.an-legacy .section__header { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: flex-start; }
.an-legacy .section__header h2 { margin: 0 0 6px; }
.an-legacy .data-table { width: 100%; border-collapse: collapse; }
.an-legacy .muted, .an-legacy .at-help { color: var(--sh-muted); }
.an-legacy h3 { margin: 0 0 10px; font-size: 15px; }

.sh-empty { margin: 0; padding: 28px 18px; color: var(--sh-muted); }
.sh-copy { cursor: pointer; border-radius: 4px; }
.sh-copy:hover { background: var(--sh-hover); }
.sh-copy.is-copied { background: rgba(5, 150, 105, 0.18); }

.wd-actions { flex-direction: column; align-items: stretch; }
.wd-client-tools {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-top: 6px;
}
.wd-expand.sh-btn .sh-i { width: 14px; height: 14px; }
.wd-expand[aria-expanded="true"] { background: var(--sh-active); }
.wd-claimed-badge {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--sh-amber);
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 4px;
  padding: 1px 6px;
}
tbody.wd-claimed > tr:first-child { background: rgba(245, 158, 11, 0.08); }
.wd-ctx-row td { background: var(--sh-bg); padding: 12px 14px 16px; }
.wd-ctx__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.wd-ctx__stat {
  background: var(--sh-card);
  border: 1px solid var(--sh-border);
  border-radius: 8px;
  padding: 10px 12px;
}
.wd-ctx__label { font-size: 11px; color: var(--sh-muted); margin-bottom: 4px; }
.wd-ctx__value { font-size: 15px; font-weight: 700; white-space: nowrap; }
.wd-ctx__history-title { font-size: 12px; font-weight: 700; margin: 4px 0 8px; }
.wd-note { margin: 0 0 10px; font-size: 12px; }
.wd-ctx__history {
  display: flex;
  flex-direction: column;
  background: var(--sh-card);
  border: 1px solid var(--sh-border);
  border-radius: 8px;
  overflow: hidden;
}
.wd-ctx__hrow {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 1.2fr 0.9fr 1.4fr 1fr;
  gap: 8px;
  padding: 7px 10px;
  align-items: center;
  border-top: 1px solid var(--sh-border);
  font-size: 12px;
}
.wd-ctx__hrow--head {
  border-top: 0;
  background: var(--sh-hover);
  font-weight: 600;
  color: var(--sh-muted);
  font-size: 11px;
}
@media (max-width: 1100px) {
  .wd-ctx__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sh-kpis--2, .sh-kpis--3 { grid-template-columns: 1fr; }
  .sh-kpis--2 .sh-kpi__rule, .sh-kpis--3 .sh-kpi__rule { display: none; }
}

.sh-row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.sh-modal__dialog--wide { width: min(720px, 100%); }
.dir-badge { font-size: 18px; line-height: 1; }
.dir-badge-input { max-width: 140px; }
.dir-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dir-sync__tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dir-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--sh-border);
  border-radius: 8px;
  background: var(--sh-bg);
}
.dir-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--sh-border);
  border-radius: 8px;
  background: var(--sh-card);
  font-size: 13px;
  cursor: pointer;
}
.dir-check:hover { background: var(--sh-hover); }

.sh-select {
  border: 1px solid var(--sh-border);
  border-radius: 8px;
  background: var(--sh-card);
  color: var(--sh-fg);
  font: inherit;
  padding: 6px 10px;
}

.sh-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--sh-border);
}
.sh-pager__size { color: var(--sh-muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.sh-pager__btns { display: flex; gap: 4px; flex-wrap: wrap; }
.sh-pager__btns button {
  min-width: 32px; height: 32px;
  border: 1px solid var(--sh-border);
  border-radius: 8px;
  background: var(--sh-card);
  color: var(--sh-fg);
  cursor: pointer;
}
.sh-pager__btns button.is-on,
.sh-pager__btns .sh-btn.is-on {
  background: var(--sh-fg);
  color: var(--sh-bg);
  border-color: var(--sh-fg);
  cursor: default;
  pointer-events: none;
}
.sh-pager__btns button:disabled { opacity: 0.4; cursor: default; }

.sh-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 40;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.sh-modal.is-open { display: flex; }
.sh-modal__dialog {
  background: var(--sh-card);
  border: 1px solid var(--sh-border);
  border-radius: 12px;
  width: min(520px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 20px;
}
.sh-form { display: flex; flex-direction: column; gap: 12px; }
.sh-form h3 { margin: 0 0 4px; }
.sh-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--sh-muted); }
.sh-form input, .sh-form textarea, .sh-form select {
  border: 1px solid var(--sh-border);
  border-radius: 8px;
  background: var(--sh-bg);
  color: var(--sh-fg);
  font: inherit;
  padding: 8px 10px;
}
.sh-modal__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

@media (max-width: 1100px) {
  .sh-charts { grid-template-columns: 1fr; }
  .sh-kpis, .sh-kpis--4, .sh-kpis--5 { grid-template-columns: 1fr 1fr; }
  .sh-kpi__rule { display: none; }
  .sh-bars-layout { flex-direction: column; }
  .sh-bars-meta { width: auto; }
}

.ex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.ex-tile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--sh-card);
  border: 1px solid var(--sh-border);
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  box-shadow: var(--sh-shadow);
}
.ex-tile:hover { background: var(--sh-hover); }
.ex-tile__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.ex-tile h3 { margin: 0 0 2px; font-size: 16px; }
.ex-tile__desc { margin: 0; font-size: 13px; min-height: 36px; }
.ex-tile__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 12px;
  color: var(--sh-muted);
}
.ex-tile__stats strong { color: var(--sh-fg); }
.ex-acc {
  background: var(--sh-card);
  border: 1px solid var(--sh-border);
  border-radius: 12px;
  padding: 0 16px 16px;
  margin-bottom: 12px;
}
.ex-acc > summary {
  cursor: pointer;
  font-weight: 650;
  padding: 14px 0;
  list-style: none;
}
.ex-acc > summary::-webkit-details-marker { display: none; }
.ex-acc > summary::after {
  content: "▾";
  float: right;
  color: var(--sh-muted);
}
.ex-acc:not([open]) > summary::after { content: "▸"; }
.ex-toolbar {
  padding: 14px 16px;
  margin-bottom: 12px;
}
.ex-toolbar__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 8px;
}
.ex-toolbar label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--sh-muted); }
.ex-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.ex-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.ex-fieldset {
  border: 1px solid var(--sh-border);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0;
}
.ex-fieldset legend { padding: 0 6px; font-weight: 650; }
.ex-check {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
}
.ex-matrix input[type="number"],
.ex-matrix input[type="time"],
.ex-matrix select { min-width: 0; width: 100%; }
.ex-shop-status { white-space: nowrap; }
form.inline { display: inline; }

@media (max-width: 860px) {
  .sh-search { min-width: 120px; }
  .sh-kpis { grid-template-columns: 1fr; }
}

.an-tabs .sh-badge { margin-left: 6px; }

.demo-creds { display: grid; gap: 2px; font-size: 12.5px; }
.demo-creds code { word-break: break-all; }
.demo-role { color: var(--sh-muted); font-size: 12px; }
.demo-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.demo-form-grid .form-row + .form-row { margin-top: 10px; }
.demo-form-grid label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--sh-muted); }
.demo-form-grid input[type="text"],
.demo-form-grid input[type="number"],
.demo-form-grid textarea {
  width: 100%;
  border: 1px solid var(--sh-border);
  border-radius: 8px;
  background: var(--sh-bg);
  color: var(--sh-fg);
  font: inherit;
  padding: 7px 10px;
}
.demo-form-2col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.demo-hr { margin: 16px 0; border: none; border-top: 1px solid var(--sh-border); }

.ds-form { display: flex; flex-direction: column; gap: 12px; }
.ds-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--sh-border);
  border-radius: 10px;
  background: var(--sh-bg);
  color: var(--sh-fg);
  cursor: pointer;
}
.ds-check input { margin: 3px 0 0; }
.ds-check strong { display: block; font-size: 14px; font-weight: 600; color: var(--sh-fg); }
.ds-check small { display: block; margin-top: 2px; color: var(--sh-muted); font-size: 12px; font-weight: 400; }
.ds-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}
.ds-grid label,
.ds-msgs label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  color: var(--sh-muted);
}
.ds-grid small { color: var(--sh-muted); font-weight: 400; font-size: 12px; }
.ds-form input[type="text"],
.ds-form input[type="number"],
.ds-form textarea,
.ds-broadcast textarea {
  width: 100%;
  border: 1px solid var(--sh-border);
  border-radius: 8px;
  background: var(--sh-bg);
  color: var(--sh-fg);
  font: inherit;
  padding: 8px 10px;
}
.ds-form input.ds-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.ds-msgs { display: flex; flex-direction: column; gap: 12px; }
.ds-form textarea,
.ds-broadcast textarea { min-height: 88px; resize: vertical; line-height: 1.45; }
.ds-hint { margin: 0; font-size: 13px; color: var(--sh-muted); }
.ds-actions { display: flex; gap: 8px; align-items: center; }
.ds-broadcast { display: flex; flex-direction: column; gap: 12px; }

@media (max-width: 860px) {
  .demo-form-grid, .demo-form-2col, .ds-grid { grid-template-columns: 1fr; }
}

/* ---- BitLaunch ---- */
.bl-hidden { display: none !important; }
.bl-toast {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 60;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
  transform: translateX(120%);
  transition: transform 0.3s ease;
  max-width: 400px;
}
.bl-toast--visible { display: block !important; transform: translateX(0); }
.bl-toast--success {
  background: rgba(5, 150, 105, 0.12);
  color: var(--sh-green);
  border: 1px solid rgba(5, 150, 105, 0.3);
}
.bl-toast--danger {
  background: rgba(220, 38, 38, 0.1);
  color: var(--sh-red);
  border: 1px solid rgba(220, 38, 38, 0.3);
}
.bl-payments-pending {
  display: grid;
  gap: 12px;
  padding: 0 16px 16px;
}
.bl-payment-card {
  padding: 16px;
  border: 1px solid var(--sh-border);
  border-radius: 12px;
  background: var(--sh-bg);
}
.bl-payment-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.bl-payment-card__body { display: grid; gap: 10px; }
.bl-payment-card__amount {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.bl-payment-card__usd { font-size: 22px; font-weight: 650; letter-spacing: -0.03em; }
.bl-payment-card__crypto { font-size: 15px; font-weight: 600; color: var(--sh-blue); }
.bl-payment-card__link-wrap {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--sh-hover);
  overflow-x: auto;
}
.bl-payment-link {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12.5px;
  word-break: break-all;
  color: var(--sh-blue);
  text-decoration: none;
  font-weight: 600;
}
.bl-payment-link:hover { text-decoration: underline; }
.bl-payment-card__address {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.bl-address-code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  background: var(--sh-hover);
  padding: 2px 6px;
  border-radius: 6px;
  word-break: break-all;
}
.bl-qr-img {
  max-width: 180px;
  border-radius: 8px;
  border: 1px solid var(--sh-border);
}
.bl-payment-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--sh-border);
}
.bl-payment-result {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(5, 150, 105, 0.08);
  border: 1px solid rgba(5, 150, 105, 0.25);
}
.bl-mass-summary {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 12px;
  background: var(--sh-hover);
  border-radius: 10px;
}
.bl-electrum-block {
  margin-top: 16px;
  border: 1px solid var(--sh-border);
  border-radius: 12px;
  overflow: hidden;
}
.bl-electrum-block__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--sh-hover);
}
.bl-electrum-text {
  margin: 0;
  padding: 12px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12.5px;
  background: #0f172a;
  color: #e2e8f0;
  overflow-x: auto;
  white-space: pre;
  line-height: 1.6;
}
.bl-progress-text { padding: 4px 0; color: var(--sh-muted); font-weight: 600; }
.sh-table tr.is-locked { opacity: 0.55; }
.sh-table tr.is-overdue td { background: color-mix(in srgb, var(--sh-amber) 12%, transparent); }
.rent-card { display: flex; flex-direction: column; gap: 12px; }
.rent-card__hint { margin: 0; font-size: 13px; max-width: 640px; }
.rent-card__form {
  display: grid;
  grid-template-columns: 140px 240px auto;
  gap: 12px 16px;
  align-items: end;
}
.rent-card__form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  color: var(--sh-muted);
}
.rent-card__actions { display: flex; gap: 8px; }
.rent-card__extend { margin: 0; }
.rent-row-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.rent-row-actions form { margin: 0; }
.st-table-wrap { overflow-x: visible; }
.st-table--compact { table-layout: fixed; }
.st-table--compact th,
.st-table--compact td {
  padding: 8px 10px;
  white-space: normal;
  vertical-align: top;
}
.st-table--compact th:nth-child(1),
.st-table--compact td:nth-child(1) { width: 18%; }
.st-table--compact th:nth-child(2),
.st-table--compact td:nth-child(2) { width: 12%; }
.st-table--compact th:nth-child(3),
.st-table--compact td:nth-child(3) { width: 24%; }
.st-table--compact th:nth-child(4),
.st-table--compact td:nth-child(4) { width: 10%; }
.st-table--compact th:nth-child(5),
.st-table--compact td:nth-child(5) { width: 14%; }
.st-table--compact .st-actions-col {
  width: 22%;
  position: sticky;
  right: 0;
  background: var(--sh-card);
  box-shadow: -8px 0 8px -8px rgba(0, 0, 0, 0.12);
  white-space: nowrap;
}
.st-table--compact thead .st-actions-col { background: var(--sh-bg); }
.st-table--compact tbody tr:hover .st-actions-col { background: var(--sh-hover); }
.st-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
  align-items: center;
}
.st-actions form { margin: 0; }
.st-addr { font-size: 12.5px; word-break: break-word; }
.st-domain { margin-top: 2px; font-size: 12px; color: var(--sh-muted); }
.st-dates { font-size: 11.5px; line-height: 1.35; color: var(--sh-muted); }
.rent-edit-refresh { margin: 12px 0 0; }
@media (max-width: 860px) {
  .rent-card__form { grid-template-columns: 1fr; }
}
.sh-card--pad { padding: 16px 18px 18px; gap: 12px; }

.acc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.acc-2fa { grid-column: 1 / -1; }
.acc-meta { display: grid; gap: 10px; margin: 0; }
.acc-meta div { display: grid; gap: 2px; }
.acc-meta dt { font-size: 12px; color: var(--sh-muted); }
.acc-meta dd { margin: 0; }
.acc-enroll { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.acc-qr {
  width: 220px;
  height: 220px;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  box-sizing: border-box;
}
.acc-secret {
  display: block;
  margin-top: 6px;
  word-break: break-all;
  font-size: 13px;
}
@media (max-width: 860px) {
  .acc-grid { grid-template-columns: 1fr; }
}

.cl-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.cl-wide { grid-column: 1 / -1; }
.cl-cmd {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.25;
  white-space: normal;
}
.cl-cmd__name { font-weight: 500; }
.cl-cmd__code {
  font-size: 11.5px;
  color: var(--sh-muted);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.cl-code {
  display: inline-block;
  max-width: 100%;
  word-break: break-all;
  cursor: pointer;
  font-size: 13px;
}
.cl-code:hover { color: var(--sh-violet); }
pre.code {
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: var(--sh-bg);
  border: 1px solid var(--sh-border);
  overflow: auto;
  font-size: 12px;
  line-height: 1.45;
}
.cl-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--sh-border);
}
.cl-toggle:first-of-type { border-top: 0; padding-top: 0; }
.cl-toggle p { margin: 0; font-size: 13px; color: var(--sh-muted); }
.cl-toggle strong { display: block; color: var(--sh-fg); margin-bottom: 2px; }
@media (max-width: 860px) {
  .cl-grid { grid-template-columns: 1fr; }
}

.rv-table { table-layout: fixed; width: 100%; }
.rv-table col.rv-col-stars { width: 40px; }
.rv-table col.rv-col-nick { width: 112px; }
.rv-table col.rv-col-text { width: auto; }
.rv-table col.rv-col-actions { width: 108px; }
.rv-table th,
.rv-table td { padding: 6px 8px; }
.rv-table td.rv-stars { color: var(--sh-muted); font-variant-numeric: tabular-nums; }
.rv-table td.rv-nick,
.rv-table td.rv-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rv-table td.rv-text { color: var(--sh-muted); }
.rv-table td.rv-actions { white-space: nowrap; }
.rv-table td.rv-actions form { display: inline; }

.nl-table { table-layout: fixed; width: 100%; }
.nl-table th:nth-child(1), .nl-table td:nth-child(1) { width: 52px; }
.nl-table th:nth-child(3), .nl-table td:nth-child(3) { width: 132px; }
.nl-table th:nth-child(4), .nl-table td:nth-child(4) { width: 128px; }
.nl-table th:nth-child(5), .nl-table td:nth-child(5) { width: 228px; }
.nl-table td.nl-preview {
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wr-spots__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.wr-spots__item {
  border: 1px solid var(--sh-border);
  border-radius: 10px;
  padding: 14px 16px;
  min-width: 0;
}
.wr-spots__form {
  display: flex;
  align-items: end;
  gap: 10px;
  margin: 0 0 14px;
}
.wr-spots__form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--sh-muted);
}
.wr-spots__form input {
  width: 88px;
  border: 1px solid var(--sh-border);
  border-radius: 8px;
  background: var(--sh-card);
  color: var(--sh-fg);
  padding: 8px 10px;
  font-size: 16px;
}
.wr-spots__label {
  color: var(--sh-muted);
  font-size: 13px;
  font-weight: 600;
}
.wr-spots__value {
  margin-top: 8px;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.wr-spots__meta {
  margin-top: 6px;
  color: var(--sh-muted);
  font-size: 12px;
}
.wr-spots__ladder {
  list-style: none;
  margin: 10px 0 0;
  padding: 8px 0 0;
  border-top: 1px solid var(--sh-border);
  font-size: 12px;
  line-height: 1.45;
  color: var(--sh-muted);
  font-variant-numeric: tabular-nums;
}
.wr-spots__ladder li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.wr-spots__ladder li span:first-child {
  flex-shrink: 0;
}
.wr-spots__ladder li span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
}
.wr-spots__ladder .is-chosen {
  color: var(--sh-fg);
  font-weight: 650;
}
.wr-defaults__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
.wr-defaults__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--sh-fg);
}
.wr-th-sub {
  display: block;
  font-weight: 400;
  color: var(--sh-muted);
  font-size: 11px;
  margin-top: 2px;
}
.wr-table td.wr-compact { white-space: nowrap; }
.wr-client-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  font-size: 12px;
}
.wr-actions { text-align: right; width: 1%; }
.wr-modal-actions { flex-wrap: wrap; }
@media (max-width: 1100px) {
  .wr-defaults__grid { grid-template-columns: 1fr; }
  .wr-spots__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .wr-spots__grid { grid-template-columns: 1fr; }
}
.sh-input {
  border: 1px solid var(--sh-border);
  border-radius: 8px;
  background: var(--sh-card);
  color: var(--sh-fg);
  font: inherit;
  padding: 7px 10px;
}
.sh-callout-ok { border-left: 4px solid var(--sh-green); }
.client-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  max-height: 220px;
  overflow: auto;
  padding: 4px 0;
}
.sh-table tfoot td {
  padding: 11px 14px;
  border-top: 1px solid var(--sh-border);
  font-weight: 650;
}

.nl-editor {
  background: #fff;
  color: #171717;
  border: 1px solid var(--sh-border);
  border-radius: 8px;
  overflow: hidden;
}
.nl-editor .ql-toolbar.ql-snow { border: none; border-bottom: 1px solid #e5e5e5; }
.nl-editor .ql-container.ql-snow { border: none; min-height: 160px; font-size: 14px; }

/* WYSIWYG parity with the shop panel (.newsletter-content in panel.css):
   the author sees the same spacing, dividers and callouts the operators
   will. Keep both blocks in sync when changing one. */
.nl-editor .ql-editor {
  padding: 18px 22px;
  font-size: 14px;
  line-height: 1.65;
  color: #334155;
  max-width: none;
}
.nl-editor .ql-editor > :first-child { margin-top: 0 !important; }
.nl-editor .ql-editor h1,
.nl-editor .ql-editor h2,
.nl-editor .ql-editor h3,
.nl-editor .ql-editor h4 {
  color: #0f172a;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.nl-editor .ql-editor h1 { font-size: 22px; margin: 0 0 12px; }
.nl-editor .ql-editor h2 { font-size: 19px; margin: 0 0 10px; }
.nl-editor .ql-editor h3 {
  font-size: 15px;
  margin: 26px 0 8px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}
.nl-editor .ql-editor h2 + h3,
.nl-editor .ql-editor h1 + h3,
.nl-editor .ql-editor hr + h3 { margin-top: 12px; padding-top: 0; border-top: none; }
.nl-editor .ql-editor h4 { font-size: 14px; margin: 18px 0 6px; }
.nl-editor .ql-editor p { margin: 0 0 10px; }
.nl-editor .ql-editor h2 + p > em:only-child,
.nl-editor .ql-editor h1 + p > em:only-child { color: #64748b; }
.nl-editor .ql-editor ul,
.nl-editor .ql-editor ol { margin: 0 0 12px; padding-left: 22px; }
.nl-editor .ql-editor li { margin: 0 0 5px; padding-left: 2px; }
.nl-editor .ql-editor li::marker,
.nl-editor .ql-editor li > .ql-ui::before { color: #6366f1; }
.nl-editor .ql-editor blockquote {
  margin: 12px 0 14px;
  padding: 10px 14px;
  border-left: 3px solid #6366f1;
  border-radius: 0 8px 8px 0;
  background: rgba(99, 102, 241, 0.07);
  color: #1e293b;
  font-size: 13.5px;
}
.nl-editor .ql-editor blockquote + blockquote { margin-top: -14px; padding-top: 0; border-top-right-radius: 0; }
.nl-editor .ql-editor hr { border: 0; border-top: 1px solid #e2e8f0; margin: 18px 0; }
.nl-editor .ql-editor strong { font-weight: 650; color: #0f172a; }
.nl-editor .ql-editor a { color: #4f46e5; text-decoration: underline; text-underline-offset: 2px; }
.nl-editor .ql-editor code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  padding: 1px 5px;
  border-radius: 5px;
  background: #f1f5f9;
}
.nl-editor .ql-editor.ql-blank::before { left: 22px; color: #94a3b8; font-style: normal; }

.addv-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}
.addv-toolbar { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.addv-toolbar button {
  background: var(--sh-hover);
  border: 1px solid var(--sh-border);
  color: var(--sh-fg);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 13px;
  cursor: pointer;
  line-height: 1.4;
}
.addv-toolbar button:hover { background: var(--sh-active); }
.addv-toolbar .sep { width: 1px; background: var(--sh-border); margin: 2px 4px; }
.addv-macros { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.addv-macros button {
  background: transparent;
  border: 1px dashed var(--sh-border);
  color: var(--sh-muted);
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 12px;
  cursor: pointer;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.addv-macros button:hover { color: var(--sh-fg); border-color: var(--sh-muted); }
.addv-url-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }
#addv-text {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  white-space: pre-wrap;
  min-height: 180px;
}

.tg-preview { position: sticky; top: 16px; }
.tg-chat {
  background: #0e1621;
  border-radius: 12px;
  padding: 16px 12px;
  border: 1px solid #1c2733;
}
.tg-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px 12px;
  border-bottom: 1px solid #1c2733;
  margin-bottom: 12px;
}
.tg-head .ava {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #6e3ff3, #35b9e9);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
}
.tg-head .t { font-size: 13px; color: #fff; font-weight: 600; }
.tg-head .s { font-size: 11px; color: #6c7883; }
.tg-bubble {
  background: #182533;
  color: #f1f1f1;
  border-radius: 12px 12px 12px 4px;
  padding: 10px 12px;
  max-width: 100%;
  font-size: 13.5px;
  line-height: 1.45;
  word-wrap: break-word;
}
.tg-bubble h4 { margin: 0 0 8px; font-size: 14.5px; color: #fff; }
.tg-bubble p { margin: 0 0 8px; }
.tg-bubble p:last-child { margin-bottom: 0; }
.tg-bubble a { color: #6ab3f3; text-decoration: none; }
.tg-bubble code { background: #0e1621; border-radius: 4px; padding: 1px 5px; font-size: 12.5px; color: #e5c07b; }
.tg-bubble blockquote {
  border-left: 3px solid #6ab3f3;
  margin: 6px 0;
  padding: 2px 8px;
  color: #c8d1d9;
  background: rgba(106, 179, 243, 0.07);
  border-radius: 0 6px 6px 0;
}
.tg-spoiler { background: #3a4048; color: transparent; border-radius: 3px; cursor: pointer; }
.tg-spoiler:hover { background: transparent; color: inherit; }
.tg-kb { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.tg-kb .kb-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-align: center;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
}
.tg-kb .kb-btn.success { background: rgba(64, 178, 110, 0.35); }
.tg-kb .kb-btn.muted-btn { background: rgba(255, 255, 255, 0.06); color: #9aa4ae; }
.tg-menu-chip { margin-top: 14px; padding-top: 10px; border-top: 1px dashed #1c2733; font-size: 11px; color: #6c7883; }
.tg-menu-chip .chip {
  display: inline-block;
  background: #2b5278;
  color: #fff;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  margin-top: 6px;
}

.st-layout {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.4fr);
  gap: 12px;
  min-height: 520px;
}
.st-list { overflow: auto; max-height: 70vh; }
.st-list__toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--sh-border);
  flex-shrink: 0;
}
.st-list__toolbar .sh-search { flex: 1; min-width: 0; }
.st-list__body { flex: 1; min-height: 0; overflow-y: auto; }
.st-item {
  display: block;
  padding: 12px 14px;
  border-bottom: 1px solid var(--sh-border);
  text-decoration: none;
  color: inherit;
}
.st-item:hover { background: var(--sh-hover); }
.st-item.is-active { background: var(--sh-active); }
.st-item__top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.st-layout--live .st-item__top + div {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.st-thread { display: flex; flex-direction: column; min-height: 520px; }
.st-thread__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--sh-border);
  flex-shrink: 0;
}
.st-thread__head h3 { margin: 0; font-size: 16px; }
.st-msgs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  max-height: 420px;
  overflow: auto;
  padding: 12px 16px;
  min-height: 0;
}
.st-msg {
  align-self: flex-start;
  max-width: 90%;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--sh-hover);
}
.st-msg--out { align-self: flex-end; background: rgba(55, 93, 251, 0.12); }
.st-msg__body { white-space: pre-wrap; word-break: break-word; }
.st-reply {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--sh-border);
  flex-shrink: 0;
}
.st-reply textarea { width: 100%; min-height: 72px; max-height: 140px; resize: vertical; }
.st-wrap { white-space: pre-wrap; max-width: 520px; }
.sr-answer summary { cursor: pointer; color: var(--sh-muted); }

.st-layout--live {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  overflow: hidden;
}
.st-layout--live .st-list,
.st-layout--live .st-thread {
  min-height: 0;
  max-height: 100%;
  height: auto;
  overflow: hidden;
}
.st-layout--live .st-list { display: flex; flex-direction: column; }
.st-layout--live .st-msgs { max-height: none; }

/* ---- Login ---- */
.sh-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
  position: relative;
  background:
    radial-gradient(900px 420px at 50% -8%, rgba(110, 63, 243, 0.14), transparent 58%),
    var(--sh-bg);
}
html.dark .sh-login {
  background:
    radial-gradient(900px 420px at 50% -8%, rgba(110, 63, 243, 0.22), transparent 58%),
    var(--sh-bg);
}
.sh-login::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--sh-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--sh-border) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 42%, #000 10%, transparent 72%);
  opacity: 0.55;
  pointer-events: none;
}
.sh-login__theme {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 2;
}
.sh-login__stage {
  position: relative;
  z-index: 1;
  width: min(400px, 100%);
}
.sh-login__card {
  padding: 36px 32px 28px;
  text-align: center;
  box-shadow: 0 18px 50px rgba(17, 17, 17, 0.06);
}
html.dark .sh-login__card {
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}
.sh-login__mark {
  display: flex;
  justify-content: center;
  margin: 0 auto 20px;
}
.sh-login__mark .sh-logo__img {
  width: 260px;
  height: auto;
}
.sh-login__card h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.15;
}
.sh-login__sub {
  margin: 0;
  color: var(--sh-muted);
  font-size: 14px;
}
.sh-login__card .sh-flash__err {
  margin-top: 16px;
  text-align: left;
}
.sh-login__card .sh-form {
  text-align: left;
  margin-top: 22px;
}
.sh-login__card .sh-btn--primary {
  width: 100%;
  justify-content: center;
  padding: 10px 13px;
  margin-top: 4px;
}
.sh-login__alt {
  margin: 16px 0 0;
  font-size: 13px;
}
.sh-login__alt a {
  color: var(--sh-muted);
  text-decoration: none;
}
.sh-login__alt a:hover { color: var(--sh-fg); }

/* ---- New panels ---- */
.np-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}
.np-card {
  background: var(--sh-card);
  border: 1px solid var(--sh-border);
  border-radius: var(--sh-radius);
  box-shadow: var(--sh-shadow);
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.np-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.np-card__head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
}
.np-card__head p { margin: 4px 0 0; font-size: 12px; }
.np-checks {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
.np-check {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  border: 1px solid var(--sh-border);
}
.np-check strong { font-weight: 600; }
.np-check span { color: var(--sh-muted); }
.np-check.is-on {
  border-color: rgba(5, 150, 105, 0.35);
  background: rgba(5, 150, 105, 0.08);
}
.np-check.is-off {
  border-color: rgba(180, 83, 9, 0.28);
  background: rgba(180, 83, 9, 0.06);
}
.np-handover {
  border: 1px solid var(--sh-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--sh-hover);
}
.np-handover__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--sh-muted);
}
.np-handover pre {
  margin: 0;
  padding: 10px 12px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
}
.np-fixes { display: flex; flex-direction: column; gap: 8px; }
.np-fix {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.np-fix select {
  flex: 1;
  min-width: 140px;
}
.np-more {
  color: var(--sh-muted);
  font-size: 13px;
  text-decoration: none;
}
.np-more:hover { color: var(--sh-fg); }
.np-sec { display: flex; flex-direction: column; gap: 10px; }
.np-sec h4 {
  margin: 0;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sh-muted);
}
.np-empty {
  align-items: flex-start;
  max-width: 520px;
}
.np-empty p { margin: 0; }
html.dark .np-check.is-on {
  border-color: rgba(5, 150, 105, 0.45);
  background: rgba(5, 150, 105, 0.12);
}
html.dark .np-check.is-off {
  border-color: rgba(180, 83, 9, 0.4);
  background: rgba(180, 83, 9, 0.1);
}

@media (max-width: 1100px) {
  .np-form__row { grid-template-columns: 1fr; }
  .np-wallet { flex-direction: column; align-items: stretch; }
  .addv-grid, .st-layout { grid-template-columns: 1fr; }
  .addv-url-row { grid-template-columns: 1fr; }
  .sh-content--chat { overflow: auto; }
  .st-layout--live {
    flex: none;
    min-height: 0;
  }
  .st-layout--live .st-list { max-height: 36vh; }
  .st-layout--live .st-thread { min-height: 52vh; }
  .st-layout--live .st-msgs { max-height: 42vh; }
}
