/* ==========================================================================
   Doodad Dude — Floating Virtual Phone Drawer Styles (phone-widget.css)
   Anchored bottom-left, iOS/mobile phone frame physics, WebRTC & SMS views.
   ========================================================================== */

:root {
  --pw-bg:             #0d0e12;
  --pw-card:           rgba(255, 255, 255, 0.05);
  --pw-card-hover:     rgba(255, 255, 255, 0.09);
  --pw-card-active:    rgba(255, 255, 255, 0.12);
  --pw-accent:         var(--orange, #FF6B00);
  --pw-accent-glow:    rgba(255, 107, 0, 0.28);
  --pw-accent-subtle:  rgba(255, 107, 0, 0.12);
  --pw-green:          #30D158;
  --pw-red:            #FF453A;
  --pw-blue:           #007AFF;
  --pw-text:           #f5f5f7;
  --pw-text-dim:       rgba(255, 255, 255, 0.65);
  --pw-text-muted:     rgba(255, 255, 255, 0.38);
  --pw-border:         rgba(255, 255, 255, 0.09);
  --pw-border-hi:      rgba(255, 255, 255, 0.16);
  --pw-shadow:         0 24px 60px rgba(0, 0, 0, 0.65), 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* ──────────────────────────────────────────────────────────
   1. LAUNCHER PILL (LOWER-RIGHT FLOATING WIDGET)
   ────────────────────────────────────────────────────────── */
#pwLauncher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  left: auto;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 10px;
  width: auto !important;
  max-width: 240px !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
  background: rgba(18, 20, 26, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--pw-border-hi);
  border-radius: 9999px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.06);
  color: var(--pw-text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  cursor: pointer;
  user-select: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s, box-shadow 0.2s, left 0.3s ease;
}

#pwLauncher.pw-sidebar-shifted,
#pwNotifyCustomerFloater.pw-sidebar-shifted,
#pwCanvas.pw-sidebar-shifted {
  transform: translateX(250px) !important;
}

/* ──────────────────────────────────────────────────────────
   1b. CUSTOMER SMS ARRIVAL FLOATER (Beside Phone Launcher)
   ────────────────────────────────────────────────────────── */
#pwNotifyCustomerFloater {
  position: fixed;
  bottom: 24px;
  right: calc(24px + 235px + 14px);
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 12px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1.5px solid #00d2ff;
  border-radius: 9999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 210, 255, 0.35);
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  cursor: pointer;
  user-select: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s, opacity 0.25s;
  animation: pwPulseGlow 2.5s infinite ease-in-out;
}

#pwNotifyCustomerFloater:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.7), 0 0 30px rgba(0, 210, 255, 0.55);
  border-color: #38bdf8;
}

#pwNotifyCustomerFloater:active {
  transform: translateY(0) scale(0.98);
}

.pw-ncf-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00d2ff 0%, #0284c7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  box-shadow: 0 4px 12px rgba(0, 210, 255, 0.4);
  flex-shrink: 0;
}

.pw-ncf-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  white-space: nowrap;
}

.pw-ncf-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.pw-ncf-sub {
  font-size: 0.72rem;
  color: #7dd3fc;
  font-weight: 500;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pw-ncf-dismiss {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #94a3b8;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s;
  margin-left: 4px;
  flex-shrink: 0;
}

.pw-ncf-dismiss:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

@keyframes pwPulseGlow {
  0%, 100% {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 16px rgba(0, 210, 255, 0.25);
  }
  50% {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 28px rgba(0, 210, 255, 0.5);
  }
}

@media (max-width: 768px) {
  #pwNotifyCustomerFloater {
    bottom: 84px;
    right: 20px;
    left: auto;
  }
}

#pwLauncher:hover {
  transform: translateY(-2px) scale(1.02);
  background: rgba(28, 32, 42, 0.95);
  box-shadow: 0 14px 38px rgba(0,0,0,0.6), 0 0 20px var(--pw-accent-glow);
  border-color: rgba(255, 107, 0, 0.4);
}

#pwLauncher:active {
  transform: translateY(0) scale(0.98);
}

.pw-launcher-icon-wrap {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pw-accent), #e05500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px var(--pw-accent-glow);
  flex-shrink: 0;
}

.pw-launcher-status-dot {
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--pw-green);
  border: 2px solid #12141a;
  transition: background 0.3s;
}
.pw-launcher-status-dot.offline { background: var(--pw-red); }
.pw-launcher-status-dot.connecting { background: #FFD60A; }
.pw-launcher-status-dot.in-call {
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pwPulseDot 1s infinite ease-in-out;
}

.pw-launcher-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 140px;
  overflow: hidden;
}

.pw-launcher-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pw-launcher-sub {
  font-size: 0.68rem;
  color: var(--pw-text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pw-badge-count {
  background: var(--pw-red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  display: inline-block;
}

.pw-launcher-badges {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

.pw-notif-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 1px 5px;
  font-size: 0.65rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
}
.pw-notif-pill.sms { background: rgba(0, 122, 255, 0.25); border-color: rgba(0, 122, 255, 0.4); }
.pw-notif-pill.missed { background: rgba(255, 69, 58, 0.25); border-color: rgba(255, 69, 58, 0.4); }
.pw-notif-pill.vm { background: rgba(255, 159, 10, 0.25); border-color: rgba(255, 159, 10, 0.4); }

/* ──────────────────────────────────────────────────────────
   INCOMING CALL VISUAL ALERTS: RADAR PULSE & HAPTIC SHAKE
   ────────────────────────────────────────────────────────── */
@keyframes radar-pulse {
  0% {
    transform: scale(0.9);
    opacity: 0.8;
  }
  50% {
    opacity: 0.4;
  }
  100% {
    transform: scale(2.3);
    opacity: 0;
  }
}

@keyframes phone-buzz {
  0%, 100% { transform: rotate(0deg); }
  10%, 30%, 50%, 70%, 90% { transform: rotate(-9deg) translateX(-1px); }
  20%, 40%, 60%, 80% { transform: rotate(9deg) translateX(1px); }
}

#pwLauncher.ringing {
  border-color: var(--pw-green);
  box-shadow: 0 0 25px rgba(48, 209, 88, 0.5);
  animation: phone-buzz 1.2s infinite ease-in-out;
}

#pwLauncher.ringing .pw-launcher-icon-wrap {
  background: linear-gradient(135deg, var(--pw-green), #249742);
}

#pwLauncher .pw-radar-ring {
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  border-radius: 9999px;
  border: 2px solid var(--pw-green);
  pointer-events: none;
  opacity: 0;
}

#pwLauncher.ringing .pw-radar-ring:nth-child(1) {
  animation: radar-pulse 1.8s infinite cubic-bezier(0.2, 0.8, 0.4, 1);
}
#pwLauncher.ringing .pw-radar-ring:nth-child(2) {
  animation: radar-pulse 1.8s infinite 0.6s cubic-bezier(0.2, 0.8, 0.4, 1);
}

/* ──────────────────────────────────────────────────────────
   2. PHONE CANVAS DRAWER (SLIDE-OUT REALISTIC PHONE SHELL)
   ────────────────────────────────────────────────────────── */
#pwCanvas {
  position: fixed;
  bottom: 24px;
  right: 24px;
  left: auto;
  width: 380px;
  height: 680px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  z-index: 10000;
  background: var(--pw-bg);
  border: 1px solid var(--pw-border-hi);
  border-radius: 38px;
  box-shadow: var(--pw-shadow), 0 0 0 1px rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  color: var(--pw-text);
  transform: translateY(110%) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1), opacity 260ms ease;
}

#pwCanvas.active {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* Speaker Notch & Drag Indicator */
.pw-phone-top {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 8px;
  user-select: none;
  touch-action: none;
  cursor: grab;
}
.pw-phone-top:active { cursor: grabbing; }

