/* 回满 · 体力恢复计算器 */
:root {
  --bg: #06100e;
  --bg-deep: #040b09;
  --card: rgba(15, 29, 25, 0.86);
  --card-solid: #0d1c18;
  --line: rgba(206, 255, 221, 0.09);
  --line-strong: rgba(206, 255, 221, 0.17);
  --text: #f1fff8;
  --text-soft: #d7eee5;
  --muted: #91aaa1;
  --faint: #617a71;
  --accent: #c9ff62;
  --accent-2: #5cf0c0;
  --accent-ink: #0b1a10;
  --amber: #ffc46b;
  --radius: 24px;
  --sans: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
    sans-serif;
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", "Consolas",
    "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

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

button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button {
  cursor: pointer;
}

::selection {
  color: var(--accent-ink);
  background: var(--accent);
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(62% 38% at 50% -8%, rgba(184, 255, 92, 0.13), transparent 68%),
    radial-gradient(46% 32% at 106% 38%, rgba(48, 231, 176, 0.09), transparent 72%),
    radial-gradient(60% 45% at -10% 92%, rgba(71, 181, 119, 0.06), transparent 70%),
    linear-gradient(180deg, #07120f 0%, #050d0b 62%, #040a08 100%);
}

.ambient::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(197, 255, 220, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(197, 255, 220, 0.055) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 55%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 55%);
}

.app {
  position: relative;
  z-index: 1;
  width: min(100%, 480px);
  margin: 0 auto;
  padding: 0 18px;
}

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: calc(16px + env(safe-area-inset-top)) 2px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid rgba(201, 255, 98, 0.22);
  border-radius: 14px;
  background:
    radial-gradient(120% 120% at 16% 0%, rgba(201, 255, 98, 0.18), transparent 56%),
    rgba(17, 34, 28, 0.72);
  box-shadow:
    0 0 26px rgba(166, 255, 116, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.brand-mark svg {
  width: 24px;
  height: 24px;
}

.brand-copy h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: 0.09em;
  line-height: 1.1;
}

.brand-copy p {
  margin: 4px 0 0;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.2em;
  line-height: 1;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.icon-btn.is-hidden {
  display: none;
}

main {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 19px 20px 18px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(115% 95% at 88% -4%, rgba(172, 255, 130, 0.13), transparent 52%),
    radial-gradient(70% 68% at 2% 102%, rgba(50, 205, 151, 0.09), transparent 60%),
    linear-gradient(165deg, rgba(22, 42, 35, 0.96), rgba(10, 22, 18, 0.96));
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.34),
    0 2px 0 rgba(255, 255, 255, 0.03) inset;
  isolation: isolate;
  animation: card-in 0.65s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 30%);
  pointer-events: none;
}

.hero-orbit {
  position: absolute;
  top: -118px;
  right: -108px;
  z-index: -1;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(201, 255, 98, 0.1);
  border-radius: 50%;
  box-shadow:
    0 0 0 34px rgba(201, 255, 98, 0.018),
    0 0 0 70px rgba(201, 255, 98, 0.012);
  pointer-events: none;
}

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

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  color: var(--accent-2);
  font-size: 10.5px;
  font-weight: 550;
  letter-spacing: 0.09em;
  line-height: 1;
  border: 1px solid rgba(92, 240, 192, 0.17);
  border-radius: 999px;
  background: rgba(92, 240, 192, 0.065);
}

.status-dot {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(92, 240, 192, 0.08);
  animation: breathe 2.4s ease-in-out infinite;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 5px 8px;
  border: 0;
  border-radius: 9px;
  color: var(--faint);
  font-size: 11px;
  background: transparent;
  transition: color 0.2s, background 0.2s;
}

.copy-btn:hover {
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.04);
}

.copy-btn svg {
  width: 14px;
  height: 14px;
}

.copy-btn.copied {
  color: var(--accent);
}

.hero-label {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: 0.09em;
}

.countdown {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1px;
  margin-top: 7px;
}

