:root {
  --bg-base: #050505;
  --rail: #070707;
  --elev-1: #10100f;
  --elev-2: #171612;
  --elev-3: #201d16;
  --line-subtle: rgba(255, 255, 255, 0.05);
  --line: rgba(224, 197, 126, 0.13);
  --line-strong: rgba(224, 197, 126, 0.28);
  --text: #f7f2e5;
  --text-2: #d5cbb4;
  --muted: #9f947d;
  --quiet: #655d50;
  --gold-dark: #8f6f37;
  --gold: #c7a668;
  --gold-2: #e0c57e;
  --gold-3: #f0d999;
  --gold-soft: rgba(199, 166, 104, 0.15);
  --gold-glow: rgba(224, 197, 126, 0.34);
  --red: var(--gold);
  --red-2: var(--gold-2);
  --red-soft: var(--gold-soft);
  --red-glow: var(--gold-glow);
  --green: #4cc26d;
  --green-soft: rgba(76, 194, 109, 0.14);
  --amber: #e8a92f;
  --amber-soft: rgba(232, 169, 47, 0.14);
  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 14px;
  --radius-pill: 999px;
  --shadow-card: 0 14px 40px rgba(0, 0, 0, 0.32);
  --gap-s: 10px;
  --gap-m: 14px;
  --gap-l: 20px;
  --rail-w: 232px;
  --aside-w: 312px;
  --max-w: 1640px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  background: #050505;
}

body {
  min-height: 100vh;
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background:
    radial-gradient(900px 480px at 78% -10%, rgba(224, 197, 126, 0.12), transparent 70%),
    radial-gradient(820px 420px at -10% 0%, rgba(143, 111, 55, 0.12), transparent 70%),
    linear-gradient(180deg, #050505 0%, #0c0b09 60%, #050505 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  transition:
    background 180ms cubic-bezier(0.32, 0.72, 0.24, 1),
    border-color 180ms ease,
    color 180ms ease,
    transform 180ms cubic-bezier(0.32, 0.72, 0.24, 1),
    box-shadow 180ms ease,
    opacity 180ms ease;
}

button[data-busy="true"] {
  position: relative;
  pointer-events: none;
  color: transparent !important;
  text-shadow: none !important;
}

button[data-busy="true"]::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.18) 50%, transparent 70%);
  background-size: 220% 100%;
  animation: dbkShimmer 1.1s linear infinite;
  pointer-events: none;
}

button[data-busy="true"]::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  border: 2px solid rgba(7, 7, 7, 0.28);
  border-top-color: rgba(7, 7, 7, 0.92);
  animation: dbkSpin 0.7s linear infinite;
  z-index: 1;
}

@keyframes dbkShimmer {
  from { background-position: 200% 0; }
  to { background-position: -100% 0; }
}

@keyframes dbkSpin {
  to { transform: rotate(360deg); }
}

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

@keyframes dbkPulseDot {
  0%, 100% { opacity: 0.35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--red-glow);
  outline-offset: 2px;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.icon {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ============================================================
   SHELL
   ============================================================ */

.shell {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  min-height: 100vh;
}

/* ============================================================
   RAIL
   ============================================================ */

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 16px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 18%),
    var(--rail);
  z-index: 5;
}

.rail-brand {
  display: grid;
  gap: 2px;
  padding: 2px 12px 22px;
  border-bottom: 1px solid var(--line-subtle);
}

.brand-mark {
  width: max-content;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 44px;
  font-weight: 900;
  letter-spacing: 0.01em;
  line-height: 1;
  color: transparent;
  background: linear-gradient(90deg, #f0d999 0%, #c7a668 42%, #8f6f37 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.brand-os {
  color: var(--gold-2);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  white-space: nowrap;
}

.rail-nav {
  display: grid;
  gap: 4px;
  margin-top: 18px;
  overflow-y: auto;
  padding-right: 2px;
}

.rail-nav::-webkit-scrollbar {
  width: 4px;
}

.rail-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
}

.rail-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-align: left;
}

.rail-link .icon {
  font-size: 18px;
  color: var(--quiet);
}

.rail-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.rail-link:hover .icon {
  color: var(--text-2);
}

.rail-link.active {
  color: #070707;
  background: linear-gradient(135deg, #f0d999, #c7a668 50%, #8f6f37);
  border-color: rgba(240, 217, 153, 0.35);
  box-shadow: 0 10px 28px rgba(199, 166, 104, 0.26);
}

.rail-link.active .icon {
  color: #070707;
}

.rail-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line-subtle);
}

.rail-gym {
  padding: 14px 12px 10px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(199, 166, 104, 0.12), rgba(0, 0, 0, 0)) ,
              rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line-subtle);
}

.rail-gym-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rail-gym-name::before {
  content: "";
  width: 6px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--gold-3), var(--gold));
}

.rail-gym-loc {
  margin-top: 4px;
  margin-left: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.rail-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 12px;
  color: #8de3a0;
  font-size: 12px;
  font-weight: 700;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #67d982;
  box-shadow: 0 0 0 4px rgba(103, 217, 130, 0.18);
}

/* ============================================================
   WORKSPACE / TOPBAR
   ============================================================ */

.workspace {
  min-width: 0;
  padding: 14px 24px 36px;
  max-width: var(--max-w);
}

.topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  height: 56px;
  margin-bottom: 4px;
}

.topbar-hamburger {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-2);
  align-items: center;
  justify-content: center;
}

.topbar-hamburger .icon {
  font-size: 18px;
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  max-width: 460px;
  width: 100%;
}

.topbar-search:focus-within {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
}

.topbar-search .icon {
  font-size: 16px;
  color: var(--quiet);
}

.topbar-search input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

.topbar-search input::placeholder {
  color: var(--quiet);
}

.topbar-search kbd {
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-bell {
  position: relative;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topbar-bell:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.topbar-bell .icon {
  font-size: 17px;
}

.bell-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold-3), var(--gold));
  color: #070707;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 0 0 2px var(--bg-base);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #2c343a, #1a2025);
  border: 1px solid var(--line-strong);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.user-meta strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
}

.user-meta span {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
}

/* ============================================================
   PAGE HEAD
   ============================================================ */

.view {
  display: none;
}

.view.active {
  display: block;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 6px 0 18px;
}

.page-head.compact {
  align-items: center;
  margin: 0 0 20px;
}

.page-head-text h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.page-head-text p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
}

.page-head-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.005em;
}

.btn .icon {
  font-size: 15px;
}

.btn-ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-2);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-color: var(--line-strong);
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-3), var(--gold) 54%, var(--gold-dark));
  border-color: rgba(240, 217, 153, 0.36);
  color: #070707;
  box-shadow: 0 8px 22px rgba(199, 166, 104, 0.30);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #f6e2a3, #aa8545);
  transform: translateY(-1px);
}

.btn-danger {
  border-color: rgba(216, 111, 95, 0.34);
  color: #ffd6cf;
  background: rgba(216, 111, 95, 0.12);
}

.btn-danger:hover {
  background: rgba(216, 111, 95, 0.18);
  border-color: rgba(216, 111, 95, 0.46);
}

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
}

.btn-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.btn-link .icon {
  font-size: 13px;
}

.btn-link-danger {
  color: var(--red);
}

.btn-link-danger:hover {
  background: rgba(199, 166, 104, 0.10);
  color: var(--red-2);
}

/* ============================================================
   KPI ROW
   ============================================================ */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap-m);
  margin-bottom: var(--gap-l);
}

.kpi {
  position: relative;
  padding: 18px 20px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 60%),
    var(--elev-1);
  overflow: hidden;
  min-height: 130px;
  display: flex;
  flex-direction: column;
}

.kpi-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.kpi-label .icon {
  font-size: 14px;
  color: var(--quiet);
}

.kpi-value {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.kpi-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--green);
  font-weight: 700;
}

