/* Calendar lower chrome stack owner */

.app-bottom-chrome-stack{
  display: contents;
}

html[data-app-surface-bundle="calendar-surface"] body:not(.discover-mode):not(.feed-mode) .app-bottom-chrome-stack,
body.calendar-mode-list:not(.discover-mode):not(.feed-mode) .app-bottom-chrome-stack,
body.calendar-mode-grid:not(.discover-mode):not(.feed-mode) .app-bottom-chrome-stack,
body.workflow-screen-open .app-bottom-chrome-stack{
  grid-row: 1;
  grid-column: 1;
  align-self: end;
  position: sticky;
  left: max(0px, env(safe-area-inset-left, 0px));
  right: max(0px, env(safe-area-inset-right, 0px));
  bottom: calc(env(safe-area-inset-bottom, 0px) + var(--sotido-recipe-calendar-lower-chrome-stack-bottom-padding));
  justify-self: center;
  z-index: 3200;
  width: min(
    calc(100% - var(--sotido-recipe-calendar-lower-chrome-stack-viewport-horizontal-inset) * 2 - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)),
    var(--sotido-recipe-calendar-lower-chrome-stack-max-width)
  );
  display: grid;
  gap: var(--sotido-recipe-calendar-lower-chrome-stack-stack-spacing);
  pointer-events: none;
  box-sizing: border-box;
}

body:is(.event-compose-screen-open, .calendar-settings-screen-open, .workflow-screen-open) #appBottomChromeStack{
  z-index: 3200;
}

.app-lower-chrome-stack{
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: 390;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--sotido-recipe-calendar-lower-chrome-stack-stack-spacing);
  pointer-events: none;
}

.app-lower-chrome-stack:empty{
  display: none !important;
}

/* Calendar story strip owner */

body.has-story-strip .calendar-topbar{
  display: none !important;
}

.calendar-story-controls-host{
  min-height: 0;
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: 16;
  width: 100%;
  max-width: 100%;
  display: grid;
  gap: var(--sotido-recipe-calendar-story-strip-controls-gap);
  box-sizing: border-box;
  padding: 0 var(--sotido-recipe-calendar-story-strip-controls-horizontal-padding);
  pointer-events: none;
}
.calendar-story-controls-host[hidden]{
  display: none !important;
}
.calendar-story-strip{
  min-height: 0;
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: 16;
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: end;
  gap: var(--sotido-recipe-calendar-story-strip-strip-gap);
  box-sizing: border-box;
  padding: 0 var(--sotido-recipe-calendar-story-strip-strip-horizontal-padding);
  margin-bottom: 0;
  overflow: hidden;
  white-space: nowrap;
  pointer-events: auto;
  user-select: none;
}
.calendar-story-strip,
.calendar-story-folder-popover{
  --calendar-story-mask-opaque: var(--sotido-theme-text-primary);
  --calendar-story-background: var(--sotido-theme-background);
  --calendar-story-surface-solid: var(--sotido-theme-surface);
  --calendar-story-surface-raised: var(--sotido-theme-surface-raised);
  --calendar-story-surface-highest: var(--sotido-theme-surface-highest);
  --calendar-story-accent: var(--sotido-theme-accent);
  --calendar-story-danger: var(--sotido-theme-danger);
  --calendar-story-surface: color-mix(in srgb, var(--sotido-theme-surface) 98%, transparent);
  --calendar-story-surface-soft: color-mix(in srgb, var(--sotido-theme-surface-soft) 52%, transparent);
  --calendar-story-surface-faint: color-mix(in srgb, var(--sotido-theme-surface-soft) 32%, transparent);
  --calendar-story-border: color-mix(in srgb, var(--sotido-theme-border) 52%, transparent);
  --calendar-story-border-soft: color-mix(in srgb, var(--sotido-theme-border) 36%, transparent);
  --calendar-story-highlight: color-mix(in srgb, var(--sotido-theme-surface-highest) 16%, transparent);
  --calendar-story-highlight-soft: color-mix(in srgb, var(--sotido-theme-surface-highest) 8%, transparent);
  --calendar-story-shadow-popover: 0 var(--sotido-recipe-calendar-story-strip-folder-popover-shadow-y) var(--sotido-recipe-calendar-story-strip-folder-popover-shadow-blur) color-mix(in srgb, var(--sotido-theme-background) 42%, transparent);
  --calendar-story-shadow-card: 0 var(--sotido-recipe-calendar-story-strip-folder-card-shadow-y) var(--sotido-recipe-calendar-story-strip-folder-card-shadow-blur) color-mix(in srgb, var(--sotido-theme-background) 28%, transparent);
}

