/* ===== ROOT ===== */
:root {
  --bg:       #f0f4f8;
  --bg2:      #f8fafc;
  --card:     #ffffff;
  --border:   #e2e8f0;
  --blue:     #3b82f6;
  --blue2:    #2563eb;
  --green:    #10b981;
  --green2:   #059669;
  --red:      #ef4444;
  --purple:   #8b5cf6;
  --text:     #0f172a;
  --text2:    #475569;
  --text3:    #94a3b8;
  --r:        16px;
  --font:     'Inter', sans-serif;
  --nav-h:    64px;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: var(--nav-h);
}
a { color: var(--blue); text-decoration: none; cursor: pointer; }
button { cursor: pointer; border: none; font-family: var(--font); }
input, textarea, select { font-family: var(--font); }

/* ===== SPLASH SCREEN ===== */
#splash-screen {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #1e3a8a 0%, #065f46 100%);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
#splash-screen.hidden { opacity: 0; pointer-events: none; transform: scale(1.05); }
.splash-bg {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 28px 28px;
}
.splash-content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  text-align: center;
}
.splash-emblem {
  width: 100px; height: 100px; object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.4));
  animation: splashPop 0.6s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes splashPop { from{opacity:0;transform:scale(0.5)} to{opacity:1;transform:scale(1)} }
.splash-logo-text {
  font-size: 40px; font-weight: 800; color: #fff;
  letter-spacing: -1px;
  animation: splashFadeUp 0.5s 0.3s both;
}
.splash-logo-text span { color: #34d399; }
.splash-tagline {
  font-size: 15px; color: rgba(255,255,255,0.8);
  font-weight: 500;
  animation: splashFadeUp 0.5s 0.45s both;
}
@keyframes splashFadeUp { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:translateY(0)} }
.splash-loader {
  width: 160px; height: 4px; border-radius: 4px;
  background: rgba(255,255,255,0.2);
  overflow: hidden; margin-top: 8px;
  animation: splashFadeUp 0.5s 0.6s both;
}
.splash-loader-bar {
  height: 100%; width: 0; border-radius: 4px;
  background: linear-gradient(90deg, #34d399, #60a5fa);
  animation: loaderFill 2s 0.7s ease-out forwards;
}
@keyframes loaderFill { to { width: 100%; } }

/* ===== PAGE SYSTEM ===== */
.pg { display: none; min-height: calc(100vh - var(--nav-h)); }
.pg.active { display: block; }

/* ===== BOTTOM NAVIGATION ===== */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: var(--card); border-top: 1px solid var(--border);
  display: flex; height: var(--nav-h);
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}
.bn-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px; padding: 8px 4px;
  background: none; color: var(--text3);
  font-size: 10px; font-weight: 500;
  transition: color .2s;
}
.bn-item svg { transition: stroke .2s; }
.bn-item.active { color: var(--blue); }
.bn-item.active svg { stroke: var(--blue); }
.bn-item:hover { color: var(--blue); }

/* ===== HOME PAGE ===== */
.hero-section {
  background: linear-gradient(160deg, #1d4ed8 0%, #059669 100%);
  padding: 40px 24px 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-bg-pattern {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; }
.hero-logo-img {
  width: 72px; height: 72px; object-fit: contain;
  margin-bottom: 14px; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}
.hero-title {
  font-size: 30px; font-weight: 800;
  color: #fff; margin-bottom: 6px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.hero-sub {
  font-size: 16px; font-weight: 600;
  color: rgba(255,255,255,0.95); margin-bottom: 6px;
}
.hero-desc {
  font-size: 13px; color: rgba(255,255,255,0.8);
  margin-bottom: 24px;
}
.hero-cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; color: var(--blue2);
  font-size: 15px; font-weight: 700;
  padding: 13px 26px; border-radius: 100px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  transition: all .2s;
}
.hero-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,0.25); }

/* Categories */
.home-categories-title {
  font-size: 13px; font-weight: 700; color: var(--text2);
  padding: 20px 16px 10px; text-transform: uppercase; letter-spacing: 0.5px;
}
.home-cats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px; padding: 0 16px 4px;
}
.cat-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px 8px;
  font-size: 12px; font-weight: 600; color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  cursor: pointer; transition: all .2s;
}
.cat-card:hover { transform: translateY(-2px); border-color: var(--blue); box-shadow: 0 6px 18px rgba(59,130,246,0.12); }
.cat-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}

