/* Hide any third-party live-chat / Zaraz widget injected site-wide */
#tawkchat-container,
.tawk-min-container,
iframe[title*="chat" i],
iframe[id*="tawk" i],
iframe[src*="tawk.to" i],
iframe[src*="intercom" i],
iframe[src*="crisp" i],
iframe[src*="drift" i],
iframe[src*="zendesk" i],
iframe[src*="livechat" i],
#intercom-container, .intercom-lightweight-app,
#crisp-chatbox, .crisp-client,
#drift-widget, #drift-frame-controller,
div[id^="zaraz-"],
div[class*="widget-launcher" i],
div[class*="chat-launcher" i] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --sidebar: #f5f6f8;
  --sidebar-hover: #ebedf2;
  --sidebar-active: #e2e6ee;
  --ink: #1e2330;
  --ink-soft: #5b6373;
  --ink-faint: #9aa1b1;
  --line: #e6e8ee;
  --line-soft: #f0f2f6;
  --dark: #1e2330;
  --accent: #4f46e5;
  --accent-soft: #eef0fe;
  --user-bg: #f5f6f8;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Georgia", "Times New Roman", serif;
  --radius: 16px;
  --maxw: 740px;
  --sidebar-w: 268px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

button, input, textarea { font-family: inherit; }

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

/* ============ SIDEBAR ============ */
.sh-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  transition: width .22s ease, padding .22s ease, opacity .18s ease;
}

/* Desktop collapsed sidebar */
.sh-app.collapsed .sh-sidebar {
  width: 0;
  padding-left: 0; padding-right: 0;
  opacity: 0;
  overflow: hidden;
  border-right: none;
}

.sh-sidebar-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 8px 14px;
}
.sh-wordmark {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: .3px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sh-logo-badge {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--dark); color: #fff;
  display: grid; place-items: center;
  font-family: var(--font);
  font-size: 15px; font-weight: 700;
  letter-spacing: 0;
  flex-shrink: 0;
}
.sh-head-icons { display: flex; gap: 6px; }
.sh-icon-btn {
  width: 30px; height: 30px; border: none; background: transparent;
  border-radius: 8px; cursor: pointer; color: var(--ink-soft);
  display: grid; place-items: center;
}
.sh-icon-btn:hover { background: var(--sidebar-hover); }
.sh-icon-btn svg { width: 17px; height: 17px; }

.sh-nav { display: flex; flex-direction: column; gap: 2px; }
.sh-nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px;
  border-radius: 9px;
  border: none; background: transparent;
  color: var(--ink); font-size: 14px;
  cursor: pointer; text-align: left; width: 100%;
  letter-spacing: .2px;
}
.sh-nav-item:hover { background: var(--sidebar-hover); }
.sh-nav-item.active { background: var(--sidebar-active); font-weight: 500; }
.sh-nav-item svg { width: 17px; height: 17px; flex-shrink: 0; color: var(--ink-soft); }
.sh-nav-item .sh-badge { margin-left: auto; color: var(--ink-faint); }
.sh-nav-item .sh-badge svg { width: 14px; height: 14px; }

.sh-new-chat { margin-bottom: 8px; }
.sh-new-chat svg { color: var(--ink); }

.sh-section-label {
  font-size: 10.5px; letter-spacing: .6px;
  color: var(--ink-faint); text-transform: uppercase;
  font-weight: 600;
  padding: 18px 10px 6px;
  display: flex; align-items: center; justify-content: space-between;
}
/* First section-label in the scroll region shouldn't push too far down */
.sh-scroll-region > *:first-child > .sh-section-label:first-child { padding-top: 8px; }

.sh-list { display: flex; flex-direction: column; gap: 1px; }
.sh-list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 8px;
  border: none; background: transparent;
  color: var(--ink-soft); font-size: 13.5px;
  cursor: pointer; text-align: left; width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sh-list-item:hover { background: var(--sidebar-hover); color: var(--ink); }
.sh-list-item svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--ink-faint); }
.sh-list-item span { overflow: hidden; text-overflow: ellipsis; }

/* Chat rows — a denser, cleaner variant of sh-list-item with no icon,
   active-chat highlight, and a subtle left border on the active row so the
   DC always knows which chat they're viewing. */
