/* ============================================================
   desktop.css — タイトルバーの ✕ / ─ を押すと現れる Windows 11 のデスクトップ。
   デスクトップの棚は、自作アプリ DesktopOrganizer の実装値を写している
   （ShelfControl.xaml / ThemeResources.xaml / OverlayWindow.xaml）。

     棚          角丸 8 / 枠 #33FFFFFF / 影 blur12 depth4 0.5 / 既定色 #CC1E1E24
     見出し      14px SemiBold #EEEEEE / padding 6 10 / 上から #66000000 → 透明
     アイコン    48px / セル 89.6 × 110.8 / ラベル 11px Medium 白 + 1px 1px #80000000
     ホバー      1.1 倍に 0.1 秒 / 背景 #22FFFFFF / 枠 #33FFFFFF / 角丸 6
     表示        不透明度 0 → 1、Y 20 → 0 を 0.4 秒（CubicEase Out）
     編集モード  #66000000 で暗くし、60px 間隔の点（白 0.15）を敷く
   ============================================================ */

:root {
  --dk-ui: "Segoe UI Variable Text", "Segoe UI", "Yu Gothic UI", "Meiryo UI", system-ui, sans-serif;
  --dk-taskbar-h: 48px;

  /* Windows 11 ダーク */
  --dk-tb-bg: rgba(28, 28, 28, 0.84);
  --dk-tb-border: rgba(255, 255, 255, 0.08);
  --dk-tb-text: #ffffff;
  --dk-tb-hover: rgba(255, 255, 255, 0.07);
  --dk-tb-press: rgba(255, 255, 255, 0.04);
  --dk-accent: #4cc2ff;
  --dk-pill-idle: rgba(255, 255, 255, 0.55);
  --dk-flyout-bg: rgba(36, 36, 36, 0.9);
  --dk-flyout-border: rgba(255, 255, 255, 0.09);
  --dk-flyout-text: #ffffff;
  --dk-flyout-sub: rgba(255, 255, 255, 0.72);
  --dk-flyout-hover: rgba(255, 255, 255, 0.06);
  --dk-field-bg: rgba(255, 255, 255, 0.06);
  --dk-field-border: rgba(255, 255, 255, 0.09);
  --dk-field-underline: rgba(255, 255, 255, 0.55);
  --dk-footer-bg: rgba(255, 255, 255, 0.03);
  --dk-wall-base: #0a1428;
}

@media (prefers-color-scheme: light) {
  :root {
    --dk-tb-bg: rgba(238, 241, 246, 0.86);
    --dk-tb-border: rgba(0, 0, 0, 0.08);
    --dk-tb-text: #1a1a1a;
    --dk-tb-hover: rgba(0, 0, 0, 0.05);
    --dk-tb-press: rgba(0, 0, 0, 0.03);
    --dk-accent: #005fb8;
    --dk-pill-idle: rgba(0, 0, 0, 0.45);
    --dk-flyout-bg: rgba(242, 242, 242, 0.92);
    --dk-flyout-border: rgba(0, 0, 0, 0.1);
    --dk-flyout-text: #1a1a1a;
    --dk-flyout-sub: rgba(0, 0, 0, 0.62);
    --dk-flyout-hover: rgba(0, 0, 0, 0.04);
    --dk-field-bg: rgba(255, 255, 255, 0.7);
    --dk-field-border: rgba(0, 0, 0, 0.08);
    --dk-field-underline: rgba(0, 0, 0, 0.45);
    --dk-footer-bg: rgba(0, 0, 0, 0.025);
    --dk-wall-base: #9fbad6;
  }
}

/* ---------- タイトルバーのボタン（<button> になった） ---------- */