.kpi-trend.down {
  color: var(--red);
}

.kpi-trend .icon {
  font-size: 12px;
}

.kpi-donut {
  --pct: 68;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: conic-gradient(var(--red) 0 calc(var(--pct) * 1%), rgba(255, 255, 255, 0.10) calc(var(--pct) * 1%) 100%);
  position: relative;
  flex: 0 0 auto;
}

.kpi-donut::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--elev-1);
}

.kpi-spark {
  position: absolute;
  right: 16px;
  bottom: 38px;
  width: 110px;
  height: 36px;
  pointer-events: none;
}

.kpi-spark path {
  fill: none;
  stroke: var(--red);
  stroke-width: 2;
}

.kpi-spark .fill {
  fill: rgba(199, 166, 104, 0.18);
  stroke: none;
}

/* ============================================================
   DASHBOARD SPLIT
   ============================================================ */

.dashboard-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--gap-l);
  align-items: start;
}

.dashboard-main {
  display: grid;
  gap: var(--gap-m);
  min-width: 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--gap-m);
}

.grid-2.even {
  grid-template-columns: 1fr 1fr;
}

/* ============================================================
   CARDS (generic)
   ============================================================ */

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.022), transparent 40%),
    var(--elev-1);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  position: relative;
}

.collapse-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from 0deg, transparent 0 62%, rgba(224, 197, 126, 0.96), transparent 82% 100%);
  opacity: 0;
  pointer-events: none;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.collapse-card.gold-ring::after {
  animation: dbk-gold-ring 920ms ease-out 1;
}

@keyframes dbk-gold-ring {
  0% {
    opacity: 0;
    transform: rotate(-80deg);
  }
  12% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(280deg);
  }
}

.collapse-card.is-collapsed .collapse-body {
  display: none;
}

.collapse-card.is-collapsed {
  background:
    linear-gradient(180deg, rgba(224, 197, 126, 0.055), rgba(255, 255, 255, 0.015)),
    var(--elev-1);
}

.collapse-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(224, 197, 126, 0.24);
  border-radius: 8px;
  background: rgba(224, 197, 126, 0.06);
  color: var(--gold-3);
  font: inherit;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.03em;
  cursor: pointer;
}

.collapse-toggle .icon {
  font-size: 13px;
  transition: transform 160ms ease;
}

.collapse-card.is-collapsed .collapse-toggle .icon {
  transform: rotate(-90deg);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-subtle);
}

.card-head-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-head-title .icon {
  font-size: 15px;
  color: var(--text-2);
}

.card-head-title .badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--red-soft);
  color: var(--gold-3);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: none;
}

.card-body {
  padding: 16px 20px 20px;
}

.card-body.flush {
  padding: 0;
}

.card-foot {
  border-top: 1px solid var(--line-subtle);
  padding: 10px 16px;
}

/* ============================================================
   CAMPAIGN CARD
   ============================================================ */

.campaign-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-subtle);
  background: linear-gradient(180deg, rgba(199, 166, 104, 0.04), transparent 100%);
}

.campaign-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.campaign-title .pill {
  background: var(--green-soft);
  color: #87ee9d;
}

.campaign-summary p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.campaign-progress {
  flex: 0 0 auto;
  width: 180px;
  text-align: right;
}

.campaign-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
}

.campaign-progress-meta strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.campaign-progress-bar {
  height: 6px;
  margin-top: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.campaign-progress-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #f0d999, #9a783d);
  border-radius: 999px;
}

.campaign-kpis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-bottom: 1px solid var(--line-subtle);
}

.campaign-kpi {
  padding: 14px 18px;
  border-right: 1px solid var(--line-subtle);
}

.campaign-kpi:last-child {
  border-right: 0;
}

.campaign-kpi .label {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.campaign-kpi .value {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.campaign-kpi .sub {
  display: block;
  margin-top: 2px;
  color: var(--quiet);
  font-size: 11.5px;
  font-weight: 600;
}

.business-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 18px 18px;
}

.business-snapshot-panel {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line-subtle);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.business-snapshot-panel strong {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.business-snapshot-panel span {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.45;
}

.campaign-chart {
  padding: 14px 20px 18px;
}

.chart-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
}

.chart-legend {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
}

.legend-dash {
  width: 18px;
  height: 0;
  border-top: 2px dashed rgba(255, 255, 255, 0.4);
}

.chart-svg {
  display: block;
  width: 100%;
  height: 140px;
  margin-top: 10px;
}

.chart-svg .grid line {
  stroke: rgba(255, 255, 255, 0.04);
}

.chart-svg .target {
  fill: none;
  stroke: rgba(255, 255, 255, 0.32);
  stroke-width: 1.5;
  stroke-dasharray: 6 7;
}

.chart-svg .returned {
  fill: none;
  stroke: var(--red);
  stroke-width: 2.5;
}

.chart-svg .returned-fill {
  fill: rgba(199, 166, 104, 0.10);
  stroke: none;
}

.chart-svg .today {
  stroke: rgba(255, 255, 255, 0.30);
  stroke-dasharray: 3 4;
}

/* ============================================================
   LEAD QUEUE
   ============================================================ */

.list {
  display: grid;
}

.lead-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line-subtle);
}

.lead-row:last-child {
  border-bottom: 0;
}

.lead-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #2a3137, #181d22);
  border: 1px solid var(--line-strong);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.lead-avatar.tone-red {
  background: linear-gradient(135deg, rgba(199, 166, 104, 0.45), rgba(143, 111, 55, 0.55));
  border-color: rgba(199, 166, 104, 0.30);
}

.lead-avatar.tone-amber {
  background: linear-gradient(135deg, rgba(232, 169, 47, 0.40), rgba(120, 80, 16, 0.55));
  border-color: rgba(232, 169, 47, 0.30);
}

.lead-avatar.tone-blue {
  background: linear-gradient(135deg, rgba(72, 130, 200, 0.42), rgba(28, 50, 80, 0.6));
  border-color: rgba(72, 130, 200, 0.30);
}

.lead-meta strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lead-meta span {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pill {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.pill-hot {
  background: var(--red-soft);
  color: var(--gold-3);
}

.pill-warm {
  background: var(--amber-soft);
  color: #f6c56b;
}

.pill-new {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-2);
}

.pill-active {
  background: var(--green-soft);
  color: #87ee9d;
}

.lead-time {
  text-align: right;
  white-space: nowrap;
}

.lead-time strong {
  display: block;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.lead-time span {
  display: block;
  color: var(--quiet);
  font-size: 11px;
  font-weight: 500;
}

.list-add {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 44px;
  padding: 0 18px;
  border: 0;
  border-top: 1px dashed var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  text-align: left;
}

.list-add:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.list-add .icon {
  font-size: 14px;
  color: var(--red);
}

/* ============================================================
   HANDOVERS
   ============================================================ */

.handover-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line-subtle);
}

.handover-row:last-child {
  border-bottom: 0;
}

.handover-flag {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(199, 166, 104, 0.18);
}

.handover-meta strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
}

.handover-meta span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.handover-time {
  color: var(--quiet);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.btn-takeover {
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 700;
}

.btn-takeover:hover {
  background: var(--red-soft);
  border-color: rgba(199, 166, 104, 0.4);
  color: var(--gold-3);
}

/* ============================================================
   BRIEF CARD
   ============================================================ */

.brief-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) minmax(220px, 1fr);
  gap: 18px;
  padding: 20px;
}

.brief-photo {
  position: relative;
  border-radius: 8px;
  min-height: 200px;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.10), rgba(0, 0, 0, 0.78)),
    linear-gradient(135deg, #1d262c, #0c1216);
  border: 1px solid var(--line-subtle);
  display: flex;
  align-items: flex-end;
  padding: 14px;
  overflow: hidden;
}

