:root {
  color-scheme: light;
  --paper: #fbf8ee;
  --ink: #151515;
  --muted: #615847;
  --gold: #d9a23b;
  --shadow: rgba(39, 29, 13, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 8%, rgba(255, 255, 255, 0.85), transparent 22rem),
    radial-gradient(circle at 80% 18%, rgba(180, 39, 35, 0.12), transparent 24rem),
    linear-gradient(135deg, #d9d0bd 0%, #f5efe2 44%, #cfc5b0 100%);
}

button,
input,
select,
textarea,
text {
  font: inherit;
}

.app-nav {
  width: 100%;
  border-bottom: 2px solid #151515;
  background: #fffcf1;
  position: sticky;
  top: 0;
  z-index: 50;
}

.app-nav-inner {
  width: min(1530px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  padding: 14px 0;
}

.app-nav-brand {
  font-family: "Cinzel", Georgia, serif;
  font-weight: 900;
  font-size: 1.2rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #111;
  text-decoration: none;
}

.app-nav-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.app-nav-links a,
.app-deck-tabs a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 6px;
  color: #2a241b;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

.app-nav-links a:hover,
.app-deck-tabs a:hover {
  background: rgba(21, 21, 21, 0.06);
}

.app-nav-links a.is-active,
.app-deck-tabs a.is-active {
  background: #111;
  color: #fff8ec;
  border-color: #111;
}

.app-deck-tabs {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 0 auto;
  padding: 0;
}

.app-deck-tabs a {
  padding: 7px 11px;
  background: rgba(255, 252, 241, 0.7);
  border-color: rgba(21, 21, 21, 0.14);
  font-size: 0.82rem;
}

.app-shell {
  width: min(1530px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0;
  display: grid;
  align-items: stretch;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  gap: 24px;
  align-items: start;
  min-height: 100vh;
}

.tree-stage {
  position: relative;
  min-width: 0;
  display: grid;
  place-items: center;
  padding: 12px;
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(245, 237, 216, 0.56)),
    #eadfc8;
  box-shadow: 0 28px 80px var(--shadow);
}

.tree-stage::before {
  content: "";
  position: absolute;
  inset: 22px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 8px;
  pointer-events: none;
}

.tree-svg {
  position: relative;
  width: 100%;
  max-width: 950px;
  height: auto;
  min-height: 100vh;
  display: block;
  filter: drop-shadow(0 16px 18px rgba(53, 35, 10, 0.18));
}

.paper {
  fill: url("#paper-glow");
  stroke: #1a1a1a;
  stroke-width: 2.5;
}

.paper-grid {
  fill: url("#fine-grid");
  opacity: 0.45;
}

.frame rect,
.frame path {
  fill: none;
  stroke: #1b1b1b;
  stroke-width: 3;
}

.frame rect:nth-child(2) {
  stroke-width: 1.4;
  stroke-dasharray: 2 4;
}

.corner-symbols path {
  fill: none;
  stroke: #181818;
  stroke-width: 3;
}

.title-plaque rect {
  fill: #050505;
  stroke: #151515;
  stroke-width: 3;
  filter: url("#poster-shadow");
}

.title-plaque path {
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 2;
}

.title-plaque text {
  fill: #f8f2e8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 38px;
  letter-spacing: 0.08em;
  text-anchor: middle;
}

.temple .pillar rect {
  fill: rgba(180, 184, 182, 0.2);
  stroke: rgba(110, 110, 110, 0.22);
  stroke-width: 2;
}

.temple .pillar text {
  fill: rgba(90, 90, 90, 0.28);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 48px;
  text-anchor: middle;
}

.veils line {
  stroke: rgba(92, 92, 92, 0.35);
  stroke-width: 5;
}

.veils text {
  fill: #555047;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 700;
}

.soul-labels rect {
  fill: rgba(255, 249, 210, 0.88);
  stroke: rgba(180, 150, 82, 0.25);
  filter: url("#poster-shadow");
}

.soul-labels text {
  fill: #a15136;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  font-weight: 800;
  text-anchor: middle;
}


.path-group {
  cursor: pointer;
  outline: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.path-border {
  stroke: rgba(24, 20, 17, 0.48);
  stroke-width: 38;
  stroke-linecap: round;
}

.path-color {
  stroke-width: 29;
  stroke-linecap: round;
}

.path-highlight {
  stroke: rgba(255, 255, 255, 0.46);
  stroke-width: 3;
  stroke-linecap: round;
}

.path-label {
  dominant-baseline: middle;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-rendering: geometricPrecision;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.72);
  stroke-width: 3;
  text-anchor: middle;
}

.path-label-number {
  font-size: 12px;
  font-weight: 900;
}

.path-label-name {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.path-label.is-dark {
  fill: #24170f;
}

.path-label.is-light {
  fill: #fff8e9;
  stroke: rgba(0, 0, 0, 0.36);
}

.path-group.is-active .path-border {
  stroke: #0f0f0f;
  stroke-width: 56;
  filter: none;
}

.path-group.is-active .path-color {
  filter: none;
}

.daath text,
.sefirah text {
  pointer-events: none;
  text-anchor: middle;
}

.daath-outer {
  fill: rgba(230, 231, 226, 0.84);
  stroke: rgba(72, 79, 82, 0.38);
  stroke-width: 8;
  filter: url("#poster-shadow");
}

.daath-core {
  fill: #8b969c;
  stroke: #f7f8f8;
  stroke-width: 3;
}

.daath-gloss {
  fill: url("#sphere-gloss");
  opacity: 0.8;
}

.daath text:first-of-type {
  fill: #2e363a;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 900;
}

.daath text:last-of-type {
  fill: #f7f8f8;
  font-size: 11px;
  font-weight: 800;
}

.sefirah {
  cursor: pointer;
  outline: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.sefirah .halo {
  fill: rgba(255, 250, 226, 0.75);
  stroke: rgba(34, 34, 34, 0.24);
  stroke-width: 2;
  filter: url("#poster-shadow");
}

.sefirah .ring {
  stroke: #fbfaf5;
  stroke-width: 8;
}

.sefirah .inner-ring {
  fill: none;
  stroke: rgba(0, 0, 0, 0.36);
  stroke-width: 2;
}

.sefirah .core {
  stroke: rgba(0, 0, 0, 0.28);
  stroke-width: 1.5;
}

.sefirah .gloss {
  fill: url("#sphere-gloss");
  opacity: 0.92;
}

.sefirah .label {
  fill: #ffffff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-weight: 900;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.58);
  stroke-width: 3;
}

.sefirah .number-label {
  fill: rgba(255, 255, 255, 0.92);
  font-size: 21px;
  font-weight: 900;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.45);
  stroke-width: 3;
}

.sefirah .sub-label {
  fill: #fff8dc;
  font-size: 10px;
  font-weight: 850;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.46);
  stroke-width: 2.4;
}

.sefirah:hover .halo,
.sefirah:focus-visible .halo,
.sefirah.is-active .halo {
  stroke: #111;
  stroke-width: 4;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 80px;
  height: calc(100vh - 96px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-right: 6px;
  min-width: 0;
  max-width: 100%;
}

.side-panel > * {
  flex: 0 0 auto;
}

.side-panel,
.side-panel *,
.side-panel *::before,
.side-panel *::after {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

.side-panel p,
.side-panel dd,
.side-panel dt,
.side-panel h1,
.side-panel h2,
.side-panel h3,
.side-panel strong,
.side-panel textarea,
.side-panel input,
.side-panel .description,
.side-panel .translation,
.side-panel .panel-kicker,
.side-panel .panel-pillar,
.side-panel .path-numbering {
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.side-panel .description {
  white-space: pre-line;
}

.side-panel textarea,
.side-panel input,
.side-panel select {
  width: 100%;
  max-width: 100%;
}

.detail-panel,
.editor-panel,
.mode-panel {
  border: 2px solid #151515;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(244, 232, 205, 0.92)),
    var(--paper);
  box-shadow: 0 28px 80px var(--shadow);
}

.mode-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px;
}

.mode-button {
  min-height: 42px;
  border: 1px solid rgba(21, 21, 21, 0.18);
  border-radius: 8px;
  background: rgba(255, 252, 241, 0.78);
  color: #342a20;
  cursor: pointer;
  font-weight: 900;
}

.mode-button.is-active {
  background: #111;
  color: #fff8ec;
}

body[data-mode="view"] .editor-panel {
  display: none;
}

body[data-mode="edit"] .detail-panel {
  display: none;
}

body[data-mode="view"] .path-group .path-border {
  transition:
    stroke 140ms ease,
    stroke-width 140ms ease;
}

body[data-mode="view"] .path-group:hover .path-border {
  stroke: #0f0f0f;
  stroke-width: 44;
  filter: none;
}

body[data-mode="view"] .path-group.is-active .path-border {
  stroke: #0f0f0f;
  stroke-width: 56;
  filter: none;
}


.detail-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 360px;
  padding: 24px;
  scroll-margin-top: 72px;
}

.detail-view {
  display: none;
  flex-direction: column;
  gap: 18px;
  min-height: 312px;
}

.detail-view.is-active {
  display: flex;
}

.panel-kicker,
.panel-pillar {
  margin: 0;
  color: #8b392c;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.panel-header {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-width: 0;
  width: 100%;
}

.panel-header > div {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.detail-panel,
.detail-view {
  min-width: 0;
  max-width: 100%;
}

.number {
  width: 56px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 4px solid #fff6cd;
  border-radius: 50%;
  background: var(--gold);
  color: #19120a;
  box-shadow: 0 8px 18px rgba(90, 60, 12, 0.22);
  font-size: 1.35rem;
  font-weight: 950;
}

h1,
h2,
p {
  margin: 0;
}

.detail-panel h1 {
  margin-top: 4px;
  font-family: "Cinzel", Georgia, "Times New Roman", serif;
  font-size: 1.3rem;
  line-height: 1.15;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  max-width: 100%;
  width: 100%;
}

.card-image-wrap {
  display: flex;
  justify-content: center;
}

.card-image {
  width: 160px;
  border: 3px solid #151515;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(39, 29, 13, 0.32);
}

.translation {
  color: #8b392c;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.1rem;
  font-weight: 900;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.description {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
  white-space: pre-line;
}

.path-numbering {
  margin: 8px 0 16px;
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
  letter-spacing: 0.02em;
}

.hebrew-glyph {
  font-family: "Noto Sans Hebrew", "Frank Ruhl Libre", serif;
  font-weight: 700;
  font-size: 1.6em;
  margin-left: 6px;
  vertical-align: -0.08em;
  color: #111;
}

.panel-header h1,
h1, h2 {
  font-family: "Cinzel", Georgia, "Times New Roman", serif;
  letter-spacing: 0.04em;
}

.mind-map-shell {
  width: 100%;
  margin: 0;
  padding: 0;
}

.mind-map-fullscreen .mind-map-board {
  height: calc(100vh - 56px);
  min-height: 0;
}

.mind-map-fullscreen .mind-map-canvas {
  height: 100%;
  min-height: 0;
  border: none;
  border-radius: 0;
}

.mind-map-fullscreen .mind-map-side {
  border-radius: 0;
  border: none;
  border-left: 2px solid #151515;
  max-height: calc(100vh - 56px);
}

.mind-map-mode-floating {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(21, 21, 21, 0.2);
  border-radius: 8px;
  background: rgba(255, 252, 241, 0.96);
  box-shadow: 0 6px 18px rgba(40, 30, 12, 0.18);
  z-index: 20;
}

.mind-map-mode-floating .mode-button {
  min-height: auto;
  padding: 6px 12px;
  font-size: 0.78rem;
  border-radius: 6px;
}

.mind-map-controls {
  position: absolute;
  bottom: 18px;
  right: 18px;
  display: grid;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(21, 21, 21, 0.2);
  border-radius: 10px;
  background: rgba(255, 252, 241, 0.96);
  box-shadow: 0 6px 18px rgba(40, 30, 12, 0.18);
  z-index: 20;
}

.map-ctrl {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(21, 21, 21, 0.18);
  border-radius: 8px;
  background: #fffdf5;
  color: #2a241b;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1;
}

.map-ctrl:hover {
  background: rgba(21, 21, 21, 0.06);
}

.map-ctrl.is-active {
  background: #111;
  color: #fff8ec;
  border-color: #111;
}

.mind-map-canvas.pan-mode {
  cursor: grab;
}

.mind-map-canvas.pan-mode.is-panning {
  cursor: grabbing;
}

/* Botão expander/colapsar individual em cada nó do mind-elixir.
   mind-elixir-core adiciona class="minus" ao <me-epd> quando o nó
   está expandido (e sem classe quando colapsado). Desenhamos o +/−
   via ::before pra garantir contraste visível em todo nível. */
#mind-map me-epd,
#mind-map epd,
.mind-map-canvas me-epd,
.mind-map-canvas epd {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 22px !important;
  height: 22px !important;
  border: 2px solid #111 !important;
  border-radius: 999px !important;
  background: #fffdf5 !important;
  color: #111 !important;
  font-family: "Cinzel", Georgia, serif;
  font-weight: 900;
  font-size: 0;          /* esconde texto/SVG existente da lib */
  line-height: 1;
  cursor: pointer !important;
  box-shadow: 0 2px 6px rgba(40, 30, 12, 0.18);
  z-index: 50;
  pointer-events: auto !important;
  visibility: visible !important;
  opacity: 1 !important;
}

#mind-map me-epd > *,
#mind-map epd > * {
  display: none !important;   /* oculta SVG/imagem internos da lib */
}

#mind-map me-epd::before,
#mind-map epd::before {
  content: "+";
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  color: inherit;
}

#mind-map me-epd.minus::before,
#mind-map epd.minus::before {
  content: "−";
}

#mind-map me-epd:hover,
#mind-map epd:hover {
  background: #111 !important;
  color: #fff8ec !important;
}

.mind-map-flash {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 20;
}

.mind-map-flash:empty {
  display: none;
}

.mind-map-board {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
}

body[data-mode="edit"] .mind-map-board {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
}

.mind-map-canvas {
  height: calc(100vh - 220px);
  min-height: 560px;
  border: 2px solid #151515;
  border-radius: 10px;
  background:
    radial-gradient(circle at 30% 30%, rgba(243, 223, 32, 0.06), transparent 60%),
    linear-gradient(180deg, #fffdf5, #f5edd6);
  overflow: hidden;
}

.mind-map-side-empty {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px dashed rgba(21, 21, 21, 0.28);
  border-radius: 8px;
  background: rgba(255, 252, 241, 0.6);
  margin-bottom: 14px;
}

.mind-map-side-empty strong {
  font-family: "Cinzel", Georgia, serif;
  font-size: 1.05rem;
}

.mind-map-side-empty p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.9rem;
}

.arcano-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  vertical-align: middle;
  margin-right: 6px;
}