/* Quick Row */
.home-quick-row {
  display: flex; gap: 12px; padding: 16px 16px 4px;
}
.home-qbtn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px; border-radius: 14px;
  font-size: 14px; font-weight: 700; color: #fff;
  transition: all .2s;
}
.home-qbtn.blue { background: linear-gradient(135deg, #3b82f6, #2563eb); box-shadow: 0 4px 16px rgba(59,130,246,0.3); }
.home-qbtn.blue:hover { box-shadow: 0 6px 22px rgba(59,130,246,0.45); transform: translateY(-1px); }
.home-qbtn.green { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 4px 16px rgba(16,185,129,0.3); }
.home-qbtn.green:hover { box-shadow: 0 6px 22px rgba(16,185,129,0.4); transform: translateY(-1px); }
.home-qbtn svg { stroke: #fff; }

.quick-section { padding: 20px 16px; }
.quick-title { font-size: 13px; font-weight: 700; color: var(--text2); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.quick-list { display: flex; flex-direction: column; gap: 8px; }
.quick-q {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 13px 16px;
  font-size: 14px; color: var(--text); text-align: left;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: all .2s; line-height: 1.4;
}
.quick-q:hover { border-color: var(--blue); background: rgba(59,130,246,0.04); }

/* Stats Bar */
.home-stats-bar {
  display: flex; align-items: center; justify-content: space-around;
  background: var(--card); border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 16px; margin: 0 0 8px;
}
.hstat { text-align: center; }
.hstat-v { font-size: 20px; font-weight: 800; color: var(--blue); }
.hstat-l { font-size: 11px; color: var(--text3); margin-top: 2px; }
.hstat-divider { width: 1px; height: 32px; background: var(--border); }

/* ===== CHAT PAGE ===== */
#pg-chat {
  display: none; flex-direction: column;
  height: calc(100vh - var(--nav-h));
}
#pg-chat.active { display: flex; }

.chat-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  flex-shrink: 0;
}
.chat-topbar-back {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text2); flex-shrink: 0; transition: all .2s;
}
.chat-topbar-back:hover { border-color: var(--blue); color: var(--blue); }
.chat-topbar-info { flex: 1; }
.chat-topbar-title { font-size: 15px; font-weight: 700; }
.chat-topbar-status { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--green); font-weight: 500; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1}50%{opacity:.3} }
.chat-topbar-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.chat-topbar-btn:hover { background: var(--blue2); }

.msgs {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 14px;
  background: var(--bg);
}

/* Suggestion chips */
.suggestion-list { display: flex; flex-direction: column; gap: 10px; padding: 8px 0; }
.suggestion-chip {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px 16px;
  font-size: 14px; color: var(--text); text-align: left;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: all .2s; cursor: pointer; line-height: 1.4;
}
.suggestion-chip:hover { border-color: var(--blue); background: rgba(59,130,246,0.04); }

/* Messages */
.msg { display: flex; gap: 10px; animation: msgIn .25s ease; }
@keyframes msgIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
.msg-av {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--blue), var(--green));
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff; font-weight: 700;
}
.msg-body { max-width: 85%; }

.bubble {
  padding: 14px 16px; border-radius: 18px 18px 18px 4px;
  background: #e8f5f0; border: 1px solid #c3e6d8;
  font-size: 14px; line-height: 1.75; color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.bubble strong { color: #1e40af; }
.bubble a { color: var(--blue); text-decoration: underline; }

.user-msg { flex-direction: row-reverse; }
.user-msg .bubble {
  background: #f1f5f9; border: 1px solid #e2e8f0;
  border-radius: 18px 18px 4px 18px; color: var(--text);
}
.user-msg .msg-av { background: #cbd5e1; color: var(--text2); font-size: 14px; }
.mtime { font-size: 11px; color: var(--text3); margin-top: 4px; padding: 0 4px; }
.user-msg .mtime { text-align: right; }

.const-box {
  margin-top: 10px; padding: 12px 14px; border-radius: 12px;
  background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.25);
}
.const-box h4 { font-size: 12px; font-weight: 700; color: var(--green); margin-bottom: 8px; }
.const-item {
  display: flex; align-items: center; gap: 8px; padding: 4px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.const-item:last-child { border-bottom: none; }
.const-mod {
  padding: 2px 8px; border-radius: 6px;
  background: rgba(16,185,129,0.15); color: var(--green);
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.const-bob { font-size: 12px; color: var(--text3); }

.lawyer-rec-box {
  margin-top: 10px; padding: 12px 14px; border-radius: 12px;
  background: rgba(59,130,246,0.06); border: 1px solid rgba(59,130,246,0.2);
}
.lawyer-rec-box h4 { font-size: 12px; font-weight: 700; color: var(--blue); margin-bottom: 8px; }
.mini-law {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: 10px; background: var(--card);
  margin-bottom: 6px; cursor: pointer; transition: all .2s;
  border: 1px solid var(--border);
}
.mini-law:hover { border-color: var(--blue); }
.mini-av { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg,var(--blue),var(--green)); display: flex; align-items: center; justify-content: center; font-size: 16px; color:#fff; font-weight:700; }
.mini-info { flex: 1; }
.mini-info strong { display: block; font-size: 13px; }
.mini-info span { font-size: 11px; color: var(--text3); }
.mini-rat { font-size: 12px; color: #f59e0b; }
.see-all-btn {
  width: 100%; padding: 8px; border-radius: 8px; margin-top: 4px;
  background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.25);
  color: var(--blue); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all .2s;
}
.see-all-btn:hover { background: rgba(59,130,246,0.2); }

.ai-disclaimer {
  margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.25);
  font-size: 12px; font-weight: 600; color: var(--red); line-height: 1.5;
}

.typing .bubble { padding: 14px 18px; }
.dots { display: flex; gap: 5px; }
.dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--text3); animation: bounce .9s infinite; }
.dots span:nth-child(2) { animation-delay: .15s; }
.dots span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%,100%{transform:translateY(0)}50%{transform:translateY(-5px)} }