.calendar-story-strip-scroll{
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  display: block;
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.calendar-story-strip-scroll::-webkit-scrollbar{
  display: none;
}
.calendar-story-strip-scroll.is-overflowing:not(.is-scroll-end){
  -webkit-mask-image: linear-gradient(to right, var(--calendar-story-mask-opaque) calc(100% - var(--sotido-recipe-calendar-story-strip-overflow-fade-width)), transparent 100%);
  mask-image: linear-gradient(to right, var(--calendar-story-mask-opaque) calc(100% - var(--sotido-recipe-calendar-story-strip-overflow-fade-width)), transparent 100%);
}
.calendar-story-strip-scroll.is-overflowing:not(.is-scroll-start):not(.is-scroll-end){
  -webkit-mask-image: linear-gradient(to right, transparent 0, var(--calendar-story-mask-opaque) var(--sotido-recipe-calendar-story-strip-overflow-fade-width), var(--calendar-story-mask-opaque) calc(100% - var(--sotido-recipe-calendar-story-strip-overflow-fade-width)), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, var(--calendar-story-mask-opaque) var(--sotido-recipe-calendar-story-strip-overflow-fade-width), var(--calendar-story-mask-opaque) calc(100% - var(--sotido-recipe-calendar-story-strip-overflow-fade-width)), transparent 100%);
}
.calendar-story-strip-scroll.is-overflowing:not(.is-scroll-start).is-scroll-end{
  -webkit-mask-image: linear-gradient(to right, transparent 0, var(--calendar-story-mask-opaque) var(--sotido-recipe-calendar-story-strip-overflow-fade-width));
  mask-image: linear-gradient(to right, transparent 0, var(--calendar-story-mask-opaque) var(--sotido-recipe-calendar-story-strip-overflow-fade-width));
}
.calendar-story-strip .calendar-story-section{
  display: inline-flex;
  align-items: flex-end;
  gap: var(--sotido-recipe-calendar-story-strip-section-gap);
  flex: 0 0 auto;
  min-width: max-content;
}
body.snapshot-mode .calendar-story-strip{
  z-index: 30;
}
body.calendar-mode-panel-rail .calendar-story-strip{
  margin-bottom: 0;
}
.calendar-story-strip.is-skeleton{
  pointer-events: none;
}
.calendar-story-item--skeleton{
  cursor: default;
}
.calendar-story-item--skeleton .calendar-story-avatar{
  background: var(--calendar-story-surface-raised);
  box-shadow: none;
  border: 1px solid var(--calendar-story-border);
}
.calendar-story-strip .calendar-story-avatar{
  margin-top: 0;
}
.calendar-story-item{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  flex: 0 0 auto;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}
.calendar-story-item--recent{
  opacity: 0.5;
}
.calendar-story-item--recent.calendar-story-item--selected{
  opacity: 1;
}
.calendar-story-item--folder .calendar-story-avatar{
  background: var(--calendar-story-surface-highest);
}
.calendar-story-folder-slot{
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  flex: 0 0 auto;
  min-width: var(--sotido-recipe-calendar-story-strip-folder-slot-min-width);
  padding-left: var(--sotido-recipe-calendar-story-strip-folder-slot-padding-start);
}
.calendar-story-folder-slot::before{
  content: "";
  position: absolute;
  left: 0;
  top: var(--sotido-recipe-calendar-story-strip-folder-divider-vertical-inset);
  bottom: var(--sotido-recipe-calendar-story-strip-folder-divider-vertical-inset);
  width: 1px;
  background: var(--calendar-story-border);
  opacity: 0.8;
}
.calendar-story-folder-slot .calendar-story-item--folder{
  position: relative;
  z-index: 1;
}
.calendar-story-folder-avatar{
  display: flex;
  align-items: center;
  justify-content: center;
}
.calendar-story-folder-grid{
  width: var(--sotido-recipe-calendar-story-strip-folder-grid-size);
  height: var(--sotido-recipe-calendar-story-strip-folder-grid-size);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sotido-recipe-calendar-story-strip-folder-grid-gap);
}
.calendar-story-folder-mini{
  display: block;
  border-radius: var(--sotido-recipe-calendar-story-strip-folder-mini-radius);
  background-image: var(--story-bg, linear-gradient(135deg, var(--calendar-story-highlight), var(--calendar-story-highlight-soft)));
  background-size: cover;
  background-position: center;
  border: 1px solid var(--calendar-story-border);
}
.calendar-story-folder-mini.is-empty{
  background: var(--calendar-story-surface-soft);
  border-color: var(--calendar-story-border-soft);
}
.calendar-story-folder-count{
  position: absolute;
  right: -4px;
  bottom: 0;
  min-width: var(--sotido-recipe-calendar-story-strip-folder-badge-min-width);
  height: var(--sotido-recipe-calendar-story-strip-folder-badge-height);
  border-radius: var(--sotido-recipe-calendar-story-strip-folder-badge-pill-radius);
  padding: 0 var(--sotido-recipe-calendar-story-strip-folder-badge-horizontal-padding);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  line-height: 1;
  color: var(--sotido-theme-text-inverse);
  background: var(--calendar-story-accent);
}
.calendar-story-folder-popover{
  position: fixed;
  z-index: 1240;
  background: var(--calendar-story-surface-solid);
  border: 1px solid var(--calendar-story-border);
  border-radius: var(--sotido-recipe-calendar-story-strip-folder-popover-radius);
  box-shadow: var(--calendar-story-shadow-popover);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity .14s ease, transform .14s ease;
}
.calendar-story-folder-popover.is-open{
  opacity: 1;
  transform: translateY(0) scale(1);
}
.calendar-story-folder-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sotido-recipe-calendar-story-strip-folder-head-gap);
  padding:
    var(--sotido-recipe-calendar-story-strip-folder-head-top-padding)
    var(--sotido-recipe-calendar-story-strip-folder-head-horizontal-padding)
    var(--sotido-recipe-calendar-story-strip-folder-head-bottom-padding);
}
.calendar-story-folder-title{
  font-size: 13px;
  font-weight: 800;
  color: var(--sotido-theme-text-primary);
}
.calendar-story-folder-head-actions{
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.calendar-story-folder-close{
  width: 28px;
  height: 28px;
  border: none;
  color: var(--sotido-theme-text-primary);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.calendar-story-folder-scroll{
  overflow: auto;
  padding: var(--sotido-recipe-calendar-story-strip-folder-scroll-padding);
  display: grid;
  gap: var(--sotido-recipe-calendar-story-strip-folder-scroll-gap);
  box-shadow:
    0 12px 30px -10px color-mix(in srgb, var(--calendar-story-background) 20%, transparent) inset,
    0 -12px 30px -10px color-mix(in srgb, var(--calendar-story-background) 20%, transparent) inset;
}
.calendar-story-folder-section{
  display: grid;
  gap: 6px;
}
.calendar-story-folder-section-title{
  font-size: 11px;
  font-weight: 700;
  color: var(--sotido-theme-text-primary);
  padding: 0 4px;
}
.calendar-story-folder-list{
  display: grid;
  gap: 4px;
}
.calendar-story-folder-row{
  display: grid;
  grid-template-columns: var(--sotido-recipe-calendar-story-strip-folder-row-avatar-size) minmax(0, 1fr) auto auto auto auto;
  align-items: center;
  gap: var(--sotido-recipe-calendar-story-strip-folder-row-gap);
  border-radius: var(--sotido-recipe-calendar-story-strip-folder-row-radius);
  padding: var(--sotido-recipe-calendar-story-strip-folder-row-padding);
  background: transparent;
  cursor: pointer;
  outline: none;
}
.calendar-story-folder-row:hover,
.calendar-story-folder-row:focus-visible{
  background: var(--calendar-story-surface-raised);
}
.calendar-story-folder-row.is-selected{
  background: color-mix(in srgb, var(--calendar-story-accent) 16%, transparent 84%);
}
.calendar-story-folder-row-avatar{
  width: var(--sotido-recipe-calendar-story-strip-folder-row-avatar-size);
  height: var(--sotido-recipe-calendar-story-strip-folder-row-avatar-size);
  border-radius: var(--sotido-recipe-calendar-story-strip-folder-row-avatar-radius);
  flex: 0 0 auto;
  background-image: var(--story-bg, linear-gradient(135deg, var(--calendar-story-highlight), var(--calendar-story-highlight-soft)));
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid var(--calendar-story-border);
  box-shadow: 0 0 var(--sotido-recipe-calendar-story-strip-folder-row-avatar-shadow-blur) color-mix(in srgb, var(--calendar-story-background) 25%, transparent);
}
.calendar-story-folder-row-body{
  min-width: 0;
  display: grid;
  gap: 1px;
}
.calendar-story-folder-row-title{
  font-size: 12px;
  font-weight: 700;
  color: var(--sotido-theme-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.calendar-story-folder-row-sub{
  font-size: 10px;
  color: var(--sotido-theme-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.calendar-story-folder-row-badge{
  display: inline-flex;
  align-items: center;
  margin-left: var(--sotido-recipe-calendar-story-strip-folder-row-badge-margin-start);
  padding:
    var(--sotido-recipe-calendar-story-strip-folder-row-badge-vertical-padding)
    var(--sotido-recipe-calendar-story-strip-folder-row-badge-horizontal-padding);
  border-radius: var(--sotido-recipe-calendar-story-strip-folder-row-badge-radius);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .02em;
  vertical-align: middle;
}
.calendar-story-folder-row-badge.is-disabled{
  color: var(--sotido-theme-text-primary);
}
.calendar-story-folder-row-action{
  border: 1px solid var(--calendar-story-border);
  background: var(--calendar-story-surface-soft);
  color: var(--sotido-theme-text-primary);
  border-radius: var(--sotido-recipe-calendar-story-strip-folder-row-radius);
  padding: 0 var(--sotido-recipe-calendar-story-strip-folder-action-horizontal-padding);
  height: var(--sotido-recipe-calendar-story-strip-folder-action-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.calendar-story-folder-row-action.is-danger{
  background: var(--calendar-story-danger);
  color: var(--sotido-theme-text-inverse);
}
.calendar-story-folder-row.is-disabled .calendar-story-folder-row-title{
  color: var(--sotido-theme-text-primary);
}
.calendar-story-folder-row.is-disabled .calendar-story-folder-row-avatar{
  filter: saturate(.72);
}
.calendar-story-folder-row[data-folder-can-reorder="1"]{
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.calendar-story-folder-pin{
  opacity: 0.3;
  width: var(--sotido-recipe-calendar-story-strip-folder-pin-size);
  height: var(--sotido-recipe-calendar-story-strip-folder-pin-size);
  border-radius: 8px;
  color: var(--sotido-theme-text-primary);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.calendar-story-folder-pin.is-on{
  color: var(--sotido-theme-text-primary);
  opacity: 1;
}
.calendar-story-folder-pin-spacer{
  width: var(--sotido-recipe-calendar-story-strip-folder-pin-size);
  height: var(--sotido-recipe-calendar-story-strip-folder-pin-size);
  display: inline-block;
}
.calendar-story-folder-row.is-reordering{
  background: var(--calendar-story-surface-raised);
  opacity: 0.98;
  box-shadow: var(--calendar-story-shadow-card);
  touch-action: none;
  cursor: grabbing;
}
.calendar-story-folder-row.is-reorder-animating{
  will-change: transform;
  pointer-events: none;
}
.calendar-story-folder-empty{
  font-size: 11px;
  color: var(--sotido-theme-text-primary);
  padding: 8px 6px;
}
.calendar-story-folder-foot{
  padding: var(--sotido-recipe-calendar-story-strip-folder-foot-padding);
  display: flex;
  justify-content: flex-start;
}
.calendar-story-folder-create-btn{
  width: 100%;
  padding: 0 var(--sotido-recipe-calendar-story-strip-folder-create-horizontal-padding);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sotido-recipe-calendar-story-strip-folder-create-gap);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  position: relative;
}
.calendar-story-folder-create-icon{
  width: var(--sotido-recipe-calendar-story-strip-folder-create-icon-size);
  height: var(--sotido-recipe-calendar-story-strip-folder-create-icon-size);
  display: block;
  filter: var(--settings-icon-filter);
  pointer-events: none;
}
.calendar-story-folder-create-text{
  display: inline-block;
}
.calendar-story-folder-create-badge{
  width: var(--sotido-recipe-calendar-story-strip-folder-create-badge-size);
  height: var(--sotido-recipe-calendar-story-strip-folder-create-badge-size);
  border-radius: var(--sotido-recipe-calendar-story-strip-avatar-radius);
  background: var(--calendar-story-danger);
}
.calendar-story-avatar{
  width: var(--sotido-recipe-calendar-story-strip-avatar-size);
  height: var(--sotido-recipe-calendar-story-strip-avatar-size);
  border-radius: var(--sotido-recipe-calendar-story-strip-folder-badge-pill-radius);
  background-image: var(--story-bg, linear-gradient(135deg, var(--calendar-story-highlight), var(--calendar-story-highlight-soft)));
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  outline: none;
}
.calendar-avatar.is-selected{
  box-sizing: border-box;
  border: 1px solid var(--calendar-story-accent);
  opacity: 1;
}
.calendar-story-badges{
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  gap: 4px;
  align-items: center;
  pointer-events: none;
}
.calendar-story-badge{
  position: absolute;
  border-radius: var(--sotido-recipe-calendar-story-strip-avatar-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: none;
  border: none;
  pointer-events: none;
}
.calendar-story-badges .calendar-story-badge{
  position: static;
  left: auto;
  right: auto;
  top: auto;
  bottom: auto;
}
.calendar-story-badge--tg{
  width: var(--sotido-recipe-calendar-story-strip-story-badge-size);
  height: var(--sotido-recipe-calendar-story-strip-story-badge-size);
  min-width: var(--sotido-recipe-calendar-story-strip-story-badge-size);
  padding: 0;
  color: var(--sotido-theme-text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.calendar-story-badge--tg .calendar-story-badge-icon{
  width: var(--sotido-recipe-calendar-story-strip-story-badge-size);
  height: var(--sotido-recipe-calendar-story-strip-story-badge-size);
  display: block;
}

.mirror-picker-overlay{
  position: fixed;
  inset: 0;
  z-index: 12110;
  background: color-mix(in srgb, var(--calendar-story-background) 45%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.mirror-picker-sheet{
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(720px, 92vw);
  background: var(--calendar-story-surface);
  color: var(--sotido-theme-text-inverse);
  border-radius: 18px;
  padding: 14px 14px 12px;
  box-shadow: 0 18px 40px color-mix(in srgb, var(--calendar-story-background) 65%, transparent);
}
.mirror-picker-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.mirror-picker-title{
  font-size: 15px;
  font-weight: 800;
}
.mirror-picker-close{
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 12px;
}
.mirror-picker-list{
  margin-top: 10px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  padding: 6px 2px 2px;
  align-items: flex-start;
}
.mirror-picker-list .calendar-story-item{
  max-width: 112px;
  min-width: 96px;
}
.mirror-picker-card{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.mirror-picker-list .calendar-story-avatar{
  margin-top: 0;
}
.mirror-picker-list .mirror-picker-story-label{
  display: -webkit-box;
  max-width: 86px;
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  white-space: normal;
  background: var(--calendar-story-surface-highest);
  padding: 2px;
  border-radius: 6px;
  overflow: hidden;
  color: var(--sotido-theme-text-primary);
  opacity: 0.82;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  word-break: normal;
  line-height: 1.15;
}
.mirror-picker-lane-actions{
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  width: 100%;
}
.mirror-picker-lane-btn{
  min-height: 28px;
  border-radius: 7px;
  padding: 5px 6px;
  font-size: 11px;
  line-height: 1.1;
}

body.capture-mode .calendar-story-strip{
  display:none !important;
}
body.discover-mode .calendar-story-strip{
  display:none !important;
}
body.calendar-settings-screen-open .calendar-story-strip,
body.event-compose-screen-open .calendar-story-strip,
body.participants-modal-open .calendar-story-strip{
  display:none !important;
}
