/**
 * Desk Booking Widget – self-contained styles.
 * No shared CSS with other widgets or the chat UI.
 */
.desk-booking-widget {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: 1rem 0;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
}

/* Disabled state after a successful book/update: keep visible but non-interactive */
.desk-booking-widget.desk-booking-widget--disabled {
    opacity: 0.6;
    pointer-events: none;
}

/* Overlay shown after booking is confirmed: above info popup, blocks interaction */
.desk-booking-overlay {
    position: absolute;
    inset: 0;
    z-index: 10001;
    background: rgba(255, 255, 255, 0.4);
    pointer-events: auto;
}

.desk-booking-overlay.hidden {
    display: none;
    pointer-events: none;
}

/* Map loading overlay (shown when Set is clicked) */
.desk-booking-map-loading {
    position: absolute;
    inset: 0;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
}

.desk-booking-map-loading__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.desk-booking-map-loading__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: desk-booking-spin 0.8s linear infinite;
}

.desk-booking-map-loading__text {
    font-size: 0.875rem;
    font-weight: 500;
    color: #4a5568;
}

@keyframes desk-booking-spin {
    to {
        transform: rotate(360deg);
    }
}

.desk-booking-inline-alert {
    margin: 0.75rem 1rem 0.25rem 1rem;
    padding: 0.75rem 0.875rem;
    border-radius: 10px;
    border: 1px solid transparent;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.desk-booking-inline-alert.hidden {
    display: none;
}

.desk-booking-inline-alert--error {
    background: #fff5f5;
    border-color: #feb2b2;
    color: #742a2a;
}

.desk-booking-inline-alert__body {
    flex: 1;
    min-width: 0;
}

.desk-booking-inline-alert__title {
    font-weight: 700;
    font-size: 0.875rem;
    margin-bottom: 0.125rem;
}

.desk-booking-inline-alert__message {
    font-size: 0.875rem;
    line-height: 1.25rem;
    word-break: break-word;
}

.desk-booking-inline-alert__link {
    margin-top: 0.5rem;
    padding: 0;
    border: none;
    background: transparent;
    color: #c53030;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

.desk-booking-inline-alert__link.hidden {
    display: none;
}

.desk-booking-inline-alert__details {
    margin-top: 0.5rem;
    padding: 0.625rem 0.75rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
    max-height: 180px;
    overflow: auto;
    font-size: 0.75rem;
    line-height: 1.1rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.desk-booking-inline-alert__details.hidden {
    display: none;
}

.desk-booking-inline-alert__close {
    border: none;
    background: transparent;
    color: inherit;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.125rem 0.25rem;
    opacity: 0.8;
}

.desk-booking-inline-alert__close:hover {
    opacity: 1;
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f7fafc;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-title-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.date-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a202c;
}

.location-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #4a5568;
    cursor: pointer;
    user-select: none;
}

.location-header:hover {
    color: #2d3748;
}

.location-header .chevron {
    font-size: 0.75rem;
    color: #a0aec0;
    transition: transform 0.2s;
    flex-shrink: 0;
}

/* Summary string (Where • When) can wrap on narrow screens */
#locationText {
    word-break: break-word;
}

.collapsible-section {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    background: white;
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
    max-height: 200px;
    opacity: 1;
    overflow: hidden;
}

.collapsible-section.collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    border-bottom: none;
}

.building-selector {
    flex: 1;
    min-width: 300px;
    margin-bottom: 0;
}


.selector-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.select-input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 0.875rem;
    background: white;
    color: #2d3748;
}

.select-input:disabled {
    background: #f7fafc;
    color: #a0aec0;
    cursor: not-allowed;
}

.btn-set {
    padding: 0.5rem 1rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-set:hover:not(:disabled) {
    background: #5a67d8;
}

.btn-set:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
}


.date-input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 0.875rem;
    background: white;
    color: #2d3748;
    min-width: 150px;
}

.theme-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-label {
    font-size: 0.875rem;
    color: #4a5568;
    font-weight: 500;
    white-space: nowrap;
}

