/*!*************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[13].oneOf[12].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[13].oneOf[12].use[3]!./app/globals.css ***!
  \*************************************************************************************************************************************************************************************************************************************************************/
/* ============================================================
   Gradvisor — styles
   ============================================================ */
:root {
  --bg: #f6f4f0;
  --panel: #ffffff;
  --ink: #1c1b19;
  --ink-soft: #57534e;
  --ink-faint: #6f6a64; /* ≥4.5:1 on --bg and --panel (WCAG AA at micro sizes) */
  --line: #e6e2db;
  --line-soft: #efece6;
  --rail: #211f1d;
  --rail-ink: #cfc9c0;
  --accent: oklch(0.52 0.07 200);
  --accent-deep: oklch(0.44 0.07 200);
  --accent-soft: oklch(0.96 0.018 200);
  --accent-line: oklch(0.88 0.03 200);
  --good: oklch(0.58 0.09 150);
  --good-soft: oklch(0.95 0.03 150);
  --warn: oklch(0.68 0.1 70);
  --warn-deep: oklch(0.5 0.1 70); /* AA on --warn-soft/panel at micro sizes */
  --warn-soft: oklch(0.96 0.04 70);
  --bad: oklch(0.5 0.12 30);
  --bad-soft: oklch(0.96 0.02 30);
  --sans: "Instrument Sans", system-ui, sans-serif;
  --serif: "Newsreader", Georgia, serif;
  --radius: 14px;
  --split: 50%;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body, #root { height: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
::selection { background: var(--accent-soft); }

/* height: dvh tracks the VISIBLE viewport on mobile (the address bar shrinks it),
   so the bottom-pinned composer stays on-screen instead of falling below 100vh.
   width: 100% (not 100vw) avoids horizontal overflow past the visual edge. */
.app { display: flex; height: 100vh; height: 100dvh; width: 100%; overflow: hidden; position: relative; }

/* ---------- LEFT RAIL ---------- */
.rail {
  width: 178px;
  flex-shrink: 0;
  position: relative; /* anchors the overlay-able .rail-inner */
}
.rail-inner {
  position: absolute; left: 0; top: 0; bottom: 0; width: 178px;
  background: var(--rail);
  color: var(--rail-ink);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  gap: 22px;
  z-index: 5;
  transition: width 0.34s var(--ease), box-shadow 0.34s var(--ease);
}
/* YOUR LISTS expanded → inner panel overlays the chat (width is driven by inline style so it tweens; here we just lift it) */
.app.lists-expanded .rail-inner {
  z-index: 60; box-shadow: 14px 0 56px -22px rgba(0, 0, 0, 0.6);
}
/* click-outside backdrop for the expanded lists overlay — sits above the chat,
   below the panel (z 60), so a click anywhere outside the panel collapses it. */
.lists-scrim {
  position: absolute; inset: 0; z-index: 55;
  background: rgba(28, 27, 25, 0.18);
  animation: ovIn 0.22s ease both;
}
.brand { display: flex; justify-content: flex-start; padding: 2px 4px 2px 0; }
.brand .brand-logo { display: flex; justify-content: flex-start; }
.brand .brand-logo svg { width: 40px; height: auto; display: block; }
.brand .mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent); display: grid; place-items: center;
  font-family: var(--serif); font-weight: 600; font-size: 17px; color: #fff;
}
.brand .name { font-family: "Cormorant Garamond", var(--serif); font-weight: 600; font-size: 19px; letter-spacing: 0; }

.new-chat {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff; padding: 9px 12px; border-radius: 10px;
  font-size: 13px; font-weight: 500; width: 100%;
  transition: background 0.15s ease;
}
.new-chat:hover { background: rgba(255, 255, 255, 0.14); }
.new-chat .plus { font-size: 17px; line-height: 1; opacity: 0.85; }

