:root {
  color-scheme: dark;
  --bg: #0B1020;
  --card: #141A2E;
  --text: #E8EEF9;
  --muted: #C5D0E6;
  --gold: #E6C15A;
  --ink: #1A1404;
  --line: #24304A;
}

* { box-sizing: border-box; }

html { font-size: 20px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, sans-serif;
  line-height: 1.4;
}

main {
  max-width: 40rem;
  margin: 0 auto;
  padding: calc(1rem + env(safe-area-inset-top)) 1rem calc(2rem + env(safe-area-inset-bottom));
}

h1, h2, p, .file span, button, label, a, td, th {
  overflow-wrap: anywhere;
}

h1 { font-size: 2rem; margin: 0 0 0.4rem; text-align: center; }
h2 { font-size: 1.35rem; margin: 0; }
h2.section { margin: 2rem 0 0.4rem; }
p { margin: 0.4rem 0; color: var(--muted); }
.lede { font-size: 1.05rem; }
.note { color: var(--muted); }
strong { color: var(--text); }

.card {
  background: var(--card);
  border-radius: 16px;
  padding: 1rem;
  margin-top: 1rem;
}

.card h2 { margin: 0 0 0.35rem; }
.card p { margin: 0; }

label {
  display: block;
  margin-top: 0.8rem;
  font-weight: 600;
}

input, textarea {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.7rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

button, a.button {
  appearance: none;
  display: inline-block;
  min-height: 48px;
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
}

button.accent, a.button.accent {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
}

a.button.quiet {
  background: var(--line);
  color: var(--text);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.actions.secondary { margin-top: 0.8rem; }

.actions button, .actions a.button { flex: 1 1 9rem; min-width: 8rem; }

.error { color: #f0b4b4; }

.code {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
  text-align: center;
}

canvas, video {
  display: block;
  width: min(100%, 280px);
  margin: 0 auto;
  background: var(--text);
  border-radius: 12px;
}

.file {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.8rem;
}

.file span {
  flex: 1 1 12rem;
  min-width: 0;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
  margin: 1.5rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
  margin-top: 0.6rem;
}

th, td {
  text-align: left;
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

th { color: var(--muted); font-weight: 600; }

tr:last-child td { border-bottom: 0; }

.ask {
  position: fixed;
  inset: 0;
  background: rgba(11, 16, 32, 0.86);
  display: flex;
  align-items: flex-end;
  padding: 1rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom));
}

.ask[hidden], [hidden] { display: none !important; }

@media (min-width: 720px) {
  .grid { grid-template-columns: 1fr 1fr; }
}
