/* =========================================================
   Workbench shell foundation
   ========================================================= */
.workbench-body {
  background: linear-gradient(180deg, #f8fbff 0%, #f3f7fc 100%);
}

.workbench-main-shell {
  min-height: 100vh;
  min-height: 100dvh;
}

.workbench-shell {
  width: min(1680px, calc(100% - 24px));
  margin: 0 auto 24px;
  --workbench-workspace-height: clamp(300px, calc(100dvh - 154px), 760px);
}

.workbench-bar {
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(280px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(10px);
}

.workbench-bar__context,
.workbench-bar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.workbench-bar__user {
  justify-content: flex-end;
}

.workbench-brand {
  display: inline-flex;
  text-decoration: none;
}

.workbench-brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #1d4ed8;
  background: linear-gradient(135deg, rgba(37,99,235,0.12), rgba(56,189,248,0.12));
  border: 1px solid rgba(37,99,235,0.16);
}

.workbench-bar__context-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.workbench-user-chip__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.workbench-bar__title {
  color: #0f172a;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workbench-bar__breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workbench-bar__breadcrumb-link {
  color: inherit;
  text-decoration: none;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workbench-bar__breadcrumb-link:hover,
.workbench-bar__breadcrumb-link:focus-visible {
  color: #334155;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.workbench-bar__breadcrumb-separator {
  flex: 0 0 auto;
  color: #94a3b8;
}

.workbench-user-chip__name {
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workbench-bar__modes {
  min-width: 0;
}

.workbench-tabs--inline {
  border-bottom: none;
}

.workbench-tabs--inline .workbench-tabs__inner {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.workbench-tabs--inline .workbench-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #475569;
  font-weight: 700;
  line-height: 1;
  box-shadow: none;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.workbench-tabs--inline .workbench-tab:hover {
  border-color: rgba(37, 99, 235, 0.18);
  background: rgba(37, 99, 235, 0.06);
  color: #0f172a;
}

.workbench-tabs--inline .workbench-tab.active {
  border-color: rgba(37, 99, 235, 0.24);
  background: rgba(37, 99, 235, 0.12);
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.workbench-tabs--inline .workbench-tab__content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.workbench-tabs--inline .workbench-tab__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.95rem;
  height: 0.95rem;
  line-height: 1;
}

.workbench-tabs--inline .workbench-tab__icon svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.workbench-tabs--inline .workbench-tab__label {
  line-height: 1;
}

.workbench-action-button {
  min-height: 38px;
}

.workbench-action-button__content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.workbench-action-button__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.95rem;
  height: 0.95rem;
  line-height: 1;
}

.workbench-action-button__icon svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.workbench-action-button__label {
  line-height: 1;
}


/* =========================================================
   Utility rail result embedding
   ========================================================= */
.workbench-utility-panel .result-details--empty-inline {
  margin-top: 0;
  padding: 2px 0 6px;
  border-top: none;
}

.workbench-utility-panel .result-empty-text {
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.workbench-user-chip {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* =========================================================
   Summary strip
   ========================================================= */
.workbench-summary-strip {
  margin-top: 6px;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
}

.workbench-summary-strip__stats {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.workbench-summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #475569;
  font-size: 0.82rem;
}

.workbench-summary-pill strong {
  color: #0f172a;
  font-size: 0.92rem;
}

.workbench-summary-pill--status strong {
  color: #1d4ed8;
}

/* =========================================================
   Workspace split layout
   ========================================================= */
.workbench-workspace,
.policy-workbench-layout {
  margin-top: 6px;
  display: grid;
  width: 100%;
  max-width: none;
  grid-template-columns: minmax(0, 1.12fr) 332px;
  gap: 8px;
  align-items: stretch;
  min-height: 0;
}

.workbench-panel,
.workbench-utility-rail {
  border-radius: 12px;
}

.workbench-panel--main {
  padding: 0px 2px;
}

.policy-workbench-layout.workbench-workspace,
.workbench-workspace--analyze {
  width: 100%;
  max-width: none;
}

.policy-workbench-layout__main {
  min-width: 0;
  min-height: 0;
}

.policy-workbench-layout__side {
  min-width: 0;
  min-height: 0;
}

.workbench-utility-rail {
  padding: 0;
  overflow: hidden;
}

.workbench-review-tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(248, 250, 252, 0.96);
}

.workbench-review-tabs__tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
}

.workbench-review-tabs__tab.is-active {
  color: #0f172a;
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.14);
}

.workbench-review-panel {
  padding: 8px 10px;
}

.workbench-side-stack--panel {
  display: grid;
  gap: 0;
}

.workbench-side-stack--panel > * + * {
  margin-top: 0;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}


.workbench-accordion__title {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.workbench-accordion__meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  white-space: nowrap;
}



.workbench-utility-panel .result-panel,
.workbench-utility-panel .workbench-output-panel {
  width: 100%;
  max-width: 100%;
  margin: 0;
  border: none;
  padding: 0;
  background: transparent;
  box-shadow: none;
}


.workbench-utility-panel .result-details:first-child,
.workbench-utility-panel .result-hero {
  margin-top: 0;
}

.workbench-utility-panel .result-config-block textarea,
.workbench-utility-panel #generated_text {
  min-height: 320px;
}

.workbench-utility-panel .tool-panel {
  width: auto;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.workbench-review-section {
  margin-top: 14px;
}

.workbench-review-section:first-of-type {
  margin-top: 0;
}

.workbench-review-section__header {
  display: flex;
  align-items: center;
  padding-bottom: 6px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.workbench-review-section__title {
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #475569;
}

.review-dominant-path {
  display: grid;
  gap: 8px;
}

.review-dominant-path__label {
  font-size: 16px;
  line-height: 1.35;
  font-weight: 700;
  color: #0f172a;
}

.review-dominant-path__meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.review-dominant-path__meta-item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
  color: #64748b;
}

.review-dominant-path__meta-key {
  font-weight: 600;
}

.review-dominant-path__meta-item strong {
  font-size: 13px;
  color: #334155;
}

.review-path-structure {
  display: grid;
  gap: 12px;
}

.review-path-structure__group {
  display: grid;
  gap: 6px;
}

.review-path-structure__src {
  font-size: 14px;
  line-height: 1.3;
  font-weight: 700;
  color: #0f172a;
}

.review-path-structure__children {
  display: grid;
  gap: 4px;
  padding-left: 10px;
}

.review-path-structure__item {
  appearance: none;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 6px;
  min-height: 28px;
  width: 100%;
  padding: 4px 8px;
  border: 0;
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.9);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.review-path-structure__arrow {
  font-size: 12px;
  line-height: 1;
  color: #94a3b8;
}

.review-path-structure__dst {
  min-width: 0;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 600;
  color: #334155;
  word-break: break-word;
}

.review-path-structure__meta {
  font-size: 12px;
  line-height: 1.2;
  color: #64748b;
  white-space: nowrap;
}

.review-path-structure__item:hover,
.review-path-structure__item:focus-visible {
  background: rgba(99, 102, 241, 0.06);
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.18);
}

.review-path-structure__item.is-dominant {
  background: rgba(99, 102, 241, 0.08);
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.22);
}

