.csm-admin-wrap {
  max-width: 1400px;
}

.csm-admin-header {
  margin: 18px 0 18px;
}

.csm-overline {
  color: #0b56b0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
  margin-bottom: 8px;
}

.csm-admin-header h1 {
  margin: 0;
  font-size: 32px;
  color: #1f2937;
}

.csm-admin-header p {
  margin: 10px 0 0;
  color: #6b7280;
  max-width: 820px;
}

.csm-admin-grid-modern {
  display: grid;
  grid-template-columns: 1.65fr 0.85fr;
  gap: 18px;
}

.csm-card {
  background: #fff;
  border: 1px solid #edf2f7;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.csm-editor-card {
  padding: 24px;
}

.csm-form-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.csm-form-layout label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.csm-form-layout label > span,
.csm-field-label {
  color: #4b5563;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.csm-form-layout input,
.csm-form-layout select,
.csm-form-layout textarea {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #f7f8fb;
  padding: 14px 16px;
  box-sizing: border-box;
  color: #111827;
}

.csm-form-layout select {
  appearance: auto;
}

.csm-form-layout textarea {
  resize: vertical;
}

.csm-form-full {
  grid-column: 1 / -1;
}

.csm-type-section {
  display: none;
}

.csm-type-section.is-visible {
  display: block;
}

.csm-delivery-section {
  display: none;
}

.csm-delivery-section.is-visible {
  display: block;
}

.csm-pill-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.csm-pill-groups {
  display: grid;
  gap: 12px;
}

.csm-type-group {
  display: none;
}

.csm-type-group.is-visible {
  display: flex;
}

.csm-segment-pill,
.csm-choice-chip,
.csm-delivery-card {
  position: relative;
}

.csm-segment-pill input,
.csm-choice-chip input,
.csm-delivery-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.csm-segment-pill span {
  display: block;
  min-width: 124px;
  text-align: center;
  padding: 12px 16px;
  border-radius: 14px;
  background: #ffffff;
  color: #6c1096;
  border: 2px solid #6c1096;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.csm-segment-pill:hover span {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  background: #6000ce;
  border-color: #6000ce;
  color: #ffffff;
}

.csm-segment-pill.is-active span,
.csm-segment-pill input:checked + span {
  background: #23bf00;
  color: #ffffff;
  border-color: #23bf00;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.16);
}

.csm-choice-chip span {
  display: block;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 800;
  cursor: pointer;
  border: 2px solid #6c1096;
  background: #ffffff;
  color: #6c1096;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, opacity 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.csm-choice-chip:hover span {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  color: #ffffff;
  background: #6000ce;
  border-color: #6000ce;
}

.csm-choice-academic_general span {
  background: #ffffff;
}

.csm-choice-ukvi span {
  background: #ffffff;
}

.csm-choice-regular span {
  background: #ffffff;
}

.csm-choice-chip input:checked + span,
.csm-choice-chip.is-active span {
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.08);
  background: #23bf00;
  border-color: #23bf00;
  color: #ffffff;
}

.csm-delivery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.csm-delivery-card {
  display: block;
  border-radius: 16px;
  background: #ffffff;
  border: 2px solid #6c1096;
  padding: 18px 18px 16px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.csm-delivery-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  background: #6000ce;
  border-color: #6000ce;
}

.csm-delivery-card:hover .csm-delivery-title,
.csm-delivery-card:hover .csm-delivery-desc {
  color: #ffffff;
}

.csm-delivery-card.is-active {
  color: #ffffff;
  background: #23bf00;
  border-color: #23bf00;
}

.csm-delivery-card.is-active .csm-delivery-title,
.csm-delivery-card.is-active .csm-delivery-desc {
  color: #ffffff;
}

.csm-delivery-card.is-active input[value="digital"] ~ .csm-delivery-title,
.csm-delivery-card.is-active input[value="digital"] ~ .csm-delivery-desc {
  color: #ffffff;
}

.csm-delivery-title {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: #6c1096;
}

.csm-delivery-desc {
  display: block;
  margin-top: 6px;
  color: #6c1096;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.csm-actions {
  margin-top: 22px;
  display: flex;
  gap: 10px;
}

