/* ── ROOT LAYOUT ── */
body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Top bar: toolbar at its natural height; logo floats above it */
#top-bar {
  position: relative;   /* establishes containing block for logo */
  flex-shrink: 0;
}

/* Logo: absolutely positioned — out of flow, does not affect toolbar height */
#logo {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 20;
  padding: 10px 16px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  cursor: default;
  transition: background 0.3s ease;
}
#logo .ascii-brand {
  font-size: 7.5px;
  line-height: 1.2;
  color: var(--accent);
  white-space: pre;
  font-family: var(--font-mono);
  user-select: none;
  display: block;
  transition: color 0.3s ease;
}
#logo:hover { background: var(--accent); }
#logo:hover .ascii-brand { color: var(--bg); }

/* App body: sidebar + main, fills remaining height */
#app-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* ── SIDEBAR ── */
#sidebar {
  width: 200px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--surface);
  /* push content below the floating logo's bottom edge */
  padding-top: 40px;
}

#dark-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
  padding: 3px 7px;
  border-radius: 5px;
  box-shadow: 0 1px 3px var(--shadow);
}
#dark-toggle:hover { border-color: var(--accent); color: var(--accent); }

.sb-section {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border);
  min-height: 0;
  flex: 1;
}
.sb-section:last-child { border-bottom: none; }

.sb-hd {
  padding: 8px 16px;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  font-family: var(--font-sans);
}
.sb-hd button {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
  padding: 0 3px;
  border-radius: 3px;
  box-shadow: none;
}
.sb-hd button:hover { color: var(--text); }

.sb-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
}
.sb-list li {
  padding: 7px 16px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
  border-left: 3px solid transparent;
}
.sb-list li:hover { background: var(--surface2); }
.sb-list li.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 5px,
      rgba(50, 101, 202, 0.07) 5px,
      rgba(50, 101, 202, 0.07) 10px
    );
}
.sb-list li .li-sub {
  font-size: 11px;
  color: var(--muted);
  display: block;
  margin-top: 1px;
}

/* ── MAIN PANEL ── */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  margin-top: 40px;
}
#toolbar {
  padding: 8px 14px 8px 328px; /* left clears the floating logo */
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
#toolbar button {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  padding: 5px 12px;
  box-shadow: 0 1px 3px var(--shadow);
  transition: border-color .12s, color .12s;
}
#toolbar button:hover { border-color: var(--accent); color: var(--accent); }
.tsep { color: var(--border); padding: 0 3px; }

#song-header {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  display: none;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
#song-title {
  background: none;
  border: none;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 19px;
  flex: 1;
  outline: none;
  font-weight: bold;
}
#song-meta {
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 13px;
  width: 240px;
  outline: none;
}

#editor {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── EMPTY STATE ── */
#empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  color: var(--muted);
}
.ascii-brand {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.25;
  color: var(--accent);
  white-space: pre;
  text-align: left;
  user-select: none;
}
#empty p {
  font-size: 13px;
  letter-spacing: 2px;
  font-family: var(--font-sans);
}
#empty button {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
  padding: 9px 24px;
  box-shadow: 0 2px 6px var(--shadow);
}
#empty button:hover { border-color: var(--accent); color: var(--accent); }
