*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --bg1: #e0e6ed; --bgc1: #f0f4f8; --bgc2: #e5ebf1;
  --gp: rgba(255,255,255,0.42); --gp-b: rgba(255,255,255,0.5);
  --gc1: rgba(255,255,255,0.7); --gc2: rgba(255,255,255,0.3);
  --gc-b: rgba(255,255,255,0.6); --gc-i: rgba(255,255,255,0.8);
  --gb: rgba(255,255,255,0.6); --gb-h: rgba(255,255,255,0.85); --gb-bdr: rgba(255,255,255,0.8);
  --shine: rgba(255,255,255,0.4);
  --tp: #1a1a1a; --ts: #4b5563; --tm: #9ca3af;
  --accent-green: #059669; --accent-red: #dc2626; --accent-amber: #f59e0b; --accent-orange: #f97316;
  --accent-blue: #2563eb; --accent-purple: #7c3aed;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08); --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.15); --shadow-fab: 0 4px 20px rgba(0,0,0,0.3);
  --radius-sm: 10px; --radius-md: 14px; --radius-lg: 16px; --radius-xl: 20px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1); --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}
body.dark {
  --bg1: #000; --bgc1: #0a0a0a; --bgc2: #111;
  --gp: rgba(255,255,255,0.05); --gp-b: rgba(255,255,255,0.09);
  --gc1: rgba(255,255,255,0.08); --gc2: rgba(255,255,255,0.03);
  --gc-b: rgba(255,255,255,0.1); --gc-i: rgba(255,255,255,0.05);
  --gb: rgba(255,255,255,0.07); --gb-h: rgba(255,255,255,0.13); --gb-bdr: rgba(255,255,255,0.1);
  --shine: rgba(255,255,255,0.05);
  --tp: #f0f0f0; --ts: #a0a0a0; --tm: #555;
  --accent-green: #34d399; --accent-red: #f87171; --accent-amber: #fbbf24; --accent-orange: #fb923c;
  --accent-blue: #60a5fa; --accent-purple: #a78bfa;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3); --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5); --shadow-fab: 0 4px 20px rgba(0,0,0,0.5);
}

html, body { min-height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-image: radial-gradient(circle at 100% 0%, var(--bg1) 0%, transparent 40%), radial-gradient(circle at 0% 100%, var(--bg1) 0%, transparent 40%), linear-gradient(135deg, var(--bgc1) 0%, var(--bgc2) 100%);
  background-attachment: fixed; background-size: cover;
  min-height: 100vh; color: var(--tp); transition: background 0.3s, color 0.3s;
  overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch;
}
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--tm); border-radius: 2px; }

/* ── Status Bar Spacer ── */
.status-bar-spacer { height: env(safe-area-inset-top, 0px); flex-shrink: 0; }

/* ── Glass ── */
.glass-panel { background: var(--gp); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--gp-b); }
.glass-card { background: linear-gradient(135deg, var(--gc1) 0%, var(--gc2) 100%); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--gc-b); box-shadow: inset 0 1px 1px var(--gc-i), var(--shadow-sm); position: relative; overflow: hidden; border-radius: var(--radius-lg); transition: transform 0.2s var(--ease-out), box-shadow 0.2s; }
.glass-card:active { transform: scale(0.98); }
.glass-btn { background: var(--gb); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); border: 1px solid var(--gb-bdr); color: var(--tp); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: all 0.2s var(--ease-out); -webkit-touch-callout: none; user-select: none; }
.glass-btn:hover, .glass-btn:active { background: var(--gb-h); }
.glass-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }
.shine { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; background: linear-gradient(120deg, transparent 30%, var(--shine) 38%, var(--shine) 40%, transparent 48%); }
.glass-input { background: var(--gb); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); border: 1px solid var(--gb-bdr); color: var(--tp); outline: none; transition: all 0.2s; font-family: inherit; }
.glass-input:focus { border-color: var(--accent-blue); background: var(--gb-h); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.glass-input::placeholder { color: var(--tm); }

/* ── Layout ── */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; min-height: 100dvh; }
.app-header { position: sticky; top: 0; z-index: 100; padding: 12px 16px; transition: all 0.3s var(--ease-out); }
.app-header.scrolled { background: var(--gp); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); }
.app-header .header-inner { display: flex; align-items: center; justify-content: space-between; max-width: 540px; margin: 0 auto; width: 100%; }
.app-header .header-left { display: flex; align-items: center; gap: 8px; min-width: 40px; }
.header-btn { width: 40px; height: 40px; border-radius: 50%; transition: transform 0.15s; }
.header-btn:active { transform: scale(0.9); }
.app-header .logo-area { display: flex; align-items: center; gap: 10px; flex: 1; justify-content: center; }
.app-header .logo-icon { 
  width: 38px; height: 38px; border-radius: 12px; 
  background: #000; color: #fff; 
  border: none; display: flex; align-items: center; justify-content: center; 
  box-shadow: 0 2px 8px rgba(0,0,0,0.2); 
  transition: all 0.3s;
}
body.dark .app-header .logo-icon { 
  background: #fff; color: #000; 
  box-shadow: 0 2px 8px rgba(255,255,255,0.2);
}
.app-header .logo-icon svg { width: 18px; height: 18px; color: inherit !important; }
.app-header .logo-icon svg * { stroke: currentColor !important; }
.app-header h1 { font-size: 15px; font-weight: 700; color: var(--tp); line-height: 1.2; }
.app-header .subtitle { font-size: 10px; font-weight: 500; color: var(--tm); text-align: center; }
.header-right { display: flex; align-items: center; gap: 8px; }
.conn-dot { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--gb); transition: background 0.2s; }
.conn-dot.connected { background: rgba(5,150,105,0.15); }
.conn-dot.offline { background: rgba(220,38,38,0.15); }
.app-main { flex: 1; padding: 12px 16px 0; max-width: 540px; margin: 0 auto; width: 100%; position: relative; overflow-x: hidden; display: flex; flex-direction: column; }
.tab-content { display: none; width: 100%; flex-shrink: 0; }
.tab-content.active { display: flex; flex-direction: column; gap: 12px; padding-bottom: 100px; width: 100%; }
.tab-content.slide-left { animation: slideInRight 0.3s var(--ease-out); }
.tab-content.slide-right { animation: slideInLeft 0.3s var(--ease-out); }