.rail-scroll { flex: 1 1; overflow-y: auto; display: flex; flex-direction: column; gap: 22px; min-height: 0; }
.rail-scroll::-webkit-scrollbar { width: 0; }
.rail-section { display: flex; flex-direction: column; gap: 3px; }
.rail-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.13em;
  color: rgba(207, 201, 192, 0.5); padding: 0 6px 5px;
  display: flex; align-items: center; justify-content: space-between;
}
.rail-label .pill {
  background: var(--accent); color: #fff; border-radius: 20px;
  font-size: 10px; padding: 1px 7px; letter-spacing: 0.02em;
}
.rail-item {
  font-size: 12.5px; color: var(--rail-ink);
  padding: 7px 8px; border-radius: 8px; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0.78; transition: background 0.13s ease, opacity 0.13s ease;
}
.rail-item:hover { background: rgba(255, 255, 255, 0.05); opacity: 1; }
.rail-item.active { background: rgba(255, 255, 255, 0.08); opacity: 1; color: #fff; }

/* ---------- YOUR LISTS tree ---------- */
.tree { display: flex; flex-direction: column; gap: 1px; }
.tree-row { display: flex; align-items: center; border-radius: 8px; transition: background 0.12s ease; }
.tree-row:hover { background: rgba(255, 255, 255, 0.05); }
.tree-caret { font-size: 9px; width: 13px; flex-shrink: 0; text-align: center; opacity: 0.6; transition: transform 0.16s var(--ease); display: inline-block; }
.tree-caret.open { transform: rotate(90deg); }
.tree-caret.ghost { opacity: 0; }

.tree-head {
  display: flex; align-items: center; gap: 6px; width: 100%; text-align: left;
  padding: 5px 6px; border-radius: 8px; white-space: nowrap;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.11em;
  color: rgba(207, 201, 192, 0.6); transition: background 0.12s ease, color 0.12s ease;
}
.tree-head:hover { background: rgba(255, 255, 255, 0.05); color: rgba(207, 201, 192, 0.9); }
.tree-head .tree-caret { opacity: 0.7; }
.tree-head .th-count { margin-left: auto; background: var(--accent); color: #fff; border-radius: 20px; font-size: 9.5px; letter-spacing: 0.02em; padding: 1px 7px; }

/* category row */
.tree-cat { padding-right: 4px; }
.tc-open { display: flex; align-items: center; gap: 6px; flex: 1 1; min-width: 0; text-align: left; padding: 6px 4px 6px 6px; color: #fff; }
.tc-label { font-size: 12.5px; font-weight: 600; white-space: normal; line-height: 1.25; }
.tree-count { font-size: 10px; color: rgba(207, 201, 192, 0.55); background: rgba(255, 255, 255, 0.07); border-radius: 20px; padding: 0 6px; line-height: 15px; flex-shrink: 0; }
.tree-children { margin-left: 8px; padding-left: 6px; border-left: 1px solid rgba(255, 255, 255, 0.08); display: flex; flex-direction: column; gap: 1px; }
.tree-grandchildren { margin-left: 8px; padding-left: 6px; border-left: 1px solid rgba(255, 255, 255, 0.07); display: flex; flex-direction: column; gap: 1px; }

/* sublist row */
.tree-sub { padding-right: 4px; }
.ts-open { display: flex; align-items: center; gap: 6px; flex: 1 1; min-width: 0; text-align: left; padding: 6px 4px 6px 6px; color: var(--rail-ink); }
.ts-name { font-size: 12px; font-weight: 500; white-space: normal; line-height: 1.25; }

/* action buttons (reveal on hover) */
.tree-act {
  width: 20px; height: 20px; border-radius: 6px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 12px; color: rgba(207, 201, 192, 0.5);
  opacity: 0; transition: opacity 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.tree-row:hover .tree-act { opacity: 1; }
.tree-act:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

/* leaf (item) row */
.tree-leaf-wrap { display: flex; flex-direction: column; }
.tree-leaf { padding-right: 4px; }
.tl-open { display: flex; align-items: center; gap: 8px; flex: 1 1; min-width: 0; text-align: left; padding: 6px 4px 6px 6px; }
.tl-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); flex-shrink: 0; opacity: 0.85; }
.tl-text { min-width: 0; display: flex; flex-direction: column; }
.tl-title { font-size: 12px; color: var(--rail-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-sub { font-size: 10px; color: rgba(207, 201, 192, 0.45); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tree-empty { font-size: 11px; color: rgba(207, 201, 192, 0.4); padding: 6px 8px; font-style: italic; }

/* rename / add input */
.tree-rename {
  flex: 1 1; min-width: 0; background: rgba(255, 255, 255, 0.1); border: 1px solid var(--accent);
  border-radius: 6px; color: #fff; font-family: inherit; font-size: 12px; padding: 4px 7px; outline: none;
}
.tree-rename::placeholder { color: rgba(207, 201, 192, 0.5); }
.tree-add { padding: 2px 4px 2px 6px; gap: 6px; }

/* move menu */
.tree-menu {
  margin: 2px 0 4px 18px; padding: 5px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex; flex-direction: column; gap: 1px; animation: ddIn 0.13s var(--ease) both;
}
.tm-label { font-size: 9px; text-transform: uppercase; letter-spacing: 0.12em; color: rgba(207, 201, 192, 0.5); padding: 4px 8px 3px; }
.tm-opt {
  display: flex; align-items: center; width: 100%; text-align: left;
  padding: 6px 9px; border-radius: 6px; font-size: 12px; color: var(--rail-ink); transition: background 0.1s ease;
}
.tm-opt:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.tm-opt.on { color: #fff; }
.tm-opt.on::after { content: "✓"; margin-left: auto; color: var(--accent); font-size: 11px; }
.tm-opt.new { color: rgba(207, 201, 192, 0.75); }
.tm-opt.danger { color: oklch(0.68 0.12 25); }
.tm-sep { height: 1px; background: rgba(255, 255, 255, 0.08); margin: 3px 6px; }

.rail-user-wrap {
  position: relative; flex-shrink: 0;
  padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.rail-user {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 7px 6px; border-radius: 10px; transition: background 0.14s ease;
}
.rail-user:hover, .rail-user.open { background: rgba(255, 255, 255, 0.06); }
.rail-user .ru-text { flex: 1 1; min-width: 0; }
.rail-user .ru-caret { margin-left: auto; color: rgba(207, 201, 192, 0.5); font-size: 12px; flex-shrink: 0; transition: transform 0.16s ease; }
.rail-user.open .ru-caret { transform: rotate(180deg); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #6b7d82, #3a4548);
  display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 600; flex-shrink: 0;
}
.avatar.lg { width: 38px; height: 38px; font-size: 14px; }
.rail-user .u-name { font-size: 12.5px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-user .u-sub { font-size: 10.5px; color: rgba(207, 201, 192, 0.6); }

/* account menu */
.user-menu {
  position: absolute; bottom: calc(100% + 8px); left: 0; min-width: 244px; z-index: 60;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 6px;
  box-shadow: 0 22px 54px -20px rgba(28, 27, 25, 0.55);
  animation: ddIn 0.16s var(--ease) both;
}
.um-head { display: flex; align-items: center; gap: 11px; padding: 9px 9px 11px; }
.um-name { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.um-mail { font-size: 11.5px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.um-sep { height: 1px; background: var(--line-soft); margin: 5px 7px; }
.um-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 9px 11px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--ink);
  transition: background 0.1s ease;
}
.um-item:hover { background: var(--bg); }
.um-hint { margin-left: auto; font-size: 11px; font-weight: 500; color: var(--ink-faint); }
.um-badge { margin-left: auto; background: var(--accent); color: #fff; border-radius: 20px; font-size: 10.5px; padding: 0 7px; line-height: 16px; }
.um-item.danger { color: oklch(0.55 0.14 25); }
.um-item.danger:hover { background: oklch(0.96 0.03 25); }

/* ---------- MAIN ---------- */
.main { flex: 1 1; display: flex; min-width: 0; position: relative; }
.conversation-col { flex: 1 1; display: flex; flex-direction: column; min-width: 0; }

.conv-head {
  padding: 15px 30px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line-soft); flex-shrink: 0; gap: 16px;
}
.conv-head h1 { font-family: var(--serif); font-weight: 500; font-size: 19px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; }
.conv-head .sub { font-size: 12px; color: var(--ink-faint); margin-top: 1px; }
.head-pill {
  font-size: 12px; color: var(--ink-soft); white-space: nowrap;
  border: 1px solid var(--line); border-radius: 20px; padding: 6px 12px; background: var(--panel);
}

.scroll { flex: 1 1; overflow-y: auto; padding: 26px 30px 8px; }
.thread { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }

.empty {
  max-width: 540px; margin: 6vh auto 0; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.empty .e-mark {
  width: 54px; height: 54px; border-radius: 15px; background: var(--ink); color: #fff;
  display: grid; place-items: center; font-family: var(--serif); font-size: 28px;
}
.empty .e-logo { margin-bottom: 2px; }
.empty .e-logo svg { width: 96px; height: auto; display: block; }
.empty h2 { font-family: var(--serif); font-weight: 500; font-size: 27px; letter-spacing: -0.015em; }
.empty p { font-size: 14.5px; color: var(--ink-soft); line-height: 1.55; max-width: 420px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; margin-top: 6px; }
.sugg {
  font-size: 13px; color: var(--ink-soft); background: var(--panel);
  border: 1px solid var(--line); border-radius: 22px; padding: 8px 14px;
  transition: border-color 0.14s ease, transform 0.14s ease;
}
.sugg:hover { border-color: var(--accent); transform: translateY(-1px); color: var(--ink); }

/* ---------- MESSAGES ---------- */
.msg { display: flex; gap: 13px; animation: rise 0.4s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.msg .who {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 12px; font-weight: 600;
}
.msg.user .who { background: #e7e3dc; color: var(--ink-soft); }
.msg.bot .who { background: #f3efe9; border: 1px solid var(--line); font-family: var(--serif); }
.msg .who .who-logo { display: flex; align-items: center; justify-content: center; }
.msg .who .who-logo svg { width: 24px; height: 24px; display: block; }
.bubble { padding-top: 3px; min-width: 0; flex: 1 1; }
.bubble .name { font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-bottom: 5px; }
.bubble p { font-size: 14.5px; line-height: 1.58; color: var(--ink); }
.bubble p .hl { color: var(--accent-deep); font-weight: 600; }
.caret {
  display: inline-block; width: 7px; height: 15px; background: var(--accent);
  margin-left: 2px; vertical-align: -2px; border-radius: 1px; animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- CARDS ---------- */
.card-grid { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; grid-gap: 12px; gap: 12px; }
.card-grid.single { grid-template-columns: 1fr; }
.card-wrap { animation: pop 0.42s var(--ease) both; min-width: 0; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 16px; cursor: pointer; position: relative; text-align: left; width: 100%;
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease), border-color 0.16s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.99); } to { opacity: 1; transform: none; } }
.card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -16px rgba(28, 27, 25, 0.3); border-color: #d8d2c8; }
.card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tag {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent-deep); font-weight: 600;
}
.card h3 { font-family: var(--serif); font-weight: 600; font-size: 16.5px; line-height: 1.25; letter-spacing: -0.01em; margin-top: 8px; }
/* whole-card click target: a real button whose ::after covers the card
   (no interactive nesting); the add-btn sits above it via z-index */
.card-open { font: inherit; color: inherit; text-align: left; padding: 0; }
.card-open::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); cursor: pointer; }
.card-open:focus-visible { outline: none; }
.card-open:focus-visible::after { outline: 2px solid var(--accent); outline-offset: 2px; }
.card .add-btn { position: relative; z-index: 1; }
.card .inst { font-size: 12.5px; color: var(--ink-faint); margin-top: 4px; }
.card-foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }

.fund-badge {
  font-size: 11.5px; font-weight: 600; padding: 4px 9px; border-radius: 20px; display: inline-flex; align-items: center; gap: 5px;
}
.fund-badge.yes { color: var(--good); background: var(--good-soft); }
.fund-badge.no { color: var(--ink-faint); background: var(--line-soft); }
.fund-badge .d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.mini-stat { font-size: 12px; color: var(--ink-soft); }
.mini-stat b { color: var(--ink); font-weight: 600; }

.prof-card-row { display: flex; gap: 12px; align-items: flex-start; }
.photo {
  border-radius: 10px; flex-shrink: 0;
  background: repeating-linear-gradient(45deg, #ece8e1 0 7px, #e4dfd6 7px 14px);
  display: grid; place-items: center;
}
.photo span { font-size: 7.5px; color: var(--ink-faint); font-family: ui-monospace, monospace; letter-spacing: 0.02em; }
.photo.sm { width: 46px; height: 46px; }
.photo.md { width: 56px; height: 56px; }

/* add-to-list button */
.add-btn {
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
  font-size: 11.5px; font-weight: 600; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; background: var(--panel);
  transition: all 0.14s ease;
}
.add-btn:hover { border-color: var(--accent); color: var(--accent-deep); }
.add-btn .ic { font-size: 13px; line-height: 1; }
.add-btn.saved { background: var(--accent); border-color: var(--accent); color: #fff; }
.add-btn.icon-only { padding: 6px; width: 28px; height: 28px; justify-content: center; }

/* ---------- DETAIL PANEL (RIGHT) ---------- */
.detail {
  width: 0; flex: 0 0 auto; background: var(--panel);
  border-left: 1px solid transparent; overflow: hidden;
  transition: width 0.44s var(--ease), border-color 0.2s ease;
}
.app.split .detail { width: var(--split, 50%); border-left-color: var(--line); }
.app.split .card-grid { grid-template-columns: 1fr; }
.app.split .thread { max-width: 620px; }

.detail-inner { width: 100%; min-width: 0; height: 100%; display: flex; flex-direction: column; }
.detail-head {
  padding: 20px 26px 18px; display: flex; align-items: flex-start; justify-content: space-between;
  border-bottom: 1px solid var(--line-soft); gap: 14px; flex-shrink: 0;
}
.detail-eyebrow { font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent-deep); font-weight: 600; }
.detail-title { font-family: var(--serif); font-weight: 600; font-size: 25px; letter-spacing: -0.015em; margin-top: 8px; line-height: 1.12; }
.detail-sub { font-size: 13.5px; color: var(--ink-soft); margin-top: 8px; line-height: 1.5; }
.detail-sub .dept { color: var(--ink); font-weight: 500; }
.head-actions { display: flex; gap: 8px; flex-shrink: 0; }
.close {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--ink-soft); background: var(--panel); font-size: 15px;
  transition: background 0.14s ease;
}
.close:hover { background: var(--bg); color: var(--ink); }
/* program profile: the body carries the agreed design's own title block,
   so the header collapses to an eyebrow + close row */
.detail-head.bare { border-bottom: none; padding: 16px 26px 0; align-items: center; }
.detail-body.program-body { gap: 0; padding: 6px 32px 36px; }
.program-body .pdetail { max-width: 760px; }
.program-body .sec, .program-body .ad-slot { margin-top: 26px; }
.detail-body { flex: 1 1; overflow-y: auto; padding: 22px 26px 30px; display: flex; flex-direction: column; gap: 24px; }
.detail-body::-webkit-scrollbar { width: 9px; }
.detail-body::-webkit-scrollbar-thumb { background: var(--line); border-radius: 9px; border: 3px solid var(--panel); }

.det-photo-row { display: flex; align-items: center; gap: 14px; }
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; }
.status-badge {
  font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 20px;
  display: inline-flex; align-items: center; gap: 6px;
}
.status-badge .d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-badge.open { color: var(--good); background: var(--good-soft); }
.status-badge.closed { color: var(--ink-faint); background: var(--line-soft); }
.status-badge.neutral { color: var(--accent-deep); background: var(--accent-soft); }

/* neutral stat grid (replaces colored bars) */
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); grid-gap: 10px; gap: 10px; }
.statcell {
  background: var(--bg); border: 1px solid var(--line-soft); border-radius: 11px;
  padding: 13px 14px; display: flex; flex-direction: column; gap: 3px;
}
.statcell .s-l { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-faint); }
.statcell .s-v { font-family: var(--serif); font-size: 21px; font-weight: 600; color: var(--ink); line-height: 1.1; }
.statcell .s-n { font-size: 11.5px; color: var(--ink-soft); }

/* ad slots — clearly-marked placeholders for future banner inventory */
.ad-slot {
  position: relative; border: 1px dashed var(--line); border-radius: 12px;
  background:
    repeating-linear-gradient(45deg, transparent 0 11px, rgba(139,134,126,0.05) 11px 22px),
    var(--panel);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  text-align: center; color: var(--ink-faint);
}
.ad-slot .ad-tag { font-size: 9px; letter-spacing: 0.16em; font-weight: 600; color: var(--ink-faint); }
.ad-slot .ad-note { font-family: ui-monospace, "SF Mono", monospace; font-size: 11px; color: var(--ink-faint); }
.ad-slot.banner { min-height: 92px; width: 100%; }
.ad-slot.rail {
  min-height: 132px; background:
    repeating-linear-gradient(45deg, transparent 0 11px, rgba(255,255,255,0.04) 11px 22px),
    rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.14); color: rgba(207,201,192,0.65);
}
.ad-slot.rail .ad-tag, .ad-slot.rail .ad-note { color: rgba(207,201,192,0.6); }

/* context chip (focused chat on an item) */
.ctx-chip {
  display: inline-flex; align-items: center; gap: 9px; margin-bottom: 10px;
  background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 22px;
  padding: 6px 8px 6px 13px; font-size: 12.5px; color: var(--accent-deep); max-width: 100%;
  animation: rise 0.3s var(--ease) both;
}
.ctx-chip .c-ic { font-size: 13px; }
.ctx-chip .c-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-chip .c-x {
  width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0,0,0,0.06); color: var(--accent-deep); font-size: 11px; flex-shrink: 0;
}
.ctx-chip .c-x:hover { background: rgba(0,0,0,0.12); }

