/* Primus IQ — design tokens
   Warm, minimal palette anchored on Primus Partners maroon. */
:root {
  /* Brand */
  --maroon:        #7A1C1C;     /* primary */
  --maroon-deep:   #5B1414;
  --maroon-ink:    #3E0E0E;     /* readable on cream */
  --maroon-soft:   #F7E9E9;
  --maroon-wash:   #FBF3F3;
  --maroon-06:     rgba(122, 28, 28, 0.06);
  --maroon-10:     rgba(122, 28, 28, 0.10);
  --maroon-20:     rgba(122, 28, 28, 0.20);

  --gold:          #B68A3B;
  --gold-soft:     #F4EBD6;

  /* Neutrals — warm, parchment-leaning */
  --ink:           #1A1614;
  --ink-2:         #2B2624;
  --mute:          #807870;
  --mute-2:        #A8A19B;
  --line:          #ECE5DD;
  --line-2:        #E0D8CE;
  --bg:            #FBF8F3;     /* page */
  --bg-soft:       #F6F1E9;
  --bg-card:       #FFFFFF;
  --bg-sidebar:    #F2EBDF;     /* warm cream sidebar */
  --bg-sidebar-2:  #F8F3E9;

  /* Semantic — confidentiality */
  --pub-fg:        #2E6F40;     --pub-bg: #E7F1EA;     --pub-bd: #C8DDD0;
  --int-fg:        #876200;     --int-bg: #FBF1D7;     --int-bd: #ECD9A1;
  --cli-fg:        #6B4310;     --cli-bg: #F4E8D2;     --cli-bd: #E6D2A8;
  --str-fg:        #7A1C1C;     --str-bg: #F7E1E1;     --str-bd: #E9C5C5;

  /* Shadow */
  --shadow-xs:     0 1px 2px rgba(60, 30, 20, 0.04);
  --shadow-sm:     0 2px 8px rgba(60, 30, 20, 0.06);
  --shadow-md:     0 8px 24px rgba(60, 30, 20, 0.08);
  --shadow-lg:     0 20px 50px rgba(60, 30, 20, 0.14);

  /* Radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.serif {
  font-family: 'Fraunces', Georgia, serif;
  font-feature-settings: "ss01", "ss03";
}

/* Utility */
.row { display: flex; align-items: center; gap: 12px; }
.col { display: flex; flex-direction: column; }

/* Animations */
@keyframes rise   { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes drift  { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-2%, 2%); } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* Confidentiality pill */
.conf {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px 3px 6px; border-radius: 4px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.02em;
  border: 1px solid transparent;
  text-transform: capitalize;
}
.conf::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.conf.public   { color: var(--pub-fg); background: var(--pub-bg); border-color: var(--pub-bd); }
.conf.internal { color: var(--int-fg); background: var(--int-bg); border-color: var(--int-bd); }
.conf.client   { color: var(--cli-fg); background: var(--cli-bg); border-color: var(--cli-bd); }
.conf.strict   { color: var(--str-fg); background: var(--str-bg); border-color: var(--str-bd); }

/* Buttons */
.btn-primary {
  height: 38px; padding: 0 16px; border-radius: 10px;
  background: var(--maroon); color: white;
  border: none; font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap;
  transition: all 0.15s;
  letter-spacing: -0.005em;
}
.btn-primary:hover { background: var(--maroon-deep); box-shadow: 0 4px 14px rgba(122,28,28,0.25); }

.btn-secondary {
  height: 38px; padding: 0 14px; border-radius: 10px;
  background: white; color: var(--ink);
  border: 1px solid var(--line-2); font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap;
  transition: all 0.15s;
}
.btn-secondary:hover { background: var(--bg-soft); border-color: var(--maroon-20); }

.btn-ghost {
  height: 34px; padding: 0 10px; border-radius: 8px;
  background: transparent; color: var(--ink-2);
  border: none; font-family: inherit; font-size: 12px; font-weight: 500;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.15s;
}
.btn-ghost:hover { background: var(--maroon-06); color: var(--maroon); }

/* Search input */
.search-input {
  height: 40px; padding: 0 14px; border-radius: 10px;
  background: white; border: 1px solid var(--line-2);
  font-family: inherit; font-size: 13px; color: var(--ink);
  display: flex; align-items: center; gap: 10px;
  outline: none; transition: all 0.15s;
}
.search-input:focus-within { border-color: var(--maroon-20); box-shadow: 0 0 0 4px var(--maroon-06); }
.search-input input {
  flex: 1; border: none; outline: none; background: transparent;
  font-family: inherit; font-size: 13px; color: var(--ink);
}
.search-input input::placeholder { color: var(--mute-2); }

/* Tag pill */
.tag-pill {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 999px;
  background: var(--maroon-06); color: var(--maroon);
  font-size: 11px; font-weight: 500; line-height: 16px;
  white-space: nowrap;
}

.role-badge {
  padding: 3px 8px; border-radius: 4px;
  background: var(--bg-soft); color: var(--ink-2);
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  border: 1px solid var(--line);
}
.role-badge.owner { background: var(--maroon-06); color: var(--maroon); border-color: var(--maroon-10); }

/* Avatar */
.avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--maroon); color: white;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 600;
  border: 2px solid var(--bg-card);
  flex-shrink: 0;
}
.avatar.dark   { background: #2B2624; }
.avatar.gold   { background: var(--gold); color: white; }
.avatar.cream  { background: var(--gold-soft); color: var(--maroon); }
.avatar.muted  { background: #C7BFB6; color: var(--ink-2); }

/* Brand wordmark gradient (subtle warm sweep — original) */
.wordmark {
  background: linear-gradient(92deg, #7A1C1C 0%, #B68A3B 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.01em;
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(122,28,28,0.12); border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(122,28,28,0.22); background-clip: padding-box; }

/* Thin, subtle scrollbar — used in the sidebar chat list */
.pi-thin-scroll { scrollbar-width: thin; scrollbar-color: rgba(122,28,28,0.14) transparent; }
.pi-thin-scroll::-webkit-scrollbar { width: 6px; }
.pi-thin-scroll::-webkit-scrollbar-track { background: transparent; }
.pi-thin-scroll::-webkit-scrollbar-thumb { background: rgba(122,28,28,0.12); border-radius: 3px; border: none; }
.pi-thin-scroll::-webkit-scrollbar-thumb:hover { background: rgba(122,28,28,0.2); }

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

/* Typography scale — use these classes instead of inline font-size/font-family/font-weight */
.t-display   { font-family: 'Fraunces', Georgia, serif; font-size: 34px; font-weight: 400; letter-spacing: -0.025em; line-height: 1.05; }
.t-h1        { font-family: 'Fraunces', Georgia, serif; font-size: 24px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; }
.t-h2        { font-family: 'Fraunces', Georgia, serif; font-size: 16px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.3; }
.t-body      { font-size: 13px; font-weight: 400; }
.t-body-sm   { font-size: 12px; font-weight: 400; }
.t-meta      { font-size: 11px; font-weight: 400; color: var(--mute); }
.t-eyebrow   { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); }
.t-nav       { font-size: 12px; font-weight: 500; }
.t-nav.is-active { font-weight: 600; color: var(--maroon); }
