.compare-cell-panel {
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
}

.compare-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.compare-panel header strong {
  color: #0f172a;
  font-size: 14px;
}

.compare-panel p,
.compare-panel small {
  color: #64748b;
}

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

.compare-sheet-list article {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}

.compare-sheet-list strong {
  min-width: 0;
  color: #0f172a;
  font-size: 13px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.compare-sheet-list b {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.compare-sheet-list b.success {
  background: var(--success-soft);
  color: var(--success-hover);
}

.compare-sheet-list b.danger {
  background: #fee2e2;
  color: #dc2626;
}

.compare-table-wrap {
  min-height: 0;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
}

.compare-table-wrap table {
  width: 100%;
  border-collapse: collapse;
}

.compare-table-wrap th,
.compare-table-wrap td {
  padding: 10px 12px;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
  vertical-align: top;
}

.compare-table-wrap th {
  color: #475569;
  font-size: 12px;
  background: #f8fafc;
}

.compare-table-wrap td {
  color: #0f172a;
  font-size: 13px;
}

.compare-table-wrap td b {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
}

.compare-table-wrap td b.success {
  background: var(--success-soft);
  color: var(--success-hover);
}

.compare-table-wrap td b.warning {
  background: #fef3c7;
  color: #d97706;
}

.compare-table-wrap td b.danger {
  background: #fee2e2;
  color: #dc2626;
}

.review-submit-form {
  display: grid;
  gap: 12px;
}

.review-submit-form label {
  display: grid;
  gap: 7px;
}

.review-submit-form label span {
  color: #475569;
  font-size: 12px;
  font-weight: 850;
}

.review-submit-form input,
.review-submit-form select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  font-size: 14px;
}

.review-submit-form input:focus,
.review-submit-form select:focus {
  outline: 0;
  border-color: rgba(var(--theme-primary-rgb), 0.5);
  box-shadow: 0 0 0 3px var(--theme-focus-ring);
}

.review-submit-test-state,
.risk-rule-action-confirm,
.risk-rule-action-note {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.review-submit-test-state span,
.risk-rule-action-confirm span,
.risk-rule-action-note span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.review-submit-test-state strong,
.risk-rule-action-confirm strong {
  color: #b45309;
  font-size: 13px;
  font-weight: 850;
}

.review-submit-test-state strong.passed {
  color: var(--success-hover);
}

.review-submit-test-state p {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.risk-rule-action-note textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  resize: vertical;
  color: #0f172a;
  font-size: 13px;
}

.review-submit-hint {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 1280px) {
  .spreadsheet-editor-body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .rule-drawer,
  .timeline-drawer {
    width: 100%;
  }

  .compare-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .change-detail-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.rule-spreadsheet-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.spreadsheet-mode-pill {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
}

.spreadsheet-upload-input {
  display: none;
}

.spreadsheet-meta-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.spreadsheet-meta-strip span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 750;
}

.spreadsheet-meta-strip strong {
  color: #0f172a;
  font-weight: 850;
}

.rule-spreadsheet-stage {
  position: relative;
  min-height: 720px;
  overflow: hidden;
  border: 1px solid #dbe4ee;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.rule-spreadsheet-host {
  width: 100%;
  height: 100%;
  min-height: 720px;
}

.rule-spreadsheet-host.hidden {
  visibility: hidden;
}

.rule-spreadsheet-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 38%, rgba(224, 242, 254, 0.72), rgba(248, 250, 252, 0) 58%),
    rgba(248, 250, 252, 0.94);
  color: #475569;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.rule-spreadsheet-state > .table-loading {
  width: 100%;
}

.rule-spreadsheet-state i {
  font-size: 22px;
}

.rule-spreadsheet-state.error {
  color: #dc2626;
}

.preview-mode-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(58, 124, 165, 0.22);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(240, 249, 255, 0.96), rgba(224, 242, 254, 0.9));
  color: #075985;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.5;
}

.preview-mode-note i {
  font-size: 16px;
}

