:root {
    color-scheme: dark;
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
    --ink: #09141b;
    --paper: #f7f7f1;
    --surface: #fffefa;
    --rail: #edf1e9;
    --line: #dce2d8;
    --muted: #52645e;
    --text: #152b26;
    --accent: #aef5cf;
    --desktop-text: #edf9f5;
    --desktop-muted: #adcbc3;
    --glass: #0d231fe8;
    --window-line: #a4bdb1;
    --background: radial-gradient(ellipse at 76% 36%, #236d55 0, #10372f 27%, transparent 59%), radial-gradient(ellipse at 89% 94%, #14374a, transparent 54%), #08151d;
    --task-height: 66px;
}
:root[data-theme="light"] {
    color-scheme: light;
    --desktop-text: #16332b;
    --desktop-muted: #3a5d52;
    --glass: #f8fff1ed;
    --background: radial-gradient(ellipse at 75% 36%, #a3d7ad, transparent 58%), radial-gradient(ellipse at 90% 95%, #c4dce9, transparent 54%), #dbe9e2;
}
:root[data-wallpaper="midnight"] { --background: radial-gradient(ellipse at 78% 42%, #303963, transparent 63%), #0b1021; }
:root[data-theme="light"][data-wallpaper="midnight"] { --background: radial-gradient(ellipse at 80% 40%, #b8c4eb, transparent 60%), #e1e4ef; }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--desktop-text); }
button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid #3ebd8a; outline-offset: 3px; }
[hidden] { display: none !important; }
svg { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.desktop-page { overflow: hidden; }
.desktop { position: relative; isolation: isolate; height: calc(100vh - var(--task-height)); height: calc(100dvh - var(--task-height)); overflow: hidden; }
.desktop::before, .auth-intro::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background-image: linear-gradient(90deg, #8cd6b313 1px, transparent 1px), linear-gradient(#8cd6b313 1px, transparent 1px); background-size: 48px 48px; }
.desktop-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 27px 36px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--accent); color: #123c2c; font-size: 15px; font-weight: 900; letter-spacing: -.09em; flex-shrink: 0; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: .97rem; letter-spacing: .1em; }
.brand small, .kicker, .version { color: var(--desktop-muted); font: 650 .66rem/1.5 ui-monospace, Consolas, monospace; letter-spacing: .13em; }
#desktop-clock { font: 600 .78rem/1.4 ui-monospace, Consolas, monospace; color: var(--desktop-muted); text-align: right; }
.shortcuts { position: absolute; inset: 102px auto 23px 23px; display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 71px); gap: 7px; overflow: auto; }
.shortcut { width: 84px; border: 1px solid transparent; border-radius: 10px; background: transparent; display: grid; place-content: center; justify-items: center; gap: 6px; padding: 4px; font-size: .71rem; text-align: center; }
.shortcut:hover, .shortcut:focus-visible { border-color: #77c6a36b; background: #85cbb521; }
.app-icon { display: inline-grid; place-items: center; width: 41px; height: 41px; color: #a9f2ce; background: #123e33; border: 1px solid #5fa88c62; border-radius: 12px; flex-shrink: 0; }
.orbital { position: absolute; top: 48%; right: 8%; width: min(51vw, 690px); aspect-ratio: 1; transform: translateY(-50%); display: grid; place-items: center; z-index: -1; pointer-events: none; }
.orbital i { position: absolute; inset: 8%; border: 1px solid #98dbb34d; border-radius: 50%; }
.orbital i:nth-child(2) { inset: 16%; border-style: dashed; opacity: .6; }
.orbital i:nth-child(3) { inset: 0; border-inline-color: transparent; transform: rotate(-28deg); opacity: .45; }
.orbital span { color: #b8ffe326; font-size: clamp(90px, 17vw, 255px); font-weight: 900; letter-spacing: -.14em; padding-right: .14em; }
.welcome { position: absolute; z-index: 0; top: 48%; right: 4%; width: clamp(235px, 23vw, 345px); padding: 24px; border: 1px solid #8cd6b352; border-radius: 18px; background: var(--glass); box-shadow: 0 22px 58px #03130b35; }
.welcome h1 { font-size: clamp(1.4rem, 2.3vw, 2.05rem); line-height: 1.05; margin: 14px 0 10px; letter-spacing: -.04em; overflow-wrap: anywhere; }
.welcome p { font-size: .88rem; color: var(--desktop-muted); line-height: 1.6; margin: 0 0 18px; }
.welcome button, .start-panel footer button, .start-panel footer a { border: 0; border-radius: 8px; background: #76d6ae24; padding: 9px 12px; color: inherit; text-decoration: none; font-size: .8rem; font-weight: 700; }
.signal { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #54c294; margin-right: 5px; vertical-align: .09em; }
.version { position: absolute; right: 36px; bottom: 22px; border: 1px solid #80c8a853; border-radius: 5px; padding: 3px 8px; }
.taskbar { position: fixed; bottom: 0; inset-inline: 0; z-index: 10; min-height: var(--task-height); display: flex; align-items: center; gap: 13px; padding: 8px 18px; background: var(--glass); border-top: 1px solid #80c8a847; backdrop-filter: blur(20px); }
.start, .dock button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; border-radius: 9px; background: #76d6ae1b; border: 1px solid #80c8a841; padding: 5px 10px; font-size: .8rem; font-weight: 720; white-space: nowrap; }
.start .brand-mark { width: 25px; height: 25px; border-radius: 6px; font-size: .68rem; }
.dock { display: flex; gap: 6px; padding: 4px; overflow-x: auto; }
.dock button[aria-pressed="true"], .start[aria-expanded="true"] { background: #76d6ae3e; border-color: #80c8a884; }
.dock svg { width: 16px; height: 16px; }
.task-label { margin-left: auto; color: var(--desktop-muted); white-space: nowrap; font-size: .72rem; }
.start-panel { position: fixed; z-index: 11; left: 16px; bottom: calc(var(--task-height) + 9px); width: min(330px, calc(100vw - 32px)); max-height: calc(100dvh - var(--task-height) - 18px); overflow: auto; padding: 18px; background: var(--glass); backdrop-filter: blur(24px); border: 1px solid #80c8a871; border-radius: 16px; box-shadow: 0 24px 70px #06171165; }
.start-panel h2 { font-size: 1.2rem; margin: 4px 0 14px; overflow-wrap: anywhere; }
.menu-apps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.menu-apps button { background: transparent; display: flex; gap: 8px; align-items: center; border: 0; border-radius: 7px; padding: 8px; font-size: .79rem; text-align: left; }
.menu-apps button:hover, .welcome button:hover, .start-panel footer button:hover, .start-panel footer a:hover { background: #76d6ae3e; }
.start-panel footer { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 14px; border-top: 1px solid #80c8a847; }
.start-panel footer form { margin-left: auto; }
.windows { position: absolute; inset: 0; pointer-events: none; }
.window { --app-width: 830px; position: absolute; left: var(--left); top: var(--top); width: min(var(--app-width), calc(100% - 160px)); height: min(610px, calc(100% - 111px)); min-width: min(455px, 100%); min-height: min(280px, 100%); max-width: calc(100% - var(--left)); max-height: calc(100% - var(--top)); display: flex; flex-direction: column; overflow: hidden; resize: both; pointer-events: auto; border: 1px solid var(--window-line); border-radius: 16px; background: var(--paper); color: var(--text); color-scheme: light; box-shadow: 0 25px 65px #0007; }
.window.active { border-color: #94d6b2; }
.window.maximized { inset: 0 !important; width: 100% !important; height: 100% !important; max-width: 100%; max-height: 100%; border-radius: 0; resize: none; }
.window[data-app="settings"] { --app-width: 590px; }
.window[data-app="mail"], .window[data-app="news"], .window[data-app="file"] { --app-width: 680px; }
.window-bar { min-height: 47px; padding: 6px 11px 6px 15px; border-bottom: 1px solid var(--line); background: #e8eee5; display: flex; align-items: center; justify-content: space-between; gap: 8px; touch-action: none; cursor: move; user-select: none; }
.window-title { display: flex; align-items: center; gap: 9px; margin: 0; font-size: .83rem; }
.window-title svg { width: 18px; height: 18px; color: #287b60; }
.window-controls { display: flex; gap: 4px; }
.window-controls button { display: grid; place-items: center; min-width: 31px; min-height: 30px; border: 0; border-radius: 6px; background: transparent; }
.window-controls button:hover { background: #d3e3d8; }
.window-controls button[data-window-action="close"]:hover { background: #f7d9d1; }
.window-controls svg { width: 18px; height: 18px; }
.window-content { min-height: 0; flex: 1; overflow: auto; }
.app-layout { display: grid; grid-template-columns: minmax(155px, 25%) minmax(0, 1fr); min-height: 100%; }
.app-rail { background: var(--rail); border-right: 1px solid var(--line); padding: 21px 13px; }
.app-rail > .app-icon { margin: 0 0 12px 4px; }
.app-rail h3 { font-size: 1.09rem; letter-spacing: -.03em; margin: 0 4px 6px; }
.app-rail p { font-size: .76rem; color: var(--muted); line-height: 1.52; margin: 0 4px 17px; }
.rail-nav { display: grid; gap: 4px; }
.rail-nav button, .secondary, .primary { border: 1px solid #cadad0; border-radius: 8px; padding: 8px 11px; background: var(--surface); color: var(--text); font-size: .8rem; font-weight: 680; }
.rail-nav button { text-align: left; background: transparent; border-color: transparent; overflow-wrap: anywhere; }
.rail-nav button:hover, .rail-nav button[aria-pressed="true"], .secondary:hover { background: #dfece0; border-color: #c6dccd; }
.app-main { padding: clamp(17px, 2.25vw, 32px); min-width: 0; overflow-wrap: anywhere; }
.app-main .kicker { color: #28735b; }
.app-heading { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 9px; margin: 5px 0 16px; }
.app-heading h3 { font-size: clamp(1.5rem, 3vw, 2.2rem); letter-spacing: -.05em; line-height: 1.06; margin: 0; }
.app-heading .secondary { display: inline-flex; align-items: center; gap: 5px; }
.app-heading .secondary[aria-disabled="true"] { opacity: .65; cursor: wait; }
.app-heading svg { width: 14px; height: 14px; }
.search { display: block; margin: 0 0 14px; font-size: .8rem; font-weight: 650; }
.search input, .field input, .field select { display: block; width: 100%; border: 1px solid #cad8cd; border-radius: 8px; background: var(--surface); color: var(--text); padding: 9px 11px; margin-top: 5px; }
.empty-state { display: grid; justify-items: start; align-content: center; min-height: 180px; padding: clamp(16px, 3vw, 30px); border: 1px dashed #b7cdbf; border-radius: 13px; background: #f0f3eb; }
.empty-state .app-icon { width: 36px; height: 36px; border-radius: 9px; margin-bottom: 11px; }
.empty-state h4 { font-size: 1.02rem; margin: 0 0 5px; }
.empty-state p, .status, .app-description { color: var(--muted); font-size: .86rem; line-height: 1.55; margin: 0; }
.status { margin: 10px 0 0; }
.error, .errorlist { color: #913629; }
.post, .person, .profile, .message { padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); margin: 0 0 10px; }
.post p, .profile p, .message p, .comments p { white-space: pre-wrap; margin: 8px 0; line-height: 1.55; }
.post img { width: 100%; max-height: 360px; object-fit: contain; border-radius: 8px; }
.avatar { display: inline-grid; place-items: center; width: 35px; height: 35px; border-radius: 50%; background: #e1eee4; color: #206249; font-weight: 700; flex-shrink: 0; }
img.avatar { object-fit: cover; }
.person-link { display: inline-flex; align-items: center; gap: 8px; font-size: .89rem; font-weight: 730; padding: 2px; background: transparent; border: 0; border-radius: 5px; }
.person-link:hover { text-decoration: underline; }
.post time { color: var(--muted); display: block; margin-top: 6px; font-size: .72rem; }
.comments { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 9px; font-size: .83rem; }
.comments summary { cursor: pointer; }
.comments article { margin-top: 10px; }
.profile dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; font-size: .83rem; }
.profile dt { font-weight: 700; }
.profile dd { margin: 0; }
.message { max-width: 87%; }
.message.player { margin-left: auto; background: #e2f0e4; }
.message small { color: var(--muted); font-weight: 650; }
.field { margin: 0 0 14px; }
.settings-fields { border: 0; margin: 0; padding: 0; min-width: 0; }
.field label { font-size: .85rem; font-weight: 690; }
.primary { background: #143f31; color: #f1fff6; border-color: #143f31; padding: 10px 14px; }
.primary:hover { background: #22684f; }
.noscript { position: absolute; top: 95px; left: 35px; }
.auth-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 26px; }
.auth-layout { position: relative; display: grid; grid-template-columns: 1fr minmax(310px, 460px); width: min(100%, 990px); min-height: 560px; border: 1px solid #8cd6b35e; border-radius: 23px; background: #102a26cc; box-shadow: 0 35px 100px #0007; overflow: hidden; }
.auth-intro { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 31px; }
.auth-intro .orbital { width: min(95%, 540px); right: 0; }
.auth-intro .orbital span { font-size: clamp(90px, 17vw, 170px); }
.auth-display p { font-size: clamp(1.45rem, 3vw, 2.65rem); line-height: 1.02; max-width: 13ch; margin: 9px 0 0; letter-spacing: -.055em; font-weight: 740; }
.auth-card { display: grid; align-content: center; padding: clamp(21px, 4vw, 44px); background: var(--paper); color: var(--text); color-scheme: light; }
.auth-card .kicker { color: #28735b; margin: 0 0 7px; }
.auth-card h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); letter-spacing: -.06em; line-height: 1.03; margin: 0; }
.auth-description { color: var(--muted); line-height: 1.5; margin: 10px 0 20px; }
.help, .errorlist, .auth-alternate { font-size: .8rem; line-height: 1.45; }
.help { color: var(--muted); margin-top: 5px; }
.help ul, .errorlist { padding-left: 17px; margin: 4px 0; }
.auth-card form .primary { width: 100%; }
.auth-alternate { margin-top: 18px; }
.auth-alternate a { color: #21684f; font-weight: 720; }
@media (max-height: 680px) and (min-width: 761px) {
    .shortcuts { grid-template-rows: repeat(4, 66px); gap: 4px 0; }
}
@media (min-height: 681px) and (max-height: 800px) and (min-width: 761px) {
    .shortcuts { top: 91px; bottom: 15px; grid-template-rows: repeat(7, 66px); gap: 4px; }
}
@media (max-width: 1000px) {
    .welcome { top: auto; bottom: 60px; }
}
@media (max-width: 760px) {
    :root { --task-height: 58px; }
    .desktop-header { padding: 17px; }
    .shortcuts { inset: 80px 10px auto 10px; grid-auto-flow: row; grid-template: auto / repeat(auto-fit, minmax(74px, 1fr)); gap: 4px; }
    .shortcut { min-height: 67px; width: auto; }
    .welcome { bottom: 45px; right: 15px; width: min(340px, calc(100% - 30px)); padding: 14px; }
    .welcome p { margin-bottom: 7px; }
    .orbital { width: 90vw; right: -5%; }
    .version { right: 15px; bottom: 10px; }
    .window { inset: 0 !important; width: 100% !important; height: 100% !important; max-width: 100%; max-height: 100%; border-radius: 0; border-width: 0; resize: none; }
    .window-bar { cursor: auto; }
    .window-controls [data-window-action="maximize"] { display: none; }
    .taskbar { gap: 6px; padding-inline: 9px; }
    .task-label { display: none; }
    .dock button span { display: none; }
    .dock button { min-width: 38px; }
}
@media (max-width: 470px) {
    .app-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
    .app-rail { padding: 9px 13px; border-right: 0; border-bottom: 1px solid var(--line); }
    .app-rail > .app-icon, .app-rail h3, .app-rail p { display: none; }
    .rail-nav { display: flex; flex-wrap: wrap; }
    .auth-layout { grid-template-columns: minmax(0, 1fr); min-height: 0; }
    .auth-intro { padding: 15px; }
    .auth-display, .auth-intro .orbital { display: none; }
    .auth-page { padding: 12px; }
}
@media (max-height: 500px) and (max-width: 760px) {
    .welcome { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
