#appointmentFeed {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;

  background:
    radial-gradient(120% 80% at 50% 0%, rgba(var(--accent-rgb), 0.05), transparent 60%),
    linear-gradient(to bottom, var(--bg-main) 0%, var(--bg-subtle) 100%);
}

#feedDayRail {
  flex: 1;
  display: flex;
  gap: 8px;
  padding: 12px 14px;

  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(6px);

  border-bottom: 1px solid var(--border-subtle);

  overflow-x: auto;
  scrollbar-width: none;
}

#feedDayRail::-webkit-scrollbar {
  display: none;
}

.feed-day-pill {
  flex: 0 0 calc((100% - 24px) / 3.5);
  padding: 8px 0;
  border-radius: 999px;

  font-size: 13px;
  font-weight: 500;

  background: rgba(255,255,255,.06);
  color: var(--text-secondary);

  transition: .25s ease;
  cursor: pointer;
  text-align: center;
}

.feed-day-pill:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.feed-day-pill.active {
  background: linear-gradient(
    135deg,
    rgba(var(--accent-rgb), 1),
    rgba(var(--accent-rgb), .75)
  );

  color: var(--bg-main);
  font-weight: 600;

  box-shadow: 0 6px 18px rgba(var(--accent-rgb), .35);
}

#appointmentFeedContent {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
  position: relative;

  -webkit-mask-image: linear-gradient(
    to bottom,
    rgba(0,0,0,0.25) 0%,
    rgba(0,0,0,1) 12%,
    rgba(0,0,0,1) 85%,
    rgba(0,0,0,0.2) 100%
  );

  mask-image: linear-gradient(
    to bottom,
    rgba(0,0,0,0.25) 0%,
    rgba(0,0,0,1) 12%,
    rgba(0,0,0,1) 85%,
    rgba(0,0,0,0.2) 100%
  );

  background: radial-gradient(circle at top, rgba(var(--accent-rgb), .05), transparent 50%);
  margin-top: 0;
}

/* =======================
   CARDS
======================= */

.feed-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;

  padding: 18px;
  margin-bottom: 14px;

  border-radius: 20px;

  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);

  opacity: .92;
  transform: scale(.98);

  transition:
    transform .28s cubic-bezier(.22,.8,.25,1),
    box-shadow .28s ease,
    border .28s ease,
    background .28s ease,
    opacity .28s ease;
}

.feed-card:hover {
  background: var(--bg-elevated);
}

.feed-card.active {
  opacity: 1;
  transform: scale(1.04);

  border: 1px solid rgba(var(--accent-rgb), 0.45);

  box-shadow:
    0 12px 30px rgba(0,0,0,0.6),
    0 0 18px rgba(var(--accent-rgb), 0.18);

  background: var(--bg-subtle);
}

.feed-card.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 22%;
  bottom: 22%;
  width: 3px;
  border-radius: 2px;

  background: linear-gradient(
    to bottom,
    rgba(var(--accent-rgb), 1),
    rgba(var(--accent-rgb), .7)
  );
}

/* =======================
   AVATAR / TEXT
======================= */

.feed-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;

  background: rgba(255,255,255,.06);

  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feed-avatar svg {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
}

.feed-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.feed-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
}

.feed-service {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.feed-time {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* =======================
   STATUS
======================= */

.feed-status {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: .3px;
  margin-bottom: 4px;
}

.feed-status.scheduled {
  background: rgba(var(--warning-rgb), .15);
  color: var(--warning);
  border: 1px solid rgba(var(--warning-rgb), .35);
}

.feed-status.completed {
  background: rgba(var(--success-rgb), .15);
  color: var(--success);
  border: 1px solid rgba(var(--success-rgb), .35);
}

.feed-status.cancelled {
  background: rgba(var(--error-rgb), .15);
  color: var(--error);
  border: 1px solid rgba(var(--error-rgb), .35);
}

/* =======================
   RAIL WRAPPER
======================= */

#feedRailWrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

#feedCalendarBtn,
#feedFilterBtn {
  width: 34px;
  height: 34px;
  border-radius: 10px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(255,255,255,.05);
  cursor: pointer;
  transition: .25s ease;
}

#feedCalendarBtn:hover,
#feedFilterBtn:hover {
  background: rgba(255,255,255,.12);
}

