/* Final AgencyOS desktop polish layer. Keep shared shell/modal fixes here. */
:root {
  --agency-surface: #d4d0c8;
  --agency-surface-alt: #c7c3bb;
  --agency-content: #f7f7f7;
  --agency-title: #8d001b;
  --agency-title-bright: #c71738;
  --agency-blue: #001f75;
  --agency-red: #b51031;
  --agency-text: #111;
  --agency-muted: #4d5358;
}

/* Every institutional mark is the same upright equilateral triangle. */
.banner-triangle {
  width: 20px !important;
  height: 17.32px !important;
  border: 0 !important;
  background: var(--agency-red) !important;
  clip-path: polygon(50% 0, 0 100%, 100% 100%);
  filter: none !important;
  transform: none !important;
}

.welcome-triangle-wrap {
  animation: none !important;
}

.welcome-triangle-svg .triangle {
  fill: var(--agency-red) !important;
}

/* Shared classic dialog chrome. */
.modal-overlay {
  background: rgba(3, 12, 12, 0.68);
  backdrop-filter: none;
}

.modal:not(.agency-dice-modal) {
  overflow: hidden;
  border: 2px solid #c0c0c0;
  border-color: #fff #454545 #454545 #fff;
  border-radius: 1px;
  background: var(--agency-surface);
  color: var(--agency-text);
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.46);
  max-height: calc(100vh - 64px);
}

