.workbench-app {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-width: 1160px;
  background: var(--os-silver);
}

.workbench-window .desktop-window-body {
  overflow: auto;
}

.workbench-toolbar {
  display: grid;
  grid-template-columns: 190px minmax(250px, 1fr) auto;
  align-items: stretch;
  gap: 6px;
  min-height: 74px;
  padding: 6px;
  border-bottom: 2px solid #6f6d67;
  background: var(--os-silver);
  box-shadow: inset 0 1px #fff;
}

.workbench-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-right: 1px solid #777;
}

.workbench-brand .agency-mark {
  flex: none;
  border-right-width: 18px;
  border-bottom-width: 31px;
  border-left-width: 18px;
}

.workbench-brand-copy {
  display: grid;
  min-width: 0;
  line-height: 1.1;
}

.workbench-brand-copy strong {
  overflow: hidden;
  color: var(--os-burgundy);
  font: 700 21px/1 var(--os-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workbench-brand-copy small {
  margin-top: 4px;
  color: var(--os-muted);
  font: 10px/1 var(--os-mono);
}

.workbench-mission-summary {
  position: relative;
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 4px;
  padding: 6px 10px;
  border: 2px solid;
  border-color: #777 #fff #fff #777;
  background: #e8e7e2;
  text-align: left;
}

.workbench-mission-summary:hover .workbench-mission-popover,
.workbench-mission-summary:focus-within .workbench-mission-popover {
  display: block;
}

.workbench-mission-line {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: flex-start;
  gap: 10px;
}

.workbench-mission-line strong {
  overflow: hidden;
  color: var(--os-burgundy);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workbench-mission-code {
  flex: none;
  color: var(--os-blue);
  font: 700 11px/1 var(--os-mono);
}

.workbench-mission-date {
  color: var(--os-muted);
  font-size: 11px;
}

.workbench-mission-popover {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  z-index: 100;
  display: none;
  padding: 8px;
  border: 3px solid;
  border-color: #fff #333 #333 #fff;
  background: var(--os-silver);
  box-shadow: 2px 2px #000;
}

.workbench-mission-detail-grid {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  border: 1px solid #777;
  background: #fff;
}

.workbench-mission-detail-grid > span {
  min-width: 0;
  padding: 4px 6px;
  border-right: 1px solid #bbb;
  border-bottom: 1px solid #bbb;
  overflow-wrap: anywhere;
}

.workbench-mission-detail-grid > span:nth-child(odd) {
  color: var(--os-muted);
  background: #ecebe7;
  font-weight: 700;
}

.workbench-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  white-space: nowrap;
}

.agent-picker {
  position: relative;
  flex: 0 0 210px;
  width: 210px;
  min-width: 210px;
}

.agent-picker-trigger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  width: 100%;
  height: 56px;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 2px solid;
  border-color: #fff #4d4c48 #4d4c48 #fff;
  background: var(--os-silver);
  text-align: left;
}

.agent-picker-trigger:active,
.agent-picker-trigger[aria-expanded="true"] {
  border-color: #4d4c48 #fff #fff #4d4c48;
}

.agent-picker-trigger > span:first-child {
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-picker-count {
  color: var(--os-blue);
  font: 700 11px/1 var(--os-mono);
}

.agent-picker-menu {
  position: absolute;
  top: calc(100% + 2px);
  right: 0;
  z-index: 200;
  display: none;
  width: max(280px, 100%);
  max-height: 320px;
  padding: 4px;
  overflow: auto;
  border: 3px solid;
  border-color: #fff #333 #333 #fff;
  background: var(--os-silver);
  box-shadow: 2px 2px #000;
}

.agent-picker-menu.open {
  display: grid;
}

.agent-picker-option {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  min-height: 34px;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  border: 1px solid transparent;
}

.agent-picker-option:hover {
  border-color: var(--os-blue);
  color: #fff;
  background: var(--os-blue);
}

.agent-picker-option input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--os-burgundy);
}

.agent-picker-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owned-agent-mark {
  color: var(--os-red);
  font-weight: 700;
}

.agent-picker-option:hover .owned-agent-mark {
  color: #fff;
}

.dice-launch-cluster {
  display: flex;
  height: 58px;
  align-items: stretch;
  gap: 2px;
}

.extra-dice-toggle-grid {
  display: grid;
  width: 78px;
  height: 58px;
  box-sizing: border-box;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, 27px);
  gap: 0;
  border: 2px solid;
  border-color: #777 #fff #fff #777;
  background: #aaa8a2;
}

.extra-die-toggle {
  width: 100%;
  min-width: 0;
  height: 27px;
  box-sizing: border-box;
  justify-content: center;
  padding: 0;
  border: 1px solid;
  border-color: #fff #555 #555 #fff;
  background: var(--os-silver);
  font: 700 10px/1 var(--os-mono);
}

.extra-die-toggle::before {
  display: none;
  content: none;
}

.extra-die-toggle[aria-pressed="true"] {
  border-color: #555 #fff #fff #555;
  color: #fff;
  background: var(--os-burgundy);
}

.agency-dice-launch {
  display: grid;
  width: 62px;
  min-width: 62px;
  height: 58px;
  box-sizing: border-box;
  grid-template-rows: 34px auto;
  place-items: center;
  padding: 2px;
  border: 2px solid;
  border-color: #fff #555 #555 #fff;
  background: var(--os-silver);
  font-size: 11px;
  font-weight: 700;
}

.agency-dice-launch::before {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid #333;
  color: #fff;
  background: var(--os-burgundy);
  content: "3";
  font: 700 15px/1 var(--os-mono);
  clip-path: polygon(50% 4%, 96% 90%, 4% 90%);
}

.agency-dice-launch > span {
  display: block;
  max-width: 58px;
  overflow: hidden;
  font-size: 10px;
  line-height: 12px;
  text-overflow: ellipsis;
}

.toolbar-icon-button {
  display: grid;
  width: 62px;
  height: 58px;
  place-items: center;
  gap: 2px;
  padding: 3px;
  border: 2px solid;
  border-color: #fff #555 #555 #fff;
  background: var(--os-silver);
  font-size: 10px;
  font-weight: 700;
}

.toolbar-icon-button img {
  width: 25px;
  height: 25px;
  object-fit: contain;
}

.toolbar-icon-button:active {
  border-color: #555 #fff #fff #555;
  padding: 5px 1px 1px 5px;
}

.workbench-session {
  display: grid;
  width: 176px;
  min-width: 176px;
  height: 58px;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 4px 7px 4px 4px;
  border: 2px solid;
  border-color: #777 #fff #fff #777;
  background: #deddd8;
  text-align: left;
}

