:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #111821;
  color: #f7f3e9;
}

* { box-sizing: border-box; }
body { margin: 0; }
button {
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
[hidden] { display: none !important; }

.stage {
  min-height: 100svh;
  display: grid;
  place-content: center;
  padding: 16px;
  background:
    radial-gradient(circle at 20% 18%, #46596a55, transparent 28%),
    radial-gradient(circle at 80% 88%, #7a5a4d40, transparent 30%),
    #111821;
}

.phone {
  position: relative;
  width: min(390px, calc(100vw - 32px));
  height: min(810px, calc(100svh - 32px));
  min-height: 560px;
  padding: 8px;
  border: 2px solid #3b414b;
  border-radius: 54px;
  background: #080b10;
  box-shadow: 0 25px 80px #0009, inset 0 0 0 2px #171b20;
}

.side-button {
  position: absolute;
  top: 24%;
  right: -5px;
  width: 4px;
  height: 67px;
  padding: 0;
  border: 0;
  border-radius: 0 3px 3px 0;
  background: #66707b;
}
.side-button:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }

.screen {
  --keyboard-height: min(350px, 53dvh);
  position: relative;
  isolation: isolate;
  height: 100%;
  overflow: hidden;
  border-radius: 45px;
  background: #ed679b url("./wallpaper.png") center / cover no-repeat;
}

.island {
  position: absolute;
  z-index: 5;
  top: 11px;
  left: 50%;
  width: 105px;
  height: 30px;
  transform: translateX(-50%);
  border-radius: 30px;
  background: #090c11;
}

.status-bar {
  position: absolute;
  z-index: 4;
  top: 16px;
  left: 31px;
  right: 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 22px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.025em;
  text-shadow: 0 1px 6px #6f214a;
}

.status-icons { display: inline-flex; align-items: center; gap: 5px; }
.status-icons svg { display: block; fill: currentColor; }
.cellular-icon { width: 19px; height: 14px; }
.wifi-icon { width: 19px; height: 16px; fill: none !important; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; }
.wifi-icon circle { fill: currentColor; stroke: none; }
.battery-icon { width: 28px; height: 14px; margin-left: 1px; }
.status-carrier { font-size: 13px; letter-spacing: 0; }
.lock-screen, .pin-screen, .home-screen { height: 100%; }
.lock-screen {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
  touch-action: none;
  user-select: none;
  transform: translate3d(0, calc(-1 * var(--swipe-offset, 0px)), 0);
  will-change: transform;
  transition: transform .27s cubic-bezier(.22, .72, .25, 1);
}
.lock-screen.unlocking { transition: transform .42s cubic-bezier(.19, .72, .18, 1); }
.lock-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(#24132336 0%, transparent 37%, transparent 67%, #21111d70 100%);
}
.lock-screen.dragging { transition: none; }
.lock-screen:focus-visible { outline: 2px solid #fff; outline-offset: -12px; }
.lock-heading, .lock-bottom { position: relative; }
.lock-heading { padding-top: clamp(57px, 8%, 76px); text-shadow: 0 2px 12px #74284fbb; }
.lock-glyph { display: block; width: 21px; height: 27px; margin: 0 auto 15px; filter: drop-shadow(0 1px 5px #0005); }
.lock-heading p { margin: 0; font-size: 20px; font-weight: 500; letter-spacing: .015em; }
.lock-heading h1 { margin: -2px 0; font-size: clamp(76px, 22vw, 88px); font-weight: 200; line-height: 1.12; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.lock-bottom { padding: 0 38px 47px; }
.swipe-hint {
  display: inline-block;
  margin-bottom: 25px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .02em;
  text-shadow: 0 1px 8px #0008;
  animation: float-up 2.4s ease-in-out infinite;
}
.lock-shortcuts { display: flex; justify-content: space-between; align-items: center; }
.lock-shortcut {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #22232a80;
  color: #fff;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.lock-shortcut svg { width: 22px; height: 26px; }

.pin-screen {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(78px, 12svh, 108px) 28px 43px;
  background: #31203970;
  backdrop-filter: blur(22px) saturate(1.3);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
}
.pin-screen.revealing .pin-heading,
.pin-screen.revealing .keypad,
.pin-screen.revealing .pin-actions {
  animation: pin-reveal .4s cubic-bezier(.2, .7, .2, 1) both;
}
.pin-screen.leaving { animation: pin-leave .36s ease-in both; pointer-events: none; }
.pin-heading { flex: 1 1 auto; min-height: 110px; text-align: center; }
.pin-heading h2 { margin: 0 0 19px; font-size: 20px; font-weight: 500; }
.pin-dots { display: flex; justify-content: center; gap: 23px; }
.pin-dots span { width: 12px; height: 12px; border: 1.5px solid #fff; border-radius: 50%; }
.pin-dots span.filled { background: #fff; }
.pin-feedback { min-height: 18px; margin: 13px 0 0; color: #ffc3a8; font-size: 13px; }
.pin-heading.shake { animation: shake .32s ease-in-out; }

.keypad {
  width: min(274px, 100%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  justify-items: center;
  gap: clamp(10px, 2svh, 20px) 10px;
}
.keypad button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: clamp(57px, 9svh, 76px);
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: #ffffff35;
  color: #fff;
  font-size: 32px;
  font-weight: 400;
  line-height: 1;
  -webkit-appearance: none;
  appearance: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s, transform .15s;
}
.keypad small { min-height: 9px; margin-top: 4px; font-size: 9px; font-weight: 600; line-height: 1; letter-spacing: .13em; }
.keypad button:active { background: #ffffff75; transform: scale(.94); }
.keypad button:focus { outline: none; }
.keypad button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.pin-actions {
  display: flex;
  justify-content: space-between;
  width: min(296px, 100%);
  margin-top: clamp(23px, 5svh, 43px);
}
.pin-actions button {
  min-width: 64px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 14px;
}
.pin-actions button:focus-visible { outline: 2px solid #fff; border-radius: 4px; }

.home-screen { display: flex; flex-direction: column; padding: 84px 22px 27px; }
.home-screen.arriving { animation: home-arrive .36s ease-out both; }
.home-screen.receding { animation: home-recede .44s cubic-bezier(.2, .7, .2, 1) both; }
.home-screen.returning { animation: home-return .36s cubic-bezier(.2, .7, .2, 1) both; }
.widget-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.home-widget {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 0;
  border-radius: 24px;
  box-shadow: 0 7px 20px #682a4a35;
  transition: transform .15s ease;
}
.home-widget:active { transform: scale(.97); }
.home-widget:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.weather-widget {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 14px 14px 12px;
  background: linear-gradient(158deg, #4b9ee9 0%, #66b4f0 52%, #9ad0f8 100%);
  color: #fff;
  text-align: left;
  text-shadow: 0 1px 4px #27669666;
}
.widget-city { font-size: 16px; font-weight: 600; }
.widget-temperature { margin-top: 1px; font-size: 47px; font-weight: 300; line-height: 1; letter-spacing: -.06em; }
.widget-weather-icon { position: absolute; top: 38%; right: 9%; width: 46px; height: 46px; filter: drop-shadow(0 2px 3px #2573a74d); }
.widget-weather-icon svg { width: 100%; height: 100%; }
.widget-condition { margin-top: auto; font-size: 13px; font-weight: 600; }
.widget-range { margin-top: 2px; font-size: 11px; white-space: nowrap; }
.photo-widget { background: linear-gradient(145deg, #f4e8ed, #d9c7d4); }
.app-grid, .dock { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); justify-items: center; }
.app-grid { row-gap: 22px; column-gap: 8px; }
.app-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 11px;
  white-space: nowrap;
  text-shadow: 0 1px 5px #74284f;
}
.app-tile:focus-visible { outline: 2px solid #fff; outline-offset: 4px; border-radius: 14px; }
.app-tile:active .app-icon { transform: scale(.9); }
.app-icon {
  position: relative;
  display: block;
  width: 58px;
  height: 58px;
  overflow: hidden;
  border-radius: 15px;
  box-shadow: 0 4px 12px #55254342;
  transition: transform .15s ease;
}
.app-icon img { display: block; width: 100%; height: 100%; object-fit: cover; }
.icon-calendar::before {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 10px;
  background: #fff;
}
.icon-calendar small, .icon-calendar strong {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  text-shadow: none;
}
.icon-calendar small { top: 11%; color: #ed403d; font-size: 11px; font-weight: 700; }
.icon-calendar strong { top: 29%; color: #1c1c1e; font-size: 35px; font-weight: 400; line-height: 1; }
.dock {
  margin-top: auto;
  padding: 13px 4px 11px;
  border-radius: 26px;
  background: #f4c6d085;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.dock .app-tile > span:last-child {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.app-screen { position: absolute; z-index: 3; inset: 0; height: 100%; background: #f6f6f8; color: #1b1b1f; }
.app-screen.opening, .app-screen.closing {
  transform-origin: var(--app-origin-x, 50%) var(--app-origin-y, 50%);
  will-change: transform, opacity, border-radius;
  overflow: hidden;
}
.app-screen.opening { animation: app-expand .44s cubic-bezier(.18, .8, .2, 1) both; }
.app-screen.closing { animation: app-collapse .36s cubic-bezier(.4, 0, .8, .3) both; pointer-events: none; }
.app-header { position: relative; display: flex; align-items: center; justify-content: center; height: 108px; padding-top: 48px; }
.app-header h2 { margin: 0; font-size: 17px; font-weight: 600; }
.app-back { position: absolute; left: 18px; bottom: 20px; padding: 0; border: 0; background: none; color: #087bf5; font-size: 15px; }
.screen.app-open .status-bar { color: #1b1b1f; text-shadow: none; }
.screen.clock-open .status-bar { color: #fff; }
.screen.weather-open .status-bar { color: #fff; text-shadow: 0 1px 5px #235a83; }
.screen.app-open .status-bar { transition: color .2s ease; }
.app-screen.clock-open { background: #000; color: #fff; }
.app-screen.clock-open > .app-header { display: none; }
.app-screen.weather-open { background: #4b9edb; color: #fff; }
.app-screen.weather-open > .app-header { display: none; }
.clock-app { display: flex; flex-direction: column; height: 100%; }
.clock-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex: 0 0 112px;
  padding: 0 22px 9px;
}
.clock-toolbar button { padding: 5px 0; border: 0; background: none; color: #ff9f0a; }
.clock-back { font-size: 17px; }
.clock-add { font-size: 34px; font-weight: 300; line-height: 1; }
.clock-content { position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.clock-page { padding: 0 22px 24px; }
.clock-page.entering, .clock-page.leaving { position: absolute; inset: 0 0 auto; width: 100%; pointer-events: none; }
.clock-content.from-right .clock-page.entering { animation: tab-enter-right .28s cubic-bezier(.2, .7, .2, 1) both; }
.clock-content.from-right .clock-page.leaving { animation: tab-leave-left .28s cubic-bezier(.2, .7, .2, 1) both; }
.clock-content.from-left .clock-page.entering { animation: tab-enter-left .28s cubic-bezier(.2, .7, .2, 1) both; }
.clock-content.from-left .clock-page.leaving { animation: tab-leave-right .28s cubic-bezier(.2, .7, .2, 1) both; }
.clock-page h2 { margin: 0 0 24px; font-size: 34px; line-height: 1.2; letter-spacing: -.035em; }
.clock-page h3 { margin: 0; padding: 0 0 8px; border-bottom: 1px solid #38383a; font-size: 17px; font-weight: 600; }
.alarm-row, .world-city {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 92px;
  border-bottom: 1px solid #38383a;
}
.alarm-edit { flex: 1; min-width: 0; padding: 10px 0; border: 0; background: none; color: inherit; text-align: left; }
.alarm-edit time { display: block; font-size: 57px; font-weight: 300; line-height: 1.1; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.alarm-row.off .alarm-edit time { color: #77777b; }
.alarm-edit small { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; letter-spacing: 0; }
.alarm-switch { position: relative; flex: 0 0 51px; width: 51px; height: 31px; margin-left: 16px; padding: 0; border: 0; border-radius: 18px; background: #39393d; transition: background .2s; }
.alarm-switch[aria-checked="true"] { background: #30d158; }
.alarm-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #0005; transition: transform .2s; }
.alarm-switch[aria-checked="true"]::after { transform: translateX(20px); }
.world-city { min-height: 94px; }
.world-city div { display: flex; flex-direction: column; gap: 3px; }
.world-offset { color: #8e8e93; font-size: 13px; }
.world-city strong { font-size: 25px; font-weight: 400; }
.world-city time { font-size: 44px; font-weight: 300; font-variant-numeric: tabular-nums; }
.clock-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  flex: 0 0 auto;
  padding: 10px 8px 25px;
  border-top: 1px solid #303033;
  background: #18181a;
}
.clock-tabs button { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; padding: 0; border: 0; background: none; color: #8e8e93; font-size: 10px; white-space: nowrap; transition: color .24s ease; }
.clock-tabs button[aria-selected="true"] { color: #ff9f0a; }
.clock-tabs button:active svg { transform: scale(.88); }
.clock-tabs svg { width: 25px; height: 25px; transition: transform .24s cubic-bezier(.2, .7, .2, 1); }
.screen.clock-open .home-indicator { background: #fff; }
.stopwatch-display { margin: clamp(35px, 10svh, 85px) 0 44px; text-align: center; font-size: clamp(54px, 15vw, 70px); font-weight: 200; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.clock-controls { display: flex; justify-content: space-between; align-items: center; }
.clock-control { width: 76px; height: 76px; padding: 0; border: 3px solid #000; border-radius: 50%; font-size: 16px; box-shadow: 0 0 0 2px currentColor; }
.clock-control.secondary { background: #303034; color: #fff; }
.clock-control.primary { background: #183b22; color: #30d158; }
.clock-control.primary.running { background: #3f1918; color: #ff453a; }
.clock-control:disabled { opacity: .45; }
.lap-list { margin-top: 34px; }
.lap-list div { display: flex; justify-content: space-between; padding: 13px 0; border-top: 1px solid #38383a; color: #ddd; font-variant-numeric: tabular-nums; }
.timer-fields { display: flex; justify-content: center; gap: 12px; margin: clamp(34px, 9svh, 72px) 0 46px; }
.timer-fields label { display: flex; align-items: baseline; gap: 3px; color: #aaa; font-size: 14px; }
.timer-fields input { width: 58px; padding: 8px 3px; border: 0; border-bottom: 1px solid #555; border-radius: 0; outline: none; background: transparent; color: #fff; font-size: 32px; text-align: center; }
.timer-fields input:focus { border-color: #ff9f0a; }
.timer-display { margin: clamp(34px, 9svh, 72px) 0 46px; text-align: center; font-size: 64px; font-weight: 200; font-variant-numeric: tabular-nums; }
.timer-message { margin-top: 35px; color: #ff9f0a; text-align: center; }
.clock-sheet { position: absolute; z-index: 7; inset: 0; display: flex; align-items: end; background: #0009; }
.screen.keyboard-open .clock-sheet { bottom: var(--keyboard-height); }
.screen.native-keyboard-open .clock-sheet { bottom: var(--native-keyboard-inset, 0px); }
.screen.keyboard-open .alarm-form, .screen.native-keyboard-open .alarm-form { min-height: 0; max-height: 100%; overflow-y: auto; }
.alarm-form { width: 100%; min-height: min(475px, 85%); padding: 0 18px max(30px, env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0; background: #1c1c1e; }
.alarm-form header { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.alarm-form header h3 { margin: 0; font-size: 17px; }
.alarm-form button { padding: 8px 2px; border: 0; background: transparent; color: #ff9f0a; font-size: 16px; }
.alarm-form > input[type="time"] { display: block; width: 100%; margin: 12px auto 30px; border: 0; background: transparent; color: #fff; font-size: clamp(45px, 14vw, 62px); text-align: center; color-scheme: dark; }
.alarm-label-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 15px; border-radius: 10px; background: #2c2c2e; font-size: 16px; }
.alarm-label-row input { width: 65%; border: 0; outline: 0; background: none; color: #aaa; font: inherit; text-align: right; }
.alarm-form .alarm-remove { display: block; width: 100%; margin-top: 22px; padding: 13px; border-radius: 10px; background: #2c2c2e; color: #ff453a; }
.home-indicator {
  position: absolute;
  z-index: 5;
  bottom: 9px;
  left: 50%;
  width: 115px;
  height: 4px;
  padding: 0;
  transform: translateX(-50%);
  border: 0;
  border-radius: 5px;
  background: #fff;
}
.screen.app-open .home-indicator { background: #1b1b1f; }
.screen.app-open.clock-open .home-indicator { background: #fff; }
.screen.app-open.weather-open .home-indicator { background: #fff; }
.weather-app {
  position: relative;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(ellipse 140px 42px at 17% 9%, #ffffff9c 5%, #ffffff00 100%),
    radial-gradient(ellipse 190px 52px at 80% 16%, #ffffff91 8%, #ffffff00 100%),
    radial-gradient(ellipse 135px 35px at 38% 23%, #ffffff59 8%, #ffffff00 100%),
    linear-gradient(175deg, #597fa7 0%, #83a5c9 27%, #508dc5 58%, #3b7fb9 100%);
  transition: background .3s ease;
}
.weather-app[data-weather-city="hengdian"] {
  background:
    radial-gradient(ellipse 190px 50px at 24% 13%, #ffffff8c 7%, #ffffff00 100%),
    radial-gradient(ellipse 155px 43px at 82% 21%, #ffffff99 10%, #ffffff00 100%),
    linear-gradient(175deg, #738dac 0%, #a6afc0 26%, #7797b4 58%, #4b789c 100%);
}
.weather-app[data-weather-city="zhengzhou"] {
  background:
    radial-gradient(ellipse 250px 75px at 34% 13%, #d9e3edaf 7%, #ffffff00 100%),
    radial-gradient(ellipse 200px 58px at 77% 24%, #cbd7e19c 7%, #ffffff00 100%),
    linear-gradient(175deg, #6f869d 0%, #98aabb 30%, #637e9d 65%, #536e92 100%);
}
.weather-app[data-weather-city="panzhihua"] {
  background:
    radial-gradient(circle at 76% 14%, #fff2b5a8 0, #fff5d100 22%),
    radial-gradient(ellipse 180px 43px at 18% 23%, #ffffff69 5%, #ffffff00 100%),
    linear-gradient(175deg, #629fc5 0%, #8ec4dc 29%, #579bc3 60%, #3c82b2 100%);
}
.weather-content { height: 100%; overflow-y: auto; padding: 0 18px 94px; overscroll-behavior: contain; scrollbar-width: none; }
.weather-content::-webkit-scrollbar { display: none; }
.weather-content.changing { animation: weather-change .3s cubic-bezier(.2, .7, .2, 1) both; }
.weather-hero { min-height: 310px; padding-top: max(102px, calc(env(safe-area-inset-top) + 72px)); text-align: center; text-shadow: 0 1px 8px #315c8c55; }
.weather-hero h2 { margin: 0; font-size: 32px; font-weight: 400; }
.weather-degree { margin-left: 13px; font-size: 96px; font-weight: 200; line-height: 1.1; letter-spacing: -.08em; }
.weather-hero p { margin: 0; font-size: 19px; }
.weather-hero .weather-high-low { margin-top: 3px; font-size: 16px; }
.weather-card { margin-bottom: 10px; padding: 12px; border: 1px solid #ffffff1e; border-radius: 13px; background: #236aa681; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.weather-card-header { display: flex; justify-content: space-between; gap: 8px; min-height: 31px; padding: 0 1px 9px; border-bottom: 1px solid #ffffff42; font-size: 13px; line-height: 1.3; }
.weather-card-symbol { color: #ffe577; }
.weather-hourly { display: flex; gap: 3px; overflow-x: auto; padding: 12px 0 2px; scrollbar-width: none; }
.weather-hourly::-webkit-scrollbar { display: none; }
.weather-hour { display: flex; flex: 0 0 55px; flex-direction: column; align-items: center; gap: 9px; white-space: nowrap; font-size: 13px; }
.weather-hour strong { font-size: 16px; font-weight: 500; }
.weather-condition-icon { height: 29px; font-size: 25px; line-height: 1; color: #ffdf70; }
.weather-card h3 { display: flex; align-items: center; gap: 6px; margin: 0; padding: 1px 0 10px; border-bottom: 1px solid #ffffff42; color: #e1e8f1; font-size: 12px; font-weight: 600; }
.weather-card h3 svg { width: 16px; height: 16px; }
.weather-day { display: grid; grid-template-columns: 40px 28px 34px minmax(65px, 1fr) 34px; align-items: center; gap: 5px; height: 46px; border-bottom: 1px solid #ffffff28; font-size: 15px; }
.weather-day:last-child { border-bottom: 0; }
.weather-day-icon { font-size: 19px; text-align: center; }
.weather-day-low { color: #d1e0ef; text-align: right; }
.weather-day-high { text-align: right; }
.weather-temp-track { position: relative; height: 4px; margin: 0 6px; border-radius: 5px; background: #102f5380; }
.weather-temp-track span { position: absolute; top: 0; height: 4px; border-radius: 5px; background: linear-gradient(90deg, #8ad5ef, #e9dc8d, #ffc344); }
.weather-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.weather-detail-card { display: flex; flex-direction: column; min-height: 140px; padding: 13px; border: 1px solid #ffffff1e; border-radius: 13px; background: #236aa681; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.weather-detail-card h3 { margin: 0; color: #dce6ee; font-size: 12px; font-weight: 600; }
.weather-detail-card strong { margin: 12px 0 auto; font-size: 32px; font-weight: 300; }
.weather-detail-card span { font-size: 12px; }
.weather-bottom { position: absolute; z-index: 2; inset: auto 0 0; display: flex; align-items: center; justify-content: space-between; height: 82px; padding: 0 26px 14px; background: linear-gradient(0deg, #316d9de8 25%, #316d9d00); }
.weather-bottom > button { display: grid; place-items: center; width: 36px; height: 36px; padding: 4px; border: 0; background: none; color: #fff; }
.weather-bottom svg { width: 25px; height: 25px; }
.weather-dots { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 25px; padding: 0 13px; border-radius: 15px; background: #294e7899; }
.weather-dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; background: #ffffff70; }
.weather-dots button[aria-current="true"] { background: #fff; box-shadow: 0 0 0 3px #ffffff19; }
.weather-location-sheet { position: absolute; z-index: 4; inset: 0; overflow-y: auto; padding: max(70px, calc(env(safe-area-inset-top) + 48px)) 20px 38px; background: #222d3a; }
.weather-location-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.weather-location-header h2 { margin: 0; font-size: 29px; }
.weather-location-header button { border: 0; background: none; color: #8bc6ff; font-size: 16px; }
.weather-location-list { display: grid; gap: 12px; }
.weather-location-list button { display: grid; grid-template-columns: 1fr auto; gap: 4px; min-height: 105px; padding: 17px 20px; border: 1px solid #ffffff24; border-radius: 19px; background: linear-gradient(135deg, #699cbe, #3075ab); color: #fff; text-align: left; }
.weather-location-list button:nth-child(2) { background: linear-gradient(135deg, #99aabb, #5b829f); }
.weather-location-list button:nth-child(3) { background: linear-gradient(135deg, #8297a8, #536d8b); }
.weather-location-list button:nth-child(4) { background: linear-gradient(135deg, #8dc1d6, #468dbb); }
.weather-location-list strong { font-size: 19px; font-weight: 500; }
.weather-location-list small { grid-row: 2; font-size: 13px; }
.weather-location-list button > span { grid-column: 2; grid-row: 1 / 3; align-self: center; font-size: 45px; font-weight: 200; }
.weather-location-sheet.map-mode { background: radial-gradient(circle at 75% 30%, #8ab39f 0 13%, transparent 14%), radial-gradient(circle at 20% 58%, #829b9a 0 18%, transparent 19%), linear-gradient(135deg, #334f63, #617f80 53%, #304d62); }
.weather-location-sheet.map-mode .weather-location-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 45px; }
.weather-location-sheet.map-mode .weather-location-list button { display: flex; flex-direction: column; min-height: 115px; padding: 12px; }
.weather-location-sheet.map-mode .weather-location-list button > span { align-self: flex-end; margin-top: auto; font-size: 30px; }
.screen.keyboard-open .home-indicator { z-index: 9; background: #fff; pointer-events: none; }
.keyboard-panel {
  position: absolute;
  z-index: 8;
  inset: auto 0 0;
  display: flex;
  flex-direction: column;
  height: var(--keyboard-height);
  padding: 0 4px max(20px, env(safe-area-inset-bottom));
  background: #2c2e35;
  color: #fff;
  box-shadow: 0 -1px 0 #6a6c73;
  animation: keyboard-rise .25s cubic-bezier(.2, .7, .2, 1) both;
  user-select: none;
  -webkit-user-select: none;
}
.keyboard-toolbar { position: relative; display: flex; align-items: center; justify-content: flex-end; flex: 0 0 40px; padding: 0 13px; }
.keyboard-toolbar button { border: 0; background: none; color: #80b7ff; font-size: 16px; font-weight: 600; }
.keyboard-handle { position: absolute; top: 8px; left: 50%; width: 36px; height: 4px; border-radius: 4px; background: #74767d; transform: translateX(-50%); }
.keyboard-numeric { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(4, 1fr); flex: 1; gap: 6px; min-height: 0; }
.keyboard-panel button { -webkit-tap-highlight-color: transparent; }
.keyboard-numeric button {
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: #646771;
  color: #fff;
  box-shadow: 0 1px 0 #16171c;
}
.keyboard-numeric button { font-size: 28px; }
.keyboard-panel button:active { background: #92959e; transform: translateY(1px); }
.keyboard-numeric .keyboard-special { background: #444852; }
.keyboard-numeric .keyboard-special { font-size: 15px; }
.keyboard-panel button:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }

@keyframes keyboard-rise {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes weather-change {
  from { opacity: .55; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes float-up {
  50% { transform: translateY(-5px); opacity: .7; }
}

@keyframes shake {
  25% { transform: translateX(-9px); }
  50% { transform: translateX(9px); }
  75% { transform: translateX(-5px); }
}

@keyframes pin-reveal {
  from { opacity: .25; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pin-leave {
  to { opacity: 0; transform: translateY(-28px); }
}

@keyframes home-arrive {
  from { opacity: .55; transform: scale(1.04); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes app-expand {
  from { opacity: .72; transform: scale(.28); border-radius: 66px; }
  to { opacity: 1; transform: scale(1); border-radius: 0; }
}

@keyframes app-collapse {
  from { opacity: 1; transform: scale(1); border-radius: 0; }
  to { opacity: .55; transform: scale(.28); border-radius: 66px; }
}

@keyframes home-recede {
  to { transform: scale(.94); opacity: .82; }
}

@keyframes home-return {
  from { transform: scale(.94); opacity: .82; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes tab-enter-right {
  from { opacity: 0; transform: translate3d(24px, 0, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes tab-enter-left {
  from { opacity: 0; transform: translate3d(-24px, 0, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes tab-leave-left {
  from { opacity: 1; transform: translate3d(0, 0, 0); }
  to { opacity: 0; transform: translate3d(-24px, 0, 0); }
}

@keyframes tab-leave-right {
  from { opacity: 1; transform: translate3d(0, 0, 0); }
  to { opacity: 0; transform: translate3d(24px, 0, 0); }
}

@media (max-height: 670px) {
  .stage { padding: 0; }
  .phone { height: 100svh; border-radius: 42px; }
  .screen { border-radius: 34px; }
  .pin-screen { padding-top: 65px; padding-bottom: 25px; }
  .pin-heading { min-height: 87px; }
  .keypad { gap: 9px 10px; }
  .keypad button { width: clamp(54px, 9svh, 62px); }
  .pin-actions { margin-top: 18px; }
  .home-screen { padding-top: 75px; }
}

@media (max-width: 600px), (max-height: 500px) and (pointer: coarse) {
  html, body { width: 100%; height: 100%; overflow: hidden; }
  .stage {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    display: block;
    padding: 0;
    overflow: hidden;
    overscroll-behavior: none;
  }
  .phone {
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .screen { border-radius: 0; }
  .side-button {
    z-index: 6;
    top: 22%;
    right: 0;
    width: 24px;
    height: 68px;
    background: transparent;
  }
  .side-button::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 3px;
    height: 100%;
    border-radius: 3px 0 0 3px;
    background: #5c2b4b99;
  }
  .status-bar { top: max(16px, env(safe-area-inset-top)); }
  .island { top: max(11px, env(safe-area-inset-top)); }
  .lock-heading { padding-top: max(65px, calc(env(safe-area-inset-top) + 45px)); }
  .lock-bottom { padding-bottom: max(47px, calc(env(safe-area-inset-bottom) + 36px)); }
  .pin-screen {
    padding-top: max(70px, calc(env(safe-area-inset-top) + 48px));
    padding-bottom: max(31px, calc(env(safe-area-inset-bottom) + 22px));
  }
  .home-screen { padding-top: max(84px, calc(env(safe-area-inset-top) + 65px)); }
  .app-header { height: max(108px, calc(env(safe-area-inset-top) + 82px)); padding-top: max(48px, env(safe-area-inset-top)); }
  .clock-toolbar { flex-basis: max(112px, calc(env(safe-area-inset-top) + 85px)); }
  .clock-tabs { padding-bottom: max(25px, calc(env(safe-area-inset-bottom) + 18px)); }
  .weather-bottom { height: max(82px, calc(env(safe-area-inset-bottom) + 65px)); padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .weather-content { padding-bottom: max(94px, calc(env(safe-area-inset-bottom) + 78px)); }
  .home-indicator { bottom: max(9px, calc(env(safe-area-inset-bottom) + 5px)); }
}

@media (display-mode: standalone) and (max-width: 600px) {
  .island, .status-bar, .home-indicator { display: none; }
  .clock-toolbar { flex-basis: max(82px, calc(env(safe-area-inset-top) + 55px)); }
  .clock-tabs { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .weather-bottom { height: max(66px, calc(env(safe-area-inset-bottom) + 52px)); padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}

@media (max-width: 600px) and (max-height: 670px) {
  .pin-screen { padding-top: max(61px, calc(env(safe-area-inset-top) + 38px)); padding-bottom: max(22px, calc(env(safe-area-inset-bottom) + 14px)); }
  .pin-heading { min-height: 78px; }
  .pin-heading h2 { margin-bottom: 13px; }
  .pin-actions { margin-top: 12px; }
  .lock-heading { padding-top: max(58px, calc(env(safe-area-inset-top) + 37px)); }
  .lock-heading h1 { font-size: clamp(68px, 21vw, 84px); }
  .lock-bottom { padding-bottom: max(34px, calc(env(safe-area-inset-bottom) + 24px)); }
}

@media (max-width: 600px) and (max-height: 670px) {
  .home-screen { padding-top: max(58px, calc(env(safe-area-inset-top) + 48px)); }
  .widget-row { gap: 10px; margin-bottom: 17px; }
  .home-widget { border-radius: 20px; }
  .weather-widget { padding: 10px 11px; }
  .widget-city { font-size: 13px; }
  .widget-temperature { font-size: 38px; }
  .widget-weather-icon { width: 35px; height: 35px; }
  .widget-condition { font-size: 11px; }
  .widget-range { font-size: 9px; }
  .app-icon { width: 48px; height: 48px; font-size: 24px; }
  .app-tile { gap: 6px; font-size: 10px; }
  .icon-calendar small { font-size: 9px; }
  .icon-calendar strong { font-size: 29px; }
  .dock { padding: 9px 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .swipe-hint { animation: none; }
  .lock-screen, .lock-screen.unlocking { transition: none; }
  .pin-screen.revealing .pin-heading,
  .pin-screen.revealing .keypad,
  .pin-screen.revealing .pin-actions,
  .pin-screen.leaving,
  .home-screen.arriving,
  .home-screen.receding,
  .home-screen.returning,
  .app-screen.opening,
  .app-screen.closing,
  .clock-page.entering,
  .clock-page.leaving,
  .keyboard-panel,
  .weather-content.changing { animation: none !important; }
}
