:root {
    color-scheme: dark;
    --bg: #010101;
    --glow-core: rgba(255, 176, 103, 0.8);
    --glow-mid: rgba(255, 140, 51, 0.24);
    --glow-halo: rgba(255, 126, 33, 0.08);
    --glow-fade: rgba(255, 118, 15, 0.04);
    --crt-scanline: rgba(255, 196, 150, 0.05);
    --taskbar-safe-zone: clamp(110px, 12vh, 140px);
    --cursor-retro: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2722%27%20height%3D%2722%27%20viewBox%3D%270%200%2022%2022%27%20fill%3D%27none%27%3E%3Cpath%20d%3D%27M3%2019V3h16%27%20stroke%3D%27%23FF9334%27%20stroke-width%3D%272.25%27%20stroke-linecap%3D%27round%27%2F%3E%3Cpath%20d%3D%27M3%2011h6%27%20stroke%3D%27%23FFD4AA%27%20stroke-width%3D%271.6%27%20stroke-linecap%3D%27round%27%20opacity%3D%270.75%27%2F%3E%3Cpath%20d%3D%27M11%203v6%27%20stroke%3D%27%23FFD4AA%27%20stroke-width%3D%271.6%27%20stroke-linecap%3D%27round%27%20opacity%3D%270.75%27%2F%3E%3Ccircle%20cx%3D%273%27%20cy%3D%273%27%20r%3D%271.7%27%20fill%3D%27%23FF9334%27%2F%3E%3C%2Fsvg%3E");
    --cursor-hotspot-x: 3;
    --cursor-hotspot-y: 3;
    --cursor-hand: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2724%27%20height%3D%2724%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20shape-rendering%3D%27crispEdges%27%3E%3Cpath%20d%3D%27M7%2021V9h2v4h1V5h2v8h1V6h2v7h1V8h2v10h-2v3H7z%27%20stroke%3D%27%23FFC48E%27%20stroke-width%3D%271.6%27%20stroke-linejoin%3D%27miter%27%20stroke-linecap%3D%27square%27%2F%3E%3C%2Fsvg%3E");
    --cursor-hand-hotspot-x: 6;
    --cursor-hand-hotspot-y: 2;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at 50% 45%, rgba(12, 12, 12, 0.85) 0%, rgba(2, 2, 2, 0.95) 45%, #010101 80%),
        var(--bg);
    font-family: 'Space Grotesk', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
    color: transparent;
    cursor: var(--cursor-retro) var(--cursor-hotspot-x) var(--cursor-hotspot-y), crosshair;
}

button,
a,
[role="button"],
.start-menu-button,
.task-button,
.tray-icon,
.download-button,
.chat-dock-button,
.chat-transcript-tools button,
.chat-input button,
.program-home-cta button,
.program-home-cta a,
.cta-button,
.program-login-form button,
.form-link-button,
.taskbar-start,
.taskbar-programs button,
.tray-clock,
.start-menu,
.taskbar {
    cursor: var(--cursor-retro) var(--cursor-hotspot-x) var(--cursor-hotspot-y), pointer;
}

button:hover,
button:focus-visible,
a:hover,
a:focus-visible,
[role="button"]:hover,
[role="button"]:focus-visible,
.start-menu-button:hover,
.start-menu-button:focus-visible,
.task-button:hover,
.task-button:focus-visible,
.tray-icon:hover,
.tray-icon:focus-visible,
.download-button:hover,
.download-button:focus-visible,
.chat-dock-button:hover,
.chat-dock-button:focus-visible,
.chat-transcript-tools button:hover,
.chat-transcript-tools button:focus-visible,
.chat-input button:hover,
.chat-input button:focus-visible,
.program-home-cta button:hover,
.program-home-cta button:focus-visible,
.program-home-cta a:hover,
.program-home-cta a:focus-visible,
.cta-button:hover,
.cta-button:focus-visible,
.program-login-form button:hover,
.program-login-form button:focus-visible,
.form-link-button:hover,
.form-link-button:focus-visible,
.taskbar-start:hover,
.taskbar-start:focus-visible,
.taskbar-programs button:hover,
.taskbar-programs button:focus-visible,
.tray-clock:hover,
.tray-clock:focus-visible,
.start-menu:hover,
.start-menu:focus-within,
.taskbar:hover {
    cursor: var(--cursor-hand) var(--cursor-hand-hotspot-x) var(--cursor-hand-hotspot-y), pointer;
}

