/**
 * Portal v2 skin — legacy (v1) content markup, inidel.com tokens.
 * Loaded only when portal-theme-v2 is active (after shell CSS).
 */

body.portal-theme-v2 {
  --bg-primary: var(--ink-950, #0a0f12);
  --bg-secondary: var(--ink-900, #111820);
  --bg-card: var(--ink-850, #141c22);
  --border-color: var(--line, #232d33);
  --text-primary: var(--text, #e8edf0);
  --text-secondary: var(--text-muted, #8e9ba2);
  --accent: var(--action, #507080);
  --sidebar-bg: var(--ink-950, #0a0f12);
  --sidebar-text: var(--text-muted, #8e9ba2);
  --sidebar-active: var(--action, #507080);
  --input-bg: var(--ink-900, #111820);
  --input-border: var(--line-strong, #2f3a42);
  --table-stripe: var(--ink-850, #141c22);
  --badge-inactive-bg: var(--ink-800, #172026);
  --badge-inactive-text: var(--text-muted, #8e9ba2);
  font-family: var(--font-sans, "Geist", system-ui, sans-serif);
}

body.portal-theme-v2 .admin-content,
body.portal-theme-v2.portal-client-shell .admin-content {
  color: var(--text-primary);
}

/* Global form controls (all screens) */
body.portal-theme-v2 input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]),
body.portal-theme-v2 select,
body.portal-theme-v2 textarea {
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-2, 6px);
  padding: 0.55rem 0.75rem;
  min-height: 2.25rem;
  box-sizing: border-box;
}

body.portal-theme-v2 input[type="checkbox"],
body.portal-theme-v2 input[type="radio"] {
  accent-color: var(--accent);
  width: 1rem;
  height: 1rem;
}

body.portal-theme-v2 button,
body.portal-theme-v2 input[type="submit"],
body.portal-theme-v2 input[type="button"],
body.portal-theme-v2 .btn,
body.portal-theme-v2 .btn-small {
  font-family: inherit;
  font-size: 0.85rem;
  border-radius: var(--radius-2, 6px);
  cursor: pointer;
}

body.portal-theme-v2 .btn-primary,
body.portal-theme-v2 .btn-small.btn-primary {
  background: var(--accent);
  color: var(--on-action, #fff);
  border: 1px solid var(--accent);
}

body.portal-theme-v2 .btn-secondary,
body.portal-theme-v2 .btn-small.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--input-border);
}

body.portal-theme-v2 .toolbar,
body.portal-theme-v2 .fin-toolbar,
body.portal-theme-v2 .people-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

/* KPI / overview */
body.portal-theme-v2 .kpi-grid {
  display: grid;
  gap: 1rem;
}
body.portal-theme-v2 .kpi-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
body.portal-theme-v2 .kpi-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) {
  body.portal-theme-v2 .kpi-grid-3,
  body.portal-theme-v2 .kpi-grid-4 { grid-template-columns: 1fr 1fr; }
}

body.portal-theme-v2 .kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-3, 8px);
  padding: 1rem 1.1rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

body.portal-theme-v2 .kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

body.portal-theme-v2 .kpi-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

body.portal-theme-v2 .kpi-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

body.portal-theme-v2 .kpi-danger { color: var(--error, #e57373); }

/* Tables / panels */
body.portal-theme-v2 .dash-panel,
body.portal-theme-v2 .chart-panel,
body.portal-theme-v2 .fin-card,
body.portal-theme-v2 .stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-3, 8px);
}

body.portal-theme-v2 .mini-table th,
body.portal-theme-v2 table th {
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

body.portal-theme-v2 .mini-table td,
body.portal-theme-v2 table td {
  border-color: var(--border-color);
  vertical-align: middle;
}

body.portal-theme-v2 .prog-wrap {
  background: var(--ink-800, #172026);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
}

body.portal-theme-v2 .prog-bar { height: 100%; border-radius: 4px; }

/* Ticket summary semantic colors (match v1 meaning) */
body.portal-theme-v2 .badge-open { background: color-mix(in srgb, #e67e22 22%, transparent); color: #f0b27a; }
body.portal-theme-v2 .badge-progress { background: color-mix(in srgb, #64b5f6 22%, transparent); color: #90caf9; }
body.portal-theme-v2 .badge-closed { background: color-mix(in srgb, #27ae60 22%, transparent); color: #6fcf97; }

/* Reminders — compact row actions */
body.portal-theme-v2 .reminder-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

body.portal-theme-v2 .reminder-done-form { display: inline; margin: 0; }

body.portal-theme-v2 .reminder-done-btn {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--input-border);
  background: var(--bg-card);
  color: var(--success, #6fcf97);
  border-radius: var(--radius-2, 6px);
  line-height: 1;
}

body.portal-theme-v2 .reminder-view-link {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}

body.portal-theme-v2 .reminders-panel .mini-table td,
body.portal-theme-v2 .reminders-panel .mini-table th {
  padding: 0.45rem 0.65rem;
  vertical-align: middle;
}

body.portal-theme-v2 .reminder-overdue { color: #f8a5ad; }
body.portal-theme-v2 .reminder-today { color: #f0b27a; }

/* Client dashboard legacy classes */
body.portal-theme-v2 .stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

body.portal-theme-v2 .banner-warn { border-color: var(--warning, #e0a040); }
body.portal-theme-v2 .banner-bad { border-color: var(--error, #e57373); }
body.portal-theme-v2 .banner-ok { border-color: var(--accent); }

body.portal-theme-v2 .status-ok { color: var(--success, #6fcf97); }
body.portal-theme-v2 .status-warn { color: var(--warning, #f0b27a); }
body.portal-theme-v2 .status-bad { color: var(--error, #f8a5ad); }

body.portal-theme-v2 :focus-visible {
  outline: 2px solid var(--focus, #7f9cab);
  outline-offset: 2px;
}

/* —— Owner polish + v2 a11y contrast —— */

body.portal-theme-v2 .admin-btn--ghost,
body.portal-theme-v2 .admin-sidebar .admin-btn,
body.portal-theme-v2 .admin-header .admin-btn,
body.portal-theme-v2 .admin-logout-form button {
  box-shadow: none !important;
  text-shadow: none !important;
  filter: none !important;
}

body.portal-theme-v2 .dash-view-tickets-link {
  color: #9ec5d6;
  text-decoration: none;
}
body.portal-theme-v2 .dash-view-tickets-link:hover {
  color: #c5dce6;
  text-decoration: underline;
}

body.portal-theme-v2 .people-table .col-modules {
  min-width: 9.5rem;
  max-width: 11rem;
}
body.portal-theme-v2 .people-table .col-modules .pill {
  color: #c5dce6;
  background: color-mix(in srgb, var(--accent) 28%, var(--bg-card));
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-color));
}

body.portal-theme-v2 .thread .bubble-client {
  align-self: flex-start;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-left: 2px solid var(--border-color);
}
body.portal-theme-v2 .thread .bubble-admin {
  align-self: flex-end;
  background: color-mix(in srgb, var(--accent) 11%, var(--bg-card));
  color: var(--text-primary);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border-color));
  border-left: 2px solid var(--accent);
}
body.portal-theme-v2 .thread .bubble-meta {
  color: var(--text-secondary);
}

body.portal-theme-v2 .fs-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  align-items: center;
  white-space: nowrap;
}
@media (max-width: 1023px) {
  body.portal-theme-v2 .fs-actions {
    flex-wrap: wrap;
    white-space: normal;
  }
}
body.portal-theme-v2 .fs-row-new .fs-actions .btn-small {
  color: var(--text-primary);
  border-color: var(--input-border);
}

body.portal-theme-v2 .pm-task-due-cell {
  font-size: 0.8rem;
  white-space: nowrap;
}

/* PCL-007: task / project status badges stay on one line */
body.portal-theme-v2 .pm-status-badge.badge {
  display: inline-block;
  white-space: nowrap;
}
body.portal-theme-v2 #pmTasksTable td:nth-child(7) {
  white-space: nowrap;
}
body.portal-theme-v2 .pm-archive-section .pm-projects-table td:nth-child(4) .badge {
  display: inline-block;
  white-space: nowrap;
}
body.portal-theme-v2 .pm-archive-section .pm-projects-table td:nth-child(4) {
  white-space: nowrap;
}

body.portal-theme-v2 .res-tile,
body.portal-theme-v2 .comms-left,
body.portal-theme-v2 .comms-right,
body.portal-theme-v2 .call-knowledge-editor,
body.portal-theme-v2 .reception-calls-table-wrap {
  background: color-mix(in srgb, var(--bg-card) 92%, #fff 8%) !important;
  border: 1px solid rgb(255 255 255 / 0.10) !important;
  border-radius: var(--radius-3, 8px);
  transition: border-color 0.15s ease;
}
body.portal-theme-v2 .res-tile:hover,
body.portal-theme-v2 .comms-left:hover,
body.portal-theme-v2 .comms-right:hover,
body.portal-theme-v2 .call-knowledge-editor:focus-within,
body.portal-theme-v2 .reception-calls-table-wrap:hover {
  border-color: rgb(255 255 255 / 0.18) !important;
}

body.portal-theme-v2 .res-tile[class*="res-tile--"] {
  border-left-width: 3px !important;
  border-left-style: solid !important;
}
body.portal-theme-v2 .res-tile--dev-hosting { border-left-color: var(--cat-dev-hosting) !important; }
body.portal-theme-v2 .res-tile--internal-documents { border-left-color: var(--cat-internal-documents) !important; }
body.portal-theme-v2 .res-tile--ai-instruction-files { border-left-color: var(--cat-ai-instruction-files) !important; }
body.portal-theme-v2 .res-tile--seo-analytics { border-left-color: var(--cat-seo-analytics) !important; }
body.portal-theme-v2 .res-tile--tools-productivity { border-left-color: var(--cat-tools-productivity) !important; }

body.portal-theme-v2 .res-tile {
  container-type: inline-size;
  container-name: res-tile;
}
body.portal-theme-v2 .res-tile-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.375rem;
  align-items: start;
  margin-bottom: 0.5rem;
}
body.portal-theme-v2 .res-tile-name {
  min-width: 0;
}
body.portal-theme-v2 .res-cat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  justify-content: flex-end;
  align-items: center;
  max-width: 100%;
}
@container res-tile (max-width: 22rem) {
  body.portal-theme-v2 .res-tile-top {
    grid-template-columns: 1fr;
  }
  body.portal-theme-v2 .res-cat-chips {
    justify-content: flex-start;
  }
}
body.portal-theme-v2 .res-tile-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--btn-group-gap, 0.35rem);
}
body.portal-theme-v2 .res-tile-actions {
  margin-left: auto;
}

body.portal-theme-v2 #resServicesTable tbody tr.res-svc-row td:first-child {
  border-left: 3px solid transparent;
  padding-left: calc(0.75rem - 3px);
}
body.portal-theme-v2 .res-svc-row--dev-hosting td:first-child { border-left-color: var(--cat-dev-hosting); }
body.portal-theme-v2 .res-svc-row--internal-documents td:first-child { border-left-color: var(--cat-internal-documents); }
body.portal-theme-v2 .res-svc-row--ai-instruction-files td:first-child { border-left-color: var(--cat-ai-instruction-files); }
body.portal-theme-v2 .res-svc-row--seo-analytics td:first-child { border-left-color: var(--cat-seo-analytics); }
body.portal-theme-v2 .res-svc-row--tools-productivity td:first-child { border-left-color: var(--cat-tools-productivity); }
body.portal-theme-v2 .res-svc-row--design-creative td:first-child { border-left-color: var(--cat-design-creative); }
body.portal-theme-v2 .res-svc-row--finance td:first-child { border-left-color: var(--cat-finance); }

body.portal-theme-v2 .site-report-score {
  background: transparent !important;
  font-weight: 700;
}
body.portal-theme-v2 .site-report-score--excellent {
  background: color-mix(in srgb, #27ae60 18%, transparent) !important;
  color: #6fcf97 !important;
}
body.portal-theme-v2 .site-report-score--good {
  background: color-mix(in srgb, #558597 18%, transparent) !important;
  color: #9ec5d6 !important;
}
body.portal-theme-v2 .site-report-score--fair {
  background: color-mix(in srgb, #f1c40f 16%, transparent) !important;
  color: #f5d76e !important;
}
body.portal-theme-v2 .site-report-score--needs {
  background: color-mix(in srgb, #e67e22 16%, transparent) !important;
  color: #f0b27a !important;
}
body.portal-theme-v2 .site-report-score--poor {
  background: color-mix(in srgb, #c0392b 16%, transparent) !important;
  color: #f8a5ad !important;
}

body.portal-theme-v2 .fin-card .sub,
body.portal-theme-v2 .fin-card .label + .sub {
  color: #b0bec5;
}

body.portal-theme-v2 .settings-tabs a.active {
  color: var(--text-primary);
  background: var(--bg-card);
  border-color: var(--accent);
}

body.portal-theme-v2 .reception-segment a.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}
body.portal-theme-v2 .reception-segment a:not(.active) {
  color: var(--text-secondary);
}

body.portal-theme-v2 .comms-left > p,
body.portal-theme-v2 .comms-left-header + p {
  color: var(--text-secondary) !important;
}

body.portal-theme-v2 .res-tile-url {
  color: #9ec5d6;
}
body.portal-theme-v2 .res-tile-url:hover {
  color: #c5dce6;
}

body.portal-theme-v2 .pm-tab-badge {
  background: color-mix(in srgb, var(--accent) 55%, #172026);
  color: #e8edf0;
}

body.portal-theme-v2 .pm-tpl-badge,
body.portal-theme-v2 .pm-activity-et-note.badge {
  color: #e8edf0;
  background: color-mix(in srgb, var(--accent) 40%, var(--bg-card));
}

body.portal-theme-v2 .call-knowledge-editor table button.btn-secondary {
  color: #f8a5ad;
  border-color: color-mix(in srgb, #c0392b 40%, var(--border-color));
}

body.portal-theme-v2 .fin-accent-green .sub {
  color: #b0bec5;
}

body.portal-theme-v2 input[type="date"].day-time,
body.portal-theme-v2 input.day-time {
  min-height: 2.25rem;
}

body.portal-theme-v2 #knowledgeContent {
  border: 1px solid rgb(255 255 255 / 0.10) !important;
  background: var(--input-bg) !important;
}

body.portal-theme-v2 .pm-unread-dot--lit {
  box-shadow: none !important;
}

body.portal-theme-v2 .btn,
body.portal-theme-v2 .btn-small,
body.portal-theme-v2 .btn-primary,
body.portal-theme-v2 .btn-secondary,
body.portal-theme-v2 .btn-send-now {
  box-shadow: none !important;
  text-shadow: none !important;
}

body.portal-theme-v2 .people-tabs-links a.active {
  color: var(--text-primary);
}

body.portal-theme-v2 .col-modules {
  line-height: 1.45;
}

body.portal-theme-v2 .website-link {
  color: #9ec5d6;
}

body.portal-theme-v2 .people-email-link,
body.portal-theme-v2 .people-web-email-secondary {
  color: #a8b8c0;
}

body.portal-theme-v2 .fs-table .fs-actions .btn-small {
  padding: 0.3rem 0.55rem;
  font-size: 0.72rem;
}

body.portal-theme-v2 .calls-summary-cell {
  max-width: 20rem;
}

body.portal-theme-v2 .admin-content a[style*="color:#558597"] {
  color: #9ec5d6 !important;
}

body.portal-theme-v2 label span[style*="color:#666"],
body.portal-theme-v2 .form-card label span {
  color: #a8b8c0 !important;
}

body.portal-theme-v2 .fin-title-row div,
body.portal-theme-v2 .fin-chart .fin-title-row div[style*="color:#666"] {
  color: #a8b8c0 !important;
}

body.portal-theme-v2 .reception-segment a.active {
  color: #e8edf0 !important;
  background: color-mix(in srgb, var(--accent) 35%, transparent);
}

body.portal-theme-v2 .comms-placeholder > p {
  color: var(--text-secondary) !important;
}

body.portal-theme-v2 .res-cat-badge {
  color: #0a0f12 !important;
  background: #c5dce6 !important;
  border: 1px solid rgb(255 255 255 / 0.15) !important;
}

body.portal-theme-v2 .pm-badge-paused.badge {
  color: #f0b27a !important;
  background: color-mix(in srgb, #e67e22 22%, var(--bg-card)) !important;
}

body.portal-theme-v2 table form[action="/admin/call-knowledge.php"] .btn-secondary {
  color: #f8a5ad !important;
  border-color: color-mix(in srgb, #c0392b 45%, var(--border-color)) !important;
}

body.portal-theme-v2 .fs-row-new .fs-actions .btn-small,
body.portal-theme-v2 .fs-actions .btn-small.btn-danger {
  color: #fde8ea !important;
  background: #5c2329 !important;
  border-color: #dc3545 !important;
}
body.portal-theme-v2 .fs-actions a.btn-view {
  color: #fff !important;
  background: #507080 !important;
  border: 1px solid #6a8a98 !important;
}

body.portal-theme-v2 .reception-calls-table th,
body.portal-theme-v2 .reception-calls-table-wrap th {
  color: #c5dce6 !important;
}

body.portal-theme-v2 .fs-pagination .current {
  background: #507080 !important;
  border-color: #6a8a98 !important;
  color: #fff !important;
}

body.portal-theme-v2 .calls-delete-btn {
  color: #fde8ea !important;
  border-color: #dc3545 !important;
  background: #5c2329 !important;
}

/* Button groups — consistent flex gap (~12px / --space-3) */
body.portal-theme-v2 {
  --btn-group-gap: var(--space-3, 12px);
}

body.portal-theme-v2 :is(
  .portal-btn-group,
  .form-actions,
  .comms-form-actions,
  .comms-campaign-tools,
  .comms-actions,
  .toolbar,
  .fin-toolbar,
  .people-tabs,
  .add-menu,
  .fs-actions,
  .reminder-actions,
  .actions-cell,
  .pm-filter-pills,
  .res-filters,
  .res-filter-pills,
  .res-tile-actions,
  .res-toolbar
) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--btn-group-gap);
}

body.portal-theme-v2 :is(
  .portal-btn-group,
  .form-actions,
  .comms-form-actions,
  .comms-campaign-tools,
  .comms-actions,
  .toolbar,
  .fin-toolbar,
  .add-menu,
  .fs-actions,
  .reminder-actions,
  .actions-cell,
  .res-filter-pills,
  .res-tile-actions
) > :is(button, .btn, .btn-small, .btn-send-now, input[type="submit"], input[type="button"], a.btn) {
  margin: 0 !important;
}

body.portal-theme-v2 td.actions .btn-small,
body.portal-theme-v2 .fs-actions .btn-small {
  margin-right: 0 !important;
  margin-bottom: 0 !important;
}

body.portal-theme-v2 .comms-form-actions {
  justify-content: flex-start;
}

body.portal-theme-v2 .comms-campaign-tools {
  margin-top: var(--btn-group-gap);
}

/*
 * Resource library category colors (slug-keyed). Muted technical palette aligned to
 * inidel admin tokens — low chroma, no neon. Usage: chips, filter pills, tile stripe.
 */
body.portal-theme-v2 {
  --cat-dev-hosting: #7a9ab8;
  --cat-dev-hosting-fill: rgb(122 154 184 / 0.14);
  --cat-internal-documents: #8a939c;
  --cat-internal-documents-fill: rgb(138 147 156 / 0.14);
  --cat-ai-instruction-files: #9a8cad;
  --cat-ai-instruction-files-fill: rgb(154 140 173 / 0.14);
  --cat-seo-analytics: #6a9494;
  --cat-seo-analytics-fill: rgb(106 148 148 / 0.14);
  --cat-tools-productivity: #9a9484;
  --cat-tools-productivity-fill: rgb(154 148 132 / 0.14);
  --cat-design-creative: #8f8a9e;
  --cat-design-creative-fill: rgb(143 138 158 / 0.14);
  --cat-finance: #8a9488;
  --cat-finance-fill: rgb(138 148 136 / 0.14);
}

body.portal-theme-v2 .res-cat-chip--dev-hosting {
  color: var(--cat-dev-hosting);
  background: var(--cat-dev-hosting-fill);
  border: 1px solid color-mix(in srgb, var(--cat-dev-hosting) 55%, transparent);
}
body.portal-theme-v2 .res-cat-chip--internal-documents {
  color: var(--cat-internal-documents);
  background: var(--cat-internal-documents-fill);
  border: 1px solid color-mix(in srgb, var(--cat-internal-documents) 55%, transparent);
}
body.portal-theme-v2 .res-cat-chip--ai-instruction-files {
  color: var(--cat-ai-instruction-files);
  background: var(--cat-ai-instruction-files-fill);
  border: 1px solid color-mix(in srgb, var(--cat-ai-instruction-files) 55%, transparent);
}
body.portal-theme-v2 .res-cat-chip--seo-analytics {
  color: var(--cat-seo-analytics);
  background: var(--cat-seo-analytics-fill);
  border: 1px solid color-mix(in srgb, var(--cat-seo-analytics) 55%, transparent);
}
body.portal-theme-v2 .res-cat-chip--tools-productivity {
  color: var(--cat-tools-productivity);
  background: var(--cat-tools-productivity-fill);
  border: 1px solid color-mix(in srgb, var(--cat-tools-productivity) 55%, transparent);
}
body.portal-theme-v2 .res-cat-chip--design-creative {
  color: var(--cat-design-creative);
  background: var(--cat-design-creative-fill);
  border: 1px solid color-mix(in srgb, var(--cat-design-creative) 55%, transparent);
}
body.portal-theme-v2 .res-cat-chip--finance {
  color: var(--cat-finance);
  background: var(--cat-finance-fill);
  border: 1px solid color-mix(in srgb, var(--cat-finance) 55%, transparent);
}

body.portal-theme-v2 .res-filter-pill {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  border: 1px solid var(--input-border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}
body.portal-theme-v2 .res-filter-pill:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
body.portal-theme-v2 .res-filter-pill--dev-hosting { color: var(--cat-dev-hosting); border-color: color-mix(in srgb, var(--cat-dev-hosting) 45%, var(--input-border)); }
body.portal-theme-v2 .res-filter-pill--internal-documents { color: var(--cat-internal-documents); border-color: color-mix(in srgb, var(--cat-internal-documents) 45%, var(--input-border)); }
body.portal-theme-v2 .res-filter-pill--ai-instruction-files { color: var(--cat-ai-instruction-files); border-color: color-mix(in srgb, var(--cat-ai-instruction-files) 45%, var(--input-border)); }
body.portal-theme-v2 .res-filter-pill--seo-analytics { color: var(--cat-seo-analytics); border-color: color-mix(in srgb, var(--cat-seo-analytics) 45%, var(--input-border)); }
body.portal-theme-v2 .res-filter-pill--tools-productivity { color: var(--cat-tools-productivity); border-color: color-mix(in srgb, var(--cat-tools-productivity) 45%, var(--input-border)); }

body.portal-theme-v2 .res-filter-pill.active.res-filter-pill--dev-hosting { background: var(--cat-dev-hosting-fill); border-color: var(--cat-dev-hosting); }
body.portal-theme-v2 .res-filter-pill.active.res-filter-pill--internal-documents { background: var(--cat-internal-documents-fill); border-color: var(--cat-internal-documents); }
body.portal-theme-v2 .res-filter-pill.active.res-filter-pill--ai-instruction-files { background: var(--cat-ai-instruction-files-fill); border-color: var(--cat-ai-instruction-files); }
body.portal-theme-v2 .res-filter-pill.active.res-filter-pill--seo-analytics { background: var(--cat-seo-analytics-fill); border-color: var(--cat-seo-analytics); }
body.portal-theme-v2 .res-filter-pill.active.res-filter-pill--tools-productivity { background: var(--cat-tools-productivity-fill); border-color: var(--cat-tools-productivity); }

body.portal-theme-v2 .res-category-swatch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-3, 8px);
  background: var(--bg-card);
}
body.portal-theme-v2 .res-category-swatch__stripe {
  width: 4rem;
  height: 2rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  box-sizing: border-box;
}
body.portal-theme-v2 .res-category-swatch__stripe--dev-hosting { border-left: 3px solid var(--cat-dev-hosting); }
body.portal-theme-v2 .res-category-swatch__stripe--internal-documents { border-left: 3px solid var(--cat-internal-documents); }
body.portal-theme-v2 .res-category-swatch__stripe--ai-instruction-files { border-left: 3px solid var(--cat-ai-instruction-files); }
body.portal-theme-v2 .res-category-swatch__stripe--seo-analytics { border-left: 3px solid var(--cat-seo-analytics); }
body.portal-theme-v2 .res-category-swatch__stripe--tools-productivity { border-left: 3px solid var(--cat-tools-productivity); }

body.portal-theme-v2 .res-cat-chip {
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
}

body.portal-theme-v2 .res-extra-cats {
  border: 1px solid var(--input-border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin: 0;
}
body.portal-theme-v2 .res-extra-cats legend {
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 0 0.35rem;
}
body.portal-theme-v2 .res-extra-cats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}
body.portal-theme-v2 .res-extra-cat-label {
  font-size: 0.85rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
