.anywhere-timeline-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
    margin: 0 0 18px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
}

.anywhere-timeline-controls label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 700;
}

.anywhere-timeline-controls select,
.anywhere-timeline-controls input {
    min-height: 40px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 8px 10px;
}

.anywhere-timeline-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 16px;
}

.anywhere-timeline-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 800;
}

.anywhere-timeline-legend i {
    width: 16px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
    border: 1px solid rgba(0,0,0,.12);
}

.anywhere-timeline-wrap {
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #ffffff;
}

.anywhere-timeline-grid {
    min-width: 980px;
}

.anywhere-timeline-header,
.anywhere-timeline-row {
    display: grid;
    grid-template-columns: 260px repeat(var(--anywhere-timeline-days), minmax(42px, 1fr));
}

.anywhere-timeline-header {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #0f172a;
    color: #ffffff;
}

.anywhere-timeline-corner,
.anywhere-timeline-day,
.anywhere-timeline-label,
.anywhere-timeline-cell {
    padding: 9px 8px;
    border-right: 1px solid rgba(226,232,240,.8);
    border-bottom: 1px solid #e5e7eb;
}

.anywhere-timeline-day {
    text-align: center;
    font-size: 12px;
    font-weight: 800;
}

.anywhere-timeline-day small {
    display: block;
    font-weight: 600;
    opacity: .8;
}

.anywhere-timeline-label {
    position: sticky;
    left: 0;
    z-index: 4;
    background: #ffffff;
    font-weight: 800;
}

.anywhere-timeline-label small {
    display: block;
    color: #64748b;
    font-weight: 600;
    margin-top: 3px;
}

.anywhere-timeline-row {
    position: relative;
}

.anywhere-timeline-cell {
    min-height: 54px;
    background: #ffffff;
}

.anywhere-timeline-cell:nth-child(even) {
    background: #fbfdff;
}

.anywhere-timeline-bars {
    grid-column: 2 / -1;
    position: relative;
    min-height: 0;
    pointer-events: none;
}

.anywhere-timeline-bar {
    position: absolute;
    top: 10px;
    height: 34px;
    border-radius: 999px;
    padding: 7px 12px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    pointer-events: auto;
    box-shadow: 0 8px 18px rgba(15,23,42,.15);
    text-decoration: none !important;
}

.anywhere-timeline-status-confirmed,
.anywhere-timeline-status-paid,
.anywhere-timeline-status-deposit_paid {
    background: #16a34a;
}

.anywhere-timeline-status-pending,
.anywhere-timeline-status-pending_approval,
.anywhere-timeline-status-awaiting_payment {
    background: #f59e0b;
}

.anywhere-timeline-status-cancelled,
.anywhere-timeline-status-declined,
.anywhere-timeline-status-expired {
    background: #dc2626;
}

.anywhere-timeline-status-completed {
    background: #2563eb;
}

.anywhere-timeline-status-blocked,
.anywhere-timeline-status-maintenance,
.anywhere-timeline-status-owner_block {
    background: #475569;
}

.anywhere-timeline-empty {
    padding: 18px;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    background: #f8fafc;
}


/* Accommodation Booking Manager v1.6.2 timeline row + colour fix */
.anywhere-timeline-row {
    position: relative;
    min-height: 64px;
    align-items: stretch;
}