/* stat bars (legacy) */
.bars { display: flex; flex-direction: column; gap: 15px; }
.bar-item { display: flex; flex-direction: column; gap: 7px; }
.bar-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.bar-head .b-label { font-size: 12px; color: var(--ink-soft); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-head .b-val { font-family: var(--serif); font-size: 16px; font-weight: 600; color: var(--ink); white-space: nowrap; flex-shrink: 0; }
.bar-track { height: 7px; background: var(--line-soft); border-radius: 20px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 20px; background: var(--accent); transform-origin: left; animation: grow 0.6s var(--ease) both; }
.bar-fill.good { background: var(--good); }
.bar-fill.warn { background: var(--warn); }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.sec h4 { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); margin-bottom: 11px; }
.sec p { font-size: 14px; line-height: 1.62; color: var(--ink-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: 12.5px; color: var(--accent-deep); background: var(--accent-soft); border: 1px solid var(--accent-line); padding: 6px 11px; border-radius: 20px; }

/* requirements grid */
.req-grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 10px; gap: 10px; }
.req {
  background: var(--bg); border: 1px solid var(--line-soft); border-radius: 11px; padding: 12px 13px;
}
.req .r-l { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-faint); }
.req .r-v { font-family: var(--serif); font-size: 18px; font-weight: 600; margin-top: 4px; }

