:root {
  --panel: #000;
  --win-bg: #fafafa;
  --win-fg: #2e3436;
  --header: #ebebeb;
  --header-fg: #2e3436;
  --border: rgba(0, 0, 0, .15);
  --accent: #3584e4;
  --card: #fff;
  --shadow: 0 8px 30px rgba(0, 0, 0, .35), 0 0 0 1px rgba(0, 0, 0, .18);
  --wall: radial-gradient(circle at 20% 15%, #99c1f1 0, transparent 45%),
          radial-gradient(circle at 85% 20%, #dc8add 0, transparent 40%),
          radial-gradient(circle at 70% 90%, #f9f06b 0, transparent 40%),
          linear-gradient(135deg, #3584e4, #613583);
}
body.dark {
  --win-bg: #242424;
  --win-fg: #fff;
  --header: #303030;
  --header-fg: #fff;
  --border: rgba(255, 255, 255, .12);
  --card: #303030;
  --wall: radial-gradient(circle at 20% 15%, #1a5fb4 0, transparent 45%),
          radial-gradient(circle at 85% 20%, #613583 0, transparent 40%),
          radial-gradient(circle at 70% 90%, #26a269 0, transparent 40%),
          linear-gradient(135deg, #1c1c2e, #241f31);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body {
  font-family: Cantarell, "Adwaita Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  color: #fff;
  background: var(--wall) fixed;
  user-select: none;
}
button { font: inherit; color: inherit; cursor: pointer; }

/* ---------- Top panel ---------- */
#panel {
  position: fixed; inset: 0 0 auto 0; height: 32px; z-index: 1000;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  background: var(--panel); font-weight: 700; font-size: 14px;
}
#panel .left { padding-left: 4px; }
#panel .right { justify-self: end; padding-right: 4px; }
.pill {
  background: none; border: 0; border-radius: 99px; padding: 2px 14px; height: 26px;
  font-weight: 700; color: #fff;
}
.pill:hover, .pill.active { background: rgba(255, 255, 255, .15); }
.status { display: flex; gap: 10px; align-items: center; }

/* ---------- Quick settings ---------- */
#quick {
  position: fixed; top: 38px; right: 8px; width: 330px; z-index: 1001;
  background: #1e1e1e; color: #fff; border-radius: 22px; padding: 14px;
  box-shadow: var(--shadow); border: 1px solid rgba(255, 255, 255, .1);
  display: none;
}
#quick.open { display: block; animation: pop .15s ease-out; }
#quick .toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.toggle {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: #3a3a3a; border: 0; border-radius: 99px; text-align: left;
}
.toggle.on { background: var(--accent); }
.slider { display: flex; align-items: center; gap: 12px; margin: 12px 4px 4px; }
.slider input { flex: 1; accent-color: var(--accent); }

/* ---------- Windows ---------- */
.window {
  position: absolute; min-width: 260px; display: flex; flex-direction: column;
  background: var(--win-bg); color: var(--win-fg);
  border-radius: 14px; box-shadow: var(--shadow); overflow: hidden;
  animation: pop .18s ease-out;
}
.window.hidden { display: none; }
.window.max { inset: 32px 0 0 0 !important; width: auto !important; height: auto !important; border-radius: 0; }
.window.focus { box-shadow: 0 14px 44px rgba(0, 0, 0, .5), 0 0 0 1px rgba(0, 0, 0, .25); }
.titlebar {
  display: flex; align-items: center; justify-content: space-between;
  height: 46px; padding: 0 8px 0 14px; cursor: grab;
  background: var(--header); color: var(--header-fg);
  border-bottom: 1px solid var(--border); font-weight: 700;
}
.titlebar:active { cursor: grabbing; }
.wbtns { display: flex; gap: 6px; }
.wbtns button {
  width: 26px; height: 26px; border-radius: 50%; border: 0;
  background: rgba(127, 127, 127, .2); line-height: 1;
}
.wbtns button:hover { background: rgba(127, 127, 127, .4); }
.wbtns .close:hover { background: #e01b24; color: #fff; }
.content { padding: 22px; overflow: auto; flex: 1; }

/* ---------- Window contents ---------- */
.hero { text-align: center; padding: 10px 0; }
.hero .logo { font-size: 64px; }
.hero h1 { margin: 6px 0 4px; font-size: 28px; }
.hero p { margin: 0; opacity: .7; }
.list { margin-top: 18px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.row { display: flex; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.row:last-child { border: 0; }
.row span:last-child { opacity: .65; }
.btn {
  background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 8px 18px;
  font-weight: 700; margin-top: 16px;
}
.btn:hover { filter: brightness(1.1); }

canvas#clock { display: block; margin: 0 auto; }
#digital { text-align: center; font-size: 34px; font-weight: 300; margin-top: 10px; font-variant-numeric: tabular-nums; }
#dateline { text-align: center; opacity: .65; margin-top: 2px; }

.term { background: #1e1e1e; color: #ddd; font: 13px/1.5 "Cascadia Mono", Consolas, monospace; padding: 0; }
.term .content { padding: 12px 14px; user-select: text; }
.term .prompt { color: #26a269; }
.term .path { color: #12488b; color: #6aa9f0; }
.term input { background: none; border: 0; outline: 0; color: #fff; font: inherit; width: 70%; }

/* ---------- Dock ---------- */
#dock {
  position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 900;
  display: flex; gap: 8px; padding: 8px 10px;
  background: rgba(30, 30, 30, .75); backdrop-filter: blur(18px);
  border-radius: 22px; border: 1px solid rgba(255, 255, 255, .1);
}
.dock-item {
  position: relative; width: 52px; height: 52px; border: 0; border-radius: 14px;
  background: rgba(255, 255, 255, .08); font-size: 28px; transition: transform .15s, background .15s;
}
.dock-item:hover { background: rgba(255, 255, 255, .2); transform: translateY(-5px) scale(1.08); }
.dock-item.running::after {
  content: ""; position: absolute; bottom: -5px; left: 50%; width: 6px; height: 6px;
  margin-left: -3px; border-radius: 50%; background: #fff;
}
.dock-item[data-tip]:hover::before {
  content: attr(data-tip); position: absolute; bottom: 66px; left: 50%; transform: translateX(-50%);
  background: #000; color: #fff; font-size: 13px; padding: 4px 10px; border-radius: 99px; white-space: nowrap;
}

/* ---------- Activities overview ---------- */
#overview {
  position: fixed; inset: 32px 0 0 0; z-index: 800; display: none;
  background: rgba(0, 0, 0, .45); backdrop-filter: blur(14px);
  flex-direction: column; align-items: center; padding-top: 28px;
}
#overview.open { display: flex; }
#search {
  width: min(480px, 80vw); padding: 12px 20px; border-radius: 99px; border: 0; outline: 0;
  background: rgba(255, 255, 255, .15); color: #fff; font-size: 16px;
}
#search::placeholder { color: rgba(255, 255, 255, .6); }
#apps { display: flex; flex-wrap: wrap; gap: 28px; justify-content: center; margin-top: 50px; max-width: 700px; }
.app { background: none; border: 0; width: 96px; text-align: center; font-size: 13px; }
.app i { display: block; font-style: normal; font-size: 48px; margin-bottom: 6px; }
.app:hover i { transform: scale(1.1); }

@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) { .window { max-width: 94vw; } #dock { gap: 4px; } .dock-item { width: 44px; height: 44px; font-size: 24px; } }
