All files / src/views GovernanceWorkspaceView.vue

5.71% Statements 4/70
0% Branches 0/99
0% Functions 0/49
5.97% Lines 4/67

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832                                                                                                                                                                                                                                  1x               1x                                                                     1x                   1x                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
<script setup lang="ts">
import { computed, onMounted, watch } from "vue";
 
import type { CompensationPhase } from "../entities/governance";
import {
  GOVERNANCE_DOMAINS,
  useGovernanceStore,
} from "../entities/governance";
import { useStaffSessionStore } from "../stores/session";
import {
  PjActionGroup,
  PjButton,
  PjField,
  PjPageContainer,
  PjStatusNotice,
  PjSurface,
} from "@plain-journal/ui";
 
const session = useStaffSessionStore();
const governance = useGovernanceStore();
const accessContext = computed(() => ({
  authorized: Boolean(
    session.authenticated
    && session.profile?.roles.includes("ADMIN"),
  ),
  operatorId: session.profile?.id ?? null,
  accessToken: session.accessToken,
}));
 
function noticeTone(
  phase: CompensationPhase,
): "neutral" | "warning" | "unknown" | "success" | "danger" {
  switch (phase) {
    case "invalid":
      return "warning";
    case "unknown":
      return "unknown";
    case "accepted":
      return "success";
    case "rejected":
      return "danger";
    default:
      return "neutral";
  }
}
 
function noticeTitle(phase: CompensationPhase): string {
  switch (phase) {
    case "invalid":
      return "命令信息不完整";
    case "unknown":
      return "命令结果未知";
    case "accepted":
      return "命令已被权威事实确认";
    case "rejected":
      return "命令已被明确拒绝";
    default:
      return "治理命令";
  }
}
 
function loadIssues() {
  return governance.loadIssues(accessContext.value);
}
 
function submitRefundRetry() {
  return governance.submitRefundRetry(accessContext.value);
}
 
function loadRefundRetryAudits() {
  return governance.loadRefundRetryAudits(accessContext.value);
}
 
function submitPaymentExceptionRefund() {
  return governance.submitPaymentExceptionRefund(accessContext.value);
}
 
function loadPaymentExceptionAudits() {
  return governance.loadPaymentExceptionAudits(accessContext.value);
}
 
watch(accessContext, (context) => {
  governance.synchronizeAccess(context);
});
 
onMounted(() => {
  governance.synchronizeAccess(accessContext.value);
  void loadIssues();
});
</script>
 
