:root {
  --emerald-green: #0d6b4f;
  --forest-green: #094d3a;
  --midnight-navy: #0a1d37;
  --soft-gold: #d4af37;
  --slate-blue: #475569;
  --white: #ffffff;
  --off-white: #f6f8f7;
  --ink: #0b1620;
  --muted: #6b7b82;
  --border: rgba(71, 85, 105, 0.18);
  --danger: #b42318;
  --danger-bg: #fff1f0;
  --warning: #b54708;
  --warning-bg: #fff7e6;
  --info: #175cd3;
  --info-bg: #eff8ff;
  --success-bg: #ecfdf3;
  --shadow-sm: 0 8px 20px rgba(9, 29, 55, 0.12);
  --shadow: 0 18px 40px rgba(9, 29, 55, 0.18);
  --grad-brand: linear-gradient(135deg, #0d6b4f 0%, #094d3a 45%, #0a1d37 100%);
  --grad-gold: linear-gradient(135deg, #e7c658 0%, #d4af37 100%);
  --font-head: "Playfair Display", Georgia, serif;
  --font-body: "Montserrat", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--off-white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.is-hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    linear-gradient(135deg, rgba(13, 107, 79, 0.92), rgba(10, 29, 55, 0.96)),
    radial-gradient(circle at 20% 20%, rgba(212, 175, 55, 0.18), transparent 36%),
    var(--midnight-navy);
}

.login-brand {
  position: fixed;
  top: 24px;
  left: 32px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
}

.login-brand strong,
.sidebar-brand strong {
  display: block;
  font-family: var(--font-head);
  font-size: 20px;
}

.login-brand span,
.sidebar-brand span {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  background: var(--grad-gold);
  color: var(--midnight-navy);
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

.login-card {
  width: min(100%, 560px);
  padding: 40px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.product-kicker,
.eyebrow {
  margin: 0 0 8px;
  color: var(--emerald-green);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--midnight-navy);
  font-family: var(--font-head);
}

h1 {
  margin-bottom: 12px;
  font-size: 48px;
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
  font-size: 36px;
  line-height: 1.08;
}

h3 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.15;
}

.login-copy {
  margin-bottom: 28px;
  color: var(--slate-blue);
  line-height: 1.7;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.role-card {
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--white);
  color: var(--midnight-navy);
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.role-card span {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
}

.role-card small {
  color: var(--muted);
  font-size: 12px;
}

.role-card:hover,
.role-card.is-selected {
  border-color: var(--emerald-green);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-form label,
.search-field span {
  color: var(--slate-blue);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input {
  min-height: 46px;
  padding: 0 14px;
}

select {
  min-height: 46px;
  padding: 0 38px 0 14px;
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--slate-blue) 50%) calc(100% - 18px) 20px / 6px 6px no-repeat,
    linear-gradient(135deg, var(--slate-blue) 50%, transparent 50%) calc(100% - 13px) 20px / 6px 6px no-repeat,
    var(--white);
}

textarea {
  min-height: 136px;
  padding: 14px;
  resize: vertical;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--emerald-green);
  box-shadow: 0 0 0 4px rgba(13, 107, 79, 0.12);
}

.primary-button,
.dark-button,
.ghost-button,
.gold-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.primary-button {
  border: 0;
  background: var(--emerald-green);
  color: var(--white);
}

.dark-button {
  border: 0;
  background: var(--midnight-navy);
  color: var(--white);
}

.gold-button {
  border: 0;
  background: var(--grad-gold);
  color: var(--midnight-navy);
}

.ghost-button {
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--midnight-navy);
}

.primary-button:hover,
.dark-button:hover,
.ghost-button:hover,
.gold-button:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.primary-button:disabled,
.dark-button:disabled,
.ghost-button:disabled,
.gold-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px;
  background: var(--grad-brand);
  color: var(--white);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
  text-align: left;
  padding: 0 14px;
}

.nav-item:hover,
.nav-item.is-active {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
}