.cap-btn {
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  font: inherit;
  cursor: default;
}
.cap-btn:focus-visible { outline: 2px solid #1a1a1a; outline-offset: -4px; }
.cap-btn .ic-restore { display: none; }
.is-maximized .cap-btn .ic-max { display: none; }
.is-maximized .cap-btn .ic-restore { display: block; }
.titlebar-icon { cursor: default; }
.titlebar { user-select: none; -webkit-user-select: none; }

/* ---------- ウィンドウが閉じる／しまわれる／戻る ----------
   ページ全体を 1 枚のウィンドウに見立て、body 直下の要素をそろって
   同じ一点を中心に縮める（transform-origin は JS が要素ごとに合わせる）。 */

html.dk-behind,
html.dk-behind body { background: transparent !important; }
html.dk-behind .desk { z-index: -1; }

html.dk-away { overflow: hidden; }
html.dk-away body > :not(.desk):not(script) { visibility: hidden; }

.dk-win-anim {
  transition:
    transform var(--dk-dur, 160ms) var(--dk-ease, cubic-bezier(0.4, 0, 1, 1)),
    opacity var(--dk-dur, 160ms) var(--dk-ease, cubic-bezier(0.4, 0, 1, 1));
}

/* 作品をデスクトップから開いたとき、新しいページはウィンドウが開く動きで出る */
/* 最初の 1 コマは透明にするだけ。ブラウザが #作品 の位置へスクロールし終えてから縮めた状態にする（縮めたままだと、ずれた位置へスクロールする） */
html.dk-launching body > :not(.desk):not(script) { opacity: 0; }
html.dk-launch-from body > :not(.desk):not(script) { opacity: 0; transform: scale(0.94); }
html.dk-launched body > :not(.desk):not(script) {
  transition: transform 220ms cubic-bezier(0.1, 0.9, 0.2, 1), opacity 160ms linear;
}

/* ---------- デスクトップ ---------- */

.desk {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow: hidden;
  font-family: var(--dk-ui);
  font-size: 12px;
  color: #eeeeee;
  background: var(--dk-wall-base);
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}
.desk[hidden] { display: none; }
.desk.is-busy, .desk.is-busy * { cursor: progress !important; }
.desk button { font-family: inherit; }

/* 壁紙は desktop.js が式から描く（paintWall）。描くまでは --dk-wall-base の単色 */
.dk-wall {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* 作業領域（タスクバーを除いた範囲）。棚の位置はここに対する割合で持つ。
   棚の z-index は掴むたびに増えるので、ここで層を閉じて棚どうしの前後にだけ効かせる
   （閉じないと、スタートメニューやタスクバーより手前に出てしまう） */
.dk-area {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: var(--dk-taskbar-h);
  isolation: isolate;
}

/* 編集モード：暗くして、60px 間隔の点を敷く */
.dk-area::before,
.dk-area::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}
.dk-area::before { background: rgba(0, 0, 0, 0.4); }
.dk-area::after {
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.15) 1.5px, transparent 1.6px);
  background-size: 60px 60px;
}
.desk.is-edit .dk-area::before,
.desk.is-edit .dk-area::after { opacity: 1; }

/* ---------- 棚 ---------- */

.dk-shelf {
  --shelf-bg: rgba(30, 30, 36, 0.8);
  position: absolute;
  display: flex;
  flex-direction: column;
  min-width: 120px;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: var(--shelf-bg);
  -webkit-backdrop-filter: blur(1px);
  backdrop-filter: blur(1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(20px);
}
.dk-shelf.is-shown {
  opacity: 1;
  transform: none;
  transition: opacity 0.4s cubic-bezier(0.33, 1, 0.68, 1), transform 0.4s cubic-bezier(0.33, 1, 0.68, 1);
}
.dk-shelf.is-ghost:not(:hover):not(:focus-within) { opacity: 0.25; transition: opacity 0.2s linear; }
.dk-shelf.is-ghost:hover { transition: opacity 0.15s linear; }
.dk-shelf.is-collapsed { height: auto !important; }
.dk-shelf.is-collapsed .dk-items,
.dk-shelf.is-collapsed .dk-shelf-body { display: none; }
.dk-shelf.is-dragging { z-index: 5; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55); }