.review-path-structure__empty {
  font-size: 12px;
  color: #64748b;
}


/* =========================================================
   Analyze work surface local layout
   ========================================================= */
.workbench-workspace--analyze .tool-form__input-sections {
  margin-top: 8px;
}

.workbench-workspace--analyze .tool-form__actions--analyze {
  justify-content: flex-start;
}

/* =========================================================
   Workbench responsive layout
   ========================================================= */
@media (max-width: 1180px) {
  .workbench-bar {
    grid-template-columns: 1fr;
  }

  .workbench-bar__modes {
    order: 3;
  }

  .workbench-workspace,
  .policy-workbench-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .workbench-shell {
    width: calc(100% - 16px);
    margin-top: 8px;
  }

  .workbench-bar,
  .workbench-summary-strip {
    padding-left: 10px;
    padding-right: 10px;
  }

  .workbench-bar__user {
    flex-wrap: wrap;
  }
}

/* =========================================================
   Policy table editor helpers
   ========================================================= */
.workbench-form-section--edit-surface {
  padding-top: 0;
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 0;
  border: none;
  background: transparent;
}

.workbench-import-summary--table {
  margin: 0 0 10px;
}

.table-editor-wrap--workbench-main {
  position: relative;
  z-index: 1;
  margin-top: 0;
}

.table-toggle--toolbar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.table-toggle--toolbar-prominent {
  padding-right: 4px;
  margin-right: 2px;
  font-weight: 600;
  color: #334155;
}

.table-tool-note--toolbar,
.table-tool-note--summary {
  color: var(--muted-foreground, #64748b);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* =========================================================
   Policy table editor toolbar layout
   ========================================================= */
.table-tool-toolbar--integrated {
  position: relative;
  z-index: 4;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: visible;
  margin: 0 0 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(248, 250, 252, 0.92);
}

.table-tool-toolbar--singleline {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: stable;
}

.table-tool-toolbar__group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.table-tool-toolbar__group--singleline {
  flex-wrap: nowrap;
  white-space: nowrap;
  min-width: 0;
}

.table-tool-toolbar__group--singleline > * {
  flex: 0 0 auto;
}

.table-excel-upload {
  display: inline-flex;
  align-items: center;
  margin: 0;
  cursor: pointer;
}

button#download-excel-template-btn,
button#export-excel-data-btn {
  font-family: inherit;
  line-height: inherit;
}

/* =========================================================
   Policy table editor workbench toolbar shell
   ========================================================= */
.workbench-editing-toolbar {
  position: relative;
  display: flex;
  flex-direction: column;
  row-gap: 8px;
  align-items: stretch;
}

.workbench-editing-toolbar--with-help {
  padding-right: 0;
  padding-bottom: 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

.workbench-editing-toolbar__head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: nowrap;
  overflow: visible;
  width: 100%;
  min-width: 0;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.workbench-editing-toolbar__head-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.workbench-editing-toolbar__primary {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.workbench-editing-toolbar__tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
  flex: 0 1 auto;
}

.workbench-editing-toolbar__tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.workbench-editing-toolbar__tab.is-active {
  color: #0f172a;
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.14);
}

.workbench-editing-toolbar__always-panels {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  flex-wrap: nowrap;
  overflow: visible;
}

.workbench-editing-toolbar__always {
  display: flex;
  align-items: center;
  min-height: 34px;
  min-width: max-content;
  flex: 0 0 auto;
}

.workbench-editing-toolbar__panels {
  min-width: 0;
  min-height: 40px;
  display: flex;
  align-items: center;
  flex: 1 1 0;
  overflow: visible;
}

.workbench-editing-toolbar__panel {
  display: none;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

.workbench-editing-toolbar__panel[hidden] {
  display: none !important;
}

.workbench-editing-toolbar__panel.is-active {
  display: block;
}


.workbench-editing-toolbar__panel-scroller {
  min-width: 0;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: stable both-edges;
}

.workbench-editing-toolbar__panel-content {
  min-width: 100%;
  width: max-content;
}


.workbench-editing-toolbar__placeholder {
  color: #64748b;
  font-size: 0.9rem;
}

.table-tool-toolbar__corner-anchor {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 8px 10px;
  pointer-events: none;
  z-index: 24;
}

.workbench-editing-toolbar__corner-help {
  position: relative;
  margin: 0;
  pointer-events: auto;
}

/* =========================================================
   Policy table editor help popover
   ========================================================= */
.workbench-toolbar-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
}

.workbench-toolbar-help__trigger {
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  background: rgba(37, 99, 235, 0.06);
  color: #475569;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.workbench-toolbar-help__trigger:hover,
.workbench-toolbar-help__trigger:focus-visible,
.workbench-toolbar-help.is-open .workbench-toolbar-help__trigger {
  color: #1e293b;
  background: rgba(37, 99, 235, 0.10);
  border-color: rgba(37, 99, 235, 0.24);
  outline: none;
}

.workbench-toolbar-help__popover {
  position: absolute;
  right: calc(100% + 10px);
  top: calc(100% - 4px);
  z-index: 120;
  min-width: 280px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.10);
}

.workbench-toolbar-help:hover .workbench-toolbar-help__popover,
.workbench-toolbar-help:focus-within .workbench-toolbar-help__popover,
.workbench-toolbar-help.is-open .workbench-toolbar-help__popover {
  display: block;
}

.workbench-toolbar-help__title {
  margin-bottom: 8px;
  font-size: 0.86rem;
  font-weight: 700;
  color: #334155;
}

.workbench-toolbar-help__list {
  margin: 0;
  padding-left: 18px;
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.55;
}

.workbench-toolbar-help__list li + li {
  margin-top: 4px;
}

@media (max-width: 900px) {
  .workbench-editing-toolbar--with-help {
    padding-right: 0;
    padding-bottom: 52px;
  }

  .workbench-editing-toolbar__head {
    align-items: flex-start;
    flex-wrap: wrap;
    padding-right: 0;
  }

  .workbench-editing-toolbar__always-panels {
    flex-wrap: wrap;
    gap: 16px;
    row-gap: 10px;
  }

  .table-tool-toolbar__corner-anchor {
    padding: 0;
  }

  .workbench-toolbar-help__popover {
    right: 0;
    left: auto;
    top: calc(100% + 8px);
    min-width: 240px;
    max-width: min(320px, calc(100vw - 48px));
  }
}

/* =========================================================
   Policy Table calm workspace
   ========================================================= */
.workbench-panel--main .table-editor-wrap--workbench-main {
  display: grid;
  gap: 0;
}

.workbench-panel--main .table-editor-scroll {
  position: relative;
  max-height: clamp(520px, calc(100vh - 250px), 760px);
  min-height: 520px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.95);
  overscroll-behavior: contain;
}