.arcano-tag.major {
  background: #8b392c;
  color: #fff8ec;
}

.arcano-tag.minor {
  background: #263c9f;
  color: #fff8ec;
}

.mind-map-side {
  border: 2px solid #151515;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 232, 205, 0.94));
  padding: 18px;
  max-height: calc(100vh - 280px);
  overflow-y: auto;
  overflow-x: hidden;
}

.mind-map-side h3 {
  margin: 0 0 12px;
  font-family: "Cinzel", Georgia, serif;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
}

.arcana-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 24px;
}

.arcano-card {
  border: 2px solid #151515;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 232, 205, 0.94)),
    var(--paper);
  box-shadow: 0 18px 48px var(--shadow);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.arcano-card-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.arcano-number {
  font-family: "Cinzel", Georgia, serif;
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1;
  color: #111;
}

.arcano-card-head h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
}

.arcano-facts {
  display: grid;
  gap: 10px;
  margin: 0;
}

.arcano-facts > div {
  padding: 12px 14px;
  border: 1px solid rgba(21, 21, 21, 0.16);
  border-radius: 8px;
  background: rgba(255, 252, 241, 0.78);
}

.arcano-facts dt {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6c5b3b;
  font-weight: 800;
  margin-bottom: 4px;
}

.arcano-facts dd {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.arcano-synthesis-label {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6c5b3b;
  font-weight: 800;
  margin: 0 0 6px;
}

.arcano-synthesis-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

body[data-mode="view"] .arcano-editor {
  display: none;
}

body[data-mode="edit"] .arcano-view {
  display: none;
}

.arcano-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.arcano-editor label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 800;
  color: #2a241b;
}