.pw-drag-pill {
  width: 50px;
  height: 6px;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 4px;
  cursor: grab;
  touch-action: none;
  transition: background 0.2s, transform 0.15s;
  margin-bottom: 2px;
}
.pw-drag-pill:hover { background: rgba(255, 255, 255, 0.8); transform: scaleY(1.3); }
.pw-drag-pill:active { cursor: grabbing; background: var(--pw-accent); }

.pw-dynamic-island {
  width: 90px;
  height: 20px;
  background: #000;
  border-radius: 20px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pw-camera-lens {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0f172a;
  border: 1px solid #1e293b;
}

/* Status Bar */
.pw-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 18px 8px 18px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--pw-text);
  user-select: none;
}
.pw-status-left { font-variant-numeric: tabular-nums; }
.pw-status-right { display: flex; align-items: center; gap: 8px; font-size: 0.72rem; }

.pw-top-actions {
  position: absolute;
  top: 8px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 10;
}

.pw-action-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--pw-text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  transition: background 0.2s, color 0.2s, transform 0.15s;
  padding: 0;
}
.pw-action-btn:hover { background: rgba(255, 255, 255, 0.2); color: #fff; transform: scale(1.05); }
.pw-action-btn:active { transform: scale(0.95); }

.pw-action-btn.pw-guides-shortcut {
  width: auto;
  border-radius: 12px;
  padding: 0 8px;
  gap: 3px;
  background: rgba(0, 210, 255, 0.15);
  border: 1px solid rgba(0, 210, 255, 0.35);
  color: var(--cyan, #00d2ff);
  font-weight: 700;
  font-size: 0.68rem;
  display: inline-flex;
}
.pw-action-btn.pw-guides-shortcut:hover {
  background: rgba(0, 210, 255, 0.28);
  border-color: #00d2ff;
  color: #fff;
}
.pw-launcher-guides-btn {
  background: rgba(0, 210, 255, 0.18);
  border: 1px solid rgba(0, 210, 255, 0.4);
  color: #00d2ff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pw-launcher-guides-btn:hover {
  background: rgba(0, 210, 255, 0.35);
  color: #fff;
  transform: scale(1.05);
}

/* Large mode: 25% larger than normal 380x680 => 475px x 850px */
#pwCanvas.pw-size-large {
  width: 475px;
  height: 850px;
}

/* ──────────────────────────────────────────────────────────
   DYNAMIC TEXT RESIZING (aA BUTTON)
   ────────────────────────────────────────────────────────── */
#pwCanvas.pw-font-small {
  --pw-font-scale: 0.82;
  font-size: 0.82em;
}
#pwCanvas.pw-font-small .pw-dialer-number { font-size: 1.4rem; }
#pwCanvas.pw-font-small .pw-view-title { font-size: 0.85rem; }
#pwCanvas.pw-font-small .pw-bubble { font-size: 0.72rem; }
#pwCanvas.pw-font-small .pw-thread-name { font-size: 0.75rem; }
#pwCanvas.pw-font-small .pw-thread-snippet { font-size: 0.68rem; }

#pwCanvas.pw-font-large {
  --pw-font-scale: 1.2;
  font-size: 1.15em;
}
#pwCanvas.pw-font-large .pw-dialer-number { font-size: 2.1rem; }
#pwCanvas.pw-font-large .pw-view-title { font-size: 1.2rem; }
#pwCanvas.pw-font-large .pw-bubble { font-size: 0.96rem; }
#pwCanvas.pw-font-large .pw-thread-name { font-size: 1rem; }
#pwCanvas.pw-font-large .pw-thread-snippet { font-size: 0.86rem; }
#pwCanvas.pw-font-large .pw-key-digit { font-size: 1.45rem; }
#pwCanvas.pw-font-large .pw-key-letters { font-size: 0.65rem; }

#pwFontScaleBtn {
  font-weight: 700;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  letter-spacing: -0.05em;
}

/* App Host (Main Screen Viewport) */
.pw-app-host {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.pw-view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--pw-bg);
  opacity: 0;
  pointer-events: none;
  transform: translateX(20px);
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

.pw-view.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

/* View Header */
.pw-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--pw-border);
  background: rgba(13, 14, 18, 0.95);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 5;
}
.pw-view-title { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.02em; }

/* Bottom Nav Bar (iOS Tab Bar) */
.pw-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 12px 14px 12px;
  background: rgba(18, 20, 26, 0.95);
  border-top: 1px solid var(--pw-border);
  backdrop-filter: blur(16px);
  user-select: none;
  flex-shrink: 0;
  position: relative;
  z-index: 30;
}

.pw-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--pw-text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 10px;
  transition: color 0.15s, transform 0.15s;
  position: relative;
}
.pw-nav-item:hover { color: var(--pw-text-dim); }
.pw-nav-item.active { color: var(--pw-accent); }
.pw-nav-item.active .pw-nav-icon { transform: scale(1.08); }

.pw-nav-icon { font-size: 1.15rem; transition: transform 0.2s; }
.pw-nav-label { font-size: 0.65rem; font-weight: 600; }

.pw-nav-badge {
  position: absolute;
  top: 2px;
  right: 10px;
  background: var(--pw-red);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 8px;
}

/* ──────────────────────────────────────────────────────────
   3. APP 1: MESSAGES (SMS / CHAT HUB)
   ────────────────────────────────────────────────────────── */
#pwViewMessages {
  display: flex;
  flex-direction: column;
}

/* Thread List View */
.pw-thread-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}

.pw-thread-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.15s;
}
.pw-thread-item:hover { background: var(--pw-card); }
.pw-thread-item.unread .pw-thread-name { font-weight: 700; color: #fff; }

.pw-thread-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2c3240, #1a1e28);
  border: 1px solid var(--pw-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--pw-accent);
  flex-shrink: 0;
}

.pw-thread-content {
  flex: 1;
  min-width: 0;
}
.pw-thread-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}
.pw-thread-name {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pw-thread-time {
  font-size: 0.68rem;
  color: var(--pw-text-muted);
  flex-shrink: 0;
}
.pw-thread-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pw-thread-snippet {
  font-size: 0.75rem;
  color: var(--pw-text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Conversation View */
#pwConversationView {
  position: absolute;
  inset: 0;
  background: var(--pw-bg);
  display: flex;
  flex-direction: column;
  z-index: 10;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
#pwConversationView.active { transform: translateX(0); }

.pw-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--pw-border);
  background: rgba(18, 20, 26, 0.95);
  backdrop-filter: blur(12px);
}
.pw-chat-header-info {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.pw-chat-contact-name { font-size: 0.88rem; font-weight: 700; }
.pw-chat-contact-phone { font-size: 0.68rem; color: var(--pw-text-dim); }

.pw-chat-bubbles {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pw-bubble-wrap {
  display: flex;
  flex-direction: column;
  max-width: 80%;
}
.pw-bubble-wrap.inbound {
  align-self: flex-start;
}
.pw-bubble-wrap.outbound {
  align-self: flex-end;
  align-items: flex-end;
}

.pw-bubble {
  padding: 9px 13px;
  border-radius: 18px;
  font-size: 0.82rem;
  line-height: 1.4;
  word-break: break-word;
}
.pw-bubble-wrap.inbound .pw-bubble {
  background: rgba(255, 255, 255, 0.08);
  color: var(--pw-text);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--pw-border);
}
.pw-bubble-wrap.outbound .pw-bubble {
  background: linear-gradient(135deg, var(--pw-accent), #e25700);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px var(--pw-accent-glow);
}

.pw-bubble-time {
  font-size: 0.62rem;
  color: var(--pw-text-muted);
  margin-top: 3px;
  padding: 0 4px;
}

/* Chat Input Bar */
.pw-chat-input-bar {
  display: flex;
  flex-direction: column;
  padding: 8px 12px 10px 12px;
  border-top: 1px solid var(--pw-border);
  background: rgba(18, 20, 26, 0.95);
  gap: 6px;
}

.pw-template-select-bar {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pw-template-dropdown {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--pw-border);
  border-radius: 8px;
  color: var(--pw-text-dim);
  font-size: 0.72rem;
  padding: 4px 8px;
  outline: none;
  cursor: pointer;
}
.pw-template-dropdown option { background: #1a1e28; color: #fff; }

.pw-chat-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pw-chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--pw-border);
  border-radius: 20px;
  padding: 8px 14px;
  color: #fff;
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.pw-chat-input:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--pw-accent);
}

.pw-chat-send-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--pw-accent);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s;
  flex-shrink: 0;
}
.pw-chat-send-btn:hover { transform: scale(1.06); }
.pw-chat-send-btn:active { transform: scale(0.95); }

