/* --- Form Elements --- */

.field-inline-error {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.875rem;
  line-height: 1.35;
  color: var(--color-error, #dc2626);
}

label {
  display: block;
  margin-bottom: 1.25rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-text);
  transition: color 200ms ease;
}

label:focus-within {
  color: var(--color-primary);
}

.required {
  color: var(--color-error);
  margin-left: 0.125rem;
}

input,
textarea,
select {
  display: block;
  width: 100%;
  margin-top: 0.375rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--focus-ring);
}

input::placeholder,
textarea::placeholder {
  color: var(--color-text-muted);
  opacity: 0.7;
}

select {
  cursor: pointer;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

/* --- Buttons --- */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding: 0.75rem 2rem;
  min-height: 44px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: background 200ms ease, transform 150ms ease;
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.btn-primary .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.625rem 1.25rem;
  min-height: 44px;
  background: var(--color-surface);
  color: var(--color-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 200ms ease, background 200ms ease;
}

.btn-secondary:hover {
  border-color: var(--color-primary);
  background: var(--color-accent-blue-bg);
}

.btn-secondary:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.btn-secondary:active:not(:disabled) {
  transform: scale(0.98);
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-text);
  margin-bottom: 0.375rem;
}

.form-hint {
  font-weight: 400;
  color: var(--color-text-muted);
}

/* --- File Upload --- */

.file-upload-area {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  padding: 1.5rem;
  margin-top: 0.375rem;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 200ms ease, background 200ms ease;
  color: var(--color-text-muted);
}

.file-upload-area:hover,
.file-upload-area.is-dragover {
  border-color: var(--color-primary);
  background: var(--color-accent-blue-bg);
}

.file-upload-area .upload-icon {
  color: var(--color-text-muted);
}

.file-upload-text {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

.file-upload-text strong {
  color: var(--color-primary);
}

.file-upload-hint {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.file-upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  margin: 0;
  padding: 0;
  border: none;
}

/* --- KB Suggestions --- */

.kb-suggestions {
  padding: 1rem;
  margin-bottom: 1rem;
  background: var(--color-accent-blue-bg);
  border: 1px solid var(--color-accent-blue-border);
  border-radius: var(--radius-md);
}

.kb-suggestions-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.kb-suggestions ul {
  margin: 0;
  padding-left: 1.25rem;
}

.kb-suggestions li {
  margin-bottom: 0.35rem;
}

.kb-suggestions a {
  color: var(--color-primary);
  font-size: 0.875rem;
  text-decoration: none;
}

.kb-suggestions a:hover {
  text-decoration: underline;
}

/* --- Confirmation --- */

#confirmation {
  text-align: center;
  background: var(--color-accent-green-bg);
  border-color: var(--color-accent-green-border);
}

.confirmation-icon {
  color: var(--color-success-icon);
  margin-bottom: 1rem;
}

#confirmation h2 {
  margin-bottom: 0.75rem;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

#confirmation p {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 0.25rem;
}

#confirmation p strong {
  color: var(--color-text);
}

/* --- Error Alert --- */

#lookup-error[hidden] {
  display: none;
}

#lookup-error {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--color-error-bg);
  border: 1px solid var(--color-error-border);
  border-radius: var(--radius-sm);
  color: var(--color-error);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

#lookup-error .alert-icon {
  flex-shrink: 0;
  margin-top: 0.1rem;
}

#lookup-error .alert-msg {
  flex: 1;
  line-height: 1.5;
}

/* --- Ticket Status --- */

#ticket-status {
  margin-top: 2rem;
}

#ticket-status h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.status-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* --- Badges --- */

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-open { background: var(--color-badge-open-bg); color: var(--color-badge-open-text); }
.badge-in_progress { background: var(--color-badge-progress-bg); color: var(--color-badge-progress-text); }
.badge-waiting_on_customer { background: var(--color-badge-waiting-bg); color: var(--color-badge-waiting-text); }
.badge-resolved { background: var(--color-badge-resolved-bg); color: var(--color-badge-resolved-text); }
.badge-closed { background: var(--color-badge-closed-bg); color: var(--color-badge-closed-text); }

/* --- Thread --- */

