/* ===================================================================== */
/* ===== GUI MODE — DESKTOP WITH DRAGGABLE WINDOWS =================== */
/* ===================================================================== */
.desktop {
    position: fixed;
    inset: 0;
    z-index: 10;
    overflow: hidden;
    /* identical backdrop across every screen — default 'grid' wallpaper */
    background:
        linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 34px 34px,
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 34px 34px,
        var(--bg-primary);
}
/* wallpaper variants (Settings → Wallpaper); default 'grid' is the rule above */
:root[data-wallpaper="dots"] .desktop {
    background:
        radial-gradient(var(--wp-ink) 1.8px, transparent 2px) 0 0 / 26px 26px,
        var(--bg-primary);
}
:root[data-wallpaper="iso"] .desktop {
    background:
        repeating-linear-gradient(30deg,  var(--wp-ink) 0 1px, transparent 1px 42px),
        repeating-linear-gradient(150deg, var(--wp-ink) 0 1px, transparent 1px 42px),
        repeating-linear-gradient(90deg,  var(--wp-ink) 0 1px, transparent 1px 42px),
        var(--bg-primary);
}
:root[data-wallpaper="glow"] .desktop {
    /* two large, colour-mixed washes — sized in vmax so the coloured area
       scales with the screen instead of being swallowed by it.
       A flat shield along row 0 keeps the very top edge pure --bg-primary:
       some browsers tint their toolbar to match a page's top-edge colour,
       and a coloured pixel there reads as a mismatched seam under the
       (uncoloured) system chrome above it. */
    background:
        linear-gradient(var(--bg-primary), transparent) top / 100% 170px no-repeat,
        radial-gradient(130vmax 100vmax at 4% -6%,
            color-mix(in srgb, var(--accent) 22%, transparent) 0%,
            color-mix(in srgb, var(--accent) 9%, transparent) 42%,
            transparent 74%),
        radial-gradient(115vmax 95vmax at 100% 122%,
            color-mix(in srgb, var(--accent) 18%, transparent) 0%,
            color-mix(in srgb, var(--accent) 7%, transparent) 40%,
            transparent 72%),
        var(--bg-primary);
}

.desktop-credit {
    position: absolute;
    left: 1.4rem;
    bottom: 1rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.72rem;
    color: var(--text-primary);
    opacity: 0.35;
    pointer-events: none;
    user-select: none;
}

/* ===================================================================== */
/* ===== HOME  —  a MacBook-style desktop  (wallpaper + dock) ========= */
/* ===================================================================== */
.home { overflow: hidden; padding: 0; }
.home::before, .home::after { content: none !important; display: none !important; }

.home-stage {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 2rem 8rem;
    pointer-events: none;
    user-select: none;
}
.home-title {
    font-family: 'Newsreader', Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-weight: 500;
    font-size: clamp(2.2rem, 6vw, 4rem);
    letter-spacing: -0.015em;
    color: var(--text-primary);
    margin-bottom: 0.7rem;
}
.home-sub {
    max-width: 34rem;
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: clamp(0.9rem, 2.2vw, 1.05rem);
}

/* --- ambient drifting dots --- */
.desk-dots { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.desk-dots span {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.16;
    filter: blur(0.5px);
    animation: deskDrift 22s ease-in-out infinite;
}
.desk-dots span:nth-child(1) { left: 12%;  top: 24%; animation-duration: 26s; }
.desk-dots span:nth-child(2) { left: 78%;  top: 18%; animation-duration: 31s; animation-delay: -6s; }
.desk-dots span:nth-child(3) { left: 66%;  top: 72%; animation-duration: 24s; animation-delay: -12s; opacity: 0.1; }
.desk-dots span:nth-child(4) { left: 22%;  top: 78%; animation-duration: 29s; animation-delay: -3s; }
.desk-dots span:nth-child(5) { left: 46%;  top: 40%; animation-duration: 34s; animation-delay: -18s; opacity: 0.09; }
@keyframes deskDrift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(26px, -34px) scale(1.4); }
    66%      { transform: translate(-30px, 18px) scale(0.7); }
}