.csm-actions .button-primary {
  background: #0b56b0;
  border-color: #0b56b0;
}

.csm-sheet-settings-form {
  display: grid;
  gap: 14px;
}

.csm-sheet-settings-form label {
  display: grid;
  gap: 8px;
}

.csm-sheet-settings-form label > span {
  color: #4b5563;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.csm-sheet-settings-form input[type="text"] {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #f7f8fb;
  padding: 14px 16px;
  box-sizing: border-box;
}

.csm-sheet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.csm-sheet-meta {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  color: #374151;
}

.csm-sheet-toggle {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 10px !important;
}

.csm-sheet-toggle input {
  margin: 0;
}

.csm-sheet-sync-now-form {
  margin-top: 12px;
}

.csm-sheet-master-notice {
  margin: 0 0 18px;
}

.csm-master-readonly {
  display: grid;
  gap: 14px;
}

.csm-master-readonly h2 {
  margin: 0;
  font-size: 24px;
  color: #1f2937;
}

.csm-master-readonly p {
  margin: 0;
  color: #6b7280;
  max-width: 700px;
}

.csm-master-readonly-list {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #f8fafc;
  color: #374151;
}

.csm-sidebar-panels {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.csm-preview-card {
  border-radius: 18px;
  padding: 24px;
  background: linear-gradient(135deg, #1d76d2, #0b56b0);
  color: #ffffff;
  box-shadow: 0 18px 40px rgba(11, 86, 176, 0.25);
}

.csm-preview-card h3 {
  margin: 0 0 10px;
  font-size: 30px;
}

.csm-preview-card p {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.6;
}

.csm-preview-summary {
  display: grid;
  gap: 10px;
  background: rgba(255, 255, 255, 0.12);
}

/* responsive calendar for mobile */
.csm-schedule-shell {
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.csm-schedule-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.csm-calendar-wrap {
  width: 100%;
  overflow-x: auto;
}

.csm-calendar-toolbar {
  width: 100%;
  margin-bottom: 10px;
}

.csm-calendar-heading h2 {
  margin: 0;
  font-size: 1.35rem;
}

.csm-calendar-heading p {
  margin: 4px 0 0;
  color: #6b7280;
  font-size: 0.95rem;
}

.csm-calendar-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.csm-calendar-controls .csm-controls-top-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.csm-branch-select-wrap,
.csm-category-tabs,
.csm-month-switcher {
  width: 100%;
}

.csm-branch-select-field select {
  width: 100%;
  max-width: 100%;
}

.csm-category-tabs a,
.csm-month-chip {
  display: inline-flex;
  flex: 1 1 auto;
  justify-content: center;
  padding: 8px 10px;
  min-width: 80px;
  box-sizing: border-box;
}

.csm-calendar-table {
  width: 100%;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
}

.csm-calendar-head,
.csm-calendar-body {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.csm-calendar-head-cell,
.csm-calendar-cell {
  padding: 8px;
  border: 1px solid #e2e8f0;
  box-sizing: border-box;
}

.csm-calendar-head-cell {
  font-weight: 700;
  text-align: center;
  color: #1f2937;
  font-size: 0.7rem;
}

.csm-calendar-cell {
  min-height: 90px;
  position: relative;
  background: #ffffff;
}

.csm-calendar-cell.is-empty {
  background: #f8fafc;
}

.csm-day-number {
  font-weight: 800;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.csm-calendar-event {
  margin-top: 4px;
  padding: 4px 6px;
  border-radius: 10px;
  background-color: rgba(35, 191, 0, 0.15);
  color: #064e3b;
  font-size: 0.7rem;
}

.csm-calendar-event-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.csm-calendar-event-pill {
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #1f2937;
}

/* Hide floating icons coming from other addons within this calendar container */
.csm-schedule-shell .floating-icon,
.csm-schedule-shell .floating-icons-container,
.csm-schedule-shell .floating-button,
.csm-schedule-shell .fb-icon,
.csm-schedule-shell [class*="floating"],
.csm-schedule-shell [class*="float"] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

@media (max-width: 900px) {
  .csm-calendar-head,
  .csm-calendar-body {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .csm-calendar-head-cell,
  .csm-calendar-cell {
    padding: 6px;
  }

  .csm-day-number {
    font-size: 0.8rem;
  }

  .csm-calendar-event {
    font-size: 0.65rem;
    padding: 3px 4px;
  }
}

@media (max-width: 640px) {
  .csm-calendar-head,
  .csm-calendar-body {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .csm-calendar-cell {
    min-height: 80px;
  }

  .csm-calendar-heading h2 {
    font-size: 1.1rem;
  }

  .csm-calendar-heading p {
    font-size: 0.85rem;
  }

  .csm-category-tabs a,
  .csm-month-chip {
    min-width: 65px;
    font-size: 0.75rem;
    padding: 6px 8px;
  }
}

.csm-info-card h4 {
  margin: 0 0 12px;
  color: #4b5563;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.csm-code,
.csm-code-block {
  display: block;
  width: 100%;
  background: #1f2937;
  color: #e5e7eb;
  border-radius: 14px;
  padding: 14px;
  box-sizing: border-box;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.csm-inline-form {
  display: inline-block;
  margin-left: 8px;
}

.csm-card-table {
  margin-top: 18px;
}

.csm-card-table h3 {
  margin: 0 0 20px;
}

.csm-card-table .csm-admin-tabs {
  display: flex;
  align-items: flex-end;
  gap: 0;
  margin: 0 0 18px;
  border-bottom: 1px solid #d8dde8;
  background: #ffffff;
}

.csm-card-table .csm-admin-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  padding: 14px 22px 12px;
  border: 0 !important;
  border-bottom: 4px solid transparent !important;
  background: #ffffff !important;
  color: #9aa3b2 !important;
  text-decoration: none !important;
  font-weight: 800;
  font-size: 18px;
  line-height: 1.2;
  box-shadow: none !important;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.csm-card-table .csm-admin-tab:hover,
.csm-card-table .csm-admin-tab:focus {
  color: #473e91 !important;
  background: #ffffff !important;
  outline: none;
}

.csm-card-table .csm-admin-tab.is-active {
  background: #ffffff !important;
  border-bottom-color: #473e91 !important;
  color: #473e91 !important;
}

@media (max-width: 640px) {
  .csm-card-table .csm-admin-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .csm-card-table .csm-admin-tab {
    flex: 0 0 auto;
    min-width: 110px;
    font-size: 15px;
  }
}

.csm-embed-body {
  margin: 0;
  background: #ffffff;
}

.csm-schedule-shell {
  width: 100%;
  max-width: 1540px;
  margin: 0 auto;
  padding: 28px 10px;
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
  color: #444;
  transition: opacity 0.18s ease;
}

.csm-schedule-shell.is-loading {
  opacity: 0.58;
  pointer-events: none;
}

.csm-schedule-layout {
  display: block;
}

.csm-calendar-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.csm-calendar-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  min-width: min(100%, 700px);
}

.csm-controls-top-row {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 16px;
  width: 100%;
  flex-wrap: wrap;
}

.csm-branch-select-wrap {
  min-width: 320px;
  max-width: 440px;
  flex: 1 1 340px;
}

.csm-branch-select-label {
  display: block;
  margin-bottom: 8px;
  color: #6b7280;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.csm-branch-select-field {
  position: relative;
}

.csm-branch-select-field::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid #5c6474;
  border-bottom: 2px solid #5c6474;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.csm-branch-select {
  width: 100%;
  appearance: none;
  border: 1px solid #d9e2f3;
  border-radius: 18px;
  background: #ffffff;
  color: #3f4960;
  font-size: 16px;
  font-weight: 700;
  padding: 16px 48px 16px 18px;
  box-sizing: border-box;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.05);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.csm-branch-select:hover {
  border-color: #5b52a4;
  transform: translateY(-1px);
}

.csm-branch-select:focus {
  outline: none;
  border-color: #5b52a4;
  box-shadow: 0 0 0 4px rgba(91, 82, 164, 0.14);
}

.csm-category-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.csm-category-tab {
  padding: 10px 16px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #4b5563;
  text-decoration: none;
  font-weight: 800;
}

.csm-category-tab.is-active {
  background: #0b56b0;
  color: #fff;
}

.csm-calendar-heading {
  min-width: 0;
}

.csm-calendar-toolbar h2 {
  margin: 0;
  font-size: 26px;
  color: #3b368c;
}

.csm-calendar-toolbar p {
  margin: 6px 0 0;
  color: #6b7280;
}

.csm-month-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.csm-month-chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: #eef7ff;
  color: #189fe8;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.csm-month-chip.is-active {
  background: #22a8f2;
  color: #fff;
}

.csm-calendar-table {
  border: 1px solid #5bc1ff;
  overflow: hidden;
  background: #fff;
}

.csm-calendar-head,
.csm-calendar-body {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.csm-calendar-head-cell {
  padding: 10px 8px;
  background: #22a8f2;
  color: #fff;
  text-align: center;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: 0.02em;
  border-right: 1px solid rgba(255, 255, 255, 0.25);
}

.csm-calendar-head-cell:last-child {
  border-right: 0;
}

.csm-calendar-cell {
  min-height: 96px;
  border-right: 1px solid #76ccff;
  border-top: 1px solid #76ccff;
  padding: 8px 6px;
  box-sizing: border-box;
  position: relative;
  background: #fff;
}

.csm-calendar-cell:nth-child(7n) {
  border-right: 0;
}

.csm-calendar-cell.is-empty {
  background: #fff;
}

.csm-day-number {
  font-size: 18px;
  font-weight: 800;
  color: #4a43a2;
  margin-bottom: 6px;
}

.csm-calendar-event {
  background: var(--csm-accent, #22a8f2);
  color: #fff;
  padding: 12px 14px;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 700;
  margin-bottom: 8px;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

.csm-calendar-event-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 12px;
}

.csm-calendar-event-title-visible {
  color: #ffffff;
  font-size: clamp(12px, 1.2vw, 18px);
  line-height: 1.18;
  font-weight: 500;
  letter-spacing: 0;
  max-width: 100%;
  word-break: break-word;
}

.csm-calendar-event-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  padding: 6px 16px;
  border-radius: 999px;
  background: #ffffff;
  color: #5a53a6;
  font-size: clamp(12px, 1vw, 16px);
  font-weight: 500;
  max-width: 100%;
}

.csm-calendar-event-meta {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  opacity: 0.96;
  font-weight: 700;
}

@media (max-width: 1200px) {
  .csm-admin-grid-modern {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .csm-calendar-head-cell {
    font-size: 18px;
  }

  .csm-calendar-controls {
    align-items: flex-start;
    min-width: 0;
  }

  .csm-controls-top-row {
    justify-content: flex-start;
  }

  .csm-calendar-event {
    padding: 10px 12px;
  }

  .csm-calendar-event-title-visible {
    font-size: 14px;
  }

  .csm-calendar-event-pill {
    min-width: 58px;
    padding: 5px 12px;
    font-size: 14px;
  }
}

@media (max-width: 860px) {
  .csm-form-layout,
  .csm-delivery-grid {
    grid-template-columns: 1fr;
  }

  .csm-calendar-wrap {
    overflow-x: auto;
  }

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

  .csm-calendar-controls,
  .csm-controls-top-row {
    align-items: stretch;
    justify-content: flex-start;
  }

  .csm-branch-select-wrap {
    min-width: 0;
    max-width: none;
    flex: 1 1 auto;
  }

  .csm-category-tabs,
  .csm-month-switcher {
    justify-content: flex-start;
  }

  .csm-calendar-table {
    min-width: 760px;
  }

  @media (max-width: 425px) {
  .csm-form-layout,
  .csm-delivery-grid {
    grid-template-columns: 1fr;
  }

  .csm-calendar-wrap {
    overflow-x: auto;
  }

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

  .csm-calendar-controls,
  .csm-controls-top-row {
    align-items: stretch;
    justify-content: flex-start;
  }

  .csm-branch-select-wrap {
    min-width: 0;
    max-width: none;
    flex: 1 1 auto;
  }

  .csm-category-tabs,
  .csm-month-switcher {
    justify-content: flex-start;
  }

  .csm-calendar-table {
    min-width: 393px;
  }
}
  
}
