.vmrfit-saved-calendars {
  margin: 28px auto 22px;
  padding: 22px;
  width: 100%;
  max-width: 1120px;
  box-sizing: border-box;
  background: #f8fafc;
  border: 1px solid #d9e2ec;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.vmrfit-saved-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 15px;
}

.vmrfit-saved-heading h3 {
  margin: 0 0 4px;
  color: #172033;
  font-size: 1.35rem;
  line-height: 1.2;
}

.vmrfit-saved-heading p {
  margin: 0;
  color: #617087;
  font-size: 0.92rem;
}

.vmrfit-saved-count {
  flex: 0 0 auto;
  padding: 5px 10px;
  color: #0f766e;
  background: #ccfbf1;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.vmrfit-sync-actions {
  margin: -2px 0 15px;
}

.vmrfit-account-button,
.vmrfit-import-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 9px 14px;
  color: #fff;
  background: #0f8f83;
  border: 1px solid #0f8f83;
  border-radius: 7px;
  font-size: 0.87rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.vmrfit-account-button:hover,
.vmrfit-account-button:focus,
.vmrfit-import-button:hover,
.vmrfit-import-button:focus {
  color: #fff;
  background: #0b756c;
  border-color: #0b756c;
  text-decoration: none;
}

.vmrfit-account-button:disabled,
.vmrfit-import-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.vmrfit-calendar-download {
  margin-left: 10px;
  padding: 9px 14px;
  color: #fff;
  background: #0f8f83;
  border: 1px solid #20b8a8;
  border-radius: 7px;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.vmrfit-calendar-download:hover,
.vmrfit-calendar-download:focus {
  color: #172033;
  background: #ccfbf1;
  border-color: #20b8a8;
}

.vmrfit-saved-list {
  display: grid;
  gap: 10px;
}

.vmrfit-saved-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 15px;
  background: #fff;
  border: 1px solid #d8e1eb;
  border-radius: 9px;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.vmrfit-saved-card:hover,
.vmrfit-saved-card:focus-within {
  border-color: #20b8a8;
  box-shadow: 0 5px 16px rgba(15, 118, 110, 0.1);
}

.vmrfit-saved-card.is-new {
  border-color: #14b8a6;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(20, 184, 166, 0.18);
}

.vmrfit-saved-details {
  min-width: 0;
}

.vmrfit-saved-details strong,
.vmrfit-saved-details span {
  display: block;
}

.vmrfit-saved-details strong {
  overflow: hidden;
  color: #172033;
  font-size: 0.98rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vmrfit-saved-details span {
  margin-top: 3px;
  color: #607087;
  font-size: 0.84rem;
}

.vmrfit-saved-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.vmrfit-saved-actions button {
  min-width: 74px;
  margin: 0;
  padding: 9px 13px;
  border-radius: 7px;
  font-size: 0.87rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.vmrfit-open-calendar {
  color: #fff;
  background: #0f8f83;
  border: 1px solid #0f8f83;
}

.vmrfit-open-calendar:hover,
.vmrfit-open-calendar:focus {
  color: #fff;
  background: #0b756c;
  border-color: #0b756c;
}

.vmrfit-delete-calendar {
  color: #be123c;
  background: #fff;
  border: 1px solid #f43f5e;
}

.vmrfit-delete-calendar:hover,
.vmrfit-delete-calendar:focus {
  color: #fff;
  background: #be123c;
  border-color: #be123c;
}

.vmrfit-saved-empty {
  padding: 20px;
  color: #607087;
  text-align: center;
  background: #fff;
  border: 1px dashed #b8c5d4;
  border-radius: 9px;
}

body.vmrfit-viewer-open {
  overflow: hidden;
}

.vmrfit-calendar-viewer[hidden] {
  display: none;
}

.vmrfit-calendar-viewer {
  position: fixed;
  z-index: 999999;
  inset: 0;
  overflow-y: auto;
  padding: 24px;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(4px);
}

.vmrfit-viewer-shell {
  width: min(1180px, 100%);
  min-height: calc(100vh - 48px);
  margin: 0 auto;
  overflow: hidden;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.34);
}

.vmrfit-viewer-toolbar {
  position: sticky;
  z-index: 2;
  top: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 15px 18px;
  color: #fff;
  background: #172033;
  border-bottom: 4px solid #20b8a8;
}

.vmrfit-viewer-toolbar h2 {
  margin: 0;
  overflow: hidden;
  color: #fff;
  font-size: 1.15rem;
  line-height: 1.3;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vmrfit-viewer-toolbar button {
  margin: 0;
  padding: 9px 14px;
  border-radius: 7px;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.vmrfit-viewer-back {
  color: #fff;
  background: #0f8f83;
  border: 1px solid #20b8a8;
}

.vmrfit-viewer-back:hover,
.vmrfit-viewer-back:focus {
  color: #172033;
  background: #ccfbf1;
  border-color: #ccfbf1;
}

.vmrfit-viewer-print {
  color: #172033;
  background: #fff;
  border: 1px solid #fff;
}

.vmrfit-viewer-print:hover,
.vmrfit-viewer-print:focus {
  color: #fff;
  background: #0f8f83;
  border-color: #20b8a8;
}

.vmrfit-viewer-content {
  padding: 28px;
}

.vmrfit-viewer-calendar {
  max-width: 1080px;
  margin: 0 auto;
}

@media (max-width: 640px) {
  .vmrfit-saved-calendars {
    padding: 16px;
  }

  .vmrfit-saved-heading,
  .vmrfit-saved-card {
    align-items: stretch;
    flex-direction: column;
  }

  .vmrfit-saved-count {
    align-self: flex-start;
  }

  .vmrfit-account-button,
  .vmrfit-import-button,
  .vmrfit-calendar-download {
    width: 100%;
    box-sizing: border-box;
  }

  .vmrfit-calendar-download {
    margin: 10px 0 0;
  }

  .vmrfit-saved-details strong {
    white-space: normal;
  }

  .vmrfit-saved-actions button {
    flex: 1;
  }

  .vmrfit-calendar-viewer {
    padding: 0;
    background: #fff;
  }

  .vmrfit-viewer-shell {
    min-height: 100vh;
    border-radius: 0;
  }

  .vmrfit-viewer-toolbar {
    grid-template-columns: 1fr auto;
    gap: 9px;
    padding: 11px;
  }

  .vmrfit-viewer-toolbar h2 {
    grid-column: 1 / -1;
    grid-row: 2;
    font-size: 1rem;
    white-space: normal;
  }

  .vmrfit-viewer-content {
    padding: 14px;
  }
}

@media print {
  body.vmrfit-viewer-open > *:not(#vmrfit-calendar-viewer) {
    display: none !important;
  }

  .vmrfit-calendar-viewer {
    position: static;
    overflow: visible;
    padding: 0;
    background: #fff;
  }

  .vmrfit-viewer-shell {
    min-height: 0;
    box-shadow: none;
  }

  .vmrfit-viewer-toolbar {
    display: none;
  }

  .vmrfit-viewer-content {
    padding: 0;
  }
}