.markdown-card .field {
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
}

.markdown-editor {
  min-height: 520px;
  height: 100%;
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre;
}

.markdown-editor.disabled {
  background: #f8fafc;
  color: #475569;
}

.json-template-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.json-template-meta span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 750;
}

.json-template-meta strong {
  color: #0f172a;
  font-weight: 850;
}

.json-editor {
  min-height: 320px;
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre;
}

.json-editor.disabled {
  background: #f8fafc;
  color: #475569;
}

.subtle-banner,
.editor-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.subtle-banner {
  min-height: 38px;
  margin-bottom: 10px;
  padding: 0 12px;
  border: 1px solid #eaf4fa;
  border-radius: 10px;
  background: #f0f9ff;
  color: #255b7d;
  font-size: 12px;
  font-weight: 700;
}

.subtle-banner > .table-loading {
  width: 100%;
}

.rule-drawer-state > .table-loading {
  width: 100%;
}

.editor-foot {
  margin-top: 12px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.skill-review-side {
  align-content: start;
  padding-right: 8px;
}

.review-card {
  position: sticky;
  top: 0;
}

.reviewer-card {
  border-color: rgba(var(--theme-primary-rgb), 0.24);
  background: linear-gradient(180deg, #ffffff, var(--theme-primary-soft));
}

.review-list {
  display: grid;
  gap: 0;
}

.review-row {
  display: grid;
  gap: 6px;
  padding: 12px 0;
  border-top: 1px solid #edf2f7;
}

.review-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.review-row span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.review-row strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.45;
}

.version-list {
  display: grid;
  gap: 0;
}

.version-row {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 10px 12px;
  border-top: 1px solid #edf2f7;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  background: transparent;
  text-align: left;
  transition: background 180ms ease;
}

.version-row:first-child {
  border-top: 0;
}

.version-row:hover {
  border-radius: 10px;
  background: #f8fafc;
}

.version-row.active {
  border-radius: 10px;
  background: var(--theme-primary-soft);
}

.version-main {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.version-row-head {
  display: grid;
  grid-template-columns: minmax(52px, 1fr) 46px 82px;
  align-items: center;
  gap: 8px;
}

.version-row strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 850;
}

.version-row span {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  text-align: right;
}

.version-current-slot {
  min-width: 46px;
  display: grid;
  place-items: center;
  text-align: center;
}

.version-current-slot .current-version {
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success-hover);
  font-size: 11px;
  font-weight: 850;
}

.version-current-slot .current-version.working {
  background: #dbeafe;
  color: #2563eb;
}

.version-row p {
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.version-row-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.version-state {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}

.version-state.success {
  background: var(--success-soft);
  color: var(--success-hover);
}

.version-state.warning {
  background: #fef3c7;
  color: #d97706;
}

.version-state.danger {
  background: #fee2e2;
  color: #dc2626;
}

.version-state.draft {
  background: #e2e8f0;
  color: #475569;
}

.version-state.disabled {
  background: #f1f5f9;
  color: #64748b;
}

.version-restore-btn {
  min-height: 24px;
  padding: 0 9px;
  border: 0;
  border-radius: 999px;
  background: #fff7ed;
  color: #ea580c;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.version-restore-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.empty-side-note {
  min-height: 120px;
  display: grid;
  place-items: center;
  gap: 8px;
  color: #64748b;
  font-size: 13px;
  text-align: center;
}

.empty-side-note i {
  font-size: 24px;
  color: #94a3b8;
}

.version-modal-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.version-modal-summary div {
  padding: 12px;
  border: 1px solid #edf2f7;
  border-radius: 10px;
  background: #f8fafc;
}

.version-modal-summary span,
.version-modal-note span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.version-modal-summary strong,
.version-modal-note strong {
  display: block;
  margin-top: 6px;
  color: #0f172a;
  font-size: 15px;
  font-weight: 850;
}

.version-modal-summary i {
  color: #94a3b8;
  text-align: center;
}

.version-modal-note {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #edf2f7;
  border-radius: 10px;
  background: #fff;
}

.prompt-stack {
  display: grid;
  gap: 14px;
}

.prompt-block {
  padding: 14px;
  border: 1px solid #edf2f7;
  border-radius: 12px;
  background: #fbfdff;
}

.prompt-block header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.prompt-block strong {
  color: #0f172a;
  font-size: 14px;
  font-weight: 850;
}

.prompt-block header span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

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

.contract-panel {
  padding: 14px;
  border: 1px solid #edf2f7;
  border-radius: 12px;
  background: #fbfdff;
}

.contract-panel h4 {
  margin: 0 0 10px;
  color: #0f172a;
  font-size: 14px;
  font-weight: 850;
}

.contract-panel ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: #475569;
  font-size: 13px;
  line-height: 1.6;
}

