/* ═══════════════════════════════════════
   UNIMATCH — style.css
   Design v3 — Light/warm with teal-blue accent
   ═══════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600&display=swap');

/* ── RESET & BASE ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --accent-start: #3EC6A0;
  --accent-end: #2AACE0;
  --accent-grad: linear-gradient(135deg, #3EC6A0, #2AACE0);
  --bg-app: #F7F6F2;
  --bg-panel: #ffffff;
  --bg-surface: #F2F4F8;
  --bg-card: #ffffff;
  --border: rgba(0, 0, 0, 0.07);
  --border-md: rgba(0, 0, 0, 0.11);
  --text-primary: #111111;
  --text-secondary: #555555;
  --text-muted: #999999;
  --text-light: #bbbbbb;
  --green-bg: #EDFAF4;
  --green-border: #A3E6C8;
  --green-text: #1A7A4E;
  --purple-bg: #F0EEFF;
  --purple-border: #C4B8FF;
  --purple-text: #6B4FBB;
  --match-green: #10B981;
  --match-orange: #F59E0B;
  --match-red: #EF4444;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 999px;
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.07);
  --shadow-card-hover: 0 8px 30px rgba(0, 0, 0, 0.11);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  background: var(--bg-app);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

/* ── APP WRAPPER ── */
.app-wrapper {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── HEADER ── */
.header {
  height: 56px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  flex-shrink: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  display: none;
}

.logo-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.logo-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.4px;
  line-height: 1;
  display: flex;
  align-items: center;
}

.logo-title::after {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-grad);
  margin-left: 2px;
  margin-bottom: 2px;
  flex-shrink: 0;
}

.logo-tagline {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Header auth buttons — injected by JS */
.header-btn {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 15px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  line-height: 1;
}

.btn-ghost {
  background: var(--bg-panel);
  border: 1px solid var(--border-md);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  border-color: rgba(0, 0, 0, 0.2);
  color: var(--text-primary);
}

.btn-primary {
  background: var(--accent-grad);
  border: none;
  color: #ffffff;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.avatar-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-grad);
  border: none;
  color: #ffffff;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.avatar-btn:hover {
  transform: scale(1.05);
}

/* ── LAYOUT ── */
.layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: calc(100vh - 56px);
}

/* ── LEFT PANEL — CHAT ── */
.panel-left {
  width: 38%;
  min-width: 280px;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  position: relative;
}

/* ── CHAT MESSAGES ── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: none;
}

.chat-messages::-webkit-scrollbar {
  display: none;
}

/* Message wrappers */
.message-wrapper {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ai-wrapper {
  align-items: flex-start;
  flex-direction: row;
  gap: 8px;
}

.ai-wrapper .message-bubble,
.ai-wrapper .message-time {
  max-width: calc(100% - 36px);
}

.user-wrapper {
  align-items: flex-end;
}

/* Avatars */
.message-avatar {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Bubbles */
.message-bubble {
  padding: 9px 12px;
  font-size: 13px;
  line-height: 1.55;
  max-width: 88%;
  word-break: break-word;
}

.ai-bubble {
  background: var(--bg-surface);
  border-radius: 4px 12px 12px 12px;
  color: var(--text-primary);
}

.user-bubble {
  background: var(--accent-grad);
  border-radius: 12px 4px 12px 12px;
  color: #ffffff;
  align-self: flex-end;
}

.message-time {
  font-size: 10px;
  color: var(--text-light);
  padding: 0 2px;
}

/* Typing indicator */
.typing-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 13px;
  min-width: 52px;
}

.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #bbbbbb;
  animation: dotBounce 1.4s infinite;
  flex-shrink: 0;
}

.dot:nth-child(2) { animation-delay: 0.15s; }
.dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes dotBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-5px); }
}

/* Account banner */
.account-banner {
  background: linear-gradient(135deg, rgba(62,198,160,0.06), rgba(42,172,224,0.06));
  border: 1px solid rgba(62, 198, 160, 0.2);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.btn-banner-signup {
  background: var(--accent-grad);
  border: none;
  color: #ffffff;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
}

.btn-banner-dismiss {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 11px;
  cursor: pointer;
  padding: 4px 8px;
}

/* ── FILTER TAGS BAR ── */
.filter-tags-bar {
  padding: 7px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.filter-tag {
  background: rgba(62, 198, 160, 0.08);
  border: 1px solid rgba(62, 198, 160, 0.25);
  color: #1A8A70;
  border-radius: var(--radius-full);
  padding: 3px 9px;
  font-size: 10.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font);
}

.tag-remove {
  background: none;
  border: none;
  color: inherit;
  opacity: 0.55;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
}

.tag-remove:hover {
  opacity: 1;
}

/* ── INPUT AREA ── */
.input-area {
  padding: 8px 12px 13px;
  border-top: 1px solid var(--border);
  background: var(--bg-panel);
  flex-shrink: 0;
}

.filters-btn {
  width: 100%;
  background: var(--bg-surface);
  border: none;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-bottom: 7px;
  transition: var(--transition);
}

.filters-btn:hover {
  background: #E8EAF0;
  color: var(--text-primary);
}

.filter-count {
  background: var(--accent-grad);
  color: #ffffff;
  border-radius: var(--radius-full);
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
}

.input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  padding: 9px 16px;
  font-family: var(--font);
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
  min-height: 38px;
  resize: none;
}