input,
textarea,
input:focus,
textarea:focus {
    cursor: text;
}

@media (pointer: coarse), (hover: none) {
    body,
    button,
    a,
    [role="button"],
    input,
    textarea,
    .taskbar,
    .taskbar-start,
    .task-button,
    .tray-icon,
    .tray-clock {
        cursor: auto;
    }
}

body.is-chat-mode {
    overflow: hidden;
}

body::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: clamp(620px, 95vw, 1800px);
    height: clamp(480px, 80vh, 1400px);
    background: radial-gradient(circle,
        var(--glow-core) 0%,
        var(--glow-mid) 28%,
        var(--glow-halo) 52%,
        var(--glow-fade) 78%,
        transparent 100%);
    filter: blur(90px) saturate(115%);
    opacity: 0.72;
    animation: breathe 18s ease-in-out infinite;
    border-radius: 60% / 45%;
    pointer-events: none;
}

body::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at center, rgba(0, 0, 0, 0) 58%, rgba(0, 0, 0, 0.65) 100%),
        linear-gradient(90deg, rgba(255, 138, 51, 0.12), rgba(255, 138, 51, 0)),
        repeating-linear-gradient(0deg, transparent 0 2px, var(--crt-scanline) 2px 3px);
    background-size: cover, cover, 100% 3px;
    background-blend-mode: normal, screen, soft-light;
    opacity: 0.95;
    filter: blur(0.25px);
    mix-blend-mode: screen;
    box-shadow: inset 0 0 180px rgba(0, 0, 0, 0.85);
    pointer-events: none;
}

@keyframes breathe {
    0% {
        transform: translate(-50%, -50%) scale(0.94);
        opacity: 0.64;
    }
    40% {
        transform: translate(calc(-50% + 1.2%), calc(-50% + 0.8%)) scale(1.02);
        opacity: 0.78;
    }
    80% {
        transform: translate(calc(-50% - 0.6%), calc(-50% - 1.4%)) scale(1.08);
        opacity: 0.7;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.94);
        opacity: 0.64;
    }
}

@media (prefers-reduced-motion: reduce) {
    body::before {
        animation: none;
    }
}

.taskbar {
    --taskbar-padding-y: clamp(6px, 1vh, 10px);
    --taskbar-padding-x: clamp(8px, 1.5vw, 16px);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    padding: var(--taskbar-padding-y) var(--taskbar-padding-x);
    border-top: 2px solid rgba(255, 176, 120, 0.8);
    border-left: 2px solid rgba(255, 176, 120, 0.5);
    border-right: 2px solid rgba(255, 176, 120, 0.5);
    border-bottom: 2px solid rgba(119, 66, 29, 0.6);
    border-radius: 0;
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    gap: clamp(6px, 1.2vw, 12px);
    color: rgba(255, 210, 174, 0.9);
    text-transform: none;
    letter-spacing: 0.08em;
    font-size: clamp(0.65rem, 1vw, 0.9rem);
    background: rgba(3, 3, 3, 0.85);
    backdrop-filter: blur(4px);
    box-shadow: 0 -6px 28px rgba(0, 0, 0, 0.65);
    pointer-events: auto;
    z-index: 5;
}

.program-layer {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    padding: 0 clamp(24px, 8vw, 140px) var(--taskbar-height, 0px);
    display: flex;
    align-items: stretch;
    justify-content: center;
    pointer-events: none;
}

.chat-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: var(--taskbar-safe-zone);
    z-index: 2;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: stretch;
    pointer-events: none;
    padding: 0;
}

.chat-fullscreen > * {
    flex: 1;
    pointer-events: auto;
    width: 100%;
    height: 100%;
    max-width: none;
}

.program-window {
    width: min(960px, 90vw);
    margin-bottom: calc(110px + var(--taskbar-padding-y));
    background: rgba(3, 3, 3, 0.82);
    border: 1px solid rgba(255, 196, 150, 0.5);
    box-shadow: 0 35px 80px rgba(0, 0, 0, 0.65), inset 0 0 45px rgba(255, 150, 90, 0.04);
    color: rgba(255, 235, 222, 0.95);
    font-size: 1rem;
    pointer-events: auto;
}

