/* === Body === */
body {
    margin: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f5f0e6;
    color: #4b4232;
    font-family: monospace;
    font-size: 1.05rem;
}

/* === Container === */
#container {
    text-align: left;
    border: 2px solid #c3b59a;
    border-radius: 8px;
    padding: 25px 30px;
    max-width: 680px;
    background: #fff8f0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 90vh;
    overflow-y: auto;
}

/* === Home === */
.home a {
    color: #6b5e4c;
    text-decoration: none;
    font-weight: bold;
    display: block;
    margin-bottom: 15px;
}

.home a:hover {
    text-decoration: underline;
}

/* === Loading === */
#loading {
    font-style: italic;
    opacity: 0.7;
    margin-bottom: 10px;
}

/* === Tree base === */
ul {
    list-style: none;
    margin-left: 0.75em;
    padding-left: 1em;
    border-left: 1px solid #c3b59a;
}

li {
    position: relative;
    margin: 4px 0;
    padding-left: 0.75em;
}

li::before {
    content: "";
    position: absolute;
    left: -1em;
    top: 0.9em;
    width: 0.75em;
    height: 0;

    /* draw line via shadow (zoom-safe) */
    box-shadow: 0 0 0 1.35px #c3b59a;
}



/* === Folder === */
.folder {
    cursor: pointer;
    user-select: none;
    color: #7a6f5e;
}

.folder::before {
    content: "📁 ";
}

.folder:hover {
    background: rgba(186, 168, 140, 0.2);
    border-radius: 4px;
    padding: 0 4px;
}

/* === Leaf site === */
.leaf {
    color: #4b4232;
    text-decoration: none;
}

.leaf::before {
    content: "🌐 ";
}

.leaf:hover {
    text-decoration: underline;
}

/* === Collapsed === */
ul.collapsed {
    display: none;
}

/* ================================
   Mobile / Portrait Layout
   ================================ */
   @media (orientation: portrait) {

    body {
        align-items: flex-start;
        justify-content: flex-start;
        padding: 16px;
        height: auto;
    }

    #container {
        width: 100%;
        max-width: 420px;      /* ⬅️ capped width */
        margin: 0;
        padding: 20px;
        border-radius: 10px;

        font-size: 1.05rem;    /* slightly smaller */
        line-height: 1.55;
    }

    .home a {
        font-size: 1.2rem;
        margin-bottom: 16px;
    }

    ul {
        margin-left: 1em;
        padding-left: 1em;
    }

    li {
        margin: 6px 0;
    }

    .folder,
    .leaf {
        padding: 4px 2px;
        display: inline-block;
    }
}