.user-panel {
  margin-top: auto;
  display: grid;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.user-panel span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

.user-panel .ghost-button {
  width: 100%;
}

.main-content {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.topbar-actions {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.search-field {
  min-width: 300px;
  display: grid;
  gap: 8px;
}

.view-panel {
  display: none;
}

.view-panel.is-active {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.metric-card,
.queue-panel,
.detail-panel,
.queue-table-shell,
.automation-grid .automation-card,
.automation-panel,
.activity-panel,
.insight-panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.metric-card {
  min-height: 132px;
  padding: 20px;
}

.metric-card span {
  display: block;
  margin-bottom: 16px;
  color: var(--slate-blue);
  font-size: 13px;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  color: var(--midnight-navy);
  font-family: var(--font-head);
  font-size: 34px;
  line-height: 1;
}

.metric-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.4;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.25fr);
  gap: 20px;
  align-items: start;
}

.triage-layout {
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(420px, 1.05fr);
  gap: 20px;
  align-items: start;
}

.knowledge-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.78fr) minmax(520px, 1.22fr);
  gap: 18px;
  align-items: start;
  min-width: 0;
}

.integration-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.82fr) minmax(520px, 1.18fr);
  gap: 18px;
  align-items: start;
  min-width: 0;
}

.queue-panel,
.detail-panel,
.queue-table-shell,
.activity-panel,
.insight-panel,
.triage-panel,
.knowledge-panel,
.integration-panel {
  padding: 20px;
}

.triage-panel,
.knowledge-panel,
.integration-panel {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.triage-panel h3,
.knowledge-panel h3,
.integration-panel h3,
.automation-panel h3,
.activity-panel h3 {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.triage-form,
.knowledge-form {
  display: grid;
  gap: 16px;
}

.triage-form label,
.knowledge-form label {
  display: grid;
  gap: 8px;
  color: var(--midnight-navy);
  font-size: 13px;
  font-weight: 800;
}

.triage-form label span,
.knowledge-form label span {
  color: var(--slate-blue);
}

.knowledge-toolbar {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.knowledge-toolbar .search-field {
  min-width: 0;
}

.knowledge-toolbar .segmented-control {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.knowledge-toolbar .segmented-control button {
  min-width: 0;
  padding: 0 8px;
}

.integration-list,
.integration-detail {
  display: grid;
  gap: 12px;
}

.integration-card {
  display: grid;
  gap: 8px;
  min-height: 132px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--white);
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.integration-card:hover,
.integration-card.is-selected {
  border-color: rgba(13, 107, 79, 0.55);
  box-shadow: 0 10px 24px rgba(9, 29, 55, 0.08);
  transform: translateY(-1px);
}

.integration-card.is-selected {
  background: linear-gradient(180deg, rgba(13, 107, 79, 0.05), var(--white));
}

.integration-card h4,
.integration-card p,
.integration-card small {
  margin: 0;
}

.integration-card h4 {
  color: var(--midnight-navy);
  font-size: 16px;
}

.integration-card p {
  color: var(--slate-blue);
  font-size: 13px;
  font-weight: 700;
}

.integration-card small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.integration-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.48fr);
  gap: 18px;
  padding: 20px;
  border: 1px solid rgba(13, 107, 79, 0.22);
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(13, 107, 79, 0.08), rgba(255, 255, 255, 0) 68%),
    var(--white);
}

.integration-overview h4,
.integration-overview p {
  margin: 0;
}

.integration-overview h4 {
  margin-bottom: 8px;
  color: var(--midnight-navy);
  font-size: 22px;
  line-height: 1.2;
}

.integration-overview p {
  color: var(--slate-blue);
  line-height: 1.55;
}

.integration-meta-grid {
  display: grid;
  gap: 10px;
}

.integration-meta-grid div,
.integration-payload,
.integration-analysis {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--off-white);
}

.integration-meta-grid div {
  padding: 14px;
}

.integration-meta-grid span,
.integration-analysis .panel-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.integration-meta-grid strong {
  color: var(--midnight-navy);
  font-size: 14px;
  line-height: 1.35;
}

.pipeline-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.pipeline-step {
  min-height: 134px;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--white);
}

.pipeline-step span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--emerald-green);
  color: var(--white);
  font-size: 12px;
  font-weight: 800;
}