.brief-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(80% 60% at 70% 30%, rgba(199, 166, 104, 0.25), transparent 60%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.02) 0 2px, transparent 2px 8px);
  pointer-events: none;
}

.brief-photo-mark {
  position: relative;
  z-index: 1;
  color: transparent;
  background: linear-gradient(90deg, var(--gold-3), var(--gold), var(--gold-dark));
  -webkit-background-clip: text;
  background-clip: text;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.brief-photo-mark span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 4px;
}

.brief-details h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.brief-when {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.brief-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
}

.brief-list > div {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid var(--line-subtle);
}

.brief-list > div:first-child {
  border-top: 0;
  padding-top: 0;
}

.brief-list dt {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brief-list dd {
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
}

.brief-notes h4 {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.brief-notes ul {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.brief-notes li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.5;
}

.brief-notes li .icon {
  font-size: 14px;
  margin-top: 1px;
  color: var(--green);
  flex: 0 0 auto;
}

.brief-notes li.note-warn {
  color: var(--amber);
}

.brief-notes li.note-warn .icon {
  color: var(--amber);
}

.brief-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line-subtle);
  background: rgba(0, 0, 0, 0.18);
}

/* ============================================================
   INSIGHTS
   ============================================================ */

.insight {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid var(--line-subtle);
  border-radius: 10px;
}

.insight + .insight {
  margin-top: 10px;
}

.insight-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
}

.insight-icon .icon {
  font-size: 16px;
}

.insight-text strong {
  display: block;
  font-size: 13.5px;
  font-weight: 800;
}

.insight-text span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

.insight.green {
  background: rgba(76, 194, 109, 0.06);
  border-color: rgba(76, 194, 109, 0.22);
}

.insight.green .insight-icon {
  background: var(--green-soft);
  color: var(--green);
}

.insight.amber {
  background: rgba(232, 169, 47, 0.05);
  border-color: rgba(232, 169, 47, 0.22);
}

.insight.amber .insight-icon {
  background: var(--amber-soft);
  color: var(--amber);
}

/* ============================================================
   ACTIVITY
   ============================================================ */

.activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}

.activity-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line-subtle);
}

.activity-row:last-child {
  border-bottom: 0;
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
}

.activity-dot.green { background: var(--green); }
.activity-dot.amber { background: var(--amber); }
.activity-dot.muted { background: var(--quiet); }

.activity-text {
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-text strong {
  color: var(--text);
  font-weight: 700;
}

.activity-time {
  color: var(--quiet);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* ============================================================
   ASIDE / PHONE
   ============================================================ */

.dashboard-aside {
  position: sticky;
  top: 14px;
  display: grid;
  gap: 12px;
}

.aside-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.aside-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: #87ee9d;
  font-size: 10.5px;
  font-weight: 800;
}

.aside-tag::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}

.phone {
  margin: 0 auto;
  width: 296px;
  border-radius: 36px;
  padding: 8px;
  background:
    linear-gradient(135deg, #2a2a2e, #0c0d10);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  position: relative;
}

.phone-screen {
  position: relative;
  border-radius: 30px;
  background: #07090b;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.phone-notch {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 92px;
  height: 22px;
  border-radius: 999px;
  background: #050608;
  z-index: 2;
}

.phone-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.phone-status-icons {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
}

.phone-status-icons .icon {
  font-size: 12px;
}

.phone-app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 4px;
}

.phone-brand {
  display: grid;
  gap: 1px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 0.88;
  color: transparent;
  background: linear-gradient(90deg, var(--gold-3), var(--gold), var(--gold-dark));
  -webkit-background-clip: text;
  background-clip: text;
}

.phone-brand-os {
  color: var(--gold-2);
  margin-left: 0;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.phone-app-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.phone-app-tools .pill {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-2);
  font-size: 10px;
  height: 18px;
  padding: 0 7px;
}

.phone-mini-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c7a668, #8f6f37);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
}

.phone-body {
  padding: 12px 18px 14px;
}

.phone-body h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-top: 6px;
}

.phone-body > p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}

.phone-card {
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.035);
}

.phone-card.primary {
  border-color: rgba(199, 166, 104, 0.30);
  background:
    linear-gradient(180deg, rgba(199, 166, 104, 0.10), rgba(199, 166, 104, 0.02));
}

.phone-card.subtle {
  background: rgba(255, 255, 255, 0.02);
}

.phone-card-eyebrow {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.phone-card strong {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.phone-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
}

.phone-cta {
  width: 100%;
  height: 34px;
  margin-top: 10px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--gold-3), var(--gold) 58%, var(--gold-dark));
  color: #070707;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.phone-mood {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.phone-mood button {
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 700;
}

.phone-mood button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.phone-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 8px 6px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.4);
}

.phone-tab {
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--quiet);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 4px 0 0;
}

.phone-tab .icon {
  font-size: 16px;
}

.phone-tab.active {
  color: var(--gold-2);
}

.aside-foot {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.015);
}

.aside-foot-title {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
}

.aside-foot p {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.5;
}

/* ============================================================
   SIMPLE PAGE (other views)
   ============================================================ */

.simple-page {
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.022), transparent 40%),
    var(--elev-1);
}

.simple-page h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.simple-page p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  max-width: 780px;
}

.simple-page pre {
  margin-top: 18px;
  padding: 16px;
  border-radius: 8px;
  background: #050709;
  border: 1px solid var(--line-subtle);
  color: #c8d0d6;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, monospace;
  white-space: pre-wrap;
  overflow-x: auto;
  max-width: 100%;
}

.endpoint-list {
  margin-top: 18px;
  border: 1px solid var(--line-subtle);
  border-radius: 10px;
  overflow: hidden;
}

.endpoint {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-top: 1px solid var(--line-subtle);
  font-size: 13px;
  color: var(--muted);
}

.endpoint:first-child { border-top: 0; }

.endpoint strong {
  font-family: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, monospace;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
}

