/* ==========================================================
   Jamari Benologa: desktop edition
   ========================================================== */

:root {
    --menubar-h: 28px;
    --dock-reserve: 88px;          /* space kept free for the dock (read by desktop.js) */

    --accent: #8b4fd8;
    --accent-text: #ffffff;
    --focus: #8b4fd8;

    --text: #1d1b22;
    --muted: #6c6677;
    --line: rgba(0, 0, 0, 0.08);

    --win-bg: rgba(248, 246, 251, 0.9);
    --win-solid: #f8f6fb;
    --pane: #ffffff;
    --sidebar: rgba(236, 231, 244, 0.7);
    --titlebar: rgba(240, 236, 246, 0.92);
    --win-border: rgba(0, 0, 0, 0.16);
    --shadow: 0 24px 64px rgba(24, 10, 48, 0.4), 0 2px 8px rgba(24, 10, 48, 0.18);
    --shadow-idle: 0 12px 34px rgba(24, 10, 48, 0.24);

    --bar-bg: rgba(255, 255, 255, 0.5);
    --bar-text: #15131a;
    --bar-hover: rgba(0, 0, 0, 0.08);
    --dock-bg: rgba(255, 255, 255, 0.3);
    --dock-border: rgba(255, 255, 255, 0.4);

    --chip-bg: rgba(139, 79, 216, 0.1);
    --chip-border: rgba(139, 79, 216, 0.35);
    --chip-text: #5b2ea3;

    --btn-bg: #ffffff;
    --btn-border: rgba(0, 0, 0, 0.14);
    --btn-hover: #f3eff9;
    --select: rgba(139, 79, 216, 0.14);
    --light-idle: #cdcad2;

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Dark theme: follows the system unless Settings picks Light or Dark (data-theme on <html>). */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --accent: #b98ae6;
        --accent-text: #1a1320;
        --focus: #cc9ee0;

        --text: #ece8f2;
        --muted: #a39cb0;
        --line: rgba(255, 255, 255, 0.08);

        --win-bg: rgba(34, 30, 42, 0.88);
        --win-solid: #221e2a;
        --pane: #1a1720;
        --sidebar: rgba(44, 38, 54, 0.7);
        --titlebar: rgba(46, 40, 56, 0.92);
        --win-border: rgba(255, 255, 255, 0.12);

        --bar-bg: rgba(22, 18, 30, 0.45);
        --bar-text: #f3f0f7;
        --bar-hover: rgba(255, 255, 255, 0.12);
        --dock-bg: rgba(30, 24, 40, 0.38);
        --dock-border: rgba(255, 255, 255, 0.14);

        --chip-bg: rgba(204, 158, 224, 0.14);
        --chip-border: rgba(204, 158, 224, 0.4);
        --chip-text: #e3cdef;

        --btn-bg: rgba(255, 255, 255, 0.08);
        --btn-border: rgba(255, 255, 255, 0.14);
        --btn-hover: rgba(255, 255, 255, 0.14);
        --select: rgba(204, 158, 224, 0.2);
        --light-idle: #5a5563;
    }
}

:root[data-theme="dark"] {
    --accent: #b98ae6;
    --accent-text: #1a1320;
    --focus: #cc9ee0;

    --text: #ece8f2;
    --muted: #a39cb0;
    --line: rgba(255, 255, 255, 0.08);

    --win-bg: rgba(34, 30, 42, 0.88);
    --win-solid: #221e2a;
    --pane: #1a1720;
    --sidebar: rgba(44, 38, 54, 0.7);
    --titlebar: rgba(46, 40, 56, 0.92);
    --win-border: rgba(255, 255, 255, 0.12);

    --bar-bg: rgba(22, 18, 30, 0.45);
    --bar-text: #f3f0f7;
    --bar-hover: rgba(255, 255, 255, 0.12);
    --dock-bg: rgba(30, 24, 40, 0.38);
    --dock-border: rgba(255, 255, 255, 0.14);

    --chip-bg: rgba(204, 158, 224, 0.14);
    --chip-border: rgba(204, 158, 224, 0.4);
    --chip-text: #e3cdef;

    --btn-bg: rgba(255, 255, 255, 0.08);
    --btn-border: rgba(255, 255, 255, 0.14);
    --btn-hover: rgba(255, 255, 255, 0.14);
    --select: rgba(204, 158, 224, 0.2);
    --light-idle: #5a5563;
}

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

html, body {
    margin: 0;
    height: 100%;
}

body {
    overflow: hidden;
    background: #24123d;
    color: var(--text);
    font-size: 13px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; }
a { color: var(--accent); }
img { max-width: 100%; }

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.gl {
    width: 1em;
    height: 1em;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: none;
}

.muted { color: var(--muted); }
.show-phone { display: none; }

.noscript {
    position: fixed;
    z-index: 30000;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    padding: 10px 16px;
    border-radius: 10px;
    background: #fff;
    color: #1d1b22;
}

/* Monogram used by the menu bar and boot screen */
.mono {
    display: inline-grid;
    place-items: center;
    background: linear-gradient(135deg, #d9aef0, #7b4fe0);
    color: #fff;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
}
.mono-sm { width: 22px; height: 16px; border-radius: 5px; font-size: 9.5px; }
.mono-lg { width: 88px; height: 88px; border-radius: 24px; font-size: 34px; box-shadow: 0 14px 40px rgba(123, 79, 224, 0.5); }

/* ---------- Boot screen ---------- */

.boot {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: grid;
    place-items: center;
    background: #120a1f;
    color: #fff;
    transition: opacity 0.4s ease;
    cursor: default;
}
.no-js .boot,
.booted .boot { display: none; }
.boot.done { opacity: 0; pointer-events: none; }

.boot-inner {
    display: grid;
    justify-items: center;
    gap: 22px;
}
.boot-name {
    font-size: 13px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    opacity: 0.8;
}
.boot-bar {
    width: 180px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.16);
    overflow: hidden;
}
.boot-bar span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: #fff;
    animation: boot-fill var(--boot-ms, 1400ms) cubic-bezier(0.5, 0, 0.3, 1) forwards;
}
.boot-skip {
    position: absolute;
    bottom: calc(28px + env(safe-area-inset-bottom));
    font-size: 12px;
    opacity: 0.45;
}
@keyframes boot-fill { to { width: 100%; } }