/* related rows (faculty / pi / lab) */
.rel-row {
  display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 11px;
  border: 1px solid var(--line-soft); background: var(--bg); width: 100%; text-align: left;
  transition: border-color 0.14s ease, background 0.14s ease;
}
.rel-row:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.rel-row + .rel-row { margin-top: 8px; }
.rel-name { font-size: 13.5px; font-weight: 600; }
.rel-meta { font-size: 12px; color: var(--ink-faint); margin-top: 1px; }
.rel-arrow { margin-left: auto; color: var(--ink-faint); font-size: 15px; }

/* links — clean list */
.links { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; }
.link-row {
  display: flex; align-items: center; gap: 11px; padding: 12px 14px; width: 100%; text-align: left;
  background: var(--panel); transition: background 0.13s ease;
}
.link-row + .link-row { border-top: 1px solid var(--line-soft); }
.link-row:hover { background: var(--bg); }
.link-ic {
  width: 26px; height: 26px; border-radius: 7px; background: var(--accent-soft); color: var(--accent-deep);
  display: grid; place-items: center; font-size: 13px; flex-shrink: 0;
}
.link-label { font-size: 13.5px; font-weight: 500; color: var(--ink); }
.link-host { font-size: 12px; color: var(--ink-faint); margin-left: auto; }
.link-ext { color: var(--ink-faint); font-size: 13px; }

/* detail footer with add to list */
.detail-foot {
  padding: 14px 26px; border-top: 1px solid var(--line-soft); flex-shrink: 0;
  display: flex; gap: 10px; background: var(--panel);
}
.btn-primary {
  flex: 1 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--ink); color: #fff; border-radius: 11px; padding: 12px; font-size: 13.5px; font-weight: 600;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn-primary:hover { background: #000; }
.btn-primary:active { transform: scale(0.99); }
.btn-primary.saved { background: var(--accent); }
.btn-ghost {
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 11px; padding: 12px 16px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft);
  transition: border-color 0.14s ease;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-deep); }

/* ---------- COMPOSER ---------- */
.composer { padding: 12px 30px 20px; border-top: 1px solid var(--line-soft); background: var(--bg); flex-shrink: 0; }
.composer-inner { max-width: 760px; margin: 0 auto; }
.tabs { display: flex; gap: 6px; margin-bottom: 11px; }
.tab {
  font-size: 12.5px; font-weight: 500; color: var(--ink-soft);
  padding: 7px 13px; border-radius: 9px; display: flex; align-items: center; gap: 7px;
  border: 1px solid transparent; transition: all 0.14s ease;
}
.tab:hover { background: var(--panel); }
.tab .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-faint); }
.tab.active { background: var(--panel); border-color: var(--line); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03); }
.tab.active .dot { background: var(--accent); }
.tab .count { font-size: 11px; color: var(--ink-faint); }

