:root,
html[data-theme="light"] {
  color-scheme: light;
  --ink: #162033;
  --muted: #617087;
  --muted-soft: #7e899a;
  --blue: #0878f9;
  --blue-soft: rgba(0, 122, 255, 0.1);
  --blue-control: rgba(0, 122, 255, 0.84);
  --green: #20a765;
  --green-soft: rgba(32, 167, 101, 0.11);
  --orange: #e98b21;
  --red: #e44559;
  --red-soft: rgba(228, 69, 89, 0.1);
  --page-top: #f5f7fa;
  --page-bottom: #edf1f6;
  --glass-fill: rgba(255, 255, 255, 0.72);
  --glass-fill-supported: rgba(255, 255, 255, 0.5);
  --glass-line: rgba(70, 88, 116, 0.1);
  --glass-highlight: rgba(255, 255, 255, 0.76);
  --glass-sheen: rgba(255, 255, 255, 0.28);
  --glass-lowlight: rgba(48, 66, 94, 0.08);
  --inner-fill: rgba(255, 255, 255, 0.44);
  --control-fill: rgba(82, 104, 136, 0.08);
  --selection-fill: rgba(0, 122, 255, 0.08);
  --ambient-shadow: 0 18px 52px rgba(35, 52, 80, 0.1), 0 2px 9px rgba(35, 52, 80, 0.05);
  --sheet-fill: rgba(246, 248, 251, 0.9);
  --sheet-head-fill: rgba(246, 248, 251, 0.95);
  --backdrop: rgba(33, 43, 60, 0.24);
  --toast-fill: rgba(27, 35, 48, 0.92);
  --lock-fill: rgba(255, 255, 255, 0.46);
  --lock-sheen-top: rgba(255, 255, 255, 0.32);
  --lock-sheen-bottom: rgba(255, 255, 255, 0.08);
  --lock-line: rgba(70, 88, 116, 0.08);
  --lock-shadow: 0 18px 50px rgba(35, 52, 80, 0.1);
  --lock-control: rgba(255, 255, 255, 0.28);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Hiragino Sans", sans-serif;
  font-synthesis: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ink: #eef3fa;
    --muted: #a6b1c1;
    --muted-soft: #828fa2;
    --blue: #4a9cff;
    --blue-soft: rgba(10, 132, 255, 0.11);
    --blue-control: rgba(10, 132, 255, 0.7);
    --green: #45cd87;
    --green-soft: rgba(69, 205, 135, 0.1);
    --orange: #f0a24a;
    --red: #ff6879;
    --red-soft: rgba(255, 104, 121, 0.1);
    --page-top: #0c121d;
    --page-bottom: #080d15;
    --glass-fill: rgba(29, 39, 54, 0.6);
    --glass-fill-supported: rgba(29, 39, 54, 0.38);
    --glass-line: rgba(189, 207, 232, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.115);
    --glass-sheen: rgba(255, 255, 255, 0.045);
    --glass-lowlight: rgba(0, 0, 0, 0.22);
    --inner-fill: rgba(255, 255, 255, 0.045);
    --control-fill: rgba(255, 255, 255, 0.06);
    --selection-fill: rgba(74, 156, 255, 0.11);
    --ambient-shadow: 0 20px 55px rgba(0, 0, 0, 0.23), 0 2px 9px rgba(0, 0, 0, 0.12);
    --sheet-fill: rgba(18, 26, 38, 0.88);
    --sheet-head-fill: rgba(18, 26, 38, 0.95);
    --backdrop: rgba(2, 6, 12, 0.48);
    --toast-fill: rgba(229, 236, 247, 0.92);
    --lock-fill: rgba(18, 27, 39, 0.55);
    --lock-sheen-top: rgba(255, 255, 255, 0.045);
    --lock-sheen-bottom: rgba(255, 255, 255, 0.012);
    --lock-line: rgba(255, 255, 255, 0.055);
    --lock-shadow: 0 18px 50px rgba(0, 0, 0, 0.17);
    --lock-control: rgba(255, 255, 255, 0.035);
  }
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #eef3fa;
  --muted: #a6b1c1;
  --muted-soft: #828fa2;
  --blue: #4a9cff;
  --blue-soft: rgba(10, 132, 255, 0.11);
  --blue-control: rgba(10, 132, 255, 0.7);
  --green: #45cd87;
  --green-soft: rgba(69, 205, 135, 0.1);
  --orange: #f0a24a;
  --red: #ff6879;
  --red-soft: rgba(255, 104, 121, 0.1);
  --page-top: #0c121d;
  --page-bottom: #080d15;
  --glass-fill: rgba(29, 39, 54, 0.6);
  --glass-fill-supported: rgba(29, 39, 54, 0.38);
  --glass-line: rgba(189, 207, 232, 0.08);
  --glass-highlight: rgba(255, 255, 255, 0.115);
  --glass-sheen: rgba(255, 255, 255, 0.045);
  --glass-lowlight: rgba(0, 0, 0, 0.22);
  --inner-fill: rgba(255, 255, 255, 0.045);
  --control-fill: rgba(255, 255, 255, 0.06);
  --selection-fill: rgba(74, 156, 255, 0.11);
  --ambient-shadow: 0 20px 55px rgba(0, 0, 0, 0.23), 0 2px 9px rgba(0, 0, 0, 0.12);
  --sheet-fill: rgba(18, 26, 38, 0.88);
  --sheet-head-fill: rgba(18, 26, 38, 0.95);
  --backdrop: rgba(2, 6, 12, 0.48);
  --toast-fill: rgba(229, 236, 247, 0.92);
  --lock-fill: rgba(18, 27, 39, 0.55);
  --lock-sheen-top: rgba(255, 255, 255, 0.045);
  --lock-sheen-bottom: rgba(255, 255, 255, 0.012);
  --lock-line: rgba(255, 255, 255, 0.055);
  --lock-shadow: 0 18px 50px rgba(0, 0, 0, 0.17);
  --lock-control: rgba(255, 255, 255, 0.035);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page-bottom);
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background-color: var(--page-bottom);
  background-image: linear-gradient(180deg, var(--page-top) 0%, var(--page-bottom) 100%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: wait;
  opacity: 0.55;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(10, 132, 255, 0.42);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.glass {
  background:
    linear-gradient(180deg, var(--glass-sheen) 0%, transparent 24%),
    var(--glass-fill);
  border: 1px solid var(--glass-line);
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    inset 0 -1px 0 var(--glass-lowlight),
    var(--ambient-shadow);
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass {
    background:
      linear-gradient(180deg, var(--glass-sheen) 0%, transparent 24%),
      var(--glass-fill-supported);
    -webkit-backdrop-filter: blur(18px) saturate(1.12);
    backdrop-filter: blur(18px) saturate(1.12);
  }
}

.glass-inner {
  background: var(--inner-fill);
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted-soft);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.085em;
}

