/* ===== Paydar demo dashboard ===== */
:root {
  --primary: #0e4f5c;
  --primary-700: #0a3d48;
  --primary-900: #072a32;
  --primary-50: #e9f3f4;
  --primary-100: #d3e8ea;
  --gold: #c8a04b;
  --gold-600: #a7832f;
  --gold-50: #fbf6e8;
  --bg: #f3f5f7;
  --card: #ffffff;
  --ink: #1b2a33;
  --ink-2: #3c4d57;
  --muted: #6d7c87;
  --line: #e3e8ec;
  --line-2: #eef2f4;
  --danger: #c0392b;
  --success: #1f8a5b;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(10, 40, 50, .05), 0 6px 18px rgba(10, 40, 50, .06);
  --shadow-lg: 0 10px 40px rgba(10, 40, 50, .16);
  --font: "Segoe UI", Tahoma, "Noto Naskh Arabic", "Noto Sans Arabic", "Geeza Pro", system-ui, sans-serif;
  --top-h: 64px;
  --chrome: 112px; /* space above the chat shell on desktop */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-700); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.nowrap { white-space: nowrap; }
/* names can be phone numbers: let content decide direction so "+964..." doesn't flip */
.person-name, .conv-name, .cell-name strong, .profile-name, .appt-name { unicode-bidi: plaintext; text-align: start; }

/* ---------- icons ---------- */
.ico { display: inline-flex; width: 20px; height: 20px; flex: none; }
.ico svg { width: 100%; height: 100%; }
.ico-sm { width: 16px; height: 16px; }
.flip svg { transform: scaleX(-1); }

/* ---------- app shell ---------- */
.app {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  grid-template-rows: var(--top-h) minmax(0, 1fr);
  grid-template-areas: "side top" "side main";
  min-height: 100vh;
}
.topbar {
  grid-area: top;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 24px;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-start { display: flex; align-items: center; gap: 14px; min-width: 0; }
.branch-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--primary-50); color: var(--primary-700);
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #22b573;
  box-shadow: 0 0 0 0 rgba(34, 181, 115, .5); animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 181, 115, .5); }
  70% { box-shadow: 0 0 0 7px rgba(34, 181, 115, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 181, 115, 0); }
}
.demo-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px;
  background: var(--gold-50); color: #7a5b17;
  border: 1px solid #ecd9a8;
  font-size: 12.5px; font-weight: 700; white-space: nowrap;
}
.demo-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }

.sidebar {
  grid-area: side;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: linear-gradient(185deg, var(--primary) 0%, var(--primary-900) 100%);
  color: #fff;
  padding: 18px 14px;
  z-index: 15;
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; min-width: 0; }
.brand:hover { color: inherit; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text strong { font-size: 16px; }
.brand-text small { font-size: 11.5px; opacity: .75; white-space: nowrap; }
.brand-full { padding: 4px 8px 20px; border-bottom: 1px solid rgba(255, 255, 255, .1); margin-bottom: 14px; }
.brand-compact { display: none; color: var(--primary-900); }
.logo {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(140deg, #e3c477, var(--gold) 55%, var(--gold-600));
  color: var(--primary-900); font-weight: 800; font-size: 20px;
  box-shadow: 0 4px 12px rgba(200, 160, 75, .35);
}
.logo-lg { width: 60px; height: 60px; font-size: 30px; border-radius: 18px; margin: 0 auto 8px; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a, .nav-logout {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  color: rgba(255, 255, 255, .78);
  font-weight: 600; font-size: 14.5px;
  transition: background .15s, color .15s;
  border: 0; background: none; cursor: pointer; text-align: start; width: 100%;
}
.nav a:hover, .nav-logout:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav a.active { background: rgba(255, 255, 255, .13); color: #fff; box-shadow: inset -3px 0 0 var(--gold); }
.nav a.active .ico { color: var(--gold); }
.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .1); }
.sidebar-note { margin: 10px 12px 0; font-size: 12px; opacity: .55; }

.view { grid-area: main; padding: 24px; min-width: 0; outline: none; }

/* ---------- page head & cards ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 22px; line-height: 1.3; color: var(--primary-900); }
.page-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(227, 232, 236, .7);
  min-width: 0;
}
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px 0; }
.card-head h2, .card-title { margin: 0; font-size: 16px; color: var(--primary-900); }
.card-head .muted { font-size: 13px; }
.card-body { padding: 14px 20px 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.stack { display: flex; flex-direction: column; gap: 18px; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { border-color: #cfd8de; background: #f8fafb; color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-700); border-color: var(--primary-700); color: #fff; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--primary-900); }
.btn-gold:hover { background: var(--gold-600); border-color: var(--gold-600); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--line-2); border-color: transparent; }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn-xs { padding: 2px 8px; font-size: 12px; border-radius: 7px; font-weight: 600; }
.btn-icon { padding: 8px; width: 38px; height: 38px; }
.btn-block { width: 100%; }
.btn-danger-ghost { color: var(--danger); }
.btn-danger-ghost:hover { background: #fdf0ee; border-color: #f3c9c3; color: var(--danger); }

.input, .select, textarea.input {
  border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: 8px 12px; font-size: 14px; outline: none; min-width: 0;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14, 79, 92, .12); }
.select { padding-inline-end: 30px; cursor: pointer; }
.search { position: relative; display: flex; align-items: center; min-width: 0; flex: 1; }
.search .ico { position: absolute; inset-inline-start: 10px; color: var(--muted); width: 17px; height: 17px; pointer-events: none; }
.search .input { width: 100%; padding-inline-start: 34px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; text-align: start; }
.field span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; outline: none; }
.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14, 79, 92, .12); }

/* ---------- chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 1px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; line-height: 20px;
  white-space: nowrap; flex: none;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 600; line-height: 19px;
  background: var(--line-2); color: var(--ink-2); white-space: nowrap;
}
.tag-bot { background: var(--primary-50); color: var(--primary); }
.tag-staff { background: var(--gold-50); color: #7a5b17; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; } /* 6 cards: 3x2, 6x1 on wide screens */
.stat { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-label { font-size: 13.5px; color: var(--muted); font-weight: 600; }
.stat-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.stat-icon .ico { width: 19px; height: 19px; }
.stat-value { font-size: 30px; font-weight: 800; color: var(--primary-900); line-height: 1.1; letter-spacing: -.5px; }
.stat-sub { font-size: 12.5px; color: var(--muted); }
.stat.alert { background: linear-gradient(160deg, #fffaf0, #fff); border-color: #f0dfb3; }
.stat.alert .stat-icon { background: var(--gold-50); color: var(--gold-600); }
.stat.alert .stat-value { color: #8a6516; }

/* ---------- bar lists ---------- */
.bars { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 128px minmax(0, 1fr) 34px; align-items: center; gap: 10px; font-size: 13.5px; }
.bar-label { color: var(--ink-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; min-width: 4px; transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.bar-val { font-weight: 700; color: var(--ink); text-align: end; }

/* ---------- people lists ---------- */
.people { list-style: none; margin: 0; padding: 0; }
.person {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 8px; border-radius: 10px; color: inherit;
}
.person:hover { background: var(--line-2); color: inherit; }
.person + .person { border-top: 1px solid var(--line-2); }
.person-main { flex: 1; min-width: 0; }
.person-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-weight: 800; font-size: 16px; color: #fff;
}
.avatar .ico { width: 20px; height: 20px; }
.avatar-lg { width: 64px; height: 64px; font-size: 24px; }

/* ---------- empty / loading ---------- */
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty-icon { width: 54px; height: 54px; margin: 0 auto 10px; border-radius: 16px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.empty-icon .ico { width: 26px; height: 26px; }
.empty strong { display: block; color: var(--ink-2); font-size: 15px; margin-bottom: 2px; }
.empty p { margin: 0; font-size: 13.5px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 30px; color: var(--muted); font-size: 14px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--primary-100); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, #eef2f4 25%, #f6f8f9 37%, #eef2f4 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- chats ---------- */
.chat-shell {
  display: grid; grid-template-columns: 350px minmax(0, 1fr);
  height: calc(100vh - var(--top-h) - 48px);
  min-height: 480px;
  overflow: hidden;
  padding: 0;
}
.list-pane { display: flex; flex-direction: column; border-inline-end: 1px solid var(--line); min-width: 0; min-height: 0; }
.list-head { padding: 14px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.list-head-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.list-head h1 { margin: 0; font-size: 18px; color: var(--primary-900); }
.list-head .toolbar { flex-wrap: nowrap; }
.list-head .select { max-width: 132px; }
.conv-list { flex: 1; overflow-y: auto; min-height: 0; }
.conv {
  display: flex; gap: 11px; padding: 11px 14px; color: inherit;
  border-bottom: 1px solid var(--line-2); transition: background .12s;
}
.conv:hover { background: #f7f9fa; color: inherit; }
.conv.active { background: var(--primary-50); }
.conv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.conv-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.conv-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.conv-time { font-size: 11.5px; color: var(--muted); white-space: nowrap; flex: none; }
.conv-preview { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.conv-preview b { color: var(--ink-2); font-weight: 600; }
.conv-paused { color: var(--gold-600); font-size: 11px; font-weight: 700; white-space: nowrap; }

.chat-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #f5f1ea; position: relative; }
.chat-pane::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(14, 79, 92, .07) 1px, transparent 1px);
  background-size: 18px 18px;
}
.chat-pane > * { position: relative; }
.chat-head {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  background: #fff; border-bottom: 1px solid var(--line); min-height: 64px; flex-wrap: wrap;
}
.chat-head .person-main { min-width: 120px; }
.chat-head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.back-btn { display: none; }
.messages { flex: 1; overflow-y: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.day-sep { align-self: center; margin: 10px 0 4px; padding: 3px 12px; border-radius: 8px; background: rgba(255, 255, 255, .92); font-size: 12px; color: var(--muted); font-weight: 600; box-shadow: 0 1px 1px rgba(0, 0, 0, .04); }
.bubble {
  max-width: min(72%, 560px);
  padding: 7px 11px 5px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 1.5px rgba(0, 0, 0, .08);
  overflow-wrap: anywhere; word-break: break-word;
  font-size: 14.5px; line-height: 1.65;
  animation: pop .18s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.bubble.in { align-self: flex-start; border-start-start-radius: 4px; }
.bubble.out { align-self: flex-end; background: #dff3ee; border-start-end-radius: 4px; }
.bubble.from-staff { background: #fdf2d9; }
.bubble-label { display: flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--primary); margin-bottom: 1px; }
.from-staff .bubble-label { color: #8a6516; }
.bubble-text { white-space: pre-wrap; }
.bubble-meta { display: block; text-align: end; font-size: 11px; color: var(--muted); margin-top: 2px; direction: rtl; }
.bubble-img { display: block; margin: 2px 0 4px; border-radius: 9px; overflow: hidden; max-width: 260px; background: var(--line-2); }
.bubble-img img { display: block; width: 100%; max-height: 300px; object-fit: cover; }
.bubble audio { display: block; width: 260px; max-width: 100%; height: 40px; margin: 2px 0; }
.transcript { margin-top: 5px; padding: 6px 9px; border-radius: 8px; background: rgba(14, 79, 92, .06); font-size: 13.5px; }
.transcript-label { display: block; font-size: 11px; font-weight: 700; color: var(--muted); }
.msg-sys {
  align-self: center; max-width: 85%;
  margin: 4px 0; padding: 4px 12px; border-radius: 8px;
  background: rgba(255, 255, 255, .75); color: var(--muted);
  font-size: 12.5px; text-align: center; overflow-wrap: anywhere; white-space: pre-wrap;
}
.msg-sys.note { background: #fff8e6; color: #7a5b17; }
.msg-sys.ok { background: #e6f5ee; color: var(--success); font-weight: 600; }
.composer { display: flex; gap: 8px; align-items: flex-end; padding: 10px 14px; background: #f0f2f3; border-top: 1px solid var(--line); }
.composer textarea {
  flex: 1; resize: none; border: 1px solid var(--line); border-radius: 12px;
  padding: 9px 13px; max-height: 140px; min-height: 42px; outline: none; background: #fff; line-height: 1.5;
}
.composer textarea:focus { border-color: var(--primary); }
.composer .btn-icon { width: 42px; height: 42px; border-radius: 12px; flex: none; }
.composer-hint {
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; background: #fff; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13.5px; text-align: center;
}
.chat-placeholder { flex: 1; display: grid; place-items: center; text-align: center; padding: 20px; }
.chat-placeholder .empty-icon { width: 72px; height: 72px; border-radius: 22px; }
.chat-placeholder .empty-icon .ico { width: 34px; height: 34px; }
.new-pill {
  position: absolute; bottom: 78px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff; border: 0; border-radius: 999px;
  padding: 5px 14px; font-size: 12.5px; font-weight: 700; cursor: pointer; box-shadow: var(--shadow-lg); z-index: 3;
}

/* typing */
.typing { align-self: flex-end; display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: 12px; background: #dff3ee; color: var(--primary); font-size: 13px; font-weight: 600; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); opacity: .4; animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: start; font-size: 12.5px; color: var(--muted); font-weight: 700;
  padding: 11px 14px; background: #f8fafb; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr { cursor: pointer; transition: background .12s; }
.table tbody tr:hover { background: #f7fafb; }
.table tbody tr:last-child td { border-bottom: 0; }
.cell-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-name .avatar { width: 34px; height: 34px; font-size: 13px; }
.cell-name strong { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-clip { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.has-note { border-bottom: 1px dashed var(--muted); cursor: help; }
.count-note { font-size: 13px; color: var(--muted); }

/* ---------- profile ---------- */
.back-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; margin-bottom: 14px; color: var(--muted); }
.back-link:hover { color: var(--primary); }
.profile-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.profile-head .person-main { min-width: 180px; }
.profile-name { margin: 0; font-size: 21px; color: var(--primary-900); overflow-wrap: anywhere; }
.profile-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; color: var(--muted); font-size: 13.5px; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.field-box { padding: 11px 13px; border-radius: 10px; background: #f8fafb; border: 1px solid var(--line-2); min-width: 0; }
.field-box dt { font-size: 12px; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
.field-box dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; white-space: pre-wrap; }
.field-box dd.empty-val { color: #a7b3bb; font-weight: 500; }
.field-box.wide { grid-column: 1 / -1; }
.assess { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.assess + .assess { margin-top: 12px; }
.assess-img { display: block; border-radius: 10px; overflow: hidden; background: var(--line-2); aspect-ratio: 1; }
.assess-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.assess-img:hover img { transform: scale(1.04); }
.assess-noimg { display: grid; place-items: center; color: var(--muted); font-size: 12px; height: 100%; }
.assess-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px 14px; }
.kv dt { font-size: 12px; color: var(--muted); font-weight: 700; }
.kv dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.grafts { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 12px; border-radius: 10px; background: var(--gold-50); border: 1px solid #ecd9a8; margin-bottom: 10px; flex-wrap: wrap; }
.grafts strong { font-size: 19px; color: #7a5b17; }
.grafts small { color: #8a6f33; font-weight: 700; }
.assess-notes { margin: 10px 0 0; font-size: 13.5px; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.appt-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; flex-wrap: wrap; }
.appt-row + .appt-row { border-top: 1px solid var(--line-2); }
.appt-when { font-weight: 700; min-width: 150px; }
.disclaimer { font-size: 12px; color: var(--muted); margin: 8px 0 0; }

/* ---------- bookings ---------- */
.week-label { font-weight: 700; color: var(--primary-900); font-size: 15px; padding: 0 6px; white-space: nowrap; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); margin: 0 0 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.week-scroll { overflow-x: auto; padding-bottom: 4px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(158px, 1fr)); gap: 10px; min-width: 0; }
.day { background: #fff; border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 0; min-height: 220px; }
.day.today { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(200, 160, 75, .25), var(--shadow); }
.day.off { background: #fafbfc; }
.day-head { padding: 10px 12px 8px; border-bottom: 1px solid var(--line-2); }
.day-name { font-weight: 800; color: var(--primary-900); display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.day-date { font-size: 12.5px; color: var(--muted); }
.today-tag { font-size: 11px; background: var(--gold); color: var(--primary-900); padding: 0 7px; border-radius: 6px; font-weight: 800; }
.day-hours { margin-top: 4px; display: flex; flex-direction: column; gap: 1px; font-size: 11.5px; color: var(--muted); }
.day-hours span { display: flex; align-items: center; gap: 5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.day-hours i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.day-body { padding: 8px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.day-empty { margin: auto; color: #a7b3bb; font-size: 12.5px; padding: 16px 0; text-align: center; }
.appt {
  border-radius: 10px; padding: 8px 10px; background: #fff;
  border: 1px solid var(--line); border-inline-start: 4px solid var(--doc, var(--primary));
  font-size: 13px; display: flex; flex-direction: column; gap: 3px; transition: box-shadow .15s;
  min-width: 0;
}
.appt:hover { box-shadow: var(--shadow); }
.appt-time { font-weight: 800; color: var(--ink); display: flex; align-items: center; justify-content: space-between; gap: 4px 6px; flex-wrap: wrap; }
.appt-time span { white-space: nowrap; }
.appt-name { font-weight: 700; color: var(--primary-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appt-sub { color: var(--muted); font-size: 12px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.appt-actions { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; padding-top: 6px; border-top: 1px dashed var(--line); }
.appt.cancelled { opacity: .55; background: #fafbfc; }
.appt.cancelled .appt-time span, .appt.cancelled .appt-name { text-decoration: line-through; }
.hours-table td, .hours-table th { text-align: center; }
.hours-table td:first-child, .hours-table th:first-child { text-align: start; }
.hours-table tbody tr { cursor: default; }
.off-txt { color: #b3bec5; }

/* ---------- try bot ---------- */
.try-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; }
.try-chat { display: flex; flex-direction: column; height: calc(100vh - var(--top-h) - 140px); min-height: 460px; overflow: hidden; }
.try-chat .chat-head { border-radius: var(--radius) var(--radius) 0 0; }
.attach-preview { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: #fff; border-top: 1px solid var(--line); }
.attach-preview img { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; }
.samples { display: flex; flex-direction: column; gap: 8px; }
.sample {
  text-align: start; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 14px; color: var(--ink-2);
  transition: border-color .15s, background .15s, color .15s;
}
.sample:hover { border-color: var(--primary); background: var(--primary-50); color: var(--primary-900); }
.sample:disabled { opacity: .5; cursor: not-allowed; }
.tips { margin: 0; padding-inline-start: 18px; color: var(--ink-2); font-size: 13.5px; }
.tips li + li { margin-top: 4px; }

/* ---------- branch ---------- */
.notice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 16px; border-radius: 12px;
  background: var(--gold-50); border: 1px solid #ecd9a8; color: #6f5214; font-size: 14px; margin-bottom: 18px;
}
.notice .ico { color: var(--gold-600); margin-top: 2px; }
.info-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.services { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.service { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; transition: border-color .15s, box-shadow .15s; min-width: 0; }
.service:hover { border-color: var(--primary-100); box-shadow: var(--shadow); }
.service h3 { margin: 0 0 6px; font-size: 15px; color: var(--primary-900); overflow-wrap: anywhere; }
.price { font-weight: 800; color: #7a5b17; font-size: 15px; }
.service p { margin: 6px 0 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.doctors { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.doctor { padding: 16px; }
.doctor-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.doctor-head h3 { margin: 0; font-size: 16px; color: var(--primary-900); }
.sched { display: flex; flex-direction: column; }
.sched-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13.5px; border-bottom: 1px solid var(--line-2); gap: 10px; }
.sched-row:last-child { border-bottom: 0; }
.sched-row b { font-weight: 600; color: var(--ink-2); }

/* ---------- nav badge ---------- */
.nav a { position: relative; }
.nav-badge {
  margin-inline-start: auto;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: #e0453a; color: #fff; font-size: 11.5px; font-weight: 800; line-height: 20px; text-align: center;
  box-shadow: 0 0 0 2px rgba(7, 42, 50, .35); animation: badgePop .25s ease-out;
}
@keyframes badgePop { from { transform: scale(.6); } to { transform: none; } }

/* ---------- handoff alerts ---------- */
.card.has-alerts { border-color: #f1c9c3; box-shadow: 0 0 0 1px rgba(224, 69, 58, .08), var(--shadow); }
.ho-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.ho-card {
  display: flex; flex-direction: column; gap: 9px; min-width: 0;
  padding: 13px 14px; border-radius: 12px; background: #fff;
  border: 1px solid var(--line); border-inline-start: 4px solid var(--gold);
}
.ho-card.high { border-inline-start-color: #e0453a; background: linear-gradient(170deg, #fff6f5, #fff 60%); }
.ho-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ho-top .conv-time { margin-inline-start: auto; }
.ho-prio { font-size: 11.5px; font-weight: 800; color: #b4362b; }
.ho-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ho-who .avatar { width: 36px; height: 36px; font-size: 14px; }
.ho-quote {
  margin: 0; padding: 7px 11px; border-radius: 9px; background: #f5f1ea;
  border-inline-start: 3px solid #d9cdb6; color: var(--ink-2); font-size: 13.5px;
  white-space: pre-wrap; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.ho-notified { display: flex; align-items: flex-start; gap: 6px; font-size: 12.5px; color: var(--success); font-weight: 600; }
.ho-notified .ico { margin-top: 2px; }
.ho-banner {
  display: flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 8px;
  background: #e0453a; color: #fff; font-size: 13px; font-weight: 700;
}
.ho-open { align-self: flex-start; }
.sub-title { margin: 18px 0 4px; font-size: 13.5px; color: var(--muted); font-weight: 700; }
.conv-alert { color: #9a6408; }
.conv-alert.high { color: #c0392b; }

/* chat: handoff strip + composer notes */
.handoff-strip {
  display: flex; align-items: flex-start; gap: 10px; padding: 9px 16px;
  background: #fff3dc; color: #6f4b06; border-bottom: 1px solid #f0dfb3; font-size: 13.5px;
}
.handoff-strip.high { background: #fdeceb; color: #8e2a20; border-bottom-color: #f3c9c3; }
.handoff-strip > .ico { margin-top: 3px; }
.strip-main { flex: 1; min-width: 0; }
.strip-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.strip-time { font-size: 12px; opacity: .8; }
.strip-quote { margin-top: 2px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip-flag { flex: none; padding: 2px 9px; border-radius: 999px; background: #e0453a; color: #fff; font-size: 12px; font-weight: 700; white-space: nowrap; }
.composer-notes { display: flex; flex-direction: column; }
.composer-note { display: flex; align-items: flex-start; gap: 8px; padding: 8px 14px; font-size: 13px; border-top: 1px solid var(--line); }
.composer-note .ico { margin-top: 2px; }
.composer-note.warn { background: #fff4d6; color: #7a5208; border-top-color: #f0dca6; font-weight: 600; }
.composer-note.optout { background: #f1f3f4; color: var(--muted); }

/* ---------- reminders ---------- */
.table-static tbody tr { cursor: default; }
.rem-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.rem-who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; unicode-bidi: plaintext; text-align: start; }
.rem-who .ltr { font-size: 12px; color: var(--muted); }
a.cell-name { color: inherit; }
a.cell-name:hover strong { color: var(--primary); }
.rem-preview summary { cursor: pointer; color: var(--primary); font-weight: 600; font-size: 13px; white-space: nowrap; }
.rem-text {
  margin-top: 6px; padding: 8px 10px; border-radius: 9px; background: #dff3ee;
  font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 320px; line-height: 1.6;
}

/* ---------- assistant settings ---------- */
.model-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.model-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
  background: var(--primary-50); color: var(--primary-700); font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--primary-100); max-width: 100%;
}
.model-chip b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hint { margin: 0 0 10px; color: var(--muted); font-size: 13.5px; }
.persona-ta { width: 100%; display: block; resize: vertical; min-height: 220px; line-height: 1.75; font-size: 14.5px; padding: 12px 14px; }
.persona-ta:focus, textarea.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14, 79, 92, .12); }
.persona-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.persona-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.dirty-note { color: #9a6408; font-size: 13px; font-weight: 700; }
.locked-wrap { display: flex; flex-direction: column; gap: 12px; }
.locked-block { border: 1px dashed #c9d2d8; border-radius: 12px; background: #f4f6f7; padding: 12px 14px; color: #6a7780; }
.locked-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.locked-head strong { color: var(--ink-2); font-size: 14px; }
.locked-ico { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: #e3e8ec; color: #55646e; }
.locked-label {
  margin-inline-start: auto; display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 9px; border-radius: 999px; background: #e3e8ec; color: #55646e; font-size: 11.5px; font-weight: 700;
}
.locked-text, .prompt-pre {
  margin: 0; font-family: Consolas, "Courier New", "Noto Naskh Arabic", monospace; font-size: 12.5px; line-height: 1.7;
  white-space: pre-wrap; overflow-wrap: anywhere; text-align: start;
}
.locked-text { max-height: 260px; overflow-y: auto; user-select: text; }
.prompt-preview summary {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px 20px; cursor: pointer;
  font-weight: 700; color: var(--primary-900); list-style: none;
}
.prompt-preview summary::-webkit-details-marker { display: none; }
.prompt-preview summary::after { content: "▾"; margin-inline-start: auto; color: var(--muted); transition: transform .15s; }
.prompt-preview[open] summary::after { transform: rotate(180deg); }
.prompt-preview summary small { font-weight: 500; }
.prompt-pre { margin: 0 20px 18px; padding: 14px; border-radius: 10px; background: #0f2a31; color: #e3eef0; max-height: 480px; overflow-y: auto; }

/* ---------- FAQ editor ---------- */
.faq-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.faq-item { display: flex; gap: 12px; align-items: flex-start; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; background: #fff; min-width: 0; }
.faq-item.editing { border-color: var(--primary-100); background: var(--primary-50); }
.faq-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.faq-q { font-weight: 700; color: var(--primary-900); overflow-wrap: anywhere; }
.faq-a { color: var(--ink-2); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.faq-q b, .faq-a b { color: var(--gold-600); }
.faq-form .input { width: 100%; }
.faq-form textarea { resize: vertical; min-height: 70px; }
.input.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(192, 57, 43, .12); }
.faq-actions { display: flex; gap: 6px; flex: none; flex-wrap: wrap; }
.faq-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding: 0 20px 18px; }
.faq-foot .dirty-note { margin-inline-end: auto; }

/* ---------- home lists (not booked + latest bookings) ---------- */
.card-head h2 { display: flex; align-items: center; gap: 7px; }
.head-ico { color: var(--primary); }
.head-ico.warn { color: #b4362b; }
.head-ico.ok { color: var(--success); }
.card-hint { margin: 2px 20px 0; font-size: 12.5px; color: var(--muted); }
.card-foot { padding: 0 20px 14px; display: flex; justify-content: flex-end; }
.card-foot a { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 13.5px; }
.home-list { display: flex; flex-direction: column; }
.home-list .card-body { flex: 1; padding-top: 8px; padding-bottom: 8px; }
.lost-list { display: flex; flex-direction: column; }
.lost { display: flex; align-items: flex-start; gap: 11px; padding: 10px 4px; min-width: 0; }
.lost + .lost { border-top: 1px solid var(--line-2); }
.lost .avatar { width: 38px; height: 38px; font-size: 15px; }
.lost-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.lost-top .person-name { color: var(--ink); max-width: 100%; }
.lost-top .person-name:hover { color: var(--primary); }
.lost-top .conv-time { margin-inline-start: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.chip-reason { background: #fbf1dc; color: #8a5d08; }
.lost-quote {
  margin: 5px 0 0; padding: 5px 10px; border-radius: 8px; background: #f5f1ea;
  border-inline-start: 3px solid #d9b46a; color: var(--ink-2); font-size: 13px;
  overflow-wrap: anywhere; unicode-bidi: plaintext; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lost-actions { display: flex; flex-direction: column; gap: 5px; flex: none; }
.recent { align-items: flex-start; }
.recent .avatar { width: 38px; height: 38px; font-size: 15px; }
.recent-sub { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.recent-when { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.recent-when .ico { color: var(--muted); }
.recent-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.recent .conv-time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.tag-joint { background: #efe9fb; color: #5b3fa8; }
.appt-comp { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; max-width: 100%; }

/* ---------- roadmap ---------- */
.nav-soon {
  margin-inline-start: auto; padding: 0 7px; border-radius: 999px; font-size: 10.5px; font-weight: 800; line-height: 18px;
  background: rgba(200, 160, 75, .22); color: #f1d796;
}
.live-badge, .soon-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 1px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 800; line-height: 20px; white-space: nowrap;
}
.live-badge { background: #e3f5ec; color: #17794b; }
.live-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #22b573; }
.soon-badge { background: var(--gold-50); color: #8a6516; border: 1px solid #ecd9a8; }
.rm-live { background: linear-gradient(170deg, #f3fbf7, #fff 55%); }
.rm-live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 10px; }
.rm-live-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 11px; background: #fff; border: 1px solid #d7eee2; min-width: 0; }
.rm-live-item strong { display: block; font-size: 14px; color: var(--primary-900); }
.rm-live-item small { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.rm-live-ico { width: 28px; height: 28px; flex: none; border-radius: 8px; display: grid; place-items: center; background: #e3f5ec; color: #17794b; }
.rm-phases { display: flex; flex-direction: column; gap: 22px; margin-top: 22px; }
.rm-phase-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.rm-phase-head h2 { margin: 0; font-size: 17px; color: var(--primary-900); }
.rm-phase-head p { margin: 0; font-size: 13.5px; color: var(--muted); }
.rm-step {
  width: 36px; height: 36px; flex: none; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--primary), var(--primary-900)); color: var(--gold); font-weight: 800; font-size: 16px;
  box-shadow: 0 4px 12px rgba(14, 79, 92, .25);
}
.rm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.rm-card {
  display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 14px; background: #fff;
  border: 1px solid var(--line); box-shadow: var(--shadow); min-width: 0; transition: transform .15s, box-shadow .15s, border-color .15s;
}
.rm-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--primary-100); }
.rm-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rm-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.rm-card h3 { margin: 4px 0 0; font-size: 15px; color: var(--primary-900); overflow-wrap: anywhere; }
.rm-card p { margin: 0; font-size: 13.2px; color: var(--muted); line-height: 1.65; overflow-wrap: anywhere; }
.rm-note { display: flex; align-items: flex-start; gap: 8px; margin: 22px 0 4px; font-size: 13px; color: var(--muted); }
.rm-note .ico { margin-top: 2px; color: var(--gold-600); }

/* ---------- login ---------- */
.login {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 16px;
  background: radial-gradient(1200px 600px at 80% -10%, rgba(200, 160, 75, .25), transparent 60%), linear-gradient(160deg, var(--primary) 0%, var(--primary-900) 100%);
}
.login-card {
  width: 100%; max-width: 380px; background: #fff; border-radius: 20px; padding: 30px 26px 22px;
  box-shadow: var(--shadow-lg); text-align: center; display: flex; flex-direction: column; gap: 14px;
}
.login-card h1 { margin: 0; font-size: 21px; color: var(--primary-900); }
.login-card p { margin: -10px 0 4px; font-size: 13.5px; }
.login-card .demo-badge { align-self: center; }
.login-error { color: var(--danger); font-size: 13px; min-height: 18px; margin: -6px 0 -6px !important; }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: 18px; left: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px; border-radius: 12px; background: #2a1715; color: #fff;
  box-shadow: var(--shadow-lg); font-size: 14px; animation: toastIn .2s ease-out;
  border-inline-start: 4px solid #e2675a; overflow-wrap: anywhere;
}
.toast.success { background: #0f2f2a; border-inline-start-color: #3cc28c; }
.toast.info { background: var(--primary-900); border-inline-start-color: var(--gold); }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- responsive ---------- */
@media (min-width: 1440px) {
  .stats { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 1280px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .try-grid { grid-template-columns: minmax(0, 1fr); }
  .chat-shell { grid-template-columns: 300px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  :root { --top-h: 56px; }
  .app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: var(--top-h) auto minmax(0, 1fr);
    grid-template-areas: "top" "side" "main";
  }
  .topbar { padding: 0 16px; position: relative; }
  .brand-compact { display: flex; }
  .brand-compact .logo { width: 34px; height: 34px; font-size: 17px; border-radius: 10px; }
  .brand-compact small { display: none; }
  .branch-pill { display: none; }
  .demo-badge { font-size: 11.5px; padding: 3px 10px; }
  .sidebar {
    height: auto; position: sticky; top: 0;
    flex-direction: row; align-items: stretch; padding: 6px 8px; gap: 4px;
    box-shadow: 0 2px 10px rgba(7, 42, 50, .2);
  }
  .brand-full, .sidebar-note { display: none; }
  .nav { flex-direction: row; overflow-x: auto; flex: 1; gap: 2px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex-direction: column; gap: 2px; padding: 6px 10px; font-size: 11.5px; white-space: nowrap; flex: none; width: auto; }
  .nav a .ico { width: 19px; height: 19px; }
  .nav a.active { box-shadow: inset 0 -3px 0 var(--gold); }
  .nav-badge { position: absolute; top: 2px; inset-inline-end: 4px; min-width: 17px; height: 17px; line-height: 17px; padding: 0 4px; font-size: 10.5px; margin: 0; }
  .nav-soon { display: none; }
  .sidebar-foot { margin: 0; padding: 0 0 0 0; border: 0; border-inline-start: 1px solid rgba(255, 255, 255, .12); display: flex; }
  .nav-logout { flex-direction: column; gap: 2px; padding: 6px 10px; font-size: 11.5px; width: auto; white-space: nowrap; }
  .nav-logout span:last-child { display: none; }
  .view { padding: 16px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .chat-shell { grid-template-columns: minmax(0, 1fr); height: calc(100vh - var(--top-h) - 62px - 32px); height: calc(100dvh - var(--top-h) - 62px - 32px); min-height: 420px; }
  .chat-shell .chat-pane { display: none; }
  .chat-shell.has-active .chat-pane { display: flex; }
  .chat-shell.has-active .list-pane { display: none; }
  .list-pane { border-inline-end: 0; }
  .back-btn { display: inline-flex; }
  .bubble { max-width: 86%; }
  .messages { padding: 14px 12px; }
  .try-chat { height: calc(100dvh - var(--top-h) - 62px - 120px); min-height: 420px; }
  .week-scroll { overflow: visible; }
  .week { grid-template-columns: minmax(0, 1fr); }
  .day { min-height: 0; }
  .day-body { flex-direction: column; }
}
@media (max-width: 700px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 13px 14px; }
  .stat-value { font-size: 25px; }
  .stat-icon { width: 30px; height: 30px; }
  .page-head h1 { font-size: 19px; }
  .bar-row { grid-template-columns: 100px minmax(0, 1fr) 28px; }
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .table-cards td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; align-items: center; min-width: 0; }
  .table-cards td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; font-weight: 600; flex: none; }
  .table-cards td.td-name::before { display: none; }
  .table-cards td.td-name { padding-bottom: 6px; }
  .table-cards .cell-clip { max-width: 60%; text-align: end; }
  .assess { grid-template-columns: minmax(0, 1fr); }
  .assess-img { max-width: 220px; }
  .chat-head { padding: 8px 10px; gap: 8px; }
  .chat-head .avatar { width: 36px; height: 36px; font-size: 14px; }
  .chat-head-actions { width: 100%; }
  .chat-head-actions .btn { flex: 1; }
  .toasts { left: 16px; right: 16px; bottom: 16px; max-width: none; }
  .week-label { font-size: 14px; white-space: normal; }
  .table-cards td.td-preview { display: block; }
  .table-cards td.td-preview::before { display: block; margin-bottom: 2px; }
  .rem-text { max-width: none; }
  .faq-item { flex-direction: column; gap: 8px; }
  .faq-actions { align-self: flex-end; }
  .locked-label { margin-inline-start: 0; }
  .handoff-strip { padding: 8px 10px; }
  .page-actions > .btn-primary { flex: 1; }
  .lost { flex-wrap: wrap; }
  .lost-actions { flex-direction: row; width: 100%; padding-inline-start: 49px; }
  .rm-phase-head h2 { font-size: 16px; }
}
@media (max-width: 400px) {
  .demo-badge::before { display: none; }
  .stat-sub { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