/* ── Pull to Refresh ── */
.pull-indicator { position: fixed; top: 60px; left: 50%; transform: translateX(-50%) translateY(-60px); z-index: 90; display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 20px; background: var(--gp); backdrop-filter: blur(10px); border: 1px solid var(--gp-b); font-size: 12px; color: var(--ts); opacity: 0; transition: opacity 0.2s, transform 0.2s var(--ease-out); pointer-events: none; }
.pull-indicator.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.pull-indicator svg { width: 16px; height: 16px; transition: transform 0.3s var(--ease-out); }
.pull-indicator.spinning svg { animation: spin 0.8s linear infinite; }

/* ── Search Bar ── */
.search-bar { display: flex; align-items: center; gap: 10px; padding: 0 4px; margin-bottom: 4px; }
.search-input-wrap { flex: 1; position: relative; }
.search-input-wrap svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--tm); pointer-events: none; }
.search-input { width: 100%; padding: 10px 14px 10px 38px; border-radius: var(--radius-xl); font-size: 14px; background: var(--gb); border: 1px solid var(--gb-bdr); color: var(--tp); outline: none; transition: all 0.2s; }
.search-input:focus { border-color: var(--accent-blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.filter-btn { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.filter-btn.active { background: var(--tp); color: var(--bgc1); }

/* ── Filter Chips ── */
.filter-chips { display: flex; gap: 8px; padding: 0 4px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.filter-chips::-webkit-scrollbar { display: none; }
.chip { padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 500; white-space: nowrap; cursor: pointer; background: var(--gb); border: 1px solid var(--gb-bdr); color: var(--ts); transition: all 0.2s var(--ease-out); user-select: none; }
.chip:active { transform: scale(0.95); }
.chip.active { background: var(--tp); color: var(--bgc1); border-color: var(--tp); }

/* ── FAB Button ── */
.fab {
  position: fixed; bottom: 100px; right: 20px; z-index: 200;
  width: 58px; height: 58px; border-radius: 50%;
  background: #000; color: #fff !important; border: none;
  box-shadow: var(--shadow-fab);
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s, background 0.3s;
  display: flex; align-items: center; justify-content: center;
}
body.dark .fab { background: #fff; color: #000 !important; }
.fab svg { width: 24px; height: 24px; color: #fff !important; }
body.dark .fab svg { color: #000 !important; }
.fab svg * { stroke: currentColor !important; }
.fab:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(0,0,0,0.2); }
body.dark .fab:hover { box-shadow: 0 6px 28px rgba(255,255,255,0.1); }
.fab:active { transform: scale(0.92); }
.fab.hidden { transform: scale(0) rotate(-45deg); opacity: 0; pointer-events: none; }

/* ── FAB Speed Dial ── */
.speed-dial { position: fixed; bottom: 170px; right: 24px; z-index: 199; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; opacity: 0; transform: translateY(20px) scale(0.8); pointer-events: none; transition: all 0.25s var(--ease-out); }
.speed-dial.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.speed-dial-item { display: flex; align-items: center; gap: 10px; }
.speed-dial-item span { font-size: 12px; font-weight: 500; color: var(--ts); padding: 4px 10px; border-radius: 8px; background: var(--gp); backdrop-filter: blur(10px); border: 1px solid var(--gp-b); }
.speed-dial-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--gb); border: 1px solid var(--gb-bdr); color: var(--tp); display: flex; align-items: center; justify-content: center; transition: transform 0.15s; }
.speed-dial-btn:active { transform: scale(0.9); }
.speed-dial-btn svg { width: 18px; height: 18px; }

/* ── Modal ── */
.modal-overlay { position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: opacity 0.25s; }
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal { position: fixed; bottom: 0; left: 0; right: 0; z-index: 301; max-height: 92vh; overflow-y: auto; border-radius: var(--radius-xl) var(--radius-xl) 0 0; background: var(--bgc1); border: 1px solid var(--gc-b); box-shadow: 0 -4px 30px rgba(0,0,0,0.3); transform: translateY(100%); transition: transform 0.35s var(--ease-out); max-width: 540px; margin: 0 auto; }
.modal.open { transform: translateY(0); }
.modal-drag-handle { width: 36px; height: 4px; border-radius: 2px; background: var(--tm); margin: 8px auto 0; opacity: 0.4; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 0; position: sticky; top: 0; z-index: 1; background: var(--bgc1); }
.modal-header h2 { font-size: 18px; font-weight: 700; color: var(--tp); }
.modal-close { width: 36px; height: 36px; border-radius: 50%; transition: transform 0.15s; }
.modal-close:active { transform: scale(0.9); }
.modal-body { padding: 16px 20px 32px; display: flex; flex-direction: column; gap: 14px; }

/* ── Confirm Dialog ── */
.dialog-overlay { position: fixed; inset: 0; z-index: 400; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.dialog-overlay.open { opacity: 1; pointer-events: auto; }
.confirm-dialog { position: fixed; top: 50%; left: 50%; z-index: 401; transform: translate(-50%, -50%) scale(0.9); background: var(--bgc1); border: 1px solid var(--gc-b); border-radius: var(--radius-xl); padding: 24px 20px 20px; max-width: 320px; width: calc(100% - 48px); box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: all 0.25s var(--ease-out); }
.confirm-dialog.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.confirm-dialog h3 { font-size: 16px; font-weight: 600; color: var(--tp); margin-bottom: 8px; text-align: center; }
.confirm-dialog p { font-size: 13px; color: var(--ts); text-align: center; margin-bottom: 20px; line-height: 1.5; }
.confirm-actions { display: flex; gap: 10px; }
.confirm-actions button { flex: 1; padding: 12px; border-radius: var(--radius-lg); font-size: 14px; font-weight: 600; border: none; cursor: pointer; transition: all 0.2s; }
.btn-cancel { background: var(--gb); color: var(--tp); border: 1px solid var(--gb-bdr); }
.btn-cancel:active { background: var(--gb-h); }
.btn-confirm { background: var(--accent-red); color: #fff; }
.btn-confirm:active { opacity: 0.85; }

/* ── Bottom Sheet ── */
.sheet-overlay { position: fixed; inset: 0; z-index: 350; background: rgba(0,0,0,0.4); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.sheet-overlay.open { opacity: 1; pointer-events: auto; }
.bottom-sheet { position: fixed; bottom: 0; left: 0; right: 0; z-index: 351; max-height: 70vh; overflow-y: auto; border-radius: var(--radius-xl) var(--radius-xl) 0 0; background: var(--bgc1); border: 1px solid var(--gc-b); box-shadow: 0 -4px 30px rgba(0,0,0,0.3); transform: translateY(100%); transition: transform 0.3s var(--ease-out); max-width: 540px; margin: 0 auto; }
.bottom-sheet.open { transform: translateY(0); }
.sheet-drag-handle { width: 36px; height: 4px; border-radius: 2px; background: var(--tm); margin: 8px auto; opacity: 0.4; }
.sheet-header { padding: 8px 20px 12px; font-size: 16px; font-weight: 600; color: var(--tp); text-align: center; }
.sheet-body { padding: 0 20px 24px; display: flex; flex-direction: column; gap: 4px; }
.sheet-item { display: flex; align-items: center; gap: 14px; padding: 14px 12px; border-radius: var(--radius-md); cursor: pointer; transition: background 0.15s; }
.sheet-item:active { background: var(--gb); }
.sheet-item svg { width: 20px; height: 20px; color: var(--ts); flex-shrink: 0; }
.sheet-item span { font-size: 14px; color: var(--tp); font-weight: 500; }
.sheet-item.danger svg, .sheet-item.danger span { color: var(--accent-red); }
.sheet-divider { height: 1px; background: var(--gb-bdr); margin: 4px 12px; }

/* ── Toast Notifications ── */
.toast-container { position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); left: 0; right: 0; z-index: 500; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 16px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: var(--radius-xl); background: var(--tp); color: var(--bgc1); box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 500; pointer-events: auto; animation: toastSlideIn 0.35s var(--ease-out), toastSlideOut 0.3s var(--ease-out) 2.7s forwards; max-width: 100%; }
.toast svg { width: 16px; height: 16px; flex-shrink: 0; }
.toast.success { background: linear-gradient(135deg, #059669, #10b981); color: #fff; }
.toast.error { background: linear-gradient(135deg, #dc2626, #ef4444); color: #fff; }
.toast.warning { background: linear-gradient(135deg, #d97706, #f59e0b); color: #fff; }

/* ── Task Row (List) ── */
.task-list { display: flex; flex-direction: column; gap: 10px; }
.task-row { padding: 14px 16px; border-radius: var(--radius-md); cursor: pointer; position: relative; overflow: hidden; }
.task-row::after { content: ''; position: absolute; inset: 0; background: var(--gb-h); opacity: 0; transition: opacity 0.15s; border-radius: inherit; }
.task-row:active::after { opacity: 1; }
.task-row-inner { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.task-row-left { flex-shrink: 0; display: flex; }
.task-row-center { flex: 1; min-width: 0; }
.task-row-title { font-size: 14px; font-weight: 500; color: var(--tp); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-row-sub { font-size: 12px; color: var(--tm); margin-top: 2px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.task-row-progress { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.progress-bar-mini { flex: 1; height: 4px; border-radius: 2px; background: var(--gb); overflow: hidden; }
.progress-bar-mini .progress-fill { height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--accent-blue), var(--accent-green)); transition: width 0.5s var(--ease-out); background-size: 200% 100%; animation: shimmer 2s infinite; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.task-row-progress span { font-size: 11px; color: var(--tm); white-space: nowrap; }
.task-row-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.btn-row-action { width: 34px; height: 34px; border-radius: 10px; transition: transform 0.1s; position: relative; z-index: 2; }
.btn-row-action:active { transform: scale(0.9); }
.btn-row-action.btn-delete { color: var(--accent-red); }

/* Swipe Actions */
.task-row-wrap { position: relative; border-radius: var(--radius-md); overflow: hidden; }
.swipe-actions { position: absolute; right: 0; top: 0; bottom: 0; display: flex; z-index: 0; }
.swipe-action { display: flex; align-items: center; justify-content: center; width: 70px; color: #fff; font-size: 12px; font-weight: 600; }
.swipe-action.resume { background: linear-gradient(135deg, #059669, #10b981); }
.swipe-action.delete { background: linear-gradient(135deg, #dc2626, #ef4444); }

/* ── Group Header ── */
.group-header { display: flex; align-items: center; gap: 8px; padding: 12px 4px 6px; margin: 4px 0; border-bottom: 1px solid var(--gb-bdr); }
.group-header:first-child { margin-top: 0; }
.group-header svg { width: 14px; height: 14px; }
.group-header .title { font-size: 11px; font-weight: 700; color: var(--tm); text-transform: uppercase; letter-spacing: 0.5px; }
.group-header .count { font-size: 11px; color: var(--tm); }

/* ── Status Card ── */
.status-card { padding: 12px 16px; border-radius: var(--radius-lg); background: var(--gp); border: 1px solid var(--gp-b); backdrop-filter: blur(10px); }
.status-card .inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.status-card .left { display: flex; align-items: center; gap: 8px; }
.status-card .left svg { width: 20px; height: 20px; }
.status-card .label { font-size: 13px; font-weight: 700; color: var(--tp); text-transform: uppercase; letter-spacing: 0.5px; }
.status-card .task-id { font-size: 11px; font-family: 'SF Mono', monospace; color: var(--tm); padding: 2px 6px; border-radius: 6px; background: var(--gb); }

/* ── Info Card (Task Detail) ── */
.info-card { padding: 16px; background: var(--gp); border: 1px solid var(--gp-b); border-radius: var(--radius-lg); }
.info-card-inner { position: relative; z-index: 1; }
.info-row { margin-bottom: 12px; }
.info-label { font-size: 10px; font-weight: 700; color: var(--tm); text-transform: uppercase; letter-spacing: 0.8px; display: block; margin-bottom: 4px; }
.info-value { font-size: 13px; color: var(--ts); word-break: break-all; }
.info-value.mono { font-family: 'SF Mono', monospace; }
.info-link { color: var(--accent-blue); text-decoration: none; display: flex; align-items: center; gap: 4px; }
.info-link:hover { text-decoration: underline; }
.info-row-inline { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.info-row-inline > div { min-width: 0; }

/* ── Result Card ── */
.result-card { padding: 14px 16px; border-radius: var(--radius-md); border: 1px solid var(--accent-green) !important; background: linear-gradient(135deg, rgba(5,150,105,0.1), rgba(16,185,129,0.05)) !important; }
.result-card .inner { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.result-card svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--accent-green); }
.result-card .info { flex: 1; min-width: 0; }
.result-card .tag { font-size: 12px; font-weight: 700; display: block; margin-bottom: 2px; color: var(--accent-green); }
.result-card a { font-size: 12px; color: var(--ts); text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-card a:hover { text-decoration: underline; }

/* ── Error ── */
.error-box { padding: 12px 14px; border-radius: var(--radius-md); background: rgba(220,38,38,0.08); border: 1px solid rgba(220,38,38,0.15); }
.error-box span { font-size: 12px; color: var(--accent-red); word-break: break-word; line-height: 1.5; }
.conn-error-card { padding: 12px 14px; border-radius: var(--radius-md); border: 1px solid var(--accent-red) !important; background: rgba(220,38,38,0.05); }
.conn-error-card .inner { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.conn-error-card span { font-size: 12px; color: var(--accent-red); font-weight: 500; }

/* ── Pipeline ── */
.pipeline-card { padding: 16px 20px; }
.pipeline-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; position: relative; z-index: 1; }
.pipeline-header h3 { font-size: 14px; font-weight: 600; color: var(--tp); }
.pipeline-header span { font-size: 12px; font-weight: 600; color: var(--ts); padding: 2px 8px; border-radius: 6px; background: var(--gb); }
.progress-bar { width: 100%; height: 6px; border-radius: 3px; background: var(--gb); margin-bottom: 16px; position: relative; z-index: 1; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent-blue), var(--accent-green)); transition: width 0.5s var(--ease-out); }
.pipeline-steps { display: flex; flex-direction: column; gap: 6px; position: relative; z-index: 1; }
.step-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--gb-bdr); transition: background 0.15s; border-radius: 8px; padding: 8px; }
.step-row:last-child { border-bottom: none; }
.step-row:hover { background: var(--gb); }
.step-icon { flex-shrink: 0; display: flex; width: 28px; height: 28px; border-radius: 50%; align-items: center; justify-content: center; background: var(--gb); }
.step-icon svg { width: 16px; height: 16px; }
.step-info { flex: 1; min-width: 0; }
.step-name-row { display: flex; align-items: center; gap: 8px; }
.step-name { font-size: 13px; font-weight: 500; }
.step-running-badge { font-size: 10px; padding: 2px 8px; border-radius: 999px; font-weight: 600; background: rgba(245,158,11,0.15); color: var(--accent-amber); }
.step-duration { font-size: 11px; margin-top: 2px; color: var(--accent-green); font-weight: 500; }
.step-error { font-size: 11px; margin-top: 2px; color: var(--accent-red); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.step-emoji { font-size: 16px; flex-shrink: 0; width: 28px; text-align: center; }
.step-emoji.pulse { animation: pulse-glow 1.5s ease-in-out infinite; }

/* ── Parent / child step nesting (Video Edit + sub-parts) ── */
/* Parent step row has a slightly stronger background and an inline
   chevron toggle button to expand/collapse its sub-parts. */
.step-row-parent { background: rgba(255,255,255,0.025); border: 1px solid var(--gb-bdr); margin: 4px 0; }
.step-row-parent .step-name { font-weight: 700; }

/* The chevron button — sits between the status icon and the step name.
   Default state: chevron points DOWN (collapsed). When the parent is
   expanded (button.expanded), we rotate it 180deg... actually we keep
   the down-chevron always; the .expanded class only changes the
   background tint so the user has a visual cue. */
.step-chevron { flex-shrink: 0; width: 26px; height: 26px; border-radius: 8px; border: 0; background: var(--gb); color: var(--tm); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: transform 0.2s, background 0.15s, color 0.15s; padding: 0; }
.step-chevron:hover { background: rgba(255,255,255,0.08); color: var(--tp); }
.step-chevron.expanded { background: rgba(37,99,235,0.15); color: var(--accent-blue); }
/* Rotate the chevron icon -90deg (so it points right) when collapsed,
   0deg (so it points down) when expanded. The default ICONS.chevron
   is a downward V (points down) — so default CSS (collapsed) should
   rotate it -90deg, and .expanded should remove the rotation. */
.step-chevron svg { transition: transform 0.2s ease; transform: rotate(-90deg); }
.step-chevron.expanded svg { transform: rotate(0deg); }

/* Parent badge — small "sub-parts" pill next to the parent step name
   so the user knows there are expandable children. */
.step-parent-badge { font-size: 9px; padding: 2px 6px; border-radius: 999px; font-weight: 600; background: rgba(37,99,235,0.12); color: var(--accent-blue); text-transform: uppercase; letter-spacing: 0.4px; }

/* Child container — wraps the child step rows. Hidden by default;
   shown when the parent's chevron is clicked. */
.step-children { margin-left: 24px; padding-left: 8px; border-left: 2px solid var(--gb-bdr); margin-top: 2px; margin-bottom: 4px; }
.step-children .step-row { border-bottom: 1px solid rgba(255,255,255,0.03); }
.step-children .step-row:last-child { border-bottom: none; }

/* Child rows are slightly smaller / more subdued than parent rows. */
.step-row-child .step-name { font-size: 12px; font-weight: 500; }
.step-row-child .step-icon { width: 22px; height: 22px; }
.step-row-child .step-icon svg { width: 13px; height: 13px; }
.step-row-child .step-emoji { font-size: 13px; width: 22px; }

/* Spacer that indents child rows under the parent — keeps the
   status icon aligned with the parent's status icon. */
.step-child-spacer { display: inline-block; width: 22px; flex-shrink: 0; }

/* ── Gemini Skip Card ────────────────────────────────────────────── */
/* Prominent amber card that appears for 10 seconds when the Gemini
   Enhancement step is about to start. Contains a "Skip Gemini
   Enhancement" button with a live countdown. If clicked, the Gemini
   step is skipped (saves quota) and the dataset is preserved. */
.gemini-skip-card {
  border: 2px solid var(--accent-amber);
  background: rgba(245, 158, 11, 0.08);
  padding: 16px;
  margin: 8px 0;
  border-radius: var(--radius-lg);
  animation: gemini-skip-pulse 2s ease-in-out infinite;
}
@keyframes gemini-skip-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.3); }
  50% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
}
.gemini-skip-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.gemini-skip-icon { font-size: 28px; flex-shrink: 0; line-height: 1; }
.gemini-skip-text { flex: 1; min-width: 0; }
.gemini-skip-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-amber);
  margin-bottom: 4px;
}
.gemini-skip-sub {
  font-size: 11px;
  color: var(--tm);
  line-height: 1.4;
}
.gemini-skip-btn {
  background: var(--accent-amber) !important;
  color: #000 !important;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 14px;
  cursor: pointer;
  border: 0;
  transition: transform 0.1s, opacity 0.2s;
}
.gemini-skip-btn:hover:not(:disabled) { transform: scale(1.01); opacity: 0.95; }
.gemini-skip-btn:active:not(:disabled) { transform: scale(0.99); }
.gemini-skip-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.gemini-skip-btn-label { flex: 1; text-align: center; }
.gemini-skip-countdown {
  background: rgba(0, 0, 0, 0.2);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  min-width: 28px;
  text-align: center;
  flex-shrink: 0;
}

/* ── YouTube OAuth Banner (v2.8.0) ──────────────────────────────── */
/* Prominent red banner that appears when the upload step needs the
   user to re-authenticate with Google (OAuth token expired). Shows
   the login URL + an "I've authenticated" button. */
.youtube-oauth-banner {
  border: 2px solid var(--accent-red);
  background: rgba(220, 38, 38, 0.08);
  padding: 16px;
  margin: 8px 0;
  border-radius: var(--radius-lg);
}
.youtube-oauth-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.youtube-oauth-icon { font-size: 28px; flex-shrink: 0; line-height: 1; }
.youtube-oauth-text { flex: 1; min-width: 0; }
.youtube-oauth-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-red);
  margin-bottom: 4px;
}
.youtube-oauth-sub {
  font-size: 11px;
  color: var(--tm);
  line-height: 1.4;
}
.youtube-oauth-url-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
}
.youtube-oauth-link {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  font-family: 'SF Mono', 'Courier New', monospace;
  color: var(--accent-blue);
  background: rgba(0, 0, 0, 0.2);
  padding: 8px 10px;
  border-radius: 8px;
  word-break: break-all;
  text-decoration: none;
  border: 1px solid var(--gb-bdr);
}
.youtube-oauth-link:hover { text-decoration: underline; }
.youtube-oauth-copy-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.youtube-oauth-resolved-btn {
  background: var(--accent-green) !important;
  color: #000 !important;
  font-weight: 700;
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 14px;
  cursor: pointer;
  border: 0;
  margin-bottom: 8px;
}
.youtube-oauth-resolved-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.youtube-oauth-countdown {
  font-size: 11px;
  color: var(--tm);
  text-align: center;
  font-family: 'SF Mono', 'Courier New', monospace;
}
/* v2.10.0: CloakBrowser-based validation buttons */
.youtube-oauth-validate-btn {
  background: var(--accent-blue) !important;
  color: #fff !important;
  font-weight: 700;
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  cursor: pointer;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.youtube-oauth-validate-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.youtube-oauth-viewer-btn {
  background: var(--accent-green) !important;
  color: #000 !important;
  font-weight: 700;
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  cursor: pointer;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.youtube-oauth-cancel-btn {
  font-size: 13px;
  padding: 10px;
  border-radius: var(--radius-md);
}

/* ── SEO Skip Card (v2.11.0) ────────────────────────────────────── */
.seo-skip-card {
  border: 2px solid var(--accent-blue);
  background: rgba(37, 99, 235, 0.08);
  padding: 16px;
  margin: 8px 0;
  border-radius: var(--radius-lg);
}
.seo-skip-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.seo-skip-icon { font-size: 28px; flex-shrink: 0; line-height: 1; }
.seo-skip-text { flex: 1; min-width: 0; }
.seo-skip-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-blue);
  margin-bottom: 4px;
}
.seo-skip-sub {
  font-size: 11px;
  color: var(--tm);
  line-height: 1.4;
}
.seo-generate-btn {
  background: var(--accent-blue) !important;
  color: #fff !important;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 14px;
  cursor: pointer;
  border: 0;
}
.seo-generate-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.seo-generate-btn-label { flex: 1; text-align: center; }
.seo-skip-countdown {
  background: rgba(0, 0, 0, 0.2);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  min-width: 28px;
  text-align: center;
  flex-shrink: 0;
}

/* ── YouTube Validation Card (v2.9.0, Accounts tab) ────────────── */
.yt-validate-card {
  padding: 16px;
  border-radius: var(--radius-lg);
}
.yt-validate-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.yt-validate-icon { font-size: 28px; flex-shrink: 0; line-height: 1; }
.yt-validate-text { flex: 1; min-width: 0; }
.yt-validate-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--tp);
  margin-bottom: 4px;
}
.yt-validate-sub {
  font-size: 11px;
  line-height: 1.4;
}
.yt-validate-oauth-url-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}
.yt-validate-oauth-link {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: var(--accent-blue);
  padding: 12px;
  border-radius: var(--radius-md);
  text-decoration: none;
  text-align: center;
  display: block;
}
.yt-validate-oauth-link:hover { opacity: 0.9; }
.yt-validate-copy-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.yt-validate-poll-hint {
  font-size: 11px;
  color: var(--tm);
  text-align: center;
  margin-bottom: 12px;
  font-style: italic;
}
.yt-validate-troubleshoot {
  font-size: 11px;
  color: var(--ts);
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  line-height: 1.5;
}
.yt-validate-troubleshoot strong { color: var(--accent-amber); }
.yt-validate-error {
  font-size: 11px;
  color: var(--accent-red);
  background: rgba(220, 38, 38, 0.08);
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 12px;
  word-break: break-word;
}
.yt-validate-actions { display: flex; gap: 8px; }

/* ── Logs ── */
.log-label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; padding: 0 4px; }
.log-label { font-size: 11px; font-weight: 700; color: var(--tm); text-transform: uppercase; letter-spacing: 0.8px; }
.log-actions { display: flex; gap: 6px; }
.copy-logs-btn, .clear-logs-btn { width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0; }
.log-box { border-radius: var(--radius-lg); padding: 14px; max-height: 240px; overflow-y: auto; font-family: 'SF Mono', 'Courier New', monospace; font-size: 11px; line-height: 1.7; color: var(--ts); white-space: pre-wrap; word-break: break-all; }
.log-box .log-empty { text-align: center; color: var(--tm); padding: 20px; }
.log-box .log-entry { padding: 2px 0; border-bottom: 1px solid rgba(255,255,255,0.03); }
.log-entry:last-child { border-bottom: none; }
/* Rate-limit marker lines — bright red background so they stand out in
   the Live Output panel. Emitted by cloudshell.py when it detects
   "Try again 1 hour later" or similar in the Cloud Shell output. */
.log-entry.log-rate-limit {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  font-weight: 600;
  padding: 6px 8px;
  margin: 2px 0;
  border-left: 3px solid #ef4444;
  border-radius: 4px;
}
/* CloudShell status lines — subtle blue tint so the user can visually
   distinguish au-agent status messages from raw server.py output. */
.log-entry.log-cloudshell {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.06);
  padding-left: 8px;
  border-left: 2px solid rgba(59, 130, 246, 0.4);
}

/* ── Task Files ── */
.task-files-list { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.file-row { transition: background 0.2s, transform 0.1s; cursor: pointer; }
.file-row:active { transform: scale(0.98); }

/* ── Detail Actions ── */
.detail-actions { display: flex; gap: 10px; margin-top: 12px; }
.btn-delete-large { padding: 14px 20px; border-radius: var(--radius-lg); font-size: 14px; font-weight: 600; gap: 6px; color: var(--accent-red); display: flex; align-items: center; justify-content: center; }

/* ── Field Cards (Modal) ── */
.field-card { padding: 0; }
.field-card > label { display: block; font-size: 11px; font-weight: 700; color: var(--tm); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 6px; }
.field-label-row { display: flex; align-items: center; gap: 6px; }
.field-label-row svg { width: 14px; height: 14px; }
.field-input { width: 100%; padding: 12px 16px; border-radius: var(--radius-md); font-size: 14px; font-family: 'SF Mono', 'Courier New', monospace; }
.field-input-sm { width: 100%; padding: 10px 12px 10px 36px; border-radius: var(--radius-md); font-size: 14px; font-family: 'SF Mono', 'Courier New', monospace; }
.trim-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.trim-field label { display: block; font-size: 12px; color: var(--ts); margin-bottom: 6px; font-weight: 500; }
.trim-input-wrap { position: relative; }
.trim-input-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--tm); }

/* Video Preview */
.video-preview { border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); }
.video-frame { position: relative; width: 100%; aspect-ratio: 16/9; background: #000; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }

/* Recent URLs */
.recent-urls { display: flex; flex-direction: column; gap: 6px; }
.recent-url-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--gb); border: 1px solid var(--gb-bdr); cursor: pointer; transition: all 0.15s; }
.recent-url-item:active { background: var(--gb-h); transform: scale(0.98); }
.recent-url-item svg { width: 16px; height: 16px; color: var(--tm); flex-shrink: 0; }
.recent-url-item span { font-size: 12px; color: var(--ts); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Quick Time Presets */
.time-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.time-preset { padding: 5px 12px; border-radius: 8px; font-size: 11px; font-weight: 600; background: var(--gb); border: 1px solid var(--gb-bdr); color: var(--ts); cursor: pointer; transition: all 0.15s; }
.time-preset:active { background: var(--gb-h); transform: scale(0.95); }

/* ── Primary Button ── */
.btn-primary { 
  width: 100%; padding: 14px; border-radius: var(--radius-lg); 
  font-size: 14px; font-weight: 600; gap: 8px; 
  background: #000; color: #fff; border: none; cursor: pointer; 
  display: flex; align-items: center; justify-content: center; 
  transition: all 0.2s var(--ease-out); 
  box-shadow: 0 2px 12px rgba(0,0,0,0.2); 
}
body.dark .btn-primary { 
  background: #fff; color: #000; 
  box-shadow: 0 2px 12px rgba(255,255,255,0.1); 
}
.btn-primary svg { width: 16px; height: 16px; color: inherit !important; }
.btn-primary svg * { stroke: currentColor !important; }
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Skeleton Loading ── */
.skeleton { background: linear-gradient(90deg, var(--gb) 25%, var(--gb-h) 50%, var(--gb) 75%); background-size: 200% 100%; animation: skeleton-loading 1.5s infinite; border-radius: 8px; }
@keyframes skeleton-loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-row { height: 72px; border-radius: var(--radius-md); margin-bottom: 10px; }
.skeleton-header { height: 20px; width: 80px; margin: 8px 4px 8px; }

/* ── Badge ── */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 3px 10px; border-radius: 999px; font-weight: 600; }
.badge svg { width: 11px; height: 11px; }
.badge-pending { background: var(--gb); color: var(--tm); }
.badge-processing { background: rgba(245,158,11,0.15); color: var(--accent-amber); }
.badge-done { background: rgba(5,150,105,0.15); color: var(--accent-green); }
.badge-error { background: rgba(220,38,38,0.15); color: var(--accent-red); }

/* ── Empty State ── */
.empty-state { padding: 56px 32px; text-align: center; }
.empty-state .inner { position: relative; z-index: 1; }
.empty-state svg { width: 56px; height: 56px; margin: 0 auto 16px; color: var(--tm); opacity: 0.3; }
.empty-state .msg { font-size: 15px; font-weight: 600; color: var(--ts); }
.empty-state .sub { font-size: 13px; color: var(--tm); margin-top: 6px; }
.empty-state .btn-primary { margin-top: 20px; max-width: 200px; margin-left: auto; margin-right: auto; }

/* ── Statistics ── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 4px; }
.stat-card { padding: 12px 8px; text-align: center; border-radius: var(--radius-md); }
.stat-card .stat-value { font-size: 18px; font-weight: 800; color: var(--tp); line-height: 1; margin-bottom: 4px; }
.stat-card .stat-label { font-size: 9px; font-weight: 600; color: var(--tm); text-transform: uppercase; letter-spacing: 0.3px; white-space: nowrap; overflow: hidden; }
.stat-card .stat-icon { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin: 0 auto 8px; }
.stat-card .stat-icon svg { width: 14px; height: 14px; }
.chart-container { padding: 20px; }
.chart-container h3 { font-size: 13px; font-weight: 600; color: var(--tp); margin-bottom: 16px; text-align: center; }
.chart-bars { display: flex; align-items: flex-end; justify-content: center; gap: 12px; height: 120px; }
.chart-bar-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; max-width: 60px; }
.chart-bar { width: 100%; border-radius: 6px 6px 0 0; min-height: 4px; transition: height 0.5s var(--ease-out); position: relative; }
.chart-bar-value { font-size: 11px; font-weight: 700; color: var(--tp); }
.chart-bar-label { font-size: 10px; font-weight: 600; color: var(--tm); }

/* ── Settings ── */
.settings-group { margin-bottom: 8px; }
.settings-header { font-size: 11px; font-weight: 700; color: var(--tm); text-transform: uppercase; letter-spacing: 0.8px; padding: 8px 4px 8px; }
.settings-item { display: flex; align-items: center; gap: 14px; padding: 14px 12px; border-radius: var(--radius-md); cursor: pointer; transition: background 0.15s; }
.settings-item:active { background: var(--gb); }
.settings-item svg { width: 20px; height: 20px; color: var(--ts); flex-shrink: 0; }
.settings-item .settings-info { flex: 1; min-width: 0; }
.settings-item .settings-title { font-size: 14px; font-weight: 500; color: var(--tp); }
.settings-item .settings-desc { font-size: 11px; color: var(--tm); margin-top: 1px; }
.settings-toggle { width: 48px; height: 28px; border-radius: 14px; background: var(--gb); border: 1px solid var(--gb-bdr); position: relative; cursor: pointer; transition: all 0.25s var(--ease-out); flex-shrink: 0; }
.settings-toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--tp); transition: transform 0.25s var(--ease-out); }
.settings-toggle.on { background: var(--accent-blue); border-color: var(--accent-blue); }
.settings-toggle.on::after { transform: translateX(20px); background: #fff; }
.settings-chevron { color: var(--tm); margin-left: auto; }
.settings-chevron svg { width: 16px; height: 16px; }

/* ── Bottom Nav ── */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 100; padding: 10px 20px calc(10px + env(safe-area-inset-bottom, 0px)); border-radius: var(--radius-xl) var(--radius-xl) 0 0; border-bottom: none; border-left: none; border-right: none; }
.bottom-nav .nav-inner { display: flex; align-items: center; justify-content: space-around; max-width: 540px; margin: 0 auto; }
.nav-tab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 16px; border-radius: 12px; font-size: 10px; font-weight: 600; color: var(--tm); background: none; border: none; cursor: pointer; transition: all 0.2s var(--ease-out); position: relative; min-width: 60px; }
.nav-tab svg { width: 22px; height: 22px; transition: transform 0.2s var(--ease-spring); }
.nav-tab.active { color: var(--accent-blue); }
.nav-tab.active svg { transform: translateY(-2px); }
.nav-tab:active { transform: scale(0.92); }
.nav-badge { position: absolute; top: 2px; right: 6px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--accent-red); color: #fff; font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; line-height: 1; }

