/* ============================================================
   infrastructure.css — Infrastructure Page View
   EPW-PRO-064: Security page pattern rebuild
   No glassmorphic cards. No entrance animations.
   Tables + collapsible sections. infra- CSS prefix.
   ============================================================ */

/* ---- Hide palette elements when view active ---- */
body.infra-active #expanded-title,
body.infra-active #bg-layer,
body.infra-active #c4-link { display: none !important; }

body.team-active #expanded-title,
body.team-active #bg-layer,
body.team-active #c4-link { display: none !important; }

/* Detail panel must render above views (z-index 50) */
body.infra-active #detail-panel { z-index: 200; }
body.team-active #detail-panel { z-index: 200; }

/* ---- Page Container ---- */
#infra-view,
#team-view {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: #ECFEFF;
  color: #475569;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  overflow: hidden;
}

#team-view {
  background: #EFF6FF;
}

#infra-view::before,
#team-view::before { content: none; }

/* ---- Header ---- */
.infra-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  z-index: 250;
  flex-shrink: 0;
  border-bottom: 2px solid #0891B2;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.infra-header-left { display: flex; align-items: center; gap: 12px; }
.infra-title { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.01em; color: #172351; margin: 0; }
.infra-subtitle {
  font-size: 0.75rem;
  font-weight: 400;
  color: rgba(71, 85, 105, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-left: 4px;
}
.infra-header-right { display: flex; align-items: center; gap: 8px; }

/* ---- Team Hero ---- */
.infra-team-hero {
  padding: 32px 28px 24px;
  text-align: center;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  border-bottom: 1px solid #e5e7eb;
}
.infra-team-lineup {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-bottom: 24px;
}
.infra-team-member {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.infra-team-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 0 0 2px rgba(8, 145, 178, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.infra-team-avatar:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15), 0 0 0 3px rgba(8, 145, 178, 0.35);
}
.infra-team-member:last-child .infra-team-avatar {
  background: #F5F0EB;
}
.infra-team-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1e293b;
  letter-spacing: -0.01em;
}
.infra-team-role {
  font-size: 0.7rem;
  font-weight: 500;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.infra-team-strapline {
  font-size: 0.68rem;
  color: #94a3b8;
  font-style: italic;
  margin-top: 3px;
}
.infra-team-mission {
  max-width: 640px;
  margin: 0 auto;
  font-size: 0.85rem;
  line-height: 1.7;
  color: #475569;
  font-style: italic;
}
.infra-team-mission--bold {
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 16px;
}

.infra-team-modes {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.infra-mode-pill {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 14px;
  background: #0d9488;
  color: #fff;
  font-size: 0.72rem;
  font-family: 'Cascadia Code', 'Consolas', monospace;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}

.infra-mode-pill:hover {
  background: #0f766e;
}

/* ---- Body ---- */
.infra-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 10cm;
}

/* ---- Sticky Nav Container ---- */
.infra-nav-sticky {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(to bottom, #f0fdfa 0%, #f0fdfa 90%, rgba(240,253,250,0) 100%);
  padding: 0 0 6px 0;
  margin: 0 -28px;
  padding-left: 28px;
  padding-right: 28px;
}

/* ---- Tab Navigation pills ---- */
.infra-tab-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.infra-tab-pill {
  padding: 4px 11px;
  border-radius: 16px;
  border: 1px solid #E5E7EB;
  background: #fff;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  color: #475569;
  transition: all 0.15s;
  font-family: inherit;
}

.infra-tab-pill:hover {
  border-color: #0891B2;
  color: #0891B2;
}

.infra-tab-pill--active {
  background: #0891B2;
  color: #fff;
  border-color: #0891B2;
  font-weight: 600;
}

.infra-tab-pill--active:hover {
  background: #0E7490;
  border-color: #0E7490;
  color: #fff;
}

/* ---- Sub-navigation pills ---- */
.infra-sub-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin: -14px 0 16px 0;
  min-height: 0;
}
.infra-sub-nav:empty {
  display: none;
}
.infra-sub-pill {
  padding: 3px 10px;
  border-radius: 14px;
  border: 1px solid #D1D5DB;
  background: #F1F5F9;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.infra-sub-pill:hover {
  border-color: #0891B2;
  color: #0891B2;
  background: #ECFEFF;
}
.infra-sub-pill--active {
  background: #0891B2;
  color: #fff;
  border-color: #0891B2;
  font-weight: 600;
}

/* ---- Tab panels ---- */
.infra-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---- DevOps sections (10-section layout) ---- */
.devops-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.devops-section-heading {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0891B2;
  margin: 18px 0 4px 0;
  padding: 0 0 6px 0;
  border-bottom: 2px solid #0891B222;
  letter-spacing: 0.02em;
}

/* ---- Section 1: Team Member Cards ---- */
.devops-member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.devops-member-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
}

.devops-member-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.devops-member-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #0891B233;
}