.chat-input::placeholder {
  color: var(--text-light);
}

.chat-input:focus {
  border-color: rgba(62, 198, 160, 0.4);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(62, 198, 160, 0.08);
}

.send-btn {
  width: 36px;
  height: 36px;
  background: var(--accent-grad);
  border: none;
  border-radius: 50%;
  color: #ffffff;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
  line-height: 1;
}

.send-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(42, 172, 224, 0.35);
}

.send-btn:active {
  transform: scale(0.96);
}

/* ── FILTER DRAWER ── */
.filter-drawer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-panel);
  z-index: 50;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.drawer-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.drawer-close {
  background: var(--bg-surface);
  border: none;
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.drawer-close:hover {
  background: #E8EAF0;
  color: var(--text-primary);
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.1) transparent;
}

.filter-section {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.filter-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Chips */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-md);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  font-size: 12px;
  font-family: var(--font);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  line-height: 1;
}

.chip:hover {
  border-color: rgba(62, 198, 160, 0.4);
  color: #1A8A70;
  background: rgba(62, 198, 160, 0.05);
}

.chip.active {
  background: linear-gradient(135deg, rgba(62,198,160,0.15), rgba(42,172,224,0.15));
  border-color: rgba(62, 198, 160, 0.45);
  color: #1A8A70;
}

/* Quick filter chips in right panel */
.chip-quick {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-size: 11px;
  font-family: var(--font);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.chip-quick:hover {
  background: linear-gradient(135deg, rgba(62,198,160,0.1), rgba(42,172,224,0.1));
  border-color: rgba(62, 198, 160, 0.35);
  color: #1A8A70;
}

/* Country search */
.country-search {
  background: var(--bg-surface);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-full);
  padding: 7px 13px;
  font-family: var(--font);
  font-size: 12px;
  color: var(--text-primary);
  outline: none;
  width: 100%;
  transition: var(--transition);
}

.country-search:focus {
  border-color: rgba(62, 198, 160, 0.4);
  box-shadow: 0 0 0 3px rgba(62, 198, 160, 0.08);
}

.country-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 80px;
  overflow-y: auto;
}

.chip-country {
  background: var(--bg-surface);
  border: 1px solid var(--border-md);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  padding: 3px 10px;
  font-size: 11px;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition);
}

.chip-country:hover {
  background: rgba(62, 198, 160, 0.08);
  border-color: rgba(62, 198, 160, 0.3);
  color: #1A8A70;
}

.selected-countries {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.country-tag {
  background: rgba(62, 198, 160, 0.08);
  border: 1px solid rgba(62, 198, 160, 0.25);
  color: #1A8A70;
  border-radius: var(--radius-full);
  padding: 3px 9px;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* Tuition slider */
.tuition-slider {
  width: 100%;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, #3EC6A0, #2AACE0);
  outline: none;
  cursor: pointer;
}

.tuition-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #3EC6A0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  cursor: pointer;
}

.tuition-value {
  font-size: 12px;
  font-weight: 600;
  color: #1A8A70;
  text-align: center;
}

/* Toggle button */
.toggle-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-family: var(--font);
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  transition: var(--transition);
}

.toggle-btn.active {
  background: rgba(62, 198, 160, 0.08);
  border-color: rgba(62, 198, 160, 0.35);
  color: #1A8A70;
}

.toggle-check {
  font-size: 15px;
  line-height: 1;
}

/* Drawer footer */
.drawer-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn {
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  border: none;
  line-height: 1;
}

.btn-secondary {
  background: var(--bg-surface);
  border: 1px solid var(--border-md);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background: #E8EAF0;
  color: var(--text-primary);
}

.btn-full {
  width: 100%;
  padding: 10px;
  font-size: 13px;
}

/* ── RIGHT PANEL ── */
.panel-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-app);
  height: 100%;
  overflow: hidden;
}

/* Panel header */
.panel-header {
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
  flex-shrink: 0;
}

.panel-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.panel-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.quick-filters {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

/* Empty state */
.results-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 8px;
  padding: 40px;
  text-align: center;
  opacity: 0.45;
  margin-top: 60px;
}

.empty-icon {
  font-size: 40px;
  line-height: 1;
}

.empty-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}

