:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --primary: #22c55e;
  --primary-hover: #15803d;
  --border: #dbe3ef;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background: linear-gradient(160deg, #eef6ff 0%, var(--bg) 50%, #ecfeff 100%);
  color: var(--text);
}

.container {
  max-width: 900px;
  margin: 32px auto;
  padding: 0 16px 24px;
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

h1 {
  margin-bottom: 4px;
}

.subtitle {
  margin-top: 0;
  color: var(--muted);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-top: 16px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.tabs-shell {
  margin-top: 14px;
}

.tabs-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  margin-bottom: -1px;
  position: relative;
  z-index: 2;
}

.tab-btn {
  margin-top: 0;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 14px 14px 0 0;
  background: linear-gradient(180deg, #ffffff 0%, #edf3fb 100%);
  color: #334155;
  box-shadow: none;
  padding: 8px 14px 10px;
  font-size: 0.9rem;
  font-weight: 600;
}

.tab-btn::before,
.tab-btn::after {
  display: none;
}

.tab-btn:hover {
  transform: none;
  box-shadow: none;
  filter: none;
}

.tab-btn.active {
  background: var(--card);
  color: var(--text);
  border-color: var(--border);
  padding-bottom: 11px;
  position: relative;
  top: 1px;
}

.tab-panel {
  margin-top: 0;
  border-top-left-radius: 0;
}

.grid {
  display: grid;
  gap: 16px;
}

.two-cols {
  grid-template-columns: 1fr;
}

label {
  display: block;
  margin-top: 8px;
  margin-bottom: 6px;
  font-size: 0.95rem;
}

input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
}

.pace-inputs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
}

.pace-inputs span {
  font-size: 1.4rem;
  font-weight: 600;
}

.time-inputs {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 8px;
  align-items: center;
}

.time-inputs span {
  font-size: 1.4rem;
  font-weight: 600;
}

button {
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 12px;
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 55%, #15803d 100%);
  color: #fff;
  padding: 10px 14px;
  font-size: 0.98rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(21, 128, 61, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

button::before,
button::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

button::before {
  width: 170%;
  height: 230%;
  left: -40%;
  top: -175%;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.46) 0%, rgba(255, 255, 255, 0) 63%);
  animation: liquid-sheen 4s ease-in-out infinite;
}

button::after {
  width: 130%;
  height: 130%;
  right: -70%;
  bottom: -95%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 68%);
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(21, 128, 61, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  filter: saturate(1.1);
}

button:active {
  transform: translateY(1px) scale(0.99);
}

button:focus-visible {
  outline: 3px solid rgba(34, 197, 94, 0.45);
  outline-offset: 2px;
}

@keyframes liquid-sheen {
  0%,
  100% {
    transform: translateX(0) translateY(0) rotate(0deg);
  }
  50% {
    transform: translateX(10%) translateY(6%) rotate(7deg);
  }
}

.result {
  min-height: 1.5em;
  font-weight: 600;
}

.note {
  color: var(--muted);
  font-size: 0.9rem;
}

.info-btn {
  width: 34px;
  height: 34px;
  margin-top: 0;
  padding: 0;
  border-radius: 50%;
  font-size: 1rem;
  font-weight: 700;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}

.modal-card {
  width: min(720px, 100%);
  max-height: 85vh;
  overflow: auto;
  background: var(--card);
  color: var(--text);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.22);
  padding: 16px 18px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.modal-head h2 {
  margin: 0;
}

.modal-close {
  margin-top: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  font-size: 1.4rem;
  line-height: 1;
}

@media (min-width: 760px) {
  .two-cols {
    grid-template-columns: 1fr 1fr;
  }
}

.actions {
  margin-top: 16px;
  display: flex;
  justify-content: center;
}

.actions-top {
  margin-top: 8px;
  margin-bottom: 4px;
}

#resetAllBtn {
  min-width: 220px;
}
