/* =========================================================
   THEME
========================================================= */
:root {
  --bg-color: #0c1c2b;          /* mörkblå bakgrund */
  --surface-color: #13283f;     /* ytor / header */
  --card-bg: #172f4a;           /* kort */

  --primary: #4db8ff;           /* accentblå */
  --primary-hover: #76ccff;

  --text-main: #e5e9f0;
  --text-muted: #9aa6b2;
}

/* =========================================================
   GLOBAL RESET & BASE
========================================================= */
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-color);
  color: var(--text-main);
}

/* Responsiv textstorlek */
html {
  font-size: clamp(15px, 1vw + 12px, 18px);
}

/* Text rendering + färg */
body, p, li, h1, h2, h3, h4 {
  color: var(--text-main);
}
label {
  color: var(--text-muted);
}

a {
  color: var(--primary);
}
a:hover {
  color: var(--primary-hover);
}

a { color: var(--primary); }
a:hover { color: var(--primary-hover); }


body {
  text-rendering: optimizeLegibility;
}

hr {
  border: 0;
  height: 1px;
  background: rgba(77,184,255,0.18);
  margin: 2rem 0;
}

/* =========================================================
   LOGO
========================================================= */

/* Bas: Liten, kompakt — styr headerns höjd */
.logo {
  height: 5.2rem;
  width: auto;
  display: block;
  object-fit: contain;
}

/* Mobil håller samma höjd */
@media (max-width: 600px) {
  .logo {
    height: 2.2rem;
  }
}
/* =========================================================
   HEADER & NAVIGATION (tight, logo-driven height)
========================================================= */

header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-color);
}

/* Nav container */
header nav {
  max-width: 1400px;
  margin: 0 auto;              /* <-- bort med bottom margin */
  padding: 0 1rem;
  height: 5.2rem;              /* <-- exakt samma som loggan */
  display: flex;
  align-items: center;         /* centrerar allt vertikalt */
  justify-content: space-between;
}

/* Logga */
.logo {
  height: 5.2rem;
  width: auto;
  display: block;
  object-fit: contain;
}