<template>
  <PjPageContainer as="section" size="wide" class="governance-page">
    <header class="governance-hero">
      <div>
        <p class="eyebrow">所有者域治理</p>
        <h1>补偿与对账</h1>
        <p>
          页面只呈现 Payment 与四个所有者域已经确认的事实。
          响应丢失不会被当成失败或成功,恢复必须沿用原命令 ID。
        </p>
      </div>
      <span class="status-label">仅 ADMIN</span>
    </header>
 
    <PjStatusNotice tone="neutral" title="治理边界">
      <p>
        四域对账保持只读;补偿命令只推进合法状态机。
        MySQL 事实、追加式审计与幂等键共同裁决结果,页面不能直接改写成功状态。
      </p>
    </PjStatusNotice>
 
    <section class="governance-section" aria-labelledby="reconciliation-title">
      <header class="governance-section__header">
        <div>
          <p class="eyebrow">Trade · Payment · Inventory · Fulfillment</p>
          <h2 id="reconciliation-title">所有者域只读对账</h2>
        </div>
        <span>{{ governance.totalIssues }} 条当前记录</span>
      </header>
 
      <div class="governance-toolbar">
        <PjField
          v-slot="{ describedBy }"
          label="对账状态"
          for-id="governance-status"
        >
          <select
            id="governance-status"
            v-model="governance.reconciliationStatus"
            class="pj-control"
            :aria-describedby="describedBy"
            @change="loadIssues"
          >
            <option value="OPEN">OPEN</option>
            <option value="RESOLVED">RESOLVED</option>
          </select>
        </PjField>
        <PjButton
          variant="text"
          :loading="governance.loadingIssues"
          @click="loadIssues"
        >
          刷新四域事实
        </PjButton>
      </div>
 
      <PjStatusNotice
        v-if="governance.issuesError"
        tone="danger"
        title="对账读取未完成"
        assertive
      >
        <p>{{ governance.issuesError }}</p>
      </PjStatusNotice>
 
      <div class="governance-domain-grid">
        <PjSurface
          v-for="domain in GOVERNANCE_DOMAINS"
          :key="domain"
          as="article"
          tone="plain"
          padding="medium"
          class="governance-domain"
        >
          <header>
            <p class="eyebrow">{{ domain }}</p>
            <h3>{{ governance.issues[domain].length }} 条</h3>
          </header>
          <ul v-if="governance.issues[domain].length">
            <li
              v-for="issue in governance.issues[domain]"
              :key="`${issue.referenceNo}:${issue.issueType}`"
            >
              <strong>{{ issue.issueType }}</strong>
              <span>{{ issue.referenceNo }}</span>
              <small>
                {{ issue.occurrences }} 次 · 最近 {{ issue.lastDetectedAt }}
              </small>
            </li>
          </ul>
          <p v-else class="governance-empty">
            当前没有 {{ governance.reconciliationStatus }} 记录。
          </p>
        </PjSurface>
      </div>
    </section>
 
    <section class="governance-section" aria-labelledby="refund-retry-title">
      <PjSurface as="article" tone="raised" padding="large">
        <header class="governance-command-header">
          <div>
            <p class="eyebrow">Payment 授权补偿</p>
            <h2 id="refund-retry-title">退款渠道重派</h2>
          </div>
          <span>稳定命令 ID · 追加式审计</span>
        </header>
 
        <p class="governance-boundary">
          仅对进入 NEEDS_ATTENTION 的退款恢复派发资格。
          接口受理不等于渠道退款成功,最终退款事实仍由 Payment 与渠道回调裁决。
        </p>
 
        <PjStatusNotice
          v-if="governance.refundRetry.phase !== 'idle'"
          :tone="noticeTone(governance.refundRetry.phase)"
          :title="noticeTitle(governance.refundRetry.phase)"
          :assertive="governance.refundRetry.phase === 'rejected'"
        >
          <p>{{ governance.refundRetry.message }}</p>
          <template
            v-if="['accepted', 'rejected'].includes(governance.refundRetry.phase)"
            #actions
          >
            <PjButton variant="text" @click="governance.resetRefundRetry">
              准备新命令
            </PjButton>
          </template>
        </PjStatusNotice>
 
        <form class="governance-command-form" @submit.prevent="submitRefundRetry">
          <PjField
            v-slot="{ describedBy, invalid }"
            label="退款号"
            for-id="refund-retry-no"
            hint="只能使用 Payment 已存在的退款业务号。"
            required
          >
            <input
              id="refund-retry-no"
              v-model.trim="governance.refundRetry.referenceNo"
              class="pj-control"
              required
              maxlength="64"
              pattern="[A-Za-z0-9._:\-]+"
              :readonly="governance.refundRetry.phase === 'unknown'"
              :aria-describedby="describedBy"
              :aria-invalid="invalid"
            />
          </PjField>
          <PjField
            v-slot="{ describedBy }"
            label="命令 ID"
            for-id="refund-retry-command-id"
            hint="结果未知时必须原样保留并复用。"
            required
          >
            <input
              id="refund-retry-command-id"
              v-model.trim="governance.refundRetry.commandId"
              class="pj-control governance-command-id"
              required
              maxlength="64"
              readonly
              :aria-describedby="describedBy"
            />
          </PjField>
          <PjField
            v-slot="{ describedBy, invalid }"
            label="补偿原因"
            for-id="refund-retry-reason"
            hint="原因进入不可变审计;结果未知时不得改写。"
            required
            class="governance-command-form__wide"
          >
            <textarea
              id="refund-retry-reason"
              v-model.trim="governance.refundRetry.reason"
              class="pj-control"
              required
              maxlength="200"
              rows="3"
              :readonly="governance.refundRetry.phase === 'unknown'"
              :aria-describedby="describedBy"
              :aria-invalid="invalid"
            />
          </PjField>
          <PjActionGroup class="governance-command-form__wide">
            <PjButton
              type="submit"
              :loading="governance.refundRetry.submitting"
              :disabled="governance.refundRetry.loadingAudits"
            >
              {{
                governance.refundRetry.phase === "unknown"
                  ? "使用原 ID 安全重试"
                  : "授权重新派发"
              }}
            </PjButton>
            <PjButton
              variant="text"
              :loading="governance.refundRetry.loadingAudits"
              :disabled="governance.refundRetry.submitting"
              @click="loadRefundRetryAudits"
            >
              读取权威审计
            </PjButton>
          </PjActionGroup>
        </form>
 
        <PjStatusNotice
          v-if="governance.refundRetry.auditError"
          tone="warning"
          title="审计读取未完成"
        >
          <p>{{ governance.refundRetry.auditError }}</p>
        </PjStatusNotice>
 
        <dl v-if="governance.refundRetry.result" class="governance-facts">
          <div>
            <dt>退款状态</dt>
            <dd>{{ governance.refundRetry.result.status }}</dd>
          </div>
          <div>
            <dt>请求状态</dt>
            <dd>{{ governance.refundRetry.result.requestStatus }}</dd>
          </div>
          <div>
            <dt>尝试次数</dt>
            <dd>{{ governance.refundRetry.result.requestAttempts }}</dd>
          </div>
          <div>
            <dt>退款金额</dt>
            <dd>{{ governance.refundRetry.result.amount }}</dd>
          </div>
        </dl>
 
        <div
          v-if="governance.refundRetry.audits.length"
          class="governance-table-wrap"
          tabindex="0"
          aria-label="退款渠道重派审计表"
        >
          <table>
            <thead>
              <tr>
                <th>命令</th>
                <th>结果</th>
                <th>前后状态</th>
                <th>原因 / 操作人</th>
              </tr>
            </thead>
            <tbody>
              <tr
                v-for="audit in governance.refundRetry.audits"
                :key="audit.commandId"
              >
                <td><code>{{ audit.commandId }}</code></td>
                <td>
                  <strong>{{ audit.outcome }}</strong>
                  <small>{{ audit.errorCode || "无错误码" }}</small>
                </td>
                <td>
                  {{ audit.beforeRequestStatus }} → {{ audit.afterRequestStatus }}
                </td>
                <td>
                  {{ audit.reason }}
                  <small>{{ audit.operatorId }}</small>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
      </PjSurface>
    </section>
 
    <section
      class="governance-section"
      aria-labelledby="exception-refund-title"
    >
      <PjSurface as="article" tone="raised" padding="large">
        <header class="governance-command-header">
          <div>
            <p class="eyebrow">Payment 异常支付恢复</p>
            <h2 id="exception-refund-title">全额原路退款</h2>
          </div>
          <span>Trade 权威状态 · Payment 退款事实</span>
        </header>
 
        <p class="governance-boundary">
          仅当 Payment 已成功且 Trade 权威状态仍为 PAYMENT_EXCEPTION 时受理。
          命令只创建退款,不直接伪造退款成功。
        </p>
 
        <PjStatusNotice
          v-if="governance.paymentExceptionRefund.phase !== 'idle'"
          :tone="noticeTone(governance.paymentExceptionRefund.phase)"
          :title="noticeTitle(governance.paymentExceptionRefund.phase)"
          :assertive="governance.paymentExceptionRefund.phase === 'rejected'"
        >
          <p>{{ governance.paymentExceptionRefund.message }}</p>
          <template
            v-if="['accepted', 'rejected'].includes(governance.paymentExceptionRefund.phase)"
            #actions
          >
            <PjButton
              variant="text"
              @click="governance.resetPaymentExceptionRefund"
            >
              准备新命令
            </PjButton>
          </template>
        </PjStatusNotice>
 
        <form
          class="governance-command-form"
          @submit.prevent="submitPaymentExceptionRefund"
        >
          <PjField
            v-slot="{ describedBy, invalid }"
            label="支付号"
            for-id="payment-exception-no"
            hint="Payment 会再次核对 Trade 的 PAYMENT_EXCEPTION 权威状态。"
            required
          >
            <input
              id="payment-exception-no"
              v-model.trim="governance.paymentExceptionRefund.referenceNo"
              class="pj-control"
              required
              maxlength="64"
              pattern="[A-Za-z0-9._:\-]+"
              :readonly="governance.paymentExceptionRefund.phase === 'unknown'"
              :aria-describedby="describedBy"
              :aria-invalid="invalid"
            />
          </PjField>
          <PjField
            v-slot="{ describedBy }"
            label="命令 ID"
            for-id="payment-exception-command-id"
            hint="响应丢失后不得生成第二个命令 ID。"
            required
          >
            <input
              id="payment-exception-command-id"
              v-model.trim="governance.paymentExceptionRefund.commandId"
              class="pj-control governance-command-id"
              required
              maxlength="64"
              readonly
              :aria-describedby="describedBy"
            />
          </PjField>
          <PjField
            v-slot="{ describedBy, invalid }"
            label="授权原因"
            for-id="payment-exception-reason"
            hint="原因与命令 ID 一起进入 Payment 追加式审计。"
            required
            class="governance-command-form__wide"
          >
            <textarea
              id="payment-exception-reason"
              v-model.trim="governance.paymentExceptionRefund.reason"
              class="pj-control"
              required
              maxlength="200"
              rows="3"
              :readonly="governance.paymentExceptionRefund.phase === 'unknown'"
              :aria-describedby="describedBy"
              :aria-invalid="invalid"
            />
          </PjField>
          <PjActionGroup class="governance-command-form__wide">
            <PjButton
              type="submit"
              :loading="governance.paymentExceptionRefund.submitting"
              :disabled="governance.paymentExceptionRefund.loadingAudits"
            >
              {{
                governance.paymentExceptionRefund.phase === "unknown"
                  ? "使用原 ID 安全重试"
                  : "授权创建退款"
              }}
            </PjButton>
            <PjButton
              variant="text"
              :loading="governance.paymentExceptionRefund.loadingAudits"
              :disabled="governance.paymentExceptionRefund.submitting"
              @click="loadPaymentExceptionAudits"
            >
              读取权威审计
            </PjButton>
          </PjActionGroup>
        </form>
 
        <PjStatusNotice
          v-if="governance.paymentExceptionRefund.auditError"
          tone="warning"
          title="审计读取未完成"
        >
          <p>{{ governance.paymentExceptionRefund.auditError }}</p>
        </PjStatusNotice>
 
        <dl
          v-if="governance.paymentExceptionRefund.result"
          class="governance-facts"
        >
          <div>
            <dt>退款号</dt>
            <dd>{{ governance.paymentExceptionRefund.result.refundNo }}</dd>
          </div>
          <div>
            <dt>退款状态</dt>
            <dd>{{ governance.paymentExceptionRefund.result.status }}</dd>
          </div>
          <div>
            <dt>请求状态</dt>
            <dd>{{ governance.paymentExceptionRefund.result.requestStatus }}</dd>
          </div>
          <div>
            <dt>退款金额</dt>
            <dd>{{ governance.paymentExceptionRefund.result.amount }}</dd>
          </div>
        </dl>
 
        <div
          v-if="governance.paymentExceptionRefund.audits.length"
          class="governance-table-wrap"
          tabindex="0"
          aria-label="异常支付退款审计表"
        >
          <table>
            <thead>
              <tr>
                <th>命令</th>
                <th>结果</th>
                <th>订单 / 退款</th>
                <th>原因 / 操作人</th>
              </tr>
            </thead>
            <tbody>
              <tr
                v-for="audit in governance.paymentExceptionRefund.audits"
                :key="audit.commandId"
              >
                <td><code>{{ audit.commandId }}</code></td>
                <td>
                  <strong>{{ audit.outcome }}</strong>
                  <small>{{ audit.errorCode || "无错误码" }}</small>
                </td>
                <td>
                  {{ audit.orderNo || "未绑定" }}
                  <small>{{ audit.refundNo || "未创建" }}</small>
                </td>
                <td>
                  {{ audit.reason }}
                  <small>{{ audit.operatorId }}</small>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
      </PjSurface>
    </section>
  </PjPageContainer>
