.page-ios-record {
  background: #0c1016;
  color: #e6ecff;
}

.ios-record-wrap {
  max-width: 520px;
  margin: 0 auto;
  padding: 0.65rem 0.75rem 0;
  box-sizing: border-box;
}

/* The hidden attribute must win over the display:flex below (used to swap to the
   active recording view on START). */
.ios-record-prestart[hidden] {
  display: none !important;
}

.ios-record-prestart {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: calc(100vh - 8.5rem - env(safe-area-inset-top, 0px) - var(--knotnow-ios-tab-clearance, 3.5rem));
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.ios-record-title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
}

.ios-record-section-title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 650;
}

.ios-record-hint {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  color: #8b95a8;
  line-height: 1.4;
}

.ios-record-wind-card {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #121214;
  padding: 0.75rem 0.7rem 0.85rem;
  margin-bottom: 0.35rem;
  flex-shrink: 0;
}

.ios-record-compass-touch {
  position: relative;
  max-width: min(200px, 54vw);
  margin: 0 auto 0.35rem;
  touch-action: none;
}

.ios-record-wind-svg {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
}

.ios-record-wind-ring-bg {
  fill: rgba(0, 0, 0, 0.45);
  stroke: rgba(220, 74, 109, 0.35);
  stroke-width: 2;
}

.ios-record-wind-tick-major {
  stroke: rgba(255, 255, 255, 0.35);
  stroke-width: 2;
}

.ios-record-wind-tick-minor {
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 1;
}

.ios-record-wind-rose-n,
.ios-record-wind-rose-e,
.ios-record-wind-rose-s,
.ios-record-wind-rose-w {
  fill: rgba(255, 255, 255, 0.55);
  font-size: 14px;
  font-weight: 700;
}

.ios-record-wind-arrow-shape {
  fill: #f4729a;
  stroke: rgba(12, 12, 14, 0.95);
  stroke-width: 1.5;
}

.ios-record-wind-readout {
  text-align: center;
  font-size: 0.92rem;
  font-weight: 600;
  color: #e6ecff;
  margin-top: 0.35rem;
}

.ios-record-dial-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.ios-record-dial-row input[type='range'] {
  flex: 1;
  min-width: 0;
  accent-color: #dc4a6d;
}

.ios-record-icon-btn {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 10px;
  padding: 0.45rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  min-width: 2.75rem;
}

.ios-record-icon-btn:active {
  background: rgba(255, 255, 255, 0.14);
}

.ios-record-speed-block {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ios-record-speed-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.4rem;
}

.ios-record-speed-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.ios-record-speed-value {
  font-size: 1.85rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  min-width: 3.2rem;
  text-align: center;
}

.ios-record-start-pink {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 0.9rem 1.15rem;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: #e64980;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.ios-record-start-pink:active {
  transform: scale(0.99);
}

.ios-record-active {
  margin-top: 0.25rem;
}

.ios-record-active-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.ios-record-tab {
  flex: 1;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.75);
  border-radius: 10px;
  padding: 0.55rem 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
}

.ios-record-tab.is-active {
  background: rgba(220, 74, 109, 0.55);
  border-color: rgba(220, 74, 109, 0.85);
  color: #fff;
}

.ios-record-panel {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #121214;
  padding: 0.85rem;
  margin-bottom: 0.75rem;
  min-height: 12rem;
}

.ios-record-hint--tight {
  margin-bottom: 0.5rem;
}

.ios-record-hint--custom {
  margin-top: 0.35rem;
}

