:root {
  color-scheme: dark;
  --bg: #111111;
  --surface: #191919;
  --surface-soft: #151515;
  --text: #eeeeeb;
  --muted: #9a9a95;
  --accent: #e67832;
  --accent-hover: #f08a45;
  --danger: #e66d66;
  --line: #343432;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 Arial, Helvetica, sans-serif;
}

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

.site-header {
  width: min(960px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.identity {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 14px;
}

.identity form { display: inline; }

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
}

main {
  width: min(720px, calc(100% - 40px));
  margin: 64px auto;
}

.panel {
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid var(--line);
  background: var(--surface);
}

.narrow { max-width: 480px; margin: 0 auto; }

h1 {
  margin: 0 0 28px;
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.15;
}

h2 { font-size: 16px; }

.step-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
}

.story { white-space: pre-line; }

.question {
  margin: 32px 0;
  padding-left: 16px;
  border-left: 3px solid var(--accent);
}

.hints {
  margin: 28px 0;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

label {
  display: block;
  margin: 18px 0;
  color: var(--text);
  font-size: 14px;
}

input {
  width: 100%;
  margin-top: 7px;
  padding: 12px 14px;
  border: 1px solid #494946;
  border-radius: 2px;
  background: #101010;
  color: var(--text);
  font: inherit;
}

input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

select {
  min-width: 170px;
  padding: 10px 12px;
  border: 1px solid #494946;
  border-radius: 2px;
  background: #101010;
  color: var(--text);
  font: inherit;
}

select:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

button,
.button {
  display: inline-block;
  padding: 11px 17px;
  border: 1px solid var(--accent);
  border-radius: 2px;
  background: var(--accent);
  color: #17100c;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #17100c;
}

.landing-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.answer-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.answer-row input { margin: 0; }

.flash {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.flash.error { color: var(--danger); border-color: #693a37; }
.flash.success { border-color: #586b43; }
.muted { color: var(--muted); font-size: 14px; }
.complete { text-align: center; }
.prologue p { margin: 0 0 20px; }
.continue-form { margin-top: 32px; }
.agenda-help {
  margin: 28px 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.agenda-list {
  margin-bottom: 28px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.agenda-item { margin: 0 0 10px; }

.agenda-entry {
  width: 100%;
  display: grid;
  grid-template-columns: 145px 1fr;
  gap: 18px;
  padding: 15px 16px;
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--text);
  text-align: left;
  font-weight: 400;
}

.agenda-entry:hover {
  border-color: #5a5a56;
  background: #1d1d1d;
  color: var(--text);
}

.agenda-time {
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

.agenda-activity strong,
.agenda-activity small { display: block; }

.agenda-activity small {
  margin-top: 2px;
  color: var(--muted);
  font-weight: 400;
}

.agenda-item--maybe .agenda-entry { border-style: dashed; }
.agenda-item--maybe .agenda-time { color: var(--text); }
.agenda-item--removed .agenda-entry { opacity: .42; }
.agenda-item--removed .agenda-activity strong { text-decoration: line-through; }
.schedule-submit { margin-top: 0; }
.sequence-result p { margin: 0 0 20px; }
.sequence-result .button { margin-top: 12px; }

.admin-panel {
  width: min(1100px, calc(100vw - 40px));
  margin-left: 50%;
  transform: translateX(-50%);
}

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td {
  padding: 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}
th { color: var(--muted); font-weight: 400; }
.badge {
  padding: 2px 5px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 11px;
}

@media (max-width: 520px) {
  .site-header { width: min(100% - 28px, 960px); }
  main { width: min(100% - 28px, 720px); margin-top: 28px; }
  .panel { padding: 24px 20px; }
  .answer-row { grid-template-columns: 1fr; }
  .agenda-entry { grid-template-columns: 1fr; gap: 5px; }
  .identity > span { display: none; }
}
