:root {
  --bg: #09090b;
  --panel: #111114;
  --card: #16161a;
  --elev: #1c1c22;
  --text: #f4f4f5;
  --muted: #9a9aa8;
  --line: #2a2a33;
  --blue: #3b82f6;
  --green: #22c55e;
  --orange: #f59e0b;
  --amber: #eab308;
  --teal: #14b8a6;
  --purple: #8b5cf6;
  --red: #ef4444;
  --brand: #ff6a00;
  --radius: 16px;
  --dock: 58px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --vw: 100vw;
  --vh: 100dvh;
  --app-h: 100dvh;
  --app-max-w: 100%;
  --dock-space: calc(var(--dock) + var(--safe-bottom) + 10px);
  font-family: "Manrope", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background:
    radial-gradient(120% 80% at 10% -10%, rgba(255,106,0,.14), transparent 55%),
    radial-gradient(90% 60% at 100% 0%, rgba(59,130,246,.10), transparent 50%),
    var(--bg);
  color: var(--text);
  height: var(--app-h);
  max-height: var(--app-h);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
body {
  padding-bottom: var(--dock-space);
}

#app {
  width: 100%;
  max-width: var(--app-max-w);
  margin: 0 auto;
  height: calc(var(--app-h) - var(--dock-space));
  max-height: calc(var(--app-h) - var(--dock-space));
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: max-width .15s ease;
}
body.wide-profiles #app {
  max-width: var(--app-max-w);
}

.screen {
  display: none;
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.screen.active { display: block; animation: in .16s ease; }
#tab-chats.active {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  max-height: 100%;
  padding-bottom: 0;
}
@keyframes in { from { opacity: .5; transform: translateY(6px);} to { opacity: 1; transform: none;} }