.endpoint .badge {
  height: 22px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.badge.ready {
  background: var(--green-soft);
  color: #87ee9d;
}

.member-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.member-stat {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line-subtle);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.member-stat span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.member-stat strong {
  font-size: 28px;
  letter-spacing: -0.03em;
}

.member-stat small {
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.45;
}

.member-table-card {
  margin-top: 16px;
  border: 1px solid var(--line-subtle);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.member-table {
  display: grid;
}

.member-row {
  display: grid;
  grid-template-columns: 1.3fr 120px 1fr 1fr;
  gap: 14px;
  align-items: center;
  padding: 13px 16px;
  border-top: 1px solid var(--line-subtle);
  color: var(--text-2);
  font-size: 13px;
}

.member-row.head {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.member-row strong {
  display: block;
  color: var(--text);
}

.member-row small {
  display: block;
  margin-top: 2px;
  color: var(--quiet);
}

.badge.draft {
  background: var(--amber-soft);
  color: #f6c56b;
}

/* ============================================================
   DBK AI / KNOWLEDGE / SETTINGS
   ============================================================ */

.assistant-grid,
.knowledge-layout,
.settings-grid {
  display: grid;
  gap: 16px;
}

.assistant-home {
  min-height: calc(100vh - 88px);
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 18px;
  padding: clamp(34px, 7vh, 78px) 18px 28px;
}

.assistant-hero {
  width: min(820px, 100%);
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.assistant-logo {
  display: grid;
  justify-items: center;
  gap: 3px;
}

.assistant-logo span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(58px, 10vw, 92px);
  font-weight: 900;
  line-height: 0.88;
  color: transparent;
  background: linear-gradient(90deg, var(--gold-3), var(--gold), var(--gold-dark));
  -webkit-background-clip: text;
  background-clip: text;
}

.assistant-logo small {
  color: var(--gold-2);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.assistant-hero h1 {
  font-size: clamp(31px, 5vw, 54px);
  font-weight: 850;
  line-height: 1;
  letter-spacing: -0.035em;
}

.assistant-hero p {
  max-width: 720px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 550;
  line-height: 1.65;
}

.hero-composer {
  width: min(860px, 100%);
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: var(--shadow-card);
}

.hero-composer input {
  min-height: 50px;
  border: 0;
  background: transparent;
  font-size: 14px;
}

.hero-composer .btn {
  height: 50px;
}

.prompt-grid {
  width: min(860px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.prompt-card {
  min-height: 82px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
}

.prompt-card:hover {
  border-color: var(--line-strong);
  background: rgba(199, 166, 104, 0.09);
  transform: translateY(-1px);
}

.prompt-card strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.prompt-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.assistant-panel.prompt-first {
  width: min(860px, 100%);
  grid-template-rows: minmax(180px, 32vh);
  min-height: 220px;
}

.assistant-grid {
  grid-template-columns: minmax(0, 1fr) 300px;
}

.assistant-panel,
.assistant-prompts,
.knowledge-editor,
.settings-card,
.knowledge-item {
  border: 1px solid var(--line-subtle);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.024), transparent 45%),
    rgba(255, 255, 255, 0.018);
}

/* ============================================================
   DBK AI HERO (assistant-home)
   ============================================================ */

.assistant-home {
  position: relative;
  display: grid;
  gap: 26px;
  max-width: 880px;
  margin: 18px auto 0;
  padding: 18px 8px 8px;
}

.assistant-home::before {
  content: "";
  position: absolute;
  inset: -120px -80px auto auto;
  width: 520px;
  height: 360px;
  background: radial-gradient(closest-side, rgba(224, 197, 126, 0.18), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.assistant-home > * { position: relative; z-index: 1; }

.assistant-hero {
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
  padding: 4px;
}

.assistant-logo {
  display: grid;
  justify-items: center;
  gap: 4px;
  margin-bottom: 4px;
}

.assistant-logo span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 56px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.01em;
  color: transparent;
  background: linear-gradient(180deg, #f6e4ad 0%, #e0c57e 38%, #8f6f37 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 4px 18px rgba(224, 197, 126, 0.18));
}

.assistant-logo small {
  color: var(--gold-2);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.assistant-hero h1 {
  font-size: clamp(28px, 3.2vw, 38px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
  background: linear-gradient(180deg, #fbf6e4 0%, #d5c8a3 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.assistant-hero p {
  max-width: 620px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
}

.assistant-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line-subtle);
  background: rgba(0, 0, 0, 0.18);
}

.assistant-composer.hero-composer {
  position: relative;
  padding: 8px 8px 8px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)),
    rgba(15, 14, 12, 0.74);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow:
    0 24px 56px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(224, 197, 126, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.assistant-composer.hero-composer::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 15px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(224, 197, 126, 0.25), transparent 38%, transparent 65%, rgba(224, 197, 126, 0.18));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}

.assistant-composer.hero-composer:focus-within {
  border-color: rgba(224, 197, 126, 0.42);
  box-shadow:
    0 28px 64px rgba(0, 0, 0, 0.5),
    0 0 0 4px rgba(224, 197, 126, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.assistant-composer.hero-composer input {
  min-height: 48px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.assistant-composer.hero-composer input::placeholder {
  color: var(--quiet);
  font-weight: 500;
}

.assistant-composer.hero-composer .btn {
  height: 44px;
  padding: 0 22px;
}

.prompt-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.prompt-card {
  display: grid;
  gap: 4px;
  align-content: start;
  padding: 14px 16px;
  border: 1px solid var(--line-subtle);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.005)),
    rgba(15, 14, 12, 0.5);
  text-align: left;
  color: var(--text);
}

.prompt-card strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.005em;
}

.prompt-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.prompt-card:hover {
  border-color: rgba(224, 197, 126, 0.32);
  background:
    linear-gradient(180deg, rgba(224, 197, 126, 0.08), rgba(224, 197, 126, 0.015)),
    rgba(15, 14, 12, 0.6);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.32);
}

.assistant-panel {
  display: grid;
  grid-template-rows: minmax(220px, 38vh) auto;
  min-height: 280px;
  overflow: hidden;
}

.assistant-panel.prompt-first {
  grid-template-rows: 1fr;
  min-height: 200px;
  border-color: var(--line-subtle);
  background: rgba(15, 14, 12, 0.4);
}

.assistant-log {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 18px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.briefs-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  margin-top: 18px;
}

.brief-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.brief-lane {
  min-width: 0;
  border: 1px solid var(--line-subtle);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
  overflow: hidden;
}

.brief-lane-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-subtle);
}

.brief-lane-head h2 {
  color: var(--gold-2);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brief-lane-head span {
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
  font-weight: 850;
}

.brief-card-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.brief-kanban-card {
  min-height: 156px;
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 13px;
  border: 1px solid var(--line-subtle);
  border-radius: 8px;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.026);
  text-align: left;
}

.brief-kanban-card:hover,
.brief-kanban-card.active {
  border-color: var(--line-strong);
  background: rgba(199, 166, 104, 0.09);
}

.brief-kanban-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.brief-kanban-card strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 850;
}

.brief-kanban-card small {
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.5;
}

.brief-kanban-card em {
  align-self: end;
  color: var(--gold-2);
  font-size: 11.5px;
  font-style: normal;
  font-weight: 800;
}

.brief-drawer {
  position: sticky;
  top: 16px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(199, 166, 104, 0.08), transparent 38%),
    rgba(255, 255, 255, 0.022);
}

.drawer-kicker {
  color: var(--gold-2);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brief-drawer h2 {
  margin-top: 9px;
  font-size: 25px;
  font-weight: 850;
  letter-spacing: -0.025em;
}

.drawer-contact {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.drawer-contact a {
  color: var(--text-2);
  font-size: 13px;
  font-weight: 750;
}

.drawer-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
}

.drawer-list div {
  display: grid;
  gap: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line-subtle);
}

.drawer-list dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.drawer-list dd {
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.55;
}

.assistant-message {
  max-width: 82%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-subtle);
  animation: dbkFadeUp 240ms cubic-bezier(0.32, 0.72, 0.24, 1) both;
}

