/* ===================================
   Outlook 快速取件 - 纯白蓝 macOS 玻璃风
   =================================== */

/* --- CSS 变量 --- */
:root {
  /* 白蓝色系 */
  --bg-base: #e8edf5;
  --bg-gradient-1: #dce4f2;
  --bg-gradient-2: #e2eaf8;

  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-bg-hover: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.65);
  --glass-border-hover: rgba(255, 255, 255, 0.85);
  --glass-shadow: rgba(100, 120, 180, 0.08);

  --accent: #2563eb;
  --accent-light: #3b82f6;
  --accent-lighter: #93c5fd;
  --accent-bg: rgba(37, 99, 235, 0.08);
  --accent-glow: rgba(37, 99, 235, 0.2);

  --accent-2: #0ea5e9;
  --accent-2-glow: rgba(14, 165, 233, 0.15);

  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --imap-color: #e11d48;
  --imap-bg: rgba(225, 29, 72, 0.08);
  --graph-color: #059669;
  --graph-bg: rgba(5, 150, 105, 0.08);

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.08);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.08);
  --error: #ef4444;
  --error-bg: rgba(239, 68, 68, 0.08);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
  --shadow-md: 0 4px 16px rgba(100, 120, 180, 0.1), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 32px rgba(100, 120, 180, 0.15), 0 2px 8px rgba(0,0,0,0.05);

  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* --- 动态背景 --- */
.bg-animation {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(135deg, #e0e7ff 0%, #dbeafe 25%, #e0f2fe 50%, #ede9fe 75%, #e8edf5 100%);
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.6;
  animation: orbFloat 25s ease-in-out infinite;
}

.bg-orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(147, 197, 253, 0.5), transparent 70%);
  top: -15%; left: -10%;
}

.bg-orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(196, 181, 253, 0.4), transparent 70%);
  top: 40%; right: -10%;
  animation-delay: -8s;
}

.bg-orb-3 {
  width: 450px; height: 450px;
  background: radial-gradient(circle, rgba(165, 218, 255, 0.45), transparent 70%);
  bottom: -10%; left: 25%;
  animation-delay: -16s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(40px, -30px) scale(1.05); }
  50% { transform: translate(-25px, 25px) scale(0.95); }
  75% { transform: translate(20px, 40px) scale(1.03); }
}

/* --- 玻璃面板 --- */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(1.4);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

/* --- 容器 --- */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* --- 顶部栏 --- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(28px) saturate(1.4);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

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

.app-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.app-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.app-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 1px;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--success-bg);
  border: 1px solid rgba(16, 185, 129, 0.15);
  font-size: 0.78rem;
  color: var(--success);
  font-weight: 500;
}

.status-badge.loading {
  background: var(--warning-bg);
  border-color: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.status-badge.error {
  background: var(--error-bg);
  border-color: rgba(239, 68, 68, 0.15);
  color: var(--error);
}

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* --- 主布局 --- */
.main-layout {
  display: flex;
  gap: 14px;
  flex: 1;
  min-height: 0;
}

/* --- 左侧面板 --- */
.sidebar {
  width: 280px;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 12px;
  max-height: calc(100vh - 110px);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title {
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

.panel-title svg { opacity: 0.5; }

.badge {
  background: var(--accent-bg);
  color: var(--accent);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-imap {
  background: var(--imap-bg);
  color: var(--imap-color);
}

.badge-graph {
  background: var(--graph-bg);
  color: var(--graph-color);
}

/* --- 按钮 --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  outline: none;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

.btn-accent {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: white;
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.25);
}

.btn-accent:hover {
  box-shadow: 0 4px 18px rgba(14, 165, 233, 0.35);
  transform: translateY(-1px);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.5);
  color: var(--text-secondary);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.8);
  color: var(--text-primary);
}

.btn-full { width: 100%; }
.btn-small { padding: 6px 12px; font-size: 0.75rem; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* --- 邮箱列表 --- */
.account-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-right: 4px;
}

.account-list::-webkit-scrollbar { width: 4px; }
.account-list::-webkit-scrollbar-track { background: transparent; }
.account-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.08);
  border-radius: 4px;
}

.account-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
}

.account-item:hover {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(0, 0, 0, 0.04);
}

.account-item.selected {
  background: rgba(37, 99, 235, 0.06);
  border-color: rgba(37, 99, 235, 0.15);
}

.account-checkbox {
  appearance: none;
  width: 16px; height: 16px;
  border: 1.5px solid var(--text-muted);
  border-radius: 5px;
  cursor: pointer;
  transition: var(--transition-fast);
  flex-shrink: 0;
  position: relative;
  background: white;
}

