:root {
  --bg: #101114;
  --window: #1c1e24;
  --text: #f4f0e8;
  --muted: #a39e94;
  --accent: #d4a574;
  --accent-ink: #1c140e;
  --line: rgba(244, 240, 232, 0.1);
  --danger: #c45c4a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.38), 0 2px 8px rgba(0, 0, 0, 0.24);
  --font: "Segoe UI", "Avenir Next", "Helvetica Neue", sans-serif;
  --display: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, "Courier New", monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.45;
}
.os { position: fixed; inset: 0; overflow: hidden; background: var(--bg); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--accent) 45%, transparent); }
* { scrollbar-width: thin; scrollbar-color: rgba(244, 240, 232, 0.28) transparent; }

.boot-fallback {
  height: 100%;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 56px;
  color: var(--text);
  background: var(--bg);
}

.desktop { position: absolute; inset: 0; }
.os[data-phase="boot"] .desktop,
.os[data-phase="off"] .desktop { visibility: hidden; }

.wallpaper {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-color: #141820;
  background-size: 140% 140%;
  animation: drift 42s ease-in-out infinite alternate;
}
.wallpaper::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 42%, rgba(0, 0, 0, 0.38) 100%);
}
.wallpaper-dusk {
  background-image:
    radial-gradient(900px 560px at 12% 18%, rgba(212, 165, 116, 0.42), transparent 60%),
    radial-gradient(760px 520px at 88% 82%, rgba(78, 112, 132, 0.5), transparent 58%),
    radial-gradient(520px 380px at 62% 38%, rgba(120, 64, 48, 0.28), transparent 55%),
    linear-gradient(160deg, #1a2230, #14110f 70%);
}
.wallpaper-tide {
  background-image:
    radial-gradient(800px 500px at 20% 80%, rgba(47, 111, 120, 0.55), transparent 60%),
    radial-gradient(700px 460px at 80% 20%, rgba(180, 210, 206, 0.22), transparent 55%),
    linear-gradient(180deg, #10242c, #0d1816);
}
.wallpaper-orchard {
  background-image:
    radial-gradient(820px 520px at 18% 22%, rgba(216, 168, 92, 0.4), transparent 60%),
    radial-gradient(680px 480px at 82% 78%, rgba(92, 112, 64, 0.45), transparent 58%),
    linear-gradient(165deg, #2a2418, #17140f);
}
.wallpaper-graphite {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    radial-gradient(700px 420px at 50% 40%, rgba(180, 180, 176, 0.16), transparent 60%),
    linear-gradient(180deg, #23262b, #121316);
  background-size: 48px 48px, 48px 48px, 140% 140%, auto;
}
.wallpaper-night {
  background-image:
    radial-gradient(2px 2px at 12% 22%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1.5px 1.5px at 28% 68%, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(2px 2px at 72% 30%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1.5px 1.5px at 84% 74%, rgba(255, 255, 255, 0.45), transparent),
    radial-gradient(600px 380px at 70% 20%, rgba(212, 165, 116, 0.16), transparent 60%),
    linear-gradient(180deg, #0c0e14, #07080c);
}
@keyframes drift {
  from { background-position: 0% 0%, 0% 0%, 0% 0%, 0% 0%; }
  to { background-position: 40% 30%, 10% 20%, 20% 40%, 0% 0%; }
}

.topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 48px;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 8px;
  background: linear-gradient(to bottom, rgba(8, 9, 12, 0.55), transparent);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}
.top-left, .top-actions { display: flex; align-items: center; gap: 8px; min-width: 0; }
.top-left { flex: 1; }
.brand {
  font-family: var(--display);
  font-size: 24px;
  letter-spacing: -0.03em;
  background: none;
  border: 0;
  color: var(--text);
  padding: 0 8px;
  text-shadow: none;
}
.active-title {
  font-size: 13px;
  opacity: 0.8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ghost {
  background: transparent;
  border: 0;
  color: inherit;
  border-radius: 8px;
  padding: 6px 8px;
}
.ghost:hover { background: rgba(255, 255, 255, 0.08); }
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 650;
  text-shadow: none;
}

.workspace { position: absolute; top: 48px; left: 0; right: 0; bottom: 96px; z-index: 2; }
.icons { position: absolute; inset: 0; pointer-events: none; }
.windows { position: absolute; inset: 0; pointer-events: none; }
.desk-icon {
  pointer-events: auto;
  position: absolute;
  width: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 0;
  color: inherit;
  padding: 4px;
}
.desk-icon .tile { width: 56px; height: 56px; border-radius: 16px; }
.desk-label {
  color: #f7f4ee;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
  font-size: 12px;
  text-align: center;
  max-width: 84px;
  line-height: 1.25;
  padding: 1px 4px;
  border-radius: 4px;
}
.desk-icon.is-selected .tile { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); }
.desk-icon.is-selected .desk-label { background: var(--accent); color: var(--accent-ink); text-shadow: none; }

.tile {
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 8px 16px rgba(0, 0, 0, 0.18);
}
.tile svg { width: 54%; height: 54%; }
.tile-files { background: linear-gradient(160deg, #f0d0a8, #c4844a); }
.tile-writer { background: linear-gradient(160deg, #f4ead0, #c9b48a); color: #3a2e22; }
.tile-terminal { background: linear-gradient(160deg, #4a5364, #232833); }
.tile-net { background: linear-gradient(160deg, #b7ddd4, #3d7c76); }
.tile-sketch { background: linear-gradient(160deg, #f0b3a4, #c45c4a); }
.tile-photos { background: linear-gradient(160deg, #f3dc9a, #c8903a); color: #3a2a12; }
.tile-piano { background: linear-gradient(160deg, #e4eaf2, #7f8b9c); color: #1c2430; }
.tile-calc { background: linear-gradient(160deg, #d5dece, #6d8a72); color: #17211b; }
.tile-calendar { background: linear-gradient(160deg, #f0c7b6, #c46b5a); }
.tile-monitor { background: linear-gradient(160deg, #c5d2e0, #5c7288); color: #15202b; }
.tile-settings { background: linear-gradient(160deg, #ddd6cb, #8d867a); color: #241f1a; }
.tile-about { background: linear-gradient(160deg, #efe4d4, #b7a48a); color: #2a241c; }
.tile-launcher { background: rgba(255, 255, 255, 0.08); box-shadow: none; color: var(--text); }
.tile.title-tile { width: 18px; height: 18px; border-radius: 6px; box-shadow: none; flex: none; }
.tile.title-tile svg { width: 12px; height: 12px; }

.window {
  position: absolute;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  background: var(--window);
  color: var(--text);
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-width: 0;
  animation: rise 0.18s ease;
}
.window.is-active { box-shadow: 0 22px 60px rgba(0, 0, 0, 0.46), 0 2px 8px rgba(0, 0, 0, 0.3); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.window:not(.is-active) .title-text { opacity: 0.65; }
.window.is-min, .window.is-closing { opacity: 0; transform: translateY(10px) scale(0.98); pointer-events: none; transition: opacity 0.15s ease, transform 0.15s ease; }
.window.is-min { visibility: hidden; }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
.titlebar {
  height: 40px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 12px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--line);
  user-select: none;
  touch-action: none;
}
.title-text { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title-actions { display: flex; }
.win-btn {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
}
.win-btn svg { width: 12px; height: 12px; }
.win-btn:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.win-btn-close:hover { background: var(--danger); color: white; }
.window-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.app { flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }

.rz { position: absolute; z-index: 3; touch-action: none; }
.rz-n, .rz-s { left: 12px; right: 12px; height: 8px; cursor: ns-resize; }
.rz-n { top: 0; }
.rz-s { bottom: 0; }
.rz-e, .rz-w { top: 12px; bottom: 12px; width: 8px; cursor: ew-resize; }
.rz-e { right: 0; }
.rz-w { left: 0; }
.rz-ne, .rz-nw, .rz-se, .rz-sw { width: 14px; height: 14px; }
.rz-ne { top: 0; right: 0; cursor: nesw-resize; }
.rz-nw { top: 0; left: 0; cursor: nwse-resize; }
.rz-se { right: 0; bottom: 0; cursor: nwse-resize; }
.rz-sw { left: 0; bottom: 0; cursor: nesw-resize; }
.window.is-max .rz { display: none; }
.snap-preview {
  position: absolute;
  display: none;
  border-radius: 14px;
  border: 2px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  pointer-events: none;
}
.snap-preview.is-on { display: block; }

.dock-wrap {
  position: absolute;
  left: 0; right: 0; bottom: 14px;
  display: flex;
  justify-content: center;
  z-index: 70;
  pointer-events: none;
}
.dock {
  pointer-events: auto;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 8px 8px 12px;
  background: rgba(20, 22, 26, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  max-width: calc(100% - 24px);
  overflow-x: auto;
  scrollbar-width: none;
}
.dock::-webkit-scrollbar { display: none; }
.dock-btn {
  position: relative;
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  padding: 4px;
  display: grid;
  place-items: center;
  flex: none;
  transition: transform 0.12s ease;
}
.dock-btn .tile { width: 46px; height: 46px; border-radius: 14px; }
.dock-btn:hover { transform: translateY(-6px); }
.dock-btn.is-current { background: rgba(255, 255, 255, 0.08); }
.dock-btn.is-running::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 1px;
  width: 4px;
  height: 4px;
  transform: translateX(-50%);
  border-radius: 99px;
  background: var(--accent);
}
.dock-btn.is-running[data-count="2"]::after,
.dock-btn.is-running[data-count="3"]::after,
.dock-btn.is-running[data-count="4"]::after,
.dock-btn.is-running[data-count="5"]::after { width: 12px; }
.dock-sep { width: 1px; align-self: stretch; margin: 6px 4px 10px; background: rgba(255, 255, 255, 0.12); flex: none; }

.launcher {
  position: absolute;
  inset: 0;
  z-index: 90;
  display: none;
  background: rgba(8, 9, 12, 0.28);
  padding-top: 12vh;
  justify-content: center;
}
.launcher.is-open { display: flex; }
.launcher-card {
  width: min(640px, calc(100% - 32px));
  max-height: min(70vh, 560px);
  display: flex;
  flex-direction: column;
  background: rgba(24, 26, 32, 0.94);
  border: 1px solid var(--line);
  border-radius: 18px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.launcher-input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 16px 18px;
  font-size: 18px;
  outline: none;
}
.launcher-body { overflow: auto; padding: 8px; }
.launcher-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.launch-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
}
.launch-item .tile { width: 48px; height: 48px; border-radius: 14px; }
.launch-item:hover, .launch-item.is-active { background: rgba(255, 255, 255, 0.06); }
.launch-name { font-size: 12px; }
.launch-file {
  width: 100%;
  flex-direction: row;
  justify-content: flex-start;
  gap: 10px;
  padding: 8px 10px;
}
.launch-file-name { flex: 1; text-align: left; }
.launch-path { font-size: 12px; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.launch-label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 4px; }
.launch-empty, .launcher-foot { color: var(--muted); padding: 12px 14px; font-size: 13px; }
.launcher-foot { border-top: 1px solid var(--line); }

.menu, .popover {
  position: fixed;
  z-index: 85;
  display: none;
  min-width: 200px;
  background: rgba(28, 30, 36, 0.96);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.menu.is-open, .popover.is-open { display: block; }
.menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: inherit;
  padding: 8px 10px;
  border-radius: 8px;
}
.menu-item:hover { background: rgba(255, 255, 255, 0.06); }
.menu-item.danger { color: #f0b2a8; }
.sep { height: 1px; background: var(--line); margin: 4px 6px; }
.popover { width: 280px; padding: 12px; }
.pop-title { font-family: var(--display); font-size: 20px; font-weight: 500; margin-bottom: 8px; }
.mini-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font-size: 12px; }
.mini-dow { color: var(--muted); padding: 4px 0; }
.mini-cell { padding: 5px 0; border-radius: 7px; }
.mini-cell.is-today { box-shadow: inset 0 0 0 1px var(--accent); }
.mini-cell.has-dot { color: var(--accent); }
.pop-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.pop-event { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.pop-empty { color: var(--muted); margin: 8px 0; }
.pop-open { width: 100%; margin-top: 8px; }

.toasts {
  position: absolute;
  top: 58px;
  right: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(320px, calc(100% - 32px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  background: rgba(28, 30, 36, 0.94);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  animation: rise 0.18s ease;
}
.toast.is-out { opacity: 0; transition: opacity 0.2s ease; }
.toast-title { font-weight: 600; }
.toast-msg { color: var(--muted); font-size: 13px; }
.toast-action { margin-left: auto; background: transparent; border: 0; color: var(--accent); font-weight: 600; }

.modal-back {
  position: absolute;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(8, 9, 12, 0.45);
}
.modal-back.is-open { display: flex; }
.modal {
  width: min(420px, calc(100% - 32px));
  background: #23262d;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal h2 { margin: 0; font-family: var(--display); font-weight: 500; font-size: 28px; }
.modal p { margin: 0; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

.boot, .lock, .off {
  position: absolute;
  inset: 0;
  z-index: 220;
  display: none;
}
.os[data-phase="boot"] .boot,
.os[data-phase="lock"] .lock,
.os[data-phase="off"] .off { display: flex; }
.boot, .off {
  background: #101114;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
}
.boot-mark { position: relative; width: 120px; height: 120px; display: grid; place-items: center; }
.boot-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}
.boot-name { font-family: var(--display); font-size: 48px; }
.boot-kicker { letter-spacing: 0.22em; text-transform: uppercase; font-size: 12px; color: var(--muted); margin: 0; }
.boot-status { min-height: 1.2em; margin: 8px 0 0; color: var(--muted); }
.boot-bar { width: 180px; height: 2px; background: rgba(255, 255, 255, 0.1); border-radius: 2px; overflow: hidden; }
.boot-bar-fill { height: 100%; width: 0; background: var(--accent); }
.boot-skip { margin-top: 12px; color: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }

.lock {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(10, 12, 16, 0.2);
  backdrop-filter: blur(22px) saturate(1.15);
}
.lock-time { font-family: var(--display); font-size: clamp(72px, 12vw, 120px); font-weight: 500; letter-spacing: -0.04em; line-height: 0.95; }
.lock-date { margin-top: 8px; font-size: 20px; }
.lock-hint { color: var(--muted); margin-top: 18px; }
.lock-footer { position: absolute; bottom: 32px; display: flex; align-items: center; gap: 10px; }
.lock-name { font-size: 15px; }
.power-btn, .power-big {
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(20, 22, 28, 0.7);
  color: var(--accent);
}
.power-btn { position: absolute; right: 28px; bottom: 28px; width: 44px; height: 44px; }
.power-btn svg, .power-big svg { width: 18px; height: 18px; }
.power-big { width: 84px; height: 84px; margin: 12px 0; background: radial-gradient(circle at 40% 35%, #2a2e38, #15171c); }
.power-big svg { width: 28px; height: 28px; }
.power-big:hover, .power-btn:hover { border-color: var(--accent); }
.off-hint { color: var(--muted); margin: 0; }

.btn, .field {
  border-radius: 9px;
  border: 1px solid var(--line);
}
.btn {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 7px 12px;
}
.btn:hover { background: rgba(255, 255, 255, 0.08); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 650; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-danger { background: transparent; color: #f0b2a8; border-color: rgba(196, 92, 74, 0.5); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--muted); padding: 6px; }
.btn-quiet svg { width: 16px; height: 16px; display: block; }
.btn:disabled { opacity: 0.35; cursor: default; }
.btn.is-on, .size-btn.is-on { border-color: var(--accent); color: var(--text); }
.field {
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  padding: 8px 10px;
  min-width: 0;
}
.field:focus { border-color: color-mix(in srgb, var(--accent) 70%, white); }
.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.grow { flex: 1; }
.muted { color: var(--muted); }
.kicker { letter-spacing: 0.16em; text-transform: uppercase; font-size: 11px; color: var(--accent); margin: 0 0 6px; }
.empty { color: var(--muted); padding: 28px 16px; margin: 0; }
.is-hidden { display: none !important; }
.mini-icon { width: 18px; height: 18px; color: var(--muted); display: block; }
.mini-icon.folder { color: var(--accent); }
.mini-icon svg { width: 18px; height: 18px; display: block; }

.files-body { display: flex; min-height: 0; flex: 1; }
.files-side {
  width: 180px;
  flex: none;
  border-right: 1px solid var(--line);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.side-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  background: transparent;
  border: 0;
  color: inherit;
  border-radius: 8px;
  padding: 8px;
}
.side-link.is-on, .side-link:hover { background: rgba(255, 255, 255, 0.05); }
.files-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.crumbs { display: flex; gap: 6px; align-items: center; padding: 8px 12px 0; flex-wrap: wrap; }
.crumb { background: none; border: 0; color: inherit; padding: 2px; border-radius: 6px; }
.crumb:hover { color: var(--accent); }
.file-list { flex: 1; overflow: auto; padding: 6px; }
.file-row {
  width: 100%;
  display: grid;
  grid-template-columns: 28px 1fr 150px;
  gap: 8px;
  align-items: center;
  text-align: left;
  background: transparent;
  border: 0;
  color: inherit;
  border-radius: 8px;
  padding: 7px 8px;
}
.file-row:hover { background: rgba(255, 255, 255, 0.04); }
.file-row.is-selected { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { color: var(--muted); font-size: 12px; text-align: right; }
.file-thumb { width: 22px; height: 22px; object-fit: cover; border-radius: 4px; }
.files-foot { border-top: 1px solid var(--line); padding: 6px 12px; color: var(--muted); font-size: 12px; }

.term { background: #14161c; color: #e7e2d8; font-family: var(--mono); font-size: 13.5px; }
.term-scroll { flex: 1; overflow: auto; padding: 12px 14px 4px; }
.term-row { white-space: pre-wrap; word-break: break-word; line-height: 1.5; }
.term-row.is-cmd { color: var(--accent); }
.term-row.is-error { color: #f0b2a8; }
.term-form { display: flex; gap: 8px; align-items: center; padding: 8px 14px 12px; }
.prompt { color: #9dceb8; flex: none; }
.term-input { flex: 1; background: transparent; border: 0; outline: none; font-family: var(--mono); min-width: 0; }

.writer-area {
  flex: 1;
  border: 0;
  resize: none;
  background: transparent;
  padding: 16px 18px 8px;
  font-size: 16px;
  line-height: 1.6;
  min-height: 0;
}
.writer-status { padding: 6px 14px 8px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); }
.banner { background: rgba(196, 92, 74, 0.16); color: #f0b2a8; padding: 8px 14px; font-size: 13px; }

.calc { background: #17191e; padding: 8px; gap: 6px; }
.calc-expr { min-height: 18px; text-align: right; color: var(--muted); padding: 8px 12px 0; font-size: 13px; }
.calc-display {
  text-align: right;
  font-size: 42px;
  font-variant-numeric: tabular-nums;
  padding: 0 12px 8px;
  overflow: hidden;
}
.calc-keys { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; min-height: 0; }
.calc-key {
  border: 0;
  border-radius: 12px;
  background: #2a2d34;
  color: var(--text);
  font-size: 18px;
}
.calc-key:hover { filter: brightness(1.08); }
.calc-key.op { background: color-mix(in srgb, var(--accent) 28%, #2a2d34); }
.calc-key.eq { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.calc-key.span2 { grid-column: span 2; }

.net-bar { display: flex; gap: 8px; align-items: center; padding: 10px; border-bottom: 1px solid var(--line); }
.net-page { flex: 1; overflow: auto; padding: 22px 26px 32px; }
.net-page h1, .about h1, .settings h2, .cal-title { font-family: var(--display); font-weight: 500; }
.net-page h1 { font-size: 36px; margin: 0 0 8px; }
.lede { font-size: 16px; max-width: 46em; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 18px; }
.info-card {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
}
.info-card:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.news-item { padding: 8px 0 14px; border-bottom: 1px solid var(--line); }
.news-item h2 { margin: 0 0 4px; font-size: 18px; }
.net-frame { flex: 1; border: 0; width: 100%; background: #fff; min-height: 0; }
.net-note { margin: 0; padding: 6px 12px; color: var(--muted); font-size: 12px; }

.cal { display: grid; grid-template-columns: 1fr 240px; min-height: 0; }
.cal-main { padding: 14px 16px 18px; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cal-title { margin: 0; font-size: 28px; }
.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { margin-top: 12px; color: var(--muted); font-size: 12px; text-align: center; }
.cal-grid { flex: 1; margin-top: 6px; }
.cal-cell {
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  min-height: 36px;
}
.cal-cell:hover { background: rgba(255, 255, 255, 0.05); }
.cal-cell.is-today { box-shadow: inset 0 0 0 1px var(--accent); }
.cal-cell.is-picked { background: var(--accent); color: var(--accent-ink); }
.cal-cell.has-event:not(.is-picked) { color: var(--accent); }
.cal-cell.is-empty { pointer-events: none; }
.cal-side { border-left: 1px solid var(--line); padding: 16px; overflow: auto; }
.cal-side h3 { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.cal-add { display: flex; gap: 6px; }
.event { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }

.monitor, .settings, .about { overflow: auto; padding: 16px 18px 28px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat b { font-size: 20px; font-weight: 600; }
.stat.wide { margin-top: 10px; }
.spark { width: 100%; height: 72px; display: block; }
.proc-title { margin: 18px 0 8px; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.proc { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.proc-main { display: flex; flex-direction: column; min-width: 0; }
.proc-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proc-actions { display: flex; gap: 6px; flex: none; }

.sketch-tools, .choice-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sketch-tools { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; padding: 0; }
.swatch.is-on { border-color: #fff; }
.sketch-stage { flex: 1; min-height: 0; position: relative; background: #f3efe6; }
.sketch-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }

.photo-grid {
  flex: 1;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  padding: 14px;
  align-content: start;
}
.photo-card {
  border: 0;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #111;
  color: inherit;
  text-align: left;
  display: flex;
  flex-direction: column;
}
.photo-card img, .photo-img { width: 100%; display: block; }
.photo-card img { height: 120px; object-fit: cover; }
.photo-cap { padding: 8px 10px 10px; font-size: 12px; }
.photo-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.photo-stage { flex: 1; min-height: 0; overflow: auto; display: grid; place-items: center; background: #111; }
.photo-img { max-width: 100%; max-height: 100%; object-fit: contain; }

.piano { padding: 16px 18px 20px; gap: 12px; }
.piano-help { margin: 0; color: var(--muted); }
.piano-roll { position: relative; height: 230px; user-select: none; touch-action: none; }
.whites { display: flex; height: 100%; }
.key { border: 0; padding: 0; position: relative; }
.key-w {
  flex: 1;
  height: 100%;
  background: linear-gradient(#fff, #e7e1d6);
  color: #3a342c;
  border-radius: 0 0 8px 8px;
  border: 1px solid #cfc6b8;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 8px;
  gap: 2px;
}
.key-b {
  position: absolute;
  top: 0;
  width: 6.8%;
  height: 58%;
  z-index: 1;
  background: linear-gradient(#2c3038, #111318);
  color: #f4f0e8;
  border-radius: 0 0 6px 6px;
  border: 1px solid #000;
}
.key.is-down { filter: brightness(0.86); }
.key-name { font-size: 12px; }
.key-bind { font-size: 10px; opacity: 0.6; }

.settings h2, .about h2 { font-size: 22px; margin: 0 0 8px; }
.set-block { margin-bottom: 22px; }
.set-block .field { width: min(280px, 100%); }
.wall-swatch {
  width: 116px;
  height: 74px;
  border-radius: 12px;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
  padding: 0;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.wall-swatch span { position: absolute; left: 8px; bottom: 6px; font-size: 12px; }
.wall-swatch.is-on, .accent-dot.is-on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.accent-dot { width: 28px; height: 28px; border-radius: 50%; border: 0; padding: 0; }
.checkline { display: flex; align-items: center; gap: 8px; }
.about-mark { font-size: 40px; margin: 0 0 8px; line-height: 1.05; }
.shortcuts { display: flex; flex-direction: column; }
.shortcut { display: grid; grid-template-columns: 160px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
kbd {
  font-family: inherit;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 1px 6px;
  background: rgba(255, 255, 255, 0.04);
  width: fit-content;
}

@media (max-width: 720px) {
  .files-side { display: none; }
  .cal { grid-template-columns: 1fr; }
  .cal-side { border-left: 0; border-top: 1px solid var(--line); }
  .launcher-grid { grid-template-columns: repeat(3, 1fr); }
  .file-row { grid-template-columns: 28px 1fr; }
  .file-meta { display: none; }
  .shortcut { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