.assistant-message strong {
  display: block;
  margin-bottom: 5px;
  color: var(--gold-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.assistant-message p {
  margin: 0;
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.6;
}

.assistant-body {
  display: grid;
  gap: 10px;
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.62;
}

.assistant-body p,
.assistant-body h4,
.assistant-body ul,
.assistant-body ol {
  margin: 0;
}

.assistant-body h4 {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.assistant-body strong {
  display: inline;
  margin: 0;
  color: var(--text);
  font-size: inherit;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.assistant-body ul,
.assistant-body ol {
  display: grid;
  gap: 8px;
  padding-left: 20px;
}

.assistant-body li::marker {
  color: var(--gold-2);
  font-weight: 800;
}

.assistant-body code {
  color: var(--gold-2);
  font-size: 0.92em;
}

.assistant-source {
  display: inline-flex;
  margin-top: 12px;
  color: rgba(224, 197, 126, 0.72);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.assistant-message.assistant {
  background:
    linear-gradient(180deg, rgba(224, 197, 126, 0.10), rgba(224, 197, 126, 0.04)),
    rgba(15, 14, 12, 0.6);
  border-color: rgba(224, 197, 126, 0.18);
  border-top-left-radius: 4px;
}

.assistant-message.user {
  justify-self: end;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
  border-top-right-radius: 4px;
}

.assistant-message.user strong {
  color: var(--text-2);
}

.assistant-message.thinking p::after {
  content: "";
  display: inline-block;
  width: 28px;
  margin-left: 4px;
  background:
    radial-gradient(circle, var(--gold-2) 30%, transparent 32%) 0 50%/6px 6px,
    radial-gradient(circle, var(--gold-2) 30%, transparent 32%) 11px 50%/6px 6px,
    radial-gradient(circle, var(--gold-2) 30%, transparent 32%) 22px 50%/6px 6px;
  background-repeat: no-repeat;
  height: 6px;
  vertical-align: middle;
  animation: dbkPulseDot 1.1s ease-in-out infinite;
}

.assistant-message.thinking {
  width: fit-content;
}

.assistant-message.thinking p {
  color: var(--text);
}

.assistant-composer input,
.knowledge-editor input,
.knowledge-editor select,
.knowledge-editor textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.26);
  color: var(--text);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.assistant-composer input:focus,
.knowledge-editor input:focus,
.knowledge-editor select:focus,
.knowledge-editor textarea:focus {
  border-color: rgba(224, 197, 126, 0.4);
  background: rgba(0, 0, 0, 0.36);
  outline: none;
  box-shadow: 0 0 0 3px rgba(224, 197, 126, 0.10);
}

.assistant-composer input {
  min-height: 40px;
  padding: 0 12px;
}

.assistant-composer.hero-composer input,
.assistant-composer.hero-composer input:focus {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
}

.assistant-composer.hero-composer input {
  min-height: 48px;
  padding: 0 4px;
}

.assistant-prompts {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px;
}

.assistant-prompts h2,
.knowledge-editor h2,
.settings-card h2 {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-2);
}

.prompt-chip {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-2);
  text-align: left;
  font-size: 13px;
  font-weight: 700;
}

.prompt-chip:hover {
  border-color: var(--line-strong);
  background: rgba(199, 166, 104, 0.09);
  color: var(--text);
}

.knowledge-layout {
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
}

.knowledge-list {
  display: grid;
  gap: 12px;
}

.knowledge-item {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.knowledge-item h2 {
  margin-top: 10px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.knowledge-item p {
  margin: 0;
  max-width: none;
  color: var(--text-2);
}

.knowledge-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--quiet);
  font-size: 11.5px;
  font-weight: 700;
}

.knowledge-editor {
  display: grid;
  gap: 12px;
  padding: 16px;
  position: sticky;
  top: 16px;
}

.knowledge-editor label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.knowledge-editor input,
.knowledge-editor select {
  height: 38px;
  padding: 0 10px;
}

.knowledge-editor textarea {
  min-height: 160px;
  padding: 10px;
  resize: vertical;
}

.editor-note {
  margin: 0;
  color: var(--quiet);
  font-size: 12px;
  line-height: 1.45;
}

.danger-zone {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  padding: 14px;
  border: 1px solid rgba(216, 111, 95, 0.32);
  border-radius: 10px;
  background: rgba(216, 111, 95, 0.08);
}

.danger-zone h3 {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffd6cf;
}

.danger-zone p {
  margin: 0;
  color: #dbb0aa;
  font-size: 12px;
  line-height: 1.45;
}

.settings-grid {
  grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr);
  margin-top: 18px;
}

.settings-card {
  padding: 16px;
}

.settings-card p {
  margin: 8px 0 14px;
}

.access-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.access-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.access-form input,
.access-form select {
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.26);
}

.access-form .inline-check {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  min-height: 34px;
  letter-spacing: 0;
  text-transform: none;
}

.access-form .inline-check input {
  width: 16px;
  height: 16px;
  padding: 0;
}

.access-result-card pre {
  min-height: 150px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line-subtle);
  color: var(--text-2);
  font-size: 13px;
}

.settings-row:first-of-type {
  margin-top: 10px;
}

.settings-row strong {
  color: var(--gold-2);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1380px) {
  :root {
    --aside-w: 296px;
    --rail-w: 220px;
  }

  .kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .dashboard-split {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-aside {
    position: static;
    justify-self: center;
    width: 100%;
    max-width: 360px;
  }

  .grid-2,
  .grid-2.even {
    grid-template-columns: 1fr;
  }

  .brief-grid {
    grid-template-columns: 1fr;
  }

  .brief-photo {
    min-height: 160px;
  }

  .briefs-workspace {
    grid-template-columns: 1fr;
  }

  .brief-drawer {
    position: static;
  }
}

@media (max-width: 960px) {
  .shell {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .rail {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: hidden;
    min-width: 0;
  }

  .workspace {
    min-width: 0;
    overflow-x: clip;
  }

  .rail-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .rail-link {
    min-width: 0;
    font-size: 13px;
  }

  .rail-foot {
    display: none;
  }

  .topbar-hamburger {
    display: inline-flex;
  }

  .topbar-user .user-meta {
    display: none;
  }

  .campaign-summary {
    flex-direction: column;
  }

  .campaign-progress {
    width: 100%;
    text-align: left;
  }

  .campaign-kpis {
    grid-template-columns: repeat(2, 1fr);
  }

  .campaign-kpi {
    border-bottom: 1px solid var(--line-subtle);
  }

  .campaign-kpi:nth-child(2n) {
    border-right: 0;
  }
}

@media (max-width: 560px) {
  .workspace {
    padding: 12px 14px 28px;
    min-width: 0;
  }

  .rail-nav {
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .topbar-search {
    display: none;
  }

  .page-head {
    flex-direction: column;
    align-items: stretch;
  }

  .page-head-actions {
    justify-content: flex-end;
  }

  .kpi-row {
    grid-template-columns: 1fr;
  }

  .campaign-kpis {
    grid-template-columns: 1fr;
  }

  .campaign-kpi {
    border-right: 0;
  }

  .lead-row {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    grid-template-areas:
      "avatar meta time"
      "avatar pill pill";
    row-gap: 6px;
  }

  .lead-row .lead-avatar { grid-area: avatar; }
  .lead-row .lead-meta { grid-area: meta; }
  .lead-row .pill { grid-area: pill; justify-self: end; }
  .lead-row .lead-time { grid-area: time; }

  .handover-row {
    grid-template-columns: 14px minmax(0, 1fr);
    grid-template-areas:
      "flag meta"
      ". time"
      ". cta";
    row-gap: 6px;
  }

  .handover-row .handover-flag { grid-area: flag; }
  .handover-row .handover-meta { grid-area: meta; }
  .handover-row .handover-time { grid-area: time; }
  .handover-row .btn-takeover { grid-area: cta; justify-self: start; }

  .brief-list > div {
    grid-template-columns: 1fr;
  }

  .endpoint {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .assistant-grid,
  .prompt-grid,
  .brief-board,
  .knowledge-layout,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .assistant-panel {
    grid-template-rows: minmax(320px, 52vh) auto;
  }

  .assistant-message {
    max-width: 100%;
  }

  .knowledge-editor {
    position: static;
  }

  .assistant-home {
    min-height: auto;
    padding: 26px 0 18px;
  }

  .hero-composer {
    grid-template-columns: 1fr;
  }

  .hero-composer .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================================
   FINAL POLISH OVERRIDES (cascade-last; intentionally late)
   ============================================================ */

.assistant-home {
  position: relative;
}

.assistant-home::after {
  content: "";
  position: absolute;
  inset: -180px -120px auto auto;
  width: 580px;
  height: 420px;
  background: radial-gradient(closest-side, rgba(224, 197, 126, 0.16), transparent 72%);
  pointer-events: none;
  z-index: 0;
}

.assistant-home > * { position: relative; z-index: 1; }

.assistant-logo span {
  filter: drop-shadow(0 8px 22px rgba(224, 197, 126, 0.18));
}

.hero-composer {
  position: relative;
  border: 1px solid rgba(224, 197, 126, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.012)),
    rgba(15, 14, 12, 0.74);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow:
    0 28px 64px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.hero-composer:focus-within {
  border-color: rgba(224, 197, 126, 0.42);
  box-shadow:
    0 32px 72px rgba(0, 0, 0, 0.52),
    0 0 0 4px rgba(224, 197, 126, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.hero-composer input::placeholder {
  color: var(--quiet);
  font-weight: 500;
}

.prompt-card {
  position: relative;
  overflow: hidden;
  transition: border-color 200ms ease, transform 200ms cubic-bezier(0.32, 0.72, 0.24, 1), background 200ms ease, box-shadow 200ms ease;
}

.prompt-card::after {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 60%;
  height: 100%;
  background: radial-gradient(120% 80% at 100% 0%, rgba(224, 197, 126, 0.10), transparent 65%);
  opacity: 0;
  transition: opacity 240ms ease;
  pointer-events: none;
}

.prompt-card:hover {
  transform: translateY(-2px);
  border-color: rgba(224, 197, 126, 0.32);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.36);
}

.prompt-card:hover::after { opacity: 1; }

.assistant-panel.prompt-first {
  border-color: var(--line-subtle);
  background: rgba(15, 14, 12, 0.4);
  border-radius: 12px;
}

.assistant-home:not(.chat-active) .assistant-panel.prompt-first {
  display: none;
}

.assistant-home .assistant-hero {
  order: 1;
}

.assistant-home .prompt-grid {
  order: 2;
}

.assistant-home .hero-composer {
  order: 3;
}

.assistant-home .assistant-panel {
  order: 4;
}

.assistant-home.chat-active {
  width: min(1040px, 100%);
  max-width: none;
  min-height: calc(100vh - 112px);
  align-content: stretch;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 16px;
  margin-top: 0;
  padding-top: 12px;
}

.assistant-home.chat-active .assistant-hero,
.assistant-home.chat-active .prompt-grid {
  display: none;
}

.assistant-home.chat-active .assistant-panel.prompt-first {
  order: 1;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: min(650px, calc(100vh - 220px));
  border-color: rgba(224, 197, 126, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 42%),
    rgba(7, 7, 6, 0.48);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 22px 54px rgba(0, 0, 0, 0.28);
}

.assistant-home.chat-active .assistant-log {
  min-height: 0;
  padding: clamp(18px, 3vw, 34px);
}

.assistant-home.chat-active .hero-composer {
  order: 2;
  width: min(980px, 100%);
  margin: 0 auto;
  position: sticky;
  bottom: 18px;
  z-index: 4;
}

/* Refined knowledge cards (override originals) */
.knowledge-item {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 18px 18px 16px 22px;
  border-radius: 12px;
  transition: border-color 200ms ease, transform 200ms ease, box-shadow 200ms ease, background 200ms ease;
}

.knowledge-item::before {
  content: "";
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: 0;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(180deg, var(--gold-2), var(--gold-dark));
  opacity: 0.5;
  transition: opacity 200ms ease;
}

.knowledge-item:hover {
  border-color: rgba(224, 197, 126, 0.22);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.32);
  background:
    linear-gradient(180deg, rgba(224, 197, 126, 0.04), transparent 50%),
    rgba(255, 255, 255, 0.02);
}

.knowledge-item:hover::before { opacity: 0.95; }

.knowledge-item > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0;
}

.knowledge-item .badge {
  height: 22px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(224, 197, 126, 0.10);
  color: var(--gold-2);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.knowledge-item h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.knowledge-item p {
  font-size: 13.5px;
  line-height: 1.6;
}

.knowledge-meta {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dashed var(--line-subtle);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.knowledge-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.knowledge-meta span::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold-2);
  opacity: 0.55;
}

/* Refined danger zone (premium amber, not red/cartoonish) */
.danger-zone {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(232, 169, 47, 0.22);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(232, 169, 47, 0.06), transparent 70%),
    rgba(0, 0, 0, 0.22);
}

.danger-zone h3 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #f6c56b;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.danger-zone h3::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f6c56b;
  box-shadow: 0 0 0 4px rgba(232, 169, 47, 0.16);
}

.danger-zone p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  font-weight: 500;
}

.danger-zone select,
.danger-zone input {
  height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(232, 169, 47, 0.18);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.30);
  color: var(--text);
  font-size: 12.5px;
}