.prompt {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 6px 6px 6px 18px; box-shadow: 0 6px 24px -16px rgba(28, 27, 25, 0.3);
  display: flex; align-items: flex-end; gap: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.prompt:focus-within { border-color: var(--accent); box-shadow: 0 6px 24px -14px rgba(28, 27, 25, 0.35); }
.prompt textarea {
  flex: 1 1; border: none; outline: none; resize: none; background: none;
  font-family: inherit; font-size: 14.5px; color: var(--ink); line-height: 1.5;
  padding: 12px 0; max-height: 140px;
}
.prompt textarea::placeholder { color: var(--ink-faint); }
.send {
  width: 38px; height: 38px; border-radius: 11px; background: var(--ink); color: #fff;
  display: grid; place-items: center; font-size: 16px; flex-shrink: 0; margin-bottom: 4px; margin-right: 4px;
  transition: background 0.15s ease, transform 0.1s ease;
}
.send:hover { background: #000; }
.send:disabled { background: var(--line); color: var(--ink-faint); cursor: default; }
.send:active:not(:disabled) { transform: scale(0.94); }

/* typing dots */
.typing { display: inline-flex; gap: 4px; align-items: center; padding: 4px 0; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-faint); animation: bob 1.1s infinite; }
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bob { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-5px); opacity: 1; } }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
  /* rail becomes an off-canvas drawer — .rail itself slides */
  .rail {
    position: absolute; left: -360px; top: 0; bottom: 0;
    width: 40vw; min-width: 0; z-index: 80;
    transition: left 0.34s var(--ease), box-shadow 0.34s var(--ease);
  }
  .rail-inner {
    position: static; width: 100% !important; height: 100%;
    padding: 20px 16px; align-items: stretch; box-shadow: none;
  }
  .app.mobile-nav-open .rail { left: 0; box-shadow: 14px 0 56px -22px rgba(0, 0, 0, 0.6); }

  .conv-head { padding: 14px 16px; }
  .scroll { padding: 20px 18px 8px; }
  .composer { padding: 10px 18px 16px; }
  /* phone: detail overlays the chat full-width instead of a cramped split */
  .app.split .detail {
    position: absolute; top: 0; right: 0; bottom: 0; width: 100%; z-index: 20;
    box-shadow: -24px 0 60px -30px rgba(28, 27, 25, 0.5);
  }
  .card-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   ADD-TO-LIST MODAL
   ============================================================ */
.addlist-overlay {
  position: absolute; inset: 0; z-index: 120;
  background: rgba(28, 27, 25, 0.46);
  display: grid; place-items: center; padding: 24px;
  animation: ovIn 0.18s ease both;
}
.addlist-modal {
  position: relative; width: 420px; max-width: 94vw; max-height: 86vh;
  background: var(--panel); border-radius: 18px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.5);
  animation: modIn 0.22s var(--ease) both;
}
.al-close {
  position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; color: var(--ink-faint); font-size: 14px; transition: background 0.13s ease;
}
.al-close:hover { background: var(--bg); color: var(--ink); }
.al-head { padding: 22px 24px 16px; border-bottom: 1px solid var(--line-soft); }
.al-eyebrow { font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent-deep); font-weight: 600; }
.al-title { font-family: var(--serif); font-weight: 600; font-size: 22px; letter-spacing: -0.015em; margin-top: 5px; }
.al-item { font-size: 13px; color: var(--ink-soft); margin-top: 7px; padding-right: 28px; }
.al-uni { color: var(--ink-faint); }

.al-body { padding: 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.al-body::-webkit-scrollbar { width: 9px; }
.al-body::-webkit-scrollbar-thumb { background: var(--line); border-radius: 9px; border: 3px solid var(--panel); }
.al-divider { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); padding: 12px 12px 6px; }

.al-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 11px 12px; border-radius: 11px; transition: background 0.12s ease;
}
.al-row:hover { background: var(--bg); }
.al-row .al-check {
  width: 22px; height: 22px; border-radius: 7px; flex-shrink: 0;
  border: 1.5px solid var(--line); display: grid; place-items: center;
  font-size: 12px; color: #fff; transition: background 0.12s ease, border-color 0.12s ease;
}
.al-row.on .al-check { background: var(--accent); border-color: var(--accent); }
.al-row.master .al-check { border-radius: 50%; }
.al-row-main { min-width: 0; display: flex; flex-direction: column; }
.al-row-name { font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.al-row-sub { font-size: 12px; color: var(--ink-faint); margin-top: 1px; }
.al-row.master { background: var(--bg); }
.al-row.master:hover { background: var(--line-soft); }

.al-row.create { color: var(--accent-deep); }
.al-row.create .al-row-name { color: var(--accent-deep); }
.al-plus {
  width: 22px; height: 22px; border-radius: 7px; flex-shrink: 0;
  border: 1.5px dashed var(--line); display: grid; place-items: center;
  font-size: 15px; color: var(--accent-deep); line-height: 1;
}
.al-newrow { display: flex; align-items: center; gap: 10px; padding: 8px 12px 4px; margin-top: 4px; }
.al-input {
  flex: 1 1; min-width: 0; font-family: inherit; font-size: 14px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; outline: none;
  transition: border-color 0.14s ease;
}
.al-input:focus { border-color: var(--accent); background: var(--panel); }
.al-addbtn {
  flex-shrink: 0; font-size: 13px; font-weight: 600; color: #fff; background: var(--accent);
  border-radius: 9px; padding: 9px 15px; transition: background 0.14s ease;
}
.al-addbtn:hover { background: var(--accent-deep); }
.al-addbtn:disabled { background: var(--line); color: var(--ink-faint); cursor: default; }

.al-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-top: 1px solid var(--line-soft); background: var(--panel);
}
.al-hint { font-size: 12px; color: var(--ink-faint); }
.al-remove { font-size: 13px; font-weight: 600; color: oklch(0.55 0.14 25); }
.al-remove:hover { text-decoration: underline; }
.al-done {
  background: var(--ink); color: #fff; border-radius: 10px; padding: 9px 22px; font-size: 13.5px; font-weight: 600;
  transition: background 0.15s ease;
}
.al-done:hover { background: #000; }

/* hamburger + scrim (mobile only) */
.hamburger { display: none; }
.mobile-scrim {
  position: absolute; inset: 0; z-index: 70;
  background: rgba(28, 27, 25, 0.42);
  animation: ovIn 0.22s ease both;
}
@media (max-width: 768px) {
  .hamburger {
    display: grid; place-items: center; flex-shrink: 0;
    width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line);
    background: var(--panel); color: var(--ink); margin-right: 4px;
  }
  .hamburger:active { background: var(--bg); }
}

