/* body-doubling-calendar.css — your body-doubling group's calendar, on the
   Calendar side of the app (js/body-doubling/bd_sessions_feed.js):

   - the row that switches it on: in My calendars (react-src/
     my_calendars_panel.tsx), the phone drawer (js/app-shell/nav_drawer.js via
     js/sidebar/group_calendar_row.js) and Views
     (views/week/widgets/bd_calendar_control.js);
   - the other members' sessions on the grid (render/bd_session_chips.js);
   - the card a session opens (js/body-doubling/bd_session_popover.js).

   Its own look everywhere (Seth, 2026-10-12: "it should be very visually
   distinct"): a fuchsia-to-violet group colour no Google calendar uses, the
   two-people mark, invitations dashed over stripes, sessions you're going to
   filled with the gradient. Unmarked selectors: any route, any page.
   (Split out of body-doubling.css, which keeps the call view.) */

:root {
  --bd-cal: #d946ef;
  --bd-cal-deep: #7c3aed;
  --bd-cal-ink: #f0abfc;
  --bd-cal-fill: linear-gradient(135deg, #c026d3 0%, #7c3aed 100%);
  --bd-cal-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E");
}

body.theme-light {
  --bd-cal: #c026d3;
  --bd-cal-ink: #86198f;
}

/* ── The switch row ──────────────────────────────────────────────────────── */

.topbar-views-panel[data-view]:not([data-view="week"]) #bd-calendar-option {
  display: none;
}

/* Views: the group's name in the group colour, the mark before it. */
.topbar-bd-calendar-option .topbar-reflection-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--bd-cal-ink);
  font-weight: 600;
}

.topbar-bd-calendar-option .topbar-reflection-label::before {
  content: '';
  flex: none;
  width: 14px;
  height: 14px;
  background: var(--bd-cal);
  -webkit-mask: var(--bd-cal-mark) center / contain no-repeat;
  mask: var(--bd-cal-mark) center / contain no-repeat;
}

/* My calendars + the phone drawer: a card of its own above the Google list. */
.my-calendars-account--group {
  color: var(--bd-cal-ink);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.bd-group-cal {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 4px 10px;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--bd-cal) 45%, transparent);
  border-radius: 10px;
  background:
    linear-gradient(135deg,
      color-mix(in srgb, #c026d3 16%, transparent),
      color-mix(in srgb, #7c3aed 10%, transparent));
  color: var(--text-primary);
  cursor: pointer;
}

.bd-group-cal:hover {
  border-color: var(--bd-cal);
}

.bd-group-cal.is-on {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--bd-cal) 35%, transparent),
    0 4px 14px color-mix(in srgb, var(--bd-cal) 22%, transparent);
}

.bd-group-cal input[type="checkbox"] {
  flex: none;
  accent-color: var(--bd-cal);
  cursor: pointer;
}

.bd-group-cal-mark {
  position: relative;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--bd-cal-fill);
}

.bd-group-cal-mark::before {
  content: '';
  position: absolute;
  inset: 5px;
  background: #fff;
  -webkit-mask: var(--bd-cal-mark) center / contain no-repeat;
  mask: var(--bd-cal-mark) center / contain no-repeat;
}

.bd-group-cal-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bd-group-cal-name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bd-group-cal-note {
  color: var(--text-secondary);
  font-size: 11px;
}

/* ── The sessions on the grid ────────────────────────────────────────────────
   Three classes: beat `body.theme-light .icx-event-themed` and the card's own
   `background` shorthand (events.css); with the attribute, beat the generic
   invitation look (views/week/shared/cowork-session-popup.css). */

/* Going: filled with the group gradient, white ink. */
.intentional-calendar-x-event-card.intentional-calendar-x-event-card--timed.bd-session-chip {
  --intentional-event-accent-color: var(--bd-cal);
  --intentional-event-text-color: #fff;
  background: var(--bd-cal-fill);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18),
    0 2px 10px color-mix(in srgb, var(--bd-cal) 35%, transparent);
  font-weight: 600;
}

