:root {
  --text:       #1f2937;
  --text-soft:  #475569;
  --hover:      #f3f4f6;
  --accent:     #2f855a;
  --accent-hi:  #38a169;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #fff;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 28px 64px;
}

/* ---------- Header ---------- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.app-header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.add-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  border-radius: 6px;
  color: #fff;
  transition: background 120ms ease;
}
.add-btn:hover { background: var(--accent-hi); }
.add-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Tree ---------- */
.tree { display: flex; flex-direction: column; }

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px;
  margin: 0 -8px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  /* indent per depth */
  padding-left: calc(8px + var(--d, 0) * 36px);
  color: var(--text);
  font-size: 19px;
  line-height: 1.2;
}
.row:hover { background: var(--hover); }

/* Chevron column — always reserve the space so icons line up. */
.chev {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  transition: transform 120ms ease;
}
.chev svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}
.row.expanded .chev { transform: rotate(90deg); }
.row.leaf .chev { visibility: hidden; }

/* File / folder icon */
.icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}
.icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}

.label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 520px) {
  .app { padding: 32px 18px 48px; }
  .app-header h1 { font-size: 24px; }
  .row { font-size: 17px; padding-left: calc(8px + var(--d, 0) * 28px); }
}