.danger-zone input::placeholder {
  color: rgba(232, 169, 47, 0.5);
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 11.5px;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(232, 169, 47, 0.32);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(232, 169, 47, 0.18), rgba(232, 169, 47, 0.04));
  color: #f6c56b;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.btn-danger:hover {
  background:
    linear-gradient(180deg, rgba(232, 169, 47, 0.28), rgba(232, 169, 47, 0.08));
  border-color: rgba(232, 169, 47, 0.5);
  color: #ffd17a;
  transform: translateY(-1px);
}

/* Brief kanban polish */
.brief-lane {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.022), transparent 35%),
    rgba(15, 14, 12, 0.4);
  transition: border-color 200ms ease;
}

.brief-lane[data-tone="now"]::before,
.brief-lane[data-tone="next"]::before,
.brief-lane[data-tone="later"]::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  border-radius: 10px 10px 0 0;
}

.brief-lane[data-tone="now"]::before { background: linear-gradient(90deg, var(--gold-2), transparent); }
.brief-lane[data-tone="next"]::before { background: linear-gradient(90deg, rgba(224, 197, 126, 0.45), transparent); }
.brief-lane[data-tone="later"]::before { background: linear-gradient(90deg, rgba(255, 255, 255, 0.18), transparent); }

.brief-kanban-card {
  position: relative;
  transition: border-color 200ms ease, transform 200ms ease, background 200ms ease, box-shadow 200ms ease;
}

.brief-kanban-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.34);
}

.brief-kanban-card.active {
  border-color: rgba(224, 197, 126, 0.42);
  background:
    linear-gradient(180deg, rgba(224, 197, 126, 0.10), rgba(224, 197, 126, 0.02)),
    rgba(20, 19, 16, 0.6);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(224, 197, 126, 0.18);
}

.brief-kanban-card .when {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(224, 197, 126, 0.12);
  color: var(--gold-2);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brief-kanban-card .when::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold-2);
  box-shadow: 0 0 0 3px rgba(224, 197, 126, 0.16);
}

.brief-kanban-card .head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.brief-kanban-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.brief-kanban-card .tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Brief drawer polish */
.brief-drawer {
  border-radius: 12px;
}

.brief-drawer.has-card {
  border-color: rgba(224, 197, 126, 0.20);
  background:
    linear-gradient(180deg, rgba(224, 197, 126, 0.08), transparent 50%),
    rgba(15, 14, 12, 0.7);
}

.drawer-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-subtle);
}

.drawer-actions .btn { flex: 1 1 auto; justify-content: center; }

.btn.is-complete {
  border-color: rgba(103, 217, 130, 0.26);
  background:
    linear-gradient(180deg, rgba(103, 217, 130, 0.14), rgba(103, 217, 130, 0.04));
  color: #9bf2ad;
}

.consult-outcome-panel {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-subtle);
}

.consult-outcome-panel h3 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.consult-outcomes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.outcome-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line-subtle);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 800;
}

.outcome-check input {
  accent-color: var(--gold-2);
}

.outcome-check.active {
  border-color: rgba(103, 217, 130, 0.32);
  background: rgba(103, 217, 130, 0.08);
  color: #a8f4b7;
}

.outcome-status {
  margin: 12px 0 0;
  color: #9bf2ad;
  font-size: 12px;
  font-weight: 800;
}

body.modal-open {
  overflow: hidden;
}

.no-show-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3, 4, 4, 0.72);
  backdrop-filter: blur(14px);
}

.no-show-dialog {
  position: relative;
  width: min(520px, 100%);
  padding: 22px;
  border: 1px solid rgba(224, 197, 126, 0.24);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(224, 197, 126, 0.08), transparent 58%),
    rgba(15, 14, 12, 0.96);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-subtle);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.no-show-dialog h2 {
  margin: 8px 38px 10px 0;
  color: var(--text);
  font-size: 24px;
}

.no-show-dialog p {
  margin: 0;
  color: var(--text-2);
  line-height: 1.55;
}

