:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --ink: #14213d;
  --muted: #667085;
  --panel: rgba(255, 255, 255, 0.92);
  --line: #cad5e6;
  --accent: #2364aa;
  --accent-2: #2a9d8f;
  --warm: #e76f51;
  --radius: 18px;
  --node-radius: 18px;
  --node-border: 1px solid rgba(20, 33, 61, 0.14);
  --node-shadow: 0 18px 35px rgba(20, 33, 61, 0.14);
}

body.dark-mode {
  color-scheme: dark;
  --bg: #0f172a;
  --ink: #edf2ff;
  --muted: #9aa7bd;
  --panel: rgba(15, 23, 42, 0.9);
  --line: #53627a;
  --accent: #66a6ff;
  --accent-2: #47d6c4;
  --node-border: 1px solid rgba(255, 255, 255, 0.18);
  --node-shadow: 0 20px 42px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.welcome-screen {
  min-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(125deg, rgba(35, 100, 170, 0.16), transparent 38%),
    linear-gradient(315deg, rgba(42, 157, 143, 0.18), transparent 42%),
    #eef4f8;
}

body.dark-mode .welcome-screen {
  background:
    linear-gradient(125deg, rgba(102, 166, 255, 0.18), transparent 38%),
    linear-gradient(315deg, rgba(71, 214, 196, 0.16), transparent 42%),
    #0b1220;
}

.topbar {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 26px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.welcome-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
}

.brand-mark span {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 30% 30%, #fff 0 16%, transparent 17%),
    linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 24px rgba(35, 100, 170, 0.25);
}

.brand-mark.compact {
  margin-bottom: 28px;
}

.hero {
  width: min(1180px, calc(100% - 40px));
  min-height: calc(100vh - 92px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(420px, 1.05fr);
  gap: 54px;
  align-items: center;
  padding-bottom: 48px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(42px, 7vw, 82px);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-text {
  max-width: 610px;
  margin: 24px 0 0;
  color: #42526b;
  font-size: 19px;
  line-height: 1.65;
}

body.dark-mode .hero-text {
  color: #b8c2d6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.primary-button,
.secondary-button,
.ghost-button,
.action-grid button,
.segmented button,
.zoom-controls button,
.node-action {
  border: 0;
  min-height: 42px;
  border-radius: 12px;
  font-weight: 750;
}

.primary-button {
  background: var(--ink);
  color: white;
  padding: 0 22px;
  box-shadow: 0 18px 30px rgba(20, 33, 61, 0.22);
}

body.dark-mode .primary-button {
  background: #f8fafc;
  color: #101828;
}

.secondary-button,
.ghost-button {
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  padding: 0 18px;
  border: 1px solid rgba(20, 33, 61, 0.24);
}

body.dark-mode .secondary-button,
body.dark-mode .ghost-button {
  background: rgba(15, 23, 42, 0.78);
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.14);
}

.secondary-button.full {
  width: 100%;
  margin-top: auto;
}

.hero-map {
  position: relative;
  min-height: 540px;
  border-radius: 28px;
  overflow: hidden;
  background:
    linear-gradient(rgba(20,33,61,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20,33,61,0.06) 1px, transparent 1px),
    rgba(255, 255, 255, 0.56);
  background-size: 30px 30px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.6), 0 28px 70px rgba(45, 64, 89, 0.2);
}

body.dark-mode .hero-map {
  background:
    linear-gradient(rgba(255,255,255,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.07) 1px, transparent 1px),
    rgba(15, 23, 42, 0.7);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08), 0 28px 70px rgba(0, 0, 0, 0.28);
}

.preview-connections {
  position: absolute;
  inset: 34px 26px;
  width: calc(100% - 52px);
  height: calc(100% - 68px);
}

.preview-connections path {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke: rgba(35, 100, 170, 0.32);
}

body.dark-mode .preview-connections path {
  stroke: rgba(102, 166, 255, 0.38);
}

.preview-selection {
  position: absolute;
  left: 322px;
  top: 242px;
  width: 232px;
  height: 166px;
  border: 1px solid rgba(35, 100, 170, 0.58);
  border-radius: 12px;
  background: rgba(35, 100, 170, 0.12);
}

body.dark-mode .preview-selection {
  border-color: rgba(102, 166, 255, 0.62);
  background: rgba(102, 166, 255, 0.14);
}

.preview-node {
  position: absolute;
  width: 168px;
  min-height: 70px;
  padding: 20px 34px 16px 16px;
  border-radius: 18px;
  background: var(--preview-color);
  color: white;
  font-weight: 800;
  box-shadow: 0 18px 28px rgba(20, 33, 61, 0.18);
}

.preview-node strong {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.22);
}