.fab-lawyer {
  position: fixed; right: 16px; bottom: calc(var(--nav-h) + 16px);
  background: var(--green); color: #fff;
  padding: 12px 18px; border-radius: 100px;
  font-size: 14px; font-weight: 700;
  display: none; align-items: center; gap: 8px;
  box-shadow: 0 4px 16px rgba(16,185,129,0.4);
  z-index: 50; transition: all .2s;
}
.fab-lawyer:hover { background: var(--green2); transform: translateY(-2px); }
#pg-chat.active ~ .fab-lawyer { display: flex; }

.chat-input-wrap {
  padding: 12px 16px; background: var(--card);
  border-top: 1px solid var(--border); flex-shrink: 0;
}
.chat-input-box {
  display: flex; align-items: flex-end; gap: 8px;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 100px; padding: 8px 8px 8px 16px;
  transition: border-color .2s;
}
.chat-input-box:focus-within { border-color: var(--blue); background: #fff; }
.chat-input-box textarea {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 14px; resize: none;
  max-height: 100px; line-height: 1.5; padding: 4px 0;
}
.chat-input-box textarea::placeholder { color: var(--text3); }
.voice-icon-btn {
  background: none; border: none; font-size: 18px;
  padding: 4px; color: var(--text2); flex-shrink: 0; cursor: pointer;
}
#sendBtn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s; flex-shrink: 0;
}
#sendBtn:hover { background: var(--blue2); }
#sendBtn svg { stroke: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  padding: 6px 14px; border-radius: 100px;
  border: 1.5px solid var(--border); background: var(--card);
  color: var(--blue); font-size: 13px; cursor: pointer; transition: all .2s;
}
.chip:hover { background: rgba(59,130,246,0.1); border-color: var(--blue); }

/* ===== PAGE TOPBAR ===== */
.page-topbar {
  background: var(--card); border-bottom: 1px solid var(--border);
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.page-topbar-title { font-size: 17px; font-weight: 700; color: var(--text); }
.page-topbar-sub { font-size: 12px; color: var(--text3); margin-top: 2px; }
.page-content { padding: 16px; }

/* ===== DOCUMENT GENERATOR ===== */
.doc-intro-card {
  background: linear-gradient(135deg, #ede9fe, #dbeafe);
  border: 1px solid #c4b5fd; border-radius: 16px;
  padding: 24px; text-align: center; margin-bottom: 20px;
}
.doc-intro-icon { font-size: 44px; margin-bottom: 10px; }
.doc-intro-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.doc-intro-card p { font-size: 13px; color: var(--text2); line-height: 1.6; }

.doc-templates-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.doc-template-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px 14px;
  text-align: center; cursor: pointer; transition: all .25s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.doc-template-card:hover { border-color: var(--purple); box-shadow: 0 6px 20px rgba(139,92,246,0.15); transform: translateY(-2px); }
.doc-template-card .doc-t-icon { font-size: 32px; margin-bottom: 8px; }
.doc-template-card .doc-t-name { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.doc-template-card .doc-t-desc { font-size: 11px; color: var(--text3); line-height: 1.4; }

.doc-form-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px;
}
.doc-back-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text2); flex-shrink: 0; cursor: pointer; transition: all .2s;
}
.doc-back-btn:hover { border-color: var(--blue); color: var(--blue); }
.doc-form-title { font-size: 16px; font-weight: 700; }