.anywhere-timeline-label {
    grid-row: 1 !important;
    min-height: 64px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.anywhere-timeline-cell {
    grid-row: 1 !important;
    min-height: 64px;
}

.anywhere-timeline-bars {
    grid-column: 2 / -1 !important;
    grid-row: 1 !important;
    position: relative !important;
    min-height: 64px !important;
    pointer-events: none;
    z-index: 3;
}

.anywhere-timeline-bar {
    position: absolute !important;
    z-index: 4;
    top: 10px;
    height: 34px;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 800;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    pointer-events: auto;
    box-shadow: 0 8px 18px rgba(15,23,42,.15);
    text-decoration: none !important;
    border: 1px solid rgba(0,0,0,.12);
}

.anywhere-timeline-status-pending,
.anywhere-timeline-status-pending_approval {
    background: #f59e0b !important;
    color: #111827 !important;
    border-color: #d97706 !important;
}

.anywhere-timeline-status-approved {
    background: #2563eb !important;
    color: #ffffff !important;
    border-color: #1d4ed8 !important;
}

.anywhere-timeline-status-awaiting_payment {
    background: #facc15 !important;
    color: #111827 !important;
    border-color: #ca8a04 !important;
}

.anywhere-timeline-status-confirmed,
.anywhere-timeline-status-paid,
.anywhere-timeline-status-deposit_paid {
    background: #16a34a !important;
    color: #ffffff !important;
    border-color: #15803d !important;
}

.anywhere-timeline-status-completed {
    background: #0f766e !important;
    color: #ffffff !important;
    border-color: #0f766e !important;
}

.anywhere-timeline-status-cancelled,
.anywhere-timeline-status-declined,
.anywhere-timeline-status-expired {
    background: #dc2626 !important;
    color: #ffffff !important;
    border-color: #b91c1c !important;
}

.anywhere-timeline-status-blocked,
.anywhere-timeline-status-maintenance,
.anywhere-timeline-status-owner_block {
    background: #475569 !important;
    color: #ffffff !important;
    border-color: #334155 !important;
}

.anywhere-timeline-legend .anywhere-timeline-status-awaiting_payment {
    background: #facc15 !important;
}


/* Accommodation Booking Manager v1.6.6 timeline blocked-row + approved-legend fix */
.anywhere-timeline-row {
    display: grid !important;
    grid-template-columns: 260px repeat(var(--anywhere-timeline-days), minmax(42px, 1fr)) !important;
    grid-auto-rows: minmax(64px, auto) !important;
    position: relative !important;
    align-items: stretch !important;
}

.anywhere-timeline-label,
.anywhere-timeline-cell,
.anywhere-timeline-bars {
    grid-row: 1 !important;
}

.anywhere-timeline-label {
    min-height: 64px !important;
}

.anywhere-timeline-cell {
    min-height: 64px !important;
}

.anywhere-timeline-bars {
    grid-column: 2 / -1 !important;
    grid-row: 1 !important;
    align-self: stretch !important;
    position: relative !important;
    min-height: 64px !important;
    height: 64px !important;
    pointer-events: none !important;
    z-index: 5 !important;
}

.anywhere-timeline-bar {
    position: absolute !important;
    top: 10px !important;
    height: 34px !important;
    z-index: 10 !important;
    box-sizing: border-box !important;
}

.anywhere-timeline-status-approved,
.anywhere-timeline-legend .anywhere-timeline-status-approved {
    background: #2563eb !important;
    color: #ffffff !important;
    border-color: #1d4ed8 !important;
}

.anywhere-timeline-status-awaiting_payment,
.anywhere-timeline-legend .anywhere-timeline-status-awaiting_payment {
    background: #facc15 !important;
    color: #111827 !important;
    border-color: #ca8a04 !important;
}

.anywhere-timeline-status-blocked,
.anywhere-timeline-status-maintenance,
.anywhere-timeline-status-owner_block,
.anywhere-timeline-legend .anywhere-timeline-status-blocked {
    background: #475569 !important;
    color: #ffffff !important;
    border-color: #334155 !important;
}


/* Accommodation Booking Manager v1.6.9 timeline operational polish */
.anywhere-timeline-controls {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)) !important;
    align-items: end;
}

.anywhere-timeline-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 14px 0 12px;
}

.anywhere-timeline-summary span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 800;
    color: #334155;
}

.anywhere-timeline-summary span.is-warning {
    background: #fee2e2;
    border-color: #fecaca;
    color: #991b1b;
}

.anywhere-timeline-bar span {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.anywhere-timeline-type-booking:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(15,23,42,.22) !important;
}

.anywhere-timeline-status-overdue,
.anywhere-timeline-legend .anywhere-timeline-status-overdue {
    background: #f97316 !important;
    color: #ffffff !important;
    border-color: #c2410c !important;
}

.anywhere-timeline-payment-unpaid.anywhere-timeline-status-awaiting_payment {
    box-shadow: 0 0 0 2px rgba(250,204,21,.35), 0 8px 18px rgba(15,23,42,.15) !important;
}

.anywhere-timeline-legend {
    align-items: center;
}


/* Accommodation Booking Manager v1.6.10 overdue/action-needed orange */
.anywhere-timeline-status-overdue,
.anywhere-timeline-legend .anywhere-timeline-status-overdue {
    background: #f97316 !important;
    color: #ffffff !important;
    border-color: #c2410c !important;
}


/* v1.9.40 Timeline Calendar Rendering Fix */
.stayfinder-timeline-wrap,
.anywhere-stays-timeline-wrap,
.stayfinder-timeline-calendar-wrap,
.anywhere-timeline-calendar-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 12px;
}

.stayfinder-timeline-calendar,
.anywhere-stays-timeline-calendar,
.anywhere-timeline-calendar {
  width: 100%;
  max-width: none;
  min-width: 920px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}