.modal:not(.agency-dice-modal) .modal-header,
.email-reminder-modal .email-reminder-header,
.email-content-modal .email-content-header {
  min-height: 34px;
  padding: 4px 5px 4px 9px;
  border: 0;
  border-bottom: 1px solid #650013;
  background: linear-gradient(90deg, var(--agency-title), var(--agency-title-bright) 78%, #760016);
  color: #fff;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.35);
}

.modal:not(.agency-dice-modal) .modal-title,
.email-reminder-modal .email-reminder-title,
.email-content-modal .email-content-title {
  margin: 0;
  color: #fff !important;
  font: 800 0.86rem "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  text-shadow: 1px 1px 0 #520010 !important;
}

.modal .modal-close,
.email-reminder-modal .modal-close,
.email-content-modal .modal-close {
  width: 23px;
  min-width: 23px;
  height: 22px;
  display: grid;
  padding: 0;
  border: 2px solid #c0c0c0;
  border-color: #fff #4e4e4e #4e4e4e #fff;
  border-radius: 0;
  background: var(--agency-surface);
  color: #111 !important;
  font: 900 0.86rem/1 Arial, sans-serif;
  text-shadow: none;
  cursor: pointer;
  place-items: center;
}

.modal .modal-close:hover,
.email-reminder-modal .modal-close:hover,
.email-content-modal .modal-close:hover {
  background: #e7e4de;
  color: #760016 !important;
}

.modal .modal-close:active,
.email-reminder-modal .modal-close:active,
.email-content-modal .modal-close:active {
  border-color: #4e4e4e #fff #fff #4e4e4e;
  padding: 1px 0 0 1px;
}

.modal:not(.agency-dice-modal) > .modal-body,
.modal:not(.agency-dice-modal) .modal-body {
  background: var(--agency-surface);
  color: var(--agency-text);
  scrollbar-color: #808080 var(--agency-surface);
}

.items-list-loading,
.dice-clear-confirm-text,
.siphon-help,
.ta-report-note,
.email-reminder-no-mail {
  color: var(--agency-muted) !important;
}

.mission-back-btn,
.dice-clear-confirm-btn,
.dice-clear-cancel-btn,
.siphon-submit-btn,
.email-reminder-open-btn {
  min-height: 29px;
  padding: 0.3rem 0.75rem;
  border: 2px solid #c0c0c0 !important;
  border-color: #fff #555 #555 #fff !important;
  border-radius: 0 !important;
  background: var(--agency-surface) !important;
  color: #111 !important;
  box-shadow: none !important;
  font: 700 0.78rem "Microsoft YaHei", sans-serif;
}

.dice-clear-confirm-btn,
.email-reminder-open-btn {
  color: #760016 !important;
}

.mission-back-btn:active,
.dice-clear-confirm-btn:active,
.dice-clear-cancel-btn:active,
.siphon-submit-btn:active,
.email-reminder-open-btn:active {
  border-color: #555 #fff #fff #555 !important;
}

.siphon-input,
.dice-edit-select {
  border: 2px solid #808080 !important;
  border-color: #808080 #fff #fff #808080 !important;
  border-radius: 0 !important;
  background: #fff !important;
  color: #111 !important;
  box-shadow: none !important;
}

/* Claimable items and reference document wells. */
.items-list-modal .items-list-item {
  border: 2px solid #808080;
  border-color: #808080 #fff #fff #808080;
  border-radius: 0;
  background: #fff;
  color: #111;
}

.items-list-modal .items-list-item summary {
  color: #153b75;
}

.items-list-modal .items-list-item .item-desc {
  color: #3f454a;
}

.items-list-modal .items-list-item .item-price {
  color: #765600;
}

.joint-assessment-modal .ta-report {
  border: 2px solid #808080;
  border-color: #808080 #fff #fff #808080;
  border-radius: 0;
  background: #fff;
  color: #111;
  box-shadow: none;
}

/* Mission archive: classified report layout rather than gray card stacks. */
.mission-archive-modal {
  width: min(920px, calc(100vw - 48px));
  max-width: 920px;
  max-height: calc(100vh - 64px);
}

.mission-archive-modal .modal-body {
  padding: 8px;
  background: var(--agency-surface-alt) !important;
}

.mission-archive-list {
  gap: 5px;
  padding: 2px;
}

.mission-archive-item {
  position: relative;
  min-height: 48px;
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.65rem;
  overflow: hidden;
  border: 2px solid #c0c0c0;
  border-color: #fff #5b5b5b #5b5b5b #fff;
  border-radius: 0;
  background: #f7f7f7;
  color: #111;
  box-shadow: none;
  font-size: 0.86rem;
}

.mission-archive-item::after {
  width: 9px;
  height: 8px;
  justify-self: end;
  background: var(--agency-red);
  clip-path: polygon(50% 0, 0 100%, 100% 100%);
  content: "";
}

.mission-archive-item:hover,
.mission-archive-item:focus-visible {
  border-color: #315f9e #00154f #00154f #315f9e;
  background: var(--agency-blue);
  color: #fff;
  outline: none;
}

.mission-archive-date {
  min-width: 0;
  color: #50565b;
  font: 700 0.72rem "Courier New", monospace;
}

.mission-archive-codename {
  color: #8f001b;
  font-weight: 800;
}

.mission-archive-item:hover .mission-archive-date,
.mission-archive-item:focus-visible .mission-archive-date,
.mission-archive-item:hover .mission-archive-codename,
.mission-archive-item:focus-visible .mission-archive-codename {
  color: #fff;
}

.mission-report {
  padding: 8px;
  border: 2px solid #808080;
  border-color: #808080 #fff #fff #808080;
  border-radius: 0;
  background: #e8e8e8;
  color: #111;
  box-shadow: none;
}

.mission-report-header {
  min-height: 48px;
  margin: 0 0 7px;
  padding: 0.45rem 0.65rem;
  border: 1px solid #5f0012;
  background: linear-gradient(90deg, #7d0018, #b51031);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.28);
}

.mission-report-brand .mission-report-triangle {
  width: 15px;
  height: 13px;
  border: 0;
  background: #fff;
  clip-path: polygon(50% 0, 0 100%, 100% 100%);
  filter: none;
}

.mission-report-brand-text {
  color: #fff;
  font: 800 0.78rem "Courier New", monospace;
  letter-spacing: 0.1em;
  text-shadow: 1px 1px 0 #4f000f;
}

.mission-report-brand-sub {
  margin-top: 0;
  color: #f4dce1;
  font-size: 0.67rem;
}

.mission-report-section,
.mission-report-header-row {
  margin: 0 0 7px;
  padding: 0.75rem;
  border: 2px solid #c0c0c0;
  border-color: #fff #717171 #717171 #fff;
  border-radius: 0;
  background: #fff;
  color: #111;
  box-shadow: none;
}

.mission-report-header-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 0;
  background: #f7f7f7;
}

.mission-report-header-item {
  display: grid;
  grid-template-columns: minmax(70px, auto) minmax(0, 1fr);
  gap: 0.45rem;
  min-height: 42px;
  align-items: center;
  padding: 0.45rem 0.55rem;
  border-right: 1px solid #aaa;
  border-bottom: 1px solid #aaa;
}

.mission-report-header-item:last-child {
  border-right: 0;
}

.mission-report-label {
  margin: -0.75rem -0.75rem 0.65rem;
  padding: 0.34rem 0.55rem;
  border-bottom: 1px solid #9c9c9c;
  background: #dedbd5;
  color: #7b0017;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
}

.mission-report-field {
  color: #6b4c00 !important;
  font-size: 0.72rem;
  font-weight: 800;
}

.mission-report-value,
.mission-report-fact-value,
.mission-report-entry,
.mission-report-participant-result {
  color: #151515;
}

.mission-report-facts,
.mission-report-participant-results,
.mission-report-entries {
  border-color: #8d8d8d;
  background: #f7f7f7;
}

.mission-report-fact,
.mission-report-participant-result {
  border-color: #a2a2a2;
  background: #fff;
}

.mission-report-fact-key,
.mission-report-participant-result strong,
.mission-report-empty {
  color: #4c5256;
}

.mission-report-participant-result.observation span:last-child {
  color: #173f79;
  font-weight: 800;
}

.mission-report-participant-result.mvp span:last-child,
.mission-report-entry strong {
  color: #8d001b;
  font-weight: 800;
}

.mission-report-entry {
  padding: 0.6rem;
  border-right: 1px solid #aaa;
  border-bottom: 1px solid #aaa;
  border-left: 1px solid #aaa;
  background: #fff;
}

.mission-report-entry-meta {
  color: #6b4c00;
}

.mission-report-status-tag {
  border: 1px solid #7a0017;
  border-radius: 0;
  background: #f7dbe1;
  color: #720016;
  font-weight: 800;
}

.mission-report-status-tag.secondary {
  border-color: #24527d;
  background: #dfeaf6;
  color: #153b65;
}

.mission-report-reward {
  background: #fff9d8;
}

.mission-report-reward-score {
  border: 2px solid #8f6a08;
  border-color: #8f6a08 #fff #fff #8f6a08;
  background: #fff3b7;
  color: #5e4300;
}

/* Mail notices use the same system chrome and maintain readable metadata. */
.email-reminder-modal,
.email-content-modal {
  border-color: #fff #454545 #454545 #fff !important;
  border-radius: 1px !important;
  background: var(--agency-surface) !important;
  color: #111 !important;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.46) !important;
}

.email-reminder-modal .email-reminder-header,
.email-content-modal .email-content-header {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) 23px;
  align-items: center;
  gap: 0.5rem;
}

.email-reminder-icon,
.email-content-icon {
  width: 25px !important;
  height: 23px !important;
  display: grid !important;
  border: 2px solid #c0c0c0 !important;
  border-color: #fff #555 #555 #fff !important;
  border-radius: 0 !important;
  background: var(--agency-surface) !important;
  color: #8d001b !important;
  box-shadow: none !important;
  place-items: center;
}

.email-reminder-icon svg,
.email-content-icon svg {
  width: 14px !important;
  height: 14px !important;
}

.email-reminder-subtitle,
.email-content-meta,
.email-content-from {
  color: #f1d8dd !important;
  font-size: 0.67rem !important;
}

.email-reminder-body,
.email-content-body-wrap {
  padding: 8px !important;
  border: 2px solid #808080;
  border-color: #808080 #fff #fff #808080;
  background: #fff !important;
  color: #111 !important;
}

.email-content-divider {
  display: none;
}

.email-content-body {
  color: #111 !important;
  line-height: 1.7;
}

