/** Washer — clean laundry assistant UI */
.washer-root {
  --w-blue: #0f74ff;
  --w-blue-deep: #0a5ad6;
  --w-navy: #08224e;
  --w-foam: #eef5ff;
  --w-mist: #f7f9fc;
  --w-line: rgba(8, 34, 78, 0.09);
  --w-ok: #0d9f6e;
  --w-ok-bg: #e8faf3;
  --w-warn: #b86a00;
  --w-warn-bg: #fff7e8;
  --w-muted: #667892;
  --w-shadow: 0 20px 48px rgba(8, 34, 78, 0.18);
  font-family: Outfit, system-ui, sans-serif;
  z-index: 9990;
  color: var(--w-navy);
}

/* —— FAB —— */
.washer-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9991;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 8px;
  border: none;
  border-radius: 999px;
  background: #fff;
  color: var(--w-navy);
  font: inherit;
  font-weight: 750;
  font-size: 14px;
  letter-spacing: -0.02em;
  box-shadow:
    0 10px 28px rgba(8, 34, 78, 0.16),
    0 0 0 1px var(--w-line);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.washer-fab:hover {
  transform: translateY(-2px);
  box-shadow:
    0 14px 32px rgba(15, 116, 255, 0.2),
    0 0 0 1px rgba(15, 116, 255, 0.25);
}

.washer-fab.is-open {
  background: var(--w-navy);
  color: #fff;
  box-shadow: 0 10px 24px rgba(8, 34, 78, 0.28);
}

.washer-fab-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(15, 116, 255, 0.25);
}

.washer-fab.is-open .washer-fab-logo {
  display: none;
}

.washer-fab-x {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
}

.washer-fab.is-open .washer-fab-x {
  display: grid;
}

.washer-fab-x svg {
  width: 18px;
  height: 18px;
}

/* —— Backdrop —— */
.washer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9990;
  background: rgba(4, 18, 36, 0.28);
  border: 0;
  padding: 0;
  cursor: pointer;
}

/* —— Panel —— */
.washer-panel {
  position: fixed;
  right: 18px;
  bottom: 78px;
  z-index: 9992;
  width: min(392px, calc(100vw - 28px));
  height: min(620px, calc(100vh - 104px));
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 22px;
  box-shadow: var(--w-shadow);
  overflow: hidden;
  animation: washer-panel-in 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.washer-panel[hidden] {
  display: none !important;
}

@keyframes washer-panel-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.washer-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 12px;
  background: #fff;
  border-bottom: 1px solid var(--w-line);
}

.washer-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(15, 116, 255, 0.22);
}

.washer-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.washer-head-copy {
  min-width: 0;
  flex: 1;
}

.washer-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--w-navy);
}

.washer-online {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 3px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--w-muted);
}

.washer-online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.washer-close {
  border: none;
  background: var(--w-mist);
  color: var(--w-navy);
  width: 34px;
  height: 34px;
  border-radius: 11px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.washer-close:hover {
  background: var(--w-foam);
}

/* —— Messages —— */
.washer-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--w-mist);
  scroll-behavior: smooth;
}

.washer-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  max-width: 100%;
  animation: washer-msg-in 0.22s ease both;
}

.washer-row--user { justify-content: flex-end; }
.washer-row--meta { justify-content: center; }

@keyframes washer-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.washer-mini-avatar {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(15, 116, 255, 0.18);
}

.washer-mini-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.washer-bubble {
  max-width: min(292px, 84%);
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.48;
  letter-spacing: -0.01em;
}

.washer-bubble--bot {
  background: #fff;
  border: 1px solid var(--w-line);
  color: var(--w-navy);
  border-bottom-left-radius: 5px;
}

.washer-bubble--user {
  background: var(--w-blue);
  color: #fff;
  border-bottom-right-radius: 5px;
}

.washer-bubble--meta {
  max-width: none;
  padding: 5px 11px;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--w-muted);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--w-line);
  border-radius: 999px;
}

.washer-bubble-title {
  display: block;
  margin: 0 0 3px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--w-blue);
}

.washer-bubble-body {
  white-space: pre-wrap;
}

/* —— Cards —— */
.washer-card {
  max-width: min(308px, 90%);
  width: 100%;
  background: #fff;
  border: 1px solid var(--w-line);
  border-radius: 16px;
  overflow: hidden;
  animation: washer-msg-in 0.22s ease both;
}

.washer-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 0;
}

.washer-card-logo {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  object-fit: cover;
  flex-shrink: 0;
}

.washer-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--w-foam);
  color: var(--w-blue);
}

.washer-card-icon svg { width: 17px; height: 17px; }
.washer-card-icon--ok { background: var(--w-ok-bg); color: var(--w-ok); }
.washer-card-icon--warn { background: var(--w-warn-bg); color: var(--w-warn); }

.washer-card-head strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.washer-card-head span {
  display: block;
  font-size: 12px;
  color: var(--w-muted);
  font-weight: 600;
  margin-top: 1px;
}

.washer-card-body {
  padding: 10px 12px 14px;
  font-size: 13.5px;
  line-height: 1.48;
}

.washer-badge {
  display: inline-flex;
  margin-top: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 750;
}

.washer-badge--ok { background: var(--w-ok-bg); color: var(--w-ok); }
.washer-badge--warn { background: var(--w-warn-bg); color: var(--w-warn); }

.washer-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.washer-steps li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

.washer-step-num {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: var(--w-blue);
}

/* —— Welcome —— */
.washer-welcome-lead {
  margin: 0 0 12px;
  font-size: 13.5px;
  line-height: 1.48;
  color: var(--w-navy);
}

