:root{
      /* Semantic tokens: color */
      --color-brand:#222A68;
      --color-brand-contrast:#fff;
      --color-surface-0:#fff;
      --color-surface-1:#fafafa;
      --color-surface-2:#f3f3f3;
      --color-border:#e0e0e0;
      --color-text:#111;
      --color-muted:#4b5563;
      --color-focus:#222A68;
      --color-focus-strong:#222A68;
      --color-success:#1a7f37;
      --color-warn:#FFB100;
      --color-danger:#D7263D;

      /* Semantic tokens: layout */
      --space-1:2px;
      --space-2:4px;
      --space-3:6px;
      --space-4:8px;
      --space-5:10px;
      --space-6:12px;
      --radius-sm:4px;
      --radius-md:6px;
      --radius-lg:8px;
      --radius-xl:12px;
      --shadow-sm:0 4px 16px rgba(15, 23, 42, 0.04);
      --shadow-md:0 10px 24px rgba(0,0,0,.08);

      /* Semantic tokens: state */
      --interactive-hover:var(--color-brand);
      --interactive-active:#1b2254;
      --interactive-disabled:0.55;
      --selection-bg:#E2E2E2;
      --selection-border:var(--color-focus);

      /* Legacy aliases (Phase A compatibility) */
      --bg:var(--color-surface-0);
      --panel:var(--color-surface-1);
      --line:var(--color-border);
      --text:var(--color-text);
      --muted:var(--color-muted);
      --btn:var(--color-surface-2);
      --btn-border:var(--color-border);
      --highlight:var(--selection-bg); /* required highlight color */
      --drop:var(--selection-border);
    }
    *{ box-sizing:border-box; }
    html,body{ height:100%; margin:0; background:var(--bg); color:var(--text);
      font:14px/1.35 "Inter", "Manrope", "Noto Sans", Helvetica, Arial, sans-serif;
    }
    button,input,textarea{ font:inherit; }

    /* Default state for unauthenticated users to prevent UI flicker on load */
    body.unauthenticated #topbar,
    body.unauthenticated #treePane,
    body.unauthenticated #detailPane,
    body.unauthenticated #detailPaneHeader,
    body.unauthenticated #treePaneHeader,
    body.unauthenticated #paneDivider {
        display: none;
    }

    #authLandingHost {
      display: none;
      flex: 1 1 auto;
      min-height: 0;
      overflow: auto;
      width: 100%;
    }

    body.unauthenticated #authLandingHost {
      display: block;
      background: var(--panel);
    }

    #app{ height:100%; display:flex; flex-direction:column; }

    #postLoginLoaderOverlay {
      position: fixed;
      inset: 0;
      z-index: 9999;
      display: none;
      align-items: center;
      justify-content: center;
      background: var(--bg);
    }

    body.post-login-loading #app {
      display: none;
    }

    body.post-login-loading #postLoginLoaderOverlay {
      display: flex;
    }

    .cookieNoticeBanner {
      position: fixed;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 10000;
      padding: 12px 16px;
      background: #111827;
      color: #ffffff;
      border-top: 1px solid rgba(255, 255, 255, 0.2);
      box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.2);
      font-family: "Inter", "Manrope", "Noto Sans", Helvetica, Arial, sans-serif;
    }

    .cookieNoticeContent {
      width: min(1200px, 100%);
      margin: 0 auto;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
    }

    .cookieNoticeText {
      margin: 0;
      font-size: 13px;
      line-height: 1.5;
      color: #f9fafb;
    }

    .cookieNoticeLink,
    .cookieNoticeLink:visited {
      color: #93c5fd;
      text-decoration: underline;
      text-underline-offset: 2px;
    }

    .cookieNoticeLink:hover,
    .cookieNoticeLink:focus-visible {
      color: #bfdbfe;
    }

    .cookieNoticeDismissBtn {
      background: #ffffff;
      color: #111827;
      border: 1px solid #d1d5db;
      font-weight: 600;
    }

    .cookieNoticeDismissBtn:hover,
    .cookieNoticeDismissBtn:active {
      background: #f3f4f6;
      color: #111827;
    }

    /* Shared chrome recipe */
    .chromeActionGroup{
      display:inline-flex;
      align-items:center;
      gap:var(--space-3);
      min-width:0;
    }
    #topbar{
      height:60px; min-height:60px;
      display:flex; align-items:center; gap:var(--space-4);
      padding:var(--space-5) var(--space-6);
      background:var(--color-surface-1);
      border:none;
      border-radius:var(--radius-lg);
      box-shadow:var(--shadow-sm);
    }
    .btn{
      padding:8px 10px;
      border:1px solid var(--btn-border);
      border-radius:var(--radius-md);
      background:var(--color-surface-0);
      cursor:pointer;
      white-space:nowrap;
      color:var(--text);
    }
    .btn:hover{ background-color:var(--interactive-hover); color:var(--color-brand-contrast); }
    .btn:active{ background-color:var(--interactive-active); color:var(--color-brand-contrast); }
    .btn:disabled,
    .btn[aria-disabled="true"]{ opacity:var(--interactive-disabled); cursor:not-allowed; }
    .btn.loading {
      position: relative;
      color: transparent !important;
      cursor: wait;
    }
    .btn.loading::after {
      content: '';
      position: absolute;
      top: 50%;
      left: 50%;
      width: 16px;
      height: 16px;
      margin-top: -8px;
      margin-left: -8px;
      border: 2px solid rgba(0, 0, 0, 0.2);
      border-top-color: #000;
      border-radius: 50%;
      animation: spin 1s linear infinite;
    }

    .loading-spinner {
      width: 1.2em;
      height: 1.2em;
      border: 2px solid currentColor;
      border-right-color: transparent;
      border-radius: 50%;
      display: inline-block;
      animation: spin .75s linear infinite;
      vertical-align: text-bottom;
    }

    /* File dropdown (CSS-only toggle: hover or focus-within) */
    .fileDropdown{ position:relative; display:inline-flex; align-items:center; }
    .fileDropdown .menu{
      position:absolute;
      top:calc(100% + 6px);
      left:0;
      min-width:160px;
      padding:6px;
      background:#fff;
      border:1px solid var(--btn-border);
      border-radius:4px;
      box-shadow:0 10px 24px rgba(0,0,0,.08);
      z-index:50;
    }
    /* Hidden by default; revealed by JS by adding the .open class */
    .fileDropdown .menu { display: none; }
    .fileDropdown.open .menu { display: block; }
    .menuItem{
      width:100%;
      text-align:left;
      padding:8px 10px;
      border:0;
      border-radius:4px;
      background:#fff;
      cursor:pointer;
      font:inherit;
      color:var(--text);
    }
    .menuItem:hover{ background:#f4f4f4; }
    .menuItem:active{ background:#e8e8e8; }
    .menuItem:disabled,
    .menuItem[aria-disabled="true"] { opacity: var(--interactive-disabled); cursor: not-allowed; }
    .menuItem:focus,
    .menuItem:focus-visible{ outline:2px solid var(--selection-border); outline-offset:2px; }
    .menuItemWithSubmenu{
      position:relative;
    }
    .submenuTrigger{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:8px;
    }
    .nestedMenu{
      position:absolute;
      top:-6px;
      left:calc(100% - 2px);
      min-width:220px;
      padding:6px;
      background:#fff;
      border:1px solid var(--btn-border);
      border-radius:4px;
      box-shadow:0 10px 24px rgba(0,0,0,.08);
      z-index:60;
      display:none;
    }
    .menuItemWithSubmenu:hover > .nestedMenu,
    .menuItemWithSubmenu:focus-within > .nestedMenu,
    .menuItemWithSubmenu.open > .nestedMenu{
      display:block;
    }
    .menuItemWithSubmenu.submenuDisabled > .nestedMenu{
      display:none;
    }
    .menuHelperText{
      padding:6px 10px;
      font-size:12px;
      color:var(--muted);
      cursor:default;
      user-select:none;
    }

#searchField{
      min-width:160px;
      padding:8px 10px;
      border:1px solid var(--btn-border);
      border-radius:4px;
      background:#fff;
    }

    #appLogo{
      font-size:18px;
      font-weight:600;
      margin-right:10px;
      white-space:nowrap;
    }

    #appLogo .appLogoMark{
      color:#222A68;
    }

    #appLogo .appLogoText{
      color:#222A68;
      font-weight: 700;
    }

    /* Layout */
    #main{
      --left-pane-width: 60%;
      --pane-divider-size: 12px;
      flex:1;
      min-height:0;
      display:flex;
      align-items:stretch;
      gap:0;
    }
    #treePane{
      width:var(--left-pane-width);
      flex:0 0 var(--left-pane-width);
      min-width:320px;
      border:1px solid var(--line);
      border-radius:var(--radius-lg);
      box-shadow:var(--shadow-sm);
      background:var(--color-surface-0);
      display:flex; flex-direction:column; min-height:0;
      overflow:hidden;
    }
    #paneDivider{
      flex:0 0 var(--pane-divider-size);
      width:var(--pane-divider-size);
      position:relative;
      cursor:col-resize;
      user-select:none;
      touch-action:none;
      outline:none;
      z-index:25;
    }
    #paneDivider::before{
      content:"";
      position:absolute;
      top:4px;
      bottom:4px;
      left:50%;
      width:2px;
      transform:translateX(-50%);
      background:var(--line);
      border-radius:999px;
      transition:background-color .12s ease;
    }
    #paneDivider:hover::before,
    body.pane-resizing #paneDivider::before{
      background:#222A68;
    }
    #paneDivider:focus-visible{
      box-shadow: inset 0 0 0 2px rgba(34, 42, 104, 0.35);
      border-radius:10px;
    }
    #detailPane{
      flex:1 1 auto;
      min-width:360px;
      display:flex; flex-direction:column; min-height:0;
      border:1px solid var(--line);
      border-radius:var(--radius-lg);
      box-shadow:var(--shadow-sm);
      background:var(--color-surface-0);
      overflow:hidden;
    }
    body.right-pane-collapsed #detailPane{
      display:none;
    }
    body.right-pane-collapsed #paneDivider{
      display:none;
    }
    body.right-pane-collapsed #treePane{
      width:100%;
      flex:1 1 auto;
      border-right:none;
    }
    #detailPane .paneBody {
      padding: 0;
      display: flex;
      flex-direction: column;
      flex: 1 1 auto;
      min-height: 0;
    }
    .paneHeader {
      display:flex;
      align-items:center;
      justify-content:space-between;
      flex-wrap:wrap;
      gap:var(--space-4);
      padding:var(--space-5) var(--space-6);
      border-bottom:1px solid var(--line);
      background:var(--color-surface-1);
      height:60px; min-height:60px;
      /* font-weight:700; */
    }
