.choice-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-field > legend {
  margin-bottom: 9px;
  color: var(--text);
  font-size: 10px;
  font-weight: 700;
}

.choice-field-joinPolicy,
.choice-field-accessRules {
  grid-column: 1 / -1;
}

.group-name-access-row > .field {
  grid-column: 1 / -1;
}

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

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

#groupDrawer .drawer-cover {
  min-height: 210px;
  gap: 0;
  padding: 34px 28px 25px;
}

#groupDrawer .drawer-cover-copy {
  max-width: 360px;
}

#groupDrawer .drawer-cover h2 {
  margin: 0 0 6px;
}

#groupDrawer .drawer-summary-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
}

#groupDrawer .drawer-summary .primary-button {
  margin-left: 0;
}

.drawer-settings-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--cream);
  background: rgba(255,255,255,.035);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}

.drawer-settings-button:hover,
.drawer-settings-button:focus-visible {
  border-color: rgba(232,224,207,.45);
  background: rgba(232,224,207,.09);
  outline: none;
}

.drawer-settings-button svg {
  width: 16px;
  height: 16px;
}

.choice-card {
  min-width: 0;
  cursor: pointer;
}

.choice-card > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.choice-card-surface {
  position: relative;
  min-height: 76px;
  display: grid;
  grid-template-columns: 30px 1fr 18px;
  align-items: center;
  gap: 10px;
  padding: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255,255,255,.025);
  transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}

.choice-card:hover .choice-card-surface {
  transform: translateY(-1px);
  border-color: rgba(232,224,207,.2);
  background: rgba(255,255,255,.04);
}

.choice-card-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted-2);
  background: rgba(255,255,255,.035);
}

.choice-card-icon svg,
.choice-card-check svg {
  width: 15px;
  height: 15px;
}

.choice-card-surface strong,
.choice-card-surface small {
  display: block;
}

.choice-card-surface strong {
  margin-bottom: 3px;
  color: var(--text);
  font-size: 10px;
}

.choice-card-surface small {
  color: var(--muted-2);
  font-size: 8px;
  line-height: 1.35;
}

.choice-card-check {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: transparent;
  transition: .18s ease;
}

.choice-card > input:focus-visible + .choice-card-surface {
  outline: 2px solid #8aa8c8;
  outline-offset: 2px;
}

.choice-card > input:checked + .choice-card-surface {
  border-color: rgba(232,224,207,.55);
  background: linear-gradient(145deg, rgba(232,224,207,.12), rgba(255,255,255,.035));
  box-shadow: 0 12px 30px rgba(0,0,0,.2), inset 0 0 0 1px rgba(255,255,255,.03);
}

.choice-card > input:checked + .choice-card-surface .choice-card-icon {
  color: #17191e;
  border-color: var(--cream);
  background: var(--cream);
}

.choice-card > input:checked + .choice-card-surface .choice-card-check {
  color: #17191e;
  border-color: var(--cream);
  background: var(--cream);
}

.group-visibility-row {
  grid-template-columns: 1fr;
}