.pipeline-step p {
  margin: 0;
  color: var(--slate-blue);
  font-size: 13px;
  line-height: 1.45;
}

.integration-sample-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.integration-payload,
.integration-analysis {
  padding: 14px;
}

.integration-payload code {
  display: block;
  overflow-x: auto;
  color: var(--midnight-navy);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre;
}

.integration-analysis strong,
.integration-analysis p {
  margin: 0;
}

.integration-analysis strong {
  display: block;
  margin: 12px 0 8px;
  color: var(--midnight-navy);
}

.integration-analysis p {
  color: var(--slate-blue);
  font-size: 13px;
  line-height: 1.45;
}

.article-list {
  display: grid;
  gap: 8px;
}

.article-row {
  display: grid;
  gap: 8px;
  min-height: 104px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--white);
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.article-row:hover,
.article-row.is-selected {
  border-color: rgba(13, 107, 79, 0.55);
  box-shadow: 0 10px 24px rgba(9, 29, 55, 0.08);
  transform: translateY(-1px);
}

.article-row.is-selected {
  background: linear-gradient(180deg, rgba(13, 107, 79, 0.05), var(--white));
}

.article-row h4,
.article-row p {
  margin: 0;
}

.article-row h4 {
  color: var(--midnight-navy);
  font-size: 15px;
  line-height: 1.3;
}

.article-row p {
  color: var(--slate-blue);
  font-size: 13px;
  line-height: 1.42;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.article-row .pill,
.article-overview .pill,
.article-tag-panel .pill {
  min-height: 24px;
  padding: 0 9px;
  font-size: 12px;
}

.article-detail {
  display: grid;
  gap: 14px;
  margin-bottom: 22px;
}

.article-overview {
  position: relative;
  padding: 20px 22px 20px 24px;
  border: 1px solid rgba(13, 107, 79, 0.22);
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(13, 107, 79, 0.08), rgba(255, 255, 255, 0) 62%),
    var(--white);
}

.article-overview::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 0;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: var(--emerald-green);
}

.article-overview h4 {
  margin: 10px 0 8px;
  color: var(--midnight-navy);
  font-size: 22px;
  line-height: 1.2;
}

.article-overview p {
  margin: 0;
  color: var(--slate-blue);
  font-size: 15px;
  line-height: 1.55;
}

.article-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.article-stat,
.article-tag-panel,
.article-section {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--white);
}

.article-stat {
  min-height: 92px;
  padding: 16px;
}

.article-stat span,
.panel-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.article-stat strong {
  color: var(--midnight-navy);
  font-size: 20px;
  line-height: 1;
}

.article-tag-panel {
  padding: 16px;
}

.article-section {
  padding: 16px;
}

.article-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.article-section-head .panel-label {
  margin-bottom: 0;
}

.article-section-head strong {
  color: var(--emerald-green);
  font-size: 13px;
}

.article-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.article-steps li {
  position: relative;
  min-height: 48px;
  padding: 12px 14px 12px 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--off-white);
  color: var(--slate-blue);
  font-size: 14px;
  line-height: 1.45;
}

.article-steps li::before {
  content: attr(data-step);
  position: absolute;
  top: 11px;
  left: 12px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--emerald-green);
  color: var(--white);
  font-size: 11px;
  font-weight: 800;
}

.related-ticket-list {
  display: grid;
  gap: 8px;
}

.related-ticket {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--off-white);
}

.related-ticket span {
  color: var(--emerald-green);
  font-size: 13px;
  font-weight: 800;
}

.related-ticket p {
  margin: 0;
  color: var(--slate-blue);
  font-size: 13px;
  line-height: 1.45;
}

.knowledge-form {
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.triage-result {
  min-height: 520px;
}

.empty-state {
  min-height: 260px;
  display: grid;
  place-content: center;
  gap: 8px;
  border: 1px dashed rgba(71, 85, 105, 0.34);
  border-radius: 14px;
  background: var(--off-white);
  color: var(--slate-blue);
  text-align: center;
  padding: 24px;
}

.empty-state strong {
  color: var(--midnight-navy);
  font-size: 18px;
}

.analysis-summary {
  display: grid;
  gap: 14px;
}

.analysis-score-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 18px;
  border-radius: 14px;
  background: var(--grad-brand);
  color: var(--white);
}

