:root {
    --ink: #111;
    --muted: #666;
    --more-muted: #999;
    --bg-app: #eee;
    --link: #00f;
    --link-visited: var(--link);
    --ui-blue: #000080;
    --ui-blue-light: #3a6ea5;
    --ui-blue-dark: #000050;
    --chrome: #c0c0c0;
    --panel: #fff;
    --border-light: #fff;
    --border-mid: #dfdfdf;
    --border-dark: #808080;
    --border-xdark: #404040;
    --overlay-dim: rgba(0, 0, 0, 0.15);
    --white: #fff;
    --black: #000;
    --hover-blue: #e5eefc;
    --hover-overlay: rgba(255, 255, 255, 0.15);
    --gray-light: #eee;
    --gray-bg: #f2f2f2;

    --font-sm: 12px;
    --font-base: 13px;
    --font-lg: 14px;

    --space-xxs: 2px;
    --space-xs: 4px;
    --space-sm: 6px;
    --space-md: 8px;
    --space-lg: 10px;
    --space-xl: 12px;
    --radius-md: 4px;
    --radius-lg: 8px;

    --thumbnail: 70px;
    --node: 140px;
    --icon: 20px;
    --icon-btn: 36px;
    --nav-height: 38px;
    --nav-title-min: 90px;
    --button-height: 28px;
    --titlebar-close-size: 18px;

    --z-overlay: 2000;
    --z-nav: 3000;

    --shadow-float: 0 10px 30px rgba(0, 0, 0, 0.25);
}

* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    margin: 0;
    background: var(--bg-app) url("../img/background.png") center/cover no-repeat fixed;
    color: var(--ink);
    font-family: "Tahoma", "MS Sans Serif", Verdana, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.35;
    overflow: hidden;
}


a {
    color: var(--ink);
}

a:visited {
    color: var(--link-visited);
}

#app {
    position: relative;
    width: 100dvw;
    height: calc(100dvh - var(--nav-height));
    margin: 0;
    padding: 0;
}

.desktop {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: transparent;
}

.overlay {
    position: absolute;
    inset: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-overlay);
}

.overlay-backdrop {
    position: absolute;
    inset: 0;
    background: var(--overlay-dim);
    z-index: var(--z-overlay);
}

.overlay-backdrop[hidden] {
    display: none !important;
}

.overlay[hidden] {
    display: none !important;
}

.window-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
    color: var(--black);
}

.window-panel.floating {
    width: min(720px, 90dvw);
    height: 75dvh;
    max-height: 75dvh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-float);
    margin: 0;
}

.window-panel.floating.maximized {
    position: static;
    width: 100dvw !important;
    height: calc(100dvh - var(--nav-height)) !important;
    max-height: calc(100dvh - var(--nav-height)) !important;
    margin: 0;
    box-shadow: none;
}


.window-panel.floating .window-viewport {
    overflow: auto;
    padding: var(--space-lg) var(--space-xl);
}

.titlebar {
    height: var(--titlebar-height, 24px);
    display: flex;
    align-items: center;
    padding: 0 var(--space-md);
    background: var(--ui-blue);
    color: var(--white);
    box-shadow: inset 0 1px 0 var(--ui-blue-light), inset 0 -1px 0 var(--ui-blue-dark);
    justify-content: space-between;
    gap: var(--space-md);
}

.titlebar-controls {
    display: flex;
    gap: var(--space-xxs, 2px);
}

.titlebar-btn {
    border: none;
    background: transparent;
    color: var(--white);
    font-size: var(--font-base);
    line-height: 1;
    width: 22px;
    height: 20px;
    text-align: center;
    cursor: pointer;
}

.titlebar-btn:hover {
    background: var(--hover-overlay);
}

.titlebar-text {
    font-weight: 700;
    font-size: var(--font-base);
}

.titlebar-close {
    border: none;
    background: transparent;
    color: var(--white);
    font-size: var(--titlebar-close-size);
    line-height: 1;
    padding: var(--space-xxs) var(--space-sm);
    cursor: pointer;
}

.titlebar-close:hover {
    background: var(--hover-overlay);
}

.window-viewport {
    flex: 1;
    background: var(--panel);
    box-shadow:
        inset 1px 1px 0 var(--border-light),
        inset -1px -1px 0 var(--border-dark),
        inset 2px 2px 0 var(--border-mid),
        inset -2px -2px 0 var(--border-xdark);
    padding: 0;
    overflow: auto;
}

.list {
    margin: 0;
    padding: 0;
    height: 100%;
}

.overlay>section {
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    position: relative;
}

.list .window-viewport {
    --cols: 2fr 1fr 1fr;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.list-header {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 2;
}

#list-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.list-header {
    position: sticky;
    top: 0;
    display: grid;
    grid-template-columns: var(--cols);
    padding: var(--space-md);
    align-items: center;
    gap: 0;
    background: var(--chrome);
    color: var(--ink);
    border-bottom: 1px solid var(--border-dark);
    box-shadow:
        inset -1px -1px 0 var(--border-dark),
        inset 1px 1px 0 var(--border-light);
    font-size: var(--font-sm);
    z-index: 2;
}

