:root {
  color-scheme: light;
  --bg: #fff7ec;
  --panel: #ffffff;
  --text: #263238;
  --muted: #687381;
  --line: #eadfcb;
  --primary: #0f8b8d;
  --primary-dark: #0a686a;
  --accent: #ffb703;
  --danger: #b42318;
  --success: #e9fff6;
  --shadow: 0 18px 50px rgba(21, 31, 44, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  touch-action: pan-y;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  background: linear-gradient(180deg, rgba(255, 247, 236, 0.98), rgba(248, 250, 252, 0.98));
  color: var(--text);
}

button,
input,
textarea {
  font: inherit;
}

button,
.button-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  background: var(--primary);
  color: white;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button-link:hover {
  background: var(--primary-dark);
}

.secondary {
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
}

.secondary:hover {
  background: #eef2f5;
}

.danger {
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: var(--danger);
}

.danger:hover {
  background: #ffe4e6;
}

.shell {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 20px;
  overflow-x: hidden;
}

.event-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: 100%;
  text-align: center;
}

.brand img {
  width: 86px;
  height: 86px;
  flex: 0 0 auto;
  border: 3px solid white;
  border-radius: 999px;
  background: white;
  box-shadow: 0 0 0 1px var(--line), 0 8px 20px rgba(21, 31, 44, 0.12);
  object-fit: cover;
}

.brand span {
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 900;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1;
}

h2 {
  margin-bottom: 10px;
  font-size: 22px;
}

h3 {
  margin-bottom: 0;
}

.small-link {
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.event-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(21, 31, 44, 0.06);
}

.event-card {
  margin-bottom: 14px;
  padding: 16px;
}

.event-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.event-meta div {
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffaf2;
}

.event-meta strong,
.event-meta span {
  display: block;
}

.event-meta strong {
  margin-bottom: 4px;
  font-size: 18px;
}

.event-meta span,
.location,
.panel p {
  color: var(--muted);
  font-weight: 700;
}

.panel {
  padding: 18px;
}

.success {
  background: var(--success);
}

.stack {
  display: grid;
  gap: 13px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  background: white;
  color: var(--text);
  font-size: 16px;
}

textarea {
  resize: vertical;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.check-line {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--text);
  font-weight: 700;
}

.check-line input {
  width: auto;
  margin-top: 4px;
}

.message {
  margin: 0;
  color: var(--danger);
  font-weight: 800;
}

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

.admin-head p {
  margin-bottom: 0;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.password-form {
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: end;
  margin-top: 0;
}

.wide {
  grid-column: 1 / -1;
}

.participant-list {
  display: grid;
  gap: 10px;
}

.participant-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
}

.participant-item p,
.participant-item small {
  display: block;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.empty {
  margin: 0;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  text-align: center;
}

@media (max-width: 720px) {
  .shell {
    padding: 14px;
  }

  .event-head,
  .admin-head,
  .list-head {
    align-items: flex-start;
  }

  .event-head {
    flex-direction: column;
  }

  .brand img {
    width: 58px;
    height: 58px;
  }

  .event-meta,
  .field-row,
  .settings-grid,
  .participant-item {
    grid-template-columns: 1fr;
  }

  .event-meta div {
    min-height: auto;
  }

  .participant-item button,
  .settings-grid button,
  .button-link {
    width: 100%;
  }
}
