:root {
  /* ── Color tokens — charcoal w/ soft fade ───────────────── */
  --bg-base: #131316;
  --bg-base-warm: #1a1a1f;
  --bg-base-cool: #08080a;
  --bg-card: rgba(14, 14, 18, 0.52);
  --bg-card-hover: rgba(20, 20, 26, 0.60);
  --bg-card-strong: rgba(28, 28, 34, 0.68);
  --rim: rgba(255, 255, 255, 0.18);
  --rim-strong: rgba(255, 255, 255, 0.36);
  --text: #f4f4f4;
  --text-soft: #c2c2c2;
  --muted: #7a7a7a;
  --muted-deep: #4a4a4a;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.18);
  --shadow:
    0 14px 44px rgba(0, 0, 0, 0.55),
    0 1px 0 rgba(255, 255, 255, 0.10) inset,
    0 -1px 0 rgba(0, 0, 0, 0.45) inset;
  --shadow-lift:
    0 28px 70px rgba(0, 0, 0, 0.7),
    0 1px 0 rgba(255, 255, 255, 0.15) inset,
    0 -1px 0 rgba(0, 0, 0, 0.5) inset;
  --blur: 14px;
  --radius: 22px;
  --radius-sm: 14px;
  --radius-pill: 999px;
}

* { box-sizing: border-box; }

html {
  background:
    radial-gradient(ellipse 120% 80% at 50% 35%, var(--bg-base-warm) 0%, var(--bg-base) 50%, var(--bg-base-cool) 100%) fixed,
    var(--bg-base);
}
html, body {
  margin: 0;
  padding: 0;
  background-color: transparent;
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-feature-settings: "ss01", "cv11";
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
  min-height: 100vh;
  overflow-x: hidden;
}
body { background: transparent; }

/* ── Metallic spheres — dark anamorphic glass orbs ───────────
   Reference: dark gray/black bodies with a tight hot specular
   pinpoint in the upper-left and a faint cool rim along the
   bottom-right. The contrast against the charcoal background
   is what makes them read as polished glass.                 */
.bg-spheres {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
body { position: relative; }
/* Ensure UI elements stack above the sphere layer */
.topbar, .metrics, .cards, .foot, dialog { position: relative; z-index: 2; }
.card, .metric, .empty { z-index: 2; }
.sphere {
  position: absolute;
  border-radius: 50%;
  opacity: 0.42;
  /* Darker silver — visible but readable through */
  background:
    radial-gradient(circle at 32% 28%,
      #d8d8e0 0%,
      #b2b2bc 12%,
      #8a8a94 32%,
      #5e5e68 55%,
      #38383f 80%,
      #1f1f24 100%);
  box-shadow:
    inset -10px -14px 30px rgba(10,10,16,0.6),
    inset 8px 10px 28px rgba(255,255,255,0.22),
    0 24px 50px rgba(0,0,0,0.45),
    0 0 0 1px rgba(255,255,255,0.06);
}
.sphere::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(circle at 28% 22%,
      rgba(255,255,255,0.65) 0%,
      rgba(255,255,255,0.35) 6%,
      rgba(255,255,255,0.1) 14%,
      transparent 22%);
  pointer-events: none;
}
.sphere::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(circle at 72% 82%,
      transparent 55%,
      rgba(255,255,255,0.28) 68%,
      rgba(255,255,255,0.08) 78%,
      transparent 86%);
  pointer-events: none;
  mix-blend-mode: screen;
}

/* Shape variants — break up the all-circles look */
.sphere.shape-squircle { border-radius: 32%; }
.sphere.shape-pill     { border-radius: 999px; }
.sphere.shape-blob     { border-radius: 62% 38% 48% 52% / 42% 58% 42% 58%; }
.sphere.shape-rect     { border-radius: 18%; }
.sphere.shape-diamond  { border-radius: 22%; transform: rotate(45deg); }
.sphere.shape-diamond::before,
.sphere.shape-diamond::after { transform: rotate(0); }

/* Sphere positions/sizes are written inline by app.js (populateSpheres)
   so the count + spacing scales to the actual document height. */

body { padding-bottom: 100px; }

/* ── Legacy bg-scenes — fully hidden ────────────────────── */
.bg-scenes { display: none; }
.bg-glow { display: none; }

/* Ghosted display text decoration (legacy, unused) */
.ghost-display { display: none; }

/* Grain overlay — very subtle, anchored to viewport */
.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.05;
  mix-blend-mode: overlay;
}