.lock-screen {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: start center;
  padding: max(clamp(58px, 9dvh, 88px), env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}

.lock-card {
  width: min(100%, 376px);
  padding: 27px 23px 20px;
  border: 1px solid var(--lock-line);
  border-radius: 23px;
  background:
    linear-gradient(180deg, var(--lock-sheen-top), var(--lock-sheen-bottom)),
    var(--lock-fill);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.075),
    inset 0 -1px 0 rgba(0, 0, 0, 0.11),
    var(--lock-shadow);
  text-align: center;
}

.app-mark {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  place-items: center;
  border: 1px solid var(--lock-line);
  border-radius: 15px;
  background: var(--lock-control);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.app-mark span {
  position: relative;
  width: 21px;
  height: 21px;
  border: 3px solid var(--blue);
  border-radius: 50%;
}

.app-mark span::after {
  position: absolute;
  right: -8px;
  bottom: -5px;
  width: 10px;
  height: 3px;
  border-radius: 4px;
  background: var(--blue);
  content: "";
  transform: rotate(45deg);
}

.lock-card h1 {
  margin: 0;
  font-size: clamp(25px, 6.9vw, 31px);
  font-weight: 620;
  letter-spacing: -0.03em;
  line-height: 1.2;
  white-space: nowrap;
}

.lock-copy {
  max-width: 320px;
  margin: 9px auto 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.lock-card .eyebrow {
  margin-bottom: 5px;
  letter-spacing: 0.055em;
}

.passkey-button {
  display: flex;
  width: 100%;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 15px 8px 16px;
  border: 1px solid var(--lock-line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--lock-control);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.065), inset 0 -1px 0 rgba(0, 0, 0, 0.07);
  text-align: left;
}

.passkey-button span {
  min-width: 0;
}

.passkey-button strong,
.passkey-button small {
  display: block;
}

.passkey-button strong {
  font-size: 14px;
  font-weight: 610;
  letter-spacing: -0.01em;
}

.passkey-button small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 480;
}

