:root {
  --bg: #0b1020;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-strong: rgba(255, 255, 255, 0.13);
  --border: rgba(255, 255, 255, 0.14);
  --text: #f7f8ff;
  --muted: #aab3cc;
  --soft: rgba(255, 255, 255, 0.06);
  --radius: 24px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(110, 145, 255, 0.25), transparent 30%),
    radial-gradient(circle at 80% 0%, rgba(210, 110, 255, 0.18), transparent 34%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.hmi-root {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 292px 1fr;
  gap: 24px;
  padding: 24px;
}

.hmi-sidebar {
  min-height: calc(100vh - 48px);
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-strong), var(--panel));
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.brand-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 24px;
  background: linear-gradient(135deg, rgba(120, 150, 255, 0.95), rgba(255, 120, 210, 0.8));
}

.brand-title {
  font-size: 20px;
  font-weight: 750;
}

.brand-subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.role-picker {
  margin: 22px 0;
}

.role-picker label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.role-picker select {
  width: 100%;
  padding: 12px 14px;
  color: var(--text);
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  outline: none;
}

.role-picker option {
  color: #101322;
}

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

.nav-item {
  width: 100%;
  text-align: left;
  padding: 13px 14px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  transition: 160ms ease;
}

.nav-item:hover,
.nav-item.active {
  color: var(--text);
  background: var(--soft);
  border-color: var(--border);
}

.hmi-main {
  min-width: 0;
}

.topbar {
  min-height: 96px;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--panel-strong), var(--panel));
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -0.03em;
}

.topbar p {
  margin: 7px 0 0;
  color: var(--muted);
}

.status-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--soft);
  color: var(--text);
  font-size: 13px;
}

.status-pill.muted {
  color: var(--muted);
}

.led {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
}

.led-ok {
  background: #75f0a3;
  box-shadow: 0 0 16px rgba(117, 240, 163, 0.75);
}

.led-warn {
  background: #ffd36a;
  box-shadow: 0 0 16px rgba(255, 211, 106, 0.55);
}

.content-grid {
  padding: 24px 0;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(12, 1fr);
}

.card {
  grid-column: span 4;
  min-height: 160px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-strong), var(--panel));
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.card.wide {
  grid-column: span 8;
}

.card.full {
  grid-column: 1 / -1;
}

.card h2,
.card h3 {
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}

.card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.agent-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}

.agent-card {
  min-height: 190px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  cursor: pointer;
  transition: 180ms ease;
}

.agent-card:hover {
  transform: translateY(-3px);
  background: var(--panel-strong);
}

.agent-icon {
  width: 58px;
  height: 58px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 750;
  background: var(--soft);
  margin-bottom: 14px;
}

.agent-title {
  font-weight: 720;
  margin-bottom: 6px;
}

.agent-meta,
.small-muted {
  color: var(--muted);
  font-size: 13px;
}

.table-card {
  grid-column: 1 / -1;
  overflow: hidden;
}

.table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text);
}

.table th,
.table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 14px;
}

.table th {
  color: var(--muted);
  font-weight: 600;
}

.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.button {
  border: 1px solid var(--border);
  background: var(--soft);
  color: var(--text);
  border-radius: 14px;
  padding: 11px 14px;
  cursor: pointer;
}

.button.primary {
  background: linear-gradient(135deg, rgba(120, 150, 255, 0.8), rgba(255, 120, 210, 0.55));
}

@media (max-width: 920px) {
  .hmi-root {
    grid-template-columns: 1fr;
  }

  .hmi-sidebar {
    min-height: auto;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .card,
  .card.wide {
    grid-column: 1 / -1;
  }
}

.hmi-label {
  display: block;
  margin-top: 14px;
  margin-bottom: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  opacity: 0.78;
}

.hmi-input {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.42);
  color: inherit;
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
}

.hmi-input:focus {
  border-color: rgba(125, 211, 252, 0.7);
  box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.12);
}

.hmi-pre {
  margin-top: 14px;
  max-height: 360px;
  overflow: auto;
  padding: 14px;
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.18);
  font-size: 0.82rem;
  line-height: 1.45;
}

.hmi-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(125, 211, 252, 0.12);
  border: 1px solid rgba(125, 211, 252, 0.22);
}

.hmi-card-soft {
  background: rgba(15, 23, 42, 0.34);
}

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

@media (max-width: 900px) {
  .hmi-grid-2 {
    grid-template-columns: 1fr;
  }
}

.hmi-kv {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.hmi-kv-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.35fr) 1fr;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.32);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.hmi-kv-key {
  font-size: 0.78rem;
  font-weight: 800;
  opacity: 0.72;
}

