/* Palette reprise de src/ui/theme/tokens.css (voxel cyberpunk), en autonome :
   la PWA est une origine séparée de l'extension, pas de partage de fichier. */
:root {
  --bg: #0b0714;
  --bg-panel: #14102450;
  --bg-panel-solid: #161022;
  --line: #2a2340;
  --text: #f2e9ff;
  --text-muted: #9a8fc2;
  --cyan: #00f0ff;
  --magenta: #ff2fd0;
  --success: #33e39a;
  --warning: #ffcb47;
  --error: #ff4d6d;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  min-height: 100vh;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px calc(env(safe-area-inset-bottom, 0px) + 24px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.view {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.title {
  font-size: 1.4rem;
  margin: 4px 0;
}

.subtitle {
  font-size: 1.05rem;
  margin: 8px 0 0;
  color: var(--text-muted);
}

.muted {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.row--between {
  justify-content: space-between;
}

.pill {
  font-size: 0.8rem;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--bg-panel-solid);
  border: 1px solid var(--line);
}

.card {
  background: var(--bg-panel-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card--clickable {
  cursor: pointer;
}

.card__title {
  font-weight: 600;
  font-size: 1.05rem;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.input {
  width: 100%;
  background: var(--bg-panel-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}

.input--payload {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  font-size: 0.8rem;
  resize: vertical;
}

.btn {
  appearance: none;
  border: 1px solid var(--cyan);
  background: transparent;
  color: var(--cyan);
  border-radius: var(--radius);
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

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

.btn--primary {
  background: var(--cyan);
  color: #051014;
}

.btn--ghost {
  border-color: var(--line);
  color: var(--text-muted);
}

.btn--danger {
  border-color: var(--error);
  color: var(--error);
}

.btn--sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.btn--icon {
  padding: 4px 10px;
}

.banner {
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.banner--error {
  background: #3a1420;
  border: 1px solid var(--error);
  color: var(--error);
}

.progress {
  height: 10px;
  border-radius: 999px;
  background: var(--bg-panel-solid);
  border: 1px solid var(--line);
  overflow: hidden;
}

.progress__fill {
  height: 100%;
  background: var(--cyan);
  transition: width 0.3s ease;
}

.log {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 40vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
  background: var(--bg-panel-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
}

.log__entry {
  font-size: 0.85rem;
  padding: 2px 0;
  border-bottom: 1px solid var(--line);
}

.log__entry:last-child {
  border-bottom: none;
}

.log__entry--error {
  color: var(--error);
}

.log__entry--warning {
  color: var(--warning);
}

.log__entry--success {
  color: var(--success);
}

.log__entry--info {
  color: var(--text-muted);
}