.email-reminder-modal .email-list-item {
  border: 1px solid #8c8c8c;
  border-left: 3px solid var(--agency-red);
  border-radius: 0;
  background: #f7f7f7;
  color: #111;
  box-shadow: none;
}

.email-reminder-modal .email-list-title {
  color: #760016;
}

.email-reminder-modal .email-list-meta {
  color: #4f5559;
}

/* Dice tray: translucent institutional console, readable result controls. */
#agencyDiceModalOverlay {
  padding: 6px;
  background: rgba(7, 27, 25, 0.24);
  backdrop-filter: blur(9px) saturate(0.72);
  -webkit-backdrop-filter: blur(9px) saturate(0.72);
}

.agency-dice-modal {
  width: calc(100vw - 12px);
  height: calc(100vh - 12px);
  overflow: hidden;
  border: 2px solid #c0c0c0;
  border-color: #fff #3f4644 #3f4644 #fff;
  border-radius: 1px;
  background: rgba(199, 195, 187, 0.48);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px) saturate(0.72);
  -webkit-backdrop-filter: blur(20px) saturate(0.72);
}

.agency-dice-modal .modal-header {
  min-height: 38px;
  padding: 4px 5px 4px 10px;
  border: 0;
  border-bottom: 1px solid #600012;
  background: linear-gradient(90deg, #760016, #bd1736 78%, #830019);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.32);
  backdrop-filter: none;
}

.agency-dice-modal .modal-title {
  color: #fff !important;
  font-size: 0.9rem;
  font-weight: 800;
  text-shadow: 1px 1px 0 #4f000f;
}

.agency-dice-intervene-btn {
  min-height: 25px;
  padding: 0.2rem 0.55rem;
  border: 2px solid #c0c0c0;
  border-color: #fff #555 #555 #fff;
  border-radius: 0;
  background: var(--agency-surface);
  color: #760016;
  box-shadow: none;
  font-size: 0.72rem;
  font-weight: 800;
}

.agency-dice-intervene-btn:hover {
  background: #e5e2dc;
  color: #540010;
  box-shadow: none;
}

.agency-dice-intervene-btn.confirming {
  border-color: #856200 #fff #fff #856200;
  background: #ffe79b;
  color: #4f3900;
}

.dice-box-stage {
  border: 2px solid #4b5e5b;
  border-color: #334b48 #d8e5e1 #d8e5e1 #334b48;
  background:
    repeating-linear-gradient(0deg, rgba(236, 244, 241, 0.07) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(90deg, rgba(236, 244, 241, 0.045) 0 1px, transparent 1px 64px),
    rgba(27, 61, 57, 0.34);
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.22), inset 1px 1px 0 rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(24px) saturate(0.68);
  -webkit-backdrop-filter: blur(24px) saturate(0.68);
}

.agency-dice-success {
  padding: 0.3rem 0.75rem;
  border: 2px solid #c0c0c0;
  border-color: #fff #555 #555 #fff;
  border-radius: 0;
  background: rgba(239, 239, 239, 0.94);
  color: #8d001b;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.36);
  text-shadow: none;
  font-weight: 900;
}

.agency-dice-roller {
  color: #f3f7f5;
  text-shadow: 1px 1px 0 #102825;
}

.dice-edit-select {
  width: 2.5rem;
  color: #111 !important;
}

/* Remaining light-surface text that was inherited from the old dark theme. */
#workbenchWindow .agent-lifecycle-status {
  border-color: #7b0017;
  background: #f5dce1;
  color: #720016;
}

#workbenchWindow .agents-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
}

#workbenchWindow .score,
#workbenchWindow .rating-value {
  text-shadow: none !important;
}

#workbenchWindow .score.嘉奖,
#workbenchWindow .score.嘉奖 .score-icon,
#workbenchWindow .rating-value.tier-0 {
  color: #087344 !important;
}

#workbenchWindow .score.过载,
#workbenchWindow .score.过载 .score-icon {
  color: #765600 !important;
}

#workbenchWindow .score.申诫,
#workbenchWindow .score.申诫 .score-icon {
  color: #9a3f00 !important;
}

#workbenchWindow .score.察看期,
#workbenchWindow .score.察看期 .score-icon {
  color: #304579 !important;
}

#workbenchWindow .arc-badge.现实 {
  color: #6b4c00;
}

#workbenchWindow .arc-badge.现实 .arc-badge-icon {
  background: #765600;
}

#workbenchWindow .arc-track.现实 .arc-track-name,
#workbenchWindow .arc-track.现实 .tracker-step-inner {
  color: #6b4c00;
}

#workbenchWindow .arc-track.现实 .tracker-step.filled {
  border-color: #806000;
  background: #fff1ad;
  color: #6b4c00;
}

#workbenchWindow .current-mission-summary-code,
#workbenchWindow .dice-history-title {
  color: #8d001b;
}

#workbenchWindow .qa-item .value {
  color: #1e5796;
}

#workbenchWindow .no-results,
#workbenchWindow .items-list-loading,
#workbenchWindow .dice-history-empty,
#workbenchWindow .ta-report-note {
  color: #4d5358;
}

#workbenchWindow .section-desc,
#workbenchWindow .ref-desc,
#workbenchWindow .item-desc,
#workbenchWindow .qa-label {
  color: #42484d;
}

@media (max-width: 720px) {
  .mission-archive-modal {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 48px);
  }

  .mission-report-header-row {
    grid-template-columns: 1fr;
  }

  .mission-report-header-item,
  .mission-report-header-item:last-child {
    border-right: 0;
  }

  .mission-archive-item {
    grid-template-columns: 92px minmax(0, 1fr) 12px;
  }

  .agency-dice-modal {
    width: calc(100vw - 8px);
    height: calc(100vh - 8px);
  }
}

/* Triangle Chat desktop integration. The iframe owns its internal system chrome. */
.chat-window {
  left: 164px;
  top: 68px;
  width: min(1220px, calc(100vw - 210px));
  height: min(760px, calc(100vh - 122px));
}

.chat-desktop-symbol {
  position: relative;
}

