@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Noto+Sans+SC:wght@400;500;600;700&display=swap');

/* ========== DESIGN TOKENS ========== */
:root {
  --bg: #09090b;
  --bg-card: #18181b;
  --bg-elevated: #27272a;
  --bg-input: #0f0f12;
  --border: #27272a;
  --border-hover: #3f3f46;
  --text: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --primary: #4285F4;
  --primary-hover: #5a9cf5;
  --primary-muted: rgba(66, 133, 244, 0.12);
  --success: #34A853;
  --success-muted: rgba(52, 168, 83, 0.12);
  --warning: #FBBC05;
  --warning-muted: rgba(251, 188, 5, 0.12);
  --danger: #EA4335;
  --danger-muted: rgba(234, 67, 53, 0.12);
  --font: 'Inter', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --mono: 'SF Mono', 'Consolas', 'Courier New', monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --transition: 150ms ease;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  line-height: 1.6;
  background-color: var(--bg);
  background-image: radial-gradient(rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 15% 50%, rgba(66, 133, 244, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 20%, rgba(52, 168, 83, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

ul, ol {
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ========== NAVBAR ========== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 56px;
  border-bottom: 1px solid var(--border);
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-inner {
  max-width: 1080px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-brand img {
  width: 28px;
  height: 28px;
}

.nav-brand span {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 100%;
}

.nav-tab {
  position: relative;
  height: 100%;
  padding: 0 14px;
  display: flex;
  align-items: center;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--transition);
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--text-secondary);
}

.nav-tab.active {
  color: var(--text);
}

.nav-tab.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 14px;
  right: 14px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px 2px 0 0;
}

.nav-link {
  height: 100%;
  padding: 0 14px;
  display: flex;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition);
}

.nav-link:hover {
  color: var(--text-secondary);
  text-decoration: none;
}

/* ========== MAIN LAYOUT ========== */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 32px 80px;
}

/* ========== SPLIT LAYOUT (two-column) ========== */
.split-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}

.split-main {
  min-width: 0;
}

.split-side {
  position: sticky;
  top: 76px;
}

/* ========== TAB PANELS ========== */
.tab-panel {
  display: none;
  animation: fadeIn 0.25s ease;
}

.tab-panel.active {
  display: block;
}

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

/* ========== PAGE HEADER ========== */
.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.2;
}

.page-header p {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ========== CARDS ========== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  transition: border-color var(--transition);
}

.card:hover {
  border-color: var(--border-hover);
}

.card-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ========== FORMS ========== */
.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-label .req {
  color: var(--danger);
  margin-left: 2px;
}

.form-input, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

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

.form-input:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-muted);
}

.form-textarea {
  min-height: 140px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.7;
}

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

.form-group:last-child {
  margin-bottom: 0;
}