.dk-shelf-head {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: 7px 7px 0 0;
  background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0));
}
.dk-shelf-title {
  flex: 1;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  color: #eeeeee;
}
.desk.is-edit .dk-shelf-head { cursor: move; }

/* 編集モードでだけ出る歯車と、右下のつまみ */
.dk-chrome-btn {
  display: none;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin: -2px -4px -2px 4px;
  padding: 4px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #cccccc;
}
.dk-chrome-btn:hover { background: rgba(255, 255, 255, 0.27); color: #fff; }
.dk-chrome-btn:active { background: rgba(255, 255, 255, 0.13); }
.dk-chrome-btn svg { display: block; width: 100%; height: 100%; fill: currentColor; }
.desk.is-edit .dk-chrome-btn { display: block; }

.dk-resize {
  display: none;
  position: absolute;
  right: 0;
  bottom: 0;
  width: 20px;
  height: 20px;
  cursor: nwse-resize;
  touch-action: none;
}
.dk-resize svg { position: absolute; right: 2px; bottom: 2px; width: 12px; height: 12px; fill: #aaaaaa; opacity: 0.5; }
.desk.is-edit .dk-resize { display: block; }

/* 中身：VirtualizingWrapPanel と同じく、セル幅で折り返して並べる */
.dk-items {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  padding: 1px 3px 4px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}
.dk-items::-webkit-scrollbar { width: 8px; background: transparent; }
.dk-items::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.3); border: 2px solid transparent; background-clip: padding-box; border-radius: 4px; }
.dk-items::-webkit-scrollbar-track { background: transparent; }

.dk-item {
  position: relative;
  flex: 0 0 auto;
  width: 89.6px;
  height: 110.8px;
  padding: 0;
  display: block;
  color: #ffffff;
  text-decoration: none;
  outline: none;
  transition: transform 0.1s linear;
}
.dk-item::before {
  content: "";
  position: absolute;
  inset: 2px;
  border: 1px solid transparent;
  border-radius: 6px;
}
.dk-item:hover { transform: scale(1.1); z-index: 1; }
.dk-item:hover::before { background: rgba(255, 255, 255, 0.13); border-color: rgba(255, 255, 255, 0.2); }
.dk-item:focus-visible::before { border-color: rgba(100, 108, 255, 0.53); background: rgba(100, 108, 255, 0.27); }
.dk-item:active { transform: scale(1.04); }

.dk-icon {
  position: relative;
  display: block;
  width: 48px;
  height: 48px;
  margin: 9px auto 0;
}
.dk-icon img,
.dk-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  object-fit: cover;
}
.dk-icon img { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18), 0 1px 3px rgba(0, 0, 0, 0.45); }

.dk-label {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  max-height: 30px;
  margin: 6px 8px 0;
  font-size: 11px;
  font-weight: 500;
  line-height: 15px;
  text-align: center;
  overflow-wrap: anywhere;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
}

.dk-empty {
  margin: 6px 8px;
  font-size: 12px;
  line-height: 1.6;
  color: #aaaaaa;
}

/* アナログ時計の棚 */
.dk-shelf-body { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 15px; }
.dk-clock { width: 100%; height: 100%; max-width: 100%; max-height: 100%; }

/* クイックメモの棚：付箋を並べる */
.dk-memos { padding: 2px 4px 6px; gap: 0; }
.dk-memo {
  flex: 0 0 auto;
  width: 140px;
  min-height: 100px;
  margin: 4px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  background: #f9f5d7;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  color: #3c3836;
  font-size: 11px;
  line-height: 1.55;
  user-select: text;
  -webkit-user-select: text;
  cursor: text;
}
.dk-memo b { display: block; margin-bottom: 4px; color: #504945; font-weight: 700; }
.dk-memo a { color: #07569c; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

/* ---------- タスクバー ---------- */

.dk-taskbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--dk-taskbar-h);
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--dk-tb-border);
  background: var(--dk-tb-bg);
  -webkit-backdrop-filter: blur(30px) saturate(1.25);
  backdrop-filter: blur(30px) saturate(1.25);
  color: var(--dk-tb-text);
  z-index: 20;
}