.paneBody{ padding:12px; overflow:auto; min-height:0; }

#treePane {
  position: relative;
}

#treePaneHeader.treeSidebar {
  --tree-sidebar-collapsed-width: 56px;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--tree-sidebar-collapsed-width);
  min-height: 0;
  height: auto;
  padding: 0;
  border-bottom: none;
  border-right: 1px solid var(--line);
  background: var(--color-surface-1);
  z-index: 30;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  overflow: visible;
  flex-wrap: nowrap;
}

body.mobile-mode #treePaneHeader.treeSidebar,
body.mobile-mode #treePaneHeader.treeSidebar:hover,
body.mobile-mode #treePaneHeader.treeSidebar:focus-within,
body.mobile-mode #treePaneHeader.treeSidebar.search-active,
body.mobile-mode #treePaneHeader.treeSidebar.has-onboarding-hint {
  display: none !important;
}

body.mobile-mode #treePane .paneBody {
  padding-left: 12px;
}

body.mobile-mode #treePaneHeader .buttonRow {
  flex-direction: row;
  flex-wrap: wrap;
}

body.mobile-mode .treeSidebarActionBtn .treeSidebarLabel,
body.mobile-mode .treeSidebarActionBtn .treeSidebarCaret {
  display: inline;
}

body.mobile-mode #treePaneHeader #searchField {
  display: block;
}