.modal-action-copy {
  display: grid;
  gap: 5px;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid rgba(224, 197, 126, 0.18);
  border-radius: 12px;
  background: rgba(224, 197, 126, 0.055);
}

.modal-action-copy strong {
  color: var(--gold-2);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.modal-action-copy span {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.45;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.agentic-followup strong {
  font-size: 13px;
}

.agentic-followup p {
  margin: 0;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.5;
}

.agentic-followup code {
  color: var(--gold-2);
  font-size: 11px;
}

.portal-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 32px));
  padding: 13px 16px;
  border: 1px solid rgba(224, 197, 126, 0.22);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)),
    rgba(12, 11, 9, 0.92);
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.48);
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.portal-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Empty-state polish (used by knowledge / brief / lists) */
.empty-state {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 36px 20px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.012);
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--text-2);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.empty-state p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
}

/* Skeleton shimmer block */
.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.08) 50%, transparent 70%);
  background-size: 220% 100%;
  animation: dbkShimmer 1.4s linear infinite;
}

/* Mock-data tag — small, restrained */
.aside-tag.mock {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.aside-tag.mock::before {
  background: var(--quiet);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============================================================
   Sprint 13 (2026-05-12): AI Setter inbox + newsletter editor.
   Visibility-only inbox and dry-run newsletter surface.
   ============================================================ */

.inbox-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: var(--gap-l);
  margin-top: 18px;
}

@media (max-width: 1100px) {
  .inbox-layout { grid-template-columns: 1fr; }
}

.inbox-list {
  background: var(--elev-1);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-l);
  overflow: hidden;
}

.inbox-list-head,
.inbox-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.4fr) 110px minmax(160px, 2fr) 90px 70px;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}

.inbox-list-head {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--line-subtle);
}

.inbox-row {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  border-bottom: 1px solid var(--line-subtle);
  transition: background 0.18s ease;
}

.inbox-row:hover { background: rgba(199, 166, 104, 0.04); }
.inbox-row.active { background: rgba(199, 166, 104, 0.08); }

.inbox-cell.contact strong {
  display: block;
  font-size: 13.5px;
  color: var(--text);
}
.inbox-cell.contact span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.inbox-cell.message {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.inbox-cell.time {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--muted);
}

.inbox-foot {
  padding: 10px 16px;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

.inbox-empty {
  padding: 26px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.inbox-drawer {
  background: var(--elev-1);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-l);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 720px;
  overflow-y: auto;
}

.inbox-drawer .drawer-kicker {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-2);
}

.inbox-drawer h2 {
  margin: 0;
  font-size: 17px;
  color: var(--text);
}

.inbox-drawer .drawer-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12.5px;
}
.inbox-drawer .drawer-contact a { color: var(--gold-2); text-decoration: none; }

.inbox-drawer dl.drawer-list {
  margin: 6px 0 4px;
  display: grid;
  gap: 8px;
  font-size: 12.5px;
}
.inbox-drawer dl.drawer-list dt {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}
.inbox-drawer dl.drawer-list dd {
  margin: 2px 0 0;
  color: var(--text-2);
  line-height: 1.5;
}

.inbox-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line-subtle);
}

.inbox-msg {
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 12.5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.inbox-msg.ai { border-left: 2px solid var(--gold-2); }
.inbox-msg.lead { border-left: 2px solid var(--green); }
.inbox-msg.staff { border-left: 2px solid var(--amber); }
.inbox-msg strong { font-size: 11px; color: var(--muted); letter-spacing: 0.05em; text-transform: uppercase; }
.inbox-msg p { margin: 0; color: var(--text); line-height: 1.45; }
.inbox-msg small { font-size: 10.5px; color: var(--muted); }

.inbox-drawer .drawer-foot {
  margin: 4px 0 0;
  font-size: 11.5px;
  color: var(--muted);
  font-style: italic;
}

/* ---------- Newsletter editor ---------- */
.newsletter-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: var(--gap-l);
  margin-top: 18px;
}

.mailchimp-connect {
  white-space: nowrap;
}

.mailchimp-connect.connected {
  pointer-events: none;
  border-color: rgba(103, 217, 130, 0.28);
  background: rgba(103, 217, 130, 0.10);
  color: #a8f4b7;
}
@media (max-width: 1100px) {
  .newsletter-layout { grid-template-columns: 1fr; }
  .business-snapshot-grid,
  .member-snapshot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.newsletter-editor {
  background: var(--elev-1);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-l);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.newsletter-editor label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.newsletter-editor input,
.newsletter-editor select,
.newsletter-editor textarea {
  background: #0c0b08;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 10px 12px;
  font: inherit;
  font-size: 13.5px;
  letter-spacing: normal;
  text-transform: none;
}
.newsletter-editor textarea {
  resize: vertical;
  min-height: 220px;
  line-height: 1.5;
}

.newsletter-editor .editor-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.newsletter-editor .editor-helper {
  font-size: 12px;
  color: var(--muted);
}

.newsletter-controls {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.newsletter-controls label.inline {
  flex: 1;
  min-width: 160px;
}

.newsletter-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid var(--line-subtle);
}
.newsletter-status {
  font-size: 12px;
  color: var(--muted);
  flex: 1;
  min-width: 220px;
}
.newsletter-confirm {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(212, 175, 55, 0.24);
  border-radius: 14px;
  background: rgba(212, 175, 55, 0.08);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.newsletter-confirm input {
  width: auto;
  margin-top: 2px;
  accent-color: var(--gold);
}

.newsletter-history {
  background: var(--elev-1);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-l);
  padding: 18px;
  max-height: 720px;
  overflow-y: auto;
}
.newsletter-history h2 {
  margin: 0 0 12px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-2);
}

.newsletter-draft {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-m);
  padding: 12px;
  margin-bottom: 12px;
}
.newsletter-draft header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.newsletter-draft header strong {
  font-size: 13.5px;
  color: var(--text);
}
.newsletter-draft p {
  margin: 0 0 8px;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.45;
}
.newsletter-draft footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11.5px;
  color: var(--muted);
  align-items: center;
}
.newsletter-empty {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0;
}

/* ---------- Team Comms ---------- */
.team-comms-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 360px;
  gap: var(--gap-l);
  margin-top: 18px;
  align-items: start;
}

.team-comms-list,
.team-comms-thread,
.team-comms-compose {
  background: var(--elev-1);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-l);
  padding: 16px;
}

.section-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.section-title-row h2,
.team-comms-compose h2,
.team-thread-head h2 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0;
}

.section-title-row span,
.team-thread-head p {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
}

.team-thread {
  width: 100%;
  display: grid;
  gap: 5px;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-m);
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
}

.team-thread:hover,
.team-thread.active {
  border-color: rgba(224, 197, 126, 0.34);
  background: rgba(224, 197, 126, 0.08);
}

.team-thread strong,
.team-thread span,
.team-thread small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.team-thread strong {
  color: var(--text);
  font-size: 13.5px;
}

.team-thread span {
  color: var(--text-2);
  font-size: 12px;
}

.team-thread small {
  color: var(--muted);
  font-size: 11px;
}

.team-thread-type {
  width: fit-content;
  border-radius: var(--radius-pill);
  padding: 3px 8px;
  background: rgba(224, 197, 126, 0.1);
  color: var(--gold-2) !important;
  font-size: 10px !important;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.team-thread-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-subtle);
}

.team-message-list {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  max-height: 430px;
  overflow-y: auto;
}

.team-message {
  max-width: min(620px, 92%);
  padding: 12px 13px;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-m);
  background: rgba(255, 255, 255, 0.035);
}

.team-message.staff {
  justify-self: end;
  background: rgba(224, 197, 126, 0.09);
  border-color: rgba(224, 197, 126, 0.2);
}

.team-message.member {
  justify-self: start;
}