.hmi-kv-value {
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.hmi-table-wrap {
  width: 100%;
  overflow: auto;
  margin-top: 14px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.hmi-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.hmi-table th,
.hmi-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  vertical-align: top;
}

.hmi-table th {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.68;
}

.hmi-table tr:last-child td {
  border-bottom: 0;
}

.hmi-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.hmi-section-header h2 {
  margin: 0 0 6px 0;
  font-size: 1.55rem;
  letter-spacing: -0.03em;
}

/* Step 35A - Master Dashboard v1 mock */

.hmi-master-dashboard {
  display: grid;
  gap: 22px;
}

.hmi-master-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: 26px;
  border-radius: 28px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 34%),
    rgba(15, 23, 42, 0.54);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

.hmi-master-hero h2 {
  margin: 4px 0 8px 0;
  font-size: 2.05rem;
  letter-spacing: -0.045em;
}

.hmi-master-hero p {
  margin: 0;
  opacity: 0.72;
  max-width: 660px;
}

.hmi-eyebrow {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.62;
  font-weight: 800;
}

.hmi-master-hero-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.64);
  border: 1px solid rgba(148, 163, 184, 0.18);
  font-weight: 800;
}

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

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

.hmi-dashboard-panel {
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.48);
  padding: 20px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.18);
}

.hmi-dashboard-panel-muted {
  opacity: 0.82;
}

.hmi-dashboard-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.hmi-dashboard-panel-head h3 {
  margin: 0 0 6px 0;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.hmi-dashboard-panel-head p {
  margin: 0;
  opacity: 0.62;
  font-size: 0.86rem;
}

.hmi-dashboard-panel-body {
  display: grid;
  gap: 10px;
}

.hmi-dashboard-kv {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 11px 12px;
  border-radius: 15px;
  background: rgba(2, 6, 23, 0.24);
  border: 1px solid rgba(148, 163, 184, 0.10);
}

.hmi-dashboard-kv span {
  opacity: 0.64;
  font-size: 0.86rem;
}

.hmi-dashboard-kv strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  text-align: right;
}

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

.hmi-dashboard-stats-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hmi-dashboard-stats-grid-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.hmi-dashboard-stat {
  padding: 16px;
  border-radius: 20px;
  background: rgba(2, 6, 23, 0.28);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.hmi-dashboard-stat-top {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}

.hmi-dashboard-stat-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.62;
  font-weight: 800;
}

.hmi-dashboard-stat-value {
  font-size: 1.6rem;
  font-weight: 850;
  letter-spacing: -0.04em;
}

.hmi-dashboard-stat-subtitle {
  margin-top: 4px;
  font-size: 0.78rem;
  opacity: 0.56;
}

.hmi-led {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 auto;
  background: rgba(148, 163, 184, 0.55);
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.10);
}

.hmi-led-ok {
  background: rgb(34, 197, 94);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}

.hmi-led-warn {
  background: rgb(250, 204, 21);
  box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.14);
}

.hmi-led-bad {
  background: rgb(248, 113, 113);
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.14);
}

.hmi-led-muted {
  background: rgb(100, 116, 139);
  box-shadow: 0 0 0 4px rgba(100, 116, 139, 0.12);
}

.hmi-backup-table {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.hmi-backup-head,
.hmi-backup-row {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.9fr 0.8fr;
  gap: 12px;
  align-items: center;
}

.hmi-backup-head {
  font-size: 0.72rem;
  opacity: 0.58;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  padding: 0 12px;
}

.hmi-backup-row {
  padding: 12px;
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.24);
  border: 1px solid rgba(148, 163, 184, 0.10);
  font-size: 0.84rem;
}

.hmi-backup-row strong,
.hmi-backup-row span {
  display: block;
}

.hmi-backup-row span {
  opacity: 0.54;
  font-size: 0.76rem;
  margin-top: 3px;
}

.hmi-dashboard-warning {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 22px;
  background: rgba(250, 204, 21, 0.08);
  border: 1px solid rgba(250, 204, 21, 0.16);
}

.hmi-dashboard-warning strong {
  margin-right: 8px;
}

.hmi-dashboard-warning span {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.26);
  font-size: 0.78rem;
  opacity: 0.78;
}

/* Sidebar readability refinement */

.hmi-nav button,
.hmi-nav-item,
button[data-feature],
[data-hmi-feature] {
  font-size: 0.95rem;
  min-height: 42px;
  padding: 11px 14px;
}