ul.details {
    list-style: none;
    margin: 0;
    padding: var(--space-md);
}

ul.details li {
    display: grid;
    grid-template-columns: var(--cols);
    border-bottom: 1px solid var(--gray-light);
    align-items: center;
    font-size: var(--font-base);
    cursor: default;
    user-select: none;
    padding: var(--space-md);
}

.list-header .col {
    cursor: pointer;
    user-select: none;
}

.list-header .col[data-sort="asc"]::after {
    content: " ▲";
}

.list-header .col[data-sort="desc"]::after {
    content: " ▼";
}

ul.details li:hover {
    background: var(--hover-blue);
}

ul.details li.selected {
    background: var(--ui-blue);
    color: var(--white);
}

ul.details li.selected a {
    color: var(--white);
}

ul.details li.selected a:hover {
    text-decoration: underline;
}

ul.details li .name a {
    color: inherit;
    text-decoration: none;
}

ul.details li .name a:hover {
    text-decoration: underline;
}

.node.is-wip .title,
.node .title.is-wip {
    color: var(--more-muted);
}

.node.selected.is-wip .title,
.node.selected .title.is-wip {
    color: rgba(255, 255, 255, 0.8);
}

ul.details li.is-wip .name,
ul.details li.is-wip .name a,
ul.details li .name .is-wip {
    color: var(--more-muted);
}

ul.details li.selected.is-wip .name,
ul.details li.selected.is-wip .name a,
ul.details li.selected .name .is-wip {
    color: rgba(255, 255, 255, 0.8);
}

.about-content p {
    margin: .5rem 0 1rem;
}

.about-content code {
    background: var(--gray-bg);
    padding: var(--space-xxs) var(--space-xs);
    border-radius: var(--radius-md);
}

.project-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.node {
    position: absolute;
    touch-action: none;
    user-select: none;
    -webkit-user-drag: none;
    cursor: grab;
    margin: 0;
    width: var(--node);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
}

.node:active {
    cursor: grabbing
}

.node a.thumb {
    display: block;
    text-decoration: none;
    outline: none;
    width: var(--thumbnail);
    height: var(--thumbnail);
    cursor: grab;
}

.node a.thumb:active {
    cursor: grabbing;
}

.node img {
    display: block;
    height: var(--thumbnail);
    min-height: var(--thumbnail);
    max-height: var(--node);
    width: auto;
    max-width: var(--node);
    object-fit: contain;
    pointer-events: none;
}

.node .caption {
    margin-top: 0;
    padding: var(--space-xxs) var(--space-xs);
    border: 1px solid transparent;
    background: transparent;
    color: var(--ink);
    text-shadow: 1px 1px 0 var(--border-light);
    display: block;
    max-width: 100%;
    width: var(--node);
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-size: var(--font-sm);
}

.node.selected .caption {
    background: var(--ui-blue);
    color: var(--border-light);
    border-color: var(--border-light);
    text-shadow: none;
}

.node.selected .caption a {
    color: var(--border-light);
}

.node .creator {
    font-size: .85rem;
    color: var(--muted)
}

.node .creator a {
    text-decoration: none;
    color: var(--link);
    border: 1px solid transparent;
}

.node .creator a:hover,
.node .creator a:focus-visible {
    background: var(--hover-blue);
    text-decoration: underline;
    box-shadow:
        inset 1px 1px 0 var(--border-light),
        inset -1px -1px 0 var(--border-dark);
    outline: none;
}

.node .creator a:active {
    background: var(--chrome);
    box-shadow:
        inset -1px -1px 0 var(--border-light),
        inset 1px 1px 0 var(--border-dark);
}

.node .title {
    font-weight: 600
}

.nav-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--nav-height);
    background: var(--chrome);
    border-top: 2px solid var(--border-light);
    box-shadow: inset 0 2px 0 var(--border-mid), inset 0 -2px 0 var(--border-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-xs) var(--space-sm);
    z-index: var(--z-nav);
    font-size: var(--font-base);
}

.nav-bar-left {
    display: flex;
    align-items: center;
    gap: var(--space-sm)
}

.task-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xxs) var(--space-md);
    text-decoration: none;
    color: var(--black);
    background: var(--chrome);
    border: none;
    cursor: pointer;
    box-shadow:
        inset -1px -1px 0 var(--border-dark),
        inset 1px 1px 0 var(--border-light),
        inset -2px -2px 0 var(--border-xdark),
        inset 2px 2px 0 var(--border-mid);
    line-height: 1;
    height: var(--button-height);
}