.time-unit {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.time-unit strong {
  display: block;
  width: 100%;
  color: var(--text);
  font-family: var(--sans);
  font-size: clamp(40px, 13.8vw, 58px);
  font-weight: 630;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: -0.065em;
  line-height: 0.98;
  text-align: center;
  text-shadow: 0 0 34px rgba(198, 255, 169, 0.11);
  background: linear-gradient(180deg, #ffffff 4%, #d7f2e4 58%, #a9cbbb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.countdown[data-hlen="3"] .time-unit strong {
  font-size: clamp(34px, 11.4vw, 48px);
  letter-spacing: -0.075em;
}

.countdown[data-hlen="4"] .time-unit strong {
  font-size: clamp(27px, 9.2vw, 39px);
  letter-spacing: -0.08em;
}

.countdown[data-hlen="5"] .time-unit strong {
  font-size: clamp(22px, 7.6vw, 32px);
  letter-spacing: -0.08em;
}

.time-unit em {
  margin-top: 7px;
  color: var(--faint);
  font-size: 9.5px;
  font-style: normal;
  letter-spacing: 0.18em;
  line-height: 1;
}

.colon {
  flex: 0 0 auto;
  padding-top: 9px;
  color: rgba(201, 255, 98, 0.36);
  font-family: var(--mono);
  font-size: clamp(22px, 7vw, 30px);
  font-weight: 500;
  line-height: 1;
  transform: translateY(0);
  user-select: none;
}

.full-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 19px;
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 14px;
  background: rgba(2, 10, 7, 0.28);
}

.full-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.06em;
}

.full-label svg {
  width: 14px;
  height: 14px;
  color: var(--accent-2);
}

.full-line strong {
  overflow: hidden;
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meter {
  margin-top: 17px;
}

.meter-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--faint);
  font-size: 10.5px;
  letter-spacing: 0.05em;
}

.meter-head > span:last-child {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.meter-head b {
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.meter-head small {
  font-size: 10px;
}

.track {
  position: relative;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.065);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.fill {
  position: relative;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #63e9be 0%, #a9ff8d 58%, #d8ff70 100%);
  box-shadow: 0 0 16px rgba(174, 255, 120, 0.3);
  transition: width 0.45s cubic-bezier(0.22, 0.8, 0.28, 1);
}

.fill::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -1px;
  width: 11px;
  height: 11px;
  border: 2px solid rgba(7, 17, 14, 0.72);
  border-radius: 50%;
  background: #e0ff9a;
  box-shadow: 0 0 12px rgba(201, 255, 98, 0.8);
  transform: translateY(-50%);
  transition: opacity 0.2s;
}

.hero-foot {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.mini {
  min-width: 0;
}

.mini + .mini {
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.mini span {
  display: block;
  overflow: hidden;
  color: var(--faint);
  font-size: 9.5px;
  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini strong {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero.is-full {
  background:
    radial-gradient(110% 95% at 88% -4%, rgba(201, 255, 98, 0.21), transparent 55%),
    radial-gradient(70% 68% at 2% 102%, rgba(50, 205, 151, 0.1), transparent 60%),
    linear-gradient(165deg, rgba(24, 47, 38, 0.97), rgba(10, 22, 18, 0.97));
}

.hero.is-full .status-pill {
  color: var(--accent);
  border-color: rgba(201, 255, 98, 0.26);
  background: rgba(201, 255, 98, 0.08);
}

.hero.is-full .status-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(201, 255, 98, 0.1);
}

.hero.is-full .fill {
  box-shadow: 0 0 22px rgba(201, 255, 98, 0.5);
}

.gain-pop {
  position: absolute;
  right: 24px;
  bottom: 98px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  text-shadow: 0 0 16px rgba(201, 255, 98, 0.55);
}

.gain-pop.show {
  animation: gain-float 1s cubic-bezier(0.18, 0.8, 0.25, 1) both;
}

/* ---------- cards / config ---------- */

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.022), transparent 36%),
    var(--card);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.23),
    inset 0 1px 0 rgba(255, 255, 255, 0.025);
  animation: card-in 0.65s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.config {
  padding: 2px 18px;
  animation-delay: 0.06s;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 0 8px;
}

.card-head h2 {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.text-btn {
  min-height: 32px;
  padding: 5px 2px 5px 10px;
  border: 0;
  color: var(--faint);
  font-size: 10.5px;
  background: transparent;
  transition: color 0.2s;
}

.text-btn:hover {
  color: var(--text-soft);
}

.field {
  padding: 15px 0;
  border-top: 1px solid var(--line);
}

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

.field-copy {
  min-width: 0;
}

.field-copy label {
  display: block;
  color: var(--text-soft);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.015em;
}

.field-copy p {
  margin: 3px 0 0;
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.02em;
}

/* max stepper */

.stepper {
  display: flex;
  align-items: center;
  gap: 1px;
  flex: 0 0 auto;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(2, 9, 7, 0.26);
}

.stepper button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  font-size: 19px;
  font-weight: 400;
  background: transparent;
  transition: color 0.18s, background 0.18s;
}

.stepper button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
}