.program-window-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: clamp(0.4rem, 2.0vw, 0.8rem);
    border-bottom: 1px solid rgba(255, 196, 150, 0.35);
    background: rgba(10, 10, 10, 0.72);
}

.program-window-meta {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.program-window-label {
    margin: 0;
    margin-left: 20px;
    font-size: clamp(0.4rem, 1.6vw, 1.1rem);
    color: rgba(255, 210, 180, 0.75);
}

.program-window-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-right: 1rem;
}

.user-badge {
    padding: 0.35rem 0.75rem;
    border: 1px solid rgba(119, 255, 181, 0.5);
    background: rgba(119, 255, 181, 0.1);
    color: #77ffb5;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
}

.floating-user-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    pointer-events: auto;
}

.program-window-body {
    padding: clamp(1.5rem, 4vw, 2.5rem);
    flex: 1;
}

.program-home {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.program-login {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: stretch;
}

.program-login-card,
.program-login-side {
    border: 1px solid rgba(255, 176, 120, 0.35);
    background: rgba(10, 10, 10, 0.6);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    box-shadow: inset 0 0 30px rgba(255, 150, 90, 0.08);
}

.program-login-kicker {
    margin: 0 0 1rem;
    text-transform: uppercase;
    letter-spacing: 0.4em;
    font-size: 0.8rem;
    color: rgba(255, 208, 172, 0.7);
}

.program-login-card h2 {
    margin: 0.35rem 0 0.5rem;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    letter-spacing: 0.05em;
}

.program-login-card p {
    margin: 0 0 1.5rem;
    color: rgba(255, 235, 222, 0.8);
    line-height: 1.6;
}

.program-login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.program-login-form label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.85rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 208, 172, 0.7);
}

.program-login-form input {
    border: 1px solid rgba(255, 176, 120, 0.35);
    background: rgba(3, 3, 3, 0.75);
    color: #fff5eb;
    padding: 0.65rem 0.9rem;
    font-size: 1rem;
    font-family: inherit;
    letter-spacing: 0.02em;
}

.program-login-form input:focus {
    outline: none;
    border-color: rgba(255, 176, 120, 0.8);
    box-shadow: 0 0 0 2px rgba(255, 176, 120, 0.2);
}

.program-login-form button,
.form-link-button {
    border: 1px solid rgba(255, 176, 120, 0.8);
    background: rgba(255, 176, 120, 0.15);
    color: inherit;
    padding: 0.75rem 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    font-size: inherit;
    font-family: inherit;
}

.program-login-form button:hover,
.program-login-form button:focus-visible,
.form-link-button:hover,
.form-link-button:focus-visible {
    outline: none;
    background: rgba(255, 176, 120, 0.25);
}

.program-login-side {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.program-login-side .login-side-label {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.35em;
    font-size: 0.75rem;
    color: rgba(255, 208, 172, 0.7);
}

.program-login-side ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    color: rgba(255, 235, 222, 0.85);
}