.team-message strong {
  display: block;
  margin-bottom: 4px;
  color: var(--gold-2);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.team-message p {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.team-message small {
  color: var(--muted);
  font-size: 11px;
}

.team-reply-box,
.team-comms-actions {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.team-reply-box textarea,
.team-comms-compose textarea,
.team-comms-compose input,
.team-comms-compose select {
  width: 100%;
  background: #0c0b08;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 10px 12px;
  font-size: 13.5px;
  letter-spacing: normal;
  text-transform: none;
}

.team-reply-box textarea,
.team-comms-compose textarea {
  resize: vertical;
  min-height: 86px;
  line-height: 1.5;
}

.team-comms-compose {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.team-comms-compose label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.team-comms-actions {
  flex-wrap: wrap;
}

@media (max-width: 1280px) {
  .team-comms-layout {
    grid-template-columns: 300px minmax(0, 1fr);
  }

  .team-comms-compose {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .team-comms-layout {
    grid-template-columns: 1fr;
  }

  .team-reply-box {
    flex-direction: column;
  }

  .team-reply-box .btn {
    width: 100%;
  }
}

/* ============================================================
   Sprint 13 follow-up: dashboard AI brief, clickable quick
   actions, and GHL-style AI Setter inbox layout.
   ============================================================ */

.quick-actions {
  position: relative;
}

.quick-actions-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(320px, 80vw);
  padding: 8px;
  background: linear-gradient(145deg, rgba(28, 25, 18, 0.98), rgba(9, 10, 10, 0.98));
  border: 1px solid rgba(219, 189, 120, 0.24);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.46), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  z-index: 30;
}

.quick-actions-menu[hidden] { display: none; }

.quick-actions-menu button {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 3px;
}

.quick-actions-menu button:hover {
  background: rgba(219, 189, 120, 0.09);
}

.quick-actions-menu strong {
  font-size: 13px;
}

.quick-actions-menu span {
  font-size: 12px;
  color: var(--muted);
}

.ai-brief-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin: 18px 0 20px;
  padding: 18px;
  border: 1px solid rgba(219, 189, 120, 0.2);
  border-radius: var(--radius-l);
  background:
    radial-gradient(circle at 12% 15%, rgba(219, 189, 120, 0.16), transparent 34%),
    linear-gradient(145deg, rgba(26, 24, 18, 0.94), rgba(12, 13, 13, 0.88));
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.ai-brief-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(219, 189, 120, 0.24), transparent 42%);
  opacity: 0.16;
}

.ai-brief-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: var(--gold-2);
  background: rgba(219, 189, 120, 0.1);
  border: 1px solid rgba(219, 189, 120, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.ai-brief-icon .icon {
  width: 22px;
  height: 22px;
}

.ai-brief-copy {
  position: relative;
  z-index: 1;
}

.ai-brief-copy span {
  display: block;
  margin-bottom: 4px;
  color: var(--gold-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.ai-brief-copy h2 {
  margin: 0 0 6px;
  font-size: clamp(20px, 2.2vw, 30px);
  letter-spacing: 0;
}

.ai-brief-copy p {
  margin: 0;
  max-width: 920px;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.6;
}

.ai-brief-card .btn {
  position: relative;
  z-index: 1;
  white-space: nowrap;
}

.ai-action-strip {
  position: relative;
  z-index: 1;
  grid-column: 2 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 2px;
}

.ai-action-strip button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(219, 189, 120, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 800;
}

.ai-action-strip button:hover,
.ai-action-strip button.is-complete {
  border-color: rgba(103, 217, 130, 0.30);
  background: rgba(103, 217, 130, 0.08);
  color: #a8f4b7;
}

.ai-action-strip .icon {
  width: 14px;
  height: 14px;
}

.inbox-layout {
  grid-template-columns: 340px minmax(0, 1fr);
  min-height: min(720px, calc(100vh - 220px));
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--line-subtle);
  border-radius: 18px;
  overflow: hidden;
  gap: 0;
}

.inbox-list {
  border: 0;
  border-right: 1px solid var(--line-subtle);
  border-radius: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
}

.inbox-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--line-subtle);
}

.inbox-list-head div {
  display: grid;
  gap: 2px;
}

.inbox-list-head strong {
  color: var(--text);
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
}

.inbox-list-head span {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.inbox-row {
  grid-template-columns: 42px minmax(0, 1fr) auto;
  grid-template-areas:
    "avatar person meta"
    "avatar preview preview";
  padding: 14px;
  gap: 8px 10px;
}

.inbox-row .lead-avatar {
  grid-area: avatar;
  align-self: start;
}

.inbox-row.active {
  background: rgba(219, 189, 120, 0.11);
  box-shadow: inset 3px 0 0 var(--gold-2);
}

.inbox-person {
  grid-area: person;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.inbox-person strong {
  color: var(--text);
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inbox-person small {
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inbox-preview {
  grid-area: preview;
  color: var(--text-2);
  font-size: 12.3px;
  line-height: 1.42;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.inbox-row-meta {
  grid-area: meta;
  justify-self: end;
  display: grid;
  justify-items: end;
  gap: 5px;
}

.inbox-row-meta time {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.inbox-drawer {
  border: 0;
  border-radius: 0;
  padding: 0;
  max-height: none;
  background:
    radial-gradient(circle at 78% 0%, rgba(219, 189, 120, 0.07), transparent 36%),
    rgba(5, 6, 6, 0.38);
}

.inbox-thread-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  background: rgba(8, 9, 9, 0.86);
  border-bottom: 1px solid var(--line-subtle);
  backdrop-filter: blur(18px);
}

.inbox-thread-summary {
  margin: 16px 20px 6px;
  display: grid;
  grid-template-columns: 1.4fr 1.2fr 0.8fr;
  gap: 10px;
}

.inbox-thread-summary div {
  padding: 12px;
  border: 1px solid rgba(219, 189, 120, 0.14);
  border-radius: 12px;
  background: rgba(219, 189, 120, 0.055);
  display: grid;
  gap: 5px;
}

.inbox-thread-summary strong {
  color: var(--gold-2);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.inbox-thread-summary span {
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.45;
}

.inbox-thread {
  flex: 1;
  margin: 0;
  padding: 18px 20px 22px;
  border-top: 0;
  gap: 12px;
}

.inbox-msg {
  max-width: min(620px, 82%);
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.14);
}

.inbox-msg.ai {
  align-self: flex-end;
  border-left: 0;
  background: linear-gradient(145deg, rgba(219, 189, 120, 0.22), rgba(58, 47, 25, 0.36));
}

.inbox-msg.lead {
  align-self: flex-start;
  border-left: 0;
  background: rgba(255, 255, 255, 0.06);
}

.inbox-msg.staff {
  align-self: flex-end;
  border-left: 0;
}

.inbox-compose {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px 20px 18px;
  background: rgba(7, 8, 8, 0.9);
  border-top: 1px solid var(--line-subtle);
  backdrop-filter: blur(18px);
}

.inbox-compose input,
.inbox-compose button {
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line-subtle);
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  padding: 0 16px;
}

.inbox-compose button {
  color: var(--ink);
  background: var(--gold-grad);
  opacity: 0.45;
}

.inbox-drawer .drawer-foot {
  padding: 0 20px 16px;
}

@media (max-width: 980px) {
  .ai-brief-card {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .ai-brief-card .btn {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .ai-action-strip {
    grid-column: 1 / -1;
  }

  .inbox-layout {
    grid-template-columns: 1fr;
  }

  .inbox-list {
    border-right: 0;
    border-bottom: 1px solid var(--line-subtle);
    max-height: 360px;
    overflow-y: auto;
  }

  .inbox-thread-summary {
    grid-template-columns: 1fr;
  }

  .business-snapshot-grid,
  .member-snapshot-grid,
  .consult-outcomes {
    grid-template-columns: 1fr;
  }

  .member-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}