/* ──────────────────────────────────────────────────────────
   4. APP 2: PHONE (DIALER, CALL LOGS & AUDIO MANAGER)
   ────────────────────────────────────────────────────────── */
#pwViewPhone {
  display: flex;
  flex-direction: column;
}

.pw-phone-subnav {
  display: flex;
  padding: 6px 14px;
  gap: 8px;
  border-bottom: 1px solid var(--pw-border);
  background: rgba(13, 14, 18, 0.85);
}
.pw-subnav-pill {
  flex: 1;
  padding: 6px 0;
  text-align: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--pw-border);
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--pw-text-dim);
  cursor: pointer;
  transition: all 0.15s;
}
.pw-subnav-pill.active {
  background: var(--pw-accent-subtle);
  border-color: var(--pw-accent);
  color: var(--pw-accent);
}

/* Sub-Tab 1: Keypad / Dialer */
.pw-dialer-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  justify-content: space-between;
}

.pw-dialer-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 52px;
  justify-content: center;
  position: relative;
}
.pw-dialer-number {
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  border: none;
  background: none;
  color: #fff;
  text-align: center;
  width: 100%;
  outline: none;
}
.pw-dialer-name {
  font-size: 0.72rem;
  color: var(--pw-accent);
  margin-top: 2px;
  min-height: 16px;
}
.pw-dialer-backspace {
  position: absolute;
  right: 6px;
  top: 14px;
  background: none;
  border: none;
  color: var(--pw-text-dim);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.15s;
}
.pw-dialer-backspace:hover { color: #fff; }

/* 12-Button Keypad */
.pw-keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 10px 10px;
}

.pw-key-btn {
  aspect-ratio: 1;
  max-width: 68px;
  margin: 0 auto;
  width: 100%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--pw-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: transform 0.1s, background 0.15s;
  user-select: none;
}
.pw-key-btn:hover { background: rgba(255, 255, 255, 0.15); }
.pw-key-btn:active { transform: scale(0.92); background: rgba(255, 255, 255, 0.22); }
.pw-key-digit { font-size: 1.35rem; font-weight: 500; line-height: 1; }
.pw-key-letters { font-size: 0.55rem; font-weight: 700; color: var(--pw-text-muted); letter-spacing: 1.5px; margin-top: 2px; }

.pw-dial-action-row,
.pw-call-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 0 16px 0;
  width: 100%;
}
.pw-call-btn,
.pw-call-btn-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #30D158, #249742) !important;
  border: none !important;
  color: #fff !important;
  font-size: 1.6rem !important;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(48, 209, 88, 0.45);
  transition: transform 0.15s, box-shadow 0.2s;
  display: flex !important;
  align-items: center;
  justify-content: center;
  margin: 0 auto !important;
}
.pw-call-btn:hover,
.pw-call-btn-circle:hover {
  transform: scale(1.06);
  box-shadow: 0 10px 30px rgba(48, 209, 88, 0.65);
}
.pw-call-btn:active,
.pw-call-btn-circle:active {
  transform: scale(0.94);
}

/* ──────────────────────────────────────────────────────────
   iOS-STYLE ACTIVE CALL BAR
   ────────────────────────────────────────────────────────── */
.pw-active-call-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
  cursor: pointer;
  user-select: none;
  z-index: 28;
  position: relative;
  transition: background 0.2s, transform 0.15s;
  animation: pwFadeDown 0.25s ease-out;
}

.pw-active-call-bar:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.pw-acb-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.pw-acb-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 8px #ffffff;
  animation: pwPulseDot 1.2s infinite ease-in-out;
  flex-shrink: 0;
}

.pw-acb-phone-icon {
  font-size: 0.95rem;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

.pw-acb-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pw-acb-caller {
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.15;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pw-acb-hint {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  white-space: nowrap;
}

.pw-acb-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.pw-acb-timer {
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: rgba(0, 0, 0, 0.25);
  padding: 3px 8px;
  border-radius: 12px;
  letter-spacing: 0.5px;
}

.pw-acb-hangup-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ef4444;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 0.72rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s, background 0.15s;
}

.pw-acb-hangup-btn:hover {
  background: #dc2626;
  transform: scale(1.1);
}

@keyframes pwPulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

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

.pw-incall-top-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.pw-incall-minimize-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  color: #e2e8f0;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.pw-incall-minimize-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  transform: translateY(-1px);
}

.pw-incall-minimize-btn svg {
  transition: transform 0.15s;
}

.pw-incall-minimize-btn:hover svg {
  transform: translateY(2px);
}

.pw-incall-secure-badge {
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 500;
}

/* In-Call Active Overlay */
.pw-incall-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 14, 18, 0.98);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 30px 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.pw-incall-overlay.active { opacity: 1; pointer-events: auto; }

.pw-incall-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.pw-incall-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pw-accent), #c24600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 10px 30px var(--pw-accent-glow);
}
.pw-incall-name { font-size: 1.15rem; font-weight: 700; }
.pw-incall-status { font-size: 0.8rem; color: var(--pw-text-dim); }
.pw-incall-timer { font-size: 0.88rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--pw-accent); }

.pw-incall-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 280px;
}
.pw-incall-tool-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
}
.pw-incall-tool-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--pw-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  transition: background 0.15s;
}
.pw-incall-tool-btn.active .pw-incall-tool-icon {
  background: #fff;
  color: #000;
}
.pw-incall-tool-label { font-size: 0.65rem; color: var(--pw-text-dim); }

.pw-hangup-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pw-red), #c8281e);
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(255, 69, 58, 0.4);
  transition: transform 0.15s;
  margin-top: 10px;
}
.pw-hangup-btn:hover { transform: scale(1.05); }

/* Incoming Call Banner in phone */
.pw-incoming-call-box {
  display: flex;
  gap: 20px;
  margin-top: 14px;
}
.pw-answer-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--pw-green);
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(48, 209, 88, 0.4);
}
.pw-decline-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--pw-red);
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 69, 58, 0.4);
}

/* Sub-Tab 2: Call History & Audio Player */
.pw-call-logs-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.pw-call-filter-chips {
  display: flex;
  gap: 6px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--pw-border);
  background: rgba(13, 14, 18, 0.6);
}
.pw-chip {
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.68rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--pw-border);
  color: var(--pw-text-dim);
  cursor: pointer;
  transition: all 0.15s;
}
.pw-chip.active {
  background: var(--pw-accent);
  color: #fff;
  border-color: var(--pw-accent);
}

.pw-call-log-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}

.pw-call-log-item {
  display: flex;
  flex-direction: column;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  gap: 6px;
}
.pw-call-log-item:hover { background: var(--pw-card); }

.pw-call-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pw-call-info-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pw-call-direction-icon {
  font-size: 1rem;
}
.pw-call-direction-icon.incoming { color: var(--pw-green); }
.pw-call-direction-icon.outgoing { color: var(--pw-blue); }
.pw-call-direction-icon.missed { color: var(--pw-red); }

