/* TBONE Check-In — Windows 95 desktop shell */

@font-face {
    font-family: "W95FA";
    src: url('/fonts/W95FA.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Scoped to check-in mode so SPA can keep this sheet loaded on site pages */
body.checkin-desktop {
    font-family: "W95FA", "MS Sans Serif", "Arial", sans-serif;
    background-color: #008080;
    color: #000000;
    margin: 0;
    /* Viewport lock — !important beats stray site/radio-footer padding if sheets stack.
       100dvh prefers dynamic mobile chrome; 100vh is the fallback. */
    overflow: hidden !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    padding-bottom: 0 !important;
}

/* Dual-shell [hidden] also in tokens.css; keep local copy for hard-load isolation. */
#site-shell[hidden],
#checkin-root[hidden] {
    display: none !important;
}

body.checkin-desktop #checkin-root {
    display: block;
    position: relative;
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    /* NEVER put filter/transform here — fixed taskbar/icons need the viewport */
    overflow: hidden;
}

/* Nav links: top-left, vertical stack */
.desktop-nav {
    position: fixed;
    left: 10px;
    top: 12px;
    width: 104px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    z-index: 5;
}

/* Programs: bottom-left above taskbar, row extending right */
.desktop-programs {
    position: fixed;
    left: 10px;
    bottom: calc(40px + env(safe-area-inset-bottom, 0px)); /* just above taskbar */
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 16px;
    z-index: 5;
    max-width: calc(100vw - 16px);
    pointer-events: none; /* container; children re-enable */
}

.desktop-programs .desktop-icon {
    pointer-events: auto;
}

a.desktop-icon,
button.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 92px;
    min-height: 78px;
    flex-shrink: 0;
    text-align: center;
    color: #FFFFFF;
    text-decoration: none;
    background: transparent;
    border: 1px dotted transparent;
    font-family: "W95FA", Arial, sans-serif;
    font-size: 13px;
    line-height: 1.2;
    padding: 5px 3px 7px;
    cursor: pointer;
    text-shadow: 1px 1px 0 #000;
    box-sizing: border-box;
    min-width: 92px;
}

a.desktop-icon:hover,
button.desktop-icon:hover,
a.desktop-icon:focus-visible,
button.desktop-icon:focus-visible {
    background: rgba(0, 0, 128, 0.4);
    border-color: rgba(255, 255, 255, 0.55);
    outline: none;
    color: #FFF;
}

.desktop-icon img {
    width: 40px;
    height: 40px;
    margin-bottom: 5px;
    object-fit: contain;
    image-rendering: pixelated;
    flex-shrink: 0;
}

.desktop-icon span {
    display: block;
    max-width: 90px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}


/* ========== Window chrome ========== */
.win95-window {
    position: absolute;
    display: flex;
    flex-direction: column;
    background: #C0C0C0;
    border-top: 2px solid #FFFFFF;
    border-left: 2px solid #FFFFFF;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    box-shadow: 1px 1px 0 #000;
    z-index: 20;
    min-width: 280px;
    min-height: 180px;
    box-sizing: border-box;
    overflow: hidden;
}

.win95-window.minimized {
    display: none !important;
}

.win95-window.maximized {
    border-width: 2px;
}