#createGroupForm .theme-picker {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.theme-slate { --swatch: linear-gradient(145deg,#242a32,#55606c); }
.theme-burgundy { --swatch: linear-gradient(145deg,#462631,#7d4153); }
.theme-indigo { --swatch: linear-gradient(145deg,#252c52,#53649b); }
.theme-amber { --swatch: linear-gradient(145deg,#563916,#a06f2d); }

.theme-image-upload__swatch {
  position: relative;
  border-style: dashed;
}

.theme-image-upload__swatch i {
  background: linear-gradient(145deg, rgba(232,224,207,.15), rgba(255,255,255,.025));
}

.theme-image-upload__icon {
  position: absolute;
  inset: 6px 6px 22px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--cream);
  background: rgba(10,12,15,.16);
}

.theme-image-upload__icon svg {
  width: 16px;
  height: 16px;
}

.theme-image-upload.has-image .theme-image-upload__swatch {
  border-color: var(--cream);
}

.theme-image-upload.has-image .theme-image-upload__swatch i {
  background-image: linear-gradient(145deg, rgba(14,17,20,.12), rgba(14,17,20,.4)), var(--uploaded-cover);
  background-position: center;
  background-size: cover;
}

.theme-image-upload.has-image .theme-image-upload__icon {
  display: none;
}

.theme-image-upload.has-image .theme-image-upload__swatch b {
  color: var(--cream);
}

.drawer-tabs [data-group-tab="agenda"] {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.drawer-tabs [data-group-tab="agenda"] svg {
  width: 13px;
  height: 13px;
}

.drawer-section-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--muted-2);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .85px;
  text-transform: uppercase;
}

.group-upcoming-list,
.group-calendar-list {
  display: grid;
  gap: 8px;
}

.group-calendar-event {
  width: 100%;
  min-height: 65px;
  display: grid;
  grid-template-columns: 52px 1fr 18px;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: rgba(255,255,255,.025);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.group-calendar-event::before {
  content: "";
  position: absolute;
}

.group-calendar-event:hover {
  transform: translateY(-1px);
  border-color: rgba(232,224,207,.22);
  background: rgba(255,255,255,.04);
}

.group-calendar-event-time {
  min-height: 40px;
  display: grid;
  place-items: center;
  padding: 4px;
  border: 1px solid color-mix(in srgb, var(--event-color) 35%, transparent);
  border-radius: 10px;
  color: var(--event-color);
  background: color-mix(in srgb, var(--event-color) 10%, transparent);
  font-size: 8px;
  font-weight: 700;
}

.group-calendar-event strong,
.group-calendar-event small {
  display: block;
}

.group-calendar-event strong {
  margin-bottom: 4px;
  font-size: 9px;
}

.group-calendar-event small {
  color: var(--muted-2);
  font-size: 8px;
}

.group-calendar-event > svg {
  width: 15px;
  height: 15px;
  color: var(--muted-2);
}

.group-calendar-empty {
  min-height: 120px;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 20px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 15px;
  background: rgba(255,255,255,.014);
}

.group-calendar-empty.compact {
  grid-template-columns: 35px 1fr auto;
  min-height: 0;
  text-align: left;
}

.group-calendar-empty > span {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--cream);
  background: rgba(232,224,207,.08);
}

.group-calendar-empty svg {
  width: 17px;
  height: 17px;
}

.group-calendar-empty strong,
.group-calendar-empty p {
  display: block;
}

.group-calendar-empty strong {
  margin-bottom: 3px;
  color: var(--text);
  font-size: 9px;
}

.group-calendar-empty p {
  margin: 0;
  color: var(--muted-2);
  font-size: 8px;
  line-height: 1.45;
}

.group-calendar-empty .secondary-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 8px;
}

.group-calendar-section {
  padding-bottom: 30px;
}

.group-calendar-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 15px;
}

.group-calendar-top h3 {
  margin: 0;
  font-size: 17px;
}

.compact-button {
  min-height: 35px;
  padding: 0 11px;
  font-size: 8px;
}

.group-drawer-action,
.drawer-section-heading .group-drawer-action {
  flex: 0 0 auto;
  min-height: 35px;
  padding: 0 11px;
  gap: 6px;
  border: 0;
  color: #15181d;
  background: var(--cream);
  white-space: nowrap;
}

.group-drawer-action svg {
  width: 13px;
  height: 13px;
}

.group-calendar-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,255,255,.02);
}

.group-calendar-nav,
.group-calendar-view-switch {
  display: flex;
  align-items: center;
  gap: 3px;
}

.group-calendar-nav button,
.group-calendar-view-switch button {
  min-height: 31px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
}

.group-calendar-nav button:hover,
.group-calendar-view-switch button:hover {
  color: var(--text);
  background: rgba(255,255,255,.04);
}

