:root {
  color-scheme: dark;
  --bg: #101218;
  --panel: #191c24;
  --panel-2: #21252f;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f4f1ea;
  --muted: #a7a6b0;
  --dim: #7d7c86;
  --accent: #e07a3d;
  --danger: #e06a6a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(224, 122, 61, 0.16), transparent 50%),
    var(--bg);
  color: var(--text);
}

body { min-height: 100vh; }

a { color: inherit; }

button, input, textarea, select { font: inherit; color: inherit; }

.top {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(16, 18, 24, 0.9);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand small {
  display: block;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
  font-size: 12px;
}

nav { display: flex; gap: 8px; align-items: center; }

nav a, .btn, .ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
  cursor: pointer;
}

nav a[aria-current="page"], .btn.primary {
  background: var(--accent);
  border-color: transparent;
  color: #1a100a;
  font-weight: 700;
}

.who { margin-left: auto; color: var(--muted); font-size: 14px; }

.page { padding: 22px; }

.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 14px;
  align-items: start;
}

.column {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 16px;
  min-height: 280px;
  padding: 12px;
}

.column.over { outline: 2px solid var(--accent); }

.column h2 {
  margin: 4px 6px 12px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.column .count { color: var(--dim); font-weight: 600; }

.cards { display: flex; flex-direction: column; gap: 10px; min-height: 80px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow);
  cursor: grab;
}

.card h3 { margin: 8px 0 6px; font-size: 16px; }

.card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.4; }

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
  color: white;
}

.meta { margin-top: 8px; color: var(--dim); font-size: 12px; }

.card a { color: #f0c7a4; }

.note { color: var(--muted); margin: 0 0 14px; }

.toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 14px; }

dialog {
  width: min(520px, calc(100vw - 32px));
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
}

dialog::backdrop { background: rgba(0, 0, 0, 0.55); }

label { display: block; margin: 10px 0 4px; font-size: 13px; color: var(--muted); }

input, textarea, select {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}

textarea { min-height: 90px; resize: vertical; }

.row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

.error { color: var(--danger); min-height: 1.2em; font-size: 14px; }

.gate {
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.gate-card {
  width: min(460px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.eyebrow { margin: 0; color: var(--accent); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; font-size: 12px; }

h1 { margin: 8px 0; font-size: 34px; letter-spacing: -0.03em; }

.lede, .quiet { color: var(--muted); line-height: 1.5; }

.gate-card .btn { width: 100%; margin-top: 10px; }

.btn.google { background: white; color: #1a1a1a; font-weight: 700; }

.message { background: rgba(224, 106, 106, 0.12); border-radius: 10px; padding: 10px 12px; }

table { width: 100%; border-collapse: collapse; }

th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }

th { color: var(--dim); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }

.reveal {
  margin: 14px 0;
  padding: 14px;
  border-radius: 14px;
  background: #24190f;
  border: 1px solid rgba(224, 122, 61, 0.5);
}

.reveal code {
  display: block;
  margin-top: 8px;
  word-break: break-all;
  font-size: 15px;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; margin-bottom: 16px; }

.revoked { color: var(--dim); text-decoration: line-through; }

.preview { margin-top: 10px; }

.preview iframe {
  width: 100%;
  height: 280px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.preview .hint, .hint { color: var(--dim); font-size: 13px; line-height: 1.4; }

.preview a { color: #f0c7a4; font-weight: 700; }

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

.review, .hook {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.review h2, .hook h2 { margin: 0; font-size: 20px; }

.review-head, .hook h2 { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.hook h2 i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }

.review-actions, .hooks { display: flex; flex-direction: column; gap: 10px; }

.review-actions textarea { min-height: 70px; }

.masked { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text); }

.log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 240px;
  max-height: 55vh;
  overflow: auto;
  padding: 8px 0 16px;
}

.bubble {
  max-width: min(640px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 12px;
}

.bubble.mine { margin-left: auto; background: #2a2118; }

.bubble.decision { border-style: dashed; }

.bubble p { margin: 0; }

.who-line, .state { color: var(--dim); font-size: 12px; }

.bubble .who-line { margin-bottom: 4px; }

.composer { margin-top: 8px; }

[data-review-count] {
  display: inline-flex;
  min-width: 1.2em;
  justify-content: center;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: #1a100a;
  color: white;
  font-size: 12px;
}

@media (max-width: 1100px) {
  .board { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .board { grid-template-columns: 1fr; }
  .top { flex-wrap: wrap; }
  .who { margin-left: 0; }
}