.treeFloatingSearchBar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 40;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--color-surface-0);
  box-shadow: var(--shadow-sm);
}

#treePane.tree-search-open .treeFloatingSearchBar {
  display: flex;
}

.treeFloatingSearchLabel {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.treeFloatingSearchInputHost {
  flex: 1 1 auto;
  min-width: 0;
}

.treeFloatingSearchInputHost #searchField {
  width: 100%;
  min-width: 0;
}

.treeFloatingSearchCloseBtn {
  padding: 6px;
  min-width: 32px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#treePane .paneBody {
  padding-left: calc(12px + 56px);
}

.treeSidebarRail {
  height: 100%;
  min-height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px 8px;
  justify-content: flex-start;
}

#treePaneHeader.has-onboarding-hint {
  align-items: stretch;
}

.onboardingHintBanner {
  position: relative;
  z-index: 30;
}

#topbar #logTitle {
  font-size: 18px;
  color: #222A68;
  font-weight: 400;
  white-space: nowrap;
  margin-right: auto;
}

#topbar #shareBtn,
#topbar #notificationsBtn,
#topbar #userMenuBtn {
  background: transparent;
}

#topbar #shareBtn:hover,
#topbar #notificationsBtn:hover,
#topbar #userMenuBtn:hover {
  background-color: var(--interactive-hover);
  color: #fff;
}

#topbar #userMenuBtn:hover span {
  color: #fff !important;
}

#treePaneHeader .buttonRow {
  margin: 0;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  width: 100%;
  overflow: visible;
}

#treePaneHeader.treeSidebar .btn,
#treePaneHeader.treeSidebar .p-button {
  background: transparent;
  border-color: transparent;
}

#treePaneHeader.treeSidebar .btn:hover,
#treePaneHeader.treeSidebar .p-button:hover {
  background-color: var(--interactive-hover);
  color: var(--color-brand-contrast);
  border-color: transparent;
}

#treePaneHeader.treeSidebar .btn:active,
#treePaneHeader.treeSidebar .p-button:active {
  background-color: var(--color-surface-1);
  color: var(--color-text);
}

.treeSidebarPrimaryActions {
  align-items: stretch;
}

.treeSidebarActionBtn {
  width: 100%;
  min-width: 0;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 0 10px;
  text-align: left;
}

.treeSidebarActionBtn .treeSidebarLabel,
.treeSidebarActionBtn .treeSidebarCaret {
  display: none;
}

#treePaneHeader .fileDropdown {
  width: 100%;
}

#treePaneHeader .fileDropdown > .menu {
  left: calc(100% + 8px);
  top: 0;
}

#treePaneHeader #searchField {
  width: 100%;
  min-width: 0;
  display: none;
}

.treeSidebarSearchWrap,
.treeSidebarFiltersWrap {
  width: 100%;
}

.treeSidebarSearchWrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#treePaneHeader.treeSidebar:hover .treeSidebarSearchWrap #searchField,
#treePaneHeader.treeSidebar:focus-within .treeSidebarSearchWrap #searchField,
#treePaneHeader.treeSidebar.search-active .treeSidebarSearchWrap #searchField,
#treePaneHeader.treeSidebar.has-onboarding-hint .treeSidebarSearchWrap #searchField {
  display: block;
}