.pw-call-caller {
  font-size: 0.85rem;
  font-weight: 600;
}
.pw-call-caller.missed { color: var(--pw-red); }
.pw-call-subtext {
  font-size: 0.68rem;
  color: var(--pw-text-muted);
}
.pw-call-time {
  font-size: 0.68rem;
  color: var(--pw-text-dim);
}

/* Voicemails Sub-tab inside Phone View */
.pw-vm-item {
  display: flex;
  flex-direction: column;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  gap: 6px;
  background: transparent;
  transition: background 0.15s;
}
.pw-vm-item.unread {
  background: rgba(255, 107, 0, 0.06);
  border-left: 3px solid var(--pw-accent);
}
.pw-vm-item:hover {
  background: var(--pw-card);
}
.pw-vm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pw-vm-caller-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pw-vm-caller-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: #fff;
}
.pw-vm-badge-unread {
  background: var(--pw-accent);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 6px;
}
.pw-vm-meta {
  font-size: 0.65rem;
  color: var(--pw-text-muted);
}
.pw-vm-transcript {
  font-size: 0.72rem;
  color: var(--pw-text-dim);
  line-height: 1.35;
  background: rgba(0, 0, 0, 0.25);
  padding: 6px 8px;
  border-radius: 6px;
  border-left: 2px solid var(--pw-border-hi);
  font-style: italic;
}
.pw-vm-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.pw-vm-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--pw-border);
  color: var(--pw-text-dim);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.65rem;
  cursor: pointer;
  transition: all 0.15s;
}
.pw-vm-btn:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }
.pw-vm-btn.primary { background: var(--pw-accent); color: #fff; border-color: var(--pw-accent); }

/* Audio Scrubber & Recording Player */
.pw-audio-scrubber-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--pw-border);
  border-radius: 10px;
  padding: 6px 10px;
  margin-top: 4px;
}

.pw-play-toggle-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--pw-accent);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.pw-scrubber-track {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
}
.pw-scrubber-progress {
  height: 100%;
  background: var(--pw-accent);
  border-radius: 4px;
  width: 0%;
  position: relative;
}
.pw-scrubber-thumb {
  position: absolute;
  right: -4px;
  top: -4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.pw-audio-time {
  font-size: 0.65rem;
  color: var(--pw-text-dim);
  font-variant-numeric: tabular-nums;
  min-width: 32px;
}

.pw-audio-download-btn {
  background: none;
  border: none;
  color: var(--pw-text-dim);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 2px 4px;
  transition: color 0.15s;
}
.pw-audio-download-btn:hover { color: #fff; }

/* ──────────────────────────────────────────────────────────
   5. APP 3: ADMIN & PHONE SETTINGS APP
   ────────────────────────────────────────────────────────── */
#pwViewSettings {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pw-settings-card {
  background: var(--pw-card);
  border: 1px solid var(--pw-border);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pw-card-header {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--pw-accent);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Ringtone Profile Options */
.pw-ringtone-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px;
  font-size: 0.78rem;
  cursor: pointer;
}
.pw-ringtone-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pw-preview-audio-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--pw-border);
  border-radius: 6px;
  color: var(--pw-text);
  padding: 2px 8px;
  font-size: 0.68rem;
  cursor: pointer;
}
.pw-preview-audio-btn:hover { background: rgba(255, 255, 255, 0.16); }

/* Audio Output Device Picker */
.pw-device-select {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--pw-border);
  border-radius: 8px;
  color: #fff;
  font-size: 0.75rem;
  padding: 6px 10px;
  outline: none;
  cursor: pointer;
}
.pw-device-select option { background: #1a1e28; color: #fff; }

/* Template Manager inside Settings */
.pw-tpl-manager-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}
.pw-tpl-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--pw-border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.75rem;
}
.pw-tpl-title { font-weight: 600; }
.pw-tpl-del-btn {
  background: none;
  border: none;
  color: var(--pw-red);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 2px 6px;
}

.pw-tpl-add-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.pw-input-sm {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--pw-border);
  border-radius: 6px;
  padding: 5px 8px;
  color: #fff;
  font-size: 0.72rem;
  outline: none;
}
.pw-input-sm:focus { border-color: var(--pw-accent); }

.pw-btn-sm {
  background: var(--pw-accent);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  align-self: flex-start;
}

/* Status summary card */
.pw-status-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  font-size: 0.72rem;
}
.pw-status-kv {
  display: flex;
  flex-direction: column;
}
.pw-status-k { color: var(--pw-text-muted); font-size: 0.65rem; }
.pw-status-v { font-weight: 600; color: #fff; margin-top: 1px; }

.pw-diagnosis-card {
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--pw-border);
  border-radius: 8px;
  font-size: 0.68rem;
}
.pw-diagnosis-title {
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--pw-accent);
  display: flex;
  align-items: center;
  gap: 4px;
}
.pw-diagnosis-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pw-diag-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pw-diag-status-ok { color: var(--pw-green); font-weight: 600; }
.pw-diag-status-missing { color: var(--pw-red); font-weight: 600; }
.pw-diag-msg {
  margin-top: 6px;
  padding: 4px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--pw-text-dim);
  font-size: 0.65rem;
  line-height: 1.3;
}

/* ──────────────────────────────────────────────────────────
   QUICK MESSAGE TEMPLATE CHIPS BAR
   ────────────────────────────────────────────────────────── */
.pw-quick-template-chips-wrap {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 6px 10px 4px 10px;
  scrollbar-width: none;
}
.pw-quick-template-chips-wrap::-webkit-scrollbar {
  display: none;
}
.pw-quick-template-chip {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--pw-border);
  color: var(--pw-text-dim);
  border-radius: 12px;
  padding: 3px 9px;
  font-size: 0.68rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.pw-quick-template-chip:hover {
  background: rgba(255, 107, 0, 0.15);
  color: #fff;
  border-color: var(--pw-accent);
}

/* ──────────────────────────────────────────────────────────
   CONTACTS BROWSER & CONTACT CARD
   ────────────────────────────────────────────────────────── */
#pwViewContacts {
  display: flex;
  flex-direction: column;
}

.pw-contacts-search-bar {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--pw-border);
}

.pw-contacts-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pw-contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--pw-border);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.pw-contact-item:hover {
  background: var(--pw-card-hover);
  border-color: var(--pw-border-hi);
  transform: translateY(-1px);
}
.pw-contact-item:active {
  transform: translateY(0);
}

.pw-contact-avatar-sm {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 107, 0, 0.25), rgba(255, 107, 0, 0.5));
  border: 1px solid var(--pw-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.pw-contact-info {
  flex: 1;
  min-width: 0;
}
.pw-contact-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pw-contact-phone {
  font-size: 0.7rem;
  color: var(--pw-text-dim);
  margin-top: 1px;
}

.pw-contact-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.pw-contact-ticket-tag {
  background: rgba(0, 210, 255, 0.12);
  color: #00d2ff;
  border: 1px solid rgba(0, 210, 255, 0.3);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 600;
}
.pw-contact-arrow {
  color: var(--pw-text-muted);
  font-size: 1rem;
}

/* Slide-Over Contact Detail View */
#pwContactDetailView {
  position: absolute;
  inset: 0;
  background: var(--pw-bg);
  display: flex;
  flex-direction: column;
  z-index: 12;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
#pwContactDetailView.active {
  transform: translateX(0);
}

.pw-contact-card-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pw-contact-profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--pw-border-hi);
  border-radius: 12px;
}

.pw-contact-avatar-lg {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pw-accent), #c24500);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  box-shadow: 0 4px 14px var(--pw-accent-glow);
  flex-shrink: 0;
}

