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

:root {
  --bg-0: #0a0b0d; --bg-1: #111318; --bg-2: #181b22; --bg-3: #1e2229; --bg-4: #252932;
  --border: rgba(255,255,255,0.07); --border-hover: rgba(255,255,255,0.15);
  --text-1: #f0f2f5; --text-2: #a0a8b8; --text-3: #606878;
  --accent: #6366f1; --accent-hover: #7c7ff5; --accent-dim: rgba(99,102,241,0.15);
  --green: #22c55e; --red: #ef4444; --yellow: #f59e0b; --orange: #f97316;
  --radius: 10px; --radius-sm: 6px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4); --shadow-lg: 0 8px 48px rgba(0,0,0,0.6);
  --font: 'Inter', system-ui, sans-serif; --mono: 'JetBrains Mono', monospace;
  --sidebar-width: 220px; --topbar-h: 52px; --transition: 0.18s ease;
}

html, body { height: 100%; font-family: var(--font); background: var(--bg-0); color: var(--text-1); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }

/* ─── Auth ──────────────────────────────────────────────────────────────────── */
.auth-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(ellipse at 30% 20%, rgba(99,102,241,0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 80%, rgba(99,102,241,0.05) 0%, transparent 60%), var(--bg-0); }
.auth-box { background: var(--bg-1); border: 1px solid var(--border); border-radius: 16px; padding: 36px; width: 100%; max-width: 400px; box-shadow: var(--shadow-lg); }
.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.logo-icon { font-size: 22px; color: var(--accent); filter: drop-shadow(0 0 8px rgba(99,102,241,0.5)); }
.logo-text { font-size: 17px; font-weight: 700; letter-spacing: 0.15em; }
.auth-title { font-size: 20px; font-weight: 600; }
.auth-sub { color: var(--text-3); margin-top: 4px; margin-bottom: 22px; font-size: 13px; }
.auth-hint { color: var(--text-3); margin-top: 16px; font-size: 12px; line-height: 1.5; text-align: center; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }

/* ─── Form Elements ─────────────────────────────────────────────────────────── */
.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-group label { font-size: 11px; font-weight: 500; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.06em; }
.field-hint { font-size: 11px; color: var(--text-3); font-weight: 400; text-transform: none; letter-spacing: normal; }
.text-subtle { color: var(--text-3); font-size: 12px; }
.textarea-mono { font-family: var(--mono); font-size: 12px; line-height: 1.6; }

input[type="text"], input[type="password"], select, textarea {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-1); font-family: var(--font); font-size: 14px; padding: 10px 14px; width: 100%;
  outline: none; transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
select option { background: var(--bg-2); }
.select-input { 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='%23606878' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }
.select-compact { font-size: 12px; padding: 6px 28px 6px 10px; }
.input-with-toggle { position: relative; }
.input-with-toggle input { padding-right: 42px; }
.toggle-visibility { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-3); padding: 4px; display: flex; align-items: center; transition: color var(--transition); }
.toggle-visibility:hover { color: var(--text-2); }
.toggle-visibility svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }

/* ─── Buttons ───────────────────────────────────────────────────────────────── */
.btn-primary { background: var(--accent); color: white; border: none; border-radius: var(--radius-sm); padding: 10px 18px; font-family: var(--font); font-size: 13px; font-weight: 500; cursor: pointer; transition: background var(--transition), transform var(--transition); display: inline-flex; align-items: center; gap: 6px; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-full { width: 100%; justify-content: center; }
.btn-ghost { background: transparent; color: var(--text-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 7px 12px; font-family: var(--font); font-size: 12px; cursor: pointer; transition: all var(--transition); display: inline-flex; align-items: center; gap: 6px; }
.btn-ghost:hover { border-color: var(--border-hover); color: var(--text-1); }
.btn-ghost svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-danger { background: rgba(239,68,68,0.1); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); border-radius: var(--radius-sm); padding: 6px 12px; font-size: 12px; font-family: var(--font); cursor: pointer; transition: all var(--transition); display: inline-flex; align-items: center; gap: 5px; }
.btn-danger:hover { background: rgba(239,68,68,0.2); }
.btn-warning { background: rgba(245,158,11,0.1); color: #fcd34d; border: 1px solid rgba(245,158,11,0.3); border-radius: var(--radius-sm); padding: 6px 12px; font-size: 12px; font-family: var(--font); cursor: pointer; transition: all var(--transition); display: inline-flex; align-items: center; gap: 5px; }
.btn-warning:hover { background: rgba(245,158,11,0.2); }

/* ─── Messages ──────────────────────────────────────────────────────────────── */
.error-msg { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); border-radius: var(--radius-sm); color: #fca5a5; padding: 10px 14px; font-size: 13px; }
.msg-box { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; }
.msg-box.success { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3); color: #86efac; }
.msg-box.error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }

/* ─── App Layout ────────────────────────────────────────────────────────────── */
#app { display: flex; height: 100vh; overflow: hidden; }
.mobile-topbar { display: none; }

/* ─── Sidebar ───────────────────────────────────────────────────────────────── */
.sidebar { width: var(--sidebar-width); background: var(--bg-1); border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; z-index: 200; }
.sidebar-close-btn { display: none; }
.sidebar-overlay { display: none; }
.sidebar-header { display: flex; align-items: center; gap: 10px; padding: 16px 14px; border-bottom: 1px solid var(--border); }
.sidebar-header .logo-icon { font-size: 17px; }
.sidebar-header .logo-text { font-size: 14px; font-weight: 700; letter-spacing: 0.12em; flex: 1; }
.sidebar-nav { flex: 1; padding: 8px 6px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text-2); text-decoration: none; font-size: 13px; font-weight: 450; transition: all var(--transition); cursor: pointer; }
.nav-item svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; flex-shrink: 0; }
.nav-item:hover { background: var(--bg-3); color: var(--text-1); }
.nav-item.active { background: var(--accent-dim); color: var(--accent); }
.nav-item.active svg { stroke: var(--accent); }
.sidebar-footer { padding: 12px 10px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.user-info { flex: 1; display: flex; align-items: center; gap: 8px; overflow: hidden; }
.user-avatar { width: 30px; height: 30px; border-radius: 8px; background: var(--accent-dim); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.user-meta { flex: 1; overflow: hidden; }
#user-name { font-size: 13px; font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 10px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; }
.logout-btn { background: none; border: none; cursor: pointer; color: var(--text-3); padding: 6px; border-radius: 6px; display: flex; align-items: center; transition: all var(--transition); flex-shrink: 0; }
.logout-btn:hover { color: var(--red); background: rgba(239,68,68,0.1); }
.logout-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }

/* ─── Main Content ──────────────────────────────────────────────────────────── */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.view { display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.view.hidden { display: none !important; }
.view.active { display: flex; }
.view-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--bg-1); flex-shrink: 0; }
.view-header h2 { font-size: 15px; font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 8px; }

