/* V357: ticket list and detail readability. All colors come from the active
   portal theme; screen-only rules leave the existing print layout intact. */
@media screen {
  body[data-portal-page="tickets"] #content {
    --it357-secondary: color-mix(in srgb, var(--text) 75%, var(--muted));
  }

  body[data-portal-page="tickets"] #content .page-head p {
    font-size: 14px;
    line-height: 1.65;
  }
  body[data-portal-page="tickets"] #content .head-actions .btn {
    font-size: 13px;
    line-height: 1.5;
  }
  body[data-portal-page="tickets"] #content .back-link {
    font-size: 13px;
  }

  body[data-portal-page="tickets"] #content .list-toolbar {
    gap: 12px;
    padding: 18px 20px;
  }
  body[data-portal-page="tickets"] #content .list-search input,
  body[data-portal-page="tickets"] #content .list-toolbar select {
    min-height: 44px;
    font-size: 14px;
    line-height: 1.5;
  }
  body[data-portal-page="tickets"] #content .list-search svg {
    top: 50%;
    transform: translateY(-50%);
  }
  body[data-portal-page="tickets"] #content .list-count,
  body[data-portal-page="tickets"] #content .pagination,
  body[data-portal-page="tickets"] #content .pagination span,
  body[data-portal-page="tickets"] #content .pagination .btn {
    font-size: 12px;
    line-height: 1.5;
  }
  body[data-portal-page="tickets"] #content .list-count,
  body[data-portal-page="tickets"] #content .pagination {
    color: var(--it357-secondary, var(--text));
  }
  body[data-portal-page="tickets"] #content .list-table {
    min-width: 980px;
    font-size: 14px;
    line-height: 1.5;
  }
  body[data-portal-page="tickets"] #content .list-table th {
    padding: 14px 20px;
    font-size: 12px;
    font-weight: 650;
    letter-spacing: .15px;
    text-transform: none;
    color: var(--it357-secondary, var(--text));
  }
  body[data-portal-page="tickets"] #content .list-table td {
    padding: 20px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
  }
  body[data-portal-page="tickets"] #content .list-table tbody tr {
    cursor: pointer;
    transition: background-color .12s ease;
  }
  body[data-portal-page="tickets"] #content .list-table tbody tr:hover,
  body[data-portal-page="tickets"] #content .list-table tbody tr:focus-within {
    background: var(--soft);
  }
  body[data-portal-page="tickets"] #content .list-table tbody tr:hover td:first-child,
  body[data-portal-page="tickets"] #content .list-table tbody tr:focus-within td:first-child {
    box-shadow: inset 3px 0 var(--primary);
  }
  body[data-portal-page="tickets"] #content .list-table .record-link {
    display: inline-block;
    font-size: 14px;
    font-weight: 750;
    line-height: 1.5;
    color: var(--primary-ink);
  }
  body[data-portal-page="tickets"] #content .list-table .record-link:focus-visible {
    outline: 2px solid var(--primary-ink);
    outline-offset: 4px;
    border-radius: 2px;
  }
  body[data-portal-page="tickets"] #content .list-table .record-secondary {
    max-width: 340px;
    margin-top: 5px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--it357-secondary, var(--text));
  }
  body[data-portal-page="tickets"] #content .list-table td .small {
    font-size: 13px;
    color: var(--it357-secondary, var(--text));
    font-variant-numeric: tabular-nums;
  }
  body[data-portal-page="tickets"] #content .badge {
    font-size: 12px;
    font-weight: 650;
    padding: 5px 9px;
    line-height: 1.4;
  }

  body[data-portal-page="tickets"] #content .card-head h2 {
    font-size: 19px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -.25px;
  }
  body[data-portal-page="tickets"] #content .card-head p {
    font-size: 13px;
    line-height: 1.6;
    color: var(--it357-secondary, var(--text));
  }
  body[data-portal-page="tickets"] #content .detail-description {
    font-size: 15px;
    line-height: 1.75;
    overflow-wrap: anywhere;
  }
  body[data-portal-page="tickets"] #content .detail-meta {
    column-gap: 24px;
    row-gap: 24px;
    padding: 25px 24px;
  }
  body[data-portal-page="tickets"] #content .detail-meta .kv {
    min-width: 0;
  }
  body[data-portal-page="tickets"] #content .detail-meta .kv small {
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 6px;
    color: var(--it357-secondary, var(--text));
  }
  body[data-portal-page="tickets"] #content .detail-meta .kv b {
    display: block;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
  }
  body[data-portal-page="tickets"] #content .detail-grid .small,
  body[data-portal-page="tickets"] #content .detail-grid .check-label,
  body[data-portal-page="tickets"] #content .detail-grid .document-name small,
  body[data-portal-page="tickets"] #content .detail-grid .timeline small,
  body[data-portal-page="tickets"] #content .detail-grid .timeline .audit-note {
    font-size: 12px;
    line-height: 1.6;
  }
  body[data-portal-page="tickets"] #content .detail-grid .comment-header {
    flex-wrap: wrap;
    gap: 5px 12px;
    font-size: 14px;
    line-height: 1.5;
  }
  body[data-portal-page="tickets"] #content .detail-grid .comment-header span {
    font-size: 12px;
    line-height: 1.5;
  }
  body[data-portal-page="tickets"] #content .detail-grid .comment-body,
  body[data-portal-page="tickets"] #content .detail-grid .document-name,
  body[data-portal-page="tickets"] #content .detail-grid .timeline li {
    font-size: 14px;
    line-height: 1.65;
  }
  body[data-portal-page="tickets"] #content .section-note,
  body[data-portal-page="tickets"] #content .ticket-wait {
    font-size: 14px;
    line-height: 1.65;
  }
  body[data-portal-page="tickets"] #content .ticket-progress li {
    font-size: 12px;
    line-height: 1.45;
  }
  body[data-portal-page="tickets"] #content .ticket-progress li > span {
    width: 38px;
    height: 38px;
    margin-bottom: 10px;
    font-size: 13px;
  }
  body[data-portal-page="tickets"] #content .ticket-progress li:after {
    top: 18px;
    left: calc(50% + 23px);
    right: calc(-50% + 23px);
  }
  body[data-portal-page="tickets"] #content .ticket-wait {
    padding: 12px 15px;
    gap: 10px;
    color: var(--it357-secondary, var(--text));
  }
  body[data-portal-page="tickets"] #content .empty-state {
    font-size: 14px;
  }
}

@media screen and (max-width: 760px) {
  body[data-portal-page="tickets"] #content .list-toolbar {
    padding: 15px;
    gap: 10px;
  }
  body[data-portal-page="tickets"] #content .list-search input,
  body[data-portal-page="tickets"] #content .list-toolbar select {
    font-size: 16px;
  }
  body[data-portal-page="tickets"] #content .card-head h2 {
    font-size: 18px;
  }
  body[data-portal-page="tickets"] #content .detail-meta {
    padding: 22px;
    column-gap: 16px;
    row-gap: 20px;
  }
  body[data-portal-page="tickets"] #content .ticket-progress li {
    font-size: 11px;
  }
  body[data-portal-page="tickets"] #content .ticket-progress li > span {
    width: 33px;
    height: 33px;
  }
  body[data-portal-page="tickets"] #content .ticket-progress li:after {
    top: 16px;
    left: calc(50% + 20px);
    right: calc(-50% + 20px);
  }
}

@media screen and (prefers-reduced-motion: reduce) {
  body[data-portal-page="tickets"] #content .list-table tbody tr {
    transition: none;
  }
}