.pw-contact-meta-group {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pw-contact-name-lg {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}
.pw-contact-sub-info {
  font-size: 0.72rem;
  color: var(--pw-text-dim);
  word-break: break-all;
}

.pw-contact-action-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pw-contact-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--pw-border-hi);
  color: #fff;
  transition: all 0.15s ease;
}
.pw-contact-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}
.pw-contact-btn.primary {
  background: var(--pw-accent);
  border-color: var(--pw-accent);
}
.pw-contact-btn.primary:hover {
  background: #ff7d1a;
  box-shadow: 0 4px 12px var(--pw-accent-glow);
}

.pw-contact-tickets-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pw-contact-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--pw-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.pw-contact-section-title .pw-badge {
  background: rgba(255, 107, 0, 0.2);
  color: var(--pw-accent);
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 0.7rem;
}

.pw-contact-tickets-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pw-contact-ticket-card {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--pw-border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.pw-contact-ticket-card:hover {
  border-color: var(--pw-accent);
  background: rgba(255, 107, 0, 0.05);
}

.pw-ct-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pw-ct-number {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--pw-accent);
}
.pw-ct-status {
  font-size: 0.65rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 6px;
  border-radius: 4px;
  color: #fff;
}
.pw-ct-device {
  font-size: 0.75rem;
  color: #fff;
  font-weight: 500;
}
.pw-ct-issue {
  font-size: 0.7rem;
  color: var(--pw-text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pw-ct-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.68rem;
  color: var(--pw-text-muted);
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.pw-ct-open-btn {
  background: none;
  border: none;
  color: var(--pw-accent);
  font-weight: 600;
  font-size: 0.7rem;
  cursor: pointer;
  padding: 2px 4px;
}

.pw-empty-tickets {
  padding: 20px 10px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--pw-text-muted);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
}

/* ──────────────────────────────────────────────────────────
   REPAIR GUIDES (iFixit & Repair.wiki Viewer)
   ────────────────────────────────────────────────────────── */
.pw-guides-body {
  overflow-y: auto;
  flex: 1;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pw-guide-quick-btn {
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
}
.pw-guide-quick-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.pw-guide-card {
  display: flex;
  gap: 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px;
  transition: border-color 0.18s, background 0.18s, transform 0.15s;
}
.pw-guide-card:hover {
  border-color: rgba(0, 210, 255, 0.35);
  background: rgba(255, 255, 255, 0.055);
}

.pw-guide-thumb {
  width: 76px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
  background: #000;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pw-guide-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: 3px;
}

.pw-guide-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.pw-guide-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.pw-guide-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  line-height: 1;
}
.pw-guide-badge-ifixit {
  background: rgba(255, 128, 0, 0.18);
  color: #ff9f43;
  border: 1px solid rgba(255, 128, 0, 0.35);
}
.pw-guide-badge-wiki {
  background: rgba(0, 210, 255, 0.16);
  color: #00d2ff;
  border: 1px solid rgba(0, 210, 255, 0.35);
}
.pw-guide-badge-diff-easy {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
}
.pw-guide-badge-diff-moderate {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}
.pw-guide-badge-diff-difficult {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.pw-guide-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.pw-guide-btn-view {
  flex: 1;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 6px;
  background: linear-gradient(135deg, #00b4d8 0%, #0077b6 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  text-align: center;
}
.pw-guide-btn-ext {
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid var(--pw-border);
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* Step-by-Step Reader inside Virtual Phone */
.pw-reader-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 8px;
}
.pw-reader-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 4px;
}
.pw-reader-img-wrap {
  width: 100%;
  max-height: 230px;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--pw-border);
}
.pw-reader-img {
  width: 100%;
  height: 100%;
  max-height: 230px;
  object-fit: contain;
}
.pw-reader-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 2px;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #e2e8f0;
}
.pw-reader-line-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.pw-reader-bullet {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan, #00d2ff);
  margin-top: 5px;
  flex-shrink: 0;
}
.pw-reader-footer-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--pw-border);
}

/* ──────────────────────────────────────────────────────────
   MOBILE OS SHELL: WALLPAPERS, HOME SCREEN, APPS & DOCK
   ────────────────────────────────────────────────────────── */

/* Canvas Wallpapers */
#pwCanvas.pw-wallpaper-cyberpunk {
  background: radial-gradient(circle at 80% 20%, rgba(236, 72, 153, 0.28) 0%, transparent 50%),
              radial-gradient(circle at 20% 80%, rgba(6, 182, 212, 0.28) 0%, transparent 50%),
              linear-gradient(135deg, #090a10 0%, #13141f 50%, #0d0e17 100%);
}
#pwCanvas.pw-wallpaper-midnight {
  background: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.22) 0%, transparent 60%),
              linear-gradient(180deg, #07090e 0%, #0c0f17 50%, #050608 100%);
}
#pwCanvas.pw-wallpaper-cobalt {
  background: radial-gradient(circle at 10% 20%, rgba(37, 99, 235, 0.32) 0%, transparent 50%),
              radial-gradient(circle at 90% 80%, rgba(14, 165, 233, 0.25) 0%, transparent 50%),
              linear-gradient(160deg, #081224 0%, #0b1a33 100%);
}
#pwCanvas.pw-wallpaper-emerald {
  background: radial-gradient(circle at 75% 25%, rgba(16, 185, 129, 0.28) 0%, transparent 55%),
              radial-gradient(circle at 20% 70%, rgba(5, 150, 105, 0.22) 0%, transparent 50%),
              linear-gradient(145deg, #05140d 0%, #092017 100%);
}
#pwCanvas.pw-wallpaper-sunset {
  background: radial-gradient(circle at 80% 20%, rgba(249, 115, 22, 0.32) 0%, transparent 55%),
              radial-gradient(circle at 20% 80%, rgba(217, 70, 239, 0.28) 0%, transparent 55%),
              linear-gradient(150deg, #180918 0%, #1a0f1e 100%);
}
#pwCanvas.pw-wallpaper-carbon {
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.018) 0px, rgba(255, 255, 255, 0.018) 2px, transparent 2px, transparent 6px),
              linear-gradient(180deg, #121318 0%, #0a0b0e 100%);
}
#pwCanvas.pw-wallpaper-frost {
  background: radial-gradient(circle at 50% 10%, rgba(255, 255, 255, 0.16) 0%, transparent 60%),
              linear-gradient(170deg, #1c2333 0%, #10141f 100%);
}

/* Home Screen View */
.pw-view.pw-view-home {
  background: transparent !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  padding: 10px 14px 6px 14px !important;
  box-sizing: border-box;
}

/* Dynamic Live Clock & Date Widget */
.pw-home-widget {
  text-align: center;
  padding: 12px 8px 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
}
.pw-home-clock {
  font-size: 3.4rem;
  font-weight: 200;
  line-height: 1;
  letter-spacing: -0.04em;
  color: #ffffff;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}
.pw-home-date {
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 4px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}
.pw-home-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 3px 12px;
  border-radius: 14px;
  font-size: 0.7rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
}
.pw-hsc-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

/* Responsive App Launcher Grid */
.pw-app-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px 10px;
  padding: 14px 6px 10px 6px;
  justify-items: center;
  align-content: start;
}
.pw-app-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.12s ease;
  width: 68px;
}
.pw-app-item:hover {
  transform: translateY(-2px);
}
.pw-app-item:active {
  transform: scale(0.92);
}
.pw-app-icon-box {
  width: 54px;
  height: 54px;
  border-radius: 12.5px; /* authentic iOS squircle */
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 1px 0.5px rgba(255, 255, 255, 0.2);
  transition: transform 0.12s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.12s;
  overflow: hidden;
  background: transparent;
}
.pw-app-icon-box.sm {
  width: 48px;
  height: 48px;
  border-radius: 11px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35), inset 0 1px 0.5px rgba(255, 255, 255, 0.2);
}
.pw-app-icon-box img.pw-app-icon-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: inherit !important;
  display: block !important;
  pointer-events: none;
}

