[hidden] {
  display: none !important;
}

.site-nav a[aria-current="page"] {
  color: var(--accent);
}

.site-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.portal-main {
  gap: 32px;
}

.portal-page-head,
.portal-shell,
.portal-preview-card,
.portal-side-card,
.portal-panel,
.portal-sidebar,
.portal-detail,
.portal-detail-section {
  border: 1px solid rgba(17, 17, 17, 0.1);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.portal-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 30px;
}

.portal-page-head h1 {
  margin: 0;
  max-width: 12ch;
}

.portal-page-head .hero-text {
  max-width: 62ch;
  margin-top: 16px;
}

.portal-shell {
  display: grid;
  gap: 22px;
  padding: 22px;
}

.portal-gate-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 22px;
}

.portal-side-card,
.portal-entry-panel {
  padding: 24px;
}

.portal-session {
  display: grid;
  gap: 22px;
}

.portal-session-top,
.portal-toolbar,
.portal-inline-actions,
.portal-ticket-top,
.portal-detail-head,
.portal-activity-head,
.portal-message-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.portal-preview-card,
.portal-toolbar {
  padding: 18px 20px;
}

.portal-preview-card {
  background: linear-gradient(135deg, rgba(214, 40, 40, 0.08), rgba(255, 255, 255, 0.94));
}

.portal-inline-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  color: var(--accent);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  word-break: break-all;
}

.portal-stats {
  margin: 0;
}

.portal-stat-card p {
  margin-bottom: 0;
}

.portal-toolbar {
  align-items: end;
}

.portal-queue-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.portal-queue-tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 999px;
  background: #ffffff;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.portal-queue-tab strong {
  color: var(--accent);
}

.portal-queue-tab.is-active {
  border-color: rgba(214, 40, 40, 0.4);
  box-shadow: 0 10px 24px rgba(214, 40, 40, 0.12);
  transform: translateY(-1px);
}

.portal-search {
  display: grid;
  gap: 8px;
  min-width: min(340px, 100%);
  font-weight: 700;
}

.portal-search input,
.portal-form-grid input,
.portal-form-grid textarea,
.portal-form-grid select {
  width: 100%;
  padding: 14px 16px;
  color: var(--text);
  font: inherit;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 16px;
  background: #ffffff;
}

.portal-search input:focus,
.portal-form-grid input:focus,
.portal-form-grid textarea:focus,
.portal-form-grid select:focus {
  outline: 2px solid rgba(214, 40, 40, 0.24);
  border-color: rgba(214, 40, 40, 0.42);
}