.task-btn>span {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.task-btn>span[aria-hidden="true"] {
    width: 1em;
    height: 1em;
    text-align: center;
    font-size: 1em;
}

.task-btn[hidden] {
    display: none !important;
}

.task-btn:active,
.task-btn.active {
    box-shadow:
        inset 1px 1px 0 var(--border-dark),
        inset -1px -1px 0 var(--border-light),
        inset 2px 2px 0 var(--border-xdark),
        inset -2px -2px 0 var(--border-mid);
}

.nav-bar-right {
    min-width: var(--nav-title-min);
    text-align: right
}

.nav-bar-title {
    white-space: nowrap;
}

.creator-menu {
    position: absolute;
    background: var(--chrome);
    border: 1px solid var(--border-dark);
    box-shadow: var(--shadow-float);
    z-index: calc(var(--z-overlay) + 10);
    display: flex;
    flex-direction: column;
    min-width: 160px;
    font-size: var(--font-sm);
}

.creator-menu a {
    padding: var(--space-xs) var(--space-md);
    text-decoration: none;
    color: var(--ink);
    white-space: nowrap;
}

.creator-menu a:hover {
    background: var(--hover-blue);
}

.node-menu {
    position: absolute;
    background: var(--chrome);
    border: 1px solid var(--border-dark);
    box-shadow: var(--shadow-float);
    z-index: calc(var(--z-overlay) + 20);
    display: flex;
    flex-direction: column;
    min-width: 160px;
}

.node-menu button {
    background: transparent;
    border: none;
    padding: var(--space-xs) var(--space-md);
    text-align: left;
    color: var(--ink);
    font-size: var(--font-sm);
    cursor: pointer;
}

.node-menu button:hover {
    background: var(--hover-blue);
}

.description-window {
    position: fixed;
    background: var(--panel);
    border: 2px solid var(--border-dark);
    box-shadow: var(--shadow-float);
    padding: var(--space-lg);
    max-width: 320px;
    z-index: calc(var(--z-overlay) + 30);
    color: var(--ink);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -45%);
}

.description-window .description-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    margin-bottom: var(--space-sm);
}

.description-window .description-header a {
    color: var(--link);
    text-decoration: none;
}

.description-window .description-header a:hover,
.description-window .description-header a:focus-visible {
    text-decoration: underline;
    outline: none;
}

.description-window .description-close {
    border: none;
    background: transparent;
    color: var(--ink);
    font-size: var(--font-lg);
    cursor: pointer;
    line-height: 1;
}

.description-window .description-close:hover {
    background: var(--hover-overlay);
}

.description-window .description-body {
    font-size: var(--font-sm);
    line-height: 1.4;
}

.description-window .description-subtitle {
    display: flex;
    flex-direction: column;
    gap: var(--space-xxs);
    margin-bottom: var(--space-xs);
}

.description-window .description-creator {
    color: var(--muted);
}

.description-window .description-session {
    color: var(--muted);
    margin-bottom: var(--space-lg);
}

.description-window .description-text {
    margin: 0;
}

@media (max-width: 640px) {
    :root {
        --thumbnail: 90px;
        --nav-height: 48px;
        --titlebar-height: 32px;
        --font-base: 14px;
        --button-height: 36px;
    }

    .window-panel.floating {
        width: 96dvw;
        height: 75dvh;
        max-height: 75dvh;
    }

    .window-panel.floating .window-viewport {
        padding: var(--space-md) var(--space-lg);
    }

    .window-panel.floating.maximized {
        width: 100dvw !important;
        height: calc(100dvh - var(--nav-height)) !important;
        max-height: calc(100dvh - var(--nav-height)) !important;
        margin: 0;
        box-shadow: none;
    }

    .list .window-viewport {
        --cols: 2fr 1fr 1fr;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .list-header {
        display: none;
        flex-shrink: 0;
    }

    #list-container {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .list-description {
        grid-column: 1 / -1;
        background: var(--gray-bg);
        color: var(--muted);
        padding: var(--space-xs) var(--space-md);
        font-size: var(--font-sm);
        border-bottom: 1px solid var(--border-light);
        line-height: 1.4;
    }

    ul.details li {
        grid-template-columns: 1fr;
        align-items: start;
        padding: inherit;
        gap: var(--space-xxs);
    }

    ul.details li .name {
        font-weight: 600;
    }

    ul.details li .creator,
    ul.details li .session {
        display: block;
        font-size: var(--font-sm);
        color: var(--muted);
        padding: 0 var(--space-md);
    }

    .project-frame {
        height: 100%;
    }

    .nav-bar {
        padding: var(--space-sm) var(--space-md);
    }

    .nav-bar-left {
        gap: var(--space-md);
    }

    .task-btn {
        padding: var(--space-md) var(--space-lg);
    }
}

@media (max-width: 430px) {
    .task-btn span:not([aria-hidden="true"]) {
        display: none;
    }
}