/* Support desk and the public portal. Scoped so it does not depend on a Tailwind rebuild. */
.hd-wrap { display: flex; flex-direction: column; gap: 16px; }
.hd-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hd-grow { flex: 1; min-width: 0; }
.hd-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.hd-stat {
  border: 1px solid rgb(var(--gray-200));
  background: rgb(var(--gray-0));
  border-radius: 12px;
  padding: 12px 14px;
  text-align: start;
  cursor: pointer;
  width: 100%;
}
.hd-stat:hover { border-color: rgb(var(--gray-300)); background: rgb(var(--gray-50)); }
.hd-stat b { display: block; font-size: 22px; line-height: 1.1; }
.hd-stat span { color: rgb(var(--gray-600)); font-size: 12px; }
.hd-card { border: 1px solid rgb(var(--gray-200)); background: rgb(var(--gray-0)); border-radius: 14px; padding: 16px; }
.hd-title { margin: 0; font-size: 20px; font-weight: 700; }
.hd-muted { color: rgb(var(--gray-600)); font-size: 13px; }
.hd-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.hd-input, .hd-select, .hd-area {
  width: 100%; border: 1px solid rgb(var(--gray-300)); background: rgb(var(--gray-0)); color: rgb(var(--gray-900));
  border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14px;
}
.hd-area { min-height: 96px; resize: vertical; }
.hd-input:focus, .hd-select:focus, .hd-area:focus { outline: 2px solid rgb(var(--primary-default) / 0.35); border-color: rgb(var(--primary-default)); }
.hd-label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.hd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.hd-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.hd-table th { text-align: start; font-size: 12px; color: rgb(var(--gray-600)); font-weight: 600; padding: 8px; border-bottom: 1px solid rgb(var(--gray-200)); }
.hd-table td { padding: 10px 8px; border-bottom: 1px solid rgb(var(--gray-100)); vertical-align: top; }
.hd-table tr.hd-click { cursor: pointer; }
.hd-table tr.hd-click:hover { background: rgb(var(--gray-50)); }
.hd-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 600; background: rgb(var(--gray-100)); color: rgb(var(--gray-800)); }
.hd-status-open { background: #e7f6f6; color: #017e84; }
.hd-status-pending { background: #fff4e8; color: #b86112; }
.hd-status-waiting { background: #eef2ff; color: #3b4db8; }
.hd-status-resolved { background: #e9f8ef; color: #1f7a45; }
.hd-status-closed { background: rgb(var(--gray-100)); color: rgb(var(--gray-600)); }
.hd-split { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
@media (max-width: 900px) { .hd-split { grid-template-columns: 1fr; } }
.hd-thread { display: flex; flex-direction: column; gap: 10px; max-height: 58vh; overflow: auto; padding: 4px; }
.hd-msg { max-width: min(640px, 92%); border-radius: 14px; padding: 10px 12px; background: rgb(var(--gray-50)); border: 1px solid rgb(var(--gray-200)); }
.hd-msg-agent, .hd-msg-ai { margin-inline-start: auto; background: #f6f0f4; border-color: #e4d5df; }
.hd-msg-note { background: #fff8e8; border-style: dashed; }
.hd-msg-system { max-width: 100%; background: transparent; border: 0; color: rgb(var(--gray-500)); font-size: 12px; text-align: center; padding: 2px; }
.hd-msg-file {
  margin-inline-start: auto;
  max-width: min(280px, 92%);
  background: #f6f0f4;
  border-color: #e4d5df;
  padding: 8px;
}
.hd-msg-body { white-space: pre-wrap; word-break: break-word; font-size: 14px; }
.hd-msg-meta { display: flex; gap: 8px; font-size: 11px; color: rgb(var(--gray-500)); margin-bottom: 4px; }
.hd-files {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  margin-top: 12px;
  margin-inline-start: auto;
  max-width: 100%;
}
.hd-files-label {
  font-size: 12px;
  font-weight: 600;
  color: rgb(var(--gray-500));
  text-align: end;
  width: 100%;
}
.hd-files-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}
.hd-file-card {
  display: flex;
  flex-direction: column;
  width: 140px;
  overflow: hidden;
  border: 1px solid rgb(var(--gray-200));
  border-radius: 12px;
  background: rgb(var(--gray-0));
  text-decoration: none;
  color: inherit;
  box-shadow: 0 4px 14px -10px rgba(15, 23, 42, 0.35);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.hd-file-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -12px rgba(15, 23, 42, 0.4);
}
.hd-file-thumb {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: cover;
  background: rgb(var(--gray-100));
}
.hd-file-doc {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 110px;
  background: color-mix(in srgb, #714b67 12%, rgb(var(--gray-50)));
  color: #714b67;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.hd-file-name {
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  color: rgb(var(--gray-800));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hd-side { display: flex; flex-direction: column; gap: 10px; }
.hd-side dl { margin: 0; display: grid; gap: 6px; font-size: 13px; }
.hd-side dt { color: rgb(var(--gray-500)); }
.hd-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.hd-tab { border: 1px solid rgb(var(--gray-200)); background: rgb(var(--gray-0)); border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.hd-tab.is-on { background: rgb(var(--primary-default)); color: rgb(var(--primary-foreground)); border-color: transparent; }
.hd-portal { max-width: 920px; margin: 0 auto; padding: 28px 16px 48px; }
.hd-hero { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 18px; }
.hd-hero h1 { margin: 0 0 6px; font-size: 32px; letter-spacing: -0.03em; }
.hd-portal-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.hd-portal-nav a { text-decoration: none; border-radius: 999px; padding: 8px 14px; background: rgb(var(--gray-0)); border: 1px solid rgb(var(--gray-200)); font-weight: 600; font-size: 14px; }
.hd-list-btn { width: 100%; text-align: start; border: 0; background: transparent; padding: 10px 0; border-bottom: 1px solid rgb(var(--gray-100)); cursor: pointer; font: inherit; }
.hd-check { display: flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 500; }
.hd-error { color: #9f1239; font-size: 13px; }
.hd-kb { white-space: pre-wrap; line-height: 1.55; }
