/* Alternate swim views, shared by the EN and RU pages. */
/* Keep horizontal clipping without turning body into a sticky scroll ancestor. */
body { overflow-x: clip; }
.sv-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; max-width: 520px; margin: 0 auto 18px; }
.sv-tabs button, .sv-controls button {
  min-height: 44px; padding: 10px 18px; border: 1px solid var(--h-line);
  border-radius: 100px; background: var(--h-card); color: var(--cream-2);
  font: inherit; font-size: .85rem; cursor: pointer;
  /* Repeated taps (e.g. Next, Next) must not trigger iOS double-tap zoom; pinch-zoom still works. */
  touch-action: manipulation;
}
.sv-tabs button[aria-selected="true"] { border-color: var(--ember); color: var(--cream); background: rgba(232,101,26,.16); }
.sv-tabs button:focus-visible, .sv-controls button:focus-visible, .sv-field select:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.sv-tabs[hidden], .sv-panel[hidden], #swimChartsPanel[hidden], .sv-panel [hidden] { display: none !important; }
.sv-panel { padding: clamp(16px, 4vw, 28px); border: 1px solid var(--h-line); border-radius: var(--r-lg); background: var(--h-card); }
.sv-panel h3 { font-family: var(--font-display); font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 400; margin: 0 0 8px; }
.sv-note { color: var(--muted); font-size: .8rem; line-height: 1.6; margin: 0 0 24px; }
.sv-field { display: block; min-width: 0; color: var(--cream-2); font-size: .8rem; }
.sv-field > span { display: block; margin-bottom: 8px; }
/* iOS Safari draws no arrow on a select with a custom background and border, so
   the native look is switched off everywhere and one chevron is drawn instead. */
.sv-field select { width: 100%; min-height: 44px; padding: 10px 40px 10px 10px; color: var(--cream); border: 1px solid var(--h-line); border-radius: 10px; font: inherit; text-overflow: ellipsis;
  -webkit-appearance: none; appearance: none;
  background: #17110d url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23f4ede0' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center / 12px 8px; }
.sv-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.sv-pair .sv-field { border-top: 2px solid var(--ember); padding-top: 12px; }
.sv-pair .sv-field + .sv-field { border-color: #6db3f0; }
.sv-time { display: block; font-family: var(--font-display); font-size: 2rem; margin-top: 8px; }
.sv-pool { display: block; width: 100%; margin: 22px 0 8px; overflow: visible; }
.sv-pool .sv-water { fill: #0d1a23; stroke: rgba(109,179,240,.2); }
.sv-pool .sv-lane { stroke: rgba(109,179,240,.25); stroke-dasharray: 5 7; }
.sv-pool .sv-one { fill: var(--ember); }
.sv-pool .sv-two { fill: #6db3f0; }
.sv-pool .sv-wake { opacity: .18; }
.sv-pool .sv-swimmer { filter: drop-shadow(0 0 5px currentColor); }
.sv-track-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: .7rem; }
.sv-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 20px 0 12px; }
.sv-controls button:disabled { opacity: .45; cursor: default; }
.sv-clock { margin-left: auto; font-family: monospace; font-variant-numeric: tabular-nums; color: var(--cream); }
.sv-result { color: var(--gold); font-size: .9rem; line-height: 1.6; margin: 0; }
.sv-timeline { margin: 12px 0; padding: 8px 0; border-top: 1px solid var(--h-line); background: var(--h-card); }
.sv-control-date { display: block; color: var(--cream-2); font-size: .75rem; line-height: 20px; }
#swimTimePanel h3 { font-size: 1.4rem; line-height: 1.2; margin-bottom: 8px; }
#swimTimeContent > .sv-note { font-size: .75rem; line-height: 1.4; margin: 0; }
.sv-date-label { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* Equal columns: Previous and Next match, and Play/Pause never shifts Next. */
.sv-timeline .sv-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 360px; margin: 0 auto; gap: 6px; }
.sv-timeline .sv-controls button { min-height: 44px; padding: 6px 14px; font-size: .75rem; }
.sv-slider { display: block; width: 100%; min-height: 44px; margin: 0; accent-color: var(--ember); cursor: pointer; }
.sv-slider:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.sv-scale { color: var(--muted); font-size: .7rem; margin: 12px 0 0; line-height: 1.5; }
.sv-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; list-style: none; padding: 0; margin: 0; }
.sv-best { min-width: 0; align-self: start; border: 1px solid var(--h-line); border-radius: 8px; background: rgba(255,255,255,.015); }
.sv-best-button { display: block; width: 100%; min-height: 52px; padding: 5px 8px; border: 0; border-radius: inherit; background: transparent; color: var(--cream-2); font: inherit; text-align: left; cursor: pointer; }
.sv-best-button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.sv-best-button strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .65rem; font-weight: 400; line-height: 13px; }
.sv-best-values { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; height: 22px; }
.sv-best-time { flex-shrink: 0; white-space: nowrap; font-family: var(--font-display); font-size: 1.2rem; line-height: 22px; color: var(--cream); font-variant-numeric: tabular-nums; }
.sv-best-track { display: block; height: 2px; margin-top: 4px; background: rgba(255,255,255,.05); border-radius: 4px; }
.sv-best-track span { display: block; height: 100%; background: #6db3f0; border-radius: inherit; }
.sv-best-detail { margin: 0; padding: 6px 8px 8px; font-size: .7rem; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.sv-best-tag { color: var(--muted); font-size: .65rem; white-space: nowrap; }
.sv-record { border-color: rgba(240,180,41,.65); animation: sv-record-glow .8s ease-out; }
.sv-record .sv-best-tag { color: var(--gold); }
.sv-record .sv-best-track span { background: var(--gold); }
.sv-none .sv-best-button { opacity: .55; }
@keyframes sv-record-glow { from { box-shadow: 0 0 24px rgba(240,180,41,.3); } to { box-shadow: none; } }
[data-motion="off"] .sv-record { animation: none; }
@media (max-width: 540px) {
  .sv-pair { grid-template-columns: 1fr; }
  .sv-tabs button { padding: 10px 13px; }
}
@media (max-width: 600px) {
  .sv-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sv-timeline { position: sticky; bottom: 0; z-index: 2; padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) {
  .sv-swimmer { filter: none; }
  .sv-record { animation: none; }
}