.theme-select {
    min-width: 120px;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    font-size: 0.875rem;
    color: #4a5568;
    cursor: pointer;
}

.theme-select:hover {
    border-color: #cbd5e0;
}

.theme-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.time-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #4a5568;
}

.chevron {
    font-size: 0.75rem;
    color: #a0aec0;
}

/* iOS-style segmented control: pill-shaped, floating over map */
.view-segmented {
    display: inline-flex;
    align-items: stretch;
    padding: 0.25rem;
    border-radius: 9999px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    gap: 0;
    box-sizing: border-box;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* Floating over map/list content */
.view-segmented--floating {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 400;
    width: auto;
    min-width: 160px;
}

.view-segmented .tab.segment {
    flex: 1;
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    border-radius: 8px;
}

.view-segmented .tab.segment:hover {
    color: #475569;
}

.view-segmented .tab.segment.segment--active,
.view-segmented .tab.segment.active {
    color: #1e293b;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border-radius: 9999px;
}

.tab {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: #718096;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tab:hover {
    color: #4a5568;
}

.tab.active {
    color: #1e293b;
}

/* Content wrapper: map/list sit here; footer floats over bottom */
.desk-booking-content {
    position: relative;
    min-height: 400px;
    height: 520px;
}

.view-container {
    display: none;
    min-height: 400px;
    height: 100%;
}

.view-container.active {
    display: block;
}

.map-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 400px;
}

.map-legend {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.75rem;
    display: flex;
    gap: 1rem;
    z-index: 1000;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.legend-color.available {
    background: #48bb78;
}

.legend-color.selected {
    background: #f59e0b;
}

.legend-color.booked {
    background: #6c757d;
}

.legend-color.my-booking {
    background: #dc2626;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    border: 2px solid #991b1b;
    position: relative;
}

.legend-color.my-booking::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z' fill='white'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.95;
}

.workstation-marker {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.workstation-marker.available {
    background: #48bb78;
}

.workstation-marker.booked {
    background: #6c757d; /* Grey for booked */
    border-color: #5a6268;
    width: 32px;
    height: 32px;
}

.booking-success-message {
    padding: 1rem;
    background: #f0fdf4;
    border-top: 1px solid #e2e8f0;
}

.workstation-marker.occupied {
    background: #f56565;
    width: 32px;
    height: 32px;
}

.workstation-marker.selected {
    transform: scale(1.3);
    background: #f59e0b !important; /* Orange for selected */
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.4);
    z-index: 300;
    border-color: #d97706 !important;
}

.workstation-marker.suggested {
    border: 3px solid #17a2b8;
    box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.3);
}

.workstation-marker.suggested.selected {
    border: 3px solid #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.5);
}

.workstation-marker.reference {
    border: 3px solid #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3);
    background: #fbbf24;
}

.workstation-marker.reference.booked {
    background: #f59e0b;
    border-color: #d97706;
}

.workstation-marker .profile-picture {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
}

.workstation-marker .user-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: white;
  font-weight: bold;
  font-size: 12px;
  background-color: #495057;
  border-radius: 50%;
}

.workstation-marker .user-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: white;
  font-weight: bold;
  font-size: 12px;
  background-color: #495057;
  border-radius: 50%;
}

/* User's own booking - red circle with pin icon */
.workstation-marker.my-booking {
  background-color: #dc2626; /* Red color */
  border: 2px solid #991b1b;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4), 0 0 0 2px rgba(255, 255, 255, 0.8);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.workstation-marker.my-booking .my-booking-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  position: relative;
}

.workstation-marker.my-booking .pin-icon {
  width: 20px;
  height: 20px;
  color: white;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.workstation-marker.my-booking:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.5), 0 0 0 3px rgba(255, 255, 255, 0.9);
  z-index: 1001;
}

.desk-list {
    padding: 3.5rem 1rem 1rem 1rem;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
}

.desk-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.desk-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.1);
}