/* ─── Daily Report ──────────────────────────────────────────────────────────── */
.daily-report-card { border-bottom: 1px solid var(--border); background: linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 100%); flex-shrink: 0; padding: 18px 20px 16px; }
.daily-report-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.daily-report-heading { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.daily-report-eyebrow { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); flex-shrink: 0; }
.daily-report-date { font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.daily-report-expand-btn { display: flex; align-items: center; gap: 6px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; font-size: 12px; color: var(--text-2); cursor: pointer; font-family: var(--font); transition: all var(--transition); flex-shrink: 0; }
.daily-report-expand-btn:hover { border-color: var(--border-hover); color: var(--text-1); }
.daily-report-chevron { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; transition: transform var(--transition); }
.daily-report-card.expanded .daily-report-chevron { transform: rotate(180deg); }

.daily-report-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.kpi-tile { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.kpi-label { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--text-3); margin-bottom: 7px; }
.kpi-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.kpi-dot.good { background: var(--green); }
.kpi-dot.bad { background: var(--red); }
.kpi-dot.neutral { background: var(--accent); }
.kpi-dot.action { background: var(--orange); }
.kpi-value { font-size: 18px; font-weight: 600; color: var(--text-1); line-height: 1; }
.kpi-value-bar { display: flex; align-items: center; gap: 10px; height: 18px; }
.kpi-inline-bar { flex: 1; }
.kpi-bar-pct { font-size: 18px; font-weight: 600; color: var(--text-1); flex-shrink: 0; font-variant-numeric: tabular-nums; }

.daily-report-body { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.daily-report-section { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.daily-report-section label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); margin-bottom: 8px; }
.md-body { font-size: 12.5px; line-height: 1.65; color: var(--text-2); max-height: 320px; overflow-y: auto; }
.md-body .md-h { color: var(--text-1); font-weight: 600; margin: 14px 0 6px; }
.md-body .md-h:first-child { margin-top: 0; }
.md-body .md-h1 { font-size: 15px; }
.md-body .md-h2 { font-size: 13.5px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.md-body .md-h3 { font-size: 12.5px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.03em; }
.md-body .md-p { margin: 0 0 8px; }
.md-body strong { color: var(--text-1); font-weight: 600; }
.md-body .md-list { margin: 0 0 10px; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.md-body .md-list li { padding-left: 2px; }
.md-body .md-inline-code { font-family: var(--mono); font-size: 11.5px; background: var(--bg-0); border: 1px solid var(--border); border-radius: 3px; padding: 1px 5px; color: var(--accent); }
.md-body .md-code { font-family: var(--mono); font-size: 11.5px; background: var(--bg-0); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin: 0 0 10px; overflow-x: auto; white-space: pre; color: var(--text-2); }

/* ─── Dashboard overview ─────────────────────────────────────────────────────── */
.dashboard-overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0; }

/* ─── Console ───────────────────────────────────────────────────────────────── */
.console-container { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
.output-area { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }

.message-block { display: flex; flex-direction: column; gap: 4px; animation: fadeIn 0.18s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.message-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-3); flex-wrap: wrap; }
.message-role { font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; }
.message-role.user { color: var(--accent); }
.message-role.assistant { color: var(--green); }
.message-badge { background: var(--bg-3); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; font-size: 10px; }
.message-badge.loop-badge { border-color: rgba(249,115,22,0.3); color: var(--orange); background: rgba(249,115,22,0.1); }
.message-content { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; font-size: 14px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.message-content.user-msg { background: var(--accent-dim); border-color: rgba(99,102,241,0.2); }
.message-content.streaming { border-color: rgba(34,197,94,0.3); }
.message-content.error-content { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.25); color: #fca5a5; }
.message-content code { font-family: var(--mono); background: var(--bg-3); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; font-size: 12px; }
.message-content pre { background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; overflow-x: auto; margin: 8px 0; font-family: var(--mono); font-size: 12px; }
.console-tool { background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; margin: 8px 0; white-space: normal; }
.console-tool-call { font-size: 12.5px; }
.console-tool-call code { font-family: var(--mono); background: var(--bg-1); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; font-size: 11.5px; color: var(--orange); }
.console-tool pre { background: var(--bg-1); margin: 6px 0 0; max-height: 220px; }
.message-content pre code { background: none; border: none; padding: 0; }
.cursor { display: inline-block; width: 2px; height: 1em; background: var(--green); vertical-align: text-bottom; animation: blink 1s step-end infinite; margin-left: 1px; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ─── Selector Bar ──────────────────────────────────────────────────────────── */
.selector-bar { display: flex; align-items: center; gap: 8px; padding: 10px 20px; border-top: 1px solid var(--border); background: var(--bg-1); flex-wrap: wrap; }
.selector-pill { display: flex; align-items: center; gap: 6px; padding: 6px 12px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 20px; cursor: pointer; font-family: var(--font); font-size: 12px; color: var(--text-2); transition: all var(--transition); white-space: nowrap; }
.selector-pill:hover { border-color: var(--accent); color: var(--accent); }
.selector-pill.active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.selector-pill.active-multi { border-color: var(--orange); color: var(--orange); background: rgba(249,115,22,0.1); }
.pill-chevron { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; flex-shrink: 0; }

/* ─── Input ─────────────────────────────────────────────────────────────────── */
.input-container { border-top: 1px solid var(--border); padding: 12px 20px; background: var(--bg-1); flex-shrink: 0; }
.input-row { display: flex; gap: 8px; align-items: flex-end; }
.command-textarea { flex: 1; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-1); font-family: var(--font); font-size: 14px; padding: 10px 14px; resize: none; outline: none; transition: border-color var(--transition), box-shadow var(--transition); line-height: 1.6; min-height: 48px; max-height: 180px; }
.command-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.send-btn { width: 42px; height: 42px; border-radius: var(--radius-sm); background: var(--accent); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all var(--transition); }
.send-btn:hover { background: var(--accent-hover); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.send-btn svg { width: 17px; height: 17px; fill: none; stroke: white; stroke-width: 1.8; stroke-linecap: round; }
.input-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.char-count { font-size: 11px; color: var(--text-3); }

/* ─── Status ────────────────────────────────────────────────────────────────── */
.status-badge { display: flex; align-items: center; gap: 5px; font-size: 11px; padding: 4px 10px; border-radius: 20px; border: 1px solid; white-space: nowrap; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.status-connecting { color: var(--yellow); border-color: rgba(245,158,11,0.3); background: rgba(245,158,11,0.08); }
.status-connecting .status-dot { background: var(--yellow); animation: pulse 1.5s ease infinite; }
.status-connected { color: var(--green); border-color: rgba(34,197,94,0.3); background: rgba(34,197,94,0.08); }
.status-connected .status-dot { background: var(--green); }
.status-error { color: var(--red); border-color: rgba(239,68,68,0.3); background: rgba(239,68,68,0.08); }
.status-error .status-dot { background: var(--red); }
.status-dot-only { width: 8px; height: 8px; border-radius: 50%; }
.status-dot-only.status-connecting { background: var(--yellow); animation: pulse 1.5s ease infinite; }
.status-dot-only.status-connected { background: var(--green); }
.status-dot-only.status-error { background: var(--red); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ─── History ───────────────────────────────────────────────────────────────── */
.history-list { flex: 1; overflow-y: auto; padding: 14px 20px; display: flex; flex-direction: column; gap: 8px; }
.history-item { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; cursor: pointer; transition: all var(--transition); display: flex; align-items: center; gap: 12px; }
.history-item:hover { border-color: var(--border-hover); background: var(--bg-2); }
.h-status { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.h-status.done { background: var(--green); } .h-status.error { background: var(--red); }
/* 'partial' = ran to completion but was incomplete (tool budget exhausted /
   couldn't finish) — amber so it reads as "attention", clearly distinct from
   both the green success and the red hard failure. */
.h-status.partial { background: var(--yellow); }
.h-status.failed { background: var(--red); }
.h-status.running { background: var(--yellow); animation: pulse 1.5s ease infinite; }
.h-status.pending { background: var(--text-3); }
.history-info { flex: 1; overflow: hidden; }
.history-title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-meta { font-size: 11px; color: var(--text-3); margin-top: 2px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.history-tag { background: var(--bg-3); border-radius: 3px; padding: 1px 5px; font-size: 10px; }
.history-tag.loop-tag { background: rgba(249,115,22,0.1); color: var(--orange); }
.h-delete { background: none; border: none; cursor: pointer; color: var(--text-3); padding: 4px; border-radius: 4px; transition: all var(--transition); flex-shrink: 0; display: flex; }
.h-delete:hover { color: var(--red); background: rgba(239,68,68,0.1); }
.h-delete svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }

/* ─── Logs ──────────────────────────────────────────────────────────────────── */
.log-item { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; transition: all var(--transition); }
.log-item:hover { border-color: var(--border-hover); background: var(--bg-2); }
.log-item.flagged { border-color: rgba(245,158,11,0.4); }
.log-header { display: flex; align-items: flex-start; gap: 12px; }
.log-flag-btn { flex-shrink: 0; background: none; border: none; cursor: pointer; padding: 2px; color: var(--text-3); display: flex; margin-top: 2px; }
.log-flag-btn:hover { color: var(--yellow); }
.log-flag-btn.active { color: var(--yellow); }
.log-flag-btn svg { width: 16px; height: 16px; }
.log-icon { flex-shrink: 0; margin-top: 6px; }
.log-icon .h-status { width: 8px; height: 8px; }
.log-info { flex: 1; overflow: hidden; }
.log-title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-meta { font-size: 11px; color: var(--text-3); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.log-preview { font-size: 12px; color: var(--text-3); margin-top: 8px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-family: var(--mono); background: var(--bg-2); border-radius: var(--radius-sm); padding: 6px 10px; }
.duration-badge { background: var(--bg-3); border-radius: 4px; padding: 1px 6px; font-size: 10px; color: var(--text-3); font-family: var(--mono); }

/* ─── Card Grid ─────────────────────────────────────────────────────────────── */
.card-grid { flex: 1; overflow-y: auto; padding: 16px 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; align-content: start; }
.mgmt-card { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 10px; transition: border-color var(--transition); }
.mgmt-card:hover { border-color: var(--border-hover); }
.card-head { display: flex; align-items: flex-start; gap: 12px; }
.card-avatar { font-size: 26px; line-height: 1; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--text-2); }
.card-title-group { flex: 1; overflow: hidden; }
.card-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-role { font-size: 11px; color: var(--accent); margin-top: 2px; }
.card-desc { font-size: 12px; color: var(--text-3); line-height: 1.5; }
.card-preview { font-size: 11px; color: var(--text-3); font-family: var(--mono); background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; max-height: 70px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; line-height: 1.5; }
.card-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Loops card specific */
.loop-card { border-left: 3px solid rgba(249,115,22,0.4); }
.loop-card:hover { border-left-color: var(--orange); }
.loop-md-preview { font-size: 11.5px; color: var(--text-2); background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; max-height: 80px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; line-height: 1.6; white-space: pre-wrap; }

/* ─── Users ─────────────────────────────────────────────────────────────────── */
.users-list { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; }
.user-row { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; display: flex; align-items: center; gap: 14px; }
.user-row.inactive { opacity: 0.55; }
.user-row-avatar { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-dim); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; flex-shrink: 0; }
.user-row-info { flex: 1; overflow: hidden; }
.user-row-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.role-badge { font-size: 10px; padding: 2px 7px; border-radius: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.role-badge.admin { background: rgba(99,102,241,0.15); color: var(--accent); }
.role-badge.user { background: var(--bg-3); color: var(--text-3); }
.suspended-badge { font-size: 10px; padding: 2px 7px; border-radius: 10px; background: rgba(239,68,68,0.1); color: #fca5a5; }
.user-row-meta { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.user-row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ─── Settings ──────────────────────────────────────────────────────────────── */
#view-settings { overflow-y: auto; }
.settings-grid { padding: 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; align-content: start; }
.settings-card { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.settings-card h3 { font-size: 14px; font-weight: 600; }
.settings-textarea { resize: vertical; min-height: 80px; font-family: var(--font); }
.info-card { background: var(--bg-2); }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 0; }
.info-label { font-size: 12px; color: var(--text-3); }
.info-val { font-size: 12px; color: var(--text-2); font-family: var(--mono); }

/* ─── Bottom Panels ─────────────────────────────────────────────────────────── */
.panel-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 400; }
.bottom-panel { position: fixed; bottom: 0; left: var(--sidebar-width); right: 0; z-index: 500; background: var(--bg-1); border-top: 1px solid var(--border); border-radius: 14px 14px 0 0; box-shadow: 0 -8px 32px rgba(0,0,0,0.5); max-height: 60vh; display: flex; flex-direction: column; animation: slideUp 0.22s ease; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.bottom-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.bottom-panel-header h3 { font-size: 14px; font-weight: 600; }
.panel-hint { font-size: 11px; color: var(--text-3); font-weight: 400; margin-left: 6px; }
.panel-close { background: none; border: none; cursor: pointer; color: var(--text-3); font-size: 16px; padding: 4px 8px; border-radius: 4px; transition: all var(--transition); }
.panel-close:hover { color: var(--text-1); background: var(--bg-3); }
.panel-cards { overflow-y: auto; padding: 14px 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.panel-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; transition: all var(--transition); display: flex; align-items: flex-start; gap: 10px; }
.panel-card:hover { border-color: var(--accent); }
.panel-card.selected { border-color: var(--accent); background: var(--accent-dim); }
.panel-card.selected-multi { border-color: var(--orange); background: rgba(249,115,22,0.1); }
.panel-card-icon { font-size: 20px; flex-shrink: 0; line-height: 1; }
.panel-card-info { flex: 1; overflow: hidden; }
.panel-card-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-card-desc { font-size: 11px; color: var(--text-3); margin-top: 2px; line-height: 1.4; }
.panel-card-check { font-size: 14px; flex-shrink: 0; color: var(--orange); }

/* ─── Temp PW ───────────────────────────────────────────────────────────────── */
.temp-pw-display { font-family: var(--mono); font-size: 22px; font-weight: 600; color: var(--accent); background: var(--accent-dim); border: 1px solid rgba(99,102,241,0.3); border-radius: var(--radius); padding: 14px 20px; text-align: center; letter-spacing: 0.08em; user-select: all; }

/* ─── Modal ─────────────────────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 600; padding: 16px; }
.modal { background: var(--bg-1); border: 1px solid var(--border); border-radius: 14px; width: 100%; max-width: 620px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.modal-wide { max-width: 720px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.modal-header h3 { font-size: 15px; font-weight: 600; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--text-3); font-size: 16px; padding: 4px 8px; border-radius: 4px; transition: all var(--transition); }
.modal-close:hover { color: var(--text-1); background: var(--bg-3); }
.modal-body { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-section { display: flex; flex-direction: column; gap: 6px; }
.modal-section label { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; }
.modal-pre { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; font-family: var(--mono); font-size: 12px; white-space: pre-wrap; word-break: break-word; overflow-y: auto; max-height: 250px; line-height: 1.6; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 60px 0; color: var(--text-3); text-align: center; grid-column: 1/-1; }

/* ─── Toast ─────────────────────────────────────────────────────────────────── */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 18px; font-size: 13px; z-index: 1000; box-shadow: var(--shadow); animation: toastIn 0.2s ease; pointer-events: none; white-space: nowrap; }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(8px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

.loading-spinner { display: flex; justify-content: center; padding: 40px 0; grid-column: 1/-1; }
.spinner { width: 26px; height: 26px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ═══ Tablet ≤900px ═══ */
@media (max-width: 900px) {
  :root { --sidebar-width: 200px; }
  .ws-label { display: none; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .settings-grid { grid-template-columns: 1fr 1fr; }
}

/* ═══ Mobile ≤640px ═══ */
@media (max-width: 640px) {
  .mobile-topbar { display: flex; align-items: center; gap: 12px; padding: 0 16px; height: var(--topbar-h); background: var(--bg-1); border-bottom: 1px solid var(--border); flex-shrink: 0; }
  .hamburger-btn { background: none; border: none; cursor: pointer; color: var(--text-2); padding: 6px; display: flex; border-radius: 6px; transition: all var(--transition); }
  .hamburger-btn:hover { color: var(--text-1); background: var(--bg-3); }
  .hamburger-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  .mobile-logo { flex: 1; display: flex; align-items: center; gap: 8px; }
  .mobile-logo .logo-icon { font-size: 17px; }
  .mobile-logo .logo-text { font-size: 14px; font-weight: 700; letter-spacing: 0.12em; }
  #app { flex-direction: column; }
  .main-content { flex: 1; overflow: hidden; }
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 260px; z-index: 500; transform: translateX(-100%); transition: transform 0.25s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 499; opacity: 0; pointer-events: none; transition: opacity 0.25s ease; }
  .sidebar-overlay.visible { opacity: 1; pointer-events: all; }
  .sidebar-close-btn { display: flex; align-items: center; justify-content: center; margin-left: auto; background: none; border: none; cursor: pointer; color: var(--text-3); font-size: 16px; padding: 4px 8px; border-radius: 4px; transition: all var(--transition); }
  #ws-status { display: none; }
  .view-header { padding: 11px 14px; }
  .output-area { padding: 12px 14px; gap: 12px; }
  .selector-bar { padding: 8px 14px; gap: 6px; }
  .selector-pill { font-size: 11px; padding: 5px 9px; }
  .input-container { padding: 10px 14px; }
  .bottom-panel { left: 0; border-radius: 16px 16px 0 0; max-height: 70vh; }
  .panel-cards { grid-template-columns: 1fr 1fr; padding: 12px 14px; gap: 8px; }
  .card-grid { grid-template-columns: 1fr; padding: 12px 14px; }
  .settings-grid { grid-template-columns: 1fr; padding: 14px; }
  .history-list, .users-list { padding: 12px 14px; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal { border-radius: 16px 16px 0 0; max-height: 90vh; max-width: 100%; }
  .auth-box { padding: 28px 20px; }
}

@media (max-width: 380px) {
  .panel-cards { grid-template-columns: 1fr; }
}

/* ─── Tasks ─────────────────────────────────────────────────────────────────── */
.tasks-list { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 16px 20px; overflow-y: auto; }

.task-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; transition: border-color var(--transition); }
.task-card:hover { border-color: var(--border-hover); }
.task-card.status-running { border-left: 3px solid var(--accent); }
.task-card.status-done { border-left: 3px solid var(--green); opacity: 0.75; }
.task-card.status-failed { border-left: 3px solid var(--red); }
.task-card.status-cancelled { border-left: 3px solid var(--text-3); opacity: 0.5; }

.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 500; font-size: 14px; margin-bottom: 4px; }
.task-content-preview { color: var(--text-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 8px; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.task-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--bg-3); color: var(--text-2); }
.task-tag.priority-high { background: rgba(249,115,22,0.12); color: var(--orange); }
.task-tag.eta-tag { background: rgba(99,102,241,0.1); color: var(--accent); }
.task-actions { display: flex; gap: 6px; flex-shrink: 0; }

.task-status-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; padding: 3px 10px; border-radius: 999px; font-weight: 500; }
.task-status-pill.pending { background: rgba(99,102,241,0.12); color: var(--accent); }
.task-status-pill.running { background: rgba(245,158,11,0.12); color: var(--yellow); }
.task-status-pill.done { background: rgba(34,197,94,0.12); color: var(--green); }
.task-status-pill.failed { background: rgba(239,68,68,0.12); color: var(--red); }
.task-status-pill.cancelled { background: var(--bg-3); color: var(--text-3); }
.task-status-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

.sched-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); padding: 5px 10px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--border); }
.sched-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); flex-shrink: 0; }
.sched-status.active .sched-dot { background: var(--green); box-shadow: 0 0 6px var(--green); animation: pulse 2s infinite; }
.sched-status.inactive .sched-dot { background: var(--text-3); }
.sched-status.rate-limited { border-color: rgba(245,158,11,0.4); }
.sched-status.rate-limited .sched-dot { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); animation: pulse 1s infinite; }

.task-info-bar { background: rgba(99,102,241,0.08); border: 1px solid rgba(99,102,241,0.2); border-radius: var(--radius-sm); margin: 0 20px 8px; padding: 8px 14px; font-size: 12px; color: var(--text-2); }

.nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; background: var(--accent); color: white; font-size: 10px; font-weight: 600; border-radius: 999px; padding: 0 4px; margin-left: auto; }
.nav-badge:empty { display: none; }

@media (max-width: 640px) {
  .tasks-list { padding: 12px 14px; }
  .task-card { flex-direction: column; gap: 8px; }
  /* In column direction, flex's cross-axis stretch alone doesn't stop a
     nowrap/ellipsis child (.task-content-preview) from forcing this box —
     and the card around it — wider than the screen. An explicit width
     gives the ellipsis truncation something concrete to measure against. */
  .task-body { width: 100%; }
  .task-actions { flex-direction: row; flex-wrap: wrap; }
}

/* ─── OAuth status card ─────────────────────────────────────────────────────── */
.oauth-status-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.oauth-status-row:last-child { border-bottom: none; }
.oauth-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.oauth-dot.active { background: var(--green); box-shadow: 0 0 6px var(--green); }
.oauth-dot.expiring { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); }
.oauth-dot.inactive { background: var(--text-3); }
.oauth-dot.error { background: var(--red); }
.oauth-info { flex: 1; }
.oauth-label { font-size: 13px; font-weight: 500; color: var(--text-1); }
.oauth-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.oauth-badge { font-size: 11px; padding: 2px 8px; border-radius: 4px; font-weight: 500; }
.oauth-badge.active { background: rgba(34,197,94,0.12); color: var(--green); border: 1px solid rgba(34,197,94,0.3); }
.oauth-badge.fallback { background: rgba(99,102,241,0.1); color: var(--accent); border: 1px solid rgba(99,102,241,0.3); }
.oauth-badge.none { background: rgba(239,68,68,0.1); color: var(--red); border: 1px solid rgba(239,68,68,0.3); }
.oauth-refresh-hint { background: var(--bg-0); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 12px; color: var(--text-2); margin-top: 10px; }
.oauth-refresh-hint code { font-family: var(--mono); color: var(--accent); background: var(--accent-dim); padding: 2px 5px; border-radius: 3px; }

