:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef3f5;
  --ink: #172026;
  --muted: #64717b;
  --line: #d8e0e5;
  --brand: #0f6b78;
  --brand-dark: #0a4d57;
  --green: #177245;
  --amber: #9a6a00;
  --red: #b2362f;
  --blue: #2d5a9e;
  --shadow: 0 16px 40px rgba(18, 30, 38, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(14, 72, 82, 0.04), transparent 32%),
    var(--bg);
}

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

button,
select,
input,
textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  text-align: center;
}

button:hover {
  background: #26343d;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(15, 107, 120, 0.24);
  outline-offset: 1px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.1;
}

h2 {
  font-size: 16px;
}

h3 {
  font-size: 18px;
  line-height: 1.3;
}

h4 {
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--brand-dark);
  text-transform: uppercase;
}

[hidden] {
  display: none !important;
}

body:not(.is-authenticated) > .topbar,
body:not(.is-authenticated) > .module-nav,
body:not(.is-authenticated) > .layout {
  display: none;
}

body.is-authenticated .welcome-screen {
  display: none;
}

body.is-authenticated .register-screen {
  display: none;
}

.welcome-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: 22px;
  padding: clamp(18px, 3vw, 34px);
  background:
    linear-gradient(90deg, rgba(5, 25, 31, 0.94), rgba(6, 37, 45, 0.82)),
    #06151b;
  color: #e9fbff;
}

.welcome-hero,
.auth-panel {
  min-width: 0;
}

.welcome-hero {
  display: grid;
  grid-template-columns: minmax(280px, 1fr);
  gap: 18px;
  align-items: stretch;
}

.welcome-copy,
.auth-card {
  border: 1px solid rgba(141, 235, 247, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
}

.welcome-copy {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: clamp(22px, 3vw, 34px);
}

.welcome-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.welcome-copy h1 {
  max-width: 780px;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 0.98;
}

.welcome-copy > p:not(.eyebrow) {
  max-width: 760px;
  color: #b8d7df;
  font-size: 16px;
}

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

.welcome-signals article {
  min-height: 84px;
  padding: 12px;
  border: 1px solid rgba(141, 235, 247, 0.18);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.welcome-signals strong {
  display: block;
  color: #fff;
}

.welcome-signals span {
  display: block;
  margin-top: 5px;
  color: #9ec1cb;
  font-size: 12px;
}

.live-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(121, 217, 139, 0.42);
  border-radius: 999px;
  background: rgba(121, 217, 139, 0.1);
  color: #bdf7cb;
  font-size: 12px;
  font-weight: 800;
}

.auth-panel {
  display: grid;
  align-content: center;
  gap: 14px;
}

.auth-card {
  display: grid;
  background: #fff;
  color: var(--ink);
}

.auth-card .dialog-head {
  border-radius: 8px 8px 0 0;
}

.auth-actions.single {
  grid-template-columns: 1fr;
}

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

.register-fields label:nth-child(1),
.register-fields label:nth-child(2),
.register-fields label:nth-child(3),
.register-fields label:nth-child(4),
.register-fields .auth-message {
  grid-column: 1 / -1;
}

.auth-switch {
  padding: 0 18px 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.auth-switch a {
  color: var(--brand);
  text-decoration: none;
}

.auth-switch a:hover {
  color: var(--brand-dark);
  text-decoration: underline;
}

.notification-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.notification {
  padding: 12px;
  border: 1px solid rgba(15, 107, 120, 0.24);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 46px rgba(18, 30, 38, 0.18);
  color: var(--ink);
}

.notification.warn {
  border-left-color: var(--amber);
}

.notification.high {
  border-left-color: var(--red);
}

.notification strong,
.notification span {
  display: block;
}

.notification span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 82px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.82), 0 10px 24px rgba(18, 30, 38, 0.04);
}

.eyebrow {
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.subtitle {
  margin-top: 4px;
  color: var(--muted);
}

.top-actions,
.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.user-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 4px 4px 4px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.user-panel div {
  display: grid;
  min-width: 110px;
}

.user-panel span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.user-panel small {
  color: var(--muted);
  font-size: 11px;
}

.user-panel button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.user-panel button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  flex: 0 0 auto;
}

.top-actions button,
.report-actions button {
  background: var(--brand);
}

.module-nav {
  position: sticky;
  top: 82px;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 9px 24px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: #edf3f5;
}