.group-calendar-nav button:first-child,
.group-calendar-nav button:last-child {
  width: 31px;
  padding: 0;
  border: 1px solid var(--line);
}

.group-calendar-nav button svg {
  width: 13px;
  height: 13px;
}

.group-calendar-nav .previous svg {
  transform: rotate(180deg);
}

.group-calendar-view-switch {
  padding: 3px;
  border-radius: 10px;
  background: rgba(0,0,0,.16);
}

.group-calendar-view-switch button.active {
  color: #17191e;
  background: var(--cream);
  box-shadow: 0 6px 14px rgba(0,0,0,.18);
}

.group-day-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 2px 2px 11px;
  text-transform: capitalize;
}

.group-day-heading span {
  color: var(--muted);
  font-size: 9px;
}

.group-day-heading strong {
  font-size: 10px;
}

.group-week-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 14px;
}

.group-week-day {
  position: relative;
  min-height: 59px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted-2);
  background: rgba(255,255,255,.016);
  cursor: pointer;
}

.group-week-day span {
  font-size: 7px;
  text-transform: uppercase;
}

.group-week-day strong {
  color: var(--muted);
  font-size: 11px;
}

.group-week-day i,
.group-month-day i {
  min-width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #17191e;
  background: var(--cream);
  font-size: 7px;
  font-style: normal;
  font-weight: 800;
}

.group-week-day.active {
  border-color: rgba(232,224,207,.45);
  background: rgba(232,224,207,.09);
}

.group-week-day.active strong,
.group-week-day.today strong {
  color: var(--cream);
}

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

.group-month-weekdays {
  margin-bottom: 5px;
}

.group-month-weekdays span {
  padding: 4px 0;
  color: var(--muted-2);
  font-size: 7px;
  text-align: center;
  text-transform: uppercase;
}

.group-month-day {
  position: relative;
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  background: rgba(255,255,255,.018);
  font-size: 8px;
  cursor: pointer;
}

.group-month-day.outside {
  opacity: .28;
}

.group-month-day.today {
  box-shadow: inset 0 0 0 1px rgba(232,224,207,.3);
}

.group-month-day.active {
  color: #17191e;
  border-color: var(--cream);
  background: var(--cream);
}

.group-month-day i {
  position: absolute;
  right: 3px;
  bottom: 3px;
  min-width: 12px;
  height: 12px;
  font-size: 6px;
}

.group-month-day.active i {
  color: var(--cream);
  background: #17191e;
}

.month-selection {
  margin-top: 14px;
}

.group-selection-label {
  margin: 0 2px 2px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  text-transform: capitalize;
}

.group-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.group-filter-chip > i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--group-dot);
}

.group-filter-chip > span {
  font-size: 13px;
  line-height: 1;
}

.group-event-badge {
  color: var(--cream);
  background: rgba(232,224,207,.1);
}

.event-group-field {
  margin-bottom: 14px;
}

.event-group-field > span small {
  margin-left: 5px;
  color: var(--muted-2);
  font-weight: 500;
}

.event-group-field select {
  appearance: none;
  padding-right: 42px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) calc(50% - 2px), calc(100% - 12px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.event-group-field em {
  display: block;
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 8px;
  font-style: normal;
  line-height: 1.4;
}

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

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

  .choice-card-surface {
    min-height: 62px;
  }

  #groupDrawer .drawer-cover {
    min-height: 190px;
    padding: 58px 20px 23px;
  }

  #createGroupForm .theme-picker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .group-calendar-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .group-calendar-nav,
  .group-calendar-view-switch {
    justify-content: space-between;
  }

  .group-calendar-view-switch button {
    flex: 1;
  }

  .group-calendar-empty.compact {
    grid-template-columns: 35px 1fr;
  }

  .group-calendar-empty.compact button {
    grid-column: 2;
    justify-self: start;
  }
}
