:root {
    --bg-dark: rgb(34, 34, 34);
    --fg-dark: rgb(228, 228, 228);
    --accent-dark: rgb(89, 169, 245);

    --bg-light: rgb(245, 245, 245);
    --fg-light: rgb(48, 48, 48);
    --accent-light: rgb(48, 83, 240);
    --bg-light: rgb(245, 245, 245);
    --fg-light: rgb(48, 48, 48);
    --accent-light: rgb(204, 81, 32);

    --bg: var(--bg-dark);
    --fg: var(--fg-dark);
    --accent: var(--accent-dark);
    color-scheme: dark;

    --grid-gap: 0px;
}

:root[data-theme="dark"] {
    --bg: var(--bg-dark);
    --fg: var(--fg-dark);
    --accent: var(--accent-dark);
    color-scheme: dark;
}

:root[data-theme="light"] {
    --bg: var(--bg-light);
    --fg: var(--fg-light);
    --accent: var(--accent-light);
    color-scheme: light;
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme]) {
        --bg: var(--bg-light);
        --fg: var(--fg-light);
        --accent: var(--accent-light);
        color-scheme: light;
    }
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --bg: var(--bg-dark);
        --fg: var(--fg-dark);
        --accent: var(--accent-dark);
        color-scheme: dark;
    }
}

* {
    box-sizing: border-box;
}

body {
    display: flex;
    height: 100dvh;
    background: var(--bg);
    color: var(--fg);
    margin: 0;
    padding: 3px;
}

#container {
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 900px;
    height: 100%;
    font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    border: 1px solid var(--accent);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg);
    flex: 0 0 auto;
}

.topbar .brand {
    letter-spacing: .04em;
    font-weight: bold;
}

.topbar button {
    border: none;
    background: inherit;
    cursor: pointer;
}

.workspace {
    display: flex;
    padding-top: 5px;
    min-height: 0;
    min-block-size: 0;
    flex: 1 1 auto;
    gap: var(--grid-gap);
    padding: var(--grid-gap) 0;
    border-top: 1px solid var(--accent);
}

.sidebar {
    background: var(--bg);
    padding: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.2s ease;

    border-right: 1px solid var(--accent);

    flex: 0 0 auto;
    width: max-content;
    min-width: 100px;
    max-width: 20vw;
}

.sidebar details {
    margin: 4px 0;
}

.sidebar summary {
    cursor: pointer;
    list-style: none;
    padding: 2px 0;
    margin-left: -16px;
    color: var(--fg);
    font-weight: normal;
}

.sidebar summary::-webkit-details-marker {
    display: none;
}

.sidebar summary::marker {
    content: "";
}

.sidebar summary::before {
    content: "▾";
    display: inline-block;
    width: 1em;
    text-align: center;
    transition: transform .2s;
    margin-right: 2px;
    color: var(--fg);
}

.sidebar details:not([open])>summary::before {
    transform: rotate(-90deg);
}

.sidebar a {
    color: inherit;
    text-decoration: none;
}

.sidebar a:hover,
.sidebar a:focus {
    color: inherit;
    text-decoration: none;
}

.tree,
.tree ul {
    list-style: none;
    margin: 0;
    padding-left: 16px;
}

.tree li {
    margin: 2px 0;
}

.editor {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.tabs {
    display: flex;
    flex: 0 0 auto;
    border-bottom: 1px solid var(--accent);
}

#sidebar-toggle {
    padding: 8px 12px;
    border: none;
    border-right: 1px solid var(--accent);
    background: inherit;
    font-size: large;
    cursor: pointer;
}

.tab {
    padding: 8px 12px;
    border-right: 1px solid var(--accent);
}

.scrollable {
    block-size: 100%;
    overflow-y: auto;
    padding: 20px 70px;
    flex: 1 1 auto;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--bg);
}

@media (max-width: 768px) {
  .scrollable {
    padding: 10px 10px;
  }
}

.content {
    margin-inline: auto;
    max-width: 90ch;
    min-width: 0;
}

.content a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px dotted var(--accent);
}

.content pre {
    padding: 10px;
    overflow: auto;
}

.quote {
    margin-block: 1.5rem;
    padding: 1rem 1.5rem;
    border-left: 2px solid var(--accent);
    background: color-mix(in srgb, var(--bg) 95%, var(--accent) 5%);
    font-style: italic;
}

.quote-text {
    margin: 0 0 .5rem 0;
    line-height: 1.6;
}

.quote-meta {
    font-size: 0.9em;
    color: var(--fg);
    opacity: 0.9;
}

.quote-from {
    font-weight: 500;
}

.quote-author {
    font-style: normal;
}

.show-mobile {
  display: none;
}

@media (max-width: 768px) {
  .show-mobile {
    display: block;
  }
}


.hidden-mobile {
    display: block;
}

@media (max-width: 768px) {
  .hidden-mobile {
    display: none;
  }
}