.dk-tb-center { display: flex; align-items: center; gap: 4px; }

.dk-tb-btn {
  position: relative;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  display: grid;
  place-items: center;
}
.dk-tb-btn:hover,
.dk-tb-btn.is-open { background: var(--dk-tb-hover); }
.dk-tb-btn:active > svg,
.dk-tb-btn:active > img { transform: scale(0.86); }
.dk-tb-btn > svg,
.dk-tb-btn > img { width: 24px; height: 24px; transition: transform 0.12s ease-out; }
.dk-tb-btn:focus-visible { outline: 2px solid var(--dk-tb-text); outline-offset: -2px; }

/* 起動中のしるし：しまわれている＝短い灰色、手前にある＝長い青 */
.dk-tb-btn .pill {
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 6px;
  height: 3px;
  margin-left: -3px;
  border-radius: 2px;
  background: var(--dk-pill-idle);
  opacity: 0;
  transition: width 0.18s ease, margin-left 0.18s ease, background 0.18s ease;
}
.dk-tb-btn.is-running .pill { opacity: 1; }
.dk-tb-btn.is-active .pill { width: 16px; margin-left: -8px; background: var(--dk-accent); }

.dk-tb-right {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 12px;
}
.dk-tray-btn {
  height: 40px;
  min-width: 32px;
  padding: 0 6px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
}
.dk-tray-btn:hover,
.dk-tray-btn.is-open { background: var(--dk-tb-hover); }
.dk-tray-btn:focus-visible { outline: 2px solid var(--dk-tb-text); outline-offset: -2px; }
.dk-tray-btn img { width: 16px; height: 16px; border-radius: 3px; }
.dk-tray-btn svg { width: 16px; height: 16px; fill: currentColor; }
.dk-ime { font-size: 12.5px; }
.dk-clockbtn { flex-direction: column; gap: 0; padding: 0 8px; align-items: flex-end; line-height: 16px; font-variant-numeric: tabular-nums; }

/* ---------- メニュー（DesktopOrganizer のコンテキストメニュー） ---------- */

