html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    background: #111;
    color: #eee;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    background: #11121d;         /* darker bluish-black background */
}

/* === Header === */
header {
    position: fixed;
    top: 0;
    left: 0;
    height: 80px;
    width: 100%;
    background: #1e1e2e;
    color: #cdd6f4;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    box-sizing: border-box;
    z-index: 100;
}

#toc-toggle, #back {
    width: 40px;
    height: 40px;
    background: #2b2e3f;
    color: #cdd6f4;
    border-radius: 5px;
    text-align: center;
    line-height: 40px;
    cursor: pointer;
    user-select: none;
    margin-right: 1rem;
    transition: background 0.2s ease;
}

#toc-toggle:hover, #back:hover {
    background: #3a3f55;
}

#head-text h1 {
    margin: 0;
    font-size: 1.25rem;
}

#note-title {
    font-weight: normal;
    font-size: 1rem;
    color: #a6adc8;
}

/* === Layout === */
#layout {
    position: absolute;
    top: 80px; /* Below the fixed header */
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
}

/* === TOC Panel === */
#toc-panel {
    width: 30%;
    background: #2a2a3a;
    border-right: 1px solid #333;
    overflow-y: auto;
    padding: 1rem;
    box-sizing: border-box;
    transition: background 0.3s ease, opacity 0.3s ease;
    transform: translateX(0);
    opactiy: 1;

}

/* Collapse TOC */
#layout.toc-closed #toc-panel {
    width: 0;
    padding: 0;
    border: none;
    overflow: hidden;
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
}

/* Allow iframe to grow into freed space */
#layout.toc-closed #note-container {
    width: 100%;
}

/* === Note Container === */
#note-container {
    flex-grow: 1;
    height: 100%;
    overflow: hidden;
    transition: margin 0.3s ease;
}

/* === iFrame === */
#note-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

#toc-panel h1 {
  color: #f38ba8;
  margin: 0.5rem 0;
  font-size: 1rem;
}

#toc-panel h2 {
  color: #89b4fa;
  margin: 0.25rem 0 0.25rem 1rem;
  font-size: 0.9rem;
}