.preview-toolbar {
  position: absolute;
  left: 10px;
  right: 10px;
  top: -12px;
  display: flex;
  justify-content: space-between;
  gap: 5px;
}

.preview-toolbar i,
.preview-toolbar b {
  width: 23px;
  height: 23px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  border: 1px solid rgba(20, 33, 61, 0.24);
  box-shadow: 0 8px 16px rgba(20, 33, 61, 0.1);
  font-size: 10px;
  font-style: normal;
}

.preview-toolbar i::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--preview-color);
}

.preview-add {
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  border: 1px solid rgba(20, 33, 61, 0.12);
  box-shadow: 0 8px 16px rgba(20, 33, 61, 0.1);
  font-size: 19px;
  font-style: normal;
}

.preview-add.right {
  right: -15px;
  top: calc(50% - 15px);
}

.preview-add.bottom {
  left: calc(50% - 15px);
  bottom: -15px;
}

.selected-preview {
  outline: 3px solid rgba(35, 100, 170, 0.5);
}

.preview-count {
  position: absolute;
  right: 10px;
  bottom: 7px;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.25);
  font-size: 12px;
}

.root-preview {
  left: 58px;
  top: 205px;
}

.p1 { left: 350px; top: 106px; }
.p2 { left: 350px; top: 200px; }
.p3 { left: 350px; top: 300px; }
.p4 { right: 32px; top: 272px; width: 136px; }

.preview-comment {
  position: absolute;
  right: 32px;
  top: 54px;
  width: 188px;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 20px 45px rgba(20, 33, 61, 0.18);
}

body.dark-mode .preview-comment {
  background: rgba(15, 23, 42, 0.96);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--ink);
}

.preview-comment div {
  min-height: 42px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(20, 33, 61, 0.1);
}

body.dark-mode .preview-comment div {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.preview-comment span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(20, 33, 61, 0.08);
  font-weight: 850;
}

body.dark-mode .preview-comment span {
  background: rgba(255, 255, 255, 0.1);
}

.preview-comment p {
  margin: 0;
  padding: 12px;
  color: #53627a;
  font-size: 13px;
  line-height: 1.45;
}

body.dark-mode .preview-comment p {
  color: #b8c2d6;
}

.hero-map.image-preview {
  display: grid;
  place-items: center;
  min-height: 540px;
  background: rgba(255, 255, 255, 0.48);
}

body.dark-mode .hero-map.image-preview {
  background: rgba(15, 23, 42, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08), 0 28px 70px rgba(0, 0, 0, 0.28);
}

.hero-preview-image {
  width: 118%;
  max-width: none;
  height: 100%;
  min-height: 540px;
  object-fit: cover;
  object-position: 48% 45%;
  display: block;
  transform: scale(1.02);
}

.workspace {
  height: 100vh;
  display: grid;
  grid-template-columns: 318px minmax(0, 1fr);
  background: #edf2f7;
}

body.dark-mode .workspace {
  background: #0b1220;
}

.sidebar {
  height: 100vh;
  padding: 22px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: rgba(255, 255, 255, 0.82);
  border-right: 1px solid rgba(20, 33, 61, 0.1);
  backdrop-filter: blur(18px);
}