/* --- ambient desktop clutter: drifting glyphs + shapes (decorative) --- */
.desk-deco { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.desk-deco .dk {
    position: absolute;
    display: block;
    color: var(--text-primary);
    opacity: 0.08;
    animation: deskFloat 30s ease-in-out infinite;
    will-change: transform;
}
.desk-deco .dk-glyph {
    font-family: 'Fira Code', monospace;
    font-size: 1.5rem;
    font-weight: 500;
    letter-spacing: 0.04em;
}
/* outline shapes */
.desk-deco .dk-ring {
    width: 84px; height: 84px;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    opacity: 0.05;
}
.desk-deco .dk-ring--sm { width: 40px; height: 40px; }
.desk-deco .dk-plus {
    width: 26px; height: 26px;
    background:
        linear-gradient(currentColor, currentColor) center / 100% 1.5px no-repeat,
        linear-gradient(currentColor, currentColor) center / 1.5px 100% no-repeat;
    opacity: 0.07;
}
.desk-deco .dk-plus--b { width: 16px; height: 16px; }
.desk-deco .dk-square {
    width: 54px; height: 54px;
    border: 1.5px dashed currentColor;
    border-radius: 6px;
    opacity: 0.05;
}
.desk-deco .dk-tri {
    width: 0; height: 0;
    border-left: 22px solid transparent;
    border-right: 22px solid transparent;
    border-bottom: 38px solid currentColor;
    opacity: 0.045;
}
/* positions + per-element timing */
.desk-deco .dk:nth-child(1)  { left: 13%; top: 60%; --dx: 22px;  --dy: -30px; --rot: 8deg;  animation-duration: 28s; animation-delay: -4s;  }
.desk-deco .dk:nth-child(2)  { left: 82%; top: 54%; --dx: -26px; --dy: 20px;  --rot: -6deg; animation-duration: 34s; animation-delay: -11s; }
.desk-deco .dk:nth-child(3)  { left: 70%; top: 28%; --dx: 18px;  --dy: 26px;  --rot: 10deg; animation-duration: 39s; animation-delay: -20s; font-size: 1.9rem; }
.desk-deco .dk:nth-child(4)  { left: 29%; top: 15%; --dx: -20px; --dy: 24px;  --rot: -8deg; animation-duration: 31s; animation-delay: -7s;  }
.desk-deco .dk:nth-child(5)  { left: 51%; top: 83%; --dx: 24px;  --dy: -22px; --rot: 5deg;  animation-duration: 27s; animation-delay: -16s; }
.desk-deco .dk:nth-child(6)  { left: 90%; top: 82%; --dx: -18px; --dy: -26px; --rot: -10deg;animation-duration: 36s; animation-delay: -2s;  color: var(--accent); opacity: 0.09; }
.desk-deco .dk:nth-child(7)  { left: 19%; top: 38%; --dx: 30px;  --dy: 22px;  --rot: 0deg;  animation-duration: 44s; animation-delay: -9s;  }
.desk-deco .dk:nth-child(8)  { left: 62%; top: 66%; --dx: -22px; --dy: -18px; --rot: 0deg;  animation-duration: 33s; animation-delay: -25s; }
.desk-deco .dk:nth-child(9)  { left: 60%; top: 18%; --dx: 16px;  --dy: 28px;  --rot: 0deg;  animation-duration: 30s; animation-delay: -13s; }
.desk-deco .dk:nth-child(10) { left: 35%; top: 72%; --dx: -24px; --dy: 16px;  --rot: 0deg;  animation-duration: 42s; animation-delay: -6s;  }
.desk-deco .dk:nth-child(11) { left: 44%; top: 32%; --dx: 20px;  --dy: -24px; --rot: 14deg; animation-duration: 38s; animation-delay: -19s; }
.desk-deco .dk:nth-child(12) { left: 77%; top: 40%; --dx: -16px; --dy: 22px;  --rot: -12deg;animation-duration: 45s; animation-delay: -3s;  }
@keyframes deskFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50%      { transform: translate(var(--dx, 20px), var(--dy, -24px)) rotate(var(--rot, 0deg)); }
}

/* --- faint blinking shell prompt (bottom-left) --- */
.desk-prompt {
    position: absolute;
    left: 1.9rem;
    bottom: 1.6rem;
    display: flex;
    align-items: center;
    font-family: 'Fira Code', monospace;
    font-size: 0.74rem;
    color: var(--text-secondary);
    opacity: 0.4;
    pointer-events: none;
    user-select: none;
}
.desk-prompt .dp-path { color: var(--accent); }
.desk-prompt .dp-caret {
    width: 7px;
    height: 14px;
    margin-left: 3px;
    background: currentColor;
    animation: dpBlink 1.1s steps(1) infinite;
}
@keyframes dpBlink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }

/* --- top-left: two iOS-style widgets (analog clock + live weather) --- */
.desk-widgets {
    --dw-size: 9.625rem;   /* both cards are the same 1:1 square — rem, so the card grows with Zoom instead of clipping its own (rem-sized) contents */
    position: absolute;
    inset: 0;           /* full-bleed layer — each widget is placed on its own below */
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    pointer-events: none;
    user-select: none;
}
/* --- default position of each widget — tweak top / left freely --- */
#dwCal {
    position: absolute;
    top: 3rem;
    left: 3rem;
}
#dwWx {
    position: absolute;
    top: 16rem;
    left: 3rem;     /* ≈ calendar's left + card width + a small gap */
}
.dw-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    z-index: 5;
    pointer-events: auto;   /* clickable to dismiss, even though .desk-widgets isn't */
    cursor: pointer;
    transform-origin: center;
    will-change: transform, opacity;
}
.dw-item[hidden] { display: none; }

/* long-press drag (widgets + shortcut icons) */
.dw-item.is-dragging,
.desk-icon.is-dragging {
    z-index: 600;
    cursor: grabbing;
    transition: none !important;
    animation: none !important;
    user-select: none;
    filter: drop-shadow(0 14px 26px rgba(0, 0, 0, 0.28));
    transform: scale(1.04);
}
/* genie in/out — the widget flies out of / back into its dock tile.
   --fly-x / --fly-y are set per-toggle in JS (vector to the dock icon centre). */
.dw-item--in  { animation: dwGenieIn 0.36s cubic-bezier(0.22, 0.9, 0.3, 1.02); }
.dw-item--out { animation: dwGenieOut 0.3s cubic-bezier(0.5, 0, 0.75, 0.15) forwards; pointer-events: none; }
@keyframes dwGenieIn {
    from { opacity: 0; transform: translate(var(--fly-x, 0px), var(--fly-y, 0px)) scale(0.07); }
    55%  { opacity: 1; }
    to   { opacity: 1; transform: translate(0, 0) scale(1); }
}
@keyframes dwGenieOut {
    from { opacity: 1; transform: translate(0, 0) scale(1); }
    to   { opacity: 0; transform: translate(var(--fly-x, 0px), var(--fly-y, 0px)) scale(0.07); }
}
@media (prefers-reduced-motion: reduce) {
    .dw-item--in, .dw-item--out { animation-duration: 0.01s; }
}
.dw-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.68rem;
    color: var(--text-secondary);
}
.dw-card {
    border-radius: 20px;
    box-shadow: 0 7px 20px -12px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.12);
    color: var(--text-primary);
    overflow: hidden;
}