.dk-menu {
  position: absolute;
  z-index: 40;
  min-width: 176px;
  padding: 2px;
  border: 1px solid #33333c;
  border-radius: 4px;
  background: #1e1e24;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  color: #eeeeee;
  font-size: 12px;
}
.dk-menu[hidden] { display: none; }
.dk-menu button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 28px 6px 26px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: inherit;
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
}
.dk-menu button:hover,
.dk-menu button:focus-visible,
.dk-menu button.is-open { background: #33333c; outline: none; }
.dk-menu button[aria-checked="true"]::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 50%;
  width: 7px;
  height: 4px;
  margin-top: -4px;
  border-left: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
}
.dk-menu button[aria-haspopup]::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 5px;
  height: 5px;
  margin-top: -3px;
  border-right: 1.5px solid currentColor;
  border-top: 1.5px solid currentColor;
  transform: rotate(45deg);
}
.dk-menu .key { margin-left: auto; padding-left: 18px; color: #aaaaaa; }
.dk-menu .sw { width: 12px; height: 12px; border-radius: 2px; border: 1px solid rgba(255, 255, 255, 0.25); }
.dk-menu hr { height: 1px; margin: 2px 6px; border: 0; background: #33333c; }

/* ---------- スタートメニュー（Windows 11） ---------- */

.dk-flyout {
  position: absolute;
  z-index: 30;
  border: 1px solid var(--dk-flyout-border);
  border-radius: 8px;
  background: var(--dk-flyout-bg);
  -webkit-backdrop-filter: blur(40px) saturate(1.3);
  backdrop-filter: blur(40px) saturate(1.3);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  color: var(--dk-flyout-text);
}
.dk-flyout[hidden] { display: none; }
.dk-flyout.is-entering { opacity: 0; transform: translateY(24px); }
.dk-flyout.is-in { transition: opacity 0.16s linear, transform 0.25s cubic-bezier(0.1, 0.9, 0.2, 1); }

.dk-start {
  left: 50%;
  bottom: calc(var(--dk-taskbar-h) + 12px);
  width: min(642px, calc(100vw - 24px));
  max-height: calc(100% - var(--dk-taskbar-h) - 24px);
  margin-left: calc(min(642px, calc(100vw - 24px)) / -2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dk-start-main { padding: 28px 32px 8px; overflow-y: auto; }
.dk-search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--dk-field-border);
  border-bottom-color: var(--dk-field-underline);
  border-radius: 18px;
  background: var(--dk-field-bg);
}
.dk-search svg { width: 14px; height: 14px; fill: var(--dk-flyout-sub); flex-shrink: 0; }
.dk-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: 13px var(--dk-ui);
}
.dk-search input::placeholder { color: var(--dk-flyout-sub); }
.dk-search:focus-within { border-bottom: 2px solid var(--dk-accent); }

.dk-start-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 26px 20px 12px;
  font-size: 14px;
  font-weight: 600;
}
.dk-pinned {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px 0;
}
.dk-pin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 84px;
  padding: 12px 4px 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  text-decoration: none;
  font-size: 12px;
}
.dk-pin:hover,
.dk-pin:focus-visible,
.dk-pin.is-first { background: var(--dk-flyout-hover); outline: none; }
.dk-pin:focus-visible { box-shadow: inset 0 0 0 2px var(--dk-flyout-text); }
.dk-pin .dk-pin-ic { width: 32px; height: 32px; flex-shrink: 0; }
.dk-pin .dk-pin-ic img,
.dk-pin .dk-pin-ic svg { display: block; width: 100%; height: 100%; border-radius: 4px; object-fit: cover; }
.dk-pin span:last-child {
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.dk-start-none { padding: 18px 20px 30px; color: var(--dk-flyout-sub); font-size: 13px; }

.dk-recs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 12px;
  margin: 0 0 12px;
}
.dk-rec {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 8px 12px;
  border-radius: 4px;
  color: inherit;
  text-decoration: none;
}
.dk-rec:hover,
.dk-rec:focus-visible { background: var(--dk-flyout-hover); outline: none; }
.dk-rec img { width: 32px; height: 32px; border-radius: 4px; object-fit: cover; flex-shrink: 0; }
.dk-rec b { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12.5px; font-weight: 400; }
.dk-rec small { display: block; color: var(--dk-flyout-sub); font-size: 12px; }
.dk-recs-empty { margin: 0 20px 18px; color: var(--dk-flyout-sub); font-size: 12.5px; line-height: 1.6; }

.dk-start-foot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 52px;
  border-top: 1px solid var(--dk-flyout-border);
  background: var(--dk-footer-bg);
}
.dk-user,
.dk-power {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font-size: 12.5px;
}
.dk-user:hover,
.dk-power:hover,
.dk-power.is-open { background: var(--dk-flyout-hover); }
.dk-user img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.dk-power { width: 40px; padding: 0; justify-content: center; }
.dk-power svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }

.dk-powermenu {
  right: calc(50% - min(642px, calc(100vw - 24px)) / 2 + 40px);
  bottom: calc(var(--dk-taskbar-h) + 12px + 56px);
  min-width: 160px;
  padding: 4px;
  z-index: 31;
}
.dk-powermenu button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font-size: 13px;
  text-align: left;
}
.dk-powermenu button:hover,
.dk-powermenu button:focus-visible { background: var(--dk-flyout-hover); outline: none; }
.dk-powermenu svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- スリープ・シャットダウン・再起動の画面 ---------- */

