/* OpenSpot design system: "signal room".
   - A cool porcelain (light) or deep blue-graphite (dark) canvas; the logo orange is a signal,
     used for what needs you and for the main action. A cool iris is its counter-light (focus, Ask).
   - A graphite navigation rail in both themes, so the workspace reads as glass on light.
   - Bricolage Grotesque (variable width + weight) for titles and numbers; the system face for text.
   - Glass layers over a slow aurora whose colours change with the section you are in.
   - Motion answers what you do (open, switch, finish); the page title is the one arrival moment.
   - Full reduced-motion / transparency / contrast fallbacks at the end of this file. */

@font-face {
  font-family: "Bricolage";
  src: url(/fonts/bricolage-grotesque.woff2) format("woff2");
  font-weight: 200 800; font-stretch: 75% 100%; font-display: swap;
}

/* Registered so the aurora can cross-fade between sections. */
@property --aura-1 { syntax: "<color>"; inherits: true; initial-value: rgba(255, 72, 0, 0.45); }
@property --aura-2 { syntax: "<color>"; inherits: true; initial-value: rgba(91, 91, 247, 0.33); }
@property --aura-3 { syntax: "<color>"; inherits: true; initial-value: rgba(255, 179, 138, 0.48); }

:root {
  --background: #ebeef2;
  --foreground: #16181d;
  --card: rgba(255, 255, 255, .56);
  --card-solid: #ffffff;
  --card-foreground: #16181d;
  --popover: rgba(255, 255, 255, .84);
  --primary: #d93a00;              /* brand orange at 4.6:1 with white text */
  --primary-hover: #c23400;
  --primary-foreground: #ffffff;
  --secondary: rgba(22, 24, 29, .055);
  --secondary-foreground: #16181d;
  --muted: rgba(22, 24, 29, .04);
  --muted-foreground: #5a6070;
  --accent: rgba(255, 72, 0, .075);
  --accent-foreground: #16181d;
  --destructive: #c4231b;
  --border: rgba(22, 24, 29, .085);
  --input: rgba(22, 24, 29, .15);
  --ring: #5b5bf7;
  --radius: 0.75rem;
  --brand: #ff4800;
  --brand-soft: rgba(255, 72, 0, .1);
  --brand-text: #c23400;
  --iris: #5b5bf7; --iris-soft: rgba(91, 91, 247, .11); --iris-text: #4343d6;
  --good: #14804a; --good-soft: rgba(20, 128, 74, .1);
  --warn: #b45309; --warn-soft: rgba(180, 83, 9, .1);
  --danger: var(--destructive);
  --info: #2459c2; --info-soft: rgba(36, 89, 194, .1);
  /* the rail stays graphite in both themes */
  --rail: rgba(22, 24, 29, .94); --rail-fg: #c9cdd6; --rail-muted: #858b9a; --rail-hover: rgba(255, 255, 255, .06); --rail-line: rgba(255, 255, 255, .07);
  /* glass */
  --glass-edge: rgba(255, 255, 255, .8);
  --glass-hi: rgba(255, 255, 255, .95);
  --glass-chrome: rgba(238, 241, 245, .7);
  --edge-grad: linear-gradient(160deg, rgba(255, 255, 255, .95), rgba(255, 255, 255, .35) 38%, rgba(22, 24, 29, .07) 100%);
  --spot: rgba(255, 110, 50, .12);
  --shadow-xs: 0 1px 2px rgba(22, 24, 29, .05);
  --shadow: 0 1px 2px rgba(22, 24, 29, .04), 0 14px 34px -16px rgba(22, 24, 29, .2);
  --shadow-hover: 0 2px 4px rgba(22, 24, 29, .05), 0 24px 46px -18px rgba(22, 24, 29, .3);
  --shadow-lg: 0 2px 8px rgba(22, 24, 29, .06), 0 32px 72px -18px rgba(22, 24, 29, .36);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --display: "Bricolage", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);          /* settles without overshoot */
  --spring: cubic-bezier(.34, 1.4, .64, 1);      /* a touch of bounce, for small things */
  /* a critically-damped spring, for things that travel (rail indicator, palette, island) */
  --glide: linear(0, .0066, .0257, .0555, .0943 7.9%, .1914, .2992 15.7%, .4072, .5089 25.1%, .6018, .6844 34.9%, .7559 40.4%, .8165 45.7%, .8662 51.2%, .9056 56.9%, .9371 62.9%, .9605 69.4%, .9773 76.4%, .9885 84.1%, .9961 92.5%, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --background: #0c0e13; --foreground: #eceef2; --card: rgba(24, 27, 34, .6); --card-solid: #181b22; --card-foreground: #eceef2;
    --popover: rgba(26, 29, 37, .88); --primary: #ff5a1f; --primary-hover: #ff7340; --primary-foreground: #170803;
    --secondary: rgba(255, 255, 255, .07); --secondary-foreground: #eceef2; --muted: rgba(255, 255, 255, .045); --muted-foreground: #9ba2b1;
    --accent: rgba(255, 90, 31, .12); --accent-foreground: #eceef2; --destructive: #ff7b72; --border: rgba(255, 255, 255, .08); --input: rgba(255, 255, 255, .14);
    --ring: #8b8bff; --brand: #ff5a1f; --brand-soft: rgba(255, 90, 31, .15); --brand-text: #ff8a5c;
    --iris: #8b8bff; --iris-soft: rgba(139, 139, 255, .14); --iris-text: #a9a9ff;
    --good: #5fd08b; --good-soft: rgba(95, 208, 139, .12); --warn: #f2a65a; --warn-soft: rgba(242, 166, 90, .12); --info: #8db4ef; --info-soft: rgba(141, 180, 239, .12);
    --rail: rgba(30, 33, 42, .72); --rail-line: rgba(255, 255, 255, .07);
    --glass-edge: rgba(255, 255, 255, .08); --glass-hi: rgba(255, 255, 255, .09); --glass-chrome: rgba(12, 14, 19, .66);
    --edge-grad: linear-gradient(160deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .04) 40%, rgba(255, 255, 255, .02));
    --spot: rgba(255, 120, 60, .1);
    --shadow-xs: none; --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 18px 42px -18px rgba(0, 0, 0, .75);
    --shadow-hover: 0 26px 52px -18px rgba(0, 0, 0, .85); --shadow-lg: 0 32px 80px -16px rgba(0, 0, 0, .9);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --background: #0c0e13; --foreground: #eceef2; --card: rgba(24, 27, 34, .6); --card-solid: #181b22; --card-foreground: #eceef2;
  --popover: rgba(26, 29, 37, .88); --primary: #ff5a1f; --primary-hover: #ff7340; --primary-foreground: #170803;
  --secondary: rgba(255, 255, 255, .07); --secondary-foreground: #eceef2; --muted: rgba(255, 255, 255, .045); --muted-foreground: #9ba2b1;
  --accent: rgba(255, 90, 31, .12); --accent-foreground: #eceef2; --destructive: #ff7b72; --border: rgba(255, 255, 255, .08); --input: rgba(255, 255, 255, .14);
  --ring: #8b8bff; --brand: #ff5a1f; --brand-soft: rgba(255, 90, 31, .15); --brand-text: #ff8a5c;
  --iris: #8b8bff; --iris-soft: rgba(139, 139, 255, .14); --iris-text: #a9a9ff;
  --good: #5fd08b; --good-soft: rgba(95, 208, 139, .12); --warn: #f2a65a; --warn-soft: rgba(242, 166, 90, .12); --info: #8db4ef; --info-soft: rgba(141, 180, 239, .12);
  --rail: rgba(30, 33, 42, .72); --rail-line: rgba(255, 255, 255, .07);
  --glass-edge: rgba(255, 255, 255, .08); --glass-hi: rgba(255, 255, 255, .09); --glass-chrome: rgba(12, 14, 19, .66);
  --edge-grad: linear-gradient(160deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .04) 40%, rgba(255, 255, 255, .02));
  --spot: rgba(255, 120, 60, .1);
  --shadow-xs: none; --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 18px 42px -18px rgba(0, 0, 0, .75);
  --shadow-hover: 0 26px 52px -18px rgba(0, 0, 0, .85); --shadow-lg: 0 32px 80px -16px rgba(0, 0, 0, .9);
  color-scheme: dark;
}

/* Aurora colours by section: warm where work is due, cool where you think or look things up. */
:root { transition: --aura-1 1.2s ease, --aura-2 1.2s ease, --aura-3 1.2s ease, background-color .3s ease; }
:root[data-section="ask"] { --aura-1: rgba(91, 91, 247, 0.51); --aura-2: rgba(176, 120, 255, 0.39); --aura-3: rgba(255, 110, 60, 0.21); }
:root[data-section="deals"] { --aura-1: rgba(255, 140, 60, 0.51); --aura-2: rgba(255, 72, 0, 0.3); --aura-3: rgba(91, 91, 247, 0.21); }
:root[data-section="dashboard"] { --aura-1: rgba(91, 91, 247, 0.33); --aura-2: rgba(255, 72, 0, 0.36); --aura-3: rgba(70, 190, 255, 0.3); }
:root[data-section="list"], :root[data-section="o"], :root[data-section="search"] { --aura-1: rgba(255, 72, 0, 0.33); --aura-2: rgba(91, 91, 247, 0.3); --aura-3: rgba(255, 200, 170, 0.36); }
:root:is([data-section="settings"], [data-section="connectors"], [data-section="history"], [data-section="import"], [data-section="trash"], [data-section="duplicates"]) {
  --aura-1: rgba(120, 140, 175, 0.39); --aura-2: rgba(91, 91, 247, 0.22); --aura-3: rgba(255, 110, 60, 0.18);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { background: var(--background); }
body { color: var(--foreground); font: 0.875rem/1.5 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; background: transparent; font-feature-settings: "cv11", "ss01"; }

/* The aurora behind the glass. It drifts slowly so the translucent layers above have
   something alive to refract; it never moves fast enough to pull the eye. */
body::before {
  content: ""; position: fixed; inset: -25vmax; z-index: -2; pointer-events: none;
  background:
    /* the layer overhangs the screen by 25vmax for the drift; visible area is ~17%-83% of it */
    radial-gradient(30vmax 24vmax at 36% 24%, var(--aura-1), transparent 66%),
    radial-gradient(28vmax 24vmax at 78% 26%, var(--aura-2), transparent 66%),
    radial-gradient(34vmax 26vmax at 68% 78%, var(--aura-3), transparent 64%),
    radial-gradient(24vmax 20vmax at 34% 76%, var(--aura-2), transparent 66%);
  animation: aurora 48s ease-in-out infinite alternate;
}
:root[data-theme="dark"] body::before { filter: brightness(1.5) saturate(1.25); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body::before { filter: brightness(1.5) saturate(1.25); } }
@keyframes aurora {
  0% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  50% { transform: translate3d(3vmax, -2vmax, 0) rotate(8deg) scale(1.06); }
  100% { transform: translate3d(-2vmax, 2vmax, 0) rotate(-6deg) scale(1.02); }
}
/* Fine grain keeps large blurred areas from banding. */
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .32; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: var(--brand-text); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
input, select, textarea, button { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 45%, transparent); border-radius: 8px; }
::selection { background: color-mix(in srgb, var(--iris) 22%, transparent); }