.desktop-chat-badge {
  position: absolute;
  top: -7px;
  right: -9px;
  min-width: 18px;
  height: 18px;
  display: none;
  place-items: center;
  padding: 0 4px;
  border: 1px solid #ffffff;
  background: #c41e3a;
  color: #ffffff;
  font: 700 10px "Courier New", monospace;
  text-shadow: 1px 1px 0 #4c000d;
}

.desktop-chat-badge.visible {
  display: grid;
}

.desktop-window.chat-attention:not(.active) {
  animation: desktop-chat-nudge 520ms steps(2, end);
}

.desktop-taskbar-button.chat-attention {
  border-color: #ffe3e8 #4c000d #4c000d #ffe3e8;
  background: #a90020;
  color: #ffffff;
  animation: desktop-chat-task-flash 900ms steps(2, end) 3;
}

.desktop-chat-notifications {
  position: absolute;
  z-index: 120;
  right: 8px;
  bottom: var(--desktop-chat-notification-bottom, 88px);
  width: min(318px, calc(100vw - 16px));
  display: grid;
  gap: 6px;
  pointer-events: none;
}

.desktop-chat-notification {
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  gap: 2px 9px;
  padding: 7px 9px 7px 7px;
  border: 2px solid;
  border-color: #ffffff #414141 #414141 #ffffff;
  border-radius: 0;
  background: #d4d0c8;
  color: #171717;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.38);
  text-align: left;
  pointer-events: auto;
  cursor: pointer;
  animation: desktop-chat-notice-in 180ms steps(3, end);
}

.desktop-chat-notification::before {
  content: "";
  grid-row: 1 / 4;
  width: 9px;
  height: 100%;
  background: #001f75;
}