.analysis-score-card .urgency-score {
  background: var(--white);
  color: var(--midnight-navy);
}

.analysis-score-card h4 {
  margin: 0 0 8px;
  font-size: 18px;
}

.analysis-score-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.5;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.analysis-box {
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--off-white);
}

.analysis-box span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.analysis-box strong,
.analysis-box p {
  margin: 0;
  color: var(--midnight-navy);
  line-height: 1.5;
}

.analysis-box p {
  color: var(--slate-blue);
  font-size: 14px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.segmented-control {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--off-white);
}

.segmented-control button {
  min-height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--slate-blue);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
}

.segmented-control button.is-selected {
  background: var(--white);
  color: var(--midnight-navy);
  box-shadow: 0 6px 14px rgba(9, 29, 55, 0.08);
}

.ticket-list {
  display: grid;
  gap: 10px;
}

.ticket-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  min-height: 116px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--white);
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.ticket-row:hover,
.ticket-row.is-selected {
  border-color: rgba(13, 107, 79, 0.55);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.ticket-row h4,
.ticket-row p {
  margin: 0;
}

.ticket-row h4 {
  color: var(--midnight-navy);
  font-size: 15px;
}

.ticket-row p {
  margin-top: 6px;
  color: var(--slate-blue);
  font-size: 13px;
  line-height: 1.45;
}

.ticket-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.pill.high,
.pill.negative,
.pill.urgent {
  background: var(--danger-bg);
  color: var(--danger);
}

.pill.medium,
.pill.mixed {
  background: var(--warning-bg);
  color: var(--warning);
}

.pill.low,
.pill.positive {
  background: var(--success-bg);
  color: var(--emerald-green);
}

.pill.info {
  background: var(--info-bg);
  color: var(--info);
}

.urgency-score {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--midnight-navy);
  color: var(--white);
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 800;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.detail-header h3 {
  margin-bottom: 8px;
}

.detail-subtitle {
  color: var(--slate-blue);
  line-height: 1.55;
}

.detail-actions,
.reply-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.intelligence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.signal-box {
  min-height: 104px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: var(--off-white);
}

.signal-box span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.signal-box strong {
  display: block;
  color: var(--midnight-navy);
  line-height: 1.4;
}

.conversation,
.knowledge-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.message,
.knowledge-item,
.activity-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: var(--white);
}

.message strong,
.knowledge-item strong,
.activity-item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--midnight-navy);
}

.message p,
.knowledge-item p,
.activity-item p {
  margin: 0;
  color: var(--slate-blue);
  font-size: 14px;
  line-height: 1.55;
}

.match-list {
  gap: 8px;
}

.match-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 96px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--white);
}

.match-content {
  min-width: 0;
}

.match-content .article-meta {
  margin-bottom: 8px;
}

.match-content .pill {
  min-height: 24px;
  padding: 0 9px;
  font-size: 12px;
}

.match-content strong {
  display: block;
  margin-bottom: 5px;
  color: var(--midnight-navy);
  font-size: 15px;
  line-height: 1.25;
}

.match-content p {
  margin: 0;
  color: var(--slate-blue);
  font-size: 13px;
  line-height: 1.45;
}

.match-action {
  display: flex;
  justify-content: flex-end;
}

.match-action .ghost-button {
  min-height: 34px;
  padding: 0 14px;
  font-size: 12px;
}

.reply-box {
  margin-top: 18px;
}

.reply-box label {
  display: block;
  margin-bottom: 8px;
  color: var(--midnight-navy);
  font-weight: 700;
}

.queue-table {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.table-row {
  display: grid;
  grid-template-columns: 1.2fr 1.6fr 0.9fr 0.9fr 0.9fr 0.8fr;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  font-size: 14px;
}

.table-row:last-child {
  border-bottom: 0;
}

.table-row.header {
  min-height: 48px;
  background: var(--off-white);
  color: var(--slate-blue);
  font-size: 12px;
  font-weight: 800;
}

.automation-layout,
.insight-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 20px;
  align-items: stretch;
}

.automation-layout {
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
}