.module-button {
  justify-content: center;
  flex: 0 0 auto;
  min-height: 36px;
  border-color: #b9c8ce;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.module-button:hover,
.module-button.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  min-height: calc(100vh - 129px);
}

.sidebar {
  position: sticky;
  top: 129px;
  align-self: start;
  display: grid;
  gap: 14px;
  height: calc(100vh - 129px);
  padding: 18px;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: #fbfcfd;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.8);
}

.panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(18, 30, 38, 0.035);
}

.score-ring {
  display: grid;
  place-items: center;
  width: 150px;
  height: 150px;
  margin: 0 auto;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 58%, transparent 59%),
    conic-gradient(var(--brand) var(--score, 0%), #dce5ea 0);
}

.score-ring span {
  font-size: 30px;
  font-weight: 800;
}

.score-ring small {
  margin-top: -28px;
  color: var(--muted);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0;
}

.stats div {
  padding: 10px;
  border-radius: 6px;
  background: var(--surface-2);
  text-align: center;
}

.stats dt {
  color: var(--muted);
  font-size: 12px;
}

.stats dd {
  margin: 3px 0 0;
  font-size: 20px;
  font-weight: 800;
}

.block-nav button {
  width: 100%;
  justify-content: flex-start;
  min-height: 34px;
  margin-bottom: 6px;
  padding: 7px 10px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.block-nav button.active,
.block-nav button:hover {
  border-color: var(--brand);
  background: #e8f3f5;
}

.workspace {
  padding: 18px 22px 40px;
  overflow: hidden;
}

.workspace-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.workspace-title h2 {
  margin-top: 2px;
  font-size: 18px;
}

.toolbar {
  position: static;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px auto;
  gap: 12px;
  align-items: end;
  margin: 0 0 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfc;
}

.executive-dashboard {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

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

.dashboard-strip article,
.dashboard-panels article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(18, 30, 38, 0.035);
}

.dashboard-strip span,
.dashboard-strip small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-strip strong {
  display: block;
  margin: 4px 0;
  color: var(--brand-dark);
  font-size: 24px;
}

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

.dashboard-panels article {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 168px;
}

.dashboard-panels h3 {
  margin-top: 2px;
  font-size: 15px;
}

.dashboard-panels ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dashboard-panels li {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fbfc;
}

.dashboard-panels strong,
.dashboard-panels span {
  display: block;
}

.dashboard-panels strong {
  color: var(--ink);
  font-size: 13px;
}

.dashboard-panels span,
.dashboard-panels p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.questions {
  display: grid;
  gap: 14px;
}

.question-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--muted);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(18, 30, 38, 0.06);
}

.question-card[data-status="conforme"] {
  border-left-color: var(--green);
}

.question-card[data-status="parcial"] {
  border-left-color: var(--amber);
}

.question-card[data-status="no_conforme"] {
  border-left-color: var(--red);
}

.question-card[data-status="no_aplica"] {
  border-left-color: var(--blue);
}

.question-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 14px;
  align-items: start;
}

.question-meta {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

details {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
}

summary {
  cursor: pointer;
  font-weight: 800;
}

.criteria-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.criteria-grid p {
  color: #2d3941;
}

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

.ai-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid #c9dde2;
  border-radius: 6px;
  background: #eef8fa;
}

.ai-text {
  margin-top: 3px;
  color: #33434b;
}

.assess-btn {
  background: var(--brand-dark);
}

.report-dialog {
  width: min(1100px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.24);
}

.report-dialog::backdrop {
  background: rgba(13, 22, 28, 0.48);
}

.auth-card {
  display: grid;
  background: #fff;
}

.auth-fields {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.auth-message {
  min-height: 20px;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 700;
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 18px 18px;
}

.auth-actions button,
.report-actions button,
.console-actions button,
.terminal-shortcuts button {
  justify-content: center;
}

.dialog-head,
.report-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.dialog-head button {
  background: #4d5962;
}

.report-output {
  padding: 24px;
  background: #fff;
}

.technical-console {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: #f8fafb;
}

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

.console-head h3 {
  font-size: 16px;
}

.console-actions,
.terminal-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.network-map-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #143946;
  border-radius: 8px;
  background: linear-gradient(180deg, #0b1821, #08131a);
  color: #d7eef3;
}

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

.map-head h3 {
  color: #fff;
}

.network-stats {
  display: flex;
  gap: 8px;
  margin: 0;
}

.network-stats div {
  min-width: 72px;
  padding: 7px 10px;
  border: 1px solid rgba(34, 211, 238, 0.26);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  text-align: center;
}

.network-stats dt {
  color: #85a4b0;
  font-size: 11px;
}

.network-stats dd {
  margin: 1px 0 0;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

.map-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 12px;
  align-items: stretch;
}

#networkMapCanvas {
  width: 100%;
  min-height: 260px;
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 8px;
  background: #07141c;
  box-shadow: inset 0 0 0 1px rgba(119, 230, 243, 0.08), 0 0 24px rgba(34, 211, 238, 0.08);
}

