:root {
  color-scheme: light;
  --bg: #0f1419;
  --panel: #1b222b;
  --text: #f4f6f8;
  --muted: #a8b3bf;
  --line: #2c3642;
  --accent: #3d8bfd;
  --danger: #e24b4a;
  --warn: #f0c14b;
  --ok: #3cb371;
  --banner: #7a1f1f;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.env-banner {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--banner);
  color: #fff;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 13px;
  padding: 10px 12px;
}

.top,
main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 16px;
}

h1 {
  font-size: 1.4rem;
  margin: 0 0 8px;
}

.origin-status,
.hint,
.lead {
  color: var(--muted);
  margin: 0 0 12px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}

.hidden {
  display: none !important;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
}

.btn:disabled {
  opacity: 0.5;
}

.btn-primary {
  background: var(--accent);
}

.btn-secondary {
  background: #314050;
}

.btn-danger {
  background: var(--danger);
}

.btn-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.session-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.toolbar {
  margin: 12px 0;
}

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

.card {
  background: #12181f;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}

.meta {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 8px;
}

.excerpt,
.post-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  background: #0c1014;
  border-radius: 8px;
  padding: 12px;
  margin: 0;
  font: 15px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.warn {
  color: var(--warn);
}

.error {
  color: var(--danger);
  max-width: 40rem;
  margin: 12px auto;
  padding: 0 16px;
}

.dialog-root {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.64);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 40;
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

.dialog {
  width: min(40rem, 100%);
  background: var(--panel);
  border-radius: 16px;
  padding: 16px;
}

.dialog-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

@media (min-width: 640px) {
  .btn-row,
  .dialog-actions,
  .session-row {
    flex-direction: row;
  }

  .dialog-root {
    align-items: center;
  }
}