.screen-inner { padding: 16px 14px 20px; }
.screen-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px 10px;
  position: sticky; top: 0; z-index: 5;
  background: rgba(9,9,11,.88); backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(42,42,51,.65);
}
.screen-head h1 {
  flex: 1; margin: 0;
  font-size: 1.12rem; font-weight: 800;
  letter-spacing: -0.02em;
}
.screen-body { padding: 10px 14px 22px; }
.back, .icon {
  width: 36px; height: 36px; border: 0; border-radius: 12px;
  background: var(--elev); color: var(--text); font-size: 1rem; cursor: pointer;
  transition: background .12s ease, transform .1s ease;
}
.back:active, .icon:active { transform: scale(.96); }
.logs-btn {
  font-size: 0.72rem !important;
  font-weight: 750 !important;
  letter-spacing: 0.01em;
  width: auto !important;
  min-width: 44px;
  padding: 0 10px !important;
  white-space: nowrap;
}
.col-ico.logs-btn {
  width: auto !important;
  min-width: 40px;
  padding: 0 8px !important;
  font-size: 0.68rem !important;
}
.hero-actions { display: flex; align-items: center; gap: 8px; }
.col-head-actions { display: flex; align-items: center; gap: 4px; }
.logs-panel {
  max-height: min(94vh, 860px) !important;
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
}
.logs-panel .sheet-body.logs-body,
.logs-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 8px;
}
.logs-head-actions { display: flex; align-items: center; gap: 6px; }
.logs-status {
  margin: 0 0 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(59,130,246,.1);
  border: 1px solid rgba(59,130,246,.22);
  color: #93c5fd;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
  flex: 0 0 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.logs-status.busy {
  background: rgba(245,158,11,.12);
  border-color: rgba(245,158,11,.35);
  color: #fcd34d;
}
.logs-filter {
  margin: 0 0 6px;
  padding: 4px 8px 6px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  flex: 0 0 auto;
}
.logs-filter.collapsed .logs-filter-list { display: none; }
.logs-filter.collapsed .logs-filter-chev { transform: rotate(-90deg); }
.logs-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 0;
  font-size: 0.7rem;
  font-weight: 750;
  color: var(--muted);
}
.logs-filter:not(.collapsed) .logs-filter-head { margin-bottom: 4px; }
.logs-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 0;
  cursor: pointer;
}
.logs-filter-count {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  color: #93c5fd;
  font-size: 0.68rem;
}
.logs-filter-chev {
  display: inline-block;
  transition: transform .12s ease;
  font-size: 0.65rem;
}
.logs-filter-acts {
  display: flex;
  gap: 4px;
}
.logs-filter-acts .btn {
  padding: 2px 7px;
  font-size: 0.68rem;
  min-height: 24px;
}
.logs-filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 56px;
  overflow: auto;
}
.logs-fchip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px 2px 5px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #0e0e11;
  font-size: 0.68rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  max-width: 100%;
}
.logs-fchip input {
  width: 12px;
  height: 12px;
  min-width: 12px;
  max-width: 12px;
  padding: 0;
  accent-color: #3b82f6;
  flex: 0 0 auto;
}
.logs-fchip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}
.logs-fchip.off {
  opacity: 0.45;
}
.logs-feed {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  height: auto;
  overflow: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.log-line {
  padding: 4px 8px 4px 10px;
  border-radius: 6px;
  background: rgba(255,255,255,.03);
  border: 1px solid transparent;
  border-left: 3px solid rgba(148,163,184,.35);
  font-size: 0.72rem;
  line-height: 1.3;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
.log-line .lt {
  color: var(--muted);
  font-size: 0.62rem;
  margin-bottom: 1px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.log-line .llvl {
  display: inline-block;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 4px;
  line-height: 1.2;
}
.log-line .llvl.info { background: rgba(148,163,184,.18); color: #cbd5e1; }
.log-line .llvl.ok { background: rgba(34,197,94,.22); color: #86efac; }
.log-line .llvl.warn { background: rgba(245,158,11,.22); color: #fcd34d; }
.log-line .llvl.err { background: rgba(239,68,68,.28); color: #fca5a5; }
.log-line.info { border-left-color: rgba(148,163,184,.45); color: #d4d4d8; }
.log-line.ok {
  border-left-color: #22c55e;
  border-color: rgba(34,197,94,.22);
  background: rgba(22,101,52,.18);
  color: #bbf7d0;
}
.log-line.warn {
  border-left-color: #f59e0b;
  border-color: rgba(245,158,11,.28);
  background: rgba(120,53,15,.22);
  color: #fde68a;
}
.log-line.err {
  border-left-color: #ef4444;
  border-color: rgba(239,68,68,.35);
  background: rgba(127,29,29,.28);
  color: #fecaca;
  font-weight: 600;
}
.saved { color: var(--green); font-size: 0.8rem; font-weight: 700; }

/* Hero / menu */
.home-inner { padding-bottom: 28px; }
.menu-hero {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px; align-items: center;
  background:
    linear-gradient(135deg, rgba(255,106,0,.16), transparent 55%),
    var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 12px;
}
.avatar-lg {
  width: 64px; height: 48px; border-radius: 8px;
  background: #ff6a00;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.2rem;
  overflow: hidden;
  border: 1px solid rgba(255,106,0,.45);
  flex-shrink: 0;
}
.avatar-lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.hero-copy {
  text-align: center;
  min-width: 0;
}
.hero-name {
  font-weight: 800;
  font-size: 1.02rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.hero-sub {
  color: var(--muted);
  font-size: 0.76rem;
  margin-top: 3px;
  font-weight: 600;
}
.tag {
  font-size: 0.68rem; font-weight: 700;
  padding: 5px 9px; border-radius: 10px;
  background: var(--elev); color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.tag.run { background: rgba(34,197,94,.15); color: var(--green); }

.balance-card {
  background:
    linear-gradient(160deg, rgba(34,197,94,.12), transparent 60%),
    var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px 14px 12px;
  margin-bottom: 12px;
}
.bal-top {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 10px;
}
.bal-label { color: var(--muted); font-size: 0.72rem; font-weight: 650; }
.bal-amount {
  font-size: 1.85rem; font-weight: 800; letter-spacing: -0.03em; margin-top: 2px;
}
.bal-meta {
  margin-top: 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  color: var(--muted); font-size: 0.78rem;
}
.linkish {
  border: 0; background: transparent; color: #93c5fd;
  font-size: 0.78rem; font-weight: 700; cursor: pointer; padding: 0;
}

.menu-list { display: flex; flex-direction: column; gap: 7px; }
.menu-item {
  width: 100%;
  display: grid;
  grid-template-columns: 44px 1fr 18px;
  gap: 12px; align-items: center;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 16px;
  padding: 11px 12px;
  color: var(--text);
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.menu-item:hover { border-color: #3f3f4a; background: #18181e; }
.menu-item:active { transform: scale(.995); }
.mi {
  width: 44px; height: 44px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1rem;
}
.mi.blue { background: rgba(59,130,246,.18); color: #93c5fd; }
.mi.green { background: rgba(34,197,94,.16); color: #86efac; }
.mi.orange { background: rgba(245,158,11,.16); color: #fcd34d; }
.mi.amber { background: rgba(234,179,8,.16); color: #fde047; }
.mi.teal { background: rgba(20,184,166,.16); color: #5eead4; }
.mi.purple { background: rgba(139,92,246,.18); color: #c4b5fd; }
.mi.grey { background: #25252d; color: #d4d4d8; }
.mi-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mi-text b { font-size: 0.94rem; font-weight: 750; letter-spacing: -0.01em; }
.mi-text small { color: var(--muted); font-size: 0.72rem; }
.chev { color: #5c5c68; font-size: 1.15rem; }

.stats-mini {
  margin-top: 14px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
}
.home-stats { margin-top: 16px; }
.stats-mini div {
  background: rgba(22,22,26,.9); border: 1px solid var(--line);
  border-radius: 14px; padding: 10px 4px; text-align: center;
}
.stats-mini span { display: block; color: var(--muted); font-size: 0.6rem; font-weight: 650; letter-spacing: 0.02em; }
.stats-mini b { font-size: 1.02rem; font-weight: 800; margin-top: 2px; display: inline-block; }

/* Blocks / forms */
.block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px;
  margin-bottom: 10px;
}
.block-title { font-size: 0.76rem; font-weight: 750; margin-bottom: 8px; letter-spacing: 0.01em; }
.block-title.blue { color: #60a5fa; }
.block-title.green { color: #4ade80; }
.block-title.orange { color: #fbbf24; }
.block-title.grey { color: #a1a1aa; }
.block.actions { display: grid; gap: 8px; }
.work-actions-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
label {
  display: block; font-size: 0.72rem; color: var(--muted);
  margin: 8px 0 4px; font-weight: 650;
}
input, textarea, select {
  width: 100%;
  background: #0c0c10;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color .12s ease;
}
input:focus, textarea:focus, select:focus { border-color: #3b82f6aa; }
textarea { resize: vertical; font-family: "JetBrains Mono", ui-monospace, Consolas, monospace; font-size: 0.78rem; }
.field-hint { color: var(--muted); font-size: 0.72rem; margin: 6px 0 0; }
.row2, .toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.row2 > div { flex: 1; min-width: 0; }
.tb-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 4px; margin-left: 4px;
  border-radius: 999px; background: #d97706; color: #0b0b0d;
  font-size: 0.65rem; font-weight: 800; vertical-align: middle;
}
.tb-badge.hidden { display: none; }

/* Profiles toolbar ? pinned under header, list scrolls below */
.prof-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin: 0;
  padding: 10px 12px 12px;
  position: relative;
  z-index: 4;
  background:
    linear-gradient(180deg, rgba(18, 18, 22, 0.98) 0%, rgba(9, 9, 11, 0.96) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.prof-toolbar .tb-group {
  display: inline-flex;
  align-items: stretch;
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: visible;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.prof-toolbar .tb-btn {
  appearance: none;
  border: 0;
  margin: 0;
  background: transparent;
  color: #d4d4d8;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  padding: 8px 11px;
  cursor: pointer;
  line-height: 1.1;
  white-space: nowrap;
  border-right: 0;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
  transition: background .14s ease, color .14s ease, box-shadow .14s ease, transform .1s ease;
}
.prof-toolbar .tb-btn .tb-ico {
  font-size: 0.72rem;
  opacity: 0.85;
  line-height: 1;
  flex-shrink: 0;
}
.prof-toolbar .tb-btn .tb-lab {
  line-height: 1;
}
.prof-toolbar .tb-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.prof-toolbar .tb-btn:active {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(0.97);
}
.prof-toolbar .tb-btn.tb-run {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.12);
}
.prof-toolbar .tb-btn.tb-run:hover {
  background: rgba(34, 197, 94, 0.3);
  color: #bbf7d0;
}
.prof-toolbar .tb-btn.tb-danger { color: #fca5a5; }
.prof-toolbar .tb-btn.tb-danger:hover {
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
}
.prof-toolbar .tb-btn.tb-ghost {
  color: #a1a1aa;
  font-weight: 600;
}
.prof-toolbar .tb-btn.tb-accent {
  background: rgba(59, 130, 246, 0.16);
  color: #93c5fd;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.12);
}
.prof-toolbar .tb-btn.tb-accent:hover {
  background: rgba(59, 130, 246, 0.28);
  color: #bfdbfe;
}
.prof-toolbar .tb-btn.tb-soft { color: #fbbf24; }
.prof-toolbar .tb-btn.tb-soft:hover { background: rgba(245, 158, 11, 0.14); }
.prof-toolbar .tb-group.tb-select {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.05);
  box-shadow: none;
}
.prof-toolbar .tb-group.tb-select .tb-btn {
  padding: 8px 10px;
}

/* Hover / focus tooltips for profile actions */
.prof-toolbar .tb-btn[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  min-width: 140px;
  max-width: 220px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(24, 24, 28, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  color: #e4e4e7;
  font-size: 0.7rem;
  font-weight: 550;
  line-height: 1.35;
  letter-spacing: 0;
  white-space: normal;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  z-index: 80;
  transition: opacity .14s ease, transform .14s ease;
}
.prof-toolbar .tb-btn[data-tip]::before {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% + 2px);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: rgba(255, 255, 255, 0.12);
  opacity: 0;
  pointer-events: none;
  z-index: 81;
  transition: opacity .14s ease;
}
.prof-toolbar .tb-btn[data-tip]:hover::after,
.prof-toolbar .tb-btn[data-tip]:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.prof-toolbar .tb-btn[data-tip]:hover::before,
.prof-toolbar .tb-btn[data-tip]:focus-visible::before {
  opacity: 1;
}
@media (hover: none) {
  .prof-toolbar .tb-btn[data-tip]:focus-visible::after,
  .prof-toolbar .tb-btn[data-tip]:focus-visible::before {
    opacity: 1;
  }
}

.tb-group {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #121216;
}
.tb-btn {
  appearance: none;
  border: 0;
  margin: 0;
  background: transparent;
  color: #d4d4d8;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  padding: 9px 12px;
  cursor: pointer;
  line-height: 1.1;
  white-space: nowrap;
  border-right: 1px solid var(--line);
  transition: background .12s ease, color .12s ease;
}
.tb-btn:last-child { border-right: 0; }
.tb-btn:hover { background: rgba(255,255,255,.05); color: #fff; }
.tb-btn:active { background: rgba(255,255,255,.08); }
.tb-btn.tb-run {
  background: rgba(34,197,94,.16);
  color: #86efac;
}
.tb-btn.tb-run:hover { background: rgba(34,197,94,.26); color: #bbf7d0; }
.tb-btn.tb-danger { color: #fca5a5; }
.tb-btn.tb-danger:hover { background: rgba(239,68,68,.14); color: #fecaca; }
.tb-btn.tb-ghost {
  color: #a1a1aa;
  font-weight: 600;
}
.tb-btn.tb-accent {
  background: rgba(59,130,246,.14);
  color: #93c5fd;
}
.tb-btn.tb-accent:hover { background: rgba(59,130,246,.24); color: #bfdbfe; }
.tb-btn.tb-soft { color: #fbbf24; }
.tb-btn.tb-soft:hover { background: rgba(245,158,11,.12); }
.tb-group.tb-select {
  background: transparent;
  border-color: transparent;
}
.tb-group.tb-select .tb-btn {
  border-right: 0;
  padding: 9px 10px;
  border-radius: 10px;
}
.tb-group.tb-select .tb-btn:hover {
  background: rgba(255,255,255,.06);
}

/* Work tab ? product source (name / links) */
.product-source {
  width: 100%;
  margin: 6px 0 10px;
}
.product-source .tb-btn {
  flex: 1;
  text-align: center;
}
.product-source .tb-btn.active {
  background: rgba(59, 130, 246, 0.22);
  color: #93c5fd;
}
.btn.warn { background: rgba(245,158,11,.18); color: #fbbf24; border: 1px solid rgba(245,158,11,.35); }
.login-acc-row {
  padding: 10px 12px; border-radius: 12px;
  background: #15151a; border: 1px solid var(--line);
}
.login-acc-row .la-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
}
.login-acc-row .la-email { font-weight: 650; font-size: 0.88rem; word-break: break-all; }
.login-acc-row .la-meta { color: var(--muted); font-size: 0.72rem; margin-top: 4px; }
.login-acc-row .la-detail { margin-top: 6px; font-size: 0.78rem; color: #e5e7eb; line-height: 1.35; }
.login-acc-row.err { border-color: rgba(239,68,68,.4); }
.login-acc-row.run { border-color: rgba(245,158,11,.4); }
.row2 > * { flex: 1; min-width: 0; }

.btn {
  border: 0; background: var(--elev); color: var(--text);
  border-radius: 14px; padding: 12px 14px;
  font-weight: 700; font-size: 0.88rem; cursor: pointer;
}
.btn.sm { padding: 8px 10px; font-size: 0.78rem; border-radius: 12px; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.run { background: var(--green); color: #052e16; }
.btn.danger { background: rgba(239,68,68,.18); color: #fca5a5; }
.btn.link { background: transparent; color: var(--blue); }

.feed { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow: auto; }
.feed.compact { max-height: 30vh; }
.item {
  background: var(--elev);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
}
.item.plain { grid-template-columns: 40px 1fr; }
.item.plain.acc-row { grid-template-columns: 22px 40px 1fr auto; align-items: start; }
.item.plain.acc-row.selected {
  border-color: rgba(59,130,246,.55);
  background: rgba(59,130,246,.08);
}
.item.selected { border-color: var(--blue); }
.item .title { font-weight: 700; font-size: 0.88rem; }
.item .meta { color: var(--muted); font-size: 0.74rem; line-height: 1.35; }
.item .num { color: var(--blue); font-weight: 800; }
.item .email { color: var(--muted); font-size: 0.74rem; margin-left: 6px; }
.item .body { cursor: pointer; min-width: 0; }

/* Orders ? compact table list */
.orders-count-pill {
  margin-left: auto;
  margin-right: 4px;
  font-size: 0.72rem;
  font-weight: 750;
  color: #93c5fd;
  background: rgba(59,130,246,.16);
  border: 1px solid rgba(59,130,246,.3);
  border-radius: 999px;
  padding: 3px 9px;
  line-height: 1.2;
}
.orders-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.orders-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}
.orders-open-hint {
  font-size: 0.72rem;
  color: var(--muted);
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.orders-open-hint b { color: #93c5fd; font-weight: 700; }
.orders-open-hint.warn b { color: #fbbf24; }
.orders-tb-acts {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}
.orders-tb-acts .btn {
  padding: 6px 10px;
  font-size: 0.72rem;
  min-height: 32px;
}
.orders-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255,255,255,.02);
}
.orders-cols {
  display: grid;
  grid-template-columns: 64px minmax(70px, 0.9fr) minmax(90px, 1.4fr) minmax(70px, 0.9fr) minmax(72px, 0.9fr) 40px 96px;
  gap: 6px;
  padding: 6px 10px;
  font-size: 0.62rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: rgba(0,0,0,.25);
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.orders-cols span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#ordersList.orders-list,
.orders-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(62vh, 560px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.ord-row {
  display: grid;
  grid-template-columns: 64px minmax(70px, 0.9fr) minmax(90px, 1.4fr) minmax(70px, 0.9fr) minmax(72px, 0.9fr) 40px 96px;
  gap: 6px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  background: transparent;
  min-width: 0;
}
.ord-row:hover { background: rgba(59,130,246,.07); }
.ord-row:last-child { border-bottom: 0; }
.ord-row .c {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.74rem;
  line-height: 1.3;
  color: #e4e4e7;
}
.ord-row .c-amt {
  font-weight: 800;
  font-size: 0.8rem;
  color: #86efac;
  font-variant-numeric: tabular-nums;
}
.ord-row .c-st {
  font-size: 0.7rem;
  color: #fcd34d;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ord-row .c-prod {
  font-weight: 650;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.ord-row .c-seller { color: #a1a1aa; font-size: 0.7rem; }
.ord-row .c-prof { font-size: 0.7rem; color: #93c5fd; }
.ord-row .c-prof .sub {
  display: block;
  color: var(--muted);
  font-size: 0.62rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ord-row .c-br {
  text-align: center;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.ord-row .c-br.open { color: #86efac; }
.ord-row .c-br.closed { color: #71717a; }
.ord-row .c-acts {
  display: flex;
  flex-wrap: nowrap;
  gap: 3px;
  justify-content: flex-end;
  overflow: visible;
}
.ord-row .c-acts .btn,
.ord-row .c-acts a.btn {
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.78rem;
  flex: 0 0 auto;
  text-decoration: none;
}
.ord-empty {
  padding: 28px 14px;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}
.ord-empty b { color: #93c5fd; }

@media (max-width: 420px) {
  .orders-cols { display: none; }
  .ord-row {
    grid-template-columns: 1fr 1fr auto;
    grid-template-areas:
      "amt st br"
      "prod prod prod"
      "seller prof acts";
    gap: 4px 8px;
    padding: 10px 10px;
  }
  .ord-row .c-amt { grid-area: amt; }
  .ord-row .c-st { grid-area: st; }
  .ord-row .c-prod { grid-area: prod; }
  .ord-row .c-seller { grid-area: seller; }
  .ord-row .c-prof { grid-area: prof; }
  .ord-row .c-br { grid-area: br; text-align: right; }
  .ord-row .c-acts { grid-area: acts; }
}

/* Profiles ? compact cards */
#tab-profiles.active {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  max-height: 100%;
}
#tab-profiles .screen-head {
  flex-shrink: 0;
}
#tab-profiles .screen-body {
  padding: 8px 10px 16px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
#tab-profiles .feed {
  max-height: none;
  gap: 5px;
}
html[data-height="short"] #tab-profiles .feed,
html[data-height="tall"] #tab-profiles .feed {
  max-height: none;
}
.prof-card {
  grid-template-columns: 18px 1fr;
  gap: 6px;
  padding: 7px 9px !important;
  border-radius: 12px !important;
  align-items: start;
}
.prof-card .chk {
  width: 14px;
  height: 14px;
  margin-top: 3px;
  accent-color: var(--blue);
}
.prof-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}
.prof-top .title {
  font-size: 0.8rem;
  font-weight: 750;
  word-break: break-word;
  line-height: 1.25;
}
.prof-top .email {
  font-size: 0.68rem !important;
  margin-left: 4px !important;
}
.prof-top .pills {
  flex-shrink: 0;
  text-align: right;
  display: flex;
  flex-wrap: nowrap;
  gap: 3px;
  align-items: center;
  justify-content: flex-end;
}
.detach-one {
  padding: 0 6px !important;
  min-height: 20px;
  font-size: 0.68rem;
}
.prof-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
html[data-size="m"] .prof-grid,
html[data-size="l"] .prof-grid,
html[data-size="xl"] .prof-grid {
  grid-template-columns: 1fr 1fr auto;
}
.prof-cell {
  min-width: 0;
  background: rgba(0,0,0,.18);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 6px;
}
.prof-cell.wide { grid-column: 1 / -1; }
html[data-size="m"] .prof-cell.wide,
html[data-size="l"] .prof-cell.wide,
html[data-size="xl"] .prof-cell.wide {
  grid-column: auto;
}
.prof-cell .k {
  display: block;
  color: var(--muted);
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: 1px;
}
.prof-cell .v {
  display: block;
  font-size: 0.7rem;
  line-height: 1.25;
  word-break: break-word;
}
.prof-cell .v.mono {
  font-family: "JetBrains Mono", ui-monospace, Consolas, monospace;
  font-size: 0.66rem;
}
button.proxy-copy {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #93c5fd;
  text-align: left;
  cursor: pointer;
  border-radius: 4px;
  position: relative;
  padding-right: 1.1rem;
}
button.proxy-copy::after {
  content: "?";
  position: absolute;
  right: 0;
  top: 0;
  font-size: 0.62rem;
  opacity: .55;
  color: var(--muted);
}
button.proxy-copy:hover {
  color: #bfdbfe;
  text-decoration: underline;
  text-underline-offset: 2px;
}
button.proxy-copy:hover::after { opacity: 1; color: #93c5fd; }
button.proxy-copy.copied {
  color: var(--green);
}
button.proxy-copy.copied::after {
  content: "?";
  opacity: 1;
  color: var(--green);
}
.prof-proxy-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.prof-proxy-row .proxy-copy,
.prof-proxy-row .v.mono {
  flex: 1;
  min-width: 0;
  width: auto;
  text-align: left;
}
.prof-proxy-row .act-proxy-one {
  flex-shrink: 0;
  min-width: 32px;
  padding: 4px 8px;
}

.pill {
  display: inline-block; font-size: 0.58rem; font-weight: 700;
  padding: 1px 5px; border-radius: 6px; background: #2a2a32; margin-right: 0;
}
.pill.open { background: rgba(34,197,94,.16); color: var(--green); }
.pill.busy { background: rgba(59,130,246,.18); color: #93c5fd; }
.pill.ok { background: rgba(34,197,94,.16); color: #86efac; }
.pill.err { background: rgba(239,68,68,.16); color: #fca5a5; }
.prof-card.task-blocked { opacity: 0.92; }
.prof-card .act-pause-one,
.prof-card .act-resume-one,
.prof-card .act-start-one,
.prof-card .act-shot-one {
  width: 22px; height: 22px; min-width: 22px; padding: 0;
  border-radius: 6px; font-size: 0.62rem;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  background: #1a1a20;
  color: #d4d4d8;
}
.prof-card .act-start-one,
.prof-card .act-resume-one {
  color: #86efac;
  border-color: rgba(34,197,94,.28);
  background: rgba(34,197,94,.1);
}
.prof-card .act-pause-one {
  color: #fbbf24;
  border-color: rgba(245,158,11,.28);
  background: rgba(245,158,11,.1);
}
.prof-card .act-shot-one {
  font-size: 0.7rem;
  color: #93c5fd;
  border-color: rgba(96,165,250,.35);
  background: rgba(96,165,250,.12);
}
.prof-card .detach-one {
  width: 28px; height: 28px; min-width: 28px; padding: 0;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
}
.job-actions { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.q-stats {
  margin-top: 6px;
  font-size: 0.78rem;
  color: #d4d4d8;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.q-stats b { color: #86efac; font-weight: 750; }
.q-sep { color: var(--muted); }
.q-profs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.q-prof {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 8px;
  background: #1a1a20;
  border: 1px solid var(--line);
  font-size: 0.72rem;
  color: #e4e4e7;
  line-height: 1.2;
}
.q-prof.muted { color: var(--muted); border-style: dashed; }
.q-job .q-main { min-width: 0; }
.q-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 2px;
}
.q-head-row .title { flex: 1; min-width: 0; }
.q-expand {
  flex-shrink: 0;
  background: rgba(59,130,246,.14) !important;
  color: #93c5fd !important;
  border: 1px solid rgba(59,130,246,.28);
  font-size: 0.72rem !important;
  padding: 6px 10px !important;
}
.q-job.open { border-color: rgba(59,130,246,.35); }
.q-detail {
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  background: #0e0e12;
  border: 1px solid var(--line);
}
.q-detail.hidden { display: none; }
.q-dl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin-bottom: 10px;
}
.q-dl {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.78rem;
  color: #e4e4e7;
  min-width: 0;
}
.q-dl.wide { grid-column: 1 / -1; }
.q-dl .k {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.q-dl ul {
  margin: 4px 0 0;
  padding-left: 16px;
}
.q-prof-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.q-prof-card {
  padding: 10px;
  border-radius: 10px;
  background: #15151a;
  border: 1px solid var(--line);
}
.q-prof-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.q-prof-name { font-weight: 700; font-size: 0.88rem; }
.q-prof-stat { text-align: right; font-size: 0.72rem; }
.q-chat-list {
  margin: 6px 0 0;
  padding-left: 14px;
  font-size: 0.74rem;
  line-height: 1.35;
}
.q-chat-list li { margin: 4px 0; }
.muted { color: var(--muted); font-size: 0.8rem; }
.led-card {
  background: var(--elev);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.led-card.credit { border-color: rgba(34,197,94,.28); }
.led-card.debit { border-color: rgba(239,68,68,.22); }
.led-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.led-title {
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.3;
}
.led-amt {
  flex-shrink: 0;
  font-weight: 800;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.led-amt.plus { color: #86efac; }
.led-amt.minus { color: #fca5a5; }
.led-details {
  margin: 0;
  padding: 0 0 0 16px;
  color: #d4d4d8;
  font-size: 0.78rem;
  line-height: 1.45;
}
.led-details li { margin: 2px 0; }
.led-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 12px;
  color: var(--muted);
  font-size: 0.72rem;
}
.led-foot b { color: #e4e4e7; font-weight: 650; }
.field-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.4;
}
.addr-pick-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.addr-pick-row select {
  flex: 1;
  min-width: 0;
}
.addr-pick-row .btn {
  flex: 0 0 42px;
  padding: 0;
  font-size: 1.15rem;
  font-weight: 700;
}
.work-new-addr {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.03);
}
.work-new-addr.hidden { display: none; }
.work-new-addr label {
  display: block;
  margin: 8px 0 4px;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 650;
}
.work-new-addr label:first-child { margin-top: 0; }
.work-new-addr input,
.work-new-addr textarea {
  width: 100%;
  box-sizing: border-box;
  background: #0e0e11;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 0.85rem;
}
.work-new-addr textarea { resize: vertical; }
.work-addr-ai {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.work-addr-ai-head {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #93c5fd;
  margin-bottom: 4px;
}
.work-addr-ai-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.work-addr-ai-row label.inline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
}
.work-addr-ai-row select {
  background: #0e0e11;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 6px 10px;
  font-size: 0.85rem;
}
.work-addr-ai-row input[type="number"] {
  width: 72px;
  box-sizing: border-box;
  background: #0e0e11;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 6px 10px;
  font-size: 0.85rem;
}
.work-addr-list {
  margin-top: 8px;
  max-height: 220px;
  overflow: auto;
}
.work-addr-list:empty { display: none; }
.work-addr-list .addr-row {
  padding: 8px 10px;
}
.work-addr-ai-preview {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.work-addr-ai-card {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(59,130,246,.25);
  background: rgba(0,0,0,.25);
}
.work-addr-ai-card .title {
  font-size: 0.78rem;
  font-weight: 650;
  margin-bottom: 4px;
}
.work-addr-ai-card .meta {
  font-size: 0.72rem;
  color: #a1a1aa;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.4;
}
.work-addr-ai-card .actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.form-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.form-actions .btn {
  width: 100%;
}
.product-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 8px;
}
.product-toolbar .btn {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.72rem;
  padding: 8px 6px;
}
.product-catalog .item.prod-row {
  align-items: flex-start;
  gap: 10px;
}
.product-catalog .prod-row.inactive {
  opacity: 0.55;
}
.product-catalog .prod-row .pill.ok {
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
}
.product-catalog .prod-row .pill.dim {
  background: rgba(161, 161, 170, 0.18);
  color: #a1a1aa;
}
.product-catalog .prod-check {
  margin-top: 4px;
  width: 18px;
  height: 18px;
  accent-color: #3b82f6;
}
.hidden { display: none !important; }

.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); margin-top: 8px;
}
.toggle-row b { display: block; font-size: 0.9rem; }
.toggle-row small { color: var(--muted); font-size: 0.72rem; }

.req-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 4px;
}
.req-chip {
  display: inline-flex;
  align-items: center;
  gap: 0;
  cursor: pointer;
  user-select: none;
  margin: 0;
}
.req-chip input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.req-chip span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.2;
  transition: 0.15s ease;
}
.req-chip.req-chip-custom span {
  padding-right: 8px;
}
.req-chip input:checked + span {
  border-color: var(--blue);
  background: rgba(59, 130, 246, 0.18);
  color: #e8f0ff;
}
.req-chip input:focus-visible + span {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.req-chip-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.req-chip-x:hover {
  background: rgba(239, 68, 68, 0.35);
  color: #fecaca;
}
.req-chip-add {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 6px 0 4px;
}
.req-chip-add input {
  flex: 1;
  min-width: 0;
  margin: 0;
}
.req-chip-add .btn {
  flex-shrink: 0;
  min-width: 40px;
  padding: 8px 12px;
  font-size: 1.1rem;
  line-height: 1;
}

.start-run-defaults {
  margin: 14px 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}
.start-run-defaults-head {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.start-run-assign-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.start-run-assign-btns .btn {
  flex: 1;
  min-width: 88px;
}
.start-run-defaults-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: end;
}
.start-run-defaults-row label {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  margin-bottom: 4px;
}
.start-run-defaults-row input[type="number"] {
  margin: 0;
  width: 100%;
}
.start-run-list-head {
  display: grid;
  grid-template-columns: minmax(72px, 0.7fr) 1.4fr 1fr;
  gap: 8px;
  margin: 14px 0 6px;
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.start-run-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(42vh, 360px);
  overflow: auto;
  padding-right: 2px;
}
.start-run-row {
  display: grid;
  grid-template-columns: minmax(72px, 0.7fr) 1.4fr 1fr;
  gap: 8px;
  align-items: start;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
}
.start-run-row .sr-prof {
  min-width: 0;
  padding-top: 6px;
}
.start-run-row .sr-prof b {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
}
.start-run-row .sr-prof small {
  display: block;
  color: var(--muted);
  font-size: 0.65rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.start-run-row select {
  margin: 0;
  font-size: 0.78rem;
  padding: 8px 10px;
}
.start-run-row .sr-products {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.start-run-row .sr-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 26px;
}
.start-run-row .sr-chip {
  appearance: none;
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.14);
  color: #bfdbfe;
  border-radius: 999px;
  font-size: 0.68rem;
  padding: 4px 8px;
  cursor: pointer;
  line-height: 1.2;
  max-width: 100%;
}
.start-run-row .sr-chip.empty {
  border-style: dashed;
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
  cursor: default;
}
.start-run-row .sr-chip .sr-x {
  opacity: 0.7;
  margin-left: 2px;
}
.start-run-row .sr-add-row {
  display: flex;
  gap: 4px;
  align-items: center;
}
.start-run-row .sr-add-row select {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  font-size: 0.72rem;
}
.start-run-row .sr-add-btn {
  flex-shrink: 0;
  min-width: 32px;
  padding: 6px 8px;
}
@media (max-width: 520px) {
  .start-run-defaults-row,
  .start-run-list-head,
  .start-run-row {
    grid-template-columns: 1fr;
  }
  .start-run-list-head span:nth-child(n + 2) {
    display: none;
  }
}

.switch { position: relative; width: 46px; height: 28px; flex-shrink: 0; }
.switch input { display: none; }
.switch span {
  position: absolute; inset: 0; border-radius: 999px; background: #3f3f46;
  transition: .2s;
}
.switch span::after {
  content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px; transition: .2s;
}
.switch input:checked + span { background: var(--blue); }
.switch input:checked + span::after { transform: translateX(18px); }

/* ?? Chat: profiles ? chats ? thread ?? */
.chat-layout {
  --chat-col-prof: 160px;
  --chat-col-list: 220px;
  flex: 1;
  display: grid;
  grid-template-columns: var(--chat-col-prof) 5px 1fr;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  background: var(--panel);
  overflow: hidden;
}
.chat-layout.has-list {
  grid-template-columns: var(--chat-col-prof) 5px var(--chat-col-list) 5px 1fr;
}
.chat-resizer {
  width: 5px;
  cursor: col-resize;
  background: transparent;
  position: relative;
  z-index: 3;
  touch-action: none;
  user-select: none;
}
.chat-resizer::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: 1px;
  width: 1px;
  background: var(--line);
}
.chat-resizer:hover::after,
.chat-resizer.is-dragging::after {
  left: 0;
  width: 3px;
  background: rgba(59,130,246,.75);
}
.chat-resizer.hidden { display: none !important; }
.chat-layout.narrow .chat-resizer { display: none !important; }
.chat-col {
  background: #0e0e10;
  border-right: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.col-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 8px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 750;
  color: var(--muted);
  flex-shrink: 0;
}
.col-head span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-ico, .col-back {
  width: 28px; height: 28px; border: 0; border-radius: 8px;
  background: var(--elev); color: var(--text); cursor: pointer; font-size: 0.9rem;
  flex-shrink: 0;
}
.col-back {
  width: auto;
  min-width: 28px;
  padding: 0 10px;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: -.01em;
  border: 1px solid var(--line);
  color: #e8e8ef;
}
.col-back:hover { border-color: #4a4a58; background: #1a1a22; }
.col-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 6px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.p-item, .c-item {
  border: 1px solid var(--line);
  background: var(--elev);
  border-radius: 12px;
  padding: 8px;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  width: 100%;
}
.p-item:hover, .c-item:hover { border-color: #3a3a48; }
.p-item.active, .c-item.active {
  border-color: var(--blue);
  background: rgba(59,130,246,.12);
}
.p-item .pn {
  font-weight: 800;
  font-size: 0.82rem;
  line-height: 1.2;
}
.p-item .pn-sub {
  font-weight: 600;
  font-size: 0.68rem;
  color: var(--muted);
}
.p-item .pm, .c-item .cm {
  color: var(--muted);
  font-size: 0.62rem;
  margin-top: 3px;
  line-height: 1.25;
  word-break: break-word;
}
.p-item .pc {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.58rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  background: #2a2a32;
  color: #c7c7d1;
}
.p-item .pc.on { background: rgba(34,197,94,.16); color: var(--green); }

.p-item .pn, .c-item .ct {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.unread-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 16px;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1;
}
.dot-new {
  width: 8px; height: 8px; border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(239,68,68,.25);
}
.c-item-wrap.has-unread .c-item {
  border-color: rgba(239,68,68,.35);
}
.c-item-wrap.has-unread .ct { font-weight: 750; }
  font-weight: 700;
  font-size: 0.78rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.c-item.reject .ct { color: #fca5a5; }
.c-item.reject .cm { color: #f87171; }

.c-item-wrap {
  display: flex;
  align-items: stretch;
  gap: 6px;
  width: 100%;
}
.c-item-wrap .c-item {
  flex: 1;
  min-width: 0;
}
.c-item-wrap.active .c-item {
  border-color: var(--blue);
  background: rgba(59,130,246,.12);
}
.c-del {
  flex-shrink: 0;
  width: 36px;
  border: 1px solid rgba(239,68,68,.35);
  border-radius: 12px;
  background: rgba(239,68,68,.12);
  color: #fca5a5;
  cursor: pointer;
  font-size: 0.78rem;
}
.c-del:hover { background: rgba(239,68,68,.22); }

.chat-main {
  background: #111114;
  display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden;
}
.chat-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--muted); gap: 6px; padding: 16px; text-align: center;
}
.empty-ico { font-size: 2rem; margin-bottom: 4px; }

#chatThread { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.thread-head {
  display: grid; grid-template-columns: 36px 42px 1fr 36px 36px 36px;
  gap: 8px; align-items: center;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
  background: #141418;
  flex-shrink: 0;
}
.thread-back {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 800;
}
.chat-empty .btn-empty-back {
  margin-top: 14px;
  border: 1px solid var(--line);
  background: var(--elev);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 0.82rem;
  font-weight: 750;
  cursor: pointer;
}
.chat-empty .btn-empty-back:hover { border-color: #4a4a58; }
.th-avatar {
  width: 42px; height: 42px; border-radius: 12px;
  background: #1e293b; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.75rem; color: #93c5fd;
}
.th-info { min-width: 0; }
.th-title { font-weight: 750; font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-sub { color: var(--muted); font-size: 0.7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--elev); color: var(--text); font-weight: 800; font-size: 0.72rem; cursor: pointer;
}
.tr-btn.danger {
  border-color: rgba(239,68,68,.4);
  background: rgba(239,68,68,.12);
  color: #fca5a5;
}

.thread-mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 0;
  background: #121218;
  flex-shrink: 0;
}
.thread-mode-row b { display: block; font-size: 0.86rem; }
.thread-mode-row small { color: var(--muted); font-size: 0.68rem; }

.thread-meta {
  --shot-h: 72px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: #101014;
  border-bottom: 1px solid var(--line);
}
.thread-meta .shot-row {
  border-bottom: 1px solid var(--line);
  padding: calc(4px + var(--shot-h) * 0.08) 12px;
}
.thread-meta.compact .shot-meta { display: none; }
.thread-meta.compact .thread-mode-row {
  padding: 6px 12px;
}
.thread-meta.compact .thread-mode-row small { display: none; }
.thread-meta.compact .thread-mode-row b { font-size: 0.78rem; }
.thread-meta.tiny .shot-row { display: none; }
.thread-meta.tiny .thread-mode-row {
  padding: 5px 12px;
  border-bottom: 0;
}

.shot-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #101014;
  flex-shrink: 0;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
}
.shot-row:hover { background: #14141a; }
.shot-thumb {
  border: 1px solid var(--line);
  background: #0a0a0c;
  border-radius: 12px;
  padding: 0;
  width: calc(var(--shot-h, 72px) * 1.22);
  height: var(--shot-h, 72px);
  max-width: 42%;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  display: block;
  transition: width .05s linear, height .05s linear;
}
.shot-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.shot-thumb.has-img img { display: block; }
.shot-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
  padding: 6px;
  color: var(--muted);
  background: linear-gradient(145deg, #16161c, #0e0e12);
  text-align: center;
}
.shot-thumb.has-img .shot-placeholder { display: none; }
.shot-ph-ico { font-size: 1.15rem; line-height: 1; }
.shot-ph-text {
  font-size: 0.52rem;
  font-weight: 650;
  line-height: 1.2;
  color: #8b8b98;
}
.shot-label {
  display: block;
  font-weight: 750;
  font-size: 0.82rem;
  color: #93c5fd;
}
.shot-meta { flex: 1; min-width: 0; }
.shot-meta .muted { display: block; font-size: 0.68rem; margin-top: 2px; }
.shot-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.78rem;
  color: #7eb6ff;
  text-decoration: none;
}
.shot-link:hover { text-decoration: underline; }
.shot-row.has-shot .shot-label { color: #e8e8ef; }

.shot-lb {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(0,0,0,.9);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.shot-lb.hidden { display: none; }
.shot-lb img {
  max-width: min(96vw, 980px);
  max-height: 88vh;
  border-radius: 12px;
  object-fit: contain;
  background: #0a0a0c;
}
.shot-lb img.hidden { display: none; }
.shot-lb-empty {
  width: min(92vw, 420px);
  min-height: 280px;
  border-radius: 16px;
  border: 1px dashed #3a3a48;
  background: #141418;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 28px;
  text-align: center;
}
.shot-lb-empty.hidden { display: none; }
.shot-lb-empty-ico { font-size: 2.4rem; opacity: .7; }
.shot-lb-empty-text {
  font-size: 1rem;
  font-weight: 700;
  color: #c7c7d1;
  line-height: 1.35;
}
.shot-lb-close {
  position: absolute; top: 14px; right: 14px;
  width: 40px; height: 40px; border: 0; border-radius: 12px;
  background: #222; color: #fff; font-size: 1.1rem; cursor: pointer;
}
.composer {
  display: flex; align-items: center; gap: 6px;
  background: #0e0e11; border: 1px solid var(--line);
  border-radius: 14px; padding: 4px 6px 4px 6px; min-width: 0;
}
.composer.manual-on {
  border-color: rgba(96, 165, 250, 0.45);
  background: #12161f;
}
.composer input[type="text"],
.composer #chatComposeInput {
  flex: 1; min-width: 0; border: 0; outline: none;
  background: transparent; color: var(--text);
  font-size: 0.82rem; padding: 8px 0;
}
.composer input:disabled {
  color: var(--muted);
}
.composer input::placeholder { color: var(--muted); }
.btn-attach {
  flex-shrink: 0; width: 34px; height: 34px; border: 0; border-radius: 10px;
  background: var(--elev); color: var(--text); font-size: 0.95rem; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-attach:hover:not(:disabled) {
  background: rgba(96,165,250,.18);
  color: #93c5fd;
}
.btn-attach:disabled {
  opacity: 0.35; cursor: not-allowed;
}
.btn-send {
  flex-shrink: 0; width: 36px; height: 36px; border: 0; border-radius: 10px;
  background: var(--blue); color: #fff; font-size: 0.95rem; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-send:disabled {
  opacity: 0.35; cursor: not-allowed; background: var(--elev); color: var(--muted);
}

.thread-body {
  flex: 1; overflow-y: auto; padding: 14px 12px;
  display: flex; flex-direction: column; gap: 8px;
  background: #0c0c0e;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}
.bubble {
  max-width: min(88%, 520px); padding: 10px 12px; border-radius: 16px;
  font-size: 0.84rem; line-height: 1.35; word-break: break-word;
}
.bubble .who { font-size: 0.66rem; opacity: .6; font-weight: 700; margin-bottom: 2px; }
.bubble .msg-meta {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: 0.62rem;
  font-weight: 600;
  opacity: .78;
  letter-spacing: .02em;
}
.bubble.buyer .msg-meta { justify-content: flex-end; color: #555; }
.bubble.seller .msg-meta { justify-content: flex-start; color: #9a9aa3; }
.bubble .msg-time { opacity: .9; font-variant-numeric: tabular-nums; }
.bubble .msg-meta-sep { opacity: .45; margin: 0 1px; }
.bubble .msg-status.unread { color: #c45c26; opacity: .95; }
.bubble .msg-status.read { color: #2a7a4b; }
.bubble .msg-status.delivered,
.bubble .msg-status.sent { opacity: .55; }
.c-unread, .c-read {
  margin-left: 6px;
  font-size: 0.62rem;
  font-weight: 700;
  vertical-align: middle;
}
.c-unread { color: #c45c26; }
.c-read { color: #3d8f5a; opacity: .85; }
.bubble.buyer { align-self: flex-end; background: #e8e8ed; color: #111; border-bottom-right-radius: 5px; }
.bubble.seller { align-self: flex-start; background: #1c1c22; color: var(--text); border-bottom-left-radius: 5px; }
.bubble-imgs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 4px 0 6px;
}
.bubble-img-btn {
  display: block;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  border-radius: 10px;
  overflow: hidden;
  max-width: 100%;
}
.bubble-img {
  display: block;
  max-width: min(100%, 280px);
  max-height: 320px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  background: #111;
}
.bubble.sys {
  align-self: center; background: #1a1a1f; color: var(--muted);
  border-radius: 999px; font-size: 0.7rem; padding: 6px 12px;
}

.thread-stage {
  margin: 0 12px 8px;
  background: #18181c; border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 12px;
  font-size: 0.7rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex-shrink: 0;
}
.thread-v-resizer {
  height: 6px;
  flex-shrink: 0;
  cursor: row-resize;
  background: transparent;
  position: relative;
  z-index: 3;
  touch-action: none;
  user-select: none;
}
.thread-v-resizer::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  top: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--line);
}
.thread-v-resizer:hover::after,
.thread-v-resizer.is-dragging::after {
  left: 12%;
  right: 12%;
  height: 3px;
  top: 1.5px;
  background: rgba(59,130,246,.75);
}
.thread-panel {
  --thread-panel-h: 28%;
  flex-shrink: 0;
  height: var(--thread-panel-h);
  min-height: 64px;
  max-height: 72%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #121216;
  border-top: 1px solid var(--line);
}
.thread-bar {
  display: grid; grid-template-columns: auto auto 1fr;
  gap: 6px; align-items: center;
  padding: 8px 10px 8px;
  border-bottom: 1px solid var(--line);
  background: #141418;
  flex-shrink: 0;
}
.tb {
  border: 0; background: var(--elev); color: var(--text);
  border-radius: 12px; padding: 10px 10px; font-size: 0.72rem; font-weight: 700; cursor: pointer;
}
.bubble.sys {
  align-self: center; max-width: 92%;
  background: rgba(248, 113, 113, 0.12); color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, 0.25);
  font-size: 0.75rem;
}
.thread-ai {
  flex: 1;
  min-height: 0;
  padding: 0 12px 10px;
  font-size: 0.78rem;
  color: #c7c7d1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.thread-ai .box {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px; margin-top: 6px; white-space: pre-wrap;
}
/* No analysis yet ? only composer bar, no tall empty panel */
#chatThread:not(:has(.thread-ai .box)) .thread-v-resizer {
  display: none;
}
#chatThread:not(:has(.thread-ai .box)) .thread-panel {
  height: auto !important;
  max-height: none;
}

/* Narrow phone: one pane at a time */
.chat-layout.narrow {
  grid-template-columns: 1fr !important;
}
.chat-layout.narrow .chat-col,
.chat-layout.narrow .chat-main {
  display: none;
}
.chat-layout.narrow[data-focus="profiles"] .profiles-col { display: flex; }
.chat-layout.narrow[data-focus="profiles"] .chat-main { display: none; }
.chat-layout.narrow[data-focus="list"] .chats-col { display: flex; }
.chat-layout.narrow[data-focus="list"] .chats-col.hidden { display: flex !important; }
.chat-layout.narrow[data-focus="thread"] .chat-main { display: flex; }
.chat-layout.narrow[data-focus="thread"] .thread-head {
  grid-template-columns: 36px 42px 1fr 36px 36px 36px;
}

/* Dock */
.dock {
  position: fixed; left: 50%; bottom: calc(8px + var(--safe-bottom));
  transform: translateX(-50%);
  width: min(var(--app-max-w), calc(100% - 14px));
  max-width: 560px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
  background: rgba(20,20,24,.96);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 6px 4px 5px;
  z-index: 40;
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.dock button {
  position: relative; border: 0; background: transparent; color: var(--muted);
  padding: 4px 2px 3px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
}
.dock button.active { color: var(--text); }
.dock button.active .di { background: var(--blue); color: #fff; }
.di {
  width: 30px; height: 30px; margin: 0; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.88rem;
  flex-shrink: 0;
}
.dock .dl {
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  opacity: .85;
}
.dock button.active .dl { opacity: 1; }
.badge-n {
  position: absolute; top: 0; right: max(2px, calc(50% - 22px));
  min-width: 15px; height: 15px; border-radius: 999px;
  background: var(--red); color: #fff; font-size: 0.55rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
}

.toast {
  position: fixed;
  left: 50%;
  top: calc(12px + var(--safe-top, 0px));
  bottom: auto;
  transform: translateX(-50%);
  background: #1f1f28;
  border: 1px solid var(--line);
  color: #fff;
  padding: 12px 16px;
  border-radius: 14px;
  z-index: 200;
  max-width: min(92%, 420px);
  box-shadow: 0 10px 32px rgba(0,0,0,.5);
  pointer-events: none;
  text-align: center;
  font-weight: 650;
  font-size: 0.9rem;
  line-height: 1.35;
}
.toast.hidden { display: none; }
.toast.err {
  background: #6b1212;
  border-color: #b91c1c;
  color: #fecaca;
}
.sheet-err {
  display: none;
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(239,68,68,.2);
  border: 1px solid rgba(248,113,113,.55);
  color: #fecaca;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.4;
}
.sheet-err.show { display: block; }

/* wallet / profile extras (home .balance-card defined above) */
.wallet-hero {
  background:
    linear-gradient(145deg, rgba(34,197,94,.14), transparent 55%),
    var(--card);
}
.wallet-big {
  font-size: 2.15rem; font-weight: 800; margin: 4px 0 10px;
  letter-spacing: -0.03em;
}
.wallet-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 10px; border-radius: 10px;
  background: #0e0e14; border: 1px solid var(--line);
  color: var(--muted); font-size: 0.74rem; font-weight: 650;
}
.chip b { color: var(--text); }
.topup-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.topup-chip {
  padding: 12px 8px !important;
  font-weight: 750 !important;
  background: #121218 !important;
}
.topup-chip:hover { border-color: #3b82f6 !important; color: #93c5fd !important; }

.profile-hero {
  display: flex; align-items: center; gap: 12px;
  background:
    linear-gradient(135deg, rgba(20,184,166,.14), transparent 60%),
    var(--card);
}
.profile-avatar {
  width: 52px; height: 52px; border-radius: 16px;
  background: rgba(20,184,166,.2); color: #5eead4;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.95rem; flex-shrink: 0;
}
.profile-name { font-size: 1.1rem; font-weight: 800; letter-spacing: -0.02em; }
.profile-id { font-size: 0.78rem; margin-top: 2px; font-family: "JetBrains Mono", monospace; }
.profile-stats { margin: 0 0 10px; }

.admin-user {
  cursor: pointer;
}
.admin-user:hover { border-color: var(--blue); }

.chat-empty .empty-title {
  font-weight: 750; margin: 6px 0 4px; letter-spacing: -0.01em;
}
.share-block { margin-top: 4px; }

.guide-intro {
  background:
    linear-gradient(135deg, rgba(255,106,0,.1), transparent 55%),
    var(--card) !important;
}

.dock {
  background: rgba(16,16,20,.94) !important;
  border-radius: 18px !important;
  box-shadow: 0 10px 32px rgba(0,0,0,.45) !important;
}

/* Commercial license cards */
.lic-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lic-card {
  background: #121218;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  cursor: pointer;
  transition: border-color .15s ease;
}
.lic-card:hover { border-color: #3f3f4a; }
.lic-card.is-active { border-color: #f59e0b; box-shadow: 0 0 0 1px rgba(245,158,11,.25); }
.lic-card.is-revoked { opacity: .72; }
.lic-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.lic-owner {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.lic-owner-tg {
  font-size: 1.02rem;
  font-weight: 750;
  color: #f4f4f5;
  word-break: break-word;
}
.lic-owner-sub {
  font-size: 0.72rem;
  color: var(--muted);
}
.lic-key-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #0a0a0e;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 8px 8px 10px;
  margin-bottom: 10px;
}
.lic-key {
  flex: 1;
  min-width: 0;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-all;
  line-height: 1.35;
  color: #e4e4e7;
  user-select: all;
}
.lic-copy {
  flex-shrink: 0;
  min-width: 36px;
  padding: 6px 8px !important;
  background: rgba(96,165,250,.14) !important;
  color: #93c5fd !important;
  border: none;
}
.lic-copy:active { transform: scale(0.96); }
.lic-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.lic-metric {
  background: #0e0e14;
  border-radius: 10px;
  padding: 8px 6px;
  text-align: center;
}
.lic-metric span {
  display: block;
  font-size: 0.62rem;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 2px;
}
.lic-metric b {
  font-size: 0.92rem;
  font-weight: 800;
  color: #fafafa;
}
.lic-metric b.ok { color: #4ade80; }
.lic-metric b.warn { color: #fbbf24; }
.lic-metric b.bad { color: #fca5a5; }
.lic-card-note {
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--muted);
}
.lic-card-foot {
  margin-top: 8px;
  font-size: 0.68rem;
  color: #71717a;
}
.lic-panel {
  margin-top: 12px;
  border: 1px solid rgba(245,158,11,.35);
  border-radius: 14px;
  padding: 12px;
  background: #0e0e11;
}
.lic-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.lic-panel-info {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.lic-panel-info .lic-metric { text-align: left; padding: 10px; }
.lic-issue {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* Size / height tweaks */
html[data-height="short"] {
  --dock: 52px;
}
html[data-height="short"] .thread-ai { display: none; }
html[data-height="short"] .thread-v-resizer { display: none; }
html[data-height="short"] .thread-panel {
  height: auto !important;
  max-height: none;
}
html[data-height="short"] .menu-hero { padding: 10px; margin-bottom: 10px; }
html[data-size="l"] .chat-layout,
html[data-size="xl"] .chat-layout {
  border-radius: 16px;
  margin: 6px 8px 0;
}
html[data-size="l"] .chat-layout:not([data-cols-custom]) {
  --chat-col-prof: 150px;
}
html[data-size="l"] .chat-layout.has-list:not([data-cols-custom]) {
  --chat-col-list: 210px;
}
html[data-size="xl"] .chat-layout:not([data-cols-custom]) {
  --chat-col-prof: 170px;
}
html[data-size="xl"] .chat-layout.has-list:not([data-cols-custom]) {
  --chat-col-list: 260px;
}
html[data-size="m"] .chat-layout.has-list:not([data-cols-custom]) {
  --chat-col-prof: 26%;
  --chat-col-list: 34%;
}
html[data-size="xl"] .dock {
  max-width: 640px;
}

/* ?? Guide ?? */
.guide-intro {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--muted);
}
.guide-intro b { color: var(--text); }
.guide-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.guide-nav button {
  border: 1px solid var(--line);
  background: #16161a;
  color: var(--text);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.72rem;
  font-weight: 650;
  cursor: pointer;
}
.guide-nav button.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.guide-sec {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
  scroll-margin-top: 12px;
}
.guide-sec h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 750;
  display: flex;
  align-items: center;
  gap: 8px;
}
.guide-sec .g-ico {
  width: 28px; height: 28px; border-radius: 8px;
  background: #1e293b; color: #93c5fd;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.85rem; flex-shrink: 0;
}
.guide-sec .g-body {
  white-space: normal;
  font-size: 0.84rem;
  line-height: 1.55;
  color: #c8c8d0;
  letter-spacing: 0.01em;
}
.guide-sec .g-h {
  margin: 12px 0 6px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
}
.guide-sec .g-h:first-child { margin-top: 0; }
.guide-sec .g-step {
  margin: 4px 0;
  padding-left: 2px;
  color: #d4d4dc;
}
.guide-sec .g-line {
  margin: 3px 0;
}
.guide-sec .g-gap {
  height: 8px;
}
.guide-sec h3 {
  color: var(--text);
}
.guide-body { padding-bottom: 20px; }

/* ?? Add account sheet ?? */
.acc-balance-bar {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 12px;
  padding: 0 2px;
}
.acc-row {
  align-items: flex-start;
  gap: 10px;
}
.acc-check {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 8px;
  cursor: pointer;
}
.acc-check input {
  width: 16px;
  height: 16px;
  accent-color: #3b82f6;
  cursor: pointer;
}
.acc-check-spacer { width: 16px; }
.acc-row .acc-main { flex: 1; min-width: 0; }
.acc-row .acc-del {
  flex: 0 0 auto;
  margin-top: 2px;
  min-width: 36px;
}
.acc-empty {
  text-align: center;
  padding: 28px 12px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}
.acc-empty-ico {
  width: 48px; height: 48px; margin: 0 auto 10px;
  border-radius: 14px; background: rgba(59,130,246,.18); color: #93c5fd;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 700;
}
.sheet {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: calc(8px + var(--safe-top, 0px));
}
.sheet.hidden { display: none; }
.sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
}
.sheet-panel {
  position: relative;
  width: min(var(--app-max-w, 480px), 100%);
  max-height: min(92vh, 720px);
  background: #15151a;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 20px 20px;
  padding: 10px 16px calc(16px + var(--safe-bottom));
  overflow: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,.45);
  animation: sheetDown .22s ease-out;
}
@keyframes sheetDown {
  from { transform: translateY(-20px); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}
.sheet-grab {
  width: 36px; height: 4px; border-radius: 999px;
  background: #3a3a44; margin: 4px auto 10px;
}
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 8px;
}
.sheet-head h2 {
  margin: 0; font-size: 1.05rem; font-weight: 750;
}
.sheet-close {
  width: 34px; height: 34px; border: 0; border-radius: 10px;
  background: var(--elev); color: var(--text); cursor: pointer; font-size: 0.95rem;
}
.sheet-body label {
  display: block; margin: 10px 0 4px;
  font-size: 0.72rem; color: var(--muted); font-weight: 650;
}
.sheet-body textarea {
  width: 100%; box-sizing: border-box;
  background: #0e0e11; border: 1px solid var(--line);
  border-radius: 12px; color: var(--text);
  padding: 10px 12px; font-size: 0.85rem; resize: vertical;
}
.sheet-body select {
  width: 100%; box-sizing: border-box;
  background: #0e0e11; border: 1px solid var(--line);
  border-radius: 12px; color: var(--text);
  padding: 10px 12px; font-size: 0.85rem;
}
.sheet-body input[type="text"],
.sheet-body input[type="number"] {
  width: 100%; box-sizing: border-box;
  background: #0e0e11; border: 1px solid var(--line);
  border-radius: 12px; color: var(--text);
  padding: 10px 12px; font-size: 0.85rem;
}
.sheet-panel-tall {
  max-height: min(94vh, 860px);
}
.pe-sec {
  margin: 16px 0 6px;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  color: #93c5fd;
  text-transform: uppercase;
}
.pe-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pe-ai-dialog {
  margin-top: 10px;
  display: flex !important;
  flex-direction: column;
  gap: 8px;
  min-height: 120px;
  max-height: 320px;
  overflow: auto;
  padding: 10px;
  background: #0e0e11;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.pe-ai-dialog.hidden { display: none !important; }
.pe-ai-placeholder {
  text-align: center;
  padding: 18px 8px;
  font-size: 0.8rem;
  line-height: 1.4;
}
.pe-ai-err {
  color: #fca5a5;
  font-size: 0.8rem;
  line-height: 1.35;
  padding: 8px;
}
.pe-ai-loading {
  text-align: center;
  padding: 18px 8px;
  color: #93c5fd;
  font-size: 0.82rem;
}
.pe-ai-msg {
  max-width: 92%;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}
.pe-ai-msg .pe-role {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  opacity: 0.75;
  margin-bottom: 3px;
  text-transform: uppercase;
}
.pe-ai-msg.buyer {
  align-self: flex-end;
  background: rgba(59,130,246,.22);
  border: 1px solid rgba(59,130,246,.35);
}
.pe-ai-msg.seller {
  align-self: flex-start;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--line);
}
body.sheet-open { overflow: hidden; }

#btnAddAccountOpen {
  font-size: 1.25rem; font-weight: 700; line-height: 1;
  color: var(--text);
}

/* Fullscreen toggle ? floating + home header */
.fs-fab {
  position: fixed;
  right: max(12px, env(safe-area-inset-right, 0px));
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  z-index: 80;
  width: auto;
  min-width: 44px;
  height: 40px;
  padding: 0 12px 0 10px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  background: rgba(24, 24, 28, 0.92);
  color: #e4e4e7;
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.fs-fab-ico {
  font-size: 1.05rem;
  line-height: 1;
  flex-shrink: 0;
}
.fs-fab-lab {
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.fs-fab:active { transform: scale(0.96); }
body.is-fullscreen .fs-fab {
  background: rgba(59, 130, 246, 0.28);
  border-color: rgba(96, 165, 250, 0.45);
  color: #93c5fd;
}
body.sheet-open .fs-fab { opacity: 0.35; pointer-events: none; }
#btnFullscreen[aria-pressed="true"] {
  color: #93c5fd;
}

/* Admin ops panel */
.admin-ops-status { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.admin-ops-feed { max-height: 280px; overflow-y: auto; }
.admin-ops-row {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 6px;
  cursor: pointer;
  background: rgba(255,255,255,.03);
}
.admin-ops-row.err { border-color: rgba(239,68,68,.4); background: rgba(127,29,29,.18); }
.admin-ops-row .ao-title { font-weight: 650; font-size: 0.86rem; word-break: break-all; }
.admin-ops-row .ao-meta { color: var(--muted); font-size: 0.72rem; margin-top: 3px; }
.admin-ops-row .ao-detail { margin-top: 4px; font-size: 0.76rem; color: #e5e7eb; line-height: 1.35; }
.admin-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 12px 0 8px;
}
.admin-tab {
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.admin-tab.active {
  color: #fff;
  background: rgba(59,130,246,.28);
  border-color: rgba(96,165,250,.45);
}
.admin-tab-panel { margin-top: 4px; }
.admin-acc-row {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 0;
  background: rgba(255,255,255,.03);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  width: 100%;
  box-sizing: border-box;
  cursor: pointer;
}
.admin-acc-row.err { border-color: rgba(239,68,68,.4); }
.admin-acc-row.run { border-color: rgba(245,158,11,.4); }
.admin-acc-row input.admin-acc-check,
.admin-xfer-list input.admin-acc-check {
  width: 18px;
  height: 18px;
  min-width: 18px;
  max-width: 18px;
  flex: 0 0 18px;
  margin: 2px 0 0;
  padding: 0;
  accent-color: #3b82f6;
  cursor: pointer;
}
.admin-acc-row .aa-body { flex: 1 1 auto; min-width: 0; overflow: hidden; }
.admin-acc-row .aa-email {
  font-weight: 650;
  font-size: 0.86rem;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.admin-acc-row .aa-meta { color: var(--muted); font-size: 0.72rem; margin-top: 3px; }
.admin-acc-row .aa-detail { margin-top: 4px; font-size: 0.76rem; color: #e5e7eb; }
.admin-acc-row.open-detail {
  border-color: rgba(59,130,246,.55);
  background: rgba(59,130,246,.1);
}
.admin-acc-detail {
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(59,130,246,.35);
  background: rgba(15,23,42,.55);
  display: grid;
  gap: 12px;
}
.admin-acc-detail.hidden { display: none; }
.aad-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.aad-head .title {
  font-weight: 750;
  font-size: 0.92rem;
  word-break: break-word;
}
.aad-sec { min-width: 0; }
.aad-sec-h {
  font-size: 0.68rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #93c5fd;
  margin-bottom: 6px;
}
.aad-grid { display: grid; gap: 6px; }
.aad-row {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 6px;
  align-items: start;
  font-size: 0.78rem;
}
.aad-row .k { color: var(--muted); font-size: 0.7rem; padding-top: 2px; }
.aad-row .v {
  min-width: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.74rem;
  color: #e4e4e7;
  line-height: 1.35;
}
.aad-row .v.secret { color: #fde68a; }
.aad-list {
  display: grid;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
}
.aad-item {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.22);
  font-size: 0.74rem;
  line-height: 1.35;
}
.aad-item .t { font-weight: 650; margin-bottom: 2px; }
.aad-item .m { color: var(--muted); font-size: 0.68rem; white-space: pre-wrap; word-break: break-word; }
.aad-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.aad-chip {
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: #a1a1aa;
  background: rgba(255,255,255,.04);
}
.admin-xfer-dir {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.admin-xfer-dir label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.82rem;
  color: var(--text);
  cursor: pointer;
}
.admin-xfer-dir input[type="radio"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  max-width: 16px;
  padding: 0;
  margin: 0;
  flex: 0 0 16px;
}
.admin-xfer-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0;
}
.admin-xfer-list {
  max-height: 240px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}
.admin-err-copy { float: right; margin-top: -2px; }

/* Account cards ? live action + AdsPower profile */
.acc-row.running {
  border-color: rgba(245,158,11,.35);
  background: rgba(245,158,11,.04);
}
.acc-ads {
  margin-top: 4px;
  font-size: 0.72rem;
  color: #a1a1aa;
  word-break: break-all;
}
.acc-ads b { color: #e4e4e7; font-weight: 650; }
.acc-ads code {
  font-size: 0.7rem;
  color: #93c5fd;
  background: rgba(59,130,246,.12);
  padding: 1px 5px;
  border-radius: 6px;
}
.acc-action {
  margin-top: 6px;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #d4d4d8;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
}
.acc-action.live {
  color: #fde68a;
  background: rgba(245,158,11,.1);
  border-color: rgba(245,158,11,.28);
}
.acc-action.err {
  color: #fecaca;
  background: rgba(239,68,68,.1);
  border-color: rgba(239,68,68,.28);
}
.acc-action-lab {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fbbf24;
  margin-right: 4px;
  opacity: 0.9;
}
.login-acc-row .acc-action { margin-top: 8px; }

.prof-ads-id {
  font-size: 0.7rem;
  color: #93c5fd;
  background: rgba(59,130,246,.12);
  padding: 1px 5px;
  border-radius: 6px;
}

/* Saved addresses list (settings) */
.addr-list { max-height: none; }
.addr-row {
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  background: rgba(255,255,255,.03);
  margin-bottom: 8px;
}
.addr-row .num {
  min-width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(59,130,246,.16);
  color: #93c5fd;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}
.addr-body { flex: 1; min-width: 0; }
.addr-body .title { font-weight: 650; font-size: 0.88rem; }
.addr-text {
  margin-top: 4px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.35;
  color: #a1a1aa;
  font-size: 0.75rem;
}
.work-new-addr {
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(59,130,246,.22);
  background: rgba(59,130,246,.06);
}
