:root {
  --bg-cream: #f8f0e4;
  --bg-sky: #dceef2;
  --ink: #1f3440;
  --muted: #5b7077;
  --panel: #ffffffd9;
  --border: #d0dde1;
  --brand: #0f7f8d;
  --brand-soft: #d9f4f2;
  --accent: #f4b942;
  --danger: #d14a4a;
  --shadow: 0 20px 45px rgba(16, 42, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Manrope", "Segoe UI", sans-serif;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 20% 10%, #ffffffab 0 16%, transparent 44%),
    radial-gradient(circle at 82% 18%, #f6d9a461 0 14%, transparent 45%),
    linear-gradient(160deg, var(--bg-cream) 0%, #edf9f3 52%, var(--bg-sky) 100%);
  min-height: 100vh;
}

body.theme-dark {
  --bg-cream: #0d1419;
  --bg-sky: #0f1a22;
  --ink: #e6f0f5;
  --muted: #98acb8;
  --panel: #111b22de;
  --border: #273946;
  --brand: #2ab8c6;
  --brand-soft: #15313b;
  --accent: #f2bd63;
  --danger: #e76464;
  --shadow: 0 20px 45px rgba(0, 0, 0, 0.42);
  color-scheme: dark;
  background:
    radial-gradient(circle at 12% 8%, #2bb9c81f 0 20%, transparent 52%),
    radial-gradient(circle at 86% 14%, #f2bd631c 0 16%, transparent 50%),
    linear-gradient(160deg, var(--bg-cream) 0%, #0d161d 50%, var(--bg-sky) 100%);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: "Fraunces", "Times New Roman", serif;
}

p {
  margin: 0;
}

.sky-scene {
  position: fixed;
  inset: -12%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  --moon-x: -20%;
  --moon-y: 72%;
  --moon-rotation: 0deg;
  --star-rotation: 0deg;
  --moon-opacity: 0;
  --stars-opacity: 0;
  --glow-opacity: 0;
  --moon-phase-shadow-shift: 0%;
  --moon-phase-shadow-opacity: 0.85;
  transition: opacity 360ms ease;
}

body.theme-enhanced .sky-scene {
  opacity: 1;
  visibility: visible;
}

.sky-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 16%, #ffffff52 0, #ffffff00 54%);
  opacity: 0.5;
}

.sky-scene.is-visible::before {
  opacity: 0.8;
}

.sky-stars {
  position: absolute;
  inset: 0;
  transform-origin: center center;
  transform: rotate(var(--star-rotation));
  opacity: var(--stars-opacity);
  transition: transform 88s ease, opacity 1.4s ease;
}

body:not(.theme-dark) .sky-stars {
  opacity: 0 !important;
}

.sky-star {
  position: absolute;
  border-radius: 999px;
  background: #fff9da;
  box-shadow: 0 0 8px #fff7be80;
  animation: sky-star-twinkle 20s ease-in-out infinite;
}

.sky-clouds {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.sky-cloud {
  position: absolute;
  left: -36vw;
  width: clamp(150px, 18vw, 340px);
  height: clamp(46px, 5.8vw, 112px);
  border-radius: 999px;
  opacity: var(--cloud-opacity, 0.2);
  transform: translateX(-30vw) scale(var(--cloud-scale, 1));
  animation: sky-cloud-drift var(--cloud-duration, 320s) linear infinite;
  animation-delay: var(--cloud-delay, 0s);
  background: linear-gradient(180deg, #ffffffad 0, #ffffff45 100%);
  box-shadow:
    inset 0 0 12px #ffffff4f,
    0 0 18px #ffffff38;
}

.sky-cloud::before,
.sky-cloud::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: inherit;
}

.sky-cloud::before {
  width: 36%;
  height: 72%;
  left: 14%;
  top: -32%;
}

.sky-cloud::after {
  width: 44%;
  height: 82%;
  right: 12%;
  top: -38%;
}

.sky-glow {
  position: absolute;
  width: 36vw;
  min-width: 240px;
  aspect-ratio: 1;
  border-radius: 50%;
  left: var(--moon-x);
  top: var(--moon-y);
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, #fff6be6e 0, #fff6be17 44%, #fff6be00 72%);
  opacity: var(--glow-opacity);
  transition: left 108s linear, top 108s linear, opacity 1.3s ease;
}


.sky-moon {
  position: absolute;
  left: var(--moon-x);
  top: var(--moon-y);
  width: clamp(82px, 9vw, 146px);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  transform: translate(-50%, -50%) rotate(var(--moon-rotation));
  background:
    radial-gradient(circle at 34% 30%, #fff7c7 0, #ffd15f 52%, #f3a820 100%),
    radial-gradient(circle at 64% 63%, #ffd7725e 0, #ffd77200 46%);
  box-shadow:
    0 0 55px #ffc3538c,
    inset -8px -10px 18px #d07f1b7d,
    inset 9px 8px 14px #fff8df8a;
  opacity: var(--moon-opacity);
  transition:
    left 108s linear,
    top 108s linear,
    transform 88s ease,
    opacity 1.3s ease;
}

.sky-moon::before {
  content: "";
  position: absolute;
  width: 18%;
  height: 18%;
  top: 24%;
  left: 18%;
  border-radius: 50%;
  background: #ffd88a54;
  box-shadow: 34px 38px 0 -2px #ffd88a3f;
}

.sky-moon::after {
  content: "";
  display: none;
}

.sky-moon-shadow-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 280ms ease;
}

body.theme-dark .sky-moon-shadow-canvas {
  opacity: 1;
}

.sky-fireflies {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.4s ease;
}

.sky-firefly {
  position: absolute;
  width: var(--firefly-size, 3px);
  height: var(--firefly-size, 3px);
  border-radius: 999px;
  background: #ffe181;
  box-shadow:
    0 0 12px #ffd876a0,
    0 0 24px #ffd87658;
  animation:
    sky-firefly-float var(--firefly-duration, 13s) ease-in-out infinite,
    sky-firefly-pulse 2.6s ease-in-out infinite;
  animation-delay: var(--firefly-delay, 0s), var(--firefly-delay, 0s);
}

@keyframes sky-star-twinkle {
  0% {
    opacity: 0.5;
    transform: scale(0.98);
  }
  50% {
    opacity: 0.84;
    transform: scale(1.04);
  }
  100% {
    opacity: 0.56;
    transform: scale(0.98);
  }
}

@keyframes sky-firefly-float {
  0% {
    transform: translate3d(0, 0, 0);
  }
  33% {
    transform: translate3d(6px, -12px, 0);
  }
  66% {
    transform: translate3d(-4px, -7px, 0);
  }
  100% {
    transform: translate3d(0, 0, 0);
  }
}

@keyframes sky-firefly-pulse {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

@keyframes sky-cloud-drift {
  0% {
    transform: translateX(-38vw) scale(var(--cloud-scale, 1));
    opacity: 0;
  }
  18% {
    opacity: var(--cloud-opacity, 0.2);
  }
  82% {
    opacity: var(--cloud-opacity, 0.2);
  }
  100% {
    transform: translateX(146vw) scale(var(--cloud-scale, 1));
    opacity: 0;
  }
}

.app-shell,
.reporting-shell {
  max-width: 1760px;
  margin: 0 auto;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  position: relative;
  z-index: 20;
}

.topbar-search-stack {
  width: min(920px, calc(100% - 240px));
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 12px;
}

.eyebrow {
  color: var(--brand);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.76rem;
  margin-bottom: 5px;
}

.topbar h1 {
  font-size: clamp(1.4rem, 2.7vw, 2.1rem);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.global-search {
  position: relative;
  width: min(760px, 100%);
  z-index: 70;
}

.global-search input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 12px 28px rgba(15, 61, 74, 0.1);
  font: inherit;
  font-size: 0.96rem;
  padding: 0.78rem 1.15rem;
  outline: none;
}

.global-search input:focus {
  border-color: #55aabe;
  box-shadow: 0 0 0 4px rgba(31, 168, 160, 0.16), 0 16px 34px rgba(15, 61, 74, 0.14);
}

.global-search-results {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 80;
  max-height: min(420px, 58vh);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 22px 60px rgba(15, 61, 74, 0.22);
  padding: 8px;
}

.global-search-results.is-open {
  display: grid;
  gap: 6px;
}

.global-search-result {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  padding: 10px 12px;
  text-align: left;
}

.global-search-result:hover,
.global-search-result.is-active {
  border-color: #b4d8e2;
  background: linear-gradient(120deg, #f7fcff, #edf8f5);
}

.global-search-load-more {
  width: 100%;
  display: grid;
  gap: 2px;
  justify-items: center;
  border: 1px dashed #9dcbd6;
  border-radius: 14px;
  background: rgba(239, 249, 250, 0.86);
  color: #0f7f8d;
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 900;
  padding: 10px 12px;
}

.global-search-load-more small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.global-search-load-more:hover:not(:disabled) {
  border-color: #55aabe;
  background: linear-gradient(120deg, #f7fcff, #edf8f5);
}

.global-search-load-more:disabled {
  cursor: wait;
  opacity: 0.72;
}

.global-search-result-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.global-search-result-main strong,
.global-search-result-main small,
.global-search-result-side span,
.global-search-result-side small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search-result-main small,
.global-search-result-side small,
.global-search-empty {
  color: var(--muted);
  font-size: 0.8rem;
}

.global-search-result-side {
  max-width: 220px;
  display: grid;
  justify-items: end;
  gap: 3px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #0f7f8d;
}

.global-search-empty {
  padding: 14px;
  text-align: center;
}

.button {
  border: 1px solid transparent;
  background: linear-gradient(120deg, #0f7f8d, #1fa8a0);
  color: #fff;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 127, 141, 0.24);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.button.ghost {
  background: #ffffff;
  color: var(--ink);
  border-color: var(--border);
}

.button.ghost.is-active {
  background: #eaf7ff;
  border-color: #9cc4d8;
  color: #0f5664;
}

.button.danger {
  background: linear-gradient(120deg, #b52a2a, #d14a4a);
}

.button.small {
  padding: 0.4rem 0.78rem;
  font-size: 0.78rem;
}

#download-data-export {
  min-width: 9.75rem;
}

.pill {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 0.35rem 0.72rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.profile-trigger {
  cursor: pointer;
  font: inherit;
  color: var(--ink);
}

.topbar > .profile-trigger {
  position: absolute;
  top: 18px;
  right: 20px;
  margin-top: 0;
  white-space: nowrap;
  z-index: 75;
}

.profile-trigger:hover {
  background: #f3fbfe;
}

.pill.small {
  padding: 0.18rem 0.5rem;
  font-size: 0.73rem;
}

.tabs-wrap {
  margin-top: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.demo-consult-cta {
  margin-top: 14px;
  border: 1px dashed #8bc2cd;
  border-radius: 16px;
  background: linear-gradient(130deg, #f9fffd, #e7f6f9);
  padding: 20px;
  display: grid;
  justify-items: center;
  gap: 8px;
}

html.public-demo-boot .demo-consult-cta {
  display: grid !important;
}

.consult-main {
  font-size: 1rem;
  padding: 0.7rem 1.4rem;
}

.consult-subline {
  font-size: 0.84rem;
  font-weight: 700;
  color: #517180;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pipeline-tabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pipeline-tabs-row .tabs {
  flex: 1;
}

.tabs-row-action {
  margin-left: auto;
  white-space: nowrap;
}

.tab-mode-pill {
  border: 1px solid #d7e4e9;
  border-radius: 999px;
  background: #fff;
  padding: 0.42rem 0.84rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.tab-button {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}

.tab-button.is-active {
  background: linear-gradient(120deg, #fffef5, #ffecc3);
  border-color: #f0cf80;
}

.sync-stamp {
  margin-top: 8px;
  font-size: 0.83rem;
  color: var(--muted);
}

.tasks-admin-controls {
  display: none;
  margin-top: 10px;
  border: 1px dashed #b8cbd2;
  border-radius: 10px;
  background: #f7fcfe;
  padding: 8px 10px;
}

.tasks-admin-controls.is-open {
  display: block;
}

.tasks-admin-title {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #4d6d77;
}

body.theme-dark .button.ghost {
  background: #182734;
  color: #d8e6ee;
  border-color: var(--border);
}

body.theme-dark .button.ghost.is-active {
  background: #173340;
  border-color: #2f6a7d;
  color: #cdf5ff;
}

body.theme-dark .pill {
  background: #182734;
  color: var(--ink);
}

body.theme-dark .profile-trigger:hover {
  background: #1b2f3b;
}

body.theme-dark .global-search input {
  background: #182734;
  color: var(--ink);
  border-color: var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 12px 28px rgba(0, 0, 0, 0.2);
}

body.theme-dark .global-search input:focus {
  border-color: #2f6a7d;
  box-shadow: 0 0 0 4px rgba(47, 106, 125, 0.28), 0 16px 34px rgba(0, 0, 0, 0.28);
}

body.theme-dark .global-search-results {
  background: rgba(18, 31, 41, 0.98);
  border-color: var(--border);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.36);
}

body.theme-dark .global-search-result {
  color: var(--ink);
}

body.theme-dark .global-search-result:hover,
body.theme-dark .global-search-result.is-active {
  border-color: #35505e;
  background: linear-gradient(120deg, #182734, #122b33);
}

body.theme-dark .global-search-load-more {
  border-color: #35505e;
  background: rgba(24, 39, 52, 0.82);
  color: #9de2ed;
}

body.theme-dark .global-search-load-more:hover:not(:disabled) {
  border-color: #477086;
  background: linear-gradient(120deg, #182734, #122b33);
}

body.theme-dark .global-search-result-side {
  color: #9de2ed;
}

body.theme-dark .demo-consult-cta {
  border: 1px dashed #2c6676;
  background: linear-gradient(130deg, #112229, #132e38);
}

body.theme-dark .consult-subline {
  color: #9fbbc7;
}

body.theme-dark .tab-mode-pill {
  border-color: var(--border);
  background: #182734;
  color: #b3c3cd;
}

body.theme-dark .tab-button {
  background: #182734;
}

body.theme-dark .tab-button.is-active {
  background: linear-gradient(120deg, #173340, #24495a);
  border-color: #3d7285;
  color: #d9f7ff;
}

body.theme-dark .reporting-hero {
  background:
    radial-gradient(circle at 8% 0%, #203a45d8 0 18%, transparent 42%),
    linear-gradient(135deg, #111f27f0, #152b34de);
}

body.theme-dark .tasks-admin-controls {
  border-color: #35505e;
  background: #121f29;
}

body.theme-dark .tasks-admin-title {
  color: #9eb5c0;
}

.tasks-admin-options {
  margin-top: 7px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.tasks-admin-options label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
}

.board-controls {
  margin-top: 10px;
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) repeat(2, minmax(140px, 1fr)) auto auto;
  gap: 8px;
  align-items: end;
}

.board-controls label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
}

.board-controls input,
.board-controls select {
  border: 1px solid #c5d4d9;
  background: #fff;
  border-radius: 9px;
  padding: 0.46rem 0.58rem;
  color: var(--ink);
  font-size: 0.84rem;
}

.board-controls select,
.priority-select,
.login-form select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(180deg, #ffffff, #f3f8fa),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath fill='%235b7077' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-size: auto, 14px;
  background-position: center, right 0.5rem center;
  padding-right: 1.7rem;
  border-color: #a9c0c8;
  box-shadow: inset 0 1px 2px rgba(16, 42, 51, 0.06);
}

.board-controls select:focus,
.priority-select:focus,
.login-form select:focus {
  outline: none;
  border-color: #0f7f8d;
  box-shadow: 0 0 0 3px rgba(15, 127, 141, 0.16);
}

.checkbox-control {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  margin-bottom: 5px;
}

.checkbox-control input {
  width: 16px;
  height: 16px;
}

.saved-views-control {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.saved-views-control label {
  min-width: 150px;
}

.filter-summary {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  justify-self: end;
  align-self: center;
}

.layout {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
}

.layout.is-board-only {
  grid-template-columns: minmax(0, 1fr);
}

.board-wrap {
  min-width: 0;
}

.board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 1fr);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-width: none;
}

.board::-webkit-scrollbar {
  display: none;
}

.board-scrollbar-proxy {
  display: none;
  position: fixed;
  bottom: 0;
  height: 22px;
  overflow: hidden;
  z-index: 90;
  border-top: 1px solid var(--border);
  background: rgba(248, 252, 252, 0.96);
  box-shadow: 0 -8px 22px rgba(16, 42, 51, 0.12);
  padding: 6px 10px;
}

.board-scrollbar-proxy.is-visible {
  display: block;
}

.board-scrollbar-proxy-track {
  position: relative;
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: rgba(15, 127, 141, 0.15);
  cursor: pointer;
}

.board-scrollbar-proxy-thumb {
  position: absolute;
  inset: 0 auto 0 0;
  min-width: 54px;
  border-radius: 999px;
  background: linear-gradient(180deg, #32c0ca, #128894);
  box-shadow: 0 2px 7px rgba(15, 61, 74, 0.24);
  cursor: grab;
  touch-action: none;
}

.board-scrollbar-proxy-thumb:active {
  cursor: grabbing;
}

.board-column {
  min-height: 68vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #fffdfaec 0%, #f7fbffea 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 10px 24px rgba(26, 42, 55, 0.08);
  backdrop-filter: blur(9px) saturate(120%);
}

.column-header {
  border-bottom: 1px solid #d8e4e8;
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.column-header h3 {
  font-size: 1.04rem;
}

.stage-settings-trigger {
  appearance: none;
  border: 0;
  border-bottom: 1px dashed currentColor;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: inherit;
  padding: 0;
  text-align: left;
}

.stage-settings-trigger:hover,
.stage-settings-trigger:focus-visible {
  color: var(--brand);
  outline: none;
}

.column-header p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.column-dropzone {
  min-height: 62vh;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-radius: 10px;
  transition: background-color 100ms ease;
}

.column-dropzone.is-over {
  background: var(--brand-soft);
}

.stage-load-more-button {
  width: 100%;
  margin-top: 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(23, 80, 95, 0.08);
  color: var(--text);
  font-weight: 800;
  padding: 10px 12px;
  cursor: pointer;
}

.stage-load-more-button:hover:not(:disabled),
.stage-load-more-button:focus-visible {
  border-color: var(--brand);
  color: var(--brand);
  outline: none;
}

.stage-load-more-button:disabled {
  cursor: progress;
  opacity: 0.72;
}

.opportunity-card {
  border: 1px solid #c5d8de;
  border-left: 6px solid var(--brand);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
  box-shadow: 0 10px 18px rgba(14, 48, 57, 0.09);
  cursor: grab;
}

.opportunity-card.is-dragging {
  opacity: 0.5;
}

.opportunity-card.is-stale {
  border-color: #df8f8f;
  border-left-color: var(--danger);
  box-shadow: 0 0 0 2px #df8f8f4d;
  animation: pulse-border 1.7s ease-in-out infinite;
}

@keyframes pulse-border {
  0% {
    box-shadow: 0 0 0 1px #df8f8f4d;
  }
  50% {
    box-shadow: 0 0 0 4px #df8f8f80;
  }
  100% {
    box-shadow: 0 0 0 1px #df8f8f4d;
  }
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.card-head h4 {
  font-size: 1rem;
  line-height: 1.25;
}

.card-title-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: color 120ms ease, border-color 120ms ease;
}

.card-title-link:hover,
.card-title-link:focus-visible {
  color: #0b6a78;
  border-bottom-color: currentColor;
  outline: none;
}

.card-title-button {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.lease-number {
  font-weight: 700;
  color: #0f606c;
  font-size: 0.84rem;
  white-space: nowrap;
}

.meta-row {
  margin-top: 5px;
  font-size: 0.83rem;
  color: var(--muted);
}

.priority-control {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 0.82rem;
  font-weight: 700;
}

.priority-select {
  border: 1px solid #a8c0c9;
  border-radius: 9px;
  background: linear-gradient(180deg, #ffffff, #f3f8fa);
  color: var(--ink);
  padding: 0.34rem 1.72rem 0.34rem 0.5rem;
  font-weight: 700;
  font-size: 0.8rem;
}

.stale-warning {
  margin-top: 8px;
  padding: 0.26rem 0.5rem;
  border-radius: 8px;
  background: #fff0f0;
  color: #8b2b2b;
  font-size: 0.78rem;
  font-weight: 700;
}

.advance-button {
  width: 100%;
  margin-top: 9px;
  border: 1px solid #f0cf80;
  border-radius: 8px;
  background: #fff6df;
  color: #6c4a00;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.42rem 0.5rem;
  cursor: pointer;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 12px;
  backdrop-filter: blur(9px) saturate(120%);
}

.panel h2 {
  font-size: 1.06rem;
  margin-bottom: 8px;
}

.panel p {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
  margin-bottom: 8px;
}

.outbox-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 350px;
  overflow: auto;
}

.outbox-item {
  border: 1px solid #d4e1e5;
  background: #fff;
  border-radius: 10px;
  padding: 8px;
  font-size: 0.79rem;
  line-height: 1.35;
}

.outbox-item .timestamp {
  margin-top: 3px;
  color: #687d85;
  font-size: 0.73rem;
}

.empty-state {
  color: var(--muted);
  font-size: 0.8rem;
}

.settings-panel {
  display: none;
}

.settings-panel.is-open {
  display: block;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 700;
}

.settings-form input,
.login-form input,
.login-form select,
.login-form textarea {
  border: 1px solid #c5d4d9;
  background: #fff;
  border-radius: 10px;
  padding: 0.53rem 0.65rem;
  color: var(--ink);
  font-size: 0.87rem;
}

.login-form textarea {
  resize: vertical;
  min-height: 92px;
}

.modal {
  position: fixed;
  inset: 0;
  background: #0f303966;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  z-index: 30;
}

.modal.is-open {
  display: flex;
}

.modal.modal--stacked {
  z-index: 45;
}

.modal-card {
  width: min(430px, 100%);
  border-radius: 16px;
  border: 1px solid #d5e3e8;
  background: #fff;
  padding: 20px;
  box-shadow: var(--shadow);
}

.modal-card h2 {
  margin-bottom: 12px;
}

.hold-reason-modal-card {
  width: min(520px, 100%);
}

.hold-reason-label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.hold-reason-label textarea {
  width: 100%;
  resize: vertical;
  min-height: 132px;
}

.hierarchy-modal-card {
  width: min(980px, 100%);
  max-height: min(86vh, 980px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: visible;
  position: relative;
}

.lead-modal-card {
  position: relative;
}

.lead-modal-header-actions {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.column-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.column-header-row h3 {
  margin: 0;
}

.create-lead-button {
  padding: 0.34rem 0.62rem;
  border-radius: 999px;
  font-size: 0.72rem;
  white-space: nowrap;
}

.lead-file-open,
.lead-note-open {
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 0;
  width: 100%;
  cursor: pointer;
}

.lead-contacts-wrap {
  margin: 0 0 12px;
}

.lead-hierarchy-field-group {
  margin-top: 12px;
}

.lead-hierarchy-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lead-note-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.lead-action-menu-wrap {
  position: relative;
  display: inline-flex;
}

.lead-convert-open {
  align-self: flex-start;
}

.lead-conversion-card {
  max-width: 760px;
}

.lead-credit-app-card {
  max-width: 560px;
}

.lease-preview-card {
  width: min(1100px, calc(100vw - 32px));
  max-width: none;
  max-height: min(92vh, 980px);
  display: flex;
  flex-direction: column;
}

.hierarchy-modal-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lease-preview-content {
  display: grid;
  gap: 14px;
  margin-top: 0;
  max-height: min(78vh, 840px);
  overflow: auto;
  padding-right: 4px;
}

.lease-preview-panel {
  border: 1px solid rgba(31, 78, 90, 0.14);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.78);
}

.lease-preview-summary {
  padding: 0 0 2px;
}

.lease-preview-summary h3,
.lease-preview-panel h3 {
  margin: 0 0 8px;
}

.lease-preview-summary h3 {
  margin-bottom: 0;
  font-size: clamp(1.75rem, 3vw, 2.75rem);
  line-height: 1.05;
}

.lease-preview-summary p {
  margin: 0;
  color: #5f7580;
}

.lease-preview-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.lease-preview-stats span {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(34, 168, 183, 0.16);
  color: #164b58;
  font-size: 0.82rem;
  font-weight: 800;
}

.lease-preview-row,
.lease-preview-field-row,
.lease-recipient-edit {
  display: grid;
  grid-template-columns: minmax(130px, 0.45fr) minmax(180px, 1fr);
  gap: 8px 14px;
  padding: 9px 0;
  border-top: 1px solid rgba(31, 78, 90, 0.1);
}

.lease-recipient-edit {
  align-items: center;
}

.lease-recipient-edit input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(31, 78, 90, 0.2);
  border-radius: 8px;
  padding: 8px 10px;
  color: #17313f;
  background: #fff;
  font: inherit;
}

.lease-recipient-edit input:focus {
  outline: 2px solid rgba(34, 168, 183, 0.26);
  border-color: rgba(34, 168, 183, 0.72);
}

.lease-amendment-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: #395766;
  font-weight: 800;
}

.lease-amendment-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #159ca8;
}

.lease-preview-field-row {
  grid-template-columns: minmax(130px, 0.35fr) minmax(180px, 1fr) minmax(120px, 0.35fr);
}

.lease-preview-row:first-of-type,
.lease-preview-field-row:first-of-type,
.lease-recipient-edit:first-of-type {
  border-top: 0;
}

.lease-preview-row span,
.lease-preview-field-row span,
.lease-recipient-edit span,
.lease-preview-field-row em,
.lease-preview-empty,
.lease-preview-list {
  color: #667d88;
}

.lease-preview-row strong,
.lease-preview-field-row strong {
  color: #17313f;
  font-weight: 800;
}

.lease-recipient-status-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.lease-recipient-status-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  border: 1px solid rgba(31, 78, 90, 0.12);
  border-radius: 8px;
  padding: 8px 10px;
}

.lease-recipient-status-row span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.lease-recipient-status-row small {
  color: #667d88;
  font-size: 0.82rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.lease-recipient-status-row em {
  color: #164b58;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.lease-preview-field-row em {
  font-style: normal;
  font-size: 0.82rem;
}

.lease-preview-list {
  margin: 0;
  padding-left: 20px;
}

.lease-preview-empty {
  margin: 0;
}

.lease-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.lease-page-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid rgba(31, 78, 90, 0.12);
  border-radius: 8px;
  padding: 8px 10px;
  color: #17313f;
  font-weight: 800;
}

.lease-page-option.is-disabled {
  opacity: 0.62;
}

.lease-document-preview-panel {
  overflow: hidden;
}

.lease-document-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.lease-document-preview-heading h3 {
  margin: 0;
}

.lease-static-text-add.is-active {
  border-color: #159ca8;
  background: #159ca8;
  color: #fff;
}

.lease-page-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.lease-page-toolbar strong {
  color: #17313f;
  font-size: 0.92rem;
}

.lease-page-toggle-grid {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.lease-page-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(31, 78, 90, 0.16);
  border-radius: 999px;
  color: #395766;
  font-size: 0.88rem;
  font-weight: 800;
  padding: 6px 10px;
  white-space: nowrap;
}

.lease-page-toggle input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #159ca8;
}

.lease-document-preview-frame {
  display: block;
  width: 100%;
  height: min(72vh, 760px);
  min-height: 560px;
  border: 1px solid rgba(31, 78, 90, 0.16);
  border-radius: 8px;
  background: #fff;
}

.lease-document-editor {
  display: grid;
  gap: 18px;
  max-height: min(72vh, 760px);
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(31, 78, 90, 0.16);
  border-radius: 8px;
  background: #e8eef1;
}

.lease-document-editor.has-render-error::before {
  content: "Unable to render the prepared lease.";
  display: block;
  color: #8a2020;
  font-weight: 800;
}

.lease-document-page-wrap {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: max-content;
}

.lease-document-page-label {
  justify-self: start;
  color: #395766;
  font-size: 0.82rem;
  font-weight: 800;
}

.lease-document-page-stage {
  position: relative;
  flex: none;
  min-width: 300px;
  min-height: 420px;
  box-shadow: 0 2px 12px rgba(12, 35, 45, 0.18);
  background: #fff;
}

.lease-document-page-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #fff;
}

.lease-document-text-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.lease-document-text-layer.is-placing {
  cursor: crosshair;
  background: rgba(21, 156, 168, 0.04);
  outline: 2px solid rgba(21, 156, 168, 0.55);
  outline-offset: -2px;
}

.lease-static-text-box {
  position: absolute;
  z-index: 2;
  box-sizing: border-box;
  border: 0;
  border-radius: 6px;
  outline: 1px dashed #1688a2;
  outline-offset: -1px;
  background: rgba(59, 178, 214, 0.11);
  color: #154d5d;
  touch-action: manipulation;
}

.lease-static-text-box.is-active,
.lease-static-text-box:focus-within {
  outline: 1px solid #0a667d;
  box-shadow: 0 0 0 2px rgba(21, 156, 168, 0.22);
}

.lease-static-text-box.is-dragging {
  cursor: grabbing;
}

.lease-static-text-drag-handle {
  position: absolute;
  z-index: 4;
  top: -7px;
  left: -7px;
  width: 12px;
  height: 12px;
  border: 1px solid #0a667d;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #d7f4ff, #2f99b7 60%, #0a6076);
  box-shadow: 0 1px 4px rgba(7, 61, 75, 0.28);
  cursor: grab;
  touch-action: none;
}

.lease-static-text-drag-handle:active {
  cursor: grabbing;
}

.lease-static-text-delete {
  position: absolute;
  z-index: 5;
  top: -22px;
  right: -8px;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(10, 102, 125, 0.45);
  border-radius: 50%;
  padding: 0;
  color: #245765;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 4px rgba(7, 61, 75, 0.18);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.lease-static-text-delete:hover,
.lease-static-text-delete:focus-visible {
  color: #842f2f;
  background: #f7dddd;
  outline: 0;
}

.lease-static-text-box textarea {
  display: block;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  resize: none;
  overflow: hidden;
  overflow-wrap: anywhere;
  border: 0;
  border-radius: 6px;
  padding: var(--lease-pdf-text-padding, 4px);
  color: #111;
  background: transparent;
  font-family: Helvetica, Arial, sans-serif;
  font-size: var(--lease-pdf-text-font-size, 12px);
  line-height: var(--lease-pdf-text-line-height, 14.4px);
  touch-action: auto;
}

.lease-static-text-box textarea:focus {
  outline: 0;
}

.lease-static-text-resize-handle {
  position: absolute;
  z-index: 4;
  width: 12px;
  height: 12px;
  right: -7px;
  bottom: -7px;
  border: 1px solid #0a667d;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #d7f4ff, #2f99b7 60%, #0a6076);
  box-shadow: 0 1px 4px rgba(7, 61, 75, 0.28);
  cursor: se-resize;
  touch-action: none;
}

.lead-credit-app-grid {
  display: grid;
  gap: 14px;
  margin: 16px 0 4px;
}

.lead-credit-app-status {
  display: grid;
  gap: 8px;
  padding: 14px;
  margin: 12px 0 16px;
  border: 1px solid rgba(31, 78, 90, 0.14);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(34, 168, 183, 0.12), rgba(255, 255, 255, 0.82));
}

.lead-credit-app-status-heading,
.lead-credit-app-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lead-credit-app-status-heading span {
  color: #66808b;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead-credit-app-status-heading strong {
  color: #0f5968;
  font-size: 1rem;
}

.lead-credit-app-status-row {
  color: #617682;
  font-size: 0.86rem;
}

.lead-credit-app-status-row strong {
  color: #17313f;
  font-weight: 750;
  text-align: right;
}

.lead-credit-app-status-empty {
  margin: 0;
  color: #6c7f89;
  font-size: 0.9rem;
}

.lead-credit-app-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 6px;
}

.lead-credit-app-loading {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 34px 18px;
  text-align: center;
  color: #536b76;
}

.lead-credit-app-loading strong {
  color: #123846;
  font-size: 1.05rem;
}

.lead-credit-app-loading p {
  max-width: 360px;
  margin: 0;
}

.lead-credit-app-loading-dot {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(34, 168, 183, 0.24);
  border-top-color: #22a8b7;
  border-radius: 999px;
  animation: lead-credit-app-spin 0.75s linear infinite;
}

@keyframes lead-credit-app-spin {
  to {
    transform: rotate(360deg);
  }
}

.lead-convert-grid {
  display: grid;
  gap: 16px;
  margin: 16px 0 4px;
}

.lead-convert-section {
  border: 1px solid rgba(31, 78, 90, 0.16);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 30px rgba(16, 44, 56, 0.08);
}

.lead-convert-section h3 {
  margin: 0 0 10px;
  color: #173948;
  font-size: 1rem;
}

.lead-convert-segmented {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.lead-convert-segmented button {
  border: 1px solid rgba(31, 78, 90, 0.22);
  border-radius: 999px;
  background: #f6fbfd;
  color: #315364;
  padding: 0.48rem 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.lead-convert-segmented button.is-selected {
  border-color: #1f6d7a;
  background: #dff6fa;
  color: #124b58;
}

.lead-convert-segmented button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.lead-convert-options {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  max-height: 210px;
  overflow: auto;
}

.lead-convert-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(31, 78, 90, 0.16);
  border-radius: 14px;
  background: #ffffff;
  color: #173948;
  padding: 0.7rem 0.85rem;
  text-align: left;
  cursor: pointer;
}

.lead-convert-option:hover,
.lead-convert-option:focus-visible,
.lead-convert-option.is-selected {
  border-color: #1f6d7a;
  background: #edf9fb;
}

.lead-convert-option small {
  color: #64818d;
  font-weight: 800;
}

.lead-convert-empty {
  margin: 8px 0 0;
}

.mode-internal-sandbox .lead-floating-files-layer {
  position: absolute;
  left: -188px;
  top: 0;
  width: 176px;
  height: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}

.mode-internal-sandbox .lead-floating-notes-layer {
  position: absolute;
  right: -228px;
  top: 0;
  width: 216px;
  height: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}

.mode-internal-sandbox .lead-floating-files-group,
.mode-internal-sandbox .lead-floating-notes-group {
  position: absolute;
  width: 100%;
  pointer-events: none;
}

.mode-internal-sandbox .lead-floating-files-group {
  left: 0;
}

.mode-internal-sandbox .lead-floating-notes-group {
  right: 0;
}

.mode-internal-sandbox .lead-file-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mode-internal-sandbox .lead-floating-files-group .hierarchy-file-tile,
.mode-internal-sandbox .lead-floating-notes-group .hierarchy-note-card,
.mode-internal-sandbox .lead-note-editor--floating {
  pointer-events: auto;
}

.lead-note-editor--floating {
  margin: 0 0 10px;
}

@media (max-width: 760px) {
  .mode-internal-sandbox .lead-floating-files-layer,
  .mode-internal-sandbox .lead-floating-notes-layer {
    display: none;
  }
}

.hierarchy-modal-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.hierarchy-modal-title-row h2 {
  margin-bottom: 0;
}

.hierarchy-tree-button {
  padding: 0.38rem 0.52rem;
  border-radius: 10px;
  min-width: 2.1rem;
}

.hierarchy-tree-button-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hierarchy-subtitle {
  margin-top: -6px;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 0.86rem;
}

.hierarchy-sections {
  overflow: auto;
  max-height: calc(86vh - 220px);
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.hierarchy-warning-list {
  border: 1px solid #f0d9a8;
  background: #fff8e8;
  color: #704f0f;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.8rem;
  line-height: 1.35;
}

.hierarchy-warning-list p + p {
  margin-top: 4px;
}

.hierarchy-section {
  border: 1px solid #d9e7ec;
  border-radius: 12px;
  background: #fdfefe;
  padding: 10px;
  position: relative;
  overflow: visible;
}

.hierarchy-section.is-missing {
  border-style: dashed;
  border-color: #c8d6dc;
  background: #f7fbfd;
}

.hierarchy-section--placeholder {
  padding: 0;
  min-height: 124px;
  overflow: hidden;
}

.hierarchy-add-placeholder {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 124px;
  border: 0;
  background: transparent;
  color: #385665;
  cursor: pointer;
}

.hierarchy-add-placeholder-label {
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 8vw, 4.75rem);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  opacity: 0.2;
}

.hierarchy-add-placeholder-plus {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(8, 99, 116, 0.38);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #086374;
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 12px 28px rgba(15, 48, 62, 0.14);
}

.hierarchy-add-placeholder:hover,
.hierarchy-add-placeholder:focus-visible {
  background: rgba(8, 99, 116, 0.08);
  outline: none;
}

.hierarchy-add-placeholder:focus-visible .hierarchy-add-placeholder-plus {
  box-shadow: 0 0 0 3px rgba(8, 99, 116, 0.2), 0 12px 28px rgba(15, 48, 62, 0.14);
}

.hierarchy-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.hierarchy-section-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hierarchy-section-header h3 {
  font-size: 0.96rem;
}

.hierarchy-section-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.hierarchy-section-actions {
  position: relative;
  display: inline-flex;
  align-items: center;
  overflow: visible;
  z-index: 8;
}

.hierarchy-tier-control {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.hierarchy-tier-medal {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid #c7d8de;
  background: #f6fbfd;
  color: #8da2af;
  font-size: 0.98rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease, background 120ms ease;
}

.hierarchy-tier-medal:hover,
.hierarchy-tier-medal:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(64, 100, 116, 0.2);
}

.hierarchy-tier-medal.is-none {
  color: #89a0ae;
  border-color: #c8d8de;
  background: #f4f9fb;
}

.hierarchy-tier-medal.is-platinum {
  color: #4f6d82;
  border-color: #7c9db2;
  background: #edf5fa;
}

.hierarchy-tier-medal.is-gold {
  color: #7d5a10;
  border-color: #cca045;
  background: #fff6dc;
}

.hierarchy-tier-medal.is-silver {
  color: #5b6f7e;
  border-color: #9cafbc;
  background: #f3f8fa;
}

.hierarchy-tier-medal.is-bronze {
  color: #7c3f1a;
  border-color: #bc6f3a;
  background: #fff0e7;
}

.hierarchy-tier-medal:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.hierarchy-tier-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 4;
  min-width: 132px;
  border-radius: 10px;
  border: 1px solid #c7d8de;
  background: #fff;
  box-shadow: 0 12px 24px rgba(19, 57, 68, 0.2);
  padding: 6px;
  display: none;
  gap: 4px;
  flex-direction: column;
}

.hierarchy-tier-menu.is-open {
  display: flex;
}

.hierarchy-tier-option {
  border: 1px solid transparent;
  border-radius: 8px;
  background: #f7fbfd;
  color: #355461;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 7px;
  cursor: pointer;
}

.hierarchy-tier-option:hover,
.hierarchy-tier-option:focus-visible {
  border-color: #b7ced8;
  background: #f0f8fb;
}

.hierarchy-tier-option.is-selected {
  border-color: #9bc3d2;
  background: #e9f5fa;
}

.mode-internal-sandbox .hierarchy-file-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mode-internal-sandbox .hierarchy-floating-files-layer {
  position: absolute;
  left: -188px;
  top: 0;
  width: 176px;
  height: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}

.mode-internal-sandbox .hierarchy-floating-notes-layer {
  position: absolute;
  right: -228px;
  top: 0;
  width: 216px;
  height: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}

.mode-internal-sandbox .hierarchy-floating-files-group {
  position: absolute;
  left: 0;
  width: 100%;
  pointer-events: none;
}

.mode-internal-sandbox .hierarchy-floating-notes-group {
  position: absolute;
  right: 0;
  width: 100%;
  pointer-events: none;
}

.mode-internal-sandbox .hierarchy-file-tile {
  pointer-events: auto;
  border: 1px solid rgba(184, 211, 221, 0.9);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(240, 250, 255, 0.58));
  backdrop-filter: blur(8px);
  border-radius: 11px;
  min-height: 72px;
  padding: 6px 7px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  color: #3e5f6c;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(82, 122, 140, 0.16);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.mode-internal-sandbox .hierarchy-file-tile:hover,
.mode-internal-sandbox .hierarchy-file-tile:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(82, 122, 140, 0.24);
}

.mode-internal-sandbox .hierarchy-file-tile-name {
  width: 100%;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.mode-internal-sandbox .hierarchy-file-tile-meta {
  font-size: 0.62rem;
  font-weight: 700;
  color: #678594;
  letter-spacing: 0.01em;
}

.mode-internal-sandbox .hierarchy-file-tile-add {
  align-items: center;
  justify-content: center;
  min-height: 72px;
  font-size: 1.4rem;
  font-weight: 700;
  color: #3b5f6b;
  line-height: 1;
}

.mode-internal-sandbox .hierarchy-file-tile-add:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.mode-internal-sandbox .hierarchy-note-cabinet {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.mode-internal-sandbox .hierarchy-note-card {
  pointer-events: auto;
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(184, 211, 221, 0.95);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.92), rgba(241, 249, 255, 0.82));
  backdrop-filter: blur(9px);
  border-radius: 10px;
  padding: 7px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
  text-align: left;
  color: #2f5260;
  cursor: pointer;
  box-shadow: 0 9px 18px rgba(82, 122, 140, 0.16);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.mode-internal-sandbox .hierarchy-note-card + .hierarchy-note-card {
  margin-top: calc(-100% + 24px);
}

.mode-internal-sandbox .hierarchy-note-card:hover,
.mode-internal-sandbox .hierarchy-note-card:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 13px 24px rgba(82, 122, 140, 0.24);
}

.mode-internal-sandbox .hierarchy-note-card.is-stacked-note .hierarchy-note-card-body {
  display: none;
}

.mode-internal-sandbox .hierarchy-note-card-header {
  font-size: 0.61rem;
  font-weight: 800;
  color: #476a78;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.2;
}

.mode-internal-sandbox .hierarchy-note-card-body {
  font-size: 0.67rem;
  line-height: 1.28;
  font-weight: 600;
  color: #325360;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.hierarchy-record-link {
  color: #0b6a78;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
}

.hierarchy-record-link:hover,
.hierarchy-record-link:focus-visible {
  color: #084f5a;
}

.hierarchy-record-missing {
  color: #5f7480;
  font-size: 0.78rem;
}

.hierarchy-section-note {
  margin-bottom: 8px;
  font-size: 0.78rem;
  color: #5f7480;
}

.hierarchy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.hierarchy-section-audit {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 16px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #e2edf1;
  color: #6c818b;
  font-size: 0.68rem;
  line-height: 1.35;
}

.hierarchy-field-group {
  grid-column: 1 / -1;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px dashed #c8d8de;
}

.hierarchy-field-group-title {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5f7480;
}

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

.hierarchy-agreement-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.hierarchy-agreement-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.hierarchy-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

.hierarchy-field input,
.hierarchy-field select {
  border: 1px solid #c5d4d9;
  background: #fff;
  border-radius: 9px;
  padding: 0.47rem 0.55rem;
  color: var(--ink);
  font-size: 0.84rem;
}

.hierarchy-field--checkbox {
  min-height: 42px;
  flex-direction: row;
  align-items: center;
  align-self: end;
  gap: 10px;
}

.hierarchy-field--checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.hierarchy-field input[readonly] {
  background: #f2f6f8;
  color: #4f6975;
}

.hierarchy-owner-row {
  margin: 2px 0 8px;
  max-width: 560px;
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
}

.hierarchy-owner-row .hierarchy-field {
  margin: 0;
}

.hierarchy-owner-display {
  border: 0;
  background: transparent;
  border-radius: 0;
  padding: 0;
  color: #2d5f79;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 120ms ease, text-decoration-color 120ms ease;
}

.hierarchy-owner-display:hover,
.hierarchy-owner-display:focus-visible {
  color: #0d95b3;
  text-decoration-color: #0d95b3;
  outline: none;
}

.hierarchy-owner-display:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  text-decoration-color: currentColor;
}

.hierarchy-owner-select {
  border: 1px solid #c5d4d9;
  background: #fff;
  border-radius: 9px;
  padding: 0.44rem 0.62rem;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  min-width: 220px;
}

.hierarchy-owner-search {
  border: 1px solid #c5d4d9;
  background: #fff;
  border-radius: 9px;
  padding: 0.44rem 0.62rem;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  min-width: 220px;
}

.hierarchy-owner-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 260px;
}

.hierarchy-owner-options {
  max-height: 152px;
  overflow: auto;
  border: 1px solid #bfd2db;
  border-radius: 9px;
  background: #fffffffc;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hierarchy-owner-option {
  border: 1px solid transparent;
  border-radius: 7px;
  background: #f6fbfd;
  color: #36525f;
  text-align: left;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.25;
  padding: 6px 7px;
  cursor: pointer;
}

.hierarchy-owner-option:hover,
.hierarchy-owner-option:focus-visible {
  border-color: #b9d0db;
  background: #ecf7fb;
  outline: none;
}

.hierarchy-owner-option.is-selected {
  border-color: #5ea9bf;
  background: #e4f4fb;
  color: #1b4f63;
}

.hierarchy-owner-option.is-hidden {
  display: none;
}

.hierarchy-owner-option-empty {
  margin: 2px 2px 0;
  font-size: 0.7rem;
  font-weight: 700;
  color: #5f7480;
}

.hierarchy-owner-option-empty.is-hidden {
  display: none;
}

.hierarchy-owner-close {
  border: 1px solid #c7d8de;
  background: #fff;
  border-radius: 8px;
  padding: 0.34rem 0.58rem;
  color: #355461;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.hierarchy-owner-close:hover,
.hierarchy-owner-close:focus-visible {
  border-color: #a8c2cf;
  background: #f4fafc;
}

.hierarchy-field--address-lookup {
  position: relative;
  grid-column: 1 / -1;
}

.hierarchy-field--address-lookup input {
  padding-right: 0.6rem;
}

.hierarchy-address-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.hierarchy-address-status {
  display: inline-flex;
  align-items: center;
  border: 1px solid #c7d7de;
  border-radius: 999px;
  padding: 2px 7px;
  background: #f4fafc;
  color: #5d7682;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.hierarchy-address-status.is-verified {
  border-color: #9bc9a6;
  background: #e9f7ed;
  color: #2d6b3d;
}

.hierarchy-address-status.is-unverified {
  border-color: #e3b0a7;
  background: #fff1ee;
  color: #9b3d31;
}

.hierarchy-address-helper {
  margin-top: 2px;
  font-size: 0.66rem;
  font-weight: 600;
  color: #6a808c;
}

.hierarchy-address-helper--error {
  color: #9b3d31;
}

.hierarchy-address-suggestions {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 180px;
  overflow: auto;
  border: 1px solid #bfd2db;
  border-radius: 9px;
  background: #fffffffc;
  box-shadow: 0 10px 20px rgba(20, 54, 67, 0.14);
  padding: 6px;
}

.hierarchy-address-suggestion {
  display: block;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #f6fbfd;
  color: #36525f;
  text-align: left;
  font-size: 0.73rem;
  font-weight: 600;
  line-height: 1.25;
  padding: 5px 6px;
  cursor: pointer;
  white-space: normal;
}

.hierarchy-address-suggestion:hover,
.hierarchy-address-suggestion:focus-visible {
  border-color: #b6cdd8;
  background: #edf7fb;
}

.hierarchy-contacts-wrap {
  margin: 2px 0 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hierarchy-contacts-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.hierarchy-contacts-title {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5f7480;
}

.hierarchy-contact-add {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid #c7d8de;
  background: #fff;
  color: #3b5966;
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.hierarchy-contact-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 132px;
  border: 1px solid #c7d8de;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(29, 54, 66, 0.16);
  padding: 4px;
  display: none;
  flex-direction: column;
  gap: 3px;
  z-index: 30;
}

.hierarchy-contact-menu.is-open {
  display: flex;
}

.hierarchy-contact-menu-item {
  border: 1px solid transparent;
  background: transparent;
  color: #3b5966;
  border-radius: 7px;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: left;
  padding: 0.35rem 0.45rem;
  cursor: pointer;
}

.hierarchy-contact-menu-item:hover,
.hierarchy-contact-menu-item:focus-visible {
  border-color: #bfd3db;
  background: #f3f8fa;
}

.hierarchy-contact-add:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hierarchy-contact-card {
  border: 1px solid #d2e0e5;
  border-radius: 10px;
  background: #f8fcfe;
  padding: 7px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hierarchy-contact-open {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  text-align: left;
  color: #5f7480;
  font-size: 0.78rem;
  line-height: 1.35;
  font-style: italic;
  cursor: pointer;
  flex: 1;
}

.hierarchy-contact-open:hover,
.hierarchy-contact-open:focus-visible {
  color: #3f5e69;
  text-decoration: underline;
}

.hierarchy-contact-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.hierarchy-contact-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hierarchy-contact-item.is-active {
  margin-bottom: 4px;
}

.hierarchy-contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.hierarchy-contact-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.hierarchy-contact-detail-grid input {
  border: 1px solid #c5d4d9;
  background: #fff;
  border-radius: 9px;
  padding: 0.4rem 0.52rem;
  color: var(--ink);
  font-size: 0.79rem;
}

.hierarchy-contact-empty {
  margin: 0;
  font-size: 0.78rem;
  color: #5f7480;
  line-height: 1.35;
}

.hierarchy-contact-row--placeholder .hierarchy-contact-empty {
  flex: 1;
}

.hierarchy-contact-editor {
  border: 1px dashed #c5d4d9;
  border-radius: 10px;
  background: #f7fbfd;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hierarchy-contact-editor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.hierarchy-contact-editor-grid input {
  border: 1px solid #c5d4d9;
  background: #fff;
  border-radius: 9px;
  padding: 0.45rem 0.52rem;
  color: var(--ink);
  font-size: 0.8rem;
}

.hierarchy-contact-role-options {
  min-width: 0;
  margin: 0;
  border: 1px solid #c5d4d9;
  border-radius: 9px;
  padding: 0.38rem 0.52rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.hierarchy-contact-role-options label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2rem;
  padding: 0.2rem 0.25rem;
  color: var(--ink);
  font-size: 0.79rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.hierarchy-contact-role-options input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  padding: 0;
  accent-color: var(--teal);
}

.hierarchy-contact-duplicate-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hierarchy-contact-duplicate-link {
  width: 100%;
  border: 1px solid #d2e0e5;
  background: #fff;
  color: #2b4855;
  border-radius: 8px;
  padding: 0.42rem 0.55rem;
  text-align: left;
  font-size: 0.76rem;
  cursor: pointer;
}

.hierarchy-contact-duplicate-link:disabled {
  opacity: 0.55;
  cursor: default;
}

.hierarchy-contact-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hierarchy-tree-modal-card {
  width: min(860px, 100%);
  max-height: min(86vh, 960px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hierarchy-parent-link-card {
  width: min(680px, 100%);
  max-height: min(86vh, 900px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.hierarchy-parent-link-card form {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

#hierarchy-parent-link-content,
#hierarchy-action-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.hierarchy-parent-link-card .consultation-actions,
.hierarchy-action-modal-card .consultation-actions {
  flex-shrink: 0;
}

.parent-link-grid {
  grid-template-columns: 1fr;
}

.parent-link-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.parent-link-section-header h3 {
  margin: 0;
}

.parent-link-detach-button {
  border: 1px solid rgba(190, 67, 67, 0.45);
  border-radius: 999px;
  background: rgba(190, 67, 67, 0.08);
  color: #9f2f2f;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
}

.parent-link-detach-button:hover:not(:disabled) {
  background: rgba(190, 67, 67, 0.14);
  border-color: rgba(190, 67, 67, 0.72);
}

.parent-link-detach-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

body.dark-mode .parent-link-detach-button {
  border-color: rgba(248, 113, 113, 0.55);
  background: rgba(248, 113, 113, 0.14);
  color: #fecaca;
}

.hierarchy-file-preview-card {
  width: min(980px, 100%);
  max-height: min(88vh, 980px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hierarchy-file-preview-body {
  min-height: 360px;
  max-height: calc(88vh - 220px);
  border: 1px solid #d5e4ea;
  border-radius: 12px;
  background: #f8fcff;
  padding: 10px;
  overflow: auto;
}

.hierarchy-file-preview-frame {
  width: 100%;
  min-height: 520px;
  border: 1px solid #ccdee6;
  border-radius: 10px;
  background: #fff;
}

.hierarchy-file-preview-image {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 70vh;
  margin: 0 auto;
  border-radius: 10px;
  border: 1px solid #ccdee6;
  background: #fff;
}

.hierarchy-file-preview-text {
  margin: 0;
  width: 100%;
  min-height: 520px;
  border: 1px solid #ccdee6;
  border-radius: 10px;
  background: #fff;
  padding: 12px;
  color: #2b4855;
  font-size: 0.8rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.hierarchy-file-preview-empty {
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #5f7480;
  text-align: center;
}

.hierarchy-file-tile-checklist {
  border-style: dashed;
}

.hierarchy-checklist-card {
  width: min(96vw, 1560px);
  max-height: min(94vh, 1200px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hierarchy-checklist-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.hierarchy-checklist-context-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.hierarchy-checklist-context-controls.is-hidden,
.hierarchy-checklist-context-field.is-hidden {
  display: none;
}

.hierarchy-checklist-context-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #4f6773;
}

.hierarchy-checklist-context-field select {
  border: 1px solid #c5d4d9;
  background: #fff;
  border-radius: 9px;
  padding: 0.4rem 0.55rem;
  font-size: 0.78rem;
  color: var(--ink);
  min-width: 220px;
}

.hierarchy-checklist-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 14px;
  min-height: 0;
  flex: 1;
}

.hierarchy-checklist-layout.is-view-only {
  grid-template-columns: minmax(0, 1fr);
}

#hierarchy-checklist-modal.is-checklist-view-only .hierarchy-checklist-card {
  width: min(96vw, 1080px);
}

#hierarchy-checklist-modal.is-checklist-view-only .hierarchy-checklist-main {
  gap: 0;
}

#hierarchy-checklist-modal.is-checklist-view-only .hierarchy-checklist-pages {
  border: none;
  background: transparent;
  padding: 0;
  min-height: 0;
}

#hierarchy-checklist-modal.is-checklist-view-only .hierarchy-checklist-page-header {
  display: none;
}

.hierarchy-checklist-main {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hierarchy-checklist-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hierarchy-checklist-pages {
  border: 1px solid #d1e2e9;
  border-radius: 12px;
  background: #f8fdff;
  padding: 10px;
  min-height: 420px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hierarchy-checklist-mode-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 320px;
  text-align: center;
  color: #36515e;
  font-weight: 700;
}

.hierarchy-checklist-mode-prompt-actions {
  display: flex;
  gap: 10px;
}

.hierarchy-checklist-page {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hierarchy-checklist-page-header {
  font-size: 0.8rem;
  font-weight: 700;
  color: #4c6a77;
}

.hierarchy-checklist-page-stage {
  position: relative;
  width: fit-content;
  max-width: 100%;
}

.hierarchy-checklist-page-canvas {
  display: block;
  max-width: 100%;
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(52, 83, 98, 0.16);
  background: #fff;
  image-rendering: auto;
}

.hierarchy-checklist-page-overlay {
  position: absolute;
  inset: 0;
}

.hierarchy-checklist-field-box,
.hierarchy-checklist-field-input {
  position: absolute;
}

.hierarchy-checklist-field-box {
  border: 1px dashed #1688a2;
  background: rgba(59, 178, 214, 0.11);
  color: #154d5d;
  border-radius: 6px;
  font-size: 0.63rem;
  line-height: 1.2;
  padding: 4px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.hierarchy-checklist-field-box.is-dragging {
  cursor: grabbing;
}

.hierarchy-checklist-field-box-label {
  padding-right: 16px;
  pointer-events: none;
  overflow-wrap: anywhere;
}

.hierarchy-checklist-resize-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  right: -7px;
  bottom: -7px;
  border-radius: 50%;
  border: 1px solid #0a667d;
  background: radial-gradient(circle at 35% 35%, #d7f4ff, #2f99b7 60%, #0a6076);
  box-shadow: 0 1px 4px rgba(7, 61, 75, 0.28);
  cursor: se-resize;
}

.hierarchy-checklist-field-box.is-selected {
  border-style: solid;
  border-color: #0a667d;
  box-shadow: 0 0 0 2px rgba(22, 136, 162, 0.25);
}

.hierarchy-checklist-field-input {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hierarchy-checklist-encrypted-toggle {
  align-self: flex-end;
  border: 1px solid rgba(19, 82, 103, 0.4);
  background: rgba(244, 251, 255, 0.95);
  border-radius: 6px;
  color: #0f5f75;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1;
  padding: 2px 4px;
  cursor: pointer;
}

.hierarchy-checklist-encrypted-toggle:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.hierarchy-checklist-field-input input[type="text"],
.hierarchy-checklist-field-input select {
  width: 100%;
  height: 100%;
  border: 1px solid rgba(19, 82, 103, 0.45);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.88);
  font-size: 0.66rem;
  padding: 2px 4px;
  color: #163f4d;
}

.hierarchy-checklist-field-input select {
  min-height: 100%;
}

.hierarchy-checklist-field-label {
  display: none;
}

.hierarchy-checklist-field-input-checkbox {
  flex-direction: row;
  align-items: center;
  gap: 4px;
  font-size: 0.67rem;
  font-weight: 700;
  color: #133647;
  padding: 0;
}

.hierarchy-checklist-sidebar {
  border: 1px solid #d1e2e9;
  border-radius: 12px;
  background: #f8fdff;
  padding: 10px;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hierarchy-checklist-sidebar h3 {
  font-size: 0.84rem;
}

.hierarchy-checklist-selected-field {
  min-height: 0;
}

.hierarchy-checklist-inspector-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.hierarchy-checklist-inspector-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #516a75;
}

.hierarchy-checklist-inspector-grid label.is-wide {
  grid-column: 1 / -1;
}

.hierarchy-checklist-inspector-grid textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  border: 1px solid rgba(41, 79, 95, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: #183847;
  padding: 8px 10px;
  font: inherit;
}

[data-theme="dark"] .hierarchy-checklist-inspector-grid textarea,
[data-theme="dark"] .hierarchy-checklist-field-input select {
  background: rgba(15, 32, 44, 0.94);
  color: #e7f4fb;
  border-color: rgba(126, 179, 199, 0.38);
}

.hierarchy-checklist-inspector-grid label.is-inline-checkbox {
  flex-direction: row;
  align-items: center;
  align-self: end;
  gap: 6px;
  font-size: 0.75rem;
}

.hierarchy-checklist-role-picker {
  border: 1px solid #d5e1e6;
  border-radius: 10px;
  padding: 8px;
  margin: 0;
}

.hierarchy-checklist-role-picker legend {
  padding: 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #4f6873;
}

.hierarchy-checklist-role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
}

.hierarchy-checklist-role-grid .is-inline-checkbox {
  margin: 0;
  font-size: 0.73rem;
}

.hierarchy-checklist-inspector-grid input,
.hierarchy-checklist-inspector-grid select {
  border: 1px solid #c5d4d9;
  background: #fff;
  border-radius: 9px;
  padding: 0.44rem 0.52rem;
  font-size: 0.78rem;
  color: var(--ink);
}

.hierarchy-checklist-inspector-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.hierarchy-checklist-field-input.is-encrypted-locked input[type="text"] {
  background: rgba(226, 236, 241, 0.85);
  color: #4e6672;
  cursor: not-allowed;
}

.hierarchy-note-composer-card {
  width: min(680px, 100%);
  max-height: min(88vh, 980px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hierarchy-note-composer-label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.hierarchy-note-composer-label textarea,
.hierarchy-note-composer-label input {
  border: 1px solid #c5d4d9;
  background: #fff;
  border-radius: 10px;
  padding: 0.53rem 0.65rem;
  color: var(--ink);
  font-size: 0.87rem;
}

.hierarchy-note-composer-label textarea {
  resize: vertical;
  min-height: 200px;
}

.hierarchy-note-tag-suggestions {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: -2px;
}

.hierarchy-note-tag-suggestions.is-open {
  display: flex;
}

.hierarchy-note-tag-suggestion {
  border: 1px solid #c4dbe4;
  background: #f5fcff;
  color: #1f5f73;
  border-radius: 999px;
  padding: 0.28rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.hierarchy-note-tag-suggestion:hover,
.hierarchy-note-tag-suggestion:focus-visible {
  border-color: #88b8c8;
  background: #e5f5fc;
}

.hierarchy-note-preview-card {
  width: min(780px, 100%);
  max-height: min(88vh, 980px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hierarchy-note-preview-body {
  border: 1px solid #d6e5eb;
  border-radius: 12px;
  background: #fbfeff;
  padding: 12px;
  max-height: calc(88vh - 260px);
  overflow: auto;
}

.hierarchy-note-preview-text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ink);
  white-space: normal;
  word-break: break-word;
}

.hierarchy-note-nav-button.is-disabled {
  opacity: 0.68;
  cursor: default;
}

.hierarchy-note-nav-button.is-disabled:hover,
.hierarchy-note-nav-button.is-disabled:focus-visible {
  transform: none;
  box-shadow: none;
}

.hierarchy-tree-content {
  overflow: auto;
  max-height: calc(86vh - 210px);
  padding-right: 4px;
}

.hierarchy-tree-warning-list {
  border: 1px solid #f0d9a8;
  background: #fff8e8;
  color: #704f0f;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.8rem;
  line-height: 1.35;
  margin-bottom: 10px;
}

.hierarchy-tree-warning-list p + p {
  margin-top: 4px;
}

.hierarchy-tree-list,
.hierarchy-tree-children {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hierarchy-tree-node-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 0 4px calc(var(--tree-depth, 0) * 18px);
}

.hierarchy-tree-toggle {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 1px solid #c7d8de;
  background: #fff;
  color: #4a6672;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.hierarchy-tree-toggle:disabled {
  cursor: default;
  opacity: 0.5;
}

.hierarchy-tree-toggle-icon {
  font-size: 0.78rem;
  line-height: 1;
  transition: transform 120ms ease;
}

.hierarchy-tree-toggle.is-expanded .hierarchy-tree-toggle-icon {
  transform: rotate(90deg);
}

.hierarchy-tree-node-type {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #67808b;
  min-width: 26px;
}

.hierarchy-tree-node-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.hierarchy-tree-node-meta {
  font-size: 0.76rem;
  color: var(--muted);
}

.hierarchy-tree-opportunity-button {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  color: #0b6a78;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}

.hierarchy-tree-opportunity-button:hover,
.hierarchy-tree-opportunity-button:focus-visible {
  color: #084f5a;
  text-decoration: underline;
}

.hierarchy-tree-node-row.is-selected .hierarchy-tree-opportunity-button {
  color: #0a5561;
  text-decoration: underline;
}

.profile-grid {
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 10px;
}

.profile-card {
  width: min(900px, 100%);
  max-height: min(88vh, 960px);
  overflow: auto;
}

.profile-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.profile-modal-header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.profile-modal-header h2 {
  margin-bottom: 0;
}

.profile-grid div {
  border: 1px solid #dbe9ee;
  border-radius: 10px;
  background: #f8fcff;
  padding: 10px 11px;
}

.profile-grid dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #4f6a74;
  font-weight: 700;
}

.profile-grid dd {
  margin: 6px 0 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
}

.permission-matrix {
  margin: 0 0 12px;
  border: 1px solid #dbe9ee;
  border-radius: 10px;
  background: #f8fcff;
  padding: 10px 11px;
  overflow: auto;
}

.permission-matrix-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.permission-matrix-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.permission-matrix-header h3 {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink);
}

.permission-matrix-summary {
  margin: 0;
  font-size: 0.74rem;
  color: #5a7783;
  text-align: right;
}

.permission-matrix-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.73rem;
}

.permission-matrix-table th,
.permission-matrix-table td {
  padding: 6px 4px;
  border-bottom: 1px solid #dbe9ee;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.permission-matrix-table thead th {
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #4f6a74;
}

.permission-matrix-table tbody th {
  font-weight: 700;
  color: #134f5a;
}

.permission-matrix-table tbody tr:last-child th,
.permission-matrix-table tbody tr:last-child td {
  border-bottom: none;
}

.permission-matrix-table tbody tr.is-current-role {
  background: rgba(0, 167, 179, 0.12);
}

.permission-matrix-email-input {
  width: 100%;
  min-width: 150px;
  border: 1px solid #cfe0e6;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  padding: 6px 8px;
}

.profile-role-simulation {
  margin: 0 0 12px;
  border: 1px solid #dbe9ee;
  border-radius: 10px;
  background: #f8fcff;
  padding: 10px 11px;
}

.profile-role-simulation-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.profile-role-simulation-header h3 {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink);
}

.profile-role-simulation-header p {
  margin: 0;
  font-size: 0.72rem;
  color: #5a7783;
}

.profile-role-simulation-field {
  display: grid;
  gap: 6px;
  margin: 0;
  font-size: 0.78rem;
  color: #214955;
  font-weight: 700;
}

.profile-role-simulation-select {
  width: min(320px, 100%);
}

.profile-role-simulation-note {
  margin: 8px 0 0;
  font-size: 0.74rem;
  color: #4f6a74;
}

.profile-theme-field {
  margin: 0 0 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.profile-theme-select {
  border: 1px solid #c5d4d9;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 0.5rem 0.65rem;
  font-size: 0.86rem;
}

.profile-enhanced-theme {
  margin: 0 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.profile-enhanced-theme input {
  width: 16px;
  height: 16px;
}

.tenant-settings-card {
  width: min(980px, 100%);
  max-height: min(88vh, 960px);
  overflow: auto;
}

.tenant-stage-settings-card {
  width: min(620px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
}

.user-management-card {
  width: min(1120px, 100%);
}

.tenant-settings-header,
.tenant-settings-section-header,
.tenant-notification-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.tenant-settings-header {
  margin-bottom: 8px;
}

.tenant-settings-header h2,
.tenant-settings-section-header h3,
.tenant-notification-card-header h3 {
  margin: 0;
}

.tenant-settings-subtitle,
.tenant-settings-meta,
.tenant-settings-section-header span,
.tenant-settings-field small {
  margin: 5px 0 0;
  color: #5a7783;
  font-size: 0.78rem;
  line-height: 1.35;
}

.tenant-settings-meta {
  margin-bottom: 8px;
}

.tenant-settings-form,
.tenant-settings-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tenant-settings-section {
  border: 1px solid #dbe9ee;
  border-radius: 14px;
  background:
    radial-gradient(circle at 0% 0%, rgba(0, 167, 179, 0.12), transparent 35%),
    #f8fcff;
  padding: 12px;
}

.tenant-stage-settings-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tenant-stage-settings-section {
  border: 1px solid #dbe9ee;
  border-radius: 14px;
  background:
    radial-gradient(circle at 0% 0%, rgba(0, 167, 179, 0.1), transparent 38%),
    rgba(248, 252, 255, 0.96);
  padding: 12px;
}

.tenant-stage-settings-note {
  border: 1px dashed #c7dce4;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: #5a7783;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.45;
  margin: 0;
  padding: 0.75rem 0.85rem;
}

.tenant-settings-section-header {
  align-items: baseline;
  border-bottom: 1px dashed #c7dce4;
  margin-bottom: 12px;
  padding-bottom: 10px;
}

.tenant-settings-section-header.compact {
  margin-bottom: 8px;
  padding-bottom: 8px;
}

.tenant-notification-card {
  border: 1px solid #d4e6ec;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 26px rgba(16, 72, 86, 0.08);
  padding: 12px;
}

.tenant-notification-card-header {
  align-items: center;
  margin-bottom: 10px;
}

.tenant-enabled-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #c8dae1;
  border-radius: 999px;
  padding: 0.35rem 0.6rem;
  color: #285a67;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.tenant-enabled-toggle input,
.tenant-role-chip input {
  width: 15px;
  height: 15px;
}

.tenant-settings-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.tenant-settings-field input,
.tenant-settings-field select,
.tenant-settings-field textarea {
  width: 100%;
  border: 1px solid #c5d4d9;
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  padding: 0.56rem 0.68rem;
  font: inherit;
  font-weight: 700;
}

.user-management-create-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 0.8fr)) minmax(120px, 0.65fr) minmax(220px, 1.2fr) minmax(150px, 0.7fr) auto;
  align-items: end;
  gap: 12px;
}

.user-management-create-grid .button {
  margin-bottom: 0;
  min-height: 42px;
  white-space: nowrap;
}

.user-management-content {
  max-height: min(46vh, 520px);
  overflow: auto;
}

.user-management-row {
  display: grid;
  grid-template-columns: minmax(200px, 1.2fr) minmax(130px, 0.65fr) repeat(3, minmax(120px, 0.6fr)) auto;
  align-items: end;
  gap: 12px;
  border: 1px solid #d4e6ec;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  padding: 12px;
}

.user-management-identity {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.user-management-identity strong,
.user-management-identity span,
.user-management-identity small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-management-identity span,
.user-management-identity small {
  color: #5a7783;
  font-size: 0.8rem;
  font-weight: 700;
}

.user-management-role-field,
.user-management-name-field {
  margin-top: 0;
}

.user-management-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.tenant-settings-field textarea {
  min-height: 68px;
  resize: vertical;
}

.tenant-role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.tenant-role-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.tenant-stage-role-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.tenant-stage-role-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #285a67;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.25;
}

.tenant-stage-role-row input {
  width: 15px;
  height: 15px;
  margin: 0;
  flex: 0 0 auto;
}

.tenant-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.tenant-feature-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #d6e7ed;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  padding: 0.72rem 0.78rem;
  color: #285a67;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(16, 72, 86, 0.06);
}

.tenant-feature-card input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

.tenant-feature-card strong {
  display: block;
  color: var(--ink);
  font-size: 0.84rem;
}

.tenant-feature-card small {
  display: block;
  margin-top: 4px;
  color: #5a7783;
  font-size: 0.75rem;
  line-height: 1.35;
}

.tenant-role-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #d6e7ed;
  border-radius: 12px;
  background: #fff;
  padding: 0.48rem 0.58rem;
  color: #285a67;
  font-size: 0.76rem;
  font-weight: 800;
}

.tenant-role-chip.compact {
  padding: 0.4rem 0.5rem;
}


.login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.84rem;
  font-weight: 700;
}

.password-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.password-field input {
  flex: 1;
}

.password-toggle {
  min-width: 58px;
  padding: 0.45rem 0.6rem;
}

.login-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.error-text {
  color: #a12828;
  min-height: 1.1em;
  font-size: 0.78rem;
}

.is-hidden {
  display: none !important;
}

.app-shell.is-locked {
  filter: blur(2px);
  pointer-events: none;
}

body.mode-public-demo .app-shell.is-locked {
  filter: none;
  pointer-events: auto;
}

body.auth-bootstrapping #login-modal {
  display: none !important;
}

body.auth-bootstrapping .app-shell.is-locked {
  filter: none;
}

html.public-demo-boot #login-modal {
  display: none !important;
}

html.public-demo-boot .app-shell.is-locked {
  filter: none;
  pointer-events: auto;
}

html.public-demo-boot .layout {
  grid-template-columns: 1fr;
}

html.public-demo-boot .sidebar {
  display: none;
}

html.public-demo-boot #my-tasks-toggle,
html.public-demo-boot #settings-toggle,
html.public-demo-boot #sync-button,
html.public-demo-boot #logout-button {
  display: none;
}

body.mode-public-demo .layout {
  grid-template-columns: 1fr;
}

body.mode-public-demo .sidebar {
  display: none;
}

body.mode-public-demo #my-tasks-toggle,
body.mode-public-demo #settings-toggle,
body.mode-public-demo #sync-button,
body.mode-public-demo #logout-button {
  display: none;
}

body.mode-public-demo #current-user {
  background: #e8f9ef;
  border-color: #a9d8bb;
  color: #1f5d3a;
}

body.mode-public-demo .tabs-wrap {
  margin-bottom: 2px;
}

.consultation-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.toast-container {
  position: fixed;
  right: 18px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 40;
}

.toast {
  background: #13353a;
  color: #fff;
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  font-size: 0.82rem;
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.2);
}

.toast.is-error {
  background: #9f2f2f;
}

.metric-grid {
  margin-top: 16px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.metric-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 14px;
  backdrop-filter: blur(8px) saturate(115%);
}

.metric-card h2 {
  font-size: 1.02rem;
  color: var(--muted);
}

.metric-value {
  margin-top: 10px;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ink);
}

.visual-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.visual-card {
  border: 1px solid #d5e3e8;
  border-radius: 12px;
  background: #fffffff0;
  padding: 12px;
  box-shadow: 0 10px 20px rgba(15, 46, 56, 0.08);
  backdrop-filter: blur(8px) saturate(115%);
}

.visual-card h3 {
  font-size: 0.98rem;
  margin-bottom: 10px;
}

.donut-wrap {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  align-items: center;
}

.donut-chart {
  width: 130px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 1px solid #d0dde1;
  position: relative;
}

.donut-chart::after {
  content: "";
  position: absolute;
  inset: 26%;
  background: #fff;
  border-radius: 50%;
  border: 1px solid #e6eff2;
}

.donut-legend {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.donut-legend li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.legend-label {
  flex: 1;
}

.legend-value {
  color: var(--ink);
  font-weight: 700;
}

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bar-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bar-row-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.78rem;
}

.bar-row-label span {
  color: var(--muted);
}

.bar-row-label strong {
  color: var(--ink);
}

.bar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.78rem;
}

.bar-label {
  color: var(--muted);
}

.bar-value {
  color: var(--ink);
  font-weight: 700;
}

.bar-track {
  width: 100%;
  height: 10px;
  background: #edf3f6;
  border-radius: 999px;
  overflow: hidden;
}

.bar-track span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(120deg, #0f7f8d, #31b3a9);
}

.bar-track span.is-danger {
  background: linear-gradient(120deg, #c44848, #df6a6a);
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(120deg, #0f7f8d, #31b3a9);
}

.bar-fill.is-danger {
  background: linear-gradient(120deg, #c44848, #df6a6a);
}

.chart-empty {
  font-size: 0.8rem;
  color: var(--muted);
}

.panel.full {
  margin-top: 14px;
}

.table-wrap {
  margin-top: 10px;
  overflow: auto;
}

.opportunity-list-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  padding: 12px 14px;
  margin-bottom: 10px;
}

.opportunity-list-toolbar strong {
  display: block;
  font-size: 0.92rem;
}

.opportunity-list-toolbar span {
  display: block;
  margin-top: 2px;
  color: #203942;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

body.theme-dark .opportunity-list-toolbar {
  border-color: #324d5b;
  background: rgba(14, 28, 37, 0.86);
}

body.theme-dark .opportunity-list-toolbar span {
  color: #d7edf3;
}

.opportunity-list-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}

.opportunity-list-sort-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-weight: 900;
  padding: 0;
  text-align: left;
}

.opportunity-list-sort-button:hover,
.opportunity-list-sort-button:focus-visible,
.opportunity-list-sort-button.is-active {
  color: #0f7f8d;
}

.opportunity-list-sort-button span {
  color: currentColor;
  font-size: 0.82rem;
}

.system-health-mode {
  display: block;
}

.reporting-mode {
  display: block;
  overflow: visible;
}

.in-app-reporting-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.reporting-hero {
  border: 1px solid var(--border);
  border-radius: 22px;
  background:
    radial-gradient(circle at 8% 0%, #ffffffd8 0 18%, transparent 42%),
    linear-gradient(135deg, #f7fbf9f0, #eaf6f7de);
  box-shadow: var(--shadow);
  padding: 18px;
  backdrop-filter: blur(12px) saturate(125%);
}

.reporting-hero h2 {
  font-size: clamp(1.35rem, 2vw, 2rem);
}

.reporting-hero p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.system-health-panel {
  border: 1px solid var(--border);
  border-radius: 22px;
  background:
    radial-gradient(circle at 8% 0%, #ffffffd8 0 18%, transparent 42%),
    linear-gradient(135deg, #f7fbf9f0, #eaf6f7de);
  box-shadow: var(--shadow);
  padding: 18px;
  backdrop-filter: blur(12px) saturate(125%);
}

.system-health-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  border-bottom: 1px solid #d7e6eb;
  padding-bottom: 14px;
  margin-bottom: 14px;
}

.system-health-hero h2 {
  font-size: clamp(1.35rem, 2vw, 2rem);
}

.system-health-hero p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.system-health-stamp {
  font-size: 0.78rem !important;
  font-weight: 700;
}

.system-health-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.system-health-error {
  border: 1px solid #f0c6c6;
  border-radius: 12px;
  background: #fff1f1;
  color: #8a2f2f;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 0.84rem;
  font-weight: 700;
}

.system-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.system-health-card {
  border: 1px solid #d4e4e9;
  border-radius: 16px;
  background: #fffffff2;
  padding: 13px;
  min-height: 122px;
  box-shadow: 0 12px 26px rgba(18, 54, 64, 0.08);
}

.system-health-card p {
  color: #5c727b;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.system-health-card strong {
  display: block;
  margin-top: 9px;
  color: var(--ink);
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  line-height: 1.05;
}

.system-health-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.system-health-card.is-healthy {
  border-color: #b8ddd4;
  background: linear-gradient(160deg, #ffffff, #effbf5);
}

.system-health-card.is-warning {
  border-color: #ecc2ae;
  background: linear-gradient(160deg, #ffffff, #fff1e9);
}

.system-health-columns {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.2fr);
  gap: 12px;
}

.system-health-section {
  border: 1px solid #d7e5ea;
  border-radius: 16px;
  background: #fffffff0;
  padding: 12px;
  min-width: 0;
}

.system-health-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.system-health-section-header h3 {
  font-size: 1rem;
}

.system-health-section-header span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.system-health-samples,
.system-health-events {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 430px;
  overflow: auto;
}

.system-health-samples article,
.system-health-event {
  border: 1px solid #d8e8ed;
  border-radius: 12px;
  background: #f8fcfd;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.system-health-samples strong,
.system-health-event strong {
  color: var(--ink);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

.system-health-samples span,
.system-health-event span,
.system-health-event time {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.reusable-resolution-options {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.reusable-resolution-option {
  align-items: flex-start;
  border: 1px solid #d8e8ed;
  border-radius: 14px;
  display: flex;
  gap: 0.7rem;
  padding: 0.75rem;
}

.reusable-resolution-option input {
  margin-top: 0.18rem;
  width: auto;
}

.reusable-resolution-option span {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.reusable-resolution-option small {
  color: var(--muted);
  line-height: 1.35;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

th,
td {
  border-bottom: 1px solid #d8e5e9;
  text-align: left;
  padding: 0.52rem 0.4rem;
  font-size: 0.84rem;
}

th {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.department-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
}

.department-card {
  border: 1px solid #d4e2e7;
  border-radius: 12px;
  background: #fffffff0;
  padding: 12px;
  box-shadow: 0 10px 20px rgba(15, 46, 56, 0.08);
  backdrop-filter: blur(8px) saturate(115%);
}

.department-card h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.department-card p {
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--muted);
}

body.theme-dark .board-controls input,
body.theme-dark .board-controls select {
  border-color: #314553;
  background: #101b23;
  color: var(--ink);
}

body.theme-dark .board-controls select,
body.theme-dark .priority-select,
body.theme-dark .login-form select {
  background-image:
    linear-gradient(180deg, #16242d, #101b23),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath fill='%23b3c7d2' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  border-color: #3a5563;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.28);
}

body.theme-dark .board-column {
  background: linear-gradient(180deg, #111e27ec 0%, #0f1a22eb 100%);
  border-color: #2b404d;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}

body.theme-dark .board-scrollbar-proxy {
  background: rgba(15, 26, 34, 0.97);
  box-shadow: 0 -8px 22px rgba(0, 0, 0, 0.34);
}

body.theme-dark .board-scrollbar-proxy-track {
  background: rgba(42, 184, 198, 0.16);
}

body.theme-dark .board-scrollbar-proxy-thumb {
  background: linear-gradient(180deg, #4bd0dc, #1a9aaa);
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.38);
}

body.theme-dark .column-header {
  border-bottom-color: #2c3f4b;
}

body.theme-dark .opportunity-card {
  border-color: #324c59;
  background: #131f28;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.28);
}

body.theme-dark .lease-number {
  color: #5bd3df;
}

body.theme-dark .card-title-link:hover,
body.theme-dark .card-title-link:focus-visible {
  color: #79e3ec;
}

body.theme-dark .card-title-button {
  color: inherit;
}

body.theme-dark .priority-select {
  border-color: #3a5563;
  background: linear-gradient(180deg, #16242d, #101b23);
  color: var(--ink);
}

body.theme-dark .stale-warning {
  background: #3b2222;
  color: #ffb8b8;
}

body.theme-dark .advance-button {
  border-color: #8b6a2f;
  background: #2b2416;
  color: #ffdba2;
}

body.theme-dark .outbox-item {
  border-color: #314553;
  background: #111d26;
}

body.theme-dark .outbox-item .timestamp {
  color: #9cb4bf;
}

body.theme-dark .settings-form input,
body.theme-dark .login-form input,
body.theme-dark .login-form select,
body.theme-dark .login-form textarea,
body.theme-dark .profile-theme-select,
body.theme-dark .profile-role-simulation-select {
  border-color: #314553;
  background: #101b23;
  color: var(--ink);
}

body.theme-dark .password-toggle {
  border-color: #3a5563;
  background: #1a2b37;
  color: #d8e6ee;
}

body.theme-dark .modal {
  background: #071218b8;
}

body.theme-dark .modal-card {
  border-color: #304753;
  background: #121f28;
}

body.theme-dark .profile-role-simulation {
  border-color: #304753;
  background:
    radial-gradient(circle at 0% 0%, rgba(0, 167, 179, 0.14), transparent 36%),
    #12212b;
}

body.theme-dark .profile-role-simulation-header p,
body.theme-dark .profile-role-simulation-note {
  color: #9fb8c4;
}

body.theme-dark .tenant-settings-section,
body.theme-dark .tenant-stage-settings-section,
body.theme-dark .tenant-notification-card {
  border-color: #304753;
  background:
    radial-gradient(circle at 0% 0%, rgba(0, 167, 179, 0.14), transparent 36%),
    #12212b;
}

body.theme-dark .tenant-settings-section-header {
  border-bottom-color: #36515d;
}

body.theme-dark .tenant-stage-settings-note {
  border-color: #36515d;
  background: #0e1a22;
  color: #9fb8c4;
}

body.theme-dark .tenant-settings-subtitle,
body.theme-dark .tenant-settings-meta,
body.theme-dark .tenant-settings-section-header span,
body.theme-dark .tenant-settings-field small {
  color: #9fb8c4;
}

body.theme-dark .tenant-enabled-toggle,
body.theme-dark .tenant-feature-card,
body.theme-dark .tenant-role-chip {
  border-color: #36515d;
  background: #0e1a22;
  color: #d8e6ee;
}

body.theme-dark .tenant-stage-role-row {
  color: #d8e6ee;
}

body.theme-dark .tenant-feature-card strong {
  color: #f2fbff;
}

body.theme-dark .tenant-feature-card small {
  color: #9fb8c4;
}

body.theme-dark .tenant-settings-field input,
body.theme-dark .tenant-settings-field select,
body.theme-dark .tenant-settings-field textarea {
  border-color: #36515d;
  background: #0e1a22;
  color: #f2fbff;
}

body.theme-dark .user-management-row {
  border-color: #36515d;
  background: #0e1a22;
}

body.theme-dark .user-management-identity span,
body.theme-dark .user-management-identity small {
  color: #9fb8c4;
}

body.theme-dark .system-health-panel {
  border-color: #304753;
  background:
    radial-gradient(circle at 8% 0%, #203746b8 0 18%, transparent 42%),
    linear-gradient(135deg, #111e27f2, #0d171fde);
}

body.theme-dark .system-health-hero {
  border-bottom-color: #2f4653;
}

body.theme-dark .system-health-card,
body.theme-dark .system-health-section,
body.theme-dark .system-health-samples article,
body.theme-dark .system-health-event {
  border-color: #304753;
  background: #101b23;
}

body.theme-dark .system-health-card.is-healthy {
  border-color: #2e655e;
  background: linear-gradient(160deg, #13222a, #112b28);
}

body.theme-dark .system-health-card.is-warning {
  border-color: #74513f;
  background: linear-gradient(160deg, #181f25, #2d1d18);
}

body.theme-dark .system-health-error {
  border-color: #744045;
  background: #2a171b;
  color: #ffb1b9;
}

body.theme-dark .reusable-resolution-option {
  background: #101b23;
  border-color: #304753;
}

body.theme-dark .hierarchy-file-preview-body {
  border-color: #2f4451;
  background: #101b23;
}

body.theme-dark .hierarchy-file-preview-frame,
body.theme-dark .hierarchy-file-preview-image,
body.theme-dark .hierarchy-file-preview-text {
  border-color: #334a58;
  background: #0f1a22;
}

body.theme-dark .hierarchy-file-preview-text {
  color: #d7e6ee;
}

body.theme-dark .hierarchy-file-preview-empty {
  color: #9cb4bf;
}

body.theme-dark .hierarchy-note-composer-label textarea,
body.theme-dark .hierarchy-note-composer-label input {
  border-color: #314553;
  background: #101b23;
  color: var(--ink);
}

body.theme-dark .hierarchy-note-tag-suggestion {
  border-color: #38586a;
  background: #12202a;
  color: #a8d5e4;
}

body.theme-dark .hierarchy-note-tag-suggestion:hover,
body.theme-dark .hierarchy-note-tag-suggestion:focus-visible {
  border-color: #4d7588;
  background: #17303d;
}

body.theme-dark .hierarchy-note-preview-body {
  border-color: #314553;
  background: #101b23;
}

body.theme-dark .hierarchy-checklist-pages,
body.theme-dark .hierarchy-checklist-sidebar {
  border-color: #314553;
  background: #101b23;
}

body.theme-dark .hierarchy-checklist-page-header {
  color: #8fb0bf;
}

body.theme-dark .hierarchy-checklist-field-box {
  border-color: #48adc9;
  background: rgba(72, 173, 201, 0.2);
  color: #b8dfee;
}

body.theme-dark .hierarchy-checklist-field-box.is-selected {
  border-color: #7ad5ec;
  box-shadow: 0 0 0 2px rgba(122, 213, 236, 0.26);
}

body.theme-dark .hierarchy-checklist-field-input input[type="text"] {
  border-color: #446474;
  background: rgba(17, 30, 39, 0.88);
  color: #d8ecf5;
}

body.theme-dark .hierarchy-checklist-encrypted-toggle {
  border-color: #436173;
  background: rgba(14, 28, 37, 0.95);
  color: #9ad4e7;
}

body.theme-dark .hierarchy-checklist-field-input-checkbox {
  color: #cae3ed;
}

body.theme-dark .hierarchy-checklist-inspector-grid label {
  color: #8fb0bf;
}

body.theme-dark .hierarchy-checklist-inspector-grid input,
body.theme-dark .hierarchy-checklist-inspector-grid select {
  border-color: #314553;
  background: #101b23;
  color: #d8ecf5;
}

body.theme-dark .hierarchy-checklist-role-picker {
  border-color: #314553;
  background: #0f1a22;
}

body.theme-dark .hierarchy-checklist-role-picker legend {
  color: #8fb0bf;
}

body.theme-dark .hierarchy-checklist-field-input.is-encrypted-locked input[type="text"] {
  background: rgba(45, 66, 78, 0.78);
  color: #a8c2d0;
}

body.theme-dark .hierarchy-checklist-context-field {
  color: #8fb0bf;
}

body.theme-dark .hierarchy-checklist-context-field select {
  border-color: #314553;
  background: #101b23;
  color: #d8ecf5;
}

body.theme-dark .hierarchy-checklist-mode-prompt {
  color: #c7deea;
}

body.theme-dark .hierarchy-section {
  border-color: #2f4451;
  background: #111e27;
}

body.theme-dark .hierarchy-section.is-missing {
  border-color: #354b58;
  background: #0f1a22;
}

body.theme-dark .hierarchy-add-placeholder {
  color: #6faabb;
}

body.theme-dark .hierarchy-add-placeholder-plus {
  border-color: rgba(125, 220, 228, 0.36);
  background: rgba(17, 30, 39, 0.9);
  color: #9ee8ef;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
}

body.theme-dark .hierarchy-add-placeholder:hover,
body.theme-dark .hierarchy-add-placeholder:focus-visible {
  background: rgba(125, 220, 228, 0.08);
}

body.theme-dark .hierarchy-add-placeholder:focus-visible .hierarchy-add-placeholder-plus {
  box-shadow: 0 0 0 3px rgba(125, 220, 228, 0.18), 0 14px 30px rgba(0, 0, 0, 0.28);
}

body.theme-dark.mode-internal-sandbox .hierarchy-file-tile {
  border-color: rgba(73, 101, 116, 0.92);
  background: linear-gradient(145deg, rgba(20, 34, 44, 0.78), rgba(23, 42, 54, 0.62));
  color: #c9dce6;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.32);
}

body.theme-dark.mode-internal-sandbox .hierarchy-file-tile:hover,
body.theme-dark.mode-internal-sandbox .hierarchy-file-tile:focus-visible {
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.42);
}

body.theme-dark.mode-internal-sandbox .hierarchy-file-tile-meta {
  color: #95b3c1;
}

body.theme-dark.mode-internal-sandbox .hierarchy-note-card {
  border-color: rgba(73, 101, 116, 0.92);
  background: linear-gradient(145deg, rgba(20, 34, 44, 0.82), rgba(23, 42, 54, 0.66));
  color: #c9dce6;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.32);
}

body.theme-dark.mode-internal-sandbox .hierarchy-note-card:hover,
body.theme-dark.mode-internal-sandbox .hierarchy-note-card:focus-visible {
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.42);
}

body.theme-dark.mode-internal-sandbox .hierarchy-note-card-header {
  color: #94b6c5;
}

body.theme-dark.mode-internal-sandbox .hierarchy-note-card-body {
  color: #c6dde7;
}

body.theme-dark .hierarchy-warning-list {
  border-color: #8c6b2f;
  background: #2a2417;
  color: #e2c58c;
}

body.theme-dark .hierarchy-record-link {
  color: #7ddce4;
}

body.theme-dark .hierarchy-record-link:hover,
body.theme-dark .hierarchy-record-link:focus-visible {
  color: #b1f0f5;
}

body.theme-dark .hierarchy-record-missing,
body.theme-dark .hierarchy-section-note {
  color: #9cb4bf;
}

body.theme-dark .hierarchy-field input,
body.theme-dark .hierarchy-field select {
  border-color: #314553;
  background: #101b23;
  color: var(--ink);
}

body.theme-dark .hierarchy-field input[readonly] {
  background: #13222c;
  color: #a7bdc7;
}

body.theme-dark .hierarchy-field-group {
  border-top-color: #314553;
}

body.theme-dark .hierarchy-section-audit {
  border-top-color: #2b3e49;
  color: #8fa8b4;
}

body.theme-dark .hierarchy-field-group-title {
  color: #9cb4bf;
}

body.theme-dark .hierarchy-contacts-wrap {
  border-top-color: transparent;
}

body.theme-dark .hierarchy-contacts-title,
body.theme-dark .hierarchy-contact-empty {
  color: #9cb4bf;
}

body.theme-dark .hierarchy-contact-add {
  border-color: #314553;
  background: #101b23;
  color: #cde0e8;
}

body.theme-dark .hierarchy-owner-select,
body.theme-dark .hierarchy-owner-search,
body.theme-dark .hierarchy-owner-close {
  border-color: #314553;
  background: #101b23;
  color: #cee2eb;
}

body.theme-dark .hierarchy-owner-options {
  border-color: #314553;
  background: #0f1e28;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.theme-dark .hierarchy-owner-option {
  background: #152631;
  color: #cee2eb;
}

body.theme-dark .hierarchy-owner-option:hover,
body.theme-dark .hierarchy-owner-option:focus-visible {
  border-color: #3f5865;
  background: #1b303d;
}

body.theme-dark .hierarchy-owner-option.is-selected {
  border-color: #3a7388;
  background: #113243;
  color: #dbf3ff;
}

body.theme-dark .hierarchy-owner-option-empty {
  color: #9cb4bf;
}

body.theme-dark .hierarchy-owner-display {
  color: #8bc4db;
  background: transparent;
  border: 0;
}

body.theme-dark .hierarchy-owner-display:hover,
body.theme-dark .hierarchy-owner-display:focus-visible {
  color: #b7ecff;
  text-decoration-color: #b7ecff;
}

body.theme-dark .hierarchy-owner-close:hover,
body.theme-dark .hierarchy-owner-close:focus-visible {
  border-color: #3f5865;
  background: #1b303d;
}

body.theme-dark .hierarchy-tier-medal {
  border-color: #314553;
  background: #101b23;
  color: #a7bcc8;
  --tier-ribbon-left: #4c6777;
  --tier-ribbon-right: #3c5565;
  --tier-disc: #5f7684;
  --tier-core: #c0d2dc;
}

body.theme-dark .hierarchy-tier-medal.is-platinum {
  color: #c4d9e6;
  border-color: #5e7f93;
  background: #132432;
  --tier-ribbon-left: #8ea9b9;
  --tier-ribbon-right: #6f8ea0;
  --tier-disc: #9fbdcf;
  --tier-core: #dcecf5;
}

body.theme-dark .hierarchy-tier-medal.is-gold {
  color: #ffd56a;
  border-color: #8d6a1f;
  background: #2d220d;
  --tier-ribbon-left: #ffc243;
  --tier-ribbon-right: #d88b17;
  --tier-disc: #f3ba2f;
  --tier-core: #ffe7a0;
}

body.theme-dark .hierarchy-tier-medal.is-silver {
  color: #d4e2e9;
  border-color: #6a8190;
  background: #172833;
  --tier-ribbon-left: #a4bac7;
  --tier-ribbon-right: #839bab;
  --tier-disc: #c3d3dc;
  --tier-core: #eff6f9;
}

body.theme-dark .hierarchy-tier-medal.is-bronze {
  color: #e9a874;
  border-color: #8e5836;
  background: #2b1b13;
  --tier-ribbon-left: #db9450;
  --tier-ribbon-right: #b36130;
  --tier-disc: #ca7748;
  --tier-core: #ffd9bf;
}

body.theme-dark .hierarchy-tier-menu {
  border-color: #314553;
  background: #101b23;
}

body.theme-dark .hierarchy-tier-option {
  background: #152631;
  color: #cee2eb;
}

body.theme-dark .hierarchy-tier-option:hover,
body.theme-dark .hierarchy-tier-option:focus-visible {
  border-color: #3f5865;
  background: #1b303d;
}

body.theme-dark .hierarchy-tier-option.is-selected {
  border-color: #3a7388;
  background: #153341;
}

body.theme-dark .hierarchy-contact-menu {
  border-color: #314553;
  background: #101b23;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}

body.theme-dark .hierarchy-contact-menu-item {
  color: #cde0e8;
}

body.theme-dark .hierarchy-contact-menu-item:hover,
body.theme-dark .hierarchy-contact-menu-item:focus-visible {
  border-color: #3e5664;
  background: #162733;
}

body.theme-dark .hierarchy-contact-card {
  border-color: #304753;
  background: #0f1a22;
}

body.theme-dark .hierarchy-contact-open {
  color: #9cb4bf;
}

body.theme-dark .hierarchy-contact-open:hover,
body.theme-dark .hierarchy-contact-open:focus-visible {
  color: #b1f0f5;
}

body.theme-dark .hierarchy-contact-role-input,
body.theme-dark .hierarchy-contact-detail-grid input,
body.theme-dark .hierarchy-contact-editor-grid input,
body.theme-dark .hierarchy-contact-duplicate-link {
  border-color: #314553;
  background: #101b23;
  color: #cfe0e8;
}

body.theme-dark .hierarchy-contact-editor {
  border-color: #314553;
  background: #12212b;
}

body.theme-dark .lead-workspace-section {
  border-color: #2f4451;
  background: #111e27;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.26);
}

body.theme-dark .lead-workspace-section-header h3,
body.theme-dark .lead-collab-header h3 {
  color: #d8ecf5;
}

body.theme-dark .lead-owner-display {
  color: #8bc4db;
}

body.theme-dark .lead-owner-display:hover,
body.theme-dark .lead-owner-display:focus-visible {
  color: #b7ecff;
  text-decoration-color: #b7ecff;
}

body.theme-dark .lead-owner-options,
body.theme-dark .lead-action-menu,
body.theme-dark .lead-contact-row,
body.theme-dark .lead-contact-editor,
body.theme-dark .lead-note-editor {
  border-color: #314553;
  background: #101b23;
  color: #cfe0e8;
}

body.theme-dark .lead-owner-option,
body.theme-dark .lead-action-menu-item {
  background: #152631;
  color: #cee2eb;
}

body.theme-dark .lead-owner-option:hover,
body.theme-dark .lead-owner-option:focus-visible,
body.theme-dark .lead-owner-option.is-selected,
body.theme-dark .lead-action-menu-item:hover,
body.theme-dark .lead-action-menu-item:focus-visible {
  border-color: #3f5865;
  background: #1b303d;
}

body.theme-dark .lead-contact-open,
body.theme-dark .lead-file-open,
body.theme-dark .lead-note-open,
body.theme-dark .lead-contact-placeholder {
  color: #9cb4bf;
}

body.theme-dark .lead-contact-editor input,
body.theme-dark .lead-note-editor textarea,
body.theme-dark .lead-note-editor input {
  border-color: #314553;
  background: #101b23;
  color: #cfe0e8;
}

body.theme-dark .lead-conversion-card,
body.theme-dark .lead-credit-app-card,
body.theme-dark .lease-preview-card,
body.theme-dark .lead-convert-section {
  border-color: #314553;
  background: #111e27;
  color: #cfe0e8;
}

body.theme-dark .lead-convert-section h3 {
  color: #d8ecf5;
}

body.theme-dark .lead-credit-app-status {
  border-color: #314553;
  background: linear-gradient(135deg, rgba(34, 168, 183, 0.14), rgba(17, 30, 39, 0.94));
}

body.theme-dark .lead-credit-app-status-heading span,
body.theme-dark .lead-credit-app-status-row,
body.theme-dark .lead-credit-app-status-empty {
  color: #9eb2bd;
}

body.theme-dark .lead-credit-app-status-heading strong,
body.theme-dark .lead-credit-app-status-row strong {
  color: #d8ecf5;
}

body.theme-dark .lead-credit-app-loading {
  color: #9eb2bd;
}

body.theme-dark .lead-credit-app-loading strong {
  color: #d8ecf5;
}

body.theme-dark .lease-preview-panel {
  border-color: #314553;
  background: rgba(17, 30, 39, 0.92);
}

body.theme-dark .lease-preview-summary p,
body.theme-dark .lease-preview-row span,
body.theme-dark .lease-preview-field-row span,
body.theme-dark .lease-recipient-edit span,
body.theme-dark .lease-preview-field-row em,
body.theme-dark .lease-preview-empty,
body.theme-dark .lease-preview-list {
  color: #9eb2bd;
}

body.theme-dark .lease-preview-row strong,
body.theme-dark .lease-preview-field-row strong,
body.theme-dark .lease-recipient-status-row strong {
  color: #d8ecf5;
}

body.theme-dark .lease-recipient-status-row {
  border-color: #314553;
  background: rgba(10, 20, 27, 0.35);
}

body.theme-dark .lease-recipient-status-row small {
  color: #9eb2bd;
}

body.theme-dark .lease-recipient-status-row em {
  color: #bdeef4;
}

body.theme-dark .lease-recipient-edit input {
  border-color: #314553;
  background: #101b23;
  color: #d8ecf5;
}

body.theme-dark .lease-amendment-toggle {
  color: #d8ecf5;
}

body.theme-dark .lease-page-toolbar strong {
  color: #d8ecf5;
}

body.theme-dark .lease-page-toggle {
  border-color: #314553;
  color: #d8ecf5;
  background: rgba(10, 20, 27, 0.35);
}

body.theme-dark .lease-preview-stats span {
  background: rgba(34, 168, 183, 0.18);
  color: #bdeef4;
}

body.theme-dark .lease-page-option {
  border-color: #314553;
  color: #d8ecf5;
}

body.theme-dark .lease-document-preview-frame {
  border-color: #314553;
  background: #fff;
}

body.theme-dark .lease-document-editor {
  border-color: #314553;
  background: #0d171d;
}

body.theme-dark .lease-document-page-label {
  color: #b8ccd6;
}

body.theme-dark .lease-static-text-box {
  background: rgba(255, 255, 255, 0.96);
}

body.theme-dark .lease-static-text-box textarea {
  color: #111;
  background: transparent;
}

body.theme-dark .lead-convert-segmented button,
body.theme-dark .lead-convert-option {
  border-color: #314553;
  background: #152631;
  color: #cee2eb;
}

body.theme-dark .lead-convert-segmented button.is-selected,
body.theme-dark .lead-convert-option:hover,
body.theme-dark .lead-convert-option:focus-visible,
body.theme-dark .lead-convert-option.is-selected {
  border-color: #4f8291;
  background: #203848;
  color: #dff8ff;
}

body.theme-dark .lead-convert-option small {
  color: #93b2c0;
}

body.theme-dark .hierarchy-address-helper {
  color: #90adbc;
}

body.theme-dark .hierarchy-address-helper--error {
  color: #f0a291;
}

body.theme-dark .hierarchy-address-status {
  border-color: #314553;
  background: #142430;
  color: #9fb9c6;
}

body.theme-dark .hierarchy-address-status.is-verified {
  border-color: #3d6f4d;
  background: #173323;
  color: #91d8a2;
}

body.theme-dark .hierarchy-address-status.is-unverified {
  border-color: #744134;
  background: #301c18;
  color: #f0a291;
}

body.theme-dark .hierarchy-address-suggestions {
  border-color: #314553;
  background: #101b23fa;
}

body.theme-dark .hierarchy-address-suggestion {
  background: #152631;
  color: #cee2eb;
}

body.theme-dark .hierarchy-address-suggestion:hover,
body.theme-dark .hierarchy-address-suggestion:focus-visible {
  border-color: #3f5865;
  background: #1b303d;
}

body.theme-dark .hierarchy-tree-warning-list {
  border-color: #8c6b2f;
  background: #2a2417;
  color: #e2c58c;
}

body.theme-dark .hierarchy-tree-toggle {
  border-color: #314553;
  background: #101b23;
  color: #b5ccd8;
}

body.theme-dark .hierarchy-tree-node-type {
  color: #9ab2bd;
}

body.theme-dark .hierarchy-tree-node-label,
body.theme-dark .hierarchy-tree-node-meta {
  color: #cfe0e8;
}

body.theme-dark .hierarchy-tree-opportunity-button {
  color: #7ddce4;
}

body.theme-dark .hierarchy-tree-opportunity-button:hover,
body.theme-dark .hierarchy-tree-opportunity-button:focus-visible {
  color: #b1f0f5;
}

body.theme-dark .hierarchy-tree-node-row.is-selected .hierarchy-tree-opportunity-button {
  color: #c4f5fa;
}

body.theme-dark .profile-grid div {
  border-color: #314553;
  background: #101b23;
}

body.theme-dark .profile-grid dt {
  color: #9eb7c3;
}

body.theme-dark .permission-matrix {
  border-color: #314553;
  background: #101b23;
}

body.theme-dark .permission-matrix-summary {
  color: #9eb7c3;
}

body.theme-dark .permission-matrix-table th,
body.theme-dark .permission-matrix-table td {
  border-bottom-color: #314553;
}

body.theme-dark .permission-matrix-email-input {
  border-color: #314553;
  background: #081119;
  color: #eef8fb;
}

body.theme-dark .permission-matrix-table thead th {
  color: #9eb7c3;
}

body.theme-dark .permission-matrix-table tbody th {
  color: #7ddce4;
}

body.theme-dark .permission-matrix-table tbody tr.is-current-role {
  background: rgba(22, 106, 112, 0.28);
}

body.theme-dark .toast {
  background: #17323b;
}

body.theme-dark .toast.is-error {
  background: #7a2525;
}

body.theme-dark .visual-card {
  border-color: #314553;
  background: #111e27ef;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.24);
}

body.theme-dark .donut-chart {
  border-color: #314553;
}

body.theme-dark .donut-chart::after {
  background: #111e27;
  border-color: #314553;
}

body.theme-dark .bar-track {
  background: #20313d;
}

body.theme-dark th,
body.theme-dark td {
  border-bottom-color: #304653;
}

body.theme-dark .department-card {
  border-color: #314553;
  background: #111e27ef;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.24);
}

body.theme-dark .sky-scene::before {
  background: radial-gradient(circle at 50% 16%, #83d3ff22 0, #83d3ff00 56%);
}

body.theme-dark .sky-star {
  background: #d5edff;
  box-shadow: 0 0 8px #d5edff80;
}

body.theme-dark .sky-cloud {
  background: linear-gradient(180deg, #d9edff40 0, #d9edff1a 100%);
  box-shadow:
    inset 0 0 12px #d9edff26,
    0 0 18px #9dd0ff1a;
}

body.theme-dark .sky-glow {
  background: radial-gradient(circle, #b7dff86f 0, #b7dff81c 45%, #b7dff800 72%);
}


body.theme-dark .sky-moon {
  background:
    radial-gradient(circle at 34% 30%, #f4f8ff 0, #d9e2ed 50%, #b8c2ce 100%),
    radial-gradient(circle at 64% 63%, #d2dbe7 0, #d2dbe700 45%);
  box-shadow:
    0 0 55px #a5d4ff59,
    inset -8px -10px 18px #8fa0b66b,
    inset 9px 8px 14px #f3f8ff61;
}

body.theme-dark .sky-moon::before {
  background: #9facc07d;
  box-shadow: 34px 38px 0 -2px #9facc05c;
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .board-column {
    min-height: 50vh;
  }

  .column-dropzone {
    min-height: 45vh;
  }

  .sidebar {
    order: -1;
  }

  .board-controls {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .filter-summary {
    grid-column: 1 / -1;
    justify-self: start;
  }

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

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

  .hierarchy-contact-editor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .mode-internal-sandbox .hierarchy-floating-files-layer {
    left: -150px;
    width: 138px;
  }

  .mode-internal-sandbox .hierarchy-floating-notes-layer {
    right: -176px;
    width: 164px;
  }

  .mode-internal-sandbox .hierarchy-file-grid {
    grid-template-columns: 1fr;
  }

  .mode-internal-sandbox .hierarchy-file-tile {
    min-height: 64px;
  }

  .mode-internal-sandbox .hierarchy-note-card {
    padding: 6px 7px;
  }

  .hierarchy-checklist-layout {
    grid-template-columns: 1fr;
  }

  .hierarchy-checklist-sidebar {
    max-height: 320px;
  }
}

@media (max-width: 700px) {
  .app-shell,
  .reporting-shell {
    padding: 12px;
  }

  .topbar {
    padding: 14px;
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-search-stack {
    width: 100%;
    justify-items: stretch;
  }

  .topbar-actions {
    width: 100%;
    justify-content: center;
  }

  .profile-trigger {
    align-self: flex-end;
  }

  .topbar > .profile-trigger {
    position: static;
    margin-top: 0;
  }

  .global-search-result {
    align-items: flex-start;
    flex-direction: column;
  }

  .global-search-result-side {
    max-width: 100%;
    justify-items: start;
  }

  .tabs-wrap {
    padding: 10px;
  }

  .pipeline-tabs-row {
    align-items: stretch;
    flex-direction: column;
  }

  .tabs-row-action {
    align-self: flex-end;
  }

  .board-controls {
    grid-template-columns: 1fr;
  }

  .filter-summary {
    justify-self: start;
  }

  .donut-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .donut-legend {
    width: 100%;
  }

  .board {
    grid-auto-columns: minmax(240px, 1fr);
  }

  .toast-container {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .hierarchy-modal-card {
    width: min(98vw, 98vw);
    max-height: 92vh;
    padding: 14px;
  }

  .hierarchy-tree-modal-card {
    width: min(98vw, 98vw);
    max-height: 92vh;
    padding: 14px;
  }

  .hierarchy-file-preview-card {
    width: min(98vw, 98vw);
    max-height: 92vh;
    padding: 14px;
  }

  .hierarchy-note-composer-card,
  .hierarchy-note-preview-card {
    width: min(98vw, 98vw);
    max-height: 92vh;
    padding: 14px;
  }

  .hierarchy-checklist-card {
    width: min(99vw, 99vw);
    max-height: 94vh;
    padding: 12px;
  }

  .hierarchy-checklist-header {
    flex-direction: column;
    gap: 8px;
  }

  .hierarchy-checklist-inspector-grid {
    grid-template-columns: 1fr;
  }

  .hierarchy-sections {
    max-height: calc(92vh - 210px);
  }

  .hierarchy-tree-content {
    max-height: calc(92vh - 210px);
  }

  .hierarchy-file-preview-body {
    max-height: calc(92vh - 220px);
    min-height: 300px;
  }

  .hierarchy-note-preview-body {
    max-height: calc(92vh - 240px);
  }

  .hierarchy-file-preview-frame,
  .hierarchy-file-preview-text {
    min-height: 430px;
  }

  .hierarchy-tree-node-row {
    padding-left: calc(var(--tree-depth, 0) * 14px);
  }

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

  .hierarchy-agreement-columns {
    grid-template-columns: 1fr;
  }

  .hierarchy-contact-editor-grid {
    grid-template-columns: 1fr;
  }

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

  .mode-internal-sandbox .hierarchy-floating-files-layer {
    left: -108px;
    width: 96px;
  }

  .mode-internal-sandbox .hierarchy-floating-notes-layer {
    right: -108px;
    width: 96px;
  }

  .mode-internal-sandbox .hierarchy-file-tile {
    min-height: 56px;
    padding: 5px 6px;
  }

  .mode-internal-sandbox .hierarchy-file-tile-name {
    font-size: 0.62rem;
  }

  .mode-internal-sandbox .hierarchy-file-tile-meta {
    font-size: 0.56rem;
  }

  .mode-internal-sandbox .hierarchy-note-card {
    padding: 5px 6px;
  }

  .mode-internal-sandbox .hierarchy-note-card-header {
    font-size: 0.52rem;
  }

  .mode-internal-sandbox .hierarchy-note-card-body {
    font-size: 0.58rem;
  }
}

@media (max-width: 900px) {
  .user-management-create-grid,
  .user-management-row {
    grid-template-columns: 1fr;
  }

  .user-management-actions {
    justify-content: flex-start;
  }

  .system-health-hero,
  .system-health-columns {
    grid-template-columns: 1fr;
  }

  .system-health-hero {
    flex-direction: column;
  }

  .system-health-actions {
    justify-content: flex-start;
  }
}

.hierarchy-action-toggle {
  margin-left: 4px;
  font-size: 0.95rem;
  line-height: 1;
}

.hierarchy-action-toggle-icon {
  display: block;
  transform: translateY(-1px);
}

.hierarchy-action-menu {
  left: 50%;
  right: auto;
  min-width: 118px;
  transform: translateX(-50%);
}

.hierarchy-contact-menu-item.danger {
  color: #b4232d;
}

.hierarchy-contact-menu-item.danger:hover,
.hierarchy-contact-menu-item.danger:focus-visible {
  border-color: #f1b3b8;
  background: #fff0f2;
}

.hierarchy-action-modal-card {
  width: min(680px, 100%);
  max-height: min(86vh, 900px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.hierarchy-action-section {
  display: grid;
  gap: 1rem;
}

.hierarchy-action-section p {
  margin: 0;
  color: #607987;
}

.hierarchy-action-section--danger {
  border-color: #cf5f67;
}

.hierarchy-action-options {
  max-height: 280px;
  overflow: auto;
}

.button.danger {
  background: #b4232d;
  border-color: #b4232d;
  color: #fff;
}

body.theme-dark .hierarchy-contact-menu-item.danger {
  color: #ff9ca6;
}

body.theme-dark .hierarchy-contact-menu-item.danger:hover,
body.theme-dark .hierarchy-contact-menu-item.danger:focus-visible {
  border-color: rgba(255, 156, 166, 0.45);
  background: rgba(180, 35, 45, 0.18);
}

body.theme-dark .hierarchy-action-section p {
  color: var(--muted);
}

/* Reporting > Sales. Scoped to preserve the existing board and Overview. */
.sales-subtabs { display:flex; gap:8px; grid-column:1 / -1; width:100%; border-bottom:1px solid var(--border, #d4dcdf); padding:0 0 10px; margin-bottom:20px; }
.sales-subtabs button { background:transparent; color:inherit; border:0; padding:10px 22px; border-radius:8px; font:inherit; cursor:pointer; }
.sales-subtabs button[aria-selected="true"] { background:#176875; color:#fff; }
.sales-tab-panel { grid-column:1 / -1; width:100%; min-width:0; }
.sales-report { display:grid; gap:20px; max-width:1440px; margin:auto; width:100%; font-variant-numeric:tabular-nums; }
.sales-report h2, .sales-report h3, .sales-report h4, .sales-report p { margin:0; }
.sales-report h2 { font-size:32px; }
.sales-report h3 { font-size:19px; }
.sales-report h4 { font-size:14px; }
.sales-report p, .sales-report small { line-height:1.6; }
.sales-report small { display:block; font-size:12px; opacity:.8; }
.sales-heading, .sales-section-heading { display:flex; align-items:center; justify-content:space-between; gap:18px; flex-wrap:wrap; }
.sales-headline { display:grid; text-align:right; gap:5px; }
.sales-headline strong { font-size:36px; letter-spacing:-1px; }
.sales-headline span { font-size:13px; }
.sales-controls { display:flex; gap:16px; align-items:end; flex-wrap:wrap; padding:18px; background:var(--panel); border:1px solid var(--border, #d4dcdf); border-radius:12px; }
.sales-controls label { display:grid; gap:6px; font-size:12px; font-weight:600; }
.sales-controls input { font:inherit; color:inherit; background:var(--panel); border:1px solid var(--border, #a7b8bf); border-radius:6px; padding:8px 10px; min-height:38px; max-width:200px; }
.sales-source, .sales-footnote { font-size:12px; opacity:.8; }
.sales-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.sales-metrics article, .sales-panel { border:1px solid var(--border, #d4dcdf); background:var(--panel); border-radius:12px; padding:20px; }
.sales-metrics article { display:grid; gap:6px; }
.sales-metrics article > span { font-size:13px; font-weight:600; }
.sales-metrics strong { font-size:30px; letter-spacing:-.8px; }
.sales-metrics .sales-attention-metric { border-top:3px solid #bc8129; }
.sales-panel { display:grid; gap:14px; min-width:0; }
.sales-panel > p { font-size:13px; opacity:.85; }
.sales-stack { display:flex; height:26px; border-radius:7px; overflow:hidden; background:#8999a422; }
.sales-banked { background:#3d866b; }
.sales-pipeline { background:#47869d; }
.sales-future { background:#cc9a49; }
.sales-layers { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; }
.sales-layers article { position:relative; padding-left:18px; display:grid; gap:5px; }
.sales-layers strong { font-size:23px; }
.sales-dot { position:absolute; width:9px; height:9px; border-radius:50%; left:0; top:5px; }
.sales-report table { width:100%; border-collapse:collapse; font-size:13px; }
.sales-report th, .sales-report td { padding:12px 10px; border-bottom:1px solid var(--border, #d4dcdf); text-align:right; vertical-align:top; }
.sales-report th:first-child, .sales-report td:first-child { text-align:left; }
.sales-report thead th { font-size:11px; text-transform:uppercase; letter-spacing:.04em; }
.sales-warning, .sales-quality { background:#c9923214; }
.sales-quality, .sales-alert { border:1px solid #be873d; border-radius:10px; padding:14px 18px; font-size:13px; }
.sales-report summary { cursor:pointer; font-weight:600; padding:4px 0; }
.sales-report details[open] summary { margin-bottom:10px; }
.sales-report details.sales-panel { display:block; }
.sales-report details.sales-panel > p { margin:10px 0; }
.sales-deal-link { color:var(--brand); font:inherit; font-weight:600; background:none; border:0; cursor:pointer; text-align:left; padding:0; text-decoration:underline; text-underline-offset:3px; }
.sales-report button:focus-visible, .sales-subtabs button:focus-visible, .sales-report input:focus-visible, .sales-report summary:focus-visible { outline:3px solid #26859c; outline-offset:3px; }
.sales-trend { display:grid; gap:9px; }
.sales-trend-row { display:grid; grid-template-columns:120px minmax(0,1fr) 85px; align-items:center; gap:14px; font-size:12px; }
.sales-trend-row strong { text-align:right; }
.sales-track { background:#8999a415; border-radius:4px; overflow:hidden; }
.sales-track i { display:block; min-height:19px; background:#3d866b; border-radius:4px; }
.sales-created-trend .sales-track i { background:#47869d; min-height:10px; }
.sales-trend-row.is-partial .sales-track i { opacity:.5; background-image:repeating-linear-gradient(45deg,transparent,transparent 5px,#fff4 5px,#fff4 7px); }
.sales-queue { display:grid; grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); gap:12px; }
.sales-queue article { border:1px solid var(--border, #d4dcdf); border-radius:8px; padding:16px; display:grid; gap:8px; }
.sales-queue p { font-size:12px; }
.sales-empty { padding:30px; text-align:center; opacity:.75; }
.sales-status { font-size:13px; }
.sales-sr-only { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
@media (max-width:900px) { .sales-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:600px) { .sales-headline { text-align:left; } .sales-layers { grid-template-columns:1fr; } .sales-metrics { grid-template-columns:1fr; } .sales-controls label, .sales-controls input { width:100%; max-width:none; } .sales-trend-row { grid-template-columns:94px minmax(0,1fr) 70px; gap:8px; } .sales-panel { padding:14px; } }