.desk-item.selected {
    border-color: #667eea;
    background: #edf2f7;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.desk-item.occupied {
    opacity: 0.6;
    cursor: not-allowed;
}

.desk-info {
    flex: 1;
}

.desk-name {
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.desk-status {
    font-size: 0.75rem;
    color: #718096;
}

.desk-item.available .desk-status {
    color: #48bb78;
}

.desk-item.occupied .desk-status {
    color: #f56565;
}

/* Radio button format for desk list */
.desk-item-radio {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0.875rem 1rem;
    margin-bottom: 0.5rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.desk-item-radio:hover {
    border-color: #667eea;
    background: #f8fafc;
    box-shadow: 0 1px 3px rgba(102, 126, 234, 0.1);
}

.desk-item-radio.selected {
    border-color: #667eea;
    background: #edf2f7;
}

.desk-item-radio input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e0;
    border-radius: 50%;
    margin-right: 0.75rem;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: border-color 0.2s, background-color 0.2s;
}

.desk-item-radio input[type="radio"]:hover {
    border-color: #667eea;
}

.desk-item-radio input[type="radio"]:checked {
    border-color: #667eea;
    background-color: white;
}

.desk-item-radio input[type="radio"]:checked::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: #667eea;
    border-radius: 50%;
}

.desk-item-radio .desk-label {
    color: #2d3748;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    flex: 1;
    min-width: 0;
}

.desk-item-radio .desk-list-status {
    margin-left: auto;
    font-size: 0.8125rem;
    font-weight: 600;
    flex-shrink: 0;
    padding-left: 0.5rem;
}

.desk-item-radio .desk-list-status--available {
    color: #059669;
}

.desk-item-radio .desk-list-status--booked {
    color: #6b7280;
    font-weight: 500;
}

.desk-item-radio .desk-list-status--my-booking {
    color: #dc2626;
    font-weight: 600;
}

.desk-item-radio.my-booking-item {
    border-color: #dc2626;
    border-width: 2px;
    background: #fef2f2;
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.1);
}

.desk-item-radio.my-booking-item:hover {
    border-color: #991b1b;
    background: #fee2e2;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}

.desk-item-radio.my-booking-item input[type="radio"] {
    border-color: #dc2626;
}

.desk-item-radio.my-booking-item input[type="radio"]:checked {
    border-color: #dc2626;
}

.desk-item-radio.my-booking-item input[type="radio"]:checked::before {
    background: #dc2626;
}

.desk-item-radio.desk-item-booked {
    cursor: default;
    opacity: 0.7;
    background: #f9fafb;
    border-color: #e5e7eb;
}

.desk-item-radio.desk-item-booked:hover {
    border-color: #e5e7eb;
    background: #f9fafb;
}

.desk-item-radio.desk-item-booked .desk-label {
    cursor: default;
    color: #6b7280;
}

.occupant-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: #718096;
}

/* Desk info popup */
.desk-info-popup {
    position: absolute;
    z-index: 300;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 0;
    min-width: 200px;
    max-width: 90%;
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.desk-info-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 12px 16px;
    gap: 12px;
    position: relative;
}

.desk-info-text-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.desk-info-name {
    color: #2d3748;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.desk-info-subtitle {
    color: #718096;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.4;
}

.desk-info-close {
    background: #667eea;
    border: none;
    color: white;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
    font-weight: 300;
}

.desk-info-close:hover {
    background: #5568d3;
}

.desk-info-close:active {
    background: #4c5bc4;
}

.desk-info-pointer {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1));
}

.widget-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-top: 1px solid #e2e8f0;
    background: #f7fafc69;
    gap: 1rem;
}

/* End-to-end floating strip over map: box look, curved corners, glassmorphism */
.widget-footer--floating {
    position: absolute;
    background: #f7fafc69;
    bottom: 12px;
    left: 12px;
    right: 12px;
    z-index: 500;
    padding: 0.875rem 1rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 -2px 12px rgba(0, 0, 0, 0.04);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: nowrap;
}