.network-event-feed {
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.network-event {
  padding: 10px;
  border: 1px solid rgba(34, 211, 238, 0.18);
  border-left: 4px solid #22d3ee;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
}

.network-event.medium {
  border-left-color: #ffb020;
}

.network-event.high {
  border-left-color: #ff4d5f;
}

.network-event strong,
.network-event span,
.network-event p {
  display: block;
}

.network-event strong {
  color: #fff;
  font-size: 12px;
}

.network-event span {
  color: #85a4b0;
  font-size: 11px;
}

.network-event p {
  margin-top: 4px;
  font-size: 12px;
}

.tool-switcher {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.tool-switcher button {
  min-height: 44px;
  border-color: #b9c8ce;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.tool-switcher button.active,
.tool-switcher button:hover {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.tool-runner {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(170px, 0.6fr) 170px 150px;
  gap: 10px;
  align-items: end;
}

.tool-params {
  grid-column: 1 / -2;
}

.tool-params textarea {
  min-height: 74px;
  font-family: Consolas, "Courier New", monospace;
}

.authorization-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

.authorization-check input {
  width: auto;
  min-height: auto;
}

.tool-output {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr) minmax(260px, 1fr);
  gap: 12px;
}

.tool-app-workspace {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #c9dde2;
  border-radius: 8px;
  background: #ffffff;
}

.tool-app-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.tool-app-head h3 {
  margin-top: 2px;
  font-size: 18px;
}

.tool-app-head p:not(.eyebrow) {
  max-width: 760px;
  color: var(--muted);
}

.engine-status {
  min-width: 210px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfc;
}

.engine-status strong,
.engine-status span {
  display: block;
}

.engine-status strong {
  color: var(--ink);
  font-size: 13px;
}

.engine-status span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.engine-status.ready {
  border-color: rgba(23, 114, 69, 0.24);
  background: #effaf4;
}

.engine-status.local {
  border-color: rgba(154, 106, 0, 0.28);
  background: #fff9ea;
}

.tool-app-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-app-actions button {
  min-height: 34px;
  padding: 0 11px;
  background: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.tool-app-actions button.secondary {
  border-color: #b9c8ce;
  background: #fff;
  color: var(--ink);
}

.tool-app-actions button.secondary:hover {
  border-color: var(--brand);
  background: #e8f3f5;
}

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

.tool-app-metrics article {
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfc;
}

.tool-app-metrics span,
.tool-app-metrics small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.tool-app-metrics strong {
  display: block;
  margin: 4px 0;
  color: var(--brand-dark);
  font-size: 24px;
}

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

.tool-app-panel {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.tool-app-panel.wide {
  grid-column: 1 / -1;
}

.tool-app-panel h4 {
  margin: 0 0 10px;
}

.tool-app-panel p,
.tool-app-panel li,
.tool-app-panel td,
.tool-app-panel th {
  font-size: 13px;
}

.tool-app-panel ol,
.tool-app-panel ul {
  margin: 0;
  padding-left: 20px;
}

.tool-app-panel table {
  width: 100%;
  border-collapse: collapse;
}

.tool-app-panel th,
.tool-app-panel td {
  padding: 8px;
  border: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

.tool-app-panel th {
  background: #edf3f5;
}

.tool-meta.compact {
  gap: 7px;
}

.tool-meta.compact div {
  grid-template-columns: 92px minmax(0, 1fr);
}

.tool-meta.compact dd {
  overflow-wrap: anywhere;
}

.empty-tool-state {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfcfd;
}

.port-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 8px;
}

.port-grid span {
  display: grid;
  min-height: 52px;
  place-items: center;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5f7f8;
  color: var(--muted);
  font-weight: 800;
}

.port-grid span.open {
  border-color: rgba(23, 114, 69, 0.34);
  background: #eefaf3;
  color: var(--green);
}

.port-grid small {
  display: block;
  color: inherit;
  font-size: 11px;
  font-weight: 700;
}

.finding-chips,
.severity-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.finding-chips span,
.severity-grid span {
  display: inline-grid;
  min-height: 30px;
  align-items: center;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f5f7f8;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
}

.finding-chips span.warn,
.severity-grid .medium {
  border-color: rgba(154, 106, 0, 0.28);
  background: #fff8e8;
  color: var(--amber);
}

.severity-grid .high {
  border-color: rgba(178, 54, 47, 0.28);
  background: #fff0ef;
  color: var(--red);
}

.severity-grid .info {
  border-color: rgba(45, 90, 158, 0.24);
  background: #eef5ff;
  color: var(--blue);
}

.severity-grid strong,
.severity-grid small {
  display: block;
  text-align: center;
}

.event-timeline {
  display: grid;
  gap: 8px;
}

.event-timeline article {
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: #fbfcfd;
}

.event-timeline article.medium {
  border-left-color: var(--amber);
}

.event-timeline article.high {
  border-left-color: var(--red);
}

.event-timeline strong,
.event-timeline span,
.event-timeline p {
  display: block;
}

.event-timeline span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.event-timeline p {
  margin-top: 5px;
}

.tool-output section,
.tool-run {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.tool-output h4 {
  margin: 0 0 8px;
}

.tool-output ol,
.tool-output ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.tool-meta {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
}

.tool-meta div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px;
}

.tool-meta dt {
  color: var(--muted);
  font-weight: 800;
}

.tool-meta dd {
  margin: 0;
}

.tool-run + .tool-run {
  margin-top: 8px;
}

.console-actions button,
.terminal-shortcuts button {
  min-height: 32px;
  padding: 0 10px;
  background: #42515b;
  font-size: 12px;
}

.terminal-output {
  height: 260px;
  overflow: auto;
  padding: 12px;
  border: 1px solid #22313a;
  border-radius: 8px;
  background: #101820;
  color: #d7efe6;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
}

.terminal-line {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.terminal-line pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.terminal-time {
  color: #85a4b0;
  font-size: 11px;
}

.terminal-prompt {
  color: #66d9c3;
  font-weight: 800;
}

.terminal-line.warn .terminal-prompt {
  color: #ffd166;
}

.terminal-line.ok .terminal-prompt {
  color: #79d98b;
}

.terminal-form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.terminal-form span {
  color: var(--brand-dark);
  font-family: Consolas, "Courier New", monospace;
  font-weight: 800;
}

.report-output h3 {
  margin-top: 22px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.report-output table {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
}

.report-output th,
.report-output td {
  padding: 9px;
  border: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

.report-output th {
  background: #edf3f5;
}

.empty-state {
  padding: 40px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  text-align: center;
}

@media (max-width: 920px) {
  .welcome-screen,
  .welcome-hero,
  .welcome-signals {
    grid-template-columns: 1fr;
  }

  .welcome-screen {
    padding: 14px;
  }

  .welcome-copy h1 {
    font-size: 34px;
  }

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

  .brand-lockup {
    align-items: flex-start;
  }

  .brand-logo {
    width: 52px;
    height: 52px;
  }

  .module-nav {
    justify-content: flex-start;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .toolbar {
    position: static;
    grid-template-columns: 1fr;
  }

  .dashboard-strip,
  .dashboard-panels {
    grid-template-columns: 1fr;
  }

  .tool-switcher,
  .tool-runner,
  .tool-output,
  .tool-app-grid,
  .tool-app-metrics,
  .map-grid,
  .register-fields,
  .question-head,
  .response-grid,
  .criteria-grid {
    grid-template-columns: 1fr;
  }

  .tool-app-head {
    flex-direction: column;
  }

  .engine-status {
    width: 100%;
  }

  .tool-params {
    grid-column: auto;
  }
}

@media print {
  .welcome-screen,
  .notification-stack,
  body > .topbar,
  body > .layout,
  .dialog-head,
  .report-actions {
    display: none;
  }

  .report-dialog {
    display: block;
    position: static;
    width: auto;
    max-height: none;
    border: 0;
    box-shadow: none;
  }
}
