:root {
  color-scheme: light;
  --background: #fff8ed;
  --surface: #ffffff;
  --surface-soft: #fff1d9;
  --text: #2b2118;
  --muted: #6f6257;
  --primary: #d95f32;
  --primary-dark: #aa4120;
  --green: #2f7d64;
  --border: #ead8bd;
  --shadow: 0 18px 45px rgba(75, 43, 20, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(217, 95, 50, 0.16), transparent 28rem),
    var(--background);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

body.is-locked {
  overflow: hidden;
}

body.is-locked > :not(.password-screen) {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
}

.password-screen {
  align-items: center;
  background:
    radial-gradient(circle at top left, rgba(217, 95, 50, 0.22), transparent 28rem),
    rgba(255, 248, 237, 0.96);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 1rem;
  position: fixed;
  z-index: 100;
}

.password-screen[hidden] {
  display: none;
}

.password-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 1rem;
  max-width: 440px;
  padding: clamp(1.4rem, 4vw, 2rem);
  width: 100%;
}

.password-box h1 {
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 1;
  margin: 0;
}

.password-box p {
  color: var(--muted);
  margin-bottom: 0;
}

.password-box label {
  color: var(--muted);
  display: grid;
  font-weight: 700;
  gap: 0.35rem;
}

.password-box input {
  border: 1px solid var(--border);
  border-radius: 14px;
  min-height: 2.9rem;
  padding: 0.75rem 0.85rem;
}

.password-box .password-error {
  color: var(--primary-dark);
  font-weight: 700;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.import-button {
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
  padding: 0.85rem 1.15rem;
  transition:
    background 160ms ease,
    transform 160ms ease;
}

button:hover,
.import-button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.hero {
  padding: 1.2rem clamp(1rem, 4vw, 4rem) 1.8rem;
}

.topbar {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  margin: 0 auto;
  max-width: 1100px;
}

.topbar a {
  align-items: center;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 12px 28px rgba(75, 43, 20, 0.1);
  color: var(--text);
  display: flex;
  font-size: 1.15rem;
  font-weight: 700;
  justify-content: center;
  min-height: 92px;
  padding: 1.3rem 1rem;
  text-align: center;
  text-decoration: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.topbar a:hover {
  border-color: var(--primary);
  box-shadow: 0 18px 34px rgba(75, 43, 20, 0.16);
  color: var(--primary-dark);
  transform: translateY(-2px);
}

.event-header {
  margin: 2rem auto 0;
  max-width: 900px;
  text-align: center;
}

.event-header h1 {
  font-size: clamp(2.2rem, 6vw, 4.8rem);
  line-height: 1;
  margin: 0 0 0.8rem;
}

.event-header p {
  color: var(--primary-dark);
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 800;
  margin: 0.15rem 0;
}

.welcome-text {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 12px 28px rgba(75, 43, 20, 0.08);
  margin: 1.4rem auto 0;
  max-width: 820px;
  padding: clamp(1rem, 3vw, 1.5rem);
  text-align: left;
}

.welcome-text p {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 400;
  margin: 0 0 0.85rem;
}

.welcome-text p:last-child {
  margin-bottom: 0;
}

.hero-content {
  margin: 0 auto;
  max-width: 900px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.2rem, 7vw, 5.5rem);
  line-height: 0.98;
  margin: 0.35rem 0 1.1rem;
}

.hero p {
  color: var(--muted);
  font-size: 1.15rem;
  margin: 0 auto;
  max-width: 720px;
}

.eyebrow {
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin: 0 0 0.35rem;
  text-transform: uppercase;
}

main {
  display: grid;
  gap: 1.5rem;
  margin: 0 auto;
  max-width: 1180px;
  padding: 0 clamp(1rem, 4vw, 4rem) 4rem;
}

.sync-status {
  background: #fffaf3;
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.75rem;
  padding: 1rem 1.2rem;
}

.sync-status p {
  margin: 0;
}

.sync-status-note {
  color: var(--muted);
  font-size: 0.92rem;
}

.sync-status.is-ok {
  border-color: #9fd4c1;
  background: #f2fbf7;
}

.sync-status.is-warning {
  border-color: #f0c27d;
  background: #fff5e8;
}

.sync-status.is-error {
  border-color: #e7a196;
  background: #fff1ee;
}

.sync-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.sync-status-actions button {
  justify-self: start;
}

.panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: clamp(1.2rem, 3vw, 2rem);
}