.sh-chat-row {
  display: flex; align-items: center;
  padding: 8px 10px 8px 12px;
  border-radius: 8px; border: none; background: transparent;
  color: var(--ink-soft); font-size: 13.5px;
  cursor: pointer; text-align: left; width: 100%;
  position: relative;
  transition: background .12s ease, color .12s ease;
}
.sh-chat-row:hover { background: var(--sidebar-hover); color: var(--ink); }
.sh-chat-row.active {
  background: var(--sidebar-active);
  color: var(--ink);
  font-weight: 500;
}
.sh-chat-row.active::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 3px; border-radius: 2px; background: var(--accent);
}
.sh-chat-title {
  flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Instructions list */
.sh-instructions { display: flex; flex-direction: column; gap: 2px; }
.sh-instruction {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 7px 10px;
}
.sh-instruction-num {
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
  font-size: 10.5px; font-weight: 700;
  margin-top: 1px;
}
.sh-instruction-text { font-size: 12.5px; color: var(--ink-soft); line-height: 1.4; }

.sh-scroll-region { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.sh-scroll-region::-webkit-scrollbar { width: 7px; }
.sh-scroll-region::-webkit-scrollbar-thumb { background: #d3d7e0; border-radius: 7px; }

/* Footer / auth */
.sh-footer { position: relative; margin-top: 8px; }

.sh-signin {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 10px;
  background: var(--dark); color: #fff;
  font-size: 14px; font-weight: 500; cursor: pointer; border: none;
  transition: opacity .15s ease;
}
.sh-signin:hover { opacity: .88; }
.sh-signin svg { width: 17px; height: 17px; }

.sh-account {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 8px; border-radius: 10px; cursor: pointer;
  background: transparent; border: none; text-align: left;
}
.sh-account:hover { background: var(--sidebar-hover); }
.sh-avatar-sq {
  width: 32px; height: 32px; border-radius: 7px;
  background: var(--dark); color: #fff;
  display: grid; place-items: center; font-size: 13px; font-weight: 600;
  flex-shrink: 0;
}
.sh-account-meta { display: flex; flex-direction: column; line-height: 1.3; overflow: hidden; }
.sh-account-name { font-size: 13.5px; font-weight: 500; color: var(--ink); }
.sh-account-sub { font-size: 11.5px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-account-chevrons { margin-left: auto; color: var(--ink-faint); }
.sh-account-chevrons svg { width: 15px; height: 15px; }

/* Account dropdown menu */
.sh-account-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(31,30,28,.14);
  padding: 6px;
  opacity: 0; transform: translateY(6px);
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}
.sh-footer.menu-open .sh-account-menu { opacity: 1; transform: translateY(0); pointer-events: auto; }
.sh-menu-item {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  border: none; background: transparent; cursor: pointer;
  font-size: 14px; color: var(--ink); text-align: left;
}
.sh-menu-item:hover { background: var(--line-soft); }
.sh-menu-item svg { width: 16px; height: 16px; color: var(--ink-soft); }

/* Login modal */
.sh-modal-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(31,30,28,.34);
  display: grid; place-items: center;
  padding: 20px;
  opacity: 0; transition: opacity .2s ease;
}
.sh-modal-overlay.show { opacity: 1; }
.sh-modal {
  position: relative;
  width: 100%; max-width: 400px;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(31,30,28,.25);
  padding: 34px 32px 30px;
  transform: translateY(10px) scale(.98);
  transition: transform .2s ease;
}
.sh-modal-overlay.show .sh-modal { transform: translateY(0) scale(1); }
.sh-modal-head { text-align: center; margin-bottom: 22px; }
.sh-modal-star { width: 26px; height: 26px; color: var(--accent); margin-bottom: 12px; }
.sh-modal-badge {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--dark); color: #fff;
  font-size: 22px; font-weight: 700; margin-bottom: 14px;
}
.sh-modal-head h2 { font-family: var(--serif); font-weight: 400; font-size: 24px; margin-bottom: 6px; }
.sh-modal-head p { font-size: 13.5px; color: var(--ink-soft); }
.sh-modal-close {
  position: absolute; top: 14px; right: 16px;
  border: none; background: transparent; cursor: pointer;
  font-size: 24px; line-height: 1; color: var(--ink-faint);
}
.sh-modal-close:hover { color: var(--ink); }

.sh-form { display: flex; flex-direction: column; gap: 14px; }
.sh-field { display: flex; flex-direction: column; gap: 6px; }
.sh-field label { font-size: 12.5px; font-weight: 500; color: var(--ink-soft); letter-spacing: .2px; }
.sh-field input, .sh-field select {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; font-size: 14.5px; color: var(--ink);
  background: var(--bg); outline: none;
  transition: border-color .15s ease, background .15s ease;
}
.sh-field input:focus, .sh-field select:focus { border-color: var(--ink-faint); background: var(--surface); }

/* searchable combobox */
.sh-combo { position: relative; }
.sh-combo-input {
  width: 100%; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; font-size: 14.5px; color: var(--ink);
  background: var(--bg); outline: none;
  transition: border-color .15s ease, background .15s ease;
}
.sh-combo-input:focus { border-color: var(--ink-faint); background: var(--surface); }
.sh-combo-list {
  display: none; position: absolute; z-index: 20;
  top: calc(100% + 6px); left: 0; right: 0;
  max-height: 240px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.14);
  padding: 5px;
}
.sh-combo.open .sh-combo-list { display: block; }
.sh-combo-opt {
  padding: 9px 11px; border-radius: 7px; font-size: 14px;
  color: var(--ink); cursor: pointer;
}
.sh-combo-opt.active { background: var(--bg); }
.sh-combo-empty { padding: 10px 11px; font-size: 13.5px; color: var(--ink-soft); }

