.landing-workflow-modal {
  z-index: 1300;
}

.landing-workflow-modal-card {
  width: min(1680px, calc(100vw - 48px));
  max-height: 92vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  border-radius: 24px;
}

.landing-workflow-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin: 0 34px 16px 0;
}

.landing-workflow-modal-head h3 {
  margin: 2px 0 6px;
  font-size: clamp(24px, 2vw, 34px);
}

.landing-workflow-modal-head p {
  margin: 0;
  max-width: 720px;
  color: var(--muted);
}

.landing-workflow-eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.landing-workflow-context {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.landing-workflow-context > div {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  background: color-mix(in srgb, var(--card) 88%, #ffffff 12%);
}

.landing-workflow-context strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
}

.landing-workflow-context p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.landing-workflow-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  cursor: help;
}

.calendar-workflows-shell--embedded {
  margin-top: 0;
}

.calendar-workflows-shell--embedded .calendar-workflows-page-body {
  display: block;
}

.calendar-workflows-shell--embedded .calendar-workflows-layout {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 0;
}

.calendar-workflows-shell--embedded .calendar-workflows-sidebar {
  display: grid;
  grid-template-columns: minmax(190px, auto) minmax(260px, 1fr) minmax(180px, 240px);
  align-items: center;
  gap: 10px;
  padding: 12px;
  overflow: visible;
}

.calendar-workflows-shell--embedded .calendar-workflows-sidebar > .admin-section-head:first-child {
  grid-column: 1;
  grid-row: 1;
  gap: 0.4rem;
  align-items: center;
  margin: 0;
}

.calendar-workflows-shell--embedded .calendar-workflows-sidebar .admin-section-title {
  font-size: 1rem;
}

.calendar-workflows-shell--embedded .calendar-workflows-section-hint,
.calendar-workflows-shell--embedded .calendar-workflows-sep,
.calendar-workflows-shell--embedded .calendar-workflows-sidebar > .admin-section-head:not(:first-child),
.calendar-workflows-shell--embedded .calendar-workflows-sidebar > .calendar-admin-item-copy:not(.calendar-workflows-section-hint) {
  display: none;
}

.calendar-workflows-shell--embedded .calendar-workflows-list {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  padding: 2px 4px 4px;
  scrollbar-width: thin;
}

.calendar-workflows-shell--embedded .calendar-workflows-template-dropdown summary {
  min-height: 42px;
  padding: 0.65rem 2.2rem 0.65rem 0.85rem;
  font-size: 0.9rem;
}

.calendar-workflows-shell--embedded .calendar-workflows-template-dropdown {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  width: 100%;
  min-width: 0;
}

.calendar-workflows-shell--embedded .calendar-workflows-template-pop {
  inset: calc(100% + 0.45rem) 0 auto auto;
  width: min(420px, calc(100vw - 96px));
}

.calendar-workflows-shell--embedded .calendar-workflows-templates {
  grid-template-columns: 1fr;
}

.calendar-workflows-shell--embedded .calendar-workflows-sidebar .button,
.calendar-workflows-shell--embedded .calendar-workflow-list-item,
.calendar-workflows-shell--embedded .calendar-workflow-template-card {
  min-width: 0;
}

.calendar-workflows-shell--embedded .calendar-workflows-sidebar .button {
  width: auto;
  padding-inline: 0.75rem;
  white-space: nowrap;
  line-height: 1.18;
}

.calendar-workflows-shell--embedded .calendar-workflow-list-item {
  flex: 0 0 min(280px, 78vw);
  padding: 0.54rem 0.6rem;
}

.calendar-workflows-shell--embedded .calendar-workflow-template-card {
  padding: 0.58rem 0.62rem;
}

.calendar-workflows-shell--embedded .calendar-workflow-template-card strong {
  font-size: 0.86rem;
}

.calendar-workflows-shell--embedded .calendar-workflow-template-card span {
  font-size: 0.76rem;
}

.calendar-workflows-shell--embedded .calendar-workflows-empty {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  white-space: nowrap;
}

.calendar-workflows-shell--embedded .calendar-workflows-editor {
  padding: 18px;
  overflow-x: hidden;
}

.calendar-workflows-shell--embedded .calendar-workflows-canvas-wrap {
  max-width: 100%;
}

.calendar-workflows-shell--embedded .calendar-workflows-editor > .admin-section-head {
  position: sticky;
  top: -18px;
  z-index: 8;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  padding-bottom: 0.75rem;
  background: color-mix(in srgb, var(--card) 96%, #ffffff 4%);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.calendar-workflows-shell--embedded .calendar-workflows-editor-actions {
  width: 100%;
  justify-content: flex-start;
  justify-self: start;
}

.calendar-workflows-shell--embedded .calendar-workflows-editor-actions .button {
  min-width: 100px;
}

.calendar-workflows-shell--embedded .calendar-workflows-sidebar,
.calendar-workflows-shell--embedded .calendar-workflows-editor,
.calendar-workflows-shell--embedded .calendar-workflows-node-panel,
.calendar-workflows-shell--embedded .calendar-workflows-warning-panel {
  box-shadow: none;
}

.calendar-workflows-shell--embedded .calendar-workflows-canvas-stage {
  max-height: 420px;
  --workflow-node-width: 190px;
  --workflow-node-col-gap: 30px;
  overflow: auto;
  scrollbar-gutter: stable both-edges;
}

.calendar-workflows-shell--embedded .calendar-workflow-node {
  width: var(--workflow-node-width, 208px);
}

.calendar-workflows-shell--embedded .calendar-workflows-node-panel {
  overflow: visible;
}

.calendar-workflows-shell--embedded [data-workflow-node-fields] {
  gap: 0.75rem;
}

body.theme-dark .landing-workflow-context > div {
  background: color-mix(in srgb, var(--card) 86%, #0f172a 14%);
}

body.theme-dark .calendar-workflows-shell--embedded .calendar-workflows-editor > .admin-section-head {
  background: color-mix(in srgb, var(--card-strong) 92%, #0f172a 8%);
  border-bottom-color: rgba(148, 163, 184, 0.22);
}

@media (min-width: 1180px) {
  .calendar-workflows-shell--embedded .calendar-workflows-bottom {
    grid-template-columns: minmax(0, 1fr) minmax(190px, 230px);
  }
}

@media (max-width: 980px) {
  .landing-workflow-modal-card {
    width: min(96vw, 760px);
    padding: 18px;
  }

  .landing-workflow-modal-head,
  .landing-workflow-context,
  .calendar-workflows-shell--embedded .calendar-workflows-layout,
  .calendar-workflows-shell--embedded .calendar-workflows-sidebar {
    grid-template-columns: 1fr;
  }

  .calendar-workflows-shell--embedded .calendar-workflows-template-dropdown {
    grid-column: auto;
    grid-row: auto;
    justify-self: stretch;
  }

  .calendar-workflows-shell--embedded .calendar-workflow-list-item {
    flex-basis: min(280px, 86vw);
  }

  .calendar-workflows-shell--embedded .calendar-workflows-sidebar > .admin-section-head:first-child,
  .calendar-workflows-shell--embedded .calendar-workflows-list,
  .calendar-workflows-shell--embedded .calendar-workflows-empty {
    grid-column: auto;
    grid-row: auto;
  }

  .landing-workflow-modal-head {
    display: grid;
    margin-right: 30px;
  }
}