body.dark-mode .sidebar {
  background: rgba(15, 23, 42, 0.86);
  border-right-color: rgba(255, 255, 255, 0.1);
}

.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.node-title,
.node-comment {
  width: 100%;
  border: 1px solid rgba(20, 33, 61, 0.13);
  border-radius: 12px;
  background: white;
  color: var(--ink);
  outline: 0;
}

.field input {
  height: 44px;
  padding: 0 12px;
}

body.dark-mode .field input {
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.14);
}

.panel {
  display: grid;
  gap: 12px;
}

.panel h2 {
  margin: 0;
  font-size: 13px;
  color: #53627a;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

body.dark-mode .panel h2,
body.dark-mode .toggle-row {
  color: #b8c2d6;
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.action-grid button,
.segmented button,
.zoom-controls button {
  background: #fff;
  color: var(--ink);
  border: 1px solid rgba(20, 33, 61, 0.12);
}

body.dark-mode .action-grid button,
body.dark-mode .segmented button,
body.dark-mode .zoom-controls button,
body.dark-mode .theme-option {
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.13);
}

.theme-list {
  display: grid;
  gap: 8px;
}

.theme-option {
  min-height: 44px;
  border: 1px solid rgba(20, 33, 61, 0.12);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  font-weight: 750;
}

.theme-option.is-active {
  outline: 3px solid rgba(35, 100, 170, 0.18);
}

.swatches {
  display: flex;
  gap: 5px;
}

.swatches span {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(20, 33, 61, 0.07);
  padding: 4px;
  border-radius: 14px;
}

body.dark-mode .segmented {
  background: rgba(255, 255, 255, 0.08);
}

.segmented button {
  min-height: 36px;
  background: transparent;
}

.segmented button.is-active {
  background: #fff;
  box-shadow: 0 8px 16px rgba(20, 33, 61, 0.08);
}

body.dark-mode .segmented button.is-active {
  background: rgba(255, 255, 255, 0.16);
}

.toggle-row {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #344054;
  font-weight: 700;
}

.toggle-row input {
  width: 42px;
  height: 22px;
  accent-color: var(--accent);
}

.canvas-shell {
  min-width: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.canvas-header {
  min-height: 86px;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(20, 33, 61, 0.1);
  background: rgba(247, 250, 252, 0.85);
}

body.dark-mode .canvas-header {
  background: rgba(15, 23, 42, 0.9);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.canvas-header h1 {
  margin: 0;
  font-size: 26px;
}

.zoom-controls {
  display: flex;
  gap: 8px;
}

.zoom-controls button {
  min-width: 44px;
}

.zoom-controls button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.canvas-viewport {
  flex: 1;
  overflow: auto;
  cursor: grab;
  background:
    linear-gradient(rgba(20,33,61,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20,33,61,0.045) 1px, transparent 1px),
    #f8fafc;
  background-size: 30px 30px;
}

.canvas-viewport.is-panning {
  cursor: grabbing;
}

body.dark-mode .canvas-viewport {
  background:
    linear-gradient(rgba(255,255,255,0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.055) 1px, transparent 1px),
    #0f172a;
}

.canvas-stage {
  position: relative;
  width: 2200px;
  min-height: 1400px;
  transform-origin: 0 0;
}

.connections {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.selection-box {
  position: absolute;
  z-index: 3;
  display: none;
  border: 1px solid rgba(35, 100, 170, 0.58);
  background: rgba(35, 100, 170, 0.12);
  border-radius: 10px;
  pointer-events: none;
}

.selection-box.is-active {
  display: block;
}

.connections path {
  fill: none;
  stroke: var(--line);
  stroke-width: 3;
  stroke-linecap: round;
}

.map-layer {
  position: relative;
  z-index: 2;
}

.node {
  position: absolute;
  width: 238px;
  padding: 12px;
  border-radius: var(--node-radius);
  border: var(--node-border);
  box-shadow: var(--node-shadow);
  background: white;
  transition: transform 180ms ease, opacity 180ms ease, box-shadow 180ms ease;
}

.node.is-hidden-node {
  opacity: 0;
  pointer-events: none;
}

.node:hover {
  transform: translateY(-2px);
}

.node-header {
  display: flex;
  gap: 8px;
  align-items: center;
}

.node-title {
  height: 38px;
  padding: 0 10px;
  font-weight: 800;
  border: 0;
  background: rgba(255, 255, 255, 0.82);
}

.color-dot {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.82);
}

.node-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.node-action {
  min-height: 30px;
  padding: 0 9px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  border: 1px solid rgba(20, 33, 61, 0.11);
  font-size: 13px;
}

.node-comment {
  min-height: 68px;
  resize: vertical;
  margin-top: 10px;
  padding: 10px;
  line-height: 1.4;
}

.node.is-collapsed {
  outline: 3px solid rgba(20, 33, 61, 0.12);
}

.file-input {
  position: fixed;
  inset: auto auto 0 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.node {
  width: 238px;
  min-height: 76px;
  padding: 18px 42px 16px 18px;
  display: flex;
  align-items: center;
  user-select: none;
  touch-action: none;
  background: var(--node-color);
  color: #fff;
  cursor: grab;
}

.node:hover {
  transform: none;
}

.node.is-dragging {
  z-index: 10;
  cursor: grabbing;
  box-shadow: 0 24px 45px rgba(20, 33, 61, 0.2);
}

.node.is-snapping {
  outline: 3px solid rgba(42, 157, 143, 0.34);
}

.node.is-selected {
  outline: 3px solid rgba(35, 100, 170, 0.5);
}

.node.is-locked {
  filter: saturate(0.74);
  cursor: default;
}

.node-title {
  height: 38px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-size: 16px;
  font-weight: 850;
  cursor: text;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.22);
}

.node-title[readonly] {
  cursor: grab;
}

.node-title:disabled {
  opacity: 0.92;
  cursor: default;
}

.node-tool:disabled,
.node-add:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.node-tool,
.node-add {
  position: absolute;
  border: 1px solid rgba(20, 33, 61, 0.24);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-weight: 850;
  box-shadow: 0 8px 16px rgba(20, 33, 61, 0.1);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(2px);
  transition: opacity 140ms ease 1s, transform 140ms ease 1s;
}

.node:hover .node-tool,
.node:hover .node-add,
.node:focus-within .node-tool,
.node:focus-within .node-add,
.node.is-single-selected .node-tool,
.node.is-single-selected .node-add {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  transition-delay: 0s;
}

body.dark-mode .node-tool,
body.dark-mode .node-add,
body.dark-mode .preview-toolbar i,
body.dark-mode .preview-toolbar b,
body.dark-mode .preview-add {
  background: rgba(15, 23, 42, 0.92);
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.28);
}

.node-tool {
  width: 24px;
  height: 24px;
  border-radius: 9px;
  padding: 0;
  font-size: 12px;
  line-height: 1;
}

.node-tool > span {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  line-height: 1;
  transform: translateY(-0.5px);
}

.color-tool {
  left: 10px;
  top: -13px;
}

.comment-tool {
  left: 40px;
  top: -13px;
}

.lock-tool {
  right: 66px;
  top: -13px;
}

.collapse-tool {
  right: 38px;
  top: -13px;
}

.delete-tool {
  right: 10px;
  top: -13px;
}

.node-add {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
}

.child-add {
  right: -16px;
  top: calc(50% - 16px);
}

.sibling-add {
  left: calc(50% - 16px);
  bottom: -16px;
}

.color-dot {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border-radius: 50%;
  border: 0;
  display: block;
  margin: auto;
}

.comment-tool > span {
  font-size: 13px;
  letter-spacing: 0;
  transform: translateY(-3px);
}

.lock-tool > span {
  font-size: 13px;
  transform: translateY(-0.5px);
}

.collapsed-count {
  position: absolute;
  right: 12px;
  bottom: 8px;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(20, 33, 61, 0.1);
  color: #344054;
  font-size: 12px;
  font-weight: 850;
}

.comment-indicator {
  position: absolute;
  right: 10px;
  bottom: 8px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(20, 33, 61, 0.18);
  box-shadow: 0 8px 16px rgba(20, 33, 61, 0.12);
}

.comment-indicator::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 5px;
  width: 8px;
  height: 6px;
  border-radius: 2px;
  background: var(--node-color);
}

.comment-indicator::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 10px;
  width: 5px;
  height: 5px;
  background: var(--node-color);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

body.dark-mode .collapsed-count {
  background: rgba(255, 255, 255, 0.16);
  color: #f8fafc;
}

.comment-popover {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(6px);
}

.confirm-popover {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(7px);
}

.color-palette {
  position: fixed;
  z-index: 70;
  width: 232px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(20, 33, 61, 0.12);
  box-shadow: 0 24px 60px rgba(20, 33, 61, 0.22);
  backdrop-filter: blur(12px);
}

.color-palette button {
  width: 34px;
  height: 34px;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(20, 33, 61, 0.16), 0 8px 14px rgba(20, 33, 61, 0.12);
}

.color-palette button.is-active {
  outline: 3px solid rgba(35, 100, 170, 0.35);
}

.confirm-card {
  width: min(430px, 100%);
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.97);
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(20, 33, 61, 0.26);
}