/* Core services */
.hmi-services-page {
  width: 100%;
  min-width: 0;
  grid-column: 1 / -1;
}

.hmi-services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.hmi-services-list-card .master-card__body {
  padding: 0;
}

.hmi-services-table-wrap {
  margin-top: 0;
  border: 0;
  border-radius: 0 0 18px 18px;
}

.hmi-services-table th,
.hmi-services-table td {
  padding: 14px 18px;
  vertical-align: middle;
}

.hmi-services-table th:first-child {
  width: 42%;
}

.hmi-services-table th:nth-child(2) {
  width: 150px;
}

.hmi-social-service-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.hmi-social-service-arrow {
  display: inline-block;
  transition: transform 160ms ease;
}

.hmi-social-service-arrow.is-open {
  transform: rotate(180deg);
}

.hmi-social-service-config-row td {
  background: color-mix(in srgb, var(--hmi-surface, #fff) 94%, #1f5fd1 6%);
  padding: 1rem 1.25rem !important;
}

.hmi-social-inline-form {
  display: grid;
  gap: 1rem;
}

.hmi-service-key-field,
.hmi-ors-wide-field {
  display: grid;
  gap: 7px;
  width: 100%;
  min-width: 0;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 700;
}

.hmi-service-key-field input,
.hmi-ors-wide-field input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 1px solid #cbd7e8;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
}

.hmi-social-inline-form [data-tavily-feedback],
.hmi-social-inline-form [data-serper-feedback],
.hmi-social-inline-form [data-openai-feedback],
.hmi-social-inline-form [data-openrouteservice-feedback] {
  color: #137044;
}

.hmi-social-inline-form [data-tavily-feedback].is-error,
.hmi-social-inline-form [data-serper-feedback].is-error,
.hmi-social-inline-form [data-openai-feedback].is-error,
.hmi-social-inline-form [data-openrouteservice-feedback].is-error {
  color: #b42318;
}

.hmi-service-link {
  display: block;
  margin: 0 0 3px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #0d56d9;
  font: inherit;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}

.hmi-service-link:hover {
  text-decoration: underline;
}

.hmi-service-row-description {
  display: block;
  color: #64748b;
  font-size: 0.82rem;
}

.hmi-service-card .master-card__header {
  align-items: flex-start;
}

.hmi-service-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  background: #eef2f7;
  color: #52606d;
}

.hmi-service-status.is-ready {
  background: #e8f7ef;
  color: #137044;
}

.hmi-service-status.is-pending {
  background: #fff6df;
  color: #8a5a00;
}

.hmi-service-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 8px 0 16px;
}

.hmi-service-metrics > span {
  padding: 10px 12px;
  border: 1px solid #dce5f2;
  border-radius: 10px;
  background: #f8fbff;
}

.hmi-service-settings-card {
  max-width: 1120px;
}

.hmi-linkedin-settings-card {
  max-width: 1500px;
}

.hmi-service-form {
  display: grid;
  gap: 18px;
}

.hmi-service-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.hmi-service-summary > span {
  display: grid;
  gap: 4px;
  padding: 13px 15px;
  border: 1px solid #dbe5f3;
  border-radius: 10px;
  background: #f7faff;
  color: #64748b;
  font-size: 0.8rem;
}

.hmi-service-summary strong {
  color: #0f172a;
  font-size: 0.95rem;
}

.hmi-service-form-section {
  display: grid;
  gap: 14px;
  padding-top: 4px;
}

.hmi-service-form-section + .hmi-service-form-section {
  padding-top: 18px;
  border-top: 1px solid #e2e8f0;
}

.hmi-service-form-section h4 {
  margin: 0;
  font-size: 1rem;
}

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

.hmi-service-form-grid > label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.hmi-service-form-grid label > span {
  color: #475569;
  font-size: 0.82rem;
  font-weight: 700;
}

.hmi-service-form-grid input,
.hmi-service-form-grid select {
  width: 100%;
  min-height: 40px;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #cbd7e8;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
}

.hmi-service-toggle {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 14px;
  border: 1px solid #dbe5f3;
  border-radius: 10px;
  background: #f8fbff;
}

.hmi-service-toggle > span {
  display: grid;
  gap: 3px;
}

.hmi-service-toggle small {
  color: #64748b;
  font-weight: 400;
}

.hmi-service-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.hmi-service-advanced {
  border-top: 1px solid #e2e8f0;
  padding-top: 16px;
}

.hmi-service-advanced summary {
  color: #254b87;
  font-weight: 750;
  cursor: pointer;
}