/* =======================
   POPOVERS
======================= */

#feedCalendarPopover,
#feedFilterPopover {
  position: absolute;
  top: 60px;
  right: 14px;
  width: 280px;

  background: var(--bg-elevated);
  border-radius: 18px;

  box-shadow: 0 20px 50px rgba(0,0,0,.7);

  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);

  transition: .25s ease;
  z-index: 200;
}

#feedCalendarPopover.open,
#feedFilterPopover.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* =======================
   WEEK NAV
======================= */

#feedWeekNav {
  display: flex;
  align-items: center;
  justify-content: center;

  margin-bottom: 10px;
  height: 32px;

  gap: 14px;
  padding: 6px 0 2px 0;
}

#weekPrev,
#weekNext {
  width: 34px;
  height: 34px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(255,255,255,.04);
  border-radius: 10px;

  cursor: pointer;
  transition: .2s;

  color: rgb(var(--accent-rgb));
}

#weekPrev:hover,
#weekNext:hover {
  background: rgba(255,255,255,.15);
}

#weekTitle {
  font-weight: 600;
  color: var(--text-primary);
}

/* =======================
   WEEK STRIP
======================= */

#feedWeekStrip {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 6px 8px 8px 8px;
  gap: 4px;
}

.feed-week-day {
  flex: 1;
  text-align: center;

  padding: 8px 0;
  border-radius: 999px;

  position: relative;
  cursor: pointer;

  transition: all .25s ease;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  width: 52px;
  aspect-ratio: 1 / 1;
  height: 78px;
}

.feed-week-day .weekday {
  font-size: 11px;
  color: var(--text-tertiary);
}

.feed-week-day .daynum {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.feed-week-day.today .daynum {
  border: 1px solid rgb(var(--accent-rgb));
  border-radius: 50%;
  padding: 4px;
}

.feed-week-day.active {
  background: linear-gradient(
    135deg,
    rgba(var(--accent-rgb), 1),
    rgba(var(--accent-rgb), .75)
  );

  box-shadow: 0 6px 18px rgba(var(--accent-rgb), .35);
}

.feed-week-day.active .daynum {
  color: var(--bg-main);
  font-weight: 600;
}

.feed-week-day .dot {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);

  font-size: 11px;

  background: var(--text-primary);
  color: var(--bg-main);

  padding: 3px 6px;
  border-radius: 999px;

  font-weight: 600;

  box-shadow: 0 3px 8px rgba(0,0,0,.4);
}

.feed-week-day.today {
  border: 1.5px solid rgb(var(--accent-rgb));
}

/* =======================
   EMPTY STATE
======================= */

.feed-empty-state {
  height: 100%;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 15px;
  font-weight: 500;

  color: var(--text-tertiary);
  text-align: center;

  padding: 40px 20px;

  background: radial-gradient(
    circle at center,
    rgba(var(--accent-rgb), 0.04),
    transparent 60%
  );
}
.feed-meta {
  font-size: 12px;
  opacity: .7;
  margin-top: 2px;
}

.feed-provider {
  font-size: 10px;
  opacity: .6;
  margin-top: 2px;
  letter-spacing: .8px;

  position: absolute;
  bottom: 6px;
  right: 10px;

  text-transform: uppercase;

  color: var(--text-tertiary);
}

/* =======================
   SERVICE PILL
======================= */

.feed-service-pill {
  display: inline-block;
  margin-top: 6px;

  padding: 4px 10px;
  border-radius: 999px;

  background: var(--bg-surface);
  color: var(--text-primary);

  font-size: 11px;
  letter-spacing: .3px;

  border: 1px solid var(--border-subtle);
}

/* =======================
   NEW BOOKING SLOT
======================= */

.new-booking-slot {
  border: 2px dashed var(--border-subtle);
  border-radius: 14px;

  padding: 28px;
  margin: 20px;

  text-align: center;
  cursor: pointer;

  transition: .2s ease;
}

