/* ==========================================================================
   AjayOS — iOS on phones, iPadOS on wider screens (.os.ipad)
   ========================================================================== */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Helvetica Neue", system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Helvetica Neue", system-ui, sans-serif;

  /* home-screen chrome (always over the dark wallpaper) */
  --chrome-ink: #fff;
  --chrome-dim: rgba(255,255,255,.72);
  --glass: rgba(255,255,255,.14);
  --glass-strong: rgba(255,255,255,.22);
  --glass-edge: rgba(255,255,255,.28);
  --glass-dark: rgba(28,28,36,.38);

  /* app surfaces (light) */
  --bg: #f2f2f7;
  --bg2: #ffffff;
  --fill: #e5e5ea;
  --label: #000;
  --label2: rgba(60,60,67,.62);
  --sep: rgba(60,60,67,.18);
  --tint: #0a84ff;
  --green: #30c75a;
  --red: #ff3b30;
  --orange: #ff9500;
  --notes-paper: #fffdf4;

  --icon: 60px;
  --icon-r: 14px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease-spring: cubic-bezier(.2, .9, .25, 1.05);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
}
:root[data-appearance="dark"] { --bg:#000; --bg2:#1c1c1e; --fill:#2c2c2e; --label:#fff; --label2:rgba(235,235,245,.6); --sep:rgba(84,84,88,.6); --tint:#0a84ff; --notes-paper:#1c1c1e; }
@media (prefers-color-scheme: dark) {
  :root:not([data-appearance="light"]) { --bg:#000; --bg2:#1c1c1e; --fill:#2c2c2e; --label:#fff; --label2:rgba(235,235,245,.6); --sep:rgba(84,84,88,.6); --notes-paper:#1c1c1e; }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: #0f1433; color: var(--chrome-ink); font-family: var(--font); overflow: hidden; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }

.os { position: fixed; inset: 0; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: manipulation; }

/* ---------- wallpaper ---------- */
.wall { position: absolute; inset: -40px; transition: filter .6s var(--ease-out), transform .6s var(--ease-out); background:
  radial-gradient(120% 60% at 70% 105%, #ff8a4c 0%, #d9466b 22%, rgba(90,40,120,0) 55%),
  radial-gradient(90% 50% at 10% 0%, #2a3a8f 0%, rgba(20,24,60,0) 60%),
  linear-gradient(180deg, #0f1433 0%, #2b2160 45%, #6a2b6e 70%, #c2475e 100%); }
.wall[data-wall="river"] { background:
  radial-gradient(100% 60% at 20% 100%, #4fd1c5 0%, rgba(30,90,120,0) 60%),
  radial-gradient(80% 50% at 90% 0%, #3b5bdb 0%, rgba(20,30,70,0) 60%),
  linear-gradient(180deg, #07142b 0%, #0f3057 50%, #11698e 80%, #19a7a3 100%); }
.wall[data-wall="park"] { background:
  radial-gradient(110% 60% at 60% 100%, #f9d976 0%, rgba(240,160,80,0) 55%),
  radial-gradient(80% 50% at 0% 10%, #2f7d4f 0%, rgba(20,60,40,0) 60%),
  linear-gradient(180deg, #0d2b1d 0%, #1f5135 45%, #5c8a3a 75%, #e0b04f 100%); }
.wall .skyline { position: absolute; left: 0; right: 0; bottom: 40px; width: 100%; height: 38%; }
.os.locked .wall { filter: none; }
.os.app-open .wall { filter: blur(20px) brightness(.85); transform: scale(1.06); }

/* ---------- status bar ---------- */
.status { position: absolute; top: 0; left: 0; right: 0; z-index: 80; height: calc(50px + var(--safe-t)); padding: calc(var(--safe-t) + 14px) 30px 0 36px;
  display: flex; justify-content: space-between; align-items: flex-start; font-weight: 600; font-size: 16px; letter-spacing: -.2px; pointer-events: none; transition: color .3s; }
.status__date { display: none; margin-left: 8px; }
.status__icons { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.battery { width: 25px; height: 12px; border: 1.2px solid currentColor; border-radius: 4px; opacity: .95; padding: 1.5px; position: relative; }
.battery::after { content: ""; position: absolute; right: -4px; top: 3.5px; width: 2px; height: 4px; border-radius: 0 1px 1px 0; background: currentColor; opacity: .5; }
.battery i { display: block; height: 100%; width: 80%; border-radius: 2px; background: currentColor; }
.os.app-open:not(.ipad) .status { color: var(--label); }
.os.app-open:not(.ipad).app-dark .status { color: #fff; }

/* ---------- lock screen ---------- */
.lock { position: absolute; inset: 0; z-index: 60; cursor: grab; will-change: transform; outline: none; }
.lock:active { cursor: grabbing; }
.lock::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.18), transparent 35%); pointer-events: none; }
.lock__padlock { position: absolute; top: calc(var(--safe-t) + 52px); left: 50%; transform: translateX(-50%); }
.lock__padlock .shackle { transition: transform .35s cubic-bezier(.3,1.6,.5,1); transform-origin: 16px 11px; }
.lock.opening .shackle { transform: translate(5px,-4px) rotate(18deg); }
.lock__date { position: absolute; top: calc(var(--safe-t) + 98px); width: 100%; text-align: center; font-size: 20px; font-weight: 600; color: var(--chrome-dim); }
.lock__clock { position: absolute; top: calc(var(--safe-t) + 116px); width: 100%; text-align: center; font-family: var(--font-display); font-size: clamp(88px, 27vw, 112px); font-weight: 700; letter-spacing: -.035em; line-height: 1.05;
  font-variant-numeric: tabular-nums; color: rgba(255,255,255,.92); text-shadow: 0 2px 30px rgba(0,0,0,.15); }
.lock__notifs { position: absolute; left: 12px; right: 12px; bottom: calc(var(--safe-b) + 140px); display: flex; flex-direction: column; gap: 8px; }
.notif { display: flex; gap: 11px; align-items: center; padding: 12px 14px; border-radius: 24px; background: var(--glass-dark); border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(26px) saturate(1.5); -webkit-backdrop-filter: blur(26px) saturate(1.5); animation: rise .6s var(--ease-spring) both; }
.notif:nth-child(2) { animation-delay: .12s; }
.notif .icon-tile { --icon: 38px; --icon-r: 9px; }
.notif__t { flex: 1; min-width: 0; font-size: 14px; line-height: 1.3; }
.notif__t b { display: flex; justify-content: space-between; font-weight: 600; }
.notif__t b span { font-weight: 400; font-size: 13px; color: var(--chrome-dim); }
.notif__t p { color: #f2f2f6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.lock__quick { position: absolute; bottom: calc(var(--safe-b) + 44px); width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center;
  background: var(--glass-dark); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.lock__quick--l { left: 46px; } .lock__quick--r { right: 46px; }
.lock__bottom { position: absolute; left: 0; right: 0; bottom: calc(var(--safe-b) + 8px); display: flex; flex-direction: column; align-items: center; gap: 22px; }
.lock__hint { font-size: 15px; color: var(--chrome-dim); padding: 8px 14px; animation: nudge 2.6s ease-in-out infinite; }
@keyframes nudge { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }
.homebar { width: 138px; height: 5px; border-radius: 3px; background: #fff; }

/* ---------- home ---------- */
.home { position: absolute; inset: 0; z-index: 10; padding-top: calc(var(--safe-t) + 58px); }
.pages { position: absolute; top: calc(var(--safe-t) + 58px); left: 0; right: 0; bottom: calc(var(--safe-b) + 146px); display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.pages::-webkit-scrollbar { display: none; }
.page { flex: 0 0 100%; scroll-snap-align: start; padding: 0 20px; overflow-y: auto; scrollbar-width: none; }
.page::-webkit-scrollbar { display: none; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: var(--row, 92px); row-gap: var(--row-gap, 16px); column-gap: 8px; grid-auto-flow: row dense; justify-items: center; align-items: start; }

.app { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; text-decoration: none; color: var(--chrome-ink); }
.app__label { font-size: 12px; font-weight: 500; letter-spacing: -.1px; text-shadow: 0 1px 3px rgba(0,0,0,.35); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-tile { position: relative; width: var(--icon); height: var(--icon); border-radius: var(--icon-r); display: grid; place-items: center; flex: none; overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.22); transition: transform .18s var(--ease-out), filter .18s; }
/* liquid-glass specular edge */
.icon-tile::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(160deg, rgba(255,255,255,.38) 0%, rgba(255,255,255,0) 38%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), inset 0 -1px 0 rgba(0,0,0,.08); }
.icon-tile svg { width: 58%; height: 58%; position: relative; z-index: 1; }
.app:active .icon-tile { transform: scale(.88); filter: brightness(.82); }
.app:focus-visible { outline: none; }
.app:focus-visible .icon-tile { outline: 3px solid #fff; outline-offset: 3px; }
.badge { position: absolute; top: -6px; left: calc(50% + var(--icon) / 2 - 14px); min-width: 22px; height: 22px; border-radius: 11px; padding: 0 6px; background: var(--red); color: #fff;
  font-size: 13px; font-weight: 600; display: grid; place-items: center; z-index: 2; box-shadow: 0 1px 3px rgba(0,0,0,.25); }

/* widgets */
.widget { position: relative; width: 100%; height: 100%; border-radius: 24px; padding: 14px; overflow: hidden; text-align: left; color: #fff;
  background: var(--glass); border: 1px solid var(--glass-edge); backdrop-filter: blur(28px) saturate(1.6); -webkit-backdrop-filter: blur(28px) saturate(1.6);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 6px 24px rgba(0,0,0,.12); transition: transform .18s var(--ease-out); }
.widget:active { transform: scale(.97); }
.widget-cell { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; height: 100%; }
.widget-cell .app__label { flex: none; }
.widget-cell .widget { flex: 1; }
.span-4x2 { grid-column: span 4; grid-row: span 2; }
.span-2x2 { grid-column: span 2; grid-row: span 2; }
.w-profile { display: flex; gap: 14px; }
.w-profile img { height: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 14px; flex: none; }
.w-profile__txt { display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.w-profile h2 { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -.4px; line-height: 1.1; }
.w-profile p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; font-size: 13px; line-height: 1.35; color: var(--chrome-dim); }
.chip { align-self: flex-start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; background: rgba(255,255,255,.18); border-radius: 20px; padding: 5px 10px; }
.w-weather { background: linear-gradient(180deg, rgba(40,110,220,.75), rgba(70,150,235,.6)); display: flex; flex-direction: column; justify-content: space-between; }
.w-weather .city { font-size: 14px; font-weight: 600; }
.w-weather .temp { font-family: var(--font-display); font-size: 44px; font-weight: 300; line-height: 1; letter-spacing: -1px; }
.w-weather .cond { font-size: 12px; font-weight: 600; }
.w-weather .hl { font-size: 12px; color: rgba(255,255,255,.85); }
.w-weather svg { width: 22px; height: 22px; }
.w-now h3 { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #ffd166; margin-bottom: 8px; }
.w-now ul { list-style: none; display: grid; gap: 8px; }
.w-now li { font-size: 15px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.w-now li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #ffd166; flex: none; }

/* search pill / page dots */
.search-pill { position: absolute; left: 50%; bottom: calc(var(--safe-b) + 116px); transform: translateX(-50%); height: 30px; padding: 0 14px; border-radius: 15px;
  background: var(--glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,.18);
  font-size: 13px; font-weight: 600; display: grid; place-items: center; color: #fff; }
.search-pill > span { grid-area: 1/1; display: flex; align-items: center; gap: 6px; transition: opacity .25s; }
.search-pill__dots { opacity: 0; gap: 8px !important; }
.search-pill__dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.4); transition: background .2s; }
.search-pill__dots i.on { background: #fff; }
.home.scrolling .search-pill__label { opacity: 0; }
.home.scrolling .search-pill__dots { opacity: 1; }

/* dock */
.dock { position: absolute; left: 10px; right: 10px; bottom: calc(var(--safe-b) + 14px); height: 94px; border-radius: 34px; display: flex; justify-content: space-around; align-items: center; padding: 0 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,.12)); border: 1px solid rgba(255,255,255,.25);
  backdrop-filter: blur(30px) saturate(1.7); -webkit-backdrop-filter: blur(30px) saturate(1.7); box-shadow: inset 0 1px 0 rgba(255,255,255,.35); }
.dock .app { width: auto; }
.dock .app__label { display: none; }
.dock__divider { width: 1px; height: 56px; background: rgba(255,255,255,.3); display: none; }

/* entrance animation after unlock */
.home .pop { opacity: 0; transform: scale(1.3); }
.home.in .pop { opacity: 1; transform: none; transition: transform .6s var(--ease-spring), opacity .45s; transition-delay: calc(var(--i, 0) * 18ms); }

/* jiggle mode */
.jiggle-done { position: absolute; top: calc(var(--safe-t) + 52px); right: 18px; z-index: 20; padding: 6px 14px; border-radius: 16px; background: var(--glass-strong);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s; }
.home.jiggle .jiggle-done { opacity: 1; pointer-events: auto; }
.home.jiggle .app .icon-tile, .home.jiggle .widget { animation: jiggle .28s ease-in-out infinite alternate; }
.home.jiggle .app:nth-child(odd) .icon-tile { animation-delay: -.14s; }
@keyframes jiggle { from { transform: rotate(-2deg); } to { transform: rotate(2deg); } }

/* ---------- app window ---------- */
.app-layer { position: absolute; inset: 0; z-index: 50; }
.app-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0); transition: background .4s; }
.appwin { position: absolute; inset: 0; background: var(--bg); color: var(--label); overflow: hidden; display: flex; flex-direction: column; border-radius: 0;
  transition: transform .52s var(--ease-spring), opacity .3s, border-radius .5s; user-select: text; -webkit-user-select: text; }
.appwin.closed { transform: scale(.1); opacity: 0; border-radius: 60px; }
.appwin__chrome { display: none; }
.appwin__body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: calc(var(--safe-t) + 56px) 16px calc(var(--safe-b) + 48px); }
.appwin__body.flush { padding: 0; overflow: hidden; }
.appwin__grab { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--safe-b) + 30px); display: flex; justify-content: center; align-items: flex-end; padding-bottom: calc(var(--safe-b) + 8px); z-index: 5; }
.appwin__grab i { width: 138px; height: 5px; border-radius: 3px; background: var(--label); opacity: .85; }
.app-dark .appwin__grab i { background: #fff; }

/* ---------- app content primitives ---------- */
.large-title { font-family: var(--font-display); font-size: 34px; font-weight: 700; letter-spacing: -.5px; margin: 4px 4px 4px; }
.subtitle { color: var(--label2); font-size: 15px; margin: 0 4px 18px; }
.section-h { font-size: 13px; text-transform: uppercase; letter-spacing: .02em; color: var(--label2); margin: 22px 16px 7px; }
.list { background: var(--bg2); border-radius: 12px; overflow: hidden; }
.cell { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 10px 16px; font-size: 17px; position: relative; text-decoration: none; color: var(--label); width: 100%; text-align: left; }
.cell + .cell::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--sep); }
.cell .icon-tile { --icon: 30px; --icon-r: 7px; box-shadow: none; }
.cell .icon-tile + .cell__main { }
.cell__main { flex: 1; min-width: 0; }
.cell__main small { display: block; color: var(--label2); font-size: 14px; margin-top: 1px; }
.cell__value { color: var(--label2); text-align: right; }
.cell__chev { color: var(--label2); opacity: .6; font-size: 20px; line-height: 1; }
a.cell:active, button.cell:active { background: var(--fill); }
.prose p { font-size: 17px; line-height: 1.5; margin-bottom: 12px; }
.ph { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #b4551d; background: #ffe9da; border-radius: 6px; padding: 2px 6px; vertical-align: middle; margin-left: 6px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 24px; background: var(--tint); color: #fff; font-size: 17px; font-weight: 600; text-decoration: none; }
.btn--gray { background: var(--fill); color: var(--tint); }
.btn--block { width: 100%; }
.stack { display: grid; gap: 10px; }
.empty { text-align: center; padding: 48px 20px; color: var(--label2); }
.empty .icon-tile { --icon: 76px; --icon-r: 18px; margin: 0 auto 16px; }
.empty h2 { color: var(--label); font-size: 22px; margin-bottom: 6px; }
.seg { display: flex; background: var(--fill); border-radius: 9px; padding: 2px; }
.seg button { flex: 1; padding: 6px 0; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--label); }
.seg button.on { background: var(--bg2); box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.switch { width: 51px; height: 31px; border-radius: 16px; background: var(--fill); position: relative; transition: background .2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.25); transition: transform .25s var(--ease-spring); }
.switch[aria-checked="true"] { background: var(--green); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }

/* Notes */
.notes-paper { background: var(--notes-paper); border-radius: 14px; padding: 18px; }
.notes-paper h2 { font-size: 26px; font-weight: 700; margin-bottom: 4px; }
.notes-paper .meta { color: var(--label2); font-size: 13px; text-align: center; margin-bottom: 14px; }

/* Messages */
.msg-app { display: flex; flex-direction: column; height: 100%; }
.msg-head { padding: calc(var(--safe-t) + 50px) 16px 10px; text-align: center; border-bottom: .5px solid var(--sep); background: var(--bg2); }
.msg-head img { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; display: block; margin: 0 auto 4px; }
.msg-head b { font-size: 13px; font-weight: 500; }
.thread { flex: 1; overflow-y: auto; padding: 14px 14px 8px; display: flex; flex-direction: column; gap: 4px; background: var(--bg2); }
.bub { max-width: 76%; padding: 8px 13px; border-radius: 19px; font-size: 16px; line-height: 1.35; animation: rise .3s var(--ease-spring) both; word-wrap: break-word; }
.bub.them { background: var(--fill); color: var(--label); align-self: flex-start; }
.bub.me { background: var(--tint); color: #fff; align-self: flex-end; }
.bub.sys { align-self: center; background: none; color: var(--label2); font-size: 12px; text-align: center; max-width: 92%; }
.typing { display: inline-flex; gap: 4px; padding: 3px 0; }
.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--label2); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .3; } }
.composer { display: flex; gap: 8px; align-items: flex-end; padding: 8px 12px calc(var(--safe-b) + 34px); background: var(--bg2); }
.composer textarea, .composer input { flex: 1; min-width: 0; border: 1px solid var(--sep); border-radius: 19px; padding: 9px 14px; font: 16px var(--font); background: var(--bg2); color: var(--label); resize: none; max-height: 110px; }
.composer input { flex: 0 0 34%; }
.composer .send { width: 36px; height: 36px; border-radius: 50%; background: var(--tint); display: grid; place-items: center; flex: none; }
.composer .send:disabled { opacity: .4; }

/* Photos */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; margin: 0 -16px; }
.photo-grid > * { aspect-ratio: 1; width: 100%; object-fit: cover; display: grid; place-items: center; text-align: center; font-size: 12px; color: var(--label2); background: var(--fill); padding: 6px; }
.photo-grid img { padding: 0; cursor: zoom-in; }
.lightbox { position: absolute; inset: 0; background: #000; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: #fff; }
.lightbox img { max-width: 100%; max-height: 80%; object-fit: contain; }

/* Maps */
.map { position: relative; height: 380px; border-radius: 16px; overflow: hidden; background: #e8efe2; }
.map svg { width: 100%; height: 100%; display: block; }
.pin { position: absolute; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; font-size: 12px; font-weight: 600; color: #111; animation: rise .5s var(--ease-spring) both; }
.pin span { background: #fff; border-radius: 8px; padding: 4px 8px; margin-bottom: 6px; box-shadow: 0 1px 6px rgba(0,0,0,.18); white-space: nowrap; }
.pin i { width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--red); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); }

/* Calendar */
.month { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; row-gap: 6px; background: var(--bg2); border-radius: 14px; padding: 12px 8px; }
.month b { font-size: 12px; color: var(--label2); font-weight: 600; }
.month span { font-size: 17px; height: 36px; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.month span.today { color: #fff; }
.month span.today::before { content: ""; position: absolute; width: 36px; height: 36px; border-radius: 50%; background: var(--red); z-index: -1; }
.month span { position: relative; z-index: 0; }

/* Weather app */
.weather-app { min-height: 100%; color: #fff; text-align: center; padding: calc(var(--safe-t) + 70px) 18px calc(var(--safe-b) + 50px); background: linear-gradient(180deg, #2e6fd8, #6aa9f0); }
.weather-app.night { background: linear-gradient(180deg, #0b1534, #2b3f7a); }
.weather-app .city { font-size: 32px; font-weight: 500; }
.weather-app .big { font-family: var(--font-display); font-size: 96px; font-weight: 200; line-height: 1; margin-left: 20px; }
.weather-app .cond { font-size: 20px; font-weight: 500; opacity: .9; }
.weather-app .card { margin-top: 28px; text-align: left; border-radius: 16px; padding: 12px 14px; background: rgba(255,255,255,.14); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.weather-app .card h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; opacity: .7; margin-bottom: 10px; font-weight: 600; }
.hours { display: flex; justify-content: space-between; gap: 6px; overflow-x: auto; }
.hours div { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; min-width: 42px; }
.hours svg { width: 24px; height: 24px; }

/* Safari start page */
.fav-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 8px; background: var(--bg2); border-radius: 14px; padding: 16px 8px; }
.fav { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; text-decoration: none; color: var(--label); text-align: center; }
.fav .icon-tile { --icon: 56px; --icon-r: 13px; box-shadow: none; }
.urlbar { display: flex; align-items: center; gap: 8px; height: 44px; border-radius: 22px; background: var(--bg2); padding: 0 16px; color: var(--label2); font-size: 16px; margin-bottom: 18px; box-shadow: 0 2px 12px rgba(0,0,0,.08); }

/* Drive */
.drive { position: relative; width: 100%; height: 100%; background: #6aa85b; touch-action: none; user-select: none; -webkit-user-select: none; }
.drive canvas { display: block; width: 100%; height: 100%; }
.drive__hud { position: absolute; top: calc(var(--safe-t) + 52px); left: 12px; right: 12px; display: flex; gap: 8px; align-items: center; pointer-events: none; }
.drive__hud > * { pointer-events: auto; }
.drive__title { background: rgba(0,0,0,.55); color: #fff; padding: 8px 12px; border-radius: 14px; font-size: 13px; font-weight: 600; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.drive__title small { display: block; font-weight: 500; opacity: .75; font-size: 11px; }
.drive__exit { margin-left: auto; width: 36px; height: 36px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 18px; display: grid; place-items: center; }
.drive__prompt { position: absolute; left: 50%; bottom: calc(var(--safe-b) + 150px); transform: translate(-50%, 20px); opacity: 0; transition: .25s var(--ease-spring); pointer-events: none;
  background: rgba(255,255,255,.95); color: #111; border-radius: 18px; padding: 12px 14px 12px 16px; display: flex; gap: 12px; align-items: center; box-shadow: 0 10px 30px rgba(0,0,0,.3); white-space: nowrap; }
.drive__prompt.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.drive__prompt b { display: block; font-size: 15px; } .drive__prompt small { font-size: 12px; color: #555; }
.drive__prompt .btn { min-height: 38px; font-size: 15px; padding: 0 16px; background: #0a84ff; }
.drive__stick { position: absolute; left: 28px; bottom: calc(var(--safe-b) + 46px); width: 120px; height: 120px; border-radius: 50%; background: rgba(0,0,0,.25); border: 2px solid rgba(255,255,255,.4); touch-action: none; }
.drive__stick i { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(255,255,255,.85); box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.drive__keys { position: absolute; right: 16px; bottom: calc(var(--safe-b) + 44px); color: #fff; font-size: 12px; background: rgba(0,0,0,.45); padding: 8px 12px; border-radius: 12px; display: none; }
.drive__hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(0,0,0,.6); color: #fff; padding: 14px 18px; border-radius: 16px; font-size: 15px; text-align: center; line-height: 1.4; transition: opacity .5s; pointer-events: none; }

/* ---------- spotlight ---------- */
.spotlight { position: absolute; inset: 0; z-index: 70; background: rgba(0,0,0,.25); backdrop-filter: blur(30px) saturate(1.4); -webkit-backdrop-filter: blur(30px) saturate(1.4); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.spotlight__box { padding: calc(var(--safe-t) + 56px) 16px 0; max-width: 640px; margin: 0 auto; }
.spotlight__field { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 0 0 12px; border-radius: 22px; background: rgba(255,255,255,.2); color: rgba(255,255,255,.8); }
.spotlight__field input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: #fff; font: 17px var(--font); }
.spotlight__field input::placeholder { color: rgba(255,255,255,.65); }
.spotlight__field button { color: #fff; font-size: 16px; padding: 0 14px; height: 100%; }
.spotlight__results { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 8px; padding: 22px 4px; }

/* ---------- toast ---------- */
.toast { position: absolute; top: calc(var(--safe-t) + 54px); left: 50%; transform: translate(-50%, -20px); opacity: 0; z-index: 90; pointer-events: none;
  background: rgba(30,30,34,.92); color: #fff; padding: 10px 16px; border-radius: 20px; font-size: 14px; font-weight: 500; transition: .3s var(--ease-spring); white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- tile colors ---------- */
.t-notes { background: linear-gradient(#fff 0 30%, #fff6cf 30%); }
.t-photos { background: linear-gradient(160deg, #6be0d6, #2a8fa8); }
.t-maps { background: linear-gradient(160deg, #a9e58f, #3e9a5a); }
.t-cal { background: #fff; color: #111; display: flex !important; flex-direction: column; justify-content: center; align-items: center; line-height: 1; }
.t-cal small { color: var(--red); font-size: calc(var(--icon) * .16); font-weight: 600; text-transform: uppercase; position: relative; z-index: 1; }
.t-cal b { font-size: calc(var(--icon) * .48); font-weight: 300; font-family: var(--font-display); position: relative; z-index: 1; }
.t-weather { background: linear-gradient(180deg, #3d8bf0, #74b8f7); }
.t-rides { background: linear-gradient(160deg, #ffb35c, #ff6a2b); }
.t-code { background: linear-gradient(160deg, #454b59, #16181d); }
.t-work { background: linear-gradient(160deg, #5a97ff, #2456c9); }
.t-cam { background: linear-gradient(160deg, #ff7cb0, #b6339a); }
.t-at { background: linear-gradient(160deg, #3a3a3c, #0b0b0c); }
.t-set { background: linear-gradient(160deg, #c9ccd3, #7d828d); }
.t-msg { background: linear-gradient(160deg, #6fe27a, #2fb84a); }
.t-mail { background: linear-gradient(160deg, #5fb2ff, #1a6ef0); }
.t-web { background: linear-gradient(160deg, #fff, #dfe8f4); }
.t-drive { background: linear-gradient(160deg, #ffe066, #f4a300); }
.t-music { background: linear-gradient(160deg, #ff6b81, #e8344e); }
.t-books { background: linear-gradient(160deg, #ffad4d, #f27a1a); }
.t-files { background: linear-gradient(160deg, #6cc4ff, #2c8ff0); }
.t-proj { background: linear-gradient(160deg, #a77bff, #5b3fd6); }
.t-classic { background: linear-gradient(160deg, #e8e4dc, #b9b2a5); }

/* ==========================================================================
   iPadOS layout (wide screens)
   ========================================================================== */
.os.ipad { --icon: 74px; --icon-r: 17px; }
.os.ipad .status { height: 34px; padding: 10px 26px 0; font-size: 14px; }
.os.ipad .status__date { display: inline; }
.os.ipad .lock__padlock { top: 30px; }
.os.ipad .lock__date { top: 76px; font-size: 24px; }
.os.ipad .lock__clock { top: 100px; font-size: 136px; }
.os.ipad .lock__notifs { left: 50%; right: auto; width: 400px; transform: translateX(-50%); bottom: 130px; }
.os.ipad .lock__quick--l { left: 60px; } .os.ipad .lock__quick--r { right: 60px; }
.os.ipad .pages { top: 64px; bottom: 150px; }
.os.ipad .page { padding: 0 max(48px, calc((100% - 1080px) / 2)); }
.os.ipad .grid { grid-template-columns: repeat(6, 1fr); column-gap: 24px; }
.os.ipad .app__label { font-size: 13px; }
.os.ipad .w-profile h2 { font-size: 28px; }
.os.ipad .w-profile p { font-size: 15px; }
.os.ipad .w-weather .temp { font-size: 56px; }
.os.ipad .dock { left: 50%; right: auto; transform: translateX(-50%); bottom: 16px; height: 98px; padding: 0 14px; gap: 16px; border-radius: 30px; }
.os.ipad .dock__divider { display: block; }
.os.ipad .search-pill { bottom: 124px; }
.os.ipad .jiggle-done { top: 44px; }

/* windows */
.os.ipad .app-backdrop { cursor: pointer; }
.os.ipad.app-open .app-backdrop { background: rgba(0,0,0,.18); }
.os.ipad .appwin { inset: auto; left: 50%; top: 50%; width: min(980px, 88vw); height: min(780px, calc(100% - 120px)); margin: 0; translate: -50% -48%;
  border-radius: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.45), 0 0 0 .5px rgba(0,0,0,.2); transition: transform .5s var(--ease-spring), opacity .3s, width .45s var(--ease-out), height .45s var(--ease-out), border-radius .45s, translate .45s var(--ease-out); }
.os.ipad .appwin.max { width: 100%; height: calc(100% - 34px); translate: -50% calc(-50% + 17px); border-radius: 0; }
.os.ipad .appwin__chrome { display: flex; align-items: center; gap: 8px; position: absolute; top: 0; left: 0; right: 0; height: 44px; padding: 0 16px; z-index: 6; pointer-events: none; }
.os.ipad .appwin__chrome > * { pointer-events: auto; }
.light { width: 13px; height: 13px; border-radius: 50%; position: relative; }
.light--close { background: #ff5f57; } .light--min { background: #febc2e; } .light--max { background: #28c840; }
.light::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.2); }
.appwin__title { margin-left: 10px; font-size: 13px; font-weight: 600; color: var(--label2); }
.os.ipad .appwin__body { padding: 52px max(28px, calc((100% - 720px) / 2)) 36px; }
.os.ipad .appwin__body.flush { padding: 0; }
.os.ipad .appwin__grab { display: none; }
.os.ipad .msg-head { padding-top: 44px; }
.os.ipad .composer { padding-bottom: 14px; }
.os.ipad .weather-app { padding-top: 70px; }
.os.ipad .drive__hud { top: 52px; left: 100px; }
.os.ipad .drive__prompt { bottom: 40px; }
.os.ipad .drive__keys { display: block; }
.os.ipad .photo-grid { grid-template-columns: repeat(5, 1fr); margin: 0; border-radius: 12px; overflow: hidden; }
.os.ipad .fav-grid { grid-template-columns: repeat(6, 1fr); }
.os.ipad .spotlight__results { grid-template-columns: repeat(6, 1fr); }
.os.ipad .map { height: 460px; }

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

@media (max-height: 600px) { .os:not(.ipad) .w-profile p { -webkit-line-clamp: 2; } .os:not(.ipad) .w-profile h2 { font-size: 19px; } }