.hmi-service-advanced > .hmi-service-form-grid,
.hmi-service-advanced-body {
  margin-top: 15px;
}

.hmi-service-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.hmi-service-actions .hmi-action--primary {
  border-color: #1464df !important;
  background: #1464df !important;
  color: #fff !important;
}

.hmi-service-actions .hmi-action--danger:not(:disabled) {
  border-color: #e35b66 !important;
  background: #e35b66 !important;
  color: #fff !important;
}

.hmi-service-actions .hmi-action:disabled {
  border-color: #d8dee8 !important;
  background: #e8ecf2 !important;
  color: #8792a3 !important;
  cursor: not-allowed;
  opacity: 1;
}

.hmi-service-connection-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid #dbe5f3;
  border-radius: 10px;
  overflow: hidden;
}

.hmi-service-connection-list > div {
  display: grid;
  gap: 5px;
  padding: 13px 15px;
  border-right: 1px solid #dbe5f3;
}

.hmi-service-connection-list > div:last-child {
  border-right: 0;
}

.hmi-service-connection-list span {
  color: #64748b;
  font-size: 0.78rem;
}

.hmi-service-connection-list strong {
  overflow-wrap: anywhere;
}

.hmi-service-note {
  margin: 0;
  padding: 12px 14px;
  border-left: 3px solid #7aa2ed;
  background: #f5f8fe;
  color: #475569;
  line-height: 1.45;
}

.hmi-linkedin-workspace {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid #cddbf0;
  border-radius: 12px;
  background: #f8fbff;
}

.hmi-linkedin-workspace[hidden] {
  display: none;
}

.hmi-linkedin-workspace__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.hmi-linkedin-workspace__header h4,
.hmi-linkedin-workspace__header p {
  margin: 0;
}

.hmi-linkedin-workspace__header p {
  margin-top: 4px;
  color: #64748b;
}

.hmi-linkedin-browser {
  min-height: 520px;
  overflow: hidden;
  border: 1px solid #b9c9e2;
  border-radius: 10px;
  background: #101827;
}

.hmi-linkedin-browser > p {
  margin: 0;
  padding: 24px;
  color: #dbeafe;
}

.hmi-linkedin-browser iframe {
  display: block;
  width: 100%;
  min-height: 620px;
  border: 0;
  background: #fff;
}

@media (max-width: 800px) {
  .hmi-service-summary,
  .hmi-service-form-grid,
  .hmi-service-connection-list {
    grid-template-columns: 1fr;
  }

  .hmi-service-connection-list > div {
    border-right: 0;
    border-bottom: 1px solid #dbe5f3;
  }

  .hmi-service-connection-list > div:last-child {
    border-bottom: 0;
  }

  .hmi-linkedin-workspace__header {
    display: grid;
  }

  .hmi-linkedin-browser,
  .hmi-linkedin-browser iframe {
    min-height: 480px;
  }
}

@media (max-width: 1100px) {
  .hmi-dashboard-grid-2,
  .hmi-dashboard-stats-grid,
  .hmi-dashboard-stats-grid-3,
  .hmi-dashboard-stats-grid-5 {
    grid-template-columns: 1fr;
  }

  .hmi-master-hero {
    flex-direction: column;
  }

  .hmi-backup-head,
  .hmi-backup-row {
    grid-template-columns: 1fr;
  }
}

/* NEXUS_CRM_PHASE9A_HEADER_CLEANUP_BEGIN */
/*
 * nexus/eva/hmi/static/hmi_modular/hmi-shell.css
 * Refinements for EVA CRM Phase 9A header layout.
 */

/* Keep the CRM header visually unified and white. */
.crm-agent-shell,
.crm-agent-workspace,
.crm-shell,
.crm-shell-root,
.crm-agent-header,
.crm-agent-topbar,
.crm-agent-mainbar,
.crm-agent-toolbar,
.crm-toolbar,
.agent-workspace-header,
.agent-workspace-topbar,
.agent-workspace-toolbar {
  background: #ffffff !important;
}

/* Remove the grey block effect behind the agent image/logo. */
.crm-agent-brand,
.crm-brand,
.crm-brand-block,
.crm-agent-logo,
.crm-agent-logo-frame,
.agent-brand,
.agent-brand-image,
.agent-image-frame,
.agent-logo-frame {
  background: #ffffff !important;
}

/* Prevent the EVA CRM image from being cropped. */
.crm-agent-logo img,
.crm-brand img,
.crm-agent-brand img,
.agent-brand img,
.agent-brand-image img,
.agent-image-frame img,
.agent-logo-frame img,
img.crm-agent-image,
img.agent-image,
img.agent-logo {
  object-fit: contain !important;
  object-position: center center !important;
  background: #ffffff !important;
}