.passkey-button b {
  color: var(--blue);
  font-size: 25px;
  font-weight: 350;
  line-height: 1;
}

.passkey-button:active {
  background: var(--selection-fill);
}

.recovery {
  margin-top: 9px;
  color: var(--muted);
  text-align: left;
}

.recovery summary {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 540;
  list-style: none;
}

.recovery summary::-webkit-details-marker {
  display: none;
}

.recovery[open] summary {
  color: var(--blue);
}

.recovery form {
  padding-top: 2px;
}

.recovery form > p {
  margin: 8px 4px 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.45;
}

.field-label {
  display: block;
  margin: 0 0 8px 4px;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
}

.token-row {
  display: flex;
  gap: 6px;
  padding: 5px;
  min-height: 50px;
  border: 1px solid var(--lock-line);
  border-radius: 14px;
  background: var(--lock-control);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.065), inset 0 -1px 0 rgba(0, 0, 0, 0.06);
}

.token-row input {
  min-width: 0;
  flex: 1;
  padding: 0 10px;
  border: 0;
  outline: none;
  color: var(--ink);
  background: transparent;
}

.token-row input::placeholder {
  color: var(--muted);
  opacity: 0.78;
}

.primary {
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid rgba(82, 161, 255, 0.16);
  border-radius: 14px;
  color: #fff;
  background: var(--blue-control);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 8px 24px rgba(0, 93, 204, 0.12);
  font-weight: 650;
  transition: transform 140ms ease, background-color 140ms ease;
}

.primary:hover {
  background-color: var(--blue);
}

.primary:active {
  transform: scale(0.98);
}

.primary.compact {
  min-height: 44px;
  padding: 0 16px;
}

.lock-card .primary.compact {
  min-height: 40px;
  border-radius: 11px;
  border-color: transparent;
  color: var(--blue);
  background: rgba(10, 132, 255, 0.075);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.065);
  font-weight: 620;
}

.primary.full {
  width: 100%;
  margin-top: 16px;
}

.inline-error {
  min-height: 16px;
  margin: 9px 0 0;
  color: var(--red);
  font-size: 13px;
}