/* ---------- DENSITY ---------- */
[data-density="compact"] .thread { gap: 16px; }
[data-density="compact"] .scroll { padding-top: 18px; }
[data-density="compact"] .card { padding: 12px 13px; }
[data-density="compact"] .detail-body { gap: 17px; padding-top: 16px; }
[data-density="compact"] .detail-head { padding: 16px 24px 14px; }
[data-density="comfy"] .thread { gap: 32px; }
[data-density="comfy"] .scroll { padding-top: 34px; }
[data-density="comfy"] .card { padding: 19px 20px; }
[data-density="comfy"] .detail-body { gap: 30px; padding-top: 28px; }
[data-density="comfy"] .detail-head { padding: 26px 30px 22px; }

/* ============================================================
   RESULTS WORKSPACE
   ============================================================ */
.panel-stack { height: 100%; display: flex; flex-direction: column; animation: panelIn 0.32s var(--ease) both; }
.results { height: 100%; display: flex; flex-direction: column; animation: panelIn 0.32s var(--ease) both; }
@keyframes panelIn { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }

.panel-back {
  display: flex; align-items: center; gap: 7px; width: 100%; text-align: left;
  padding: 12px 26px; font-size: 12.5px; font-weight: 600; color: var(--accent-deep);
  border-bottom: 1px solid var(--line-soft); flex-shrink: 0; background: var(--panel);
  transition: background 0.13s ease;
}
.panel-back:hover { background: var(--accent-soft); }
.panel-back .pb-arrow { font-size: 14px; }

.results-head { flex-shrink: 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; }
.rh-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px 12px; }

.set-switch { display: flex; flex-direction: column; gap: 1px; text-align: left; min-width: 0; padding: 4px 8px; margin: -4px -8px; border-radius: 9px; transition: background 0.13s ease; }
.set-switch:not(:disabled):hover { background: var(--bg); }
.set-switch:disabled { cursor: default; }
.set-switch .ss-q { font-family: var(--serif); font-size: 17px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.set-switch .ss-meta { font-size: 12px; color: var(--ink-faint); }

.filter-bar { display: flex; align-items: center; gap: 7px; padding: 0 22px 12px; flex-wrap: wrap; }
.fb-spacer { flex: 1 1; min-width: 8px; }
.filter-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 500; color: var(--ink-soft);
  background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 7px 11px;
  transition: border-color 0.13s ease, background 0.13s ease, color 0.13s ease;
}
.filter-btn:hover, .filter-btn.open { border-color: #cfc7ba; background: var(--bg); }
.filter-btn.on { border-color: var(--accent); color: var(--accent-deep); background: var(--accent-soft); }
.filter-btn .fb-count { background: var(--accent); color: #fff; border-radius: 20px; font-size: 10.5px; padding: 0 6px; line-height: 16px; }
.filter-btn .fb-caret { font-size: 9px; opacity: 0.6; }
.filter-btn .fb-pre { color: var(--ink-faint); }
.filter-btn.ghost { border-color: transparent; background: none; color: var(--ink); font-weight: 600; }
.filter-btn.ghost:hover { background: var(--bg); }
.filter-btn.toggle .tk-box { width: 15px; height: 15px; border-radius: 4px; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 10px; color: #fff; }
.filter-btn.toggle.on .tk-box { background: var(--accent); border-color: var(--accent); }

/* dropdown */
.dd { position: relative; display: inline-block; }
.dd-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 18px 42px -20px rgba(28, 27, 25, 0.4); overflow: hidden;
  animation: ddIn 0.14s var(--ease) both;
}
.dd-pop.right { left: auto; right: 0; }
@keyframes ddIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.dd-list { max-height: 320px; overflow-y: auto; padding: 5px; }
.dd-head { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); padding: 7px 9px 5px; }
.dd-opt { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 8px 9px; border-radius: 8px; font-size: 13px; color: var(--ink); transition: background 0.1s ease; }
.dd-opt:hover { background: var(--bg); }
.dd-opt .dd-check { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 10px; color: #fff; flex-shrink: 0; }
.dd-opt .dd-check.on { background: var(--accent); border-color: var(--accent); }
.dd-opt .dd-opt-l { flex: 1 1; min-width: 0; }
.dd-opt .dd-opt-h { font-size: 11.5px; color: var(--ink-faint); }
.dd-set { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; padding: 9px; border-radius: 8px; transition: background 0.1s ease; }
.dd-set:hover { background: var(--bg); }
.dd-set.active { background: var(--accent-soft); }
.dd-set .ds-q { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-set .ds-c { font-size: 11.5px; color: var(--ink-faint); }

.results-count { display: flex; align-items: center; justify-content: space-between; padding: 9px 22px; background: var(--bg); border-top: 1px solid var(--line-soft); }
.results-count span { font-size: 12.5px; color: var(--ink-soft); }
.results-count b { color: var(--ink); font-weight: 600; }
.clear-filters { font-size: 12px; font-weight: 600; color: var(--accent-deep); }
.clear-filters:hover { text-decoration: underline; }

.results-list { flex: 1 1; overflow-y: auto; padding: 8px 14px 16px; }
.results-list::-webkit-scrollbar { width: 9px; }
.results-list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 9px; border: 3px solid var(--panel); }

.result-row {
  position: relative; /* anchors the .rr-open click overlay */
  display: flex; align-items: center; gap: 12px; padding: 14px 12px; border-radius: 11px;
  border: 1px solid transparent; transition: background 0.12s ease, border-color 0.12s ease;
}
/* whole-row click target via a real button (keyboard + focus ring) */
.rr-open { font: inherit; color: inherit; text-align: left; padding: 0; }
.rr-open::after { content: ""; position: absolute; inset: 0; border-radius: 11px; cursor: pointer; }
.rr-open:focus-visible { outline: none; }
.rr-open:focus-visible::after { outline: 2px solid var(--accent); outline-offset: -2px; }
.result-row .add-btn { position: relative; z-index: 1; }
.result-row:hover { background: var(--bg); }
.result-row.selected { background: var(--accent-soft); border-color: var(--accent-line); }
.rr-main { flex: 1 1; min-width: 0; }
.rr-title { font-family: var(--serif); font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
.rr-sub { font-size: 12.5px; color: var(--ink-faint); margin-top: 2px; }
.rr-meta { display: flex; align-items: center; gap: 8px; margin-top: 9px; flex-wrap: wrap; }
.rr-chip { font-size: 11px; font-weight: 600; color: var(--ink-soft); background: var(--line-soft); border-radius: 6px; padding: 2px 7px; }
.rr-stat { font-size: 12px; color: var(--ink-soft); }
.rr-ok { font-size: 11.5px; font-weight: 600; color: var(--good); }
.rr-mut { font-size: 11.5px; color: var(--ink-faint); }
.rr-arrow { color: var(--ink-faint); font-size: 14px; opacity: 0; transition: opacity 0.12s ease; flex-shrink: 0; }
.result-row:hover .rr-arrow { opacity: 1; }

.load-more { text-align: center; padding: 18px; font-size: 12.5px; color: var(--ink-faint); }
.load-more .lm-count { display: block; font-size: 11px; margin-top: 3px; opacity: 0.7; }
.list-end { text-align: center; padding: 20px; font-size: 11.5px; color: var(--ink-faint); letter-spacing: 0.02em; }
.results-empty { text-align: center; padding: 48px 24px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.results-empty p { font-size: 14px; color: var(--ink-soft); }

/* view-all button under chat preview cards */
.view-all {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 12px;
  font-size: 13px; font-weight: 600; color: var(--accent-deep);
  background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 10px; padding: 9px 14px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.view-all:hover { transform: translateY(-1px); box-shadow: 0 8px 18px -12px rgba(28, 27, 25, 0.3); }
.view-all.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.view-all .va-arrow { transition: transform 0.14s ease; }
.view-all:hover .va-arrow { transform: translateX(3px); }

/* ---------- conv-head actions + Customize ---------- */
.ch-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.customize-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 20px; padding: 6px 13px; background: var(--panel);
  transition: border-color 0.14s ease, color 0.14s ease;
}
.customize-btn:hover { border-color: var(--accent); color: var(--accent-deep); }
.customize-btn .cz-gear { font-size: 13px; }

/* ---------- global (conversation) filters ---------- */
.gfilters { display: flex; align-items: center; gap: 7px; margin-bottom: 11px; flex-wrap: wrap; }
.gf-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--ink-soft);
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 6px 12px;
  transition: border-color 0.13s ease, background 0.13s ease, color 0.13s ease;
}
.gf-toggle:hover { border-color: #cfc7ba; }
.gf-toggle.on { border-color: var(--accent); color: var(--accent-deep); background: var(--accent-soft); }
.gf-toggle .fb-count { background: var(--accent); color: #fff; border-radius: 20px; font-size: 10px; padding: 0 6px; line-height: 15px; }
.gf-toggle .fb-caret { font-size: 8px; opacity: 0.6; }
.gf-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--accent-deep); background: var(--accent-soft);
  border: 1px solid var(--accent-line); border-radius: 20px; padding: 4px 6px 4px 11px;
}
.gf-pill .gp-x { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.06); color: var(--accent-deep); font-size: 10px; }
.gf-pill .gp-x:hover { background: rgba(0, 0, 0, 0.13); }
.gf-note { font-size: 11.5px; color: var(--ink-faint); }

.gf-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 13px; padding: 13px 14px; margin-bottom: 11px; box-shadow: 0 6px 22px -16px rgba(28, 27, 25, 0.3); }
.gf-hint { font-size: 12px; color: var(--ink-soft); }
.gf-hint b { color: var(--ink); }
.gf-dropdowns { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }

/* dropdown opening upward (composer is at the bottom) */
.dd-pop.up { top: auto; bottom: calc(100% + 6px); }

/* ============================================================
   SETTINGS MODAL
   ============================================================ */
.settings-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(28, 27, 25, 0.46);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 26px;
  animation: ovIn 0.18s ease both;
}
@keyframes ovIn { from { opacity: 0; } to { opacity: 1; } }
.settings-modal {
  width: 940px; max-width: 95vw; height: 636px; max-height: 90vh;
  background: var(--panel); border-radius: 20px; overflow: hidden;
  display: flex; box-shadow: 0 44px 110px -34px rgba(0, 0, 0, 0.55);
  animation: modIn 0.24s var(--ease) both;
}
@keyframes modIn { from { opacity: 0; transform: translateY(14px) scale(0.985); } to { opacity: 1; transform: none; } }

/* sidebar */
.set-side {
  width: 252px; flex-shrink: 0; background: var(--bg);
  border-right: 1px solid var(--line); display: flex; flex-direction: column;
  padding: 22px 14px 16px;
}
.set-title { font-family: var(--serif); font-weight: 600; font-size: 20px; letter-spacing: -0.01em; padding: 0 8px 15px; }
.set-search-wrap { position: relative; display: flex; align-items: center; }
.set-search-wrap .ss-ic { position: absolute; left: 11px; color: var(--ink-faint); pointer-events: none; }
.set-search {
  width: 100%; font-family: inherit; font-size: 13px; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 12px 9px 32px; outline: none; transition: border-color 0.14s ease;
}
.set-search:focus { border-color: var(--accent); }
.set-search::placeholder { color: var(--ink-faint); }
.set-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; flex: 1 1; overflow-y: auto; }
.set-nav::-webkit-scrollbar { width: 0; }
.set-nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 9px 11px; border-radius: 9px; font-size: 13.5px; font-weight: 500;
  color: var(--ink-soft); border: 1px solid transparent; transition: background 0.12s ease, color 0.12s ease;
}
.set-nav-item svg { flex-shrink: 0; opacity: 0.78; }
.set-nav-item:hover { background: rgba(0, 0, 0, 0.04); color: var(--ink); }
.set-nav-item.active { background: var(--panel); color: var(--ink); font-weight: 600; border-color: var(--line); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); }
.set-nav-item.active svg { opacity: 1; color: var(--accent-deep); }
.set-nav-item .nav-badge { margin-left: auto; background: var(--accent); color: #fff; border-radius: 20px; font-size: 10.5px; padding: 0 7px; line-height: 16px; }
.set-nav-empty { font-size: 12.5px; color: var(--ink-faint); padding: 10px 11px; }
.set-signout {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  margin-top: 8px; padding: 10px 11px; border-radius: 9px; font-size: 13px; font-weight: 600;
  color: oklch(0.55 0.14 25); transition: background 0.12s ease;
}
.set-signout svg { opacity: 0.85; }
.set-signout:hover { background: oklch(0.96 0.03 25); }

/* main */
.set-main { flex: 1 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
.set-close {
  position: absolute; top: 16px; right: 18px; z-index: 5;
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  color: var(--ink-faint); font-size: 15px; transition: background 0.13s ease, color 0.13s ease;
}
.set-close:hover { background: var(--bg); color: var(--ink); }
.set-body { flex: 1 1; overflow-y: auto; padding: 30px 40px 40px; }
.set-body::-webkit-scrollbar { width: 10px; }
.set-body::-webkit-scrollbar-thumb { background: var(--line); border-radius: 9px; border: 3px solid var(--panel); }
.set-section-title { font-family: var(--serif); font-weight: 600; font-size: 23px; letter-spacing: -0.015em; margin-bottom: 6px; }
.set-lead { font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; margin: 4px 0 18px; max-width: 460px; }

.set-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 17px 0; border-top: 1px solid var(--line-soft); }
.set-row:first-of-type { border-top: none; padding-top: 8px; }
.sr-left { min-width: 0; }
.sr-label { font-size: 14px; font-weight: 600; color: var(--ink); }
.sr-desc { font-size: 12.5px; color: var(--ink-faint); margin-top: 3px; line-height: 1.5; max-width: 380px; }
.sr-right { flex-shrink: 0; display: flex; align-items: center; }

.set-sep { height: 1px; background: var(--line-soft); margin: 8px 0; }
.set-block { padding-top: 22px; margin-top: 8px; border-top: 1px solid var(--line-soft); }
.set-block .sr-desc { margin-bottom: 12px; }

/* inputs */
.set-input {
  font-family: inherit; font-size: 13.5px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 13px; width: 282px; max-width: 42vw; outline: none; transition: border-color 0.14s ease, background 0.14s ease;
}
.set-input:focus { border-color: var(--accent); background: var(--panel); }
.set-input[readonly] { color: var(--ink-soft); }
.set-textarea {
  width: 100%; font-family: inherit; font-size: 13.5px; line-height: 1.6; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 15px; outline: none; resize: vertical; transition: border-color 0.14s ease, background 0.14s ease;
}
.set-textarea:focus { border-color: var(--accent); background: var(--panel); }

.set-select-wrap { position: relative; display: inline-flex; align-items: center; }
.set-select {
  -moz-appearance: none;
       appearance: none; -webkit-appearance: none; font-family: inherit; font-size: 13.5px; font-weight: 500;
  color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 34px 10px 14px; outline: none; cursor: pointer; transition: border-color 0.14s ease;
}
.set-select:focus { border-color: var(--accent); }
.set-select-wrap .sel-caret { position: absolute; right: 13px; font-size: 10px; color: var(--ink-faint); pointer-events: none; }

/* avatar */
.set-avatar-edit { display: flex; align-items: center; gap: 13px; }
.set-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(135deg, #6b7d82, #3a4548);
  display: grid; place-items: center; color: #fff; font-size: 16px; font-weight: 600;
}
.set-pill-btn {
  font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 9px; padding: 8px 14px; background: var(--panel);
  transition: border-color 0.14s ease, color 0.14s ease;
}
.set-pill-btn:hover { border-color: var(--accent); color: var(--accent-deep); }
.set-pill-btn.accent { background: var(--ink); border-color: var(--ink); color: #fff; }
.set-pill-btn.accent:hover { background: #000; }
.set-pill-btn.danger { border-color: oklch(0.85 0.06 25); color: oklch(0.55 0.14 25); }
.set-pill-btn.danger:hover { background: oklch(0.96 0.03 25); border-color: oklch(0.55 0.14 25); }

/* segmented */
.set-seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg-opt { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); padding: 7px 14px; border-radius: 7px; transition: all 0.13s ease; }
.seg-opt:hover { color: var(--ink); }
.seg-opt.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07); }