/* Not answered yet: dashed group outline over group stripes. */
.intentional-calendar-x-event-card.intentional-calendar-x-event-card--timed.bd-session-chip[data-session-invite] {
  --intentional-event-text-color: var(--bd-cal-ink);
  background: repeating-linear-gradient(
    -45deg,
    color-mix(in srgb, var(--bd-cal) 20%, var(--bg)) 0 6px,
    color-mix(in srgb, var(--bd-cal) 7%, var(--bg)) 6px 12px
  );
  color: var(--bd-cal-ink);
  box-shadow: none;
  outline: 2px dashed var(--bd-cal);
  outline-offset: -2px;
}

.intentional-calendar-x-event-card.intentional-calendar-x-event-card--timed.bd-session-chip:focus-visible {
  outline: 2px solid var(--bd-cal);
  outline-offset: 1px;
}

/* ── The card a session opens ──────────────────────────────────────────────── */

.bd-session-pop {
  position: fixed;
  z-index: 1200;
  width: 280px;
  max-width: calc(100vw - 16px);
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--bd-cal) 40%, var(--border-subtle));
  border-top: 4px solid var(--bd-cal);
  background: var(--bg-elevated, var(--panel-bg, #1b2232));
  color: var(--text-primary);
  box-shadow: var(--shadow, 0 14px 32px rgba(0, 0, 0, 0.28));
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.bd-session-pop-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bd-session-pop-title {
  font-weight: 600;
  font-size: 14px;
}

.bd-session-pop-pill {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--bd-cal);
  color: var(--bd-cal-ink);
}

.bd-session-pop-close {
  margin-left: auto;
  border: 0;
  background: none;
  color: var(--text-secondary);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.bd-session-pop-when {
  color: var(--text-primary);
}

.bd-session-pop-line {
  color: var(--text-secondary);
}

.bd-session-pop-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.bd-session-pop-btn {
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  font: inherit;
}

.bd-session-pop-btn.is-primary {
  background: var(--bd-cal-fill);
  border-color: transparent;
  color: #fff;
}

.bd-session-pop-join {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--bd-cal) 10%, transparent);
}

.bd-session-pop-live {
  color: var(--text-secondary);
  font-weight: 600;
}

.bd-session-pop-live.is-live { color: var(--bd-cal-ink); }

.bd-session-pop-live.is-live::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--bd-cal);
  vertical-align: 1px;
}

.bd-session-pop-btn.is-join {
  padding: 6px 16px;
  background: var(--bd-cal-fill);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}

.bd-session-pop-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.bd-session-pop-yes {
  color: var(--bd-cal-ink);
  font-weight: 600;
}

.bd-session-pop-error {
  color: #e57373;
}

.bd-session-pop-note {
  color: var(--text-tertiary, var(--text-secondary));
  font-size: 11px;
}

.bd-session-pop-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
}

.bd-session-pop-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.bd-session-pop-people {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bd-session-pop-person {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--text-primary);
}

.bd-session-pop-tag {
  font-size: 11px;
  color: var(--bd-cal-ink);
}

.bd-session-pop-plan {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}

.bd-session-pop-focus-when {
  font-size: 11px;
  color: var(--text-secondary);
}

.bd-session-pop-goal {
  color: var(--text-primary);
  padding-left: 8px;
  border-left: 2px solid var(--bd-cal);
}

.bd-session-pop-goal.is-sub {
  margin-left: 12px;
  color: var(--text-secondary);
}

.bd-session-pop-goal.is-done {
  text-decoration: line-through;
  opacity: 0.6;
}

.bd-session-pop-goal.is-empty {
  color: var(--text-secondary);
  font-style: italic;
  border-left-color: var(--border-subtle);
}

.bd-session-host-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: inherit;
  pointer-events: none;
}
.bd-session-chip[data-bd-host] { cursor: grab; touch-action: none; }
.bd-session-chip.bd-session-dragging { z-index: 99; cursor: grabbing; opacity: .7; }
.bd-event-length { width: auto; padding-inline: 8px; }