/* ─── Usage limit ─────────────────────────────────────────────────────────────── */
.usage-window { padding: 12px 0; border-bottom: 1px solid var(--border); }
.usage-window:last-child { border-bottom: none; }
.usage-window-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.usage-window-label { font-size: 13px; font-weight: 500; color: var(--text-1); }
.usage-window-pct { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.usage-bar-track { height: 7px; border-radius: 999px; background: var(--bg-0); border: 1px solid var(--border); overflow: hidden; }
.usage-bar-fill { height: 100%; border-radius: 999px; background: var(--green); transition: width var(--transition); }
.usage-bar-fill.warn { background: var(--yellow); }
.usage-bar-fill.crit { background: var(--red); }
.usage-window-sub { font-size: 11px; color: var(--text-3); margin-top: 5px; }

.usage-mini { display: flex; gap: 16px; margin: 0 20px 12px; padding: 10px 14px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.usage-mini-item { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.usage-mini-head { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); }
.usage-mini-head strong { color: var(--text-2); font-weight: 500; }

/* ─── Attachment upload ──────────────────────────────────────────────────────── */
.attachment-zone { border: 1.5px dashed var(--border); border-radius: var(--radius-sm); padding: 14px 16px; cursor: pointer; transition: border-color var(--transition), background var(--transition); display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 13px; }
.attachment-zone:hover, .attachment-zone.drag-over { border-color: var(--accent); background: var(--accent-dim); color: var(--text-2); }
.attachment-zone input[type="file"] { display: none; }
.attachment-zone svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; flex-shrink: 0; }
.attachment-info { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 10px; margin-top: 6px; }
.attachment-info .attachment-name { font-family: var(--mono); font-size: 11px; color: var(--accent); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-info .attachment-size { color: var(--text-3); font-size: 11px; flex-shrink: 0; }
.attachment-info button { background: none; border: none; color: var(--text-3); cursor: pointer; padding: 2px; font-size: 14px; line-height: 1; flex-shrink: 0; }
.attachment-info button:hover { color: var(--red); }

/* ─── Ergebnisse ─────────────────────────────────────────────────────────────── */
.ergebnisse-list { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.ergebnis-card { background: var(--bg-1); border: 1px solid var(--border); border-left: 3px solid transparent; border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; transition: border-color var(--transition); }
.ergebnis-card:hover { border-color: var(--border-hover); }
.ergebnis-card.unseen { border-left-color: var(--accent); }
.ergebnis-header { display: flex; align-items: flex-start; gap: 10px; }
.ergebnis-ack { display: flex; align-items: center; padding-top: 2px; cursor: pointer; flex-shrink: 0; }
.ergebnis-ack input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.ergebnis-info { flex: 1; min-width: 0; }
.ergebnis-title { font-size: 14px; font-weight: 600; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 7px; }
.ergebnis-new-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; display: inline-block; }
.ergebnis-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.ergebnis-badge { font-size: 11px; color: var(--text-3); background: var(--bg-3); border: 1px solid var(--border); padding: 2px 7px; border-radius: 4px; }
.ergebnis-badge.policy { color: #818cf8; border-color: rgba(129,140,248,0.3); background: rgba(129,140,248,0.08); }
.ergebnis-preview { font-family: var(--mono); font-size: 11px; color: var(--text-3); background: var(--bg-0); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; max-height: 80px; overflow: hidden; white-space: pre; cursor: pointer; transition: max-height 0.3s ease, border-color var(--transition); }
.ergebnis-preview:hover { border-color: var(--border-hover); }
.ergebnis-preview.expanded { max-height: 420px; overflow: auto; }
.ergebnis-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

@media (max-width: 640px) {
  .ergebnisse-list { padding: 12px 14px; }
}

/* ─── 2FA / TOTP ────────────────────────────────────────────────────────────── */
.enforce-banner {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  flex-wrap: wrap; padding: 10px 16px; margin: 0;
  background: rgba(245,158,11,0.12); border-bottom: 1px solid rgba(245,158,11,0.35);
  color: var(--text-1); font-size: 14px; font-weight: 500;
}
.btn-sm { padding: 5px 12px; font-size: 13px; }
.twofa-qr {
  display: flex; justify-content: center; align-items: center;
  background: #fff; border-radius: var(--radius); padding: 14px; margin: 4px auto 14px;
  width: max-content; max-width: 100%;
}
.twofa-qr svg { width: 190px; height: 190px; display: block; }
.twofa-manual { margin: 0 0 14px; font-size: 13px; color: var(--text-2); }
.twofa-manual summary { cursor: pointer; user-select: none; }
.twofa-secret {
  display: block; margin-top: 8px; padding: 8px 10px; font-family: var(--mono);
  font-size: 13px; letter-spacing: 1px; word-break: break-all;
  background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-1);
}
.recovery-list {
  font-family: var(--mono); font-size: 15px; line-height: 1.9; text-align: center;
  background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin: 0 0 16px; color: var(--text-1); white-space: pre-wrap;
}
.twofa-status-line { font-size: 14px; color: var(--text-2); margin: 4px 0 12px; }
.twofa-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.badge-ok { color: var(--green); font-weight: 600; }
.badge-warn {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px;
  background: rgba(245,158,11,0.15); color: var(--yellow); font-weight: 600;
}
.muted { color: var(--text-3); }