/* UL layout */
nav ul {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Första UL (logga) */
header nav > ul:first-child {
  flex: 0 0 auto;
}

/* Meny */
header nav > ul:nth-of-type(2) {
  flex: 1 1 auto;
  justify-content: flex-end;
}

/* Länkar */
header nav a {
  display: inline-flex;
  align-items: center;
  height: 100%;                 /* <-- viktigt: fyller nav-höjden */
  padding: 0 0.6rem;
  line-height: 1;               /* <-- tar bort vertikal fluff */
  white-space: nowrap;
}

/* Aktiv sida */
nav a[aria-current="page"] {
  font-weight: 600;
  text-decoration: underline;
}

/* Mobil */
@media (max-width: 600px) {
  header nav {
    height: 2.6rem;
  }

  .logo {
    height: 2.6rem;
  }

  header nav a {
    font-size: 0.85rem;
  }
}
/* =========================================================
   LAYOUT
========================================================= */
main.container {
  padding-left: 5px;
  padding-right: 5px;
  max-width: 1400px;
  margin: 0 auto 3rem;
  padding-top: 0.4rem;     /* luft under menyn */
}

section {
  margin-bottom: 1.6rem; /* tidigare 2.5rem */
}

/* Standard padding i sektioner */
section:not(.hero):not(.card-section) {
  padding-left: 1rem;
  padding-right: 1rem;
}

/* =========================================================
   FORMS (login sizing)
========================================================= */
main.container > form {
  max-width: 420px;
  margin: 2rem auto 0;
}


/* =========================================================
   HERO
========================================================= */
.hero {
  padding: 2.5rem 2rem;
  margin-bottom: 2rem;
  border-radius: 1.25rem;
  background: var(--card-bg);
  color: var(--text-main);
  border: 1px solid rgba(77,184,255,0.25);
  box-shadow: 0 10px 25px rgba(0,0,0,0.05);
  text-align: center;
}

/* Mobil: mindre bredd */
@media (max-width: 600px) {
  .hero {
    margin-left: 12px;
    margin-right: 12px;
  }
}

/* =========================================================
   CARD SECTIONS
========================================================= */
.card-section {
  padding: 1.75rem 1.5rem;
  margin-bottom: 1.8rem;
  border-radius: 1rem;
  background: var(--card-bg);
  color: var(--text-main);
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
  border: 1px solid rgba(77,184,255,0.25);
}

/* Mobil: smalare cards */
@media (max-width: 600px) {
  .card-section {
    margin-left: 12px;
    margin-right: 12px;
  }
}

/* =========================================================
   BUTTONS
========================================================= */
a[role="button"].btn-primary {
  display: block; 
  width: fit-content;      /* behåll naturlig bredd */
  padding: 0.9rem 2.6rem;
  border-radius: 20px;
  font-weight: 600;
  text-align: center;
  margin-left: auto; 
  margin-right: auto; 

  background:
    radial-gradient(circle at 20% 0%, rgba(255,255,255,0.25), rgba(255,255,255,0) 55%),
    linear-gradient(135deg, #2b7a78, var(--primary));
  border: 1px solid rgba(255,255,255,0.4);

  color: #fff;
  
  box-shadow:
    0 0 12px rgba(31,55,74,0.25),
    0 6px 14px rgba(0,0,0,0.18);

  transition: transform .15s, box-shadow .15s, background .15s;
}

a[role="button"].btn-primary:hover {
  background:
    radial-gradient(circle at 15% 0%, rgba(255,255,255,0.35), rgba(255,255,255,0) 55%),
    linear-gradient(135deg, #2f8c87, var(--primary-hover));
  box-shadow:
    0 0 16px rgba(31,55,74,0.28),
    0 7px 16px rgba(0,0,0,0.20);
  transform: translateY(-1px);
}

@media (max-width: 600px) {
  a[role="button"].btn-primary {
    width: 100%;
    max-width: 280px;
    padding: 0.9rem 1rem;
  }
}

/* =========================================================
   FOOTER
========================================================= */
footer {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 3rem;
}


/* =========================================================
   SOC CARD (component only — no theme switch)
========================================================= */
.soc-card {
  max-width: none;
  margin: 0 auto 16px;
  padding: 24px 28px;
  border: 2px solid var(--primary);
  border-radius: 10px;
  background: var(--card-bg);
  box-sizing: border-box;
}

.soc-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0;
}

.soc-header {
  margin: 0rem 0 0rem;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--primary);
}
.soc-label { font-weight: 700; }
.soc-value { opacity: 0.9; text-align: right; }

.soc-actions { margin-top: 22px; text-align: center; }

.soc-btn {
  display: inline-block;
  padding: 10px 22px;
  font-size: 1rem;
  color: #fff;
  background: var(--primary);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  transition: transform .15s ease, background .15s ease;
}


.soc-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

/* =========================================================
   GLOBAL TABLE THEME
========================================================= */
table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
  color: var(--text-main);
}

table thead {
  background: rgba(255,255,255,0.06);
}

table th {
  text-align: left;
  font-weight: 700;
  padding: 12px 10px;
  color: var(--text-main);
  border-bottom: 1px solid rgba(255,255,255,0.14);
}

table td {
  padding: 12px 10px;
  color: var(--text-main);
  background: transparent;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  vertical-align: top;
}

table tbody tr {
  background: transparent;
  transition: background 0.15s ease;
}

table tbody tr:hover {
  background: rgba(255,255,255,0.04);
}

table a {
  color: #7db8ff;
  text-decoration: none;
}

table a:hover {
  text-decoration: underline;
}

/* Force correct table header contrast */
table thead,
table thead tr,
table thead th {
  background: var(--surface-color) !important;
  color: var(--text-main) !important;
}

table thead th {
  border-bottom: 1px solid rgba(255,255,255,0.14) !important;
}

/* AI Inbox table header – match soc-header style */
table thead th {
  background: transparent;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(77,184,255,0.35);
}