.account-checkbox:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.account-checkbox:checked::after {
  content: '';
  position: absolute;
  top: 2px; left: 5px;
  width: 4px; height: 8px;
  border: solid white;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

.account-email {
  font-size: 0.8rem;
  color: var(--text-primary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-delete {
  opacity: 0;
  background: none;
  border: none;
  color: var(--error);
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.account-item:hover .account-delete { opacity: 0.5; }
.account-delete:hover {
  opacity: 1 !important;
  background: var(--error-bg);
}

/* --- 空状态 --- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-muted);
  gap: 6px;
  text-align: center;
}

.empty-state svg { opacity: 0.15; margin-bottom: 6px; }
.empty-state p { font-size: 0.82rem; }
.text-muted { color: var(--text-muted); font-size: 0.75rem; }

.sidebar-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding-top: 12px;
}

/* --- 右侧内容 --- */
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

/* --- 搜索区 --- */
.control-panel {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.control-actions { justify-content: space-between; }
.flex-grow { flex: 1; }

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 1;
}

.input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.82rem;
  outline: none;
  transition: var(--transition-fast);
}

.input:focus {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
  background: rgba(255, 255, 255, 0.9);
}

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

.select {
  padding-left: 14px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  cursor: pointer;
}

.input-narrow { width: 110px; min-width: 110px; }

/* --- 协议开关 --- */
.protocol-toggles {
  display: flex;
  gap: 8px;
}

.toggle-label { cursor: pointer; }
.toggle-label input { display: none; }

.toggle-pill {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(0, 0, 0, 0.06);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.5);
  transition: var(--transition-fast);
}

.toggle-label input:checked + .toggle-pill {
  border-color: rgba(37, 99, 235, 0.25);
  color: var(--accent);
  background: rgba(37, 99, 235, 0.06);
}

.action-buttons { display: flex; gap: 8px; }

/* --- 进度条 --- */
.progress-bar-container {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
  animation: fadeInUp 0.3s ease;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  margin-bottom: 10px;
  color: var(--text-secondary);
  font-weight: 500;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 6px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
  border-radius: 6px;
  transition: width 0.4s ease;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 1.5s infinite;
}

/* --- 结果区 --- */
.results-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px;
}

.results-title {
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

.results-meta { display: flex; gap: 8px; }

/* --- 邮件列表 --- */
.email-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.email-list::-webkit-scrollbar { width: 5px; }
.email-list::-webkit-scrollbar-track { background: transparent; }
.email-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.06);
  border-radius: 4px;
}

.email-card {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: var(--transition);
  animation: fadeInUp 0.35s ease forwards;
  opacity: 0;
  box-shadow: var(--shadow-sm);
}

.email-card:hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.email-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.email-from {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.email-protocol {
  font-size: 0.62rem;
  padding: 1px 7px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.email-protocol.imap {
  background: var(--imap-bg);
  color: var(--imap-color);
}

.email-protocol.graph {
  background: var(--graph-bg);
  color: var(--graph-color);
}

.email-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.email-subject {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-preview {
  font-size: 0.78rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-account-tag {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* --- 弹窗 --- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(148, 163, 184, 0.3);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal {
  width: 90%;
  max-width: 560px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(32px) saturate(1.5);
  -webkit-backdrop-filter: blur(32px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-large {
  max-width: 760px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
  transition: var(--transition-fast);
  border-radius: 6px;
}

.btn-close:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.04);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
}

.modal-tip {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.modal-tip code {
  background: rgba(37, 99, 235, 0.06);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.75rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.textarea {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text-primary);
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.8rem;
  resize: vertical;
  outline: none;
  transition: var(--transition-fast);
  margin-top: 10px;
  line-height: 1.7;
}

.textarea:focus {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: white;
}

.textarea::placeholder { color: var(--text-muted); }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

/* --- 邮件详情 --- */
.email-detail-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 16px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.04);
  margin-bottom: 14px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.email-detail-meta span { display: flex; gap: 8px; }
.email-detail-meta .meta-label {
  color: var(--text-muted);
  min-width: 50px;
}

.email-detail-body {
  padding: 14px;
  border-radius: 8px;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.04);
  font-size: 0.82rem;
  line-height: 1.7;
  max-height: 50vh;
  overflow-y: auto;
  word-break: break-word;
}

.email-detail-body img {
  max-width: 100%;
  border-radius: 8px;
}

.email-detail-body a { color: var(--accent); }

/* --- Toast --- */
.toast-container {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-md);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 380px;
  color: var(--text-primary);
}

.toast.toast-exit { animation: toastOut 0.25s ease forwards; }

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--error); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info { border-left: 3px solid var(--accent); }

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

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

/* --- 骨架屏 --- */
.skeleton {
  background: linear-gradient(90deg, rgba(0,0,0,0.02) 25%, rgba(0,0,0,0.05) 50%, rgba(0,0,0,0.02) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

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

.skeleton-card {
  height: 80px;
  margin-bottom: 8px;
  border-radius: var(--radius-md);
}

/* --- 全选 --- */
.select-all-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --- 响应式 --- */
@media (max-width: 900px) {
  .main-layout { flex-direction: column; }
  .sidebar { width: 100%; min-width: unset; max-height: 300px; }
  .control-row { flex-wrap: wrap; }
  .input-narrow { width: 100%; min-width: unset; }
}

@media (max-width: 600px) {
  .app-container { padding: 10px; }
  .app-header { padding: 12px 16px; }
  .control-actions { flex-direction: column; gap: 10px; }
  .action-buttons { width: 100%; }
  .action-buttons .btn { flex: 1; }
}