.program-login-side li {
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.program-home-hero {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.program-home-kicker {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.38em;
    font-size: 0.82rem;
    color: rgba(255, 208, 172, 0.75);
}

.program-home-hero h2 {
    margin: 0;
    font-size: clamp(2.1rem, 4vw, 3rem);
    letter-spacing: 0.06em;
}

.program-home-hero p {
    margin: 0;
    color: rgba(255, 235, 222, 0.82);
    line-height: 1.6;
}

.user-welcome {
    margin: 0;
    color: rgba(255, 235, 222, 0.9);
    font-size: 1rem;
}

.program-home-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.program-home-cta button,
.program-home-cta a,
.cta-button {
    border: 1px solid rgba(255, 176, 120, 0.8);
    background: transparent;
    color: inherit;
    padding: 0.65rem 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    cursor: pointer;
    transition: background 140ms ease, color 140ms ease;
    text-decoration: none;
    font-size: inherit;
    font-family: inherit;
}

.program-home-cta button:hover,
.program-home-cta button:focus-visible,
.program-home-cta a:hover,
.program-home-cta a:focus-visible,
.cta-button:hover,
.cta-button:focus-visible {
    outline: none;
    background: rgba(255, 176, 120, 0.15);
}

.program-home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.program-home-grid article {
    border: 1px solid rgba(255, 176, 120, 0.35);
    padding: 1rem 1.25rem;
    background: rgba(10, 10, 10, 0.65);
    box-shadow: inset 0 0 25px rgba(255, 150, 90, 0.05);
}

.program-download {
    display: flex;
    flex-direction: column;
    gap: clamp(1.5rem, 4vw, 2.75rem);
}

.download-hero {
    max-width: 640px;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.download-kicker {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.32em;
    font-size: 0.78rem;
    color: rgba(255, 208, 172, 0.75);
}

.download-hero h2 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 2.8rem);
    letter-spacing: 0.08em;
}

.download-hero p {
    margin: 0;
    color: rgba(255, 235, 222, 0.82);
    line-height: 1.6;
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: clamp(1rem, 3vw, 1.75rem);
}

.download-card {
    border: 1px solid rgba(255, 176, 120, 0.4);
    background: rgba(8, 8, 8, 0.78);
    box-shadow: inset 0 0 30px rgba(255, 150, 90, 0.06);
    padding: clamp(1.25rem, 3vw, 1.75rem);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.download-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}

.download-platform {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.4em;
    font-size: 0.8rem;
    color: rgba(255, 208, 172, 0.85);
}

.download-version {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255, 235, 222, 0.65);
}

.download-card p {
    margin: 0;
    color: rgba(255, 235, 222, 0.82);
    line-height: 1.5;
}

.download-actions {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.download-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255, 176, 120, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.35em;
    font-size: 0.78rem;
    color: inherit;
    text-decoration: none;
    background: rgba(255, 176, 120, 0.2);
    transition: background 140ms ease, transform 140ms ease;
}

.download-button:hover,
.download-button:focus-visible {
    outline: none;
    background: rgba(255, 176, 120, 0.35);
    transform: translateY(-2px);
}

.download-hash {
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    color: rgba(255, 235, 222, 0.55);
}

.download-reqs {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: rgba(255, 235, 222, 0.75);
}

.download-reqs li::before {
    content: "✦";
    margin-right: 0.4rem;
    color: rgba(255, 176, 120, 0.8);
}

.download-footnotes {
    border-top: 1px solid rgba(255, 176, 120, 0.2);
    padding-top: 1rem;
    color: rgba(255, 235, 222, 0.75);
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.download-footnotes ul {
    margin: 0;
    padding-left: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.download-footnotes a {
    color: rgba(255, 214, 190, 0.95);
}

.download-app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: clamp(1rem, 3vw, 1.75rem);
}

.download-app-card {
    border: 1px solid rgba(255, 176, 120, 0.4);
    background: rgba(8, 8, 8, 0.78);
    box-shadow: inset 0 0 30px rgba(255, 150, 90, 0.06);
    padding: clamp(1.5rem, 3vw, 2rem);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    transition: background 140ms ease, transform 140ms ease, border-color 140ms ease;
}

.download-app-card:hover,
.download-app-card:focus-visible {
    outline: none;
    background: rgba(12, 12, 12, 0.85);
    border-color: rgba(255, 176, 120, 0.65);
    transform: translateY(-2px);
}

.download-app-card h3 {
    margin: 0;
    font-size: 1.4rem;
    letter-spacing: 0.1em;
}

.download-app-desc {
    margin: 0;
    color: rgba(255, 235, 222, 0.75);
    line-height: 1.5;
    flex: 1;
}

.download-app-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-size: 0.75rem;
    color: rgba(255, 176, 120, 0.9);
}

.download-app-link::after {
    content: "\2192";
}

.download-button-alt {
    background: transparent;
    border-color: rgba(255, 176, 120, 0.5);
}

.download-button-alt:hover,
.download-button-alt:focus-visible {
    background: rgba(255, 176, 120, 0.15);
}

.download-back {
    padding-top: 1rem;
}

.download-back a {
    color: rgba(255, 208, 172, 0.85);
    text-decoration: none;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    transition: color 140ms ease;
}

.download-back a:hover,
.download-back a:focus-visible {
    color: rgba(255, 235, 222, 1);
}