/* swatches */
.set-swatches { display: flex; gap: 9px; }
.swatch { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06); transition: transform 0.13s ease; }
.swatch:hover { transform: scale(1.08); }
.swatch.on { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px currentColor; }
.swatch .sw-check { color: #fff; font-size: 13px; }

/* toggle switch */
.set-switch-tog { width: 42px; height: 24px; border-radius: 20px; background: var(--line); position: relative; transition: background 0.16s ease; flex-shrink: 0; }
.set-switch-tog .kn { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 0.16s var(--ease); }
.set-switch-tog.on { background: var(--accent); }
.set-switch-tog.on .kn { transform: translateX(18px); }

/* range */
.set-range { width: 180px; accent-color: var(--accent); cursor: pointer; }

/* lists (saved searches / shortlist) */
.set-list { display: flex; flex-direction: column; gap: 8px; }
.set-list-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  width: 100%; text-align: left; padding: 14px 16px; border-radius: 12px;
  background: var(--bg); border: 1px solid var(--line-soft); transition: border-color 0.14s ease, background 0.14s ease;
}
.set-list-row:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.slr-title { font-family: var(--serif); font-size: 15px; font-weight: 600; }
.slr-sub { font-size: 12.5px; color: var(--ink-faint); margin-top: 2px; }
.slr-go { font-size: 12.5px; font-weight: 600; color: var(--accent-deep); flex-shrink: 0; }

/* help links */
.set-links { display: flex; flex-direction: column; border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; }
.set-link-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; width: 100%; text-align: left; font-size: 13.5px; font-weight: 500; color: var(--ink); background: var(--panel); transition: background 0.12s ease; }
.set-link-row + .set-link-row { border-top: 1px solid var(--line-soft); }
.set-link-row:hover { background: var(--bg); }
.set-link-row .slk-ext { color: var(--ink-faint); font-size: 13px; }
.set-version { font-size: 11.5px; color: var(--ink-faint); margin-top: 18px; letter-spacing: 0.02em; }

@media (max-width: 768px) {
  .settings-modal { flex-direction: column; height: 92vh; }
  .set-side { width: 100%; border-right: none; border-bottom: 1px solid var(--line); padding: 16px 12px; }
  .set-nav { flex-direction: row; flex-wrap: wrap; overflow: visible; }
  .set-nav-item { width: auto; }
  .set-nav-item .nav-badge { margin-left: 6px; }
  .set-signout { width: auto; }
  .set-body { padding: 22px 20px 30px; }
  .set-input { width: 100%; max-width: none; }
}