/* Authentic iOS App Icon Gradients & Palettes */
.pw-icon-phone {
  background: linear-gradient(180deg, #34c759 0%, #248a3d 100%);
}
.pw-icon-messages {
  background: linear-gradient(180deg, #34c759 0%, #28a745 100%);
}
.pw-icon-contacts {
  background: linear-gradient(180deg, #d1d5db 0%, #9ca3af 100%);
}
.pw-icon-calculator {
  background: linear-gradient(180deg, #2c2c2e 0%, #1c1c1e 100%);
}
.pw-icon-benchcam {
  background: linear-gradient(180deg, #e5e5ea 0%, #aeaeb2 100%);
}
.pw-icon-imeicheck {
  background: linear-gradient(180deg, #0a84ff 0%, #0055d4 100%);
}
.pw-icon-voicenotes {
  background: linear-gradient(180deg, #1c1c1e 0%, #000000 100%);
}
.pw-icon-guides {
  background: linear-gradient(180deg, #0071ce 0%, #00569e 100%);
}
.pw-icon-youtube {
  background: linear-gradient(180deg, #ffffff 0%, #f4f4f5 100%);
}
.pw-icon-sentrix {
  background: linear-gradient(180deg, #ffffff 0%, #e2e8f0 100%);
  color: #111;
}
.pw-icon-amazon {
  background: linear-gradient(180deg, #232f3e 0%, #131921 100%);
}
.pw-icon-settings {
  background: linear-gradient(180deg, #8e8e93 0%, #636366 100%);
}

.pw-app-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: #ffffff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
  text-align: center;
  max-width: 68px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pw-app-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5), 0 0 0 1.5px #ffffff;
  z-index: 2;
}

/* Persistent Bottom Dock */
.pw-home-dock-wrap {
  margin-top: auto;
  padding: 0 4px 6px 4px;
  display: flex;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
}
.pw-home-dock {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 26px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 8px;
  width: 100%;
  max-width: 320px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.42);
}
.pw-dock-item {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease;
}
.pw-dock-item:hover {
  transform: scale(1.1);
}
.pw-dock-item:active {
  transform: scale(0.92);
}

/* Mobile OS Shell Navigation Bar */
.pw-os-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 16px 6px 16px;
  background: rgba(10, 11, 16, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  z-index: 40;
  height: 42px;
  box-sizing: border-box;
  user-select: none;
}
.pw-os-nav-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.72);
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}
.pw-os-nav-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}
.pw-os-home-bar-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pw-os-home-pill {
  width: 90px;
  height: 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.6);
  transition: background 0.15s, width 0.15s;
}
.pw-os-home-bar-btn:hover .pw-os-home-pill {
  background: #ffffff;
  width: 105px;
}

/* App Switcher Modal / Recents Drawer */
.pw-recents-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 14, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: 16px;
  box-sizing: border-box;
  animation: pwFadeIn 0.2s ease;
}
.pw-recents-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.pw-recents-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 0;
}
.pw-recents-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.pw-recents-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}
.pw-recents-card.active {
  border-color: var(--cyan, #00d2ff);
  background: rgba(0, 210, 255, 0.08);
}
.pw-rc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pw-rc-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pw-rc-icon {
  font-size: 1.15rem;
}
.pw-rc-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
}
.pw-rc-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.pw-rc-close:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}
.pw-rc-desc {
  font-size: 0.74rem;
  color: #94a3b8;
}
.pw-rc-action {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--cyan, #00d2ff);
  margin-top: 2px;
}
.pw-recents-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Calculator App */
#pwViewCalculator {
  background: #0d0f17;
}
.pw-calc-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 8px 12px 8px 12px;
  box-sizing: border-box;
  gap: 8px;
}
.pw-calc-display-wrap {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 8px 14px;
  text-align: right;
  min-height: 62px;
  max-height: 70px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  user-select: text;
}
.pw-calc-expr {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  min-height: 16px;
  word-break: break-all;
}
.pw-calc-display {
  font-size: 2rem;
  font-weight: 300;
  color: #ffffff;
  letter-spacing: -0.03em;
  word-break: break-all;
  line-height: 1.1;
}
.pw-calc-quick-actions {
  display: flex;
  gap: 6px;
}
.pw-calc-quick-btn {
  flex: 1;
  padding: 6px 4px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, transform 0.1s;
}
.pw-calc-quick-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}
.pw-calc-quick-btn:active {
  transform: scale(0.95);
}
.pw-calc-quick-btn.tax {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.35);
  color: #60a5fa;
}
.pw-calc-quick-btn.pos {
  flex: 1.4;
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.38);
  color: #34d399;
  font-weight: 700;
}
.pw-calc-keypad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  flex: 1;
  align-content: stretch;
}
.pw-calc-btn {
  height: 48px;
  border-radius: 12px; /* Rounded rectangles */
  border: none;
  font-size: 1.25rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  transition: background 0.1s, transform 0.08s;
  user-select: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
}
.pw-calc-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}
.pw-calc-btn:active {
  transform: scale(0.94);
}
.pw-calc-btn.fn {
  background: rgba(255, 255, 255, 0.22);
  color: #0d0f17;
  font-weight: 600;
}
.pw-calc-btn.op {
  background: #f97316;
  color: #ffffff;
  font-weight: 600;
}
.pw-calc-btn.op:hover {
  background: #ea580c;
}
.pw-calc-btn.eq {
  background: #10b981;
  color: #ffffff;
  font-weight: 700;
}
.pw-calc-btn.eq:hover {
  background: #059669;
}
.pw-calc-btn.zero {
  grid-column: span 2;
  border-radius: 12px;
  justify-content: flex-start;
  padding-left: 20px;
}
.pw-calc-history-wrap {
  display: none;
  background: rgba(10, 12, 18, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 12px;
  max-height: 140px;
  overflow-y: auto;
  box-sizing: border-box;
}
.pw-calc-history-wrap.active {
  display: block;
}
.pw-calc-hist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.pw-calc-hist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.74rem;
  transition: background 0.12s;
}
.pw-calc-hist-item:hover {
  background: rgba(255, 255, 255, 0.08);
}
.pw-chi-expr {
  color: #94a3b8;
}
.pw-chi-res {
  color: #38bdf8;
  font-weight: 700;
}

/* Shared Header Icon / Utility Buttons (Amazon, Guides, etc.) */
.pw-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}
.pw-icon-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}
.pw-icon-btn:active {
  transform: scale(0.95);
}

