/**
 * Landing page (index.html / pl.html): the portfolio as one maximized Win95
 * window, "Portfolio.exe", in the same colours, bevels and icons as PortfolioOS.
 * The page is generated by scripts/build-static.mjs and works without JavaScript;
 * js/home.js adds the filter, copy button, menu highlight, clock and form.
 */

:root {
    --gray: #C0C0C0;
    --light: #DFDFDF;
    --white: #FFFFFF;
    --dark: #808080;
    --black: #0A0A0A;
    --navy: #000080;
    --teal: #008080;
    --font: 'MS Sans Serif', 'Segoe UI', Tahoma, Geneva, sans-serif;
    --mono: 'Fixedsys', 'Lucida Console', 'Courier New', monospace;
    --taskbar: 36px;

    /* The four-line Win95 bevels */
    --raised: inset -1px -1px var(--black), inset 1px 1px var(--white), inset -2px -2px var(--dark), inset 2px 2px var(--light);
    --window: inset -1px -1px var(--black), inset 1px 1px var(--light), inset -2px -2px var(--dark), inset 2px 2px var(--white);
    --pressed: inset -1px -1px var(--white), inset 1px 1px var(--black), inset -2px -2px var(--light), inset 2px 2px var(--dark);
    --sunken: inset -1px -1px var(--white), inset 1px 1px var(--dark), inset -2px -2px var(--light), inset 2px 2px var(--black);
    --thin: inset -1px -1px var(--white), inset 1px 1px var(--dark);
    --checker: repeating-conic-gradient(var(--gray) 0 25%, var(--white) 0 50%) 0 0 / 2px 2px;

    /* What the colours are used for, so the dark look below only swaps values */
    --desk: var(--teal);
    --field: #FFFFFF;
    --ink: #000000;
    --ink-2: #202020;
    --ink-3: #404040;
    --ink-4: #505050;
    --disabled: #808080;
    --accent: var(--navy);
    --frame: #000000;
    --ok: #006000;
    --led: #00C000;
    --led-off: #006000;
    --led-ring: #004000;
    --error: #A00000;
    --note: #FFFFE1;
    --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 7' shape-rendering='crispEdges'%3E%3Cpath d='M6 0h1v2H6v1H5v1H4v1H3v1H2V5H1V4H0V2h1v1h1v1h1V3h1V2h1V1h1z'/%3E%3C/svg%3E");
    color-scheme: light;
}

/* Dark look, the default (same palette as the Dark theme in PortfolioOS). The switch
   in the tray sets data-theme="light"; printing always uses the light colours. */
