*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}

.hidden { display: none !important; }

.screen { height: 100vh; }

/* Login */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: var(--surface);
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  width: 100%;
  max-width: 400px;
}

.login-card h1 {
  text-align: center;
  margin-bottom: 8px;
  font-size: 24px;
}

.login-version {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.45;
}

.form-group textarea {
  min-height: 96px;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.error { color: var(--danger); font-size: 13px; margin-top: 12px; text-align: center; }

/* Buttons */
.btn {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12px; background: var(--border); }

/* Admin Layout */
#admin-screen {
  display: flex;
}

.sidebar {
  width: 360px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  overflow: hidden;
}

.sidebar-brand {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.brand-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-text strong {
  font-size: 15px;
  letter-spacing: -0.02em;
}

.brand-text span {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-icon {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-icon svg {
  width: 16px;
  height: 16px;
}

.btn-icon:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: var(--danger);
}

.sidebar-nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

.nav-btn {
  padding: 6px 4px;
  border: none;
  background: none;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 48px;
  transition: background 0.15s, color 0.15s;
}

.nav-btn .nav-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-label {
  line-height: 1;
  letter-spacing: 0.01em;
}

.nav-btn.active {
  background: var(--surface);
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.nav-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
}

.nav-btn.active .nav-icon, .nav-btn:hover .nav-icon {
  opacity: 1;
}

.sidebar-alt {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  text-align: center;
  color: var(--text-muted);
}

.sidebar-alt.hidden {
  display: none;
}

.sidebar-alt-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  color: #94a3b8;
}

.sidebar-alt-icon svg {
  width: 24px;
  height: 24px;
}

.sidebar-alt p {
  font-size: 13px;
  line-height: 1.5;
  max-width: 200px;
}

.sidebar-inbox {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: #fafbfc;
}

.sidebar-inbox.hidden {
  display: none;
}

.inbox-toolbar {
  padding: 10px 10px 8px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.inbox-search-wrap {
  position: relative;
  margin-bottom: 8px;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.inbox-search {
  width: 100%;
  padding: 8px 10px 8px 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  background: var(--bg);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.inbox-search:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.stats-row {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 1px;
}

.stats-row::-webkit-scrollbar { display: none; }

.stat-chip {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 8px;
  padding: 5px 8px;
  cursor: pointer;
  text-align: center;
  min-width: 52px;
  flex-shrink: 0;
  transition: border-color 0.12s, background 0.12s;
}

.stat-chip:hover {
  background: var(--surface);
}

.stat-chip.active {
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2);
}

.stat-chip.all.active { border-color: var(--text-muted); box-shadow: 0 0 0 1px rgba(100, 116, 139, 0.2); }
.stat-chip.ai.active { border-color: #3b82f6; box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2); }
.stat-chip.pending.active { border-color: #f59e0b; box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.2); }
.stat-chip.human.active { border-color: #22c55e; box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.2); }
.stat-chip.closed.active { border-color: #94a3b8; box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.25); }

.stat-chip.pending.has-alert:not(.active) {
  border-color: #fbbf24;
  animation: stat-pulse 2s ease-in-out infinite;
}

.stat-chip .stat-value {
  display: block;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.stat-chip.all .stat-value { color: var(--text); }
.stat-chip.ai .stat-value { color: #2563eb; }
.stat-chip.pending .stat-value { color: #d97706; }
.stat-chip.human .stat-value { color: #16a34a; }
.stat-chip.closed .stat-value { color: #64748b; }

.stat-chip .stat-label {
  display: block;
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 1px;
}

.stat-chip.pending.has-alert:not(.active) {
  border-color: #fbbf24;
  animation: stat-pulse 2s ease-in-out infinite;
}

@keyframes stat-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.3); }
  50% { box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12); }
}

.inbox-search::placeholder {
  color: #94a3b8;
}

.conversation-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.empty-list {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
}

.empty-list-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
}

.empty-list-icon svg {
  width: 20px;
  height: 20px;
}

.conversation-list-header {
  padding: 6px 12px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: #f1f5f9;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.clear-filter {
  border: none;
  background: none;
  color: var(--primary);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  padding: 2px 0;
}

.clear-filter:hover { text-decoration: underline; }
.clear-filter.hidden { display: none; }

.conv-item {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  border-left: 3px solid transparent;
  background: var(--surface);
}

.conv-item:hover { background: #f8fafc; }

.conv-item.active {
  background: #eff6ff;
  border-left-color: var(--primary);
}

.conv-item.human_pending { border-left-color: #f59e0b; }
.conv-item.human_pending.active { border-left-color: var(--primary); }
.conv-item.human_active:not(.active) { border-left-color: #22c55e; }
.conv-item.ai_active:not(.active) { border-left-color: #3b82f6; }

.conv-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}

.conv-item.active .conv-avatar {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
}

.conv-body {
  flex: 1;
  min-width: 0;
}

.conv-row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}

.conv-name {
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-time {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.conv-item-preview {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.conv-item.active .conv-item-preview {
  color: #475569;
}

.conv-row-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  min-width: 0;
}

.conv-page {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.badge.ai_active { background: #dbeafe; color: #1d4ed8; }
.badge.human_pending { background: #fef3c7; color: #b45309; }
.badge.human_active { background: #dcfce7; color: #15803d; }
.badge.closed { background: #f1f5f9; color: #64748b; }

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.empty-state {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: linear-gradient(180deg, #f8fafc 0%, var(--bg) 100%);
}

.empty-state-card {
  text-align: center;
  max-width: 320px;
}

.empty-state-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.empty-state-icon svg {
  width: 32px;
  height: 32px;
}

.empty-state-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text);
}

.empty-state-card p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
}

.conversation-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

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

.conv-header-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.conv-header-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  color: #475569;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}

.conv-header-text {
  min-width: 0;
}

.conv-header-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.conv-header-top h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-header-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

.conv-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn-compact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 13px;
}

.btn-compact svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.visitor-panel {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.visitor-panel.hidden {
  display: none;
}

.visitor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  padding: 14px 24px;
}

.visitor-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 0;
}

.visitor-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.visitor-card-icon svg {
  width: 16px;
  height: 16px;
}

.visitor-card-body {
  min-width: 0;
}

.visitor-card-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.visitor-card-value {
  font-size: 13px;
  color: var(--text);
  word-break: break-word;
  line-height: 1.4;
}

.message-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  scroll-behavior: smooth;
}

.msg-date-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 12px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.msg-date-divider::before,
.msg-date-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.msg-date-divider span {
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.msg-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  max-width: 85%;
  margin-bottom: 8px;
  animation: msg-in 0.2s ease;
}

@keyframes msg-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg-row.visitor,
.msg-row.ai {
  align-self: flex-start;
}

.msg-row.operator,
.msg-row.note {
  align-self: flex-end;
  flex-direction: row-reverse;
  margin-left: auto;
}

.msg-row.system {
  align-self: center;
  max-width: 92%;
  margin-left: auto;
  margin-right: auto;
  justify-content: center;
}

.msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  color: #475569;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}

.msg-avatar.ai { background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; }
.msg-avatar.operator { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; }

.msg-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.55;
  word-wrap: break-word;
  min-width: 0;
}

.msg-bubble.visitor {
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.msg-bubble.ai {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-bottom-left-radius: 4px;
}

.msg-bubble.operator {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.msg-bubble.system {
  background: var(--surface);
  border: 1px dashed var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
  text-align: center;
  border-radius: 12px;
  padding: 8px 14px;
}

.msg-bubble.note {
  background: #fef3c7;
  border: 1px dashed #f59e0b;
  color: #92400e;
  border-bottom-right-radius: 4px;
}

.msg-sender {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
  opacity: 0.75;
}

.msg-bubble.operator .msg-sender,
.msg-bubble.operator .msg-time { opacity: 0.85; }

.msg-text {
  white-space: pre-wrap;
}

.msg-time {
  font-size: 10px;
  opacity: 0.55;
  margin-top: 6px;
  text-align: right;
}

.msg-bubble.system .msg-time { display: none; }

.quick-replies {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.qr-btn {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.qr-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #eff6ff;
}

.reply-area {
  padding: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.reply-area.is-closed {
  opacity: 0.65;
}

.reply-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 24px 0;
}

.reply-tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: var(--bg);
  border-radius: 10px;
}

.reply-tab {
  padding: 6px 14px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}

.reply-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.reply-hint {
  font-size: 11px;
  color: #94a3b8;
}

.conv-quick-replies {
  padding: 10px 24px 0;
}

.reply-compose {
  padding: 12px 24px 16px;
}

.reply-input-wrap {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  padding: 8px 8px 8px 16px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.reply-input-wrap:focus-within {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

#reply-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 0;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  outline: none;
  max-height: 140px;
  line-height: 1.45;
}

#reply-input:disabled {
  cursor: not-allowed;
}

.btn-send {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.12s, opacity 0.12s;
}

.btn-send svg {
  width: 18px;
  height: 18px;
}

.btn-send:hover:not(:disabled) {
  transform: scale(1.05);
}

.btn-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.reply-closed-notice {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: center;
}

.reply-closed-notice.hidden {
  display: none;
}

#login-form .btn-primary { width: 100%; margin-top: 8px; }

.panel-view, .settings-view {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  background: var(--surface);
}

.panel-header h2, .settings-header h2 {
  font-size: 22px;
  margin-bottom: 4px;
}

.panel-subtitle, .settings-subtitle, .section-desc {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
}

.panel-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

.panel-form .form-group textarea,
.panel-form .form-group select,
.panel-form .form-group input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}

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

.color-input-row input[type="color"] {
  width: 44px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  cursor: pointer;
}

.color-input-row input[type="text"] { flex: 1; }

.widget-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.widget-page-header .panel-subtitle { margin-bottom: 0; }

.widget-header-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.widget-page-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 28px;
  align-items: start;
}

.widget-form-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.widget-form-stack .settings-section { margin-bottom: 16px; }

.icon-upload-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.icon-upload-row input[type="file"] {
  flex: 1;
  min-width: 180px;
  font-size: 13px;
}

.icon-preview {
  margin-top: 10px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.icon-preview img,
.preview-custom-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.checkbox-row { margin-bottom: 12px; }

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.color-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-preset {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--border);
  cursor: pointer;
  transition: transform 0.15s;
}

.color-preset:hover { transform: scale(1.1); }
.color-preset.active { box-shadow: 0 0 0 2px var(--primary); }

.position-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.position-option { cursor: pointer; }
.position-option input { display: none; }

.position-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  background: var(--surface);
  transition: border-color 0.15s, background 0.15s;
}

.position-option input:checked + .position-card {
  border-color: var(--primary);
  background: #eff6ff;
  color: var(--primary);
}

.position-dot {
  width: 64px;
  height: 40px;
  border: 2px dashed var(--border);
  border-radius: 6px;
  position: relative;
  background: var(--bg);
}

.position-dot::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
}

.position-dot.br::after { right: 4px; }
.position-dot.bl::after { left: 4px; }

.embed-advanced {
  margin-top: 16px;
}

.embed-advanced label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
}

.embed-advanced input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--bg);
  color: var(--text-muted);
}

.widget-preview-sticky {
  position: sticky;
  top: 24px;
}

.preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.preview-toolbar strong { font-size: 14px; }
.preview-hint { font-size: 12px; color: var(--text-muted); }

.widget-preview {
  position: relative;
  background: linear-gradient(160deg, #e2e8f0 0%, #f8fafc 50%, #e2e8f0 100%);
  border-radius: 16px;
  height: 520px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.widget-preview.position-left .preview-toggle { left: 20px; right: auto; }
.widget-preview.position-left .preview-panel { left: 20px; right: auto; }

.preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.08);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}

.widget-preview.open-preview .preview-backdrop { opacity: 1; }

.preview-panel {
  position: absolute;
  bottom: 84px;
  right: 20px;
  width: 300px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.15);
  overflow: hidden;
  transform: translateY(16px) scale(0.95);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  display: flex;
  flex-direction: column;
}

.widget-preview.open-preview .preview-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.preview-header {
  padding: 16px 18px;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.preview-header-text strong { display: block; font-size: 15px; margin-bottom: 2px; }

.preview-header-text span {
  font-size: 11px;
  opacity: 0.92;
  display: flex;
  align-items: center;
  gap: 5px;
}

.preview-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  display: inline-block;
}

.preview-close {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
}

.preview-body {
  padding: 14px;
  flex: 1;
  min-height: 280px;
  max-height: 320px;
  overflow-y: auto;
  background: #f8fafc;
}

.preview-welcome-block {
  text-align: center;
  padding: 12px 8px 16px;
}

.preview-welcome-icon { font-size: 28px; margin-bottom: 8px; }

.preview-welcome-block p {
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
  margin: 0 auto 12px;
  max-width: 240px;
}

.preview-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.preview-prompt-chip {
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 11px;
  color: var(--text);
  cursor: default;
}

.preview-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.preview-msg-row {
  display: flex;
  gap: 6px;
  align-items: flex-end;
}

.preview-msg-row.visitor { justify-content: flex-end; }

.preview-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.preview-bubble {
  max-width: 78%;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.45;
}

.preview-bubble.visitor {
  background: #2563eb;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.preview-bubble.ai {
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  border-bottom-left-radius: 4px;
}

.preview-input-bar {
  padding: 10px 12px 14px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #94a3b8;
}

.preview-send-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.preview-toggle {
  position: absolute;
  bottom: 20px;
  right: 20px;
  min-width: 52px;
  height: 52px;
  padding: 0 16px;
  border-radius: 26px;
  border: none;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s;
}

.preview-toggle.icon-only {
  width: 52px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
}

.preview-toggle:hover { transform: translateY(-2px); }

.preview-toggle-icon { font-size: 18px; line-height: 1; }

.code-block {
  display: flex;
  gap: 8px;
  align-items: center;
  background: #1e293b;
  border-radius: 8px;
  padding: 12px 14px;
}

.code-block code {
  flex: 1;
  font-size: 12px;
  color: #e2e8f0;
  word-break: break-all;
  font-family: ui-monospace, monospace;
}

@media (max-width: 1100px) {
  .widget-page-layout { grid-template-columns: 1fr; }
  .widget-preview-sticky { position: static; }
  .widget-page-header { flex-direction: column; }
  .qr-page-layout { grid-template-columns: 1fr; }
  .qr-form-panel { position: static; }
}

.qr-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.qr-page-header .panel-subtitle { margin-bottom: 0; }

.qr-page-header .panel-subtitle code {
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

.qr-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.qr-count-badge {
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 500;
}

.qr-page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 20px;
  align-items: start;
}

.qr-list-panel {
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  min-height: 420px;
  display: flex;
  flex-direction: column;
}

.qr-list-toolbar {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.qr-search-wrap {
  position: relative;
}

.qr-search-wrap .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.qr-search-wrap .inbox-search {
  padding-left: 32px;
}

.qr-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
  overflow-y: auto;
  max-height: calc(100vh - 220px);
}

.qr-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.qr-item:last-child { border-bottom: none; }

.qr-item:hover { background: #f8fafc; }

.qr-item.active {
  background: #eff6ff;
  border-left: 3px solid var(--primary);
  padding-left: 13px;
}

.qr-item-main {
  flex: 1;
  min-width: 0;
}

.qr-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.qr-item-shortcut {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  flex-shrink: 0;
}

.qr-item-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.qr-item-content {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  word-break: break-word;
}

.qr-item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
}

.qr-item:hover .qr-item-actions,
.qr-item.active .qr-item-actions {
  opacity: 1;
}

.qr-icon-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.qr-icon-btn svg {
  width: 15px;
  height: 15px;
}

.qr-icon-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #eff6ff;
}

.qr-icon-btn.danger:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: #fef2f2;
}

.qr-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}

.qr-empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
}

