:root {
  color-scheme: dark;
  --sticky-toolbar-height: 0px;
  --sticky-gap: 20px;
  --bg: #07110d;
  --surface: #101a16;
  --surface-2: #17241f;
  --text: #f3f7f4;
  --muted: #aab8af;
  --line: rgba(255, 255, 255, 0.13);
  --green: #36c173;
  --green-deep: #0f6b47;
  --gold: #d7ad55;
  --red: #e05b4f;
  --blue: #5b8def;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

:root.light {
  color-scheme: light;
  --bg: #f5f2ec;
  --surface: #ffffff;
  --surface-2: #ece8df;
  --text: #13201a;
  --muted: #59665f;
  --line: rgba(19, 32, 26, 0.14);
  --green: #14774d;
  --green-deep: #0f593d;
  --gold: #9b742d;
  --red: #b7443b;
  --blue: #346bc4;
  --shadow: 0 18px 45px rgba(48, 39, 24, 0.16);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body.modal-open {
  overflow: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.hero {
  position: relative;
  min-height: 42vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 12, 9, 0.88), rgba(5, 12, 9, 0.52) 45%, rgba(5, 12, 9, 0.18)),
    linear-gradient(0deg, var(--bg), rgba(5, 12, 9, 0) 35%);
}

.topbar,
.hero__content {
  position: relative;
  z-index: 1;
}

.topbar {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 800;
}

.brand__mark {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0 11%, var(--red) 12% 30%, #111 31% 38%, var(--green) 39% 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.topbar__actions,
.hero__actions,
.calendar-head__buttons,
.panel__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-status {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--green) 48%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--green) 12%, transparent);
  color: var(--text);
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.hero__content {
  width: min(1180px, calc(100% - 32px));
  margin: auto auto 12vh;
  padding-top: 34px;
}

.hero__content h1 {
  color: #fff;
}

.kicker,
.section-label {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  max-width: 620px;
  margin-bottom: 0;
  font-size: clamp(2.6rem, 7vw, 5.7rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 2.5vw, 2rem);
}

.button,
.icon-button {
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover,
.icon-button:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--green) 55%, var(--line));
}

.button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.button--primary {
  background: var(--green);
  border-color: transparent;
  color: #07110d;
}

.button--ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.button--small {
  min-height: 38px;
  padding: 0 14px;
}

.button--danger {
  border-color: color-mix(in srgb, var(--red) 52%, var(--line));
  color: color-mix(in srgb, var(--red) 75%, var(--text));
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  font-size: 1.25rem;
  font-weight: 800;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 22px auto 72px;
  position: relative;
  z-index: 2;
}

body.admin-route .hero,
body.admin-route main > :not(.admin-panel) {
  display: none;
}

body.admin-route main {
  margin-top: 42px;
}

.highlight-events {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 22px;
}

.highlight-events h2 {
  margin-bottom: 16px;
}

.section-heading--unframed {
  padding: 0 0 12px;
  border-bottom: 0;
}

.highlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 14px;
}

.highlight-card {
  position: relative;
  min-height: 168px;
  border: 1px solid color-mix(in srgb, var(--category-color, var(--line)) 45%, var(--line));
  border-left: 5px solid var(--category-color, var(--green));
  border-radius: 8px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--surface) 88%, transparent), var(--surface-2));
  padding: 18px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  min-width: 0;
}

.highlight-card__tag {
  position: absolute;
  top: 12px;
  right: 12px;
  max-width: min(62%, 220px);
  display: flex;
  justify-content: flex-end;
}

.highlight-card__tag .category-tags {
  justify-content: flex-end;
}

