:root {
  --bg: #f6f7f4;
  --panel: #ffffff;
  --ink: #1f2933;
  --muted: #6b7280;
  --line: #d8ded6;
  --soft: #eef2ed;
  --accent: #157f74;
  --accent-strong: #0f6159;
  --danger: #ba3434;
  --shadow: 0 18px 50px rgba(31, 41, 51, 0.12);
}

* {
  box-sizing: border-box;
}

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

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  background: #202b33;
  color: white;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f3cf72;
  color: #202b33;
  font-weight: 800;
}

.brand h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.05;
}

.brand p,
.small {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

.profile {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.profile-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.dot {
  width: 15px;
  height: 15px;
  border-radius: 99px;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.8);
}

.nav-list,
.people-list,
.mail-list {
  display: grid;
  gap: 8px;
}

.nav-btn,
.person-btn,
.mail-btn {
  width: 100%;
  text-align: left;
  color: inherit;
  background: transparent;
  border-radius: 8px;
  padding: 10px 12px;
}

.nav-btn.active,
.nav-btn:hover,
.person-btn:hover,
.mail-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.gear-btn {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: #202b33;
  background: #f3cf72;
  border-radius: 8px;
  font-size: 24px;
  line-height: 1;
}

.help-btn {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #3d5968;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  font-size: 22px;
  font-weight: 800;
}

.gear-btn:hover,
.help-btn:hover {
  background: #ffd978;
  color: #202b33;
}

.person-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.sidebar-actions {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.sidebar-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-version {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  text-align: left;
}

.sidebar-top-actions .secondary {
  color: var(--ink);
  flex: 1;
}

.main {
  min-width: 0;
  padding: 22px;
  display: grid;
  gap: 16px;
}

.topbar,
.calendar-head,
.toolbar,
.form-actions,
.dialog-head,
.inline-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar {
  align-items: flex-start;
  justify-content: space-between;
}

.toolbar {
  flex-wrap: wrap;
}

.calendar-filter {
  position: relative;
}

.calendar-filter-button {
  min-width: 92px;
}

.calendar-filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 250px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 35;
}

.calendar-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}

.calendar-filter-actions button {
  flex: 1 1 70px;
  min-height: 32px;
  color: var(--accent-strong);
  background: var(--soft);
  border-radius: 6px;
}

.calendar-filter-options {
  max-height: 280px;
  overflow-y: auto;
  padding-top: 6px;
}

.calendar-filter-option {
  min-height: 32px;
  padding: 5px 6px;
  display: grid;
  grid-template-columns: 18px 14px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

.calendar-filter-option:hover {
  background: var(--soft);
}

.calendar-filter-option input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.filter-color {
  width: 12px;
  height: 12px;
  border-radius: 99px;
  border: 1px solid rgba(31, 41, 51, 0.2);
}

.calendar-filter-option:not(:has(.filter-color)) {
  grid-template-columns: 18px minmax(0, 1fr);
}

.calendar-head {
  justify-content: space-between;
  flex-wrap: wrap;
}

.title-block h2 {
  margin: 0;
  font-size: 28px;
}

.title-block p {
  margin: 4px 0 0;
  color: var(--muted);
}

.period-title-block {
  min-width: min(320px, 100%);
}

.period-navigation {
  width: 84px;
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(2, 38px);
  gap: 8px;
}

.segmented {
  display: flex;
  padding: 3px;
  background: var(--soft);
  border-radius: 8px;
  border: 1px solid var(--line);
}

.segmented button {
  min-width: 62px;
  min-height: 34px;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
}

.segmented button.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 4px rgba(31, 41, 51, 0.12);
}

.icon-btn,
.primary,
.secondary,
.danger,
.ghost {
  min-height: 38px;
  border-radius: 8px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
}