@media screen {
    :root:not([data-theme="light"]) {
        --gray: #2D2D44;
        --light: #3D3D5C;
        --white: #55557A;
        --dark: #15151F;
        --black: #050508;
        --navy: #4A4A8A;
        --desk: #1A1A2E;
        --field: #1E1E33;
        --ink: #E6E6EF;
        --ink-2: #D0D0DC;
        --ink-3: #B8B8C8;
        --ink-4: #9E9EB4;
        --disabled: #70708A;
        --accent: #B7B8FF;
        --frame: #050508;
        --ok: #5FD35F;
        --led: #3CFF3C;
        --led-off: #1A7A1A;
        --led-ring: #062006;
        --error: #FF7A7A;
        --note: #3A3A22;
        --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 7' shape-rendering='crispEdges'%3E%3Cpath fill='%23E6E6EF' d='M6 0h1v2H6v1H5v1H4v1H3v1H2V5H1V4H0V2h1v1h1v1h1V3h1V2h1V1h1z'/%3E%3C/svg%3E");
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

/* Room for the sticky title bar + menu (about 57px) and the section legend that sticks out 11px above its frame */
html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
    margin: 0;
    padding: 14px 14px calc(var(--taskbar) + 14px);
    min-height: 100vh;
    background: var(--desk);
    color: var(--ink);
    font: 14px/1.5 var(--font);
}

::selection { background: var(--navy); color: #FFF; }

::-webkit-scrollbar { width: 16px; height: 16px; }
::-webkit-scrollbar-track { background: var(--checker); }
::-webkit-scrollbar-thumb, ::-webkit-scrollbar-button { background: var(--gray); box-shadow: var(--raised); }
::-webkit-scrollbar-button { width: 16px; height: 16px; }

a { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 1px dotted var(--ink); outline-offset: 1px; }

h1, h2, h3, h4, p { margin: 0; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico, .titlebar > svg, .btn > svg, .legend > svg, .start > svg, .task > svg { width: 16px; height: 16px; flex-shrink: 0; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; z-index: 50; padding: 6px 10px; background: var(--note); color: var(--ink); border: 1px solid var(--ink); }

/* ---------- Window ---------- */

.win {
    max-width: 1180px;
    margin: 0 auto;
    padding: 3px;
    background: var(--gray);
    box-shadow: var(--window), 4px 4px 0 rgb(0 0 0 / 0.25);
    animation: win-open 0.3s steps(6) both;
}

@keyframes win-open {
    from { clip-path: inset(0 100% 100% 0); }
    to { clip-path: inset(0 0 0 0); }
}

.titlebar {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 24px;
    padding: 0 3px 0 4px;
    background: var(--navy);
    color: #FFF;
    font-weight: bold;
    font-size: 13px;
}

.win > .titlebar { position: sticky; top: 0; z-index: 5; }

.titlebar-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.controls { display: flex; gap: 2px; }
.controls span {
    width: 18px;
    height: 16px;
    display: grid;
    place-items: center;
    background: var(--gray);
    color: var(--ink);
    box-shadow: var(--raised);
    font: bold 12px/1 var(--font);
}
.controls span:last-child:not(:first-child) { margin-left: 2px; }
.controls .min { padding-bottom: 5px; }

.menubar {
    position: sticky;
    top: 24px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 2px 2px 3px;
    background: var(--gray);
    border-bottom: 1px solid var(--dark);
    box-shadow: 0 1px 0 var(--white);
}

.menubar a {
    display: inline-block;
    padding: 2px 9px;
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
}

.menubar a:hover, .menubar a:focus-visible { background: var(--navy); color: #FFF; outline: none; }
.menubar a.is-active { box-shadow: var(--thin); }
.menubar u { text-underline-offset: 2px; }

.menubar-right { margin-left: auto; display: flex; gap: 2px; }
.menubar-right a { display: inline-flex; align-items: center; gap: 5px; }
.menubar-right svg { width: 18px; height: 12px; outline: 1px solid var(--dark); }
.menubar-right a[aria-current] { background: var(--checker); box-shadow: var(--thin); }
.menubar-right a[aria-current]:hover { background: var(--navy); }

.client {
    display: grid;
    gap: 24px;
    padding: 24px 12px 14px;
}

/* ---------- Group boxes ---------- */

.group {
    position: relative;
    min-width: 0;
    padding: 22px 14px 14px;
    border: 1px solid var(--dark);
    box-shadow: inset 1px 1px var(--white), 1px 1px var(--white);
}

.legend {
    position: absolute;
    top: -11px;
    left: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 6px;
    background: var(--gray);
    font-size: 14px;
    font-weight: bold;
    line-height: 20px;
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 28px;
    padding: 4px 14px;
    background: var(--gray);
    color: var(--ink);
    font: inherit;
    text-decoration: none;
    white-space: nowrap;
    border: 0;
    border-radius: 0;
    box-shadow: var(--raised);
    cursor: pointer;
}

.btn:active { box-shadow: var(--pressed); padding: 5px 13px 3px 15px; }
.btn:focus-visible { outline: 1px dotted var(--ink); outline-offset: -5px; }
.btn.default { box-shadow: 0 0 0 1px var(--frame), var(--raised); }
.btn.default:active { box-shadow: 0 0 0 1px var(--frame), var(--pressed); }
.btn:disabled { color: var(--disabled); text-shadow: 1px 1px var(--white); cursor: default; }
.btn:disabled:active { box-shadow: 0 0 0 1px var(--frame), var(--raised); padding: 4px 14px; }
.btn:disabled svg { opacity: 0.45; }
.btn.small { min-height: 22px; padding: 1px 9px; font-size: 12px; gap: 4px; }
.btn.small:active { padding: 2px 8px 0 10px; }
.btn.small .ico { width: 14px; height: 14px; }

/* ---------- About ---------- */

.about {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(250px, 320px);
    gap: 20px;
    align-items: start;
}

.avatar {
    margin: 0;
    padding: 14px 16px;
    background: #111;
    color: #00FF00;
    box-shadow: var(--sunken);
    font: 13px/1.15 'Courier New', monospace;
    text-shadow: 0 0 6px rgb(0 255 0 / 0.5);
}

.intro h1 { font-size: 30px; line-height: 1.15; }
.role { margin-top: 2px; color: var(--accent); font-weight: bold; }
.bio { margin-top: 10px; max-width: 62ch; color: var(--ink-2); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.props {
    padding: 10px 12px 12px;
    background: var(--field);
    box-shadow: var(--sunken);
    font-size: 13px;
}

.props h3 { margin-bottom: 8px; padding-bottom: 5px; border-bottom: 1px solid var(--gray); font-size: 13px; }
.props dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 10px; margin: 0; }
.props dt { color: var(--ink-3); }
.props dd { margin: 0; }

.status { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-weight: bold; }
.status i { width: 8px; height: 8px; background: var(--led); box-shadow: 0 0 0 1px var(--led-ring); animation: led 1.6s steps(1) infinite; }
@keyframes led { 50% { background: var(--led-off); } }

/* ---------- Projects (Explorer) ---------- */

.explorer { display: grid; gap: 4px; }

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 3px;
    box-shadow: var(--thin);
}

.chip {
    min-height: 24px;
    padding: 2px 10px;
    background: var(--gray);
    color: var(--ink);
    font: 13px var(--font);
    border: 0;
    border-radius: 0;
    cursor: pointer;
}

.chip:hover { box-shadow: inset 1px 1px var(--white), inset -1px -1px var(--dark); }
.chip[aria-pressed="true"] { background: var(--checker); box-shadow: var(--pressed); padding: 3px 9px 1px 11px; }
.chip small { font-size: inherit; opacity: .6; }
.chip:focus-visible { outline: 1px dotted var(--ink); outline-offset: -4px; }

.address {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.address code {
    flex: 1;
    min-width: 0;
    padding: 3px 8px;
    background: var(--field);
    box-shadow: var(--sunken);
    font: 13px var(--mono);
    white-space: nowrap;
    overflow: hidden;
}

.items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
    gap: 4px;
    padding: 8px;
    min-height: 120px;
    background: var(--field);
    box-shadow: var(--sunken);
}

.item {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 10px;
    padding: 10px 10px 10px 8px;
    border: 1px dotted transparent;
}

.item:hover, .item:focus-within { border-color: var(--navy); }
.item.is-out { display: none; }
.item.is-in { animation: appear 0.24s steps(3) both; }
@keyframes appear { from { opacity: 0; } }

.item-icon { position: relative; width: 36px; height: 36px; }
.item-icon .ico { width: 36px; height: 36px; }
.item:hover .item-icon .ico, .item:focus-within .item-icon .ico { filter: sepia(1) saturate(6) hue-rotate(190deg) brightness(0.6); }

.badge {
    position: absolute;
    right: -4px;
    bottom: -3px;
    color: #FFD700;
    font-size: 15px;
    line-height: 1;
    text-shadow: 1px 0 #000, -1px 0 #000, 0 1px #000, 0 -1px #000;
}

.item h3 { font-size: 15px; line-height: 1.3; }
.item h3 a { padding: 0 3px; margin-left: -3px; color: var(--ink); text-decoration: none; }
.item:hover h3 a, .item h3 a:focus-visible { background: var(--navy); color: #FFF; }
.item h3 a:focus-visible { outline: 1px dotted #FFF; outline-offset: -1px; }
.item p { margin-top: 3px; color: var(--ink-2); font-size: 13px; }

.item-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 6px; color: var(--ink-4); font-size: 12px; }
.lang { display: inline-flex; align-items: center; gap: 5px; }
.lang i { width: 9px; height: 9px; box-shadow: 0 0 0 1px var(--frame); }

.item-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.empty { grid-column: 1 / -1; margin: 24px 0; text-align: center; color: var(--disabled); }

.explorer-status { display: flex; gap: 2px; font-size: 12px; }
.explorer-status > * { padding: 1px 8px; box-shadow: var(--thin); }
.explorer-status > :first-child { flex: 1; }

/* ---------- Changelog ---------- */

.log {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.log-side { display: grid; gap: 18px; }

/* White sunken list box with a raised column header, like a Win95 list view */
.pane {
    padding: 2px;
    background: var(--field);
    box-shadow: var(--sunken);
}

.pane-head {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    background: var(--gray);
    box-shadow: var(--raised);
    font-size: 13px;
    font-weight: normal;
}

.list { margin: 0; padding: 2px 0; list-style: none; }

.entry {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 12px;
    padding: 8px 12px;
}

.entry + .entry { border-top: 1px dotted var(--gray); }

.date { color: var(--accent); font: 12px/1.9 var(--mono); }
.entry h4 { font-size: 14px; line-height: 1.35; }
.where { color: var(--ink-3); font-size: 13px; }
.entry p { margin-top: 4px; font-size: 13px; color: var(--ink-2); }

.tag {
    display: inline-block;
    margin-left: 4px;
    padding: 0 5px;
    background: var(--navy);
    color: #FFF;
    font-size: 11px;
    line-height: 16px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    vertical-align: 1px;
}

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 10px; list-style: none; }
.tags li { padding: 2px 9px; font-size: 13px; box-shadow: var(--raised); }

/* ---------- Contact ---------- */

.contact {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    gap: 22px;
    align-items: start;
}

.contact-info h3 { font-size: 20px; line-height: 1.25; }
.contact-info > p { margin-top: 6px; color: var(--ink-2); }

.contact-links {
    margin: 16px 0 0;
    padding: 4px 2px;
    list-style: none;
    font-size: 13px;
}

.contact-links li {
    display: grid;
    grid-template-columns: 16px 64px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 32px;
    padding: 2px 10px;
}

.contact-links li + li { border-top: 1px dotted var(--gray); }
.contact-links b { color: var(--ink-3); font-weight: normal; }
.contact-links li > a, .contact-links li > span { grid-column: 3; overflow-wrap: anywhere; }
.contact-links .btn { grid-column: 4; }

.dialog { padding: 3px; background: var(--gray); box-shadow: var(--window); }
.titlebar.small { height: 22px; }

.postcard { display: grid; gap: 10px; padding: 12px 10px 10px; }
.postcard .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.postcard label { display: grid; gap: 3px; font-size: 13px; }

.postcard input, .postcard select, .postcard textarea {
    width: 100%;
    padding: 5px 7px;
    background: var(--field);
    color: var(--ink);
    font: 14px var(--font);
    border: 0;
    border-radius: 0;
    box-shadow: var(--sunken);
}

.postcard input:focus, .postcard select:focus, .postcard textarea:focus { outline: 1px dotted var(--ink); outline-offset: -4px; }
.postcard textarea { min-height: 130px; resize: vertical; }

/* Subject picker (js/winSelect.js): the <select> stays in the form, hidden */
.postcard .win-select-native[hidden] { display: none !important; }

.win-select-picker {
    display: flex;
    align-items: stretch;
    gap: 4px;
    width: 100%;
    min-height: 32px;
    padding: 3px;
    background: var(--field);
    color: var(--ink);
    font: 14px var(--font);
    text-align: left;
    border: 0;
    border-radius: 0;
    box-shadow: var(--sunken);
    cursor: pointer;
}

.win-select-value {
    display: grid;
    flex: 1;
    min-width: 0;
    align-items: center;
    padding: 0 4px;
    border: 1px dotted transparent;
}

.win-select-current, .win-select-sizer > span {
    grid-area: 1 / 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.win-select-sizer { display: contents; }
.win-select-sizer > span { visibility: hidden; }

.win-select-arrow {
    position: relative;
    flex: none;
    width: 20px;
    background: var(--gray);
    color: var(--ink);
    box-shadow: var(--raised);
}

.win-select-arrow::before, .win-select-arrow::after {
    content: '';
    position: absolute;
    left: 50%;
    width: 7px;
    background: currentColor;
    transform: translateX(-50%);
}

.win-select-arrow::before { top: calc(50% - 4px); height: 4px; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.win-select-arrow::after { top: calc(50% + 2px); height: 1px; }

.win-select-picker:active .win-select-arrow, .win-select-picker.is-open .win-select-arrow { box-shadow: var(--pressed); }
.win-select-picker:active .win-select-arrow::before, .win-select-picker:active .win-select-arrow::after,
.win-select-picker.is-open .win-select-arrow::before, .win-select-picker.is-open .win-select-arrow::after { margin: 1px 0 0 1px; }

.win-select-picker:focus { outline: none; }
.win-select-picker:focus-visible .win-select-value, .win-select-picker.is-open .win-select-value {
    background: var(--navy);
    color: #FFF;
    border-color: var(--field);
}

.win-select-picker:disabled { color: var(--disabled); cursor: not-allowed; }

.win-select-list {
    position: fixed;
    z-index: 1000;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--field);
    color: var(--ink);
    border: 1px solid var(--frame);
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
    font: 14px/1.3 var(--font);
    user-select: none;
}

.win-select-list:focus { outline: none; }
.win-select-option { padding: 4px 26px 4px 8px; white-space: nowrap; cursor: default; }
.win-select-option[aria-selected="true"] { font-weight: bold; }
.win-select-option.is-active { background: var(--navy); color: #FFF; }
.win-select-option[aria-disabled="true"] { color: var(--disabled); }

@media screen {
    :root:not([data-theme="light"]) .win-select-list {
        border-color: var(--white);
        box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6);
    }
}

@media (pointer: coarse) {
    .win-select-picker { min-height: 40px; }
    .win-select-option { padding: 9px 26px 9px 10px; }
}

.hp { position: absolute; left: -9999px; }
.turnstile { max-width: 100%; overflow: hidden; }
.turnstile:empty { display: none; }

.form-note { color: var(--ink-3); font-size: 12px; }
.form-foot { display: flex; align-items: center; gap: 12px; }
.form-status { flex: 1; font-size: 13px; }
.form-status.is-error { color: var(--error); }
.form-foot .btn { min-width: 110px; }

html:not(.js) .postcard.needs-js { display: none; }
.no-js-note { margin: 0; padding: 12px; background: var(--note); box-shadow: var(--thin); font-size: 13px; }

/* Without JavaScript the PortfolioOS links open #no-js: this box slides down from
   the top, stays about five seconds and goes back up. Pure CSS (:target). */
.boot-error {
    position: fixed;
    top: 0;
    left: 50%;
    z-index: 60;
    width: min(460px, calc(100% - 16px));
    padding: 3px;
    background: var(--gray);
    color: var(--ink);
    box-shadow: var(--window), 4px 4px 0 rgb(0 0 0 / 0.35);
    transform: translate(-50%, -110%);
    visibility: hidden;
    outline: none;
}
.boot-error p { display: flex; align-items: center; gap: 12px; padding: 12px 10px 10px; font-size: 13px; }
.boot-error-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #C00000;
    color: #FFF;
    box-shadow: inset -2px -2px rgb(0 0 0 / 0.3), 1px 1px 0 #000;
    font: bold 24px/1 var(--font);
}
/* Every PortfolioOS link has a twin aimed at #no-js-again (see bootLink in the build
   script). Showing the other twin after each click makes the next click change the
   hash too, and the different animation name restarts the banner. */
html:not(:has(#no-js:target)) [data-boot-again],
html:not(.js):has(#no-js:target) a[data-boot]:not([data-boot-again]) { display: none !important; }
html:not(.js) .boot-error:target { animation: boot-error 5.6s steps(40) both; }
html:not(.js) .boot-error:has(#no-js-again:target) { animation: boot-error-again 5.6s steps(40) both; }
@keyframes boot-error {
    0% { transform: translate(-50%, -110%); visibility: visible; }
    5%, 94% { transform: translate(-50%, 8px); visibility: visible; }
    100% { transform: translate(-50%, -110%); visibility: hidden; }
}
@keyframes boot-error-again {
    0% { transform: translate(-50%, -110%); visibility: visible; }
    5%, 94% { transform: translate(-50%, 8px); visibility: visible; }
    100% { transform: translate(-50%, -110%); visibility: hidden; }
}

/* ---------- PortfolioOS ---------- */

.boot-row {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 22px;
    align-items: center;
}

.mini-desktop {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px 4px;
    padding: 16px 10px;
    background: var(--desk);
    box-shadow: var(--sunken);
    text-decoration: none;
}

.desk-icon { display: grid; justify-items: center; gap: 4px; color: #FFF; font-size: 12px; text-align: center; }
.desk-icon .ico { width: 32px; height: 32px; }
.desk-icon span { padding: 0 3px; border: 1px dotted transparent; }
.desk-icon:hover span { background: var(--navy); border-color: #FFFF80; }
.desk-icon:hover .ico { filter: sepia(1) saturate(6) hue-rotate(190deg) brightness(0.6); }
.mini-desktop:focus-visible { outline: 1px dotted var(--ink); outline-offset: 2px; }

.boot-text h3 { font-size: 18px; }
.boot-text p { margin: 6px 0 14px; color: var(--ink-2); }

/* ---------- Legal pages: a property sheet with tabs ---------- */

.legal-sheet { padding: 14px; }

.tabs { display: flex; flex-wrap: wrap; padding-left: 2px; }

.tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
    padding: 3px 12px 4px;
    background: var(--gray);
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
    box-shadow: inset 1px 1px var(--white), inset -1px 0 var(--black), inset -2px 0 var(--dark);
}

/* The open tab is taller and covers the top edge of the sheet below it */
.tab[aria-current] {
    position: relative;
    z-index: 1;
    margin: 0 -2px -2px;
    padding: 4px 14px 7px;
    font-weight: bold;
}

.tab:focus-visible { outline: 1px dotted var(--ink); outline-offset: -4px; }

.sheet { padding: 12px; background: var(--gray); box-shadow: var(--window); }

.doc {
    padding: 24px 28px 28px;
    background: var(--field);
    box-shadow: var(--sunken);
    color: var(--ink-2);
}

.doc h1 { color: var(--ink); font-size: 26px; line-height: 1.2; }
.updated { margin-top: 4px; color: var(--ink-4); font-size: 13px; }
.doc p, .doc ul { max-width: 78ch; }
.doc p + p, .doc > p, .doc-section > p:first-of-type, .doc-section > ul { margin-top: 10px; }
.doc ul { margin-bottom: 0; padding-left: 22px; }
.doc li + li { margin-top: 5px; }
.doc code { font: 12px var(--mono); overflow-wrap: anywhere; }

.toc {
    max-width: 78ch;
    margin-top: 18px;
    padding: 8px 14px 10px;
    background: var(--light);
    box-shadow: var(--thin);
    font-size: 13px;
}

.toc ol { margin: 0; padding-left: 22px; columns: 2; column-gap: 28px; }
.toc li { break-inside: avoid; }

.doc-section { margin-top: 24px; }
.doc-section h2 { max-width: 78ch; padding-bottom: 4px; border-bottom: 1px solid var(--gray); color: var(--accent); font-size: 17px; line-height: 1.3; }

.table-wrap { margin-top: 12px; padding: 2px; overflow-x: auto; box-shadow: var(--sunken); }
.list-view { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 13px; }
.list-view th { padding: 3px 8px; background: var(--gray); box-shadow: var(--raised); font-weight: normal; text-align: left; white-space: nowrap; }
.list-view td { padding: 6px 8px; border-top: 1px dotted var(--gray); vertical-align: top; }
.list-view tr:first-child td { border-top: 0; }

.storage { max-width: 78ch; margin-top: 14px; }
.storage-nojs, .storage-ui { padding: 10px 12px; font-size: 13px; }
html.js .storage-nojs { display: none; }

.check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.check input {
    flex-shrink: 0;
    width: 13px;
    height: 13px;
    margin: 3px 0 0;
    appearance: none;
    background: var(--field);
    box-shadow: var(--sunken);
    cursor: pointer;
}
.check input:checked { background: var(--field) var(--check) center / 7px 7px no-repeat; }
.check input:focus-visible { outline: 1px dotted var(--ink); outline-offset: 2px; }

.storage-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-top: 10px; }
.storage-status { margin-top: 8px; color: var(--ink-3); }
.storage-status:empty { display: none; }

.sheet-foot { display: flex; justify-content: flex-end; margin-top: 12px; }

/* ---------- Status bar + taskbar ---------- */

.statusbar { display: flex; gap: 2px; padding: 2px 0 0; font-size: 12px; }
.statusbar span { padding: 1px 8px; box-shadow: var(--thin); white-space: nowrap; }
.statusbar span:first-child { flex: 1; }
.statusbar a { color: var(--ink); }
.statusbar a[aria-current] { color: var(--accent); font-weight: bold; text-decoration: none; }
.statusbar .legal a + a::before { content: '\00B7'; display: inline-block; margin: 0 6px; color: var(--disabled); }

.taskbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 4px;
    height: var(--taskbar);
    padding: 4px 3px 3px;
    background: var(--gray);
    box-shadow: inset 0 1px var(--light), inset 0 2px var(--white);
    font-size: 13px;
}

.start, .task {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 100%;
    padding: 0 8px;
    color: var(--ink);
    text-decoration: none;
    box-shadow: var(--raised);
}

.start:active { box-shadow: var(--pressed); }
.task { min-width: 0; max-width: 200px; flex: 0 1 200px; background: var(--checker); box-shadow: var(--pressed); font-weight: bold; }
.task span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tray {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    padding: 0 12px;
    box-shadow: var(--thin);
    font-variant-numeric: tabular-nums;
}

.tray-btn {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    margin-left: -6px;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
}

.tray-btn:hover { box-shadow: var(--thin); }
.tray-btn:active { box-shadow: inset 1px 1px var(--dark), inset -1px -1px var(--white); }
.tray-btn:focus-visible { outline: 1px dotted var(--ink); outline-offset: -2px; }
.tray-btn svg { width: 16px; height: 16px; }
.tray-btn .ico-sun, [data-theme="light"] .tray-btn .ico-moon { display: none; }
[data-theme="light"] .tray-btn .ico-sun { display: block; }

/* ---------- Small screens ---------- */

@media (max-width: 980px) {
    .about { grid-template-columns: auto minmax(0, 1fr); }
    .props { grid-column: 1 / -1; }
    .log, .contact, .boot-row { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    body { padding: 0 0 var(--taskbar); }
    .win { max-width: none; min-height: calc(100vh - var(--taskbar)); box-shadow: var(--window); }
    .titlebar-text { font-size: 12px; }
    .win > .titlebar .controls span:not(:last-child) { display: none; }
    .menubar { overflow-x: auto; scrollbar-width: none; }
    .menubar::-webkit-scrollbar { display: none; }
    .menubar a { padding: 3px 6px; }
    .menubar-right a { font-size: 0; }
    .client { padding: 22px 6px 10px; gap: 22px; }
    .group { padding: 20px 8px 10px; }
    .about { grid-template-columns: 1fr; gap: 14px; }
    .avatar { justify-self: start; font-size: 11px; padding: 10px 12px; }
    .intro h1 { font-size: 26px; }
    .actions .btn { flex: 1 1 auto; }
    .items { padding: 4px; }
    .item { padding: 8px 6px; }
    .entry { grid-template-columns: 1fr; gap: 2px; padding: 8px 10px; }
    .contact-links li { gap: 8px; padding: 2px 6px; }
    .date { line-height: 1.5; }
    .postcard { padding: 10px 6px 8px; }
    .postcard .two { grid-template-columns: 1fr; }
    .mini-desktop { gap: 12px 2px; padding: 12px 4px; }
    .desk-icon { font-size: 11px; }
    .statusbar .copy { display: none; }
    .legal-sheet { padding: 8px 6px; }
    .tab { padding: 3px 8px 4px; }
    .tab[aria-current] { padding: 4px 10px 7px; }
    .tab .ico { display: none; }
    .sheet { padding: 6px; }
    .doc { padding: 16px 12px 20px; }
    .doc h1 { font-size: 22px; }
    .toc ol { columns: 1; }
    .sheet-foot .btn { flex: 1; }
    .task { flex-basis: 150px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .win, .item.is-in, .status i { animation: none; }
    html:not(.js) .boot-error:target { animation-name: boot-error-still; animation-timing-function: linear; }
    html:not(.js) .boot-error:has(#no-js-again:target) { animation-name: boot-error-still-again; animation-timing-function: linear; }
    @keyframes boot-error-still-again {
        0%, 99% { transform: translate(-50%, 8px); visibility: visible; }
        100% { transform: translate(-50%, 8px); visibility: hidden; }
    }
    @keyframes boot-error-still {
        0%, 99% { transform: translate(-50%, 8px); visibility: visible; }
        100% { transform: translate(-50%, 8px); visibility: hidden; }
    }
}

@media print {
    body { background: #FFF; padding: 0; }
    .win { box-shadow: none; animation: none; }
    .taskbar, .menubar, .skip, .controls, .dialog, .boot, .item-actions, .filter, .tabs, .toc, .storage, .sheet-foot, .statusbar { display: none !important; }
    .sheet, .doc, .table-wrap { padding: 0; box-shadow: none; }
    .titlebar { position: static; }
}