/* --- left: macOS-style calendar (weekday + month + big day number) --- */
.dw-card--cal {
    width: var(--dw-size);
    height: var(--dw-size);
    padding: 11px 12px 13px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    text-align: center;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.07);
}
[data-theme="dark"] .dw-card--cal {
    background: #1c1c1e;
    border-color: rgba(255, 255, 255, 0.08);
}
.cal-head {
    display: flex;
    justify-content: center;
    gap: 0.28em;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.cal-dow { color: #ff3b30; }
[data-theme="dark"] .cal-dow { color: #ff453a; }
.cal-mon { color: #8a8a8e; }
.cal-day {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4.4rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.04em;
    color: #1c1c1e;
}
[data-theme="dark"] .cal-day { color: #f5f5f7; }

/* --- right: macOS-style weather, gradient keyed to the sky --- */
.dw-card--wx {
    position: relative;
    width: var(--dw-size);
    height: var(--dw-size);
    padding: 10px 12px 11px;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
    background: linear-gradient(158deg, #5aa9e6 0%, #2f7cc4 55%, #2867a8 100%);
}
.dw-card--wx[data-state="error"] { display: none; }
.dw-card--wx > * { position: relative; z-index: 1; }

/* sky gradients */
.dw-card--wx[data-sky="day"]         { background: linear-gradient(158deg, #63b0e8 0%, #3480c6 55%, #2a68aa 100%); }
.dw-card--wx[data-sky="cloudy"]      { background: linear-gradient(158deg, #8091a4 0%, #5c6b7e 60%, #4a5867 100%); }
.dw-card--wx[data-sky="rain"]        { background: linear-gradient(158deg, #6d7885 0%, #4d5761 60%, #3b444d 100%); }
.dw-card--wx[data-sky="fog"]         { background: linear-gradient(158deg, #aeb6bd 0%, #8d969e 58%, #7b848c 100%); }
.dw-card--wx[data-sky="snow"]        { background: linear-gradient(158deg, #a6b8c8 0%, #8398ab 58%, #71889b 100%); }
.dw-card--wx[data-sky="storm"]       { background: linear-gradient(158deg, #49525f 0%, #333c48 55%, #232a33 100%); }
.dw-card--wx[data-sky="night"]       { background: linear-gradient(165deg, #2c3f60 0%, #1a2846 50%, #0d1830 100%); }
.dw-card--wx[data-sky="clear-night"] { background: linear-gradient(165deg, #26395c 0%, #172542 50%, #0b1631 100%); }

/* starfield — only lit for night skies */
.dw-card--wx::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.45s ease;
    background-image:
        radial-gradient(1.5px 1.5px at 17% 20%, rgba(255, 255, 255, 0.95), transparent),
        radial-gradient(1.2px 1.2px at 61% 13%, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(1.6px 1.6px at 83% 27%, rgba(255, 255, 255, 0.9), transparent),
        radial-gradient(1px 1px at 34% 37%, rgba(255, 255, 255, 0.65), transparent),
        radial-gradient(1.3px 1.3px at 49% 52%, rgba(255, 255, 255, 0.75), transparent),
        radial-gradient(1px 1px at 12% 60%, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(1.2px 1.2px at 90% 64%, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(1px 1px at 72% 78%, rgba(255, 255, 255, 0.55), transparent),
        radial-gradient(1.4px 1.4px at 28% 83%, rgba(255, 255, 255, 0.7), transparent);
}
.dw-card--wx[data-sky="night"]::before,
.dw-card--wx[data-sky="clear-night"]::before { opacity: 1; }
/* a faint moon glow for a clear night */
.dw-card--wx[data-sky="clear-night"]::after {
    content: "";
    position: absolute;
    top: -18px;
    right: -14px;
    width: 74px;
    height: 74px;
    z-index: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(215, 228, 255, 0.35) 0%, rgba(215, 228, 255, 0) 70%);
    pointer-events: none;
}

.wx-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.3rem; }
.wx-loc {
    display: inline-flex;
    align-items: center;
    gap: 0.18rem;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.1;
    max-width: 6.4rem;
}
.wx-loc > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wx-loc-arrow { font-size: 0.46rem; opacity: 0.8; flex-shrink: 0; }
.dw-card--wx[data-state="loading"] .wx-loc { opacity: 0.55; }
.wx-ico { font-size: 0.98rem; line-height: 1; flex-shrink: 0; }
.wx-now { display: flex; align-items: center; justify-content: space-between; gap: 0.3rem; }
.wx-temp { font-size: 1.75rem; font-weight: 500; letter-spacing: -0.02em; line-height: 1; }
.wx-hilo {
    display: flex;
    flex-direction: column;
    gap: 0;
    font-size: 0.62rem;
    font-weight: 600;
    opacity: 0.95;
    font-variant-numeric: tabular-nums;
}
.wx-hilo[hidden] { display: none; }
.wx-h { display: grid; grid-template-columns: 0.8em auto; gap: 2px; }
.wx-h i { font-style: normal; text-align: center; opacity: 0.75; }
.wx-h b { font-weight: 600; text-align: right; }

/* multi-day forecast list — tight, no divider */
.wx-days {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-top: 0.2rem;
    font-variant-numeric: tabular-nums;
}
.wx-days:empty { display: none; }
.wx-day {
    display: grid;
    grid-template-columns: 1fr 1.05rem 1.9em 1.9em;
    align-items: center;
    gap: 0 0.28rem;
    font-size: 0.66rem;
    font-weight: 600;
}
.wx-day-ico { justify-self: center; font-size: 0.74rem; line-height: 1; }
.wx-day-lo { text-align: right; opacity: 0.62; }
.wx-day-hi { text-align: right; }

/* --- top-right: the app icon — a button that "shuts down" the desktop --- */
.desk-badge {
    position: absolute;
    top: 1.6rem;
    right: 1.8rem;
    width: 40px;
    height: 40px;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    overflow: hidden;
    user-select: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.desk-badge img { width: 100%; height: 100%; object-fit: cover; display: block; }
.desk-badge:hover { transform: scale(1.06); box-shadow: var(--shadow-md); }
.desk-badge:active { transform: scale(0.94); }

/* --- lock screen (sleep / wake) — a plain fade, everything centred --- */
.lockscreen {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: #000;
    color: #fff;
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-font-smoothing: antialiased;
    cursor: pointer;
    font-family: var(--font-sans);
}
.lockscreen.is-active { display: flex; }
.lockscreen.is-on { opacity: 1; }

.lock-clock {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.lockscreen.is-on .lock-clock { opacity: 1; transform: none; }

.lock-date {
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.15rem;
}
.lock-time {
    font-size: clamp(4rem, 13vw, 7.5rem);
    font-weight: 250;
    letter-spacing: -0.02em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.lock-hint {
    margin-top: 1.6rem;
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 450;
    letter-spacing: 0.01em;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.2s ease;
}
.lock-hint:hover { color: rgba(255, 255, 255, 0.85); }
.lock-hint kbd {
    font: inherit;
    font-size: 0.78rem;
    padding: 0.12rem 0.44rem;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: rgba(255, 255, 255, 0.82);
}
@media (prefers-reduced-motion: reduce) {
    .lockscreen, .lock-clock { transition-duration: 0.001s; }
}

/* --- time-of-day greeting above the name --- */
.home-greet {
    font-family: 'Fira Code', monospace;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    opacity: 0.85;
    margin-bottom: 0.85rem;
}

/* --- desktop shortcut icons (left edge) --- */
.desk-icon {
    position: absolute;
    width: 74px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0.35rem 0.2rem;
    border-radius: 8px;
    transition: background 0.15s ease;
}
.desk-icon--a { left: 65rem; top: 10rem; }   /* cleared below the widgets + their labels */
.desk-icon--b { left: 23rem; top: 33rem; }
.desk-icon:hover { background: color-mix(in srgb, var(--text-primary) 8%, transparent); }
.desk-icon-glyph {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    color: var(--text-secondary);
}
.desk-icon:hover .desk-icon-glyph { color: var(--text-primary); }
.desk-icon-glyph svg { width: 30px; height: 30px; }
.desk-icon-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.68rem;
    color: var(--text-secondary);
}
.desk-icon:hover .desk-icon-label { color: var(--text-primary); }

/* --- the dock --- */
.dock {
    --dock-ico-bg: var(--bg-tertiary);
    position: absolute;
    left: 50%;
    bottom: 1.4rem;
    transform: translateX(-50%);
    z-index: 40;
    display: flex;
    align-items: flex-end;
    gap: 0.7rem;
    padding: 0.6rem 0.8rem;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(26px) saturate(1.7);
    -webkit-backdrop-filter: blur(26px) saturate(1.7);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
[data-theme="dark"] .dock {
    background: rgba(30, 32, 38, 0.55);
    border-color: rgba(255, 255, 255, 0.08);
}
.dock-sep {
    width: 1px;
    align-self: stretch;
    margin: 0.2rem 0.15rem;
    background: color-mix(in srgb, var(--text-primary) 22%, transparent);
}
.dock-app {
    position: relative;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    transition: transform 0.16s cubic-bezier(0.3, 1.3, 0.5, 1);
}
.dock-app:hover { transform: translateY(-10px) scale(1.12); }
.dock-app:active { transform: translateY(-4px) scale(1.04); }
.dock-ico {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}
.dock-ico svg { width: 30px; height: 30px; }
/* every tile shares the Terminal's near-black background; only the glyph colour changes */
.dock-ico--term  { background: #16181d; color: #47d787; }
.dock-ico--folio { background: #16181d; color: #6ea8ff; }
.dock-ico--help  { background: #16181d; color: #ffbd2e; }
.dock-ico--theme { background: #16181d; color: #cfd3da; position: relative; }
.dock-ico--theme svg { position: absolute; transition: opacity 0.2s ease, transform 0.3s ease; }
.dock-ico--theme .moon-icon { opacity: 0; transform: scale(0.6) rotate(-30deg); }
[data-theme="dark"] .dock-ico--theme .sun-icon  { opacity: 0; transform: scale(0.6) rotate(30deg); }

/* tiles that use a PNG app icon: drop the tile chrome, let the artwork speak.
   (defined after the colour tiles so it wins the background override) */
.dock-ico--img {
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
}
.dock-ico--img .dock-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transform: scale(1.16);   /* the artwork has built-in padding — nudge it to fill the tile */
}
[data-theme="dark"] .dock-ico--theme .moon-icon { opacity: 1; transform: scale(1) rotate(0); }

/* calendar / weather dock tiles — PNG art, with an SVG glyph fallback if the
   image is missing (onerror adds .dock-ico--noimg) */
.dock-ico--cal > svg,
.dock-ico--wx  > svg { display: none; }
.dock-ico--noimg {
    background: #16181d;
    border: 1px solid var(--border-color);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}
.dock-ico--noimg > svg { display: block; width: 28px; height: 28px; }
.dock-ico--cal.dock-ico--noimg { color: #ff5a52; }
.dock-ico--wx.dock-ico--noimg  { color: #6ea8ff; }

.dock-tip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 12px);
    transform: translateX(-50%) translateY(4px);
    padding: 0.25rem 0.6rem;
    border-radius: 7px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    font-family: 'Fira Code', monospace;
    font-size: 0.72rem;
    white-space: nowrap;
    color: var(--text-primary);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.dock-app:hover .dock-tip { opacity: 1; transform: translateX(-50%) translateY(0); }