.overview {
  display: grid;
  gap: 1.3rem;
}

.section-heading {
  align-items: end;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
  margin-bottom: 1.25rem;
}

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

h2 {
  font-size: clamp(1.55rem, 3vw, 2.45rem);
  line-height: 1.08;
  margin-bottom: 0;
}

.section-heading > p {
  color: var(--muted);
  margin-bottom: 0;
}

.stats {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stats article {
  background: var(--surface-soft);
  border-radius: 22px;
  padding: 1rem;
}

.stats span {
  color: var(--primary-dark);
  display: block;
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
}

.stats p {
  color: var(--muted);
  margin-bottom: 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.import-button {
  display: inline-flex;
  position: relative;
}

.import-button input {
  height: 1px;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

.entry-form {
  align-items: end;
  background: #fffaf3;
  border: 1px solid var(--border);
  border-radius: 22px;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 1.2rem;
  padding: 1rem;
}

.entry-form > label,
.form-field {
  color: var(--muted);
  display: grid;
  font-size: 0.92rem;
  font-weight: 700;
  gap: 0.35rem;
}

.form-field > span {
  font-weight: 700;
}

.entry-form input,
.entry-form select,
.entry-form textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  min-height: 2.7rem;
  padding: 0.75rem 0.85rem;
  width: 100%;
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.checkbox-group label {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  display: flex;
  gap: 0.35rem;
  padding: 0.55rem 0.75rem;
}

.checkbox-group input {
  min-height: auto;
  padding: 0;
  width: auto;
}

.single-checkbox {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  flex-direction: row;
  font-size: 0.92rem;
  font-weight: 700;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  width: fit-content;
}

.single-checkbox input {
  min-height: auto;
  padding: 0;
  width: auto;
}

.participant-absent {
  color: var(--primary-dark);
  font-weight: 700;
}

.entry-form textarea {
  min-height: 5.5rem;
  resize: vertical;
}

.entry-form button {
  min-height: 2.7rem;
}

.secondary-button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--primary-dark);
}

.secondary-button:hover {
  background: #fff2e8;
}

.subheading {
  font-size: 1rem;
  margin: 1.2rem 0 0.8rem;
}

.requirements-overview {
  background: #fffaf3;
  border: 1px solid var(--border);
  border-radius: 22px;
  display: grid;
  gap: 1rem;
  margin: 0 0 1.2rem;
  padding: 1rem;
}

.requirements-overview h3 {
  margin-bottom: 0.25rem;
}

.requirements-overview p {
  color: var(--muted);
  margin-bottom: 0;
}

.requirements-summary {
  overflow-x: auto;
}

.requirements-table {
  border-collapse: collapse;
  min-width: 480px;
  width: 100%;
}

.requirements-table th,
.requirements-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.7rem 0.5rem;
  text-align: left;
  vertical-align: top;
}