.sh-form-submit {
  margin-top: 6px;
  border: none; background: var(--dark); color: #fff;
  padding: 13px; border-radius: 10px;
  font-size: 14.5px; font-weight: 500; cursor: pointer;
  transition: opacity .15s ease;
}
.sh-form-submit:hover { opacity: .88; }
.sh-form-alt { text-align: center; font-size: 13px; color: var(--ink-soft); margin-top: 4px; }
.sh-form-alt a { color: var(--accent); text-decoration: none; font-weight: 500; }
.sh-form-alt a:hover { text-decoration: underline; }

/* Help dialog list */
.sh-help-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 22px; }
.sh-help-row { display: flex; gap: 13px; align-items: flex-start; }
.sh-help-num {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-size: 12.5px; font-weight: 700;
}
.sh-help-t { font-size: 14.5px; font-weight: 600; margin-bottom: 2px; }
.sh-help-d { font-size: 13px; color: var(--ink-soft); line-height: 1.45; }

/* ============ MAIN ============ */
.sh-main {
  flex: 1; display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}
.sh-main-top {
  height: 56px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px;
}
.sh-main-top-left { display: flex; align-items: center; gap: 8px; }
/* "Open sidebar" button: only visible on desktop when the sidebar is collapsed.
   Uses .sh-help.sh-reopen-btn so it outranks the base .sh-help { display: grid }. */
.sh-help.sh-reopen-btn { display: none; }
.sh-app.collapsed .sh-help.sh-reopen-btn { display: grid; }
.sh-help {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; color: var(--ink-soft);
}
.sh-help:hover { border-color: var(--ink-faint); }
.sh-help svg { width: 17px; height: 17px; }

/* Centered hero */
.sh-center {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px;
  position: relative;   /* anchor for the scroll-to-bottom FAB */
}
.sh-center.has-thread { justify-content: flex-start; }
.sh-center::-webkit-scrollbar { width: 9px; }
.sh-center::-webkit-scrollbar-thumb { background: #dfe2ea; border-radius: 8px; }

/* Scroll-to-bottom floating action button. Fixed to the bottom-right of
   the center scroll area; only visible when the user has scrolled up. */
.sh-scroll-fab {
  position: sticky;
  bottom: 20px;
  align-self: flex-end;
  margin-right: 12px;
  margin-top: -40px;   /* overlap the tail of the thread so it doesn't push layout */
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(31,30,28,.10);
  display: grid; place-items: center;
  transition: background .15s ease, transform .15s ease;
  z-index: 5;
}
.sh-scroll-fab:hover { background: var(--sidebar-hover); transform: translateY(-1px); }

.sh-center { padding-top: 6vh; }
.sh-center.has-thread { padding-top: 20px; }
.sh-hero-inner {
  width: 100%; max-width: var(--maxw);
  display: flex; flex-direction: column; align-items: center;
}
.sh-greeting {
  display: flex; align-items: center; gap: 13px;
  margin-bottom: 12px;
}
.sh-star { width: 28px; height: 28px; color: var(--accent); flex-shrink: 0; }
.sh-hero-badge {
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--dark); color: #fff;
  display: grid; place-items: center;
  font-family: var(--font);
  font-size: 21px; font-weight: 700;
  flex-shrink: 0;
}
.sh-greeting h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 34px;
  letter-spacing: -.3px;
  color: var(--ink);
}
.sh-subtitle {
  text-align: center;
  font-size: 15px;
  color: var(--ink-soft);
  max-width: 600px;
  margin-bottom: 26px;
}