.stepper button:active {
  background: rgba(201, 255, 98, 0.1);
}

.stepper input {
  width: 58px;
  height: 36px;
  padding: 0;
  border: 0;
  color: var(--text);
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
  background: transparent;
  outline: none;
}

/* rate */

.rate-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--muted);
  font-size: 11.5px;
  background: rgba(2, 9, 7, 0.2);
}

.rate-line input {
  width: 42px;
  height: 33px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
  background: rgba(255, 255, 255, 0.045);
  outline: none;
  transition: border-color 0.18s, background 0.18s;
}

.rate-line input:focus {
  border-color: rgba(201, 255, 98, 0.45);
  background: rgba(201, 255, 98, 0.055);
}

/* current */

.current-value {
  flex: 0 0 auto;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.current-value b {
  color: var(--text);
  font-size: 16px;
  font-weight: 650;
}

.current-value small {
  color: var(--faint);
  font-size: 10px;
}

.range-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.round-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 17px;
  background: rgba(255, 255, 255, 0.025);
  transition: color 0.18s, background 0.18s;
}

.round-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
}

input[type="range"] {
  --p: 71%;
  width: 100%;
  height: 30px;
  flex: 1 1 auto;
  margin: 0;
  padding: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #5fe9bd 0%,
    #a9ff8d 56%,
    #d8ff70 var(--p),
    rgba(255, 255, 255, 0.075) var(--p),
    rgba(255, 255, 255, 0.075) 100%
  );
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
}

input[type="range"]::-webkit-slider-thumb {
  width: 21px;
  height: 21px;
  margin-top: -7px;
  border: 3px solid #0d1c18;
  border-radius: 50%;
  background: #e4ffa4;
  box-shadow:
    0 0 0 1px rgba(201, 255, 98, 0.48),
    0 2px 9px rgba(0, 0, 0, 0.45),
    0 0 15px rgba(201, 255, 98, 0.3);
  -webkit-appearance: none;
  appearance: none;
  transition: transform 0.15s;
}

input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(1.1);
}

input[type="range"]::-moz-range-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
}

input[type="range"]::-moz-range-progress {
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, #5fe9bd, #c9ff62);
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 3px solid #0d1c18;
  border-radius: 50%;
  background: #e4ffa4;
  box-shadow: 0 0 0 1px rgba(201, 255, 98, 0.48);
}

/* timer */

.timer-field {
  transition: opacity 0.2s;
}

.timer-field.is-muted {
  opacity: 0.45;
}

.timer-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.time-box {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(2, 9, 7, 0.2);
  transition: border-color 0.18s;
}

.time-box:focus-within {
  border-color: rgba(201, 255, 98, 0.42);
}

.time-box input {
  width: 28px;
  height: 27px;
  padding: 0;
  border: 0;
  color: var(--text);
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
  background: transparent;
  outline: none;
}

.time-box span {
  color: var(--faint);
  font-size: 9.5px;
}

.time-box input:disabled {
  color: var(--muted);
  -webkit-text-fill-color: var(--muted);
}

.field-warning {
  margin: 9px 0 0;
  padding: 8px 10px;
  color: var(--amber);
  font-size: 10.5px;
  line-height: 1.5;
  border: 1px solid rgba(255, 196, 107, 0.16);
  border-radius: 9px;
  background: rgba(255, 196, 107, 0.055);
}

/* ---------- details ---------- */

.details {
  padding: 0 18px;
  animation-delay: 0.12s;
}

.details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.02em;
  list-style: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

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