.automation-panel {
  padding: 20px;
}

.automation-side {
  display: grid;
  gap: 20px;
  align-content: start;
}

.automation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.automation-card {
  min-height: 254px;
  display: grid;
  gap: 12px;
  padding: 16px;
}

.automation-card header,
.automation-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.automation-card header > div {
  display: flex;
  flex: 1 1 180px;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.automation-card header .switch {
  margin-left: auto;
}

.automation-card h4 {
  margin: 0;
  color: var(--midnight-navy);
  font-size: 16px;
  line-height: 1.25;
}

.automation-card p {
  margin: 0;
  color: var(--slate-blue);
  font-size: 14px;
  line-height: 1.45;
}

.automation-fields {
  display: grid;
  gap: 12px;
}

.automation-fields div,
.simulation-ticket,
.automation-payload {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--off-white);
}

.automation-fields div {
  padding: 12px;
}

.automation-fields span,
.automation-payload .panel-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.automation-fields strong {
  color: var(--midnight-navy);
  font-size: 13px;
  line-height: 1.35;
}

.automation-card footer small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.automation-card footer .ghost-button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 14px;
  font-size: 12px;
}

.automation-simulator {
  display: grid;
  gap: 14px;
}

.simulation-ticket {
  padding: 16px;
}

.simulation-ticket h4,
.simulation-ticket p {
  margin: 0;
}

.simulation-ticket h4 {
  margin-top: 10px;
  color: var(--midnight-navy);
  font-size: 16px;
  line-height: 1.3;
}

.simulation-ticket p {
  margin-top: 6px;
  color: var(--slate-blue);
  font-size: 13px;
}

.simulation-flow {
  display: grid;
  gap: 8px;
}

.flow-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--white);
}

.flow-step > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--emerald-green);
  color: var(--white);
  font-size: 12px;
  font-weight: 800;
}

.flow-step strong {
  color: var(--midnight-navy);
  font-size: 14px;
}

.flow-step p {
  margin: 4px 0 0;
  color: var(--slate-blue);
  font-size: 13px;
  line-height: 1.4;
}

.automation-payload {
  padding: 14px;
}

.automation-payload code {
  display: block;
  overflow-x: auto;
  color: var(--midnight-navy);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre;
}

.empty-state.compact {
  min-height: 136px;
  padding: 18px;
}

.switch {
  position: relative;
  width: 50px;
  height: 28px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d0d5dd;
  transition: background 180ms ease;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 2px 8px rgba(9, 29, 55, 0.25);
  transition: transform 180ms ease;
}

.switch input:checked + span {
  background: var(--emerald-green);
}

.switch input:checked + span::after {
  transform: translateX(22px);
}

.activity-list,
.issue-list {
  display: grid;
  gap: 10px;
}

.insights-dashboard {
  display: grid;
  gap: 18px;
}

.insight-hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(13, 107, 79, 0.08), rgba(255, 255, 255, 0) 68%),
    var(--white);
  box-shadow: var(--shadow-sm);
}

.insight-hero-panel h3 {
  margin-bottom: 8px;
  font-family: var(--font-body);
  font-size: 24px;
  font-weight: 800;
}

.insight-hero-panel p:last-child {
  max-width: 840px;
  margin: 0;
  color: var(--slate-blue);
  line-height: 1.6;
}

.health-score {
  width: 136px;
  height: 136px;
  display: grid;
  place-content: center;
  gap: 6px;
  border-radius: 28px;
  background: var(--grad-brand);
  color: var(--white);
  text-align: center;
}

.health-score strong {
  font-family: var(--font-head);
  font-size: 54px;
  line-height: 1;
}

.health-score span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 800;
}

