/* Brutalist UI — active when html[data-emam-theme="brutal"] (see emam-theme-switcher.js). */

html[data-emam-theme="brutal"],
html[data-emam-theme="brutal"] body {
  font-family: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  background-color: #e8ff00;
  color: #000;
  min-height: 100vh;
}

html[data-emam-theme="brutal"] {
  background-image:
    linear-gradient(#00000012 1px, transparent 1px),
    linear-gradient(90deg, #00000012 1px, transparent 1px);
  background-size: 24px 24px;
}

/* —— Theme toggle —— */
#emam-theme-toggle {
  position: fixed;
  z-index: 100000;
  right: 14px;
  bottom: 14px;
  padding: 12px 16px;
  font-weight: 900;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border: 4px solid #000;
  box-shadow: 6px 6px 0 #000;
}
html[data-emam-theme="minimal"] #emam-theme-toggle,
html:not([data-emam-theme]) #emam-theme-toggle {
  background: #fff;
  color: #000;
  border-radius: 999px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  font-weight: 600;
  letter-spacing: 0.04em;
}
html[data-emam-theme="brutal"] #emam-theme-toggle {
  background: #000;
  color: #e8ff00;
  border-radius: 0;
}
html[data-emam-theme="brutal"] #emam-theme-toggle:hover {
  background: #fff;
  color: #000;
  transform: translate(2px, 2px);
  box-shadow: 4px 4px 0 #000;
}

/* —— Sign-in (portal) —— */
html[data-emam-theme="brutal"] .portal-card {
  max-width: 440px;
  margin: 8vh auto;
  padding: 28px 26px 32px;
  background: #fff !important;
  border: 5px solid #000;
  box-shadow: 14px 14px 0 #000;
  border-radius: 0;
}
html[data-emam-theme="brutal"] .portal-logo {
  border: 4px solid #000;
  background: #000;
  padding: 8px;
  filter: invert(1);
}
html[data-emam-theme="brutal"] .portal-card h1 {
  font-weight: 900;
  text-transform: uppercase;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
}
html[data-emam-theme="brutal"] .portal-card .lead {
  font-family: ui-monospace, monospace;
  font-weight: 700;
  color: #000 !important;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}
html[data-emam-theme="brutal"] .auth-block label {
  font-weight: 900;
  letter-spacing: 0.1em;
}
html[data-emam-theme="brutal"] .auth-block input {
  border: 4px solid #000 !important;
  border-radius: 0 !important;
  background: #fff !important;
  font-family: ui-monospace, monospace;
  font-weight: 600;
}
html[data-emam-theme="brutal"] .portal-card .btn-primary {
  border: 4px solid #000 !important;
  border-radius: 0 !important;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: 6px 6px 0 #000;
}
html[data-emam-theme="brutal"] .portal-card .btn-primary:hover {
  transform: translate(2px, 2px);
  box-shadow: 4px 4px 0 #000;
}

/* —— Demo hub —— */
html[data-emam-theme="brutal"] .hub-body {
  max-width: 1100px;
}
html[data-emam-theme="brutal"] .hub-header {
  align-items: stretch;
  gap: 0;
  margin-bottom: 28px;
  padding: 0;
  border: 5px solid #000;
  background: #fff;
  box-shadow: 10px 10px 0 #000;
}
html[data-emam-theme="brutal"] .hub-brand {
  flex: 1;
  padding: 20px 22px;
  border-right: 5px solid #000;
  gap: 18px;
}
html[data-emam-theme="brutal"] .hub-logo {
  width: 64px;
  padding: 6px;
  border: 4px solid #000;
  background: #000;
  filter: invert(1);
}
html[data-emam-theme="brutal"] .hub-header h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.05;
}
html[data-emam-theme="brutal"] .hub-header .lead {
  font-family: ui-monospace, "Courier New", monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: #000;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 8px;
}
html[data-emam-theme="brutal"] .hub-actions {
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  min-width: 160px;
  padding: 16px;
  background: #ff3d00;
  gap: 12px;
}
html[data-emam-theme="brutal"] .hub-user {
  font-family: ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #000;
  background: #fff;
  border: 3px solid #000;
  padding: 8px 10px;
  text-align: center;
}
html[data-emam-theme="brutal"] .hub-actions .btn-muted {
  border: 4px solid #000 !important;
  border-radius: 0 !important;
  background: #000 !important;
  color: #fff !important;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  box-shadow: 4px 4px 0 #000;
}
html[data-emam-theme="brutal"] .hub-filter {
  gap: 0;
  margin-bottom: 20px;
  border: 4px solid #000;
  background: #fff;
  padding: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  box-shadow: 8px 8px 0 #000;
}
html[data-emam-theme="brutal"] .hub-filter button {
  flex-shrink: 0;
  border: none;
  border-right: 4px solid #000;
  border-radius: 0;
  background: #fff;
  color: #000;
  font-weight: 900;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  padding: 14px 18px;
  min-height: 48px;
}
html[data-emam-theme="brutal"] .hub-filter button:last-child {
  border-right: none;
}
html[data-emam-theme="brutal"] .hub-filter button:hover {
  background: #00e5ff;
}
html[data-emam-theme="brutal"] .hub-filter button.active {
  background: #000;
  color: #e8ff00;
}
html[data-emam-theme="brutal"] .hub-grid {
  gap: 0;
  border: 5px solid #000;
  background: #000;
  box-shadow: 12px 12px 0 #000;
}
html[data-emam-theme="brutal"] .hub-card {
  padding: 18px 16px 20px;
  background: #fff;
  border: none;
  border-right: 4px solid #000;
  border-bottom: 4px solid #000;
  border-radius: 0;
  min-height: 140px;
}
html[data-emam-theme="brutal"] .hub-card:hover {
  background: #00e5ff;
  transform: translate(-3px, -3px);
  z-index: 1;
  box-shadow: 6px 6px 0 #000;
}
html[data-emam-theme="brutal"] .hub-card-featured {
  background: #ff3d00;
}
html[data-emam-theme="brutal"] .hub-card h2 {
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
}
html[data-emam-theme="brutal"] .hub-card p {
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 600;
  color: #000;
}
html[data-emam-theme="brutal"] .hub-card .cat {
  margin-top: 14px;
  padding: 4px 8px;
  background: #000;
  color: #e8ff00;
  font-weight: 800;
  font-size: 0.62rem;
}
html[data-emam-theme="brutal"] .hub-loading {
  grid-column: 1 / -1;
  padding: 32px;
  font-weight: 900;
  text-transform: uppercase;
  text-align: center;
  background: #fff;
  border-bottom: 4px solid #000;
}

