:root {
  --bg: #f7f7f5;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --border: #d9d9d3;
  --panel: #ffffff;
  --accent: #2a5bd7;
  --accent-pressed: #1e45a3;
  --code-bg: #f0f0ec;
  --warning-bg: #fff8e1;
  --warning-border: #e6c87a;
  --focus: #2a5bd7;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --fg: #e8e8e6;
    --muted: #9a9a9a;
    --border: #2a2a2a;
    --panel: #1c1c1c;
    --accent: #6b8cff;
    --accent-pressed: #4a6ae0;
    --code-bg: #222222;
    --warning-bg: #2a2410;
    --warning-border: #8a7a3a;
    --focus: #6b8cff;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
#app {
  max-width: 70ch;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}
h1, h2, h3 { line-height: 1.25; }
code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: var(--code-bg);
}
pre {
  padding: 0.75rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
}
code { padding: 0.1rem 0.3rem; border-radius: 4px; }
pre code { background: transparent; padding: 0; }
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}
.terminal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0;
}
.warning {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}
button, input {
  font: inherit;
}
button {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
}
button:disabled { opacity: 0.5; cursor: not-allowed; }
button:active { background: var(--accent-pressed); }
button:focus-visible, input:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
input[type="text"], input[type="url"] {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--fg);
}
label { display: block; margin-bottom: 0.25rem; font-weight: 600; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.id { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; color: var(--muted); font-size: 0.85rem; }
.progress-item { margin: 0.25rem 0; }
.footer { margin-top: 2rem; border-top: 1px solid var(--border); padding-top: 1rem; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Fix cards */
.fix-section {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
.fix-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin: 0.75rem 0;
  background: var(--panel);
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}
.fix-card-title {
  font-weight: 600;
  margin: 0 0 0.5rem 0;
}
.button-link {
  display: inline-block;
  background: var(--accent);
  color: white !important;
  border-radius: 6px;
  padding: 0.5rem 0.9rem;
  text-decoration: none;
  cursor: pointer;
}
.button-link:active {
  background: var(--accent-pressed);
}
.button-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.fix-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.code-wrap pre.fix-code {
  max-height: 30rem;
  overflow-y: auto;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.code-wrap pre {
  max-height: 30rem;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}
/* Prevent horizontal scroll at 400px: ensure pre wraps */
pre, code {
  max-width: 100%;
  overflow-wrap: anywhere;
}
@media (max-width: 400px) {
  #app { padding: 1rem 0.75rem; }
  pre { white-space: pre-wrap; word-break: break-word; }
}