.workbench-session-avatar,
.gm-summary-avatar {
  display: grid;
  overflow: hidden;
  place-items: center;
  border: 2px solid;
  border-color: #777 #fff #fff #777;
  color: #fff;
  background: var(--os-blue);
  font: 700 13px/1 var(--os-mono);
}

.workbench-session-avatar {
  width: 40px;
  height: 40px;
}

.workbench-session-avatar img,
.gm-summary-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.workbench-session-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.workbench-session strong,
.workbench-session small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workbench-session small {
  color: var(--os-muted);
  font-size: 10px;
}

.workbench-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 286px;
  min-width: 0;
  min-height: 0;
  gap: 4px;
  padding: 4px;
}

.workbench-sidebar,
.dice-history-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
  border: 2px solid;
  border-color: #777 #fff #fff #777;
  background: #dfded9;
}

.workbench-sidebar {
  overflow: auto;
}

.workbench-panel-heading {
  display: flex;
  min-height: 28px;
  align-items: center;
  justify-content: space-between;
  padding: 4px 7px;
  color: #fff;
  background: var(--os-burgundy);
  font-size: 12px;
  font-weight: 700;
}

.workbench-panel-body {
  padding: 7px;
}

.agency-metric-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  border: 1px solid #777;
  background: #fff;
}

.agency-metric-list span {
  padding: 5px 6px;
  border-bottom: 1px solid #ccc;
}

.agency-metric-list span:nth-child(odd) {
  color: var(--os-muted);
  background: #ecebe7;
}

.agency-metric-list span:nth-child(even) {
  color: var(--os-burgundy);
  font: 700 13px/1.3 var(--os-mono);
  text-align: right;
}

.gm-summary {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 6px;
  border: 1px solid #777;
  background: #fff;
}

.gm-summary-avatar {
  width: 48px;
  height: 54px;
  background: var(--os-burgundy);
}

.gm-summary-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.gm-summary-copy strong,
.gm-summary-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gm-summary strong {
  color: var(--os-burgundy);
}

.gm-public-file-button {
  width: 100%;
  margin-top: 6px;
  color: #fff;
  background: var(--os-blue);
  font-size: 11px;
  text-shadow: none;
}

.gm-summary small {
  color: var(--os-muted);
}

.agency-news-list {
  display: grid;
  gap: 4px;
}

.agency-news-item {
  display: grid;
  gap: 3px;
  padding: 5px;
  border-left: 4px solid var(--os-burgundy);
  background: #fff;
  font-size: 12px;
  line-height: 1.45;
}

.agency-news-item time {
  color: var(--os-burgundy);
  font: 700 9px/1.2 var(--os-mono);
}

.workbench-agent-viewport {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  border: 2px solid;
  border-color: #777 #fff #fff #777;
  background-color: #f6f5f1;
  background-image:
    linear-gradient(rgba(18, 63, 122, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 63, 122, 0.045) 1px, transparent 1px);
  background-size: 20px 20px;
}

.agent-card-row {
  display: flex;
  width: max-content;
  min-width: 100%;
  min-height: 100%;
  align-items: flex-start;
  gap: 10px;
  padding: 8px;
}

.workbench-empty {
  display: grid;
  width: 100%;
  min-width: 360px;
  min-height: 100%;
  place-items: center;
  color: var(--os-muted);
  text-align: center;
}