/* ---------- Wallpaper / desktop ---------- */

/* Wallpapers (picked in Settings; stored as data-wallpaper on <html>) */
:root {
    --wp-aurora:
        radial-gradient(55% 65% at 12% 18%, rgba(214, 160, 236, 0.85), transparent 62%),
        radial-gradient(50% 60% at 88% 22%, rgba(118, 88, 255, 0.75), transparent 62%),
        radial-gradient(65% 55% at 72% 92%, rgba(255, 138, 190, 0.55), transparent 62%),
        radial-gradient(60% 60% at 18% 96%, rgba(58, 38, 140, 0.9), transparent 62%),
        linear-gradient(160deg, #3b1d66, #1c1034);
    --wp-sunset:
        radial-gradient(60% 60% at 18% 18%, rgba(255, 190, 110, 0.9), transparent 62%),
        radial-gradient(55% 60% at 86% 24%, rgba(255, 96, 140, 0.8), transparent 62%),
        radial-gradient(70% 60% at 62% 96%, rgba(124, 58, 237, 0.75), transparent 62%),
        linear-gradient(160deg, #f0845c, #52246f);
    --wp-ocean:
        radial-gradient(60% 60% at 15% 20%, rgba(56, 189, 248, 0.75), transparent 62%),
        radial-gradient(55% 60% at 85% 25%, rgba(99, 102, 241, 0.7), transparent 62%),
        radial-gradient(70% 60% at 70% 95%, rgba(20, 184, 166, 0.6), transparent 62%),
        linear-gradient(160deg, #0f4a70, #0b1733);
    --wp-forest:
        radial-gradient(60% 60% at 15% 20%, rgba(134, 239, 172, 0.55), transparent 62%),
        radial-gradient(55% 60% at 85% 25%, rgba(16, 185, 129, 0.6), transparent 62%),
        radial-gradient(70% 60% at 70% 95%, rgba(250, 204, 21, 0.3), transparent 62%),
        linear-gradient(160deg, #1d6b3e, #062b1b);
    --wp-midnight:
        radial-gradient(50% 55% at 20% 20%, rgba(99, 102, 241, 0.35), transparent 62%),
        radial-gradient(50% 55% at 80% 85%, rgba(236, 72, 153, 0.25), transparent 62%),
        linear-gradient(160deg, #15152a, #07070f);
    --wp-classic: #161415 url("/brett-ritchie-S0c_wsCmlXE-unsplash.jpg") center / cover no-repeat;
}

.desktop {
    position: fixed;
    inset: 0;
    overflow: hidden;
    background: var(--wp-aurora);
}
[data-wallpaper="sunset"] .desktop   { background: var(--wp-sunset); }
[data-wallpaper="ocean"] .desktop    { background: var(--wp-ocean); }
[data-wallpaper="forest"] .desktop   { background: var(--wp-forest); }
[data-wallpaper="midnight"] .desktop { background: var(--wp-midnight); }
[data-wallpaper="classic"] .desktop  { background: var(--wp-classic); }

.wallpaper-title {
    position: absolute;
    top: 42%;
    left: 50%;
    width: min(90vw, 900px);
    transform: translate(-50%, -50%);
    text-align: center;
    color: #fff;
    text-shadow: 0 2px 24px rgba(20, 6, 40, 0.35);
    pointer-events: none;
    user-select: none;
}
.wallpaper-title h1 {
    margin: 0;
    font-size: clamp(40px, 6.4vw, 88px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.02;
}
.wallpaper-title .role {
    margin: 10px 0 0;
    font-size: clamp(16px, 1.6vw, 22px);
    opacity: 0.9;
}
.wallpaper-title .hint {
    margin: 18px 0 0;
    font-size: 13px;
    opacity: 0.7;
}

/* ---------- Menu bar ---------- */

.menubar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9500;
    height: var(--menubar-h);
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bar-bg);
    color: var(--bar-text);
    -webkit-backdrop-filter: blur(24px) saturate(1.6);
    backdrop-filter: blur(24px) saturate(1.6);
    font-size: 13px;
    user-select: none;
}
.menubar-left,
.menubar-right {
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
}
.menubar-btn {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 9px;
    border: 0;
    border-radius: 5px;
    background: none;
    color: inherit;
    text-decoration: none;
    cursor: default;
    white-space: nowrap;
}
.menubar-btn:hover,
.menubar-btn[aria-expanded="true"] { background: var(--bar-hover); }
.classic-link { font-weight: 600; }
.active-app {
    padding: 0 9px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.clock {
    padding: 0 9px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.menu { position: relative; }
.dropdown {
    position: absolute;
    top: calc(100% + 3px);
    left: 0;
    min-width: 220px;
    margin: 0;
    padding: 5px;
    list-style: none;
    background: var(--win-bg);
    color: var(--text);
    -webkit-backdrop-filter: blur(30px) saturate(1.6);
    backdrop-filter: blur(30px) saturate(1.6);
    border: 1px solid var(--win-border);
    border-radius: 9px;
    box-shadow: var(--shadow);
}
.dropdown button,
.dropdown a {
    display: block;
    width: 100%;
    padding: 4px 10px;
    border: 0;
    border-radius: 5px;
    background: none;
    color: inherit;
    text-align: left;
    text-decoration: none;
    cursor: default;
}
.dropdown button:hover,
.dropdown a:hover,
.dropdown button:focus-visible,
.dropdown a:focus-visible {
    background: var(--accent);
    color: var(--accent-text);
    outline: none;
}
.dropdown .sep {
    height: 1px;
    margin: 5px 8px;
    background: var(--line);
}

/* ---------- Desktop icons ---------- */

.desk-icons {
    position: fixed;
    top: calc(var(--menubar-h) + 12px);
    right: 12px;
    bottom: var(--dock-reserve);
    z-index: 1;
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(auto-fill, 94px);
    grid-auto-columns: 92px;
    gap: 4px;
    direction: rtl;               /* first column sits on the right, like a Mac */
}
.desk-icons li { direction: ltr; }

.desk-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    width: 92px;
    padding: 6px 2px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: #fff;
    text-decoration: none;
    cursor: default;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.desk-icon .app-icon {
    width: 54px;
    height: 54px;
    font-size: 30px;
    border-radius: 13px;
}
.desk-icon .label {
    max-width: 100%;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.25;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    overflow-wrap: anywhere;
}
.desk-icon.selected .app-icon { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35); }
.desk-icon.selected .label {
    background: var(--accent);
    color: var(--accent-text);
    text-shadow: none;
}

/* App icon tiles (glyphs are drawn in the sprite in index.html) */
.app-icon {
    display: inline-grid;
    place-items: center;
    flex: none;
    border-radius: 22%;
    color: #fff;
    box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.35), 0 4px 10px rgba(20, 8, 40, 0.28);
    overflow: hidden;
}
.app-icon .gl { width: 58%; height: 58%; stroke-width: 1.9; }
.app-icon img { width: 100%; height: 100%; object-fit: cover; }
.ic-about      { background: linear-gradient(145deg, #d6a4f0, #8a4fdb); }
.ic-experience { background: linear-gradient(145deg, #ffc46b, #ea7a26); }
.ic-projects   { background: linear-gradient(145deg, #79b4ff, #4a5ee0); }
.ic-resume     { background: linear-gradient(145deg, #ff8c8c, #d93c62); }
.ic-snake      { background: linear-gradient(145deg, #5ee08e, #169a4d); }
.ic-astar      { background: linear-gradient(145deg, #5fd6e0, #3a6fd8); }
.ic-triage     { background: linear-gradient(145deg, #ff9a8a, #c2398f); }
.ic-contact    { background: linear-gradient(145deg, #7fd0ff, #2f8ef0); }
.ic-classic    { background: linear-gradient(145deg, #b9b3c4, #6b6478); }
.ic-linkedin   { background: linear-gradient(145deg, #3f9ae0, #1664b8); }
.ic-github     { background: linear-gradient(145deg, #5a5566, #25222c); }
.ic-browser    { background: linear-gradient(145deg, #6fe0ff, #2b7de9); }
.ic-terminal   { background: linear-gradient(145deg, #4a4556, #16141c); }
.ic-notes      { background: linear-gradient(145deg, #ffe07a, #f2a93b); }
.ic-calculator { background: linear-gradient(145deg, #ffa25c, #e4572e); }
.ic-settings   { background: linear-gradient(145deg, #aab4c8, #5d6880); }
.ic-wiki       { background: linear-gradient(145deg, #f4f4f5, #b8b8c0); color: #222; }
.ic-map        { background: linear-gradient(145deg, #8fe39a, #3aa15a); }
.ic-google     { background: linear-gradient(145deg, #ffffff, #dfe3ea); color: #3b6fe0; }
.desk-icons li[data-phone-only] { display: none; }

/* ---------- Dock ---------- */

.dock {
    position: fixed;
    left: 50%;
    bottom: 8px;
    z-index: 9000;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: calc(100vw - 16px);
    padding: 6px 8px;
    background: var(--dock-bg);
    -webkit-backdrop-filter: blur(24px) saturate(1.7);
    backdrop-filter: blur(24px) saturate(1.7);
    border: 1px solid var(--dock-border);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(10, 4, 24, 0.28);
}
.dock ul {
    display: flex;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.dock-min:empty { display: none; }
.dock-sep {
    align-self: stretch;
    width: 1px;
    margin: 4px 2px;
    background: rgba(255, 255, 255, 0.35);
}
.dock {
    --dock-icon: clamp(34px, calc((100vw - 160px) / 16), 52px);
}
.dock-btn {
    position: relative;
    display: block;
    width: var(--dock-icon);
    height: var(--dock-icon);
    padding: 0;
    border: 0;
    border-radius: 13px;
    background: none;
    cursor: default;
    transition: transform 0.16s ease;
    -webkit-tap-highlight-color: transparent;
}
.dock-btn .app-icon {
    width: 100%;
    height: 100%;
    border-radius: 25%;
    font-size: 30px;
}
.dock-btn:hover { transform: translateY(-5px); }
.dock-btn .tip {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    padding: 3px 9px;
    border-radius: 6px;
    background: var(--win-solid);
    color: var(--text);
    border: 1px solid var(--win-border);
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s;
}
.dock-btn:hover .tip,
.dock-btn:focus-visible .tip { opacity: 1; }
.dock-btn.running::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 4px;
    height: 4px;
    margin-left: -2px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}

/* ---------- Windows ---------- */

.window {
    position: fixed;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--win-bg);
    -webkit-backdrop-filter: blur(28px) saturate(1.5);
    backdrop-filter: blur(28px) saturate(1.5);
    border: 1px solid var(--win-border);
    border-radius: 12px;
    box-shadow: var(--shadow-idle);
    color: var(--text);
    font-size: 14px;
}
.window:focus { outline: none; }
.window.focused { box-shadow: var(--shadow); }
.window.minimized {
    visibility: hidden;
    pointer-events: none;
}
.window.maximized {
    left: 0 !important;
    top: var(--menubar-h) !important;
    width: 100% !important;
    height: calc(100% - var(--menubar-h) - var(--dock-reserve)) !important;
    border-radius: 0 0 12px 12px;
}
.window.maximized .titlebar { border-radius: 0; }
.window.animating { transition: left 0.22s ease, top 0.22s ease, width 0.22s ease, height 0.22s ease; }

.titlebar {
    position: relative;
    flex: none;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    height: 40px;
    padding: 0 12px;
    background: var(--titlebar);
    border-bottom: 1px solid var(--line);
    border-radius: 11px 11px 0 0;
    touch-action: none;
    user-select: none;
    cursor: default;
}
.win-title {
    grid-column: 2;
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.window:not(.focused) .win-title { color: var(--muted); }

.lights {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    gap: 8px;
}
.light {
    display: grid;
    place-items: center;
    width: 13px;
    height: 13px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: rgba(0, 0, 0, 0.55);
    cursor: default;
    box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.2);
}
.light .gl { width: 9px; height: 9px; stroke-width: 1.6; opacity: 0; }
.lights:hover .light .gl,
.light:focus-visible .gl { opacity: 1; }
.l-close { background: #ff5f57; }
.l-min   { background: #febc2e; }
.l-max   { background: #2bc840; }
.window:not(.focused) .lights:not(:hover) .light { background: var(--light-idle); }

.back {
    display: none;
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    align-items: center;
    gap: 2px;
    padding: 6px 8px 6px 2px;
    border: 0;
    background: none;
    color: var(--accent);
    font-size: 15px;
}
.back .gl { width: 20px; height: 20px; stroke-width: 2.2; }

.title-actions {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    display: flex;
    gap: 2px;
}
.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--muted);
    font-size: 17px;
    cursor: default;
}
.icon-btn:hover { background: var(--btn-hover); color: var(--text); }

.win-body {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    border-radius: 0 0 11px 11px;
    container-type: inline-size;
}
.win-body.split { overflow: hidden; }

.win-body,
.exp-list,
.exp-pane {
    scrollbar-width: thin;
    scrollbar-color: rgba(128, 120, 140, 0.45) transparent;
}
.win-body.frame {
    overflow: hidden;
    background: var(--pane);
}
.win-body iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}
.pdf-fallback { display: none; }

/* While dragging or resizing, iframes must not swallow the pointer. */
body.dragging iframe { pointer-events: none; }
body.dragging { user-select: none; }

/* Resize handles (added by desktop.js) */
.rz { position: absolute; z-index: 2; }
.rz-n, .rz-s { left: 8px; right: 8px; height: 8px; cursor: ns-resize; }
.rz-e, .rz-w { top: 8px; bottom: 8px; width: 8px; cursor: ew-resize; }
.rz-n { top: -4px; }
.rz-s { bottom: -4px; }
.rz-e { right: -4px; }
.rz-w { left: -4px; }
.rz-ne, .rz-nw, .rz-se, .rz-sw { width: 14px; height: 14px; }
.rz-ne { top: -4px; right: -4px; cursor: nesw-resize; }
.rz-sw { bottom: -4px; left: -4px; cursor: nesw-resize; }
.rz-nw { top: -4px; left: -4px; cursor: nwse-resize; }
.rz-se { bottom: -4px; right: -4px; cursor: nwse-resize; }
.window.maximized .rz { display: none; }

/* ---------- Shared content pieces ---------- */

.pad { padding: 22px 26px 26px; }

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 5px 14px;
    border: 1px solid var(--btn-border);
    border-radius: 8px;
    background: var(--btn-bg);
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}
.btn:hover { background: var(--btn-hover); }
.btn .gl { font-size: 15px; }
.btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-text);
}
.btn.primary:hover { filter: brightness(1.08); }

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.chips li {
    padding: 3px 11px;
    border: 1px solid var(--chip-border);
    border-radius: 999px;
    background: var(--chip-bg);
    color: var(--chip-text);
    font-size: 12.5px;
}

.section-label {
    margin: 24px 0 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

/* About */
.about-head {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
}
.about-head img {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    object-fit: cover;
    flex: none;
    box-shadow: 0 0 0 3px var(--pane), 0 0 0 4px var(--line);
}
.about-head h3 { margin: 0; font-size: 22px; letter-spacing: -0.01em; }
.about-head p { margin: 2px 0 0; }
.about p { line-height: 1.6; }

.facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 20px;
    margin: 0;
}
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 1px 0 0; overflow-wrap: anywhere; }
.skill-group + .skill-group { margin-top: 14px; }
.skill-group h5 { margin: 0 0 8px; font-size: 13px; font-weight: 600; }

@container (max-width: 520px) {
    .about-head { flex-direction: column; text-align: center; }
    .about-head .btn-row { justify-content: center; }
    .facts { grid-template-columns: 1fr; }
    .pad { padding: 18px; }
}

/* Experience */
.exp {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    height: 100%;
}
.exp-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 8px;
    overflow: auto;
    background: var(--sidebar);
    border-right: 1px solid var(--line);
}
.exp-group {
    margin: 10px 8px 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
.exp-group:first-child { margin-top: 2px; }
.exp-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 7px 8px;
    border: 0;
    border-radius: 7px;
    background: none;
    text-align: left;
    cursor: default;
}
.exp-tab:hover { background: var(--btn-hover); }
.exp-tab[aria-selected="true"] { background: var(--select); }
.exp-tab img {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    object-fit: cover;
    background: #fff;
    flex: none;
}
.exp-tab span { display: grid; min-width: 0; }
.exp-tab strong { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exp-tab small { font-size: 11.5px; color: var(--muted); }
.exp-pane {
    overflow: auto;
    overscroll-behavior: contain;
    padding: 24px 28px;
    background: var(--pane);
}
.exp-entry header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}
.exp-entry header img {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 0 0 1px var(--line);
    flex: none;
}
.exp-entry h3 { margin: 0; font-size: 20px; }
.exp-entry .role-line { margin: 2px 0 0; font-weight: 600; }
.exp-entry .muted { margin: 2px 0 0; font-size: 13px; }
.exp-entry ul { margin: 0; padding-left: 20px; }
.exp-entry li { margin: 0 0 10px; line-height: 1.55; }
.exp-entry p { line-height: 1.6; }

@container (max-width: 600px) {
    .exp { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
    .exp-list {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 8px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
    .exp-group { display: none; }
    .exp-tab { width: auto; flex: none; }
    .exp-tab small { display: none; }
    .exp-pane { padding: 18px; }
}

/* Projects folder */
.folder-meta {
    margin: 0;
    padding: 10px 20px;
    font-size: 12px;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
}
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    margin: 0;
    padding: 16px 18px 22px;
    list-style: none;
}
.project-item {
    display: grid;
    gap: 8px;
    width: 100%;
    padding: 8px;
    border: 0;
    border-radius: 10px;
    background: none;
    text-align: center;
    cursor: pointer;
}
.project-item:hover { background: var(--select); }
.project-item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
    background: var(--pane);
    box-shadow: 0 0 0 1px var(--line), 0 4px 12px rgba(20, 8, 40, 0.12);
}
.project-item span { font-size: 13px; font-weight: 500; }

/* Project detail */
.project-hero {
    display: block;
    width: 100%;
    height: 240px;
    object-fit: cover;
    border-bottom: 1px solid var(--line);
    background: var(--pane);
}
.project p { line-height: 1.6; }
.project .chips { margin-bottom: 4px; }

@container (max-width: 520px) {
    .project-hero { height: 190px; }
}

/* Resume fallback */
.pdf-fallback {
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 24px;
    text-align: center;
}
.pdf-fallback .app-icon { width: 72px; height: 72px; border-radius: 18px; font-size: 40px; }
.pdf-fallback p { margin: 10px 0 0; }

/* Contact */
.contact h3 { margin: 0 0 16px; font-size: 20px; }
.contact-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.contact-list li {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-right: 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--pane);
}
.contact-list a {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    border-radius: 12px;
    color: var(--text);
    text-decoration: none;
}
.contact-list a:hover strong { color: var(--accent); }
.contact-list .app-icon { width: 40px; height: 40px; border-radius: 10px; font-size: 22px; }
.contact-list a > span:last-child { display: grid; min-width: 0; }
.contact-list .muted { font-size: 13px; overflow-wrap: anywhere; }
.copy-status { min-height: 1.4em; margin: 10px 0 0; font-size: 13px; }

/* ---------- Browser ---------- */

.win-body.browser {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--pane);
}
.br-tabs {
    flex: none;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    padding: 6px 8px 0;
    overflow-x: auto;
    scrollbar-width: none;
    background: var(--titlebar);
}
.br-tab {
    display: flex;
    align-items: center;
    flex: 0 1 200px;
    min-width: 90px;
    height: 30px;
    padding-left: 10px;
    border-radius: 8px 8px 0 0;
    color: var(--muted);
}
.br-tab:hover { background: var(--btn-hover); }
.br-tab.active {
    background: var(--pane);
    color: var(--text);
}
.br-tab-title {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font-size: 12.5px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
}
.br-tab-close {
    display: grid;
    place-items: center;
    flex: none;
    width: 22px;
    height: 22px;
    margin: 0 4px;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: none;
    color: inherit;
    font-size: 11px;
    cursor: default;
}
.br-tab-close .gl { width: 14px; height: 14px; }
.br-tab-close:hover { background: var(--btn-hover); }
.br-newtab { flex: none; margin-bottom: 2px; }

.br-bar {
    flex: none;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    background: var(--pane);
    border-bottom: 1px solid var(--line);
}
.br-bar .icon-btn:disabled { opacity: 0.35; background: none; }
.br-address {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    margin: 0 4px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--btn-hover);
    color: var(--muted);
    font-size: 15px;
}
.br-address:focus-within { box-shadow: 0 0 0 2px var(--focus); }
.br-address input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: none;
    color: var(--text);
    font: inherit;
    font-size: 13.5px;
}

.br-views { position: relative; flex: 1; min-height: 0; }
.br-view {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    overflow: auto;
    background: var(--pane);
}
.br-view iframe {
    flex: 1;
    width: 100%;
    min-height: 0;
    border: 0;
    background: #fff;
}
.br-notice {
    flex: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: var(--chip-bg);
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 12.5px;
}
.br-notice span { flex: 1; }
.br-notice button {
    padding: 2px 10px;
    border: 1px solid var(--btn-border);
    border-radius: 6px;
    background: var(--btn-bg);
    color: var(--text);
    font-size: 12px;
    white-space: nowrap;
    cursor: pointer;
}

.br-start,
.br-blocked {
    flex: 1;
    display: grid;
    place-items: center;
    padding: 36px 20px;
}
.br-start-inner {
    width: min(620px, 100%);
    display: grid;
    justify-items: center;
    gap: 14px;
}
.br-start h3 { margin: 4px 0 6px; font-size: 26px; letter-spacing: -0.02em; }
.mono-md { width: 56px; height: 56px; border-radius: 16px; font-size: 22px; }
.br-search {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 46px;
    padding: 0 18px;
    border: 1px solid var(--btn-border);
    border-radius: 999px;
    background: var(--btn-bg);
    color: var(--muted);
    font-size: 18px;
    box-shadow: 0 4px 16px rgba(20, 8, 40, 0.08);
}
.br-search:focus-within { box-shadow: 0 0 0 2px var(--focus); }
.br-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: none;
    color: var(--text);
    font: inherit;
    font-size: 15px;
}
.br-section {
    justify-self: start;
    margin: 14px 0 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}
.br-tiles {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 8px;
}
.br-tile {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 7px;
    padding: 12px 4px 10px;
    border: 0;
    border-radius: 12px;
    background: none;
    font-size: 12.5px;
    cursor: pointer;
}
.br-tile:hover { background: var(--btn-hover); }
.br-tile .app-icon { width: 48px; height: 48px; border-radius: 12px; font-size: 27px; }
.br-tile .ext {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 13px;
    color: var(--muted);
}
.br-blocked-inner { max-width: 420px; text-align: center; }
.br-blocked-inner .app-icon { width: 64px; height: 64px; border-radius: 16px; font-size: 34px; }
.br-blocked h3 { margin: 16px 0 6px; font-size: 19px; overflow-wrap: anywhere; }
.br-blocked p { margin: 0; color: var(--muted); line-height: 1.55; }
.br-blocked .btn-row { justify-content: center; }

@container (max-width: 520px) {
    .br-bar [data-br="forward"],
    .br-bar [data-br="home"] { display: none; }
    .br-start h3 { font-size: 22px; }
}

/* ---------- Terminal ---------- */

.win-body.term {
    padding: 10px 14px 14px;
    background: #16131d;
    color: #e6e1ee;
    font: 13px/1.55 ui-monospace, "SF Mono", "Cascadia Mono", Consolas, Menlo, monospace;
    cursor: text;
}
.window.term-window .titlebar { background: #23202b; border-bottom-color: rgba(255, 255, 255, 0.06); }
.window.term-window .win-title { color: #d8d3e0 !important; }
.window.term-window .back { color: #cc9ee0; }
.term-out { white-space: pre-wrap; overflow-wrap: anywhere; }
.term-out p { margin: 0; }
.term-out a { color: #9ad0ff; }
.term-cmd { color: #fff; }
.term-dim { color: #8e879c; }
.term-accent { color: #cc9ee0; }
.term-good { color: #7ee2a8; }
.term-err { color: #ff8a8a; }
.term-line {
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.term-prompt { color: #7ee2a8; white-space: nowrap; }
.term-line input {
    flex: 1;
    min-width: 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: none;
    color: #fff;
    font: inherit;
    caret-color: #cc9ee0;
}

/* ---------- Notes ---------- */

.notes {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    height: 100%;
}
.notes-side {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--sidebar);
    border-right: 1px solid var(--line);
}
.notes-tools {
    display: flex;
    justify-content: flex-end;
    gap: 2px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--line);
}
.notes-list {
    flex: 1;
    margin: 0;
    padding: 6px;
    list-style: none;
    overflow: auto;
}
.note-item {
    display: grid;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 7px;
    background: none;
    text-align: left;
    cursor: default;
}
.note-item:hover { background: var(--btn-hover); }
.note-item[aria-current="true"] { background: #f5c451; color: #1d1b22; }
.note-item[aria-current="true"] small { color: rgba(29, 27, 34, 0.7); }
.note-item strong {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.note-item small { font-size: 11.5px; color: var(--muted); }
.notes-editor {
    display: block;
    width: 100%;
    height: 100%;
    padding: 20px 24px;
    border: 0;
    outline: 0;
    resize: none;
    background: var(--pane);
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.6;
}

@container (max-width: 520px) {
    .notes { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
    .notes-side { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--line); }
    .notes-tools { order: 2; border: 0; padding: 6px; }
    .notes-list { display: flex; gap: 4px; overflow-x: auto; overflow-y: hidden; padding: 6px; }
    .note-item { width: auto; max-width: 150px; }
    .note-item small { display: none; }
    .notes-editor { padding: 16px 18px; }
}

/* ---------- Calculator ---------- */

.window.calc-window { background: #1e1b24; }
.window.calc-window .titlebar { background: #1e1b24; border-bottom: 0; }
.window.calc-window .win-title { color: #d8d3e0 !important; }
.window.calc-window .back { color: #f5a25c; }
.win-body.calc {
    display: flex;
    flex-direction: column;
    padding: 0 12px 12px;
    background: #1e1b24;
    color: #fff;
}
.calc-display {
    flex: 1 0 70px;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 6px 8px 12px;
    font-size: 52px;
    font-weight: 300;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
}
.calc-keys {
    flex: 4 1 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(44px, 1fr);
    gap: 10px;
}
.calc-keys button {
    border: 0;
    border-radius: 999px;
    background: #3a3642;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    transition: filter 0.1s;
}
.calc-keys button:hover { filter: brightness(1.18); }
.calc-keys button:active,
.calc-keys button.pressed { filter: brightness(1.4); }
.calc-keys .fn { background: #a6a1ae; color: #1a1720; }
.calc-keys .op { background: #f08a3a; font-size: 26px; }
.calc-keys .op.active { background: #fff; color: #f08a3a; }
.calc-keys .zero { grid-column: span 2; text-align: left; padding-left: 26px; }

/* ---------- Settings ---------- */

.settings .section-label:first-child { margin-top: 0; }
.wp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
}
.wp-option {
    display: grid;
    gap: 6px;
    font-size: 12.5px;
    text-align: center;
    cursor: pointer;
}
.wp-option input,
.seg input,
.switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.wp-preview {
    display: block;
    aspect-ratio: 16 / 10;
    border-radius: 9px;
    box-shadow: 0 0 0 1px var(--line);
}
.wp-option:has(input:checked) .wp-preview { box-shadow: 0 0 0 3px var(--accent); }
.wp-option:has(input:focus-visible) .wp-preview { outline: 2px solid var(--focus); outline-offset: 4px; }
.wp-aurora   { background: var(--wp-aurora); }
.wp-sunset   { background: var(--wp-sunset); }
.wp-ocean    { background: var(--wp-ocean); }
.wp-forest   { background: var(--wp-forest); }
.wp-midnight { background: var(--wp-midnight); }
.wp-classic  { background: var(--wp-classic); }

.seg {
    display: inline-flex;
    padding: 3px;
    border-radius: 9px;
    background: var(--btn-hover);
}
.seg label {
    padding: 5px 16px;
    border-radius: 7px;
    font-size: 13px;
    cursor: pointer;
}
.seg label:has(input:checked) {
    background: var(--btn-bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    font-weight: 600;
}
.seg label:has(input:focus-visible) { outline: 2px solid var(--focus); }

.switch {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}
.switch-track {
    position: relative;
    flex: none;
    width: 40px;
    height: 24px;
    border-radius: 999px;
    background: var(--light-idle);
    transition: background 0.2s;
}
.switch-track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}
.switch input:checked + .switch-track { background: #34c759; }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--focus); outline-offset: 2px; }
.settings p { line-height: 1.6; }

/* ---------- Customizable layout (layout.js) ---------- */

/* Computers: icons sit at saved grid spots instead of flowing in columns. */
.desk-icons.free {
    display: block;
    left: 12px;
    direction: ltr;
    pointer-events: none;
}
.desk-icons.free li {
    position: absolute;
    width: 92px;
    pointer-events: auto;
    transition: left 0.18s ease, top 0.18s ease;
}
.desk-icons.free li.dragging {
    z-index: 5;
    transition: none;
    opacity: 0.85;
}

.desk-icon,
.dock-btn {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
@media (min-width: 768px) {
    .desk-icon,
    .dock-btn { touch-action: none; }
}

/* The dock hides its divider when nothing is minimized, and hides itself when emptied. */
.dock-sep:has(+ .dock-min:empty) { display: none; }
.dock:not(:has(li)) { display: none; }

/* Dragging */
.drag-ghost {
    position: fixed;
    z-index: 9900;
    margin: 0;
    list-style: none;
    pointer-events: none;
}
.drag-ghost .dock-btn,
.drag-ghost .desk-icon { transform: scale(1.06); }
.drag-ghost .tip { display: none; }
.drag-ghost[hidden] { display: none; }
.desk-ghost { width: 92px; opacity: 0.9; }
.placeholder { visibility: hidden; }
.collapsed { display: none !important; }
.dock-slot {
    width: var(--dock-icon);
    height: var(--dock-icon);
    border-radius: 25%;
    border: 2px dashed rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.15);
}

/* Right-click menu (reuses the menu bar's dropdown look) */
.dropdown.ctx-menu {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9800;
    min-width: 210px;
}

/* Phone edit mode: press and hold an icon, icons wiggle, tap Done to finish. */
.edit-done {
    position: fixed;
    top: 3px;
    right: 12px;
    z-index: 9600;
    padding: 3px 16px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: #1d1b22;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.edit-hint { display: none; }
.editing .classic-link { visibility: hidden; }
.editing .wallpaper-title .show-phone { display: none; }
.editing .wallpaper-title .edit-hint { display: inline; }
.editing .desk-icons li,
.editing .dock-apps li { touch-action: none; }
.editing .desk-icon .app-icon,
.editing .dock-btn .app-icon { animation: jiggle 0.3s ease-in-out infinite alternate; }
.editing .desk-icons li:nth-child(even) .app-icon,
.editing .dock-apps li:nth-child(even) .app-icon { animation-delay: -0.15s; }
@keyframes jiggle {
    from { transform: rotate(-2deg); }
    to { transform: rotate(2deg); }
}

/* Settings: Desktop & Dock checklist */
.layout-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.layout-table th {
    padding: 4px 6px;
    font-size: 11px;
    font-weight: 600;
    text-align: left;
    color: var(--muted);
}
.layout-table td {
    padding: 5px 6px;
    border-top: 1px solid var(--line);
}
.layout-table .c {
    width: 96px;
    text-align: center;
}
.layout-table .app-icon {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    border-radius: 6px;
    font-size: 14px;
    vertical-align: middle;
    box-shadow: none;
}
.layout-table input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}
.layout-table input:disabled { cursor: not-allowed; }

@media (prefers-reduced-motion: reduce) {
    .editing .desk-icon .app-icon,
    .editing .dock-btn .app-icon { animation: none; }
    .desk-icons.free li { transition: none; }
}

/* ---------- Search (Ctrl+K) ---------- */

.search-btn .gl { width: 15px; height: 15px; stroke-width: 2; }
.spotlight {
    position: fixed;
    inset: 0;
    z-index: 9700;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 16vh 16px 16px;
    background: rgba(10, 4, 24, 0.28);
}
.spotlight-box {
    width: min(600px, 100%);
    overflow: hidden;
    background: var(--win-bg);
    -webkit-backdrop-filter: blur(30px) saturate(1.6);
    backdrop-filter: blur(30px) saturate(1.6);
    border: 1px solid var(--win-border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    color: var(--text);
}
.spotlight-field {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 56px;
    padding: 0 18px;
    font-size: 22px;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
}
.spotlight-field input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: none;
    color: var(--text);
    font: inherit;
    font-size: 19px;
}
.spotlight-list {
    max-height: min(380px, 50vh);
    margin: 0;
    padding: 6px;
    overflow-y: auto;
    list-style: none;
}
.spotlight-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 10px;
    border-radius: 8px;
    cursor: pointer;
}
.spotlight-list li[aria-selected="true"] { background: var(--accent); color: var(--accent-text); }
.spotlight-list li[aria-selected="true"] .sl-kind { color: inherit; opacity: 0.8; }
.spotlight-list .app-icon,
.spotlight-list .sl-thumb {
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 17px;
    box-shadow: none;
}
.spotlight-list .sl-thumb { object-fit: cover; background: var(--pane); }
.sl-label { flex: 1; min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-kind { font-size: 12px; color: var(--muted); }
.spotlight-empty { padding: 14px 12px; color: var(--muted); font-size: 14px; }
.spotlight-hint {
    margin: 0;
    padding: 8px 16px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    color: var(--muted);
}
.spotlight-hint kbd {
    display: inline-block;
    min-width: 18px;
    margin-right: 2px;
    padding: 0 4px;
    border: 1px solid var(--line);
    border-radius: 4px;
    font: inherit;
    text-align: center;
}

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

.contact-form { margin-top: 22px; }
.contact-form label {
    display: grid;
    gap: 4px;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
}
.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--btn-border);
    border-radius: 8px;
    background: var(--pane);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    font-weight: 400;
}
.contact-form textarea { resize: vertical; min-height: 96px; }
.contact-form input:focus,
.contact-form textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.contact-form [aria-invalid="true"] { border-color: #e5484d; }
.cf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cf-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.cf-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.cf-status { font-size: 13px; }
.cf-status.good { color: #1f9d55; }
.cf-status.bad { color: #e5484d; }
@container (max-width: 460px) {
    .cf-row { grid-template-columns: 1fr; gap: 0; }
}

/* ---------- Touch devices: bigger window buttons ---------- */

@media (pointer: coarse) {
    .lights { gap: 12px; }
    .light { width: 18px; height: 18px; }
    .light .gl { opacity: 1; width: 11px; height: 11px; }
    .rz-e, .rz-w { width: 16px; }
    .rz-n, .rz-s { height: 16px; }
    .rz-ne, .rz-nw, .rz-se, .rz-sw { width: 24px; height: 24px; }
}

/* ---------- Phones: home screen + full-screen apps ---------- */

@media (max-width: 767px) {
    :root { --menubar-h: 30px; }

    .hide-phone { display: none !important; }
    .show-phone { display: inline; }

    .menubar { padding: 0 14px; }
    .menubar .menu,
    .active-app { display: none; }
    .clock { order: -1; padding: 0; font-weight: 600; }
    .menubar-right { flex: 1; justify-content: space-between; }

    .desktop {
        overflow-y: auto;
        padding: calc(var(--menubar-h) + 22px) 18px calc(120px + env(safe-area-inset-bottom));
    }
    .wallpaper-title {
        position: static;
        transform: none;
        width: auto;
        padding: 22px 20px;
        border-radius: 22px;
        background: rgba(255, 255, 255, 0.14);
        border: 1px solid rgba(255, 255, 255, 0.22);
        -webkit-backdrop-filter: blur(20px);
        backdrop-filter: blur(20px);
        text-align: left;
    }
    .wallpaper-title h1 { font-size: 34px; }
    .wallpaper-title .role { font-size: 16px; margin-top: 6px; }
    .wallpaper-title .hint { margin-top: 10px; }

    .desk-icons {
        position: static;
        margin-top: 26px;
        direction: ltr;
        grid-auto-flow: row;
        grid-template-rows: none;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-auto-columns: auto;
        gap: 18px 6px;
    }
    .desk-icons li[data-fav] { display: none; }
    .desk-icons li[data-phone-only] { display: block; }
    .desk-icon { width: 100%; }
    .desk-icon .app-icon { width: 60px; height: 60px; border-radius: 15px; }
    .desk-icon.selected .label { background: none; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
    .desk-icon.selected .app-icon { box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.35), 0 4px 10px rgba(20, 8, 40, 0.28); }

    .dock {
        left: 12px;
        right: 12px;
        bottom: calc(10px + env(safe-area-inset-bottom));
        transform: none;
        justify-content: center;
        padding: 10px;
        border-radius: 28px;
    }
    .dock-apps { flex: 1; justify-content: space-around; }
    .dock-sep,
    .dock-min { display: none !important; }
    .dock-btn { width: 60px; height: auto; }
    .dock-btn .app-icon { height: 60px; border-radius: 15px; }
    .dock-btn:hover { transform: none; }
    .dock-btn .tip {
        position: static;
        display: block;
        margin-top: 4px;
        padding: 0;
        transform: none;
        opacity: 1;
        border: 0;
        background: none;
        color: #fff;
        font-size: 11px;
        font-weight: 500;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    }
    .dock-btn.running::after { display: none; }
    .has-open .dock { display: none; }

    .window {
        inset: var(--menubar-h) 0 0 0 !important;
        width: auto !important;
        height: auto !important;
        border: 0;
        border-radius: 0;
        background: var(--win-solid);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        box-shadow: none;
    }
    .window.maximized { border-radius: 0; }
    .titlebar {
        height: 48px;
        padding: 0 8px;
        border-radius: 0;
        touch-action: auto;
    }
    .win-title { font-size: 16px; color: var(--text) !important; }
    .lights,
    .rz { display: none; }
    .back { display: inline-flex; }
    .win-body { border-radius: 0; padding-bottom: env(safe-area-inset-bottom); }
    .win-body.frame iframe[data-phone-fallback] { display: none; }
    .win-body.frame iframe[data-phone-fallback] + .pdf-fallback { display: flex; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    .boot, .dock-btn, .window.animating { transition: none; }
    .boot-bar span { animation-duration: 1ms; }
}