/* ── Animations ── */
@keyframes pulse-glow { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastSlideIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastSlideOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-20px); } }
@keyframes bounceIn { 0% { transform: scale(0.3); opacity: 0; } 50% { transform: scale(1.05); } 70% { transform: scale(0.95); } 100% { transform: scale(1); opacity: 1; } }
.animate-spin { animation: spin 1s linear infinite; }
.animate-fade { animation: fadeIn 0.3s var(--ease-out); }
.animate-bounce-in { animation: bounceIn 0.4s var(--ease-out); }

/* ── Responsive ── */
@media (min-width: 480px) { .app-main { padding: 16px 20px 0; } }
@media (max-width: 380px) {
  .task-row-inner { gap: 8px; }
  .task-row-title { font-size: 13px; }
  .pipeline-steps { gap: 4px; }
  .stats-grid { gap: 8px; }
  .stat-card .stat-value { font-size: 24px; }
}

/* ── Account Logo Button (header) ── */
.account-logo-btn {
  position: relative;
}
.account-logo-btn .account-logo-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tm);
  border: 1.5px solid var(--gb);
  transition: background 0.25s var(--ease-out);
  z-index: 2;
}

/* ── Accounts Tab ── */
.accounts-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: calc(100vh - 200px);
  min-height: 400px;
}