.workbench-panel--main .table-editor,
.workbench-panel--main .table-editor--spreadsheet {
  background: #ffffff;
}

.workbench-panel--main .table-editor thead th,
.workbench-panel--main .table-editor--spreadsheet thead th {
  top: 0;
  background: #f3f6fb;
  box-shadow: inset 0 -1px 0 rgba(203, 213, 225, 0.9);
}

.workbench-panel--main .table-editor__rownum-head,
.workbench-panel--main .table-editor__rownum {
  box-shadow: 1px 0 0 rgba(226, 232, 240, 0.88);
}

.workbench-panel--main .table-editor tbody tr:nth-child(even) td:not(.table-editor__rownum):not(.table-editor__actions):not(.table-editor__end-gutter),
.workbench-panel--main .table-editor--spreadsheet tbody tr:nth-child(even) td:not(.table-editor__rownum):not(.table-editor__actions):not(.table-editor__end-gutter) {
  background: rgba(248, 250, 252, 0.38);
}

.workbench-panel--main .table-editor tbody tr:hover td:not(.table-editor__rownum):not(.table-editor__actions):not(.table-editor__end-gutter),
.workbench-panel--main .table-editor--spreadsheet tbody tr:hover td:not(.table-editor__rownum):not(.table-editor__actions):not(.table-editor__end-gutter) {
  background: rgba(226, 232, 240, 0.78);
}

.workbench-panel--main #policy-table tbody tr.is-row-error td:not(.table-editor__actions):not(.table-editor__end-gutter) {
  background: rgba(255, 255, 255, 0.98);
}

.workbench-panel--main #policy-table tbody tr.is-row-error:hover td:not(.table-editor__rownum):not(.table-editor__actions):not(.table-editor__end-gutter) {
  background: rgba(254, 242, 242, 0.92);
}

.workbench-panel--main #policy-table tbody tr.is-row-warning td:not(.table-editor__actions):not(.table-editor__end-gutter) {
  background: rgba(255, 255, 255, 0.98);
}

.workbench-panel--main #policy-table tbody tr.is-row-warning:hover td:not(.table-editor__rownum):not(.table-editor__actions):not(.table-editor__end-gutter) {
  background: rgba(255, 251, 235, 0.92);
}

.workbench-panel--main #policy-table .table-editor__rownum.is-row-error {
  background: #ffffff;
  box-shadow: inset 2px 0 0 rgba(239, 68, 68, 0.72), 1px 0 0 rgba(226, 232, 240, 0.88);
}

.workbench-panel--main #policy-table .table-editor__actions.is-row-error {
  box-shadow: inset 1px 0 0 rgba(239, 68, 68, 0.18);
}

.workbench-panel--main #policy-table .table-editor__rownum.is-row-warning {
  background: #ffffff;
  box-shadow: inset 2px 0 0 rgba(245, 158, 11, 0.62), 1px 0 0 rgba(226, 232, 240, 0.88);
}

.workbench-panel--main #policy-table .table-editor__actions.is-row-warning {
  box-shadow: inset 1px 0 0 rgba(245, 158, 11, 0.16);
}

.workbench-panel--main #policy-table tbody tr:hover .table-editor__rownum {
  background: #eef4ff;
}

.workbench-panel--main #policy-table tbody tr:hover .table-editor__actions {
  background: rgba(226, 232, 240, 0.46);
}

.workbench-panel--main #policy-table tbody tr.is-row-error:hover .table-editor__rownum {
  background: #fff7f7;
  box-shadow: inset 2px 0 0 rgba(239, 68, 68, 0.72), 1px 0 0 rgba(226, 232, 240, 0.88);
}

.workbench-panel--main #policy-table tbody tr.is-row-error:hover .table-editor__actions {
  background: rgba(254, 242, 242, 0.82);
  box-shadow: inset 1px 0 0 rgba(239, 68, 68, 0.18);
}

.workbench-panel--main #policy-table tbody tr.is-row-warning:hover .table-editor__rownum {
  background: #fffaf0;
  box-shadow: inset 2px 0 0 rgba(245, 158, 11, 0.62), 1px 0 0 rgba(226, 232, 240, 0.88);
}

.workbench-panel--main #policy-table tbody tr.is-row-warning:hover .table-editor__actions {
  background: rgba(255, 251, 235, 0.84);
  box-shadow: inset 1px 0 0 rgba(245, 158, 11, 0.16);
}


.workbench-panel--main #policy-table .table-editor__input,
.workbench-panel--main #policy-table select.table-editor__input,
.workbench-panel--main #policy-table input.table-editor__input {
  height: 34px;
}

.workbench-panel--main #policy-table input.table-editor__input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
}

.workbench-panel--main #policy-table .table-editor__actions {
  background: #fbfcfe !important;
}

@media (max-width: 900px) {
  .workbench-panel--main .table-editor-scroll {
    min-height: 420px;
    max-height: clamp(420px, calc(100vh - 220px), 620px);
  }
}

/* =========================================================
   Analyze review and handoff helpers
   ========================================================= */
.workbench-summary-strip--analyze {
  align-items: center;
}

.workbench-workspace--analyze .tool-form__input-sections--analyze {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.workbench-workspace--analyze .tool-form__input-block--analyze {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(248,250,252,0.9), rgba(255,255,255,0.98));
  padding: 14px;
}