.workbench-tech-idle {
  position: relative;
  overflow: hidden;
  min-width: 720px;
  grid-template-columns: 250px minmax(310px, 1fr);
  justify-content: center;
  padding: 40px;
  border: 1px solid #84a39e;
  background-color: #e4e7e1;
  background-image:
    linear-gradient(rgba(22, 79, 72, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 79, 72, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(18, 63, 122, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 63, 122, 0.06) 1px, transparent 1px);
  background-size: 18px 18px, 18px 18px, 90px 90px, 90px 90px;
  box-shadow:
    inset 0 0 0 4px #f6f5f0,
    inset 0 0 0 5px #6d817d;
  color: #183f3a;
  text-align: left;
}

.workbench-tech-idle::before {
  position: absolute;
  inset: 12px;
  pointer-events: none;
  border: 1px solid rgba(18, 63, 122, 0.22);
  content: "";
}

.workbench-tech-idle::after {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 74px;
  height: 18px;
  pointer-events: none;
  border-top: 3px solid var(--os-burgundy);
  border-right: 3px solid var(--os-burgundy);
  content: "";
}

.workbench-idle-visual {
  position: relative;
  width: 236px;
  height: 236px;
  place-self: center;
  overflow: hidden;
  border: 2px solid #244f49;
  background:
    linear-gradient(90deg, transparent 49.75%, rgba(18, 63, 122, 0.12) 49.75% 50.25%, transparent 50.25%),
    linear-gradient(transparent 49.75%, rgba(18, 63, 122, 0.12) 49.75% 50.25%, transparent 50.25%),
    repeating-linear-gradient(0deg, transparent 0 17px, rgba(22, 79, 72, 0.06) 17px 18px),
    repeating-linear-gradient(90deg, transparent 0 17px, rgba(22, 79, 72, 0.06) 17px 18px),
    #edf0eb;
  box-shadow:
    inset 0 0 0 5px #d4dbd5,
    5px 5px 0 rgba(35, 57, 54, 0.16);
}

.workbench-idle-visual::before,
.workbench-idle-visual::after {
  position: absolute;
  z-index: 4;
  width: 26px;
  height: 26px;
  border-color: var(--os-blue);
  content: "";
}

.workbench-idle-visual::before {
  top: 8px;
  left: 8px;
  border-top: 3px solid;
  border-left: 3px solid;
}

.workbench-idle-visual::after {
  right: 8px;
  bottom: 8px;
  border-right: 3px solid;
  border-bottom: 3px solid;
}

.workbench-idle-sigil {
  position: absolute;
  inset: 6px;
  z-index: 2;
  display: block;
  width: calc(100% - 12px);
  height: calc(100% - 12px);
  shape-rendering: geometricPrecision;
}

.workbench-idle-ring,
.workbench-idle-axes line,
.workbench-idle-scan {
  vector-effect: non-scaling-stroke;
}

.workbench-idle-axes {
  stroke: rgba(22, 79, 72, 0.26);
  stroke-width: 1.5;
  stroke-dasharray: 4 5;
}

.workbench-idle-ring {
  fill: rgba(237, 240, 235, 0.34);
  stroke-linejoin: miter;
}

.workbench-idle-ring.ring-outer {
  stroke: rgba(18, 63, 122, 0.82);
  stroke-width: 2;
  stroke-dasharray: 7 5;
}

.workbench-idle-ring.ring-middle {
  stroke: rgba(21, 116, 92, 0.72);
  stroke-width: 1.5;
  stroke-dasharray: 2 4;
}

.workbench-idle-ring.ring-inner {
  stroke: rgba(181, 16, 49, 0.5);
  stroke-width: 1.5;
}

.workbench-idle-node {
  fill: var(--os-blue);
  stroke: #edf0eb;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  animation: workbench-node-signal 2.4s steps(4, end) infinite;
}

.workbench-idle-node.node-two {
  animation-delay: -1.6s;
}

.workbench-idle-node.node-three {
  animation-delay: -0.8s;
}

.workbench-idle-core {
  fill: var(--os-burgundy);
  stroke: #fff;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 5px rgba(181, 16, 49, 0.42));
  animation: workbench-core-pulse 2.4s steps(4, end) infinite;
}

.workbench-idle-scan {
  fill: none;
  stroke: #d31d41;
  stroke-width: 3;
  stroke-linecap: butt;
  stroke-linejoin: miter;
  stroke-dasharray: 34 486;
  filter: drop-shadow(0 0 3px rgba(181, 16, 49, 0.45));
  animation: workbench-perimeter-scan 3.6s linear infinite;
}

.workbench-idle-copy {
  display: grid;
  align-content: center;
  gap: 8px;
  border-left: 4px solid var(--os-burgundy);
  padding-left: 20px;
}

.workbench-idle-copy strong {
  color: var(--os-burgundy);
  font: 700 24px/1.15 var(--os-mono);
}

.workbench-idle-copy p {
  margin: 0;
  color: var(--os-blue);
  font: 700 11px/1.4 var(--os-mono);
}

.workbench-idle-copy span {
  color: var(--os-muted);
  font-size: 12px;
}

@keyframes workbench-core-pulse {
  0%, 100% { opacity: 0.78; }
  50% { opacity: 1; }
}

@keyframes workbench-node-signal {
  0%, 32%, 100% { fill: var(--os-blue); opacity: 0.52; }
  33%, 65% { fill: var(--os-burgundy); opacity: 1; }
  66%, 99% { fill: #15745c; opacity: 0.72; }
}

@keyframes workbench-perimeter-scan {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -520; }
}

.agent-dossier {
  flex: 0 0 360px;
  width: 360px;
  min-width: 360px;
  border: 3px solid;
  border-color: #fff #333 #333 #fff;
  background: var(--os-silver);
  box-shadow: 2px 2px rgba(0, 0, 0, 0.22);
}

.agent-dossier-header {
  display: grid;
  min-height: 86px;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px;
  color: #fff;
  background: var(--os-burgundy);
}

.agent-profile {
  display: grid;
  overflow: hidden;
  width: 64px;
  height: 70px;
  place-items: center;
  border: 2px solid;
  border-color: rgba(255, 255, 255, 0.9) #4e0010 #4e0010 rgba(255, 255, 255, 0.9);
  color: #fff;
  background: var(--os-blue);
  font: 700 17px/1 var(--os-mono);
}

.agent-profile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.agent-dossier-identity {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 3px;
}

.agent-dossier-name {
  overflow: hidden;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-dossier-aka {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.78);
  font: 10px/1.5 var(--os-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-arc-stripe {
  display: grid;
  gap: 2px;
  margin-top: 2px;
}

.agent-arc-badge {
  display: grid;
  min-width: 0;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  color: #fff;
  font-size: 9px;
  line-height: 14px;
}

.agent-arc-badge b {
  text-align: center;
}

.agent-arc-badge span {
  overflow: hidden;
  padding: 0 4px;
  background: rgba(0, 0, 0, 0.22);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-arc-badge.arc-异常 { background: #2e4d92; }
.agent-arc-badge.arc-现实 { background: #a97800; }
.agent-arc-badge.arc-职能 { background: #c41e3a; }

.agent-mechanism-badges {
  display: grid;
  align-self: stretch;
  align-content: start;
  gap: 4px;
}

.agent-mechanism-badge {
  display: grid;
  width: 34px;
  min-height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.18);
}

.agent-mechanism-badge b {
  font-size: 7px;
  line-height: 8px;
}

.badge-flag i {
  width: 20px;
  height: 18px;
  background: #f02242;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  filter:
    drop-shadow(1px 0 0 #fff)
    drop-shadow(-1px 0 0 #fff)
    drop-shadow(0 1px 0 #fff)
    drop-shadow(0 -1px 0 #fff);
}

.badge-socks i {
  position: relative;
  width: 18px;
  height: 20px;
  background: #f4f6ff;
  clip-path: polygon(18% 0, 79% 0, 76% 55%, 96% 68%, 100% 88%, 82% 100%, 46% 96%, 23% 79%);
  filter:
    drop-shadow(1px 0 0 #fff)
    drop-shadow(-1px 0 0 #fff)
    drop-shadow(0 1px 0 #fff);
  transform: rotate(-5deg);
}

.badge-socks i::before {
  position: absolute;
  top: 1px;
  left: 3px;
  width: 10px;
  height: 5px;
  border-bottom: 2px solid #89a7e7;
  background: #365ba5;
  content: "";
}

.badge-socks i::after {
  position: absolute;
  right: 1px;
  bottom: 2px;
  width: 8px;
  height: 5px;
  background: #365ba5;
  clip-path: polygon(0 0, 100% 32%, 100% 100%, 22% 100%);
  content: "";
}

.agent-dossier-status {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid #777;
  background: #e9e8e3;
}

.agent-dossier-status > div {
  min-width: 0;
  padding: 5px 7px;
  border-right: 1px solid #aaa;
  border-bottom: 1px solid #aaa;
}

.agent-dossier-status span {
  display: block;
  color: var(--os-muted);
  font-size: 10px;
}

.agent-dossier-status strong {
  display: block;
  overflow: hidden;
  color: var(--os-burgundy);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-overload {
  color: var(--os-gold) !important;
}

.agent-dossier-tabs {
  display: flex;
  gap: 2px;
  padding: 4px 4px 0;
}

.agent-dossier-tab {
  flex: 1;
  min-height: 25px;
  padding: 2px 4px;
  border: 2px solid;
  border-color: #fff #555 #555 #fff;
  background: var(--os-silver);
  font-size: 11px;
}

.agent-dossier-tab.active {
  border-color: #555 #fff #fff #555;
  color: #fff;
  background: var(--os-blue);
}

.agent-dossier-content {
  height: 570px;
  margin: 4px;
  overflow: auto;
  border: 2px solid;
  border-color: #777 #fff #fff #777;
  background: #fff;
}

.agent-section {
  border-bottom: 1px solid #a9a8a3;
}

.agent-section-title {
  padding: 5px 7px;
  color: #fff;
  background: var(--os-burgundy-dark);
  font-size: 11px;
  font-weight: 700;
}

.agent-section-body {
  padding: 6px;
}

.agent-info-grid {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  border: 1px solid #bbb;
}

.agent-info-grid > span {
  min-width: 0;
  padding: 4px 5px;
  border-right: 1px solid #ccc;
  border-bottom: 1px solid #ccc;
  overflow-wrap: anywhere;
}

.agent-info-grid > span:nth-child(odd) {
  color: var(--os-muted);
  background: #efeee9;
}

.qa-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 11px;
}

.qa-table th,
.qa-table td {
  padding: 3px 4px;
  border: 1px solid #aaa;
  text-align: center;
}

.qa-table th {
  color: #fff;
  background: var(--os-blue);
}

.qa-table td:first-child {
  overflow: hidden;
  background: #efeee9;
  font-weight: 700;
  text-align: left;
  text-overflow: ellipsis;
}

.arc-summary {
  margin-bottom: 5px;
  border: 1px solid #aaa;
}

.arc-summary > summary {
  padding: 5px 7px;
  color: var(--os-burgundy);
  background: #ebeae5;
  font-weight: 700;
  cursor: pointer;
}

.arc-summary-copy {
  padding: 6px;
  color: #333;
  font-size: 11px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.arc-outcome-label {
  color: var(--os-burgundy);
  font-weight: 700;
}

.well-known-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-top: 1px solid #ddd;
  font-size: 10px;
}

.well-known-box {
  width: 12px;
  height: 12px;
  border: 1px solid #333;
  background: #fff;
}

.well-known-box.is-filled {
  background: var(--os-burgundy);
}

.relationship-row,
.inventory-row {
  margin-bottom: 5px;
  padding: 5px;
  border-left: 4px solid var(--os-blue);
  background: #f0efeb;
  font-size: 11px;
  line-height: 1.45;
}

.inventory-row {
  min-height: 0;
  border-left-color: var(--os-burgundy);
}

.inventory-row img {
  float: left;
  width: 56px;
  height: 56px;
  margin: 0 7px 4px 0;
  border: 1px solid #777;
  object-fit: cover;
}

.inventory-row::after {
  display: block;
  clear: both;
  content: "";
}

.arc-track {
  display: grid;
  gap: 3px;
  margin-bottom: 8px;
}

.arc-track-help {
  margin: 0 0 5px;
  color: var(--os-muted);
  font-size: 10px;
  line-height: 1.45;
}

.arc-track-head {
  display: flex;
  justify-content: space-between;
  color: var(--os-burgundy);
  font-size: 11px;
  font-weight: 700;
}

.arc-track-cells {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  row-gap: 5px;
}

.arc-track-node {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
}

.arc-track-cell {
  position: relative;
  display: grid;
  z-index: 1;
  width: 21px;
  height: 21px;
  min-width: 0;
  place-items: center;
  border: 2px solid currentColor;
  color: #666;
  background: #fff;
  font: 7px/1 var(--os-mono);
}

.arc-track-connector {
  height: 2px;
  min-width: 4px;
  flex: 1 1 auto;
  color: inherit;
  background: currentColor;
  opacity: 0.55;
}

.arc-track-职能 { color: #c41e3a; }
.arc-track-现实 { color: #a97800; }
.arc-track-异常 { color: #2e4d92; }

.arc-track-cell.filled {
  color: #fff;
}

.arc-track-职能 .arc-track-cell.filled { background: #c41e3a; }
.arc-track-现实 .arc-track-cell.filled { background: #a97800; }
.arc-track-异常 .arc-track-cell.filled { background: #2e4d92; }

.arc-track-cell.struck {
  background-image: linear-gradient(135deg, transparent 44%, #111 45% 55%, transparent 56%);
}

.reality-split-record {
  display: grid;
  gap: 6px;
  margin-bottom: 7px;
  padding: 7px;
  border: 1px solid #9f8a4b;
  background: #fff9e4;
}

.reality-split-head,
.reality-source {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.reality-split-head strong,
.reality-source span {
  color: #7b5700;
}

.cell-progress {
  display: flex;
  min-width: 0;
  align-items: center;
}

.progress-start,
.progress-terminal,
.progress-cell {
  display: grid;
  flex: 0 0 23px;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 2px solid #8d6c17;
  background: #fff;
  color: #704f00;
  font: 700 9px/1 var(--os-mono);
}

.progress-start {
  flex-basis: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8d6c17;
}

.progress-connector {
  height: 2px;
  min-width: 4px;
  flex: 1 1 auto;
  background: #8d6c17;
  opacity: 0.65;
}

.progress-cell.filled {
  color: #fff;
  background: #a97800;
}

.progress-cell.warning {
  border-color: var(--os-burgundy);
  background: var(--os-burgundy);
}

.progress-terminal.failed {
  color: #fff;
  border-color: var(--os-burgundy);
  background: var(--os-burgundy);
}

.relationship-link {
  display: grid;
  gap: 3px;
  margin: 5px 0;
}

.relationship-link-track .progress-start,
.relationship-link-track .progress-terminal {
  display: none;
}

.relationship-link-track .progress-cell {
  flex-basis: 18px;
  width: 18px;
  height: 18px;
  border-color: var(--os-blue);
  color: var(--os-blue);
  font-size: 7px;
}

.relationship-link-track .progress-cell.filled {
  color: #fff;
  background: var(--os-blue);
}

.relationship-link-track .progress-connector {
  background: var(--os-blue);
}

.questionnaire-row {
  padding: 5px;
  border-bottom: 1px solid #ccc;
}

.questionnaire-row strong {
  display: block;
  color: var(--os-burgundy);
  font-size: 10px;
}

.questionnaire-row span {
  display: block;
  margin-top: 2px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.dice-history-panel {
  overflow: hidden;
}

.dice-history-header {
  display: flex;
  flex: none;
  min-height: 30px;
  align-items: center;
  justify-content: space-between;
  padding: 3px 5px 3px 8px;
  color: #fff;
  background: var(--os-burgundy);
}

.dice-history-clear {
  display: none;
  min-height: 22px;
  padding: 1px 6px;
  border: 2px solid;
  border-color: #fff #3d3d3d #3d3d3d #fff;
  background: var(--os-silver);
  font-size: 10px;
}

.dice-history-clear.visible {
  display: block;
}

.dice-history-list {
  flex: 1 1 auto;
  min-height: 0;
  padding: 6px;
  overflow: auto;
  background: #efeee9;
}

.dice-history-empty {
  padding: 24px 8px;
  color: var(--os-muted);
  text-align: center;
}

.dice-history-entry {
  margin-bottom: 7px;
  padding: 7px;
  border: 2px solid;
  border-color: #fff #777 #777 #fff;
  background: #f8f8f6;
  box-shadow: inset 0 0 0 1px #d1d0cb;
}

.dice-history-entry.triple {
  border-left: 5px solid var(--os-red);
  background: #fff3f5;
}

.dice-history-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  color: var(--os-muted);
  font-size: 10px;
}

.dice-history-meta strong {
  min-width: 0;
  overflow: hidden;
  color: #222;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dice-history-badge {
  margin-left: 4px;
  padding: 1px 3px;
  color: #fff;
  background: var(--os-blue);
  font-size: 9px;
}

.dice-history-values,
.dice-change-values {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin: 5px 0;
}

.dice-chip {
  display: grid;
  min-width: 28px;
  height: 28px;
  place-items: center;
  border: 2px solid;
  border-color: #fff #555 #555 #fff;
  color: #fff;
  background: #68757b;
  font: 700 11px/1 var(--os-mono);
}

.dice-chip strong {
  font: inherit;
}

.dice-chip small {
  display: none;
}

.dice-chip.success {
  color: #fff;
  background: var(--os-burgundy);
}

.dice-chip.extra {
  min-width: 45px;
  grid-template-columns: auto auto;
  gap: 3px;
  padding: 0 4px;
  color: #0d2950;
  background: #cbd5da;
}

.dice-chip.extra small {
  display: inline;
  color: #38546f;
  font: 700 8px/1 var(--os-mono);
}

.dice-chip.changed {
  border-color: #69a7ee #0f4f9c #0f4f9c #69a7ee;
  box-shadow: inset 0 0 0 2px #1d6fc7;
}

.dice-history-result {
  color: var(--os-burgundy);
  font-size: 11px;
  font-weight: 700;
}

.dice-change {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px dashed #999;
}

.dice-change-values {
  margin: 0;
}

.dice-change-arrow {
  color: var(--os-blue);
  font-weight: 700;
}

.os-dialog-layer {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(0, 20, 18, 0.58);
}

.os-dialog-layer.open {
  display: grid;
}

.os-dialog {
  display: flex;
  width: min(780px, 96vw);
  max-height: min(760px, 92vh);
  flex-direction: column;
  border: 3px solid;
  border-color: #fff #222 #222 #fff;
  background: var(--os-silver);
  box-shadow: 3px 3px #000;
}

.os-dialog.large {
  width: min(980px, 96vw);
}

.os-dialog-titlebar {
  display: flex;
  flex: none;
  min-height: 29px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 4px 3px 8px;
  color: #fff;
  background: var(--os-burgundy);
  font-weight: 700;
}

.os-dialog-close {
  display: grid;
  width: 23px;
  height: 22px;
  place-items: center;
  padding: 0;
  border: 2px solid;
  border-color: #fff #333 #333 #fff;
  background: var(--os-silver);
  color: #111;
  font-weight: 700;
}

.os-dialog-content {
  min-height: 0;
  padding: 8px;
  overflow: auto;
}

.os-dialog-footer {
  display: flex;
  flex: none;
  justify-content: flex-end;
  gap: 6px;
  padding: 7px;
  border-top: 1px solid #777;
}

.mission-archive-layout {
  display: grid;
  grid-template-columns: 278px minmax(0, 1fr);
  min-height: min(690px, calc(92vh - 72px));
  border: 2px solid;
  border-color: #777 #fff #fff #777;
  background: #fff;
}

#missionArchiveLayer .os-dialog.large {
  width: min(1180px, 97vw);
}

.mission-archive-list {
  overflow: auto;
  border-right: 1px solid #777;
  padding: 5px;
  background: #d8d6d0;
}

.mission-archive-item {
  display: grid;
  width: 100%;
  min-height: 62px;
  grid-template-columns: 30px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  gap: 2px 7px;
  margin-bottom: 4px;
  padding: 7px;
  border: 2px solid;
  border-color: #fff #777 #777 #fff;
  background: #efeee9;
  text-align: left;
}

.mission-archive-item:hover,
.mission-archive-item.active {
  color: #fff;
  background: var(--os-blue);
}

.mission-archive-item:active {
  border-color: #555 #fff #fff #555;
}

.mission-archive-index {
  display: grid;
  width: 29px;
  height: 36px;
  grid-row: 1 / 3;
  place-items: center;
  color: #fff;
  background: var(--os-burgundy);
  font: 700 10px/1 var(--os-mono);
}

.mission-archive-item-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.mission-archive-item-copy strong,
.mission-archive-item-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mission-archive-status {
  justify-self: start;
  padding: 1px 5px;
  color: var(--os-burgundy);
  background: #fff;
  font-size: 9px;
  font-weight: 700;
}

.mission-archive-item small {
  opacity: 0.75;
}

.mission-report-view {
  min-width: 0;
  padding: 13px;
  overflow: auto;
  color: #171717;
  background:
    linear-gradient(rgba(18, 63, 122, 0.035) 1px, transparent 1px),
    #f8f8f5;
  background-size: 100% 24px;
}

.mission-report-view h2 {
  margin: 0;
  color: #fff;
  font: 700 24px/1.1 var(--os-mono);
}

.mission-report-hero {
  display: grid;
  min-height: 88px;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  color: #fff;
  background: linear-gradient(90deg, #4c0d1a, #97001f 62%, #650013);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.3);
}

.mission-report-mark {
  width: 52px;
  height: 46px;
  background: #ef3657;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.mission-report-heading {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.mission-report-heading > small {
  color: #ffb8c5;
  font: 9px/1 var(--os-mono);
}

.mission-report-heading > span {
  font: 11px/1 var(--os-mono);
}

.mission-report-status-block {
  display: grid;
  min-width: 120px;
  max-width: 210px;
  gap: 3px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(0, 0, 0, 0.2);
  text-align: right;
}

.mission-report-status-block b {
  font-size: 13px;
}

.mission-report-status-block small {
  overflow-wrap: anywhere;
  opacity: 0.78;
  font-size: 9px;
}

.mission-report-readouts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 8px 0;
  border: 2px solid;
  border-color: #777 #fff #fff #777;
  background: #e8e7e2;
}

.mission-readout {
  display: grid;
  min-width: 0;
  min-height: 52px;
  align-content: center;
  gap: 3px;
  padding: 6px 8px;
  border-right: 1px solid #aaa;
}

.mission-readout:last-child {
  border-right: 0;
}

.mission-readout small {
  color: var(--os-muted);
  font-size: 9px;
}

.mission-readout strong {
  overflow: hidden;
  color: #252525;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mission-readout.red strong { color: var(--os-burgundy); }
.mission-readout.blue strong { color: var(--os-blue); }
.mission-readout.gold strong { color: #795700; }

.mission-report-section {
  margin-top: 8px;
  border: 1px solid #777;
  background: rgba(255, 255, 255, 0.92);
}

.mission-report-section > header,
.mission-report-group > header {
  display: flex;
  min-height: 30px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px;
  color: #fff;
  background: var(--os-burgundy-dark);
}

.mission-report-section > header span,
.mission-report-group > header span {
  font-weight: 700;
}

.mission-report-section > header small,
.mission-report-group > header small {
  opacity: 0.72;
  font: 8px/1 var(--os-mono);
}

.mission-report-section.anomaly {
  border-left: 5px solid #2e4d92;
}

.mission-report-section.participants {
  border-left: 5px solid #14745c;
}

.mission-report-section.rewards {
  border-left: 5px solid #a97800;
}

.mission-report-section-body {
  padding: 8px;
}

.mission-analysis-copy {
  min-height: 54px;
  padding: 9px;
  border: 1px solid #c3c2bd;
  background: #fff;
  line-height: 1.65;
}

.mission-participant-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.mission-participant-list > span {
  padding: 4px 8px;
  border: 1px solid #355d55;
  color: #fff;
  background: #1b5d52;
  font-size: 11px;
  font-weight: 700;
}

.mission-participant-list > span.empty {
  color: var(--os-muted);
  border-color: #aaa;
  background: #efeee9;
  font-weight: 400;
}

.mission-participant-awards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 7px;
}

.mission-participant-awards .mission-readout {
  border: 1px solid #aaa;
  background: #f2f1ed;
}

.mission-report-grid {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  border: 1px solid #777;
}

.mission-report-grid > div {
  min-width: 0;
  padding: 6px 7px;
  border-right: 1px solid #bbb;
  border-bottom: 1px solid #bbb;
  overflow-wrap: anywhere;
}

.mission-report-grid > div:nth-child(odd) {
  color: var(--os-muted);
  background: #ecebe7;
  font-weight: 700;
}

.mission-report-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.mission-report-group {
  border: 1px solid #777;
  background: rgba(255, 255, 255, 0.94);
}

.mission-report-group.loose-ends > header {
  background: #704f00;
}

.mission-report-group.objectives > header {
  background: var(--os-blue);
}

.mission-report-entry-list {
  display: grid;
  gap: 5px;
  padding: 7px;
}

.mission-report-entry {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) auto;
  align-items: start;
  gap: 6px;
  padding: 6px;
  border: 1px solid #aaa;
  background: #f4f3ef;
}

.mission-report-entry-index {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  color: #fff;
  background: var(--os-burgundy);
  font: 700 8px/1 var(--os-mono);
}

.mission-report-entry strong {
  display: block;
  color: #222;
}

.mission-report-entry p {
  margin: 3px 0 0;
  color: var(--os-muted);
  font-size: 10px;
  line-height: 1.45;
}

.mission-report-entry > small {
  padding: 2px 5px;
  color: var(--os-blue);
  background: #e1e7ee;
  font-size: 9px;
  font-weight: 700;
}

.mission-report-empty {
  padding: 18px 8px;
  color: var(--os-muted);
  text-align: center;
}

.agency-dice-layer {
  z-index: 3200;
  background: rgba(2, 24, 22, 0.58);
  backdrop-filter: blur(12px) saturate(0.82);
  opacity: 0;
  transition: opacity 140ms ease;
}

.agency-dice-layer.open {
  opacity: 1;
}

.agency-dice-dialog {
  position: relative;
  width: min(1240px, 96vw);
  max-height: 95vh;
  transform: translateY(14px) scale(0.975);
  transition: transform 180ms ease-out;
}

.agency-dice-layer.open .agency-dice-dialog {
  transform: translateY(0) scale(1);
}

.agency-dice-dialog > .os-dialog-content {
  padding: 9px;
  background: #c9c7c1;
}

.agency-dice-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.agency-dice-intervene {
  display: none;
  min-height: 24px;
  padding: 2px 9px;
  border: 2px solid;
  border-color: #fff #333 #333 #fff;
  background: var(--os-silver);
  color: #111;
  font-size: 10px;
}

.agency-dice-intervene.visible {
  display: block;
}

.agency-dice-intervene.confirming {
  color: #fff;
  background: var(--os-blue);
}

.agency-dice-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 8.3;
  min-height: 440px;
  overflow: hidden;
  border: 2px solid;
  border-color: #4a4945 #fff #fff #4a4945;
  background: rgba(17, 50, 46, 0.7);
  box-shadow:
    inset 0 0 48px rgba(0, 0, 0, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.agency-dice-stage::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 26px 26px;
  content: "";
}

.agency-dice-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.agency-dice-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  min-height: 66px;
  padding: 8px 10px;
  border: 2px solid;
  border-color: #777 #fff #fff #777;
  background: #f8f8f5;
}

.agency-dice-values {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.agency-dice-values .dice-chip {
  position: relative;
  width: 46px;
  min-width: 46px;
  height: 42px;
  padding-top: 8px;
  border: 0;
  color: #fff;
  background: #77838a;
  clip-path: polygon(50% 2%, 98% 94%, 2% 94%);
  filter: drop-shadow(2px 3px 0 rgba(0, 0, 0, 0.42));
  font-size: 15px;
}

.agency-dice-values .dice-chip.success {
  background: var(--os-burgundy);
}

.agency-dice-values .dice-chip.extra {
  width: 64px;
  min-width: 64px;
  height: 42px;
  grid-template-columns: 1fr;
  grid-template-rows: 12px 1fr;
  gap: 0;
  padding: 4px 5px;
  border: 2px solid;
  border-color: #fff #555 #555 #fff;
  color: #102f59;
  background: #d8e0e4;
  clip-path: none;
  filter: none;
}

.agency-dice-values .dice-chip.extra small {
  display: block;
  color: #486477;
}

.agency-dice-result {
  color: var(--os-burgundy);
  font-size: 20px;
  font-weight: 700;
}

.agency-dice-roller {
  grid-column: 1 / -1;
  color: var(--os-muted);
  font: 10px/1.3 var(--os-mono);
}

.agency-dice-editors {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 6px;
  margin-top: 6px;
}

.agency-dice-editors.open {
  display: grid;
}

.agency-dice-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border: 2px solid;
  border-color: #fff #777 #777 #fff;
  background: #e8e7e2;
  font-size: 10px;
}

.agency-dice-editor.extra {
  border-left: 4px solid var(--os-blue);
}

.agency-dice-editor-label {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.agency-dice-editor-label b {
  color: var(--os-burgundy);
  font: 700 11px/1 var(--os-mono);
}

.agency-dice-editor-label small {
  overflow: hidden;
  color: var(--os-muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agency-dice-editor select {
  min-width: 0;
  width: 48px;
  height: 28px;
  padding: 1px 4px;
  border: 2px solid;
  border-color: #777 #fff #fff #777;
  color: #111;
  background: #fff;
  font: 700 12px/1 var(--os-mono);
}

.sublimation-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  pointer-events: none;
}

.sublimation-wave {
  position: absolute;
  width: 110px;
  height: 106px;
  overflow: visible;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.2);
  animation: sublimation-wave 2.1s cubic-bezier(0.12, 0.72, 0.25, 1) forwards;
}

.sublimation-wave polygon {
  fill: none;
  stroke: rgba(255, 39, 72, 0.94);
  stroke-width: 3;
  filter: drop-shadow(0 0 5px rgba(255, 30, 65, 0.95));
}

.sublimation-flare {
  position: absolute;
  width: 150px;
  height: 130px;
  background: rgba(255, 25, 62, 0.28);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.2);
  filter: blur(8px);
  animation: sublimation-flare 1.65s ease-out forwards;
}

.sublimation-particle {
  position: absolute;
  width: 0;
  height: 0;
  border-right: 4px solid transparent;
  border-bottom: 8px solid rgba(255, 48, 78, 0.9);
  border-left: 4px solid transparent;
  opacity: 0;
  animation: sublimation-rise var(--duration, 1.7s) ease-out var(--delay, 0s) forwards;
}

@keyframes sublimation-wave {
  12% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(5.8);
  }
}

@keyframes sublimation-flare {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.15); }
  18% { opacity: 0.75; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(3.6); }
}

@keyframes sublimation-rise {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4) rotate(0deg);
  }
  15% {
    opacity: 0.95;
  }
  70% {
    opacity: 0.72;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--drift-x)), calc(-50% - var(--rise))) scale(1.7) rotate(var(--spin));
  }
}

.mail-window-body {
  background: #deddd8;
}

.mail-app {
  display: grid;
  grid-template-columns: minmax(230px, 30%) minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 6px;
  gap: 6px;
}

.mail-sidebar,
.mail-detail {
  min-width: 0;
  min-height: 0;
  border: 2px solid;
  border-color: #777 #fff #fff #777;
  background: #fff;
}

.mail-sidebar {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.mail-toolbar {
  padding: 6px;
  border-bottom: 1px solid #777;
  background: #e6e5e0;
}

.mail-toolbar input {
  width: 100%;
  height: 28px;
  border: 2px solid;
  border-color: #777 #fff #fff #777;
  background: #fff;
}

.mail-list {
  overflow: auto;
}

.mail-list-item {
  display: grid;
  width: 100%;
  gap: 2px;
  padding: 8px;
  border: 0;
  border-bottom: 1px solid #aaa;
  background: #fff;
  text-align: left;
}

.mail-list-item:hover,
.mail-list-item.active {
  color: #fff;
  background: var(--os-blue);
}

.mail-list-item.unread strong::after {
  margin-left: 5px;
  padding: 1px 4px;
  color: #fff;
  background: var(--os-red);
  content: "NEW";
  font-size: 8px;
}

.mail-list-item span,
.mail-list-item time {
  overflow: hidden;
  color: var(--os-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-list-item:hover span,
.mail-list-item:hover time,
.mail-list-item.active span,
.mail-list-item.active time {
  color: rgba(255, 255, 255, 0.8);
}

.mail-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px;
  border-top: 1px solid #777;
  background: var(--os-silver);
}

.mail-detail {
  overflow: auto;
}

.mail-detail-empty {
  display: grid;
  min-height: 100%;
  place-items: center;
  color: var(--os-muted);
}

.mail-message-header {
  padding: 12px;
  border-bottom: 2px solid var(--os-burgundy);
  background: #efeee9;
}

.mail-message-header h2 {
  margin: 0 0 5px;
  color: var(--os-burgundy);
  font-size: 20px;
}

.mail-message-header p {
  margin: 0;
  color: var(--os-muted);
  font-size: 11px;
}

.mail-message-content {
  padding: 16px;
  line-height: 1.7;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.utility-app {
  width: 100%;
  height: 100%;
  padding: 8px;
  overflow: auto;
  background: #deddd8;
}

.utility-heading {
  margin: 0 0 8px;
  padding: 7px;
  color: #fff;
  background: var(--os-burgundy);
  font-size: 15px;
}

.utility-agent-row,
.utility-metric-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) repeat(3, auto);
  align-items: center;
  gap: 5px;
  margin-bottom: 5px;
  padding: 7px;
  border: 2px solid;
  border-color: #fff #777 #777 #fff;
  background: #efeee9;
}

.utility-stepper {
  display: flex;
  align-items: center;
  gap: 2px;
}

.utility-stepper button {
  width: 26px;
  height: 26px;
  padding: 0;
}

.utility-stepper output {
  min-width: 32px;
  text-align: center;
  font-weight: 700;
}

.utility-app {
  padding: 10px;
  background:
    linear-gradient(rgba(17, 65, 60, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 65, 60, 0.045) 1px, transparent 1px),
    #d6d3cb;
  background-size: 16px 16px;
}

.utility-app-header {
  min-height: 58px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
  padding: 8px 10px;
  border: 2px solid;
  border-color: #fff #777 #777 #fff;
  background: #e9e7e1;
  box-shadow: inset 0 5px 0 var(--os-burgundy);
}

.utility-app-header > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.utility-app-header small {
  color: var(--os-muted);
  font: 9px Consolas, monospace;
}

.utility-app-header strong {
  color: #600d20;
  font-size: 17px;
}

.utility-app-header > output {
  padding: 4px 7px;
  border: 1px solid #777;
  background: #f7f6f1;
  color: #20483f;
  font: 700 10px Consolas, monospace;
}

.utility-agent-list {
  display: grid;
  gap: 7px;
}

.utility-agent-card {
  display: grid;
  grid-template-columns: minmax(210px, 0.8fr) minmax(390px, 1.4fr);
  gap: 8px;
  padding: 8px;
  border: 2px solid;
  border-color: #fff #777 #777 #fff;
  background: #eeece6;
}

.utility-agent-identity {
  min-width: 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding-right: 8px;
  border-right: 1px solid #aaa69e;
}

.utility-agent-avatar {
  width: 48px;
  height: 48px;
  display: grid;
  overflow: hidden;
  border: 1px solid #5d5b56;
  background: #17413d;
  color: #fff;
  font: 700 13px Consolas, monospace;
  place-items: center;
}

.utility-agent-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.utility-agent-identity > span:last-child {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.utility-agent-identity strong,
.utility-agent-identity small,
.utility-agent-identity em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.utility-agent-identity small {
  color: #214e79;
  font: 700 9px Consolas, monospace;
}

.utility-agent-identity strong {
  color: #4f1020;
  font-size: 14px;
}

.utility-agent-identity em {
  color: var(--os-muted);
  font-size: 10px;
  font-style: normal;
}

.utility-agent-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(105px, 1fr));
  gap: 5px;
}

.utility-stepper {
  min-width: 0;
  min-height: 56px;
  display: grid;
  grid-template-columns: minmax(48px, 1fr) auto;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border: 1px solid #aaa69e;
  background: #dedbd4;
}

.utility-stepper > span:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.utility-stepper small {
  color: var(--os-muted);
  font-size: 9px;
}

.utility-stepper output {
  min-width: 0;
  color: #1a1a1a;
  font: 700 18px Consolas, monospace;
  text-align: left;
}

.utility-stepper.commendation {
  border-top: 3px solid #1f5589;
}

.utility-stepper.reprimand {
  border-top: 3px solid #a10d2b;
}

.utility-stepper.overload {
  border-top: 3px solid #a7780b;
}

.utility-stepper-controls {
  display: flex;
  gap: 3px;
}

.utility-stepper button,
.utility-stepper-controls .os-button {
  width: 28px;
  height: 28px;
  padding: 0;
  font-weight: 700;
}

.utility-empty {
  padding: 24px;
  border: 1px dashed #777;
  background: #eceae4;
  color: var(--os-muted);
  text-align: center;
}

.chaos-mission-card {
  display: grid;
  grid-template-columns: 72px minmax(180px, 1fr) minmax(110px, 0.6fr) minmax(110px, 0.6fr);
  align-items: stretch;
  gap: 0;
  margin-bottom: 9px;
  border: 2px solid;
  border-color: #fff #777 #777 #fff;
  background: #eceae4;
}

.chaos-mission-card > * {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 9px;
  border-right: 1px solid #aaa69e;
}

.chaos-mission-card > *:last-child {
  border-right: 0;
}

.chaos-mission-index {
  background: #681127;
  color: #fff;
  font: 700 10px Consolas, monospace;
  place-items: center;
}

.chaos-mission-card small {
  color: var(--os-muted);
  font-size: 9px;
}

.chaos-mission-card strong {
  color: #4f1020;
}

.chaos-metric-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 8px;
}

.chaos-metric {
  padding: 9px;
  border: 2px solid;
  border-color: #fff #777 #777 #fff;
  background: #eceae4;
}

.chaos-metric > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chaos-metric > header span {
  color: #4f1020;
  font-weight: 700;
}

.chaos-metric > header output {
  color: #141414;
  font: 700 26px Consolas, monospace;
}

.chaos-meter {
  display: grid;
  grid-template-columns: repeat(12, minmax(4px, 1fr));
  gap: 2px;
  margin: 8px 0;
}

.chaos-meter i {
  height: 13px;
  border: 1px solid #777;
  background: #f6f5f0;
}

.chaos-metric.chaos .chaos-meter i.filled {
  background: #9d0d2a;
}

.chaos-metric.loose .chaos-meter i.filled {
  background: #9f7618;
}

.chaos-metric.reality .chaos-meter i.filled {
  background: #28588b;
}

.chaos-metric > .utility-stepper-controls {
  justify-content: flex-end;
}

@media (max-width: 780px) {
  .utility-agent-card {
    grid-template-columns: minmax(180px, 1fr);
  }

  .utility-agent-identity {
    padding: 0 0 7px;
    border-right: 0;
    border-bottom: 1px solid #aaa69e;
  }

  .chaos-mission-card {
    grid-template-columns: 64px minmax(180px, 1fr);
  }

  .chaos-mission-card > div:nth-of-type(n + 2) {
    border-top: 1px solid #aaa69e;
  }

  .chaos-metric-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1120px) {
  .workbench-toolbar { grid-template-columns: 190px minmax(250px, 1fr) auto; }
}

@media (max-width: 900px) {
  .workbench-app { min-width: 1160px; }
}

@media (prefers-reduced-motion: reduce) {
  .agency-dice-layer {
    transition: none;
  }

  .workbench-idle-node,
  .workbench-idle-core,
  .workbench-idle-scan {
    animation: none;
  }

  .sublimation-wave,
  .sublimation-particle {
    animation-duration: 1ms !important;
  }
}

#gmLoreLayer .os-dialog {
  width: min(820px, 94vw);
  max-height: 88vh;
}

.gm-lore-content {
  max-height: calc(88vh - 38px);
  padding: 14px;
  overflow: auto;
  color: #20201f;
  background:
    linear-gradient(rgba(83, 23, 35, 0.035) 1px, transparent 1px),
    #f5f3ed;
  background-size: 100% 24px;
  line-height: 1.65;
  white-space: normal;
}

.ta-report-header {
  margin-bottom: 14px;
  padding: 12px;
  border: 2px solid;
  border-color: #fff #777 #777 #fff;
  background: #d9d6cf;
}

.ta-report-logo {
  padding-bottom: 7px;
  border-bottom: 5px solid var(--os-burgundy);
  color: var(--os-burgundy);
  font: 900 17px/1.2 var(--os-mono);
}

.ta-report-doc-type {
  margin-top: 8px;
  color: #151515;
  font-size: 16px;
  font-weight: 900;
}

.ta-report-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
  color: #4e4b47;
  font: 10px/1.45 var(--os-mono);
}

.ta-report-meta span {
  padding: 4px 6px;
  border: 1px solid #aaa69e;
  background: #eceae4;
}

.ta-report-section {
  margin: 0 0 10px;
  border: 1px solid #8e8b84;
  background: rgba(255, 255, 255, 0.78);
}

.ta-report-section-title {
  padding: 5px 8px;
  color: #fff;
  background: #4a292f;
  font: 800 11px/1.2 var(--os-mono);
}

.ta-report-body {
  padding: 8px 10px;
}

.ta-report-body p {
  margin: 0 0 7px;
}

.ta-report-body p:last-child {
  margin-bottom: 0;
}

.ta-report-body .bullet {
  position: relative;
  padding-left: 17px;
}

.ta-report-body .bullet::before {
  width: 8px;
  height: 7px;
  position: absolute;
  top: 7px;
  left: 1px;
  background: var(--os-burgundy);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  content: "";
}

.ta-report-note {
  padding: 6px 8px;
  border-left: 4px solid #a9811e;
  background: #eee4c6;
  color: #4b3a0d;
}

.ta-report-divider {
  height: 2px;
  margin: 10px 0;
  background: repeating-linear-gradient(90deg, #781027 0 20px, transparent 20px 27px);
}

.redacted {
  padding: 0 3px;
  color: #111;
  background: #111;
  letter-spacing: 1px;
  user-select: none;
}

@media (max-width: 620px) {
  .ta-report-meta {
    grid-template-columns: minmax(0, 1fr);
  }
}