.highlight-card__tag .tag {
  min-height: 24px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.highlight-card__dresscode {
  align-self: end;
  justify-self: end;
}

.highlight-card__content {
  align-self: end;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  min-width: 0;
}

.highlight-card__text {
  min-width: 0;
  overflow: hidden;
}

.highlight-card:hover {
  border-color: color-mix(in srgb, var(--green) 55%, var(--line));
  transform: translateY(-1px);
}

.highlight-card__date {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding-right: min(42%, 180px);
  color: var(--category-color, var(--gold));
  font-weight: 900;
}

.highlight-card__date strong {
  font-size: 2.35rem;
  line-height: 1;
}

.highlight-card__title {
  display: block;
  margin: 0 0 8px;
  font-size: 1.08rem;
  font-weight: 900;
}

.highlight-card__meta {
  display: block;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.9rem;
}

.toolbar,
.calendar-shell,
.event-list {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
}

label,
.muted {
  color: var(--muted);
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
}

textarea {
  padding-top: 10px;
  resize: vertical;
}

.toolbar {
  margin: 22px 0;
  padding: 14px;
  border-radius: 8px;
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 60;
  isolation: isolate;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow), 0 var(--sticky-gap) 0 0 var(--bg);
}

.toolbar::after {
  content: "";
  position: absolute;
  left: -1px;
  right: -1px;
  bottom: calc(-1 * var(--sticky-gap));
  height: var(--sticky-gap);
  background: var(--bg);
  pointer-events: none;
  z-index: 0;
}

.toolbar > * {
  position: relative;
  z-index: 1;
}

.search,
.category-filter-field {
  grid-column: 1 / -1;
}

.target-audience-filter-field {
  grid-column: 2;
}

.category-options {
  display: grid;
  grid-template-columns: 46px repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.target-audience-options {
  grid-template-columns: 46px repeat(5, minmax(0, 1fr));
}

.category-options .checkbox-pill {
  min-height: 38px;
  border-radius: 8px;
  margin: 0;
  border-color: color-mix(in srgb, var(--category-color, var(--line)) 42%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--category-color, transparent) 12%, transparent), transparent 58%),
    color-mix(in srgb, var(--category-color, var(--surface)) 8%, var(--surface));
  font-size: 0.82rem;
  text-transform: none;
  justify-content: center;
  text-align: center;
  width: 100%;
}

.category-options .checkbox-pill span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.category-options .checkbox-pill--all {
  --category-color: var(--green);
  border-color: color-mix(in srgb, var(--green) 55%, var(--line));
  background: color-mix(in srgb, var(--green) 12%, var(--surface));
  padding: 0;
  color: var(--green);
}

.category-options .checkbox-pill--all input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.category-options .checkbox-pill--all:has(input:checked) .select-all-icon {
  color: var(--text);
}

.select-all-icon {
  position: relative;
  display: inline-block;
  width: 27px;
  height: 24px;
  color: currentColor;
}

.select-all-icon span {
  position: absolute;
  width: 18px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 4px;
  background: color-mix(in srgb, var(--green) 10%, var(--surface-2));
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

.select-all-icon span:nth-child(1) {
  left: 0;
  top: 1px;
  opacity: 0.55;
}

.select-all-icon span:nth-child(2) {
  left: 4px;
  top: 5px;
  opacity: 0.72;
}

.select-all-icon span:nth-child(3) {
  left: 8px;
  top: 7px;
  background: color-mix(in srgb, var(--green) 16%, var(--surface-2));
}

.select-all-icon span:nth-child(3)::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 1px;
  width: 12px;
  height: 8px;
  border-left: 4px solid currentColor;
  border-bottom: 4px solid currentColor;
  transform: rotate(-45deg);
  transform-origin: center;
}

.category-options .checkbox-pill:has(input:checked) {
  border-color: color-mix(in srgb, var(--category-color, var(--green)) 72%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--category-color, transparent) 20%, transparent), transparent 62%),
    color-mix(in srgb, var(--category-color, var(--surface-2)) 16%, var(--surface-2));
}

.field.is-placeholder {
  visibility: hidden;
  pointer-events: none;
}

