:root {
  --bg-primary: #000000;
  --bg-secondary: #0a0a0f;
  --bg-tertiary: #14141f;
  --bg-card: #1a1a2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent-primary: #00d4ff;
  --accent-secondary: #00ff88;
  --accent-warm: #ff9f43;
  --danger: #ff4466;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.4);
  --success: #00ff88;
  --warning: #ffaa00;
  --info: #00b4d8;

  --sev-critical: #ff4466;
  --sev-high: #ff9f43;
  --sev-medium: #ffaa00;
  --sev-low: #00d4ff;
  --sev-possible: #a0a0b0;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

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

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  width: 600px;
  height: 600px;
  overflow: hidden;
}

#app {
  width: 600px;
  height: 600px;
  position: relative;
}

.screen {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 0;
  left: 0;
}
.screen.hidden { display: none; }

.header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-secondary);
  gap: 12px;
  flex-shrink: 0;
  min-height: 64px;
}
.header h1 {
  font-size: 22px;
  font-weight: 600;
  flex: 1;
}
.header-meta {
  font-size: 13px;
  color: var(--text-secondary);
}
.status-pill {
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  background: rgba(160, 160, 176, 0.18);
  color: var(--text-secondary);
}
.status-pill[data-status="connected"] {
  background: rgba(0, 255, 136, 0.18);
  color: var(--success);
}
.status-pill[data-status="connecting"] {
  background: rgba(0, 212, 255, 0.18);
  color: var(--accent-primary);
}
.status-pill[data-status="error"], .status-pill[data-status="disconnected"] {
  background: rgba(255, 68, 102, 0.18);
  color: var(--danger);
}
.back-btn {
  background: transparent;
  color: var(--text-primary);
  font-size: 22px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  min-width: 44px;
  min-height: 44px;
}

.content {
  flex: 1;
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.focusable {
  transition: all 0.15s ease;
  border: 2px solid transparent;
  cursor: pointer;
  min-height: 44px;
}
.focusable:focus {
  outline: none;
  border-color: var(--focus-ring);
  box-shadow: 0 0 20px var(--focus-glow);
}

.nav-bar {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  background: var(--bg-secondary);
  flex-shrink: 0;
}
.nav-item {
  flex: 1;
  min-height: 88px;
  padding: 14px 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 17px;
  font-weight: 600;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.04em;
}
.nav-item:focus { background: var(--bg-card); }

.awaiting-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  text-align: center;
}
.awaiting-pulse {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 2px solid var(--accent-primary);
  box-shadow: 0 0 32px var(--focus-glow);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50%      { transform: scale(1.08); opacity: 1; }
}
.awaiting-label {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
}
.awaiting-sub {
  font-size: 14px;
  color: var(--text-secondary);
}

.finding-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  border: 2px solid var(--bg-tertiary);
}
.severity-band {
  padding: 10px 16px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  color: #0a0a0f;
  background: var(--sev-possible);
}
.severity-band.sev-CRITICAL { background: var(--sev-critical); color: #ffffff; }
.severity-band.sev-HIGH     { background: var(--sev-high); color: #0a0a0f; }
.severity-band.sev-MEDIUM   { background: var(--sev-medium); color: #0a0a0f; }
.severity-band.sev-LOW      { background: var(--sev-low); color: #0a0a0f; }
.severity-band.sev-POSSIBLE { background: var(--sev-possible); color: #0a0a0f; }

.finding-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.finding-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}
.finding-confidence {
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}
.finding-citation {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-primary);
  padding: 6px 10px;
  background: rgba(0, 212, 255, 0.10);
  border-radius: var(--radius-sm);
  align-self: flex-start;
}
.finding-meta {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.3;
}

.action-row {
  display: flex;
  gap: 8px;
}
.action-btn {
  flex: 1;
  min-height: 88px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 2px solid transparent;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.action-btn:focus {
  border-color: var(--focus-ring);
  box-shadow: 0 0 20px var(--focus-glow);
  background: var(--bg-card);
}
.action-btn.confirm { background: rgba(0, 255, 136, 0.18); }
.action-btn.confirm:focus { background: rgba(0, 255, 136, 0.30); }
.action-btn.dismiss { background: var(--bg-tertiary); }
.action-btn.flag    { background: rgba(255, 159, 67, 0.18); }
.action-btn.flag:focus { background: rgba(255, 159, 67, 0.30); }

.action-btn.is-confirmed { background: var(--success); color: #0a0a0f; }
.action-btn.is-dismissed { background: var(--text-muted); color: #0a0a0f; }
.action-btn.is-flagged   { background: var(--accent-warm); color: #0a0a0f; }

/* --- Reconnect indicator (KI-035) --- */
.reconnect-indicator {
  position: fixed;
  bottom: 110px;
  right: 16px;
  background: rgba(255, 159, 67, 0.18);
  color: var(--accent-warm);
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  z-index: 200;
  pointer-events: none;
  opacity: 1;
  transition: opacity 400ms ease;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 280px;
}
.reconnect-indicator.fade-out { opacity: 0; }
.reconnect-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-warm);
  animation: pulse 1s ease-in-out infinite;
  flex-shrink: 0;
}

.hidden { display: none !important; }
.text-muted { color: var(--text-secondary); }