.program-status {
    display: flex;
    flex-direction: column;
    gap: clamp(1.5rem, 4vw, 3rem);
}

.status-hero {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.status-kicker {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.35em;
    font-size: 0.78rem;
    color: rgba(255, 208, 172, 0.75);
}

.status-hero h2 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 2.8rem);
}

.status-hero p {
    margin: 0;
    color: rgba(255, 235, 222, 0.8);
    line-height: 1.6;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: clamp(1rem, 3vw, 1.75rem);
}

.status-card {
    border: 1px solid rgba(255, 176, 120, 0.4);
    background: rgba(8, 8, 8, 0.75);
    box-shadow: inset 0 0 30px rgba(255, 150, 90, 0.08);
    padding: clamp(1.1rem, 3vw, 1.6rem);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.status-card h3 {
    margin: 0;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.9rem;
    color: rgba(255, 214, 190, 0.95);
}

.status-state {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.status-state.is-online {
    color: #77ffb5;
}

.status-state.is-degraded {
    color: #ffd75e;
}

.status-state.is-maint {
    color: #ff9ba1;
}

.status-meta {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255, 235, 222, 0.65);
}

.status-log {
    border: 1px dashed rgba(255, 176, 120, 0.35);
    padding: clamp(1rem, 3vw, 1.5rem);
    background: rgba(6, 6, 6, 0.7);
}

.status-log h3 {
    margin: 0 0 0.75rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: rgba(255, 208, 172, 0.75);
}

.status-log ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.status-log li {
    display: flex;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: rgba(255, 235, 222, 0.85);
}

.log-time {
    font-family: 'Space Grotesk', monospace;
    letter-spacing: 0.1em;
    color: rgba(255, 214, 190, 0.8);
    min-width: 4ch;
}

.log-text {
    flex: 1;
}

.status-note {
    margin: 0.85rem 0 0;
    font-size: 0.85rem;
    color: rgba(255, 235, 222, 0.6);
}

.metric-label {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-size: 0.75rem;
    color: rgba(255, 208, 172, 0.7);
}

.metric-value {
    margin: 0.35rem 0 0;
    font-size: 2rem;
    font-variant-numeric: tabular-nums;
}

.metric-footnote {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
    color: rgba(255, 235, 222, 0.7);
}

.program-chat {
    display: grid;
    grid-template-columns: 90px 280px minmax(0, 1fr);
    min-height: 100%;
    border: 1px solid rgba(255, 176, 120, 0.2);
    background: rgba(6, 6, 6, 0.7);
    color: rgba(255, 235, 222, 0.92);
}

.chat-dock {
    border-right: 1px solid rgba(255, 176, 120, 0.25);
    padding: 1.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    background: rgba(10, 10, 10, 0.8);
}

.chat-dock-button {
    width: 72px;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    border: 1px solid rgba(255, 176, 120, 0.35);
    background: rgba(0, 0, 0, 0.35);
    color: rgba(255, 235, 222, 0.85);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.32em;
    text-align: center;
    padding: 0.35rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 140ms ease, border 140ms ease;
}

.chat-dock-button.is-active,
.chat-dock-button:focus-visible,
.chat-dock-button:hover {
    outline: none;
    border-color: rgba(255, 176, 120, 0.8);
    transform: translateY(-2px);
}

.chat-dock-button span {
    display: inline-block;
    line-height: 1.3;
}

.chat-dock-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.chat-dock-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chat-dock-button:hover .chat-dock-icon svg,
.chat-dock-button:focus-visible .chat-dock-icon svg,
.chat-dock-button.is-active .chat-dock-icon svg {
    filter: drop-shadow(0 0 10px rgba(255, 176, 120, 0.35));
}

.chat-sidebar {
    border-right: 1px solid rgba(255, 176, 120, 0.25);
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: rgba(8, 8, 8, 0.78);
}

.chat-sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.chat-sidebar-panel {
    display: none;
    flex-direction: column;
    gap: 1.25rem;
}

.chat-sidebar-panel.is-visible {
    display: flex;
}

.chat-sidebar-panel ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    color: rgba(255, 235, 222, 0.85);
}

.chat-sidebar-panel ul li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.45rem 0.25rem;
    border-bottom: 1px solid rgba(255, 176, 120, 0.1);
}