table tbody td {
  background: transparent;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* Blue1 table styling */
table {
  width: 100%;
  border-collapse: collapse;
}

table thead th {
  background: var(--surface-color);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(77,184,255,0.35);
}

table tbody td {
  padding: 12px 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
}


/* Blue1 table header = soc-header */
table thead th {
  background: var(--card-bg);
  color: var(--primary);
  font-weight: 600;
  font-size: 1rem;
  padding: 14px 12px;
  border-bottom: 1px solid rgba(77,184,255,0.25);
}


/* AI Inbox header styled like soc-header */

table thead {
  background: var(--card-bg);
}

table thead th {
  color: var(--primary);
  font-weight: 600;
  font-size: 1.05rem;
  padding: 16px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(77,184,255,0.25);
}

/* subtle separation to table rows */

table tbody td {
  padding: 12px 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.ai-inbox-table {
    table-layout: fixed;
    width: 100%;
}
/* AI Inbox: force header to match soc-header look */
table.ai-inbox-table thead,
table.ai-inbox-table thead tr,
table.ai-inbox-table thead th {
  background: transparent !important;
}

table.ai-inbox-table thead th {
  color: var(--primary) !important;
  font-size: 1.2rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.03em !important;
  text-align: left !important;
  padding: 10px 12px 14px !important;
  border-bottom: 1px solid rgba(77,184,255,0.25) !important;
}

table.ai-inbox-table tbody td {
  background: transparent !important;
}


/* Secondary button (used for reset etc) */
button.btn-secondary {
  background: rgba(255,255,255,0.08);
  color: var(--text-main);
}

button.btn-secondary:hover {
  background: rgba(255,255,255,0.14);
}


/* =========================================================
   UNDERLAG TABLE / MOBILE DETAIL VIEW
========================================================= */
.underlag-table-wrap {
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
}

.underlag-table-head,
.underlag-table-row {
  display: grid;
  grid-template-columns: 110px 2.2fr 130px 190px 120px 140px 110px;
  gap: 16px;
  align-items: start;
}

.underlag-table-head {
  padding: 0 0 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  font-weight: 600;
}

.underlag-table-row {
  padding: 10px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.underlag-cell {
  min-width: 0;
  overflow-wrap: break-word;
  word-break: normal;
}

.underlag-name {
  font-weight: 600;
}

.underlag-url {
  margin-top: 4px;
  font-size: 0.92rem;
  opacity: 0.88;
}

.underlag-url a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 900px) {
  .underlag-table-head,
  .underlag-table-row {
    display: grid;
    grid-template-columns: 110px minmax(0, 2.4fr) 160px 190px 90px;
    gap: 16px;
    align-items: start;
  }
}

@media (max-width: 700px) {
  .underlag-table-head {
    display: none;
  }

  .underlag-table-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
    margin-bottom: 12px;
    border-top: none;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    background: rgba(255,255,255,0.02);
  }

  .underlag-cell {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }

  .underlag-cell::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--text-main);
    opacity: 0.95;
  }
}

@media (max-width: 480px) {
  .soc-card {
    padding: 18px 14px;
  }

  .underlag-table-wrap {
    padding: 10px;
  }

  .underlag-cell {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .underlag-cell::before {
    margin-bottom: 2px;
  }

  .underlag-url {
    font-size: 0.88rem;
  }
}


/* =========================================================
   STATUS INDICATORS
========================================================= */

.status-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.status-ok {
  color: #0f2;
  background: rgba(0,255,120,0.12);
  border: 1px solid rgba(0,255,120,0.35);
}

.status-warn {
  color: #ffd166;
  background: rgba(255,209,102,0.12);
  border: 1px solid rgba(255,209,102,0.35);
}

.status-bad {
  color: #ff5c5c;
  background: rgba(255,0,0,0.12);
  border: 1px solid rgba(255,0,0,0.35);
}

.underlag-table-row .underlag-name { font-weight: normal; }


.perf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.perf-kpi {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(88, 170, 255, 0.22);
  border-radius: 14px;
  padding: 14px 16px;
}

.perf-kpi-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.perf-kpi-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-main);
}

.perf-kpi-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.perf-meters {
  display: grid;
  gap: 14px;
}

.perf-meter-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(88, 170, 255, 0.16);
  border-radius: 14px;
  padding: 14px 16px;
}

.perf-meter-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}

.perf-meter-title {
  font-weight: 700;
  color: var(--text-main);
}