</template>
 
<style scoped>
.governance-page {
  display: grid;
  gap: var(--pj-space-7);
  padding-block: var(--pj-space-7) var(--pj-space-8);
}
 
.governance-hero,
.governance-section__header,
.governance-command-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--pj-space-5);
}
 
.governance-hero h1 {
  margin: 0;
  font-size: var(--pj-font-size-xl);
  font-weight: 520;
  letter-spacing: -0.04em;
}
 
.governance-hero p:last-child {
  max-width: var(--pj-layout-reading);
  margin-bottom: 0;
  color: var(--pj-text-secondary);
}
 
.governance-section {
  min-width: 0;
  display: grid;
  gap: var(--pj-space-5);
}
 
.governance-section > .pj-surface,
.governance-command-form > *,
.governance-facts > * {
  min-width: 0;
}
 
.governance-section :deep(.pj-status-notice__body),
.governance-section :deep(.pj-status-notice__content) {
  min-width: 0;
  overflow-wrap: anywhere;
}
 
.governance-section__header h2,
.governance-command-header h2 {
  margin: 0;
  font-size: var(--pj-font-size-lg);
}
 
.governance-section__header > span,
.governance-command-header > span,
.governance-boundary,
.governance-empty {
  color: var(--pj-text-secondary);
  font-size: var(--pj-font-size-sm);
}
 