.stayfinder-timeline-calendar th,
.stayfinder-timeline-calendar td,
.anywhere-stays-timeline-calendar th,
.anywhere-stays-timeline-calendar td,
.anywhere-timeline-calendar th,
.anywhere-timeline-calendar td {
  box-sizing: border-box;
  vertical-align: middle;
  white-space: nowrap;
  padding: 8px 10px;
  min-width: 44px;
  height: 42px;
  border-right: 1px solid #eef2f7;
  border-bottom: 1px solid #eef2f7;
  font-size: 13px;
  line-height: 1.2;
}

.stayfinder-timeline-calendar thead th,
.anywhere-stays-timeline-calendar thead th,
.anywhere-timeline-calendar thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f8fafc;
  color: #111827;
  font-weight: 700;
  text-align: center;
}

.stayfinder-timeline-calendar .stayfinder-timeline-row-label,
.stayfinder-timeline-calendar .timeline-row-label,
.anywhere-stays-timeline-calendar .stayfinder-timeline-row-label,
.anywhere-stays-timeline-calendar .timeline-row-label,
.anywhere-timeline-calendar .stayfinder-timeline-row-label,
.anywhere-timeline-calendar .timeline-row-label {
  position: sticky;
  left: 0;
  z-index: 4;
  background: #fff;
  min-width: 220px;
  width: 220px;
  max-width: 260px;
  text-align: left;
  font-weight: 700;
  color: #111827;
  box-shadow: 1px 0 0 #e5e7eb;
}

.stayfinder-timeline-calendar thead .stayfinder-timeline-row-label,
.stayfinder-timeline-calendar thead .timeline-row-label,
.anywhere-stays-timeline-calendar thead .stayfinder-timeline-row-label,
.anywhere-stays-timeline-calendar thead .timeline-row-label,
.anywhere-timeline-calendar thead .stayfinder-timeline-row-label,
.anywhere-timeline-calendar thead .timeline-row-label {
  z-index: 5;
  background: #f8fafc;
}

.stayfinder-timeline-calendar .is-booked,
.stayfinder-timeline-calendar .booked,
.stayfinder-timeline-calendar .unavailable,
.anywhere-stays-timeline-calendar .is-booked,
.anywhere-stays-timeline-calendar .booked,
.anywhere-stays-timeline-calendar .unavailable,
.anywhere-timeline-calendar .is-booked,
.anywhere-timeline-calendar .booked,
.anywhere-timeline-calendar .unavailable {
  background: #fee2e2;
  color: #991b1b;
  font-weight: 700;
}

.stayfinder-timeline-calendar .is-open,
.stayfinder-timeline-calendar .available,
.stayfinder-timeline-calendar .open,
.anywhere-stays-timeline-calendar .is-open,
.anywhere-stays-timeline-calendar .available,
.anywhere-stays-timeline-calendar .open,
.anywhere-timeline-calendar .is-open,
.anywhere-timeline-calendar .available,
.anywhere-timeline-calendar .open {
  background: #ecfdf5;
  color: #065f46;
}

.stayfinder-timeline-calendar .is-past,
.stayfinder-timeline-calendar .past,
.anywhere-stays-timeline-calendar .is-past,
.anywhere-stays-timeline-calendar .past,
.anywhere-timeline-calendar .is-past,
.anywhere-timeline-calendar .past {
  background: #f3f4f6;
  color: #9ca3af;
}

.stayfinder-timeline-legend,
.anywhere-stays-timeline-legend,
.anywhere-timeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 12px 0 18px;
  font-size: 13px;
  color: #374151;
}

.stayfinder-timeline-legend span,
.anywhere-stays-timeline-legend span,
.anywhere-timeline-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.stayfinder-timeline-legend span::before,
.anywhere-stays-timeline-legend span::before,
.anywhere-timeline-legend span::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: inline-block;
  background: #e5e7eb;
}

.stayfinder-timeline-legend .available::before,
.stayfinder-timeline-legend .open::before,
.anywhere-stays-timeline-legend .available::before,
.anywhere-stays-timeline-legend .open::before,
.anywhere-timeline-legend .available::before,
.anywhere-timeline-legend .open::before {
  background: #10b981;
}

.stayfinder-timeline-legend .booked::before,
.stayfinder-timeline-legend .unavailable::before,
.anywhere-stays-timeline-legend .booked::before,
.anywhere-stays-timeline-legend .unavailable::before,
.anywhere-timeline-legend .booked::before,
.anywhere-timeline-legend .unavailable::before {
  background: #ef4444;
}