.workbench-workspace--analyze .tool-form__input-header--analyze h3 {
  margin: 0;
  font-size: 1rem;
}

.workbench-workspace--analyze .tool-form__input-header--analyze p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 0.88rem;
}

.workbench-workspace--analyze .tool-form__upload-row {
  align-items: center;
  gap: 10px;
}

.workbench-workspace--analyze .tool-form__paste-group {
  margin-top: 10px;
  margin-bottom: 0;
}

.workbench-workspace--analyze .tool-form__paste-group textarea {
  min-height: 240px;
}

.workbench-workspace--analyze .workbench-summary-item--detail {
  align-items: flex-start;
}

.workbench-analyze-handoff {
  display: grid;
  gap: 10px;
}

.workbench-analyze-handoff p {
  margin: 0;
  color: #475569;
  line-height: 1.6;
}

/* =========================================================
   Workbench guide surface
   ========================================================= */
.workbench-bar__guide-button {
  appearance: none;
  border: none;
  background: transparent;
  color: #475569;
  padding: 6px 2px;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.workbench-bar__guide-button:hover,
.workbench-bar__guide-button:focus-visible {
  color: #1d4ed8;
}

.workbench-bar__guide-button:focus-visible {
  outline: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.workbench-guide-copy {
  display: grid;
  gap: 12px;
  color: #334155;
  font-size: 0.9rem;
  line-height: 1.65;
}


.workbench-guide-docs-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #eff6ff;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.workbench-guide-docs-link__text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.workbench-guide-docs-link__text strong {
  color: #1e3a8a;
  font-size: 0.84rem;
  line-height: 1.3;
}

.workbench-guide-docs-link__text span {
  color: #475569;
  font-size: 0.82rem;
  line-height: 1.45;
}

.workbench-guide-docs-link__action {
  flex: 0 0 auto;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #ffffff;
  color: #1d4ed8;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.workbench-guide-docs-link:hover,
.workbench-guide-docs-link:focus-visible {
  border-color: #bfdbfe;
  background: #eaf2ff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.1);
  text-decoration: none;
  transform: translateY(-1px);
}

.workbench-guide-docs-link:hover .workbench-guide-docs-link__action,
.workbench-guide-docs-link:focus-visible .workbench-guide-docs-link__action {
  border-color: #93c5fd;
  color: #1e40af;
}

.workbench-guide-docs-link:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
}

.workbench-side-card--guide.workbench-guide-attention {
  animation: workbench-guide-attention-pulse 900ms ease-out;
}

@keyframes workbench-guide-attention-pulse {
  0% {
    background: rgba(37, 99, 235, 0.1);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.28), 0 0 0 4px rgba(37, 99, 235, 0.08);
  }
  100% {
    background: #ffffff;
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .workbench-side-card--guide.workbench-guide-attention {
    animation-duration: 1ms;
  }
}

.workbench-guide-copy p,
.workbench-guide-copy ol,
.workbench-guide-copy ul {
  margin: 0;
}

.workbench-guide-list,
.workbench-guide-notes {
  padding-left: 1.1rem;
}

.workbench-guide-list li + li,
.workbench-guide-notes li + li {
  margin-top: 6px;
}



/* =========================================================
   Policy Workbench Generate height alignment
   ========================================================= */
.policy-workbench-layout__main {
  display: flex;
  min-height: 0;
}

.policy-workbench-layout__main,
.policy-workbench-layout__main + .workbench-workspace__side {
  height: var(--workbench-workspace-height);
}

.policy-workbench-layout__main > .workbench-panel--main {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.policy-workbench-layout__main > .workbench-panel--main > .tool-form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.policy-workbench-layout__main .workbench-form-section--edit-surface {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.policy-workbench-layout__main .table-editor-wrap--workbench-main {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.policy-workbench-layout__main .table-editor-scroll {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: none;
}

.policy-workbench-layout__main + .workbench-workspace__side {
  display: flex;
  min-height: 0;
}

.policy-workbench-layout__main + .workbench-workspace__side > .workbench-utility-rail {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.policy-workbench-layout__main + .workbench-workspace__side .workbench-review-panels {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.policy-workbench-layout__main + .workbench-workspace__side .workbench-review-panel {
  height: 100%;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}


@media (max-width: 1180px) {
  .policy-workbench-layout__main,
  .policy-workbench-layout__main + .workbench-workspace__side {
    height: auto;
  }

  .policy-workbench-layout__main > .workbench-panel--main,
  .policy-workbench-layout__main + .workbench-workspace__side > .workbench-utility-rail {
    height: auto;
  }

  .policy-workbench-layout__main .table-editor-scroll,
  .policy-workbench-layout__main + .workbench-workspace__side .workbench-review-panel {
    height: auto;
  }
}


/* =========================================================
   Policy Workbench Analyze height alignment
   ========================================================= */
.policy-workbench-analyze-layout__main {
  display: flex;
  min-height: 0;
}

.policy-workbench-analyze-layout__main,
.policy-workbench-analyze-layout__main + .workbench-workspace__side {
  height: var(--workbench-workspace-height);
}

.policy-workbench-analyze-layout__main > .workbench-panel--main {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.policy-workbench-analyze-layout__main > .workbench-panel--main > .tool-form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.policy-workbench-analyze-layout__main .tool-form__input-sections--analyze {
  flex: 1 1 auto;
  min-height: 0;
}

.policy-workbench-analyze-layout__main .tool-form__section-divider--analyze-gap {
  flex: 0 0 auto;
}

.policy-workbench-analyze-layout__main .tool-form__input-block--paste-analyze {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.policy-workbench-analyze-layout__main .tool-form__paste-group {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.policy-workbench-analyze-layout__main .tool-form__paste-group textarea {
  flex: 1 1 auto;
  min-height: 120px;
}

.policy-workbench-analyze-layout__main + .workbench-workspace__side {
  display: flex;
  min-height: 0;
}

.policy-workbench-analyze-layout__main + .workbench-workspace__side > .workbench-utility-rail {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.policy-workbench-analyze-layout__main + .workbench-workspace__side .workbench-review-panels {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.policy-workbench-analyze-layout__main + .workbench-workspace__side .workbench-review-panel {
  height: 100%;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}

@media (max-width: 1180px) {
  .policy-workbench-analyze-layout__main,
  .policy-workbench-analyze-layout__main + .workbench-workspace__side {
    height: auto;
  }

  .policy-workbench-analyze-layout__main > .workbench-panel--main,
  .policy-workbench-analyze-layout__main + .workbench-workspace__side > .workbench-utility-rail {
    height: auto;
  }

  .policy-workbench-analyze-layout__main .tool-form__input-sections--analyze,
  .policy-workbench-analyze-layout__main .tool-form__paste-group textarea,
  .policy-workbench-analyze-layout__main + .workbench-workspace__side .workbench-review-panel {
    height: auto;
  }
}


/* =========================================================
   Workbench density Phase B corrective patch
   Actual controlling selectors for Generate toolbar shell
   ========================================================= */
.workbench-form-section--spreadsheet .table-tool-toolbar--integrated {
  margin-bottom: 0px;
  padding: 8px 10px;
}

.workbench-form-section--spreadsheet .workbench-editing-toolbar {
  row-gap: 8px;
}

.workbench-form-section--spreadsheet .workbench-editing-toolbar__head {
  gap: 10px;
  padding-bottom: 2px;
}

.workbench-form-section--spreadsheet .workbench-editing-toolbar__head-left,
.workbench-form-section--spreadsheet .workbench-editing-toolbar__always-panels {
  gap: 10px;
}

.workbench-form-section--spreadsheet .workbench-editing-toolbar__tabs {
  gap: 6px;
}

.workbench-form-section--spreadsheet .workbench-editing-toolbar__tab {
  padding: 4px 10px;
}

.workbench-form-section--spreadsheet .workbench-action-button,
.workbench-form-section--spreadsheet .workbench-editing-toolbar__always,
.workbench-form-section--spreadsheet .workbench-editing-toolbar__panels {
  min-height: 34px;
}

.workbench-form-section--spreadsheet .table-tool-toolbar__group,
.workbench-form-section--spreadsheet .table-tool-toolbar__left,
.workbench-form-section--spreadsheet .table-tool-toolbar__right {
  gap: 8px;
}

/* =========================================================
   Review Relationship Flow View modal
   ========================================================= */
body.is-review-flow-modal-open {
  overflow: hidden;
}

.workbench-review-section__header--with-action {
  justify-content: space-between;
  gap: 10px;
}

.workbench-review-section__action {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 3px 10px;
  border: 1px solid rgba(71, 85, 105, 0.18);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.96);
  color: #334155;
  font: inherit;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 500;
  cursor: pointer;
}

.workbench-review-section__action:hover,
.workbench-review-section__action:focus-visible {
  background: rgba(99, 102, 241, 0.06);
  border-color: rgba(99, 102, 241, 0.28);
  outline: none;
}

.review-flow-modal[hidden] {
  display: none;
}

.review-flow-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
}

.review-flow-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(2px);
}

.review-flow-modal__dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(94vw, 1260px);
  height: 92vh;
  min-width: min(1240px, 94vw);
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

.review-flow-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 18px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.96));
}

.review-flow-modal__title-block {
  display: grid;
  gap: 0;
}

.review-flow-modal__title {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 700;
  color: #0f172a;
}


.review-flow-modal__close {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 3px 12px;
  border: 1px solid rgba(71, 85, 105, 0.18);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.96);
  color: #334155;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.review-flow-modal__close:hover,
.review-flow-modal__close:focus-visible {
  background: rgba(99, 102, 241, 0.06);
  border-color: rgba(99, 102, 241, 0.28);
  outline: none;
}

.review-flow-modal__body {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #f8fafc;
}

.review-flow-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: auto;
  padding: 0;
}


/* Review Flow View: tooltip */
.review-flow-tooltip {
  position: absolute;
  z-index: 4;
  min-width: 156px;
  max-width: 280px;
  max-height: 280px;
  overflow: auto;
  padding: 6px 8px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.80);
  color: rgba(255, 255, 255, 0.96);
  font-size: 10.5px;
  line-height: 1.25;
  pointer-events: none;
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
}

.review-flow-tooltip[hidden] {
  display: none;
}

.review-flow-tooltip strong,
.review-flow-tooltip span {
  display: block;
}

.review-flow-tooltip strong {
  font-size: 10.8px;
  line-height: 1.25;
}

.review-flow-tooltip span {
  margin-top: 1px;
  color: rgba(226, 232, 240, 0.92);
}

.review-flow-tooltip__total {
  margin-top: 3px;
  color: rgba(226, 232, 240, 0.92);
}

.review-flow-tooltip__directions,
.review-flow-tooltip__node-relationships {
  display: grid;
  gap: 3px;
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid rgba(226, 232, 240, 0.14);
}

.review-flow-tooltip__direction {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 5px;
  min-height: 14px;
  color: rgba(248, 250, 252, 0.96);
}

.review-flow-tooltip__marker {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.44);
}

.review-flow-tooltip__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-flow-tooltip__count {
  justify-self: end;
  min-width: 2.5ch;
  font-weight: 700;
  text-align: right;
}

.review-flow-tooltip__relationship-block {
  display: grid;
  gap: 2px;
  padding-top: 3px;
}

.review-flow-tooltip__relationship-block + .review-flow-tooltip__relationship-block {
  border-top: 1px solid rgba(226, 232, 240, 0.10);
}

.review-flow-tooltip__relationship-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  color: rgba(255, 255, 255, 0.96);
  font-weight: 700;
}

.review-flow-tooltip__relationship-summary span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-flow-canvas__empty {
  margin: 0;
  padding: 18px;
  border: 1px dashed rgba(100, 116, 139, 0.3);
  border-radius: 16px;
  background: #ffffff;
  color: #64748b;
  font-size: 13px;
}

/* Review Flow View: SVG canvas */
.review-flow-svg {
  display: block;
  flex: 0 0 auto;
  max-width: none;
  min-width: 1160px;
  overflow: visible;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  background: #ffffff;
}

.review-flow-svg--network {
  min-width: 1240px;
}

.review-flow-svg__column-title {
  fill: #64748b;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Review Flow View: pan / zoom interaction */
.review-flow-svg.is-pannable {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.review-flow-svg.is-pannable.is-panning {
  cursor: grabbing;
}

.review-flow-svg.is-pannable.is-panning .review-flow-svg__band {
  cursor: grabbing;
}

/* Review Flow View: relationship bands */
.review-flow-svg--network .review-flow-svg__band {
  cursor: pointer;
  opacity: 0.82;
  transition: opacity 0.16s ease, filter 0.16s ease;
}

.review-flow-svg--network.is-band-hovering .review-flow-svg__band:not(.is-hovered):not(.is-selected) {
  opacity: 0.24;
}

.review-flow-svg--network .review-flow-svg__band:hover,
.review-flow-svg--network .review-flow-svg__band.is-hovered {
  opacity: 1;
  filter: drop-shadow(0 4px 12px rgba(15, 23, 42, 0.34));
}

.review-flow-svg--network .review-flow-svg__band.is-dominant {
  opacity: 0.92;
}

.review-flow-svg--network .review-flow-svg__band.is-selected {
  opacity: 1;
  filter: drop-shadow(0 5px 14px rgba(15, 23, 42, 0.4));
}

.review-flow-svg--network .review-flow-svg__band-hover-halo {
  fill: none;
  stroke: rgba(15, 23, 42, 0.72);
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}

.review-flow-svg--network .review-flow-svg__band:hover .review-flow-svg__band-hover-halo,
.review-flow-svg--network .review-flow-svg__band.is-hovered .review-flow-svg__band-hover-halo,
.review-flow-svg--network .review-flow-svg__band.is-selected .review-flow-svg__band-hover-halo {
  opacity: 0.34;
}

.review-flow-svg--network .review-flow-svg__band-backbone {
  fill: none;
  stroke: rgba(15, 23, 42, 0.28);
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.13;
}

.review-flow-svg--network .review-flow-svg__band-layer {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.84;
}

.review-flow-svg--network .review-flow-svg__band-layer--direction {
  opacity: 0.9;
}

.review-flow-svg--network .review-flow-svg__band:hover .review-flow-svg__band-layer,
.review-flow-svg--network .review-flow-svg__band.is-hovered .review-flow-svg__band-layer,
.review-flow-svg--network .review-flow-svg__band.is-selected .review-flow-svg__band-layer,
.review-flow-svg--network .review-flow-svg__band:hover .review-flow-svg__band-layer--direction,
.review-flow-svg--network .review-flow-svg__band.is-hovered .review-flow-svg__band-layer--direction,
.review-flow-svg--network .review-flow-svg__band.is-selected .review-flow-svg__band-layer--direction {
  opacity: 1;
}

.review-flow-svg--network .review-flow-svg__band-divider {
  fill: none;
  stroke: rgba(255, 255, 255, 0.86);
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.9;
  pointer-events: none;
}

.review-flow-svg--network .review-flow-svg__band-hitarea {
  fill: none;
  stroke: transparent;
  stroke-linecap: round;
  stroke-linejoin: round;
  cursor: pointer;
}

.review-flow-svg--network .review-flow-svg__mini-arrow {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4px;
  pointer-events: none;
  opacity: 0.98;
  filter: drop-shadow(0 0 1.2px rgba(15, 23, 42, 0.62)) drop-shadow(0 1px 1px rgba(15, 23, 42, 0.32));
}

.review-flow-svg--network .review-flow-svg__band:hover .review-flow-svg__mini-arrow,
.review-flow-svg--network .review-flow-svg__band.is-hovered .review-flow-svg__mini-arrow,
.review-flow-svg--network .review-flow-svg__band.is-selected .review-flow-svg__mini-arrow {
  stroke-width: 2.7px;
  opacity: 1;
}

/* Review Flow View: nodes */
.review-flow-svg__node {
  cursor: pointer;
  transition: opacity 0.16s ease, filter 0.16s ease;
}

.review-flow-svg__node rect {
  fill: #ffffff;
  stroke: rgba(148, 163, 184, 0.42);
}

.review-flow-svg__node--source rect,
.review-flow-svg__node--destination rect {
  fill: rgba(248, 250, 252, 0.98);
}

.review-flow-svg--network .review-flow-svg__node.is-hovered rect {
  stroke: rgba(37, 99, 235, 0.58);
  stroke-width: 1.6px;
  filter: drop-shadow(0 4px 12px rgba(37, 99, 235, 0.16));
}

.review-flow-svg__node-label {
  fill: #0f172a;
  font-size: 14px;
  font-weight: 700;
  text-anchor: middle;
}

.review-flow-svg__node-meta {
  fill: #64748b;
  font-size: 12px;
  font-weight: 600;
  text-anchor: middle;
}

/* Review Flow View: FortiGate bus */
.review-flow-svg__firewall rect {
  fill: #ffffff;
  stroke: rgba(37, 99, 235, 0.28);
  stroke-width: 1.4;
  filter: drop-shadow(0 12px 24px rgba(15, 23, 42, 0.12));
}

.review-flow-svg__firewall-icon {
  fill: #dc2626;
  font-size: 26px;
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: middle;
}

.review-flow-svg__firewall-label {
  fill: #0f172a;
  font-size: 12px;
  font-weight: 800;
  text-anchor: middle;
}

/* =========================================================
   Review Flow View visual uplift: Layered Network Structure
   Scope: CSS-only visual design, no relationship/layout logic change
   ========================================================= */
.review-flow-modal__backdrop {
  background:
    radial-gradient(circle at 50% 34%, rgba(37, 99, 235, 0.18), transparent 34%),
    rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(4px);
}

.review-flow-modal__dialog {
  border-color: rgba(148, 163, 184, 0.28);
  box-shadow: 0 26px 90px rgba(15, 23, 42, 0.34);
}

.review-flow-modal__header {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94));
}

.review-flow-modal__body {
  background: #eef2f7;
}

.review-flow-canvas {
  padding: 0;
  background:
    radial-gradient(circle at 50% 40%, rgba(96, 165, 250, 0.15), transparent 34%),
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.review-flow-svg {
  border-color: rgba(148, 163, 184, 0.22);
  border-radius: 22px;
  background:
    linear-gradient(rgba(148, 163, 184, 0.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    radial-gradient(circle at 50% 48%, rgba(37, 99, 235, 0.08), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  background-size: 100% 56px, 80px 100%, auto, auto;
  box-shadow:
    0 18px 42px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.review-flow-svg__column-title {
  fill: #64748b;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.review-flow-svg--network .review-flow-svg__band {
  opacity: 0.9;
  transition: opacity 0.16s ease, filter 0.16s ease;
}

.review-flow-svg--network.is-band-hovering .review-flow-svg__band:not(.is-hovered):not(.is-selected) {
  opacity: 0.20;
}

.review-flow-svg--network .review-flow-svg__band:hover,
.review-flow-svg--network .review-flow-svg__band.is-hovered {
  opacity: 1;
  filter: drop-shadow(0 7px 14px rgba(15, 23, 42, 0.28));
}

.review-flow-svg--network .review-flow-svg__band.is-selected {
  filter: drop-shadow(0 8px 18px rgba(15, 23, 42, 0.34));
}

.review-flow-svg--network .review-flow-svg__band-hover-halo {
  stroke: rgba(15, 23, 42, 0.68);
}

.review-flow-svg--network .review-flow-svg__band:hover .review-flow-svg__band-hover-halo,
.review-flow-svg--network .review-flow-svg__band.is-hovered .review-flow-svg__band-hover-halo,
.review-flow-svg--network .review-flow-svg__band.is-selected .review-flow-svg__band-hover-halo {
  opacity: 0.24;
}

.review-flow-svg--network .review-flow-svg__band-backbone {
  stroke: rgba(15, 23, 42, 0.32);
  opacity: 0.12;
  filter: drop-shadow(0 2px 3px rgba(15, 23, 42, 0.16));
}

.review-flow-svg--network .review-flow-svg__band-layer {
  opacity: 0.88;
  filter:
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.72))
    drop-shadow(0 3px 5px rgba(15, 23, 42, 0.13));
}

.review-flow-svg--network .review-flow-svg__band-layer--direction {
  opacity: 0.92;
}

.review-flow-svg--network .review-flow-svg__band-divider {
  stroke: rgba(255, 255, 255, 0.82);
  opacity: 0.86;
}

.review-flow-svg--network .review-flow-svg__mini-arrow {
  stroke-width: 2.2px;
  opacity: 0.92;
  filter:
    drop-shadow(0 0 1px rgba(15, 23, 42, 0.58))
    drop-shadow(0 1px 1px rgba(15, 23, 42, 0.28));
}

.review-flow-svg--network .review-flow-svg__band:hover .review-flow-svg__mini-arrow,
.review-flow-svg--network .review-flow-svg__band.is-hovered .review-flow-svg__mini-arrow,
.review-flow-svg--network .review-flow-svg__band.is-selected .review-flow-svg__mini-arrow {
  stroke-width: 2.6px;
}

.review-flow-svg__node rect {
  fill: rgba(255, 255, 255, 0.96);
  stroke: rgba(148, 163, 184, 0.36);
  stroke-width: 1.1px;
  filter:
    drop-shadow(0 8px 16px rgba(15, 23, 42, 0.10))
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.8));
}

.review-flow-svg__node--source rect,
.review-flow-svg__node--destination rect {
  fill: rgba(255, 255, 255, 0.96);
}

.review-flow-svg--network .review-flow-svg__node.is-hovered rect {
  stroke: rgba(37, 99, 235, 0.62);
  stroke-width: 1.7px;
  filter:
    drop-shadow(0 10px 20px rgba(37, 99, 235, 0.16))
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.86));
}