.requirements-table th {
  color: var(--green);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.requirements-table td:first-child {
  font-weight: 800;
}

.timetable-scroll {
  margin-top: 1rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
}

.timetable-grid {
  --location-count: 1;
  --slot-count: 16;
  display: grid;
  gap: 0;
  grid-template-columns: 90px repeat(var(--location-count), minmax(190px, 1fr));
  grid-template-rows: 42px repeat(var(--slot-count), 42px);
  min-width: calc(90px + (var(--location-count) * 190px));
  position: relative;
}

.timetable-corner,
.timetable-location,
.timetable-time,
.timetable-cell {
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.timetable-corner,
.timetable-location {
  align-items: center;
  background: var(--surface-soft);
  display: flex;
  font-weight: 800;
  justify-content: center;
  padding: 0.6rem;
  position: sticky;
  top: 0;
  z-index: 3;
}

.timetable-corner {
  border-left: 1px solid var(--border);
  border-top-left-radius: 18px;
  grid-column: 1;
  grid-row: 1;
  left: 0;
  z-index: 4;
}

.timetable-location:last-of-type {
  border-top-right-radius: 18px;
}

.timetable-time {
  align-items: start;
  background: #fffaf3;
  border-left: 1px solid var(--border);
  color: var(--muted);
  display: flex;
  font-size: 0.85rem;
  font-weight: 800;
  grid-column: 1;
  justify-content: center;
  padding-top: 0.45rem;
  position: sticky;
  left: 0;
  z-index: 2;
}

.timetable-cell {
  background:
    linear-gradient(to bottom, rgba(217, 95, 50, 0.05), transparent),
    #ffffff;
  min-height: 42px;
}

.timetable-cell.is-drop-target {
  background: #ffe1c8;
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.timetable-event {
  align-self: stretch;
  background: var(--primary);
  border: 2px solid #ffffff;
  border-radius: 14px;
  box-shadow: 0 10px 20px rgba(170, 65, 32, 0.18);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  cursor: grab;
  margin: 0.18rem;
  overflow: hidden;
  padding: 0.4rem 0.5rem;
  z-index: 5;
}

.timetable-event:active {
  cursor: grabbing;
}

.timetable-event.is-dragging {
  opacity: 0.65;
}

.timetable-event strong {
  font-size: 0.82rem;
  line-height: 1.15;
}

.timetable-event span,
.timetable-event small {
  font-size: 0.7rem;
  line-height: 1.2;
}

.cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.participant-list {
  display: grid;
  gap: 0;
  grid-template-columns: 1fr;
}

.participant-row {
  align-items: center;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.75rem 0;
}

.participant-row:first-child {
  border-top: 1px solid var(--border);
}

.participant-row > div {
  display: grid;
  gap: 0.15rem;
}

.participant-row strong {
  font-size: 1rem;
}

.participant-row span,
.participant-row small {
  color: var(--muted);
}

.participant-row .edit-button,
.participant-row .delete-button {
  flex: 0 0 auto;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 1rem;
}

.card.is-editable {
  cursor: pointer;
}

.card.is-editable:hover {
  border-color: var(--primary);
}

.card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.9rem;
}

.card dl {
  display: grid;
  gap: 0.3rem;
  margin: 0 0 1rem;
}

.card dt {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.card dd {
  color: var(--muted);
  margin: 0 0 0.45rem;
  white-space: pre-wrap;
}

.edit-button,
.delete-button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--primary-dark);
  margin-right: 0.45rem;
  padding: 0.6rem 0.85rem;
}

.edit-button:hover,
.delete-button:hover {
  background: #fff2e8;
}

.empty {
  background: #fffaf3;
  border: 1px dashed var(--border);
  border-radius: 18px;
  color: var(--muted);
  margin: 0;
  padding: 1rem;
}

footer {
  color: var(--muted);
  margin: 0 auto;
  max-width: 900px;
  padding: 0 1rem 3rem;
  text-align: center;
}

.public-page-calendar-only {
  margin: 0;
}

.public-calendar-main {
  margin: 0 auto;
  max-width: 1320px;
  padding: 1rem;
  width: 100%;
}

.public-page-calendar-only .timetable-scroll {
  margin-top: 0;
  overflow-x: auto;
  width: 100%;
}

.public-page-calendar-only .timetable-grid {
  min-width: 100%;
  width: 100%;
  grid-template-columns: 80px repeat(var(--location-count), minmax(160px, 1fr));
  grid-template-rows: 42px repeat(var(--slot-count), 42px);
}

.public-page-calendar-only .timetable-location {
  hyphens: auto;
  line-height: 1.15;
  overflow-wrap: anywhere;
  text-align: center;
  word-break: break-word;
}

.public-page .hero {
  padding-bottom: 1rem;
}

.public-hero .event-header {
  margin-top: 0;
}

.public-intro {
  color: var(--muted) !important;
  font-size: 1.05rem !important;
  font-weight: 400 !important;
  margin-top: 1rem !important;
}

.public-main {
  margin-top: 0;
}

.public-panel {
  margin-top: 0;
}

.public-section-heading {
  align-items: start;
}

.public-actions {
  display: grid;
  gap: 0.6rem;
  justify-items: start;
}

.public-plan-link {
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: none;
}

.public-plan-link:hover {
  text-decoration: underline;
}

.public-status {
  background: #f2fbf7;
  border: 1px solid #9fd4c1;
  border-radius: 14px;
  color: var(--text);
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
}

.public-status.is-error {
  background: #fff1ee;
  border-color: #e7a196;
}

.timetable-event.is-public {
  cursor: default;
}

.program-list {
  display: grid;
  gap: 0.75rem;
}

.program-list-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 0.9rem 1rem;
}

.program-list-item h3 {
  font-size: 1.05rem;
  margin: 0 0 0.35rem;
}

.program-list-item p {
  color: var(--muted);
  margin: 0;
}

@media (max-width: 850px) {
  .section-heading,
  .entry-form,
  .stats {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-bottom: 1.5rem;
  }

  .topbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
