﻿
    :root {
      --ink: #172033;
      --muted: #667085;
      --line: #d9dee8;
      --panel: #ffffff;
      --page: #f4f6fb;
      --navy: #173a67;
      --slate: #5b626d;
      --green: #8bd000;
      --orange: #ff6b00;
      --red: #ff221c;
      --yellow: #fff200;
      --gold: #f5b700;
      --shadow: 0 16px 40px rgba(19, 34, 56, .12);
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      min-width: 1180px;
      background: var(--page);
      color: var(--ink);
      font-family: Arial, Helvetica, sans-serif;
    }

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

    .app {
      min-height: 100vh;
      display: grid;
      grid-template-columns: 280px 1fr;
    }

    .sidebar {
      background: #111827;
      color: #fff;
      padding: 22px 18px;
      display: flex;
      flex-direction: column;
      gap: 22px;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 12px;
      padding-bottom: 18px;
      border-bottom: 1px solid rgba(255, 255, 255, .12);
    }

    .mark {
      display: grid;
      place-items: center;
      width: 42px;
      height: 42px;
      border-radius: 50%;
      background: linear-gradient(135deg, #163b6f 0 52%, #d9b15b 52% 100%);
      box-shadow: inset 0 0 0 5px #111827, 0 0 0 2px rgba(255, 255, 255, .18);
      overflow: hidden;
      flex: 0 0 auto;
    }

    .mark img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .brand strong {
      display: block;
      font-size: 18px;
      letter-spacing: 0;
      overflow-wrap: anywhere;
    }

    .brand span {
      color: #c6a15b;
      font-weight: 700;
      letter-spacing: 1px;
    }

    .nav-group {
      display: grid;
      gap: 8px;
    }

    .nav-label {
      color: #94a3b8;
      font-size: 12px;
      font-weight: 700;
      text-transform: uppercase;
    }

    .nav-item {
      border: 0;
      color: #e5e7eb;
      background: transparent;
      text-align: left;
      padding: 11px 12px;
      border-radius: 6px;
      cursor: pointer;
    }

    .nav-item.active,
    .nav-item:hover {
      background: rgba(255, 255, 255, .1);
    }

    .account-actions {
      display: grid;
      gap: 8px;
    }

    .current-user {
      display: block;
      padding: 12px;
      border: 1px solid rgba(255, 255, 255, .14);
      border-radius: 8px;
      background: rgba(255, 255, 255, .07);
      color: #fff;
    }

    .sidebar-bottom {
      margin-top: auto;
      display: grid;
      gap: 12px;
    }

    .current-user strong,
    .current-user span {
      display: block;
      overflow-wrap: anywhere;
    }

    .current-user span {
      margin-top: 3px;
      color: #cbd5e1;
      font-size: 12px;
      font-weight: 700;
    }

    .account-actions .btn {
      width: 100%;
      background: rgba(255, 255, 255, .08);
      border-color: rgba(255, 255, 255, .16);
      color: #fff;
    }

    .account-actions .btn.primary {
      background: #fff;
      border-color: #fff;
      color: #111827;
    }

    .sidebar-role-picker {
      display: grid;
      gap: 6px;
      color: #cbd5e1;
      font-size: 11px;
      font-weight: 800;
      text-transform: uppercase;
    }

    .sidebar-role-picker select {
      width: 100%;
      min-height: 38px;
      border: 1px solid rgba(255, 255, 255, .24);
      border-radius: 6px;
      padding: 8px 10px;
      background: #fff;
      color: #111827;
      font-weight: 800;
      text-transform: none;
    }

    .summary-card {
      margin-top: auto;
      background: rgba(255, 255, 255, .08);
      border: 1px solid rgba(255, 255, 255, .1);
      border-radius: 8px;
      padding: 14px;
    }

    .summary-card span {
      color: #cbd5e1;
      font-size: 12px;
      font-weight: 700;
      text-transform: uppercase;
    }

    .summary-card strong {
      display: block;
      margin-top: 8px;
      color: #fff;
      font-size: 26px;
    }

    ::placeholder {
      color: #667085;
      opacity: .62;
      font-weight: 500;
    }

    .admin-only {
      display: block;
    }

    .privileged-only {
      display: block;
    }

    .settings-grid {
      display: grid;
      gap: 16px;
      padding: 16px;
    }

    .settings-card {
      border: 1px solid var(--line);
      border-radius: 8px;
      overflow: hidden;
      background: #fff;
    }

    .settings-card h3 {
      margin: 0;
      padding: 12px 14px;
      background: var(--navy);
      color: #fff;
      font-size: 16px;
    }

    .settings-body {
      display: grid;
      gap: 12px;
      padding: 14px;
      background: #f8fafc;
    }

    .settings-form {
      display: grid;
      grid-template-columns: 1.2fr 1.4fr 180px auto;
      gap: 10px;
      align-items: end;
    }

    .settings-form label {
      display: grid;
      gap: 6px;
      color: #344054;
      font-size: 12px;
      font-weight: 800;
      text-transform: uppercase;
      background: #fff;
      border: 1px solid #e5e7eb;
      border-radius: 8px;
      padding: 10px;
    }

    .settings-form input,
    .settings-form select {
      min-height: 40px;
      border: 1px solid var(--line);
      border-radius: 6px;
      padding: 8px 10px;
      text-transform: none;
      background: #fff;
      color: var(--ink);
      font-weight: 600;
    }

    .branding-form {
      grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr) auto;
    }

    .logo-preview {
      display: flex;
      align-items: center;
      gap: 10px;
      color: var(--muted);
      font-size: 12px;
      font-weight: 700;
    }

    .logo-preview .mark {
      box-shadow: 0 0 0 1px var(--line);
    }

    .danger-zone {
      border-color: #fecaca;
    }

    .danger-zone h3 {
      background: #991b1b;
    }

    .danger-zone p {
      margin: 0;
      color: var(--muted);
      line-height: 1.45;
    }

    .btn.danger {
      background: #dc2626;
      border-color: #dc2626;
      color: #fff;
    }

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

    .change-panel {
      border: 1px solid var(--line);
      border-radius: 8px;
      overflow: hidden;
      background: #fff;
    }

    .change-panel h3 {
      margin: 0;
      padding: 10px 12px;
      background: #f8fafc;
      color: var(--navy);
      font-size: 14px;
    }

    .change-panel pre {
      margin: 0;
      min-height: 260px;
      max-height: 520px;
      overflow: auto;
      padding: 12px;
      white-space: pre-wrap;
      word-break: break-word;
      color: #991b1b;
      font: 12px/1.45 Consolas, monospace;
    }

    .archive-detail {
      display: grid;
      gap: 14px;
      padding: 16px;
    }

    .archive-detail pre {
      margin: 0;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
      padding: 14px;
      white-space: pre-wrap;
      word-break: break-word;
      font: 13px/1.45 Consolas, monospace;
    }

    .archive-readonly .field-row input,
    .archive-readonly .field-row textarea,
    .archive-readonly .field-row select {
      background: #f8fafc;
      color: #172033;
    }

    main {
      padding: 26px;
      overflow: auto;
    }

    .topbar {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 32px;
      margin-bottom: 22px;
      padding: 18px 18px 14px;
      background: rgba(255, 255, 255, .62);
      border: 1px solid #e5eaf3;
      border-radius: 10px;
    }

    .topbar > div:first-child {
      max-width: 860px;
      display: grid;
      gap: 8px;
    }

    h1 {
      margin: 0;
      color: var(--navy);
      font-size: 30px;
      line-height: 1.18;
      letter-spacing: 0;
    }

    .subtitle {
      margin: 0;
      color: var(--muted);
      font-size: 14px;
      line-height: 1.55;
    }

    .actions {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
      justify-content: flex-end;
      max-width: 920px;
    }

    .action-group {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      padding: 4px;
      border: 1px solid #d8e2f2;
      border-radius: 8px;
      background: #f8fbff;
    }

    .action-group-label {
      flex: 1 0 100%;
      color: #42526a;
      font-size: 11px;
      font-weight: 800;
      letter-spacing: 0.04em;
      line-height: 1.1;
      text-transform: uppercase;
    }

    .topbar .actions {
      align-self: center;
      justify-content: flex-start;
    }

    .actions .save-status {
      min-height: 20px;
    }

    .topbar[data-view-panel="bowtie-view"] {
      align-items: stretch;
    }

    .topbar[data-view-panel="bowtie-view"] > div:first-child {
      flex: 0 1 520px;
    }

    .topbar[data-view-panel="bowtie-view"] .actions {
      flex: 1 1 auto;
      max-width: none;
      justify-content: space-between;
      align-content: center;
    }

    .topbar[data-view-panel="bowtie-view"] .actions .save-status {
      flex-basis: 100%;
      order: -1;
    }

    .topbar[data-view-panel="bowtie-view"] .action-group {
      flex: 1 1 250px;
      justify-content: center;
    }

    .topbar[data-view-panel="bowtie-view"] .btn {
      flex: 1 1 116px;
      min-width: 0;
    }

    .review-mode-banner {
      display: none;
      align-items: center;
      gap: 10px;
      margin-bottom: 12px;
      padding: 10px 12px;
      position: sticky;
      top: 8px;
      z-index: 20;
      border: 1px solid #f4c46b;
      border-radius: 8px;
      background: #fff8df;
      color: var(--ink);
      box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
    }

    .review-mode-banner.active {
      display: flex;
      flex-wrap: wrap;
    }

    .review-mode-banner strong {
      color: var(--brand);
      margin-right: auto;
    }

    .review-selectable {
      position: relative;
      outline: 2px dashed rgba(26, 66, 111, 0.28);
      outline-offset: -3px;
      cursor: crosshair;
    }

    .review-comment-bubble {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 20px;
      height: 20px;
      margin-left: 6px;
      border-radius: 999px;
      background: #f59e0b;
      color: #111827;
      font-size: 11px;
      font-weight: 900;
      vertical-align: middle;
    }

    .topbar[data-view-panel="control-reference-view"] {
      align-items: stretch;
    }

    .topbar[data-view-panel="control-reference-view"] .actions {
      flex: 1 1 auto;
      max-width: none;
      justify-content: flex-end;
      align-content: center;
    }

    .topbar[data-view-panel="control-reference-view"] .action-group {
      justify-content: center;
    }

    .btn {
      border: 1px solid var(--line);
      background: #fff;
      color: var(--ink);
      border-radius: 6px;
      padding: 10px 14px;
      font-weight: 700;
      cursor: pointer;
      min-height: 38px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      line-height: 1.1;
    }

    .btn.primary {
      background: var(--navy);
      border-color: var(--navy);
      color: #fff;
    }

    .btn.icon-btn {
      min-width: 42px;
      padding-inline: 12px;
      font-size: 16px;
    }

    .btn:disabled {
      opacity: .48;
      cursor: not-allowed;
    }

    .view-panel {
      display: none;
    }

    .view-panel.active {
      display: block;
    }

    .registry {
      background: #fff;
      border: 1px solid var(--line);
      border-radius: 8px;
      box-shadow: var(--shadow);
      overflow: hidden;
    }

    .registry[data-view-panel="register-risk-form-view"] {
      overflow: visible;
    }

    .registry-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      padding: 14px 16px;
      border-bottom: 1px solid var(--line);
    }

    .registry-header h2 {
      margin: 0;
      color: var(--navy);
      font-size: 18px;
      line-height: 1.2;
    }

    .registry-header .actions {
      flex: 1 1 auto;
      max-width: none;
      flex-wrap: nowrap;
      align-items: stretch;
      justify-content: flex-end;
    }

    .registry-header .action-group {
      flex: 0 1 auto;
      align-content: flex-start;
    }

    .save-status {
      color: #047857;
      font-size: 13px;
      font-weight: 700;
      min-height: 18px;
    }

    .sync-status {
      margin: 8px 16px 0;
      color: #315a86;
      font-size: 13px;
      font-weight: 700;
    }

    .sync-status.error {
      color: #b42318;
    }

    .sync-status.ok {
      color: #067647;
    }

    .registry-table {
      width: 100%;
      border-collapse: collapse;
      table-layout: fixed;
    }

    .registry-table th,
    .registry-table td {
      border-bottom: 1px solid var(--line);
      padding: 11px 12px;
      text-align: left;
      vertical-align: middle;
    }

    .registry-table th {
      background: #f8fafc;
      color: var(--muted);
      font-size: 12px;
      text-transform: uppercase;
    }

    .registry-table tr:last-child td {
      border-bottom: 0;
    }

    .registry-table .empty-row {
      color: var(--muted);
      text-align: center;
      padding: 18px;
    }

    .registry-toolbar {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
      align-items: center;
      gap: 10px;
      padding: 12px 16px;
      margin: 10px 12px;
      border: 1px solid #b7cceb;
      border-radius: 8px;
      background: #eef6ff;
      box-shadow: inset 0 0 0 1px #ffffff, 0 1px 3px rgba(15, 23, 42, 0.08);
    }

    .registry-toolbar.soft-filters {
      background: #f6f9ff;
      border-color: #c7d7ee;
    }

    .formal-rating-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(260px, 1fr));
      gap: 12px;
    }

    .formal-rating-button {
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 100%;
      min-height: 52px;
      padding: 10px 12px;
      border: 1px solid var(--line);
      border-radius: 6px;
      background: #fff;
      color: var(--ink);
      font-weight: 800;
      text-align: left;
      cursor: pointer;
    }

    .formal-rating-button .risk-score {
      min-width: 76px;
      margin-left: 12px;
    }

    .formal-rating-panel {
      border: 1px solid #bfd0e6;
      border-radius: 8px;
      background: #f8fbff;
      padding: 12px;
      margin-top: 10px;
    }

    .formal-rating-panel[hidden] {
      display: none;
    }

    .formal-rating-options {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
      gap: 8px;
      margin: 8px 0 12px;
    }

    .formal-option {
      display: flex;
      gap: 8px;
      align-items: flex-start;
      min-height: 44px;
      padding: 10px;
      border: 1px solid var(--line);
      border-radius: 6px;
      background: #fff;
      cursor: pointer;
    }

    .formal-option strong {
      display: block;
      margin-bottom: 3px;
      color: var(--brand);
    }

    .formal-option span {
      color: var(--muted);
      line-height: 1.35;
    }

    .registry-toolbar input,
    .registry-toolbar select {
      width: 100%;
      min-width: 0;
      min-height: 38px;
      border: 1px solid var(--line);
      border-radius: 6px;
      padding: 8px 10px;
      background: #fff;
    }

    .filter-field {
      display: grid;
      gap: 6px;
      color: #0b2f4a;
      font-size: 11px;
      font-weight: 800;
      text-transform: uppercase;
      padding: 8px;
      border: 1px solid #98b6d8;
      border-radius: 7px;
      background: #f8fbff;
    }

    .filter-group {
      display: grid;
      grid-template-columns: repeat(3, minmax(140px, 1fr));
      gap: 8px;
      padding: 8px;
      border: 1px solid #84a8d3;
      border-radius: 8px;
      background: #eef6ff;
      box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    }

    .filter-group-title {
      grid-column: 1 / -1;
      color: #0a2f4a;
      font-size: 11px;
      font-weight: 900;
      text-transform: uppercase;
    }

    .risk-register-filters {
      grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
      align-items: stretch;
    }

    .risk-register-filters .filter-group {
      grid-column: span 2;
      min-width: 0;
    }

    .risk-register-filters .filter-field,
    .risk-register-filters .filter-group {
      min-width: 0;
    }

    .fra-filter-toolbar {
      grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(180px, 1fr)) auto;
    }

    .fra-filter-toolbar .btn {
      align-self: end;
      min-height: 38px;
    }

    @media (max-width: 1450px) {
      .risk-register-filters .filter-group {
        grid-column: 1 / -1;
      }
    }

    .fra-table {
      min-width: 2600px;
      table-layout: fixed;
    }

    .fra-table input,
    .fra-table select,
    .fra-table textarea {
      width: 100%;
      min-height: 36px;
      border: 1px solid var(--line);
      border-radius: 5px;
      padding: 7px 8px;
      background: #fff;
    }

    .fra-table textarea {
      min-height: 58px;
      resize: vertical;
    }

    .fra-rating-button {
      width: 100%;
      min-height: 42px;
      border: 0;
      border-radius: 6px;
      font-weight: 900;
      cursor: pointer;
    }

    .fra-action-stack {
      display: grid;
      gap: 6px;
    }

    .fra-table .compact-list {
      max-height: 190px;
      overflow: auto;
    }

    .fra-risk-section {
      border: 1px solid var(--line);
      border-radius: 8px;
      overflow: hidden;
      background: #fff;
      margin-top: 14px;
    }

    .fra-risk-section-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 14px 16px;
      background: #eef5ff;
      border-bottom: 1px solid var(--line);
    }

    .fra-risk-section-header h2 {
      margin: 0;
      font-size: 16px;
      color: var(--brand);
    }

    .fra-risk-section-header .btn {
      min-width: 120px;
      min-height: 40px;
    }

    .risk-register-wrap {
      overflow: auto;
      max-height: calc(100vh - 230px);
    }

    .risk-register-table {
      min-width: 2500px;
      table-layout: fixed;
    }

    .risk-register-table th:first-child,
    .risk-register-table td:first-child {
      width: 78px;
      max-width: 78px;
      white-space: nowrap;
    }

    .risk-register-table th:nth-child(3),
    .risk-register-table td:nth-child(3) {
      width: 160.75px;
    }

    .risk-register-table th:nth-child(4),
    .risk-register-table td:nth-child(4) {
      width: 360px;
    }

    .risk-register-table th:nth-child(5),
    .risk-register-table td:nth-child(5) {
      width: 320px;
    }

    .risk-register-table th:nth-child(9),
    .risk-register-table td:nth-child(9),
    .risk-register-table th:nth-child(10),
    .risk-register-table td:nth-child(10) {
      width: 360px;
    }

    .risk-register-table th {
      background: #08283a;
      color: #fff;
      text-align: center;
    }

    .risk-register-table td {
      vertical-align: top;
      white-space: pre-line;
      line-height: 1.35;
      overflow-wrap: anywhere;
    }

    .risk-register-table tr.draft-risk-row td {
      color: #9ca3af;
    }

    .risk-register-table tr.draft-risk-row .risk-id-main {
      color: #6b7280;
      font-weight: 800;
    }

    .draft-label {
      display: block;
      margin-top: 2px;
      color: #9ca3af;
      font-size: 11px;
      font-weight: 800;
      text-transform: uppercase;
    }

    .risk-action-buttons {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 8px;
    }

    .risk-action-buttons button,
    .action-toolbar button {
      border: 1px solid #c7d7fe;
      background: #eef4ff;
      color: var(--navy);
      border-radius: 6px;
      padding: 7px 10px;
      font-size: 12px;
      font-weight: 800;
      cursor: pointer;
    }

    .dashboard-grid {
      display: grid;
      grid-template-columns: minmax(520px, 1.25fr) minmax(360px, .75fr);
      gap: 16px;
      padding: 16px;
    }

    .dashboard-card {
      background: #fff;
      border: 1px solid var(--line);
      border-radius: 8px;
      overflow: hidden;
      box-shadow: 0 10px 28px rgba(19, 34, 56, .06);
    }

    .dashboard-card h3 {
      margin: 0;
      padding: 12px 14px;
      color: #fff;
      background: var(--navy);
      font-size: 16px;
    }

    .dashboard-card-title {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 10px 12px 10px 14px;
      color: #fff;
      background: var(--navy);
    }

    .dashboard-card-title h3 {
      padding: 0;
      background: transparent;
    }

    .dashboard-card-title .btn {
      min-height: 30px;
      padding: 6px 10px;
      background: #fff;
      color: var(--navy);
      border-color: #c7d7fe;
      font-size: 12px;
    }

    .dashboard-body {
      padding: 14px;
    }

    .dashboard-filters {
      display: grid;
      grid-template-columns: repeat(6, minmax(140px, 1fr));
      gap: 10px;
      padding: 14px 16px 0;
    }

    .dashboard-filters label {
      display: grid;
      gap: 5px;
      background: #f8fafc;
      border: 1px solid var(--line);
      border-radius: 8px;
      color: #16406f;
      font-size: 11px;
      font-weight: 800;
      padding: 10px;
      text-transform: uppercase;
    }

    .dashboard-filters input,
    .dashboard-filters select {
      min-width: 0;
      border: 1px solid var(--line);
      border-radius: 6px;
      padding: 9px 10px;
      color: #0f172a;
      font-size: 14px;
      text-transform: none;
      background: #fff;
    }

    .kpi-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(130px, 1fr));
      gap: 12px;
      padding: 16px;
    }

    .kpi-card {
      background: #fff;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 14px;
      box-shadow: 0 8px 22px rgba(19, 34, 56, .06);
    }

    .kpi-card span {
      display: block;
      color: #667085;
      font-size: 12px;
      font-weight: 800;
      text-transform: uppercase;
    }

    .kpi-card strong {
      display: block;
      margin-top: 8px;
      color: var(--navy);
      font-size: 28px;
    }

    .heatmap {
      display: grid;
      grid-template-columns: 150px repeat(5, minmax(86px, 1fr));
      border: 1px solid #111827;
      overflow: hidden;
    }

    .heat-cell {
      min-height: 70px;
      border-right: 1px solid #111827;
      border-bottom: 1px solid #111827;
      display: grid;
      place-items: center;
      text-align: center;
      padding: 8px;
      font-weight: 800;
    }

    .heat-cell[data-likelihood] {
      cursor: pointer;
      transition: transform .12s ease, box-shadow .12s ease;
    }

    .heat-cell[data-likelihood]:hover {
      transform: translateY(-1px);
      box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .65);
    }

    .heat-cell small {
      display: block;
      margin-top: 4px;
      font-size: 11px;
      font-weight: 800;
      text-transform: uppercase;
    }

    .heat-head {
      background: #f1f5f9;
      color: #111827;
    }

    .heat-label {
      background: #a99b68;
      color: #111827;
      font-size: 12px;
    }

    .dash-bars {
      display: grid;
      gap: 10px;
    }

    .dash-bar-row {
      display: grid;
      grid-template-columns: 150px 1fr 42px;
      align-items: center;
      gap: 10px;
      font-weight: 800;
    }

    .dash-bar-track {
      height: 22px;
      background: #e5e7eb;
      border-radius: 999px;
      overflow: hidden;
    }

    .dash-bar-fill {
      height: 100%;
      min-width: 4px;
      background: var(--navy);
    }

    .dash-empty {
      color: #667085;
      font-weight: 700;
      padding: 8px 0;
      text-align: center;
    }

    .pie-wrap {
      display: grid;
      grid-template-columns: 220px 1fr;
      gap: 16px;
      align-items: center;
    }

    .pie-chart {
      width: 220px;
      height: 220px;
      overflow: visible;
    }

    .pie-slice {
      cursor: pointer;
      stroke: #fff;
      stroke-width: .025;
    }

    .pie-legend {
      display: grid;
      gap: 8px;
      align-content: center;
    }

    .pie-legend button {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      border: 1px solid var(--line);
      border-radius: 6px;
      background: #fff;
      padding: 8px 10px;
      font-weight: 800;
      cursor: pointer;
    }

    .pie-swatch {
      width: 14px;
      height: 14px;
      border-radius: 999px;
      display: inline-block;
      margin-right: 8px;
    }

    .control-detail-table {
      margin-top: 14px;
      max-height: 260px;
      overflow: auto;
      border: 1px solid var(--line);
      border-radius: 6px;
    }

    .control-detail-table table {
      width: 100%;
      border-collapse: collapse;
      font-size: 12px;
    }

    .control-detail-table th,
    .control-detail-table td {
      border-bottom: 1px solid var(--line);
      padding: 8px;
      text-align: left;
      vertical-align: top;
    }

    .control-detail-table th {
      background: #f8fafc;
      color: #344054;
      font-size: 11px;
      text-transform: uppercase;
    }

    .verification-pie-layout {
      display: grid;
      grid-template-columns: 180px 1fr;
      align-items: center;
      gap: 16px;
    }

    .verification-pie-layout .pie-chart {
      width: 180px;
      height: 180px;
    }

    .risk-action-buttons button:first-child,
    .action-toolbar .primary-action {
      background: var(--navy);
      border-color: var(--navy);
      color: #fff;
    }

    .rating-chip {
      display: inline-flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      min-width: 74px;
      min-height: 52px;
      border-radius: 6px;
      padding: 6px 8px;
      font-weight: 800;
      line-height: 1.15;
    }

    .rating-chip small {
      margin-top: 3px;
      font-size: 11px;
      text-transform: uppercase;
    }

    .heat-extreme {
      background: #d7192f;
      color: #fff;
      font-weight: 800;
      text-align: center;
    }

    .heat-high {
      background: #ff6b00;
      color: #fff;
      font-weight: 800;
      text-align: center;
    }

    .heat-medium {
      background: #ffff00;
      color: #111827;
      font-weight: 800;
      text-align: center;
    }

    .heat-low {
      background: #00b050;
      color: #111827;
      font-weight: 800;
      text-align: center;
    }

    .action-form {
      display: grid;
      gap: 14px;
      padding: 16px;
    }

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

    .action-grid .full {
      grid-column: 1 / -1;
    }

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

    .register-builder-panel {
      border: 1px solid var(--line);
      border-radius: 8px;
      overflow: visible;
      background: #fff;
    }

    .register-builder-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      background: #f8fafc;
      border-bottom: 1px solid var(--line);
      padding: 10px 12px;
      font-weight: 800;
      color: var(--navy);
    }

    .register-builder-body {
      display: grid;
      gap: 8px;
      padding: 10px;
      overflow: visible;
    }

    .register-row {
      display: grid;
      grid-template-columns: 54px minmax(460px, 1fr) minmax(112px, 128px) minmax(110px, 140px) 72px minmax(126px, 150px) 36px;
      gap: 8px;
      align-items: center;
    }

    .register-row > * {
      min-width: 0;
    }

    .register-row.simple {
      grid-template-columns: 54px minmax(520px, 1fr) 36px;
    }

    .register-control-head {
      padding: 8px 10px;
      font-weight: 800;
      color: #667085;
      background: #f8fafc;
      align-items: center;
    }

    .register-control-head span {
      overflow-wrap: anywhere;
      line-height: 1.2;
    }

    .register-row textarea {
      width: 100%;
      min-height: 48px;
      border: 1px solid var(--line);
      border-radius: 6px;
      padding: 8px;
      resize: vertical;
      overflow-wrap: anywhere;
    }

    .register-row select {
      width: 100%;
      min-height: 42px;
      border: 1px solid var(--line);
      border-radius: 6px;
    }

    .register-row input[type="checkbox"] {
      width: 18px;
      height: 18px;
      margin: 0 auto;
    }

    .register-tag {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 36px;
      border-radius: 6px;
      background: #eef4ff;
      color: var(--navy);
      font-weight: 800;
    }

    .register-tag.uncontrolled {
      background: var(--red);
      color: #fff;
    }

    .compact-list {
      display: grid;
      gap: 6px;
      white-space: normal;
    }

    .compact-list div {
      border: 1px solid #d8dee8;
      border-left: 4px solid #cbd5e1;
      border-radius: 6px;
      background: #f3f6fa;
      padding: 7px 9px;
      color: #1f2937;
    }

    .compact-list div.critical-control-chip {
      font-weight: 900;
      color: #0b2f57;
      border-left-color: var(--navy);
      background: #eaf1fb;
    }

    .compact-list div.uncontrolled-risk-card {
      color: #7a1111;
      border-color: #fecaca;
      border-left-color: #ef4444;
      background: #fff1f2;
    }

    .compact-list .item-number {
      display: inline-block;
      min-width: 26px;
      margin-right: 6px;
      color: inherit;
      font-weight: 900;
    }

    .risk-register-heat-note {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin: 10px 12px 0;
      padding: 9px 10px;
      border: 1px solid #c7d7fe;
      border-radius: 6px;
      background: #eef4ff;
      color: var(--navy);
      font-weight: 800;
    }

    .risk-register-heat-note button {
      border: 1px solid #c7d7fe;
      border-radius: 6px;
      background: #fff;
      color: var(--navy);
      font-weight: 800;
      padding: 5px 9px;
      cursor: pointer;
    }

    .risk-entry-ratings {
      grid-column: 1 / -1;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 14px;
    }

    .risk-entry-card {
      border: 1px solid var(--line);
      border-radius: 8px;
      overflow: hidden;
      background: #fff;
    }

    .risk-entry-card h3 {
      margin: 0;
      padding: 10px 12px;
      background: var(--navy);
      color: #fff;
      font-size: 14px;
    }

    .risk-entry-card .rating-controls {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 130px;
      gap: 10px;
      align-items: end;
      padding: 12px;
    }

    .rating-input {
      display: grid;
      gap: 6px;
    }

    .rating-input label {
      background: transparent;
      color: var(--muted);
      padding: 0;
      font-size: 12px;
      text-transform: uppercase;
    }

    .rating-input select {
      min-height: 42px;
      border: 1px solid var(--line);
      border-radius: 6px;
      padding: 8px 10px;
      background: #fff;
      font-weight: 700;
    }

    .risk-entry-card .risk-score {
      border-radius: 6px;
      min-height: 58px;
    }

    .verification-run-table th:nth-child(1),
    .verification-run-table th:nth-child(2) {
      width: 25%;
    }

    .verification-run-table th:nth-child(3) {
      width: 12%;
    }

    .verification-run-table th:nth-child(4) {
      width: 18%;
    }

    .verification-run-table textarea {
      width: 100%;
      min-height: 86px;
      border: 1px solid var(--line);
      border-radius: 6px;
      padding: 10px;
      resize: vertical;
      font: inherit;
    }

    .attachment-name {
      display: block;
      margin-top: 6px;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.3;
      word-break: break-word;
    }

    .verification-run-table select {
      width: 100%;
      min-height: 40px;
      font-weight: 800;
      text-align: center;
      text-align-last: center;
    }

    .verification-readonly input,
    .verification-readonly select,
    .verification-readonly textarea {
      background: #f8fafc;
      color: #111827;
      pointer-events: none;
    }

    .pill {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 44px;
      border-radius: 999px;
      background: var(--yellow);
      color: #111827;
      padding: 5px 10px;
      font-weight: 800;
    }

    .edit-bowtie,
    .delete-bowtie {
      border: 1px solid #f0c8c8;
      background: #fff5f5;
      color: #b42318;
      border-radius: 6px;
      padding: 7px 10px;
      font-size: 13px;
      font-weight: 800;
      cursor: pointer;
    }

    .edit-bowtie {
      border-color: #c7d7fe;
      background: #eef4ff;
      color: var(--navy);
      margin-right: 6px;
    }

    .edit-bowtie:hover {
      background: #dbeafe;
      border-color: #9db7fb;
    }

    .delete-bowtie:hover {
      background: #ffe3e3;
      border-color: #f5a9a9;
    }

    .shell {
      background: #fbfac8;
      border: 1px solid #d8d69c;
      border-radius: 8px;
      padding: 22px;
      box-shadow: var(--shadow);
    }

    .meta-grid {
      display: grid;
      grid-template-columns: 1fr 1.3fr 330px;
      gap: 18px;
      align-items: stretch;
      margin-bottom: 22px;
    }

    .panel {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 8px;
      overflow: hidden;
    }

    .fields {
      display: grid;
    }

    .field-row {
      display: grid;
      grid-template-columns: 140px 1fr;
      min-height: 45px;
      border-bottom: 1px solid var(--line);
    }

    .field-row:last-child {
      border-bottom: 0;
    }

    label,
    .label {
      background: var(--slate);
      color: #fff;
      font-weight: 700;
      padding: 12px;
      display: flex;
      align-items: center;
    }

    input,
    textarea,
    select {
      width: 100%;
      border: 0;
      background: #fff;
      color: var(--ink);
      padding: 11px 12px;
      outline: 0;
    }

    textarea {
      resize: vertical;
      min-height: 78px;
    }

    .status-strip {
      display: grid;
      grid-template-columns: 1fr;
      gap: 12px;
      height: 100%;
    }

    .metric {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
      padding: 14px;
    }

    .metric span {
      color: var(--muted);
      font-size: 12px;
      font-weight: 700;
      text-transform: uppercase;
    }

    .metric strong {
      display: block;
      margin-top: 8px;
      font-size: 22px;
    }

    .metric.danger strong {
      color: #d8130d;
    }

    .bowtie {
      display: grid;
      grid-template-columns:
        minmax(360px, 1.65fr)
        minmax(120px, .42fr)
        minmax(280px, .86fr)
        minmax(120px, .42fr)
        minmax(360px, 1.65fr);
      gap: 0;
      align-items: stretch;
      min-height: 590px;
      margin-bottom: 22px;
    }

    .bowtie-side {
      display: grid;
      grid-template-rows: minmax(260px, auto) auto;
      gap: 14px;
      align-self: stretch;
    }

    .list-card {
      background: #fff;
      border: 1px solid var(--line);
      border-radius: 8px;
      overflow: hidden;
      display: grid;
      grid-template-rows: auto 1fr;
    }

    .section-title {
      background: var(--navy);
      color: #fff;
      text-align: center;
      font-weight: 800;
      padding: 10px;
      letter-spacing: 0;
    }

    .list-card-header {
      background: var(--navy);
      color: #fff;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 8px 10px;
    }

    .list-card-header-actions {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .list-card-header .section-title {
      background: transparent;
      padding: 0;
      flex: 1;
    }

    .add-item {
      border: 1px solid rgba(255, 255, 255, .45);
      background: rgba(255, 255, 255, .12);
      color: #fff;
      border-radius: 6px;
      width: 34px;
      height: 30px;
      display: grid;
      place-items: center;
      font-size: 20px;
      font-weight: 800;
      line-height: 1;
      cursor: pointer;
    }

    .group-item {
      border: 1px solid rgba(255, 255, 255, .45);
      background: rgba(255, 255, 255, .12);
      color: #fff;
      border-radius: 6px;
      min-height: 30px;
      padding: 4px 10px;
      font-weight: 800;
      cursor: pointer;
    }

    .item-group-card,
    .cause-group-card {
      border: 1px solid #9db8da;
      border-radius: 8px;
      background: #eef6ff;
      overflow: hidden;
      display: grid;
      gap: 0;
    }

    .item-group-title,
    .cause-group-title {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 8px 10px;
      background: #dbeafe;
      color: #0a3764;
      font-weight: 900;
    }

    .item-group-actions {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .ungroup-item {
      border: 1px solid #9db8da;
      background: #fff;
      color: #0a3764;
      border-radius: 6px;
      min-height: 28px;
      padding: 4px 9px;
      font-size: 12px;
      font-weight: 900;
      cursor: pointer;
    }

    .item-group-body,
    .cause-group-body {
      display: grid;
      gap: 8px;
      padding: 10px;
    }

    .item-list.group-select-mode {
      outline: 3px solid #2563eb;
      outline-offset: -3px;
      background: #eff6ff;
    }

    .item-list.group-select-mode .item {
      cursor: pointer;
      border-radius: 8px;
    }

    .item-list.group-select-mode .item textarea {
      pointer-events: none;
    }

    .item.group-selected {
      background: #dbeafe;
      box-shadow: inset 0 0 0 3px #2563eb;
      border-radius: 8px;
      padding: 4px;
    }

    .group-item.active {
      background: #fff;
      color: var(--navy);
    }

    .add-item:hover {
      background: rgba(255, 255, 255, .22);
    }

    .item-list {
      padding: 14px;
      display: grid;
      align-content: start;
      gap: 10px;
    }

    .item {
      display: grid;
      grid-template-columns: 46px 1fr 34px;
      gap: 10px;
      align-items: start;
    }

    .tag {
      background: #eef2f7;
      border: 1px solid var(--line);
      border-radius: 6px;
      padding: 8px 6px;
      text-align: center;
      font-weight: 800;
      color: var(--navy);
    }

    .tag.uncontrolled {
      background: #ff221c;
      border-color: #d8130d;
      color: #fff;
    }

    .item textarea {
      border: 1px solid var(--line);
      border-radius: 6px;
      min-height: 54px;
    }

    .delete-item {
      border: 1px solid #f0c8c8;
      background: #fff5f5;
      color: #b42318;
      border-radius: 6px;
      width: 34px;
      height: 34px;
      display: grid;
      place-items: center;
      font-size: 20px;
      font-weight: 800;
      line-height: 1;
      cursor: pointer;
    }

    .delete-item:hover {
      background: #ffe3e3;
      border-color: #f5a9a9;
    }

    .barrier {
      height: 300px;
      align-self: center;
      background: var(--slate);
      color: #fff;
      display: flex;
      align-items: center;
      justify-content: flex-start;
      padding: 24px 86px 24px 44px;
      text-align: center;
      font-weight: 800;
      line-height: 1.25;
      position: relative;
      clip-path: polygon(0 0, 100% 50%, 0 100%);
    }

    .barrier.right {
      justify-content: flex-end;
      padding: 24px 44px 24px 86px;
      clip-path: polygon(100% 0, 0 50%, 100% 100%);
    }

    .event-stack {
      display: grid;
      gap: 16px;
      padding: 0;
      align-self: center;
    }

    .event-card {
      background: #fff;
      border: 1px solid var(--line);
      border-radius: 8px;
      overflow: hidden;
    }

    .event-body {
      padding: 14px;
    }

    .rating-table {
      background: #fff;
      border: 1px solid var(--line);
      border-radius: 8px;
      overflow: hidden;
    }

    .rating-title {
      padding: 10px 12px;
      font-weight: 800;
      border-bottom: 1px solid var(--line);
    }

    .rating-row {
      display: grid;
      grid-template-columns: minmax(180px, 1.1fr) minmax(210px, 1fr);
      min-height: max-content;
      border-bottom: 1px solid var(--line);
    }

    .rating-row:last-child {
      border-bottom: 0;
    }

    .rating-row .label {
      background: #c8c8c8;
      color: #101828;
    }

    .rating-row select,
    .rating-row input {
      text-align: center;
      font-weight: 800;
      white-space: normal;
      line-height: 1.2;
      min-height: 64px;
      height: auto;
      padding: 10px 28px 10px 12px;
    }

    .rating-row .high {
      background: var(--red);
      color: #000;
    }

    .risk-green {
      background: #00b050 !important;
      color: #000 !important;
    }

    .risk-blue {
      background: #0070c0 !important;
      color: #000 !important;
    }

    .risk-yellow {
      background: #ffff00 !important;
      color: #000 !important;
    }

    .risk-red {
      background: #ff221c !important;
      color: #000 !important;
    }

    .risk-score {
      display: grid;
      place-items: center;
      font-weight: 800;
      min-height: 64px;
      padding: 10px;
    }

    .controls-grid {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      gap: 18px;
      margin-bottom: 22px;
    }

    .control-table {
      background: #fff;
      border: 1px solid var(--line);
      border-radius: 8px;
      overflow: visible;
    }

    .control-table.prevent .control-head {
      background: var(--green);
    }

    .control-table.mitigate .control-head {
      background: var(--orange);
    }

    .control-head,
    .control-row {
      display: grid;
      grid-template-columns: 52px minmax(560px, 1.35fr) 112px 150px 74px 150px 46px;
      border-bottom: 1px solid var(--line);
    }

    .control-head {
      color: #111827;
      font-weight: 800;
      text-align: center;
      line-height: 1.18;
    }

    .control-head > div,
    .control-row > div {
      border-right: 1px solid var(--line);
      min-height: 52px;
      display: grid;
      align-items: stretch;
    }

    .control-head > div:last-child,
    .control-row > div:last-child {
      border-right: 0;
    }

    .control-head > div {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
      padding: 10px 8px;
      overflow-wrap: anywhere;
    }

    .control-head > div:last-child,
    .control-action {
      align-items: center;
      justify-items: center;
    }

    .control-row textarea,
    .control-row input,
    .control-row select {
      height: 100%;
      border-radius: 0;
    }

    .control-row textarea {
      font-size: 14px;
      line-height: 1.25;
    }

    .control-effectiveness {
      font-weight: 800;
      text-align: center;
      text-align-last: center;
    }

    .control-effectiveness.excellent,
    .control-effectiveness option[value="Excellent"] {
      background: #00b050;
      color: #000;
    }

    .control-effectiveness.very-good,
    .control-effectiveness option[value="Very Good"] {
      background: #92d050;
      color: #000;
    }

    .control-effectiveness.good,
    .control-effectiveness option[value="Good"] {
      background: #ffff00;
      color: #000;
    }

    .control-effectiveness.poor,
    .control-effectiveness option[value="Poor"] {
      background: #ffc000;
      color: #000;
    }

    .control-effectiveness.very-poor,
    .control-effectiveness option[value="Very Poor"] {
      background: #ff0000;
      color: #000;
    }

    .control-effectiveness option[value=""] {
      background: #fff;
      color: #000;
    }

    .control-description {
      min-height: 64px;
      max-height: 132px;
      overflow: auto;
      resize: vertical;
      white-space: normal;
      overflow-wrap: anywhere;
    }

    .control-owner {
      min-height: 64px;
      max-height: 132px;
      overflow: auto;
      resize: vertical;
      white-space: normal;
      overflow-wrap: anywhere;
    }

    select.control-owner,
    select.register-control-owner {
      min-height: 42px;
      height: 42px;
      resize: none;
      overflow: hidden;
      white-space: normal;
      font-weight: 700;
    }

    .control-row.critical-row .control-description,
    .register-row.critical-row textarea:first-of-type {
      font-weight: 800;
    }

    .control-id-button {
      width: 100%;
      height: 100%;
      border: 0;
      background: #fff;
      color: var(--navy);
      font-weight: 800;
      cursor: pointer;
    }

    .control-id-button:hover {
      background: #eef4ff;
      text-decoration: underline;
    }

    .control-row .link-options,
    .register-row .link-options {
      min-height: 52px;
      padding: 6px;
      position: relative;
      background: #fff;
    }

    .link-picker-toggle {
      width: 100%;
      min-height: 36px;
      border: 1px solid var(--line);
      background: #f8fafc;
      color: var(--ink);
      border-radius: 6px;
      padding: 7px 8px;
      text-align: left;
      font-size: 13px;
      font-weight: 800;
      cursor: pointer;
    }

    .link-options.open .link-menu {
      display: grid;
    }

    .link-options.open-up .link-menu {
      top: auto;
      bottom: 46px;
    }

    .link-menu {
      display: none;
      position: absolute;
      z-index: 20;
      top: 46px;
      left: 6px;
      right: 6px;
      max-height: 180px;
      overflow: auto;
      gap: 6px;
      padding: 8px;
      background: #fff;
      border: 1px solid var(--line);
      border-radius: 6px;
      box-shadow: 0 12px 28px rgba(19, 34, 56, .16);
    }

    .link-option {
      display: flex;
      align-items: center;
      gap: 6px;
      color: var(--ink);
      background: transparent;
      padding: 0;
      font-size: 13px;
      font-weight: 700;
    }

    .link-option input {
      width: 16px;
      height: 16px;
      padding: 0;
    }

    .control-action {
      display: grid;
      place-items: center;
      height: 100%;
      padding: 0;
    }

    .critical-control {
      display: grid;
      place-items: center;
    }

    .critical-control input {
      width: 18px;
      height: 18px;
      padding: 0;
    }

    .add-control,
    .delete-control {
      border-radius: 6px;
      width: 32px;
      height: 32px;
      display: grid;
      place-items: center;
      font-size: 20px;
      font-weight: 800;
      line-height: 1;
      cursor: pointer;
      align-self: center;
      justify-self: center;
    }

    .add-control {
      border: 1px solid rgba(17, 24, 39, .28);
      background: rgba(255, 255, 255, .35);
      color: #111827;
    }

    .add-control:hover {
      background: rgba(255, 255, 255, .58);
    }

    .delete-control {
      border: 1px solid #f0c8c8;
      background: #fff5f5;
      color: #b42318;
      font-size: 18px;
    }

    .delete-control:hover {
      background: #ffe3e3;
      border-color: #f5a9a9;
    }

    .footer-grid {
      display: grid;
      grid-template-columns: minmax(320px, 1fr) minmax(500px, 540px) minmax(320px, 1fr);
      gap: 18px;
      align-items: start;
    }

    .footer-grid > .panel.fields {
      width: 360px;
      justify-self: end;
    }

    .reference-shell {
      display: grid;
      gap: 18px;
    }

    .reference-shell.view-panel {
      display: none;
    }

    .reference-shell.view-panel.active {
      display: grid;
    }

    .reference-shell.reference-readonly input,
    .reference-shell.reference-readonly select,
    .reference-shell.reference-readonly textarea {
      background: #f8fafc;
      color: #111827;
      pointer-events: none;
    }

    .reference-shell.reference-readonly .add-reference-item,
    .reference-shell.reference-readonly .delete-reference-item {
      display: none;
    }

    .shell.bowtie-readonly input,
    .shell.bowtie-readonly select,
    .shell.bowtie-readonly textarea {
      background: #f8fafc;
      color: #4b5563;
      pointer-events: none;
    }

    .shell.bowtie-readonly .add-item,
    .shell.bowtie-readonly .group-item,
    .shell.bowtie-readonly .delete-item,
    .shell.bowtie-readonly .add-control,
    .shell.bowtie-readonly .delete-control {
      display: none;
    }

    .reference-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 18px;
    }

    .reference-card {
      background: #fff;
      border: 1px solid var(--line);
      border-radius: 8px;
      overflow: hidden;
      box-shadow: var(--shadow);
    }

    .reference-card.wide {
      grid-column: 1 / -1;
    }

    .reference-card h2 {
      margin: 0;
      padding: 12px 14px;
      background: var(--navy);
      color: #fff;
      font-size: 17px;
      line-height: 1.2;
    }

    .reference-body {
      padding: 18px;
      display: grid;
      gap: 16px;
    }

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

    .reference-field {
      display: grid;
      gap: 6px;
    }

    .reference-field.full {
      grid-column: 1 / -1;
    }

    .reference-field label {
      background: transparent;
      color: var(--muted);
      padding: 0;
      font-size: 12px;
      text-transform: uppercase;
    }

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

    .reference-field textarea {
      min-height: 110px;
    }

    .reference-item-section {
      display: grid;
      gap: 12px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #f8fafc;
      padding: 14px;
      margin-bottom: 14px;
      box-shadow: inset 4px 0 0 #dbe7f6;
    }

    .reference-item-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding-bottom: 8px;
      border-bottom: 1px solid #e6edf7;
    }

    .reference-item-header span {
      color: var(--muted);
      font-size: 12px;
      font-weight: 700;
      text-transform: uppercase;
    }

    .reference-shell.effectiveness-only .reference-card:not(.reference-effectiveness-card) {
      display: none;
    }

    .reference-shell.effectiveness-only .reference-grid {
      grid-template-columns: 1fr;
    }

    .reference-shell:not(.effectiveness-only) .reference-effectiveness-card {
      display: none;
    }

    .help-tip {
      display: inline-grid;
      place-items: center;
      width: 17px;
      height: 17px;
      margin-left: 6px;
      border: 1px solid #9fb3ce;
      border-radius: 999px;
      background: #eef4ff;
      color: var(--navy);
      font-size: 11px;
      font-weight: 900;
      cursor: help;
      vertical-align: middle;
    }

    .settings-list {
      display: grid;
      gap: 8px;
    }

    .settings-list-item {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto auto;
      gap: 8px;
      align-items: center;
      padding: 10px 12px;
      border: 1px solid var(--line);
      border-radius: 6px;
      background: #fff;
    }

    .settings-list-item strong {
      line-height: 1.35;
      overflow-wrap: anywhere;
    }

    .feedback-form {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 10px;
      align-items: end;
      background: #f8fbff;
      border: 1px solid #c7d7fe;
      border-radius: 8px;
      padding: 12px;
    }

    .feedback-form textarea {
      min-height: 96px;
      border: 1px solid #bfd0ea;
      background: #fff;
    }

    .feedback-card {
      border: 1px solid #bfdbfe;
      border-radius: 8px;
      background: #eff6ff;
      padding: 12px;
      display: grid;
      gap: 6px;
    }

    .feedback-meta {
      color: #16406f;
      font-size: 12px;
      font-weight: 700;
    }

    .add-reference-item {
      border: 1px solid var(--line);
      background: #eef4ff;
      color: var(--navy);
      border-radius: 6px;
      width: 32px;
      height: 30px;
      font-weight: 800;
      cursor: pointer;
    }

    .reference-item-list {
      display: grid;
      gap: 8px;
    }

    .reference-item {
      display: grid;
      grid-template-columns: 1fr 34px;
      gap: 8px;
      align-items: center;
    }

    .reference-item textarea {
      min-height: 72px;
      border: 1px solid var(--line);
      border-radius: 6px;
    }

    .delete-reference-item {
      border: 1px solid #f0c8c8;
      background: #fff5f5;
      color: #b42318;
      border-radius: 6px;
      align-self: center;
      width: 34px;
      height: 34px;
      font-size: 18px;
      font-weight: 800;
      cursor: pointer;
    }

    .verification-items {
      display: grid;
      gap: 10px;
    }

    .verification-item {
      display: grid;
      grid-template-columns: 1fr 1fr 34px;
      gap: 8px;
      align-items: center;
    }

    .verification-item textarea {
      min-height: 82px;
      border: 1px solid var(--line);
      border-radius: 6px;
    }

    .reference-table {
      width: 100%;
      border-collapse: collapse;
      table-layout: fixed;
    }

    .reference-table th,
    .reference-table td {
      border: 1px solid var(--line);
      padding: 8px;
      vertical-align: top;
    }

    .reference-table th {
      background: #0f2e4d;
      color: #fff;
      font-size: 12px;
      text-transform: uppercase;
    }

    .reference-table textarea {
      min-height: 66px;
      border: 0;
      padding: 0;
    }

    .score-box {
      display: grid;
      grid-template-columns: 220px 1fr;
      border: 1px solid var(--line);
      border-radius: 8px;
      overflow: hidden;
      background: #fff;
    }

    .score-box strong {
      background: var(--navy);
      color: #fff;
      padding: 12px;
    }

    .score-box select {
      font-weight: 800;
      border-left: 1px solid var(--line);
    }

    .assessment {
      display: grid;
      grid-template-columns: 1.35fr 1fr;
      max-width: 720px;
      border: 1px solid var(--line);
      border-radius: 8px;
      overflow: hidden;
      background: #fff;
      margin-top: 92px;
    }

    .entry-assessment {
      width: min(720px, 100%);
      margin-top: 10px;
    }

    .assessment div {
      padding: 14px;
      font-weight: 800;
      text-align: center;
    }

    .assessment div:first-child {
      background: var(--slate);
      color: #fff;
    }

    .assessment select {
      width: 100%;
      height: 100%;
      min-height: 50px;
      border: 0;
      border-radius: 0;
      color: #000;
      font-weight: 800;
      text-align: center;
      text-align-last: center;
    }

    .assessment select.well-controlled {
      background: #00b050;
    }

    .assessment option[value="well-controlled"] {
      background: #00b050;
      color: #000;
    }

    .assessment select.improvement-required {
      background: #ffff00;
    }

    .assessment option[value="improvement-required"] {
      background: #ffff00;
      color: #000;
    }

    .assessment select.control-gap {
      background: #ff221c;
    }

    .assessment option[value="control-gap"] {
      background: #ff221c;
      color: #000;
    }

    .assessment select.limited-influence {
      background: #d9d9d9;
    }

    .assessment option[value="limited-influence"] {
      background: #d9d9d9;
      color: #000;
    }

    .rca-entry-row {
      max-width: 720px;
    }

    .rca-select {
      width: 100%;
      min-height: 46px;
      border: 1px solid var(--line);
      border-radius: 8px;
      color: #000;
      font-weight: 800;
      text-align: center;
      text-align-last: center;
    }

    .rca-select.well-controlled {
      background: #00b050;
    }

    .rca-select option[value="well-controlled"] {
      background: #00b050;
      color: #000;
    }

    .rca-select.improvement-required {
      background: #ffff00;
    }

    .rca-select option[value="improvement-required"] {
      background: #ffff00;
      color: #000;
    }

    .rca-select.control-gap {
      background: #ff221c;
    }

    .rca-select option[value="control-gap"] {
      background: #ff221c;
      color: #000;
    }

    .rca-select.limited-influence {
      background: #d9d9d9;
    }

    .rca-select option[value="limited-influence"] {
      background: #d9d9d9;
      color: #000;
    }

    .residual {
      border: 1px solid var(--line);
      border-radius: 8px;
      overflow: hidden;
      background: #fff;
      min-width: 430px;
      justify-self: center;
    }

    .residual-row {
      display: grid;
      grid-template-columns: minmax(230px, 1.2fr) minmax(180px, .8fr);
      min-height: max-content;
      border-bottom: 1px solid var(--line);
    }

    .residual-row:last-child {
      border-bottom: 0;
    }

    .residual-row div {
      padding: 11px;
      text-align: center;
      font-weight: 800;
      border-right: 1px solid var(--line);
    }

    .residual-row div:last-child {
      border-right: 0;
    }

    .residual-row .label {
      justify-content: center;
    }

    .residual-row .gold {
      background: var(--gold);
    }

    .residual-row .yellow {
      background: var(--yellow);
    }

    .residual-row select {
      height: auto;
      text-align: center;
      text-align-last: center;
      font-weight: 800;
      border-radius: 0;
      white-space: normal;
      line-height: 1.2;
      min-height: 64px;
      padding: 10px 28px 10px 12px;
    }

    .residual-note {
      display: grid;
      grid-template-columns: .58fr 1.2fr;
      border-top: 1px solid var(--line);
    }

    .residual-note textarea {
      min-height: 150px;
      text-align: center;
      border: 1px solid var(--line);
    }

    .residual-note textarea:first-child {
      resize: none;
      overflow: hidden;
      line-height: 1.25;
      border-left: 0;
      border-top: 0;
      border-bottom: 0;
      border-right: 1px solid var(--line);
    }

    .residual-note textarea:last-child {
      border-top: 0;
      border-right: 0;
      border-bottom: 0;
      border-left: 0;
    }

    @media (max-width: 1300px) {
      body {
        min-width: 1000px;
      }

      .app {
        grid-template-columns: 220px 1fr;
      }

      .bowtie {
        grid-template-columns: minmax(320px, 1.3fr) minmax(100px, .38fr) minmax(260px, .82fr) minmax(100px, .38fr) minmax(320px, 1.3fr);
      }

      .barrier {
        height: 180px;
        font-size: 14px;
      }
    }
  
    .item .delete-item {
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
    }

    .action-link {
      border: 0;
      background: transparent;
      color: var(--navy);
      cursor: pointer;
      padding: 0;
      text-align: left;
      text-decoration: underline;
      font: inherit;
    }

    .action-access-note {
      margin: 0;
      padding: 10px 12px;
      border: 1px solid #d9dee8;
      border-radius: 6px;
      background: #f8fafc;
      color: #667085;
      font-weight: 700;
    }

    .action-access-note.allowed {
      border-color: #bbf7d0;
      background: #f0fdf4;
      color: #067647;
    }