.ios-record-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.ios-record-metric {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.65rem 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.ios-record-metric--hero .ios-record-metric-val {
  font-size: clamp(2.35rem, 11vw, 3.15rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.ios-record-metric--hero .ios-record-metric-label {
  font-size: 0.58rem;
}

.ios-record-metric--hero .ios-record-metric-unit {
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
}

.ios-record-metric--elapsed .ios-record-metric-val {
  font-size: 1.35rem;
}

.ios-record-metric--elapsed .ios-record-metric-val--wide {
  font-size: 1.45rem;
}

.ios-record-metric-lap-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.ios-record-metric--lap-split {
  min-height: 0;
}

.ios-record-metric--lap {
  border-color: rgba(250, 204, 21, 0.45);
  background: rgba(66, 32, 6, 0.35);
}

.ios-record-metric--lap-elapsed .ios-record-metric-label {
  color: rgba(250, 204, 21, 0.75);
}

.ios-record-metric-val--lap-elapsed {
  color: #facc15 !important;
  font-size: 1.45rem !important;
  font-weight: 900 !important;
  font-variant-numeric: tabular-nums;
}

.ios-record-lap-num {
  display: inline-block;
  font-weight: 900;
  font-size: 1.05em;
  color: #facc15;
  font-variant-numeric: tabular-nums;
}

.ios-record-metric-val--lap {
  color: #fef08a !important;
  font-size: 1.65rem !important;
  font-weight: 900 !important;
}

.ios-record-metric-unit--lap {
  color: rgba(254, 240, 138, 0.85) !important;
  font-weight: 700;
}

.ios-record-metric-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.48);
}

.ios-record-metric-val {
  font-size: 1.35rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #fff;
}

.ios-record-metric-val--wide {
  font-size: 1.5rem;
}

.ios-record-metric-unit {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.45);
}

.ios-record-lap-btn {
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.85rem 0.75rem;
  min-height: 3.25rem;
  border-radius: 14px;
  border: 2px solid rgba(250, 204, 21, 0.85);
  background: linear-gradient(180deg, rgba(113, 63, 18, 0.55) 0%, rgba(66, 32, 6, 0.75) 100%);
  color: #fef9c3;
  font-weight: 900;
  letter-spacing: 0.14em;
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35) inset;
}

.ios-record-lap-btn-main {
  color: #facc15;
}

.ios-record-lap-btn:active {
  filter: brightness(1.12);
}

.ios-record-lap-sub {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(254, 249, 195, 0.88);
}

.ios-record-watch-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

.ios-record-bearing-big {
  font-size: clamp(2.75rem, 12vw, 4.25rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  line-height: 1;
  color: #fab005;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
  margin: 0 0 0.15rem;
}

.ios-record-watch-svg {
  width: min(100%, 300px);
  height: auto;
  display: block;
}

.ios-record-watch-bezel {
  fill: rgba(0, 0, 0, 0.45);
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 3;
}

.ios-record-watch-deg {
  fill: #fef08a;
  font-size: 15px;
  font-weight: 800;
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
  paint-order: stroke fill;
  stroke: rgba(12, 16, 22, 0.92);
  stroke-width: 3px;
}

.ios-record-watch-tick {
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 1.5;
}

.ios-record-watch-n {
  fill: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  font-weight: 700;
}

.ios-record-watch-bearing-line {
  stroke: #fbbf24;
  stroke-width: 4;
  stroke-linecap: round;
}

.ios-record-watch-bearing-head {
  fill: #fbbf24;
  stroke: rgba(0, 0, 0, 0.35);
  stroke-width: 1;
}

.ios-record-watch-wind-line {
  stroke: rgba(244, 114, 182, 0.85);
  stroke-width: 5;
  stroke-linecap: round;
  opacity: 0.95;
}

.ios-record-watch-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.78rem;
  color: #adb4c4;
}

.ios-record-legend-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.ios-record-legend-dot--hdg {
  background: #fbbf24;
}

.ios-record-legend-dot--wnd {
  background: #f4729a;
}

.ios-record-watch-note {
  margin: 0;
  font-size: 0.75rem;
  color: #7a8499;
  text-align: center;
  max-width: 18rem;
  line-height: 1.4;
}

.ios-record-gun-custom input[type='time'] {
  width: 100%;
}