.perf-meter-value {
  color: var(--text-muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.perf-meter-track {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.perf-meter-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.25s ease;
}

.perf-good {
  background: linear-gradient(90deg, #00c853, #64dd17);
}

.perf-warn {
  background: linear-gradient(90deg, #ffb300, #ffca28);
}

.perf-critical {
  background: linear-gradient(90deg, #e53935, #ff5252);
}

.perf-meter-note {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (max-width: 720px) {
  .perf-meter-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .perf-meter-value {
    text-align: left;
  }
}
.perf-meter-with-max {
  position: relative;
}

.perf-meter-max {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.85);
  pointer-events: none;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.badge--success {
  background: rgba(40,167,69,0.20);
  color: #9be7ae;
}

.badge--warning {
  background: rgba(255,193,7,0.18);
  color: #ffe08a;
}

.badge--error {
  background: rgba(220,53,69,0.20);
  color: #ff9aa7;
}

.badge--missing {
  background: rgba(255,140,0,0.18);
  color: #ffd199;
}

.badge--info {
  background: rgba(70,130,255,0.20);
  color: #cfe0ff;
}

.badge--topic {
  background: rgba(111,66,193,0.22);
  color: #d9c2ff;
}

.badge--subcategory {
  background: rgba(32,201,151,0.18);
  color: #b8ffe8;
}

.pipeline-steps {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.pipeline-step-toggle {
  position: relative;
  flex: 1;
  min-width: 180px;
  border: 1px solid rgba(120,170,255,0.35);
  border-radius: 10px;
  padding: 14px;
  background: rgba(255,255,255,0.02);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.pipeline-step-toggle.is-active {
  background: rgba(80,140,220,0.14);
  border-color: rgba(70,170,255,0.55);
  box-shadow: inset 0 0 0 1px rgba(70,170,255,0.18);
}

.pipeline-step-panel {
  margin-top: 0;
  padding: 16px 18px;
  border: 1px solid rgba(120,170,255,0.28);
  border-radius: 10px;
  background: rgba(80,140,220,0.08);
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.pipeline-step-panel.is-active {
  background: rgba(80,140,220,0.10);
  border-color: rgba(70,170,255,0.40);
  box-shadow: inset 0 0 0 1px rgba(70,170,255,0.08);
}

.pipeline-step-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.pipeline-subcard {
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
}

.pipeline-subcard__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.pipeline-subcard__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: rgba(255,255,255,0.92);
}

.pipeline-panels {
  margin-top: 8px;
}

.pipeline-panels.has-active-panel {
  background: transparent;
  border-top: none;
  padding-top: 0;
}

.filter-pill {
  gap: 8px; /* viktig */
}

.filter-pill__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  opacity: 0.9;
}

a.filter-pill,
a.filter-pill:visited {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 38px !important;
  padding: 0 14px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(120,170,255,0.22) !important;
  background: rgba(255,255,255,0.06) !important;
  color: var(--text-main) !important;
  text-decoration: none !important;
  font-size: 0.95rem !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
  transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease, color 120ms ease !important;
}

a.filter-pill:hover,
a.filter-pill:focus {
  background: rgba(255,255,255,0.12) !important;
  border-color: rgba(120,170,255,0.34) !important;
  color: var(--text-main) !important;
  text-decoration: none !important;
}

a.filter-pill.is-active,
a.filter-pill.is-active:visited {
  background: rgba(70,170,255,0.22) !important;
  border-color: rgba(70,170,255,0.44) !important;
  color: #cfe0ff !important;
  box-shadow: inset 0 0 0 1px rgba(70,170,255,0.16) !important;
  text-decoration: none !important;
}

/* ===== FILTER PILL VARIANTS ===== */

a.filter-pill.filter-pill--neutral {
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(255,255,255,0.12) !important;
}

a.filter-pill.filter-pill--ok {
  background: rgba(40,167,69,0.18) !important;
  border-color: rgba(40,167,69,0.35) !important;
  color: #9be7ae !important;
}

a.filter-pill.filter-pill--warn {
  background: rgba(255,193,7,0.18) !important;
  border-color: rgba(255,193,7,0.35) !important;
  color: #ffe08a !important;
}

a.filter-pill.filter-pill--info {
  background: rgba(70,130,255,0.18) !important;
  border-color: rgba(70,130,255,0.35) !important;
  color: #cfe0ff !important;
}

/* active override (lite starkare) */
.filter-pill.is-active {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25) !important;
}

/* =========================================================
   CATEGORIES PAGE
========================================================= */

.categories-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}

.categories-layout:first-of-type {
  margin-top: 0;
}






.categories-stack {
  display: grid;
  gap: 14px;
}

.categories-main-card,
.categories-parent-card {
  display: grid;
  gap: 10px;
}

.categories-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.categories-panel-copy {
  margin: 0 0 14px 0;
  color: var(--text-muted);
}

.categories-chip-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
}

.categories-badge-xl {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 2px 8px;
}

.categories-badge-lg {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 2px 8px;
}

.categories-badge-count {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 2px 8px;
}

.categories-proposal-form {
  display: inline-flex;
  margin: 0;
}

.categories-proposal-btn {
  display: inline-flex;
  align-items: center;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  line-height: 1;
}

.categories-proposal-btn .badge {
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.categories-proposal-btn:hover .badge,
.categories-proposal-btn:focus-visible .badge {
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
}
/* === categories create row hard override test === */
.categories-form-block {
  margin-top: 14px !important;
  padding-top: 12px !important;
  border-top: 1px solid rgba(255,255,255,0.08) !important;
}

.categories-form-row {
  display: inline-grid !important;
  grid-template-columns: 220px 72px !important;
  gap: 8px !important;
  align-items: center !important;
  justify-content: start !important;
}

.categories-form-row input[type="text"] {
  width: 220px !important;
  min-width: 220px !important;
  max-width: 220px !important;
  height: 26px !important;
  min-height: 26px !important;
  max-height: 26px !important;
  margin: 0 !important;
  padding: 2px 8px !important;
  font-size: 0.85rem !important;
  line-height: 1 !important;
  border-radius: 6px !important;
  box-sizing: border-box !important;
}

.categories-form-row button[type="submit"] {
  width: 72px !important;
  min-width: 72px !important;
  max-width: 72px !important;
  height: 26px !important;
  min-height: 26px !important;
  max-height: 26px !important;
  margin: 0 !important;
  padding: 0 8px !important;
  font-size: 0.85rem !important;
  line-height: 1 !important;
  border-radius: 6px !important;
  box-sizing: border-box !important;
}
/* === categories subcategory row hard override === */
.categories-form-row:has(select) {
  grid-template-columns: 220px 160px 72px !important;
}

.categories-form-row select {
  width: 160px !important;
  min-width: 160px !important;
  max-width: 160px !important;
  height: 26px !important;
  min-height: 26px !important;
  max-height: 26px !important;
  margin: 0 !important;
  padding: 0 8px !important;
  font-size: 0.85rem !important;
  line-height: 1 !important;
  border-radius: 6px !important;
  box-sizing: border-box !important;
}

.categories-form-row:has(select) button[type="submit"] {
  width: 72px !important;
  min-width: 72px !important;
  max-width: 72px !important;
}

.categories-empty {
  margin: 0;
  color: var(--text-muted);
}

/* === hard override: main proposal chips must wrap horizontally === */
.categories-chip-cloud {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: flex-start !important;
  align-content: flex-start !important;
  justify-content: flex-start !important;
  gap: 8px !important;
}

.categories-chip-cloud > * {
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: none !important;
}

/* Proposal intensity levels for main-category suggestions */
/* Stronger but controlled scaling */
.proposal-lvl-1 {
  background: rgba(111,66,193,0.14);
  color: #cdb6ff;
  font-size: 0.70rem;
  font-weight: 600;
}

.proposal-lvl-2 {
  background: rgba(111,66,193,0.24);
  color: #d9c2ff;
  font-size: 0.88rem;
  font-weight: 600;
}

.proposal-lvl-3 {
  background: rgba(111,66,193,0.38);
  color: #e6d6ff;
  font-size: 0.98rem;
  font-weight: 700;
}

.proposal-lvl-4 {
  background: rgba(111,66,193,0.55);
  color: #f5ecff;
  font-size: 1.08rem;
  font-weight: 700;
}



@media (max-width: 700px) {
  .categories-layout {
    grid-template-columns: 1fr;
  }

  .categories-badge-xl {
    font-size: 1rem;
    padding: 7px 14px;
  }

  .categories-badge-lg,
  .categories-badge-count {
    font-size: 0.9rem;
    padding: 5px 11px;
  }

  .categories-form-row input,
  .categories-form-row select {
    min-width: 100%;
  }
}