.new-booking-slot:hover {
  border-color: rgba(var(--accent-rgb), .6);
  background: var(--bg-surface);
}

.new-booking-plus {
  font-size: 28px;
  color: rgb(var(--accent-rgb));
}

.new-booking-text {
  font-size: 14px;
  opacity: .7;
  margin-top: 4px;
  color: var(--text-secondary);
}

/* =======================
   HEADER MODES
======================= */

#feedHeader[data-mode="collapsed"] #feedWeekNav,
#feedHeader[data-mode="collapsed"] #feedWeekStrip,
#feedHeader[data-mode="collapsed"] #feedFilterRow {
  display: none;
}

#feedHeader[data-mode="calendar"] #feedCollapsedBar,
#feedHeader[data-mode="calendar"] #feedFilterRow {
  display: none;
}

#feedHeader[data-mode="filters"] #feedCollapsedBar,
#feedHeader[data-mode="filters"] #feedWeekNav,
#feedHeader[data-mode="filters"] #feedWeekStrip {
  display: none;
}

/* =======================
   HEADER STATES
======================= */

.feed-header {
  position: relative;
  transition: height .25s ease;
}

.feed-header.collapsed {
  height: 48px;

  display: flex;
  align-items: center;
  justify-content: center;
}

.feed-header.collapsed .feed-header-expanded {
  display: none;
}

.feed-header.collapsed .feed-header-date {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--text-primary);
}

.feed-header.expanded {
  height: 120px;
}

.feed-header.expanded .feed-header-collapsed {
  display: none;
}

.feed-header-expanded {
  padding: 10px 16px;
}

/* =======================
   FILTER BTN
======================= */

#feedFilterBtn:hover {
  opacity: 1;
  background: rgba(var(--accent-rgb), .15);
}

#feedFilterBtn svg {
  width: 22px;
  height: 22px;

  stroke: rgb(var(--accent-rgb));
  opacity: .9;

  display: block;
}

/* =======================
   COLLAPSED BAR
======================= */

#feedCollapsedBar {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0 12px;

  font-size: 20px;
  font-weight: 600;
  letter-spacing: .3px;

  color: var(--text-primary);

  gap: 10px;

  background: linear-gradient(
    180deg,
    rgba(0,0,0,.35),
    rgba(0,0,0,.65)
  );

  backdrop-filter: blur(10px);

  border-bottom: 1px solid rgba(var(--accent-rgb), .15);

  height: 52px;
  width: 100%;

  box-sizing: border-box;
  grid-template-columns: 48px 1fr 96px;
}

#feedCollapsedBar:active {
  background: rgba(var(--accent-rgb), .05);
  border-radius: 10px;
}

/* =======================
   MODE VISIBILITY
======================= */

#feedHeader[data-mode="calendar"] #feedWeekNav,
#feedHeader[data-mode="calendar"] #feedWeekStrip {
  display: flex;
}

#feedHeader[data-mode="calendar"] #feedFilterRow {
  display: none;
}

#feedHeader[data-mode="filters"] #feedWeekNav,
#feedHeader[data-mode="filters"] #feedWeekStrip {
  display: none;
}

#feedHeader[data-mode="filters"] #feedFilterRow {
  display: flex;
}

/* =======================
   FILTER ROW
======================= */

#feedFilterRow {
  display: flex;
  gap: 12px;

  padding: 10px 14px 14px;

  justify-content: center;

  overflow-x: auto;
  white-space: nowrap;

  align-items: center;

  scrollbar-width: none;
}

#feedFilterRow::-webkit-scrollbar {
  display: none;
}

#feedFilterRow select {
  appearance: none;

  background: rgba(var(--accent-rgb), .08);
  border: 1px solid rgba(var(--accent-rgb), .25);

  color: rgb(var(--accent-rgb));

  padding: 8px 14px;
  border-radius: 10px;

  font-size: 14px;
  font-weight: 500;

  cursor: pointer;
}

#feedFilterRow select:focus {
  border-color: rgb(var(--accent-rgb));
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), .4);
}

/* =======================
   FILTER PILL SYSTEM
======================= */