.admin-panel {
  margin: 22px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.admin-panel.is-login-screen {
  max-width: 620px;
  margin: 32px auto;
}

.admin-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.admin-login,
.admin-workspace,
.admin-card {
  padding: 18px;
}

.admin-login {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 12px;
  align-items: end;
}

.admin-workspace {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.admin-nav {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-nav #adminLogout {
  margin-left: auto;
}

.admin-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.admin-card--events {
  grid-column: 1 / -1;
}

.admin-card h3 {
  margin: 0;
  font-size: 1.1rem;
}

.section-heading--compact {
  padding: 0 0 16px;
  border-bottom: 0;
}

.category-form,
.target-audience-form,
.location-form {
  display: grid;
  gap: 12px;
}

.category-admin-list,
.target-audience-admin-list,
.location-admin-list,
.dresscode-admin-list,
.checkbox-cloud,
.category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-admin-list,
.target-audience-admin-list,
.location-admin-list,
.dresscode-admin-list {
  margin-top: 16px;
}

.admin-event-list {
  display: grid;
  align-content: start;
  gap: 10px;
  margin-top: 18px;
}

.admin-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.admin-tab {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

.admin-tab.is-active {
  border-color: color-mix(in srgb, var(--green) 68%, var(--line));
  background: color-mix(in srgb, var(--green) 16%, var(--surface-2));
  color: var(--text);
}

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

.admin-event-item strong,
.admin-event-item small {
  display: block;
}

.admin-event-item small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.4;
}

.admin-event-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.category-item,
.target-audience-item,
.location-item,
.dresscode-item,
.checkbox-pill,
.tag {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
}

.category-item,
.target-audience-item,
.location-item,
.dresscode-item {
  padding: 0 4px 0 12px;
}

.category-item,
.target-audience-item {
  width: 100%;
  border-radius: 8px;
  padding: 10px;
  align-items: center;
}

.dresscode-item {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  border-radius: 8px;
  padding: 10px;
  align-items: start;
}

.dresscode-item__code {
  min-width: 42px;
  color: var(--gold);
  font-size: 1rem;
  font-weight: 900;
}

.dresscode-item__content {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.dresscode-item textarea {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  font-weight: 700;
}

.dresscode-image-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dresscode-file-button {
  position: relative;
  overflow: hidden;
}

.dresscode-file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dresscode-image-tools span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.event-import-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.event-import-file-button {
  position: relative;
  overflow: hidden;
}

.event-import-file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.event-import-message {
  flex-basis: 100%;
}

.category-item input,
.category-item select,
.target-audience-item input,
.location-item input {
  width: 150px;
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  font-weight: 800;
}

.category-item .category-name-input,
.target-audience-item input {
  width: 140px;
}

.category-item .category-color-select {
  width: min(180px, 100%);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  padding: 0 8px;
}

.category-item .category-color-input {
  width: 36px;
  min-height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
}

.location-item input {
  width: 220px;
}

.category-item button,
.target-audience-item button,
.location-item button,
.dresscode-item button {
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--red) 22%, transparent);
  color: var(--text);
  cursor: pointer;
}

.category-item .category-ok-button,
.target-audience-item .category-ok-button {
  width: auto;
  min-width: 30px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 900;
}

.category-item button:first-of-type,
.target-audience-item button:first-of-type,
.location-item button:first-of-type,
.dresscode-item button:first-of-type {
  background: color-mix(in srgb, var(--green) 20%, transparent);
}

.dresscode-badge {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid color-mix(in srgb, var(--gold) 60%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--gold) 13%, var(--surface-2));
  color: var(--text);
  padding: 0 10px;
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.dresscode-badge--subtle {
  min-height: 26px;
  gap: 4px;
  border-color: color-mix(in srgb, var(--gold) 38%, var(--line));
  background: color-mix(in srgb, var(--gold) 8%, var(--surface-2));
  color: color-mix(in srgb, var(--text) 78%, var(--muted));
  padding: 0 8px;
  font-size: 0.74rem;
  opacity: 0.86;
}

.dresscode-badge--subtle:hover {
  opacity: 1;
}

.dresscode-badge.has-image {
  cursor: pointer;
  border-color: color-mix(in srgb, var(--gold) 82%, var(--line));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 12%, transparent);
}