.thread-message {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  margin-bottom: 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.thread-customer {
  border-left: 3px solid var(--color-primary);
}

.thread-agent {
  border-left: 3px solid var(--color-cta);
  background: var(--color-note-bg);
}

.thread-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.thread-customer .thread-avatar {
  background: var(--color-accent-blue-bg);
  color: var(--color-primary);
}

.thread-agent .thread-avatar {
  background: var(--color-surface-alt);
  color: var(--color-cta);
  border: 1px solid var(--color-note-border);
}

.thread-content {
  flex: 1;
  min-width: 0;
}

.thread-meta {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 0.375rem;
}

.thread-body {
  line-height: 1.7;
  font-size: 0.9375rem;
  word-break: break-word;
  white-space: pre-wrap;
}

/* --- Reply Form --- */

#reply-form,
.portal-detail-attachments {
  margin: 1rem 0 0;
}

.portal-detail-attachments ul {
  margin: 0.35rem 0 0;
  padding-left: 1.25rem;
}

.portal-reply-form {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.portal-reply-heading {
  font-size: 1.125rem;
  margin: 0 0 0.75rem;
  color: var(--color-text);
}

.portal-reply-form label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.portal-reply-form textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-bottom: 0.75rem;
}

.portal-attach-label {
  display: block;
  margin-top: 0.5rem;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.portal-reply-files-hint {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
}

.portal-reply-file {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-bottom: 0.75rem;
  font: inherit;
}

/* --- CSAT --- */

.csat-section {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-align: center;
}

.csat-section h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.csat-prompt {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.csat-stars {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.csat-star {
  font-size: 2rem;
  background: none;
  border: none;
  color: var(--color-star-inactive);
  cursor: pointer;
  transition: color 150ms ease, transform 150ms ease;
  padding: 0.25rem;
  min-width: 44px;
  min-height: 44px;
}

.csat-star:hover,
.csat-star-active {
  color: var(--color-star-active);
  transform: scale(1.15);
}

@media (prefers-reduced-motion: reduce) {
  .csat-star {
    transition: none;
  }

  .csat-star:hover,
  .csat-star-active {
    transform: none;
  }
}

.csat-star:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.csat-section textarea {
  margin-bottom: 1rem;
}

#csat-submit,
#portal-csat-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.5rem;
  min-height: 44px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 200ms ease;
}

#csat-submit:hover:not(:disabled),
#portal-csat-submit:hover:not(:disabled) {
  background: var(--color-primary-hover);
}

#csat-submit:disabled,
#portal-csat-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.csat-thanks-msg {
  color: var(--color-success-icon);
  font-weight: 600;
  font-size: 1.1rem;
}

/* --- Support landing: warmer hero + chat (KB RAG) --- */

.support-landing .support-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% -20%, rgba(37, 99, 235, 0.12), transparent 55%),
    radial-gradient(80% 50% at 100% 50%, rgba(99, 102, 241, 0.08), transparent 45%),
    var(--color-surface);
  border-bottom-color: var(--color-border);
  padding-top: 2.75rem;
  padding-bottom: 2.75rem;
}

[data-theme='dark'] .support-landing .support-hero {
  background:
    radial-gradient(120% 80% at 50% -20%, rgba(59, 130, 246, 0.18), transparent 55%),
    radial-gradient(80% 50% at 100% 50%, rgba(129, 140, 248, 0.1), transparent 45%),
    var(--color-surface);
}

.support-hero-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin: 0 0 0.5rem;
}

.support-landing .support-hero h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1.2;
  margin-bottom: 0.65rem;
}

.support-landing .support-hero .hero-subtitle {
  font-size: 1.0625rem;
  line-height: 1.55;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

/* --- Help assistant (KB RAG chat) --- */

.support-chat-card {
  position: relative;
  margin-bottom: 1.5rem;
  padding-top: 1.75rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.support-chat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: linear-gradient(90deg, var(--color-primary), #6366f1, #0ea5e9);
  opacity: 0.9;
}

.support-chat-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.support-chat-card-head-text {
  flex: 1;
  min-width: min(100%, 12rem);
}

.support-chat-title {
  margin-top: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.support-chat-tagline {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.45;
}

.support-chat-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-accent-blue-bg);
  border: 1px solid var(--color-accent-blue-border);
  border-radius: 999px;
  white-space: nowrap;
}

.support-chat-intro {
  color: var(--color-text-muted, #64748b);
  font-size: 0.9375rem;
  margin-bottom: 0.85rem;
  line-height: 1.55;
}

.support-chat-details {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-alt);
}

.support-chat-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--color-text);
  padding: 0.15rem 0;
}