.test-row,
.tool-row,
.history-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid #edf2f7;
}

.test-row:first-child,
.tool-row:first-child,
.history-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.test-row strong,
.tool-row strong,
.history-row strong {
  display: block;
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
}

.test-row span,
.tool-row span,
.history-row span,
.history-row small {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.test-state,
.tool-state {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.test-state.success,
.tool-state.safe {
  background: var(--success-soft);
  color: var(--success-hover);
}

.test-state.warning,
.tool-state.active {
  background: #fff7ed;
  color: #ea580c;
}

.test-state.danger,
.tool-state.danger {
  background: #fee2e2;
  color: #dc2626;
}

.review-action-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.action-help {
  margin-top: 12px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.6;
}

.tag-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag-list span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
}

.publish-card {
  display: grid;
  gap: 14px;
}

.publish-card p,
.publish-summary span {
  margin-top: 6px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.55;
}

.shared-confirm-card:has(.risk-rule-create-form) {
  width: min(680px, 100%);
}

.risk-rule-create-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.risk-rule-create-form label {
  display: grid;
  gap: 7px;
}

.risk-rule-create-form label.span-2 {
  grid-column: 1 / -1;
}

.risk-rule-create-toggle {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbe5ef;
  border-radius: 10px;
  background: #f8fafc;
}

.risk-rule-create-toggle input {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  accent-color: var(--theme-primary);
}

.risk-rule-create-toggle span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.risk-rule-create-toggle strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 850;
}

.risk-rule-create-toggle small {
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.risk-rule-create-form label span {
  color: #475569;
  font-size: 12px;
  font-weight: 850;
}

.risk-rule-create-form input:not([type='checkbox']),
.risk-rule-create-form select,
.risk-rule-create-form textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font-size: 13px;
}

.risk-rule-create-form input:not([type='checkbox']),
.risk-rule-create-form select {
  min-height: 42px;
  padding: 0 12px;
}

.risk-rule-create-form textarea {
  min-height: 140px;
  resize: vertical;
  padding: 12px;
  line-height: 1.6;
}

.risk-rule-create-form input:not([type='checkbox']):focus,
.risk-rule-create-form select:focus,
.risk-rule-create-form textarea:focus {
  outline: 0;
  border-color: rgba(var(--theme-primary-rgb), 0.5);
  box-shadow: 0 0 0 3px var(--theme-focus-ring);
}

.risk-rule-create-form input:not([type='checkbox'])::placeholder,
.risk-rule-create-form textarea::placeholder {
  color: #94a3b8;
}

.publish-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  background: #f8fafc;
}

.publish-summary strong {
  color: var(--theme-primary-active);
  font-size: 14px;
  font-weight: 850;
}

.detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0 0;
  border-top: 1px solid #e5eaf0;
}

