/* ==========================================================================
   FILE VIEWER
   ========================================================================== */

.file-list span {
  color: var(--muted);
  font-size: 13px;
}

.upload-drop .upload-icon {
  color: #ffffff;
  font-size: 30px;
}

.upload-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.upload-submit {
  min-width: 260px;
  justify-content: center;
}

.upload-submit:disabled {
  cursor: not-allowed;
  opacity: 0.56;
  box-shadow: none;
}

.file-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.file-list article {
  display: grid;
  gap: 4px;
  border: 1px solid #dbe5ec;
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.rich-file-list article,
.file-card {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.file-preview {
  display: grid;
  place-items: center;
  width: 86px;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid #dbe5ec;
  border-radius: 8px;
  background: #f3f6f7;
}

.file-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-thumb {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--primary-dark);
  font-weight: 900;
}

.icon-file-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--primary);
  font-size: 20px;
  font-weight: 900;
}

.file-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  min-width: 0;
}

.danger-file-btn {
  background: var(--danger);
}

.file-card-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.file-card-copy strong,
.file-card-copy span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.file-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 150px;
  border: 1px solid rgba(123, 142, 158, 0.22);
  border-radius: 999px;
  padding: 6px 9px;
  color: #627084;
  background: #f3f6f7;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
}

.compare-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.before-after-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.compare-photo {
  display: grid;
  gap: 10px;
  border: 1px solid #dbe5ec;
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.compare-photo button {
  overflow: hidden;
  border-radius: 8px;
  background: #f3f6f7;
}

.compare-photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #f3f6f7;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(23, 33, 43, 0.62);
}

.conversation-panel {
  display: grid;
  gap: 18px;
}

.conversation-header {
  align-items: flex-start;
}

.conversation-thread {
  display: grid;
  gap: 12px;
  max-height: 440px;
  overflow: auto;
  border: 1px solid #dbe5ec;
  border-radius: 8px;
  padding: 16px;
  background: #f8fbfb;
}

.message-bubble {
  width: min(76%, 640px);
  border: 1px solid #d9e3e8;
  border-radius: 8px;
  padding: 12px 14px;
  background: #ffffff;
}

.message-bubble.own {
  justify-self: end;
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, #27745d, #2e5680);
}

.message-bubble div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.message-bubble time {
  opacity: 0.72;
  font-size: 12px;
}

.message-delete-btn {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-left: auto;
  border: 1px solid rgba(130, 68, 68, 0.16);
  border-radius: 999px;
  color: #8a4b4b;
  background: rgba(255, 245, 245, 0.8);
  font-size: 16px;
  line-height: 1;
}

.message-delete-btn:hover {
  color: #ffffff;
  background: #a74d4d;
}

.message-bubble p {
  margin: 0;
  line-height: 1.55;
  white-space: pre-wrap;
}

.appointment-coming-soon {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  margin-bottom: 26px;
  border: 1px solid #dbe5ec;
  border-radius: 8px;
  padding: clamp(20px, 4vw, 34px);
  background:
    linear-gradient(135deg, rgba(231, 241, 237, 0.92), rgba(244, 248, 249, 0.96)),
    #ffffff;
  box-shadow: 0 18px 45px rgba(23, 33, 43, 0.08);
}

.appointment-visual {
  position: relative;
  display: grid;
  min-height: 210px;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(39, 116, 93, 0.86), rgba(46, 86, 128, 0.9)),
    url("https://images.unsplash.com/photo-1506784983877-45594efa4cbe?auto=format&fit=crop&w=900&q=80");
  background-position: center;
  background-size: cover;
}

.appointment-visual span {
  position: absolute;
  inset: 22px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
}

.appointment-visual strong {
  z-index: 1;
  font-size: 32px;
}

.appointment-visual small {
  z-index: 1;
  margin-top: -62px;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.appointment-coming-soon h3 {
  margin: 8px 0 12px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
}

.appointment-coming-soon p {
  max-width: 720px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.appointment-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.appointment-preview-list span {
  border: 1px solid rgba(39, 116, 93, 0.14);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--primary-dark);
  background: rgba(255, 255, 255, 0.72);
  font-weight: 800;
}

.conversation-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.conversation-form textarea {
  min-height: 76px;
  resize: vertical;
}

.messages-workspace {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 18px;
}

.messages-client-list {
  display: grid;
  align-content: start;
  gap: 8px;
}

.messages-client-list button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 70px;
  border: 1px solid #dbe5ec;
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
  text-align: left;
}

.messages-client-list button.active,
.messages-client-list button:hover {
  border-color: rgba(39, 116, 93, 0.24);
  background: #edf4f2;
}

.messages-client-list strong,
.messages-client-list small {
  display: block;
}

.messages-client-list small {
  overflow: hidden;
  color: #647184;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-modal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1040px, 96vw);
  max-height: 92vh;
  overflow: hidden;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.file-modal header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid #dbe5ec;
}

.file-modal header span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.viewer-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.viewer-tools span {
  min-width: 48px;
  margin: 0;
  color: var(--ink);
  text-align: center;
  font-weight: 900;
}

.viewer-zoom-stage {
  width: 100%;
  height: min(76vh, 820px);
  overflow: auto;
  background: #f7fafb;
  cursor: grab;
  overscroll-behavior: contain;
  text-align: left;
  user-select: none;
}

.viewer-zoom-stage.dragging {
  cursor: grabbing;
}

.viewer-image,
.viewer-frame {
  width: 100%;
  height: min(76vh, 820px);
  border: 0;
  background: #f7fafb;
}

.viewer-image {
  display: block;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  transition: width 0.18s ease;
  user-select: none;
}

.viewer-pdf-stage {
  width: 100%;
  height: min(76vh, 820px);
  overflow-x: auto;
  overflow-y: hidden;
  background: #f7fafb;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.viewer-pdf-stage .viewer-frame {
  display: block;
  min-width: 100%;
  max-width: none;
}

.viewer-download {
  display: grid;
  place-items: center;
  gap: 16px;
  min-height: 360px;
  padding: 30px;
  text-align: center;
}

