:root {
  color-scheme: light;
  --bg: #f7f6f2;
  --surface: #f9f8f5;
  --surface-2: #fbfbf9;
  --offset: #f0ece6;
  --border: #d8d1c8;
  --text: #23201b;
  --muted: #6f6b64;
  --primary: #0b6b61;
  --primary-text: #f9f8f4;
  --warn: #9c5b10;
  --shadow: 0 10px 24px rgb(31 28 22 / 8%);
  --r: 18px;
}
[data-theme='dark'] {
  color-scheme: dark;
  --bg: #181614;
  --surface: #201d1a;
  --surface-2: #26231f;
  --offset: #2d2924;
  --border: #3a3631;
  --text: #ece6dc;
  --muted: #b8b0a5;
  --primary: #69a99f;
  --primary-text: #171513;
  --warn: #d69a54;
  --shadow: 0 10px 24px rgb(0 0 0 / 28%);
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  font:
    16px/1.6 Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  color: var(--text);
  background:
    radial-gradient(
      circle at top left,
      color-mix(in srgb, var(--primary) 8%, transparent),
      transparent 28%
    ),
    var(--bg);
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1,
.brand {
  font-family: Georgia, 'Times New Roman', serif;
}
h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}
h2 {
  line-height: 1.2;
  overflow-wrap: anywhere;
}
a {
  color: inherit;
}
button,
input,
select,
textarea {
  font: inherit;
}
input,
select,
textarea {
  max-width: 100%;
  width: 100%;
  padding: 0.7rem 0.8rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
textarea {
  min-height: 90px;
  resize: vertical;
}
label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.92rem;
  font-weight: 700;
  min-width: 0;
}
small,
.muted {
  color: var(--muted);
  font-weight: 400;
}
:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent);
  outline-offset: 3px;
}
.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  padding: 1.5rem;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}
.brand {
  display: grid;
  gap: 0.65rem;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  text-decoration: none;
}
.brand img {
  width: 100%;
  max-height: 132px;
  object-fit: contain;
  border-radius: 16px;
  background: #fff;
}
.menu {
  display: grid;
  gap: 0.35rem;
}
.menu-link {
  padding: 0.7rem 0.8rem;
  border: 1px solid transparent;
  border-radius: 12px;
  text-decoration: none;
}
.menu-link:hover,
.menu-link.active {
  background: var(--offset);
  border-color: var(--border);
}
.theme {
  margin-top: auto;
}
.content {
  max-width: 1400px;
  width: 100%;
  min-width: 0;
  padding: 1.5rem;
  display: grid;
  align-content: start;
  gap: 1.5rem;
}
.topbar,
.actions,
.intro,
.event-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.topbar h2 {
  margin: 0.3rem 0 0;
}
.topbar .actions {
  justify-content: flex-end;
}
.card {
  min-width: 0;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: 0 1px 2px rgb(31 28 22 / 6%);
  padding: 1.5rem;
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.85fr);
  gap: 1.5rem;
}
.hero-card {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--primary) 13%, var(--surface)),
    var(--surface)
  );
}
.eyebrow,
.pill,
.status {
  display: inline-flex;
  width: fit-content;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 16%, var(--surface));
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 750;
}
.status {
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 12%, var(--surface));
}
.stats,
.countdown,
.grid {
  display: grid;
  gap: 1rem;
}
.stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 1.5rem;
}
.stats div,
.countdown div,
.quick {
  display: grid;
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
}
.stats span,
.countdown span,
.quick p,
.timeline span {
  color: var(--muted);
  font-size: 0.9rem;
}
.countdown {
  grid-template-columns: repeat(2, 1fr);
  margin: 1rem 0;
  text-align: center;
}
.countdown b {
  font-size: 1.5rem;
}
.stack {
  display: grid;
  gap: 1rem;
}
.button {
  display: inline-flex;
  width: fit-content;
  min-height: 44px;
  padding: 0.6rem 0.9rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 11px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
}
.button.primary {
  color: var(--primary-text);
  background: var(--primary);
  border-color: var(--primary);
}
.button.secondary {
  color: var(--text);
  background: var(--surface-2);
}
.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.quick {
  text-decoration: none;
  min-height: 140px;
}
.quick:hover {
  border-color: var(--primary);
}
.timeline {
  display: grid;
}
.timeline div {
  display: grid;
  gap: 0.1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.timeline div:last-child {
  border: 0;
}
.event {
  display: grid;
  gap: 1rem;
}
.event-head h2 {
  margin: 0.75rem 0 0.2rem;
}
.event-head p {
  margin: 0;
  color: var(--muted);
}
.event-details {
  display: grid;
  grid-template-columns: minmax(190px, 0.7fr) minmax(0, 1.3fr);
  gap: 2rem;
}
.event-details p {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.event-details li {
  margin-bottom: 0.45rem;
}
.registration {
  display: grid;
  gap: 0.8rem;
  min-width: 0;
  padding: 1rem;
  margin: 0.8rem 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
}
.event-select {
  grid-template-columns: auto 1fr;
  align-items: start;
}
.event-select span {
  grid-column: 2;
  color: var(--muted);
  font-weight: 400;
}
.registration-extra {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}
.registration-extra > label:last-child {
  grid-column: 1/-1;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-weight: 500;
}
.check input {
  width: auto;
  margin-top: 0.3rem;
}
.message {
  padding: 0.8rem 1rem;
  border-radius: 11px;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.message.error {
  color: #9d251d;
  background: color-mix(in srgb, #b42318 10%, var(--surface));
  border: 1px solid color-mix(in srgb, #b42318 35%, var(--border));
}
.message.success {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 14%, var(--surface));
}
.auth {
  width: min(100%, 560px);
  margin: auto;
}
.inline {
  color: var(--primary);
}
.notification,
.registration-summary {
  display: grid;
  gap: 0.45rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.admin-user {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) 130px 110px auto;
  gap: 0.75rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}
.admin-user span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
}
footer {
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
  padding: 1rem;
}
.mobile-nav {
  display: none;
}
.consent-details,
.admin-event,
.admin-create {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}
.consent-details summary,
.admin-event summary,
.admin-create summary {
  cursor: pointer;
  font-weight: 700;
}
.consent-details p {
  margin: 1rem 0 0;
  color: var(--muted);
}
.notification.unread {
  border-left: 4px solid var(--primary);
  padding-left: 1rem;
}
.admin-event {
  display: grid;
  gap: 1rem;
}
.admin-event summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.admin-event summary span {
  color: var(--muted);
  font-size: 0.9rem;
}
.button.danger {
  color: #9d251d;
  background: color-mix(in srgb, #b42318 8%, var(--surface));
  border-color: color-mix(in srgb, #b42318 35%, var(--border));
}
.media-folder-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1.5rem;
  max-width: 760px;
}
.media-folder-icon {
  width: 4.25rem;
  height: 4.25rem;
  color: var(--primary);
  padding: 0.9rem;
  border-radius: 1.2rem;
  background: var(--offset);
}
.media-folder-card h2 {
  margin: 0.55rem 0;
}
@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 1rem;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .brand {
    grid-template-columns: 56px 1fr;
    align-items: center;
    text-align: left;
  }
  .brand img {
    height: 56px;
  }
  .menu {
    display: flex;
    overflow: auto;
  }
  .menu-link {
    white-space: nowrap;
  }
  .theme {
    margin-top: 0;
  }
  .hero,
  .event-details {
    grid-template-columns: 1fr;
  }
  .four {
    grid-template-columns: repeat(2, 1fr);
  }
  .admin-user {
    grid-template-columns: 1fr 1fr;
  }
  .admin-user div {
    grid-column: 1/-1;
  }
}
@media (max-width: 640px) {
  body {
    font-size: 15px;
  }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
    padding: 0.65rem 1rem;
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    backdrop-filter: blur(12px);
  }
  .brand {
    grid-template-columns: 42px minmax(0, 1fr);
    font-size: 1rem;
  }
  .brand img {
    width: 42px;
    height: 42px;
    border-radius: 10px;
  }
  .sidebar .menu {
    display: none;
  }
  .theme {
    width: 44px;
    height: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    white-space: nowrap;
    font-size: 0;
  }
  .theme::before {
    content: '☾';
    font-size: 1.25rem;
  }
  .content {
    padding: 1rem 1rem calc(6.6rem + env(safe-area-inset-bottom));
    gap: 1rem;
  }
  .topbar {
    align-items: flex-start;
  }
  .topbar .actions {
    width: 100%;
  }
  .topbar .button {
    flex: 1;
  }
  .card {
    padding: 1rem;
    border-radius: 15px;
  }
  .hero {
    gap: 1rem;
  }
  .hero-card {
    padding: 1.25rem 1rem;
  }
  .stats {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    margin-top: 1rem;
  }
  .stats div {
    padding: 0.75rem;
  }
  .countdown {
    gap: 0.65rem;
  }
  .countdown div {
    padding: 0.8rem 0.5rem;
  }
  .countdown b {
    font-size: 1.3rem;
  }
  .four,
  .two,
  .registration-extra {
    grid-template-columns: 1fr;
  }
  .quick {
    min-height: 0;
    padding: 1rem;
  }
  .event-details {
    gap: 1rem;
  }
  .event-head,
  .intro {
    align-items: flex-start;
  }
  .event-details p {
    overflow-wrap: anywhere;
  }
  .registration {
    padding: 0.8rem;
  }
  .registration-extra > label:last-child {
    grid-column: auto;
  }
  .admin-user {
    grid-template-columns: 1fr;
  }
  .admin-user div {
    grid-column: auto;
  }
  .mobile-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    padding: 0.45rem max(0.5rem, env(safe-area-inset-right))
      calc(0.45rem + env(safe-area-inset-bottom)) max(0.5rem, env(safe-area-inset-left));
    border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    backdrop-filter: blur(12px);
    box-shadow: 0 -8px 22px rgb(31 28 22 / 8%);
  }
  .mobile-nav-link {
    display: grid;
    place-items: center;
    min-height: 48px;
    padding: 0.25rem;
    border-radius: 10px;
    color: var(--muted);
    font-size: 0.66rem;
    line-height: 1.1;
    text-align: center;
    text-decoration: none;
    overflow-wrap: anywhere;
  }
  .mobile-nav-link.active {
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 14%, var(--surface));
    font-weight: 750;
  }
  footer {
    padding-bottom: 0.25rem;
  }
}
