/* ABOUTME: Responsive square visual system for the MJS v3 operational interface. */

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url("/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url("/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url("/fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url("/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url("/fonts/ibm-plex-mono-latin-700-normal.woff2") format("woff2");
}

:root {
  --ink: #141414;
  --paper: #ffffff;
  --page: #ececea;
  --line: #c9c9c7;
  --hair: #e3e3e1;
  --mute: #6f6f6d;
  --c-found: #0f62fe;
  --c-applied: #198038;
  --c-escalated: #d2a106;
  --c-error: #da1e28;
  --c-gray: #8d8d8b;
  --c-closed: #525252;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 0;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

a {
  color: var(--ink);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--ink);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  z-index: 3;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 77px;
  padding: 20px;
  border-bottom: 1px solid var(--ink);
}

.brand:hover {
  background: #f4f4f2;
  text-decoration: none;
}

.mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--ink);
  color: var(--paper);
}

.brand .word {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.1;
}

.brand .stamp {
  display: block;
  margin-top: 4px;
  max-width: 172px;
  overflow: hidden;
  color: var(--mute);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  white-space: nowrap;
}

.nav {
  display: flex;
  flex-direction: column;
}

.nav a,
.nav button {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 20px;
  border: 0;
  border-bottom: 1px solid var(--hair);
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
}

.nav a:hover,
.nav button:hover {
  background: #f4f4f2;
  text-decoration: none;
}

.nav a.active {
  background: var(--ink);
  color: var(--paper);
}

.nav .badge {
  margin-left: auto;
}

.sidebar .spacer {
  flex: 1;
}

.identity {
  padding: 16px 20px;
  border-top: 1px solid var(--hair);
  display: grid;
  gap: 2px;
  min-width: 0;
}

.identity strong,
.identity span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity strong {
  font-size: 13px;
}

.identity span {
  color: var(--mute);
  font-family: var(--mono);
  font-size: 10.5px;
}

.identity .identity-label {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
}

.nav.foot {
  border-top: 1px solid var(--ink);
}

.nav.foot form {
  margin: 0;
}

.nav.foot button {
  border-bottom: 0;
}

.stage {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  height: 100vh;
}

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.topbar h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
}

.tracking {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  white-space: nowrap;
}

.tracking .k {
  color: var(--mute);
}

.tracking .sq {
  width: 8px;
  height: 8px;
  background: var(--c-applied);
}

.tracking .sq.standby {
  background: var(--c-escalated);
}

.topbar-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.context-chip {
  border: 1px solid var(--ink);
  padding: 7px 12px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.context-chip.active {
  background: var(--ink);
  color: var(--paper);
}

.topbar-user {
  max-width: 260px;
  overflow: hidden;
  color: var(--mute);
  font-family: var(--mono);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.body {
  min-height: 0;
  min-width: 0;
}

.well {
  height: 100%;
  min-width: 0;
  padding: 12px;
  overflow: auto;
  background: var(--page);
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 12px;
  align-items: start;
}

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

.dashboard-main > * + * {
  margin-top: 12px;
}

.dashboard-rail {
  min-width: 0;
  background: var(--paper);
  border: 1px solid var(--ink);
}

.page-stack {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.panel {
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.panel h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
}

.panel .desc {
  margin: 7px 0 0;
  color: var(--mute);
  font-size: 13px;
  line-height: 1.55;
}

.kicker {
  margin: 0 0 8px;
  color: var(--mute);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
}

.ticker {
  min-width: 0;
  padding: 8px 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper);
  font-family: var(--mono);
  font-size: 11px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

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

.stat {
  min-width: 0;
  padding: 14px 16px 12px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.stat .num {
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
}

.stat .num small {
  color: var(--c-applied);
  font-size: 13px;
  font-weight: 500;
}

.stat .rule {
  margin: 10px 0 8px;
  border: 0;
  border-top: 1px solid var(--line);
}

.stat .lbl {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.stat .note {
  margin-top: 3px;
  color: var(--mute);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

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

.agent {
  display: flex;
  flex-direction: column;
}

.agent-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.run {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

.run i {
  width: 7px;
  height: 7px;
  background: #42be65;
}

.run.standby i {
  background: var(--c-escalated);
}

.ledger {
  margin-top: 10px;
}

.lrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--hair);
}

.lrow:last-child {
  border-bottom: 0;
}

.lrow .lk {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
}

.lrow .lv {
  margin-left: auto;
  flex: none;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12.5px;
  text-align: right;
  white-space: nowrap;
}

.agent-foot {
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.agent-foot .last {
  margin-left: auto;
  color: var(--mute);
  font-family: var(--mono);
  font-size: 10.5px;
  text-align: right;
  text-transform: uppercase;
}

.agent-foot form {
  margin-left: auto;
}

.actionlink {
  display: inline-block;
  padding-bottom: 1px;
  border-bottom: 1px solid var(--ink);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
}

button.actionlink {
  border-top: 0;
  border-right: 0;
  border-left: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-family: inherit;
}

button.actionlink:disabled {
  cursor: default;
  opacity: 0.55;
}

.actionlink:hover {
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

button.actionlink:disabled:hover {
  background: transparent;
  color: inherit;
}

.status-ledger,
.meter-ledger {
  margin-top: 14px;
}

.srow,
.mrow {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--hair);
}

.srow:last-child,
.mrow:last-child {
  border-bottom: 0;
}

.sbar {
  width: var(--w);
  height: 12px;
  flex: none;
  min-width: 3px;
  max-width: 64%;
  background: var(--c-gray);
}

.sbar.found {
  background: var(--c-found);
}

.sbar.applied {
  background: var(--c-applied);
}

.sbar.escalated {
  background: var(--c-escalated);
}

.sbar.error {
  background: var(--c-error);
}

.sbar.not_suitable {
  background: var(--c-gray);
}

.sbar.closed {
  background: var(--c-closed);
}

.sname {
  min-width: 92px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.sv {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12.5px;
}

.mrow .mk {
  width: 132px;
  flex: none;
  overflow: hidden;
  font-size: 11.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.meter {
  position: relative;
  height: 13px;
  flex: 1;
  min-width: 50px;
  border: 1px solid var(--line);
  background: repeating-linear-gradient(
    90deg,
    transparent 0 9px,
    var(--hair) 9px 10px
  );
}

.meter i {
  position: absolute;
  inset: 1px auto 1px 1px;
  width: var(--w);
  background: #4a4a48;
}

.mrow .mv {
  width: 42px;
  flex: none;
  font-family: var(--mono);
  font-size: 12.5px;
  text-align: right;
}
