:root {
  font-family:
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #203c35;
  background: #f7f6f2;
  font-synthesis: none;
  --green: #193e35;
  --teal: #176b73;
  --line: #e0e5dd;
  --muted: #69776e;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
button {
  border: 1px solid var(--line);
  background: white;
  color: var(--green);
  border-radius: 8px;
  padding: 9px 13px;
  font-size: 13px;
  font-weight: 550;
}
button:hover {
  background: #edf2eb;
}
.primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.primary:hover {
  background: #2c5749;
}
.ghost {
  background: transparent;
  border-color: transparent;
}
.small {
  padding: 6px 10px;
  font-size: 12px;
}
.danger {
  color: #a43f35;
}
.shell {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  border-right: 1px solid var(--line);
  background: #f1f2ec;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  gap: 25px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.7px;
}
.brand svg {
  width: 31px;
  height: 31px;
}
.brand-sub {
  font-size: 10px;
  margin: 6px 0 0 41px;
  color: var(--muted);
  letter-spacing: 0.6px;
}
.workspace {
  border: 1px solid #dce1d5;
  border-radius: 10px;
  background: #fafbf7;
  padding: 13px;
  font-size: 13px;
  line-height: 1.8;
}
.eyebrow {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  font-weight: 650;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nav button {
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 12px;
}
.nav .active {
  background: #dee7dc;
  color: #254b3d;
}
.nav-icon {
  font-size: 17px;
  width: 20px;
  text-align: center;
}
.side-bottom {
  margin-top: auto;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
}
.local-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.dot {
  width: 6px;
  height: 6px;
  background: #6c8872;
  border-radius: 50%;
}
.main {
  min-width: 0;
}
.topbar {
  height: 69px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  gap: 12px;
  background: #fcfcf9;
}
.breadcrumb {
  font-size: 12px;
  color: var(--muted);
}
.breadcrumb strong {
  color: var(--green);
  font-weight: 550;
}
.top-actions {
  display: flex;
  gap: 7px;
  align-items: center;
}
.save-status {
  font-size: 11px;
  color: var(--muted);
  margin-right: 8px;
}
.content {
  padding: 30px;
}
.heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 23px;
}
.heading h1 {
  font-size: 29px;
  letter-spacing: -0.8px;
  margin: 7px 0 9px;
  font-weight: 620;
}
.heading p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.65;
}
.title-actions {
  display: flex;
  gap: 8px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 22px;
}
.stat {
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.stat-label {
  font-size: 12px;
  color: var(--muted);
}
.stat-number {
  font-size: 25px;
  letter-spacing: -0.8px;
}
.stat-icon {
  font-size: 22px;
  color: #95a99b;
}
.editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 18px;
  align-items: start;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  overflow: hidden;
}
.panel-header {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.panel-header h2 {
  font-size: 14px;
  margin: 0;
  font-weight: 600;
}
.segmented {
  display: flex;
  gap: 2px;
  background: #f0f2ed;
  border-radius: 7px;
  padding: 3px;
}
.segmented button {
  padding: 6px 10px;
  border: 0;
  background: transparent;
  font-size: 11px;
}
.segmented .active {
  background: white;
  box-shadow: 0 1px 3px #0001;
}
.canvas {
  min-height: 410px;
  height: 480px;
  overflow: auto;
  background-color: #fafbf8;
  background-image: radial-gradient(#d9dfd5 0.8px, transparent 0.8px);
  background-size: 18px 18px;
  position: relative;
}
.tree {
  position: relative;
  transform-origin: top left;
}
.tree svg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.node {
  position: absolute;
  width: 207px;
  min-height: 95px;
  text-align: left;
  white-space: normal;
  padding: 12px 14px;
  border: 1px solid #d8e1d4;
  border-left: 3px solid #87a381;
  border-radius: 9px;
  box-shadow: 0 3px 10px #17352d07;
  background: #fff;
}
.node.selected {
  border: 1.5px solid #176b73;
  border-left: 4px solid #176b73;
  box-shadow: 0 0 0 3px #176b730c;
}
.node.measure {
  border-left-color: #ab8b58;
  background: #fffdf6;
}
.node-type {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #778779;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
  font-weight: 650;
  text-transform: uppercase;
}
.node-title {
  display: block;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 600;
}
.node-footer {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
  margin-top: 11px;
  font-weight: 400;
}
.pill {
  font-size: 10px;
  display: inline-flex;
  gap: 5px;
  align-items: center;
  border-radius: 4px;
  background: #f0f3ec;
  padding: 3px 6px;
  color: #657663;
  white-space: nowrap;
}
.pill.reached {
  background: #e3f0e5;
  color: #2e633e;
}
.pill.progress {
  background: #e4eff0;
  color: #22636b;
}
.pill.missed {
  background: #f9e9e4;
  color: #963e2a;
}
.legend {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  padding: 12px 16px;
  font-size: 10px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.line {
  width: 17px;
  border-top: 1.5px solid #9eb393;
}
.line.dashed {
  border-top-style: dashed;
  border-color: #ae8d52;
}
.line.cross {
  border-top-style: dotted;
  border-color: #176b73;
}
.detail-body {
  padding: 18px;
}
.detail-body h3 {
  font-size: 17px;
  line-height: 1.45;
  margin: 9px 0 16px;
  letter-spacing: -0.3px;
}
.form-label {
  display: block;
  font-size: 11px;
  color: #64746a;
  font-weight: 600;
  margin: 13px 0 6px;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #dce3d7;
  border-radius: 7px;
  background: #fcfdfb;
  color: var(--green);
  padding: 9px 10px;
  font-size: 12px;
}
textarea {
  resize: vertical;
  min-height: 76px;
  line-height: 1.5;
}
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.detail-section {
  margin-top: 19px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}
.detail-section h4 {
  font-size: 12px;
  margin: 0 0 9px;
}
.source-ref {
  font-size: 11px;
  line-height: 1.65;
  color: var(--muted);
  background: #f6f7f2;
  border-radius: 7px;
  padding: 10px;
  margin: 7px 0;
}
.source-ref a {
  color: var(--teal);
}
.source-ref blockquote {
  margin: 5px 0;
  font-style: italic;
}
.full {
  width: 100%;
}
.muted {
  color: var(--muted);
}
.help {
  font-size: 11px;
  line-height: 1.7;
}
.guide {
  margin-top: 18px;
  padding: 19px 21px;
  display: flex;
  gap: 15px;
  background: #edf2e8;
  border: 1px solid #dce5d4;
  border-radius: 10px;
}
.guide-icon {
  font-size: 22px;
}
.guide h3 {
  font-size: 13px;
  margin: 0 0 6px;
}
.guide p {
  font-size: 12px;
  line-height: 1.7;
  margin: 0;
  color: #65745f;
}
.list-view {
  padding: 15px;
}
.list-node {
  width: 100%;
  display: flex;
  gap: 10px;
  text-align: left;
  align-items: center;
  margin: 6px 0;
  padding: 12px;
}
.list-node .node-title {
  flex: 1;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
th {
  text-align: left;
  padding: 14px;
  color: var(--muted);
  font-weight: 500;
  font-size: 11px;
  background: #fafbf7;
}
td {
  padding: 15px 14px;
  border-top: 1px solid var(--line);
  line-height: 1.5;
}
td button {
  text-align: left;
}
.metric {
  font-weight: 600;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.source-card,
.finding {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}
.source-card h3,
.finding h3 {
  font-size: 15px;
  line-height: 1.5;
  margin: 8px 0;
}
.source-card p,
.finding p {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}
.source-card a {
  font-size: 12px;
  color: var(--teal);
}
.finding {
  margin-bottom: 12px;
}
.notice {
  padding: 15px 18px;
  border-radius: 9px;
  background: #f0f3ec;
  color: #68755e;
  font-size: 12px;
  line-height: 1.7;
  margin-bottom: 18px;
}
.empty {
  padding: 40px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.link-item {
  font-size: 11px;
  margin: 9px 0;
  line-height: 1.7;
}
.link-item button {
  padding: 2px 5px;
}
.tab-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: 0 24px 90px #163c3540;
  width: min(760px, calc(100vw - 32px));
  max-height: 90vh;
  padding: 0;
  color: var(--green);
}
dialog::backdrop {
  background: #142e2855;
  backdrop-filter: blur(3px);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  border-bottom: 1px solid var(--line);
}
.modal-header h2 {
  font-size: 20px;
  margin: 0;
  letter-spacing: -0.4px;
}
.modal-body {
  padding: 22px 25px;
}
.modal-footer {
  padding: 17px 25px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.dropzone {
  border: 1.5px dashed #bccaba;
  border-radius: 10px;
  background: #f7f9f3;
  padding: 25px;
  text-align: center;
}
.dropzone p {
  font-size: 12px;
  color: var(--muted);
}
.proposal {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 16px;
  margin: 12px 0;
}
.proposal h3 {
  font-size: 14px;
  margin: 0 0 8px;
}
.proposal blockquote {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  margin: 9px 0;
  padding-left: 10px;
  border-left: 2px solid #bac8b2;
}
.proposal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}
.measurement {
  padding: 8px 0;
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #eef1e9;
}
.busy {
  opacity: 0.55;
  pointer-events: none;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--green);
  color: white;
  font-size: 13px;
  border-radius: 9px;
  padding: 13px 20px;
  box-shadow: 0 5px 25px #0002;
  z-index: 100;
  display: none;
  max-width: 90vw;
}
#toast.visible {
  display: block;
}
.toolbar {
  display: flex;
  gap: 5px;
}
.heading .pill {
  margin-left: 10px;
}
a {
  color: var(--teal);
}
.check-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.check-list label {
  font-size: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.check-list input {
  width: auto;
}
.context-fields {
  margin-bottom: 20px;
}
.ai-badge {
  font-size: 10px;
  color: #687a64;
}
.assessment-warning {
  font-size: 11px;
  color: #946527;
  background: #faf2dc;
  padding: 9px;
  border-radius: 6px;
}
.saved-error {
  color: #a43f35;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #168391;
}
.hidden {
  display: none;
}
@media (min-width: 1500px) {
  .content {
    max-width: 1550px;
    margin: auto;
  }
  .canvas {
    height: 570px;
  }
}
@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 180px 1fr;
  }
  .sidebar {
    padding: 24px 12px;
  }
  .brand {
    font-size: 18px;
  }
  .content {
    padding: 22px;
  }
  .editor {
    grid-template-columns: minmax(0, 1fr) 280px;
  }
  .topbar {
    padding: 0 22px;
  }
  .heading h1 {
    font-size: 25px;
  }
}
@media (max-width: 850px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    padding: 14px 18px;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .workspace,
  .brand-sub,
  .side-bottom {
    display: none;
  }
  .nav {
    flex-direction: row;
    gap: 2px;
    margin-left: auto;
  }
  .nav button {
    padding: 8px;
    font-size: 11px;
  }
  .nav-icon {
    display: none;
  }
  .editor {
    grid-template-columns: 1fr;
  }
  .detail-body {
    max-width: 100%;
  }
  .heading {
    align-items: flex-start;
  }
  .topbar {
    padding: 0 18px;
  }
  .save-status {
    display: none;
  }
  .stats {
    gap: 8px;
  }
  .stat {
    padding: 12px;
  }
  .stat-icon {
    display: none;
  }
  .card-grid {
    grid-template-columns: 1fr;
  }
  .content {
    padding: 18px;
  }
  .title-actions {
    flex-direction: column;
  }
  .heading h1 {
    font-size: 22px;
  }
  .canvas {
    height: 450px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button {
    transition:
      background 0.15s,
      box-shadow 0.15s;
  }
}
.detail-body {
  max-height: 690px;
  overflow: auto;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
}
.canvas {
  cursor: grab;
}
.node {
  cursor: pointer;
}
.node:active {
  cursor: grabbing;
}
@media (max-width: 850px) {
  .sidebar {
    position: static;
    height: auto;
  }
  .detail-body {
    max-height: none;
  }
}
@media (max-width: 600px) {
  .breadcrumb {
    display: none;
  }
  .top-actions {
    width: 100%;
    justify-content: space-between;
  }
  .heading {
    flex-direction: column;
  }
  .title-actions {
    flex-direction: row;
  }
  .nav button {
    font-size: 10px;
    padding: 7px 5px;
  }
  .brand {
    font-size: 16px;
  }
  .brand svg {
    width: 23px;
  }
  .sidebar {
    gap: 7px;
  }
  .content {
    padding: 14px;
  }
  .stat-number {
    font-size: 22px;
  }
  .stat-label {
    font-size: 10px;
  }
  .legend {
    gap: 9px;
  }
}
.panel,
.editor > div,
.stat {
  min-width: 0;
}
.stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 850px) {
  .editor {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 600px) {
  .sidebar {
    flex-wrap: wrap;
  }
  .nav {
    width: 100%;
    justify-content: space-between;
  }
  .nav button {
    font-size: 12px;
    padding: 8px;
  }
  .top-actions {
    gap: 4px;
  }
  .top-actions button {
    padding: 7px 9px;
  }
  .stat {
    padding: 10px;
  }
  .panel-header {
    flex-wrap: wrap;
  }
  .source-card {
    overflow-wrap: anywhere;
  }
}
/* Board controls are separate buttons so keyboard and pointer flows agree. */
.board-hint {
  padding: 10px 17px;
  font-size: 11px;
  color: #69786d;
  border-bottom: 1px solid #e8ebe3;
  background: #fbfcf8;
}
.canvas {
  touch-action: none;
  cursor: grab;
}
.canvas:active {
  cursor: grabbing;
}
.tree svg {
  pointer-events: none;
  overflow: visible;
}
.node {
  padding: 0;
  overflow: visible;
  cursor: grab;
  touch-action: none;
}
.node-select {
  display: block;
  width: 100%;
  min-height: 104px;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 13px 15px 12px;
  border-radius: inherit;
  color: inherit;
  cursor: grab;
  user-select: none;
}
.node-select:hover {
  background: transparent;
}
.node-select .node-type {
  padding-right: 16px;
}
.node-title {
  display: block;
}
.node-plus {
  position: absolute;
  right: 6px;
  top: 5px;
  border: 0;
  padding: 0;
  width: 24px;
  height: 24px;
  background: transparent;
  border-radius: 5px;
  font-size: 18px;
  color: #527258;
}
.node-plus:hover {
  background: #e7eedf;
}
.port {
  position: absolute;
  top: 44px;
  width: 16px;
  height: 16px;
  min-width: 0;
  border: 2px solid #91a78b;
  border-radius: 50%;
  background: #fff;
  padding: 0;
  z-index: 3;
  cursor: crosshair;
}
.port-in {
  left: -9px;
}
.port-out {
  right: -9px;
}
.port:hover,
.port.armed {
  background: #193e35;
  border-color: #193e35;
  transform: scale(1.2);
}
.port:focus-visible,
.node-plus:focus-visible,
.node-select:focus-visible {
  outline: 3px solid #176b73;
  outline-offset: 3px;
}
.connecting .port-in {
  border-color: #176b73;
  box-shadow: 0 0 0 4px #176b7318;
}
.card-menu {
  display: grid;
  gap: 10px;
}
.card-menu button {
  text-align: left;
}
.modal-message {
  padding: 13px 15px;
  margin: 0 0 16px;
  background: #fff0e9;
  color: #813f2c;
  border: 1px solid #e4bba8;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.auth-shell {
  max-width: 480px;
  margin: 8vh auto;
  padding: 28px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 12px 50px #193e3510;
}
.auth-shell h1 {
  font-size: 26px;
  margin-top: 24px;
}
.auth-shell .primary {
  margin-top: 20px;
}
.dashboard-context {
  margin-bottom: 20px;
}
.progress-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--border);
}
.filters label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 150px;
  font-size: 12px;
  color: #58655b;
}
.filters .check-label {
  flex-direction: row;
  align-items: center;
  min-width: auto;
  padding-bottom: 9px;
}
.filters input[type="checkbox"] {
  width: auto;
}
.filter-count {
  padding: 0 18px;
}
.execution-fields {
  padding-top: 10px;
}
.demo-banner {
  border-left: 4px solid #92722f;
}
.error-banner {
  border-left: 4px solid #a43f35;
  background: #fff1ee;
  padding: 15px;
  color: #6f2b24;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid #176b73;
  outline-offset: 3px;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.analysis-context {
  margin: 16px 0;
  padding: 14px 18px;
  background: #f5f7f2;
  border: 1px solid #dce4d8;
  border-radius: 8px;
  overflow-wrap: anywhere;
}
.analysis-context summary {
  cursor: pointer;
  font-weight: 650;
}
.analysis-fact + .analysis-fact {
  border-top: 1px solid #dce4d8;
  margin-top: 16px;
  padding-top: 8px;
}
.analysis-fact h4 {
  margin: 14px 0 8px;
}
.analysis-fact blockquote {
  margin: 8px 0;
  padding: 8px 12px;
  border-left: 3px solid #708d62;
  font-size: 13px;
}
.analysis-decision {
  padding: 12px 15px;
  margin: 12px 0;
  background: #f0f4ef;
  border-left: 3px solid #527149;
}
.analysis-decision p {
  white-space: pre-wrap;
}
[data-ai-finding] {
  overflow-wrap: anywhere;
}
@media (max-width: 800px) {
  .progress-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .filters label {
    flex: 1;
    min-width: 120px;
  }
  .auth-shell {
    margin: 25px 14px;
  }
  .topbar {
    gap: 12px;
    flex-wrap: wrap;
  }
  .top-actions {
    flex-wrap: wrap;
  }
  .heading {
    gap: 12px;
  }
  .title-actions {
    flex-wrap: wrap;
  }
}
@media (max-width: 850px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    min-width: 0;
    flex-wrap: wrap;
  }
  .nav {
    flex-wrap: wrap;
    min-width: 0;
  }
  .save-status {
    display: block;
    flex-basis: 100%;
  }
  .topbar {
    height: auto;
    min-height: 69px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
}
@media (max-width: 600px) {
  .nav button {
    flex: 1 1 auto;
  }
  .list-node {
    flex-wrap: wrap;
  }
  .list-node .node-title {
    min-width: 100px;
  }
}