/* Colleague strip left; Book button right in same strip */
.widget-footer--floating .widget-footer-left {
    flex: 0 0 auto;
    min-width: 0;
    align-items: center;
}

.widget-footer--floating .widget-footer-center {
    flex: 0 0 auto;
    min-width: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-left: auto;
    margin-right: 0.75rem;
}

.widget-footer--floating .widget-footer-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Selected desk info in footer center */
.selected-desk-info {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.selected-desk-info.hidden {
    display: none;
}

.selected-desk-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #718096;
    white-space: nowrap;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.selected-desk-details {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
    align-items: flex-start;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: opacity 0.2s;
}

.selected-desk-details:hover {
    opacity: 0.75;
}

.selected-desk-details:active {
    opacity: 0.6;
}

.selected-desk-name {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selected-desk-status {
    font-size: 0.75rem;
    font-weight: 400;
    color: #38a169;
    line-height: 1.2;
    white-space: nowrap;
}

.widget-footer-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.widget-footer-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Colleague strip: heading and list stacked vertically */
.colleague-strip {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.375rem;
}

.colleague-strip.hidden {
    display: none;
}


.colleague-strip-label {
    font-size: 0.8125rem;
    color: #718096;
    font-weight: 500;
    white-space: nowrap;
}

.colleague-strip-icons {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: nowrap;
    position: relative;
}

.colleague-strip-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    background: #e2e8f0;
    color: #2d3748;
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.15s, z-index 0.15s;
    flex-shrink: 0;
    position: relative;
    margin-left: -8px;
}

.colleague-strip-icon:first-child {
    margin-left: 0;
}

.colleague-strip-icon:hover {
    background: #cbd5e0;
    border-color: #ffffff;
    transform: translateY(-2px);
    z-index: 10;
}

.colleague-strip-icon.selected {
    border-color: #667eea;
    background: #e0e7ff;
    color: #4338ca;
    z-index: 5;
}

/* Overflow indicator for stacked avatars */
.colleague-strip-overflow {
    background: #cbd5e0;
    color: #4a5568;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    border: 2px solid #ffffff;
    margin-left: -8px;
}

.colleague-strip-overflow:hover {
    background: #b8c5d0;
    border-color: #ffffff;
    transform: translateY(-2px);
    z-index: 10;
}

/* Colleague overflow popover */
.colleague-overflow-popover {
    position: absolute;
    bottom: 90px;
    left: 20px;
    z-index: 600;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
    padding: 16px 18px;
    min-width: 240px;
    max-width: 320px;
    max-height: 280px;
    overflow-y: auto;
    animation: popoverFadeIn 0.2s ease-out;
}

.colleague-overflow-popover.hidden {
    display: none;
}

@keyframes popoverFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.colleague-overflow-header {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.colleague-overflow-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.colleague-overflow-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
}

.colleague-overflow-item:hover {
    background: #f8fafc;
}

.colleague-overflow-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #2d3748;
    font-size: 0.9375rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid #cbd5e0;
}

.colleague-overflow-avatar--user {
    background: #fee2e2;
    color: #991b1b;
    border-color: #dc2626;
}

.colleague-overflow-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.colleague-overflow-name {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
}

.colleague-overflow-desk {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.3;
}

/* Separator between current floor and other floors */
.colleague-overflow-separator {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 8px 12px 6px 12px;
    margin-top: 4px;
}

/* Other floors colleagues - slightly dimmed */
.colleague-overflow-item--other-floor {
    opacity: 0.75;
}

.colleague-overflow-item--other-floor:hover {
    opacity: 1;
}

/* User's own icon with pin - distinct styling */
.colleague-strip-icon--user {
    border-color: #ffffff;
    border-width: 2.5px;
    background: #fee2e2;
    color: #991b1b;
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.2);
}

.colleague-strip-icon--user:hover {
    background: #fecaca;
    border-color: #ffffff;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.3);
}

.colleague-strip-icon--user.colleague-strip-icon--other-floor {
    opacity: 0.85;
}

