* { box-sizing: border-box; }
body { overflow-wrap: anywhere; }
main, section, article, form, .flex > *, .grid > * { min-width: 0; }
img, video, canvas { max-width: 100%; }
input, select, textarea { max-width: 100%; min-width: 0; }
textarea { white-space: pre-wrap; overflow-wrap: anywhere; resize: vertical; }
button, a { overflow-wrap: anywhere; }
#dashSidebar { overflow-y: auto; max-height: 100dvh; }
.chat-panel { height: auto !important; min-height: 400px; }
.chat-history { min-height: 160px; max-height: 55dvh; overflow-y: auto; }
.chat-compose { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; padding: 16px; }
.chat-compose textarea { flex: 1 1 200px; width: 100%; min-height: 80px; padding: 12px; border: 1px solid #cbd5e1; border-radius: 12px; }
.chat-compose button { flex-shrink: 0; min-height: 44px; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.admin-nav a, .action-link { display: inline-flex; padding: 10px 14px; border-radius: 10px; background: #eff6ff; color: #1d4ed8; font-size: 14px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.admin-card, .edit-panel, .review-panel { padding: 20px; border: 1px solid #e2e8f0; background: white; border-radius: 16px; }
.admin-card h2 { font-weight: 700; font-size: 18px; margin-bottom: 10px; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.admin-form { display: grid; gap: 16px; max-width: 850px; }
.admin-form label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.admin-form input, .admin-form select, .admin-form textarea { width: 100%; padding: 12px; border: 1px solid #cbd5e1; border-radius: 10px; font-weight: 400; background: white; }
.primary-button { background: #2563eb; color: white; padding: 12px 20px; border-radius: 10px; font-weight: 600; }
.danger-button { background: #fee2e2; color: #b91c1c; padding: 10px 14px; border-radius: 10px; }
.record-details { display: grid; gap: 12px; margin: 16px 0; }
.record-details dt { font-size: 12px; color: #64748b; }
.record-details dd { white-space: pre-wrap; }
.stars { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.stars label { cursor: pointer; display: grid; justify-items: center; padding: 8px; border: 1px solid #cbd5e1; border-radius: 10px; min-width: 44px; }
.stars label:has(input:checked) { border-color: #ca8a04; background: #fef9c3; }
.stars span { color: #a16207; font-size: 26px; }
.stars input { accent-color: #ca8a04; }
.review-panel textarea { width: 100%; padding: 12px; border: 1px solid #cbd5e1; border-radius: 10px; }
.service-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 20px; }
@media (max-width: 767px) {
  main { width: 100%; }
  input, select, textarea { font-size: 16px !important; }
  .chat-compose { flex-direction: column; align-items: stretch; }
  .chat-compose textarea { flex: auto; }
  .chat-compose button { width: 100%; }
  .chat-history { padding: 16px !important; }
  .flex.items-center.justify-between { flex-wrap: wrap; gap: 10px; }
  header .flex.items-center.justify-between { flex-wrap: nowrap; gap: 6px; }
  .truncate { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; }
  .max-w-\[80\%\] { max-width: 95%; }
  .admin-card, .edit-panel, .review-panel { padding: 16px; }
  .overflow-x-auto { max-width: 100%; }
}
