html {
    font-family: IRANSansWeb;
    font-size:25px;
}
:root { --accent: #2b6cb0; --muted: #6b7280; }

body {
  font-family: Tahoma, Arial, 'Segoe UI', sans-serif;
  margin: 24px;
  color: #111;
  direction: rtl;
}

.tree {
  max-width: 720px;
  margin-left: auto;   /* push to right */
  margin-right: 0;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-start; 	
}

details {
  width: 90vw;
}

summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  flex-direction: row;
  justify-content: flex-start; /* marker first on right */
  list-style: none;
}

summary::-webkit-details-marker { display: none; }

.marker {
  display: inline-grid;
  place-items: center;
  width: 1rem;
  height: 1rem;
  transition: transform 0.18s ease;
}

details[open] > summary .marker {
  transform: rotate(-90deg); /* rotate marker down */
}

.node-label {
  font-weight: 600;
}

.child {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* children aligned right */
  margin-right: 1.2rem;  /* indent to left */
  padding-right: 0.6rem;
  border-right: 2px dashed rgba(0,0,0,.06); /* connector line */
}

.leaf {
  display: flex;
  align-items: center;
  flex-direction: row;
  justify-content: flex-start; /* bullet first on right */
  padding: 0.2rem 0.5rem;
  margin: 0.2rem 0;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.leaf:hover { background: rgba(43,108,176,.08); }

.leaf .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  margin-left: 0.6rem;
}

.controls {
  margin-bottom: 12px;
  display: flex;
  gap: 0.5rem;
  justify-content: flex-start;
}

button {
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,.08);
  background: white;
  cursor: pointer;
}

button:active { transform: translateY(1px); }

.hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 8px;
}
