/* ── Base ────────────────────────────────────────────────────────────── */
html { height: 100%; }

body {
  min-height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f0eb;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 24px;
}

/* ── App shell ───────────────────────────────────────────────────────── */
#shell {
  width: 100%;
  max-width: 1280px;
  display: flex;
  height: calc(100dvh - 40px);
  overflow: hidden;
  border-radius: 8px;
  box-shadow: var(--shadow-shell);
}

/* ── Chat panel ──────────────────────────────────────────────────────── */
#chat-panel {
  flex: 65;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  min-width: 0;
}

/* ── Top nav ─────────────────────────────────────────────────────────── */
#chat-nav {
  display: flex;
  align-items: center;
  padding: 0 var(--gap-lg) 0 20px;
  height: var(--nav-h);
  border-bottom: none;
  flex-shrink: 0;
  gap: var(--gap-md);
  background: linear-gradient(135deg, #374151 0%, #6b7280 100%);
  box-shadow: 0 2px 12px rgba(0,0,0,.2);
}

.brand-mark {
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.brand-copy strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.2px;
}
.brand-copy small {
  display: block;
  font-size: 11.5px;
  color: rgba(255,255,255,.65);
  line-height: 1.2;
}
.brand-copy small::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #4ade80;
  margin-right: 5px;
  vertical-align: middle;
  box-shadow: 0 0 0 2px rgba(74,222,128,.25);
}

/* WhatsApp toggle — visible only on tablet/mobile via responsive.css */
#wa-toggle {
  display: none;
  width: 42px; height: 42px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: var(--brand-dark);
  cursor: pointer;
  align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  transition: background .13s;
}
#wa-toggle:hover { background: var(--brand-mid); }

/* ── Messages feed ───────────────────────────────────────────────────── */
#messages {
  flex: 1;
  overflow-y: auto;
  padding: 22px var(--gap-xl) 12px;
  background-color: #edf0f7;
  background-image: radial-gradient(circle at 1px 1px, rgba(99,117,160,.28) 1px, transparent 0);
  background-size: 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

/* ── Upload hint bar ─────────────────────────────────────────────────── */
#upload-hint {
  display: none;
  padding: var(--gap-sm) var(--gap-xl);
  font-size: 12.5px;
  color: #4338ca;
  background: #eef2ff;
  border-top: 1px solid #c7d2fe;
  flex-shrink: 0;
}

/* ── Input bar ───────────────────────────────────────────────────────── */
#input-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: var(--gap-md) var(--gap-lg);
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  box-shadow: 0 -2px 12px rgba(0,0,0,.05);
}

.ibtn {
  width: 42px; height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  color: var(--muted);
  transition: background .13s, border-color .13s, transform .1s;
  flex-shrink: 0;
}
.ibtn:not(:disabled):hover  { background: #f1f5f9; border-color: #94a3b8; }
.ibtn:not(:disabled):active { transform: scale(.94); }
.ibtn:disabled              { opacity: .38; cursor: not-allowed; }
#send-btn                   { background: var(--brand); border-color: var(--brand); color: #fff; }
#send-btn:not(:disabled):hover { background: #4338ca; border-color: #4338ca; }

#msg-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 14.5px;
  font-family: inherit;
  color: var(--text);
  resize: none;
  outline: none;
  min-height: 42px;
  max-height: 120px;
  background: #f8fafc;
  line-height: 1.45;
  transition: border-color .15s, background .15s;
}
#msg-input:focus        { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
#msg-input::placeholder { color: #94a3b8; }
#file-input             { display: none; }

/* ── Custom scrollbar ───────────────────────────────────────────────── */
#messages::-webkit-scrollbar        { width: 5px; }
#messages::-webkit-scrollbar-track  { background: transparent; }
#messages::-webkit-scrollbar-thumb  { background: #b8c4da; border-radius: 10px; }
#messages::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
