:root {
  color-scheme: dark;
  --bg: #101820;
  --panel: #182534;
  --text: #f3f7fb;
  --muted: #95a6b8;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #35c49f;
  --accent-text: #061411;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100dvh; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  padding: max(env(safe-area-inset-top), 18px) 16px max(env(safe-area-inset-bottom), 18px);
}
.shell {
  width: min(100%, 720px);
  margin: 0 auto;
  display: grid;
  gap: 14px;
}
.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 2px;
}
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 13px; }
h1 { margin: 0; font-size: 28px; letter-spacing: 0; }
.status {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--muted);
  font-size: 12px;
}
.info-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.info-strip span {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  display: grid;
  gap: 10px;
}
label, .result-head { color: var(--muted); font-size: 14px; }
textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  padding: 12px;
  font: inherit;
}
textarea:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.actions, .result-head { display: flex; align-items: center; gap: 10px; }
.result-head { justify-content: space-between; }
button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  font: 650 15px/1 inherit;
  cursor: pointer;
}
button:disabled { opacity: 0.55; cursor: progress; }
.primary { background: var(--accent); color: var(--accent-text); }
.secondary { background: #ffd166; color: #1e1600; }
.subtle { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.icon-button {
  min-height: 34px;
  padding: 0 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}
pre {
  margin: 0;
  min-height: 120px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  font: 14px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.history-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.history-item {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 10px;
}
.history-item button {
  min-height: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.history-item span { color: var(--muted); font-size: 12px; }
.risk-risky { border-left-color: #ffd166; }
.risk-blocked { border-left-color: #ff6b6b; }
@media (max-width: 520px) {
  .info-strip { grid-template-columns: 1fr; }
  .actions { flex-wrap: wrap; }
  button { flex: 1 1 auto; }
}