.review-flow-svg__node-label {
  font-weight: 800;
}

.review-flow-svg__node-meta {
  font-weight: 650;
}

.review-flow-svg__firewall rect {
  fill: rgba(255, 255, 255, 0.98);
  stroke: rgba(37, 99, 235, 0.40);
  stroke-width: 1.6;
  filter:
    drop-shadow(0 20px 38px rgba(37, 99, 235, 0.18))
    drop-shadow(0 4px 10px rgba(15, 23, 42, 0.10));
}

.review-flow-svg__firewall-icon {
  font-weight: 900;
  filter: drop-shadow(0 2px 3px rgba(220, 38, 38, 0.20));
}

.review-flow-svg__firewall-label {
  font-weight: 850;
}

.review-flow-tooltip {
  min-width: 172px;
  max-width: 300px;
  max-height: 300px;
  padding: 8px 10px;
  border-color: rgba(226, 232, 240, 0.20);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.86);
  backdrop-filter: blur(8px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.26);
}

/* =========================================================
   Review Flow View visual refinement v2
   Scope: CSS-only refinement after first layered design review
   - remove center glow conflict around FortiGate
   - strengthen interface / zone node card appearance
   - keep grid background but reduce visual noise
   - center fixed-width SVG canvas inside wide modal body
   ========================================================= */