.detail-action-group {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.back-action,
.minor-action,
.major-action {
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 760;
}

.back-action {
  border: 1px solid #d7e0ea;
  background: #fff;
  color: #475569;
}

.minor-action {
  border: 1px solid #d7e0ea;
  background: #fff;
  color: #334155;
}

.minor-action.success-action {
  border-color: rgba(var(--success-rgb), 0.26);
  color: var(--success-hover);
}

.minor-action.primary-action {
  border-color: rgba(37, 99, 235, 0.28);
  color: #1d4ed8;
  background: #f8fbff;
}

.minor-action.enable-action {
  border-color: rgba(100, 116, 139, 0.26);
  color: #64748b;
}

.minor-action.enable-action.is-on {
  border-color: rgba(var(--success-rgb), 0.26);
  color: var(--success-hover);
}

.minor-action.enable-action i {
  font-size: 18px;
}

.risk-level-switch {
  position: relative;
  display: inline-flex;
}

.minor-action.risk-level-action {
  padding-right: 10px;
}

.minor-action.risk-level-action b {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}

.minor-action.risk-level-action.low {
  border-color: rgba(37, 99, 235, 0.22);
  color: #1d4ed8;
}

.minor-action.risk-level-action.low b {
  background: #eff6ff;
  color: #1d4ed8;
}

.minor-action.risk-level-action.medium {
  border-color: rgba(249, 115, 22, 0.26);
  color: #c2410c;
}

.minor-action.risk-level-action.medium b {
  background: #fff7ed;
  color: #c2410c;
}

.minor-action.risk-level-action.high {
  border-color: rgba(220, 38, 38, 0.22);
  color: #b91c1c;
}

.minor-action.risk-level-action.high b {
  background: #fef2f2;
  color: #b91c1c;
}

.risk-level-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 35;
  width: 146px;
  padding: 6px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.16);
}

.risk-level-option {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}

.risk-level-option:hover,
.risk-level-option.active {
  background: #f8fafc;
}

.risk-level-option:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.risk-level-option i {
  margin-left: auto;
  font-size: 15px;
}

.risk-level-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}

.risk-level-option.low .risk-level-dot {
  background: #2563eb;
}

.risk-level-option.medium .risk-level-dot {
  background: #f97316;
}

.risk-level-option.high .risk-level-dot {
  background: #dc2626;
}

.minor-action.danger-action {
  border-color: rgba(220, 38, 38, 0.2);
  color: #dc2626;
}

.major-action {
  border: 1px solid var(--theme-primary);
  background: var(--theme-primary);
  color: #fff;
  box-shadow: 0 4px 12px var(--theme-primary-shadow);
}

.back-action:hover,
.minor-action:hover,
.major-action:hover,
.mini-btn:hover {
  transform: translateY(-1px);
}

.back-action:disabled,
.minor-action:disabled,
.major-action:disabled,
.mini-btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.detail-meta-actions {
  align-items: center;
}