.desktop-chat-notification.direct::before { background: #750016; }
.desktop-chat-notification.nudge::before { background: #b51031; }

.desktop-chat-notification:hover,
.desktop-chat-notification:focus-visible {
  background: #f0eee9;
  outline: 1px dotted #001f75;
  outline-offset: -5px;
}

.desktop-chat-notification strong,
.desktop-chat-notification span,
.desktop-chat-notification small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desktop-chat-notification strong { color: #620012; font-size: 12px; }
.desktop-chat-notification span { font-size: 11px; }
.desktop-chat-notification small { color: #545454; font: 9px "Courier New", monospace; }

@keyframes desktop-chat-notice-in {
  from { transform: translateX(22px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes desktop-chat-nudge {
  0%, 100% { transform: translate(0, 0); }
  18% { transform: translate(-9px, 2px); }
  36% { transform: translate(8px, -2px); }
  54% { transform: translate(-6px, -1px); }
  72% { transform: translate(5px, 2px); }
}

@keyframes desktop-chat-task-flash {
  0%, 100% { background: #d4d0c8; color: #111111; }
  50% { background: #a90020; color: #ffffff; }
}

@media (max-width: 900px) {
  .chat-window {
    left: 0.5rem;
    top: 0.5rem;
    width: calc(100vw - 1rem);
    height: calc(100vh - 3rem);
    min-width: 0;
  }
}

/* Persistent Agency music relay. It collapses but intentionally has no close state. */
.desktop-music-player {
  --music-surface: #d4d0c8;
  --music-surface-dark: #b9b6af;
  --music-well: #ffffff;
  --music-title: #750016;
  --music-select: #001f75;
  --music-text: #111111;
  --music-muted: #565c60;
  position: absolute;
  z-index: 78;
  right: 8px;
  bottom: 38px;
  width: 326px;
  color: var(--music-text);
  font: 13px "Microsoft YaHei", "Noto Sans SC", Arial, sans-serif;
  letter-spacing: 0;
}

.desktop-music-player[hidden],
.desktop-music-player [hidden] {
  display: none !important;
}

.desktop-music-player.gm.expanded {
  width: min(790px, calc(100vw - 132px));
}

.music-dock-collapsed {
  width: 100%;
  height: 44px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 8px;
  padding: 4px 7px;
  overflow: hidden;
  border: 2px solid;
  border-color: #ffffff #4b4b4b #4b4b4b #ffffff;
  border-radius: 0;
  background: var(--music-surface);
  color: var(--music-text);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.38);
  text-align: left;
  cursor: pointer;
}

.music-dock-collapsed:hover,
.music-dock-collapsed:focus-visible {
  background: #ece9e2;
  outline: 1px dotted #001f75;
  outline-offset: -5px;
}

.desktop-music-player.expanded .music-dock-collapsed {
  display: none;
}

.music-dock-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid #36000a;
  background: var(--music-title);
  color: #ffffff;
}

.music-dock-icon svg {
  width: 19px;
  height: 19px;
  stroke-width: 1.8;
}

.music-dock-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

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

.music-dock-copy strong {
  color: #620012;
  font-size: 12px;
}

.music-dock-copy small {
  color: var(--music-muted);
  font: 9px "Courier New", monospace;
}

.music-level-bars {
  height: 24px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid #777777;
  background: #efefed;
}

.music-level-bars i {
  width: 4px;
  height: 4px;
  background: #868686;
}

.music-level-bars i:nth-child(2) { height: 8px; }
.music-level-bars i:nth-child(3) { height: 13px; }
.music-level-bars i:nth-child(4) { height: 18px; }

.desktop-music-player.playing .music-level-bars i {
  background: #b51031;
  animation: agency-music-meter 760ms steps(4, end) infinite alternate;
}

.desktop-music-player.playing .music-level-bars i:nth-child(2) { animation-delay: -240ms; }
.desktop-music-player.playing .music-level-bars i:nth-child(3) { animation-delay: -410ms; }
.desktop-music-player.playing .music-level-bars i:nth-child(4) { animation-delay: -120ms; }

@keyframes agency-music-meter {
  0% { transform: scaleY(0.35); transform-origin: bottom; }
  100% { transform: scaleY(1); transform-origin: bottom; }
}

.music-player-panel {
  position: relative;
  width: 100%;
  max-height: calc(100vh - 86px);
  overflow: hidden;
  border: 2px solid;
  border-color: #ffffff #414141 #414141 #ffffff;
  background: var(--music-surface);
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.42);
}

.music-player-titlebar {
  height: 34px;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 28px;
  align-items: center;
  gap: 9px;
  padding: 3px 4px 3px 8px;
  border-bottom: 1px solid #3f000b;
  background: var(--music-title);
  color: #ffffff;
}

.music-player-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.music-player-mark {
  width: 0;
  height: 0;
  flex: 0 0 auto;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 14px solid #ef1e38;
}

.music-player-brand > span:last-child {
  min-width: 0;
  display: grid;
  line-height: 1;
}

.music-player-brand strong,
.music-player-brand small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-player-brand strong { font-size: 13px; }
.music-player-brand small {
  margin-top: 3px;
  color: #f3c5ce;
  font: 8px "Courier New", monospace;
}

.music-player-network {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #f1dfe3;
  font: 9px "Courier New", monospace;
  white-space: nowrap;
}

.music-player-network svg {
  width: 14px;
  height: 14px;
}

.music-player-layout {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  background: #99968f;
  gap: 3px;
  padding: 3px;
}

.desktop-music-player.gm .music-player-layout {
  grid-template-columns: 318px minmax(360px, 1fr);
}

.music-now-panel,
.music-library-panel {
  min-width: 0;
  min-height: 0;
  border: 2px solid;
  border-color: #ffffff #555555 #555555 #ffffff;
  background: var(--music-surface);
}

.music-now-panel {
  display: grid;
  grid-template-rows: auto auto auto auto auto;
  align-content: start;
  padding: 8px;
}

.music-now-display {
  min-width: 0;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 82px;
  padding: 7px;
  border: 2px solid;
  border-color: #777777 #ffffff #ffffff #777777;
  background: #f7f7f5;
}

.music-record-visual {
  position: relative;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 1px solid #171a19;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, #242927 0 3px, #111413 4px 7px);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.28);
}

.desktop-music-player.playing .music-record-visual {
  animation: agency-record-spin 3.8s linear infinite;
}

.music-record-center {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid #4a000d;
  border-radius: 50%;
  background: #b51031;
}

.music-record-center::after {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 9px solid #ffffff;
  content: "";
}

@keyframes agency-record-spin {
  to { transform: rotate(360deg); }
}

.music-now-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.music-now-kicker {
  color: #750016;
  font: 700 9px "Courier New", monospace;
}

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

.music-now-copy strong {
  font-size: 14px;
}

.music-now-copy small {
  color: var(--music-muted);
  font-size: 10px;
}

.music-progress-block {
  display: grid;
  gap: 4px;
  padding: 10px 2px 5px;
}

.music-progress-block input,
.music-volume-row input {
  width: 100%;
  min-width: 0;
  height: 18px;
  margin: 0;
  accent-color: #750016;
}

.music-progress-block input:disabled {
  opacity: 1;
}

.music-time-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  color: var(--music-muted);
  font: 9px "Courier New", monospace;
}

.music-time-row span:nth-child(2) {
  overflow: hidden;
  color: #750016;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-time-row span:last-child { text-align: right; }

.music-transport {
  display: flex;
  justify-content: center;
  gap: 5px;
  padding: 5px 0 8px;
  border-bottom: 1px solid #8a8a8a;
}

.music-icon-button,
.music-command-button,
.music-text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 2px solid;
  border-color: #ffffff #565656 #565656 #ffffff;
  border-radius: 0;
  background: #d4d0c8;
  color: #111111;
  box-shadow: none;
  font: inherit;
  letter-spacing: 0;
  cursor: pointer;
}

.music-icon-button {
  width: 28px;
  min-width: 28px;
  height: 26px;
  padding: 3px;
}

.music-icon-button svg,
.music-command-button svg {
  width: 15px;
  height: 15px;
  stroke-width: 1.9;
}

.music-icon-button:hover,
.music-command-button:hover,
.music-text-button:hover {
  background: #f0eee9;
  color: #750016;
  outline: 1px dotted #242424;
  outline-offset: -4px;
}

.music-icon-button:active,
.music-command-button:active,
.music-text-button:active {
  border-color: #565656 #ffffff #ffffff #565656;
  transform: translate(1px, 1px);
}

.music-icon-button:disabled,
.music-command-button:disabled,
.music-text-button:disabled {
  color: #777777;
  cursor: default;
  text-shadow: 1px 1px #ffffff;
  transform: none;
}

.music-play-button {
  width: 38px;
  color: #750016;
}

.music-volume-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 7px;
  padding: 9px 1px 6px;
}

.music-volume-row output {
  height: 23px;
  display: grid;
  place-items: center;
  border: 1px solid;
  border-color: #777777 #ffffff #ffffff #777777;
  background: #efefed;
  color: #4b5054;
  font: 10px "Courier New", monospace;
}

.music-player-notice {
  min-height: 26px;
  padding: 5px 6px;
  overflow: hidden;
  border: 1px solid;
  border-color: #777777 #ffffff #ffffff #777777;
  background: #efefed;
  color: #4f5559;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-player-notice.error {
  border-left: 5px solid #b51031;
  color: #750016;
}

.music-library-panel {
  height: min(480px, calc(100vh - 94px));
  display: grid;
  grid-template-rows: 36px 38px auto minmax(0, 1fr) 32px;
  overflow: hidden;
}

.music-library-header {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 7px;
  border-bottom: 1px solid #777777;
  background: #c3c0b9;
}

.music-library-header > span:first-child {
  min-width: 0;
  display: grid;
}

.music-library-header strong {
  color: #750016;
  font-size: 12px;
}

.music-library-header small {
  color: var(--music-muted);
  font-size: 9px;
}

.music-library-page {
  padding: 2px 5px;
  border: 1px solid #777777;
  background: #ffffff;
  font: 9px "Courier New", monospace;
}

.music-library-toolbar {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 5px;
  border-bottom: 1px solid #888888;
  background: #d4d0c8;
}

.music-command-button {
  min-width: 0;
  height: 27px;
  padding: 2px 5px;
  overflow: hidden;
  font-size: 10px;
  white-space: nowrap;
}

.music-inline-form {
  position: absolute;
  z-index: 4;
  top: 75px;
  right: 7px;
  width: min(390px, calc(100% - 330px));
  display: grid;
  gap: 7px;
  padding: 7px;
  border: 2px solid;
  border-color: #ffffff #4b4b4b #4b4b4b #ffffff;
  background: #d4d0c8;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.4);
}

.music-form-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 2px 4px 5px;
  border-bottom: 1px solid #8a8a8a;
  color: #750016;
}

.music-inline-form label {
  min-width: 0;
  display: grid;
  gap: 3px;
  color: #44494c;
  font-size: 10px;
  font-weight: 700;
}

.music-inline-form input {
  width: 100%;
  min-width: 0;
  height: 27px;
  padding: 3px 6px;
  border: 2px solid;
  border-color: #777777 #ffffff #ffffff #777777;
  border-radius: 0;
  background: #ffffff;
  color: #111111;
  font: 11px "Microsoft YaHei", sans-serif;
}

.music-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.music-text-button {
  min-height: 26px;
  padding: 3px 10px;
}

.music-text-button.primary {
  border-color: #dfe7ff #00103d #00103d #dfe7ff;
  background: #274f91;
  color: #ffffff;
}

.music-text-button.danger {
  border-color: #ffe1e6 #57000f #57000f #ffe1e6;
  background: #98001c;
  color: #ffffff;
}

.music-track-list {
  min-height: 0;
  overflow-y: auto;
  border-top: 1px solid #ffffff;
  background: #ffffff;
  scrollbar-color: #b9b6af #ece9e2;
  scrollbar-width: thin;
}

.music-track-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 2px 7px;
  min-height: 48px;
  padding: 5px 6px;
  border-bottom: 1px solid #c5c5c2;
  background: #ffffff;
}

.music-track-row:nth-child(even) { background: #f1f1ef; }

.music-track-row.active {
  border-left: 4px solid #b51031;
  padding-left: 2px;
  background: #fff0f2;
}

.music-track-index {
  grid-row: 1 / span 2;
  color: #666b6f;
  font: 9px "Courier New", monospace;
  text-align: center;
}

.music-track-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

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

.music-track-copy strong {
  color: #222222;
  font-size: 11px;
}

.music-track-copy small {
  color: #5e6367;
  font-size: 9px;
}

.music-track-actions {
  grid-row: 1 / span 2;
  display: flex;
  gap: 3px;
}

.music-track-actions .music-icon-button {
  width: 24px;
  min-width: 24px;
  height: 23px;
}

.music-track-empty {
  min-height: 160px;
  display: grid;
  place-items: center;
  padding: 20px;
  color: #5a6064;
  text-align: center;
}

.music-library-pagination {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 5px;
  padding: 3px 6px;
  border-top: 1px solid #777777;
  background: #c5c2bb;
}

.music-library-pagination span {
  color: #4f5559;
  font: 9px "Courier New", monospace;
  text-align: center;
}

.music-confirm-layer {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 12px;
  background: rgba(23, 61, 59, 0.62);
}

.music-confirm-dialog {
  width: min(400px, calc(100% - 24px));
  border: 2px solid;
  border-color: #ffffff #3f3f3f #3f3f3f #ffffff;
  background: #d4d0c8;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.44);
}

.music-confirm-dialog > header {
  padding: 5px 7px;
  background: #750016;
  color: #ffffff;
}

.music-confirm-dialog > div {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 12px;
}

.music-confirm-dialog > div > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 2px solid #680012;
  background: #dfad00;
  color: #680012;
  font-size: 22px;
  font-weight: 900;
}

.music-confirm-dialog p {
  margin: 0;
  line-height: 1.55;
}

.music-confirm-dialog > footer {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 7px;
  border-top: 1px solid #7e7e7e;
}

@media (max-width: 920px) {
  .desktop-music-player,
  .desktop-music-player.gm.expanded {
    right: 4px;
    width: min(620px, calc(100vw - 8px));
  }

  .desktop-music-player.gm .music-player-layout {
    grid-template-columns: minmax(260px, 0.85fr) minmax(330px, 1.15fr);
  }

  .music-player-network { display: none; }
  .music-player-titlebar { grid-template-columns: minmax(0, 1fr) 28px; }
}

@media (max-width: 680px) {
  .desktop-music-player,
  .desktop-music-player.gm.expanded {
    left: 4px;
    right: 4px;
    width: auto;
  }

  .music-player-panel {
    max-height: calc(100vh - 74px);
    overflow-y: auto;
  }

  .desktop-music-player.gm .music-player-layout {
    grid-template-columns: 1fr;
  }

  .music-library-panel {
    height: min(390px, 48vh);
  }

  .music-inline-form {
    position: fixed;
    top: 76px;
    right: 12px;
    left: 12px;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .desktop-music-player.playing .music-record-visual,
  .desktop-music-player.playing .music-level-bars i {
    animation: none;
  }
}
/* Shared requisition inventory records inside the Workbench agent card. */
#workbenchWindow .agent-item-card-rich {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 7px;
}

#workbenchWindow .agent-item-visual {
  display: grid;
  overflow: hidden;
  width: 72px;
  height: 72px;
  place-items: center;
  border: 2px solid #c0c0c0;
  border-color: #666 #fff #fff #666;
  background: #fff;
}

#workbenchWindow .agent-item-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#workbenchWindow .agent-item-image-placeholder {
  width: 34px;
  height: 30px;
  background: #b41132;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  opacity: .85;
}