.portal-dashboard {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.portal-sidebar,
.portal-detail {
  padding: 18px;
}

.portal-ticket-list,
.portal-activity-list,
.portal-message-list,
.portal-attachment-list {
  display: grid;
  gap: 14px;
}

.portal-ticket-card {
  width: 100%;
  padding: 18px;
  text-align: left;
  color: inherit;
  font: inherit;
  border: 1px solid rgba(17, 17, 17, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.portal-ticket-card:hover,
.portal-ticket-card:focus-visible,
.portal-ticket-card.is-active {
  border-color: rgba(214, 40, 40, 0.32);
  box-shadow: 0 16px 32px rgba(214, 40, 40, 0.08);
  transform: translateY(-1px);
}

.portal-ticket-card h3,
.portal-detail-head h2,
.portal-section-head h3 {
  margin: 0;
  line-height: 1.02;
}

.portal-ticket-subtitle,
.portal-ticket-meta,
.portal-meta,
.portal-note {
  margin: 0;
  color: var(--muted);
}

.portal-ticket-subtitle {
  margin-top: 12px;
  line-height: 1.55;
}

.portal-ticket-meta,
.portal-meta {
  font-size: 0.94rem;
}

.portal-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.portal-flag,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-flag {
  color: #111111;
  border-color: rgba(17, 17, 17, 0.12);
  background: rgba(17, 17, 17, 0.06);
}

.portal-flag--accent {
  color: #8c1717;
  border-color: rgba(214, 40, 40, 0.16);
  background: rgba(214, 40, 40, 0.12);
}

.status-pill--neutral {
  color: #303030;
  border-color: rgba(17, 17, 17, 0.1);
  background: rgba(17, 17, 17, 0.06);
}

.status-pill--accent {
  color: #8c1717;
  border-color: rgba(214, 40, 40, 0.16);
  background: rgba(214, 40, 40, 0.12);
}

.status-pill--dark {
  color: #ffffff;
  border-color: rgba(17, 17, 17, 0.14);
  background: #111111;
}

.status-pill--success {
  color: #155c2f;
  border-color: rgba(47, 140, 83, 0.18);
  background: rgba(47, 140, 83, 0.14);
}

.status-pill--warning {
  color: #8f5b03;
  border-color: rgba(199, 128, 0, 0.2);
  background: rgba(199, 128, 0, 0.14);
}

.portal-detail {
  display: grid;
  gap: 18px;
}

.portal-detail-section {
  padding: 22px;
  box-shadow: none;
}

.portal-section-head .eyebrow {
  margin-bottom: 8px;
}

.portal-overview-grid,
.portal-data-grid,
.portal-form-grid,
.portal-inline-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.portal-form-grid--tight {
  margin-top: 0;
}

.portal-overview-card,
.portal-inline-summary-card,
.portal-data-grid div,
.portal-wide-card,
.portal-attachment-item,
.portal-activity-item,
.portal-message {
  padding: 16px;
  border: 1px solid rgba(17, 17, 17, 0.09);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
}

.portal-overview-card strong,
.portal-inline-summary-card strong,
.portal-wide-card strong {
  display: block;
  margin-bottom: 8px;
}

.portal-overview-card p,
.portal-inline-summary-card p,
.portal-wide-card p,
.portal-message p,
.portal-activity-item p,
.portal-attachment-item p {
  margin: 0;
  line-height: 1.6;
}

.portal-data-grid dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.portal-data-grid dd {
  margin: 8px 0 0;
  font-weight: 700;
  line-height: 1.45;
}

.portal-form-grid {
  margin-top: 16px;
}

.portal-form-grid label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.portal-form-span {
  grid-column: 1 / -1;
}

.portal-check {
  align-content: center;
}

.portal-check span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}

.portal-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.portal-checklist,
.portal-entry-card-head,
.portal-subsection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.portal-checklist {
  margin-top: 16px;
}

.portal-entry-stack {
  display: grid;
  gap: 12px;
}

.portal-entry-card {
  padding: 16px;
  border: 1px solid rgba(17, 17, 17, 0.09);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
}

.portal-entry-card-head {
  margin-bottom: 12px;
}

.portal-entry-card-head strong,
.portal-subsection-head h4 {
  margin: 0;
}

.portal-subsection-head {
  margin-bottom: 12px;
}

.portal-description {
  margin: 16px 0 0;
  line-height: 1.65;
}

.button-small {
  min-height: 36px;
  padding: 0 14px;
  font-size: 0.82rem;
}

.portal-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.04);
  font-weight: 700;
}

.portal-message--staff {
  border-color: rgba(214, 40, 40, 0.18);
  background: rgba(214, 40, 40, 0.05);
}

.portal-attachment-item span,
.portal-activity-head span,
.portal-message-head span {
  color: var(--muted);
  font-size: 0.92rem;
}

.portal-empty {
  padding: 24px;
  border: 1px dashed rgba(17, 17, 17, 0.18);
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.82);
}

.portal-empty--compact {
  padding: 16px;
}

.portal-invoice-table {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.portal-invoice-table div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(17, 17, 17, 0.09);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
}

.portal-invoice-total {
  border-color: rgba(214, 40, 40, 0.18) !important;
  background: rgba(214, 40, 40, 0.06) !important;
}

.form-note.is-success {
  color: #155c2f;
}

.form-note.is-error {
  color: #8c1717;
}

@media (max-width: 1100px) {
  .portal-gate-grid,
  .portal-dashboard,
  .portal-page-head {
    grid-template-columns: 1fr;
  }

  .portal-page-head {
    align-items: start;
  }
}

@media (max-width: 760px) {
  .portal-page-head,
  .portal-shell,
  .portal-side-card,
  .portal-entry-panel,
  .portal-sidebar,
  .portal-detail,
  .portal-detail-section {
    padding: 18px;
  }

  .portal-overview-grid,
  .portal-data-grid,
  .portal-form-grid,
  .portal-inline-summary {
    grid-template-columns: 1fr;
  }

  .portal-search {
    min-width: 100%;
  }
}