.chat-sidebar-panel ul li.is-active {
    background: rgba(255, 176, 120, 0.08);
    border-bottom-color: rgba(255, 176, 120, 0.4);
}

.chat-sidebar-panel ul li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}


.chat-sidebar-label {
    margin: 0 0 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.35em;
    font-size: 0.7rem;
    color: rgba(255, 208, 172, 0.7);
}

.chat-list-title {
    margin: 0;
    font-size: 0.95rem;
}

.chat-list-preview {
    margin: 0.2rem 0 0;
    font-size: 0.75rem;
    color: rgba(255, 235, 222, 0.55);
}

.presence-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    display: inline-flex;
}

.presence-dot.is-online {
    background: #77ffb5;
}

.presence-dot.is-idle {
    background: #ffc057;
}

.presence-handle {
    flex: 1;
    margin-left: 0.35rem;
}

.presence-status {
    font-size: 0.7rem;
    opacity: 0.7;
}

.channel-pill {
    min-width: 1.75rem;
    text-align: center;
    border-radius: 999px;
    background: rgba(255, 176, 120, 0.2);
    border: 1px solid rgba(255, 176, 120, 0.5);
    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
}


.chat-transcript {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background: rgba(4, 4, 4, 0.78);
}

.chat-transcript-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem 1.75rem 1rem;
    border-bottom: 1px solid rgba(255, 176, 120, 0.25);
}

.chat-transcript-label {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.4em;
    font-size: 0.7rem;
    color: rgba(255, 208, 172, 0.65);
}

.chat-transcript-header h2 {
    margin: 0.15rem 0 0;
    font-size: 1.75rem;
}

.chat-transcript-tools {
    display: flex;
    gap: 0.5rem;
}

.chat-transcript-tools button {
    border: 1px solid rgba(255, 176, 120, 0.45);
    background: transparent;
    color: inherit;
    padding: 0.4rem 0.85rem;
    letter-spacing: 0.2em;
    font-size: 0.75rem;
    text-transform: uppercase;
    cursor: pointer;
}

.chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 1rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-messages article {
    border: 1px solid rgba(255, 176, 120, 0.2);
    padding: 0.75rem 1rem;
    background: rgba(10, 10, 10, 0.6);
    box-shadow: inset 0 0 25px rgba(255, 150, 90, 0.08);
}

.chat-messages article.is-mine {
    border-color: rgba(119, 208, 255, 0.65);
    background: rgba(50, 83, 108, 0.35);
}

.chat-messages article header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

.chat-messages article p {
    margin: 0;
    line-height: 1.5;
}

.chat-input {
    border-top: 1px solid rgba(255, 176, 120, 0.25);
    padding: 1rem 1.75rem 1.5rem;
    display: flex;
    gap: 0.75rem;
}

.chat-input input {
    flex: 1;
    border: 1px solid rgba(255, 176, 120, 0.35);
    background: rgba(0, 0, 0, 0.6);
    color: inherit;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: inherit;
}

.chat-input input::placeholder {
    color: rgba(255, 235, 222, 0.45);
}

.chat-input input:focus {
    outline: none;
    border-color: rgba(255, 176, 120, 0.8);
    box-shadow: 0 0 0 2px rgba(255, 176, 120, 0.15);
}