.field-note {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ========== SEGMENT CONTROL ========== */
.segment-control {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.segment-btn {
  padding: 7px 16px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.segment-btn.active {
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.segment-btn:hover:not(.active) {
  color: var(--text-secondary);
}

/* ========== MODE PANELS (submit forms) ========== */
.mode-panel {
  display: none;
}

.mode-panel.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

/* ========== BUTTONS ========== */
.btn-submit {
  width: 100%;
  padding: 11px 20px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  margin-top: 20px;
}

.btn-submit:hover {
  background: var(--primary-hover);
}

.btn-submit:active {
  transform: scale(0.98);
}

.btn-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-query {
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition);
}

.btn-query:hover {
  background: var(--primary-hover);
}

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

.btn-ghost {
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
}

.btn-ghost:hover {
  border-color: var(--border-hover);
  color: var(--text);
  text-decoration: none;
}

/* ========== QUERY BAR ========== */
.query-bar {
  display: flex;
  gap: 10px;
}

.query-bar .form-input {
  flex: 1;
}

/* ========== RESPONSE PANEL ========== */
.response-panel {
  display: none;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
}

.response-panel.visible {
  display: block;
}

.response-panel.success {
  background: var(--success-muted);
  border: 1px solid rgba(52, 168, 83, 0.2);
}

.response-panel.error {
  background: var(--danger-muted);
  border: 1px solid rgba(234, 67, 53, 0.2);
}

.resp-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.resp-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  flex-shrink: 0;
}

.response-panel.success .resp-icon {
  color: var(--success);
  background: rgba(255,255,255,0.05);
}

.response-panel.error .resp-icon {
  color: var(--danger);
  background: rgba(255,255,255,0.05);
}

.resp-title {
  font-size: 0.9rem;
  font-weight: 600;
}

.resp-meta, .resp-tips {
  margin-top: 4px;
  font-size: 0.825rem;
  color: var(--text-secondary);
}

/* ========== STATS GRID ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.stat-card.green .stat-value { color: var(--success); }
.stat-card.orange .stat-value { color: var(--warning); }
.stat-card.blue .stat-value { color: var(--primary); }
.stat-card.red .stat-value { color: var(--danger); }

/* ========== CARD STATUS BAR ========== */
.card-status-bar {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.card-stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.card-stat-item {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.cstat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.cstat-value {
  font-size: 1rem;
  font-weight: 700;
}

.text-neon-blue { color: var(--primary) !important; }
.text-neon-green { color: var(--success) !important; }
.text-neon-amber { color: var(--warning) !important; }
.text-neon-rose { color: var(--danger) !important; }

/* ========== QUEUE STATS ========== */
.queue-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.queue-stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
}

.queue-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.queue-stat-value {
  font-size: 0.9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ========== USAGE BAR ========== */
.usage-bar-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.usage-label, .usage-pct {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.usage-bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-elevated);
  overflow: hidden;
}

.usage-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--success);
  transition: width 300ms ease;
}

/* ========== NOTICES ========== */
.notices {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notice {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.notice-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warning);
  flex-shrink: 0;
  margin-top: 7px;
}

.notice strong {
  color: var(--text);
  font-weight: 600;
}

/* Backward-compatible notice styles */
.compact-notice-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.notice-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.notice-item strong {
  color: var(--text);
  display: block;
  margin-bottom: 2px;
}

.notice-index {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-muted);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.region-note {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ========== FILTER TABS ========== */
.filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-tab {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-tab.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.filter-tab:hover:not(.active) {
  border-color: var(--border-hover);
  color: var(--text-secondary);
}

/* ========== DATA TABLE ========== */
#task-table-body {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.data-table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
}

.data-table thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.data-table tbody tr:last-child {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: rgba(66, 133, 244, 0.03);
}

.data-table td {
  padding: 11px 14px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  vertical-align: middle;
}

.email-cell {
  max-width: 200px;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-cell {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ========== STATUS TAGS ========== */
.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-tag.pending {
  color: var(--warning);
  background: var(--warning-muted);
}
.status-tag.pending::before { background: var(--warning); }

.status-tag.running {
  color: var(--primary);
  background: var(--primary-muted);
}
.status-tag.running::before { background: var(--primary); }

.status-tag.success {
  color: var(--success);
  background: var(--success-muted);
}
.status-tag.success::before { background: var(--success); }

.status-tag.failed {
  color: var(--danger);
  background: var(--danger-muted);
}
.status-tag.failed::before { background: var(--danger); }

.status-tag.cancelled {
  color: var(--text-muted);
  background: rgba(113, 113, 122, 0.12);
}
.status-tag.cancelled::before { background: var(--text-muted); }

/* ========== PAGINATION ========== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.page-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.825rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.page-btn:hover { border-color: var(--border-hover); color: var(--text); }

.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.page-info {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-sm {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-sm.cancel {
  color: var(--danger);
  background: var(--danger-muted);
  border-color: rgba(234, 67, 53, 0.15);
}

.btn-sm.cancel:hover {
  background: var(--danger);
  color: #fff;
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.history-shell {
  margin-top: 0;
}

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

.history-top h2 {
  font-size: 1rem;
  font-weight: 600;
}

.history-meta {
  font-size: 0.825rem;
  color: var(--text-muted);
}

/* ========== PLACEHOLDER / SUMMARY ========== */
.placeholder-note, .summary-note {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 12px;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.summary-stat {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
}

.summary-stat span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.summary-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 1.1rem;
  font-weight: 700;
}

.quick-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.quick-pill {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ========== TUTORIAL TABS ========== */
.tutorial-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.tutorial-tab {
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: -1px;
}

.tutorial-tab:hover {
  color: var(--text-secondary);
}

.tutorial-tab.active {
  color: var(--text);
  border-bottom-color: var(--primary);
}

.guide-panel {
  display: none;
}

.guide-panel.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

/* ========== TUTORIAL STEPS ========== */
.tutorial-note {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--primary-muted);
  border: 1px solid rgba(66, 133, 244, 0.15);
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

.tutorial-steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.tutorial-step:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.tutorial-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition);
}

.tutorial-step:hover {
  border-color: var(--border-hover);
}

.tutorial-step-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px;
}

.tutorial-step-index {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-muted);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.tutorial-step h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.tutorial-step p {
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.tutorial-media {
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.tutorial-media img {
  display: block;
  width: 100%;
  height: auto;
}

/* ========== QUERY PAGE ========== */
.query-page .main,
.query-page .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 32px 80px;
}

.query-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.query-toolbar .form-input {
  flex: 1;
}

.btn {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

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

.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

/* ========== FOOTER ========== */
.footer {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .split-layout {
    grid-template-columns: 1fr;
  }

  .split-side {
    position: static;
  }

  .tutorial-steps {
    grid-template-columns: 1fr;
  }

  .tutorial-step:last-child:nth-child(odd) {
    grid-column: auto;
  }
}

@media (max-width: 768px) {
  .nav-inner {
    padding: 0 16px;
    gap: 16px;
  }

  .nav-brand span {
    display: none;
  }

  .nav-tab {
    padding: 0 10px;
    font-size: 0.8rem;
  }

  .main {
    padding: 24px 16px 60px;
  }

  .page-header h1 {
    font-size: 1.35rem;
  }

  .card {
    padding: 18px;
  }

  .stats-grid, .card-stat-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .query-bar, .query-toolbar {
    flex-direction: column;
  }

  .summary-strip {
    grid-template-columns: 1fr;
  }

  .tutorial-step-head {
    padding: 14px 16px;
  }
}

@media (max-width: 560px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .card-stat-row {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 14px;
  }

  .data-table, .data-table thead, .data-table tbody, .data-table tr, .data-table td {
    display: block;
    width: 100%;
  }

  .data-table { min-width: 0; }
  .data-table thead { display: none; }

  .data-table tbody tr {
    padding: 12px 14px;
  }

  .data-table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border: none;
    white-space: normal;
    text-align: right;
  }

  .data-table td::before {
    content: attr(data-label);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: left;
    flex-shrink: 0;
  }

  .email-cell, .msg-cell {
    max-width: none;
  }

  .filter-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .tutorial-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