.washer-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.washer-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 11px;
  border: 1px solid var(--w-line);
  border-radius: 12px;
  background: var(--w-mist);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.washer-tile:hover {
  border-color: rgba(15, 116, 255, 0.4);
  background: #fff;
}

.washer-tile-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--w-blue);
  border: 1px solid var(--w-line);
}

.washer-tile-icon svg { width: 14px; height: 14px; }

.washer-tile strong {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--w-navy);
}

.washer-tile span {
  font-size: 11px;
  color: var(--w-muted);
  font-weight: 600;
  line-height: 1.25;
}

/* —— Order tracking —— */
.washer-order-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(308px, 90%);
  width: 100%;
}

.washer-order-card {
  background: #fff;
  border: 1px solid var(--w-line);
  border-radius: 16px;
  padding: 12px;
  animation: washer-msg-in 0.22s ease both;
}

.washer-order-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.washer-order-id {
  margin: 0;
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.washer-order-svc {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--w-muted);
  font-weight: 600;
}

.washer-order-status {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 750;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--w-foam);
  color: var(--w-blue-deep);
}

.washer-order-status.is-done {
  background: var(--w-ok-bg);
  color: var(--w-ok);
}

.washer-order-status.is-cancel {
  background: #fde8e8;
  color: #c0392b;
}

.washer-order-note {
  margin: 0 0 10px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--w-navy);
}

.washer-order-meta {
  margin: 0;
  font-size: 11.5px;
  color: var(--w-muted);
  font-weight: 600;
}

.washer-pipeline {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 10px 0 4px;
  padding: 0 2px;
}

.washer-pipe-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d5deeb;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.washer-pipe-dot.is-done,
.washer-pipe-dot.is-current {
  background: var(--w-blue);
}

.washer-pipe-dot.is-current {
  box-shadow: 0 0 0 3px rgba(15, 116, 255, 0.22);
}

.washer-pipe-line {
  flex: 1;
  height: 2px;
  background: #d5deeb;
  min-width: 8px;
}

.washer-pipe-line.is-done {
  background: var(--w-blue);
}

.washer-pipe-labels {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin-top: 4px;
}

.washer-pipe-labels span {
  font-size: 9.5px;
  font-weight: 700;
  color: #9aa8bd;
  flex: 1;
  text-align: center;
  line-height: 1.2;
}

.washer-pipe-labels span.is-on {
  color: var(--w-blue-deep);
}

.washer-order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.washer-order-actions button {
  border: 1px solid var(--w-line);
  background: var(--w-mist);
  color: var(--w-navy);
  border-radius: 999px;
  padding: 5px 10px;
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.washer-typing {
  display: inline-flex;
  gap: 4px;
  padding: 11px 13px;
  background: #fff;
  border: 1px solid var(--w-line);
  border-radius: 14px;
  border-bottom-left-radius: 5px;
}

.washer-typing i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #94a3b8;
  animation: washer-dot 1.1s ease-in-out infinite;
}

.washer-typing i:nth-child(2) { animation-delay: 0.15s; }
.washer-typing i:nth-child(3) { animation-delay: 0.3s; }

@keyframes washer-dot {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
  40% { transform: translateY(-3px); opacity: 1; }
}

/* —— Composer —— */
.washer-composer {
  background: #fff;
  border-top: 1px solid var(--w-line);
  padding: 10px 12px 12px;
}

.washer-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 0 0 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.washer-chips::-webkit-scrollbar { display: none; }

.washer-chip {
  flex-shrink: 0;
  border: 1px solid var(--w-line);
  background: #fff;
  color: var(--w-navy);
  border-radius: 999px;
  padding: 6px 11px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.washer-chip:hover:not(:disabled) {
  border-color: rgba(15, 116, 255, 0.45);
  color: var(--w-blue-deep);
  background: var(--w-foam);
}

.washer-chip:disabled { opacity: 0.45; cursor: default; }

.washer-chip--accent {
  background: var(--w-blue);
  border-color: transparent;
  color: #fff;
}

.washer-chip--accent:hover:not(:disabled) {
  background: var(--w-blue-deep);
  color: #fff;
}

.washer-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.washer-form input {
  flex: 1;
  border: 1px solid var(--w-line);
  border-radius: 12px;
  padding: 11px 13px;
  font: inherit;
  font-size: 14px;
  background: var(--w-mist);
  color: var(--w-navy);
  outline: none;
}

.washer-form input:focus {
  border-color: rgba(15, 116, 255, 0.5);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15, 116, 255, 0.1);
}

.washer-form button[type='submit'] {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 12px;
  background: var(--w-blue);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.washer-form button[type='submit']:hover:not(:disabled) {
  background: var(--w-blue-deep);
}

.washer-form button[type='submit']:disabled {
  opacity: 0.4;
  cursor: default;
}

.washer-form button[type='submit'] svg {
  width: 17px;
  height: 17px;
}

.washer-disclaimer {
  margin: 8px 0 0;
  font-size: 10.5px;
  line-height: 1.35;
  color: #8b9bb3;
  text-align: center;
}

@media (max-width: 480px) {
  .washer-panel {
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    height: min(92vh, 720px);
    border-radius: 20px 20px 0 0;
  }

  .washer-fab-label { display: none; }

  .washer-fab {
    padding: 8px;
    right: 14px;
    bottom: 14px;
  }

  .washer-fab.is-open .washer-fab-label { display: none; }
}

@media (min-width: 481px) {
  .washer-backdrop { display: none; }
}