.stayfinder-timeline-toolbar,
.anywhere-stays-timeline-toolbar,
.anywhere-timeline-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 14px;
}

.stayfinder-timeline-toolbar a,
.stayfinder-timeline-toolbar button,
.anywhere-stays-timeline-toolbar a,
.anywhere-stays-timeline-toolbar button,
.anywhere-timeline-toolbar a,
.anywhere-timeline-toolbar button {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #111827;
  background: #111827;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 768px) {
  .stayfinder-timeline-calendar,
  .anywhere-stays-timeline-calendar,
  .anywhere-timeline-calendar {
    min-width: 760px;
  }

  .stayfinder-timeline-calendar .stayfinder-timeline-row-label,
  .stayfinder-timeline-calendar .timeline-row-label,
  .anywhere-stays-timeline-calendar .stayfinder-timeline-row-label,
  .anywhere-stays-timeline-calendar .timeline-row-label,
  .anywhere-timeline-calendar .stayfinder-timeline-row-label,
  .anywhere-timeline-calendar .timeline-row-label {
    min-width: 160px;
    width: 160px;
  }
}



/* v1.9.42 Timeline fixed-width columns + sticky header fix */
.anywhere-timeline-wrap{
  width:100% !important;
  max-width:100% !important;
  max-height:72vh !important;
  overflow:auto !important;
  -webkit-overflow-scrolling:touch;
  position:relative !important;
  border:1px solid #e5e7eb;
  border-radius:18px;
  background:#ffffff;
}

.anywhere-timeline-grid{
  width:max-content !important;
  max-width:none !important;
  min-width:max-content !important;
  position:relative !important;
}

.anywhere-timeline-header,
.anywhere-timeline-row{
  display:grid !important;
  grid-template-columns:var(--anywhere-timeline-left-width,280px) repeat(var(--anywhere-timeline-days), var(--anywhere-timeline-day-width,72px)) !important;
  width:100% !important;
  min-width:100% !important;
}

.anywhere-timeline-header{
  position:sticky !important;
  top:0 !important;
  z-index:80 !important;
  background:#0f172a !important;
  color:#ffffff !important;
  box-shadow:0 2px 0 rgba(15,23,42,.12);
}

.anywhere-timeline-corner{
  position:sticky !important;
  left:0 !important;
  z-index:100 !important;
  min-width:var(--anywhere-timeline-left-width,280px) !important;
  width:var(--anywhere-timeline-left-width,280px) !important;
  background:#0f172a !important;
  color:#ffffff !important;
}

.anywhere-timeline-label{
  position:sticky !important;
  left:0 !important;
  z-index:50 !important;
  min-width:var(--anywhere-timeline-left-width,280px) !important;
  width:var(--anywhere-timeline-left-width,280px) !important;
  background:#ffffff !important;
  box-shadow:2px 0 0 rgba(226,232,240,.95);
}

.anywhere-timeline-day,
.anywhere-timeline-cell{
  min-width:var(--anywhere-timeline-day-width,72px) !important;
  width:var(--anywhere-timeline-day-width,72px) !important;
  max-width:var(--anywhere-timeline-day-width,72px) !important;
  box-sizing:border-box !important;
  flex:0 0 var(--anywhere-timeline-day-width,72px) !important;
}

.anywhere-timeline-day{
  height:52px !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
  padding:7px 4px !important;
}

.anywhere-timeline-row{
  position:relative !important;
  min-height:68px !important;
  grid-auto-rows:minmax(68px,auto) !important;
}

.anywhere-timeline-label,
.anywhere-timeline-cell{
  min-height:68px !important;
}

.anywhere-timeline-bars{
  grid-column:2 / -1 !important;
  grid-row:1 !important;
  position:relative !important;
  height:68px !important;
  min-height:68px !important;
  z-index:20 !important;
  pointer-events:none !important;
}

.anywhere-timeline-bar{
  position:absolute !important;
  z-index:30 !important;
  pointer-events:auto !important;
  height:34px !important;
  max-width:calc(100% - 4px) !important;
  box-sizing:border-box !important;
}

@media (max-width:768px){
  .anywhere-timeline-wrap{max-height:68vh !important;}
  .anywhere-timeline-header,
  .anywhere-timeline-row{
    grid-template-columns:220px repeat(var(--anywhere-timeline-days), 64px) !important;
  }
  .anywhere-timeline-corner,
  .anywhere-timeline-label{
    min-width:220px !important;
    width:220px !important;
  }
  .anywhere-timeline-day,
  .anywhere-timeline-cell{
    min-width:64px !important;
    width:64px !important;
    max-width:64px !important;
  }
}