.governance-toolbar {
  display: flex;
  align-items: flex-end;
  gap: var(--pj-space-5);
  padding-block: var(--pj-space-3);
  border-block: 1px solid var(--pj-border-subtle);
}
 
.governance-toolbar .pj-field {
  min-width: 12rem;
}
 
.governance-domain-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--pj-space-4);
}
 
.governance-domain {
  min-width: 0;
}
 
.governance-domain h3 {
  margin: 0;
  font-size: var(--pj-font-size-lg);
}
 
.governance-domain ul {
  display: grid;
  gap: var(--pj-space-3);
  margin: var(--pj-space-4) 0 0;
  padding: 0;
  list-style: none;
}
 
.governance-domain li {
  min-width: 0;
  display: grid;
  gap: var(--pj-space-1);
  padding-top: var(--pj-space-3);
  border-top: 1px solid var(--pj-border-subtle);
}
 
.governance-domain span,
.governance-domain small {
  overflow-wrap: anywhere;
}
 
.governance-domain small {
  color: var(--pj-text-secondary);
}
 
.governance-command-header {
  margin-bottom: var(--pj-space-4);
}
 
.governance-boundary {
  max-width: var(--pj-layout-reading);
  margin-bottom: var(--pj-space-5);
}
 
.governance-command-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--pj-space-5);
  margin-top: var(--pj-space-6);
  padding-top: var(--pj-space-5);
  border-top: 1px solid var(--pj-border-subtle);
}
 