.support-chat-details summary:hover {
  color: var(--color-primary);
}

.support-chat-details summary:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.support-chat-details-body {
  margin: 0.65rem 0 0.15rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  line-height: 1.55;
}

.support-chat-chips-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 0.5rem;
}

.support-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.support-chat-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.5rem 1rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
  transition:
    border-color 180ms var(--ease-out, ease),
    background 180ms var(--ease-out, ease),
    color 180ms ease;
}

.support-chat-chip:hover {
  border-color: var(--color-primary);
  background: var(--color-accent-blue-bg);
  color: var(--color-primary);
}

.support-chat-chip:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  .support-chat-chip:active {
    transform: scale(0.98);
  }
}

.support-chat-handoff-hint {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--color-text);
  background: var(--color-accent-blue-bg, #eff6ff);
  border: 1px solid var(--color-accent-blue-border, #bfdbfe);
  border-radius: var(--radius-md);
}

.support-chat-log {
  min-height: 11rem;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  padding: 1rem 0.85rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-md);
  background: var(--color-surface-alt, #f8fafc);
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scroll-behavior: smooth;
}

.support-chat-msg {
  max-width: 100%;
}

.support-chat-msg-row {
  display: flex;
  align-items: flex-end;
  gap: 0.65rem;
  max-width: 100%;
}

.support-chat-msg-user .support-chat-msg-row {
  flex-direction: row-reverse;
}

.support-chat-avatar {
  flex-shrink: 0;
  width: 2.125rem;
  height: 2.125rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.support-chat-avatar svg {
  display: block;
}

.support-chat-avatar-assistant {
  background: linear-gradient(145deg, var(--color-primary) 0%, #4f46e5 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.support-chat-avatar-user {
  background: var(--color-surface);
  color: var(--color-primary);
  border: 1px solid var(--color-accent-blue-border);
}

[data-theme='dark'] .support-chat-avatar-user {
  background: var(--color-surface-alt);
}

.support-chat-msg-body {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.support-chat-msg-user .support-chat-msg-body {
  background: var(--color-accent-blue-bg, #eff6ff);
  border: 1px solid var(--color-accent-blue-border, #bfdbfe);
  color: var(--color-text);
  border-bottom-right-radius: 0.35rem;
}

.support-chat-msg-assistant .support-chat-msg-body {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  border-bottom-left-radius: 0.35rem;
}

.support-chat-msg-sources {
  margin-top: 0.5rem;
  margin-left: 2.75rem;
  padding: 0.5rem 0.65rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.support-chat-sources-label {
  font-weight: 600;
  display: block;
  margin-bottom: 0.25rem;
}

.support-chat-msg-sources ul {
  margin: 0;
  padding-left: 1.2rem;
}

.support-chat-composer {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.support-chat-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.9375rem;
  resize: vertical;
  min-height: 2.75rem;
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.support-chat-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--focus-ring);
}

.support-chat-input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.7;
}

.support-chat-log[aria-busy='true'] {
  opacity: 0.92;
  pointer-events: none;
}

.support-chat-hint {
  margin: 0;
}

.support-chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.support-chat-open-ticket-emphasis {
  box-shadow: 0 0 0 2px var(--color-primary);
}

.support-chat-skip-wrap {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
}

.support-ticket-section {
  margin-bottom: 1.5rem;
}

.support-ticket-lead {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  margin: -0.35rem 0 1rem;
  line-height: 1.45;
}

.field-hint {
  margin: -0.75rem 0 1rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted, #64748b);
}

.link-inline {
  color: var(--color-primary);
  font-weight: 600;
}

/* --- Portal (my tickets) --- */

.btn-link {
  background: none;
  border: none;
  color: var(--color-primary, #2563eb);
  cursor: pointer;
  text-decoration: underline;
  padding: 0.5rem 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font: inherit;
  text-align: left;
}

.btn-link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.portal-card-footnote {
  margin-top: 1rem;
}

#portal-request-form label[for='portal-email'] {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

#portal-request-form #portal-email {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-bottom: 0.75rem;
}

#portal-main:focus {
  outline: none;
}

#portal-main:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.portal-empty-state {
  margin: 0;
  padding: 1rem 0;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  text-align: center;
}

.portal-csat-thanks:focus {
  outline: none;
}

.portal-csat-thanks:focus-visible {
  outline: 2px solid var(--color-success-icon, #16a34a);
  outline-offset: 2px;
}

#portal-ticket-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

#portal-ticket-table th,
#portal-ticket-table td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
}

.portal-toolbar {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  align-items: center;
}

.turnstile-form-hint {
  margin-top: 0.5rem;
  max-width: 42rem;
}

.alert-success {
  background: var(--color-accent-green-bg);
  border: 1px solid var(--color-accent-green-border);
  color: var(--color-badge-resolved-text);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.alert-error {
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: rgba(220, 38, 38, 0.08);
  color: var(--color-error, #b91c1c);
  font-size: 0.875rem;
}

.portal-linked-assets {
  margin: 1.25rem 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-sm, 8px);
  background: var(--surface-alt, #f8fafc);
}

.portal-linked-assets-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.portal-linked-assets-intro {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
}

.portal-linked-assets-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.portal-linked-assets-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  font-size: 0.9rem;
}

.portal-linked-assets-item:last-child {
  border-bottom: none;
}

.portal-asset-name {
  font-weight: 600;
  color: var(--color-text);
}

/* --- Responsive --- */

@media (max-width: 640px) {
  .status-meta {
    gap: 0.5rem;
  }

  .thread-message {
    flex-direction: column;
    gap: 0.5rem;
  }

  .thread-avatar {
    width: 28px;
    height: 28px;
  }
}


#portal-ticket-table tbody tr {
  cursor: pointer;
  transition: background 0.15s var(--ease-out);
}

#portal-ticket-table tbody tr:hover,
#portal-ticket-table tbody tr:focus-within {
  background: var(--color-surface-alt);
}

@media (max-width: 640px) {
  #portal-ticket-table {
    font-size: 0.875rem;
  }

  #portal-ticket-table th,
  #portal-ticket-table td {
    padding: 0.5rem 0.625rem;
    white-space: nowrap;
  }
}