.doc-field-group { margin-bottom: 14px; }
.doc-field-group label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text2); margin-bottom: 5px;
}
.doc-field-input {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  background: var(--bg); border: 1.5px solid var(--border);
  color: var(--text); font-size: 14px; transition: border-color .2s;
}
.doc-field-input:focus { outline: none; border-color: var(--purple); background: #fff; }
.doc-field-input::placeholder { color: var(--text3); }

.doc-action-btns { display: flex; gap: 10px; margin-top: 24px; }
.doc-preview-btn {
  flex: 1; padding: 13px; border-radius: 12px;
  background: var(--bg); border: 1.5px solid var(--border);
  color: var(--text); font-size: 14px; font-weight: 700;
  transition: all .2s;
}
.doc-preview-btn:hover { border-color: var(--purple); }
.doc-pdf-btn {
  flex: 1; padding: 13px; border-radius: 12px;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: #fff; font-size: 14px; font-weight: 700;
  transition: all .2s; box-shadow: 0 4px 14px rgba(139,92,246,0.3);
}
.doc-pdf-btn:hover { box-shadow: 0 6px 20px rgba(139,92,246,0.45); transform: translateY(-1px); }

.doc-preview-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
}
.doc-preview-box {
  background: #fff; border: 2px solid var(--border);
  border-radius: 12px; padding: 24px;
  font-size: 13px; line-height: 1.8; color: var(--text);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  white-space: pre-wrap;
  font-family: 'Courier New', monospace;
}
.doc-preview-box h2 { font-family: var(--font); font-size: 16px; text-align: center; margin-bottom: 16px; border-bottom: 2px solid var(--border); padding-bottom: 12px; }
.doc-preview-box .doc-field-line { margin: 8px 0; }
.doc-preview-box .doc-footer { margin-top: 24px; font-size: 11px; color: var(--text3); text-align: center; border-top: 1px solid var(--border); padding-top: 12px; }

/* ===== LAWYERS PAGE ===== */
.lawyer-filter-wrap { padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--border); }
.lawyer-search {
  width: 100%; padding: 10px 14px; border-radius: 12px;
  background: var(--bg); border: 1px solid var(--border);
  font-size: 14px; color: var(--text); margin-bottom: 10px;
}
.lawyer-search:focus { outline: none; border-color: var(--blue); }
.lawyer-filter-row { display: flex; gap: 10px; }
.lawyer-select {
  flex: 1; padding: 8px 10px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--border);
  font-size: 13px; color: var(--text);
}
.lawyer-select:focus { outline: none; border-color: var(--blue); }

.lawyers-list { display: flex; flex-direction: column; gap: 12px; }
.lcard {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  cursor: pointer; transition: all .25s;
}
.lcard:hover { border-color: var(--blue); box-shadow: 0 4px 16px rgba(59,130,246,0.12); }
.lcard-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.lav-circle {
  width: 50px; height: 50px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--green));
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: #fff; flex-shrink: 0;
}
.linf { flex: 1; }
.lname { font-size: 15px; font-weight: 700; color: var(--text); }
.lspec { font-size: 13px; color: var(--blue); font-weight: 500; margin-top: 1px; }
.lstats-row { font-size: 12px; color: var(--text3); margin-top: 2px; }
.lbosh-badge {
  padding: 3px 10px; border-radius: 100px;
  background: #e6f7f2; border: 1px solid #bce6db;
  font-size: 11px; font-weight: 700; color: var(--green); flex-shrink: 0;
}
.lcard-btns { display: flex; gap: 8px; }
.lb-call {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px; border-radius: 10px;
  background: var(--blue); color: #fff;
  font-size: 13px; font-weight: 700; transition: all .2s;
}
.lb-call:hover { background: var(--blue2); }
.lb-video {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px; border-radius: 10px;
  background: var(--green); color: #fff;
  font-size: 13px; font-weight: 700; transition: all .2s;
}
.lb-video:hover { background: var(--green2); }