/* ── Cursor orb — softer per request ─────────────────────── */
.cursor-orb {
  position: fixed;
  top: 0; left: 0;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0.04) 30%,
    transparent 70%);
  filter: blur(36px);
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.5s ease;
  will-change: transform;
}
.cursor-orb.active { opacity: 0.55; }
.cursor-orb-core {
  position: fixed;
  top: 0; left: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255,255,255,0.35) 0%, rgba(255,255,255,0.12) 50%, transparent 75%);
  filter: blur(6px);
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.4s ease;
  will-change: transform;
}
.cursor-orb-core.active { opacity: 0.45; }

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 48px 22px;
  flex-wrap: wrap;
  gap: 16px;
  max-width: 1280px;
  margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  filter: grayscale(1) brightness(1.5);
}
.brand h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text);
  text-transform: uppercase;
}
.brand-sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

/* ── Buttons / controls (unified system) ─────────────────
   All pill buttons share:
     - padding: 10px 20px
     - font-size: 11.5px
     - text-transform: uppercase
     - letter-spacing: 0.14em
     - border-radius: 999px (pill)
     - transition: 0.2s ease
   Only the surface (color/background) changes between tiers.
*/
.controls { display: flex; gap: 8px; align-items: center; }

.btn,
.controls select,
.ghost-btn,
.primary-btn,
.send-btn,
.send-email-btn,
.send-ig-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  line-height: 1;
}

/* Tier 1 — Primary (white-on-black) */
.primary-btn,
.send-btn,
.send-email-btn {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}
.primary-btn:hover,
.send-btn:hover,
.send-email-btn:hover {
  background: #e6e6e6;
  border-color: #e6e6e6;
  color: #000;
}
.primary-btn:disabled,
.send-btn:disabled,
.send-email-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* IG DM — secondary (glass pill, matches ghost tier) */
.send-ig-btn {
  background: var(--bg-card);
  border-color: var(--line-strong);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  color: var(--text-soft);
}
.send-ig-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--rim-strong);
  color: var(--text);
}

/* Two action buttons side by side */
.action-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}
.no-channel {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
  opacity: 0.6;
}

/* Tier 2 — Secondary (glass pill) */
.controls select,
.ghost-btn {
  background: var(--bg-card);
  border-color: var(--line-strong);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  color: var(--text-soft);
}
.controls select {
  padding-right: 32px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%237a7a7a' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.controls select:hover,
.ghost-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--rim-strong);
  color: var(--text);
}
.ghost-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Metrics row ───────────────────────────────────────── */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 4px 48px 18px;
  max-width: 1280px;
  margin: 0 auto;
}
.metric {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(var(--blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(180%);
  padding: 20px 22px;
  border-radius: var(--radius-sm);
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  box-shadow: var(--shadow);
}
/* Single clean glass rim */
.metric::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-sm);
  padding: 1px;
  background: linear-gradient(135deg, var(--rim-strong) 0%, var(--rim) 30%, transparent 50%, var(--rim) 75%, var(--rim-strong) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}
.metric::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-sm);
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(circle 220px at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,0.16), transparent 60%);
  transition: opacity 0.3s ease;
  mix-blend-mode: screen;
}
.metric:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.metric:hover::after { opacity: 1; }
.metric > * { position: relative; z-index: 2; }
.m-v {
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.025em;
  color: var(--text);
  font-feature-settings: "tnum";
  line-height: 1;
}
.m-l {
  font-size: 9.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  margin-top: 6px;
  font-weight: 500;
}

/* ── Cards container ───────────────────────────────────── */
.cards {
  max-width: 1280px;
  margin: 0 auto;
  padding: 6px 48px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.empty {
  text-align: center;
  color: var(--text-soft);
  padding: 90px 20px;
  background: var(--bg-card);
  backdrop-filter: blur(var(--blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(180%);
  border-radius: var(--radius);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
  box-shadow: var(--shadow);
  position: relative;
}
.empty::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  padding: 1px;
  background: linear-gradient(135deg, var(--rim-strong) 0%, var(--rim) 50%, var(--rim-strong) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}

/* ── Card ──────────────────────────────────────────────── */
.card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(var(--blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(180%);
  border-radius: var(--radius);
  padding: 18px 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  box-shadow: var(--shadow);
}
/* Single glass rim */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  padding: 1px;
  background: linear-gradient(135deg, var(--rim-strong) 0%, var(--rim) 30%, transparent 50%, var(--rim) 75%, var(--rim-strong) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(circle 320px at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,0.16), transparent 60%);
  transition: opacity 0.3s ease;
  mix-blend-mode: screen;
}
.card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}
.card:hover::after { opacity: 1; }
.card > * { position: relative; z-index: 2; }

/* Card head — title block + vet icons + status badge */
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 0; }
.card-title-block { flex: 1; min-width: 0; }
.card-title {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--text);
}
.card-meta {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Vet icons — Website / IG / TikTok */
.card-vet {
  display: flex;
  gap: 6px;
  align-items: center;
}
.card-vet .vet {
  width: 30px; height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-strong);
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
  backdrop-filter: blur(8px);
}
.card-vet .vet:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--rim-strong);
  color: #fff;
  transform: translateY(-1px);
}
.card-vet .vet[hidden] { display: none; }

