:root {
  --request-recovery-bg: #f7f8fb;
  --request-recovery-surface: #ffffff;
  --request-recovery-text: #111827;
  --request-recovery-muted: #667085;
  --request-recovery-border: #e4e7ec;
  --request-recovery-accent: #3b82f6;
  --request-recovery-danger: #d92d20;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --request-recovery-bg: #0b0f1a;
    --request-recovery-surface: #111827;
    --request-recovery-text: #f3f4f6;
    --request-recovery-muted: #98a2b3;
    --request-recovery-border: #263244;
    --request-recovery-accent: #4f8ff7;
    --request-recovery-danger: #ff7b72;
  }
}

.is-hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.customer-request-launcher {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 900;
  display: inline-flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border: 1px solid color-mix(in srgb, var(--request-recovery-accent) 72%, white);
  border-radius: 50%;
  background: var(--request-recovery-accent);
  color: #fff;
  box-shadow: 0 7px 22px rgba(15, 23, 42, 0.24);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.customer-request-launcher:hover,
.customer-request-launcher:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 9px 26px rgba(15, 23, 42, 0.3);
}

.customer-request-launcher:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--request-recovery-accent) 35%, transparent);
  outline-offset: 3px;
}

.customer-request-launcher svg {
  width: 25px;
  height: 25px;
}

.customer-request-launcher-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 16px;
  height: 16px;
  box-sizing: border-box;
  border: 3px solid var(--request-recovery-surface);
  border-radius: 50%;
  background: #e11d48;
  box-shadow: 0 0 0 1px rgba(136, 19, 55, 0.2), 0 2px 6px rgba(136, 19, 55, 0.36);
}

.customer-request-launcher-preview {
  position: absolute;
  left: calc(100% + 11px);
  bottom: 5px;
  max-width: min(150px, calc(100vw - 91px - env(safe-area-inset-left)));
  padding: 7px 10px;
  border: 1px solid var(--request-recovery-border);
  border-radius: 12px;
  background: var(--request-recovery-surface);
  color: var(--request-recovery-text);
  box-shadow: 0 7px 20px rgba(15, 23, 42, 0.18);
  font-size: 0.76rem;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  animation: customer-request-launcher-preview-in 180ms ease-out 1;
}

.customer-request-launcher-preview::before {
  position: absolute;
  right: 100%;
  bottom: 10px;
  width: 8px;
  height: 8px;
  border-bottom: 1px solid var(--request-recovery-border);
  border-left: 1px solid var(--request-recovery-border);
  background: var(--request-recovery-surface);
  content: "";
  transform: translateX(5px) rotate(45deg);
}

@keyframes customer-request-launcher-preview-in {
  from { opacity: 0; transform: translateX(-5px) scale(0.96); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

.customer-request-launcher.is-pulsing {
  animation: customer-request-launcher-pulse 850ms ease-out 1;
}

@keyframes customer-request-launcher-pulse {
  0% { transform: scale(1); box-shadow: 0 7px 22px rgba(15, 23, 42, 0.24); }
  42% { transform: scale(1.12); box-shadow: 0 0 0 10px rgba(59, 130, 246, 0.18), 0 9px 26px rgba(15, 23, 42, 0.28); }
  100% { transform: scale(1); box-shadow: 0 7px 22px rgba(15, 23, 42, 0.24); }
}

.customer-request-reply-banner {
  margin: 0.45rem 0.5rem 0.55rem;
  border: 1px solid color-mix(in srgb, var(--request-recovery-accent) 48%, var(--request-recovery-border));
  border-radius: 14px;
  background: color-mix(in srgb, var(--request-recovery-accent) 9%, var(--request-recovery-surface));
  box-shadow: 0 7px 20px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  transition: margin 180ms ease, border-radius 180ms ease, box-shadow 180ms ease;
}

.customer-request-reply-banner.is-announcing {
  animation: customer-request-reply-banner-in 360ms ease-out 1;
}

.customer-request-reply-banner-link {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 64px;
  padding: 10px 12px;
  box-sizing: border-box;
  color: var(--request-recovery-text);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: min-height 180ms ease, padding 180ms ease, background 150ms ease;
}

.customer-request-reply-banner-link:hover,
.customer-request-reply-banner-link:focus-visible {
  background: color-mix(in srgb, var(--request-recovery-accent) 7%, transparent);
}

.customer-request-reply-banner-link:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--request-recovery-accent) 38%, transparent);
  outline-offset: -3px;
}