/* Quick nav — mobile-first portal IA (2026 self-service research) */
.support-quick-nav {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: var(--content-max, 720px);
  margin: -0.5rem auto 0;
  padding: 0 1.5rem 0.75rem;
  scrollbar-width: none;
}

.support-quick-nav::-webkit-scrollbar { display: none; }

.support-quick-nav-item {
  flex: 0 0 auto;
  min-height: var(--touch-min, 44px);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s var(--ease-out), background 0.15s var(--ease-out);
}

.support-quick-nav-item:hover,
.support-quick-nav-item:focus-visible {
  border-color: var(--color-primary);
  background: var(--color-accent-blue-bg);
}

.support-quick-nav-item.is-active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* Portal ticket list — card layout on mobile (Coveo/Nielsen chunking) */
@media (max-width: 640px) {
  #portal-ticket-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  #portal-ticket-table,
  #portal-ticket-table tbody,
  #portal-ticket-table tr,
  #portal-ticket-table td {
    display: block;
    width: 100%;
  }

  #portal-ticket-table tr[data-ticket-id] {
    margin-bottom: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
  }

  #portal-ticket-table tr[data-ticket-id] td {
    padding: 0.15rem 0;
    border: none;
    white-space: normal;
  }

  #portal-ticket-table tr[data-ticket-id] td:first-child {
    font-weight: 600;
    margin-bottom: 0.35rem;
  }

  #portal-ticket-table tr[data-ticket-id] td:nth-child(2) {
    font-size: 1rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
  }

  #portal-ticket-table tr[data-ticket-id] td:nth-child(3),
  #portal-ticket-table tr[data-ticket-id] td:nth-child(4) {
    display: inline-block;
    margin-right: 0.75rem;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
  }
}

.portal-skeleton {
  background: linear-gradient(90deg, var(--color-surface-alt) 25%, var(--color-border) 50%, var(--color-surface-alt) 75%);
  background-size: 200% 100%;
  animation: portal-shimmer 1.2s ease-in-out infinite;
  border-radius: var(--radius-sm);
  min-height: 1rem;
}

@keyframes portal-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