.details summary svg {
  width: 18px;
  height: 18px;
  color: var(--faint);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.details[open] summary svg {
  transform: rotate(180deg);
}

.details-body {
  padding: 4px 0 18px;
  border-top: 1px solid var(--line);
}

.timeline {
  padding-top: 7px;
}

.node {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 35px;
  border-bottom: 1px dashed rgba(206, 255, 221, 0.055);
}

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

.node-badge {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  height: 22px;
  padding: 0 7px;
  color: var(--accent-2);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  border: 1px solid rgba(92, 240, 192, 0.16);
  border-radius: 7px;
  background: rgba(92, 240, 192, 0.055);
}

.node-badge.final {
  color: var(--accent-ink);
  border-color: transparent;
  background: linear-gradient(100deg, #a9ff8d, #d8ff70);
}

.node-time {
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.node-rel {
  margin-left: auto;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.node-more {
  padding: 6px 0 6px 47px;
  color: var(--faint);
  font-size: 10px;
}

.formula {
  margin-top: 13px;
  padding: 11px 12px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.85;
  border: 1px solid rgba(206, 255, 221, 0.055);
  border-radius: 12px;
  background: rgba(2, 9, 7, 0.2);
}

.formula b {
  color: var(--text-soft);
  font-weight: 600;
}

.formula code {
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.formula p {
  margin: 0;
}

.formula p + p {
  margin-top: 4px;
}

/* ---------- footer / toast / sheet ---------- */

.app-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 0 calc(18px + env(safe-area-inset-bottom));
  color: rgba(112, 139, 128, 0.65);
  font-size: 9.5px;
  letter-spacing: 0.03em;
  text-align: center;
}

.app-footer svg {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 80;
  max-width: min(88vw, 340px);
  padding: 10px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
  font-size: 11.5px;
  text-align: center;
  background: rgba(16, 33, 28, 0.96);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.42);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.24s, transform 0.24s;
  backdrop-filter: blur(12px);
}

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

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(1, 6, 4, 0.68);
  opacity: 0;
  transition: opacity 0.25s;
  backdrop-filter: blur(7px);
}

.sheet-backdrop[hidden] {
  display: none;
}

.sheet-backdrop.open {
  opacity: 1;
}

.sheet {
  width: min(100%, 480px);
  padding: 9px 22px calc(22px + env(safe-area-inset-bottom));
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  background:
    radial-gradient(100% 45% at 80% 0%, rgba(201, 255, 98, 0.08), transparent 70%),
    #0d1c18;
  box-shadow: 0 -24px 60px rgba(0, 0, 0, 0.45);
  transform: translateY(24px);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sheet:focus {
  outline: none;
}

.sheet-backdrop.open .sheet {
  transform: translateY(0);
}

.sheet-handle {
  display: block;
  width: 38px;
  height: 4px;
  margin: 0 auto 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
}

.sheet h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.sheet-intro {
  margin: 7px 0 17px;
  color: var(--muted);
  font-size: 12px;
}

.install-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.install-step {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.step-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  border: 1px solid rgba(201, 255, 98, 0.17);
  border-radius: 10px;
  background: rgba(201, 255, 98, 0.055);
}

.step-icon.android {
  color: var(--accent-2);
  border-color: rgba(92, 240, 192, 0.17);
  background: rgba(92, 240, 192, 0.055);
}

.step-icon.desktop {
  color: var(--muted);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.install-step b {
  display: block;
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 600;
}

.install-step p {
  margin: 3px 0 0;
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.55;
}

.primary-btn {
  width: 100%;
  min-height: 46px;
  margin-top: 16px;
  border: 0;
  border-radius: 14px;
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 650;
  background: linear-gradient(100deg, #a9ff8d, #d8ff70);
  box-shadow: 0 8px 24px rgba(180, 255, 115, 0.16);
}

.primary-btn[hidden] {
  display: none;
}

.secondary-btn {
  width: 100%;
  min-height: 42px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.sheet-open {
  overflow: hidden;
}

/* ---------- motion ---------- */

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(13px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes breathe {
  0%,
  100% {
    box-shadow: 0 0 0 4px rgba(92, 240, 192, 0.06);
    opacity: 0.72;
  }
  50% {
    box-shadow: 0 0 0 5px rgba(92, 240, 192, 0.13);
    opacity: 1;
  }
}

@keyframes gain-float {
  0% {
    opacity: 0;
    transform: translateY(4px) scale(0.9);
  }
  18% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  70% {
    opacity: 1;
    transform: translateY(-15px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-27px) scale(0.96);
  }
}

@media (min-width: 720px) {
  .app {
    padding: 0 20px 24px;
  }

  .topbar {
    padding-top: 30px;
  }

  .hero {
    padding: 22px 24px 20px;
  }

  .config {
    padding: 2px 22px;
  }

  .details {
    padding: 0 22px;
  }
}

@media (max-width: 359px) {
  .app {
    padding: 0 13px;
  }

  .hero {
    padding-left: 15px;
    padding-right: 15px;
  }

  .config,
  .details {
    padding-left: 15px;
    padding-right: 15px;
  }

  .copy-btn span {
    display: none;
  }

  .full-line strong {
    font-size: 12.5px;
  }

  .time-unit strong {
    font-size: 38px;
  }

  .countdown[data-hlen="3"] .time-unit strong {
    font-size: 32px;
  }

  .rate-line {
    gap: 4px;
    padding-left: 8px;
    padding-right: 8px;
    font-size: 10.5px;
  }

  .rate-line input {
    width: 36px;
  }

  .field-copy p {
    max-width: 128px;
  }
}

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