.qr-empty-icon svg {
  width: 24px;
  height: 24px;
}

.qr-empty h4 {
  font-size: 15px;
  color: var(--text);
  margin-bottom: 6px;
}

.qr-empty p {
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 16px;
}

.qr-form-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  position: sticky;
  top: 0;
  min-width: 0;
  width: 100%;
}

.qr-form {
  width: 100%;
  min-width: 0;
}

.qr-form-head h3 {
  font-size: 16px;
  margin-bottom: 6px;
}

.qr-form-head .section-desc {
  margin-bottom: 16px;
}

.qr-io-section {
  margin-top: 24px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}

.qr-io-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.qr-io-head h3 {
  font-size: 16px;
  margin-bottom: 4px;
}

.qr-io-head .section-desc {
  margin-bottom: 0;
}

.qr-io-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.qr-io-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.qr-io-row input[type="file"] {
  flex: 1;
  min-width: 180px;
  font-size: 13px;
}

.qr-io-row select {
  min-width: 240px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--surface);
}

.qr-io-import .field-hint {
  display: block;
  margin-top: 8px;
}

.qr-io-import .field-hint code {
  background: var(--surface);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}

.qr-io-import .test-result {
  display: block;
  margin-top: 10px;
}

.qr-shortcut-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.qr-shortcut-input:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.qr-shortcut-prefix {
  padding: 10px 0 10px 12px;
  color: var(--primary);
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
}