.win95-window.focused .win95-titlebar {
    background: linear-gradient(to right, #000080, #1084D0);
}

.win95-window:not(.focused) .win95-titlebar {
    background: linear-gradient(to right, #808080, #b5b5b5);
}

.win95-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 4px 3px 5px;
    color: #FFF;
    font-size: 14px;
    font-weight: bold;
    cursor: move;
    user-select: none;
    flex-shrink: 0;
    gap: 4px;
}

.win95-titlebar .header-title {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.win95-titlebar .header-title img {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    image-rendering: pixelated;
}

.header-buttons {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.header-buttons button {
    width: 18px;
    height: 16px;
    padding: 0;
    margin: 0;
    font-size: 11px;
    line-height: 14px;
    text-align: center;
    background: #C0C0C0;
    color: #000;
    border-top: 1px solid #FFF;
    border-left: 1px solid #FFF;
    border-right: 1px solid #404040;
    border-bottom: 1px solid #404040;
    cursor: pointer;
    min-width: 18px;
    min-height: 16px;
    font-family: "W95FA", sans-serif;
}

.header-buttons button:active {
    border-top: 1px solid #404040;
    border-left: 1px solid #404040;
    border-right: 1px solid #FFF;
    border-bottom: 1px solid #FFF;
}

.win95-menubar {
    display: flex;
    gap: 12px;
    padding: 3px 8px;
    font-size: 13px;
    background: #C0C0C0;
    border-bottom: 1px solid #808080;
    flex-shrink: 0;
    user-select: none;
}

.win95-menubar span {
    cursor: default;
    padding: 1px 4px;
}

.win95-menubar span:hover {
    background: #000080;
    color: #FFF;
}

.win95-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px 6px;
    background: #C0C0C0;
    border-bottom: 1px solid #808080;
    flex-shrink: 0;
    align-items: center;
    min-height: 30px;
    box-sizing: border-box;
}

/* Uniform toolbar buttons (Library, Philippics, etc.) */
.win95-toolbar button,
.win95-toolbar .tb-btn,
.exchange-mail-toolbar .tb-btn {
    font-family: "W95FA", Arial, sans-serif;
    font-size: 12px;
    line-height: 1;
    height: 22px;
    min-height: 22px;
    max-height: 22px;
    box-sizing: border-box;
    background: #C0C0C0;
    color: #000;
    border-top: 2px solid #FFF;
    border-left: 2px solid #FFF;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    padding: 0 10px;
    cursor: pointer;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.win95-toolbar button:active:not(:disabled),
.win95-toolbar .tb-btn:active:not(:disabled),
.exchange-mail-toolbar .tb-btn:active:not(:disabled) {
    border-top: 2px solid #404040;
    border-left: 2px solid #404040;
    border-right: 2px solid #FFF;
    border-bottom: 2px solid #FFF;
}

.win95-toolbar button:disabled,
.win95-toolbar .tb-btn:disabled {
    color: #808080;
    cursor: default;
}

.win95-toolbar .tb-sep {
    display: inline-block;
    width: 1px;
    height: 18px;
    background: #808080;
    border-right: 1px solid #FFF;
    margin: 0 4px;
    flex-shrink: 0;
}

.library-toolbar {
    align-items: center;
}

.win95-client {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    background: #FFF;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #FFF;
    border-bottom: 2px solid #FFF;
    margin: 4px 6px;
    box-sizing: border-box;
}

.win95-statusbar {
    flex-shrink: 0;
    font-size: 11px;
    padding: 2px 6px;
    border-top: 1px solid #FFF;
    background: #C0C0C0;
    color: #000;
    min-height: 18px;
}

.win95-resize {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 14px;
    height: 14px;
    cursor: se-resize;
    background:
        linear-gradient(135deg, transparent 50%, #808080 50%, #808080 60%, transparent 60%),
        linear-gradient(135deg, transparent 65%, #808080 65%, #808080 75%, transparent 75%),
        linear-gradient(135deg, transparent 80%, #404040 80%);
    z-index: 5;
}

.win95-window.maximized .win95-resize {
    display: none;
}

.win95-muted {
    color: #555;
    font-size: 12px;
}

.readable {
    font-family: "Georgia", "Times New Roman", Times, serif;
    font-size: 16px;
    line-height: 1.55;
    color: #111;
    padding: 12px 16px;
}

.readable h1, .readable h2, .readable h3 {
    font-family: "W95FA", Arial, sans-serif;
    line-height: 1.25;
    margin: 0.75em 0 0.4em;
}

.readable p { margin: 0 0 0.85em; }
.readable a { color: #000080; }

/* ========== Guestbook form ========== */
.guestbook-content {
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.guestbook-form label {
    display: block;
    margin-bottom: 2px;
    font-size: 12px;
}

.guestbook-form input,
.guestbook-form textarea {
    width: 100%;
    box-sizing: border-box;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #FFF;
    border-bottom: 2px solid #FFF;
    padding: 3px 4px;
    font-family: Arial, sans-serif;
    font-size: 13px;
    margin-bottom: 6px;
    background: #FFF;
}

.guestbook-form .hp-field {
    position: absolute;
    left: -10000px;
    height: 1px;
    overflow: hidden;
}

.guestbook-form button[type="submit"] {
    display: block;
    width: 100px;
    height: 30px;
    margin: 4px auto 8px;
    background: url('/nc_assets/img/ok_button.png') no-repeat center / 100px 30px;
    border-top: 2px solid #FFF;
    border-left: 2px solid #FFF;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    text-indent: -9999px;
    cursor: pointer;
    min-width: 100px;
    min-height: 30px;
}

#comments {
    flex: 1;
    min-height: 80px;
    overflow: auto;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #FFF;
    border-bottom: 2px solid #FFF;
    background: #FFF;
    padding: 6px 8px;
    font-family: "Courier New", monospace;
    font-size: 12px;
}

#comments p {
    margin: 0 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px dotted #808080;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ========== Philippics / Exchange ========== */
.app-exchange .exchange-split {
    display: flex;
    flex-direction: row;
    margin: 4px 6px;
    border: none;
    background: transparent;
    overflow: hidden;
    flex: 1;
    min-height: 0;
    gap: 4px;
}

.exchange-folders {
    width: 140px;
    flex-shrink: 0;
    background: #FFF;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #FFF;
    border-bottom: 2px solid #FFF;
    padding: 4px 0;
    overflow: auto;
    font-size: 12px;
}

.folder-heading {
    padding: 4px 8px 6px;
    font-weight: bold;
    color: #000080;
    font-size: 11px;
}

.folder-item {
    padding: 3px 8px 3px 14px;
    cursor: default;
}

.folder-item.active {
    background: #000080;
    color: #FFF;
}

.folder-item.muted {
    color: #808080;
}

.exchange-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #FFF;
    border-bottom: 2px solid #FFF;
    background: #FFF;
    overflow: hidden;
}

.exchange-list {
    flex: 1;
    overflow: auto;
    min-height: 0;
}

/* Column header strip */
.exchange-list::before {
    content: "From\a0\a0\a0\a0\a0\a0\a0\a0\a0 Subject\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0\a0 Received";
    display: block;
    position: sticky;
    top: 0;
    background: #C0C0C0;
    border-bottom: 1px solid #808080;
    padding: 3px 8px;
    font-size: 11px;
    font-family: "W95FA", Arial, sans-serif;
    color: #000;
    z-index: 1;
}

.exchange-row {
    display: grid;
    grid-template-columns: 80px 1fr 100px;
    gap: 6px;
    width: 100%;
    text-align: left;
    border: none;
    border-bottom: 1px solid #e8e8e8;
    background: #FFF;
    padding: 6px 8px;
    font-family: "W95FA", Arial, sans-serif;
    font-size: 12px;
    cursor: pointer;
    color: #000;
    min-width: 0;
    min-height: 0;
    box-sizing: border-box;
}

.exchange-row:hover {
    background: #e8e8ff;
}

.exchange-row.selected {
    background: #000080;
    color: #FFF;
}

.exchange-row.unread .ex-subject {
    font-weight: bold;
}

.ex-from { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-date { text-align: right; color: #444; white-space: nowrap; font-size: 11px; }
.exchange-row.selected .ex-date { color: #ccc; }

/* Full email reading surface */
.exchange-read {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    background: #C0C0C0;
}

.exchange-read[hidden] { display: none !important; }

.exchange-mail-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    background: #C0C0C0;
    border-bottom: 1px solid #808080;
    flex-shrink: 0;
    min-height: 30px;
    box-sizing: border-box;
}

.exchange-mail-headers {
    background: #FFF;
    border-bottom: 1px solid #808080;
    padding: 8px 12px 10px;
    flex-shrink: 0;
    font-family: "W95FA", Arial, sans-serif;
    font-size: 12px;
    line-height: 1.45;
}

.exchange-mail-headers .mail-field {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 6px;
    margin-bottom: 2px;
}

.exchange-mail-headers .mail-label {
    color: #000;
    font-weight: bold;
    text-align: right;
}

.exchange-mail-headers .mail-value {
    color: #000;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.exchange-mail-headers .mail-subject-line {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #c0c0c0;
    font-size: 14px;
    font-weight: bold;
    white-space: normal;
    word-wrap: break-word;
}

.exchange-read-body {
    flex: 1;
    overflow: auto;
    min-height: 0;
    background: #FFF;
    margin: 0;
    border: none;
    /* Readable email body */
    font-family: "Times New Roman", Times, serif;
    font-size: 15px;
    line-height: 1.55;
    padding: 14px 18px 20px;
    color: #000;
}

.exchange-read-body h1,
.exchange-read-body h2,
.exchange-read-body h3 {
    font-family: "W95FA", Arial, sans-serif;
    margin: 0.7em 0 0.35em;
}

.exchange-read-body p {
    margin: 0 0 0.85em;
}

.exchange-read-body a {
    color: #000080;
}

/* When reading mail, hide list (full pane) */
.app-exchange.reading-mail .exchange-list {
    display: none;
}

.app-exchange.reading-mail .exchange-main {
    background: #C0C0C0;
}

/* ========== Library / Notepad ========== */
.notepad-catalog {
    padding: 0;
    overflow: auto;
    background: #FFF;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.notepad-catalog[hidden] {
    display: none !important;
}

/* Explorer-style Details list */
.library-explorer {
    width: 100%;
    border-collapse: collapse;
    font-family: "W95FA", "MS Sans Serif", Arial, sans-serif;
    font-size: 12px;
    color: #000;
    table-layout: fixed;
}

.library-explorer thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    text-align: left;
    font-weight: normal;
    padding: 2px 6px;
    background: #C0C0C0;
    border-top: 1px solid #FFF;
    border-left: 1px solid #FFF;
    border-right: 1px solid #808080;
    border-bottom: 1px solid #808080;
    white-space: nowrap;
    user-select: none;
}

.library-explorer .col-type { width: 14%; }
.library-explorer .col-name { width: 42%; }
.library-explorer .col-license { width: 28%; }
.library-explorer .col-dl { width: 16%; text-align: right; }

.lib-dl-btn {
    display: inline-block;
    font-family: "W95FA", Arial, sans-serif;
    font-size: 11px;
    padding: 1px 6px;
    color: #000;
    background: #C0C0C0;
    border-top: 1px solid #FFF;
    border-left: 1px solid #FFF;
    border-right: 1px solid #808080;
    border-bottom: 1px solid #808080;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.lib-dl-btn:hover,
.lib-dl-btn:focus-visible {
    background: #d4d0c8;
    outline: 1px dotted #000;
}

.library-explorer tbody tr:hover .lib-dl-btn,
.library-explorer tbody tr.is-selected .lib-dl-btn {
    /* keep chip readable on blue selection */
    color: #000;
    background: #C0C0C0;
}

.library-explorer tbody tr {
    cursor: pointer;
}

.library-explorer tbody tr:nth-child(even) {
    background: #F0F0F0;
}

.library-explorer tbody tr:hover,
.library-explorer tbody tr:focus-visible {
    background: #000080;
    color: #FFF;
    outline: none;
}

.library-explorer tbody tr.is-selected {
    background: #000080;
    color: #FFF;
}

.library-explorer tbody td {
    padding: 3px 6px;
    border-bottom: 1px solid #E0E0E0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.library-explorer .lib-name-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.library-explorer .lib-doc-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    image-rendering: pixelated;
    opacity: 0.95;
}

.library-explorer .lib-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.library-explorer .lib-author {
    color: #555;
    font-size: 11px;
}

.library-explorer tbody tr:hover .lib-author,
.library-explorer tbody tr.is-selected .lib-author {
    color: #c0c0ff;
}

.notepad-reader {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.notepad-reader[hidden] { display: none !important; }

.notepad-meta {
    font-size: 11px;
    padding: 3px 8px;
    background: #C0C0C0;
    border-bottom: 1px solid #808080;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

/* epub.js render host — needs real pixel height for epub.js */
.library-epub-wrap {
    position: relative;
    flex: 1 1 auto;
    min-height: 280px;
    margin: 0 4px 4px;
    display: flex;
    flex-direction: column;
    border-top: 2px solid #404040;
    border-left: 2px solid #404040;
    border-right: 2px solid #FFF;
    border-bottom: 2px solid #FFF;
    background: #fffff8;
    overflow: hidden;
}

.library-epub-frame {
    flex: 1 1 auto;
    width: 100%;
    min-height: 280px;
    height: 100%;
    border: none;
    background: #fffff8;
    display: block;
}

.library-epub-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 16px;
    font-family: "W95FA", Arial, sans-serif;
    font-size: 13px;
    line-height: 1.4;
    color: #222;
    background: rgba(255, 255, 248, 0.94);
    z-index: 5;
    pointer-events: none;
}

.library-epub-loading[hidden] {
    display: none !important;
}

.library-epub-loading.is-error {
    pointer-events: auto;
    color: #400;
}

#library-window.theme-paper .library-epub-wrap,
#library-window.theme-paper .library-epub-frame { background: #fffff8; }
#library-window.theme-sepia .library-epub-wrap,
#library-window.theme-sepia .library-epub-frame { background: #f4ecd8; }
#library-window.theme-black .library-epub-wrap,
#library-window.theme-black .library-epub-frame { background: #1a1a1a; }
#library-window.theme-black .notepad-meta { background: #333; color: #ddd; }
#library-window.theme-black .library-epub-loading {
    background: rgba(26, 26, 26, 0.94);
    color: #ddd;
}

/* ========== Windows Media Player 6.x layout (visual) ========== */
.app-wmp {
    background: #C0C0C0;
}

.wmp-toolbar {
    display: flex;
    gap: 2px;
    padding: 2px 4px;
    background: #C0C0C0;
    border-bottom: 1px solid #808080;
    flex-shrink: 0;
}

.wmp-tb-btn {
    font-size: 11px;
    padding: 2px 8px;
    border-top: 1px solid #FFF;
    border-left: 1px solid #FFF;
    border-right: 1px solid #808080;
    border-bottom: 1px solid #808080;
    background: #C0C0C0;
    color: #000;
}

.wmp-tb-btn.is-active {
    border-top: 1px solid #808080;
    border-left: 1px solid #808080;
    border-right: 1px solid #FFF;
    border-bottom: 1px solid #FFF;
    background: #d4d0c8;
}

/* Player + playlist side-by-side (classic WMP media + list) */
.wmp-body {
    display: flex;
    flex: 1;
    min-height: 0;
    background: #C0C0C0;
}

.wmp-player {
    display: flex;
    flex-direction: column;
    flex: 1 1 58%;
    min-width: 0;
    min-height: 0;
    background: #C0C0C0;
    padding: 4px 6px 2px;
    box-sizing: border-box;
}

.wmp-playlist {
    flex: 0 0 42%;
    max-width: 280px;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #C0C0C0;
    border-left: 2px solid #808080;
    box-sizing: border-box;
}

.wmp-playlist-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
    padding: 3px 6px;
    background: #000080;
    color: #FFF;
    font-family: "W95FA", Arial, sans-serif;
    font-size: 11px;
    flex-shrink: 0;
}

.wmp-playlist-title {
    font-weight: bold;
    letter-spacing: 0.02em;
}

.wmp-playlist-sub {
    font-size: 10px;
    color: #c0c0ff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.wmp-playlist-cols {
    display: grid;
    grid-template-columns: 1.4em 1fr 0.9fr;
    gap: 4px;
    padding: 2px 4px;
    font-size: 10px;
    font-family: "W95FA", Arial, sans-serif;
    background: #C0C0C0;
    border-bottom: 1px solid #808080;
    border-top: 1px solid #FFF;
    color: #000;
    flex-shrink: 0;
}

.wmp-playlist-list {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    min-height: 0;
    overflow: auto;
    background: #FFF;
    border-top: 1px solid #404040;
    border-left: 1px solid #404040;
    border-right: 1px solid #FFF;
    border-bottom: 1px solid #FFF;
    font-family: "W95FA", Arial, sans-serif;
    font-size: 11px;
}

.wmp-playlist-list li {
    display: grid;
    grid-template-columns: 1.4em 1fr 0.9fr;
    gap: 4px;
    padding: 3px 4px;
    border-bottom: 1px solid #E8E8E8;
    color: #000;
    cursor: default;
}

.wmp-playlist-list li:nth-child(even) {
    background: #F4F4F4;
}

.wmp-playlist-list li.is-now {
    background: #000080;
    color: #FFF;
}

.wmp-playlist-list li .wmp-pl-num {
    color: #808080;
    text-align: right;
}

.wmp-playlist-list li.is-now .wmp-pl-num {
    color: #c0c0ff;
}

.wmp-playlist-list li .wmp-pl-clip,
.wmp-playlist-list li .wmp-pl-author {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wmp-playlist-list li.wmp-pl-empty {
    display: block;
    color: #666;
    padding: 8px;
    background: #FFF;
}

.wmp-display {
    position: relative;
    flex: 1 1 auto;
    min-height: 160px;
    background: #000;
    border-top: 2px solid #404040;
    border-left: 2px solid #404040;
    border-right: 2px solid #FFF;
    border-bottom: 2px solid #FFF;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wmp-display .visualizer,
.wmp-visualizer {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    bottom: auto !important;
    left: auto !important;
    z-index: 1 !important;
    display: none;
    pointer-events: none;
    background: transparent !important;
}

.wmp-display .visualizer.active {
    display: block !important;
}

.wmp-display .visualizer canvas {
    width: 100% !important;
    height: 100% !important;
}

.wmp-album {
    position: relative;
    z-index: 2;
    max-width: 55%;
    max-height: 70%;
    object-fit: contain;
    border: 1px solid #333;
    background: #111;
}

.wmp-seek-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0 2px;
    flex-shrink: 0;
}

.wmp-seek-row[hidden] {
    display: none !important;
}

.wmp-time {
    font-size: 10px;
    font-family: "W95FA", Arial, sans-serif;
    color: #000;
    min-width: 2.2em;
}

.wmp-seek {
    position: relative;
    flex: 1;
    height: 10px;
    background: #808080;
    border-top: 1px solid #404040;
    border-left: 1px solid #404040;
    border-right: 1px solid #FFF;
    border-bottom: 1px solid #FFF;
    overflow: hidden;
}

.wmp-seek-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0%;
    background: linear-gradient(to bottom, #c0c0ff, #000080);
}

.wmp-transport {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 2px 6px;
    flex-shrink: 0;
    background: #C0C0C0;
}

.wmp-ctrl {
    width: 28px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #C0C0C0;
    color: #000;
    border-top: 2px solid #FFF;
    border-left: 2px solid #FFF;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    cursor: pointer;
    padding: 0;
    min-width: 28px;
    min-height: 24px;
}

.wmp-ctrl:active {
    border-top: 2px solid #404040;
    border-left: 2px solid #404040;
    border-right: 2px solid #FFF;
    border-bottom: 2px solid #FFF;
}

.wmp-ctrl[aria-pressed="true"] {
    color: #000080;
}

.wmp-volume {
    flex: 1;
    max-width: 120px;
    height: 4px;
    margin-left: 6px;
    accent-color: #000080;
    cursor: pointer;
}

.wmp-meta {
    flex-shrink: 0;
    background: #000;
    color: #c0c0c0;
    border-top: 2px solid #404040;
    border-left: 2px solid #404040;
    border-right: 2px solid #FFF;
    border-bottom: 2px solid #FFF;
    padding: 6px 8px;
    font-size: 11px;
    font-family: "W95FA", Arial, sans-serif;
    line-height: 1.45;
}

.wmp-meta-row {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wmp-k {
    color: #808080;
    display: inline-block;
    min-width: 4.2em;
}

.wmp-v {
    color: #e0e0e0;
}

.app-wmp .loading-indicator {
    animation: wmp-spin 1s linear infinite;
}

@keyframes wmp-spin {
    to { transform: rotate(360deg); }
}

/* ========== Taskbar ========== */
.taskbar {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    height: auto;
    min-height: 34px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 3px calc(2px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    background: #C0C0C0;
    border-top: 2px solid #FFF;
    z-index: 200;
    font-family: "W95FA", Arial, sans-serif;
    font-size: 13px;
}

body.checkin-desktop .win95-window.maximized {
    height: calc(100vh - 42px - env(safe-area-inset-bottom, 0px)) !important;
    height: calc(100dvh - 42px - env(safe-area-inset-bottom, 0px)) !important;
    max-width: calc(100vw - 8px) !important;
}

/* Start button — classic raised chip */
.start-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #C0C0C0;
    border-top: 2px solid #FFF;
    border-left: 2px solid #FFF;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    padding: 1px 8px 1px 4px;
    font-weight: bold;
    font-size: 14px;
    height: 26px;
    cursor: pointer;
    margin-left: 2px;
    box-sizing: border-box;
    user-select: none;
    flex-shrink: 0;
}

.start-button.is-open {
    border-top: 2px solid #404040;
    border-left: 2px solid #404040;
    border-right: 2px solid #FFF;
    border-bottom: 2px solid #FFF;
}

.start-flag {
    width: 18px;
    height: 18px;
    image-rendering: pixelated;
    display: block;
}

.start-label {
    font-family: "W95FA", "MS Sans Serif", Arial, sans-serif;
    font-weight: bold;
    letter-spacing: 0.02em;
}

/* Full Start menu panel (reference: Win95 start menu) */
.start-menu {
    position: absolute;
    bottom: calc(100% + 2px);
    left: 0;
    display: flex;
    flex-direction: row;
    width: 248px;
    min-height: 240px;
    background: #C0C0C0;
    border-top: 2px solid #FFF;
    border-left: 2px solid #FFF;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
    z-index: 300;
    padding: 0;
    box-sizing: border-box;
}

.start-menu[hidden] {
    display: none !important;
}

.start-menu-banner {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    background: linear-gradient(to top, #000080, #1084d0);
    color: #C0C0C0;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bold;
    font-size: 20px;
    letter-spacing: 0.06em;
    padding: 12px 5px;
    flex-shrink: 0;
    text-align: center;
    user-select: none;
}

.start-menu-items {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2px;
    min-width: 0;
}

.start-menu-row {
    position: relative;
}

.start-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    color: #000;
    font-family: "W95FA", Arial, sans-serif;
    font-size: 13px;
    padding: 7px 10px 7px 7px;
    cursor: pointer;
    box-sizing: border-box;
    text-decoration: none;
    min-height: 36px;
    min-width: 0;
}

.start-menu-item .smi-icon,
.start-menu-item img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    image-rendering: pixelated;
    flex-shrink: 0;
}

.start-menu-item .smi-icon-sm {
    width: 18px;
    height: 18px;
}

.start-menu-item .smi-label {
    flex: 1;
    min-width: 0;
}

.start-menu-item .smi-arrow {
    color: #000;
    font-size: 10px;
    flex-shrink: 0;
}

.start-menu-item:hover:not(:disabled):not(.is-empty),
.start-menu-item:focus-visible:not(:disabled),
.start-menu-row:hover > .start-menu-item:not(:disabled):not(.is-empty),
.start-menu-row.is-open > .start-menu-item {
    background: #000080;
    color: #FFF;
    outline: none;
}

.start-menu-row:hover > .start-menu-item .smi-arrow,
.start-menu-row.is-open > .start-menu-item .smi-arrow,
.start-menu-item:hover:not(:disabled) .smi-arrow {
    color: #FFF;
}

.start-menu-item.is-empty,
.start-menu-item:disabled {
    color: #808080;
    cursor: default;
}

.start-menu-item.is-empty:hover,
.start-menu-item:disabled:hover {
    background: transparent;
    color: #808080;
}

.start-menu-sep {
    height: 1px;
    margin: 3px 4px;
    background: #808080;
    border-bottom: 1px solid #FFF;
}

.start-shutdown:hover {
    background: #000080 !important;
    color: #FFF !important;
}

/* Programs flyout */
.start-flyout {
    position: absolute;
    left: 100%;
    top: -2px;
    min-width: 160px;
    background: #C0C0C0;
    border-top: 2px solid #FFF;
    border-left: 2px solid #FFF;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
    padding: 2px;
    z-index: 310;
}

.start-flyout[hidden] {
    display: none !important;
}

.start-flyout .start-menu-item img {
    width: 16px;
    height: 16px;
}

.start-flyout .start-menu-item {
    min-height: 28px;
    padding: 4px 8px 4px 6px;
}

.taskbar-apps {
    display: flex;
    align-items: center;
    gap: 3px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    margin-left: 4px;
}

/*
 * Taskbar buttons (Win95):
 * - not running: hidden
 * - running inactive / minimized: raised
 * - focused open: inset (.tb-active)
 */
.taskbar-window {
    display: none; /* default hidden; .tb-running shows it */
    align-items: center;
    background: #C0C0C0;
    border-top: 2px solid #FFF;
    border-left: 2px solid #FFF;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    padding: 1px 10px;
    height: 26px;
    min-width: 110px;
    max-width: 160px;
    font-size: 13px;
    cursor: pointer;
    box-sizing: border-box;
    overflow: hidden;
    white-space: nowrap;
    font-family: "W95FA", Arial, sans-serif;
    color: #000;
}

.taskbar-window.tb-running {
    display: flex;
}

.taskbar-window[hidden] {
    display: none !important;
}

.taskbar-window img {
    width: 18px;
    height: 18px;
    margin-right: 5px;
    image-rendering: pixelated;
    flex-shrink: 0;
}

.taskbar-window.tb-active {
    border-top: 2px solid #404040;
    border-left: 2px solid #404040;
    border-right: 2px solid #FFF;
    border-bottom: 2px solid #FFF;
    background: #D4D0C8;
    font-weight: bold;
}

.taskbar-time {
    margin-left: auto;
    margin-right: 4px;
    padding: 1px 10px;
    height: 26px;
    display: flex;
    align-items: center;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #FFF;
    border-bottom: 2px solid #FFF;
    font-size: 12px;
    box-sizing: border-box;
    background: #C0C0C0;
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 900px) {
    .desktop-nav {
        flex-direction: row;
        flex-wrap: wrap;
        width: auto;
        max-width: calc(100% - 12px);
        gap: 8px;
    }
    .desktop-programs {
        left: 4px;
        right: 4px;
        max-width: none;
        gap: 8px;
    }
    a.desktop-icon,
    button.desktop-icon {
        width: 70px;
        min-width: 70px;
    }
    .desktop-programs {
        left: 4px;
    }
    .exchange-folders { display: none; }
    body.checkin-desktop {
        overflow: auto;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        max-height: none !important;
    }
    /*
     * Mobile windows: full width, height capped, position set by JS centerWin()
     * (between .desktop-nav and taskbar). Do NOT pin top:8 — that covered the nav.
     */
    .win95-window:not(.minimized):not(.maximized) {
        max-width: calc(100vw - 16px);
        width: min(100%, calc(100vw - 16px)) !important;
        max-height: calc(100dvh - 100px - env(safe-area-inset-bottom, 0px));
        /* left/top applied by checkin-apps centerWin — no force-to-corner */
    }
    .win95-window.maximized {
        left: 4px !important;
        top: 4px !important;
        width: calc(100vw - 8px) !important;
        max-height: calc(100dvh - 42px - env(safe-area-inset-bottom, 0px));
    }
    /* Titlebar not draggable on narrow (pointer still works for buttons) */
    .win95-titlebar {
        cursor: default;
    }
    .wmp-body {
        flex-direction: column;
    }
    .wmp-playlist {
        flex: 0 0 auto;
        max-width: none;
        max-height: 160px;
        border-left: none;
        border-top: 2px solid #808080;
    }
}

@media (max-width: 480px) {
    .taskbar-window {
        min-width: 70px;
        max-width: 96px;
        font-size: 11px;
        padding: 1px 4px;
    }
    .win95-menubar { display: none; }
    .desktop-nav {
        left: 4px;
        top: 8px;
        width: auto;
    }
    .win95-window:not(.minimized):not(.maximized) {
        max-height: calc(100dvh - 96px - env(safe-area-inset-bottom, 0px));
    }
}