.insight-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.insight-kpi-card {
  min-height: 116px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.insight-kpi-card span {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.insight-kpi-card strong {
  display: block;
  color: var(--midnight-navy);
  font-family: var(--font-head);
  font-size: 34px;
  line-height: 1;
}

.insight-kpi-card small {
  display: block;
  margin-top: 10px;
  color: var(--slate-blue);
  line-height: 1.35;
}

.insight-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.insight-panel {
  min-height: 330px;
  padding: 20px;
}

.insight-panel .eyebrow {
  margin-bottom: 8px;
}

.insight-panel h3 {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.insight-bars {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.bar-row {
  display: grid;
  gap: 8px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  color: var(--slate-blue);
  font-size: 14px;
  font-weight: 700;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--grad-brand);
}

.risk-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.risk-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 14px;
  align-items: center;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--off-white);
}

.risk-item strong,
.risk-item p {
  margin: 0;
}

.risk-item strong {
  color: var(--midnight-navy);
}

.risk-item p {
  margin-top: 6px;
  color: var(--slate-blue);
  font-size: 13px;
  line-height: 1.45;
}

.risk-item > span {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--midnight-navy);
  color: var(--white);
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 800;
}

.issue-list {
  gap: 0;
  overflow: hidden;
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--white);
}

.issue-item {
  position: relative;
  display: grid;
  gap: 6px;
  min-height: 82px;
  padding: 16px 18px 16px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
}

.issue-item:last-child {
  border-bottom: 0;
}

.issue-item::before {
  content: "";
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: 0;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: var(--emerald-green);
}

.issue-item strong {
  display: block;
  color: var(--midnight-navy);
  font-size: 15px;
  line-height: 1.3;
}

.issue-item .article-meta {
  margin-bottom: 2px;
}

.impact-panel {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.impact-score {
  min-height: 184px;
  display: grid;
  place-content: center;
  gap: 10px;
  border-radius: 14px;
  background: var(--grad-brand);
  color: var(--white);
  text-align: center;
}

.impact-score strong {
  font-family: var(--font-head);
  font-size: 48px;
  line-height: 1;
}

.impact-score span {
  color: rgba(255, 255, 255, 0.78);
  padding: 0 24px;
}

.impact-breakdown {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.impact-breakdown div {
  min-height: 88px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--off-white);
}

.impact-breakdown span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.impact-breakdown strong {
  color: var(--midnight-navy);
  font-size: 22px;
}

.issue-item p {
  margin: 0;
  color: var(--slate-blue);
  font-size: 14px;
  line-height: 1.5;
}

.blueprint-dashboard {
  display: grid;
  gap: 20px;
}

.blueprint-hero-panel,
.blueprint-panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.blueprint-hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 24px;
  align-items: center;
  min-height: 260px;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(13, 107, 79, 0.08), rgba(255, 255, 255, 0) 62%),
    var(--white);
}

.blueprint-hero-panel h3 {
  max-width: 740px;
  margin-bottom: 12px;
  font-size: 34px;
  line-height: 1.08;
}

.blueprint-hero-panel p {
  max-width: 820px;
  margin: 0;
  color: var(--slate-blue);
  line-height: 1.65;
}

.blueprint-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.blueprint-stat {
  min-height: 112px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(13, 107, 79, 0.18);
  border-radius: 12px;
  background: var(--off-white);
}

.blueprint-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.blueprint-stat strong {
  color: var(--midnight-navy);
  font-family: var(--font-head);
  font-size: 30px;
  line-height: 1;
}

.blueprint-panel {
  padding: 22px;
}

.blueprint-panel h3 {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
}

.architecture-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.architecture-node {
  position: relative;
  min-height: 178px;
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--white);
}

.architecture-node::after {
  content: "";
  position: absolute;
  top: 30px;
  right: -9px;
  width: 14px;
  height: 2px;
  background: rgba(13, 107, 79, 0.34);
}

.architecture-node:last-child::after {
  display: none;
}

.architecture-node span,
.roadmap-step-number {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--emerald-green);
  color: var(--white);
  font-size: 13px;
  font-weight: 800;
}

.architecture-node strong,
.data-object strong,
.automation-handoff strong,
.roadmap-card strong {
  color: var(--midnight-navy);
  line-height: 1.3;
}

.architecture-node p,
.data-object p,
.automation-handoff p,
.roadmap-card p {
  margin: 0;
  color: var(--slate-blue);
  font-size: 13px;
  line-height: 1.55;
}

.blueprint-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}

.data-model-list,
.automation-map,
.roadmap-grid {
  display: grid;
  gap: 12px;
}