#workbenchWindow .agent-item-card-rich details {
  min-width: 0;
}

#workbenchWindow .agent-item-source {
  margin-top: 5px;
  color: #6d4300;
  font-size: 11px;
  font-weight: 700;
}

#workbenchWindow .agent-item-notes {
  margin-top: 6px;
  padding: 5px 6px;
  color: #2a220e;
  border: 1px solid #8c762b;
  background: #fff3bd;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
}

#workbenchWindow .agent-item-notes strong {
  display: block;
  margin-bottom: 2px;
  color: #6b4900;
}

#workbenchWindow .agent-questionnaire-reality-row .agent-questionnaire-label {
  color: #684900;
  border-color: #8c772d;
  background: #f2d978;
}

#workbenchWindow .agent-questionnaire-reality-row .agent-questionnaire-value {
  border-color: #8c772d;
  background: #fff8d9;
}

@media (max-width: 520px) {
  #workbenchWindow .agent-item-card-rich {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  #workbenchWindow .agent-item-visual {
    width: 56px;
    height: 56px;
  }
}
.anomaly-question-prompt-overlay,
.anomaly-unlock-notice-overlay {
  z-index: 12000;
  background: rgba(10, 24, 23, 0.68);
}

.anomaly-question-prompt-modal,
.anomaly-unlock-notice-modal {
  width: min(620px, calc(100vw - 20px));
  max-height: calc(100vh - 20px);
  border-radius: 0;
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.42);
}