.customer-request-reply-banner-icon {
  position: relative;
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--request-recovery-accent);
  color: #fff;
}

.customer-request-reply-banner-icon svg {
  width: 21px;
  height: 21px;
}

.customer-request-reply-banner-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 11px;
  height: 11px;
  box-sizing: border-box;
  border: 2px solid var(--request-recovery-surface);
  border-radius: 50%;
  background: #e11d48;
}

.customer-request-reply-banner-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.customer-request-reply-banner-title {
  overflow: hidden;
  font-size: 0.86rem;
  font-weight: 750;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-request-reply-banner-preview {
  overflow: hidden;
  color: var(--request-recovery-muted);
  font-size: 0.77rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-request-reply-banner-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--request-recovery-accent);
  font-size: 0.76rem;
  font-weight: 750;
  white-space: nowrap;
}

.customer-request-reply-banner-action svg {
  width: 6px;
  height: 12px;
}

.customer-request-reply-banner.is-compact {
  margin-top: 0.25rem;
  margin-bottom: 0.35rem;
  border-radius: 11px;
  box-shadow: none;
}

.customer-request-reply-banner.is-compact .customer-request-reply-banner-link {
  min-height: 46px;
  padding-top: 5px;
  padding-bottom: 5px;
}

.customer-request-reply-banner.is-compact .customer-request-reply-banner-icon {
  width: 30px;
  height: 30px;
}

.customer-request-reply-banner.is-compact .customer-request-reply-banner-icon svg {
  width: 18px;
  height: 18px;
}

.customer-request-reply-banner.is-compact .customer-request-reply-banner-preview {
  display: none;
}