.colleague-strip-icon--user.colleague-strip-icon--other-floor:hover {
    opacity: 1;
}

.colleague-strip-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    height: 100%;
}

.colleague-strip-icon-text {
    font-size: 0.875rem;
    font-weight: 700;
}

.colleague-strip-pin {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 12px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #dc2626;
    border-radius: 50%;
    color: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.colleague-strip-pin svg {
    width: 8px;
    height: 8px;
    display: block;
}

/* Other floors colleagues */
.colleague-strip-icon--other-floor {
    opacity: 0.7;
}

.colleague-strip-icon--other-floor:hover {
    opacity: 1;
}

.widget-error,
.widget-success {
    padding: 0.75rem 1rem;
    margin: 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
}

.widget-error {
    background: #fed7d7;
    color: #c53030;
    border: 1px solid #feb2b2;
}

.widget-success {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

/* Desk booking success toast (mobile positioning/typography in @media below) */
.desk-booking-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #48bb78;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    font-weight: 500;
    font-size: 0.875rem;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    max-width: 400px;
}

.desk-booking-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.desk-booking-toast-success {
    background: #48bb78;
}

.desk-booking-toast-error {
    background: #f56565;
}

/* Mobile-friendly styles */
@media (max-width: 640px) {
    .desk-booking-widget {
        margin: 0.5rem 0.5rem 0.75rem;
        border-radius: 12px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    }

    .desk-booking-inline-alert {
        margin: 0.5rem 0.5rem 0.25rem 0.5rem;
        padding: 0.625rem 0.5rem;
    }

    .desk-booking-inline-alert__title,
    .desk-booking-inline-alert__message {
        font-size: 0.8125rem;
    }

    .desk-booking-inline-alert__details {
        max-height: 140px;
        font-size: 0.6875rem;
    }

    .widget-header {
        flex-direction: column;
        align-items: stretch;
        padding: 0.5rem 0.5rem 0.625rem;
        gap: 0.35rem;
    }

    .header-title-section {
        gap: 0.2rem;
    }

    .date-title {
        font-size: 1.125rem;
        font-weight: 600;
        color: #1a202c;
    }

    .location-header {
        font-size: 0.8125rem;
        min-height: 40px;
        padding: 0.125rem 0;
    }

    .collapsible-section {
        padding: 0.5rem 0.5rem;
        max-height: 280px;
    }

    .building-selector {
        min-width: 0;
        width: 100%;
    }

    .selector-group {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }

    .date-input,
    .select-input {
        min-width: 0;
        width: 100%;
        padding: 0.5rem 0.625rem;
        font-size: 16px; /* Prevents zoom on focus in iOS */
    }

    .btn-set {
        width: 100%;
        min-height: 44px;
        padding: 0.5rem 0.75rem;
        font-size: 1rem;
    }

    .view-segmented--floating {
        top: 12px;
        min-width: 140px;
    }

    .view-segmented .tab.segment {
        padding: 0.5rem 0.75rem;
        font-size: 0.9375rem;
    }

    .view-container {
        min-height: 400px;
        height: 100%;
    }

    .desk-booking-content {
        height: 550px;
        min-height: 450px;
    }

    .map-container {
        height: 100%;
        min-height: 400px;
    }

    .map-legend {
        bottom: 8px;
        left: 8px;
        padding: 0.375rem 0.75rem;
        font-size: 0.6875rem;
        gap: 0.75rem;
    }

    .legend-color {
        width: 12px;
        height: 12px;
    }

    .legend-color.my-booking {
        width: 12px;
        height: 12px;
    }

    .desk-list {
        padding: 3.75rem 0.5rem 2rem 0.5rem;
        max-height: 450px;
    }

    .desk-item {
        padding: 0.75rem 0.5rem;
        margin-bottom: 0.5rem;
    }

    .desk-item-radio {
        padding: 0.875rem 0.75rem;
        min-height: 52px;
        border-width: 1.5px;
    }

    .desk-item-radio input[type="radio"] {
        width: 22px;
        height: 22px;
        margin-right: 0.875rem;
    }

    .desk-item-radio input[type="radio"]:checked::before {
        width: 11px;
        height: 11px;
    }

    .desk-info-popup {
        min-width: 0;
        max-width: calc(100vw - 24px);
    }

    .desk-info-content {
        padding: 10px 0.5rem;
        gap: 10px;
    }

    .desk-info-name {
        font-size: 0.9375rem;
    }

    .desk-info-close {
        width: 28px;
        height: 28px;
        min-width: 28px;
        min-height: 28px;
    }

    .widget-footer {
        align-items: center;
        padding: 0.75rem 0.875rem;
    }

    .widget-footer--floating {
        bottom: 10px;
        left: 10px;
        right: 10px;
        padding: 0.75rem 0.875rem;
        border-radius: 14px;
        flex-wrap: wrap;
        gap: 0.625rem;
    }

    .widget-footer--floating .widget-footer-left {
        min-width: 0;
        flex: 0 0 auto;
        order: 1;
    }

    .widget-footer--floating .widget-footer-center {
        flex: 1 1 auto;
        min-width: 0;
        padding: 0;
        margin-left: 0;
        margin-right: 0;
        order: 2;
        width: auto;
        justify-content: flex-start;
    }

    .widget-footer--floating .widget-footer-actions {
        flex-shrink: 0;
        justify-content: flex-end;
        order: 3;
        margin-left: auto;
    }

    .selected-desk-info {
        gap: 0;
    }

    .selected-desk-label {
        font-size: 0.6875rem;
    }

    .selected-desk-name {
        font-size: 0.875rem;
    }

    .widget-footer-actions .btn,
    .desk-booking-widget #bookBtn {
        width: auto;
        flex-shrink: 0;
        min-height: 48px;
        padding: 0.625rem 1.25rem;
        font-size: 1rem;
        font-weight: 600;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .colleague-strip {
        min-width: 0;
    }

    .colleague-strip-icon {
        width: 36px;
        height: 36px;
        font-size: 0.8125rem;
        margin-left: -10px;
    }

    .colleague-strip-icon:first-child {
        margin-left: 0;
    }

    .colleague-strip-overflow {
        margin-left: -10px;
    }

    /* Colleague overflow popover mobile adjustments */
    .colleague-overflow-popover {
        left: 10px;
        right: 10px;
        bottom: 80px;
        max-width: none;
    }

    /* Very narrow screens (Z Fold 5 folded, etc.): colleagues on row 1, selected + Update on row 2 */
    @media (max-width: 400px) {
        .widget-footer--floating .widget-footer-left {
            flex-basis: 100%;
            width: 100%;
        }

        .widget-footer--floating .widget-footer-center {
            flex: 1 1 auto;
            min-width: 0;
        }

        .widget-footer--floating .widget-footer-actions {
            flex-shrink: 0;
        }
    }

    /* Toast: bottom bar style on mobile, safe area aware */
    .desk-booking-toast {
        top: auto;
        bottom: max(0.5rem, env(safe-area-inset-bottom));
        left: max(0.5rem, env(safe-area-inset-left));
        right: max(0.5rem, env(safe-area-inset-right));
        max-width: none;
        padding: 0.875rem 1rem;
        font-size: 0.9375rem;
        line-height: 1.35;
        word-break: break-word;
        border-radius: 10px;
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.15);
        transform: translateY(100%);
    }

    .desk-booking-toast.show {
        transform: translateY(0);
    }

    /* Inline widget success/error: compact, readable */
    .widget-error,
    .widget-success {
        margin: 0.5rem 0.5rem;
        padding: 0.625rem 0.5rem;
        font-size: 0.875rem;
        line-height: 1.35;
        word-break: break-word;
        border-radius: 8px;
    }

    /* Inline alert (availability error): touch-friendly close, compact */
    .desk-booking-inline-alert__close {
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}