:root {
  --bg: #f4f5f7;
  --paper: #ffffff;
  --ink: #171a21;
  --muted: #5e6772;
  --line: #e4e7ee;
  --soft: #f2f4f7;
  --accent: #111827;
  --accent-ink: #f8fafc;
  --price: #0f766e;
  --danger: #9f1239;
  --danger-bg: #fff1f2;
  --ok: #047857;
  --ok-bg: #ecfdf5;
  --warn-bg: #fff7ed;
  --warn-ink: #9a3412;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 28px rgba(16, 24, 40, 0.05);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
img, svg, video { max-width: 100%; }
a { color: inherit; }
.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  background: #fff;
  padding: 8px 12px;
  border-radius: 8px;
}
.skip:focus { top: 8px; z-index: 20; }
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
}
.brand { min-width: 0; }
.brand a {
  display: inline-block;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}
nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
}
nav a, nav .linkish {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  text-decoration: none;
  border: 0;
  font: inherit;
  line-height: 1.2;
  cursor: pointer;
  text-align: center;
}
nav form { margin: 0; }
main {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 28px 20px 56px;
  min-width: 0;
}
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.03em; }
h1 { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 700; margin: 0 0 8px; }
h2 { font-size: 1.25rem; font-weight: 650; margin: 0; }
.hero { margin-bottom: 20px; }
.hero.slim { margin-bottom: 16px; }
.eyebrow {
  margin: 0 0 6px;
  color: var(--price);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.lead { margin: 0; max-width: 40rem; color: var(--muted); font-size: 1.05rem; }
.banner, .errors, .hint, .meta, .when, .place { overflow-wrap: anywhere; }
.banner {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--warn-bg);
  color: var(--warn-ink);
}
.banner.ok { background: var(--ok-bg); color: var(--ok); }
.errors {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--danger-bg);
  color: var(--danger);
}
.errors ul { margin: 0; padding-left: 1.1rem; }
.grid { display: grid; gap: 12px; }
.card, .event, .ticket-sheet, .auth, .stack, .prose-page, .buy {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 16px;
}
.card-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.card h2 a { text-decoration: none; }
.card h2 a:hover { text-decoration: underline; }
.card-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.card-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  flex: 0 0 auto;
  min-width: 132px;
}
.price { margin: 0; color: var(--price); font-size: 1.15rem; }
.meta, .hint, .when, .place, .foot { color: var(--muted); }
.when, .place, .hint, .meta { margin: 0; }
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}
.event, .prose-page, .ticket-sheet { padding: 22px 20px; }
.event-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.8fr);
  gap: 16px;
  align-items: start;
}
.buy, .stack, .auth { display: grid; gap: 12px; padding: 18px; }
.auth { width: min(440px, 100%); margin: 12px auto; }
label { display: grid; gap: 6px; font-size: 0.95rem; font-weight: 600; min-width: 0; }
input, select, textarea {
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  font: inherit;
  font-weight: 400;
  color: inherit;
  border-radius: 12px;
  border: 1px solid #d5d9e2;
  background: #fff;
  padding: 10px 12px;
}
textarea { min-height: 120px; resize: vertical; }
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  max-width: 100%;
}
button:hover, .button:hover { background: #000; }
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 400;
}
.choice input, .check input { width: auto; min-height: 1.15rem; margin: 0; }
.choice span { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; min-width: 0; }
.choice em { font-style: normal; color: var(--price); font-weight: 700; }
.is-off { opacity: 0.55; }
.check { grid-template-columns: auto minmax(0, 1fr); align-items: start; font-weight: 400; }
.check input { margin-top: 4px; }
fieldset {
  margin: 0;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 10px;
  padding: 12px;
}
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.tickets { margin: 0; padding-left: 1.1rem; display: grid; gap: 8px; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}
.who { overflow-wrap: anywhere; }
.table-scroll {
  width: 100%;
  max-width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: auto;
}
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
}
th { font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
.danger { border-color: #fecdd3; }
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.stat {
  margin: 0;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  gap: 2px;
}
.stat span { color: var(--muted); font-size: 0.82rem; }
.stat strong { font-size: 1.35rem; letter-spacing: -0.03em; }
.type-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.7fr) minmax(0, 0.7fr);
  gap: 8px;
}
.empty { padding: 16px; margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.foot {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 0 20px 28px;
  font-size: 0.92rem;
}
.foot a { color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 800px) {
  .event-layout { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .top { align-items: stretch; padding: 12px 16px; }
  main, .foot { padding-left: 16px; padding-right: 16px; }
  .is-admin nav, .is-login nav { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .is-admin nav form { display: contents; }
  .is-admin nav a, .is-admin nav .linkish, .is-login nav a { width: 100%; }
  .card { flex-direction: column; }
  .card-aside { align-items: stretch; min-width: 0; }
  .card-aside .button, .buy button, .stack button, .auth button { width: 100%; }
  .type-row { grid-template-columns: 1fr; }
  .table-scroll { overflow: visible; background: transparent; border: 0; border-radius: 0; }
  table, thead, tbody, tr, td { display: block; width: 100%; }
  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  tr {
    margin: 0 0 12px;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
  }
  td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border: 0;
    padding: 8px 0;
  }
  td::before {
    content: attr(data-label);
    color: var(--muted);
    flex: 0 0 auto;
    font-size: 0.82rem;
  }
  td[data-label=""]::before { content: none; }
}