.arcano-editor input,
.arcano-editor textarea {
  font: inherit;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  padding: 8px 10px;
  border: 1px solid rgba(21, 21, 21, 0.28);
  border-radius: 6px;
  background: #fffdf5;
  color: #161616;
  resize: vertical;
}

.arcano-editor button {
  align-self: flex-start;
  margin-top: 4px;
  padding: 10px 18px;
  background: #111;
  color: #fff8ec;
  border: none;
  border-radius: 6px;
  font-weight: 800;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.facts {
  margin: auto 0 0;
  display: grid;
  gap: 12px;
}

.facts div {
  padding: 14px;
  border: 1px solid rgba(21, 21, 21, 0.16);
  border-radius: 8px;
  background: rgba(255, 252, 241, 0.78);
}

dt {
  color: #165b48;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

dd {
  margin: 6px 0 0;
  color: #231f1b;
  line-height: 1.45;
}

.flash {
  padding: 12px 14px;
  border: 1px solid rgba(22, 91, 72, 0.3);
  border-radius: 8px;
  background: rgba(232, 255, 246, 0.92);
  color: #165b48;
  font-weight: 800;
}

.editor-panel {
  min-height: 0;
  padding: 18px;
}

.editor-title-row {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.editor-title-row h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
}

.path-editor-list {
  display: grid;
  gap: 12px;
}

.path-editor {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(21, 21, 21, 0.14);
  border-radius: 8px;
  background: rgba(255, 252, 241, 0.76);
}

.editor-form {
  display: none;
}

.editor-form.is-active {
  display: grid;
}

.editor-empty {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px dashed rgba(21, 21, 21, 0.28);
  border-radius: 8px;
  background: rgba(255, 252, 241, 0.58);
}

.editor-empty strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
}

.editor-empty p {
  color: #5f5748;
  line-height: 1.45;
}

.editor-panel.has-selection .editor-empty {
  display: none;
}

.path-editor.is-active {
  border-color: #151515;
  box-shadow: 0 0 0 3px rgba(217, 162, 59, 0.22);
}

.path-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #2a241d;
  font-size: 0.9rem;
  text-transform: capitalize;
}