/* Display type: Bricolage, condensed and heavy at large sizes, opening up as it gets smaller. */
h1 { font-family: var(--display); font-size: 1.875rem; line-height: 1; font-weight: 760; font-stretch: 82%; letter-spacing: -0.025em; margin: 0; }
h2 { font-family: var(--display); font-size: 1.0625rem; line-height: 1.25; font-weight: 680; font-stretch: 92%; letter-spacing: -0.01em; margin: 0 0 12px; }
h3 { font-size: 0.8125rem; line-height: 1.4; color: var(--muted-foreground); font-weight: 600; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
h3 .count { font-family: var(--display); font-weight: 700; color: var(--foreground); font-variant-numeric: tabular-nums; }
code, kbd { font-family: var(--mono); font-size: 0.85em; }

/* ---------- icons (Lucide) ---------- */
/* pointer-events: none so clicks on an icon land on its button (handlers read the button). */
.ic { width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: -3px; pointer-events: none; transition: transform .35s var(--spring); }
.ic.lg { width: 20px; height: 20px; }
/* Each icon hints at its action on hover. */
:is(.btn, .icon-btn, a, button):hover > .ic-plus { transform: rotate(90deg); }
:is(.btn, .icon-btn, a, button):hover > .ic-download { transform: translateY(2px); }
:is(.btn, .icon-btn, a, button):hover > .ic-upload { transform: translateY(-2px); }
:is(.btn, .icon-btn, a, button):hover > :is(.ic-arrow-right, .ic-chevron-right, .ic-send, .ic-external-link) { transform: translateX(2px); }
:is(.btn, .icon-btn, a, button):hover > .ic-arrow-up { transform: translateY(-2px); }
:is(.btn, .icon-btn, a, button):hover > .ic-refresh-cw { transform: rotate(180deg); }
:is(.btn, .icon-btn, a, button):hover > .ic-x { transform: rotate(90deg) scale(.9); }
:is(.btn, .icon-btn, a, button):hover > .ic-trash-2 { animation: wiggle .4s var(--ease); }
:is(.btn, .icon-btn, a, button):hover > :is(.ic-check, .ic-check-check, .ic-copy, .ic-mail, .ic-unplug) { transform: scale(1.14); }
:is(.btn, .icon-btn, a, button):hover > .ic-settings { transform: rotate(60deg); }
.spin { animation: spin .9s linear infinite; }
@keyframes wiggle { 25% { transform: rotate(-10deg); } 60% { transform: rotate(8deg); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- glass surfaces ---------- */
.glass, .card, .top, .side, dialog, .search-pop, .toast, .palette-box {
  -webkit-backdrop-filter: blur(26px) saturate(180%); backdrop-filter: blur(26px) saturate(180%);
}

/* ---------- chrome ---------- */
.top {
  position: sticky; top: 0; z-index: 30; height: 60px;
  display: flex; align-items: center; gap: 12px; padding: 0 18px;
  background: var(--glass-chrome);
  border-bottom: 1px solid var(--border);
  box-shadow: inset 0 -1px 0 var(--glass-edge);
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--foreground); width: 206px; flex: none; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 30px; height: 30px; flex: none; transition: transform .6s var(--spring); filter: drop-shadow(0 2px 8px rgba(255, 72, 0, .4)); }
.brand:hover .mark { transform: rotate(-20deg) scale(1.05); }
.brand:active .mark { transform: rotate(-20deg) scale(.9); transition-duration: .12s; }
.wordmark { font-family: var(--display); font-size: 1.4rem; font-weight: 780; font-stretch: 80%; letter-spacing: -0.02em; line-height: 1; }
.search { position: relative; flex: 1; max-width: 560px; }
.search .ic-search { position: absolute; left: 13px; top: 11px; color: var(--muted-foreground); pointer-events: none; }
.search input {
  width: 100%; height: 38px; padding: 0 64px 0 38px; border-radius: 12px; border: 1px solid var(--input);
  background: color-mix(in srgb, var(--card-solid) 55%, transparent); box-shadow: var(--shadow-xs), inset 0 1px 0 var(--glass-hi);
  transition: background-color .2s, border-color .2s, box-shadow .2s;
}
.search input::placeholder { color: var(--muted-foreground); }
.search input:focus { outline: none; background: var(--card-solid); border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 28%, transparent); }
.search kbd { position: absolute; right: 9px; top: 8px; padding: 2px 7px; border-radius: 7px; border: 1px solid var(--border); color: var(--muted-foreground); font-size: 11px; background: var(--card-solid); transition: opacity .15s, color .15s, border-color .15s; cursor: pointer; }
.search kbd:hover { color: var(--iris-text); border-color: color-mix(in srgb, var(--iris) 40%, transparent); }
.search input:focus ~ kbd { opacity: 0; }
.search-pop {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 40;
  background: var(--popover); border: 1px solid var(--glass-edge); border-radius: 16px; box-shadow: var(--shadow-lg); max-height: 440px; overflow-y: auto; padding: 6px;
  transform-origin: top center; animation: materialize .24s var(--ease);
}
.search-pop a { display: block; padding: 9px 10px; color: var(--foreground); border-radius: 10px; transition: background-color .12s; }
.search-pop a:hover, .search-pop a.sel { background: var(--accent); text-decoration: none; }
.search-pop .snip { color: var(--muted-foreground); font-size: 12px; }
.top .menu { display: none; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: calc(100vh - 60px); }

/* The rail: graphite glass in both themes, with one glowing indicator that travels. */
.side {
  position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; padding: 14px 12px 18px;
  display: flex; flex-direction: column; background: var(--rail); color: var(--rail-fg);
  border-right: 1px solid var(--rail-line); box-shadow: inset -1px 0 0 rgba(255, 255, 255, .03);
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent;
}
.side nav { position: relative; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-ind {
  position: absolute; left: 0; right: 0; top: 0; height: 36px; border-radius: 10px; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, rgba(255, 72, 0, .2), rgba(255, 255, 255, .06) 70%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07), inset 0 1px 0 rgba(255, 255, 255, .08);
  transition: transform .55s var(--glide), height .55s var(--glide), opacity .3s;
}
.nav-ind::before { /* the signal bar */
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--brand); box-shadow: 0 0 12px 2px rgba(255, 72, 0, .65), 0 0 2px rgba(255, 140, 90, .9);
}
.nav-ind.on { opacity: 1; }
.side nav a {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 11px; color: var(--rail-fg); padding: 8px 10px; border-radius: 10px;
  font-weight: 520; transition: background-color .18s, color .18s, transform .15s var(--ease);
}
.side nav a .ic { color: var(--rail-muted); transition: transform .35s var(--spring), color .18s, filter .2s; }
.side nav a:hover { background: var(--rail-hover); color: #fff; text-decoration: none; }
.side nav a:hover .ic { transform: translateX(1px) scale(1.12); color: #fff; }
.side nav a:active { transform: scale(.98); }
.side nav a.active { color: #fff; font-weight: 620; }
.side nav a.active:hover { background: transparent; }
.side nav a.active .ic { color: #ff7a45; filter: drop-shadow(0 0 6px rgba(255, 72, 0, .7)); }
.side nav a:focus-visible { box-shadow: 0 0 0 2px rgba(139, 139, 255, .8); }
.nav-label { font-size: 12px; color: var(--rail-muted); padding: 18px 10px 6px; font-weight: 560; }
.side-foot { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--rail-muted); padding: 14px 10px 0; border-top: 1px solid var(--rail-line); margin-top: 14px; }
.side .pill { background: rgba(255, 255, 255, .08); color: var(--rail-fg); }
.side .icon-btn { color: var(--rail-muted); }
.side .icon-btn:hover { background: var(--rail-hover); color: #fff; }

#view { padding: 32px 36px 64px; max-width: 1320px; width: 100%; outline: none; }

/* ---------- page title: the one arrival moment ---------- */
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head .spacer { flex: 1; }
.page-head h1 {
  font-size: clamp(2.1rem, 1.25rem + 2.3vw, 3.1rem); font-weight: 780; font-stretch: 76%; letter-spacing: -0.03em; line-height: .92;
  animation: title-in .9s var(--glide) both;
}
.page-head > .pill, .page-head > .muted, .page-head > .sub { margin-bottom: 4px; }
/* Saving or refreshing the same page keeps the title still. */
#view.same-page .page-head h1 { animation: none; }
/* The title arrives wide and light, then condenses and gains weight as it settles. */
@keyframes title-in {
  from { opacity: 0; font-stretch: 100%; font-weight: 300; letter-spacing: .01em; filter: blur(6px); transform: translateY(6px); }
  60% { opacity: 1; filter: blur(0); }
}
.sub { color: var(--muted-foreground); margin-top: 8px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- shadcn: Card, as layered glass with a lit edge ---------- */
.card {
  position: relative; color: var(--card-foreground);
  border: 1px solid transparent; border-radius: 20px; padding: 20px;
  /* spotlight where the pointer is (set by app.js), the glass, then a gradient edge catching light from above */
  background:
    radial-gradient(520px circle at var(--mx, -9999px) var(--my, -9999px), var(--spot), transparent 42%) padding-box,
    linear-gradient(var(--card), var(--card)) padding-box,
    var(--edge-grad) border-box;
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-hi);
  transition: box-shadow .3s var(--ease), transform .3s var(--ease);
}
.card h2 { display: flex; align-items: center; gap: 8px; }
.card h2 .ic { color: var(--brand); }
/* Clickable cards lift; reading cards stay put (motion only where it means something). */
.kpi, .lift { cursor: pointer; }
.kpi:hover, .lift:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover), inset 0 1px 0 var(--glass-hi); }
.kpi:active, .lift:active { transform: translateY(-1px) scale(.99); transition-duration: .1s; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { color: inherit; text-decoration: none !important; padding: 16px 18px 18px; border-radius: 18px; overflow: hidden; container-type: inline-size; }
.kpi .label { display: flex; align-items: center; justify-content: space-between; color: var(--muted-foreground); font-size: 12.5px; font-weight: 550; }
.kpi .label .chip { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); transition: transform .4s var(--spring); }
.kpi:hover .label .chip { transform: scale(1.1) rotate(-6deg); }
.kpi .value { white-space: nowrap; font-family: var(--display); font-size: clamp(1.25rem, 17cqi, 2.4rem); line-height: 1; font-weight: 760; font-stretch: 80%; letter-spacing: -0.03em; margin-top: 14px; font-variant-numeric: tabular-nums; }
/* The overdue tile is the one that glows: it is the number that asks for action. */
.kpi.signal .value { color: var(--brand-text); }
.kpi.signal {
  background:
    radial-gradient(520px circle at var(--mx, -9999px) var(--my, -9999px), var(--spot), transparent 42%) padding-box,
    linear-gradient(160deg, color-mix(in srgb, var(--brand) 9%, var(--card)), var(--card) 60%) padding-box,
    linear-gradient(160deg, rgba(255, 72, 0, .75), rgba(255, 72, 0, .15) 45%, rgba(255, 72, 0, .05)) border-box;
  box-shadow: var(--shadow), 0 10px 30px -14px rgba(255, 72, 0, .45), inset 0 1px 0 var(--glass-hi);
}
.kpi.signal .label .chip { background: var(--brand); color: #fff; box-shadow: 0 0 14px rgba(255, 72, 0, .5); }

/* ---------- shadcn: Button ---------- */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px;
  border-radius: calc(var(--radius) - 2px); font-size: 0.875rem; font-weight: 550; white-space: nowrap; cursor: pointer;
  /* default: outline */
  background: color-mix(in srgb, var(--card-solid) 70%, transparent); color: var(--foreground);
  border: 1px solid var(--input); box-shadow: var(--shadow-xs), inset 0 1px 0 var(--glass-hi);
  text-decoration: none !important; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: background-color .18s, border-color .18s, box-shadow .2s, transform .12s var(--ease), color .18s;
}
.btn:hover { background: var(--card-solid); border-color: color-mix(in srgb, var(--input) 60%, var(--foreground) 25%); }
.btn:active { transform: scale(.97); transition-duration: 0s; }
.btn:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 40%, transparent); }
.btn:disabled { opacity: .5; pointer-events: none; }
/* default (primary) */
.btn.primary {
  background: var(--primary); color: var(--primary-foreground); border-color: transparent; font-weight: 650;
  background-image: linear-gradient(to bottom, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 1px 2px rgba(0, 0, 0, .12), 0 6px 16px -6px color-mix(in srgb, var(--brand) 75%, transparent);
}
.btn.primary:hover { background-color: var(--primary-hover); box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 2px 4px rgba(0, 0, 0, .14), 0 10px 22px -8px color-mix(in srgb, var(--brand) 85%, transparent); }
/* A soft sheen crosses primary buttons on hover. */
.btn.primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .28) 50%, transparent 70%); transform: translateX(-120%); pointer-events: none; }
.btn.primary:hover::after { transform: translateX(120%); transition: transform .8s var(--ease); }
.btn.secondary { background: var(--secondary); border-color: transparent; box-shadow: none; }
.btn.secondary:hover { background: color-mix(in srgb, var(--secondary) 100%, var(--foreground) 6%); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--accent); }
.btn.danger { color: var(--destructive); }
.btn.danger:hover { background: color-mix(in srgb, var(--destructive) 10%, var(--card-solid)); border-color: color-mix(in srgb, var(--destructive) 40%, transparent); }
.btn.link { background: none; border: 0; box-shadow: none; color: var(--brand-text); padding: 0; height: auto; }
.btn.link:hover { text-decoration: underline !important; }
.btn.sm { height: 32px; padding: 0 11px; gap: 6px; font-size: 0.8125rem; }
.btn.lg { height: 42px; padding: 0 22px; font-size: 0.9375rem; }
.btn.icon { width: 36px; padding: 0; }
.icon-btn {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border: 0; background: none; cursor: pointer; border-radius: 9px; color: var(--muted-foreground);
  transition: transform .12s var(--ease), background-color .15s, color .15s;
}
.icon-btn:hover { background: var(--secondary); color: var(--foreground); }
.icon-btn:active { transform: scale(.9); transition-duration: 0s; }

