:root {
  --ink:#152341;
  --muted:#52617a;
  --selected:#dbe6fb;
  --chrome-top:#557bc3;
  --chrome-bottom:#244887;
  --chrome-edge:#1b3568;
  --accent:#254a90;
  --taskbar-height:47px;
  font-family:Tahoma,Verdana,'Malgun Gothic',sans-serif;
  background:#142752;
}

.login-screen {
  min-height:100dvh; max-height:100dvh; overflow:auto; display:grid; place-items:center;
  padding:clamp(14px,5vw,60px);
  background:linear-gradient(135deg,#0a235f70,#14377a26),url('./district-coast.png') center/cover;
}
.login-frame {
  width:min(830px,100%); border:1px solid #10264d; border-radius:7px; overflow:hidden;
  box-shadow:0 28px 80px #10255280,0 2px 0 #e4efff8c inset;
  background:#f3f5fa;
}
.login-band,.login-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:0 18px; font-size:.69rem; font-weight:700; letter-spacing:.12em; }
.login-band { height:36px; color:#f9fbff; background:linear-gradient(#486daf,#274783); border-bottom:1px solid #17366f; }
.login-footer { justify-content:flex-end; height:36px; color:#263f70; background:linear-gradient(#e8efff,#cddaf4); border-top:1px solid #b3c3e2; letter-spacing:.06em; }
.login-grid { display:grid; grid-template-columns:minmax(215px,.8fr) minmax(330px,1.2fr); }
.login-brand { display:flex; align-items:flex-start; justify-content:center; flex-direction:column; gap:23px; padding:clamp(26px,5vw,54px); color:white; background:linear-gradient(147deg,#142b60f2,#213f8bc4 63%,#25498944),url('./district-coast.png') 77% center/cover; border-right:1px solid #1e417b; }
.login-brand strong { display:block; font-size:clamp(2.2rem,6vw,4.5rem); line-height:.92; letter-spacing:-.08em; }
.login-brand span { display:block; margin-top:9px; font-size:1.03rem; letter-spacing:.12em; }
.workstation-mark { display:flex; align-items:flex-end; gap:4px; height:45px; transform:skewY(-10deg); }
.workstation-mark i { display:block; width:15px; height:26px; background:#aecaff; border:1px solid #fff9; box-shadow:2px 2px #0f285f; }
.workstation-mark i:nth-child(2) { height:35px; background:#daecff; }
.workstation-mark i:nth-child(3) { height:44px; background:#b8d680; }
.login-panel { padding:clamp(23px,4vw,42px); background:linear-gradient(140deg,#ffffff,#edf2fc); }
.login-panel h1 { margin:0 0 22px; color:#1d396c; text-align:center; font-size:clamp(1.33rem,3vw,1.7rem); line-height:1.15; font-weight:700; letter-spacing:-.045em; }
.login-avatar { display:grid; place-items:center; width:66px; height:66px; margin:0 auto 13px; border:1px solid #34588d; border-radius:50%; background:linear-gradient(145deg,#7199da,#375c9c); box-shadow:inset 0 0 0 2px #ffffff4f,0 2px 4px #213f702b; color:#f6faff; }
.login-avatar .icon { width:36px; height:36px; }
#login-form { display:grid; gap:6px; }
#login-form label { font-weight:700; font-size:.81rem; }
#login-form input { width:100%; min-height:35px; padding:6px 9px; border:1px solid #839dc7; border-radius:2px; background:white; color:#172c50; font:inherit; }
#login-form label[for=login-password] { margin-top:5px; }
#login-form .control { margin-top:11px; min-width:95px; justify-self:end; }
#login-error { margin:4px 0 0; color:#852d35; font-size:.81rem; }

[data-member=anon] {
  --chrome-top:#41577d; --chrome-bottom:#25334f; --chrome-edge:#172136;
  --accent:#324f83; --selected:#dce7fb; --start-light:#e8eef9; --start-dark:#aebedc;
  --wall-image:url('./wallpaper-anon.jpg'); --wall-pos:60% 54%; --wall-filter:saturate(.86);
  --wall-wash:linear-gradient(158deg,#15203b24,transparent 52%,#182c4a20);
  --label-fill:#172844d9;
}
[data-member=revi] {
  --chrome-top:#716287; --chrome-bottom:#493d62; --chrome-edge:#382b51;
  --accent:#645475; --selected:#e8def3; --start-light:#f8e9f4; --start-dark:#cdb8d9;
  --wall-image:url('./wallpaper-revi.jpg'); --wall-pos:52% 57%; --wall-filter:saturate(.97);
  --wall-wash:linear-gradient(158deg,#45305d28,transparent 64%,#23254c26);
  --label-fill:#382c53d9;
}
[data-member=tama] {
  --chrome-top:#94618f; --chrome-bottom:#563a70; --chrome-edge:#463052;
  --accent:#794774; --selected:#f0e0ee; --start-light:#fff0cf; --start-dark:#dfb87f;
  --wall-image:url('./wallpaper-tama-pixel.png'); --wall-pos:54% 58%; --wall-filter:saturate(.96);
  --wall-wash:linear-gradient(132deg,#0d4c611f,transparent 38%,#92508d2b 83%,#94592929);
  --label-fill:#42265bdc;
}
[data-member=log] {
  --chrome-top:#567780; --chrome-bottom:#304e59; --chrome-edge:#233c47;
  --accent:#375f69; --selected:#dcebee; --start-light:#edf5ed; --start-dark:#bad0c8;
  --wall-image:url('./wallpaper-log.jpg'); --wall-pos:58% 57%; --wall-filter:saturate(.82);
  --wall-wash:linear-gradient(156deg,#e2edf42f,transparent 57%,#30485233);
  --label-fill:#28424dd9;
}
[data-member=guest] {
  --chrome-top:#557bc3; --chrome-bottom:#244887; --chrome-edge:#1b3568;
  --start-light:#e8f2df; --start-dark:#afc797;
  --wall-image:url('./district-coast.png'); --wall-pos:center; --wall-filter:none;
  --wall-wash:linear-gradient(transparent,transparent); --label-fill:#17345ab3;
}
[data-member=guest] :is(.plan,.station-id) { display:none; }
#workstation { position:fixed; inset:0; }
#desktop { inset:0 0 var(--taskbar-height); background:var(--chrome-bottom); }
.wallpaper::before,.wallpaper-atmosphere,.wallpaper-atmosphere::before,.wallpaper-atmosphere::after { content:''; position:absolute; inset:0; }
.wallpaper::before,.wallpaper-atmosphere::before {
  background:var(--wall-wash),var(--wall-image) var(--wall-pos)/cover;
  filter:var(--wall-filter);
}
[data-member=tama] .wallpaper::before,[data-member=tama] .wallpaper-atmosphere::before { image-rendering:pixelated; }

/* Each effect samples the signed-in member's wallpaper. */
[data-member=anon] .wallpaper-atmosphere::before {
  clip-path:polygon(41% 39%,58% 39%,58% 40.5%,41% 40.5%,41% 39%,62% 63%,92% 63%,92% 65.7%,62% 65.7%,62% 63%,41% 39%);
  transform:translate(11px,-6px);
  opacity:.78;
  animation:anon-interference 21s step-end infinite;
}
[data-member=anon] .wallpaper-atmosphere::after {
  background:repeating-linear-gradient(0deg,transparent 0 4px,#c3daff24 4px 5px),linear-gradient(92deg,transparent 33%,#6d9df05c 64%,transparent 93%);
  mask-image:radial-gradient(ellipse 57% 34% at 78% 62%,#000,transparent);
  opacity:.56;
}
@keyframes anon-interference {
  0%,82%,100% { transform:translate(11px,-6px); }
  83% { transform:translate(24px,-13px); }
  84% { transform:translate(5px,5px); }
  85%,87% { transform:translate(13px,-3px); }
  86% { transform:translate(19px,-9px); }
}

[data-member=revi] .wallpaper-atmosphere::before {
  mask-image:radial-gradient(ellipse 47% 40% at 72% 64%,#000 8%,transparent 88%);
  transform:translate(17px,-13px) scale(1.035);
  filter:saturate(.6) hue-rotate(24deg) blur(2px);
  opacity:.47;
  animation:revi-afterimage 27s ease-in-out infinite;
}
[data-member=revi] .wallpaper-atmosphere::after {
  background:radial-gradient(ellipse 42% 46% at 68% 41%,#f5bbbf25,transparent 95%),radial-gradient(ellipse 57% 48% at 81% 91%,#29225135,transparent 100%);
}
@keyframes revi-afterimage {
  0%,100% { transform:translate(17px,-13px) scale(1.035); opacity:.47; }
  32% { transform:translate(-8px,4px) scale(1.018); opacity:.29; }
  47% { transform:translate(25px,-19px) scale(1.045); opacity:.52; }
  78% { transform:translate(14px,-8px) scale(1.03); opacity:.37; }
}

[data-member=tama] .wallpaper-atmosphere {
  background:linear-gradient(130deg,transparent 17%,#bee5d0a1 47%,#d881845e 73%,transparent 85%);
  clip-path:polygon(29% 25%,53% 13%,52% 36%,72% 45%,63% 75%,43% 86%,36% 65%,17% 63%);
  opacity:.69;
}
[data-member=tama] .wallpaper-atmosphere::before {
  clip-path:polygon(32% 25%,54% 14%,54% 36%,74% 45%,65% 76%,45% 85%,38% 66%,19% 62%);
  transform:translate(-18px,14px) scale(1.045);
  filter:hue-rotate(-18deg) saturate(.88) brightness(1.07);
  opacity:.82;
  animation:tama-refraction 24s ease-in-out infinite;
}
[data-member=tama] .wallpaper-atmosphere::after {
  background:linear-gradient(148deg,transparent 46.8%,#f1deb286 47%,#efc2925c 63.2%,transparent 63.4%),linear-gradient(58deg,transparent 35.6%,#92cfc073 35.8%,#f4d6eb3b 52%,transparent 52.2%);
  opacity:.53;
}
@keyframes tama-refraction {
  0%,100% { transform:translate(-18px,14px) scale(1.045); }
  50% { transform:translate(3px,-9px) scale(1.09); }
}

[data-member=log] .wallpaper-atmosphere::before {
  mask-image:radial-gradient(ellipse 36% 35% at 54% 67%,#000,transparent 85%);
  transform:translate(-16px,-17px) scale(1.025);
  filter:saturate(.15) blur(3px);
  opacity:.43;
  animation:log-recollection 32s ease-in-out infinite;
}
[data-member=log] .wallpaper-atmosphere::after {
  background:radial-gradient(ellipse 57% 20% at 51% 64%,#e7f1ed80,#d8e9e54d 41%,transparent 100%),radial-gradient(ellipse 28% 55% at 39% 61%,#dfeee839,transparent 93%);
}
@keyframes log-recollection {
  0%,100% { opacity:.43; }
  37%,55% { opacity:0; }
  82% { opacity:.38; }
}
@media (prefers-reduced-motion:reduce) {
  .wallpaper .wallpaper-atmosphere::before { animation:none; }
}

.plan { color:#eff5ff; opacity:.16; }
.station-id { z-index:1; left:auto; right:24px; bottom:22px; display:grid; gap:5px; padding:10px 12px; color:#f7faff; background:var(--label-fill); border:1px solid #d4e4ff77; text-shadow:0 1px #142853; }
.station-id b { font:700 .84rem Tahoma,sans-serif; letter-spacing:.12em; }
.station-id span { font-size:.70rem; }
.desktop-items { inset:19px auto auto 15px; grid-template-rows:repeat(4,72px); grid-auto-columns:104px; gap:6px; }
.desk-item { color:#fff; text-shadow:0 1px 2px #0c1c40,1px 1px #152546; }
.desk-item span { padding:2px 4px; background:var(--label-fill); border-radius:2px; }
.desk-item:hover { background:#dcecff28; border-color:#dcecff6e; }
.desk-item[aria-pressed=true] { background:#1e438b79; border-color:#d4e5ff9e; }
.desk-item:focus-visible { outline-color:#f6fbff; }
.desk-item .item-icon { width:44px; height:40px; filter:drop-shadow(1px 2px 1px #12234a75); }
[data-member=revi] .desktop-items { grid-template-rows:repeat(3,76px); }
[data-member=tama] .desktop-items { left:auto; right:16px; grid-template-rows:repeat(3,75px); }
[data-member=log] .desktop-items { left:auto; right:17px; grid-template-rows:repeat(5,69px); }
[data-desktop=personal] span { box-shadow:inset 0 -1px var(--start-dark); }

.program.window { width:min(405px,calc(100% - 24px)); max-height:calc(100% - 16px); }
.program .window-content { overflow:auto; background:#f3f5fa; }
.program-body { display:grid; gap:12px; padding:15px; }
.program-body label { display:flex; align-items:center; gap:12px; }
.program-body input[type=range] { flex:1; accent-color:var(--accent); }
.program-body output { font:.74rem/1.35 var(--mono); }
.program-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:7px; }
.program-toolbar output { margin-inline-start:auto; }
.program-toolbar button[aria-pressed=true] { background:var(--selected); box-shadow:inset 1px 1px #18294755; }
.program-stage { color:var(--accent); font:.78rem var(--mono); font-weight:700; }
.program-help { margin:0; color:var(--muted); font-size:.8rem; line-height:1.4; }
.program-toolbar > span { margin-inline-start:auto; font-size:.76rem; }
.program-reward { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; padding:9px 15px; border-top:1px solid #becade; color:var(--ink); background:var(--selected); font-size:.75rem; }
.signal-plot,.runner-track { display:block; width:100%; border:1px solid var(--chrome-edge); }
.signal-plot { background-color:#19253b; background-image:linear-gradient(#82a4bc2a 1px,transparent 1px),linear-gradient(90deg,#82a4bc2a 1px,transparent 1px); background-size:15px 15px; }
.signal-plot polyline { stroke:#bce7ae; stroke-width:1.3px; }
.signal-plot [data-reference-trace] { stroke:#b5c7e0; stroke-dasharray:1.5 2.5; }
.runner-track { image-rendering:pixelated; }
.mine-board,.index-grid { width:min(100%,calc(var(--columns) * var(--cell-size) + 6px)); display:grid; grid-template-columns:repeat(var(--columns),minmax(0,1fr)); justify-self:center; gap:2px; padding:3px; background:#9faab9; border:1px solid #7c899e; }
.mine-board { --cell-size:31px; }
.index-grid { --cell-size:50px; }
.mine-board button,.index-grid button { aspect-ratio:1; min-width:0; font:700 .81rem var(--mono); color:var(--ink); background:linear-gradient(#fafbff,#d2ddeb); border:1px solid #627899; box-shadow:inset 1px 1px #fff; }
.mine-board button { padding:0; }
.mine-board button:disabled,.index-grid button:disabled { background:#e5eaf2; border-color:#aebaca; box-shadow:none; }
.mine-board button[data-hit] { color:#71191c; background:#f4d6d7; border-color:#aa5057; }
.calculator-form { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr) auto; gap:6px; }
.calculator-form input,.calculator-form select { min-width:0; padding:4px; border:1px solid #a7b5cd; background:white; }
.calculator-result { padding:9px; background:#e8eef8; border:1px solid #b0bfd4; text-align:right; }

.menubar,.reduced-transparency .menubar { position:absolute; inset:auto 0 0; height:var(--taskbar-height); padding:4px 8px; gap:8px; color:white; border-top:1px solid #d4e4ff; border-bottom:0; background:linear-gradient(var(--chrome-top),var(--chrome-bottom)); backdrop-filter:none; box-shadow:inset 0 1px #ffffff65; }
.brand { display:flex; align-items:center; gap:8px; min-height:35px; padding:0 14px; color:#152b23; font-size:.88rem; font-weight:700; letter-spacing:0; background:linear-gradient(var(--start-light),var(--start-dark)); box-shadow:inset 1px 1px #fff8; border:1px solid var(--chrome-edge); border-radius:4px 7px 7px 4px; }
.brand:hover,.brand[aria-expanded=true] { background:var(--start-light); }
.start-mark { width:13px; height:13px; border:1px solid #253753; background:linear-gradient(90deg,#668bc0 48%,#263f74 48% 55%,#8da754 55%); box-shadow:1px 1px #fff8; }
.menus { gap:2px; align-items:center; }
.menus button { min-width:0; padding:5px 6px; color:#f6f8ff; font-size:.67rem; }
.menus button:hover,.menus button[aria-expanded=true] { background:#1832627a; }
.system-status { margin-left:auto; flex:none; padding:0 7px; gap:7px; color:#fff; font-size:.73rem; }
.status-rule { border-color:#ffffff57; }
.dock,.reduced-transparency .dock { position:static; transform:none; display:flex; flex:1; align-items:center; gap:4px; min-width:0; padding:0; background:none; backdrop-filter:none; border:0; box-shadow:none; border-radius:0; }
.dock-button { display:flex; align-items:center; justify-content:center; width:32px; height:31px; padding:0 5px; border:1px solid #1735668c; border-radius:3px; box-shadow:inset 1px 1px #ffffff4b; background:#e8eff424; color:#fff; }
.dock-button:hover,.dock-button.running { background:#13295d8a; }
.dock-button:focus-visible { outline-color:#f0f7ff; }
.dock-tile,.dock-button[data-value=terminal] .dock-tile { width:auto; height:auto; background:none; border:0; color:inherit; }
.dock-button .icon { width:16px; height:16px; }
.dock-button.running::after { display:none; }
.dock-button[data-value=explorer] { width:auto; min-width:32px; gap:5px; }
.dock-button[data-value=explorer] .dock-label { position:static; display:block; padding:0; border:0; box-shadow:none; background:none; font-size:.72rem; color:inherit; }
.dock-separator { height:21px; background:#e3edff4f; }

.explorer { left:clamp(125px,19vw,280px); top:clamp(28px,8vh,90px); width:min(930px,calc(100% - clamp(125px,19vw,280px) - 22px)); height:min(570px,calc(100% - 133px)); }
[data-member=tama] .explorer,[data-member=log] .explorer { left:clamp(14px,6vw,80px); width:min(930px,calc(100% - clamp(14px,6vw,80px) - 160px)); }
.window { border:1px solid var(--chrome-edge); border-radius:6px 6px 3px 3px; background:#e8edf6; box-shadow:2px 4px 18px #0f244b6b; }
.window.inactive { border-color:#425e89; box-shadow:2px 4px 14px #0f244b4f; }
.window .titlebar,.reduced-transparency .window .titlebar { position:relative; height:34px; padding:0 9px; grid-template-columns:minmax(0,1fr) auto; color:white; background:linear-gradient(var(--chrome-top),var(--chrome-bottom)); backdrop-filter:none; border-bottom:1px solid var(--chrome-edge); box-shadow:inset 0 1px #ffffff6a; }
.window.inactive .titlebar { color:#f5f8ff; background:linear-gradient(#798bab,#51678d); }
.titlebar h2 { grid-area:1 / 1; text-align:left; padding-right:36px; text-shadow:0 1px #162c50; }
.title-controls { grid-area:1 / 2; gap:4px; flex-direction:row-reverse; }
.window .title-controls button { width:21px; height:21px; border-radius:2px; color:#fff; background:linear-gradient(#6387c4,#34588f); border:1px solid #1d3e73; box-shadow:inset 1px 1px #ffffff70; }
.window:not(.inactive) .title-controls button[data-action=close] { background:linear-gradient(#bb5b50,#853a39); border-color:#6c3231; }
.window:not(.inactive) .title-controls button:is([data-action=minimize],[data-action=maximize]) { background:linear-gradient(#6789c3,#365a92); border-color:#1d3e73; }
.title-controls .icon { width:12px; height:12px; }
.titlebar .account-settings,.window-code { position:absolute; right:86px; color:#f9fbff; }
.titlebar .account-settings:hover { background:#13295d86; }
.workspace .sidebar { background:linear-gradient(#e9effa,#f0f4fb); border-right-color:#c1cfe5; }
.side-button[aria-current=true] { border-color:#a7badc; }
.toolbar,.statusbar { background:#edf1f8; border-color:#cad4e5; }
.files th { background:linear-gradient(#fafcff,#e8edf6); }
.files tr[aria-selected=true] td:first-child { box-shadow:inset 2px 0 var(--accent); }
.inspector { background:#f4f7fd; }
.control { box-shadow:inset 1px 1px #ffffff90; }
.control.primary { color:#182e55; background:linear-gradient(#f4f8ff,#d5e1f8); border-color:#819dc7; }
.popup { background:#f7f9ff; border:1px solid var(--chrome-edge); border-radius:4px; }
.popup button:hover,.popup button:focus-visible { background:var(--selected); }

@media (max-width:780px) {
  .menus { display:none; }
  .system-status { padding-inline:3px; }
  .dock-button[data-value=explorer] .dock-label { display:none; }
  .explorer,[data-member=tama] .explorer,[data-member=log] .explorer { left:12px; width:calc(100% - 24px); top:94px; height:calc(100% - 112px); min-height:0; }
}
@media (max-width:590px) {
  .login-grid { grid-template-columns:minmax(0,1fr); }
  .login-brand { flex-direction:row; align-items:center; justify-content:flex-start; padding:20px; border-right:0; border-bottom:1px solid #274a87; }
  .login-brand strong { font-size:2.35rem; }
  .login-brand span { margin-top:3px; font-size:.79rem; }
  .login-panel { padding:22px; }
  .desktop-items,[data-member=revi] .desktop-items,[data-member=tama] .desktop-items,[data-member=log] .desktop-items { inset:11px 6px auto; grid-auto-flow:row; grid-template-columns:repeat(4,minmax(0,1fr)); grid-auto-rows:61px; grid-template-rows:repeat(3,61px); gap:3px; }
  .desk-item .item-icon { width:33px; height:31px; }
  .station-id { display:none; }
  .explorer:not(.maximized),[data-member=tama] .explorer:not(.maximized),[data-member=log] .explorer:not(.maximized) { left:7px!important; width:calc(100% - 14px); top:min(200px,42%); height:calc(100% - min(200px,42%) - 11px); }
  .program.window { left:10px!important; }
  .explorer.manually-sized:not(.maximized) { width:var(--window-width); height:var(--window-height); }
  .menubar { gap:4px; padding-inline:4px; }
  .brand { min-height:30px; padding:0 7px; gap:4px; font-size:.76rem; }
  .start-mark { width:10px; height:10px; }
  .dock { gap:2px; }
  .dock-button { width:26px; height:29px; padding:0 3px; }
  .dock-button .icon { width:14px; height:14px; }
  .dock-button[data-value=explorer] { min-width:26px; }
  .dock-button[data-value=desktop] { display:none; }
  #active-account,.status-rule { display:none; }
  #clock { font-size:.62rem; }
}
@media (max-width:375px) {
  .dock-button[data-value=readers] { display:none; }
  .login-panel { padding:17px; }
}