.review-flow-canvas {
  padding: 0;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.review-flow-svg {
  margin: 0 auto;
  border-color: rgba(148, 163, 184, 0.24);
  background:
    linear-gradient(rgba(148, 163, 184, 0.085) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.065) 1px, transparent 1px),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  background-size: 100% 56px, 80px 100%, auto;
  box-shadow:
    0 16px 36px rgba(15, 23, 42, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.review-flow-svg__node rect {
  fill: #ffffff;
  stroke: rgba(100, 116, 139, 0.32);
  stroke-width: 1.15px;
  filter:
    drop-shadow(0 10px 18px rgba(15, 23, 42, 0.12))
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.9));
}

.review-flow-svg__node--source rect,
.review-flow-svg__node--destination rect {
  fill: #ffffff;
}

.review-flow-svg__node-label {
  fill: #0f172a;
  font-size: 14.5px;
  font-weight: 850;
  letter-spacing: 0.01em;
}

.review-flow-svg__node-meta {
  fill: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.review-flow-svg--network .review-flow-svg__node.is-hovered rect {
  stroke: rgba(37, 99, 235, 0.58);
  stroke-width: 1.8px;
  filter:
    drop-shadow(0 12px 22px rgba(37, 99, 235, 0.14))
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.9));
}

.review-flow-svg__firewall rect {
  fill: #ffffff;
  stroke: rgba(37, 99, 235, 0.34);
  stroke-width: 1.55;
  filter:
    drop-shadow(0 8px 18px rgba(15, 23, 42, 0.12))
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.9));
}