/* Status badge */
.badge {
  font-size: 9.5px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.18em;
  white-space: nowrap;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
  color: var(--text-soft);
}
.badge.s-To-Contact { color: var(--text-soft); }
.badge.s-Contacted { color: #d4d4d4; border-color: rgba(255,255,255,0.25); }
.badge.s-Replied, .badge.s-In-Convo { color: #fff; border-color: rgba(255,255,255,0.4); background: rgba(255,255,255,0.06); }
.badge.s-Call-Booked { color: #fff; border-color: rgba(255,255,255,0.4); background: rgba(255,255,255,0.06); }
.badge.s-Proposal-Sent { color: #fff; border-color: rgba(255,255,255,0.4); background: rgba(255,255,255,0.06); }
.badge.s-Won { color: #000; background: #fff; border-color: #fff; }
.badge.s-Lost { color: var(--muted); border-color: var(--line); }
.badge.s-Passed, .badge.s-Ghosted { color: var(--muted-deep); }

.card-contacts {
  display: flex;
  gap: 14px;
  margin: 10px 0 0;
  flex-wrap: wrap;
}
.contact {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  font-feature-settings: "tnum";
}
.contact:empty { display: none; }

/* Brief preview */
.brief-short {
  margin: 10px 0 12px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.005em;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-detail { margin: 0 0 10px; }
.card-detail summary {
  cursor: pointer;
  list-style: none;
  display: inline-block;
  padding: 0;
}
.card-detail summary::-webkit-details-marker { display: none; }

.brief-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 16px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: all 0.22s ease;
}
.brief-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--rim-strong);
  transform: translateY(-1px);
}
.brief-btn-icon {
  font-size: 17px;
  line-height: 1;
  font-weight: 400;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-soft);
}
.card-detail[open] .brief-btn-icon { transform: rotate(90deg); }
.card-detail[open] .brief-btn-label::after { content: " · close"; opacity: 0.55; }

.detail-expand {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.brief-full {
  color: var(--text-soft);
  font-size: 13.5px;
  line-height: 1.65;
  margin: 0;
}
.draft-label {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.message {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--text);
  padding: 14px 16px;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.6;
  resize: vertical;
  transition: all 0.2s ease;
  letter-spacing: 0.005em;
  backdrop-filter: blur(10px);
}
.message:focus {
  outline: none;
  border-color: rgba(255,255,255,0.45);
  background: rgba(0, 0, 0, 0.55);
}
.notes {
  color: var(--text-soft);
  font-size: 12.5px;
  margin: 0;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  border-left: 2px solid var(--rim-strong);
  line-height: 1.55;
  backdrop-filter: blur(8px);
}
.notes:empty { display: none; }

/* Card actions */
.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 2px;
}
.deal {
  color: var(--text);
  font-weight: 500;
  font-size: 13.5px;
  letter-spacing: -0.005em;
  font-feature-settings: "tnum";
}
/* send-btn unified with primary-btn above — no overrides here */

/* Load-more trigger */
.load-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 28px 20px 12px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.load-more[hidden] { display: none; }
.load-more .spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-top-color: rgba(255, 255, 255, 0.85);
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.load-more.done .spinner { display: none; }
.load-more.done .load-label::before { content: "✓ "; opacity: 0.55; }

/* ── Footer ─────────────────────────────────────────────── */
.foot {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 14px 48px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
}
.foot a {
  color: var(--text-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
  transition: color 0.2s ease;
}
.foot a:hover { color: var(--text); }

/* ── Dialogs ────────────────────────────────────────────── */
dialog {
  background: rgba(15, 15, 15, 0.9);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 36px;
  max-width: 500px;
  width: 90vw;
  box-shadow: 0 40px 100px rgba(0,0,0,0.7), 0 1px 0 rgba(255,255,255,0.12) inset;
}
dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
dialog h2 {
  margin: 0 0 22px;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
dialog label {
  display: block;
  margin: 14px 0;
  font-size: 9.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-weight: 600;
}
dialog input[type="text"],
dialog input[type="email"],
dialog input[type="number"],
dialog input[type="date"],
dialog textarea,
dialog select {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--line-strong);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13.5px;
  margin-top: 8px;
  letter-spacing: 0.005em;
  text-transform: none;
}
dialog input:focus, dialog textarea:focus, dialog select:focus {
  outline: none;
  border-color: rgba(255,255,255,0.45);
  background: rgba(0, 0, 0, 0.55);
}
dialog label.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}
.row { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

#add-panel { max-width: 700px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-grid label.full { grid-column: span 2; }
.form-grid textarea { resize: vertical; }

@media (max-width: 800px) {
  .topbar { padding: 22px 22px 14px; }
  .metrics { grid-template-columns: repeat(2, 1fr); padding: 6px 22px 14px; }
  .cards { padding: 6px 22px; }
  .card { padding: 18px 20px; }
  .foot { padding: 12px 22px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid label.full { grid-column: span 1; }
}

/* ── AI chat assistant ──────────────────────────────────── */
.kc-launch {
  position: fixed;
  right: 28px;
  bottom: 66px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 22px;
  border-radius: var(--radius-pill);
  background: #ffffff;
  color: #000;
  border: 1px solid #fff;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: var(--shadow-lift);
  transition: transform 0.2s ease, background 0.2s ease;
}
.kc-launch:hover { transform: translateY(-2px); background: #e8e8e8; }
.kc-launch-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #000;
  box-shadow: 0 0 0 0 rgba(0,0,0,0.35);
  animation: kcPulse 2.4s infinite;
}
@keyframes kcPulse {
  0% { box-shadow: 0 0 0 0 rgba(0,0,0,0.35); }
  70% { box-shadow: 0 0 0 7px rgba(0,0,0,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); }
}

.kc-panel {
  position: fixed;
  right: 28px;
  bottom: 66px;
  z-index: 60;
  width: 384px;
  height: min(560px, 72vh);
  display: flex;
  flex-direction: column;
  background: rgba(15, 15, 18, 0.86);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lift);
}
.kc-panel[hidden] { display: none; }
.kc-panel::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: var(--radius);
  padding: 1px;
  background: linear-gradient(135deg, var(--rim-strong) 0%, var(--rim) 40%, transparent 60%, var(--rim) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}

.kc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}
.kc-title { font-size: 14px; font-weight: 600; letter-spacing: 0.02em; color: var(--text); }
.kc-sub {
  font-size: 9.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.2em;
  margin-top: 3px; font-weight: 500;
}
.kc-close {
  background: none; border: none; color: var(--muted);
  font-size: 22px; line-height: 1; cursor: pointer;
  padding: 2px 6px; border-radius: 8px; transition: color 0.2s ease;
}
.kc-close:hover { color: var(--text); }

.kc-log {
  flex: 1;
  overflow-y: auto;
  padding: 18px 18px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.kc-intro {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.6;
}
.kc-intro strong { color: var(--text); }
.kc-eg {
  margin-top: 12px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
}

.kc-msg {
  max-width: 86%;
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.kc-user {
  align-self: flex-end;
  background: #ffffff;
  color: #000;
  border-bottom-right-radius: 5px;
}
.kc-assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-bottom-left-radius: 5px;
}
.kc-note {
  align-self: center;
  font-size: 10.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  padding: 2px 0;
}

.kc-typing { display: flex; gap: 5px; align-items: center; }
.kc-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-soft);
  animation: kcBlink 1.3s infinite both;
}
.kc-typing span:nth-child(2) { animation-delay: 0.18s; }
.kc-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes kcBlink {
  0%, 80%, 100% { opacity: 0.25; }
  40% { opacity: 1; }
}

.kc-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
}
.kc-form textarea {
  flex: 1;
  resize: none;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--text);
  padding: 11px 14px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  max-height: 130px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.kc-form textarea:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(0, 0, 0, 0.55);
}
.kc-send {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #fff;
  color: #000;
  border: none;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.kc-send:hover { background: #e6e6e6; transform: translateY(-1px); }
.kc-send:disabled { opacity: 0.4; cursor: not-allowed; }

@media (max-width: 800px) {
  .kc-panel {
    right: 12px; left: 12px;
    width: auto;
    bottom: 60px;
    height: min(70vh, 540px);
  }
  .kc-launch { right: 16px; bottom: 60px; }
}
