:root {
  color-scheme: light;
  --navy: #082f49;
  --blue: #0b6d93;
  --sky: #dff5fb;
  --lime: #d9f278;
  --ink: #123243;
  --muted: #607783;
  --line: #d9e5e9;
  --paper: #ffffff;
  --sand: #f5f3eb;
  font-family: "Hiragino Sans", "Yu Gothic", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: linear-gradient(180deg, #eaf8fc 0, #f7faf9 34rem, var(--sand) 100%);
}

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

.hero {
  position: relative;
  overflow: hidden;
  padding: max(28px, env(safe-area-inset-top)) 20px 54px;
  color: white;
  background:
    radial-gradient(circle at 80% 10%, rgba(217, 242, 120, .26), transparent 28%),
    linear-gradient(145deg, #07324a 0%, #095d80 68%, #0a789d 100%);
}

.hero::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -82px;
  top: 24px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
}

.hero__inner { position: relative; z-index: 1; max-width: 700px; margin: 0 auto; }
.eyebrow { display: flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 700; letter-spacing: .08em; color: #d9eff7; }
.eyebrow span { padding: 4px 8px; border-radius: 999px; color: var(--navy); background: var(--lime); font-size: 10px; }
.hero h1 { margin: 15px 0 12px; font-size: clamp(33px, 9vw, 54px); line-height: 1.08; letter-spacing: -.035em; }
.hero h1 span { color: var(--lime); }
.hero p { max-width: 30em; margin: 0; color: #e5f5fa; font-size: 15px; line-height: 1.75; }

.bridge-line { position: absolute; right: 0; bottom: -20px; width: 46%; min-width: 180px; height: 90px; border-bottom: 3px solid rgba(255,255,255,.65); transform: rotate(-2deg); }
.bridge-line::before, .bridge-line::after { content: ""; position: absolute; bottom: -2px; width: 4px; height: 70px; background: rgba(255,255,255,.68); border-radius: 5px 5px 0 0; }
.bridge-line::before { left: 24%; }
.bridge-line::after { right: 22%; }
.bridge-line span { position: absolute; left: 24%; right: 22%; bottom: 34px; height: 35px; border-top: 2px solid rgba(255,255,255,.55); border-radius: 50% 50% 0 0; }

main { width: min(100% - 28px, 700px); margin: -25px auto 0; position: relative; z-index: 2; }

.card {
  margin-bottom: 18px;
  padding: 24px;
  background: rgba(255,255,255,.98);
  border: 1px solid rgba(8,47,73,.08);
  border-radius: 24px;
  box-shadow: 0 14px 40px rgba(8,47,73,.10);
}

.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.section-heading > div { display: flex; align-items: center; gap: 10px; }
.section-heading h2 { margin: 0; color: var(--navy); font-size: 21px; letter-spacing: -.02em; }
.step { display: inline-grid; place-items: center; min-height: 28px; padding: 0 9px; border-radius: 8px; background: var(--sky); color: var(--blue); font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.step--lime { background: #eff9c9; color: #567000; }
.live-badge { flex: none; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.live-badge i { width: 7px; height: 7px; border-radius: 50%; background: #5fae19; box-shadow: 0 0 0 3px rgba(95,174,25,.14); }

.field-group { margin: 0 0 22px; padding: 0; border: 0; }
.field-group > label, .field-group > legend { display: block; margin: 0 0 10px; color: var(--navy); font-size: 13px; font-weight: 800; }

.quick-buttons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-bottom: 10px; }
.quick-buttons--training { grid-template-columns: repeat(6, 1fr); }
.quick-buttons button {
  min-height: 42px;
  padding: 7px 5px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
  font-weight: 700;
  cursor: pointer;
}
.quick-buttons button.is-selected { border-color: var(--blue); color: white; background: var(--blue); box-shadow: 0 5px 12px rgba(11,109,147,.18); }
.quick-buttons--training button.is-selected { border-color: #6e8c0c; color: var(--navy); background: var(--lime); box-shadow: 0 5px 12px rgba(118,145,24,.14); }

input[type="number"] {
  width: 100%;
  min-height: 50px;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  color: var(--navy);
  background: #fbfdfd;
  font-size: 18px;
  font-weight: 800;
  text-align: center;
  outline: none;
}
input[type="number"]:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(11,109,147,.10); }

.input-with-unit { position: relative; }
.input-with-unit input { padding-right: 58px; text-align: left; }
.input-with-unit span { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; font-weight: 700; }
.time-inputs, .pace-inputs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.pace-inputs { grid-template-columns: repeat(2, 1fr); }
.time-inputs label, .pace-inputs label { position: relative; }
.time-inputs small, .pace-inputs small { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 11px; font-weight: 700; pointer-events: none; }
.time-inputs input, .pace-inputs input { padding-right: 34px; text-align: left; }
.pace-inputs label:last-child input { padding-right: 65px; }

.pace-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 4px 0 24px;
  padding: 18px;
  color: white;
  background: linear-gradient(135deg, var(--navy), #0c6688);
  border-radius: 17px;
}
.pace-result > span { font-size: 13px; font-weight: 700; }
.pace-result div { white-space: nowrap; }
.pace-result strong { font-size: 36px; line-height: 1; letter-spacing: -.03em; }
.pace-result em { margin-left: 5px; color: #c9eaf4; font-size: 13px; font-style: normal; font-weight: 700; }

.splits h3 { margin: 0 0 8px; color: var(--navy); font-size: 14px; }
.split-table { border-top: 1px solid var(--line); }
.split-row { display: flex; align-items: center; justify-content: space-between; min-height: 46px; padding: 0 6px; border-bottom: 1px solid var(--line); font-size: 14px; }
.split-row strong { color: var(--navy); font-variant-numeric: tabular-nums; }
.split-row.is-goal { margin-top: 5px; padding: 0 10px; border: 0; border-radius: 10px; background: #eff8fa; }
.split-row.is-goal span { font-weight: 800; }
.split-row.is-muted { color: #98a6ac; }
.split-row.is-muted strong { color: #98a6ac; font-weight: 500; }
.note { margin: 14px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }

.training-card { border-top: 5px solid var(--lime); }
.training-grid { margin-top: 4px; }
.secondary-button {
  width: 100%;
  min-height: 45px;
  margin: -8px 0 18px;
  border: 1.5px solid var(--blue);
  border-radius: 12px;
  color: var(--blue);
  background: white;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.secondary-button:active { transform: translateY(1px); }
.training-result { padding: 19px; border-radius: 17px; background: #f0f7d5; text-align: center; }
.training-result span { display: block; margin-bottom: 4px; color: #64722d; font-size: 12px; font-weight: 700; }
.training-result strong { display: block; color: var(--navy); font-size: clamp(26px, 8vw, 36px); letter-spacing: -.035em; }
.training-result small { display: block; margin-top: 6px; color: var(--muted); font-weight: 700; }

footer { padding: 10px 20px calc(28px + env(safe-area-inset-bottom)); color: #6c7b81; text-align: center; font-size: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (min-width: 620px) {
  .hero { padding-top: 46px; padding-bottom: 72px; }
  main { margin-top: -38px; }
  .card { padding: 32px 38px; }
  .training-grid { display: grid; grid-template-columns: 1fr 200px; align-items: end; gap: 14px; }
  .training-grid .field-group { margin-bottom: 18px; }
  .secondary-button { margin: 0 0 18px; }
}

@media (max-width: 390px) {
  .card { padding: 21px 17px; border-radius: 20px; }
  .quick-buttons--training { grid-template-columns: repeat(3, 1fr); }
  .pace-result { align-items: flex-start; flex-direction: column; gap: 9px; }
}

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