.chat-input button {
    border: 1px solid rgba(255, 176, 120, 0.8);
    background: rgba(255, 176, 120, 0.2);
    color: inherit;
    padding: 0.75rem 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    cursor: pointer;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Form error styles */
.form-error {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(255, 100, 100, 0.6);
    background: rgba(255, 100, 100, 0.1);
    color: #ff9ba1;
    font-size: 0.9rem;
    animation: shake 0.3s ease-in-out;
}

.form-error .error-icon {
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid currentColor;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.form-error .error-message {
    flex: 1;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* HTMX loading states */
.htmx-request {
    opacity: 0.7;
    pointer-events: none;
}

.htmx-request button[type="submit"] {
    position: relative;
}

.htmx-request button[type="submit"]::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 176, 120, 0.2);
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

@media (max-width: 1200px) {
    .program-chat {
        grid-template-columns: 80px 240px minmax(0, 1fr);
    }
}

@media (max-width: 960px) {
    .program-chat {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .chat-sidebar {
        display: none;
    }
}

@media (max-width: 720px) {
    .chat-dock-button {
        width: 64px;
    }

    .chat-transcript-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .chat-input {
        flex-direction: column;
    }
}

@media (max-width: 720px) {
    .program-window-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .program-layer {
        padding: clamp(24px, 6vh, 80px) clamp(18px, 6vw, 60px) calc(110px + var(--taskbar-padding-y));
    }

    .program-login {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .taskbar {
        letter-spacing: 0.25em;
    }
}

.desktop {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.taskbar-start {
    border: 3px solid rgba(255, 196, 150, 0.5);
    min-width: 150px;
    padding: 0.45rem 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    background: transparent;
    color: inherit;
    font-weight: 600;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.55), 0 0 10px rgba(0, 0, 0, 0.4);
}

.taskbar-start .start-label {
    font-size: 1rem;
}

.start-launcher {
    position: relative;
    display: flex;
    align-items: stretch;
}

.start-menu {
    position: absolute;
    left: calc(-1 * var(--taskbar-padding-x) - 1px);
    bottom: calc(100% + 12px);
    width: clamp(220px, 24vw, 320px);
    padding: 1rem 1.25rem;
    border-radius: 0;
    border: 1px solid rgba(255, 196, 150, 0.5);
    background: radial-gradient(circle at top, rgba(18, 18, 18, 0.95), rgba(4, 4, 4, 0.96));
    box-shadow: 0 10px 45px rgba(0, 0, 0, 0.65), inset 0 0 35px rgba(255, 160, 82, 0.08);
    display: none;
    flex-direction: column;
    gap: 0.35rem;
    color: rgba(255, 224, 207, 0.92);
    text-align: left;
    z-index: 10;
}


.start-menu-inner {
    display: flex;
    justify-content: center;
}

.start-menu::after {
    content: "";
    position: absolute;
    left: 28px;
    bottom: -10px;
    width: 14px;
    height: 10px;
    background: transparent;
    border-top: 10px solid rgba(255, 196, 150, 0.5);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.6));
}

.start-menu[hidden] {
    display: none !important;
}

.start-menu.is-visible {
    display: flex;
}

.start-menu-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.start-menu-button {
    display: block;
    border-radius: 0;
    border: 1px solid rgba(255, 176, 120, 0.8);
    padding: 0.65rem 0.85rem;
    text-align: left;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: background 140ms ease, color 140ms ease;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.start-menu-icon {
    width: 1.6rem;
    height: 1.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.start-menu-icon svg {
    width: 85%;
    height: 85%;
    stroke: rgba(255, 235, 222, 0.9);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.start-menu-button span:last-child {
    flex: 1;
}
.start-menu-button:hover,
.start-menu-button:focus-visible {
    outline: none;
    background: rgba(255, 176, 120, 0.1);
    color: #fff2e7;
}

.start-menu-button:active {
    background: rgba(255, 176, 120, 0.2);
}

.taskbar-start:focus-visible,
.taskbar-start:hover {
    outline: none;
    border-color: rgba(255, 214, 190, 0.95);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35), 0 0 16px rgba(255, 176, 120, 0.5);
}

.taskbar-divider {
    width: 2px;
    background: rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    align-self: stretch;
}

.taskbar-programs {
    display: flex;
    align-items: stretch;
    gap: 0.4rem;
    flex: 1;
    min-width: 0;
}

.taskbar-address {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0 0.5rem;
    font-size: 0.9rem;
}

.address-home {
    display: inline-flex;
    align-items: center;
    color: rgba(255, 208, 172, 0.85);
    text-decoration: none;
}

.address-home:hover,
.address-home:focus-visible {
    color: rgba(255, 235, 222, 1);
}

.address-home svg {
    width: 1.1rem;
    height: 1.1rem;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.address-sep {
    color: rgba(255, 208, 172, 0.5);
}

.address-crumb {
    color: rgba(255, 208, 172, 0.85);
    text-decoration: none;
    letter-spacing: 0.05em;
}

.address-crumb:hover,
.address-crumb:focus-visible {
    color: rgba(255, 235, 222, 1);
}

.task-button {
    border: 1px solid rgba(255, 196, 150, 0.65);
    min-width: 150px;
    padding: 0.45rem 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    background: transparent;
    color: inherit;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.55), 0 0 10px rgba(0, 0, 0, 0.4);
}

.task-button:focus-visible,
.task-button:hover {
    outline: none;
    border-color: rgba(255, 214, 190, 0.95);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35), 0 0 16px rgba(255, 176, 120, 0.5);
}

.task-icon {
    width: 1.45rem;
    height: 1.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 235, 222, 0.9);
}

.task-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.task-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: clamp(0.8rem, 1.6vw, 1.0rem);
    padding-top: 0.1rem;
}

.taskbar-spacer {
    width: 1.5rem;
}

.taskbar-tray {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tray-icons {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tray-icon {
    --tray-border: rgba(255, 196, 150, 0.65);
    width: 2.2rem;
    height: 2.2rem;
    border: 1px solid var(--tray-border);
    background: transparent;
    color: rgba(255, 235, 222, 0.9);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.55), 0 0 8px rgba(0, 0, 0, 0.45);
    cursor: pointer;
    text-decoration: none;
}

.tray-icon:focus-visible,
.tray-icon:hover {
    outline: none;
    border-color: rgba(255, 214, 190, 0.95);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35), 0 0 12px rgba(255, 176, 120, 0.45);
}

.tray-icon svg {
    width: 80%;
    height: 80%;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.tray-clock {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
}

.tray-clock time {
    display: inline-flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 0.25rem;
    min-width: 9ch;
}


.clock-digits {
    font-size: 1.1rem;
    min-width: 6ch;
    text-align: right;
    display: inline-block;
}

.clock-suffix {
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    min-width: 3.5ch;
    text-align: right;
    display: inline-block;
    opacity: 0.8;
}

.tray-date {
    font-size: 0.88rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0.75;
    min-width: 10ch;
    text-align: right;
    display: inline-block;
}

.tray-clock:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.65);
    outline-offset: 3px;
}

