:root{
  --bg:#e0e6ef;
  --accent:#3ddc84;
  --panel: rgba(0,0,0,0.6);
  --glass: rgba(255,255,255,0.06);
  --text-dark: #111;
  --muted-dark: #666;
}
*{box-sizing:border-box;margin:0;padding:0}
html,body,#device{height:100%}
body{
  background:linear-gradient(180deg,#c6daf6 0%, #eaf2ff 100%);
  font-family: "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  display:block;
  min-height:100vh;
  margin:0;
  padding:0;
}
#device{
  width:100vw;
  height:100vh;
  border-radius:0;
  box-shadow:none;
  background:#111;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  position:fixed;
  inset:0;
  z-index:999;
}
#status-bar{
  height:28px;
  background:linear-gradient(180deg, rgba(0,0,0,0.35), rgba(0,0,0,0.2));
  color:#fff;
  font-size:12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 8px;
}
#screen{
  position:relative;
  flex:1;
  overflow:hidden;
}
#wallpaper{
  position:absolute;
  inset:0;
  background-image: radial-gradient(circle at 20% 30%, rgba(61,220,132,0.12), transparent 10%), radial-gradient(circle at 80% 70%, rgba(0,0,0,0.06), transparent 30%), linear-gradient(180deg,#9bd7ff,#67bdf7);
  filter:contrast(1.02);
  z-index:0;
}
#desktop{
  position:relative;
  z-index:1;
  height:100%;
  display:flex;
  flex-direction:column;
  /* place content toward the bottom so apps and dock sit at screen bottom */
  justify-content:flex-end;
  padding:14px;
  padding-top:24px;
}

/* position the clock at the top center, just below the status bar */
#home-clock{
  position:absolute;
  top:36px; /* place below the status bar */
  left:50%;
  transform:translateX(-50%);
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  min-width:160px;
  padding:6px 10px;
  border-radius:12px;
  color:#fff;
  z-index:4;
  background:linear-gradient(180deg, rgba(0,0,0,0.18), rgba(0,0,0,0.12));
  backdrop-filter: blur(6px);
}
#home-clock #time{
  font-size:22px;
  font-weight:700;
  line-height:1;
}
#home-clock #date{
  font-size:12px;
  opacity:0.95;
  margin-top:2px;
}

/* push grid down so icons sit under the floating clock — now anchored near bottom */
#app-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:10px;
  margin:0 0 12px 0;
  pointer-events:auto;
}
.icon{
  background:var(--glass);
  border-radius:12px;
  height:64px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:26px;
  color:#fff;
  box-shadow:inset 0 -8px 12px rgba(0,0,0,0.08);
  user-select:none;
}
.icon span{font-size:11px;display:block;margin-top:6px;color:#fff;opacity:0.95}
#dock{
  height:72px;
  display:flex;
  align-items:center;
  justify-content:space-around;
  background:rgba(255,255,255,0.06);
  border-radius:16px;
  padding:6px 10px;
  /* keep space above nav and let the clock sit above the dock */
  margin-bottom:12px;
  backdrop-filter: blur(6px);
}
.dock-icon{
  width:44px;height:44px;border-radius:10px;background:rgba(255,255,255,0.02);display:flex;align-items:center;justify-content:center;font-size:20px;color:#fff;
}
#navigation{
  height:48px;
  background:linear-gradient(180deg, rgba(0,0,0,0.25), rgba(0,0,0,0.15));
  display:flex;
  align-items:center;
  justify-content:center;
  gap:32px;
  color:#fff;
}
#navigation button{background:transparent;border:0;color:#fff;font-size:16px;padding:8px;min-width:44px}
#notification-shade{
  position:absolute;
  top:-100%;
  left:0;
  right:0;
  height:52%;
  background:linear-gradient(180deg, rgba(0,0,0,0.6), rgba(0,0,0,0.5));
  color:#fff;
  z-index:5;
  transition:top 260ms ease;
  padding:10px;
  display:flex;
  flex-direction:column;
}
#notification-shade.visible{top:0}
#shade-handle{width:36px;height:4px;background:rgba(255,255,255,0.2);border-radius:4px;margin:6px auto}
#notifications{flex:1;overflow:auto;padding:8px}
.notif{background:rgba(255,255,255,0.03);padding:10px;border-radius:8px;margin-bottom:8px}
#quick-settings{display:flex;gap:8px;padding:8px;flex-wrap:wrap}
.qs{background:rgba(255,255,255,0.06);border:0;color:#fff;padding:8px 10px;border-radius:8px}

#app-window{
  position:absolute;inset:10% 6% 12% 6%;
  background:linear-gradient(180deg,#ffffff,#f1f1f1);
  border-radius:12px;
  box-shadow:0 20px 60px rgba(0,0,0,0.4);
  z-index:6;
  overflow:hidden;
}
#app-window.hidden{display:none}
#app-header{height:44px;background:linear-gradient(180deg,#f5f5f5,#eaeaea);display:flex;align-items:center;justify-content:space-between;padding:0 10px}
#app-content{padding:12px;height:calc(100% - 44px);overflow:auto}
#app-close{cursor:pointer}

/* Light mode overrides */
.light-mode body, .light-mode #device {
  background: linear-gradient(180deg,#f7f9fc 0%, #ffffff 100%);
}
.light-mode #status-bar{
  background:linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0.95));
  color:var(--text-dark);
  box-shadow:0 1px 0 rgba(0,0,0,0.04) inset;
}
.light-mode .icon{
  background:rgba(0,0,0,0.04);
  color:var(--text-dark);
  box-shadow:none;
}
.light-mode #dock{
  background:rgba(0,0,0,0.04);
}
.light-mode #navigation{
  background:linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0.98));
  color:var(--text-dark);
}
.light-mode #app-window{
  background:linear-gradient(180deg,#ffffff,#fbfbfb);
  box-shadow:0 10px 30px rgba(0,0,0,0.06);
}
.light-mode #app-header{
  background:linear-gradient(180deg,#fafafa,#f4f4f4);
  color:var(--text-dark);
}
.light-mode .notif{background:rgba(0,0,0,0.02);color:var(--text-dark)}