.dresscode-badge.has-image:hover {
  background: color-mix(in srgb, var(--gold) 20%, var(--surface-2));
}

.checkbox-pill {
  padding: 7px 10px;
  cursor: pointer;
}

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

.tag {
  min-height: 26px;
  padding: 0 9px;
  border-color: color-mix(in srgb, var(--category-color, var(--muted)) 65%, var(--line));
  background: color-mix(in srgb, var(--category-color, var(--surface-2)) 15%, var(--surface-2));
  color: color-mix(in srgb, var(--category-color, var(--muted)) 80%, var(--text));
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 12px;
}

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

.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--gold);
  font-weight: 800;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-2);
}

.segmented__button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.segmented__button.is-active {
  background: var(--green);
  color: #07110d;
}

.calendar-shell {
  border-radius: 8px;
  overflow: visible;
}

.calendar-shell.is-list .calendar-head__buttons {
  display: none;
}

.calendar-head,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.calendar-views {
  display: grid;
  gap: 1px;
  background: var(--line);
}

.calendar-views.is-loading {
  display: block;
  background: var(--surface);
}

.calendar-load-state {
  min-height: 280px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding: 32px;
  color: var(--muted);
  text-align: center;
}

.calendar-load-state__indicator {
  width: 34px;
  height: 34px;
  border: 3px solid color-mix(in srgb, var(--green) 24%, var(--line));
  border-top-color: var(--green);
  border-radius: 50%;
  animation: calendar-loading-spin 0.8s linear infinite;
}

.calendar-cache-notice {
  grid-column: 1 / -1;
  margin: 0;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--gold) 12%, var(--surface));
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
}

@keyframes calendar-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .calendar-load-state__indicator {
    animation: none;
  }
}

.month-view {
  background: var(--surface);
}

.month-view__title {
  position: sticky;
  top: calc(var(--sticky-toolbar-height) + var(--sticky-gap));
  z-index: 20;
  padding: 14px 16px;
  background: color-mix(in srgb, var(--surface-2) 94%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  font-weight: 900;
  box-shadow:
    0 calc(-1 * var(--sticky-gap)) 0 0 var(--bg),
    0 8px 22px rgba(0, 0, 0, 0.24);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  background: var(--line);
}

.calendar-views.is-wide,
.calendar-views.is-multi {
  grid-template-columns: 1fr;
}

.calendar-views.is-year {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  background: transparent;
  padding: 12px;
}

.weekday,
.day {
  min-width: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.weekday {
  padding: 12px 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.day {
  min-height: 138px;
  padding: 10px;
  background: var(--surface);
  position: relative;
}

.calendar-views.is-year .day {
  min-height: 74px;
  padding: 6px;
}

.calendar-views.is-year .event-chip {
  min-height: 26px;
  padding: 5px 6px;
  font-size: 0.68rem;
}

.calendar-views.is-year .event-chip small {
  display: none;
}

.calendar-views.is-year .day__number {
  align-items: flex-start;
  flex-direction: column;
  gap: 3px;
}

.calendar-views.is-year .day__marker {
  max-width: 100%;
  text-align: left;
  font-size: 0.58rem;
}

.calendar-views.is-year .month-view {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.calendar-views.is-year .month-view__title {
  padding: 10px 12px;
  font-size: 0.95rem;
}

.day.is-muted {
  background: color-mix(in srgb, var(--surface) 72%, var(--bg));
  color: var(--muted);
}

.calendar-views.is-wide .day.is-empty,
.calendar-views.is-wide .day.is-empty.is-weekend,
.calendar-views.is-year .day.is-empty,
.calendar-views.is-year .day.is-empty.is-weekend {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: none;
  color: transparent;
}

.day.is-weekend {
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--blue) 18%, transparent), transparent 68%),
    color-mix(in srgb, var(--surface) 80%, var(--surface-2));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blue) 18%, transparent);
}

