:root{
  color-scheme: dark;
  --bg: #0b0f1a;
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.70);
  --card: rgba(255,255,255,.06);
  --border: rgba(255,255,255,.14);
  --shadow: 0 30px 120px rgba(0,0,0,.55);

  --bezel: #0b0b0e;
  --glass: rgba(255,255,255,.06);
  --screenRadius: 44px;
  --uiRadius: 18px;
}

*{ box-sizing: border-box; }
html,body{ height: 100%; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:
    radial-gradient(1200px 800px at 20% 10%, rgba(120,230,255,.14), transparent 60%),
    radial-gradient(900px 700px at 85% 20%, rgba(190,120,255,.12), transparent 55%),
    linear-gradient(180deg, rgba(11,15,26,.88), rgba(6,8,14,.98));
  color: var(--text);
}

.page{ max-width: 1200px; margin: 0 auto; padding: 18px 16px 30px; }
.pageHead h1{ margin: 0 0 6px; font-size: 22px; }
.pageHead p{ margin: 0; color: var(--muted); }

.stage{ margin-top: 16px; display: grid; grid-template-columns: 420px 1fr; gap: 16px; align-items: start; }

@media (max-width: 980px){
  .stage{ grid-template-columns: 1fr; }
}

@media (max-width: 520px){
  .phoneBezel{ border-radius: 44px; padding: 10px; }
  .phoneGlass{ border-radius: 36px; padding: 8px; }
  .screen{ min-height: 0; max-height: 78vh; border-radius: 30px; }
  .grid{ padding: 62px 12px 104px; gap: 10px; }
  .icon{ width: 56px; height: 56px; border-radius: 14px; font-size: 24px; }
  .dock{ left: 12px; right: 12px; bottom: 12px; height: 72px; }
  .appChrome{ height: 52px; grid-template-columns: 44px 1fr 44px; }
  .appBody{ height: calc(100% - 52px); padding: 10px; }
  .nowPlaying{ grid-template-columns: 1fr; }
  .album{ max-width: 180px; }
}

.phone{
  width: min(420px, calc(100vw - 24px));
  margin: 0 auto;
}

.phoneBezel{
  border-radius: 58px;
  padding: 14px;
  background: linear-gradient(180deg, #101018, #07070a);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,.10);
}

.phoneGlass{
  position: relative;
  border-radius: 48px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.10);
  padding: 10px;
}

.screen{
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 19.5;
  max-height: 82vh;
  min-height: 560px;
  border-radius: var(--screenRadius);
  overflow: hidden;
  background: #000;
}

.statusBar{
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 46px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 50;
  pointer-events: none;
  color: rgba(255,255,255,.92);
  font-weight: 650;
  font-size: 13px;
  text-shadow: 0 2px 14px rgba(0,0,0,.6);
}

.sbRight{ display: flex; gap: 8px; }
.pill{ background: rgba(0,0,0,.28); padding: 3px 8px; border-radius: 999px; border: 1px solid rgba(255,255,255,.12); }

.wallpaper{
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 600px at 20% 10%, rgba(120,230,255,.25), transparent 60%),
    radial-gradient(700px 600px at 90% 25%, rgba(200,120,255,.22), transparent 60%),
    radial-gradient(900px 700px at 30% 90%, rgba(120,255,200,.14), transparent 60%),
    linear-gradient(180deg, rgba(9,12,22,.65), rgba(2,3,6,.88));
  filter: saturate(1.1);
}

.view{
  position: absolute;
  inset: 0;
  padding-top: 46px;
  display: none;
}
.view.isActive{ display: block; }

.viewHome{ position: absolute; }

.grid{
  position: relative;
  padding: 68px 18px 116px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.app{
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 0;
  display: grid;
  gap: 8px;
  justify-items: center;
}

.icon{
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 28px;
  box-shadow: 0 10px 24px rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.10);
  backdrop-filter: blur(10px);
}