/* —— Injected HTML demos —— */
html[data-emam-theme="brutal"] .demo-nav {
  border-bottom: 4px solid #000 !important;
  background: #fff !important;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  box-shadow: 0 4px 0 #000;
}
html[data-emam-theme="brutal"] .demo-nav a {
  color: #000 !important;
  text-decoration: none !important;
}
html[data-emam-theme="brutal"] h1,
html[data-emam-theme="brutal"] h2,
html[data-emam-theme="brutal"] .panel h2 {
  font-weight: 900 !important;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
html[data-emam-theme="brutal"] .wrap,
html[data-emam-theme="brutal"] .container,
html[data-emam-theme="brutal"] .panel,
html[data-emam-theme="brutal"] .card,
html[data-emam-theme="brutal"] .latency-panel,
html[data-emam-theme="brutal"] .header {
  background: #fff !important;
  border: 4px solid #000 !important;
  border-radius: 0 !important;
  box-shadow: 8px 8px 0 #000 !important;
  margin-bottom: 16px;
}
html[data-emam-theme="brutal"] .metric,
html[data-emam-theme="brutal"] .latency-item,
html[data-emam-theme="brutal"] .status,
html[data-emam-theme="brutal"] .transcript,
html[data-emam-theme="brutal"] .audio-box,
html[data-emam-theme="brutal"] #eventLog,
html[data-emam-theme="brutal"] #lastJson,
html[data-emam-theme="brutal"] #transcript,
html[data-emam-theme="brutal"] .log,
html[data-emam-theme="brutal"] .controls {
  background: #fff !important;
  border: 3px solid #000 !important;
  border-radius: 0 !important;
  box-shadow: 4px 4px 0 #000 !important;
  color: #000 !important;
}
html[data-emam-theme="brutal"] .metric.hit,
html[data-emam-theme="brutal"] .latency-item.highlight {
  background: #00e5ff !important;
}
html[data-emam-theme="brutal"] .latency-item .v,
html[data-emam-theme="brutal"] .metric .v.hero {
  color: #000 !important;
  font-weight: 900;
}
html[data-emam-theme="brutal"] input,
html[data-emam-theme="brutal"] textarea,
html[data-emam-theme="brutal"] select {
  border: 3px solid #000 !important;
  border-radius: 0 !important;
  background: #fff !important;
  font-family: ui-monospace, monospace !important;
  font-weight: 600;
}
html[data-emam-theme="brutal"] button,
html[data-emam-theme="brutal"] .btn-muted,
html[data-emam-theme="brutal"] .btn-danger,
html[data-emam-theme="brutal"] .btn-ok {
  border: 3px solid #000 !important;
  border-radius: 0 !important;
  font-weight: 900 !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 4px 4px 0 #000 !important;
  background: #fff !important;
  color: #000 !important;
}
html[data-emam-theme="brutal"] .btn-primary,
html[data-emam-theme="brutal"] .btn-go,
html[data-emam-theme="brutal"] .btn-start,
html[data-emam-theme="brutal"] #startBtn {
  background: #000 !important;
  color: #e8ff00 !important;
}
html[data-emam-theme="brutal"] .badge {
  border: 2px solid #000 !important;
  border-radius: 0 !important;
  background: #ff3d00 !important;
  color: #000 !important;
  font-weight: 900;
}
html[data-emam-theme="brutal"] a {
  color: #000 !important;
  font-weight: 800;
}
html[data-emam-theme="brutal"] .sub,
html[data-emam-theme="brutal"] .hint,
html[data-emam-theme="brutal"] .lead {
  font-family: ui-monospace, monospace;
  color: #000 !important;
  font-weight: 600;
}
html[data-emam-theme="brutal"] .status:empty {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 0 !important;
  border: none !important;
  box-shadow: none !important;
}
html[data-emam-theme="brutal"] .status.err,
html[data-emam-theme="brutal"] .status-bad {
  background: #ff3d00 !important;
  border: 3px solid #000 !important;
  font-weight: 800;
  text-transform: uppercase;
}

@media (max-width: 720px) {
  html[data-emam-theme="brutal"] .hub-header {
    flex-direction: column;
  }
  html[data-emam-theme="brutal"] .hub-brand {
    border-right: none;
    border-bottom: 5px solid #000;
  }
  html[data-emam-theme="brutal"] .hub-actions {
    min-width: 0;
    flex-direction: row;
    flex-wrap: wrap;
  }
  html[data-emam-theme="brutal"] .hub-grid {
    grid-template-columns: 1fr;
  }
  html[data-emam-theme="brutal"] .hub-card {
    border-right: none;
  }
}