.day.is-weekend .day__number > span:first-child {
  color: color-mix(in srgb, var(--blue) 46%, var(--text));
}

.day.is-today {
  box-shadow: inset 0 0 0 2px var(--gold);
}

.day.is-marked-day {
  background: var(--surface);
}

.day.is-vacation {
  background: var(--surface);
}

.day.is-special {
  background: var(--surface);
}

.day.is-holiday {
  background: var(--surface);
}

.day.is-weekend.is-marked-day,
.day.is-weekend.is-vacation,
.day.is-weekend.is-special,
.day.is-weekend.is-holiday {
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--blue) 18%, transparent), transparent 68%),
    color-mix(in srgb, var(--surface) 80%, var(--surface-2));
}

.day__number {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.86rem;
  font-weight: 800;
}

.day__marker {
  min-width: 0;
  max-width: min(150px, 72%);
  border: 1px solid color-mix(in srgb, var(--muted) 35%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 10%, transparent);
  color: color-mix(in srgb, var(--muted) 86%, var(--text));
  padding: 2px 7px;
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1.15;
  text-align: right;
  text-transform: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day.is-holiday .day__marker {
  color: color-mix(in srgb, var(--muted) 82%, var(--text));
}

.day.is-vacation .day__marker {
  color: color-mix(in srgb, var(--muted) 82%, var(--text));
}

.event-chip {
  width: 100%;
  min-height: 34px;
  margin-bottom: 6px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--category-color, var(--green));
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  padding: 7px 6px 7px 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.2;
  cursor: pointer;
}

.event-chip__text {
  display: block;
  min-width: 0;
  overflow: hidden;
}

.event-chip__dresscode {
  align-self: start;
  justify-self: end;
}

.event-chip .dresscode-badge--subtle {
  min-height: 22px;
  padding: 0 6px;
  font-size: 0.68rem;
}

.event-chip .dresscode-badge--subtle > span {
  display: none;
}

.event-chip[data-status="planned"] {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blue) 24%, transparent);
}

.event-chip[data-status="reserved"] {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 24%, transparent);
}

.event-chip small {
  display: block;
  color: var(--muted);
  font-weight: 600;
  margin-top: 3px;
}

.event-chip-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 0.72rem;
  font-weight: 900;
}

.event-chip.is-past,
.event-row.is-past {
  opacity: 0.48;
  filter: grayscale(1);
}

.event-chip.is-past {
  border-left-color: var(--muted);
  background: color-mix(in srgb, var(--surface-2) 62%, var(--bg));
}

.detail-list {
  display: grid;
  grid-template-columns: 105px 1fr;
  gap: 12px;
  margin: 22px 0;
}

.detail-list dt {
  color: var(--muted);
  font-weight: 700;
}

.detail-list dd {
  margin: 0;
  font-weight: 700;
}

.detail-link {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  margin: 0 6px 6px 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--green);
  background: var(--surface-2);
}

.event-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
}

.event-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 8, 6, 0.72);
  backdrop-filter: blur(8px);
}

.event-modal__panel,
.image-modal__panel {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
  border: 1px solid color-mix(in srgb, var(--category-color, var(--line)) 55%, var(--line));
  border-radius: 8px;
  background:
    radial-gradient(circle at 16% 0%, color-mix(in srgb, var(--category-color, transparent) 15%, transparent), transparent 34%),
    var(--surface);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--category-color, transparent) 18%, transparent),
    0 0 34px color-mix(in srgb, var(--category-color, transparent) 24%, transparent),
    inset 0 0 0 1px color-mix(in srgb, var(--category-color, transparent) 12%, transparent),
    0 26px 90px rgba(0, 0, 0, 0.5);
  padding: clamp(20px, 4vw, 32px);
}

.image-modal__panel {
  --category-color: var(--gold);
  width: min(900px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: hidden;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 18px;
}

.event-modal__panel::before,
.image-modal__panel::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid color-mix(in srgb, var(--category-color, transparent) 16%, transparent);
  border-radius: 6px;
  pointer-events: none;
}