/* ===== HISTORY PAGE ===== */
.history-full-list { display: flex; flex-direction: column; gap: 12px; }
.hist-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); overflow: hidden; transition: all .2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.hist-card:hover { border-color: var(--blue); }
.hist-card-top { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.hist-q-icon { font-size: 18px; flex-shrink: 0; }
.hist-q-text { flex: 1; font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.4; }
.hist-date { font-size: 11px; color: var(--text3); white-space: nowrap; flex-shrink: 0; }
.hist-answer { padding: 12px 16px; font-size: 13px; color: var(--text2); line-height: 1.7; max-height: 120px; overflow: hidden; position: relative; }
.hist-answer::after { content:''; position:absolute; bottom:0; left:0; right:0; height:40px; background:linear-gradient(transparent,var(--card)); }
.hist-repeat-btn {
  display: block; margin: 0 16px 14px; padding: 8px;
  border-radius: 8px; background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.2); color: var(--blue);
  font-size: 13px; font-weight: 600; text-align: center;
  cursor: pointer; transition: all .2s;
}
.hist-repeat-btn:hover { background: rgba(59,130,246,0.15); }
.no-hist-big { text-align:center; padding:60px 20px; color:var(--text3); }
.no-hist-big h3 { font-size:20px; font-weight:700; margin-bottom:8px; color:var(--text2); }
.no-hist-big p { font-size:14px; margin-bottom:20px; }
.hist-chat-btn { padding:12px 28px; border-radius:100px; background:var(--blue); color:#fff; font-size:14px; font-weight:700; transition:all .2s; }
.hist-chat-btn:hover { background:var(--blue2); }

/* ===== PROFILE PAGE ===== */
.profile-header {
  background: linear-gradient(135deg, #1d4ed8, #059669);
  padding: 32px 20px; text-align: center;
}
.profile-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: rgba(255,255,255,0.25); border: 3px solid rgba(255,255,255,0.6);
  margin: 0 auto 12px; display: flex; align-items: center; justify-content: center;
  font-size: 36px; color: #fff;
}
.profile-name { font-size: 20px; font-weight: 800; color: #fff; margin-bottom: 4px; }
.profile-phone { font-size: 13px; color: rgba(255,255,255,0.8); }
.profile-actions { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.profile-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--r);
  font-size: 14px; color: var(--text); font-weight: 500;
  cursor: pointer; transition: all .2s; text-align: left;
}
.profile-btn:hover { border-color: var(--blue); background: rgba(59,130,246,0.04); }
.profile-btn-danger { color: var(--red); border-color: rgba(239,68,68,0.25); }
.profile-btn-danger:hover { border-color: var(--red); background: rgba(239,68,68,0.05); }
.profile-btn-admin { color: var(--purple); border-color: rgba(139,92,246,0.25); }
.profile-btn-admin:hover { border-color: var(--purple); background: rgba(139,92,246,0.05); }

/* Auth form */
.auth-wrap { padding: 40px 20px; max-width: 400px; margin: 0 auto; }
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo-icon { font-size: 48px; margin-bottom: 8px; }
.auth-logo h2 { font-size: 22px; font-weight: 800; }
.auth-logo p { font-size: 13px; color: var(--text2); margin-top: 4px; }
.auth-tabs {
  display: flex; gap: 4px; margin-bottom: 24px;
  background: var(--bg); border-radius: 12px; padding: 4px;
}
.atab { flex: 1; padding: 10px; border-radius: 9px; background: none; color: var(--text2); font-size: 14px; font-weight: 600; transition: all .2s; }
.atab.active { background: var(--blue); color: #fff; }
.fgroup { margin-bottom: 14px; }
.fgroup label { display: block; font-size: 13px; font-weight: 600; color: var(--text2); margin-bottom: 5px; }
.finput {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  background: var(--bg); border: 1.5px solid var(--border);
  color: var(--text); font-size: 14px; transition: border-color .2s;
}
.finput:focus { outline: none; border-color: var(--blue); background: #fff; }
.ferr { color: var(--red); font-size: 13px; margin-bottom: 10px; min-height: 16px; }
.fsubmit {
  width: 100%; padding: 14px; border-radius: 12px; background: var(--blue);
  color: #fff; font-size: 15px; font-weight: 700; transition: all .2s; margin-bottom: 10px;
}
.fsubmit:hover { background: var(--blue2); }
.auth-hint { text-align:center; margin-top:12px; font-size:13px; color:var(--text2); }
.auth-hint a { color: var(--blue); cursor: pointer; font-weight: 600; }
.resend-btn {
  width:100%; padding:11px; border-radius:10px; background:none;
  border:1.5px solid var(--border); color:var(--text2); font-size:13px;
}
.resend-btn:hover { border-color:var(--blue); color:var(--text); }

/* OTP */
.otp-row { display:flex; gap:8px; justify-content:center; margin:16px 0 8px; }
.otp-inp {
  width:44px; height:52px; text-align:center; border-radius:10px;
  background:var(--bg); border:1.5px solid var(--border);
  color:var(--text); font-size:20px; font-weight:700;
}
.otp-inp:focus { outline:none; border-color:var(--blue); background:#fff; }
.otp-hint { text-align:center; font-size:12px; color:var(--text3); margin-bottom:14px; }

/* ===== ADMIN PANEL ===== */
.admin-topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, #1e293b, #334155);
  padding: 16px;
}
.admin-topbar-left { display: flex; align-items: center; }
.admin-topbar-title { font-size: 17px; font-weight: 800; color: #fff; }
.admin-topbar-sub { font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 2px; }
.admin-badge {
  padding: 5px 12px; border-radius: 100px;
  background: rgba(139,92,246,0.25); border: 1px solid rgba(139,92,246,0.4);
  font-size: 12px; font-weight: 700; color: #c4b5fd;
}

.admin-tabs {
  display: flex; background: var(--card); border-bottom: 1px solid var(--border);
  padding: 0 16px;
  overflow-x: auto; gap: 0;
}
.admin-tab {
  padding: 14px 16px; background: none; color: var(--text3);
  font-size: 13px; font-weight: 600; border-bottom: 2px solid transparent;
  transition: all .2s; white-space: nowrap;
}
.admin-tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.admin-tab:hover { color: var(--text); }

.admin-tab-content { padding: 16px; }
.admin-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.admin-section-title { font-size: 15px; font-weight: 700; }
.admin-add-btn {
  padding: 8px 16px; border-radius: 10px;
  background: var(--blue); color: #fff;
  font-size: 13px; font-weight: 700; transition: all .2s;
}
.admin-add-btn:hover { background: var(--blue2); }

.admin-lawyers-list { display: flex; flex-direction: column; gap: 10px; }
.admin-lawyer-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.admin-lawyer-av {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--green));
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; color: #fff; flex-shrink: 0;
}
.admin-lawyer-info { flex: 1; }
.admin-lawyer-name { font-size: 14px; font-weight: 700; }
.admin-lawyer-meta { font-size: 12px; color: var(--text3); margin-top: 2px; }
.admin-delete-btn {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2);
  color: var(--red); font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.admin-delete-btn:hover { background: rgba(239,68,68,0.2); }

.admin-kb-list { display: flex; flex-direction: column; gap: 10px; }
.admin-kb-row {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.admin-kb-q { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.admin-kb-a { font-size: 13px; color: var(--text2); line-height: 1.6; }
.admin-kb-src { font-size: 11px; color: var(--blue); margin-top: 6px; }
.admin-kb-actions { display: flex; gap: 6px; margin-top: 10px; }
.admin-kb-del {
  padding: 5px 12px; border-radius: 8px;
  background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2);
  color: var(--red); font-size: 12px; font-weight: 600;
  transition: all .2s;
}
.admin-kb-del:hover { background: rgba(239,68,68,0.18); }
.admin-kb-cat-badge {
  padding: 3px 10px; border-radius: 100px;
  background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.2);
  font-size: 11px; font-weight: 700; color: var(--blue);
}

/* Admin Stats */
.admin-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.admin-stat-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04); text-align: center;
}
.admin-stat-icon { font-size: 28px; margin-bottom: 8px; }
.admin-stat-val { font-size: 28px; font-weight: 800; color: var(--blue); }
.admin-stat-lbl { font-size: 12px; color: var(--text3); margin-top: 3px; }

