:root {
  color-scheme: dark;
  --background: #090909;
  --surface: #17191c;
  --surface-strong: #23272d;
  --border: #493223;
  --orange: #ff7a1a;
  --orange-soft: #ff9a45;
  --brown: #c38b61;
  --text: #f7f7f7;
  --muted: #aeb4bc;
  --green: #63cf7c;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--background); color: var(--text); }
button, input { font: inherit; }
.hidden { display: none !important; }

.app-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 14px;
  padding: max(14px, env(safe-area-inset-top)) 18px 14px;
  background: rgba(9, 9, 9, .94); border-bottom: 2px solid var(--orange);
  backdrop-filter: blur(16px);
}
.brand-mark {
  width: 48px; height: 48px; flex: 0 0 48px; display: grid; place-items: center;
  border-radius: 50%; background: var(--orange); color: #111; font-weight: 900;
  border: 2px solid #fff;
}
.app-header h1 { margin: 1px 0 0; font-size: clamp(1.05rem, 4vw, 1.35rem); }
.eyebrow, .section-label { margin: 0; color: var(--orange-soft); font-size: .72rem; font-weight: 800; letter-spacing: .12em; }
.app-header .button { margin-left: auto; width: auto; }

main { width: min(960px, 100%); margin: 0 auto; padding: 24px 16px calc(34px + env(safe-area-inset-bottom)); }
.auth-card, .panel, .event-card {
  background: linear-gradient(145deg, var(--surface-strong), var(--surface));
  border: 1px solid var(--border); border-radius: 18px;
}
.auth-card { max-width: 520px; margin: 8vh auto 0; padding: 28px; border-top: 6px solid var(--orange); }
.auth-card h2, .panel h2 { margin: 8px 0; }
.auth-card p { color: var(--muted); line-height: 1.55; }
label { display: block; margin: 22px 0 8px; font-weight: 700; }
input {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 10px;
  color: var(--text); background: #0f1113; border: 1px solid #59606a; outline: none;
}
input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255, 122, 26, .18); }
.button {
  min-height: 46px; width: 100%; border-radius: 10px; border: 1px solid #fff;
  padding: 10px 15px; cursor: pointer; font-weight: 800;
}
.button-primary { margin-top: 14px; color: #111; background: var(--orange); }
.button-secondary { color: #fff; background: #111; }
.button-link { margin-top: 10px; color: var(--muted); background: transparent; border-color: #59606a; }
.button:disabled { opacity: .55; cursor: wait; }
.message { min-height: 1.3em; margin-bottom: 0 !important; }
.message.success { color: var(--green); }
.message.error { color: #ff746a; }

.portal-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.portal-toolbar .button { width: auto; }
.toolbar-actions { display: flex; align-items: center; gap: 8px; }
.toolbar-actions .button-primary { margin-top: 0; }
.muted { color: var(--muted); margin: 4px 0 0; }
.events-grid { display: grid; gap: 18px; }
.event-card { padding: 20px; border-top: 6px solid var(--orange); }
.event-card-head { display: flex; justify-content: space-between; gap: 12px; color: var(--orange-soft); font-weight: 800; font-size: .82rem; text-transform: uppercase; }
.event-title { margin: 12px 0 4px; font-size: clamp(1.35rem, 6vw, 2rem); }
.services { margin: 0 0 18px; color: var(--muted); }
.details-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.detail {
  min-width: 0; padding: 14px; border: 1px solid #3a3f46; border-radius: 12px;
  background: rgba(10, 11, 12, .55);
}
.detail-label { display: block; color: var(--muted); font-size: .73rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.detail-value { display: block; margin-top: 5px; overflow-wrap: anywhere; }
.maps-link {
  display: block; margin-top: 10px; padding: 9px 10px; text-align: center;
  border: 1px solid #fff; border-radius: 9px; color: #fff; font-weight: 800;
  text-decoration: none; text-shadow: 0 1px 2px #0008;
  background:
    radial-gradient(circle at 8% 100%, #34a853 0, transparent 42%),
    radial-gradient(circle at 92% 5%, #ea4335 0, transparent 40%),
    radial-gradient(circle at 88% 100%, #fbbc04 0, transparent 44%),
    linear-gradient(135deg, #4285f4 12%, #34a853 100%);
}
.instructions { margin-top: 16px; padding: 15px; border-left: 6px solid var(--brown); border-radius: 10px; background: #2c211b; }
.instructions h3, .team-section h3 { margin: 0 0 8px; color: var(--brown); }
.instructions p { margin: 0; white-space: pre-wrap; line-height: 1.5; }
.team-section { margin-top: 18px; }
.team-list { display: grid; gap: 8px; }
.team-person { display: flex; justify-content: space-between; gap: 12px; padding: 11px 13px; background: #111315; border-radius: 9px; }
.team-role { color: var(--muted); }
.panel { padding: 24px; }
.loading { padding: 35px; text-align: center; color: var(--muted); }
.offline-banner, .install-help { margin-bottom: 16px; padding: 12px 14px; border: 1px solid #80671e; border-radius: 10px; background: #382f16; color: #f0c44f; }
.install-help { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 20; max-width: 620px; margin: auto; }
code { color: var(--orange-soft); }

@media (max-width: 600px) {
  main { padding-left: 12px; padding-right: 12px; }
  .app-header { padding-left: 12px; padding-right: 12px; }
  .brand-mark { width: 42px; height: 42px; flex-basis: 42px; }
  .auth-card { margin-top: 3vh; padding: 22px 18px; }
  .details-grid { grid-template-columns: 1fr; }
  .event-card { padding: 17px 14px; }
  .portal-toolbar { align-items: flex-start; }
  .toolbar-actions { flex-direction: column; align-items: stretch; }
  .toolbar-actions .button { width: 100%; }
}

@media (min-width: 820px) {
  .events-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
