/* Runtime detail — extends shared policy-packs / policy-detail-view patterns */
.policy-detail-view.runtime-detail-view .pack-detail-header {
  flex-shrink: 0;
}
.policy-detail-view.runtime-detail-view .runtime-summary-panel {
  padding: 16px 18px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.policy-detail-view.runtime-detail-view .runtime-summary-label {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.policy-detail-view.runtime-detail-view .runtime-summary-body {
  margin: 0;
}
.policy-detail-view.runtime-detail-view .runtime-summary-body .markdown-viewer--rich table {
  table-layout: auto;
  width: 100%;
}
.policy-detail-view.runtime-detail-view .runtime-summary-body .markdown-viewer--rich th,
.policy-detail-view.runtime-detail-view .runtime-summary-body .markdown-viewer--rich td {
  overflow: visible;
  word-break: normal;
  white-space: normal;
  text-align: left;
  vertical-align: top;
  text-transform: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: normal;
}
.policy-detail-view.runtime-detail-view .runtime-summary-body .markdown-viewer--rich td {
  font-weight: 400;
  font-size: 14px;
}
.policy-detail-view.runtime-detail-view .runtime-summary-body .markdown-viewer--rich th:last-child,
.policy-detail-view.runtime-detail-view .runtime-summary-body .markdown-viewer--rich td:last-child {
  min-width: 0;
  text-align: left;
}
.policy-detail-view.runtime-detail-view .runtime-summary-empty {
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.policy-detail-view.runtime-detail-view .decisions-focus {
  flex: 1;
  min-height: 0;
}
.policy-detail-view.runtime-detail-view .runtime-decision-filters-bar {
  flex-shrink: 0;
  overflow: visible;
}

.policy-detail-view.runtime-detail-view .runtime-decision-filters-bar .tier-nav {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  flex: 1 1 100%;
  min-width: 0;
}

.policy-detail-view.runtime-detail-view .runtime-decision-filters-bar .tier-nav-item {
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
  padding: 0 10px;
  font-size: 12.5px;
}

.policy-detail-view.runtime-detail-view .runtime-decision-filters-bar .tier-nav-count {
  font-size: 9.5px;
  padding: 1px 5px;
}

.policy-detail-view.runtime-detail-view .tier-nav-count--applied {
  color: #2d6b3a;
  background: #e8f3eb;
}
.policy-detail-view.runtime-detail-view .tier-nav-count--missed {
  color: #9a5b14;
  background: #faf0df;
}
.policy-detail-view.runtime-detail-view .tier-nav-count--not-logged {
  color: #8b3a3a;
  background: #faecec;
}
.policy-detail-view.runtime-detail-view .tier-nav-count--summary {
  color: #2d4f7a;
  background: #e8f0fa;
}
.policy-detail-view.runtime-detail-view .tier-nav-count--empty {
  color: var(--muted);
}
.policy-detail-view.runtime-detail-view .topics-toolbar .section-label {
  margin: 0 0 10px;
  padding-left: 2px;
}
.policy-detail-view.runtime-detail-view .runtime-decisions-table,
.policy-detail-view.runtime-detail-view .runtime-recommendations-table {
  width: 100%;
  table-layout: fixed;
}
.policy-detail-view.runtime-detail-view .runtime-decisions-table th,
.policy-detail-view.runtime-detail-view .runtime-decisions-table td,
.policy-detail-view.runtime-detail-view .runtime-recommendations-table th,
.policy-detail-view.runtime-detail-view .runtime-recommendations-table td {
  text-align: left;
  vertical-align: top;
  overflow: visible;
  word-break: break-word;
}
.policy-detail-view.runtime-detail-view .runtime-decisions-table th,
.policy-detail-view.runtime-detail-view .runtime-recommendations-table th {
  font-size: var(--th-size);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--th-color);
  font-weight: var(--th-weight);
  white-space: nowrap;
}
.policy-detail-view.runtime-detail-view .insights-reco-title {
  color: var(--td-color);
  font-weight: 400;
}
.policy-detail-view.runtime-detail-view .runtime-note {
  color: var(--td-secondary-color);
  font-size: inherit;
  line-height: var(--lh-table);
  white-space: normal;
  word-break: break-word;
  display: block;
}
.policy-detail-view.runtime-detail-view .runtime-decisions-table th:first-child,
.policy-detail-view.runtime-detail-view .runtime-decisions-table td:first-child,
.policy-detail-view.runtime-detail-view .runtime-recommendations-table th:first-child,
.policy-detail-view.runtime-detail-view .runtime-recommendations-table td:first-child {
  width: 34%;
  min-width: 180px;
}
.policy-detail-view.runtime-detail-view .runtime-decisions-table .col-result,
.policy-detail-view.runtime-detail-view .runtime-recommendations-table .col-result {
  width: 112px;
  min-width: 112px;
  max-width: 112px;
  white-space: nowrap;
}
.policy-detail-view.runtime-detail-view .runtime-topic-row .section-label {
  margin: 0;
}
.policy-detail-view.runtime-detail-view .result-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.policy-detail-view.runtime-detail-view .result-pill--applied {
  background: #edf7ef;
  border: 1px solid #b8d4be;
  color: #2d6b3a;
}
.policy-detail-view.runtime-detail-view .result-pill--not-applied {
  background: #fff8ed;
  border: 1px solid #e8d4a8;
  color: #9a5b14;
}
.policy-detail-view.runtime-detail-view .result-pill--not-logged {
  background: #fdf0f0;
  border: 1px solid #e8b8b8;
  color: #8b3a3a;
}
.policy-detail-view.runtime-detail-view .runtime-source {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}
.policy-detail-view.runtime-detail-view .runtime-note-cell {
  width: auto;
  min-width: 0;
}
/* Runtime list — filter toolbar uses shared .filter-panel in style.css */
.runtime-list-page .runtime-filters .filter-panel__row {
  flex-wrap: nowrap;
  gap: 10px;
}

.runtime-list-page .runtime-filters .filter-field--date {
  flex: 0 0 136px;
  width: 136px;
}

.runtime-list-page .runtime-filters .filter-field--project {
  flex: 0 0 156px;
  width: 156px;
}

.runtime-list-page .runtime-filters .filter-field--actor {
  flex: 1 1 150px;
  min-width: 140px;
  max-width: 200px;
}

.runtime-list-page .runtime-filters .filter-field--search {
  flex: 1 1 160px;
  min-width: 140px;
  max-width: 220px;
}

.runtime-list-page .runtime-filters .filter-panel__actions {
  margin-left: auto;
  flex-shrink: 0;
}

.runtime-list-page .runtime-date-input {
  color: var(--subtle);
}

.runtime-list-page .page-head-lead strong {
  color: var(--text);
  font-weight: 500;
}

/* Policy column — match policy packs list table */
.runtime-list-page .runtime-policy-name,
.runtime-list-page .policy-list-table .list-policy-name {
  font-size: inherit;
  font-weight: 500;
  color: var(--text);
  line-height: var(--lh-table);
  letter-spacing: -0.01em;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Policy filter — readable width, aligned with table */
.runtime-list-page .runtime-pack-filter {
  width: min(380px, 100%);
  min-width: 280px;
  min-height: 38px;
  padding: 8px 36px 8px 12px;
  font-family: var(--type-sans, var(--sans));
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--panel);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236f6e68' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  border-radius: 10px;
}

.runtime-list-page .runtime-pack-filter option {
  font-family: var(--type-sans, var(--sans));
  font-size: 14px;
  font-weight: 400;
}

.policy-packs-page .sessions-panel {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}
.policy-packs-page .sessions-panel[hidden] {
  display: none !important;
}

/* Runtime sessions list — keep columns readable inside resizable layout */
.policy-packs-page .sessions-panel .resizable-table th,
.policy-packs-page .sessions-panel .resizable-table td {
  padding: 10px 14px;
}

.policy-packs-page .sessions-panel .resizable-table .list-policy-name {
  font-size: inherit;
  font-weight: 500;
  color: var(--text);
  line-height: var(--lh-table);
  letter-spacing: -0.01em;
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.policy-packs-page .sessions-panel .resizable-table td.list-meta,
.policy-packs-page .sessions-panel .resizable-table td.col-updated,
.policy-packs-page .sessions-panel .resizable-table td.col-num {
  display: table-cell;
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.policy-packs-page .sessions-panel .resizable-table .col-list-actions {
  white-space: nowrap;
}

.runtime-reco-link {
  margin: 0 0 14px;
  padding: 0 2px;
}
.runtime-reco-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  padding: 16px;
  min-width: 0;
}
.runtime-reco-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.runtime-reco-panel-title {
  margin: 0;
  font-size: 15px;
}
.runtime-reco-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.runtime-reco-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.runtime-reco-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
}
.runtime-reco-meta,
.runtime-reco-provenance {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}
.runtime-reco-rationale {
  margin: 0;
  color: var(--subtle);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.runtime-reco-inbox-link {
  margin: 14px 0 0;
  font-size: 14px;
}
.policy-detail-view.runtime-detail-view .runtime-recommendations-table {
  margin: 0;
}
.policy-detail-view.runtime-detail-view .runtime-recommendation-row:hover td {
  background: #faf9f7;
}
.policy-detail-view.runtime-detail-view .runtime-reco-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border);
  background: var(--panel-soft);
}
.policy-detail-view.runtime-detail-view .runtime-reco-table-footer .runtime-reco-nav {
  flex: 1;
  min-width: 0;
}
.policy-detail-view.runtime-detail-view .runtime-reco-table-footer .runtime-reco-actions {
  margin: 0;
  flex-shrink: 0;
}
.runtime-reco-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}
.runtime-reco-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.runtime-reco-stats {
  margin: 14px 0 0;
  font-size: 14px;
}
.runtime-session-context {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 14px;
}
.runtime-session-summary,
.runtime-session-recos {
  min-width: 0;
}
@media (max-width: 960px) {
  .runtime-by-policy-layout,
  .runtime-session-context {
    grid-template-columns: 1fr;
  }
}