/* ===== MODALS ===== */
.overlay {
  position:fixed; inset:0; z-index:200;
  background:rgba(0,0,0,0.5); backdrop-filter:blur(4px);
  display:none; align-items:flex-end; justify-content:center; padding:0;
}
.overlay.open { display:flex; animation:fadeIn .2s; }
@keyframes fadeIn { from{opacity:0}to{opacity:1} }
.modal {
  background:var(--card); border-radius:24px 24px 0 0;
  padding:28px 24px; width:100%; max-width:520px;
  position:relative; max-height:90vh; overflow-y:auto;
  animation:slideUp .25s ease;
}
@keyframes slideUp { from{transform:translateY(48px);opacity:0}to{transform:translateY(0);opacity:1} }
.modal-x {
  position:absolute; top:14px; right:14px;
  width:30px; height:30px; border-radius:50%;
  background:var(--bg); border:1px solid var(--border);
  color:var(--text2); font-size:14px; display:flex; align-items:center; justify-content:center;
}

/* Lawyer Modal */
.lm-head { display:flex; gap:14px; align-items:center; margin-bottom:16px; }
.lm-av-c { width:56px; height:56px; border-radius:50%; background:linear-gradient(135deg,var(--blue),var(--green)); display:flex; align-items:center; justify-content:center; font-size:24px; font-weight:800; color:#fff; }
.lm-name { font-size:18px; font-weight:800; }
.lm-spec { color:var(--blue); font-size:13px; font-weight:500; margin-top:3px; }
.lm-stats { display:flex; gap:10px; margin-bottom:16px; }
.lm-stat { flex:1; text-align:center; padding:10px; border-radius:10px; background:var(--bg); border:1px solid var(--border); }
.lm-stat .v { font-size:16px; font-weight:800; color:var(--text); }
.lm-stat .l { font-size:11px; color:var(--text3); margin-top:2px; }
.lm-about { font-size:14px; color:var(--text2); line-height:1.7; margin-bottom:16px; }
.lm-btns { display:flex; gap:10px; }
.lm-btn { flex:1; padding:12px; border-radius:10px; font-size:14px; font-weight:700; transition:all .2s; cursor:pointer; border:none; }
.lm-call { background:var(--blue); color:#fff; }
.lm-call:hover { background:var(--blue2); }
.lm-video { background:var(--green); color:#fff; }
.lm-video:hover { background:var(--green2); }

/* ===== TOAST ===== */
.toast {
  position:fixed; bottom:calc(var(--nav-h) + 16px); left:50%; transform:translateX(-50%);
  background:#1e293b; color:#fff; padding:12px 22px; border-radius:100px;
  font-size:14px; z-index:9999; opacity:0; transition:opacity .3s;
  pointer-events:none; white-space:nowrap; max-width:90vw; text-align:center;
  box-shadow:0 4px 16px rgba(0,0,0,0.25);
}
.toast.show { opacity:1; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width:4px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:var(--border); border-radius:4px; }

/* ===== RESPONSIVE ===== */
@media (min-width: 640px) {
  .home-cats-grid { grid-template-columns: repeat(4, 1fr); }
  .bottom-nav { max-width: 480px; left: 50%; transform: translateX(-50%); border-radius: 20px 20px 0 0; }
  .modal { border-radius: 24px; margin: auto; }
  .overlay { align-items: center; padding: 20px; }
}

/* ===== ROLE SELECTOR ===== */
.role-selector {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px;
}
.role-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 10px; border-radius: 12px;
  background: var(--bg); border: 2px solid var(--border);
  color: var(--text2); font-size: 13px; font-weight: 600;
  transition: all .2s; cursor: pointer;
}
.role-btn .role-icon { font-size: 26px; }
.role-btn small { font-size: 10px; color: var(--text3); font-weight: 400; text-align: center; line-height: 1.3; }
.role-btn.active {
  border-color: var(--blue); background: rgba(59,130,246,0.08); color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.role-btn.active small { color: rgba(59,130,246,0.7); }

/* ===== PROFILE ROLE BADGE ===== */
.profile-role-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 14px; border-radius: 100px; margin: 6px auto 2px;
  background: rgba(255,255,255,0.25); border: 1px solid rgba(255,255,255,0.5);
  font-size: 12px; font-weight: 700; color: #fff;
}
.user-badge { background: rgba(16,185,129,0.3); border-color: rgba(16,185,129,0.5); }

/* ===== LEX.UZ LINK STYLE ===== */
.bubble a[href*="lex.uz"] {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.25);
  border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 600;
  color: var(--blue); text-decoration: none;
}
.bubble a[href*="lex.uz"]::before { content: "📖 "; }

/* ===== VERIFIED BADGE ===== */
.verified-badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 100px;
  background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.3);
  font-size: 10px; font-weight: 700; color: var(--green);
  margin-left: 6px;
}
.pending-badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 100px;
  background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.3);
  font-size: 10px; font-weight: 700; color: #d97706;
  margin-left: 6px;
}

