:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at 50% 10%, #252a31 0, #111317 42%, #08090b 100%);
  color: #f7f8fa;
  --surface: #111419;
  --surface-raised: #171b21;
  --text-muted: #8f98a5;
  --line: rgba(255,255,255,.07);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: grid; place-items: center; }
main { display: flex; gap: 48px; align-items: center; padding: 40px; }
.device {
  width: 560px;
  height: 560px;
  aspect-ratio: 1;
  flex: 0 0 auto;
  border-radius: 58px;
  padding: 40px;
  background: linear-gradient(145deg, #30353c, #1b1f24 64%, #15181c);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 40px 100px rgba(0,0,0,.55), inset 0 1px rgba(255,255,255,.08);
}
.screen {
  width: 480px;
  height: 480px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 30px;
  background: radial-gradient(circle at 50% -20%, #17202b, #050607 52%);
  position: relative;
  display: grid;
  grid-template-rows: 34px minmax(0, 1fr);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.045), 0 10px 30px rgba(0,0,0,.45);
}
.screen.has-header { grid-template-rows: 34px 62px minmax(0, 1fr); }
.sim-status {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  white-space: nowrap;
  overflow: hidden;
  color: #f4f7fa;
  font-size: 13px;
  font-weight: 620;
  letter-spacing: -.01em;
  border-bottom: 1px solid rgba(255,255,255,.04);
  background: linear-gradient(to bottom, rgba(7,10,14,.94), rgba(7,10,14,.72));
}
.sim-status .connection-status {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: capitalize;
}
.sim-status .connection-status::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  vertical-align: 1px;
  background: #52d68a;
  box-shadow: 0 0 10px rgba(82,214,138,.65);
}
.sim-status .battery-status { color: #d8dde5; }
.header {
  height: auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  align-items: center;
  padding: 4px 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.045);
  background: linear-gradient(to bottom, rgba(255,255,255,.025), transparent);
}
.back {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.055);
  color: inherit;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  transition: transform 90ms ease, background 140ms ease;
}
.back:active { transform: scale(.93); background: rgba(255,255,255,.11); }
.title { text-align: center; font-size: 20px; font-weight: 650; letter-spacing: -.02em; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #52d68a; justify-self: center; box-shadow: 0 0 10px rgba(82,214,138,.65); }
.zones {
  min-width: 0;
  min-height: 0;
  display: grid;
  gap: 10px;
  padding: 10px;
  overflow: hidden;
}
.screen.has-header .zones { height: auto; }
.layout-single { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.layout-split-horizontal { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); }
.layout-split-vertical { grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(2, minmax(0, 1fr)); }
.layout-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); }
.layout-primary-top { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: minmax(0, 1.22fr) minmax(0, .78fr); }
.layout-primary-top .zone:first-child { grid-column: 1 / 3; }
.zone {
  --accent: 150 160 174;
  --accent-rgb: rgb(var(--accent));
  min-width: 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.055);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255,255,255,.047), rgba(255,255,255,.018));
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: inset 0 1px rgba(255,255,255,.045), 0 8px 20px rgba(0,0,0,.16);
  transition: transform 100ms cubic-bezier(.2,.8,.2,1), border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}
.zone:hover { border-color: rgba(var(--accent), .27); }
.zone:active, .zone.pressed {
  transform: scale(.972);
  background: linear-gradient(145deg, rgba(var(--accent), .15), rgba(var(--accent), .055));
  box-shadow: inset 0 1px rgba(255,255,255,.07), 0 3px 12px rgba(0,0,0,.22);
}
.zone.active {
  border-color: rgba(var(--accent), .38);
  background: linear-gradient(145deg, rgba(var(--accent), .19), rgba(var(--accent), .065));
  box-shadow: inset 0 1px rgba(255,255,255,.08), 0 0 26px rgba(var(--accent), .09);
}
.zone-glow {
  position: absolute;
  width: 150%;
  aspect-ratio: 1;
  left: -25%;
  top: -75%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--accent), .22), transparent 67%);
  opacity: .2;
  transition: opacity 200ms ease, transform 220ms ease;
}
.zone.active .zone-glow, .zone.pressed .zone-glow { opacity: .72; transform: translateY(8px); }
.icon-wrap {
  width: 66px;
  height: 66px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: rgba(var(--accent), .08);
  border: 1px solid rgba(var(--accent), .12);
  color: var(--accent-rgb);
  transition: transform 160ms ease, background 180ms ease, box-shadow 180ms ease;
  z-index: 1;
}
.zone.active .icon-wrap {
  background: rgba(var(--accent), .17);
  box-shadow: 0 0 22px rgba(var(--accent), .16);
}
.zone.pressed .icon-wrap { transform: scale(.94); }
.icon { font-size: 35px; font-weight: 620; line-height: 1; letter-spacing: -.05em; }
.label { font-size: 19px; font-weight: 650; letter-spacing: -.025em; z-index: 1; }
.caption { color: var(--text-muted); font-size: 13px; font-weight: 520; z-index: 1; }
.zone.active .caption { color: rgba(var(--accent), .86); }
.chevron {
  position: absolute;
  right: 16px;
  top: 15px;
  color: rgba(var(--accent), .62);
  font-size: 25px;
  font-weight: 300;
}
.tone-warm { --accent: 255 199 91; }
.tone-amber { --accent: 255 163 74; }
.tone-indigo { --accent: 154 139 255; }
.tone-aqua { --accent: 90 218 213; }
.tone-coral { --accent: 255 121 112; }
.tone-blue { --accent: 103 173 255; }
.tone-navigation { --accent: 132 154 255; }
.tone-neutral { --accent: 175 183 196; }
.transition-forward .zones { animation: page-forward 220ms cubic-bezier(.2,.8,.2,1); }
.transition-backward .zones { animation: page-back 220ms cubic-bezier(.2,.8,.2,1); }
@keyframes page-forward { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes page-back { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
aside { width: 360px; }
aside h1 { margin: 0 0 8px; font-size: 28px; letter-spacing: -.035em; }
aside p { margin: 0 0 18px; color: #9ca4ae; line-height: 1.5; }
pre {
  min-height: 220px;
  white-space: pre-wrap;
  background: rgba(5,6,7,.75);
  border: 1px solid rgba(255,255,255,.06);
  padding: 16px;
  border-radius: 16px;
  color: #9ae6b4;
  box-shadow: inset 0 1px rgba(255,255,255,.025);
}
.load-error { padding: 40px; color: #ff8e88; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; } }
@media (max-width: 1000px) { main { flex-direction: column; } .device { transform: scale(.8); margin: -56px; } }