.accounts-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  flex-wrap: wrap;
}

.accounts-status {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.accounts-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
  animation: pulse-glow 2s ease-in-out infinite;
}

.accounts-status-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--tp);
}

.accounts-status-desc {
  font-size: 11px;
  color: var(--tm);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.accounts-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.accounts-actions .glass-btn {
  font-size: 11px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.accounts-viewer {
  flex: 1;
  position: relative;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--gb-bdr);
  min-height: 300px;
}

.accounts-viewer iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #111;
}

/* ── Accounts Empty State ── */
.accounts-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 200px);
  padding: 16px;
}

.accounts-empty .glass-card {
  max-width: 480px;
  width: 100%;
  padding: 32px 24px;
  text-align: center;
}

.accounts-empty-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--gb);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-blue);
}

.accounts-empty h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--tp);
  margin-bottom: 10px;
}

.accounts-empty p {
  font-size: 13px;
  color: var(--ts);
  line-height: 1.5;
  margin-bottom: 14px;
}

.accounts-empty .accounts-ready,
.accounts-empty .accounts-err {
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 8px;
}

.accounts-empty .primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-blue);
  color: #fff;
  border: 0;
  border-radius: var(--radius-md);
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin: 8px 0;
  transition: transform 0.15s var(--ease-out);
}

