.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  min-height: 46px;
  padding: 0 16px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), transparent 36%),
    linear-gradient(180deg, #6d74ff, var(--primary));
  color: white;
  box-shadow: 0 5px 0 var(--primary-deep);
  cursor: pointer;
}

.btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--primary-deep); }
.btn-lg { min-height: 52px; padding-inline: 18px; }
.btn-ghost {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 40%),
    rgba(16, 16, 32, 0.8);
  box-shadow: 0 5px 0 #151226;
}
.btn-danger {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), transparent 34%),
    linear-gradient(180deg, #ff7b93, var(--danger));
  box-shadow: 0 5px 0 #8d243c;
}

.panel {
  min-width: 0;
  border-radius: 22px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 28%),
    var(--panel);
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.kicker {
  color: var(--highlight);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.section-title { font-size: clamp(20px, 5vw, 28px); margin: 6px 0; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 3, 10, 0.62);
  pointer-events: auto;
}

.modal-sheet-layer { align-items: end; padding: 0; }

.modal-card {
  width: min(440px, 100%);
  max-height: min(82dvh, 720px);
  overflow: auto;
  padding: 18px 16px 16px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 24%),
    #141226;
  box-shadow: 0 12px 0 rgba(0, 0, 0, 0.35);
}

.modal-sheet {
  width: min(560px, 100%);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  padding-bottom: calc(16px + var(--safe-bottom));
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.modal-card { position: relative; }
.modal-kicker { margin-bottom: 4px; }
.modal-title { font-size: clamp(22px, 6vw, 32px); padding-right: 36px; }
.modal-body { margin-top: 10px; display: grid; gap: 10px; }
.modal-text { color: var(--muted); overflow-wrap: break-word; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.modal-actions .btn { flex: 1 1 120px; }

.toast {
  max-width: min(420px, 100%);
  padding: 10px 14px;
  border-radius: 16px;
  background: #17152a;
  border: 1px solid var(--line);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.toast-danger { border-color: rgba(255, 92, 122, 0.7); }
.toast.is-leaving { opacity: 0; }

.ring {
  width: 84px;
  height: 84px;
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
}

.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring-track { stroke: rgba(255, 255, 255, 0.12); }
.ring-value { stroke: var(--highlight); stroke-linecap: round; }
.ring strong { font-size: 18px; }
.ring small { position: absolute; bottom: 16px; font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

.meter {
  min-width: 0;
  padding: 6px 8px;
  border-radius: 14px;
  background: rgba(8, 8, 18, 0.55);
  border: 1px solid var(--line);
  display: grid;
}

.meter span { color: var(--muted); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.meter strong { font-size: 14px; }
.meter.is-done { border-color: rgba(61, 220, 151, 0.7); }

.settings { display: grid; gap: 12px; }
.switch-row, .name-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.switch {
  width: 52px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: #2a2740;
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.35);
  position: relative;
}
.switch::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  transition: transform 0.2s ease;
}
.switch.is-on { background: linear-gradient(90deg, var(--primary), var(--secondary)); }
.switch.is-on::after { transform: translateX(20px); }

.tab-bar { display: flex; gap: 6px; overflow: hidden; }
.tab {
  flex: 1 1 0;
  min-width: 0;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(10, 10, 20, 0.55);
  color: var(--muted);
}
.tab.is-active {
  color: #1a1408;
  background: linear-gradient(180deg, #ffe7a8, var(--highlight));
  border-color: #fff1c2;
}

.star-meter {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.star-meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--secondary)); }