@media (max-width: 900px) {
  #treePane.tree-search-open .treeFloatingSearchBar {
    display: flex;
  }
}

@media (max-width: 680px) {
  .cookieNoticeBanner {
    padding: 10px 12px;
  }
  .cookieNoticeText {
    font-size: 12px;
  }
}

.treeHeaderOverflowItem {
  display: block;
  width: 100%;
}

.treeHeaderOverflowItem > .btn,
.treeHeaderOverflowItem > .fileDropdown > button,
.treeHeaderOverflowItem > .fileDropdown > .btn {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

.treeHeaderOverflowItem > .fileDropdown {
  display: block;
  width: 100%;
}

.treeHeaderOverflowItem > .fileDropdown > .menu {
  left: calc(100% + 6px);
  top: 0;
}

.material-symbols-rounded {
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.ijBadge {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 4px;
  border: 1px solid var(--btn-border);
  background: #fff;
}
.ijBadge.pos { background:#f0fff4; border-color:#9ad0a6; color:#1a7f37; }
.ijBadge.neg { background:#fff1f1; border-color:#e2a6a6; color:#8a1f1f; }

.btn .material-symbols-rounded {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ijEditor {
  border: none;
  border-radius: 10px;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 160px;
}
.ijEditorBar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--btn-border);
  background: #fafafa;
}
.ijEditorTabs {
  display: inline-flex;
  gap: 6px;
}
.ijEditorTab {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}
.ijEditorTab.active {
  background: #fff;
  border-color: var(--btn-border);
}
.ijEditorStatus {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}
.ijEditorDirty {
  display: inline-flex;
  padding: 2px 6px;
  border-radius: 999px;
  background: #fff1d6;
  color: #FFB100;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 10px;
}
.ijEditorSaved {
  font-size: 12px;
}
.ijEditorBody {
  position: relative;
  padding: 8px;
}
.ijEditorStatusRow {
  margin-top: 8px;
}
.ijEditorSurface {
  min-height: 140px;
  outline: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ijEditorInput {
  width: 100%;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font: inherit;
  line-height: 1.45;
  resize: vertical;
  background: #fff;
}
.ijEditorInput:focus {
  box-shadow: 0 0 0 3px rgba(185, 201, 239, 0.25);
}
.ijEditorInput[readonly] {
  background: #f5f5f5;
}
.ijEditorInput::placeholder {
  color: var(--muted);
}
.ijEditorToolbar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 0 6px;
  border-radius: 0;
  background: transparent;
  border: none;
  margin-bottom: 8px;
  z-index: 2;
}
.ijEditorToolbarActions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.ijEditorToolbarStatus {
  margin-left: auto;
}
.ijEditorTool {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 6px;
  border: none;
  background: #f7f7f7;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ijEditorToolIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: normal;
  font-size: 18px;
}

.agreementTab {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.agreementBlock {
  padding: 14px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.agreementTab .agreementBlock + .agreementBlock {
  border-top: 1px solid var(--line);
}

.participantsNoSelectionTab .agreementBlock {
  padding-left: 10px;
  padding-right: 10px;
}

.agreementBlockTitle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 10px;
}

.agreementStatusIcon {
  font-size: 18px;
  color: var(--brand);
}

.agreementStatusValue {
  font-weight: 700;
  font-size: 16px;
  color: #1f1f1f;
}

.agreementExplanationBody {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.typeOptionGrid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.typeOptionGrid .p-button {
  min-width: 120px;
}
.ijEditorPreview {
  min-height: 140px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

blockquote {
  margin: 10px 0;
  padding: 8px 12px;
  border-left: 3px solid #b9c9ef;
  background: #f7f9ff;
  color: #2e3a59;
}

    .logTitleHeader {
      font-size: 28px; /* Twice the base font size of 14px */
      font-weight: 400;
      line-height: 1.2;
    }
    .detailPaneDecisionTitle {
      font-size: 18px;
      color: #222A68;
      font-weight: 400;
      line-height: 1.2;
    }

    /* Tree */
    #rootDrop{
      border:1px dashed var(--btn-border);
      border-radius:4px;
      padding:8px 10px;
      color:var(--muted);
      margin-bottom:10px;
      background:#fff;
      user-select:none;
    }
    #rootDrop.dropOn{ outline:2px solid rgba(159,185,255,.45); color:var(--text); }

    ul.tree{ list-style:none; margin:0; padding-left:0; }
    ul.tree.children{ padding-left:0px; } /* indent */
    li.node{ margin:0; }

    .nodeRow{
      display:flex; align-items:flex-start; gap:8px;
      padding:6px 8px;
      border:1px solid transparent;
      border-radius:4px;
      user-select:none;
      background:#fff;
    }
    .nodeRow:hover{ background:#f7f7f7; }
    .nodeRow.selected,
    .tree-table-row.selected,
    .tree-table-row[aria-selected="true"],
    .p-datatable .p-datatable-tbody > tr.p-datatable-row-selected {
      border-left: 3px solid #222A68 !important;
      background: inherit !important;
      outline: none !important;
      box-shadow: none !important;
    }


    /* while dragging, show containers around all other decisions */
    body.dragging .nodeRow{ border-color:#d1d5db; }
    body.dragging, body.dragging *{ cursor:grabbing !important; } /* required grabbing cursor */

    .toggle{
      width:18px; flex:0 0 18px;
      display:flex; align-items:center; justify-content:center;
      cursor:pointer;
      color:var(--muted);
      margin-top:1px;
    }
    .toggle.inactive{ opacity:.25; cursor:default; }

    .nodeTextWrap{
      flex:1; min-width:0;
      cursor:pointer;
      white-space:normal; /* wrap */
      overflow-wrap:anywhere;
      padding:2px 4px;
      border-radius:4px;
    }
    .nodeTextWrap.highlight{ background:var(--highlight); }
    .idSuffix{ color:var(--muted); font-size:12px; margin-left:6px; }

    /* highlight parent candidate while dragging */
    .dropInside{ outline:2px solid rgba(159,185,255,.55); outline-offset:2px; }
    .dropBefore{ border-top:2px solid var(--drop); }
    .dropAfter{ border-bottom:2px solid var(--drop); }

    /* Detail */
    textarea#decisionText{
      width:100%;
      min-height:180px;
      resize:vertical;
      padding:10px;
      border:1px solid var(--btn-border);
      border-radius:4px;
      background:#fff;
    }
    .buttonRow{ display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }

    .section{ margin-top:0; padding-top:12px; }
    .section + .section{ margin-top:14px; border-top:1px solid var(--line); }
    .sectionTitle{ font-weight:800; margin-bottom:8px; }

    .mdPreview p{ margin:0; padding:0; }
    .mdPreview h1,.mdPreview h2,.mdPreview h3{ margin:0 0 6px; line-height:1.25; }
    .mdPreview ul{ margin:0 0 0 18px; padding-left:16px; list-style:disc; list-style-position: outside; }
    .mdPreview ol{ margin:0 0 0 18px; padding-left:16px; list-style:decimal; list-style-position: outside; }
    .mdPreview li{ margin:0; padding:0; }
    .mdPreview code{ background:#f4f4f4; padding:1px 4px; border-radius:6px; font-size:12px; }

    /* Similar decisions (detail pane) */
    .similarDecisionItem{
      cursor:pointer;
      display:inline-block;
      padding:2px 8px;
      border-radius:4px;
      border:3px solid transparent;
    }
    .similarDecisionItem.highlight{ background:transparent; border-color:#FFE347; }

    /* Concepts */
    .conceptList{ display:flex; flex-wrap:wrap; gap:8px; }
    .conceptChip{
      border:1px solid var(--btn-border);
      border-radius:16px;
      padding:6px 10px;
      background:#fff;
      color:var(--color-text);
      cursor:pointer;
      font-size:13px;
      user-select:none;
      transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
    }
    .conceptChip:hover{
      background:#222A68;
      color:#ffffff;
      border-color:#222A68;
    }
    .conceptChip.selected,
    .conceptChip.selected:hover{
      background:#222A68;
      color:#ffffff;
      border-color:#222A68;
    }

    /* Change log */
    .logItem{
      padding:8px 10px;
      border:1px solid var(--btn-border);
      border-radius:4px;
      background:#fff;
      cursor:pointer;
      margin:8px 0;
      user-select:none;
    }
    .logItem:hover{ border-color:#bfbfbf; }
    .logMeta{ color:var(--muted); font-size:12px; margin-top:2px; }
    .logDetail{ margin-top:8px; color:var(--text); }
    .logDetail ul{ margin:6px 0 0 18px; }
    .logDetail li{ margin:4px 0; }

    @media (max-width: 900px){
      #main{ flex-direction:column; }
      #paneDivider{ display:none; }
      #treePane,#detailPane{ width:100%; }
      #treePane,#detailPane{ min-width:0; }
      #treePane{ border-right:none; border-bottom:1px solid var(--line); }
      #treePaneHeader.treeSidebar {
        position: static;
        width: 100%;
        height: auto;
        min-height: 0;
        border-right: none;
        border-bottom: 1px solid var(--line);
        box-shadow: none;
      }
      #treePaneHeader.treeSidebar .treeSidebarRail {
        min-height: 0;
      }
      #treePaneHeader .buttonRow {
        flex-direction: row;
        flex-wrap: wrap;
      }
      #treePane .paneBody {
        padding-left: 12px;
      }
      .treeSidebarActionBtn .treeSidebarLabel,
      .treeSidebarActionBtn .treeSidebarCaret {
        display: inline;
      }
      #treePaneHeader #searchField {
        display: block;
      }
    }

/* Modal (Sharing) */
.modalOverlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.22);
  display:none;
  align-items:center;
  justify-content:center;
  padding:16px;
  z-index:999;
}
.modalOverlay.show{ display:flex; }
.modalCard{
  width:min(720px, 100%);
  background:#fff;
  border:1px solid var(--btn-border);
  border-radius:4px;
  box-shadow:0 18px 60px rgba(0,0,0,.18);
  overflow:hidden;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
.modalHeader{
  padding:12px 14px;
  background:#fafafa;
  border-bottom:1px solid var(--btn-border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  font-weight:900;
}
.modalBody{ padding:14px; }
.modalFooter{
  padding:12px 14px;
  border-top:1px solid var(--btn-border);
  background:#fafafa;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  flex-wrap:wrap;
}

.nodeImageAttachmentsList {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.nodeImageAttachmentRow {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--btn-border);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.nodeImageThumbBtn {
  border: 1px solid var(--btn-border);
  border-radius: 8px;
  background: #fff;
  padding: 0;
  width: 64px;
  height: 64px;
  overflow: hidden;
  cursor: pointer;
}

.nodeImageThumbBtn--nonImage {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text);
}

.nodeFileThumbIcon {
  font-size: 26px;
  line-height: 1;
}

.nodeFileThumbExt {
  line-height: 1;
}

.nodeImageThumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nodeImageAttachmentActions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nodeImageGalleryModalCard {
  width: min(1000px, 96vw);
}

.nodeImageGalleryModalBody {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.nodeImageGalleryViewport {
  min-height: 60vh;
  max-height: 72vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f8f8;
  border: 1px solid var(--btn-border);
  border-radius: 8px;
  overflow: hidden;
}

.nodeImageGalleryImg {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  display: block;
}

.nodeImageGalleryNavBtn {
  min-width: 44px;
}

@media (max-width: 900px) {
  .nodeImageAttachmentRow {
    grid-template-columns: 64px 1fr;
  }

  .nodeImageAttachmentActions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .nodeImageGalleryModalBody {
    grid-template-columns: 1fr;
  }

  .nodeImageGalleryNavBtn {
    width: 100%;
  }
}
.vueFiltersBtnWrap {
  position: relative;
  display: inline-flex;
  align-self: center;
}
.vueFiltersBtnWrap .filter-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: #222A68;
  color: white;
  border-radius: 10px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: bold;
  line-height: 1.5;
  min-width: 18px;
  text-align: center;
  box-sizing: border-box;
  border: 1px solid white;
}
.vueFilterList {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.vueFilterRow {
  display: grid;
  grid-template-columns: auto auto auto minmax(120px, 1fr) auto;
  gap: 8px;
  align-items: center;
}
@media (max-width: 900px) {
  .vueFilterRow {
    grid-template-columns: 1fr;
  }
}
.fieldLabel{ font-weight:800; margin:10px 0 6px; }
.fieldLabel{ color:var(--color-text); }
.fieldHelp{ color:#5b6472; font-size:12px; margin-top:6px; }
textarea.modalTextarea{
  width:100%;
  min-height:92px;
  resize:vertical;
  padding:10px;
  border:1px solid var(--btn-border);
  border-radius:4px;
  background:#fff;
}
select.modalSelect{
  padding:8px 10px;
  border:1px solid var(--btn-border);
  border-radius:4px;
  background:#fff;
}
.memberRow{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:8px 10px;
  border:1px solid var(--btn-border);
  border-radius:4px;
  background:#fff;
  margin:8px 0;
  align-items:center;
  flex-wrap:wrap;
}
.userPhoto {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}
.topbarOrganizationLabel {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  margin-right: 8px;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.userMenuBtn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 2px 6px;
}
.userMenuBtn:hover {
  background-color: var(--interactive-hover);
  color: var(--color-brand-contrast);
}
#topbar .userMenuBtn:active,
#topbar .userMenuBtn:focus,
#topbar .userMenuBtn:focus-visible {
  background-color: transparent;
}

#topbar #userDropdown > .menu {
  left: auto;
  right: 0;
  max-width: calc(100vw - 16px);
}

#topbar #userDropdown > .menu .menuItem {
  white-space: normal;
  overflow-wrap: anywhere;
}
.memberMeta{ color:var(--muted); font-size:12px; }
.pill{ padding:2px 8px; border:1px solid var(--btn-border); border-radius:4px; background:#fff; font-size:12px; font-weight:800; }

/* Detail sidebar navigation */
.detailSidebarLayout {
  --detail-sidebar-collapsed-width: 56px;
  --detail-sidebar-expanded-width: min(220px, calc(100% - 24px));
  display: flex;
  min-height: 0;
  height: 100%;
  flex: 1 1 auto;
  align-items: stretch;
  position: relative;
}

.detailSidebarRail {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--detail-sidebar-collapsed-width);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 8px;
  border-right: 1px solid var(--line);
  background: var(--color-surface-1);
  min-height: 0;
  overflow: visible;
}

body.mobile-mode .detailSidebarRail,
body.mobile-mode .detailSidebarRail:hover,
body.mobile-mode .detailSidebarRail:focus-within {
  width: var(--detail-sidebar-collapsed-width);
  box-shadow: none;
}

.detailSidebarBtn {
  width: 100%;
  height: 40px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.detailSidebarBtn .treeSidebarLabel {
  display: none;
  white-space: nowrap;
}

body.mobile-mode .detailSidebarRail .detailSidebarBtn,
body.mobile-mode .detailSidebarRail:hover .detailSidebarBtn,
body.mobile-mode .detailSidebarRail:focus-within .detailSidebarBtn {
  justify-content: center;
}

body.mobile-mode .detailSidebarRail .detailSidebarBtn .treeSidebarLabel,
body.mobile-mode .detailSidebarRail:hover .detailSidebarBtn .treeSidebarLabel,
body.mobile-mode .detailSidebarRail:focus-within .detailSidebarBtn .treeSidebarLabel {
  display: none;
}

.detailSidebarBtn .material-symbols-rounded {
  font-size: 20px;
  line-height: 1;
}

.detailSidebarBtn:hover {
  background-color: var(--interactive-hover);
  color: var(--color-brand-contrast);
}

.detailSidebarBtn.active {
  color: var(--color-brand-contrast);
  background: var(--interactive-hover);
  border-color: transparent;
}

.detailSidebarBranchDropdown {
  width: 100%;
  position: relative;
}

.detailSidebarBranchDropdown > .menu {
  left: calc(100% + 8px);
  top: 0;
}

.detailActionsDropdown > .menu {
  left: auto;
  right: 0;
  max-width: min(320px, calc(100vw - 32px));
}

.detailActionsDropdown > .menu .menuItem {
  white-space: normal;
}

.detailSidebarBadge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  border: 1px solid var(--color-surface-0);
  background: var(--color-brand);
  color: var(--color-brand-contrast);
  font-size: 10px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.detailSidebarContent {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
  padding-left: calc(12px + var(--detail-sidebar-collapsed-width));
}

.detailSidebarPanel {
  display: none;
}

.detailSidebarPanel.active {
  display: block;
}

.detailSidebarPanel#detail-panel-details.active {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.detailTabEditorFill {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.detailBlockEditorFill {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 200px;
  padding: 0;
}

.detailEditorFillHost {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.detailEditorFillHost .ijEditor {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 200px;
  height: 100%;
}

.detailEditorFillHost .ijEditorBody {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.detailEditorFillHost .ijEditorInput {
  flex: 1 1 auto;
  min-height: 0;
}

/* Vue phase-1 shell helpers */
.vueModeBadge {
  font-size: 12px;
  color: #222A68;
  border: 1px solid var(--btn-border);
  border-radius: 999px;
  padding: 3px 8px;
  background: #fff;
}

.vueRolePill {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--btn-border);
  border-radius: 999px;
  padding: 3px 8px;
  background: #fff;
}

.vueStubBlock {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.vueStubTitle {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.vueStubText {
  margin: 6px 0;
  color: var(--muted);
}

.vueStubActions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.vuePaneHeaderTitle {
  font-size: 14px;
  color: var(--muted);
  display: flex;
  align-items: center;
  height: 100%;
}

/* Phase B: cross-mode chrome convergence */
.chromeActionPrimary,
.btn.chromeActionPrimary,
.p-button.chromeActionPrimary {
  background: var(--color-brand);
  border-color: var(--color-brand);
  color: var(--color-primary);
}

.chromeActionPrimary:hover,
.btn.chromeActionPrimary:hover,
.p-button.chromeActionPrimary:hover {
  background: var(--interactive-hover);
  border-color: var(--interactive-hover);
  color: var(--color-brand-contrast);
}

.chromeActionPrimary:active,
.btn.chromeActionPrimary:active,
.p-button.chromeActionPrimary:active,
.p-button.chromeActionPrimary:not(.p-disabled):focus:active {
  background: var(--interactive-active);
  border-color: var(--interactive-active);
  color: var(--color-brand-contrast);
}

.chromeActionSecondary,
.btn.chromeActionSecondary,
.p-button.chromeActionSecondary {
  background: var(--color-surface-0);
  border-color: var(--btn-border);
  color: var(--color-text);
}

.chromeActionSecondary:hover,
.btn.chromeActionSecondary:hover,
.p-button.chromeActionSecondary:hover {
  background: #f7f7f7;
  border-color: var(--selection-border);
  color: var(--color-text);
}

.chromeActionSecondary:active,
.btn.chromeActionSecondary:active,
.p-button.chromeActionSecondary:active,
.p-button.chromeActionSecondary:not(.p-disabled):focus:active {
  background: #eceff5;
  border-color: var(--selection-border);
  color: var(--color-text);
}

.chromeActionTertiary,
.btn.chromeActionTertiary,
.p-button.chromeActionTertiary {
  background: transparent;
  border-color: transparent;
  color: var(--color-muted);
}

.chromeActionTertiary:hover,
.btn.chromeActionTertiary:hover,
.p-button.chromeActionTertiary:hover {
  background: #f8fafc;
  border-color: var(--line);
  color: var(--color-text);
}

.chromeActionTertiary:active,
.btn.chromeActionTertiary:active,
.p-button.chromeActionTertiary:active,
.p-button.chromeActionTertiary:not(.p-disabled):focus:active {
  background: #eef2f7;
  border-color: var(--line);
  color: var(--color-text);
}

.chromeActionPrimary:disabled,
.chromeActionSecondary:disabled,
.btn.chromeActionPrimary:disabled,
.btn.chromeActionSecondary:disabled,
.p-button.chromeActionPrimary.p-disabled,
.p-button.chromeActionSecondary.p-disabled,
.p-button:disabled,
.detailSidebarBtn:disabled {
  opacity: var(--interactive-disabled);
  cursor: not-allowed;
}

.chromeActionPrimary:disabled,
.btn.chromeActionPrimary:disabled,
.p-button.chromeActionPrimary.p-disabled {
  color: var(--color-muted);
}

.btn:focus-visible,
.p-button:focus-visible,
.detailSidebarBtn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.p-inputtext:focus-visible,
.p-select.p-focus,
.p-tab:focus-visible {
  outline: 2px solid var(--color-focus-strong);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(12, 206, 107, 0.25);
}

#searchField:focus,
#searchField:focus-visible,
.vueSearchInputWrap:focus-within,
.vueFiltersBtnWrap:focus-within,
#filtersBtnWrapper:focus-within,
.legacyFiltersBtnWrap:focus-within,
#notificationsBtnWrapper:focus-within {
  outline: 2px solid var(--color-focus-strong);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(12, 206, 107, 0.2);
}

.vueSearchInputWrap:focus-within {
  border-color: var(--color-focus-strong);
}

.btn.loading,
.p-button.p-button-loading,
[aria-busy="true"].btn,
[aria-busy="true"].p-button {
  cursor: wait;
  opacity: 0.9;
}

.btn.loading::after,
.p-button.p-button-loading .p-button-loading-icon {
  border-top-color: var(--interactive-active);
}

.loading-spinner,
.p-progressspinner,
.p-progress-spinner {
  color: var(--interactive-active);
}

.chromeLoadingMessage {
  color: var(--color-muted);
  font-weight: 500;
}

.chromeEmptyState {
  border-style: dashed;
  border-color: #cbd5e1;
  background: #f8fafc;
}

.chromeEmptyStateText,
.vueStubText {
  color: var(--color-muted);
  line-height: 1.45;
}

.chromeStatusSurface {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  background: var(--color-surface-0);
}

.chromeStatusActionRow {
  margin-bottom: var(--space-3);
}

.chromeStatusMessage {
  margin-top: var(--space-2);
}

.chromeStatusMessage--saving .p-message-text,
.chromeStatusMessage--saving {
  color: #1e40af;
}

.chromeStatusMessage--success .p-message-text,
.chromeStatusMessage--success {
  color: var(--color-success);
}

.chromeStatusMessage--error .p-message-text,
.chromeStatusMessage--error {
  color: var(--color-danger);
}

.chromeStatusMessage--warn .p-message-text,
.chromeStatusMessage--warn {
  color: var(--color-warn);
}

#treePane,
#detailPane {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/* Single-seam ownership: pane containers own the top/main divider line */
body #topbar {
  border-bottom: 0;
}

#topbar,
#treePaneHeader,
#detailPaneHeader,
.modalHeader,
.modalFooter,
.detailSidebarRail {
  background: var(--color-surface-1);
}

#treePaneHeader,
#detailPaneHeader,
.paneHeader {
  padding: var(--space-5) var(--space-6);
  gap: var(--space-4);
  border-bottom: 1px solid var(--line);
}

#treePaneHeader .buttonRow,
.treeHeaderSearchRow {
  gap: var(--space-3);
}

#treePaneHeader .btn,
#treePaneHeader .p-button,
#detailPaneHeader .p-button,
#topbar .btn,
#topbar .p-button {
  min-height: 34px;
  border-radius: var(--radius-md);
}

#treePaneHeader:not(.treeSidebar) .btn,
#treePaneHeader:not(.treeSidebar) .p-button,
#topbar .btn,
#topbar .p-button {
  background: var(--color-surface-0);
}

.ijBadge,
.pill,
.vueFiltersBtnWrap .filter-badge {
  border-radius: 999px;
}

.vueFiltersBtnWrap .filter-badge {
  background: var(--color-brand);
  color: var(--color-brand-contrast);
  border-color: var(--color-surface-0);
  box-shadow: var(--shadow-sm);
}

.vueFiltersBtnWrap.is-active .p-button,
.legacyFiltersBtnWrap.is-active #filtersBtn,
#filtersBtnWrapper:has(.filter-badge) #filtersBtn,
.legacyFiltersBtnWrap:has(.filter-badge) #filtersBtn {
  border-color: var(--selection-border);
  background: #eef3ff;
  color: #1f2a5f;
}

#filtersBtnWrapper .filter-badge,
#notificationsBtnWrapper .notification-badge {
  border-radius: 999px;
  border: 1px solid var(--color-surface-0);
  box-shadow: var(--shadow-sm);
}

#filtersBtnWrapper .filter-badge,
.vueFiltersBtnWrap .filter-badge {
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
}

input::placeholder,
textarea::placeholder,
.p-inputtext::placeholder {
  color: #64748b;
  opacity: 1;
}

.detailSidebarRail {
  border-right: 1px solid var(--line);
}

.modalCard {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