/* Amazon App */
#pwViewAmazon {
  background: #0f1111;
  display: flex;
  flex-direction: column;
}
.pw-amazon-results-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.pw-amazon-product-card {
  display: flex;
  gap: 10px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  align-items: center;
  transition: background 0.15s, border-color 0.15s;
}
.pw-amazon-product-card:hover {
  background: rgba(255, 153, 0, 0.08);
  border-color: rgba(255, 153, 0, 0.35);
}
.pw-amazon-product-img {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: #ffffff;
  object-fit: contain;
  padding: 4px;
  flex-shrink: 0;
}
.pw-amazon-product-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.pw-amazon-product-title {
  font-size: 0.74rem;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pw-amazon-product-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
}
.pw-amazon-product-price {
  color: #ff9900;
  font-weight: 800;
}
.pw-amazon-product-rating {
  color: #94a3b8;
  font-size: 0.68rem;
}
.pw-amazon-product-open {
  padding: 5px 8px;
  border-radius: 7px;
  background: #ff9900;
  color: #111;
  font-size: 0.68rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.pw-amazon-card-item {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  padding: 9px;
  gap: 8px;
}
.pw-amazon-card-item:hover {
  border-color: rgba(255, 153, 0, 0.4);
}
.pw-amazon-actions-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 2px;
}
.pw-amazon-btn-cart {
  padding: 4px 8px;
  border-radius: 6px;
  background: #ff9900;
  color: #111;
  font-size: 0.68rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pw-amazon-btn-desc {
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
  font-size: 0.68rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
}
.pw-amazon-desc-box {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.72rem;
  line-height: 1.4;
  color: #cbd5e1;
  border-left: 2px solid #ff9900;
}
.pw-amazon-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #131921;
  border-bottom: 1px solid #232f3e;
  flex-shrink: 0;
}
.pw-amazon-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pw-amazon-corp-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 12px;
  background: #232f3e;
  font-size: 0.68rem;
  color: #cbd5e1;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.pw-amazon-corp-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 6px #38bdf8;
}
.pw-amazon-util-bar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 6px 8px;
  background: #0f1111;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  gap: 4px;
}
.pw-amazon-util-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s;
}
.pw-amazon-util-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}
.pw-amazon-util-btn.pw-amazon-popout {
  background: rgba(255, 153, 0, 0.2);
  border-color: rgba(255, 153, 0, 0.4);
  color: #ffb84d;
}
.pw-amazon-portal-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px;
  background: #0f1111;
  overflow-y: auto;
  gap: 12px;
}
.pw-amazon-search-bar {
  display: flex;
  gap: 6px;
  align-items: center;
}
.pw-amazon-card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pw-amazon-hero-card {
  background: linear-gradient(135deg, #19222d 0%, #131921 100%);
  border: 1px solid rgba(255, 153, 0, 0.3);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.pw-amazon-launch-btn {
  width: 100%;
  padding: 10px 16px;
  background: linear-gradient(135deg, #ff9900 0%, #e68a00 100%);
  color: #111;
  font-weight: 800;
  font-size: 0.85rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s;
}
.pw-amazon-launch-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 153, 0, 0.4);
}
.pw-amazon-launch-btn:active {
  transform: scale(0.98);
}
.pw-amazon-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.pw-amazon-tile {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}
.pw-amazon-tile:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 153, 0, 0.35);
}
.pw-tile-icon { font-size: 1.15rem; }
.pw-tile-title { font-size: 0.76rem; font-weight: 700; color: #fff; }
.pw-tile-sub { font-size: 0.65rem; color: #94a3b8; }

.pw-amazon-quick-picks {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 10px 12px;
}
.pw-amazon-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pw-amazon-chips .pw-pill {
  padding: 4px 9px;
  font-size: 0.7rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.pw-amazon-chips .pw-pill:hover {
  background: rgba(255, 153, 0, 0.15);
  border-color: rgba(255, 153, 0, 0.4);
  color: #ffb84d;
}

/* Settings App Wallpaper & Personalization */
.pw-wallpaper-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 8px;
}
.pw-wallpaper-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  position: relative;
}
.pw-wp-preview {
  width: 100%;
  height: 72px;
  border-radius: 10px;
  border: 2px solid transparent;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s, transform 0.15s;
  position: relative;
  overflow: hidden;
}
.pw-wallpaper-card:hover .pw-wp-preview {
  transform: translateY(-2px);
}
.pw-wallpaper-card.active .pw-wp-preview {
  border-color: var(--cyan, #00d2ff);
  box-shadow: 0 0 12px rgba(0, 210, 255, 0.4);
}
.pw-wp-check {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--cyan, #00d2ff);
  color: #000;
  font-size: 0.65rem;
  font-weight: 800;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pw-wp-name {
  font-size: 0.72rem;
  color: #cbd5e1;
  text-align: center;
}
.pw-settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.pw-settings-toggle-row:last-child {
  border-bottom: none;
}
.pw-toggle-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}
.pw-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.pw-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.2);
  transition: 0.2s;
  border-radius: 22px;
}
.pw-toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}
.pw-toggle-switch input:checked + .pw-toggle-slider {
  background-color: #10b981;
}
.pw-toggle-switch input:checked + .pw-toggle-slider:before {
  transform: translateX(16px);
}

/* ──────────────────────────────────────────────────────────
   BENCH APPS: BENCHCAM, IMEI CHECK & VOICE NOTES
   ────────────────────────────────────────────────────────── */

/* App Icon Gradients */
.pw-icon-benchcam {
  background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
}
.pw-icon-imeicheck {
  background: linear-gradient(135deg, #0ea5e9 0%, #0369a1 100%);
}
.pw-icon-voicenotes {
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
}

/* 1. BenchCam App */
#pwViewBenchcam {
  background: #090b10;
  display: flex;
  flex-direction: column;
}
.pw-bc-cam-select {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 6px;
  font-size: 0.7rem;
  padding: 3px 6px;
  max-width: 140px;
}
.pw-bc-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.pw-bc-live-stage, .pw-bc-edit-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}
.pw-bc-video-container {
  flex: 1;
  position: relative;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#pwBcVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pw-bc-grid-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to right, rgba(255,255,255,0.15) 1px, transparent 1px) 0 0 / 33.33% 100%,
    linear-gradient(to bottom, rgba(255,255,255,0.15) 1px, transparent 1px) 0 0 / 100% 33.33%;
}
.pw-bc-stream-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  color: #10b981;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.pw-bc-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 12px 20px;
  background: #0f1118;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.pw-bc-icon-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
}
.pw-bc-icon-btn.active {
  background: rgba(0, 210, 255, 0.2);
  border-color: rgba(0, 210, 255, 0.5);
  color: #00d2ff;
}
.pw-bc-shutter-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: transparent;
  padding: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s;
}
.pw-bc-shutter-btn:active {
  transform: scale(0.92);
}
.pw-bc-shutter-inner {
  width: 100%;
  height: 100%;
  background: #ffffff;
  border-radius: 50%;
  transition: background 0.15s;
}
.pw-bc-shutter-btn:hover .pw-bc-shutter-inner {
  background: #f43f5e;
}

/* BenchCam Markup Stage */
.pw-bc-canvas-container {
  flex: 1;
  position: relative;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
}
#pwBcCanvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: crosshair;
}
.pw-bc-markup-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 6px 8px;
  background: #111420;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  gap: 4px;
}
.pw-bc-tool-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.pw-bc-tool-chip.active {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
  color: #f87171;
}
.pw-bc-tool-chip.danger {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}
.pw-bc-action-row {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  background: #0d0f17;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.pw-bc-attach-btn {
  flex: 1.2;
  font-weight: 700;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  border-radius: 8px;
}
.pw-bc-sms-btn {
  flex: 1;
  font-weight: 600;
  border-radius: 8px;
}

