:root {
  --ink: #142033;
  --muted: #5c6b7a;
  --line: #d7e0e8;
  --surface: rgba(255, 255, 255, 0.78);
  --accent: #0b6f65;
  --accent-2: #0a5a52;
  --bg: #eef3f6;
  --shadow: 0 18px 40px rgba(20, 32, 51, 0.08);
  --radius: 18px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(ellipse 70% 45% at 8% -10%, #cfe8e3 0%, transparent 55%),
    linear-gradient(180deg, #f7fafb 0%, var(--bg) 100%);
}
a { color: var(--accent); text-decoration: none; }
.app-shell { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem 3rem; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  margin: 0 -1.25rem 1.5rem; padding: 0.65rem 1.25rem;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; max-width: 1100px; margin: 0 auto; }
.brand {
  font-family: var(--font-display); font-weight: 650; font-size: 1.55rem;
  letter-spacing: -0.03em; color: var(--ink);
}
.brand span { color: var(--accent); }
.btn {
  display: inline-flex; align-items: center; border: 0; border-radius: 999px;
  padding: 0.55rem 1rem; font: inherit; font-weight: 700; cursor: pointer;
  background: #fff; border: 1px solid var(--line);
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.panel {
  background: var(--surface); border: 1px solid rgba(215, 224, 232, 0.9);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.25rem 1.35rem; margin-bottom: 1rem;
}
.panel h2 { margin: 0 0 0.35rem; font-family: var(--font-display); font-size: 1.35rem; }
.panel .sub { margin: 0 0 1rem; color: var(--muted); }
.muted { color: var(--muted); }
.share-line { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.share-line input, .share-mail input, .panel input[type=text], .panel input[type=email] {
  border: 1px solid var(--line); border-radius: 10px; padding: 0.5rem 0.7rem; font: inherit; min-width: 16rem;
}
.share-mail { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; }
.outline-panel { overflow: hidden; }
.hc-crumbs { margin: 0 0 0.75rem; font-size: 0.92rem; }
.hc-crumbs a { font-weight: 650; }
.hc-scroll {
  overflow: hidden; padding: 0; margin-top: 0.5rem; position: relative;
  min-height: 28rem; height: min(72vh, 46rem); cursor: grab; touch-action: none;
  background: #f7fbfa; border: 1px solid #e4eeec; border-radius: 12px;
}
.hc-scroll.is-panning { cursor: grabbing; user-select: none; }
.hc-scale-wrap { position: relative; transform-origin: 0 0; width: max-content; margin: 0; padding: 2rem 2.5rem; }
.hc-wires { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 1; }
.hc-tree, .hc-children {
  list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: nowrap; justify-content: center;
}
.hc-tree { flex-direction: column; align-items: center; min-width: max-content; }
.hc-tree > .hc-node { padding-top: 0; }
.hc-node {
  display: flex; flex-direction: column; align-items: center; position: relative;
  padding: 1.15rem 0.55rem 0; text-align: center;
}
.hc-card {
  position: relative; z-index: 2; background: #fff; border: 1.5px solid #0b6f65;
  border-radius: 10px; padding: 0.85rem 0.95rem 0.65rem;
  min-width: clamp(5.5rem, 11vw, 10rem); max-width: 11rem; width: max-content;
  box-shadow: 0 6px 18px rgba(20, 32, 51, 0.06); cursor: grab;
}
.hc-card.is-editable { user-select: text; }
.hc-node.is-root > .hc-card {
  border-width: 2px; border-bottom-width: 4px;
  background: linear-gradient(180deg, #f2faf8 0%, #fff 70%);
}
.hc-title, .hc-title-input {
  font-weight: 750; font-size: 0.95rem; line-height: 1.25; color: var(--ink);
}
.hc-title-input {
  width: 100%; border: 1px solid transparent; border-radius: 8px;
  padding: 0.2rem 0.3rem; font: inherit; font-weight: 750; text-align: center;
  background: transparent; cursor: text;
}
.hc-title-input:focus { outline: none; border-color: #0b6f65; background: #fff; }
.hc-status { margin-top: 0.15rem; font-size: 0.78rem; font-weight: 700; color: #0b6f65; }
.hc-handle {
  position: absolute; z-index: 3; width: 1.35rem; height: 1.35rem; border-radius: 999px;
  border: 1.5px solid #0b6f65; background: #fff; color: #0b6f65; font-size: 0.95rem;
  font-weight: 700; line-height: 1; display: grid; place-items: center; padding: 0; cursor: pointer;
  opacity: 0.7;
}
.hc-card:hover .hc-handle, .hc-card:focus-within .hc-handle { opacity: 1; }
.hc-handle:hover { background: #0b6f65; color: #fff; }
.hc-handle-bottom { bottom: -0.7rem; left: 50%; transform: translateX(-50%); }
.hc-handle-left { left: -0.7rem; top: 50%; transform: translateY(-50%); }
.hc-handle-right { right: -0.7rem; top: 50%; transform: translateY(-50%); }
.hc-handle-delete {
  top: -0.55rem; right: -0.55rem; left: auto; transform: none;
  border-color: #b42318; color: #b42318;
}
.hc-children { position: relative; padding-top: 1.15rem; }
.hc-children.hc-stagger + .hc-children.hc-stagger { padding-top: 1.7rem; }
.hc-stem { position: relative; width: 100%; display: flex; flex-direction: column; align-items: stretch; padding: 0.55rem 0 0.35rem; min-height: 2.8rem; }
.hc-stem::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 0;
  border-left: 1.5px solid #0b6f65; z-index: 1;
}
.hc-staff {
  position: relative; z-index: 2; display: flex; flex-direction: row; align-items: flex-start;
  width: 50%; margin-left: 50%; padding: 0.4rem 0;
}
.hc-staff-line { width: 2.75rem; height: 0; border-top: 1.5px solid #0b6f65; flex-shrink: 0; margin: 1.35rem 0 0; }
.hc-staff-tree { flex: 0 1 auto; align-items: flex-start; min-width: 0; }
.hc-staff-tree > .hc-node { padding-top: 0; align-items: flex-start; }
.hc-card-side {
  min-width: 7.2rem; max-width: 10rem; padding: 0.45rem 0.65rem;
  border-style: dashed; background: #f7fbfa;
}
.hc-node:has(> .hc-stem):has(> .hc-children) > .hc-stem { padding-bottom: 0; }
.hc-node:has(> .hc-stem):has(> .hc-children) > .hc-children { padding-top: 1.15rem; }