.accounts-empty .primary-btn:active {
  transform: scale(0.96);
}

.accounts-empty .primary-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.accounts-empty-hint {
  font-size: 11px;
  color: var(--tm);
  margin-top: 8px;
}

/* ── Hide account logo on very small screens to save space ── */
@media (max-width: 360px) {
  .account-logo-btn .account-logo-dot {
    top: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
  }
}

/* ── Accounts auth banner ── */
.accounts-auth-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  border: 1px solid transparent;
  animation: slideIn 0.25s var(--ease-out);
}
.accounts-auth-banner svg { flex-shrink: 0; }
.accounts-auth-banner.ok {
  background: rgba(5, 150, 105, 0.12);
  color: var(--accent-green);
  border-color: rgba(5, 150, 105, 0.3);
}
.accounts-auth-banner.warn {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-amber);
  border-color: rgba(245, 158, 11, 0.3);
}
.accounts-auth-banner.info {
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-blue);
  border-color: rgba(59, 130, 246, 0.3);
}
.accounts-auth-banner.err {
  background: rgba(220, 38, 38, 0.12);
  color: var(--accent-red);
  border-color: rgba(220, 38, 38, 0.3);
}

/* ── Accounts Tab — Android-style card layout ── */
.acc-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0;
}

.acc-card {
  background: var(--gb);
  border: 1px solid var(--gb-bdr);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.acc-card-center {
  align-items: center;
  text-align: center;
  padding: 32px 20px;
}

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

.acc-status-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--gb-bdr);
  color: var(--ts);
}
.acc-status-icon.logged_in {
  background: rgba(5, 150, 105, 0.15);
  color: var(--accent-green);
}
.acc-status-icon.not_logged_in {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
}
.acc-status-icon.unknown {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
}