.ios-record-race-presets {
  display: flex;
  gap: 0.4rem;
  margin: 0.5rem 0 0.35rem;
}

.ios-record-race-preset {
  flex: 1;
  min-height: 3rem;
  border-radius: 12px;
  border: 2px solid rgba(77, 171, 247, 0.55);
  background: rgba(77, 171, 247, 0.14);
  color: #e8f4ff;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.35rem 0.25rem;
}

.ios-record-race-preset.is-active {
  border-color: #e64980;
  background: rgba(230, 73, 128, 0.38);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(230, 73, 128, 0.35) inset;
}

.ios-record-race-preset:active {
  filter: brightness(1.08);
}

.ios-record-race-anchored-readout {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #fab005;
  text-align: center;
}

.ios-record-race-anchored-readout span#ios-record-race-anchored-clock {
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.ios-record-race-anchored-note {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.62rem;
  font-weight: 600;
  color: rgba(250, 176, 5, 0.78);
  letter-spacing: 0.02em;
}

.ios-record-field {
  display: block;
  margin-bottom: 0.65rem;
}

.ios-record-field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.35rem;
}

.ios-record-field input[type='time'] {
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 1.1rem;
}

.ios-record-countdown {
  text-align: center;
  font-size: 2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  margin: 0.75rem 0;
  color: #e64980;
}

.ios-record-race-run .ios-record-countdown--hero {
  font-size: clamp(2.75rem, 11vw, 4.25rem);
  font-weight: 900;
  line-height: 1.05;
  margin: 0 0 0.35rem;
  letter-spacing: 0.04em;
}

.ios-record-countdown--final {
  font-size: clamp(4.25rem, 24vw, 7.5rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  color: #fab005;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
}

.ios-record-race-run {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ios-record-race-run .ios-record-race-anchored-readout {
  margin: 0 0 0.15rem;
  font-size: 0.95rem;
}

.ios-record-race-resync-btn {
  width: 100%;
  min-height: 2.5rem;
  border-radius: 10px;
  border: 1px solid rgba(77, 171, 247, 0.55);
  background: rgba(77, 171, 247, 0.12);
  color: #dbeafe;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.ios-record-race-resync-btn:active {
  filter: brightness(1.08);
}

.ios-record-race-stop-btn {
  width: 100%;
  min-height: 3rem;
  margin-top: 0.15rem;
  border-radius: 12px;
  border: 2px solid #7f1d1d;
  background: linear-gradient(180deg, #ef4444 0%, #b91c1c 55%, #991b1b 100%);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.ios-record-race-stop-btn:active {
  transform: scale(0.99);
  filter: brightness(1.06);
}

.ios-record-race-next-btn {
  width: 100%;
  min-height: 2.75rem;
  margin-top: 0.35rem;
  border-radius: 12px;
  border: 2px solid #e64980;
  background: rgba(230, 73, 128, 0.22);
  color: #fecdd3;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.ios-record-race-next-btn:active {
  filter: brightness(1.08);
  transform: scale(0.99);
}

.ios-record-race-post-hint {
  font-size: 0.65rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.58);
  margin: 0.35rem 0 0;
  text-align: center;
}

.ios-record-race-post-hint strong {
  color: rgba(255, 255, 255, 0.88);
}

.ios-record-nudge-block--race-run {
  margin-top: 0.15rem;
}

.ios-record-nudge-block--race-run .ios-record-field-label {
  margin-bottom: 0.25rem;
}

#ios-record-race-run .ios-record-nudge-block--race-run[hidden],
#ios-record-race-run #ios-record-race-stop-btn[hidden],
#ios-record-race-run #ios-record-race-next-btn[hidden],
#ios-record-race-run #ios-record-race-post-hint[hidden] {
  display: none !important;
  margin: 0 !important;
}

.ios-record-nudge-block--setup-hint {
  margin-top: 0.65rem;
}

.ios-record-countdown--start {
  color: #fab005;
  animation: ios-record-start-pulse 0.9s ease-in-out infinite;
}

@keyframes ios-record-start-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.82;
    transform: scale(1.04);
  }
}