/* ===== NEWS / BANNER CARD ===== */
.news-banner {
  margin: 12px 16px 0;
  background: linear-gradient(135deg, #1d4ed8 0%, #7c3aed 100%);
  border-radius: 16px; padding: 16px 18px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 4px 18px rgba(29,78,216,0.25);
  cursor: pointer; transition: all .2s;
}
.news-banner:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(29,78,216,0.35); }
.news-banner-icon { font-size: 32px; flex-shrink: 0; }
.news-banner-content { flex: 1; }
.news-banner-title { font-size: 14px; font-weight: 800; color: #fff; margin-bottom: 3px; }
.news-banner-sub { font-size: 12px; color: rgba(255,255,255,0.8); }
.news-banner-arrow { color: rgba(255,255,255,0.7); font-size: 18px; flex-shrink: 0; }

/* ===== PREMIUM CARD ===== */
.premium-card {
  margin: 12px 16px;
  background: linear-gradient(135deg, #f59e0b 0%, #dc2626 100%);
  border-radius: 16px; padding: 18px;
  box-shadow: 0 4px 18px rgba(245,158,11,0.3);
}
.premium-card-title { font-size: 16px; font-weight: 800; color: #fff; margin-bottom: 4px; }
.premium-card-sub { font-size: 13px; color: rgba(255,255,255,0.85); margin-bottom: 14px; line-height: 1.4; }
.premium-card-btn {
  display: inline-block; background: #fff; color: #dc2626;
  padding: 9px 20px; border-radius: 100px;
  font-size: 13px; font-weight: 800; cursor: pointer;
  transition: all .2s; border: none;
}
.premium-card-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

/* ===== ANIMATED COUNTER ===== */
@keyframes countUp { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }
.hstat-v { animation: countUp 0.6s ease both; }

/* ===== NOTIFICATION DOT on nav ===== */
.bn-item { position: relative; }
.nav-notif {
  position: absolute; top: 6px; right: 18px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); border: 2px solid var(--card);
}

/* ===== CHAT SCROLL TO BOTTOM ===== */
.scroll-to-bottom {
  position: absolute; right: 16px; bottom: calc(var(--nav-h) + 70px);
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--card); border: 1.5px solid var(--border);
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; cursor: pointer; z-index: 40;
  opacity: 0; transition: opacity .2s;
}
.scroll-to-bottom.visible { opacity: 1; }

/* ===== COPY BUTTON ===== */
.copy-btn {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 8px; padding: 5px 12px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--border);
  font-size: 11px; font-weight: 600; color: var(--text2);
  cursor: pointer; transition: all .2s;
}
.copy-btn:hover { border-color: var(--blue); color: var(--blue); }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text3);
}
.empty-state-icon { font-size: 56px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--text2); margin-bottom: 8px; }
.empty-state p { font-size: 14px; margin-bottom: 20px; line-height: 1.5; }