.confirm-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(231, 111, 81, 0.14);
  color: #c2410c;
  font-size: 24px;
  font-weight: 900;
}

.confirm-card h2 {
  margin: 18px 0 8px;
  font-size: 22px;
}

.confirm-card p {
  margin: 0;
  color: #53627a;
  line-height: 1.55;
}

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

.confirm-actions button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid rgba(20, 33, 61, 0.12);
  font-weight: 800;
}

#confirmCancelBtn {
  background: #fff;
  color: var(--ink);
}

#confirmOkBtn {
  background: #c2410c;
  color: #fff;
  border-color: transparent;
}

body.dark-mode .comment-popover {
  background: rgba(2, 6, 23, 0.58);
}

body.dark-mode .confirm-popover {
  background: rgba(2, 6, 23, 0.62);
}

body.dark-mode .color-palette {
  background: rgba(15, 23, 42, 0.96);
  border-color: rgba(255, 255, 255, 0.14);
}

body.dark-mode .confirm-card {
  background: rgba(15, 23, 42, 0.97);
  border-color: rgba(255, 255, 255, 0.13);
  color: var(--ink);
}

body.dark-mode .confirm-card p {
  color: #b8c2d6;
}

body.dark-mode #confirmCancelBtn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.14);
}

.comment-card {
  width: min(520px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 30px 80px rgba(20, 33, 61, 0.25);
  overflow: hidden;
}

body.dark-mode .comment-card {
  background: rgba(15, 23, 42, 0.97);
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.13);
}

.comment-card-header {
  min-height: 58px;
  padding: 0 16px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(20, 33, 61, 0.1);
}

body.dark-mode .comment-card-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.comment-card-header button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 11px;
  background: rgba(20, 33, 61, 0.08);
  color: var(--ink);
  font-weight: 850;
}

body.dark-mode .comment-card-header button {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
}

#commentText {
  width: 100%;
  min-height: 220px;
  padding: 18px;
  border: 0;
  resize: vertical;
  outline: 0;
  color: var(--ink);
  line-height: 1.55;
}

body.dark-mode #commentText {
  background: rgba(15, 23, 42, 0.97);
  color: var(--ink);
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 36px;
  }

  .hero-map {
    min-height: 420px;
  }

  .workspace {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
  }

  .sidebar {
    height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(20, 33, 61, 0.1);
  }

  .canvas-shell {
    height: 72vh;
  }
}

@media (max-width: 620px) {
  .topbar,
  .hero {
    width: min(100% - 24px, 1180px);
  }

  .hero h1 {
    font-size: 42px;
  }

  .canvas-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
}