.dk-screen {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  background: #000;
  color: #fff;
  font-size: 20px;
  font-weight: 300;
  opacity: 0;
  transition: opacity 0.4s linear;
}
.dk-screen.is-in { opacity: 1; }
.dk-screen.is-bye { background: #0c2a5b; }
.dk-screen[hidden] { display: none; }

/* Windows の読み込み中の輪：5 つの点が追いかけ合って回る */
.dk-ring { position: relative; width: 44px; height: 44px; }
.dk-ring i {
  position: absolute;
  inset: 0;
  animation: dk-orbit 5.5s infinite;
}
.dk-ring i::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: #fff;
}
.dk-ring i:nth-child(2) { animation-delay: 0.24s; }
.dk-ring i:nth-child(3) { animation-delay: 0.48s; }
.dk-ring i:nth-child(4) { animation-delay: 0.72s; }
.dk-ring i:nth-child(5) { animation-delay: 0.96s; }
@keyframes dk-orbit {
  0% { transform: rotate(225deg); opacity: 1; animation-timing-function: ease-out; }
  7% { transform: rotate(345deg); animation-timing-function: linear; }
  30% { transform: rotate(455deg); animation-timing-function: ease-in-out; }
  39% { transform: rotate(690deg); animation-timing-function: linear; }
  70% { transform: rotate(815deg); opacity: 1; animation-timing-function: ease-out; }
  75% { transform: rotate(945deg); animation-timing-function: ease-out; }
  76%, 100% { transform: rotate(945deg); opacity: 0; }
}

.dk-poweron {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: transparent;
  color: #fff;
}
.dk-poweron:hover { background: rgba(255, 255, 255, 0.08); }
.dk-poweron svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }
.dk-screen small { font-size: 13px; color: rgba(255, 255, 255, 0.6); }

/* ---------- 画面が狭いとき：棚は上から順に積む ---------- */

.desk.is-compact .dk-area {
  overflow-y: auto;
  padding: 14px 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.desk.is-compact .dk-shelf {
  position: relative;
  left: auto !important;
  top: auto !important;
  width: auto !important;
  height: auto !important;
  flex-shrink: 0;
}
.desk.is-compact .dk-items { overflow: visible; }
.desk.is-compact .dk-shelf-works { order: 1; }
.desk.is-compact .dk-shelf-recent { order: 2; }
.desk.is-compact .dk-shelf-memo { order: 3; }
.desk.is-compact .dk-shelf-clock { order: 4; }
.desk.is-compact .dk-clock { width: 160px; height: 160px; }
.desk.is-compact .dk-pinned { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.desk.is-compact .dk-start-main { padding: 20px 14px 8px; }
.desk.is-compact .dk-start-foot { padding: 0 20px; }
.desk.is-compact .dk-recs { grid-template-columns: minmax(0, 1fr); }
.desk.is-compact .dk-tb-right .dk-hide-sm { display: none; }

@media (prefers-reduced-motion: reduce) {
  .dk-shelf,
  .dk-shelf.is-shown,
  .dk-item,
  .dk-flyout.is-in,
  .dk-screen,
  .dk-win-anim { transition: none !important; }
  .dk-shelf { transform: none; }
  .dk-item:hover { transform: none; }
}

/* 補足：押せない表示だけの部品、メニューの書体、システムメニュー */
.dk-tray-static:hover { background: transparent; }
.dk-tray-static svg + svg { margin-left: 0; }
.dk-menu { font-family: var(--dk-ui); }
.dk-sysmenu { z-index: 2000; }
.dk-rec > svg { width: 32px; height: 32px; flex-shrink: 0; }
.desk [hidden] { display: none !important; }
.dk-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: var(--ps-blue);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 96px 96px;
}