.anomaly-question-prompt-header {
  align-items: center;
}

.anomaly-question-prompt-header .modal-title {
  display: flex;
  align-items: center;
  gap: 7px;
}

.agency-prompt-mark,
.agency-unlock-mark {
  display: inline-block;
  width: 19px;
  height: 17px;
  flex: 0 0 auto;
  background: #e02b48;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.anomaly-question-required {
  padding: 2px 5px;
  border: 1px solid #f1b4bf;
  color: #fff;
  font: 700 10px "Courier New", monospace;
}

.anomaly-question-prompt-body {
  display: grid;
  gap: 11px;
  overflow: auto;
  background: #d4d0c8;
}

.anomaly-question-prompt-file {
  padding: 7px 9px;
  border: 2px solid #c0c0c0;
  border-color: #666 #fff #fff #666;
  background: #fff;
}

.anomaly-question-prompt-file strong,
.anomaly-question-prompt-file small { display: block; }
.anomaly-question-prompt-file strong { color: #760016; font-size: 14px; }
.anomaly-question-prompt-file small { margin-top: 2px; color: #555b61; font: 11px "Courier New", monospace; }
#anomalyQuestionPromptMeta:empty { display: none; }

.anomaly-question-prompt-text {
  margin: 0;
  padding: 12px;
  border-left: 5px solid #b51031;
  background: #fff;
  color: #111;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.55;
  white-space: pre-wrap;
}

.anomaly-question-prompt-options {
  display: grid;
  gap: 7px;
}

.anomaly-question-prompt-option {
  display: grid;
  grid-template-columns: 18px 30px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 50px;
  padding: 7px 9px;
  border: 2px solid #c0c0c0;
  border-color: #fff #555 #555 #fff;
  background: #ece9e2;
  color: #111;
  cursor: pointer;
}

.anomaly-question-prompt-option:hover { background: #fff; }
.anomaly-question-prompt-option:has(input:checked) {
  border-color: #8ba9d2 #001f75 #001f75 #8ba9d2;
  background: #dce8f8;
}

.anomaly-question-prompt-option input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #001f75;
}

.anomaly-question-choice-code {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  background: #001f75;
  color: #fff;
  font: 800 15px "Courier New", monospace;
}

.anomaly-question-prompt-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-top: 1px solid #777;
  background: #d4d0c8;
  color: #444;
  font-size: 11px;
}

.anomaly-question-prompt-footer .agency-classic-button {
  min-width: 106px;
  min-height: 29px;
  padding: 4px 12px;
  border: 2px solid #c0c0c0;
  border-color: #fff #555 #555 #fff;
  border-radius: 0;
  background: #d4d0c8;
  color: #111;
  font: 700 12px "Microsoft YaHei", sans-serif;
  cursor: pointer;
}

.anomaly-question-prompt-footer .agency-classic-button.primary { background: #001f75; color: #fff; }
.anomaly-question-prompt-footer .agency-classic-button:active:not(:disabled) { border-color: #555 #fff #fff #555; }
.anomaly-question-prompt-footer .agency-classic-button:disabled { color: #777; background: #c7c3bb; cursor: not-allowed; }

.anomaly-unlock-notice-body {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  background: #fff;
}

.anomaly-unlock-notice-body .agency-unlock-mark {
  width: 66px;
  height: 58px;
  background: #b51031;
  filter: drop-shadow(3px 3px 0 #650010);
}

.anomaly-unlock-notice-body h3 { margin: 0 0 5px; color: #760016; font-size: 17px; }
.anomaly-unlock-notice-body p { margin: 0; color: #222; line-height: 1.55; }
.anomaly-unlock-tag {
  display: inline-block;
  margin-top: 9px;
  padding: 4px 10px;
  border: 2px solid #c0c0c0;
  border-color: #fff #555 #555 #fff;
  background: #001f75;
  color: #fff;
  font: 800 16px "Courier New", monospace;
}

@media (max-width: 520px) {
  .anomaly-question-prompt-footer { align-items: stretch; flex-direction: column; }
  .anomaly-question-prompt-footer .agency-classic-button { width: 100%; }
  .anomaly-unlock-notice-body { grid-template-columns: 48px minmax(0, 1fr); }
  .anomaly-unlock-notice-body .agency-unlock-mark { width: 44px; height: 39px; }
}

.extra-dice-toggle-group {
  display: grid;
  grid-template-columns: repeat(2, 32px);
  grid-template-rows: repeat(3, 17px);
  gap: 1px;
  padding: 2px;
  border: 2px solid #c0c0c0;
  border-color: #666 #fff #fff #666;
  background: #c7c3bb;
}

.extra-die-toggle {
  position: relative;
  display: flex;
  width: 32px;
  height: 17px;
  padding: 0 2px 0 13px;
  align-items: center;
  justify-content: center;
  border: 1px solid #c0c0c0;
  border-color: #fff #555 #555 #fff;
  border-radius: 0;
  background: #d4d0c8;
  color: #25282a;
  cursor: pointer;
}

.extra-die-toggle::before {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 9px;
  height: 9px;
  content: "";
  background: #8f1028;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.extra-die-toggle span {
  position: relative;
  z-index: 1;
  font: 800 8px/1 "Courier New", monospace;
}

.extra-die-toggle:hover { background: #f1eee7; color: #001f75; }
.extra-die-toggle[aria-pressed="true"],
.extra-die-toggle.selected {
  border-color: #555 #fff #fff #555;
  background: #001f75;
  color: #fff;
  transform: translate(1px, 1px);
}

.extra-die-toggle[aria-pressed="true"]::before { background: #ef304f; }

.agency-extra-dice-container {
  position: absolute;
  left: 50%;
  bottom: 7px;
  z-index: 8;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100% - 16px);
  min-height: 60px;
  box-sizing: border-box;
  margin: 0;
  padding: 4px 7px;
  border: 2px solid #c0c0c0;
  border-color: #566966 #edf4f1 #edf4f1 #566966;
  background: rgba(199, 195, 187, 0.72);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.36), 3px 3px 0 rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px) saturate(0.72);
  -webkit-backdrop-filter: blur(12px) saturate(0.72);
  transform: translateX(-50%);
}

.agency-extra-dice-container[hidden] { display: none; }

.agency-dice-body.has-extra-dice {
  background:
    repeating-linear-gradient(90deg, rgba(236, 244, 241, 0.035) 0 1px, transparent 1px 64px),
    rgba(27, 61, 57, 0.34);
}

.agency-dice-body.has-extra-dice .dice-box-stage {
  height: calc(100% - 68px);
  min-height: 0;
}

.agency-dice-body.has-extra-dice .dice-container { bottom: calc(4.15rem + 68px); }
.agency-dice-body.has-extra-dice .agency-dice-success { bottom: calc(2.45rem + 68px); }
.agency-dice-body.has-extra-dice .agency-dice-roller { bottom: calc(1rem + 68px); }

.agency-extra-die {
  position: relative;
  display: grid;
  width: clamp(42px, 12vw, 56px);
  height: 50px;
  flex: 0 1 56px;
  place-items: center;
  color: #fff;
  background: #737e86;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  filter: drop-shadow(3px 4px 2px rgba(0, 0, 0, 0.45));
  isolation: isolate;
}

.agency-extra-die::before {
  display: none;
}

.agency-extra-die[data-sides="6"] {
  clip-path: polygon(50% 0, 96% 24%, 96% 76%, 50% 100%, 4% 76%, 4% 24%);
}

.agency-extra-die[data-sides="8"] {
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

.agency-extra-die[data-sides="10"] {
  clip-path: polygon(50% 0, 94% 34%, 78% 90%, 50% 100%, 22% 90%, 6% 34%);
}

.agency-extra-die[data-sides="12"] {
  clip-path: polygon(35% 0, 65% 0, 92% 20%, 100% 52%, 82% 88%, 50% 100%, 18% 88%, 0 52%, 8% 20%);
}

.agency-extra-die[data-sides="20"] {
  clip-path: polygon(50% 0, 82% 10%, 100% 38%, 94% 72%, 70% 100%, 30% 100%, 6% 72%, 0 38%, 18% 10%);
}

.agency-extra-die strong {
  position: relative;
  z-index: 1;
  padding-top: 2px;
  font: 900 20px/1 "Arial Black", Arial, sans-serif;
  text-shadow: 1px 1px 0 #30363a, 0 0 3px rgba(255, 255, 255, 0.25);
}

.agency-extra-die-type {
  position: absolute;
  z-index: 2;
  top: auto;
  bottom: 4px;
  left: 50%;
  padding: 1px 3px;
  background: rgba(38, 45, 50, 0.82);
  color: #fff;
  font: 700 8px "Courier New", monospace;
  transform: translateX(-50%);
}

.agency-extra-die.rolling {
  animation: agency-extra-die-readout 620ms steps(2, end) infinite;
  animation-delay: var(--extra-delay, 0ms);
}

@keyframes agency-extra-die-readout {
  0%, 100% { opacity: 0.28; }
  50% { opacity: 0.52; }
}

.agency-extra-die .extra-dice-edit-select {
  position: absolute;
  z-index: 5;
  inset: auto 5px 5px;
  width: calc(100% - 10px);
  height: 24px;
  border-radius: 0;
}

.agency-extra-die.editing {
  clip-path: none;
  border: 2px solid #c0c0c0;
  border-color: #555 #fff #fff #555;
  background: #c7c3bb;
  filter: none;
}

.agency-extra-die.editing::before { display: none; }
.agency-extra-die.editing strong,
.agency-extra-die.editing .agency-extra-die-type { visibility: hidden; }

@media (min-width: 769px) {
  #workbenchWindow .agents-grid {
    grid-template-columns: repeat(4, minmax(250px, 1fr));
    align-items: start;
    min-width: calc(1000px + 3.75rem);
  }

  #workbenchWindow .agents-grid > .agent-card-flip {
    min-width: 0;
  }
}

#workbenchWindow .dice-history-die.extra,
#workbenchWindow .dice-history-mini-die.extra {
  display: inline-grid;
  grid-template-rows: 9px 1fr;
  width: 28px;
  height: 31px;
  padding: 1px;
  place-items: center;
  border-color: #edf2f4 #485158 #485158 #edf2f4;
  background: #737e86;
  color: #fff;
  line-height: 1;
  clip-path: polygon(18% 0, 100% 0, 100% 78%, 80% 100%, 0 100%, 0 20%);
}

#workbenchWindow .dice-history-mini-die.extra { width: 25px; height: 28px; }
#workbenchWindow .dice-history-die.extra small,
#workbenchWindow .dice-history-mini-die.extra small {
  display: block;
  width: 100%;
  background: #343c42;
  color: #fff;
  font: 700 8px "Courier New", monospace;
  text-align: center;
}

#workbenchWindow .dice-history-mini-die.extra.after {
  border-color: #8fb7e8 #123f78 #123f78 #8fb7e8;
  box-shadow: inset 0 0 0 1px #2d73bd;
}

#workbenchWindow .dice-history-intervention.extra-dice-change { margin-top: 3px; }

@media (max-width: 768px) {
  .extra-dice-toggle-group { order: -1; }
  .workbench-window .banner-buttons { flex-wrap: wrap; }
}