.image-modal__panel img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 126px);
  min-height: 0;
  margin-top: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  object-fit: contain;
}

.image-modal__panel .panel__actions {
  justify-content: center;
  margin-top: 0;
}

.event-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
}

.event-modal__panel h2 {
  max-width: calc(100% - 56px);
  margin-bottom: 8px;
}

.event-modal__category {
  display: flex;
  margin-top: 14px;
}

.event-modal__category .category-tags {
  gap: 8px;
}

.event-modal__category .tag {
  border-color: color-mix(in srgb, var(--category-color, var(--green)) 78%, var(--line));
  background: color-mix(in srgb, var(--category-color, var(--surface-2)) 22%, var(--surface-2));
  color: color-mix(in srgb, var(--category-color, var(--text)) 50%, var(--text));
}

.event-modal__details {
  grid-template-columns: minmax(100px, 0.32fr) minmax(0, 1fr);
}

.pill,
.status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.event-list {
  display: grid;
  gap: 1px;
  background: var(--line);
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}

.event-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 92px;
  padding: 16px 20px;
  border: 0;
  border-left: 5px solid var(--category-color, transparent);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  width: 100%;
}

.event-row:hover {
  background: var(--surface-2);
}

.event-row__badges {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.event-row.is-past:hover {
  opacity: 0.62;
}

.event-date {
  display: grid;
  gap: 2px;
  color: var(--gold);
  font-weight: 800;
}

.event-date strong {
  font-size: 1.55rem;
}

.event-title {
  margin: 0 0 6px;
  font-weight: 850;
  font-size: 1.02rem;
}

.event-meta {
  color: var(--muted);
  line-height: 1.45;
}

.event-list {
  padding: 0;
}

.empty {
  padding: 28px;
  background: var(--surface);
  color: var(--muted);
}

@media (max-width: 860px) {
  .hero {
    min-height: 38vh;
  }

  .topbar {
    min-height: 58px;
    padding: 8px 0;
  }

  h1 {
    font-size: clamp(2.35rem, 13vw, 4.25rem);
  }

  .toolbar,
  .admin-login,
  .admin-workspace,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .admin-nav #adminLogout {
    margin-left: 0;
  }

  .category-options {
    grid-template-columns: 46px repeat(2, minmax(0, 1fr));
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .target-audience-filter-field {
    grid-column: 1 / -1;
  }

  .admin-card--events {
    grid-column: auto;
  }

  main {
    margin-top: 18px;
  }

  .calendar-grid,
  .calendar-views.is-multi,
  .calendar-views.is-wide,
  .calendar-views.is-year {
    grid-template-columns: 1fr;
  }

  .calendar-shell {
    overflow: visible;
  }

  .calendar-views.is-wide .month-view__title {
    top: calc(var(--sticky-toolbar-height) + var(--sticky-gap));
  }

  .weekday {
    display: none;
  }

  .day {
    min-height: auto;
  }

  .day.is-muted:empty {
    display: none;
  }

  .event-row {
    grid-template-columns: 72px 1fr;
  }

  .admin-event-item {
    grid-template-columns: 1fr;
  }

  .admin-event-actions {
    justify-content: flex-start;
  }

  .dresscode-item {
    grid-template-columns: 1fr;
  }

  .event-row__badges {
    grid-column: 2;
    justify-self: start;
  }

}

@media (max-width: 520px) {
  .category-options {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .toolbar {
    padding: 10px;
    gap: 10px;
  }

  .category-options .checkbox-pill {
    justify-content: flex-start;
    padding-inline: 10px;
    text-align: left;
  }

  .category-options .checkbox-pill--all {
    justify-content: center;
    padding: 0;
  }
}

@media (max-width: 700px) {
  :root {
    --sticky-gap: 8px;
  }

  .toolbar {
    grid-template-columns: minmax(96px, 0.38fr) minmax(0, 1fr);
    margin: 8px 0 12px;
    padding: 7px;
    gap: 6px;
    max-height: none;
    overflow: hidden;
    overscroll-behavior: contain;
  }

  .toolbar > .field,
  .toolbar > .search {
    min-width: 0;
  }

  .search,
  .category-filter-field {
    grid-column: 1 / -1;
  }

  .search {
    order: 1;
  }

  .category-filter-field {
    order: 2;
  }

  .target-audience-filter-field {
    grid-column: 1 / -1;
    order: 3;
  }

  .view-filter-field {
    grid-column: 1 / -1;
    order: 4;
  }

  .view-filter-field .segmented {
    width: min(180px, 100%);
  }

  .toolbar label {
    margin-bottom: 3px;
    font-size: 0.62rem;
  }

  .toolbar input,
  .toolbar select,
  .segmented {
    min-height: 30px;
  }

  .toolbar input,
  .toolbar select {
    padding: 0 10px;
  }

  .segmented__button {
    min-height: 30px;
    padding: 0 9px;
    font-size: 0.82rem;
  }

  .category-options,
  .target-audience-options {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    max-width: 100%;
    padding-bottom: 2px;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }

  .category-options .checkbox-pill {
    flex: 0 0 auto;
    justify-content: center;
    gap: 4px;
    width: auto;
    max-width: 96px;
    min-width: 82px;
    min-height: 25px;
    padding: 0 7px;
    font-size: 0.66rem;
    text-align: center;
    white-space: nowrap;
  }

  .category-options .checkbox-pill input {
    flex: 0 0 auto;
    width: 11px;
    height: 11px;
    min-height: 0;
    margin: 0;
  }

  .category-options .checkbox-pill span {
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: normal;
  }

  .category-options .checkbox-pill--all {
    width: 32px;
    min-width: 32px;
    max-width: 32px;
    padding: 0;
  }

  .select-all-icon {
    transform: scale(0.76);
  }
}

@media (max-width: 430px) {
  .toolbar {
    grid-template-columns: minmax(92px, 0.36fr) minmax(0, 1fr);
  }

  .category-options .checkbox-pill {
    max-width: 84px;
    min-width: 72px;
    min-height: 24px;
    padding-inline: 6px;
    font-size: 0.62rem;
  }

  .category-options .checkbox-pill--all {
    width: 30px;
    min-width: 30px;
  }
}

@media (max-width: 520px) {
  .hero {
    min-height: 40vh;
  }

  .event-modal,
  .image-modal {
    align-items: end;
    padding: 10px;
  }

  .event-modal__panel,
  .image-modal__panel {
    max-height: 88vh;
    padding: 20px;
  }

  .image-modal__panel {
    max-height: calc(100vh - 20px);
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .image-modal__panel img {
    max-height: calc(100vh - 128px);
    margin-top: 32px;
  }

  .event-modal__details {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .brand {
    font-size: 0.95rem;
  }

  .brand__mark {
    width: 28px;
    height: 28px;
  }

  .icon-button {
    width: 38px;
    height: 38px;
  }

  .calendar-head,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-head__buttons {
    justify-content: space-between;
  }

  .button {
    width: 100%;
  }

  .calendar-head {
    align-items: center;
    flex-direction: row;
    padding: 10px 12px;
    gap: 8px;
  }

  .calendar-head .section-label {
    margin-bottom: 3px;
    font-size: 0.62rem;
  }

  .calendar-head h2 {
    font-size: 1.05rem;
  }

  .calendar-head__buttons {
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: nowrap;
  }

  .calendar-head__buttons .button {
    width: auto;
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.78rem;
  }

  .calendar-head__buttons .icon-button {
    width: 32px;
    height: 32px;
  }

  .topbar__actions {
    justify-content: flex-end;
    gap: 8px;
  }

  .hero__content {
    margin-bottom: 10vh;
  }

  .highlight-card {
    min-height: 150px;
  }

  .event-row {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
  }

  .topbar {
    width: min(100% - 20px, 1180px);
  }

  main,
  .hero__content {
    width: min(100% - 20px, 1180px);
  }
}
