:root {
  color-scheme: dark;
  --bg: #0f1117;
  --panel: #171b25;
  --panel-2: #1d2330;
  --text: #f4f7fb;
  --muted: #aab4c4;
  --line: #2c3547;
  --accent: #8ab4ff;
  --accent-2: #c3d8ff;
  --danger: #ff8f8f;
  --shadow: 0 14px 40px rgb(0 0 0 / 0.35);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgb(70 104 184 / 0.25), transparent 35rem),
    var(--bg);
  color: var(--text);
}

.shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero,
.panel {
  background: rgb(23 27 37 / 0.9);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  margin-bottom: 20px;
}

.panel {
  padding: 22px;
  margin-bottom: 20px;
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
  margin-bottom: 16px;
}

h3 {
  margin-bottom: 10px;
}

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

code,
pre {
  background: #0b0d13;
  border: 1px solid var(--line);
  border-radius: 10px;
}

code {
  padding: 2px 6px;
}

pre {
  padding: 16px;
  overflow: auto;
  line-height: 1.45;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #07101f;
  padding: 10px 14px;
  font-weight: 800;
}

button:hover {
  filter: brightness(1.08);
}

button.secondary,
button.ghost {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
}

button.danger {
  color: #260606;
  background: var(--danger);
}

.event-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.92rem;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #10141d;
  color: var(--text);
  padding: 12px 14px;
}

input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.form-actions {
  display: flex;
  align-items: end;
  gap: 10px;
  grid-column: 1 / -1;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  padding: 6px 10px;
  font-size: 0.82rem;
}

.events-list {
  list-style: none;
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
}

.event-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  background: #111621;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
}

.event-card.dragging {
  opacity: 0.45;
}

.drag-handle {
  user-select: none;
  color: var(--accent-2);
  font-size: 1.5rem;
  cursor: grab;
}

.event-title {
  font-weight: 900;
  margin: 0 0 4px;
}

.event-meta {
  color: var(--muted);
  margin: 0;
}

.event-actions {
  display: flex;
  gap: 8px;
}

details summary {
  cursor: pointer;
  list-style: none;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

details summary h2 {
  display: inline;
}

.list-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 18px;
  padding-top: 16px;
}

.list-editor {
  background: #10141d;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}

.list-add-form {
  display: flex;
  gap: 8px;
}

.list-add-form input {
  min-width: 0;
}

.list-editor ul {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 8px;
}

.list-editor li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  word-break: break-word;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  opacity: 0;
  transform: translateY(10px);
  background: var(--accent);
  color: #07101f;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 900;
  box-shadow: var(--shadow);
  pointer-events: none;
  transition: 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 820px) {
  .hero,
  .section-title,
  details summary {
    align-items: stretch;
    flex-direction: column;
  }

  .event-form,
  .list-grid {
    grid-template-columns: 1fr;
  }

  .event-card {
    grid-template-columns: auto 1fr;
  }

  .event-actions {
    grid-column: 2;
    justify-content: flex-start;
  }
}