.ios-record-nudge-block {
  margin-top: 0.5rem;
}

.ios-record-control-bar--glove {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  position: sticky;
  bottom: 0;
  padding: 0.65rem 0 calc(0.35rem + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, transparent, #0c1016 28%);
}

.ios-record-glove-stop {
  width: 100%;
  min-height: 3.5rem;
  border-radius: 16px;
  border: 2px solid rgba(252, 82, 0, 0.95);
  background: linear-gradient(180deg, #ff6a1a 0%, #fc5200 45%, #e04800 100%);
  color: #fff;
  font-size: 1.12rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
}

.ios-record-glove-resume {
  width: 100%;
  min-height: 3.5rem;
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  background: linear-gradient(180deg, rgba(55, 55, 60, 0.92) 0%, rgba(22, 22, 26, 0.98) 100%);
  color: #f8fafc;
  font-size: 1.12rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
}

.ios-record-glove-stop:active,
.ios-record-glove-resume:active {
  transform: scale(0.99);
  filter: brightness(1.06);
}

.ios-record-glove-action {
  width: 100%;
  min-height: 3.25rem;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  border: 2px solid transparent;
}

.ios-record-glove-action--save {
  background: linear-gradient(180deg, rgba(220, 74, 109, 0.35) 0%, rgba(120, 30, 55, 0.55) 100%);
  border-color: rgba(220, 74, 109, 0.55);
  color: #fff5f7;
}

.ios-record-glove-action--discard {
  background: linear-gradient(180deg, rgba(38, 38, 42, 0.95) 0%, rgba(18, 18, 20, 0.98) 100%);
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(248, 250, 252, 0.88);
}

.ios-record-glove-action:active {
  filter: brightness(1.08);
  transform: scale(0.995);
}

.ios-record-stopped-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: 100%;
}

.ios-record-stopped-actions[hidden] {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.ios-record-orient-status {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  line-height: 1.4;
  color: rgba(226, 232, 240, 0.75);
}

.ios-record-race-arm-btn {
  width: 100%;
  min-height: 3rem;
  margin: 0.35rem 0 0.5rem;
  border-radius: 12px;
  border: 2px solid #e64980;
  background: linear-gradient(180deg, rgba(230, 73, 128, 0.88) 0%, rgba(170, 40, 85, 0.98) 100%);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 2px 14px rgba(230, 73, 128, 0.4);
}

.ios-record-race-arm-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.ios-record-hint--nudge {
  margin: 0.25rem 0 0.45rem;
  font-size: 0.72rem;
}

.ios-record-nudge-horn-btn {
  width: 100%;
  min-height: 3rem;
  border-radius: 12px;
  border: 2px solid rgba(77, 171, 247, 0.85);
  background: rgba(77, 171, 247, 0.2);
  color: #f0f8ff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.ios-record-nudge-horn-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Race tab: brighter copy on dark panel */
#ios-record-panel-race.ios-record-panel--race .ios-record-hint,
#ios-record-panel-race.ios-record-panel--race .ios-record-section-title {
  color: #c8dded;
}

#ios-record-panel-race.ios-record-panel--race .ios-record-field-label {
  color: rgba(77, 171, 247, 0.95);
}

#ios-record-panel-race.ios-record-panel--race .ios-record-field input[type='time'] {
  border-color: rgba(77, 171, 247, 0.5);
  box-shadow: 0 0 0 1px rgba(77, 171, 247, 0.12) inset;
}

.ios-record-gps-status {
  text-align: center;
  margin-bottom: 0.65rem;
}

.ios-record-gps-status--err {
  color: #fca5a5;
}

.ios-record-upload-status {
  width: 100%;
  text-align: center;
  font-size: 0.85rem;
  color: #9fb2ff;
  margin: 0 0 0.55rem;
  min-height: 1.25rem;
}
