:root {
  color-scheme: light;
  --ink: #21313d;
  --muted: #5f6d78;
  --line: #d8e4ea;
  --paper: #ffffff;
  --sky: #e8f8ff;
  --sun: #ffc83d;
  --sun-deep: #f59f00;
  --cloud: #ffffff;
  --cloud-shadow: #d8e4ea;
  --rain: #2f80ed;
  --snow: #78c9ff;
  --storm: #7c65ff;
  --hot: #ff6f8f;
  --cold: #20a39e;
  --shadow: 0 18px 40px rgba(33, 49, 61, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100dvh;
  margin: 0;
  background: linear-gradient(160deg, #f9fdff 0%, #dff6ef 50%, #fff4bf 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible {
  outline: 4px solid rgba(124, 101, 255, 0.42);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.lock-screen,
.app-shell {
  width: min(100%, 880px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
}

.lock-screen {
  display: grid;
  min-height: 100dvh;
  align-content: center;
  justify-items: center;
  gap: 18px;
}

.app-icon {
  display: block;
  filter: drop-shadow(0 14px 18px rgba(33, 49, 61, 0.18));
}

.password-form {
  display: grid;
  grid-template-columns: minmax(0, 220px) 72px;
  gap: 12px;
  align-items: center;
}

.hidden-password {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.dot-button {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 72px;
  padding: 0 16px;
  border: 3px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.pass-dot {
  display: block;
  width: 28px;
  height: 28px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: #ffffff;
}

.pass-dot.is-filled {
  background: var(--ink);
}

.round-button,
.icon-button {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 8px 20px rgba(33, 49, 61, 0.12);
}

.round-button {
  width: 72px;
  height: 72px;
  background: var(--cold);
}

.round-button svg,
.icon-button svg {
  width: 36px;
  height: 36px;
  fill: none;
  stroke: currentColor;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.round-button svg {
  color: #ffffff;
}

.password-picture,
.noscript-picture {
  display: grid;
  width: 128px;
  height: 128px;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 10px 24px rgba(33, 49, 61, 0.12);
}

.password-picture svg,
.noscript-picture svg {
  width: 92px;
  height: 92px;
  fill: none;
  stroke: #b42342;
  stroke-width: 9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-picture.is-shaking {
  animation: shake 260ms ease;
}

.app-shell {
  display: grid;
  gap: 14px;
  min-height: 100dvh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  width: 48px;
  height: 48px;
}

.weather-card {
  display: grid;
  grid-template-columns: 1fr 70px;
  align-items: center;
  gap: 12px;
  min-height: min(63dvh, 560px);
  padding: clamp(14px, 4vw, 28px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow);
}

.weather-art {
  display: grid;
  min-height: 300px;
  place-items: center;
}

.weather-art svg {
  width: min(82vw, 520px);
  height: min(82vw, 520px);
  overflow: visible;
}

.forecast-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.mini-weather {
  display: grid;
  min-height: 112px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 9px 18px rgba(33, 49, 61, 0.09);
}

.mini-weather svg {
  width: 86px;
  height: 86px;
}

.thermo {
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: 260px;
}

.thermo-track {
  display: flex;
  align-items: end;
  width: 28px;
  height: 190px;
  padding: 4px;
  border: 4px solid var(--ink);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  background: #ffffff;
}

.thermo-fill {
  width: 100%;
  height: 35%;
  border-radius: 14px 14px 0 0;
  background: linear-gradient(0deg, var(--cold), var(--sun), var(--hot));
  transition: height 280ms ease;
}

.thermo-bulb {
  width: 58px;
  height: 58px;
  margin-top: -4px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: var(--hot);
}

.sun-core {
  fill: var(--sun);
  stroke: var(--sun-deep);
  stroke-width: 10;
}

.rays path,
.rain-drop,
.snowflake,
.fog-line,
.help-mark,
.loading-ring {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rays path {
  color: var(--sun-deep);
  stroke-width: 11;
}

.moon-core {
  fill: #fff0a8;
  stroke: #d18b00;
  stroke-width: 8;
}

.cloud-core {
  fill: var(--cloud);
  stroke: var(--cloud-shadow);
  stroke-width: 9;
}

.rain-drop {
  color: var(--rain);
  stroke-width: 12;
}

.snowflake {
  color: var(--snow);
  stroke-width: 8;
}

.bolt {
  fill: var(--sun);
  stroke: var(--storm);
  stroke-width: 7;
  stroke-linejoin: round;
}

.fog-line {
  color: #8da1ad;
  stroke-width: 10;
}

.help-mark {
  color: #b42342;
  stroke-width: 12;
}

.loading-ring {
  color: var(--cold);
  stroke-width: 13;
  animation: spin 1s linear infinite;
  transform-origin: center;
}

body[data-weather="rain"],
body[data-weather="fog"] {
  background: linear-gradient(160deg, #eef5f7 0%, #cce7ee 55%, #f6fbff 100%);
}

body[data-weather="snow"] {
  background: linear-gradient(160deg, #f8fdff 0%, #d8f2ff 55%, #ffffff 100%);
}

body[data-weather="storm"] {
  background: linear-gradient(160deg, #ece8ff 0%, #dbe7ff 52%, #fff4bf 100%);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-8px);
  }

  75% {
    transform: translateX(8px);
  }
}

@media (max-width: 620px) {
  .weather-card {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .weather-art {
    min-height: 58dvh;
  }

  .thermo {
    min-height: 76px;
  }

  .thermo-track {
    width: 190px;
    height: 28px;
    align-items: stretch;
    border: 4px solid var(--ink);
    border-right: 0;
    border-radius: 18px 0 0 18px;
  }

  .thermo-fill {
    width: 55%;
    height: 100% !important;
    border-radius: 14px 0 0 14px;
  }

  .thermo-bulb {
    width: 58px;
    height: 58px;
    margin-top: -45px;
    margin-left: 190px;
  }

  .mini-weather {
    min-height: 92px;
  }

  .mini-weather svg {
    width: 68px;
    height: 68px;
  }
}

@media (max-width: 380px) {
  .password-form {
    grid-template-columns: 1fr;
    width: min(100%, 220px);
  }

  .round-button {
    width: 100%;
  }
}
