:root {
  --accent: #c91830;
  --dark: #171719;
  --ink: #1c1b20;
  --muted: #5d5a65;
  --line: #e7e4e8;
  --paper: #fff;
  --background: #f5f4f6;
  --tint: color-mix(in srgb, var(--accent) 7%, white);
  --action: color-mix(in srgb, var(--accent) 72%, #131315);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--background);
  line-height: 1.48;
}
* { box-sizing: border-box; }
body, h1, h2, p, ul, fieldset, form { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 3px solid #205bb7; outline-offset: 3px; }
.shell { width: min(1170px, calc(100% - 48px)); margin-inline: auto; }
.narrow { max-width: 850px; }
.subtle { color: var(--muted); font-size: .875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.stack { display: grid; gap: 1rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 44px; padding: .63rem .92rem; border: 1px solid transparent; border-radius: 9px;
  text-decoration: none; font-size: .9rem; font-weight: 700; line-height: 1.2; text-align: center;
}
.button.primary { background: var(--action); color: white; }
.button.primary:hover { background: color-mix(in srgb, var(--action) 86%, black); }
.button.secondary { background: white; border-color: #dedbe0; color: var(--ink); }
.button.secondary:hover { background: #f4f2f5; }
.button > span { font-size: 1.2em; line-height: .8; }
.topbar { background: #fff; border-top: 4px solid var(--accent); border-bottom: 1px solid var(--line); }
.topbar-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; }
.club, .login-brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; }
.wordmark { font-weight: 850; letter-spacing: -.035em; font-size: 1.14rem; overflow-wrap: anywhere; }
.crest {
  display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 48px;
  background: white; border: 1px solid var(--line); border-radius: 50%;
}
.crest img, .logo-upload img, .poster-logo img { max-width: 100%; object-fit: contain; }
.topbar nav { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.topbar nav a, .nav-button {
  color: #53505b; text-decoration: none; background: transparent; border: 0;
  font-weight: 650; font-size: .88rem; padding: .57rem .72rem; border-radius: 7px;
}
.topbar nav a[aria-current], .topbar nav a:hover, .nav-button:hover { background: var(--tint); color: #28242b; }
.main-section { padding-block: 2.8rem 4rem; }
.page-heading, .section-heading, .sharing { display: flex; justify-content: space-between; align-items: center; gap: 1.2rem; }
.page-heading { margin-bottom: 1.6rem; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 850; letter-spacing: -.062em; line-height: 1.07; overflow-wrap: anywhere; }
h2 { font-size: 1.18rem; font-weight: 800; letter-spacing: -.025em; }
.page-heading p, .section-heading p { color: var(--muted); margin-top: .5rem; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; }
.empty { padding: 3.3rem 1.3rem; text-align: center; }
.empty p { color: var(--muted); margin: .45rem 0 1.1rem; }
.calendar-row { display: flex; gap: 1rem; align-items: center; padding: 1rem 1.15rem; }
.calendar-row + .calendar-row { border-top: 1px solid var(--line); }
.date-tile {
  display: grid; place-content: center; text-align: center; width: 57px; height: 62px; flex-shrink: 0;
  border-radius: 9px; background: var(--tint); border-top: 3px solid var(--accent); line-height: 1.1;
}
.date-tile span { font-size: .75rem; font-weight: 650; }
.date-tile strong { font-size: 1.3rem; }
.row-detail { flex: 1; }
.row-detail p { color: var(--muted); font-size: .9rem; }
.row-title { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.row-title a { text-decoration: none; overflow-wrap: anywhere; }
.row-title a:hover { text-decoration: underline; }
.pill { display: inline-block; border-radius: 50px; padding: .2rem .55rem; background: #efedf1; color: #4e4a56; font-size: .8rem; font-weight: 700; }
.pill.live { background: #e3f3e9; color: #236447; }
.back { display: inline-block; font-weight: 700; font-size: .93rem; text-underline-offset: 3px; margin-bottom: 1.05rem; }
.sharing { padding: 1rem 1.2rem; margin-bottom: 1rem; }
.public-address { color: #4b4654; font-size: .88rem; overflow-wrap: anywhere; }
.notice { padding: .85rem 1rem; background: #e6f4eb; border-radius: 9px; color: #245d43; margin-bottom: 1rem; }
.notice.error { background: #fbe9ec; color: #861d32; }
.form-panel { padding: 1.2rem; }
.form-panel > h2:first-child { margin-bottom: .7rem; }
.form-panel.stack > h2:first-child { margin-bottom: 0; }
label { display: grid; gap: .3rem; font-size: .88rem; font-weight: 700; min-width: 0; }
input:not([type=color], [type=checkbox]), select {
  width: 100%; min-width: 0; min-height: 44px; padding: .57rem .65rem; font-size: 1rem; font-weight: 450;
  border: 1px solid #dbd8de; color: var(--ink); border-radius: 8px; background: #fff;
}
select { appearance: none; padding-right: 1.65rem; background: linear-gradient(45deg,transparent 50%,#555 50%) right 12px center/5px 5px no-repeat, linear-gradient(135deg,#555 50%,transparent 50%) right 7px center/5px 5px no-repeat, #fff; }
.period-fields { display: grid; gap: .85rem; align-items: start; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)); }
.event-list { display: grid; gap: .75rem; margin-top: 1rem; }
.event-row {
  display: grid; align-items: end; gap: .65rem; grid-template-columns: minmax(0, 2fr) minmax(102px, 1fr) repeat(2, minmax(0, 1fr)) 44px;
  border: 1px solid var(--line); background: #faf9fb; border-radius: 10px; padding: .75rem; min-width: 0;
}
.event-row label { display: block; }
.event-row input, .event-row select { display: block; margin-top: .35rem; }
.optional { color: var(--muted); font-weight: 450; }
.remove { color: #861d32; background: #fff; border-color: var(--line); padding: 0; font-size: 1.4rem; }
.remove:hover { background: #fbe9ec; }
.empty-events { color: var(--muted); border: 1px dashed #dad5df; border-radius: 9px; padding: 1.05rem; }
.form-actions { justify-content: flex-end; }
.logo-upload { display: flex; gap: 1rem; align-items: center; }
.logo-upload img { border: 1px solid var(--line); border-radius: 12px; padding: 5px; flex: 0 0 auto; }
.logo-upload .stack { gap: .3rem; min-width: 0; }
.check { display: flex; align-items: center; gap: .4rem; }
.color-list { display: flex; flex-wrap: wrap; gap: .6rem; }
.color-field { display: flex; align-items: center; gap: .55rem; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 9px; min-width: 125px; }
.color-field input { height: 36px; width: 36px; border: 0; padding: 0; background: transparent; cursor: pointer; }
.color-field small { display: block; color: var(--muted); font-size: .75rem; font-weight: 500; }
.sign-in { min-height: 100dvh; display: grid; place-items: center; padding: 1.3rem; background: radial-gradient(ellipse at 22% 4%, var(--tint), transparent 60%), var(--background); }
.login-card { width: min(100%, 440px); padding: clamp(1.2rem, 5vw, 2rem); border: 1px solid var(--line); border-top: 5px solid var(--accent); border-radius: 16px; background: white; box-shadow: 0 15px 50px #2318210c; }
.login-brand { margin-bottom: 1.2rem; }
.login-card h1 { font-size: clamp(1.9rem, 6vw, 2.65rem); margin-bottom: .4rem; }
.login-card form, .login-card .notice { margin-top: 1.15rem; }
.public-shell { padding-block: 1.25rem 2.5rem; }
.poster-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; margin-bottom: .9rem; }
.poster-toolbar .actions { margin-left: auto; }
.poster-toolbar .back { margin: 0; }
.poster-toolbar p { width: 100%; text-align: right; }
.poster { background: white; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.poster-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: clamp(1.15rem, 4vw, 2.4rem);
  border-top: 8px solid var(--accent); background: color-mix(in srgb, var(--dark) 75%, #0c0b0e); color: white;
}
.poster-club { font-weight: 750; color: #fff; overflow-wrap: anywhere; }
.poster-heading h1 { margin: .28rem 0 .65rem; }
.poster-heading p { color: #f0edf2; }
.poster-text { min-width: 0; }
.poster-logo { display: grid; place-items: center; width: 108px; height: 108px; flex: 0 0 auto; padding: 7px; border-radius: 50%; background: #fff; }
.poster-logo img { height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: .45rem 1.15rem; list-style: none; padding: .95rem clamp(1rem, 3vw, 1.9rem); border-bottom: 1px solid var(--line); }
.legend li { display: flex; align-items: center; gap: .42rem; font-size: .875rem; font-weight: 700; }
.marker { display: inline-block; flex: 0 0 auto; width: 9px; height: 9px; background: var(--category); border-radius: 50%; box-shadow: inset 0 0 0 1px #0003; }
.months { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; padding: clamp(.85rem, 3vw, 1.8rem); align-items: start; }
.public-shell:has(.month:only-child) { max-width: 680px; }
.public-shell:has(.month:nth-child(2):last-child) { max-width: 900px; }
.months:has(> .month:only-child) { grid-template-columns: minmax(0, 1fr); }
.month { padding: .85rem; border: 1px solid var(--line); border-radius: 12px; }
.month h2 { margin-bottom: .65rem; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .2rem; }
.weekday { text-align: center; color: var(--muted); font-size: .875rem; font-weight: 700; }
.day { display: grid; place-items: center; background: #f5f4f6; border-radius: 5px; min-height: 36px; font-size: .9rem; padding: 1px; }
.day.blank { background: none; }
.day.marked { background: var(--tint); font-weight: 800; }
.marks { display: flex; flex-wrap: wrap; justify-content: center; gap: 1px; min-height: 5px; }
.marks .marker { width: 4px; height: 4px; box-shadow: none; }
.agenda { display: grid; gap: .58rem; list-style: none; padding: .7rem 0 0; }
.agenda-item { display: flex; gap: .5rem; align-items: flex-start; padding-top: .5rem; border-top: 1px solid var(--line); }
.agenda-item .marker { margin-top: .35rem; }
.agenda-item div { min-width: 0; }
.agenda-item time, .agenda-item div > span { color: var(--muted); font-size: .86rem; display: block; }
.agenda-item strong { display: block; overflow-wrap: anywhere; font-size: .95rem; }
.no-events { color: var(--muted); margin-top: .7rem; font-size: .86rem; }
@media (max-width: 900px) {
  .months { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .event-row { grid-template-columns: 1fr 1fr 1fr 44px; }
  .event-name { grid-column: 1 / -1; }
}
@media (min-width: 631px) {
  .months:has(> .month:nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 630px) {
  .shell { width: calc(100% - 24px); }
  .topbar-inner, .page-heading, .section-heading, .sharing { align-items: flex-start; flex-direction: column; gap: .75rem; }
  .topbar-inner { padding-block: .65rem; }
  .topbar nav { gap: .2rem; }
  .topbar nav a, .nav-button { padding: .5rem .55rem; }
  .main-section { padding-top: 1.45rem; }
  .calendar-row { flex-wrap: wrap; }
  .calendar-row .actions { flex-basis: 100%; }
  .period-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .period-fields label:first-child { grid-column: 1 / -1; }
  .event-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .event-row .remove { justify-self: end; width: 44px; }
  .form-actions { justify-content: flex-start; }
  .months { grid-template-columns: minmax(0, 1fr); }
  .poster-logo { width: 66px; height: 66px; }
  .poster-heading h1 { font-size: clamp(1.75rem, 7vw, 2.4rem); }
  .poster-toolbar .actions { margin-left: 0; }
}