.qr-shortcut-input input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 12px 10px 4px;
  font-size: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  outline: none;
}

.qr-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.qr-live-preview {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.qr-live-preview-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.qr-preview-compose {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.qr-preview-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
}

.qr-preview-tabs span {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.qr-preview-tabs span.active {
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
}

.qr-preview-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  min-height: 0;
}

.qr-preview-chips:empty { display: none; }

.qr-preview-chips .qr-chip-demo {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.qr-preview-chips .qr-chip-demo.current {
  border-color: var(--primary);
  background: #eff6ff;
}

.qr-preview-input {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
}

.qr-preview-shortcut {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  color: var(--primary);
}

.qr-preview-arrow {
  color: #94a3b8;
  font-size: 12px;
}

.qr-preview-message {
  color: var(--text);
  white-space: pre-wrap;
}

.settings-header h2 {
  font-size: 22px;
  margin-bottom: 4px;
}

.settings-subtitle, .section-desc {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
}

.settings-section {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.settings-section h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.settings-form .form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--surface);
}

.form-row.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.form-actions, .settings-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.test-result {
  font-size: 13px;
  color: var(--text-muted);
}

.test-result.success { color: var(--success); }
.test-result.error { color: var(--danger); }

@media (max-width: 1024px) {
  .panel-grid, .qr-page-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    max-width: 360px;
    position: absolute;
    z-index: 10;
    height: 100%;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
  }
  .main-content { margin-left: 0; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .conv-header {
    flex-direction: column;
    align-items: stretch;
  }
  .conv-actions { justify-content: flex-start; }
  .reply-toolbar { flex-direction: column; align-items: flex-start; }
  .reply-hint { display: none; }
  .msg-row { max-width: 95%; }
}

.users-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.users-page-header .panel-subtitle { margin-bottom: 0; }

.users-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.users-page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 20px;
  align-items: start;
}

.users-list-panel {
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  min-height: 420px;
  display: flex;
  flex-direction: column;
}

.users-list-toolbar {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.users-list {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  max-height: calc(100vh - 220px);
}

.user-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.user-item:last-child { border-bottom: none; }

.user-item:hover { background: #f8fafc; }

.user-item.active {
  background: #eff6ff;
  border-left: 3px solid var(--primary);
  padding-left: 13px;
}

.user-item-main {
  flex: 1;
  min-width: 0;
}

.user-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.user-item-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.user-item-email {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-item-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.user-role-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.user-role-badge.admin {
  background: #fef3c7;
  color: #b45309;
}

.user-role-badge.operator {
  background: #e0f2fe;
  color: #0369a1;
}

.user-item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.users-form-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  position: sticky;
  top: 0;
}

.users-form-head {
  margin-bottom: 16px;
}

.users-form-head h3 {
  font-size: 16px;
  margin-bottom: 4px;
}

.users-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}

.users-empty h4 {
  color: var(--text);
  margin: 12px 0 6px;
  font-size: 15px;
}

@media (max-width: 1100px) {
  .users-page-layout { grid-template-columns: 1fr; }
  .users-form-panel { position: static; }
  .users-page-header { flex-direction: column; }
}