.review-flow-svg__firewall-icon {
  filter: none;
}

.review-flow-svg--network .review-flow-svg__band-layer {
  filter:
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.72))
    drop-shadow(0 3px 5px rgba(15, 23, 42, 0.12));
}

/* =========================================================
   Review Flow View visual strengthening v3
   Scope: CSS + SVG presentation constants only
   Purpose: make relationship bands the primary visual layer and make
   interface / zone nodes read as structured information cards.
   ========================================================= */
.review-flow-svg {
  background:
    linear-gradient(rgba(148, 163, 184, 0.075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.055) 1px, transparent 1px),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  background-size: 100% 56px, 80px 100%, auto;
}

.review-flow-svg--network .review-flow-svg__band {
  opacity: 0.94;
}

.review-flow-svg--network.is-band-hovering .review-flow-svg__band:not(.is-hovered):not(.is-selected) {
  opacity: 0.16;
}

.review-flow-svg--network .review-flow-svg__band:hover,
.review-flow-svg--network .review-flow-svg__band.is-hovered,
.review-flow-svg--network .review-flow-svg__band.is-selected {
  opacity: 1;
  filter: drop-shadow(0 9px 18px rgba(15, 23, 42, 0.32));
}

.review-flow-svg--network .review-flow-svg__band-hover-halo {
  stroke: rgba(15, 23, 42, 0.52);
}