/* ---------- badges (shadcn Badge) ---------- */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 999px; font-size: 12px; line-height: 1.65; font-weight: 550; background: var(--secondary); border: 1px solid transparent; color: var(--muted-foreground); white-space: nowrap; transition: background-color .15s, color .15s, transform .2s var(--ease); }
a.pill:hover { text-decoration: none; color: var(--foreground); transform: translateY(-1px); }
.pill.accent { background: var(--brand-soft); color: var(--brand-text); }
.pill.wrap { white-space: normal; max-width: 100%; line-height: 1.4; padding-block: 3px; }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.info { background: var(--info-soft); color: var(--info); }
.tags { display: flex; gap: 4px; flex-wrap: wrap; }
.empty { color: var(--muted-foreground); padding: 40px 24px; text-align: center; }
.empty::before { content: ""; display: block; width: 46px; height: 46px; margin: 0 auto 14px; background: url(/brand/mark-192.png) center/contain no-repeat; filter: drop-shadow(0 6px 14px rgba(255, 72, 0, .3)); animation: float 5s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-4px); } }
.muted { color: var(--muted-foreground); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }

/* ---------- shadcn: Input, Select, Textarea ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; color: var(--foreground); font-weight: 550; }
.field input, .field select, .field textarea, .inline-input, select.inline-input {
  min-height: 36px; padding: 7px 12px; border: 1px solid var(--input); border-radius: calc(var(--radius) - 2px);
  background: color-mix(in srgb, var(--card-solid) 60%, transparent); width: 100%; box-shadow: var(--shadow-xs);
  transition: border-color .18s, box-shadow .18s, background-color .18s;
}
.field input:hover, .field select:hover, .field textarea:hover, .inline-input:hover { border-color: color-mix(in srgb, var(--input) 60%, var(--foreground) 20%); }
.field input:focus, .field select:focus, .field textarea:focus, .inline-input:focus { outline: none; background: var(--card-solid); border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 28%, transparent); }
.field textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); width: 15px; height: 15px; }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 12px; color: var(--muted-foreground); font-weight: 600; white-space: nowrap; }
tbody tr { cursor: pointer; transition: background-color .15s; }
tbody tr:hover { background: var(--accent); }
tbody tr:hover .avatar { transform: scale(1.08); }
tbody tr:active { background: var(--brand-soft); }
tbody tr:last-child td { border-bottom: 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters .inline-input { width: auto; min-width: 170px; }
.pager { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 14px; }

/* ---------- today ---------- */
.att { display: flex; gap: 12px; align-items: center; padding: 11px 10px; margin: 0 -10px; border-radius: 12px; transition: background-color .15s; }
.att + .att { box-shadow: 0 -1px 0 var(--border); }
.att:hover { background: var(--accent); }
/* Finishing an item: it is struck through, slides off, and the list closes the gap. */
.att.leaving { animation: att-leave .5s var(--ease) forwards; pointer-events: none; }
.att.leaving .what b { text-decoration: line-through; text-decoration-color: var(--brand); text-decoration-thickness: 2px; }
.att.leaving .kind { background: var(--good-soft); color: var(--good); transform: scale(1.12); }
@keyframes att-leave { 30% { opacity: 1; transform: none; max-height: var(--h); } to { opacity: 0; transform: translateX(28px); max-height: 0; padding-block: 0; margin-block: 0; } }
.att .what { flex: 1; min-width: 0; }
.att .what a { color: var(--foreground); font-weight: 600; }
.att .when { color: var(--muted-foreground); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kind { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; color: var(--muted-foreground); background: var(--secondary); transition: transform .35s var(--spring); }
.att:hover .kind { transform: scale(1.08) rotate(-4deg); }
.kind.k-follow_up { color: var(--brand); background: var(--brand-soft); } .kind.k-outreach { color: var(--info); background: var(--info-soft); }
.kind.k-waiting { color: var(--warn); background: var(--warn-soft); } .kind.k-deal { color: var(--destructive); background: color-mix(in srgb, var(--destructive) 12%, transparent); }
.kind.k-meeting { color: #7c5cd6; background: rgba(124, 92, 214, .12); }
.legend .row { gap: 10px; } .legend .kind { width: 26px; height: 26px; border-radius: 8px; }

/* ---------- record ---------- */
.rec-head { display: flex; gap: 16px; align-items: center; margin-bottom: 24px; flex-wrap: wrap; }
.avatar { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; font-weight: 750; font-size: 16px; flex: none;
  background: linear-gradient(145deg, color-mix(in srgb, var(--brand) 22%, transparent), color-mix(in srgb, var(--brand) 8%, transparent)); color: var(--brand-text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 18%, transparent); transition: transform .35s var(--spring); }
.avatar.company { border-radius: 14px; background: linear-gradient(145deg, #2b2f3a, #16181d); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12); }
.rec-title input { font-family: var(--display); font-size: clamp(1.9rem, 1.2rem + 1.8vw, 2.6rem); line-height: 1.05; font-weight: 760; font-stretch: 78%; letter-spacing: -0.025em; border: 1px solid transparent; background: none; padding: 2px 8px; border-radius: 10px; margin-left: -8px; width: min(560px, 70vw); transition: border-color .15s, background-color .15s; }
.rec-title input:hover, .rec-title input:focus { border-color: var(--input); background: var(--card); outline: none; }
.rec-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.tl-item { display: flex; gap: 12px; padding: 12px 0; }
.tl-item + .tl-item { box-shadow: 0 -1px 0 var(--border); }
.tl-icon { width: 32px; height: 32px; border-radius: 10px; background: var(--secondary); display: grid; place-items: center; flex: none; color: var(--muted-foreground); transition: transform .35s var(--spring), color .2s; }
.tl-item:hover .tl-icon { transform: scale(1.08); color: var(--brand); }
.tl-body { flex: 1; min-width: 0; }
.tl-meta { color: var(--muted-foreground); font-size: 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; }
.check input { margin-top: 3px; }
.check.done .t { text-decoration: line-through; color: var(--muted-foreground); }
.edge { display: flex; gap: 10px; align-items: center; padding: 8px 0; }
.edge + .edge { box-shadow: 0 -1px 0 var(--border); }
.edge .rel { font-size: 11px; color: var(--muted-foreground); }
/* shadcn Tabs */
.tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--secondary); border-radius: calc(var(--radius) - 1px); margin-bottom: 16px; }
.tabs button { border: 0; background: none; padding: 5px 14px; cursor: pointer; color: var(--muted-foreground); border-radius: calc(var(--radius) - 4px); font-weight: 600; font-size: 13px; transition: background-color .2s var(--ease), color .2s, box-shadow .2s, transform .12s; }
.tabs button:hover { color: var(--foreground); }
.tabs button:active { transform: scale(.96); }
.tabs button.on { color: var(--foreground); background: var(--card-solid); box-shadow: var(--shadow-xs), 0 0 0 1px var(--border); animation: tab-on .35s var(--glide); }
@keyframes tab-on { from { transform: scale(.94); opacity: .6; } }
.desc { white-space: pre-wrap; }

/* ---------- deals board ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding: 2px 2px 12px; scroll-snap-type: x proximity; }
.col { background: color-mix(in srgb, var(--card-solid) 28%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid var(--glass-edge); border-radius: 18px; padding: 10px; min-height: 340px; display: flex; flex-direction: column; scroll-snap-align: start; transition: background-color .2s, box-shadow .2s; }
.col.over { background: var(--brand-soft); box-shadow: inset 0 0 0 2px var(--brand); }
.col-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 12px; }
.col-head b { font-size: 13px; display: flex; align-items: center; gap: 7px; }
.col-head b::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--input); }
.col.won .col-head b::before { background: var(--good); } .col.lost .col-head b::before { background: var(--destructive); }
.col-head span { font-size: 12px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.deal { background: var(--card-solid); border: 1px solid var(--border); border-radius: 14px; padding: 12px; margin-bottom: 8px; cursor: grab; box-shadow: var(--shadow-xs); transition: transform .25s var(--ease), box-shadow .25s, opacity .2s; }
.deal a { color: var(--foreground); font-weight: 600; }
.deal:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.deal:active { cursor: grabbing; transform: scale(.98); }
.deal.dragging { opacity: .5; transform: scale(.96) rotate(-1.5deg); }
.deal .v { font-family: var(--display); font-size: 1.3rem; line-height: 1.1; font-weight: 740; font-stretch: 82%; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-top: 6px; }
.deal .m { font-size: 12px; color: var(--muted-foreground); }

/* ---------- charts ---------- */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 130px; }
.bars div { flex: 1; background: linear-gradient(to top, var(--brand), color-mix(in srgb, var(--brand) 55%, #ffd2bd)); border-radius: 6px 6px 2px 2px; min-height: 3px; transform-origin: bottom; animation: grow .7s var(--ease) both; transition: filter .15s; }
.bars div:hover { filter: brightness(1.12); }
@keyframes grow { from { transform: scaleY(0); } }
.hbar { display: grid; grid-template-columns: 140px 1fr 84px; gap: 10px; align-items: center; padding: 5px 0; font-size: 13px; }
.hbar .track { background: var(--secondary); border-radius: 999px; height: 8px; overflow: hidden; }
.hbar .fill { background: linear-gradient(to right, color-mix(in srgb, var(--brand) 70%, #ffb38f), var(--brand)); height: 100%; border-radius: 999px; transform-origin: left; animation: grow-x .8s var(--ease) both; }
@keyframes grow-x { from { transform: scaleX(0); } }
.hbar .n { text-align: right; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }

/* ---------- duplicates ---------- */
.dup { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; }
.dup .side-rec { background: var(--muted); border: 1px solid var(--border); border-radius: 14px; padding: 12px; font-size: 13px; }
.dup .mid { display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 3px 10px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted-foreground); } .kv dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- dialog: dims to focus, materializes rather than fades ---------- */
dialog { border: 1px solid var(--glass-edge); border-radius: 24px; padding: 0; width: min(620px, 94vw); background: var(--popover); color: var(--foreground); box-shadow: var(--shadow-lg), inset 0 1px 0 var(--glass-hi); }
dialog[open] { animation: materialize .32s var(--ease); }
dialog::backdrop { background: rgba(15, 12, 10, .32); -webkit-backdrop-filter: blur(6px) saturate(120%); backdrop-filter: blur(6px) saturate(120%); animation: fade .25s ease-out; }
.modal-head { padding: 20px 22px 0; display: flex; align-items: center; gap: 10px; }
.modal-head h2 { flex: 1; margin: 0; font-size: 1.45rem; font-weight: 760; font-stretch: 82%; letter-spacing: -0.02em; }
.modal-body { padding: 16px 22px; max-height: 70vh; overflow-y: auto; }
.modal-foot { padding: 14px 22px 20px; display: flex; gap: 8px; justify-content: flex-end; }
@keyframes materialize { from { opacity: 0; transform: scale(.95) translateY(6px); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---------- toast (shadcn Sonner-like) ---------- */
/* Notifications drop out of the top bar and expand, like an island, then fold back in. */
#toast { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; align-items: center; pointer-events: none; }
#toast > * { pointer-events: auto; }
.toast { background: color-mix(in srgb, #0e1015 90%, transparent); color: #f4f5f7; padding: 10px 18px 10px 14px; min-height: 40px; border-radius: 22px; border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 18px 40px -14px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .08); max-width: 90vw; animation: island-in .6s var(--glide) both; display: flex; align-items: center; gap: 10px; font-weight: 550; }
.toast.out { animation: island-out .35s var(--ease) forwards; }
@keyframes island-in { from { clip-path: inset(0 calc(50% - 20px) round 22px); transform: translateY(-18px) scale(.9); opacity: 0; } 40% { opacity: 1; } to { clip-path: inset(0 0 round 22px); } }
@keyframes island-out { to { clip-path: inset(0 calc(50% - 20px) round 22px); transform: translateY(-18px) scale(.9); opacity: 0; } }
.toast .ic { color: #ff7a45; filter: drop-shadow(0 0 6px rgba(255, 72, 0, .6)); }
.toast.err { background: color-mix(in srgb, var(--destructive) 92%, transparent); color: #fff; }
.toast.err .ic { color: #fff; }
.toast .btn { background: rgba(255, 255, 255, .14); color: inherit; border-color: rgba(255, 255, 255, .22); box-shadow: none; height: 28px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.92); } }
pre.code { background: var(--muted); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; overflow-x: auto; font: 12px/1.55 var(--mono); }

/* ---------- ask ---------- */
.chat { display: flex; flex-direction: column; }
.chat-log { min-height: 360px; max-height: calc(100vh - 300px); overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 4px 2px;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 14px, #000 calc(100% - 14px), transparent); mask-image: linear-gradient(to bottom, transparent, #000 14px, #000 calc(100% - 14px), transparent); }
.chat-log .empty { margin: auto; }
.chat-log .empty::before { width: 68px; height: 68px; margin-bottom: 16px; }
.ask-title { display: block; color: var(--foreground); font-family: var(--display); font-size: clamp(2rem, 1.3rem + 2vw, 2.8rem); font-weight: 760; font-stretch: 78%; letter-spacing: -0.025em; line-height: 1; margin-bottom: 10px; }
.suggest { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 16px; }
.msg { padding: 11px 16px; border-radius: 20px; max-width: 78%; overflow-wrap: anywhere; animation: toast-in .4s var(--spring); line-height: 1.55; }
.msg.user { align-self: flex-end; background: #16181d; color: #fafafa; border-bottom-right-radius: 6px; white-space: pre-wrap; box-shadow: var(--shadow); }
.msg.bot { align-self: flex-start; background: var(--card-solid); border: 1px solid var(--border); border-bottom-left-radius: 6px; box-shadow: var(--shadow-xs); }
.msg.bot ul { margin: 4px 0; padding-left: 18px; }
.msg .srcs { margin-top: 10px; font-size: 12px; display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
#askForm { background: color-mix(in srgb, var(--card-solid) 70%, transparent); border: 1px solid var(--input); border-radius: 18px; padding: 6px 6px 6px 12px; align-items: flex-end; box-shadow: var(--shadow-xs), inset 0 1px 0 var(--glass-hi); transition: border-color .2s, box-shadow .2s; }
#askForm:focus-within { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 28%, transparent); }
#askForm textarea { border: 0; background: none; box-shadow: none; min-height: 40px; padding-left: 0; }

/* ---------- events (modelled on Gmail) ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.gm {
  --gm-bg: #f6f8fc; --gm-panel: #fff; --gm-fg: #1f1f1f; --gm-muted: #5e5e5e; --gm-line: #e9eef6; --gm-read: #f2f6fc;
  --gm-active: #d3e3fd; --gm-active-fg: #001d35; --gm-compose: #c2e7ff; --gm-compose-hover: #b3dcf5; --gm-hover-ic: rgba(68, 71, 70, .08);
  --gm-blue: #0b57d0; --gm-star: #f4b400; --gm-sel: #c2dbff; --gm-chip: #e8eaed;
  display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 12px; padding: 12px; border-radius: 24px; background: var(--gm-bg); color: var(--gm-fg); min-height: calc(100vh - 140px);
  font-family: "Google Sans", "Product Sans", var(--font);
}
:root[data-theme="dark"] .gm { --gm-bg: #1b1b1b; --gm-panel: #242424; --gm-fg: #e3e3e3; --gm-muted: #a8a8a8; --gm-line: #333; --gm-read: #1f1f1f; --gm-active: #004a77; --gm-active-fg: #c2e7ff; --gm-compose: #004a77; --gm-compose-hover: #005a91; --gm-hover-ic: rgba(255, 255, 255, .08); --gm-blue: #a8c7fa; --gm-sel: #0b3a66; --gm-chip: #3c4043; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gm { --gm-bg: #1b1b1b; --gm-panel: #242424; --gm-fg: #e3e3e3; --gm-muted: #a8a8a8; --gm-line: #333; --gm-read: #1f1f1f; --gm-active: #004a77; --gm-active-fg: #c2e7ff; --gm-compose: #004a77; --gm-compose-hover: #005a91; --gm-hover-ic: rgba(255, 255, 255, .08); --gm-blue: #a8c7fa; --gm-sel: #0b3a66; --gm-chip: #3c4043; } }
.gm.gm-read { grid-template-columns: minmax(0, 1fr); }
.gm-rail { display: flex; flex-direction: column; gap: 2px; padding-top: 4px; }
.gm-compose { display: inline-flex; align-items: center; gap: 12px; align-self: flex-start; height: 56px; padding: 0 24px 0 18px; margin-bottom: 12px; border: 0; border-radius: 16px; background: var(--gm-compose); color: var(--gm-active-fg); font: 500 14px/1 inherit; font-family: inherit; cursor: pointer; box-shadow: 0 1px 2px rgba(60, 64, 67, .3), 0 1px 3px 1px rgba(60, 64, 67, .15); transition: background-color .15s, box-shadow .2s, transform .2s var(--spring); }
.gm-compose:hover { background: var(--gm-compose-hover); box-shadow: 0 1px 3px rgba(60, 64, 67, .3), 0 4px 8px 3px rgba(60, 64, 67, .15); }
.gm-compose:active { transform: scale(.97); }
.gm-compose .ic { width: 22px; height: 22px; }
.gm-folder { display: flex; align-items: center; gap: 16px; height: 32px; padding: 0 12px 0 22px; border-radius: 0 16px 16px 0; margin-right: 8px; color: var(--gm-fg); font-size: 14px; text-decoration: none; transition: background-color .12s; }
.gm-folder:hover { background: var(--gm-hover-ic); }
.gm-folder .ic { width: 19px; height: 19px; color: var(--gm-muted); }
.gm-folder span { flex: 1; }
.gm-folder b { font-size: 12.5px; font-weight: 700; }
.gm-folder small { font-size: 12px; color: var(--gm-muted); }
.gm-folder.on { background: var(--gm-active); color: var(--gm-active-fg); font-weight: 700; }
.gm-folder.on .ic { color: var(--gm-active-fg); }
.gm-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.gm-search { display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 16px; max-width: 720px; border-radius: 24px; background: #e9eef6; color: var(--gm-muted); transition: background-color .15s, box-shadow .15s; }
:root[data-theme="dark"] .gm-search { background: #333537; }
.gm-search:focus-within { background: var(--gm-panel); box-shadow: 0 1px 1px rgba(65, 69, 73, .3), 0 1px 3px 1px rgba(65, 69, 73, .15); }
.gm-search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font: 16px inherit; font-family: inherit; color: var(--gm-fg); }
.gm-search > .ic { width: 20px; height: 20px; }
.gm-panel { flex: 1; background: var(--gm-panel); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.gm-bar { display: flex; align-items: center; gap: 4px; height: 48px; padding: 0 8px 0 10px; border-bottom: 1px solid var(--gm-line); }
.gm-spacer { flex: 1; }
.gm-range { font-size: 12px; color: var(--gm-muted); margin-right: 4px; }
.gm-sel { font-size: 13px; color: var(--gm-muted); margin-left: 4px; }
.gm-ic { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; background: none; color: var(--gm-muted); cursor: pointer; text-decoration: none; transition: background-color .12s; }
.gm-ic:hover:not(:disabled) { background: var(--gm-hover-ic); color: var(--gm-fg); }
.gm-ic:disabled { opacity: .35; cursor: default; }
.gm-ic .ic { width: 20px; height: 20px; }
.gm-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--gm-blue); cursor: pointer; }
.gm-star.on { color: var(--gm-star); }
.gm-star.on .ic { fill: var(--gm-star); }
.gm-list { flex: 1; overflow-y: auto; }
.gm-row { position: relative; display: flex; align-items: center; gap: 2px; height: 40px; padding: 0 16px 0 10px; border-bottom: 1px solid var(--gm-line); background: var(--gm-read); font-size: 14px; cursor: pointer; }
.gm-row.unread { background: var(--gm-panel); }
.gm-row.unread .gm-from, .gm-row.unread .gm-subj b, .gm-row.unread .gm-date { font-weight: 700; color: var(--gm-fg); }
.gm-row:hover { z-index: 1; box-shadow: inset 1px 0 0 #dadce0, inset -1px 0 0 #dadce0, 0 1px 2px 0 rgba(60, 64, 67, .3), 0 1px 3px 1px rgba(60, 64, 67, .15); }
:root[data-theme="dark"] .gm-row:hover { box-shadow: inset 1px 0 0 #444, inset -1px 0 0 #444, 0 1px 3px rgba(0, 0, 0, .6); }
.gm-row.sel { background: var(--gm-sel); }
.gm-row .gm-ic { width: 32px; height: 32px; }
.gm-row .gm-ic .ic { width: 18px; height: 18px; }
.gm-from { flex: 0 0 200px; padding-left: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--gm-fg); font-weight: 400; }
.gm-subj { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-subj b { font-weight: 400; color: var(--gm-fg); }
.gm-snip { color: var(--gm-muted); }
.gm-label { flex: none; margin: 0 8px; padding: 0 6px; border-radius: 4px; background: var(--gm-chip); color: var(--gm-fg); font-size: 12px; line-height: 20px; }
.gm-label.up { background: #c4eed0; color: #0d652d; }
:root[data-theme="dark"] .gm-label.up { background: #0d652d; color: #c4eed0; }
.gm-date { flex: 0 0 76px; text-align: right; font-size: 12px; color: var(--gm-muted); white-space: nowrap; }
.gm-hover { display: none; position: absolute; right: 8px; top: 4px; gap: 2px; background: inherit; }
.gm-row:hover .gm-hover { display: flex; }
.gm-row:hover .gm-date { visibility: hidden; }
.gm-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 64px 16px; color: var(--gm-muted); text-align: center; }
.gm-empty > .ic { width: 48px; height: 48px; opacity: .45; margin-bottom: 6px; }
.gm-empty b { color: var(--gm-fg); font-size: 18px; font-weight: 500; }

/* one event, like an open message */
.gm-msg { padding: 8px 24px 28px 72px; overflow-y: auto; }
.gm-subject { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin: 12px 0 18px; }
.gm-subject .rec-title { flex: 0 1 auto; }
.gm-subject .rec-title input { font-family: inherit; font-size: 22px; font-weight: 400; color: var(--gm-fg); }
.gm-subject .rec-title input { field-sizing: content; min-width: 6ch; max-width: 100%; }
.gm-sender { display: flex; align-items: flex-start; gap: 12px; margin-left: -56px; }
.gm-av { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--gm-active); color: var(--gm-active-fg); }
.gm-av .ic { width: 20px; height: 20px; }
.gm-sender-main { flex: 1; min-width: 0; }
.gm-sender-main b { display: block; font-size: 14px; font-weight: 700; }
.gm-sender-main span { font-size: 12.5px; color: var(--gm-muted); }
.gm-sender-date { font-size: 12px; color: var(--gm-muted); white-space: nowrap; }
.gm-body { margin-top: 18px; }
.gm-facts { display: grid; gap: 14px; padding: 16px 18px; border: 1px solid var(--gm-line); border-radius: 12px; }
.gm-facts > div { display: flex; gap: 14px; align-items: flex-start; font-size: 14px; }
.gm-facts > div > .ic { width: 20px; height: 20px; color: var(--gm-muted); flex: none; margin-top: 1px; }
.gm-facts small { display: block; color: var(--gm-muted); font-size: 12px; margin-top: 4px; }
.gm-join { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: 18px; background: var(--gm-blue); color: #fff; font-weight: 500; text-decoration: none; }
:root[data-theme="dark"] .gm-join { color: #062e6f; }
.gm-join .ic { width: 16px; height: 16px; }
.gm-people { display: flex; flex-wrap: wrap; gap: 6px; }
.gm-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 3px; border: 1px solid var(--gm-line); border-radius: 14px; color: var(--gm-fg); font-size: 13px; text-decoration: none; }
.gm-chip:hover { background: var(--gm-hover-ic); }
.gm-chip-av { --h: 210; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: hsl(var(--h) 55% 45%); color: #fff; font-size: 10px; font-weight: 700; }
.gm-muted { color: var(--gm-muted); }
.gm-notes { display: grid; gap: 8px; margin-top: 18px; }
.gm-notes label { font-size: 13px; font-weight: 500; color: var(--gm-muted); }
.gm-notes textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--gm-line); border-radius: 12px; background: var(--gm-panel); color: var(--gm-fg); font: 14px/1.6 inherit; font-family: inherit; resize: vertical; }
.gm-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 20px; border: 1px solid #747775; border-radius: 20px; background: none; color: var(--gm-fg); font: 500 14px inherit; font-family: inherit; cursor: pointer; transition: background-color .12s; }
.gm-btn:hover { background: var(--gm-hover-ic); }
.gm-btn.primary { background: var(--gm-blue); border-color: var(--gm-blue); color: #fff; }
:root[data-theme="dark"] .gm-btn.primary { color: #062e6f; }
.gm-btn .ic { width: 18px; height: 18px; }
.gm-replies { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.gm-extra { margin-top: 24px; display: grid; gap: 4px; }
.gm-extra details { border-top: 1px solid var(--gm-line); padding: 10px 0; }
.gm-extra summary { font-size: 14px; font-weight: 500; }
@media (max-width: 860px) {
  .gm { grid-template-columns: minmax(0, 1fr); padding: 8px; border-radius: 16px; }
  .gm-rail { flex-direction: row; overflow-x: auto; gap: 6px; padding: 0 0 4px; scrollbar-width: none; }
  .gm-compose { height: 40px; margin: 0; padding: 0 14px; flex: none; }
  .gm-folder { flex: none; border-radius: 16px; margin: 0; padding: 0 14px; gap: 8px; }
  .gm { align-content: start; grid-template-rows: auto 1fr; }
  .gm-row { flex-wrap: wrap; height: auto; padding: 8px 12px 8px 4px; row-gap: 0; }
  .gm-from { order: 3; flex: 1 1 0; }
  .gm-date { order: 4; flex-basis: auto; }
  .gm-subj { order: 5; flex-basis: 100%; padding-left: 74px; margin-top: -6px; }
  .gm-row .gm-label { display: none; }
  .gm-row:hover .gm-date { visibility: visible; }
  .gm-row:hover .gm-hover { display: none; }
  .gm-msg { padding: 8px 14px 22px; }
  .gm-sender { margin-left: 0; }
}

/* ---------- contacts & companies (modelled on HubSpot's CRM) ---------- */
.hs-page, .hs-rec, .hs-drawer {
  --hs-fg: #33475b; --hs-muted: #516f90; --hs-line: #cbd6e2; --hs-soft: #f5f8fa; --hs-bg: #fff; --hs-link: #0091ae; --hs-link-hover: #007a8c;
  --hs-orange: #ff7a59; --hs-orange-hover: #ff8f73; --hs-dark: #2d3e50; --hs-hover: #f5f8fa; --hs-teal-soft: #e5f5f8;
}
:root[data-theme="dark"] :is(.hs-page, .hs-rec, .hs-drawer) { --hs-fg: #dfe3eb; --hs-muted: #99afc4; --hs-line: #3b4a5a; --hs-soft: #1f2a36; --hs-bg: #17212b; --hs-link: #4fc4dc; --hs-link-hover: #7ad6e8; --hs-hover: #1f2a36; --hs-teal-soft: rgba(0, 145, 174, .18); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.hs-page, .hs-rec, .hs-drawer) { --hs-fg: #dfe3eb; --hs-muted: #99afc4; --hs-line: #3b4a5a; --hs-soft: #1f2a36; --hs-bg: #17212b; --hs-link: #4fc4dc; --hs-link-hover: #7ad6e8; --hs-hover: #1f2a36; --hs-teal-soft: rgba(0, 145, 174, .18); } }
.hs-page { color: var(--hs-fg); }
.hs-top { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.hs-top .spacer { flex: 1; }
.hs-h1 { display: flex; align-items: center; gap: 6px; margin: 0; font-family: var(--display); font-size: clamp(1.7rem, 1.3rem + 1.2vw, 2.3rem); font-weight: 760; font-stretch: 80%; letter-spacing: -.02em; color: var(--foreground); }
.hs-h1 .ic { width: 20px; height: 20px; color: var(--hs-muted); }
.hs-count { font-size: 13px; color: var(--hs-muted); margin-top: 2px; }
.hs-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px; border: 1px solid var(--hs-line); border-radius: 3px; background: var(--hs-soft); color: var(--hs-fg); font: 600 14px/1 var(--font); text-decoration: none; cursor: pointer; transition: background-color .15s, border-color .15s, transform .15s var(--spring); }
.hs-btn:hover { background: var(--hs-bg); border-color: var(--hs-muted); }
.hs-btn:active { transform: scale(.97); }
.hs-btn.primary { background: var(--hs-orange); border-color: var(--hs-orange); color: #fff; }
.hs-btn.primary:hover { background: var(--hs-orange-hover); border-color: var(--hs-orange-hover); }
.hs-btn .ic { width: 15px; height: 15px; }
.hs-views { display: flex; gap: 0; overflow-x: auto; border-bottom: 1px solid var(--hs-line); scrollbar-width: none; }
.hs-view { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; border: 1px solid transparent; border-bottom: 0; border-radius: 3px 3px 0 0; background: none; color: var(--hs-muted); font: 600 14px var(--font); white-space: nowrap; cursor: pointer; margin-bottom: -1px; }
.hs-view:hover { color: var(--hs-fg); background: color-mix(in srgb, var(--hs-soft) 60%, transparent); }
.hs-view.on { background: var(--hs-bg); border-color: var(--hs-line); color: var(--hs-fg); box-shadow: inset 0 3px 0 var(--hs-link); }
.hs-x .ic { width: 13px; height: 13px; opacity: .6; }
.hs-board { background: var(--hs-bg); border: 1px solid var(--hs-line); border-top: 0; border-radius: 0 0 6px 6px; box-shadow: var(--shadow-xs); }
.hs-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--hs-line); }
.hs-search { display: flex; align-items: center; gap: 8px; width: min(320px, 100%); height: 36px; padding: 0 10px; border: 1px solid var(--hs-line); border-radius: 3px; background: var(--hs-soft); color: var(--hs-muted); }
.hs-search:focus-within { background: var(--hs-bg); border-color: var(--hs-link); box-shadow: 0 0 4px 1px rgba(0, 208, 228, .3); }
.hs-search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font: 14px var(--font); color: var(--hs-fg); }
.hs-search .ic { width: 15px; height: 15px; }
.hs-chip { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px 0 12px; border-radius: 3px; color: var(--hs-link); font: 600 13.5px var(--font); cursor: pointer; white-space: nowrap; }
.hs-chip:hover { background: var(--hs-teal-soft); }
.hs-chip.on { background: var(--hs-teal-soft); color: var(--hs-fg); }
.hs-chip select { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 16px; }
.hs-chip .ic { width: 14px; height: 14px; }
.hs-chip button { display: grid; place-items: center; border: 0; background: none; color: inherit; cursor: pointer; padding: 0; }
.hs-clear { border: 0; background: none; color: var(--hs-link); font: 600 13.5px var(--font); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.hs-table-wrap { overflow-x: auto; }
.hs-table { width: 100%; border-collapse: collapse; font-size: 14px; color: var(--hs-fg); }
.hs-table th { position: sticky; top: 0; z-index: 1; height: 40px; padding: 0 16px; background: var(--hs-soft); border-bottom: 1px solid var(--hs-line); border-right: 1px solid var(--hs-line); text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--hs-fg); white-space: nowrap; }
.hs-table th:last-child { border-right: 0; }
.hs-sort { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; cursor: pointer; }
.hs-sort .ic { width: 12px; height: 12px; opacity: .45; }
.hs-sort.on .ic { opacity: 1; color: var(--hs-link); }
.hs-table td { height: 52px; padding: 0 16px; border-bottom: 1px solid var(--hs-line); white-space: nowrap; max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
.hs-table tbody tr { cursor: pointer; transition: background-color .1s; }
.hs-table tbody tr:hover { background: var(--hs-hover); }
.hs-table tbody tr:last-child td { border-bottom: 0; }
.hs-name { display: flex; align-items: center; gap: 10px; }
.hs-name a { color: var(--hs-link); font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.hs-name a:hover { color: var(--hs-link-hover); text-decoration: underline; }
.hs-preview { margin-left: auto; height: 28px; padding: 0 12px; border: 1px solid var(--hs-line); border-radius: 3px; background: var(--hs-bg); color: var(--hs-fg); font: 600 12.5px var(--font); cursor: pointer; opacity: 0; transition: opacity .12s; }
tr:hover .hs-preview, .hs-preview:focus-visible { opacity: 1; }
.hs-preview:hover { border-color: var(--hs-muted); }
.hs-link { color: var(--hs-link); text-decoration: none; }
.hs-link:hover { text-decoration: underline; }
.hs-dash { color: var(--hs-muted); }
.hs-av { --h: 190; display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%; background: hsl(var(--h) 55% 88%); color: hsl(var(--h) 55% 26%); font: 700 12px var(--font); }
.hs-av.co { border-radius: 4px; background: var(--hs-soft); color: var(--hs-fg); border: 1px solid var(--hs-line); }
.hs-av.sm { width: 28px; height: 28px; font-size: 11px; }
.hs-av.lg { width: 48px; height: 48px; font-size: 16px; }
.hs-av.xl { width: 72px; height: 72px; font-size: 24px; }
:root[data-theme="dark"] .hs-av:not(.co) { background: hsl(var(--h) 40% 28%); color: hsl(var(--h) 70% 86%); }
.hs-status { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.hs-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #99afc4; }
.hs-status.s-new::before { background: #00a4bd; } .hs-status.s-contacted::before { background: #7c98b6; } .hs-status.s-engaged::before { background: #f5c26b; }
.hs-status.s-qualified::before { background: #6a78d1; } .hs-status.s-customer::before { background: #00bda5; } .hs-status.s-lost::before { background: #f2545b; } .hs-status.s-nurture::before { background: #ff7a59; }
.hs-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 56px 16px; color: var(--hs-muted); text-align: center; }
.hs-empty b { color: var(--hs-fg); font-size: 16px; }
.hs-empty a { color: var(--hs-link); }
.hs-foot { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--hs-line); }
.hs-pager { display: flex; align-items: center; gap: 4px; }
.hs-pg { display: inline-flex; align-items: center; gap: 4px; min-width: 32px; height: 32px; padding: 0 8px; border: 0; border-radius: 3px; background: none; color: var(--hs-link); font: 600 13.5px var(--font); cursor: pointer; justify-content: center; }
.hs-pg:hover:not(:disabled) { background: var(--hs-teal-soft); }
.hs-pg:disabled { color: var(--hs-muted); opacity: .5; cursor: default; }
.hs-pg.on { background: var(--hs-dark); color: #fff; }
.hs-pg .ic { width: 14px; height: 14px; }
.hs-gap { color: var(--hs-muted); padding: 0 2px; }

/* preview drawer */
.hs-drawer { position: fixed; inset: 0; z-index: 60; }
.hs-drawer-scrim { position: absolute; inset: 0; background: rgba(45, 62, 80, .5); animation: hs-fade .25s var(--ease); }
.hs-drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); display: flex; flex-direction: column; background: var(--hs-bg); color: var(--hs-fg); box-shadow: -12px 0 40px rgba(0, 0, 0, .18); animation: hs-in .35s var(--spring); }
.hs-drawer.out .hs-drawer-panel { transform: translateX(100%); transition: transform .25s var(--ease); }
.hs-drawer.out .hs-drawer-scrim { opacity: 0; transition: opacity .25s; }
@keyframes hs-in { from { transform: translateX(100%); } }
@keyframes hs-fade { from { opacity: 0; } }
.hs-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 24px; height: 56px; background: linear-gradient(90deg, #00a4bd, #00bda5); color: #fff; font-weight: 700; font-size: 16px; }
.hs-drawer-head .icon-btn { color: #fff; }
.hs-drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px 32px; }
.hs-pv-id { display: flex; gap: 14px; align-items: center; }
.hs-pv-id > div b { display: block; font-size: 20px; font-weight: 700; }
.hs-pv-id > div > span { display: block; color: var(--hs-muted); font-size: 13.5px; }
.hs-pv-acts { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 6px; }
.hs-pv-sec { padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--hs-line); }
.hs-pv-sec h3 { margin: 0 0 10px; font-size: 14px; font-weight: 700; }
.hs-props { display: grid; gap: 10px; margin: 0; }
.hs-props dt { font-size: 12px; color: var(--hs-muted); }
.hs-props dd { margin: 2px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.hs-pv-act { display: flex; gap: 10px; padding: 8px 0; }
.hs-pv-act b { display: block; font-size: 13.5px; }
.hs-pv-act span { font-size: 12px; color: var(--hs-muted); }
.hs-pv-act p { margin: 4px 0 0; font-size: 13.5px; }
.hs-act-ic { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--hs-teal-soft); color: var(--hs-link); }
.hs-act-ic .ic { width: 15px; height: 15px; }
.hs-assoc-row { display: block; padding: 6px 0; color: var(--hs-link); font-weight: 600; text-decoration: none; }

/* record page */
.hs-rec { display: grid; grid-template-columns: 330px minmax(0, 1fr) 320px; gap: 0; color: var(--hs-fg); background: var(--hs-bg); border: 1px solid var(--hs-line); border-radius: 8px; overflow: hidden; box-shadow: var(--shadow-xs); }
.hs-col { min-width: 0; padding: 18px 20px 28px; }
.hs-left { border-right: 1px solid var(--hs-line); }
.hs-mid { background: var(--hs-soft); }
.hs-right { border-left: 1px solid var(--hs-line); padding-top: 8px; }
.hs-back { display: inline-flex; align-items: center; gap: 4px; color: var(--hs-link); font-weight: 600; font-size: 13.5px; text-decoration: none; }
.hs-back .ic { width: 14px; height: 14px; }
.hs-ident { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; margin: 18px 0 14px; }
.hs-name-edit input { width: 100%; text-align: center; font-size: 22px !important; font-weight: 700 !important; color: var(--hs-fg); }
.hs-sub { color: var(--hs-muted); font-size: 14px; }
.hs-mail { display: inline-flex; align-items: center; gap: 2px; font-size: 14px; }
.hs-mail .icon-btn { width: 26px; height: 26px; }
.hs-acts { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--hs-line); }
.hs-acts > * { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 42px; border: 0; background: none; color: var(--hs-fg); font: 500 11px var(--font); text-decoration: none; cursor: pointer; }
.hs-acts > * > span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--hs-line); background: var(--hs-soft); color: var(--hs-fg); transition: background-color .15s, border-color .15s, transform .2s var(--spring); }
.hs-acts > *:hover > span { background: var(--hs-teal-soft); border-color: var(--hs-link); color: var(--hs-link); transform: translateY(-2px); }
.hs-acts .ic { width: 16px; height: 16px; }
.hs-more { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding: 12px 0; border-bottom: 1px solid var(--hs-line); }
.hs-more:not(:has(> :not([hidden]))) { display: none; }
.hs-sec { padding: 12px 0; border-bottom: 1px solid var(--hs-line); }
.hs-sec > summary, .hs-side-card > summary { display: flex; align-items: center; gap: 6px; list-style: none; cursor: pointer; font-weight: 700; font-size: 14.5px; color: var(--hs-fg); padding: 4px 0; }
.hs-sec > summary::-webkit-details-marker, .hs-side-card > summary::-webkit-details-marker { display: none; }
.hs-sec > summary::before, .hs-side-card > summary::before { content: none; }
.hs-sec[open] > summary, .hs-side-card[open] > summary { margin-bottom: 0; }
.hs-sec > summary .ic, .hs-side-card > summary > .ic { width: 15px; height: 15px; transition: transform .2s var(--spring); color: var(--hs-muted); }
.hs-sec:not([open]) > summary .ic, .hs-side-card:not([open]) > summary > .ic { transform: rotate(-90deg); }
.hs-sec form { margin-top: 10px; gap: 10px; }
.hs-sec .field label { font-size: 12px; color: var(--hs-muted); font-weight: 500; }
.hs-meta { margin-top: 14px; font-size: 12px; color: var(--hs-muted); line-height: 1.7; }
.hs-del { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; border: 0; background: none; color: #d94c53; font: 600 12.5px var(--font); cursor: pointer; padding: 0; }
.hs-del .ic { width: 13px; height: 13px; }
.hs-tabs { display: flex; width: 100%; padding: 0; gap: 0; background: none; border-bottom: 1px solid var(--hs-line); border-radius: 0; margin-bottom: 16px; }
.hs-tabs button { border-radius: 0; padding: 12px 16px; font-size: 14px; color: var(--hs-muted); box-shadow: none !important; background: none !important; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.hs-tabs button.on { color: var(--hs-fg); border-bottom-color: var(--hs-link); }
.hs-tabs button:hover { color: var(--hs-fg); }
.hs-card { background: var(--hs-bg); border: 1px solid var(--hs-line); border-radius: 6px; padding: 16px 18px; margin-bottom: 14px; }
.hs-card h3 { margin: 0 0 12px; font-size: 15px; font-weight: 700; }
.hs-card-head { display: flex; align-items: center; justify-content: space-between; }
.hs-linkbtn { border: 0; background: none; color: var(--hs-link); font: 600 13.5px var(--font); cursor: pointer; }
.hs-highlights { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.hs-highlights > div > span { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--hs-muted); }
.hs-highlights b { display: block; margin-top: 4px; font-size: 15px; font-weight: 600; }
.hs-notes { margin: 0; white-space: pre-wrap; font-size: 14px; }
.hs-month { margin: 6px 0 8px; font-size: 13px; font-weight: 700; color: var(--hs-muted); }
.hs-act-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.hs-mid [data-pane="notes"], .hs-mid [data-pane="outreach"] { background: var(--hs-bg); border: 1px solid var(--hs-line); border-radius: 6px; padding: 16px 18px; }
.hs-side-card { padding: 12px 0; border-bottom: 1px solid var(--hs-line); }
.hs-side-card > summary { justify-content: flex-start; }
.hs-add { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; border: 0; background: none; color: var(--hs-link); font: 600 13px var(--font); cursor: pointer; }
.hs-add .ic { width: 13px; height: 13px; }
.hs-side-card > p { margin: 8px 0 0; font-size: 13px; }
.hs-assoc { display: flex; align-items: center; gap: 6px; margin-top: 8px; padding: 8px 10px; border: 1px solid var(--hs-line); border-radius: 6px; background: var(--hs-bg); transition: border-color .15s, box-shadow .15s; }
.hs-assoc:hover { border-color: var(--hs-link); box-shadow: 0 2px 8px rgba(0, 0, 0, .06); }
.hs-assoc a { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.hs-assoc a span { min-width: 0; }
.hs-assoc b { display: block; color: var(--hs-link); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-assoc small { color: var(--hs-muted); font-size: 12px; }
.hs-side-card .check { margin-top: 6px; }
@media (max-width: 1240px) {
  .hs-rec { grid-template-columns: 300px minmax(0, 1fr); }
  .hs-right { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--hs-line); display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 24px; }
}
@media (max-width: 860px) {
  .hs-rec { grid-template-columns: minmax(0, 1fr); }
  .hs-left { border-right: 0; border-bottom: 1px solid var(--hs-line); }
  .hs-top .hs-btn:not(.primary) { display: none; }
  .hs-table th:nth-child(n+5), .hs-table td:nth-child(n+5) { display: none; }
  .hs-preview { display: none; }
}

/* ---------- slack (modelled on Slack's own web app) ---------- */
:root[data-section="slack"] { --aura-1: rgba(224, 30, 90, 0.33); --aura-2: rgba(54, 197, 240, 0.3); --aura-3: rgba(236, 178, 46, 0.27); }
.slack-app {
  --sk-rail: #3f0e40; --sk-rail-hover: #350d36; --sk-rail-fg: rgba(255, 255, 255, .72); --sk-rail-line: rgba(255, 255, 255, .12); --sk-active: #1164a3;
  --sk-bg: #fff; --sk-fg: #1d1c1d; --sk-muted: #616061; --sk-line: #e2e2e2; --sk-hover: #f8f8f8; --sk-chip: #f2f2f2;
  --sk-link: #1264a3; --sk-mention: #e8f5fa; --sk-loud: #fdf3c7; --sk-green: #007a5a; --sk-green-hover: #148567;
  display: grid; grid-template-columns: 260px minmax(0, 1fr); padding: 0; overflow: hidden; height: calc(100vh - 210px); min-height: 460px;
  background: var(--sk-bg); color: var(--sk-fg); border-color: var(--sk-line);
}
:root[data-theme="dark"] .slack-app { --sk-rail: #19171d; --sk-rail-hover: #27242c; --sk-bg: #1a1d21; --sk-fg: #d1d2d3; --sk-muted: #9a9b9e; --sk-line: #35373b; --sk-hover: #222529; --sk-chip: #2c2d30; --sk-link: #1d9bd1; --sk-mention: rgba(29, 155, 209, .18); --sk-loud: rgba(242, 199, 68, .22); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .slack-app { --sk-rail: #19171d; --sk-rail-hover: #27242c; --sk-bg: #1a1d21; --sk-fg: #d1d2d3; --sk-muted: #9a9b9e; --sk-line: #35373b; --sk-hover: #222529; --sk-chip: #2c2d30; --sk-link: #1d9bd1; --sk-mention: rgba(29, 155, 209, .18); --sk-loud: rgba(242, 199, 68, .22); } }
.slack-app.has-thread { grid-template-columns: 260px minmax(0, 1fr) minmax(300px, 380px); }
.sl-logo { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 2px; border-radius: 13px; background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-xs), inset 0 1px 0 #fff; }

/* sidebar */
.sl-side { display: flex; flex-direction: column; min-height: 0; background: var(--sk-rail); color: var(--sk-rail-fg); }
.sl-ws { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--sk-rail-line); }
.sl-ws-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: #fff; color: var(--sk-rail); font-weight: 800; font-size: 14px; flex: none; }
.sl-ws b { display: block; color: #fff; font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.sl-ws span { font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.sl-ws span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2bac76; }
.sl-search { display: flex; align-items: center; gap: 8px; margin: 12px 12px 6px; padding: 0 10px; height: 32px; border-radius: 7px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14); color: var(--sk-rail-fg); }
.sl-search input { border: 0; background: none; outline: none; flex: 1; min-width: 0; font: inherit; font-size: 13.5px; color: #fff; }
.sl-search input::placeholder { color: rgba(255, 255, 255, .55); }
.sl-search:focus-within { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .4); }
.sl-convs { overflow-y: auto; padding: 4px 8px 16px; flex: 1; scrollbar-color: rgba(255, 255, 255, .25) transparent; }
.sl-sec { display: flex; align-items: center; gap: 4px; width: 100%; margin-top: 10px; padding: 4px 8px; border: 0; border-radius: 6px; background: none; color: var(--sk-rail-fg); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; text-align: left; }
.sl-sec:hover { background: var(--sk-rail-hover); }
.sl-sec .ic { width: 15px; height: 15px; transition: transform .25s var(--spring); }
.sl-group.closed .sl-sec .ic { transform: rotate(-90deg); }
.sl-group.closed .sl-sec-body { display: none; }
.sl-count { margin-left: auto; font-size: 11.5px; opacity: .6; }
.sl-conv { display: flex; align-items: center; gap: 8px; width: 100%; height: 30px; padding: 0 10px 0 18px; border: 0; border-radius: 6px; background: none; color: var(--sk-rail-fg); font: inherit; font-size: 14.5px; text-align: left; cursor: pointer; transition: background-color .12s; }
.sl-conv > span:not(.sl-av) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.sl-conv .ic { width: 15px; height: 15px; flex: none; opacity: .85; }
.sl-conv:hover { background: var(--sk-rail-hover); }
.sl-conv.on { background: var(--sk-active); color: #fff; font-weight: 700; }
.sl-conv.out { opacity: .5; }
.sl-conv .sl-crm { width: 13px; height: 13px; opacity: .7; }
.sl-side .sl-note { color: rgba(255, 255, 255, .62); padding: 4px 12px 6px 18px; }
.sl-side .sl-note code { background: rgba(255, 255, 255, .12); border: 0; color: #fff; }

/* conversation */
.sl-main, .sl-thread { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--sk-bg); }
.sl-main > .empty { margin: auto; }
.sl-thread { border-left: 1px solid var(--sk-line); animation: sl-slide .45s var(--spring); }
@keyframes sl-slide { from { opacity: 0; transform: translateX(24px); } }
.sl-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--sk-line); min-height: 56px; }
.sl-title { display: flex; flex-direction: column; min-width: 0; }
.sl-title b { display: flex; align-items: center; gap: 4px; font-size: 18px; font-weight: 900; letter-spacing: -.01em; color: var(--sk-fg); white-space: nowrap; }
.sl-title b .ic { width: 17px; height: 17px; }
.sl-topic { font-size: 12.5px; color: var(--sk-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-members { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 9px; border: 1px solid var(--sk-line); border-radius: 7px; font-size: 13px; font-weight: 700; color: var(--sk-muted); }
.sl-members .ic { width: 15px; height: 15px; }
.sl-head .btn.sm img { margin-right: 2px; }
.sl-back { display: none; }
.sl-log { flex: 1; overflow-y: auto; padding: 8px 0 12px; display: flex; flex-direction: column; overscroll-behavior: contain; }
.sl-log > .empty { margin: auto; }
.sl-main .empty b, .sl-log .empty b { display: block; margin-bottom: 4px; color: var(--sk-fg); }
.sl-older { align-self: center; margin: 4px 0 10px; }
.sl-day { position: sticky; top: 4px; z-index: 2; display: flex; align-items: center; margin: 16px 0 6px; font-size: 13px; font-weight: 700; color: var(--sk-fg); }
.sl-day::before, .sl-day::after { content: ""; flex: 1; height: 1px; background: var(--sk-line); }
.sl-day span { padding: 3px 14px; border: 1px solid var(--sk-line); border-radius: 999px; background: var(--sk-bg); box-shadow: 0 1px 3px rgba(0, 0, 0, .06); }

/* messages */
.sl-msg { position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr); padding: 8px 20px 8px 0; transition: background-color .1s; animation: sl-in .3s var(--ease) both; }
.sl-msg.cont { padding-top: 2px; padding-bottom: 4px; }
.sl-msg:hover { background: var(--sk-hover); }
@keyframes sl-in { from { opacity: 0; transform: translateY(5px); } }
.sl-av { --h: 220; width: 36px; height: 36px; justify-self: center; display: grid; place-items: center; border-radius: 8px; font-size: 13px; font-weight: 800; color: #fff; background: hsl(var(--h) 52% 46%); overflow: hidden; }
.sl-av img { width: 36px; height: 36px; object-fit: cover; }
.sl-av.xs { width: 20px; height: 20px; border-radius: 5px; font-size: 9px; flex: none; }
.sl-msg.mine .sl-av:not(:has(img)) { background: #4a154b; }
.sl-gutter { justify-self: center; align-self: start; padding-top: 3px; font-size: 11px; color: var(--sk-muted); opacity: 0; }
.sl-msg:hover .sl-gutter { opacity: 1; }
.sl-meta { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; line-height: 1.3; }
.sl-meta b { font-size: 15px; font-weight: 900; color: var(--sk-fg); }
.sl-meta time { font-size: 12px; color: var(--sk-muted); }
.sl-tag { align-self: center; padding: 0 4px; border-radius: 3px; background: var(--sk-chip); color: var(--sk-muted); font-size: 10px; font-weight: 700; letter-spacing: .02em; line-height: 16px; }
.sl-tag.you { background: var(--sk-mention); color: var(--sk-link); }
.sl-crm-link { align-self: center; display: inline-flex; align-items: center; gap: 3px; padding: 0 6px; border-radius: 4px; background: var(--brand-soft); color: var(--brand-text); font-size: 11px; font-weight: 700; line-height: 18px; text-decoration: none; }
.sl-crm-link .ic { width: 11px; height: 11px; }
.sl-text { font-size: 15px; line-height: 1.47; color: var(--sk-fg); overflow-wrap: anywhere; }
.sl-text a { color: var(--sk-link); text-decoration: none; }
.sl-text a:hover { text-decoration: underline; }
.sl-text code { font: 12px/1.5 var(--mono); padding: 2px 3px 1px; border-radius: 3px; background: var(--sk-chip); border: 1px solid var(--sk-line); color: #e01e5a; }
.sl-text pre { font: 12px/1.5 var(--mono); padding: 8px; margin: 4px 0; border-radius: 4px; background: var(--sk-chip); border: 1px solid var(--sk-line); white-space: pre-wrap; }
.sl-text .mention { padding: 0 2px; border-radius: 3px; background: var(--sk-mention); color: var(--sk-link); font-weight: 500; }
.sl-text .mention.loud { background: var(--sk-loud); color: var(--sk-fg); font-weight: 700; }
.sl-edited { font-size: 12.5px; color: var(--sk-muted); }
.sl-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.sl-file { display: inline-flex; align-items: center; gap: 8px; max-width: 320px; padding: 8px 12px; border: 1px solid var(--sk-line); border-radius: 8px; font-size: 13.5px; font-weight: 700; color: var(--sk-fg); background: var(--sk-bg); }
.sl-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-file .ic { color: var(--sk-link); flex: none; }
.sl-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.sl-react { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: 12px; background: var(--sk-chip); border: 1px solid transparent; font-size: 14px; }
.sl-react b { font-size: 11.5px; font-weight: 700; color: var(--sk-muted); }
.sl-react.you { background: var(--sk-mention); border-color: #1d9bd1; }
.sl-react.you b { color: var(--sk-link); }
.sl-react-name { font-size: 11px; color: var(--sk-muted); }
.sl-replies { display: flex; align-items: center; gap: 8px; width: min(100%, 520px); margin-top: 4px; padding: 4px 6px; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--sk-muted); font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.sl-replies b { color: var(--sk-link); font-weight: 700; }
.sl-replies:hover { border-color: var(--sk-line); background: var(--sk-bg); }
.sl-faces { display: inline-flex; gap: 2px; }
.sl-faces .sl-av.xs { width: 24px; height: 24px; border-radius: 6px; font-size: 10px; }
.sl-view { margin-left: auto; display: none; align-items: center; gap: 2px; }
.sl-view .ic { width: 14px; height: 14px; }
.sl-replies:hover .sl-last { display: none; }
.sl-replies:hover .sl-view { display: inline-flex; }
.sl-actions { position: absolute; right: 16px; top: -14px; z-index: 3; display: flex; gap: 2px; padding: 2px; border: 1px solid var(--sk-line); border-radius: 8px; background: var(--sk-bg); box-shadow: 0 2px 6px rgba(0, 0, 0, .08); opacity: 0; pointer-events: none; transform: translateY(3px); transition: opacity .12s, transform .2s var(--spring); }
.sl-actions:empty { display: none; }
.sl-msg:hover .sl-actions, .sl-actions:focus-within { opacity: 1; pointer-events: auto; transform: none; }
.sl-actions > * { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 5px; background: none; color: var(--sk-muted); cursor: pointer; }
.sl-actions > *:hover { background: var(--sk-chip); color: var(--sk-fg); }
.sl-actions .ic { width: 17px; height: 17px; }

/* composer */
.sl-compose { margin: 4px 20px 18px; border: 1px solid #a0a0a2; border-radius: 8px; background: var(--sk-bg); transition: border-color .15s, box-shadow .15s; }
:root[data-theme="dark"] .sl-compose { border-color: #565856; }
.sl-compose:focus-within { border-color: var(--sk-muted); box-shadow: 0 0 0 1px var(--sk-muted); }
.sl-fmt { display: flex; gap: 2px; padding: 4px 6px; border-bottom: 1px solid var(--sk-line); background: var(--sk-hover); border-radius: 8px 8px 0 0; }
.sl-fmt button { display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 4px; border: 0; border-radius: 4px; background: none; color: var(--sk-muted); font: 700 14px/1 var(--font, inherit); cursor: pointer; }
.sl-fmt button:hover { background: var(--sk-chip); color: var(--sk-fg); }
.sl-fmt .f-i { font-style: italic; font-family: Georgia, serif; }
.sl-fmt .f-s { text-decoration: line-through; }
.sl-fmt .f-code { font: 700 12px var(--mono); }
.sl-fmt .ic { width: 16px; height: 16px; }
.sl-compose textarea { display: block; width: 100%; border: 0; background: none; outline: none; resize: none; font: inherit; font-size: 15px; color: var(--sk-fg); min-height: 42px; max-height: 200px; padding: 10px 12px 4px; }
.sl-compose textarea:focus, .sl-compose textarea:focus-visible { outline: none; box-shadow: none; border: 0; }
.sl-compose textarea::placeholder { color: var(--sk-muted); }
.sl-send-row { display: flex; align-items: center; gap: 8px; padding: 4px 6px 6px 12px; }
.sl-hint { flex: 1; font-size: 11.5px; color: var(--sk-muted); }
.sl-hint b { font-weight: 700; }
.sl-send { margin-left: auto; display: grid; place-items: center; width: 34px; height: 30px; border: 0; border-radius: 5px; background: var(--sk-green); color: #fff; cursor: pointer; transition: background-color .15s, transform .2s var(--spring); }
.sl-send:hover { background: var(--sk-green-hover); }
.sl-send:active { transform: scale(.94); }
.sl-send:disabled { background: var(--sk-chip); color: var(--sk-muted); cursor: default; }
.sl-send .ic { width: 16px; height: 16px; }
.sl-main > .sl-note { margin: 0 20px 18px; padding: 12px; border: 1px solid var(--sk-line); border-radius: 8px; background: var(--sk-hover); }

@media (max-width: 1100px) {
  .slack-app.has-thread { grid-template-columns: 260px minmax(0, 1fr); }
  .slack-app.has-thread .sl-main { display: none; }
}
@media (max-width: 760px) {
  .slack-app, .slack-app.has-thread { grid-template-columns: minmax(0, 1fr); height: calc(100vh - 170px); }
  .slack-app.has-conv .sl-side { display: none; }
  .slack-app:not(.has-conv) .sl-main, .slack-app:not(.has-conv) .sl-thread { display: none; }
  .slack-app.has-conv.has-thread .sl-main { display: none; }
  .slack-app.has-thread .sl-thread { border-left: 0; }
  .sl-back { display: inline-flex; }
  .sl-msg { grid-template-columns: 48px minmax(0, 1fr); padding-right: 12px; }
  .sl-actions { opacity: 1; pointer-events: auto; transform: none; top: 4px; right: 6px; background: none; border: 0; box-shadow: none; }
  .sl-head .btn.sm, .sl-members, .sl-hint { display: none; }
  .sl-compose { margin: 4px 10px 10px; }
  .sl-day { position: static; }
  .sl-logo { display: none; }
}
.dots { display: inline-flex; gap: 5px; padding: 4px 0; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); animation: dot 1.1s var(--ease) infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 100% { transform: scale(.6); opacity: .45; } 40% { transform: scale(1); opacity: 1; } }

/* ---------- history ---------- */
.h-item { display: flex; gap: 12px; padding: 12px 0; }
.h-item + .h-item { box-shadow: 0 -1px 0 var(--border); }
.h-item .row { gap: 8px; }
.h-changes { display: grid; grid-template-columns: minmax(90px, max-content) 1fr; gap: 4px 12px; margin: 8px 0 0; font-size: 13px; }
.h-changes dt { color: var(--muted-foreground); }
.h-changes dd { margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; overflow-wrap: anywhere; }
.h-changes dd .ic { color: var(--muted-foreground); width: 13px; height: 13px; }
.h-before { color: var(--muted-foreground); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--destructive) 55%, transparent); }
.h-after { color: var(--foreground); font-weight: 550; }

/* ---------- backups ---------- */
.backup-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 13px; }
.backup-row + .backup-row { box-shadow: 0 -1px 0 var(--border); }
.backup-row .name { flex: 1; min-width: 10ch; font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
/* Team rows: the role menu and buttons keep their own size, so a name never collapses to one letter per line. */
.backup-row > select.inline-input { flex: none; width: auto; min-width: 110px; }
.backup-row > .btn, .backup-row > .pill, .backup-row > .muted { flex: none; white-space: nowrap; }
#teamCard .backup-row { flex-wrap: wrap; row-gap: 6px; }
#inviteForm { flex-wrap: wrap; }
#inviteForm input { min-width: 180px; }

/* ---------- connectors ---------- */
.conn-head { display: flex; align-items: center; gap: 12px; }
/* Brand logos sit on white tiles (most need a light ground, even in dark mode). */
.logo-stack { display: inline-flex; flex: none; }
.logo-tile {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: #fff; border: 1px solid rgba(23, 23, 23, .08);
  box-shadow: 0 1px 2px rgba(23, 23, 23, .06), 0 6px 14px -6px rgba(23, 23, 23, .2), inset 0 1px 0 #fff;
  transition: transform .45s var(--spring), margin .45s var(--spring), box-shadow .3s var(--ease);
}
.logo-tile img { width: 24px; height: 24px; display: block; }
/* Several logos overlap like a hand of cards and fan out on hover. */
.logo-tile + .logo-tile { margin-left: -12px; }
.logo-stack .logo-tile:nth-child(2) { transform: rotate(4deg); }
.logo-stack .logo-tile:nth-child(3) { transform: rotate(8deg); }
.card:hover .logo-tile + .logo-tile { margin-left: 6px; }
.card:hover .logo-tile { transform: none; box-shadow: 0 2px 4px rgba(23, 23, 23, .07), 0 12px 22px -8px rgba(23, 23, 23, .28), inset 0 1px 0 #fff; }
.card:hover .logo-stack .logo-tile:first-child { transform: translateY(-2px); }
.works-with { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; font-size: 12.5px; }
.works-with .ww { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 4px; border-radius: 999px; background: var(--secondary); font-weight: 550; }
.works-with .ww img { width: 18px; height: 18px; padding: 2px; border-radius: 6px; background: #fff; }
.works-with .ww.wordmark-only { padding: 4px 10px; background: #fff; }
/* The Typeform file is a square canvas with the wordmark across the middle: crop to it. */
.works-with .ww.wordmark-only img { width: 64px; height: 18px; object-fit: cover; padding: 0; border-radius: 0; }
#hubForm input[name=token] { min-width: 170px; }
details summary img { margin-right: 2px; }
.conn-head h2 { margin: 0; }
.slack-opts { border: 1px solid var(--border); border-radius: 14px; padding: 12px; background: color-mix(in srgb, var(--card-solid) 45%, transparent); }
.slack-opts .row { gap: 6px 16px; }
.btn img { flex: none; }
.acct { border: 1px solid var(--border); border-radius: 14px; padding: 12px; background: color-mix(in srgb, var(--card-solid) 55%, transparent); }
.err { color: var(--destructive); font-size: 13px; margin-top: 6px; }
.ok-banner { border-color: transparent; background: var(--good-soft); color: var(--good); margin-bottom: 14px; box-shadow: none; }
.err-banner { border-color: transparent; background: var(--warn-soft); color: var(--destructive); margin-bottom: 14px; box-shadow: none; }
details summary { cursor: pointer; font-weight: 600; padding: 4px 0; list-style: none; display: flex; align-items: center; gap: 6px; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted-foreground); border-bottom: 2px solid var(--muted-foreground); transform: rotate(-45deg); transition: transform .25s var(--ease); margin-right: 4px; }
details[open] summary::before { transform: rotate(45deg); }
details[open] summary { margin-bottom: 10px; }
ol.steps { margin: 0 0 12px; padding-left: 20px; color: var(--muted-foreground); font-size: 13px; }
ol.steps li + li { margin-top: 4px; }
.copy { display: flex; gap: 6px; align-items: flex-start; }
.copy pre { flex: 1; margin: 0; white-space: pre-wrap; word-break: break-all; }

/* ---------- page arrival ---------- */
#view.entering { animation: page-in .55s var(--glide) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(10px); filter: blur(6px); } }

/* ---------- loading shimmer ---------- */
.skel { border-radius: 12px; background: linear-gradient(100deg, var(--muted) 30%, color-mix(in srgb, var(--card-solid) 70%, transparent) 50%, var(--muted) 70%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
.skel.title { width: 220px; height: 44px; margin-bottom: 26px; }
.skel.block { height: 180px; border-radius: 20px; }
.skel.line { height: 14px; margin: 10px 0; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }

/* ---------- command palette (Cmd/Ctrl K) ---------- */
.palette { position: fixed; inset: 0; z-index: 90; display: grid; justify-items: center; align-items: start; padding-top: 13vh; background: rgba(10, 12, 16, .3); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); animation: fade .2s ease-out; }
.palette.closing { animation: fade .16s ease-in reverse forwards; }
.palette-box {
  width: min(640px, calc(100vw - 32px)); border-radius: 22px; overflow: hidden; color: var(--foreground);
  border: 1px solid transparent; background: linear-gradient(var(--popover), var(--popover)) padding-box, var(--edge-grad) border-box;
  box-shadow: var(--shadow-lg), 0 0 0 1px color-mix(in srgb, var(--iris) 14%, transparent), 0 30px 90px -30px color-mix(in srgb, var(--iris) 55%, transparent);
  animation: palette-in .45s var(--glide) both;
}
.palette.closing .palette-box { animation: palette-in .16s var(--ease) reverse forwards; }
@keyframes palette-in { from { opacity: 0; transform: translateY(-10px) scale(.97); filter: blur(6px); } }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.palette-input .ic { color: var(--iris); width: 20px; height: 20px; }
.palette-input input { flex: 1; border: 0; background: none; outline: none; font-size: 1.0625rem; min-width: 0; }
.palette-input input::placeholder { color: var(--muted-foreground); }
.palette-list { max-height: min(420px, 55vh); overflow-y: auto; padding: 6px; scroll-padding: 6px; }
.palette-group { font-size: 12px; color: var(--muted-foreground); font-weight: 600; padding: 10px 12px 4px; }
.palette-item { position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 12px; cursor: pointer; color: var(--foreground); }
.palette-item .ic { color: var(--muted-foreground); }
.palette-item .hint { margin-left: auto; color: var(--muted-foreground); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.palette-item.sel { background: var(--iris-soft); }
.palette-item.sel::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--iris); box-shadow: 0 0 10px var(--iris); }
.palette-item.sel .ic { color: var(--iris-text); }
.palette-empty { padding: 26px 16px; text-align: center; color: var(--muted-foreground); }
.palette-foot { display: flex; gap: 14px; padding: 9px 16px; border-top: 1px solid var(--border); color: var(--muted-foreground); font-size: 12px; }
.palette-foot kbd { padding: 1px 6px; border-radius: 6px; border: 1px solid var(--border); background: var(--card-solid); margin-right: 4px; }

/* ---------- accessibility preferences ---------- */
[hidden] { display: none !important; }
/* Controls a role cannot use (the server refuses them too). */
body[data-role="viewer"] .needs-member, body[data-role="viewer"] .needs-admin, body[data-role="member"] .needs-admin { display: none !important; }
/* ---------- sign in ---------- */
body.locked .top, body.locked .shell { visibility: hidden; }
.auth-screen { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px 16px; overflow-y: auto; }
.auth-card { width: min(400px, 100%); padding: 28px; gap: 16px; animation: auth-in .5s var(--ease) both; }
.auth-card h1 { font-size: 1.5rem; letter-spacing: -0.03em; margin: 0 0 4px; }
.auth-card p { margin: 0; }
.auth-brand { display: flex; align-items: center; gap: 10px; }
.auth-card .btn.lg { width: 100%; justify-content: center; }
.auth-error { margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: 13px; }
.hint { font-size: 12px; color: var(--muted-foreground); }
.small { font-size: 12px; }
.sub-h { font-size: 12.5px; font-weight: 600; color: var(--muted-foreground); margin: 4px 0 6px; }
.key-once { margin-top: 10px; padding: 12px; border-radius: 12px; background: var(--brand-soft); display: grid; gap: 8px; }
.key-once code { word-break: break-all; }
.grow { flex: 1; min-width: 0; }
.backup-row.off .name { opacity: .55; }
.me .pill { font-size: 11px; }
.side-foot { flex-direction: column; align-items: stretch; }
.side-foot > .row { gap: 8px; }
.me { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #f4f5f7; }
.me .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
@keyframes auth-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .btn:active, .icon-btn:active, .deal:active, .tabs button:active, .kpi:hover, .lift:hover, .deal:hover { transform: none; }
  .ic, .kind, .avatar, .chip, .brand .mark, .logo-tile { transform: none !important; }
  .btn.primary::after { display: none; }
  body::before { animation: none; }
  .page-head h1 { animation: none; }
}
@media (prefers-reduced-transparency: reduce) {
  :root { --card: var(--card-solid); --popover: var(--card-solid); --glass-chrome: var(--card-solid); }
  .glass, .card, .top, .side, dialog, .search-pop, .toast, .col, .palette-box { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .side { background: #16181d; }
  .card { background: var(--card-solid); border-color: var(--border); }
  .toast { background: #171717; }
  body::after { display: none; }
}
@media (prefers-contrast: more) {
  :root { --border: rgba(23, 23, 23, .5); --input: rgba(23, 23, 23, .7); --muted-foreground: #3d3d3d; --card: var(--card-solid); }
  .card, .btn, .pill { border-width: 1.5px; }
}

/* ---------- responsive ---------- */
@media (max-width: 1020px) { .g2, .g3 { grid-template-columns: 1fr; } }
@media (max-width: 1180px) { .rec-grid { grid-template-columns: 1fr; } }
@media (max-width: 780px) {
  .top { padding: 0 12px; gap: 8px; }
  .brand { width: auto; }
  .top .wordmark, .top .btn .label { display: none; }
  .top .menu { display: inline-grid; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .page-head .spacer { display: none; }
  .side { position: fixed; left: 0; top: 60px; z-index: 25; width: 268px; height: calc(100vh - 60px); transform: translateX(-104%); transition: transform .4s var(--ease); box-shadow: var(--shadow-lg); }
  .side.open { transform: none; }
  #view { padding: 18px 16px 40px; }
  .form-grid { grid-template-columns: 1fr; }
  .dup { grid-template-columns: 1fr; }
  .hbar { grid-template-columns: 96px 1fr 64px; }
  .msg { max-width: 92%; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .search kbd { display: none; }
  .search input { padding-right: 12px; }
  h1 { font-size: 1.5rem; }
}

/* My accounts: who can see a mailbox's mail and meetings */
.share-row { margin-top: 10px; gap: 10px; flex-wrap: wrap; }
.share-row .tabs { margin: 0; }
.share-row .tabs button { display: inline-flex; align-items: center; gap: 6px; }
.explain .row svg { color: var(--brand); }
.acc-page { display: grid; gap: 14px; max-width: 860px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--brand); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.sl-connect { max-width: 640px; }
.check-line { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.45; cursor: pointer; }
.check-line input { flex: none; margin-top: 2px; }