/* mic listening pulse */
.sh-round.listening {
  background: var(--accent); color: #fff; border-color: var(--accent);
  animation: micpulse 1s infinite;
}
@keyframes micpulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(79,70,229,.35); }
  50% { box-shadow: 0 0 0 7px rgba(79,70,229,0); }
}

/* Composer card */
.sh-composer {
  width: 100%; max-width: var(--maxw);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 2px 14px rgba(31, 30, 28, .05);
  padding: 16px 18px 12px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.sh-composer:focus-within {
  border-color: var(--ink-faint);
  box-shadow: 0 4px 22px rgba(31, 30, 28, .08);
}
.sh-input {
  width: 100%; border: none; outline: none; resize: none;
  font-size: 16px; line-height: 1.5; color: var(--ink);
  background: transparent; max-height: 200px; min-height: 28px;
}
.sh-input::placeholder { color: var(--ink-faint); }

/* brand scraping chip in the composer */
.sh-composer-chips:not(:empty) { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.sh-brand-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 8px 5px 11px;
  font-size: 13px; color: var(--ink);
}
.sh-brand-chip svg { width: 14px; height: 14px; color: var(--ink-soft); }
.sh-brand-chip-label { color: var(--ink-soft); }
.sh-brand-chip-name { font-weight: 600; }
.sh-brand-chip-x {
  border: none; background: transparent; cursor: pointer;
  color: var(--ink-faint); font-size: 17px; line-height: 1;
  padding: 0 2px; display: grid; place-items: center;
}
.sh-brand-chip-x:hover { color: var(--ink); }

.sh-composer-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px;
}
.sh-composer-left, .sh-composer-right { display: flex; align-items: center; gap: 8px; }
.sh-round {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; color: var(--ink-soft);
}
.sh-round:hover { border-color: var(--ink-faint); color: var(--ink); }
.sh-round svg { width: 17px; height: 17px; }
.sh-model {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--ink-soft);
  padding: 6px 10px; border-radius: 8px; cursor: pointer;
}
.sh-model:hover { background: var(--line-soft); }
.sh-model svg { width: 13px; height: 13px; }
.sh-send {
  width: 36px; height: 36px; border-radius: 50%;
  border: none; background: var(--dark); color: #fff;
  display: grid; place-items: center; cursor: pointer;
  transition: opacity .15s ease;
}
.sh-send:hover { opacity: .85; }
.sh-send:disabled { background: #cdd1db; cursor: default; }
.sh-send svg { width: 17px; height: 17px; }

/* Suggestion chips under composer */
.sh-suggestions {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  margin-top: 20px; max-width: var(--maxw);
}
.sh-suggestion {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 10px; padding: 9px 15px;
  font-size: 13.5px; color: var(--ink); cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.sh-suggestion:hover { border-color: var(--ink-faint); background: var(--surface); }
.sh-suggestion svg { width: 15px; height: 15px; color: var(--accent); }

/* ============ THREAD (after first message) ============ */
.sh-thread {
  width: 100%; max-width: var(--maxw);
  margin: 0 auto; padding: 20px 8px 24px;
}
/* Tighter vertical rhythm — 14px each side instead of 22px. Consecutive
   messages of the same role get even less breathing room so a rapid
   back-and-forth doesn't feel walled off. */
.sh-msg {
  display: flex; gap: 14px;
  padding: 14px 0;
  animation: rise .35s ease;
  border-radius: 8px;
  transition: background .12s ease;
}
.sh-msg + .sh-msg { padding-top: 12px; }
.sh-msg[data-role="user"] + .sh-msg[data-role="bot"] { padding-top: 10px; }
.sh-msg[data-role="bot"] + .sh-msg[data-role="user"] { padding-top: 10px; }

.sh-role {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
}
.sh-role.bot { background: var(--accent-soft); color: var(--accent); }
.sh-role.user { background: var(--dark); color: #fff; }
.sh-body { flex: 1; padding-top: 3px; min-width: 0; }   /* min-width:0 prevents flexbox overflow from long tokens */
.sh-author { font-size: 12px; font-weight: 600; color: var(--ink-faint); margin-bottom: 6px; letter-spacing: .3px; }
.sh-text { font-size: 15.5px; color: var(--ink); word-wrap: break-word; }
/* Subtle bubble on user messages so a rapid thread reads like a conversation
   not a wall. Bot messages stay flat — they already carry the accent avatar. */
.sh-msg[data-role="user"] .sh-text {
  background: var(--user-bg);
  padding: 10px 14px;
  border-radius: 12px 12px 12px 4px;
  display: inline-block;
  max-width: 100%;
}
.sh-text p { margin: 0 0 8px 0; }
.sh-text p:last-child { margin-bottom: 0; }
.sh-text strong { font-weight: 600; }
.sh-text code { background: var(--panel, #f3f3f3); padding: 1px 5px; border-radius: 3px; font-size: 92%; }
.sh-md-list { margin: 6px 0 8px 20px; padding: 0; }
.sh-md-list li { margin: 2px 0; }
.sh-md-table { border-collapse: collapse; margin: 8px 0; font-size: 14.5px; width: 100%; max-width: 640px; }
.sh-md-table th, .sh-md-table td { border: 1px solid var(--line, #e4e4e4); padding: 6px 10px; text-align: left; }
.sh-md-table th { background: var(--panel, #f7f7f7); font-weight: 600; }
.sh-md-table tbody tr:nth-child(even) td { background: rgba(0,0,0,.02); }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.sh-typing { display: inline-flex; gap: 5px; padding: 5px 0; }
.sh-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-faint); animation: blink 1.2s infinite both; }
.sh-typing span:nth-child(2) { animation-delay: .2s; }
.sh-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,80%,100% { opacity: .25; } 40% { opacity: 1; } }

.sh-activity { display: flex; flex-direction: column; gap: 4px; padding: 6px 0 2px; font-size: 13px; color: var(--ink-soft, #6b6b6b); }
.sh-activity-step { display: flex; align-items: flex-start; gap: 8px; line-height: 1.35; }
.sh-activity-icon { flex: 0 0 14px; width: 14px; height: 14px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; margin-top: 1px; }
.sh-activity-icon.pending { color: var(--ink-faint, #9a9a9a); animation: sh-spin 1.1s linear infinite; }
.sh-activity-icon.ok { color: #1c7c4a; }
.sh-activity-icon.fail { color: #b3261e; }
.sh-activity-label { flex: 1; word-break: break-word; }
.sh-activity-label .sh-activity-tool { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: rgba(0,0,0,.04); padding: 1px 5px; border-radius: 3px; }
.sh-activity-label .sh-activity-detail { color: var(--ink-faint, #9a9a9a); }
.sh-activity-step.fail .sh-activity-label { color: #b3261e; }
@keyframes sh-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.sh-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.sh-chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 9px 16px; border-radius: 10px; font-size: 13.5px; cursor: pointer;
  transition: border-color .15s ease;
}
.sh-chip:hover { border-color: var(--ink); }

/* Result cards (margin-ranked supplier matches) */
.sh-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.sh-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 18px;
  background: var(--surface); display: flex; flex-direction: column;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.sh-card:hover { border-color: var(--ink); box-shadow: 0 4px 18px rgba(31,30,28,.06); }
.sh-card-rankrow { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sh-card-rank { font-size: 12px; font-weight: 700; color: var(--ink-faint); letter-spacing: .5px; }
.sh-card-margin {
  font-size: 11px; font-weight: 700; letter-spacing: .3px;
  color: #1c7c4a; background: #e8f5ec; border: 1px solid #cde9d6;
  padding: 3px 9px; border-radius: 999px;
}
.sh-card-name { font-family: var(--serif); font-size: 18px; line-height: 1.25; margin-bottom: 3px; }
.sh-card-supplier { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.sh-card-spec { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 14px; flex: 1; }
.sh-card-prices { display: flex; gap: 22px; padding: 12px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); margin-bottom: 12px; }
.sh-price-col { display: flex; flex-direction: column; gap: 2px; }
.sh-price-label { font-size: 10.5px; letter-spacing: .6px; text-transform: uppercase; color: var(--ink-faint); }
.sh-price-val { font-size: 18px; color: var(--ink); }
.sh-price-val.sell { color: var(--ink); font-weight: 600; }
.sh-card-pdf {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 8px; padding: 9px 12px; cursor: pointer;
  font-size: 12.5px; color: var(--ink); text-align: left;
  transition: border-color .15s ease, background .15s ease;
}
.sh-card-pdf:hover { border-color: var(--accent); background: var(--accent-soft); }
.sh-card-pdf svg { width: 15px; height: 15px; color: var(--accent); flex-shrink: 0; }

.sh-note {
  margin-top: 14px; padding: 11px 14px;
  background: var(--accent-soft); border: 1px solid #d9dcfb;
  border-radius: 10px; font-size: 12.5px; color: #3b349e;
}

/* ============ HERO EXPLAINER SECTIONS ============ */
.sh-section { width: 100%; max-width: var(--maxw); margin-top: 40px; }
.sh-section-title {
  font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 16px; text-align: center;
}

/* Flow */
.sh-flow {
  display: flex; align-items: stretch; justify-content: center;
  flex-wrap: wrap; gap: 6px;
}
.sh-flow-step {
  flex: 1; min-width: 120px;
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.sh-flow-num {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.sh-flow-t { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.sh-flow-d { font-size: 11.5px; color: var(--ink-soft); line-height: 1.4; }
.sh-flow-arrow { align-self: center; color: var(--ink-faint); font-size: 16px; }

/* Capabilities */
.sh-caps { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sh-cap {
  border: 1px solid var(--line); border-radius: 12px; padding: 18px; background: var(--surface);
}
.sh-cap-icon {
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; margin-bottom: 12px;
}
.sh-cap-icon svg { width: 18px; height: 18px; }
.sh-cap-t { font-size: 14.5px; font-weight: 600; margin-bottom: 4px; }
.sh-cap-d { font-size: 12.5px; color: var(--ink-soft); line-height: 1.45; }

/* SOP (collapsible) */
.sh-sop-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  padding: 14px 18px; cursor: pointer; font-size: 14px; color: var(--ink);
}
.sh-sop-toggle:hover { border-color: var(--ink-faint); }
.sh-sop-toggle svg { width: 16px; height: 16px; color: var(--ink-soft); transition: transform .2s ease; }
.sh-section.open .sh-sop-toggle svg { transform: rotate(180deg); }
.sh-sop {
  max-height: 0; overflow: hidden;
  transition: max-height .3s ease;
}
.sh-section.open .sh-sop { max-height: 900px; margin-top: 8px; }
.sh-sop-row {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 12px 4px; border-bottom: 1px solid var(--line-soft);
}
.sh-sop-row:last-child { border-bottom: none; }
.sh-sop-num {
  width: 26px; height: 26px; border-radius: 7px; flex-shrink: 0;
  background: var(--sidebar); color: var(--ink-soft);
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.sh-sop-t { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.sh-sop-d { font-size: 12.5px; color: var(--ink-soft); line-height: 1.45; }

/* Bottom composer (docked when in thread) */
.sh-dock {
  flex-shrink: 0; padding: 12px 20px 22px;
  display: flex; flex-direction: column; align-items: center;
}
.sh-dock .sh-composer { box-shadow: 0 -2px 16px rgba(31,30,28,.04); }
.sh-hint { font-size: 11px; color: var(--ink-faint); margin-top: 10px; text-align: center; }

/* ============ RESPONSIVE ============ */
.sh-help.sh-menu-btn { display: none; }
@media (max-width: 860px) {
  .sh-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 30;
    transform: translateX(-100%); transition: transform .25s ease;
    box-shadow: 0 0 40px rgba(0,0,0,.15);
  }
  .sh-sidebar.open { transform: translateX(0); }
  .sh-help.sh-menu-btn { display: grid; }
  /* On mobile the sidebar is an overlay; ignore the desktop collapse state. */
  .sh-app.collapsed .sh-sidebar { width: var(--sidebar-w); padding: 16px 12px; opacity: 1; border-right: 1px solid var(--line); }
  .sh-app.collapsed .sh-help.sh-reopen-btn { display: none; }
  .sh-main-top { justify-content: space-between; }
  .sh-greeting h1 { font-size: 26px; }
  .sh-cards { grid-template-columns: 1fr; }
  .sh-caps { grid-template-columns: 1fr; }
  .sh-flow { flex-direction: column; }
  .sh-flow-arrow { transform: rotate(90deg); }
  .sh-backdrop {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 20;
  }
  .sh-backdrop.show { display: block; }
}

/* ============ SHELDON EXPANDABLE ROWS ============ */
.sh-rows {
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 700px;
  background: var(--surface);
  margin-top: 10px;
  scrollbar-gutter: stable;
}
.sh-rows::-webkit-scrollbar { width: 9px; }
.sh-rows::-webkit-scrollbar-track { background: transparent; }
.sh-rows::-webkit-scrollbar-thumb { background: #dfe2ea; border-radius: 8px; }
.sh-rows::-webkit-scrollbar-thumb:hover { background: #c9cdd8; }
.sh-row + .sh-row { border-top: 1px solid var(--line); }

.sh-show-more {
  border: 0;
  border-top: 1px solid var(--line);
  background: var(--surface-muted, #f5f5f7);
  color: var(--ink, #1a1c1f);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 12px 16px;
  cursor: pointer;
  text-align: center;
  transition: background-color .12s ease;
  position: sticky; bottom: 0;
}
.sh-show-more:hover:not(:disabled) { background: #edeff4; }
.sh-show-more:disabled { opacity: 0.6; cursor: wait; }

/* Group heading for compound briefs (multi-intent search) */
.sh-rows-heading {
  padding: 10px 16px;
  background: var(--surface-muted, #f5f5f7);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #666);
  border-top: 1px solid var(--line);
}
.sh-rows > .sh-rows-heading:first-child { border-top: 0; }
.sh-rows-heading + .sh-row { border-top: 1px solid var(--line); }

.sh-row-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  transition: background-color .12s ease;
}
.sh-row-header:hover { background: var(--line-soft); }
.sh-row-header:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.sh-row-left {
  display: flex; align-items: center; gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}
.sh-row-thumb {
  width: 46px; height: 46px;
  object-fit: cover;
  object-position: center 25%;
  border-radius: 8px;
  background: var(--line-soft);
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.sh-row-rank {
  font-size: 11px; font-weight: 600;
  color: var(--ink-faint);
  min-width: 22px;
  letter-spacing: .3px;
}
.sh-row-title { min-width: 0; }
.sh-row-name {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sh-row-brand {
  font-size: 11px;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
  margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sh-row-brand strong { font-weight: 600; color: var(--ink-soft); }

.sh-row-right {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
  text-align: right;
}
.sh-row-price { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.sh-row-price-val {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.1px;
  font-variant-numeric: tabular-nums;
}
.sh-row-margin {
  font-size: 10.5px;
  color: #0f8a4a;
  background: #eafbf1;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: .2px;
}
.sh-row-chev {
  display: grid; place-items: center;
  width: 22px; height: 22px;
  color: var(--ink-faint);
  transition: transform .18s ease;
}
.sh-row-chev svg { width: 16px; height: 16px; }
.sh-row-open .sh-row-chev { transform: rotate(180deg); color: var(--accent); }

.sh-row-body {
  padding: 0;
  border-top: 1px solid var(--line-soft);
  background: #fafbfd;
  animation: shRowIn .18s ease;
  display: flex;
  flex-direction: column;
}
@keyframes shRowIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

/* ---- ZONE base ---- */
.sh-zone {
  padding: 16px 20px 16px 62px;
  position: relative;
}
.sh-zone + .sh-zone { border-top: 1px solid var(--line); }
.sh-zone-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* ---- ZONE 1: Why this ---- */
.sh-zone-why {
  display: flex;
  gap: 12px;
  align-items: stretch;
  padding-top: 14px;
  padding-bottom: 14px;
  background: linear-gradient(180deg, #f4f5ff 0%, #fafbfd 100%);
}
.sh-zone-why .sh-zone-stripe {
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
  flex-shrink: 0;
}
.sh-zone-why-text {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.55;
  padding: 2px 0;
}
.sh-zone-why-label {
  font-weight: 600;
  color: var(--accent);
  margin-right: 4px;
}

/* ---- ZONE 2: Product (image | details) ---- */
.sh-zone-product {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 20px;
}
.sh-zone-image-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sh-zone-image {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center 25%;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  cursor: zoom-in;
  transition: transform .12s ease, box-shadow .12s ease;
}
.sh-zone-image:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(30,35,48,.09);
}
.sh-zone-image-caption {
  font-size: 10px;
  color: var(--ink-faint);
  text-align: center;
  letter-spacing: 0.04em;
}
.sh-zone-product-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.sh-zone-product-heading {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 2px;
}
.sh-zone-product-name {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--ink);
  line-height: 1.25;
}
.sh-zone-product-designer {
  font-size: 12px;
  font-style: italic;
  color: var(--ink-soft);
  margin-top: 4px;
}
.sh-zone-product-desc {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 10px 0 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}
.sh-zone-product-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 12px;
  font-size: 12px;
  line-height: 1.5;
  align-items: baseline;
}
.sh-zone-product-label {
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10px;
}
.sh-zone-product-value {
  color: var(--ink);
  word-wrap: break-word;
}
.sh-dim-chip {
  display: inline-block;
  padding: 2px 8px;
  background: var(--sidebar);
  border-radius: 999px;
  font-size: 11px;
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
}

/* ---- ZONE 3: The Deal (pricing) ---- */
.sh-zone-deal {
  background: #f7f8fb;
}
.sh-deal-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.sh-deal-cell {
  position: relative;
  background: #fff;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sh-deal-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sh-deal-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}
.sh-deal-meta {
  font-size: 11px;
  color: var(--ink-soft);
  margin-top: 10px;
  line-height: 1.5;
}

/* Info button — visibly clickable */
.sh-row-stat-info {
  display: inline-grid;
  place-items: center;
  width: 20px; height: 20px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  font-family: inherit;
  transition: color .12s ease, background .12s ease, border-color .12s ease, transform .1s ease;
}
.sh-row-stat-info svg {
  width: 14px;
  height: 14px;
  display: block;
}
.sh-row-stat-info:hover {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-soft);
}
.sh-row-stat-info:focus-visible {
  outline: none;
  color: var(--accent);
  border-color: var(--accent);
}
.sh-row-stat-info:active {
  transform: scale(0.92);
}
.sh-row-stat-info.sh-info-open {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
/* Popover is portalled to <body> at viewport-fixed coordinates so it
   escapes parent containers with overflow: hidden. JS sets top/left. */
.sh-row-stat-popover {
  position: fixed;
  z-index: 9999;
  padding: 10px 12px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: normal;
  text-transform: none;
  border-radius: 8px;
  width: max-content;
  max-width: 280px;
  box-shadow: 0 8px 24px rgba(30,35,48,.22);
  animation: shPopIn .14s ease-out both;   /* both = keep final state */
  white-space: normal;
  word-break: break-word;
  opacity: 1;                              /* explicit final state */
  /* CSS var set by JS to point the arrow at the ⓘ */
  --sh-arrow-left: 16px;
}
/* Arrow pointing at the icon */
.sh-row-stat-popover::before {
  content: "";
  position: absolute;
  left: var(--sh-arrow-left);
  width: 10px; height: 10px;
  background: var(--ink);
  transform: translateX(-50%) rotate(45deg);
  border-radius: 2px;
}
/* Popover BELOW the icon → arrow on top */
.sh-row-stat-popover.sh-pop-below::before { top: -5px; }
/* Popover ABOVE the icon → arrow on bottom */
.sh-row-stat-popover.sh-pop-above::before { bottom: -5px; }
@keyframes shPopIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

/* Budget badge */
.sh-budget-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: normal;
  text-transform: none;
}
.sh-badge-ok { background: #eafbf1; color: #0f8a4a; }
.sh-badge-warn { background: #fff4dc; color: #a26c00; }
.sh-badge-over { background: #fde8e8; color: #b02020; }

/* ---- ZONE 4: Actions ---- */
.sh-zone-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.sh-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform .1s ease, background .1s ease, border-color .1s ease;
  font-family: inherit;
}
.sh-btn svg { width: 14px; height: 14px; }
.sh-btn-primary {
  background: var(--dark);
  color: #fff;
}
.sh-btn-primary:hover {
  background: #2a2f3d;
  transform: translateY(-1px);
}
.sh-btn-secondary {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--line);
}
.sh-btn-secondary:hover {
  background: var(--line-soft);
  color: var(--ink);
  border-color: var(--ink-faint);
}
.sh-variants-list {
  flex-basis: 100%;
  margin-top: 4px;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.sh-variant-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 90px 74px 74px 60px 40px;
  gap: 10px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--ink-soft);
  align-items: baseline;
}
.sh-variant-row + .sh-variant-row { border-top: 1px solid var(--line-soft); }
.sh-variant-hdr {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  background: var(--line-soft);
  font-weight: 600;
}
.sh-variant-idx { color: var(--ink-faint); }
.sh-variant-combo { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-variant-code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sh-variant-price { font-weight: 600; color: var(--ink); text-align: right; }
.sh-variant-trade { color: var(--ink-soft); text-align: right; }
.sh-variant-margin { color: var(--ink-soft); text-align: right; }
.sh-variant-page {
  color: var(--accent, #2563eb);
  text-align: right;
  text-decoration: none;
}
.sh-variant-page:hover { text-decoration: underline; }
/* On narrow screens, hide the least essential columns so the row stays legible */
@media (max-width: 640px) {
  .sh-variant-row {
    grid-template-columns: 28px minmax(0, 1fr) 74px 60px 40px;
  }
  .sh-variant-code,
  .sh-variant-trade { display: none; }
}
.sh-actions-note {
  flex-basis: 100%;
  font-size: 11px;
  color: var(--ink-faint);
  line-height: 1.5;
  margin-top: 2px;
}

/* Responsive */
@media (max-width: 860px) {
  .sh-row-header { padding: 12px 14px; }
  .sh-row-name { font-size: 15px; }
  .sh-zone { padding: 14px; }
  .sh-zone-product { grid-template-columns: 1fr; }
  .sh-zone-image-wrap { max-width: 200px; margin: 0 auto; }
  .sh-deal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sh-row-price-val { font-size: 14px; }
}