.devops-member-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: #1e293b;
}

.devops-member-role {
  font-size: 0.74rem;
  color: #64748b;
  font-weight: 500;
}

.devops-member-strapline {
  font-size: 0.68rem;
  color: #94a3b8;
  font-style: italic;
  margin-top: 2px;
}

.devops-member-owns {
  margin: 0;
  padding: 0 0 0 18px;
  font-size: 0.76rem;
  color: #475569;
  line-height: 1.7;
}

.devops-member-owns li {
  margin-bottom: 2px;
}

/* ---- Section 1c: Readiness Gate ---- */
.devops-rg-ok {
  color: #059669;
  font-weight: 600;
  font-size: 0.8rem;
}

.devops-rg-ok::before {
  content: '\25CF ';
  color: #10b981;
}

.devops-rg-fail {
  color: #dc2626;
  font-weight: 600;
  font-size: 0.8rem;
}

.devops-rg-fail::before {
  content: '\25CF ';
  color: #ef4444;
}

.devops-rg-unknown {
  color: #d97706;
  font-weight: 500;
  font-size: 0.8rem;
}

.devops-rg-unknown::before {
  content: '\25CF ';
  color: #f59e0b;
}

.devops-rg-pending {
  color: #94a3b8;
  font-size: 0.78rem;
  font-style: italic;
}

/* ---- Collapsible sections ---- */
.infra-collapsible {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}

.infra-collapsible-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: text;
  font-size: 0.88rem;
  font-weight: 600;
  color: #172351;
  background: #F8FAFC;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition: background 0.15s;
}

.infra-collapsible-toggle:hover { background: #F1F5F9; }

.infra-collapsible-arrow {
  font-size: 0.7rem;
  color: #0891B2;
  flex-shrink: 0;
  transition: none;
}

.infra-collapsible-body {
  max-height: 0;
  overflow: hidden;
  padding: 0 16px;
  transition: max-height 0.3s ease, padding 0.3s;
}

.infra-collapsible-body.open {
  max-height: 20000px;
  padding: 12px 16px 16px;
}

/* ---- Tables ---- */
.infra-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.82rem;
  margin-bottom: 4px;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.infra-table th {
  background: #F1F5F9;
  color: #475569;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid #E5E7EB;
  white-space: nowrap;
}

.infra-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #F1F5F9;
  color: #475569;
  vertical-align: middle;
}