.review-flow-svg--network .review-flow-svg__band:hover .review-flow-svg__band-hover-halo,
.review-flow-svg--network .review-flow-svg__band.is-hovered .review-flow-svg__band-hover-halo,
.review-flow-svg--network .review-flow-svg__band.is-selected .review-flow-svg__band-hover-halo {
  opacity: 0.18;
}

.review-flow-svg--network .review-flow-svg__band-backbone {
  opacity: 0.18;
  filter: drop-shadow(0 4px 7px rgba(15, 23, 42, 0.18));
}

.review-flow-svg--network .review-flow-svg__band-layer {
  opacity: 0.94;
  filter:
    drop-shadow(0 -1px 0 rgba(255, 255, 255, 0.62))
    drop-shadow(0 4px 8px rgba(15, 23, 42, 0.16));
}

.review-flow-svg--network .review-flow-svg__band-layer--direction {
  opacity: 0.96;
}

.review-flow-svg--network .review-flow-svg__band-divider {
  stroke: rgba(255, 255, 255, 0.74);
  opacity: 0.74;
}

.review-flow-svg--network .review-flow-svg__mini-arrow {
  stroke-width: 2.45px;
  opacity: 0.96;
  filter:
    drop-shadow(0 0 1.4px rgba(15, 23, 42, 0.58))
    drop-shadow(0 1px 1.5px rgba(15, 23, 42, 0.34));
}

.review-flow-svg__node rect:first-of-type {
  fill: #ffffff;
  stroke: rgba(100, 116, 139, 0.36);
  stroke-width: 1.25px;
  filter:
    drop-shadow(0 13px 24px rgba(15, 23, 42, 0.13))
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.92));
}

.review-flow-svg__node-label {
  fill: #0f172a;
  font-size: 15px;
  font-weight: 850;
  letter-spacing: 0.01em;
}

.review-flow-svg__node-metric {
  stroke-width: 1px;
}

.review-flow-svg__node-metric--out {
  fill: rgba(37, 99, 235, 0.075);
  stroke: rgba(37, 99, 235, 0.18);
}

.review-flow-svg__node-metric--in {
  fill: rgba(15, 118, 110, 0.075);
  stroke: rgba(15, 118, 110, 0.18);
}

.review-flow-svg__node-meta {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.035em;
  text-anchor: middle;
}

.review-flow-svg__node-meta--out {
  fill: #2563eb;
}

.review-flow-svg__node-meta--in {
  fill: #0f766e;
}

.review-flow-svg--network .review-flow-svg__node.is-hovered rect:first-of-type {
  stroke: rgba(37, 99, 235, 0.62);
  stroke-width: 1.9px;
  filter:
    drop-shadow(0 15px 28px rgba(37, 99, 235, 0.17))
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.92));
}

.review-flow-svg__firewall rect {
  stroke: rgba(37, 99, 235, 0.42);
  stroke-width: 1.7;
  filter:
    drop-shadow(0 9px 18px rgba(15, 23, 42, 0.13))
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.9));
}

/* =========================================================
   Review Flow View visual finishing v4
   Scope: visual-only final refinement
   - reduce grid contrast
   - reduce node card shadow weight
   - add extremely subtle node-to-band connector cue
   ========================================================= */
.review-flow-svg {
  background:
    linear-gradient(rgba(148, 163, 184, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  background-size: 100% 56px, 80px 100%, auto;
}

.review-flow-svg__node rect:first-of-type {
  filter:
    drop-shadow(0 7px 14px rgba(15, 23, 42, 0.085))
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.92));
}

.review-flow-svg--network .review-flow-svg__node.is-hovered rect:first-of-type {
  filter:
    drop-shadow(0 10px 20px rgba(37, 99, 235, 0.13))
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.92));
}

.review-flow-svg__node-connector {
  fill: none;
  stroke: rgba(100, 116, 139, 0.22);
  stroke-width: 1.2px;
  stroke-linecap: round;
  opacity: 0.62;
  pointer-events: none;
}

.review-flow-svg__node.is-hovered .review-flow-svg__node-connector {
  stroke: rgba(37, 99, 235, 0.32);
  opacity: 0.82;
}

/* =========================================================
   Review Flow View modal auto-height refinement v5
   Scope: CSS-only minimal adjustment
   Purpose: remove unnecessary vertical blank area and avoid scrollbars
   when the rendered flow diagram fits within the viewport.
   ========================================================= */
.review-flow-modal__dialog {
  height: auto;
  max-height: 92vh;
  grid-template-rows: auto auto;
}

.review-flow-modal__body {
  min-height: 0;
  overflow: visible;
}

.review-flow-canvas {
  box-sizing: border-box;
  height: auto;
  max-height: calc(92vh - 88px);
  overflow: auto;
}

/* =========================================================
   Review Flow View fullscreen canvas refinement v6
   Scope: Flow View container only
   Purpose: provide viewport-scale canvas room and preserve tooltip escape space
   without changing relationship drawing logic.
   ========================================================= */
.review-flow-modal {
  display: block;
  padding: 16px;
  box-sizing: border-box;
}

.review-flow-modal__dialog {
  width: calc(100vw - 32px);
  height: calc(100vh - 32px);
  max-width: none;
  max-height: none;
  min-width: 0;
  grid-template-rows: auto minmax(0, 1fr);
  border-radius: 20px;
}

.review-flow-modal__header {
  min-height: 48px;
  padding: 8px 18px;
}

.review-flow-modal__body {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.review-flow-canvas {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-height: none;
  padding: 24px;
  overflow: auto;
}

.review-flow-svg {
  margin: 0 auto;
}

@media (max-width: 900px) {
  .review-flow-modal {
    padding: 8px;
  }

  .review-flow-modal__dialog {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
    border-radius: 16px;
  }

  .review-flow-canvas {
    padding: 14px;
  }
}