@keyframes customer-request-reply-banner-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.customer-requests-page {
  min-height: 100vh;
  margin: 0;
  padding: max(24px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  box-sizing: border-box;
  background: var(--request-recovery-bg);
  color: var(--request-recovery-text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.customer-requests-shell {
  width: min(100%, 620px);
  margin: 0 auto;
}

.customer-requests-header {
  margin: 2px 2px 25px;
}

.customer-requests-header h1 {
  margin: 0;
  color: var(--request-recovery-text);
  font-size: clamp(1.65rem, 7vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.customer-requests-header p {
  margin: 7px 0 0;
  color: var(--request-recovery-muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.customer-requests-state {
  display: flex;
  min-height: 210px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  padding: 28px 22px;
  box-sizing: border-box;
  border: 1px solid var(--request-recovery-border);
  border-radius: 18px;
  background: var(--request-recovery-surface);
  color: var(--request-recovery-muted);
  text-align: center;
}

.customer-requests-state h2,
.customer-requests-state p {
  margin: 0;
}

.customer-requests-state h2 {
  color: var(--request-recovery-text);
  font-size: 1.08rem;
}

.customer-requests-state p {
  max-width: 340px;
  line-height: 1.5;
}

.customer-requests-spinner {
  width: 24px;
  height: 24px;
  box-sizing: border-box;
  border: 3px solid color-mix(in srgb, var(--request-recovery-accent) 20%, var(--request-recovery-border));
  border-top-color: var(--request-recovery-accent);
  border-radius: 50%;
  animation: customer-request-spin 800ms linear infinite;
}

@keyframes customer-request-spin {
  to { transform: rotate(360deg); }
}

.customer-requests-empty-icon {
  width: 42px;
  height: 42px;
  color: var(--request-recovery-muted);
}

.customer-requests-empty-icon svg {
  width: 100%;
  height: 100%;
}

.customer-requests-retry {
  min-height: 44px;
  padding: 9px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--request-recovery-accent);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.customer-requests-context-empty {
  margin-bottom: 24px;
  padding: 15px 16px;
  border: 1px dashed var(--request-recovery-border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--request-recovery-surface) 82%, transparent);
  color: var(--request-recovery-muted);
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: center;
}

.customer-requests-group + .customer-requests-group {
  margin-top: 27px;
}

.customer-request-row-chat-window {
  color: var(--request-recovery-accent);
  font-size: 0.75rem;
  font-weight: 650;
}

.customer-requests-group > h2 {
  margin: 0 2px 10px;
  color: var(--request-recovery-muted);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.customer-requests-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.customer-requests-other {
  margin-top: 27px;
}

.customer-requests-other-toggle {
  display: grid;
  width: 100%;
  min-height: 54px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  padding: 13px 14px;
  border: 1px solid var(--request-recovery-border);
  border-radius: 15px;
  background: var(--request-recovery-surface);
  color: var(--request-recovery-text);
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 720;
  text-align: left;
}

.customer-requests-other-toggle:hover,
.customer-requests-other-toggle:focus-visible {
  border-color: color-mix(in srgb, var(--request-recovery-accent) 45%, var(--request-recovery-border));
}

.customer-requests-other-toggle:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--request-recovery-accent) 30%, transparent);
  outline-offset: 3px;
}

.customer-requests-other-unread {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--request-recovery-danger);
  font-size: 0.74rem;
  font-weight: 750;
  white-space: nowrap;
}

.customer-requests-other-unread-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #e11d48;
}

.customer-requests-other-chevron {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--request-recovery-muted);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: transform 150ms ease;
}

.customer-requests-other.is-expanded .customer-requests-other-chevron {
  transform: rotate(180deg);
}

.customer-requests-other-content {
  padding-top: 18px;
}

.customer-requests-other-content .customer-requests-group + .customer-requests-group {
  margin-top: 22px;
}

.customer-request-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  padding: 15px 14px;
  border: 1px solid var(--request-recovery-border);
  border-radius: 15px;
  background: var(--request-recovery-surface);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.customer-request-row-link {
  display: block;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.customer-request-row-link::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  content: "";
}

.customer-request-row-link:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--request-recovery-accent) 30%, transparent);
  outline-offset: 4px;
  border-radius: 8px;
}

.customer-request-row:has(.customer-request-row-link:focus-visible) {
  outline: 3px solid color-mix(in srgb, var(--request-recovery-accent) 30%, transparent);
  outline-offset: 2px;
}

.customer-request-row-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.customer-request-row-title {
  overflow: hidden;
  color: var(--request-recovery-text);
  font-size: 1rem;
  font-weight: 720;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-request-row-unread {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #e11d48;
}

.customer-request-row-band,
.customer-request-row-preview,
.customer-request-row-time {
  color: var(--request-recovery-muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.customer-request-row-preview {
  display: -webkit-box;
  margin-top: 7px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.customer-request-row-meta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 9px;
}

.customer-request-row-status {
  padding: 4px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--request-recovery-accent) 11%, transparent);
  color: var(--request-recovery-accent);
  font-size: 0.7rem;
  font-weight: 750;
  text-transform: capitalize;
}

@media (max-width: 420px) {
  .customer-request-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .customer-request-row-meta {
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
  }
}

@media (prefers-reduced-motion: reduce) {
  .customer-request-launcher,
  .customer-request-launcher.is-pulsing,
  .customer-request-launcher-preview,
  .customer-request-reply-banner,
  .customer-request-reply-banner.is-announcing,
  .customer-request-reply-banner-link,
  .customer-requests-other-chevron,
  .customer-requests-spinner {
    animation: none;
    transition: none;
  }
}