.infra-table tr:last-child td { border-bottom: none; }
.infra-table tr:hover td { background: #F8FAFC; }

/* Clickable rows */
.infra-worker-row,
.infra-asset-row,
.infra-doc-row {
  cursor: pointer;
}

/* ---- Worker cell layout ---- */
.infra-worker-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.infra-worker-avatar-sm {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.infra-worker-name {
  font-weight: 600;
  color: #172351;
  white-space: nowrap;
}

/* ---- Asset name cell ---- */
.infra-asset-name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.infra-asset-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Spec cells ---- */
.infra-spec-val {
  font-weight: 600;
  color: #172351;
  margin-right: 4px;
}

.infra-spec-lbl {
  font-size: 0.7rem;
  color: #94A3B8;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ---- Detail cell ---- */
.infra-detail-cell {
  font-size: 0.78rem;
  color: #64748B;
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Badges ---- */
.infra-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.infra-badge-ok      { background: #DCFCE7; color: #166534; }
.infra-badge-warning { background: #FEF3C7; color: #92400E; }
.infra-badge-info    { background: #DBEAFE; color: #1E40AF; }
.infra-badge-na      { background: #F3F4F6; color: #6B7280; }

.infra-badge-level {
  background: rgba(8, 145, 178, 0.08);
  color: #0891B2;
  font-family: monospace;
}

/* ---- Stat badges (worker cards) ---- */
.infra-stat-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  background: rgba(8, 145, 178, 0.08);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #0891B2;
  margin-right: 4px;
}

.infra-stat-badge small {
  font-size: 0.65rem;
  font-weight: 500;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ---- Doc ID tag ---- */
.infra-doc-id {
  font-family: 'SF Mono', 'Consolas', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  color: #0891B2;
  background: rgba(8, 145, 178, 0.08);
  border: 1px solid rgba(8, 145, 178, 0.2);
  padding: 1px 6px;
  border-radius: 4px;
}

/* ---- Count cells ---- */
.infra-count-cell {
  font-size: 0.88rem;
  font-weight: 700;
  color: #172351;
}

/* ---- Tool icon ---- */
.infra-tool-icon-cell {
  margin-right: 6px;
  font-size: 1rem;
}

/* ---- Action buttons ---- */
.infra-action-btn {
  padding: 3px 10px;
  border: 1px solid #CBD5E1;
  border-radius: 4px;
  background: #fff;
  font-size: 0.72rem;
  font-weight: 500;
  color: #0891B2;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.infra-action-btn:hover {
  background: #ECFEFF;
  border-color: #0891B2;
}

/* ---- Return to Top ---- */
.infra-return-top {
  text-align: left;
  padding: 8px 0 2px;
}

.infra-return-top-link {
  font-size: 0.72rem;
  font-weight: 500;
  color: #0891B2;
  text-decoration: none;
  cursor: pointer;
}

.infra-return-top-link:hover { text-decoration: underline; }

/* ---- Empty / loading states ---- */
.infra-empty {
  padding: 20px;
  text-align: center;
  color: #94A3B8;
  font-size: 0.82rem;
  font-style: italic;
}

.infra-loading {
  padding: 16px;
  color: #94A3B8;
  font-size: 0.82rem;
}

.infra-api-note {
  font-size: 0.75rem;
  color: #94A3B8;
  margin-top: 8px;
  padding: 6px 16px;
}

/* ---- Device specs (Detail Panel — shared with old CSS) ---- */
.device-specs-section {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(8, 145, 178, 0.05);
  border: 1px solid rgba(8, 145, 178, 0.1);
}

.device-specs-section .project-detail-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #0891B2;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 10px;
}

.device-spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(8, 145, 178, 0.08);
  font-size: 0.78rem;
}

.device-spec-row:last-child { border-bottom: none; }
.device-spec-label { color: #6B7280; font-weight: 500; }
.device-spec-value { color: #1F2937; font-weight: 600; text-align: right; }

.device-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.02);
  width: fit-content;
  margin-bottom: 12px;
}

/* ---- Worker Scratchpads ---- */
.scratchpad-card {
  border: 1px solid #E5E7EB;
  border-radius: 6px;
  margin-bottom: 6px;
  background: #FAFAFA;
}
.scratchpad-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  cursor: pointer;
}
.scratchpad-card-header:hover { background: #F1F5F9; }
.scratchpad-worker-name { font-weight: 600; font-size: 0.85rem; }
.scratchpad-count { font-size: 0.75rem; color: #9CA3AF; }
.scratchpad-card-body { padding: 0 12px 12px; }
.scratchpad-notes { margin-bottom: 8px; }
.scratchpad-empty { color: #9CA3AF; font-size: 0.8rem; padding: 4px 0; }
.scratchpad-note {
  border-left: 2px solid #D1D5DB;
  padding: 4px 0 4px 8px;
  margin-bottom: 6px;
}
.scratchpad-note-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  color: #6B7280;
  margin-bottom: 2px;
}
.scratchpad-note-author { font-weight: 600; color: #374151; }
.scratchpad-note-time { flex: 1; }
.scratchpad-note-delete {
  background: none; border: none; color: #DC2626; cursor: pointer;
  font-size: 1.1rem; font-weight: 700; line-height: 1; padding: 0 4px;
}
.scratchpad-note-delete:hover { color: #991B1B; }
.scratchpad-note { cursor: pointer; position: relative; }
.scratchpad-note:hover { background: rgba(0,0,0,0.02); }
.scratchpad-note-copied {
  position: absolute; top: 4px; right: 28px;
  font-size: 0.55rem; color: #22C55E; font-weight: 600;
  opacity: 0; transition: opacity 0.3s; pointer-events: none;
}
.scratchpad-note-content {
  font-size: 0.82rem;
  color: #1F2937;
  white-space: pre-wrap;
  word-break: break-word;
}
.scratchpad-add-form { margin-top: 4px; }
.scratchpad-textarea {
  width: 100%;
  border: 1px solid #D1D5DB;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 0.82rem;
  font-family: inherit;
  resize: vertical;
  min-height: 40px;
  box-sizing: border-box;
}
.scratchpad-textarea:focus { outline: none; border-color: #0891B2; }
.scratchpad-form-row {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  justify-content: flex-end;
  align-items: center;
}
.scratchpad-author-select {
  font-size: 0.75rem;
  padding: 3px 6px;
  border: 1px solid #D1D5DB;
  border-radius: 4px;
  background: #fff;
}
.scratchpad-add-btn {
  font-size: 0.75rem;
  padding: 4px 12px;
  background: #0891B2;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}
.scratchpad-add-btn:hover { background: #0E7490; }
.scratchpad-add-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Business Documentation & Details ---- */
.business-docs-table { width: 100%; }
.business-docs-table th { text-align: left; font-size: 0.75rem; text-transform: uppercase; color: #6B7280; padding: 6px 10px; border-bottom: 2px solid #E5E7EB; }
.business-docs-label { font-weight: 600; font-size: 0.82rem; color: #374151; white-space: nowrap; width: 200px; padding: 8px 10px; vertical-align: top; }
.business-docs-value { font-size: 0.82rem; color: #1F2937; padding: 8px 10px; white-space: pre-wrap; word-break: break-word; }
.business-docs-edit-cell { width: 32px; text-align: center; padding: 8px 4px; }
.business-docs-edit-btn { background: none; border: none; cursor: pointer; font-size: 0.9rem; color: #9CA3AF; padding: 2px 4px; }
.business-docs-edit-btn:hover { color: #0891B2; }
.infra-empty-val { color: #D1D5DB; }
.business-docs-input {
  width: 100%; border: 1px solid #0891B2; border-radius: 4px;
  padding: 4px 8px; font-size: 0.82rem; font-family: inherit;
  box-sizing: border-box;
}
.business-docs-input:focus { outline: none; border-color: #0E7490; box-shadow: 0 0 0 2px rgba(8,145,178,0.15); }
.business-docs-edit-actions { display: flex; gap: 6px; margin-top: 4px; }
.business-docs-save-btn {
  font-size: 0.75rem; padding: 3px 10px; background: #0891B2; color: #fff;
  border: none; border-radius: 4px; cursor: pointer; font-weight: 600;
}
.business-docs-save-btn:hover { background: #0E7490; }
.business-docs-cancel-btn {
  font-size: 0.75rem; padding: 3px 10px; background: #E5E7EB; color: #374151;
  border: none; border-radius: 4px; cursor: pointer;
}
.business-docs-cancel-btn:hover { background: #D1D5DB; }
.business-docs-table tbody tr:hover { background: #F8FAFC; }

/* ---- Canned Responses ---- */
.canned-responses-wrapper { padding: 4px 0; }
.canned-response-add {
  border: 1px solid #E5E7EB; border-radius: 6px; padding: 10px;
  margin-bottom: 12px; background: #FAFAFA;
}
.canned-response-title-input, .canned-response-category-input {
  width: 100%; border: 1px solid #D1D5DB; border-radius: 4px;
  padding: 6px 8px; font-size: 0.82rem; font-family: inherit;
  box-sizing: border-box; margin-bottom: 6px;
}
.canned-response-content-input {
  width: 100%; border: 1px solid #D1D5DB; border-radius: 4px;
  padding: 6px 8px; font-size: 0.82rem; font-family: inherit;
  resize: vertical; min-height: 60px; box-sizing: border-box; margin-bottom: 6px;
}
.canned-response-title-input:focus, .canned-response-content-input:focus, .canned-response-category-input:focus {
  outline: none; border-color: #0891B2;
}
.canned-response-add-actions {
  display: flex; gap: 8px; align-items: center;
}
.canned-response-category-input { width: auto; flex: 1; margin-bottom: 0; }
.canned-response-add-btn {
  font-size: 0.75rem; padding: 5px 14px; background: #0891B2; color: #fff;
  border: none; border-radius: 4px; cursor: pointer; font-weight: 600; white-space: nowrap;
}
.canned-response-add-btn:hover { background: #0E7490; }
.canned-response-add-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.canned-response-category-group { margin-bottom: 10px; }
.canned-response-category-label {
  font-size: 0.72rem; text-transform: uppercase; font-weight: 700;
  color: #6B7280; letter-spacing: 0.04em; padding: 4px 0 2px;
  border-bottom: 1px solid #E5E7EB; margin-bottom: 4px;
}
.canned-response-card {
  border: 1px solid #E5E7EB; border-radius: 6px;
  margin-bottom: 4px; background: #fff;
}
.canned-response-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 10px; border-bottom: 1px solid #F3F4F6;
}
.canned-response-title { font-weight: 600; font-size: 0.82rem; color: #1F2937; }
.canned-response-actions { display: flex; gap: 4px; }
.canned-response-copy-btn, .canned-response-delete-btn {
  background: none; border: none; cursor: pointer; font-size: 0.85rem;
  color: #9CA3AF; padding: 2px 4px;
}
.canned-response-delete-btn { color: #DC2626; font-weight: 700; }
.canned-response-copy-btn:hover { color: #0891B2; }
.canned-response-delete-btn:hover { color: #991B1B; }
.canned-response-body {
  padding: 8px 10px; font-size: 0.82rem; color: #374151;
  white-space: pre-wrap; word-break: break-word; line-height: 1.5;
}
.canned-response-card:hover { border-color: #D1D5DB; }

/* ---- Dev Team KB ---- */
.infra-kb-mission-statement { padding: 12px 0; }
.infra-kb-quote {
  margin: 0;
  padding: 16px 24px;
  border-left: 4px solid #f59e0b;
  background: rgba(245, 158, 11, 0.06);
  border-radius: 0 8px 8px 0;
  font-size: 1rem;
  line-height: 1.6;
  color: #1e293b;
  font-style: italic;
}
.infra-kb-placeholder {
  padding: 16px;
  color: #94a3b8;
  font-size: 0.82rem;
  font-style: italic;
}
.infra-kb-forum-entry { padding: 8px 0; }
.infra-kb-forum-meta {
  display: flex;
  gap: 12px;
  font-size: 0.72rem;
  color: #94a3b8;
  margin-bottom: 8px;
}
.infra-kb-forum-date { font-weight: 600; }
.infra-kb-forum-author { color: #64748b; }
.infra-kb-forum-title {
  margin: 0 0 12px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #1e293b;
}
.infra-kb-forum-body {
  font-size: 0.82rem;
  line-height: 1.7;
  color: #334155;
}
.infra-kb-forum-body h5 {
  margin: 16px 0 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #1e293b;
}
.infra-kb-forum-body p { margin: 0 0 8px; }
.infra-kb-forum-body ol {
  margin: 0 0 8px;
  padding-left: 20px;
}
.infra-kb-forum-body li { margin-bottom: 6px; }
.infra-kb-forum-body em { color: #f59e0b; }

/* Forum — toolbar & topic list */
.infra-kb-forum-toolbar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.infra-kb-forum-new-btn {
  padding: 6px 16px; border: none; border-radius: 6px; cursor: pointer;
  background: #f59e0b; color: #fff; font-size: 0.78rem; font-weight: 600;
}
.infra-kb-forum-new-btn:hover { background: #d97706; }
.infra-kb-forum-topics { display: flex; flex-direction: column; gap: 6px; }
.infra-kb-forum-topic-card {
  padding: 10px 14px; border-radius: 8px; cursor: pointer;
  border: 1px solid #e5e7eb; background: #fafafa; transition: border-color 0.15s;
}
.infra-kb-forum-topic-card:hover { border-color: #f59e0b; }
.infra-kb-forum-topic-title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.infra-kb-forum-topic-title { font-size: 0.85rem; font-weight: 600; color: #1e293b; }
.infra-kb-forum-responses-count { font-size: 0.7rem; color: #64748b; margin-left: auto; }

/* Forum — tier & status badges */
.infra-kb-tier-badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 0.65rem; font-weight: 600; color: #fff; line-height: 1.4;
}
.infra-kb-status-badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 0.65rem; font-weight: 600; color: #fff; text-transform: uppercase; line-height: 1.4;
}

/* Forum — new topic form */
.infra-kb-forum-new-form { padding: 12px; background: #f8fafc; border-radius: 8px; border: 1px solid #e5e7eb; margin-bottom: 12px; }
.infra-kb-forum-input {
  width: 100%; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px;
  font-size: 0.82rem; margin-bottom: 8px; box-sizing: border-box;
}
.infra-kb-forum-textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px;
  font-size: 0.78rem; font-family: 'Cascadia Code', 'Consolas', monospace;
  resize: vertical; margin-bottom: 8px; box-sizing: border-box;
}
.infra-kb-forum-form-actions { display: flex; gap: 8px; align-items: center; }
.infra-kb-forum-select { padding: 6px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 0.78rem; }
.infra-kb-forum-submit-btn {
  padding: 6px 16px; border: none; border-radius: 6px; cursor: pointer;
  background: #f59e0b; color: #fff; font-size: 0.78rem; font-weight: 600;
}
.infra-kb-forum-submit-btn:hover { background: #d97706; }
.infra-kb-forum-cancel-btn {
  padding: 6px 12px; border: 1px solid #d1d5db; border-radius: 6px; cursor: pointer;
  background: #fff; color: #64748b; font-size: 0.78rem;
}

/* Forum — thread view */
.infra-kb-forum-back-btn {
  padding: 4px 12px; border: 1px solid #d1d5db; border-radius: 6px; cursor: pointer;
  background: #fff; color: #64748b; font-size: 0.75rem; margin-bottom: 12px;
}
.infra-kb-forum-back-btn:hover { border-color: #f59e0b; color: #f59e0b; }
.infra-kb-forum-thread-header { margin-bottom: 12px; }
.infra-kb-forum-thread-title { margin: 0; font-size: 1rem; font-weight: 600; color: #1e293b; }
.infra-kb-forum-op {
  padding: 12px; background: #f8fafc; border-radius: 8px; border: 1px solid #e5e7eb; margin-bottom: 16px;
}
.infra-kb-forum-body-text {
  margin: 0; white-space: pre-wrap; word-wrap: break-word;
  font-size: 0.8rem; line-height: 1.7; color: #334155;
  font-family: 'Cascadia Code', 'Consolas', monospace;
}
.infra-kb-forum-responses-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.infra-kb-forum-response {
  padding: 10px 14px; background: #fff; border-radius: 6px;
  border: 1px solid #e5e7eb;
}

/* Forum — reply section */
.infra-kb-forum-reply-section {
  padding: 12px; background: #f0f9ff; border-radius: 8px; border: 1px solid #bae6fd;
}
.infra-kb-forum-reply-heading { margin: 0 0 8px; font-size: 0.82rem; font-weight: 600; color: #1e293b; }
.infra-kb-forum-ollama-btn {
  padding: 6px 16px; border: none; border-radius: 6px; cursor: pointer;
  background: #10b981; color: #fff; font-size: 0.78rem; font-weight: 600;
}
.infra-kb-forum-ollama-btn:hover { background: #059669; }
.infra-kb-forum-ollama-btn:disabled { opacity: 0.6; cursor: wait; }
.infra-kb-forum-gemini-btn {
  padding: 6px 16px; border: none; border-radius: 6px; cursor: pointer;
  background: #3b82f6; color: #fff; font-size: 0.78rem; font-weight: 600;
}
.infra-kb-forum-gemini-btn:hover { background: #2563eb; }
.infra-kb-forum-gemini-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.infra-kb-forum-openai-btn {
  padding: 6px 16px; border: none; border-radius: 6px; cursor: pointer;
  background: #ef4444; color: #fff; font-size: 0.78rem; font-weight: 600;
}
.infra-kb-forum-openai-btn:hover { background: #dc2626; }
.infra-kb-forum-openai-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Synthesize section */
.infra-kb-forum-synthesize-section {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; margin-bottom: 12px;
  background: linear-gradient(135deg, rgba(139,92,246,0.08), rgba(59,130,246,0.08), rgba(16,185,129,0.08));
  border-radius: 8px; border: 1px solid rgba(139,92,246,0.2);
}
.infra-kb-forum-synthesize-btn {
  padding: 8px 24px; border: none; border-radius: 6px; cursor: pointer;
  background: linear-gradient(135deg, #8b5cf6, #3b82f6, #10b981);
  color: #fff; font-size: 0.85rem; font-weight: 700; letter-spacing: 0.02em;
  white-space: nowrap;
}
.infra-kb-forum-synthesize-btn:hover { opacity: 0.9; }
.infra-kb-forum-synthesize-btn:disabled { opacity: 0.6; cursor: wait; }
.infra-kb-forum-synth-hint { font-size: 0.72rem; color: #64748b; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .infra-body { padding: 16px; }
  .infra-header { padding: 12px 16px; }
  .infra-detail-cell { max-width: 140px; }
}