/* Google Fonts import */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

/* Dashboard */
.program-dashboard {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.dashboard-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dashboard-header h2 {
    margin: 0;
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
    letter-spacing: 0.06em;
}

.dashboard-welcome {
    margin: 0;
    color: rgba(255, 235, 222, 0.8);
    font-size: 1rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.dashboard-card {
    background: rgba(10, 10, 10, 0.5);
    border: 1px solid rgba(255, 176, 120, 0.3);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dashboard-card h3 {
    margin: 0;
    font-size: 1.1rem;
    letter-spacing: 0.1em;
    color: rgba(255, 210, 180, 0.95);
}

.dashboard-card-desc {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255, 235, 222, 0.7);
    line-height: 1.5;
}

.dashboard-card-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.5rem;
}

.dashboard-card-status .status-item {
    font-size: 0.85rem;
    color: rgba(255, 235, 222, 0.85);
    word-break: break-all;
}

.dashboard-card-status .status-badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.2rem 0.5rem;
    border-radius: 2px;
}

.status-verified {
    background: rgba(119, 255, 181, 0.15);
    color: #77ffb5;
    border: 1px solid rgba(119, 255, 181, 0.4);
}

.status-unverified {
    background: rgba(255, 176, 120, 0.15);
    color: #ffb078;
    border: 1px solid rgba(255, 176, 120, 0.4);
}

.dashboard-card-button {
    margin-top: 0.75rem;
    padding: 0.6rem 1rem;
    border: 1px solid rgba(255, 176, 120, 0.6);
    background: transparent;
    color: inherit;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 140ms ease;
    font-family: inherit;
    text-decoration: none;
    text-align: center;
    display: inline-block;
}

.dashboard-card-button:hover:not(:disabled),
.dashboard-card-button:focus-visible:not(:disabled) {
    background: rgba(255, 176, 120, 0.2);
    outline: none;
}

.dashboard-card-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dashboard-card-danger {
    border-color: rgba(255, 100, 100, 0.3);
}

.dashboard-button-danger {
    border-color: rgba(255, 100, 100, 0.6);
    color: #ff9090;
}

.dashboard-button-danger:hover:not(:disabled),
.dashboard-button-danger:focus-visible:not(:disabled) {
    background: rgba(255, 100, 100, 0.2);
}