/* 2. IMEI & Cloud Lock Checker App */
#pwViewImeicheck {
  background: #0c0e14;
  display: flex;
  flex-direction: column;
}
.pw-imei-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}
.pw-imei-search-box {
  display: flex;
  gap: 8px;
}
.pw-imei-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.8rem;
  outline: none;
  font-family: monospace;
}
.pw-imei-input:focus {
  border-color: var(--cyan, #00d2ff);
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.25);
}
.pw-imei-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pw-imei-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pw-imei-brand-badge {
  background: rgba(14, 165, 233, 0.2);
  border: 1px solid rgba(14, 165, 233, 0.4);
  color: #38bdf8;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  letter-spacing: 0.05em;
}
.pw-imei-tac-valid {
  font-size: 0.68rem;
  color: #10b981;
  font-weight: 600;
}
.pw-imei-model-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
}
.pw-imei-sub-details {
  font-size: 0.72rem;
  color: #94a3b8;
}
.pw-imei-status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}
.pw-imei-stat-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pw-isb-lbl {
  font-size: 0.62rem;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 700;
}
.pw-isb-val {
  font-size: 0.74rem;
  color: #38bdf8;
  font-weight: 600;
}
.pw-imei-copy-btn {
  margin-top: 8px;
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  font-weight: 700;
}
.pw-imei-portals-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.pw-imei-portal-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pw-imei-portals-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pw-imei-portal-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.pw-imei-portal-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}
.pw-ipc-icon {
  font-size: 1.2rem;
}
.pw-ipc-text {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.pw-ipc-text strong {
  font-size: 0.76rem;
  color: #f1f5f9;
}
.pw-ipc-text small {
  font-size: 0.65rem;
  color: #64748b;
}
.pw-ipc-arrow {
  color: #94a3b8;
  font-size: 0.8rem;
}

/* 3. Voice Notes App */
#pwViewVoicenotes {
  background: #090a10;
  display: flex;
  flex-direction: column;
}
.pw-vn-rec-indicator {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
  animation: pwPulse 1.5s infinite;
}
.pw-vn-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  overflow-y: auto;
}
.pw-vn-wave-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 38px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.pw-vn-bar {
  width: 4px;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  transition: height 0.15s, background 0.15s;
}
.pw-vn-wave-wrap.active .pw-vn-bar {
  background: #8b5cf6;
  animation: pwWave 0.6s infinite ease-in-out alternate;
}
.pw-vn-wave-wrap.active .b1 { animation-delay: 0.1s; }
.pw-vn-wave-wrap.active .b2 { animation-delay: 0.2s; }
.pw-vn-wave-wrap.active .b3 { animation-delay: 0.3s; }
.pw-vn-wave-wrap.active .b4 { animation-delay: 0.4s; }
.pw-vn-wave-wrap.active .b5 { animation-delay: 0.35s; }
.pw-vn-wave-wrap.active .b6 { animation-delay: 0.25s; }
.pw-vn-wave-wrap.active .b7 { animation-delay: 0.15s; }
.pw-vn-wave-wrap.active .b8 { animation-delay: 0.05s; }

@keyframes pwWave {
  from { height: 6px; }
  to { height: 26px; }
}

.pw-vn-transcript-wrap {
  position: relative;
}
.pw-vn-transcript-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #ffffff;
  padding: 10px;
  font-size: 0.8rem;
  line-height: 1.4;
  outline: none;
  resize: vertical;
  box-sizing: border-box;
}
.pw-vn-dictate-bar {
  display: flex;
  gap: 8px;
}
.pw-vn-mic-btn {
  flex: 1;
  padding: 10px;
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.1s;
}
.pw-vn-mic-btn:active {
  transform: scale(0.96);
}
.pw-vn-mic-btn.recording {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
}
.pw-vn-insert-btn {
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  font-weight: 700;
}
.pw-vn-memos-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}
.pw-vn-memos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pw-vn-memos-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 130px;
  overflow-y: auto;
}
.pw-vn-memo-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 8px;
}

/* Voice Notes Workorder Selector & Notes List */
.pw-vn-ticket-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pw-vn-ticket-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pw-vn-ticket-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #cbd5e1;
}
.pw-vn-ticket-badge {
  font-size: 0.65rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 1px 6px;
  border-radius: 8px;
}
.pw-vn-ticket-select {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #fff;
  font-size: 0.76rem;
  padding: 6px 8px;
  outline: none;
  box-sizing: border-box;
}
.pw-vn-notes-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  font-weight: 700;
  color: #94a3b8;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 6px;
}
.pw-vn-notes-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 120px;
  overflow-y: auto;
  padding-right: 2px;
}
.pw-vn-note-item {
  background: rgba(255, 255, 255, 0.03);
  border-left: 2px solid #64748b;
  border-radius: 4px;
  padding: 5px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.pw-vn-note-item.voice-note {
  border-left-color: #8b5cf6;
  background: rgba(139, 92, 246, 0.08);
}
.pw-vn-note-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pw-vn-note-time {
  font-size: 0.64rem;
  color: #94a3b8;
}
.pw-vn-note-badge {
  font-size: 0.6rem;
  font-weight: 700;
  color: #a78bfa;
}
.pw-vn-note-badge.manual {
  color: #94a3b8;
}
.pw-vn-note-text {
  font-size: 0.72rem;
  color: #e2e8f0;
  line-height: 1.3;
  word-break: break-word;
}

/* ──────────────────────────────────────────────────────────
   APP: YOUTUBE REPAIR VIDEO FEED & PLAYER
   ────────────────────────────────────────────────────────── */
#pwViewYoutube {
  background: #0f0f0f;
}
.pw-yt-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  overflow-y: auto;
}
.pw-yt-search-bar {
  display: flex;
  gap: 6px;
  align-items: center;
}
.pw-yt-player-stage {
  background: #181818;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 0, 0, 0.3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}
.pw-yt-player-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
}
.pw-yt-player-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}
.pw-yt-player-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: #212121;
}
.pw-yt-player-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}
.pw-yt-chips-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.pw-yt-chips-row .pw-pill {
  padding: 4px 9px;
  font-size: 0.68rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  white-space: nowrap;
  cursor: pointer;
}
.pw-yt-chips-row .pw-pill.active {
  background: rgba(255, 0, 0, 0.2);
  border-color: #ff0000;
  color: #fff;
}
.pw-yt-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pw-yt-video-card {
  display: flex;
  gap: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, border-color 0.15s;
}
.pw-yt-video-card:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 0, 0, 0.4);
  transform: translateY(-1px);
}
.pw-yt-video-card:active {
  transform: scale(0.98);
}
.pw-yt-thumb-box {
  position: relative;
  width: 108px;
  height: 61px; /* 16:9 ratio */
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: #111;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.pw-yt-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pw-yt-duration-badge {
  position: absolute;
  bottom: 3px;
  right: 4px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  letter-spacing: 0.02em;
}
.pw-yt-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 1.25rem;
  opacity: 0;
  transition: opacity 0.15s;
}
.pw-yt-video-card:hover .pw-yt-play-overlay {
  opacity: 1;
}
.pw-yt-video-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  overflow: hidden;
}
.pw-yt-video-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pw-yt-video-channel {
  font-size: 0.68rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 4. Photo SMS Confirmation Modal */
.pw-photo-sms-modal {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 10, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}
.pw-psm-box {
  background: #131722;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  width: 100%;
  max-width: 330px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}
.pw-psm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}
.pw-psm-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pw-psm-preview-wrap {
  width: 100%;
  height: 120px;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pw-psm-preview-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.pw-psm-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pw-psm-field {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pw-psm-label {
  font-size: 0.7rem;
  color: #94a3b8;
  font-weight: 700;
}
.pw-psm-value {
  font-size: 0.74rem;
  color: #ffffff;
  font-weight: 600;
}
.pw-psm-textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #fff;
  padding: 6px 8px;
  font-size: 0.72rem;
  line-height: 1.4;
  outline: none;
  resize: none;
  box-sizing: border-box;
}
.pw-psm-notice {
  font-size: 0.65rem;
  color: #eab308;
  line-height: 1.3;
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.25);
  border-radius: 6px;
  padding: 6px 8px;
}
.pw-psm-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
}

/* Repeat Device Badges */
.repeat-device-badge {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.2) 0%, rgba(249, 115, 22, 0.2) 100%);
  border: 1px solid rgba(234, 179, 8, 0.4);
  color: #fbbf24;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  animation: pwPulse 2s infinite;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: transform 0.12s;
}
.repeat-device-badge:hover {
  transform: scale(1.04);
}

/* ──────────────────────────────────────────────────────────
   RESPONSIVE OVERRIDES (MOBILE VIEWPORTS)
   ────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  #pwLauncher {
    bottom: 16px;
    right: 16px;
    left: auto !important;
    padding: 6px 12px 6px 8px;
    max-width: 200px !important;
  }
  #pwCanvas {
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    border: none;
  }
}