.empty-text {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Skeleton loader */
.skeleton-container {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton-card {
  height: 180px;
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg,
    rgba(0,0,0,0.04) 25%,
    rgba(0,0,0,0.08) 50%,
    rgba(0,0,0,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Results container */
.results-container {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.1) transparent;
}

/* Results divider */
.results-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider-text {
  font-size: 10.5px;
  color: var(--text-light);
  white-space: nowrap;
}

/* ── UNIVERSITY CARDS ── */
.result-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: visible;
  transition: var(--transition);
  animation: cardIn 0.35s ease both;
}

.result-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Card media strip */
.card-media {
  display: flex;
  min-height: 72px;
  position: relative;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}

.card-image-block {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  overflow: hidden;
}

.card-city-img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  display: block;
}

.card-initials {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.card-banner {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 42px 8px 12px;
  background: var(--bg-panel);
}

.card-banner-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-banner-loc {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.match-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-panel);
}

.match-score {
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.match-label {
  font-size: 7.5px;
  opacity: 0.65;
}

/* Card body */
.card-body {
  padding: 10px 13px 12px;
}

/* Badges */
.card-badges {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.badge {
  border-radius: var(--radius-full);
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.badge-green {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  color: var(--green-text);
}

.badge-purple {
  background: var(--purple-bg);
  border: 1px solid var(--purple-border);
  color: var(--purple-text);
}

/* Info grid */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-bottom: 8px;
}

.info-item {
  background: var(--bg-app);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
}

.info-label {
  font-size: 8.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 2px;
}

.info-value {
  font-size: 11.5px;
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Website link */
.website-link-row {
  margin-bottom: 7px;
}

.website-link {
  font-size: 11px;
  color: #2AACE0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.website-link:hover {
  text-decoration: underline;
}

/* Description */
.card-description {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 9px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card buttons */
.card-buttons {
  display: flex;
  gap: 6px;
}

.card-btn {
  flex: 1;
  padding: 7px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-family: var(--font);
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  line-height: 1;
}

.card-btn-primary {
  background: var(--text-primary);
  color: #ffffff;
  border: none;
}

.card-btn-primary:hover {
  background: #2a2a2a;
  transform: translateY(-1px);
}

.card-btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-md);
}

.card-btn-secondary:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: rgba(0,0,0,0.18);
}

/* Expanded card */
.card-expanded {
  border-top: 1px solid var(--border);
  padding: 12px 13px;
  background: var(--bg-app);
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.card-expanded p {
  margin: 0;
}

.card-expanded strong {
  color: var(--text-primary);
  font-weight: 600;
}

.btn-ask {
  width: 100%;
  background: var(--accent-grad);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-full);
  padding: 8px 12px;
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-ask:hover {
  opacity: 0.9;
}

.btn-ghost-sm {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 11px;
  cursor: pointer;
  padding: 4px 0;
  text-align: center;
  width: 100%;
}

.btn-ghost-sm:hover {
  color: var(--text-secondary);
}

/* ── AUTH MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal {
  background: var(--bg-panel);
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 28px;
  width: 380px;
  max-width: calc(100vw - 32px);
  position: relative;
  animation: modalIn 0.2s ease;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(-8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--bg-surface);
  border: none;
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  background: #E8EAF0;
}

.modal-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.modal-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px 10px;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: -1px;
}

.modal-tab.active {
  color: var(--text-primary);
  border-bottom-color: #3EC6A0;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-input {
  background: var(--bg-surface);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-family: var(--font);
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
  width: 100%;
}

.auth-input:focus {
  border-color: rgba(62, 198, 160, 0.5);
  box-shadow: 0 0 0 3px rgba(62, 198, 160, 0.1);
}

.auth-error {
  font-size: 12px;
  color: #EF4444;
  min-height: 16px;
}

.auth-note {
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
  padding: 8px;
  background: var(--bg-app);
  border-radius: var(--radius-sm);
}

/* ── PROFILE DROPDOWN ── */
.profile-dropdown {
  position: fixed;
  top: 60px;
  right: 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 8px;
  min-width: 180px;
  z-index: 150;
  box-shadow: var(--shadow-card-hover);
  animation: modalIn 0.15s ease;
}

.dropdown-greeting {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 6px 10px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.dropdown-item {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 12.5px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: var(--transition);
  display: block;
}

.dropdown-item:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

/* ── TOAST ── */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 15px;
  font-size: 12.5px;
  color: var(--text-primary);
  min-width: 240px;
  box-shadow: var(--shadow-card-hover);
  animation: toastIn 0.3s ease;
  transition: opacity 0.3s, transform 0.3s;
}

.toast-success { border-left: 3px solid var(--match-green); }
.toast-error   { border-left: 3px solid var(--match-red); }
.toast-info    { border-left: 3px solid #2AACE0; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(60px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .layout {
    flex-direction: column;
    height: auto;
    overflow: auto;
  }

  .panel-left {
    width: 100%;
    max-width: 100%;
    height: 55vh;
    min-width: unset;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .panel-right {
    height: 45vh;
  }

  .quick-filters {
    display: none;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 0 14px;
  }

  .logo-tagline {
    display: none;
  }

  .modal {
    width: calc(100vw - 24px);
    padding: 20px;
  }
}