.acc-card-info {
  flex: 1;
  min-width: 0;
}

.acc-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--tp);
}

.acc-card-sub {
  font-size: 12px;
  color: var(--tm);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.acc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.acc-auth-tag {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  background: var(--gb-bdr);
  border-radius: 20px;
  align-self: flex-start;
}

/* Action buttons — Android Material style */
.acc-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.acc-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 16px;
  background: var(--accent-blue);
  color: #fff;
  border: 0;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.15s;
}
.acc-btn-primary:active {
  transform: scale(0.98);
  opacity: 0.9;
}
.acc-btn-primary:disabled {
  opacity: 0.6;
  cursor: wait;
}

.acc-btn-row {
  display: flex;
  gap: 8px;
}

.acc-btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  padding: 12px 8px;
  background: var(--gb);
  color: var(--tp);
  border: 1px solid var(--gb-bdr);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.acc-btn-secondary:active {
  background: var(--gb-bdr);
}

.acc-btn-danger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  color: var(--accent-red);
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.acc-btn-danger:active {
  background: rgba(220, 38, 38, 0.1);
}

/* Info section */
.acc-info {
  background: var(--gb);
  border: 1px solid var(--gb-bdr);
  border-radius: 12px;
  padding: 4px 16px;
}

.acc-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--gb-bdr);
  font-size: 13px;
}
.acc-info-row:last-child {
  border-bottom: 0;
}
.acc-info-row > span:first-child {
  color: var(--tm);
}
.acc-info-row > span:last-child {
  color: var(--tp);
  font-weight: 500;
  text-align: right;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Custom Notification animations ── */
@keyframes slideInDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes slideOutUp {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(-100%); opacity: 0; }
}

/* ── Account login label ── */
.account-login-label {
  display: inline-block;
}
@media (max-width: 400px) {
  .account-login-label { display: none; }
}

/* ── Dark mode dropdown fix ── */
.field-input option {
  background: #1a1a1a;
  color: #fff;
}
select.field-input {
  background: var(--gb);
  color: var(--tp);
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