.feed-filter {
  position: relative;

  padding: 8px 14px;
  border-radius: 10px;

  background: var(--bg-surface);
  color: rgb(var(--accent-rgb));

  font-size: 13px;
  white-space: nowrap;

  cursor: pointer;

  border: 1px solid rgba(var(--accent-rgb), .25);

  transition: all .18s ease;
}

.feed-filter:hover {
  background: var(--bg-subtle);
  border-color: rgba(var(--accent-rgb), .45);
}

.feed-filter.active {
  border: 1px solid rgba(var(--accent-rgb), .5);
  box-shadow: 0 0 10px rgba(var(--accent-rgb), .25);
}

/* =======================
   FILTER MENU
======================= */

.feed-filter-menu {
  position: absolute;
  top: 42px;
  left: 0;

  min-width: 170px;

  background: var(--bg-subtle);
  border-radius: 12px;

  border: 1px solid rgba(var(--accent-rgb), .2);

  box-shadow: 0 12px 30px rgba(0,0,0,.6);

  display: flex;
  flex-direction: column;

  z-index: 999;

  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;

  transition: all .18s ease;
}

.feed-filter.open .feed-filter-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.feed-filter-menu::before {
  content: "";

  position: absolute;
  top: -6px;
  left: 18px;

  width: 10px;
  height: 10px;

  background: var(--bg-subtle);

  border-left: 1px solid rgba(var(--accent-rgb), .2);
  border-top: 1px solid rgba(var(--accent-rgb), .2);

  transform: rotate(45deg);
}

.feed-filter-item {
  padding: 10px 14px;

  color: var(--text-primary);

  font-size: 13px;
  cursor: pointer;

  transition: background .15s ease, color .15s ease;
}

.feed-filter-item:hover {
  background: rgba(var(--accent-rgb), .12);
  color: rgb(var(--accent-rgb));
}

.feed-filter-item.active {
  background: rgba(var(--accent-rgb), .18);
  color: rgb(var(--accent-rgb));
  font-weight: 600;
}

/* =======================
   FILTER BADGE
======================= */

#feedFilterBadge {
  position: absolute;
  top: -4px;
  right: -4px;

  min-width: 16px;
  height: 16px;

  padding: 0 4px;

  border-radius: 10px;

  display: none;
  align-items: center;
  justify-content: center;

  font-size: 10px;
  font-weight: 600;

  background: rgb(var(--accent-rgb));
  color: var(--bg-main);
}

/* =======================
   COLLAPSED NAV
======================= */

.collapsed-nav {
  width: 40px;
  height: 40px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 12px;

  background: rgba(var(--accent-rgb), .10);
  color: rgb(var(--accent-rgb));

  cursor: pointer;

  font-size: 20px;
  flex: 0 0 42px;
}

.collapsed-expand {
  font-size: 14px;
  opacity: .65;
  margin-left: 4px;

  color: var(--text-secondary);
}

/* =======================
   DATE TRACK
======================= */

.feed-date-track {
  position: relative;
  width: 100%;
  height: 24px;
}

.feed-date-label {
  position: absolute;
  width: 100%;

  left: 0;
  top: 0;

  transition: transform .25s ease;

  font-size: 20px;
  font-weight: 600;

  color: var(--text-primary);

  white-space: nowrap;
}
.collapsed-nav,
#feedFilterBtn,
.collapsed-expand {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 40px;
  height: 40px;
}

.collapsed-nav,
.collapsed-expand,
#feedFilterBtn {
  flex: 0 0 40px;
}

/* =======================
   HEADER HEIGHT STATES
======================= */

#feedHeader[data-mode="collapsed"] {
  height: 56px;
}

#feedHeader[data-mode="calendar"] {
  height: auto;
}

/* =======================
   COLLAPSED NAV BUTTONS
======================= */

.collapsed-nav,
.collapsed-expand {
  border-radius: 12px;

  background: rgba(var(--accent-rgb), .10);
  color: rgb(var(--accent-rgb));
}

/* =======================
   ACTIVE DAY RING
======================= */