.icon-btn {
  width: 38px;
  padding: 0;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.menu-btn {
  font-size: 21px;
  line-height: 1;
}

.primary {
  color: white;
  background: var(--accent);
}

.primary:hover {
  background: var(--accent-strong);
}

.secondary {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.danger {
  color: white;
  background: var(--danger);
}

.ghost {
  color: inherit;
  background: transparent;
}

.calendar-wrap,
.admin-panel,
.settings-panel,
.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(31, 41, 51, 0.05);
}

.calendar-wrap {
  overflow: hidden;
}

.calendar-vertical-navigation {
  touch-action: pan-x;
}

.calendar-horizontal-navigation {
  touch-action: pan-y;
}

.calendar-slide-up {
  animation: calendar-slide-up 260ms ease-out;
}

.calendar-slide-down {
  animation: calendar-slide-down 260ms ease-out;
}

.calendar-slide-left {
  animation: calendar-slide-left 260ms ease-out;
}

.calendar-slide-right {
  animation: calendar-slide-right 260ms ease-out;
}

@keyframes calendar-slide-up {
  from { opacity: 0.35; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes calendar-slide-down {
  from { opacity: 0.35; transform: translateY(-24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes calendar-slide-left {
  from { opacity: 0.35; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes calendar-slide-right {
  from { opacity: 0.35; transform: translateX(-24px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .calendar-slide-up,
  .calendar-slide-down,
  .calendar-slide-left,
  .calendar-slide-right {
    animation: none;
  }
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekday {
  padding: 10px;
  min-height: 38px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fbfcfb;
}

.day-cell {
  position: relative;
  min-height: 116px;
  padding: 9px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.day-cell.outside {
  background: #f7f8f7;
  color: #9ca3af;
}

.day-cell.today .date-num {
  background: var(--accent);
  color: #fff;
}

.date-num {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 750;
}

.date-num:hover {
  box-shadow: inset 0 0 0 1px var(--accent);
}

.event-list {
  display: grid;
  gap: 4px;
  margin-top: 7px;
}

.day-event-list {
  width: 100%;
}

.reservation-line {
  width: 100%;
  min-height: 22px;
  margin-top: 5px;
  padding: 3px 5px;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  color: #315c37;
  background: #e6f4df;
  border: 1px solid #bdd8b7;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
  text-align: left;
}

.reservation-line span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reservation-line.editable:hover {
  background: #d8edcf;
}

.pickleball-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: #d7ef65;
  stroke: #315c37;
  stroke-width: 1.2;
}

.pickleball-icon circle:not(:first-child) {
  fill: #315c37;
  stroke: none;
}

.reservation-editor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.reservation-entry {
  padding: 14px;
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.reservation-entry-head,
.court-choices {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.reservation-entry-head {
  justify-content: space-between;
}

.reservation-date-heading {
  padding: 10px 12px;
  color: var(--ink);
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 17px;
  font-weight: 800;
}

.reservation-users {
  min-width: 0;
}

.reservation-users[hidden] {
  display: none;
}

.reservation-user-list {
  max-height: 190px;
  overflow-y: auto;
  display: grid;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.reservation-user-list .check-row {
  padding: 7px 8px;
  border-radius: 6px;
}

.reservation-user-list .check-row:hover {
  background: var(--soft);
}

.compact-btn {
  min-height: 32px;
  padding: 0 10px;
}

.event-pill {
  min-height: 24px;
  border-radius: 5px;
  padding: 4px 7px;
  color: #fff;
  font-size: 12px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.calendar-event-tooltip {
  position: fixed;
  z-index: 100;
  max-width: min(360px, calc(100vw - 16px));
  padding: 9px 11px;
  color: #fff;
  background: #263238;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(20, 27, 33, 0.25);
  font-size: 12px;
  line-height: 1.4;
  text-align: left;
  white-space: pre-line;
  pointer-events: none;
}

.day-slot .event-pill {
  width: 100%;
  display: block;
  white-space: normal;
}

.week-view,
.day-view {
  display: grid;
  grid-template-columns: 88px repeat(7, minmax(0, 1fr));
}

.day-view {
  grid-template-columns: 88px minmax(0, 1fr);
}

.time-col,
.week-col,
.single-day {
  border-right: 1px solid var(--line);
}

.time-slot,
.week-slot,
.day-slot {
  min-height: 78px;
  border-bottom: 1px solid var(--line);
  padding: 8px;
}

.time-slot {
  color: var(--muted);
  font-size: 12px;
  background: #fbfcfb;
}

.week-label {
  min-height: 52px;
  padding: 10px;
  font-weight: 750;
  border-bottom: 1px solid var(--line);
  background: #fbfcfb;
}

.year-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 14px;
}

.mini-month {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.mini-month h3 {
  margin: 0;
  padding: 9px 10px;
  font-size: 14px;
  background: #fbfcfb;
  border-bottom: 1px solid var(--line);
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--line);
}

.mini-day {
  min-height: 24px;
  background: #fff;
  position: relative;
  font-size: 10px;
  color: var(--muted);
  padding: 3px;
}

.mini-date-num {
  display: inline-grid;
  min-width: 16px;
  min-height: 16px;
  place-items: center;
  border-radius: 99px;
}

.mini-date-num:hover {
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.mini-line {
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 3px;
  height: 3px;
  border-radius: 8px;
}

.mini-reservation {
  position: absolute;
  top: 1px;
  right: 1px;
  display: flex;
}

.mini-reservation .pickleball-icon {
  width: 9px;
  height: 9px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(246, 247, 244, 0.88), rgba(246, 247, 244, 0.88)),
    url("https://images.unsplash.com/photo-1494526585095-c41746248156?auto=format&fit=crop&w=1800&q=80");
  background-size: cover;
  background-position: center;
}

.login-card {
  width: min(760px, 100%);
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 34px;
}

.app-version {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.field {
  display: grid;
  gap: 6px;
}

.field label,
.check-row {
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
}

.field textarea {
  min-height: 82px;
  resize: vertical;
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 64px;
}

.password-toggle {
  position: absolute;
  right: 5px;
  top: 5px;
  width: 40px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--muted);
  background: var(--soft);
}

.password-toggle:hover {
  color: var(--ink);
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}

.password-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-toggle .eye-slash {
  stroke-width: 2.4;
}

.sidebar-field label {
  color: rgba(255, 255, 255, 0.72);
}

.sidebar-field select {
  color: var(--ink);
  background: #fff;
}

.form-grid {
  display: grid;
  gap: 13px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.event-linked-user {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.event-linked-user > .check-row {
  min-height: 40px;
  align-items: center;
  padding: 0 8px;
}

.event-view-permissions {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.event-view-permissions .title-block h3 {
  margin: 0;
  font-size: 16px;
}

.event-view-permissions .title-block p {
  margin: 3px 0 10px;
}

.event-viewer-list {
  display: grid;
  gap: 4px;
  max-height: 180px;
  margin-top: 8px;
  overflow-y: auto;
}

.event-viewer-list .check-row {
  min-height: 30px;
}

.event-viewer-list .small {
  margin-left: auto;
}

.away-settings {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.family-account {
  display: grid;
  gap: 9px;
}

.family-member-list {
  display: grid;
  gap: 6px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.family-member-list .dot {
  border-color: rgba(31, 41, 51, 0.25);
}

.family-member-list .small {
  color: var(--muted);
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--ink);
}

.check-row input {
  margin-top: 2px;
}

.interest-choices {
  max-height: 190px;
  overflow-y: auto;
  display: grid;
  gap: 5px;
  padding: 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.interest-choices .check-row {
  min-height: 28px;
  align-items: center;
  padding: 3px 5px;
  border-radius: 6px;
}

.interest-choices .check-row:hover {
  background: var(--soft);
}

.interest-choices input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.reservation-user-list .check-row {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
}

.reservation-user-list input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border-radius: 3px;
}

.admin-panel,
.settings-panel {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.admin-panel .small,
.settings-panel .small,
.login-card .small {
  color: var(--muted);
}

.mail-date {
  display: inline-block;
  margin: 3px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.auth-log-controls {
  display: flex;
  align-items: end;
  gap: 8px;
}

.auth-log-controls .field {
  width: 90px;
}

.category-list {
  display: grid;
  gap: 8px;
}

.category-row {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.fixed-category {
  color: var(--muted);
}

.face-choice {
  color: var(--ink);
  border: 1px solid var(--line);
  background: #fbfcfb;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
}

.table th {
  color: var(--muted);
  font-size: 12px;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 27, 33, 0.44);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 20;
}

.dialog {
  width: min(520px, 100%);
  max-height: min(820px, 92vh);
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
  display: grid;
  gap: 14px;
}

.wide-dialog {
  width: min(980px, 100%);
}

.dialog-head {
  justify-content: space-between;
}

.dialog-head-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  margin-left: auto;
}

.dialog-head h2 {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 22px;
}

.weekly-pickleball-dialog .dialog-head h2 {
  font-size: 30px;
  font-weight: 800;
}

.weekly-pickleball-content {
  display: grid;
  gap: 18px;
  padding: 8px 2px;
}

.weekly-pickleball-day {
  display: grid;
  gap: 5px;
}

.weekly-schedule-line {
  font-weight: 800;
  font-size: 17px;
}

.weekly-player {
  padding-left: 28px;
  font-size: 15px;
}

.weekly-pickleball-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.event-list-range {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.event-list-filter-summary {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  color: #44515b;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}

.event-list-content {
  display: grid;
  gap: 22px;
  padding: 4px 2px;
}

.event-list-day {
  display: grid;
  gap: 12px;
}

.event-list-day h3 {
  margin: 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-size: 23px;
  font-weight: 800;
}

.event-list-category {
  display: grid;
  gap: 6px;
  padding-left: 14px;
}

.event-list-category h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}

.event-list-user {
  display: grid;
  grid-template-columns: 12px minmax(150px, 0.4fr) minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding-left: 16px;
  font-size: 14px;
}

.event-list-user .filter-color {
  margin-top: 3px;
}

.event-list-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.copy-btn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 3px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.settings-tabs button {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
}

.settings-tabs button.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 4px rgba(31, 41, 51, 0.12);
}

.settings-window-body {
  display: grid;
  gap: 14px;
}

.help-content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 28px;
}

.help-content section {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.help-content h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.help-content p {
  margin: 0 0 9px;
  color: #44515b;
  font-size: 14px;
  line-height: 1.55;
}

.help-content p:last-child {
  margin-bottom: 0;
}

.help-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.help-version {
  color: var(--muted);
  font-size: 12px;
}

.whats-new-content {
  min-height: 280px;
}

.feature-list-intro {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.feature-list-content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px;
}

.feature-list-content section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.feature-list-content h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.feature-list-content ul {
  margin: 0;
  padding-left: 20px;
}

.feature-list-content li {
  margin-bottom: 7px;
  color: #44515b;
  font-size: 14px;
  line-height: 1.5;
}

.whats-new-content h3 {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 800;
}

.whats-new-content ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 24px;
  color: #44515b;
  line-height: 1.55;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(420px, calc(100vw - 40px));
  color: #fff;
  background: #202b33;
  padding: 12px 14px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 30;
}

.inactivity-warning {
  background: #8a4b00;
  border: 1px solid #f3cf72;
}

.context-menu {
  position: fixed;
  min-width: 250px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 40;
}

.context-menu button {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  color: var(--ink);
  text-align: left;
  border-radius: 6px;
  background: transparent;
}

.context-menu button:hover {
  background: var(--soft);
}

.empty {
  color: var(--muted);
  padding: 16px;
  text-align: center;
}

.swatches {
  display: grid;
  grid-template-columns: repeat(8, 30px);
  gap: 8px;
}

.swatch {
  width: 30px;
  height: 30px;
  border-radius: 99px;
  border: 3px solid transparent;
}

.swatch.selected {
  border-color: #202b33;
}

.color-picker-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.spectrum-picker {
  width: 52px;
  height: 40px;
  padding: 2px;
}

.notice {
  color: #704800;
  background: #fff2cf;
  border: 1px solid #e8cc86;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
}

@media (max-width: 920px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    padding: 14px;
    gap: 12px;
  }

  .sidebar-actions {
    margin-top: 0;
  }

  .main {
    padding: 16px;
  }

  .login-card,
  .two-col,
  .event-linked-user,
  .reservation-editor,
  .help-content,
  .feature-list-content {
    grid-template-columns: 1fr;
  }

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

  .admin-panel {
    overflow-x: auto;
  }

  .table {
    min-width: 680px;
  }
}

@media (max-width: 640px) {
  body {
    overflow-x: hidden;
  }

  button,
  input,
  select,
  textarea {
    font-size: 16px;
  }

  .shell {
    min-height: 100dvh;
  }

  .sidebar {
    padding: 10px 12px;
    gap: 9px;
  }

  .sidebar .brand {
    min-height: 38px;
  }

  .sidebar .brand-mark {
    width: 36px;
    height: 36px;
  }

  .sidebar .brand h1 {
    font-size: 18px;
  }

  .sidebar .brand p,
  .sidebar .profile,
  .sidebar-version {
    display: none;
  }

  .sidebar-top-actions {
    display: grid;
    grid-template-columns: 42px 42px minmax(0, 1fr);
    gap: 8px;
  }

  .gear-btn,
  .help-btn {
    width: 42px;
    height: 42px;
  }

  .sidebar-top-actions .secondary {
    min-width: 0;
  }

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

  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .title-block h2 {
    font-size: 22px;
  }

  .title-block p {
    font-size: 13px;
  }

  .toolbar {
    display: grid;
    grid-template-columns: 42px minmax(72px, 1fr) 42px 42px;
    gap: 6px;
  }

  .toolbar > .segmented {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }

  .toolbar > .segmented button {
    min-width: 0;
    padding: 0 5px;
  }

  .toolbar > .calendar-filter {
    min-width: 0;
  }

  .toolbar > .calendar-filter,
  .toolbar > .secondary,
  .toolbar > .primary {
    grid-column: span 2;
    width: 100%;
  }

  .toolbar > .menu-btn {
    grid-column: 4;
    grid-row: 1;
  }

  .toolbar > [data-action="today"] {
    grid-column: 1 / 4;
    grid-row: 1;
    width: 100%;
    min-width: 0;
    padding: 0 6px;
  }

  .calendar-filter-button {
    width: 100%;
    min-width: 0;
  }

  .calendar-filter-menu {
    position: fixed;
    left: 10px;
    right: 10px;
    top: auto;
    bottom: 10px;
    width: auto;
    max-height: 70dvh;
  }

  .calendar-wrap {
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  .month-grid {
    min-width: 700px;
  }

  .month-grid .day-cell {
    min-height: 100px;
  }

  .day-view {
    min-width: 0;
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .weekly-pickleball-dialog .dialog-head h2 {
    font-size: 20px;
  }

  .day-cell {
    min-height: 86px;
    padding: 5px;
  }

  .weekday {
    padding: 8px 4px;
    text-align: center;
  }

  .event-pill {
    font-size: 11px;
    padding: 3px 5px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .event-list-user {
    grid-template-columns: 12px minmax(0, 1fr);
  }

  .event-list-user > span:last-child {
    grid-column: 2;
  }

  .year-grid {
    grid-template-columns: 1fr;
    padding: 8px;
  }

  .week-view {
    grid-template-columns: 58px repeat(7, minmax(84px, 1fr));
    overflow-x: auto;
  }

  .dialog-backdrop {
    align-items: end;
    padding: 0;
  }

  .dialog,
  .wide-dialog {
    width: 100%;
    max-height: 96dvh;
    padding: 14px;
    border-radius: 8px 8px 0 0;
  }

  .dialog-head {
    position: sticky;
    top: -14px;
    z-index: 3;
    flex-wrap: wrap;
    margin: -14px -14px 0;
    padding: 12px 14px;
    background: #fff;
    border-bottom: 1px solid var(--line);
  }

  .dialog-head h2 {
    flex: 1 1 150px;
    min-width: 0;
    font-size: 19px;
    overflow-wrap: anywhere;
  }

  .dialog-head-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .form-actions,
  .help-actions {
    flex-wrap: wrap;
  }

  .form-actions > button {
    flex: 1 1 calc(50% - 6px);
  }

  .help-actions .inline-actions {
    margin-left: auto;
  }

  .event-linked-user {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .swatches {
    grid-template-columns: repeat(4, 30px);
  }

  .login-page {
    padding: 10px;
  }

  .login-card {
    padding: 16px;
    gap: 16px;
  }

  .login-card h1 {
    font-size: 27px;
  }

  .context-menu {
    left: 10px !important;
    right: 10px;
    width: auto;
    min-width: 0;
  }

  .toast {
    left: 10px;
    right: 10px;
    bottom: 10px;
    max-width: none;
  }
}

@media (max-width: 400px) {
  .toolbar {
    grid-template-columns: 40px minmax(64px, 1fr) 40px 40px;
  }

  .toolbar > .calendar-filter,
  .toolbar > .secondary,
  .toolbar > .primary {
    grid-column: 1 / -1;
  }

  .event-linked-user {
    grid-template-columns: 1fr;
  }

  .event-linked-user > .check-row {
    min-height: 32px;
    padding: 0;
  }

  .help-actions {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .help-actions .inline-actions {
    grid-column: 1 / -1;
    width: 100%;
  }

  .help-actions .inline-actions .secondary {
    flex: 1;
  }
}