.data-object,
.automation-handoff,
.roadmap-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--off-white);
}

.data-object header,
.automation-handoff header,
.roadmap-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.data-object small,
.automation-handoff small,
.roadmap-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.field-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.field-list span {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(13, 107, 79, 0.08);
  color: var(--emerald-green);
  font-size: 12px;
  font-weight: 800;
}

.automation-handoff {
  background:
    linear-gradient(90deg, rgba(13, 107, 79, 0.06), rgba(246, 248, 247, 0) 72%),
    var(--off-white);
}

.roadmap-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.roadmap-card {
  min-height: 178px;
  background: var(--white);
}

.savings-card {
  min-height: 220px;
  display: grid;
  place-content: center;
  gap: 12px;
  margin-top: 20px;
  border-radius: 14px;
  background: var(--grad-brand);
  color: var(--white);
  text-align: center;
}

.savings-card strong {
  font-family: var(--font-head);
  font-size: 52px;
  line-height: 1;
}

.savings-card span {
  color: rgba(255, 255, 255, 0.78);
  padding: 0 24px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100vw - 48px));
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--midnight-navy);
  color: var(--white);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .metric-grid,
  .workspace-grid,
  .triage-layout,
  .automation-layout,
  .insight-layout,
  .insight-kpi-grid,
  .insight-detail-grid,
  .blueprint-hero-panel,
  .blueprint-grid,
  .architecture-flow,
  .roadmap-grid {
    grid-template-columns: 1fr 1fr;
  }

  .knowledge-layout {
    grid-template-columns: minmax(320px, 0.82fr) minmax(420px, 1.18fr);
  }

  .integration-layout {
    grid-template-columns: minmax(320px, 0.82fr) minmax(420px, 1.18fr);
  }

  .detail-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar,
  .topbar-actions,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .search-field {
    min-width: 0;
  }

  .main-content,
  .view-panel,
  .workspace-grid,
  .triage-layout,
  .knowledge-layout,
  .integration-layout,
  .automation-layout,
  .insight-detail-grid,
  .blueprint-grid,
  .queue-panel,
  .detail-panel,
  .triage-panel,
  .knowledge-panel,
  .integration-panel,
  .integration-list,
  .integration-detail,
  .integration-card,
  .integration-overview,
  .integration-meta-grid,
  .pipeline-steps,
  .pipeline-step,
  .integration-sample-grid,
  .integration-payload,
  .integration-analysis,
  .automation-panel,
  .activity-panel,
  .insight-panel,
  .blueprint-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .metric-grid,
  .workspace-grid,
  .triage-layout,
  .knowledge-layout,
  .integration-layout,
  .automation-layout,
  .automation-grid,
  .insight-layout,
  .insight-kpi-grid,
  .insight-detail-grid,
  .insight-hero-panel,
  .intelligence-grid,
  .analysis-grid,
  .impact-breakdown,
  .integration-overview,
  .pipeline-steps,
  .integration-sample-grid,
  .blueprint-hero-panel,
  .blueprint-grid,
  .blueprint-stats,
  .architecture-flow,
  .roadmap-grid,
  .form-row,
  .role-grid {
    grid-template-columns: 1fr;
  }

  .architecture-node::after {
    display: none;
  }

  .health-score {
    width: 100%;
    height: auto;
    min-height: 124px;
  }

  .table-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .table-row.header {
    display: none;
  }

  .article-stat-grid {
    grid-template-columns: 1fr;
  }

  .related-ticket {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .match-item {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .match-action {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .login-shell,
  .main-content,
  .sidebar {
    padding: 20px;
  }

  .login-brand {
    position: static;
    width: 100%;
    margin-bottom: 20px;
  }

  .login-shell {
    place-items: start;
  }

  .login-card {
    padding: 24px;
  }

  h1 {
    font-size: 38px;
  }

  h2 {
    font-size: 30px;
  }

  .segmented-control {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .knowledge-toolbar .segmented-control {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .article-overview {
    padding: 18px 18px 18px 22px;
  }

  .article-overview h4 {
    font-size: 20px;
  }

  .detail-header,
  .ticket-row {
    grid-template-columns: 1fr;
  }
}