/* Give the image a little breathing room so the bottom wordmark is not clipped. */
.crm-agent-logo,
.crm-brand,
.crm-agent-brand,
.agent-brand-image,
.agent-image-frame,
.agent-logo-frame {
  overflow: visible !important;
  padding: 0 !important;
}

/* Hide redundant area title near the search bar.
   The active area is already clear from the top navigation. */
.crm-area-title,
.crm-current-area-title,
.crm-current-section-title,
.crm-toolbar-title,
.crm-toolbar-heading,
.agent-workspace-area-title,
.agent-current-area-title,
.agent-toolbar-title {
  display: none !important;
}

/* Selected top navigation: no filled pill background.
   Active state is represented by bold text and underline only. */
.crm-nav-item,
.crm-shell-nav-item,
.crm-global-nav-item,
.agent-global-nav-item,
.agent-nav-item {
  background: transparent !important;
}

.crm-nav-item.active,
.crm-nav-item.is-active,
.crm-shell-nav-item.active,
.crm-shell-nav-item.is-active,
.crm-global-nav-item.active,
.crm-global-nav-item.is-active,
.agent-global-nav-item.active,
.agent-global-nav-item.is-active,
.agent-nav-item.active,
.agent-nav-item.is-active,
button[aria-current="page"],
button[aria-selected="true"] {
  background: transparent !important;
  box-shadow: none !important;
  border-color: transparent !important;
  font-weight: 800 !important;
  color: #0f5fe8 !important;
}

/* Keep the active underline visible and elegant. */
.crm-nav-item.active::after,
.crm-nav-item.is-active::after,
.crm-shell-nav-item.active::after,
.crm-shell-nav-item.is-active::after,
.crm-global-nav-item.active::after,
.crm-global-nav-item.is-active::after,
.agent-global-nav-item.active::after,
.agent-global-nav-item.is-active::after,
.agent-nav-item.active::after,
.agent-nav-item.is-active::after,
button[aria-current="page"]::after,
button[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: -9px;
  height: 4px;
  border-radius: 999px;
  background: #1d67f2;
}

/* Make nav items able to host the underline correctly. */
.crm-nav-item,
.crm-shell-nav-item,
.crm-global-nav-item,
.agent-global-nav-item,
.agent-nav-item,
button[aria-current="page"],
button[aria-selected="true"] {
  position: relative;
}

/* Increase top navigation icons: previous size was too small. */
.crm-nav-icon,
.crm-shell-nav-icon,
.crm-global-nav-icon,
.agent-nav-icon,
.agent-global-nav-icon,
.nav-item-icon,
.crm-nav-item img,
.crm-shell-nav-item img,
.crm-global-nav-item img,
.agent-nav-item img,
.agent-global-nav-item img,
.crm-nav-item svg,
.crm-shell-nav-item svg,
.crm-global-nav-item svg,
.agent-nav-item svg,
.agent-global-nav-item svg {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;
  opacity: 1 !important;
  display: inline-flex !important;
  vertical-align: middle !important;
}

/* Slightly stronger visible icon in active item. */
.crm-nav-item.active img,
.crm-nav-item.is-active img,
.crm-shell-nav-item.active img,
.crm-shell-nav-item.is-active img,
.crm-global-nav-item.active img,
.crm-global-nav-item.is-active img,
.agent-nav-item.active img,
.agent-nav-item.is-active img,
.crm-nav-item.active svg,
.crm-nav-item.is-active svg,
.crm-shell-nav-item.active svg,
.crm-shell-nav-item.is-active svg,
.crm-global-nav-item.active svg,
.crm-global-nav-item.is-active svg,
.agent-nav-item.active svg,
.agent-nav-item.is-active svg {
  transform: scale(1.08);
  opacity: 1 !important;
}

/* Header should span full width with white background, not a grey logo block + white buttons. */
.crm-agent-header,
.crm-agent-topbar,
.agent-workspace-header {
  width: 100% !important;
  border-radius: 0 !important;
}

/* NEXUS_CRM_PHASE9A_HEADER_CLEANUP_END */

/* Governed Interaction Console live surface. */
#interaction-live-screen img,
#interaction-live-screen iframe {
  display: block;
  width: min(100%, 1366px);
  aspect-ratio: 16 / 9;
  min-height: 360px;
  border: 1px solid var(--border, #cbd5e1);
  background: #111827;
  object-fit: contain;
}

#interaction-action-result {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