.footer-note {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.mini-btn {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid #d7e0ea;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 13px;
  font-weight: 760;
}

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

.mini-btn.danger {
  border-color: rgba(220, 38, 38, 0.24);
  color: #dc2626;
}

.mini-btn.warning {
  border-color: rgba(245, 158, 11, 0.28);
  color: #b45309;
}

@media (max-width: 1320px) {
  .detail-hero {
    grid-template-columns: 1fr;
  }

  .hero-stats,
  .form-grid,
  .contract-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rule-spreadsheet-stage,
  .rule-spreadsheet-host {
    min-height: 620px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-grid.skill-md-detail-grid {
    grid-template-columns: 1fr;
  }

  .skill-review-side {
    padding-right: 0;
  }

  .review-card {
    position: static;
  }
}

@media (max-width: 860px) {
  .skill-center {
    height: auto;
    min-height: 100%;
  }

  .skill-list,
  .detail-card,
  .side-card,
  .detail-hero {
    padding: 16px;
  }

  .skill-list {
    height: auto;
    min-height: 100%;
    display: block;
    overflow: visible;
  }

  .skill-list .status-tabs {
    flex-wrap: nowrap;
    padding-bottom: 10px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .skill-list .status-tabs button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .list-toolbar,
  .card-head,
  .detail-actions,
  .detail-action-group,
  .toolbar-actions,
  .detail-inline-state {
    flex-direction: column;
    align-items: stretch;
  }

  .status-tabs,
  .filter-set {
    overflow-x: auto;
  }

  .search-filter,
  .picker-trigger,
  .picker-filter,
  .risk-level-switch,
  .risk-level-switch .minor-action,
  .toolbar-actions > * {
    width: 100%;
  }

  .picker-popover {
    width: min(100vw - 64px, 320px);
  }

  .skill-list .table-wrap {
    min-height: 0;
    max-height: none;
    display: block;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .skill-list .table-wrap table,
  .skill-list .table-wrap thead,
  .skill-list .table-wrap tbody,
  .skill-list .table-wrap tr,
  .skill-list .table-wrap th,
  .skill-list .table-wrap td {
    display: block;
  }

  .skill-list .table-wrap table {
    width: 100%;
    min-width: 0;
    border-collapse: separate;
  }

  .skill-list .table-wrap thead {
    display: none;
  }

  .skill-list .table-wrap tbody {
    display: grid;
    gap: 10px;
  }

  .skill-list .table-wrap tr {
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  }

  .skill-list .table-wrap td,
  .audit-asset-table td:first-child,
  .audit-asset-table td:not(:first-child) {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 30px;
    padding: 7px 0;
    border-bottom: 1px dashed #edf2f7;
    color: #273142;
    font-size: 13px;
    line-height: 1.45;
    text-align: left;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .skill-list .table-wrap td:last-child {
    border-bottom: 0;
  }

  .skill-list .table-wrap td::before {
    content: attr(data-label);
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.6;
  }

  .skill-list .table-wrap td:first-child {
    grid-template-columns: 1fr;
    padding-top: 0;
  }

  .skill-list .table-wrap td:first-child::before {
    display: none;
  }

  .skill-name-cell {
    width: 100%;
  }

  .skill-name-cell span:last-child {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .list-foot {
    justify-content: stretch;
  }

  .hero-stats,
  .form-grid,
  .contract-grid {
    grid-template-columns: 1fr;
  }

  .review-action-strip {
    flex-direction: column;
  }

  .version-modal-summary {
    grid-template-columns: 1fr;
  }

  .version-modal-summary i {
    transform: rotate(90deg);
  }

  .json-risk-summary-grid {
    grid-template-columns: 1fr;
  }

  .field.span-2 {
    grid-column: span 1;
  }
}

.json-risk-editor-shell {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  overflow: hidden;
}

.skill-name-cell .skill-list-subtitle {
  display: -webkit-box;
  overflow: hidden;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.json-risk-editor-body {
  flex: 1 1 auto;
  min-height: 0;
  display: block;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 2px 2px 0;
}

.json-risk-generation-failure {
  min-height: 360px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  padding: 44px 24px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: #fffafa;
  text-align: center;
  color: #475569;
}

.json-risk-generation-failure i {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #fef2f2;
  color: #dc2626;
  font-size: 28px;
}

.json-risk-generation-failure h3 {
  margin: 0;
  color: #991b1b;
  font-size: 18px;
  font-weight: 850;
}

.json-risk-generation-failure p {
  max-width: 520px;
  margin: 8px auto 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.7;
}

.json-risk-generation-failure small {
  display: block;
  max-width: 640px;
  margin-top: 12px;
  color: #b91c1c;
  line-height: 1.6;
  word-break: break-word;
}

.json-risk-main-stage {
  min-width: 0;
  min-height: 0;
  display: grid;
  gap: 12px;
  padding-bottom: 2px;
}

.json-risk-summary-card,
.json-risk-flow-card,
.json-risk-description-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

.json-risk-flow-card {
  min-width: 0;
  overflow: hidden;
}

.json-risk-description-text {
  margin: 0;
  padding: 0 4px 8px;
  color: #334155;
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

.json-risk-description-source {
  margin: 0;
  padding: 8px 12px 4px;
  border-top: 1px solid #e2e8f0;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.5;
}

.json-risk-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 36px;
  row-gap: 0;
}

.json-risk-meta-item {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  min-height: 40px;
}

.json-risk-meta-item.full-width {
  grid-column: span 2;
}

.json-risk-meta-label {
  width: 84px;
  flex-shrink: 0;
  color: #64748b;
  font-weight: 500;
}

.json-risk-meta-value {
  color: #0f172a;
  font-weight: 600;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.meta-value-hint {
  color: #64748b;
  font-size: 11.5px;
  font-weight: 400;
  margin-left: 2px;
}

.json-risk-meta-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.json-risk-meta-badge.high {
  background: #fef2f2;
  color: #dc2626;
}

.json-risk-meta-badge.critical {
  background: #fff1f2;
  color: #991b1b;
}

.json-risk-meta-badge.medium {
  background: #fff7ed;
  color: #ea580c;
}

.json-risk-meta-badge.low {
  background: #eff6ff;
  color: #1d4ed8;
}

.json-risk-meta-badge.test-passed {
  background: var(--success-soft);
  color: var(--success-hover);
}

.json-risk-meta-badge.test-pending {
  background: #fff7ed;
  color: #b45309;
}

.meta-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
}

.meta-status-indicator .indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
}

.meta-status-indicator.is-active .indicator-dot {
  background: var(--success);
  box-shadow: 0 0 4px rgba(var(--success-rgb), 0.4);
}

.json-risk-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.json-risk-editor {
  min-height: 280px;
}

.json-risk-version-center {
  min-height: 0;
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
}

.digital-worker-source-card {
  min-height: 0;
}

.digital-worker-source-card .card-head {
  align-items: center;
}

.digital-worker-source-editor {
  width: 100%;
  min-height: 360px;
  resize: vertical;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  padding: 14px 16px;
  background: #0f172a;
  color: #e2e8f0;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.7;
  outline: none;
}

.digital-worker-source-editor:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.digital-worker-source-editor[readonly] {
  color: #cbd5e1;
  background: #1e293b;
  cursor: default;
}

@media (max-width: 760px) {
  .risk-rule-create-form,
  .json-risk-meta-grid {
    grid-template-columns: 1fr;
  }
  .json-risk-meta-item.full-width {
    grid-column: span 1;
  }
}

@media (max-width: 860px) {
  .skill-center :deep(.skill-list .table-wrap) {
    min-height: 0;
    max-height: none;
    display: block;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .skill-center :deep(.skill-list .table-wrap table),
  .skill-center :deep(.skill-list .table-wrap thead),
  .skill-center :deep(.skill-list .table-wrap tbody),
  .skill-center :deep(.skill-list .table-wrap tr),
  .skill-center :deep(.skill-list .table-wrap th),
  .skill-center :deep(.skill-list .table-wrap td) {
    display: block;
  }

  .skill-center :deep(.skill-list .table-wrap table) {
    width: 100%;
    min-width: 0;
    border-collapse: separate;
  }

  .skill-center :deep(.skill-list .table-wrap thead) {
    display: none;
  }

  .skill-center :deep(.skill-list .table-wrap tbody) {
    display: grid;
    gap: 10px;
  }

  .skill-center :deep(.skill-list .table-wrap tr) {
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  }

  .skill-center :deep(.skill-list .table-wrap td) {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 30px;
    padding: 7px 0;
    border-bottom: 1px dashed #edf2f7;
    color: #273142;
    font-size: 13px;
    line-height: 1.45;
    text-align: left;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .skill-center :deep(.skill-list .table-wrap td:last-child) {
    border-bottom: 0;
  }

  .skill-center :deep(.skill-list .table-wrap td::before) {
    content: attr(data-label);
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.6;
  }

  .skill-center :deep(.skill-list .table-wrap td:first-child) {
    grid-template-columns: 1fr;
    padding-top: 0;
  }

  .skill-center :deep(.skill-list .table-wrap td:first-child::before) {
    display: none;
  }

  .skill-center :deep(.skill-name-cell span:last-child) {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}