.app {
  position: relative;
  z-index: 1;
  width: min(100%, 820px);
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 18px calc(106px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 3px 18px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(27px, 7vw, 30px);
  font-weight: 630;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.round-button {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0 0 7px;
  border: 1px solid var(--glass-line);
  border-radius: 50%;
  color: var(--muted);
  background: var(--glass-fill-supported);
  box-shadow: inset 0 1px 0 var(--glass-highlight), 0 8px 24px rgba(0, 0, 0, 0.07);
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 1px;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .round-button {
    -webkit-backdrop-filter: blur(14px) saturate(1.08);
    backdrop-filter: blur(14px) saturate(1.08);
  }
}

.hero {
  position: relative;
  display: flex;
  min-height: 158px;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  overflow: hidden;
  padding: 25px 26px;
  border-radius: 24px;
}

.hero-copy {
  min-width: 0;
  flex: 1;
}

.hero-copy > p {
  display: inline;
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 560;
}

.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.hero h2 {
  margin: 13px 0 7px;
  font-size: clamp(24px, 6.5vw, 33px);
  font-weight: 630;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.subtle {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.add-button {
  min-width: 90px;
  flex: 0 0 auto;
  border-color: rgba(115, 184, 255, 0.15);
  background:
    linear-gradient(180deg, rgba(122, 189, 255, 0.16), rgba(0, 59, 126, 0.04)),
    var(--blue-control);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 -1px 0 rgba(0, 51, 112, 0.1), 0 9px 28px rgba(0, 93, 204, 0.11);
}

.add-button span {
  font-size: 20px;
  font-weight: 400;
  line-height: 0;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 20px;
}

.metric {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 88px;
  flex-direction: column;
  justify-content: center;
  padding: 15px 18px;
}

.metric + .metric::before {
  position: absolute;
  top: 22%;
  bottom: 22%;
  left: 0;
  width: 1px;
  background: var(--glass-line);
  content: "";
}

.metric span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 540;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric strong {
  display: block;
  margin-top: 7px;
  font-size: 29px;
  font-variant-numeric: tabular-nums;
  font-weight: 630;
  letter-spacing: -0.035em;
  line-height: 1;
}

.section-block {
  padding-top: 32px;
  scroll-margin-top: 14px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 4px 12px;
}

.section-heading h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 620;
  letter-spacing: -0.025em;
}

.text-button {
  min-height: 44px;
  padding: 8px 4px;
  border: 0;
  color: var(--blue);
  background: transparent;
  font-weight: 560;
}

.text-button.strong {
  font-weight: 650;
}

.monitor-list {
  display: grid;
  gap: 12px;
}

.monitor-card {
  position: relative;
  overflow: hidden;
  padding: 19px 20px 18px;
  border-radius: 21px;
}

.monitor-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.status-orb {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 16px;
  font-weight: 650;
}

.status-orb.error {
  color: var(--red);
  background: var(--red-soft);
}

.status-orb.paused {
  color: var(--muted);
  background: var(--control-fill);
}

.monitor-main {
  min-width: 0;
  flex: 1;
}

.monitor-title-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.monitor-title-row h3 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  flex: 1;
  font-size: 16.5px;
  font-weight: 610;
  letter-spacing: -0.015em;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pill {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 10px;
  font-weight: 580;
  line-height: 1.35;
}

.monitor-url {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.35;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monitor-url:hover {
  color: var(--blue);
}

.monitor-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  margin: 15px 0 0 46px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.monitor-error {
  flex-basis: 100%;
  color: var(--red);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 14px 0 0 46px;
}

.mini-button {
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  color: var(--muted);
  background: var(--control-fill);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  font-size: 11.5px;
  font-weight: 570;
}

.mini-button:first-child {
  color: var(--blue);
  background: var(--blue-soft);
}

.empty {
  padding: 36px 26px;
  border-radius: 22px;
  text-align: center;
}

.empty-symbol {
  display: grid;
  width: 50px;
  height: 50px;
  margin: 0 auto 14px;
  place-items: center;
  border-radius: 16px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 25px;
}

.empty h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 620;
}

.empty p {
  max-width: 360px;
  margin: 9px auto 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.timeline {
  overflow: hidden;
  padding: 3px 18px;
  border-radius: 21px;
}

.event {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 11px;
  padding: 16px 0;
  border-bottom: 1px solid var(--glass-line);
}

.event:last-child {
  border-bottom: 0;
}

.event-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 13px;
}

.event-icon.error {
  color: var(--red);
  background: var(--red-soft);
}

.event h4 {
  margin: 1px 0 3px;
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 590;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event p {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}

.event time {
  color: var(--muted-soft);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.timeline-empty {
  padding: 26px 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.tabbar {
  position: fixed;
  z-index: 10;
  bottom: max(8px, env(safe-area-inset-bottom));
  left: 50%;
  display: grid;
  width: min(calc(100% - 24px), 430px);
  height: 62px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 5px;
  border-radius: 20px;
  transform: translateX(-50%);
}

.tab {
  min-width: 0;
  min-height: 50px;
  padding: 4px 6px;
  border: 0;
  border-radius: 15px;
  color: var(--muted-soft);
  background: transparent;
  font-size: 9.5px;
  font-weight: 560;
  line-height: 1.1;
}

.tab span {
  display: block;
  margin-bottom: 2px;
  font-size: 17px;
  font-weight: 500;
  line-height: 1;
}

.tab.active {
  color: var(--blue);
  background: var(--selection-fill);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

.sheet {
  width: min(100% - 20px, 560px);
  max-height: min(calc(100dvh - max(48px, env(safe-area-inset-top)) - max(12px, env(safe-area-inset-bottom))), 760px);
  margin: max(24px, env(safe-area-inset-top)) auto auto;
  overflow-y: auto;
  padding: 0 18px 28px;
  border: 1px solid var(--glass-line);
  border-radius: 27px;
  color: var(--ink);
  background: var(--sheet-fill);
  box-shadow: inset 0 1px 0 var(--glass-highlight), 0 28px 80px rgba(0, 0, 0, 0.26);
  -webkit-backdrop-filter: blur(22px) saturate(1.1);
  backdrop-filter: blur(22px) saturate(1.1);
}

.sheet::backdrop {
  background: var(--backdrop);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.sheet-handle {
  width: 36px;
  height: 4px;
  margin: 9px auto 6px;
  border-radius: 4px;
  background: var(--muted-soft);
  opacity: 0.3;
}

.sheet-head {
  position: sticky;
  z-index: 2;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 7px 0 13px;
  background: linear-gradient(180deg, var(--sheet-head-fill) 76%, transparent 100%);
}

.sheet-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 620;
}

.sheet-head .text-button:last-child {
  justify-self: end;
}

.sheet-head .text-button:first-child {
  justify-self: start;
}

.form-group {
  overflow: hidden;
  border-radius: 17px;
}

.form-group label {
  display: flex;
  min-height: 57px;
  align-items: center;
  gap: 14px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--glass-line);
}

.form-group label:last-child {
  border-bottom: 0;
}

.form-group label > span {
  min-width: 100px;
  font-size: 13px;
  font-weight: 570;
}

.form-group small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 450;
}

.form-group input:not([type="checkbox"]),
.form-group select {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
  text-align: right;
}

.group-label {
  margin: 20px 6px 8px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 570;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  margin-bottom: 12px;
  padding: 3px;
  border-radius: 13px;
  background: var(--control-fill);
}

.segmented button {
  min-width: 0;
  min-height: 42px;
  padding: 0 6px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 550;
}

.segmented button.selected {
  color: var(--ink);
  background: var(--inner-fill);
  box-shadow: inset 0 1px 0 var(--glass-highlight), 0 3px 10px rgba(0, 0, 0, 0.05);
}

.form-hint {
  margin: 10px 7px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.picker-row .inline-control {
  min-height: 40px;
  margin-left: auto;
  padding: 0 12px;
  border: 0;
  border-radius: 11px;
  color: var(--blue);
  background: var(--blue-soft);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  font-size: 12px;
  font-weight: 570;
}

.selector-help {
  margin: 11px 7px 0;
  color: var(--muted);
  font-size: 11px;
}

.selector-help summary {
  min-height: 40px;
  color: var(--blue);
  cursor: pointer;
  font-weight: 570;
  line-height: 40px;
}

.selector-help > div {
  padding: 10px 12px 12px;
  border-radius: 13px;
  background: var(--control-fill);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
}

.selector-help p {
  margin: 0 0 7px;
  line-height: 1.45;
}

.selector-help p:last-of-type {
  margin-bottom: 10px;
}

.selector-help code {
  color: var(--ink);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 10.5px;
}

.selector-help small {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
}

.scope-picker-sheet {
  width: min(100% - 20px, 900px);
  max-height: calc(100dvh - max(36px, env(safe-area-inset-top)) - max(10px, env(safe-area-inset-bottom)));
}

.picker-guide {
  margin: 3px 4px 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.picker-status {
  display: grid;
  min-height: 92px;
  place-items: center;
  border-radius: 15px;
  color: var(--muted);
  background: var(--control-fill);
  font-size: 12px;
}

.scope-preview {
  display: block;
  width: 100%;
  height: min(56dvh, 520px);
  border: 1px solid var(--glass-line);
  border-radius: 15px;
  background: #f5f6f8;
}

.picker-selection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 13px;
  background: var(--control-fill);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
}

.picker-selection > div:first-child {
  min-width: 0;
  flex: 1;
}

.picker-selection small,
.picker-selection strong {
  display: block;
}

.picker-selection small {
  color: var(--muted);
  font-size: 9.5px;
}

.picker-selection strong {
  margin-top: 2px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 570;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picker-level-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.picker-level-actions .mini-button {
  min-height: 38px;
}

.danger-button {
  width: 100%;
  min-height: 48px;
  margin-top: 10px;
  border: 0;
  color: var(--red);
  background: transparent;
  font-weight: 570;
}

.switch-row {
  justify-content: space-between;
}

.switch-row > span {
  flex: 1;
}

.switch-row input {
  position: relative;
  width: 49px;
  height: 29px;
  flex: 0 0 auto;
  appearance: none;
  border-radius: 999px;
  background: rgba(126, 139, 158, 0.38);
  transition: background-color 160ms ease;
}

.switch-row input::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.18);
  content: "";
  transition: transform 160ms ease;
}

.switch-row input:checked {
  background: var(--green);
}

.switch-row input:checked::after {
  transform: translateX(20px);
}

.secondary {
  min-height: 50px;
  border: 0;
  border-radius: 14px;
  color: var(--blue);
  background: var(--control-fill);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  font-weight: 580;
}

.secondary.full {
  width: 100%;
  margin-top: 11px;
}

.toast {
  position: fixed;
  z-index: 50;
  top: max(20px, env(safe-area-inset-top));
  left: 50%;
  max-width: calc(100% - 30px);
  padding: 12px 18px;
  border-radius: 14px;
  color: var(--page-top);
  background: var(--toast-fill);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.2);
  font-size: 13px;
  font-weight: 560;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -20px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 520px) {
  .lock-screen {
    padding-top: max(clamp(44px, 7dvh, 64px), env(safe-area-inset-top));
  }

  .lock-card {
    padding: 25px 21px 18px;
  }

  .app {
    padding-right: 16px;
    padding-left: 16px;
  }

  .hero {
    min-height: 168px;
    padding: 22px 20px;
  }

  .add-button {
    width: 50px;
    min-width: 50px;
    padding: 0;
    border-radius: 15px;
    font-size: 0;
  }

  .add-button span {
    font-size: 23px;
  }

  .metric {
    min-height: 83px;
    padding: 14px 11px;
  }

  .metric span {
    font-size: 10px;
  }

  .metric strong {
    font-size: 27px;
  }

  .monitor-card {
    padding: 18px;
  }

  .monitor-meta,
  .card-actions {
    margin-left: 0;
  }

  .sheet {
    width: calc(100% - 10px);
    margin-top: max(20px, env(safe-area-inset-top));
    border-radius: 25px;
  }

  .scope-picker-sheet {
    margin-top: max(10px, env(safe-area-inset-top));
    padding-right: 12px;
    padding-left: 12px;
  }

  .scope-preview {
    height: 52dvh;
  }

  .picker-selection {
    align-items: stretch;
    flex-direction: column;
  }

  .picker-level-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 360px) {
  .lock-card h1 {
    font-size: 24px;
  }

  .topbar h1 {
    font-size: 25px;
  }

  .hero {
    gap: 14px;
    padding-right: 17px;
    padding-left: 17px;
  }

  .hero h2 {
    font-size: 22px;
  }

  .metric {
    padding-right: 8px;
    padding-left: 8px;
  }

  .monitor-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .monitor-title-row h3 {
    width: 100%;
  }

  .card-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mini-button {
    padding: 0 5px;
    font-size: 10.5px;
  }

  .form-group label {
    gap: 8px;
    padding-right: 11px;
    padding-left: 11px;
  }

  .form-group label > span {
    min-width: 84px;
  }
}

@media (min-width: 760px) {
  .app {
    width: min(100% - 36px, 1120px);
    padding-bottom: 54px;
  }

  main {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(310px, 0.75fr);
    gap: 0 24px;
    align-items: start;
  }

  .hero,
  .metrics {
    grid-column: 1 / -1;
  }

  #monitorsSection {
    grid-column: 1;
  }

  #historySection {
    position: sticky;
    top: 14px;
    grid-column: 2;
  }

  .tabbar {
    display: none;
  }
}

@media (prefers-contrast: more) {
  :root,
  html[data-theme="light"],
  html[data-theme="dark"] {
    --glass-line: rgba(116, 136, 166, 0.28);
  }

  .muted,
  .subtle,
  .monitor-url,
  .monitor-meta,
  .event p {
    color: var(--ink);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