.governance-command-form__wide {
  grid-column: 1 / -1;
}
 
.governance-command-form textarea {
  resize: vertical;
  line-height: 1.5;
}
 
.governance-command-form .pj-control {
  min-width: 0;
  max-width: 100%;
}
 
.governance-command-id {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: var(--pj-font-size-xs);
}
 
.governance-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--pj-space-4);
  margin: var(--pj-space-6) 0 0;
}
 
.governance-facts div {
  min-width: 0;
  padding-top: var(--pj-space-3);
  border-top: 1px solid var(--pj-border-subtle);
}
 
.governance-facts dt {
  color: var(--pj-text-secondary);
  font-size: var(--pj-font-size-xs);
}
 
.governance-facts dd {
  margin: var(--pj-space-1) 0 0;
  overflow-wrap: anywhere;
}
 
.governance-table-wrap {
  width: 100%;
  max-width: 100%;
  margin-top: var(--pj-space-6);
  overflow-x: auto;
  border-top: 1px solid var(--pj-border-strong);
}
 
.governance-table-wrap:focus-visible {
  outline: 0.15rem solid var(--pj-action-primary);
  outline-offset: var(--pj-space-1);
}
 
.governance-table-wrap table {
  width: 100%;
  min-width: 52rem;
  border-collapse: collapse;
  text-align: left;
}
 
.governance-table-wrap th,
.governance-table-wrap td {
  padding: var(--pj-space-4) var(--pj-space-3);
  border-bottom: 1px solid var(--pj-border-subtle);
  vertical-align: top;
}
 
.governance-table-wrap th {
  color: var(--pj-text-secondary);
  font-size: var(--pj-font-size-xs);
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
 
.governance-table-wrap td:first-child {
  max-width: 19rem;
}
 
.governance-table-wrap code {
  overflow-wrap: anywhere;
  font-size: var(--pj-font-size-xs);
}
 
.governance-table-wrap strong,
.governance-table-wrap small {
  display: block;
}
 
.governance-table-wrap small {
  margin-top: var(--pj-space-1);
  color: var(--pj-text-secondary);
}
 
@media (max-width: 72rem) {
  .governance-domain-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
 
@media (max-width: 48rem) {
  .governance-hero,
  .governance-section__header,
  .governance-command-header {
    align-items: flex-start;
    flex-direction: column;
  }
 
  .governance-command-form,
  .governance-facts {
    grid-template-columns: minmax(0, 1fr);
  }
 
  .governance-command-form__wide {
    grid-column: auto;
  }
}
 
@media (max-width: 32rem) {
  .governance-page {
    gap: var(--pj-space-6);
    padding-block: var(--pj-space-6);
  }
 
  .governance-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
 
  .governance-toolbar .pj-field {
    min-width: 0;
  }
 
  .governance-domain-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
</style>