.icon.i-notes{ background: linear-gradient(180deg, rgba(255,230,90,.95), rgba(255,190,40,.85)); color: #16130a; }
.icon.i-photos{ background: linear-gradient(135deg, rgba(255,100,140,.92), rgba(120,230,255,.92)); }
.icon.i-calc{ background: linear-gradient(180deg, rgba(50,60,80,.88), rgba(20,24,36,.92)); }
.icon.i-weather{ background: linear-gradient(180deg, rgba(120,230,255,.90), rgba(70,130,255,.90)); }
.icon.i-msg{ background: linear-gradient(180deg, rgba(140,255,200,.92), rgba(40,200,120,.92)); color: #052014; }
.icon.i-music{ background: linear-gradient(180deg, rgba(255,120,210,.92), rgba(160,80,255,.92)); }
.icon.i-settings{ background: linear-gradient(180deg, rgba(220,220,230,.92), rgba(140,150,165,.92)); color: #0f141f; }
.icon.i-camera{ background: linear-gradient(180deg, rgba(30,30,36,.92), rgba(14,14,18,.92)); }

.name{
  font-size: 11px;
  opacity: .92;
  text-shadow: 0 2px 14px rgba(0,0,0,.7);
}

.dock{
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  height: 78px;
  border-radius: 26px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(14px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 10px;
}

.dockApp{
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 18px;
  background: rgba(0,0,0,.18);
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
}
.dockApp:active{ transform: translateY(1px); }

.appChrome{
  position: sticky;
  top: 0;
  z-index: 40;
  height: 56px;
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  align-items: center;
  padding: 0 10px;
  background: rgba(0,0,0,.35);
  border-bottom: 1px solid rgba(255,255,255,.10);
  backdrop-filter: blur(14px);
}

.backBtn,.ghostBtn{
  height: 40px;
  width: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.08);
  color: var(--text);
  cursor: pointer;
  font-size: 18px;
}

.appTitle{ text-align: center; font-weight: 750; }

.appBody{
  padding: 14px;
  height: calc(100% - 56px);
  overflow: auto;
  background: rgba(0,0,0,.22);
}

.card{
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}
.card h2{ margin: 0 0 8px; font-size: 16px; }
.card p, .card li{ color: var(--muted); }
.card ul{ margin: 8px 0 0 18px; }

.homeIndicator{
  position: absolute;
  left: 50%;
  bottom: 12px;
  width: 140px;
  height: 5px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(255,255,255,.32);
  z-index: 55;
}

kbd{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.25);
  color: var(--text);
}

.pageFoot{ margin-top: 14px; color: var(--muted); text-align: center; font-size: 12px; }

/* app content shared widgets */
.appCard{
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255,255,255,.06);
}
.appCard h3{ margin: 0 0 8px; }
.muted{ color: rgba(255,255,255,.72); }

.row{ display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.miniBtn{
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  background: rgba(255,255,255,.10);
  color: var(--text);
  padding: 8px 10px;
  cursor: pointer;
}
.miniBtn.ghost{ background: rgba(255,255,255,.04); }
.miniHint{ color: rgba(255,255,255,.75); font-size: 12px; }

textarea, input{
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.22);
  color: var(--text);
  padding: 10px;
}

.photoGrid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.photo{
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  cursor: pointer;
}

.calcIn{ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

.weatherRow{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.wx{
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  padding: 8px;
  background: rgba(255,255,255,.06);
  text-align: center;
}
.wxT{ font-size: 11px; color: rgba(255,255,255,.72); }
.wxI{ font-size: 20px; margin: 4px 0; }
.wxV{ font-weight: 700; }

.chat{
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow: auto;
  padding: 4px;
}
.bubble{
  max-width: 88%;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 14px;
}
.bubble.them{ background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.12); justify-self: start; }
.bubble.you{ background: rgba(130,230,255,.20); border: 1px solid rgba(130,230,255,.28); justify-self: end; }
.chatBar{ margin-top: 10px; display:flex; gap:8px; }
.chatBar input{ flex:1; }

.nowPlaying{ display:grid; grid-template-columns: 120px 1fr; gap: 12px; align-items:start; min-width: 0; }
.nowPlaying > div{ min-width: 0; }
.album{
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: linear-gradient(135deg, #7ad7ff, #c7a5ff);
}
.track{ font-weight: 800; }

.setting{ display:flex; gap:10px; align-items:center; }
.setting input{ width:auto; }

.camera .viewfinder{
  height: 180px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background:
    radial-gradient(500px 300px at 30% 20%, rgba(120,230,255,.16), transparent 60%),
    radial-gradient(400px 260px at 80% 60%, rgba(255,140,190,.14), transparent 60%),
    rgba(0,0,0,.28);
  display:grid;
  place-items:center;
  color: rgba(255,255,255,.72);
  margin-bottom: 10px;
}

.list{ display:grid; gap:8px; }
.listRow{
  display:flex;
  justify-content: space-between;
  gap:10px;
  align-items:center;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  padding: 8px;
  background: rgba(255,255,255,.05);
}
.listTitle{ font-weight: 700; }

.mapTile{
  height: 180px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  margin: 10px 0;
  background:
    linear-gradient(45deg, rgba(255,255,255,.06) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.06) 50%, rgba(255,255,255,.06) 75%, transparent 75%, transparent),
    linear-gradient(135deg, rgba(120,230,255,.18), rgba(120,255,180,.12));
  background-size: 24px 24px, 100% 100%;
}

/* tiny hover polish */
.app:hover .icon{ transform: translateY(-1px); }
.app:active .icon{ transform: translateY(1px); }

:root[data-reduced] *{ animation: none !important; transition: none !important; }