/* ===== LAWYER STATUS STYLES ===== */
.lbosh-badge.offline {
  background: #fef2f2; border: 1px solid #fecaca;
  color: var(--red);
}
.lbosh-badge.busy {
  background: #fffbeb; border: 1px solid #fde68a;
  color: #d97706;
}

/* ===== SEARCH HIGHLIGHT ===== */
.search-highlight { background: rgba(59,130,246,0.15); border-radius: 3px; padding: 0 2px; }

/* ===== INFO BANNER ===== */
.info-banner {
  margin: 12px 16px;
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 14px; padding: 14px 16px;
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 13px; color: var(--text2); line-height: 1.5;
}
.info-banner-icon { font-size: 20px; flex-shrink: 0; }

/* ===== SETTINGS ITEM ===== */
.settings-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; background: var(--card);
  border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .2s;
}
.settings-item:first-child { border-radius: var(--r) var(--r) 0 0; }
.settings-item:last-child { border-radius: 0 0 var(--r) var(--r); border-bottom: none; }
.settings-item:hover { background: var(--bg); }
.settings-item-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.settings-item-text { flex: 1; }
.settings-item-label { font-size: 14px; font-weight: 600; color: var(--text); }
.settings-item-sub { font-size: 12px; color: var(--text3); margin-top: 1px; }
.settings-item-arrow { color: var(--text3); font-size: 16px; }

/* ===== ONBOARDING / FEATURE HIGHLIGHT ===== */
.feature-row {
  display: flex; gap: 12px; padding: 4px 16px 0;
  overflow-x: auto; scrollbar-width: none;
}
.feature-row::-webkit-scrollbar { display: none; }
.feature-chip {
  flex-shrink: 0; display: flex; align-items: center; gap: 6px;
  background: var(--card); border: 1px solid var(--border);
  padding: 8px 14px; border-radius: 100px;
  font-size: 12px; font-weight: 600; color: var(--text2);
  white-space: nowrap;
}
.feature-chip-icon { font-size: 14px; }