.feed-week-day.active::after {
  content: "";
  position: absolute;

  width: 64px;
  height: 64px;

  border-radius: 50%;
  border: 2px solid rgb(var(--accent-rgb));

  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
}

/* =======================
   RIGHT CONTROLS
======================= */

#feedCollapsedBar .right-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* =======================
   COLLAPSED DATE
======================= */

#feedCollapsedDate {
  flex: 1;

  display: flex;
  align-items: center;
  justify-content: center;

  font-weight: 600;
  font-size: clamp(14px,4.4vw,20px);
  letter-spacing: .3px;

  color: var(--text-primary);

  white-space: nowrap;
}

/* =======================
   WEEK TITLE
======================= */

#feedWeekNav #weekTitle {
  font-size: 18px;
  font-weight: 600;

  color: var(--text-primary);
  letter-spacing: .3px;
}

/* =======================
   FLOATING DOCK
======================= */

#feedActionDock {
  position: absolute;
  right: 14px;
  bottom: 10px;

  display: flex;
  gap: 10px;

  z-index: 200;

  align-items: center;
  justify-content: flex-end;

  pointer-events: auto;

  transition: transform .25s ease, opacity .25s ease;
}

/* =======================
   PRIMARY ADD BUTTON
======================= */

#feedAddBtn {
  width: 56px;
  height: 56px;

  border-radius: 50%;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 32px;
  font-weight: 600;

  color: var(--bg-main);

  background: linear-gradient(
    135deg,
    rgba(var(--accent-rgb), 1),
    rgba(var(--accent-rgb), .75)
  );

  box-shadow: 0 12px 32px rgba(0,0,0,.45);

  cursor: pointer;
}

/* =======================
   FLOATING BUTTON BASE
======================= */

#feedAddBtn,
#feedFilterFloatingBtn {
  width: 44px;
  height: 44px;

  display: flex !important;
  align-items: center;
  justify-content: center;

  border-radius: 12px;

  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);

  color: rgb(var(--accent-rgb));

  font-size: 20px;

  box-shadow:
    0 4px 10px rgba(0,0,0,.45),
    inset 0 1px 0 rgba(255,255,255,.04);

  cursor: pointer;

  transition:
    transform .12s ease,
    box-shadow .15s ease,
    background .15s ease;
}

/* =======================
   HOVER / ACTIVE
======================= */

#feedAddBtn:hover,
#feedFilterFloatingBtn:hover {
  background: var(--bg-elevated);
}

#feedAddBtn:active,
#feedFilterFloatingBtn:active {
  transform: scale(.92);
  box-shadow: 0 2px 6px rgba(0,0,0,.55);
}

/* =======================
   FILTER ACTIVE STATE
======================= */

#feedFilterFloatingBtn.active {
  background: linear-gradient(
    180deg,
    rgba(var(--accent-rgb), 1),
    rgba(var(--accent-rgb), .7)
  );

  color: var(--bg-main);

  border: none;

  box-shadow: 0 4px 14px rgba(var(--accent-rgb), .45);
}

/* =======================
   FILTER CAROUSEL
======================= */

#feedFilterCarousel {
  display: flex;
  align-items: center;

  overflow: hidden;
  margin-right: 6px;

  pointer-events: none;
  opacity: 1;
}

.feed-filter-track {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

.feed-filter-track.scroll {
  animation: filterScroll 18s linear infinite;
}

/* =======================
   FILTER PILLS
======================= */

.feed-filter-pill {
  display: flex;
  align-items: center;

  padding: 4px 10px;
  border-radius: 999px;

  background: rgba(var(--accent-rgb), .15);
  border: 1px solid rgba(var(--accent-rgb), .35);

  color: rgb(var(--accent-rgb));

  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
}

/* =======================
   SCROLL ANIMATION
======================= */

@keyframes filterScroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* =======================
   LANDSCAPE
======================= */

@media (orientation:landscape) {

  .feed-week-day {
    height: 64px;
  }

  .feed-week-day.active::after {
    width: 46px;
    height: 46px;
  }

  #feedHeader[data-mode="calendar"] {
    height: auto;
  }

}