.path-editor-head span {
  width: 34px;
  height: 10px;
  border: 1px solid rgba(0, 0, 0, 0.28);
  border-radius: 999px;
  background: var(--path-color);
}

.path-editor label {
  display: grid;
  gap: 5px;
  color: #584e3d;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.path-editor input,
.path-editor select,
.path-editor textarea {
  width: 100%;
  border: 1px solid rgba(21, 21, 21, 0.18);
  border-radius: 7px;
  background: #fffdf8;
  color: #151515;
  font-size: 0.95rem;
  letter-spacing: 0;
  padding: 8px 10px;
}

.path-editor input,
.path-editor select {
  min-height: 38px;
}

.path-editor textarea {
  min-height: 94px;
  line-height: 1.45;
  resize: vertical;
  text-transform: none;
}

.path-editor button {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  background: #111;
  color: #fff8ec;
  cursor: pointer;
  font-weight: 900;
}

@media (max-width: 1080px) {
  .app-shell {
    width: min(100% - 24px, 820px);
    align-items: start;
  }

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

  .tree-svg {
    min-height: 0;
  }

  .side-panel {
    position: static;
    height: auto;
    overflow-y: visible;
    padding-right: 0;
  }

  .path-editor-list {
    max-height: none;
  }
}

/* Em dispositivos de toque os filtros SVG (drop-shadow / poster-shadow)
   forçam recomposição a cada frame de scroll, travando a rolagem. Trocamos
   por estilos baratos para manter a árvore fluida. */
@media (hover: none) and (pointer: coarse) {
  .tree-svg {
    filter: none;
  }

  .sefirah .halo,
  .soul-labels rect,
  .title-plaque rect {
    filter: none;
  }
}

@media (max-width: 560px) {
  .app-nav-inner {
    width: min(100% - 16px, 520px);
    gap: 10px;
  }

  .app-nav-brand {
    width: 100%;
  }

  .app-deck-tabs {
    margin-left: 0;
  }

  .app-nav-links a,
  .app-deck-tabs a {
    padding: 7px 9px;
    font-size: 0.78rem;
  }

  .app-shell {
    width: min(100% - 16px, 520px);
    padding: 12px 0;
  }

  .tree-stage {
    padding: 6px;
  }

  .tree-stage::before {
    inset: 12px;
  }

  .tree-svg {
    height: auto;
    min-height: auto;
  }

  .title-plaque text {
    font-size: 32px;
  }

  .path-label,
  .soul-labels {
    display: none;
  }

  .sefirah .label {
    font-size: 18px;
  }

  .sefirah .sub-label {
    display: none;
  }

  .panel-header {
    grid-template-columns: 52px 1fr;
  }

  .number {
    width: 52px;
  }
}
