/* ═══════════════════════════════════════════════════
   SCREEN-SPECIFIC STYLES
   ═══════════════════════════════════════════════════ */

/* ── Splash ── */
.phone-shell--dark .phone-content {
  background: linear-gradient(160deg, var(--ink-900) 0%, var(--ink-800) 50%, var(--ink-900) 100%);
}

/* ── Dashboard ── */
.phone-shell .phone-content[style*="background:#0F0F17"] {
  background: #0F0F17;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  /* Demo frame only — the PWA shell is sized by app-mode.css. */
  #app.demo-wrapper .phone-shell {
    width: 100%;
    height: 100dvh;
    border-radius: 0;
  }
}

/* ── Booking time proposal (customer) ─────────────── */
.booking-proposal {
  margin: 12px 0; padding: 13px 13px 12px; border-radius: 14px;
  border: 1px solid var(--primary-border, var(--primary));
  background: linear-gradient(145deg, var(--primary-surface), var(--surface));
}
.booking-proposal--waiting {
  border-color: var(--border); background: var(--surface-2, var(--surface));
}
.booking-proposal__eyebrow {
  font-size: 9.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--primary);
}
.booking-proposal--waiting .booking-proposal__eyebrow { color: var(--text-3); }
.booking-proposal__title { margin-top: 3px; font-size: 15px; font-weight: 700; color: var(--text); }
.booking-proposal__body { margin-top: 4px; font-size: 12px; line-height: 1.5; color: var(--text-2); }
.booking-proposal__slots { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.booking-proposal__slot {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  flex: 1 1 42%; min-height: 52px; padding: 8px 11px; border-radius: 11px;
  border: 1px solid var(--primary); background: var(--primary); color: #fff;
  font-family: inherit; text-align: left; cursor: pointer;
}
.booking-proposal__slot span { font-size: 14px; font-weight: 750; }
.booking-proposal__slot em { font-size: 9.5px; font-style: normal; opacity: .8; }
.booking-proposal__slot--static {
  flex: 0 0 auto; min-height: 0; background: var(--surface); color: var(--text);
  border-color: var(--border); cursor: default; padding: 8px 11px;
}
.booking-proposal__slot--static { font-size: 13px; font-weight: 700; }
.booking-proposal__note { margin-top: 9px; font-size: 12px; font-style: italic; color: var(--text-2); }
.booking-proposal__actions { display: flex; gap: 8px; margin-top: 11px; flex-wrap: wrap; }
.booking-proposal__ghost {
  flex: 1 1 42%; min-height: 40px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-family: inherit; font-size: 11.5px;
  font-weight: 650; cursor: pointer; padding: 8px 10px;
}

/* ── Messages: header shortcut ─────────────────────── */
.messages-head-btn {
  position: relative; width: 42px; height: 42px; flex-shrink: 0; display: grid; place-items: center;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer;
}
.messages-head-btn__badge {
  position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px;
  display: grid; place-items: center; border-radius: 99px; background: var(--primary); color: #fff;
  border: 2px solid var(--bg); font-size: 9px; font-weight: 800;
}

/* ── Messages: list and thread ─────────────────────── */
.chat-list { padding: 0 16px 20px; display: flex; flex-direction: column; gap: 8px; }
.chat-unread-pill {
  flex-shrink: 0; border-radius: 99px; background: var(--primary-surface); color: var(--primary);
  padding: 5px 9px; font-size: 10.5px; font-weight: 750;
}
.chat-conversation {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 12px; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface); font-family: inherit; cursor: pointer;
}
.chat-conversation__avatar {
  width: 42px; height: 42px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary-surface); color: var(--primary); font-size: 16px; font-weight: 750;
}
.chat-conversation__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.chat-conversation__top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.chat-conversation__top b { font-size: 13.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-conversation__top em { flex-shrink: 0; font-size: 9.5px; font-style: normal; color: var(--text-3); }
.chat-conversation__preview { font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-conversation__badge {
  flex-shrink: 0; min-width: 19px; height: 19px; padding: 0 5px; display: grid; place-items: center;
  border-radius: 99px; background: var(--primary); color: #fff; font-size: 9.5px; font-weight: 800;
}
.chat-page { display: flex; flex-direction: column; min-height: calc(100dvh - 145px); }
.chat-head {
  position: sticky; top: 0; z-index: 12; display: flex; align-items: center; gap: 10px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px; background: rgba(251, 249, 248, .96);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.chat-head__back {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); display: grid; place-items: center; cursor: pointer;
}
.chat-head__avatar {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 12px; background: var(--primary-surface);
  color: var(--primary); display: grid; place-items: center; font-size: 15px; font-weight: 750;
}
.chat-head__copy { flex: 1; min-width: 0; }
.chat-head__name { font-size: 15px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head__sub { margin-top: 1px; font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head__call {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; background: var(--success-surface, var(--successS));
  color: var(--success); display: grid; place-items: center; text-decoration: none;
}
.chat-head__safety { border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); cursor: pointer; }
.chat-thread {
  flex: 1; display: flex; flex-direction: column; gap: 7px;
  padding: 14px 16px 10px; min-height: 220px;
}
.chat-thread > :first-child { margin-top: auto; }
.chat-day { align-self: center; margin: 6px 0 2px; font-size: 9.5px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.chat-bubble {
  max-width: 82%; padding: 9px 12px; border-radius: 16px; font-size: 13.5px;
  line-height: 1.45; overflow-wrap: anywhere;
}
.chat-bubble--mine { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 5px; }
.chat-bubble--theirs { align-self: flex-start; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.chat-bubble__name { font-size: 9.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; opacity: .6; margin-bottom: 3px; }
.chat-bubble__body { white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-bubble__foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.chat-bubble__meta { font-size: 9px; opacity: .62; text-align: right; }
.chat-bubble__report {
  padding: 0; border: 0; background: none; color: var(--text-3); font-family: inherit;
  font-size: 9px; font-weight: 700; cursor: pointer; text-decoration: underline;
}
.chat-bubble--mine .chat-bubble__report { color: rgba(255,255,255,.75); }
.chat-safety-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 14px 8px; padding: 9px 11px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--surface-2); color: var(--text-2);
  font-size: 10.5px; line-height: 1.4;
}
.chat-safety-banner span { display: flex; align-items: center; gap: 6px; }
.chat-safety-banner button {
  flex-shrink: 0; min-height: 28px; padding: 0 10px; border: 1px solid var(--primary);
  border-radius: 999px; background: var(--surface); color: var(--primary);
  font-family: inherit; font-size: 10px; font-weight: 750; cursor: pointer;
}
.chat-composer {
  position: sticky; bottom: calc(var(--app-nav-height, 78px) + env(safe-area-inset-bottom, 0px) + 4px); z-index: 11; display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 12px; background: rgba(251, 249, 248, .97);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
}
.chat-composer textarea {
  flex: 1; min-height: 42px; max-height: 112px; resize: none; box-sizing: border-box;
  padding: 11px 13px; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface); color: var(--text); font-family: inherit; font-size: 13.5px; line-height: 1.4;
}
.chat-composer.is-blocked textarea { background: var(--surface-2); color: var(--text-3); }
.chat-send {
  width: 42px; height: 42px; flex-shrink: 0; border: 0; border-radius: 50%;
  background: var(--primary); display: grid; place-items: center; cursor: pointer;
}
.chat-send:disabled { opacity: .55; }
.chat-empty {
  margin: auto; display: flex; flex-direction: column; align-items: center; gap: 5px;
  text-align: center; padding: 38px 20px; color: var(--text-3);
}
.chat-empty b { font-size: 14px; color: var(--text-2); }
.chat-empty span { max-width: 240px; font-size: 11.5px; line-height: 1.5; }
.chat-loading { padding: 30px 16px; text-align: center; font-size: 12px; color: var(--text-3); }
.chat-retry { border: 0; background: none; color: var(--primary); font-family: inherit; font-weight: 700; cursor: pointer; padding: 4px; }
