* {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    :root {
      --primary-blue: #0066FF;
      --primary-green: #10B981;
      --primary-red: #EF4444;
      --gray-50: #F9FAFB;
      --gray-100: #F3F4F6;
      --gray-200: #E5E7EB;
      --gray-300: #D1D5DB;
      --gray-400: #9CA3AF;
      --gray-500: #6B7280;
      --gray-600: #4B5563;
      --gray-700: #374151;
      --gray-800: #1F2937;
      --gray-900: #111827;
      --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
      --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
      --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
      --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    }

    body {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      background: var(--gray-50);
      color: var(--gray-900);
      overscroll-behavior: none;
      touch-action: pan-x pan-y;
    }

    .app {
      display: flex;
      flex-direction: column;
      min-height: 100vh;
      max-width: 1200px;
      margin: 0 auto;
      background: white;
      box-shadow: var(--shadow-lg);
    }

    .header {
      background: white;
      border-bottom: 1px solid var(--gray-200);
      padding: 10px 16px;
      position: sticky;
      top: 0;
      z-index: 100;
      box-shadow: var(--shadow-sm);
    }

    .header-content {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .header-icon {
      font-size: 24px;
      line-height: 1;
      flex-shrink: 0;
    }

    .header-title {
      font-size: 18px;
      font-weight: 700;
      color: var(--gray-900);
      margin: 0;
      line-height: 1.2;
    }

    .header-subtitle {
      font-size: 11px;
      color: var(--gray-500);
      margin: 2px 0 0 0;
      line-height: 1.2;
    }

    .main-content {
      flex: 1;
      overflow-y: auto;
      overflow-x: hidden;
      padding-bottom: 70px;
      -webkit-overflow-scrolling: touch;
    }

    .screen {
      display: none;
      padding: 20px;
      animation: fadeIn 0.3s ease-out;
    }

    .screen.active {
      display: block;
    }

    @keyframes fadeIn {
      from {
        opacity: 0;
        transform: translateY(10px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    /* Timer Screen */
    .timer-controls-top {
      display: flex;
      gap: 8px;
      justify-content: center;
      margin-bottom: 16px;
      flex-wrap: wrap;
    }

    .pool-config {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 2px;
      padding: 8px 16px;
      background: white;
      border: 2px solid var(--primary-blue);
      border-radius: 8px;
      cursor: pointer;
      transition: all 0.2s ease;
      user-select: none;
      -webkit-tap-highlight-color: transparent;
    }

    .pool-config:hover {
      background: var(--gray-50);
      transform: translateY(-2px);
      box-shadow: var(--shadow);
    }

    .pool-config:active {
      transform: translateY(0);
    }

    .config-label {
      font-size: 10px;
      color: var(--gray-500);
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.3px;
    }

    .config-value {
      font-size: 14px;
      font-weight: 700;
      color: var(--primary-blue);
    }

    .global-controls {
      display: flex;
      gap: 12px;
      margin-bottom: 24px;
      flex-wrap: wrap;
    }

    .btn {
      flex: 1;
      min-width: 120px;
      padding: 14px 20px;
      border: none;
      border-radius: 8px;
      font-size: 15px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.2s ease;
      box-shadow: var(--shadow);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      -webkit-tap-highlight-color: transparent;
      user-select: none;
    }

    .btn:active {
      transform: scale(0.97);
    }

    .btn-start {
      background: var(--primary-green);
      color: white;
    }

    .btn-start:hover {
      background: #0EA572;
    }

    .btn-stop {
      background: var(--primary-red);
      color: white;
    }

    .btn-stop:hover {
      background: #DC2626;
    }

    .btn-reset {
      background: var(--gray-200);
      color: var(--gray-700);
    }

    .btn-reset:hover {
      background: var(--gray-300);
    }

    .btn-save {
      background: var(--primary-blue);
      color: white;
    }

    .btn-save:hover {
      background: #0052CC;
    }

    .lanes-grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 12px;
    }

    @media (min-width: 640px) {
      .lanes-grid {
        grid-template-columns: repeat(2, 1fr);
      }
    }

    @media (min-width: 900px) {
      .lanes-grid {
        grid-template-columns: repeat(3, 1fr);
      }
    }

    /* Lane Timer */
    .lane-timer {
      background: white;
      border: 2px solid var(--gray-200);
      border-radius: 12px;
      padding: 12px;
      transition: all 0.3s ease;
    }

    .lane-timer.running {
      border-color: var(--primary-blue);
      box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
    }

    .lane-timer.finished {
      background: var(--gray-50);
      border-color: var(--primary-green);
    }

    .lane-header {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 12px;
    }

    .lane-badge {
      width: 40px;
      height: 40px;
      background: var(--primary-blue);
      color: white;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
      font-weight: 700;
      flex-shrink: 0;
    }

    .lane-time {
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .time-label {
      font-size: 10px;
      color: var(--gray-500);
      text-transform: uppercase;
      font-weight: 600;
      letter-spacing: 0.5px;
    }

    .time-value {
      font-size: 22px;
      font-weight: 700;
      color: var(--gray-900);
      font-variant-numeric: tabular-nums;
      line-height: 1;
    }

    .time-value.pulse {
      animation: pulse 1s ease-in-out infinite;
    }

    @keyframes pulse {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.5; }
    }

    .lane-controls {
      display: flex;
      gap: 6px;
      margin-bottom: 12px;
    }

    .lane-btn {
      flex: 1;
      padding: 10px 12px;
      border: none;
      border-radius: 8px;
      font-size: 12px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.2s ease;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      user-select: none;
      -webkit-tap-highlight-color: transparent;
    }

    .lane-btn:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }

    .lane-btn:active:not(:disabled) {
      transform: scale(0.95);
    }

    .lane-btn-start {
      background: var(--primary-green);
      color: white;
    }

    .lane-btn-lap {
      background: var(--primary-blue);
      color: white;
    }

    .lane-btn-stop {
      background: var(--primary-red);
      color: white;
    }

    .lane-btn-reset {
      background: var(--gray-200);
      color: var(--gray-700);
    }

    .lane-stats {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 8px;
      margin-bottom: 10px;
    }

    .stat {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .stat-label {
      font-size: 10px;
      color: var(--gray-500);
      font-weight: 500;
    }

    .stat-value {
      font-size: 14px;
      font-weight: 700;
      color: var(--gray-900);
      font-variant-numeric: tabular-nums;
    }

    .laps-list {
      border-top: 1px solid var(--gray-200);
      padding-top: 12px;
      margin-top: 12px;
      max-height: 200px;
      overflow-y: auto;
    }

    .laps-header {
      font-size: 12px;
      color: var(--gray-600);
      font-weight: 600;
      margin-bottom: 8px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .lap-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 6px 8px;
      background: var(--gray-50);
      border-radius: 6px;
      margin-bottom: 4px;
    }

    .lap-number {
      font-size: 13px;
      color: var(--gray-600);
      font-weight: 600;
    }

    .lap-time {
      font-size: 14px;
      font-weight: 700;
      color: var(--gray-900);
      font-variant-numeric: tabular-nums;
    }

    /* Settings Screen */
    .settings-section {
      background: white;
      border-radius: 12px;
      padding: 20px;
      margin-bottom: 20px;
      box-shadow: var(--shadow);
    }

    .section-title {
      font-size: 18px;
      font-weight: 700;
      color: var(--gray-900);
      margin-bottom: 20px;
      padding-bottom: 12px;
      border-bottom: 2px solid var(--gray-100);
    }

    .setting-item {
      margin-bottom: 24px;
    }

    .setting-item:last-child {
      margin-bottom: 0;
    }

    .setting-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 12px;
    }

    .setting-label {
      font-size: 15px;
      font-weight: 600;
      color: var(--gray-700);
      display: block;
      margin-bottom: 12px;
    }

    .setting-value {
      font-size: 18px;
      font-weight: 700;
      color: var(--primary-blue);
    }

    .setting-description {
      font-size: 13px;
      color: var(--gray-500);
      margin-top: 8px;
      line-height: 1.5;
    }

    .slider {
      width: 100%;
      height: 8px;
      border-radius: 4px;
      background: var(--gray-200);
      outline: none;
      -webkit-appearance: none;
      appearance: none;
      cursor: pointer;
    }

    .slider::-webkit-slider-thumb {
      -webkit-appearance: none;
      appearance: none;
      width: 24px;
      height: 24px;
      border-radius: 50%;
      background: var(--primary-blue);
      cursor: pointer;
      box-shadow: var(--shadow);
    }

    .slider::-moz-range-thumb {
      width: 24px;
      height: 24px;
      border-radius: 50%;
      background: var(--primary-blue);
      cursor: pointer;
      border: none;
      box-shadow: var(--shadow);
    }

    .slider-labels {
      display: flex;
      justify-content: space-between;
      margin-top: 8px;
      font-size: 12px;
      color: var(--gray-500);
      font-weight: 600;
    }

    .button-group {
      display: flex;
      gap: 8px;
    }

    .option-btn {
      flex: 1;
      padding: 12px 16px;
      border: 2px solid var(--gray-200);
      background: white;
      border-radius: 8px;
      font-size: 14px;
      font-weight: 600;
      color: var(--gray-700);
      cursor: pointer;
      transition: all 0.2s ease;
      user-select: none;
      -webkit-tap-highlight-color: transparent;
    }

    .option-btn:hover {
      border-color: var(--gray-300);
      background: var(--gray-50);
    }

    .option-btn.active {
      border-color: var(--primary-blue);
      background: var(--primary-blue);
      color: white;
    }

    .option-btn:active {
      transform: scale(0.97);
    }

    .toggle-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 16px;
    }

    .setting-info {
      flex: 1;
    }

    .toggle-item .setting-label {
      margin-bottom: 4px;
    }

    .toggle-btn {
      width: 56px;
      height: 32px;
      background: var(--gray-300);
      border: none;
      border-radius: 16px;
      position: relative;
      cursor: pointer;
      transition: background 0.3s ease;
      flex-shrink: 0;
    }

    .toggle-btn.active {
      background: var(--primary-blue);
    }

    .toggle-slider {
      position: absolute;
      top: 4px;
      left: 4px;
      width: 24px;
      height: 24px;
      background: white;
      border-radius: 50%;
      transition: transform 0.3s ease;
      box-shadow: var(--shadow);
    }

    .toggle-btn.active .toggle-slider {
      transform: translateX(24px);
    }

    /* Results Screen */
    .results-header {
      margin-bottom: 24px;
    }

    .results-header h2 {
      font-size: 20px;
      font-weight: 700;
      color: var(--gray-900);
      margin-bottom: 4px;
    }

    .results-count {
      font-size: 14px;
      color: var(--gray-500);
    }

    .empty-state {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 60px 20px;
      text-align: center;
    }

    .empty-icon {
      font-size: 64px;
      margin-bottom: 16px;
      opacity: 0.5;
    }

    .empty-state h3 {
      font-size: 18px;
      color: var(--gray-900);
      margin-bottom: 8px;
    }

    .empty-state p {
      font-size: 14px;
      color: var(--gray-500);
      max-width: 300px;
    }

    .session-card {
      background: white;
      border-radius: 12px;
      box-shadow: var(--shadow);
      overflow: hidden;
      margin-bottom: 16px;
    }

    .session-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 16px;
      cursor: pointer;
      transition: background 0.2s ease;
    }

    .session-header:hover {
      background: var(--gray-50);
    }

    .session-info {
      flex: 1;
    }

    .session-date {
      font-size: 16px;
      font-weight: 700;
      color: var(--gray-900);
      margin-bottom: 6px;
    }

    .session-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .meta-item {
      font-size: 12px;
      color: var(--gray-500);
      background: var(--gray-100);
      padding: 4px 8px;
      border-radius: 4px;
      font-weight: 500;
    }

    .expand-btn {
      width: 32px;
      height: 32px;
      border: none;
      background: var(--gray-100);
      border-radius: 6px;
      color: var(--gray-600);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      transition: all 0.2s ease;
    }

    .session-stats {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 12px;
      padding: 0 16px 16px;
    }

    @media (max-width: 640px) {
      .session-stats {
        grid-template-columns: 1fr;
      }
    }

    .stat-card {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 12px;
      background: var(--gray-50);
      border-radius: 8px;
    }

    .stat-icon {
      font-size: 24px;
      line-height: 1;
    }

    .stat-content {
      display: flex;
      flex-direction: column;
      gap: 2px;
      min-width: 0;
    }

    .session-details {
      border-top: 1px solid var(--gray-200);
      padding: 16px;
      display: none;
    }

    .session-details.expanded {
      display: block;
    }

    .details-title {
      font-size: 14px;
      font-weight: 700;
      color: var(--gray-900);
      margin-bottom: 12px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .ranking {
      margin-bottom: 20px;
    }

    .ranking-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 10px;
      background: var(--gray-50);
      border-radius: 8px;
      margin-bottom: 6px;
    }

    .ranking-position {
      font-size: 18px;
      line-height: 1;
      width: 28px;
      text-align: center;
    }

    .ranking-lane {
      flex: 1;
      font-size: 14px;
      font-weight: 600;
      color: var(--gray-700);
    }

    .ranking-time {
      font-size: 16px;
      font-weight: 700;
      color: var(--gray-900);
      font-variant-numeric: tabular-nums;
    }

    .session-actions {
      display: flex;
      gap: 8px;
      margin-top: 16px;
    }

    .action-btn {
      flex: 1;
      padding: 12px;
      border: none;
      border-radius: 8px;
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s ease;
      user-select: none;
      -webkit-tap-highlight-color: transparent;
    }

    .action-btn:active {
      transform: scale(0.97);
    }

    .share-btn {
      background: var(--primary-blue);
      color: white;
    }

    .delete-btn {
      background: var(--gray-200);
      color: var(--gray-700);
    }

    .delete-btn:hover {
      background: var(--primary-red);
      color: white;
    }

    /* Tab Bar */
    .tab-bar {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      background: white;
      border-top: 1px solid var(--gray-200);
      display: flex;
      justify-content: space-around;
      padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
      z-index: 1000;
      box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
      max-width: 1200px;
      margin: 0 auto;
    }

    .tab-button {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 4px;
      padding: 8px 12px;
      border: none;
      background: transparent;
      color: var(--gray-500);
      cursor: pointer;
      transition: all 0.2s ease;
      border-radius: 8px;
      font-size: 14px;
      max-width: 120px;
      user-select: none;
      -webkit-tap-highlight-color: transparent;
    }

    .tab-button:hover {
      background: var(--gray-50);
    }

    .tab-button:active {
      transform: scale(0.95);
    }

    .tab-button.active {
      color: var(--primary-blue);
      font-weight: 600;
    }

    .tab-icon {
      font-size: 24px;
      line-height: 1;
    }

    .tab-label {
      font-size: 12px;
      line-height: 1;
    }

    @media (min-width: 768px) {
      .app {
        margin-top: 20px;
        border-radius: 12px;
        overflow: hidden;
      }
    }

    /* ===== CADENCE SCREEN ===== */
    .cadence-header {
      margin-bottom: 20px;
    }

    .cadence-controls-top {
      display: flex;
      gap: 12px;
      justify-content: center;
      flex-wrap: wrap;
    }

    .toggle-mode-btn,
    .toggle-graph-btn {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 12px 20px;
      background: white;
      border: 2px solid var(--gray-200);
      border-radius: 8px;
      font-size: 14px;
      font-weight: 600;
      color: var(--gray-700);
      cursor: pointer;
      transition: all 0.2s ease;
      user-select: none;
      -webkit-tap-highlight-color: transparent;
    }

    .toggle-mode-btn:hover,
    .toggle-graph-btn:hover {
      border-color: var(--primary-blue);
      background: var(--gray-50);
    }

    .toggle-mode-btn.active {
      background: var(--primary-blue);
      border-color: var(--primary-blue);
      color: white;
    }

    .toggle-graph-btn.active {
      background: var(--primary-green);
      border-color: var(--primary-green);
      color: white;
    }

    .toggle-icon {
      font-size: 18px;
      line-height: 1;
    }

    .toggle-text {
      font-size: 14px;
    }

    /* Series Progress */
    .series-progress {
      background: white;
      border-radius: 12px;
      padding: 16px;
      margin-bottom: 20px;
      box-shadow: var(--shadow);
    }

    .series-title {
      font-size: 14px;
      font-weight: 700;
      color: var(--gray-900);
      margin-bottom: 12px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .series-progress-item {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 8px;
    }

    .series-lane-label {
      font-size: 13px;
      font-weight: 600;
      color: var(--gray-700);
      min-width: 40px;
    }

    .series-bar {
      flex: 1;
      height: 24px;
      background: var(--gray-100);
      border-radius: 12px;
      overflow: hidden;
      position: relative;
    }

    .series-bar-fill {
      height: 100%;
      background: linear-gradient(90deg, var(--primary-blue), var(--primary-green));
      transition: width 0.3s ease;
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      font-size: 11px;
      font-weight: 700;
    }

    /* Global Graph */
    .global-graph-container {
      background: white;
      border-radius: 12px;
      padding: 20px;
      margin-bottom: 20px;
      box-shadow: var(--shadow);
    }

    .graph-title {
      font-size: 16px;
      font-weight: 700;
      color: var(--gray-900);
      margin-bottom: 16px;
      text-align: center;
    }

    .global-graph-canvas {
      width: 100%;
      max-height: 300px;
    }

    .graph-legend {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      justify-content: center;
      margin-top: 16px;
    }

    .legend-item {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 12px;
      color: var(--gray-700);
    }

    .legend-color {
      width: 16px;
      height: 16px;
      border-radius: 4px;
    }

    /* Cadence Lanes Grid */
    .cadence-lanes-grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 12px;
    }

    /* Cadence Lane Card */
    .cadence-lane-card {
      background: white;
      border: 2px solid var(--gray-200);
      border-radius: 12px;
      overflow: hidden;
      transition: all 0.3s ease;
    }

    .cadence-lane-card.active {
      border-color: var(--primary-blue);
      box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
    }

    .cadence-lane-card.finished {
      border-color: var(--primary-green);
      background: var(--gray-50);
    }

    .cadence-lane-card.fatigue {
      border-color: var(--primary-red);
      box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
    }

    /* Cadence Lane Header (Collapsed) */
    .cadence-lane-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px 16px;
      cursor: pointer;
      transition: background 0.2s ease;
      user-select: none;
      -webkit-tap-highlight-color: transparent;
    }

    .cadence-lane-header:hover {
      background: var(--gray-50);
    }

    .cadence-lane-info {
      display: flex;
      align-items: center;
      gap: 12px;
      flex: 1;
    }

    .cadence-lane-badge {
      width: 40px;
      height: 40px;
      background: var(--primary-blue);
      color: white;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      font-weight: 700;
      flex-shrink: 0;
    }

    .cadence-lane-meta {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .cadence-lane-name {
      font-size: 14px;
      font-weight: 600;
      color: var(--gray-900);
    }

    .cadence-lane-stroke-select {
      padding: 4px 8px;
      border: 1px solid var(--gray-300);
      border-radius: 6px;
      font-size: 13px;
      background: white;
      color: var(--gray-700);
      font-weight: 500;
      cursor: pointer;
    }

    .cadence-lane-status {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 12px;
      color: var(--gray-500);
    }

    .status-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--gray-300);
    }

    .status-dot.active {
      background: var(--primary-blue);
      animation: pulse-dot 1.5s ease-in-out infinite;
    }

    .status-dot.finished {
      background: var(--primary-green);
    }

    @keyframes pulse-dot {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.3; }
    }

    .expand-icon {
      font-size: 14px;
      color: var(--gray-400);
      transition: transform 0.3s ease;
    }

    .cadence-lane-card.expanded .expand-icon {
      transform: rotate(180deg);
    }

    /* Cadence Lane Body (Expanded) */
    .cadence-lane-body {
      display: none;
      padding: 16px;
      border-top: 1px solid var(--gray-200);
    }

    .cadence-lane-card.expanded .cadence-lane-body {
      display: block;
    }

    /* Stroke Button (BIG) */
    .stroke-button-container {
      margin-bottom: 16px;
    }

    .stroke-button {
      width: 100%;
      padding: 40px 20px;
      background: linear-gradient(135deg, var(--primary-blue), #00C9FF);
      color: white;
      border: none;
      border-radius: 16px;
      font-size: 20px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.2s ease;
      box-shadow: var(--shadow-lg);
      text-transform: uppercase;
      letter-spacing: 1px;
      user-select: none;
      -webkit-tap-highlight-color: transparent;
    }

    .stroke-button:hover {
      transform: translateY(-2px);
      box-shadow: 0 20px 40px rgba(0, 102, 255, 0.3);
    }

    .stroke-button:active {
      transform: scale(0.98);
      box-shadow: var(--shadow);
    }

    .stroke-button.pulse-animation {
      animation: button-pulse 0.3s ease;
    }

    @keyframes button-pulse {
      0%, 100% { transform: scale(1); }
      50% { transform: scale(0.95); }
    }

    /* Cadence Display */
    .cadence-display {
      display: flex;
      justify-content: space-around;
      margin-bottom: 16px;
      padding: 16px;
      background: var(--gray-50);
      border-radius: 12px;
    }

    .cadence-metric {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 4px;
    }

    .cadence-metric-label {
      font-size: 11px;
      color: var(--gray-500);
      text-transform: uppercase;
      font-weight: 600;
      letter-spacing: 0.5px;
    }

    .cadence-metric-value {
      font-size: 20px;
      font-weight: 700;
      color: var(--gray-900);
      font-variant-numeric: tabular-nums;
    }

    .cadence-metric-value.highlight {
      color: var(--primary-blue);
    }

    /* Cadence Controls */
    .cadence-controls {
      display: flex;
      gap: 8px;
      margin-bottom: 16px;
    }

    .cadence-btn {
      flex: 1;
      padding: 12px;
      border: none;
      border-radius: 8px;
      font-size: 13px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.2s ease;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      user-select: none;
      -webkit-tap-highlight-color: transparent;
    }

    .cadence-btn:active {
      transform: scale(0.97);
    }

    .cadence-btn-start {
      background: var(--primary-green);
      color: white;
    }

    .cadence-btn-stop {
      background: var(--primary-red);
      color: white;
    }

    .cadence-btn-reset {
      background: var(--gray-200);
      color: var(--gray-700);
    }

    /* Cadence Stats */
    .cadence-stats-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 12px;
      margin-bottom: 16px;
    }

    .cadence-stat-card {
      background: var(--gray-50);
      padding: 12px;
      border-radius: 8px;
      border-left: 4px solid var(--primary-blue);
    }

    .cadence-stat-card.excellent {
      border-left-color: var(--primary-green);
    }

    .cadence-stat-card.warning {
      border-left-color: #F59E0B;
    }

    .cadence-stat-card.danger {
      border-left-color: var(--primary-red);
    }

    .cadence-stat-label {
      font-size: 11px;
      color: var(--gray-500);
      font-weight: 600;
      margin-bottom: 4px;
    }

    .cadence-stat-value {
      font-size: 16px;
      font-weight: 700;
      color: var(--gray-900);
      font-variant-numeric: tabular-nums;
    }

    .cadence-stat-badge {
      display: inline-block;
      margin-left: 6px;
      font-size: 12px;
    }

    /* Stroke History */
    .stroke-history {
      margin-top: 16px;
      padding-top: 16px;
      border-top: 1px solid var(--gray-200);
    }

    .stroke-history-title {
      font-size: 12px;
      font-weight: 700;
      color: var(--gray-900);
      margin-bottom: 12px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .stroke-history-graph {
      width: 100%;
      height: 120px;
      margin-bottom: 12px;
    }

    .stroke-history-list {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 6px;
      max-height: 150px;
      overflow-y: auto;
    }

    .stroke-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 6px;
      background: var(--gray-50);
      border-radius: 6px;
      font-size: 11px;
    }

    .stroke-item.fatigue-warning {
      background: #FEF3C7;
      border: 1px solid #F59E0B;
    }

    .stroke-number {
      font-weight: 700;
      color: var(--gray-600);
      margin-bottom: 2px;
    }

    .stroke-time {
      font-weight: 600;
      color: var(--gray-900);
      font-variant-numeric: tabular-nums;
    }

    /* Fatigue Alert */
    .fatigue-alert {
      display: none;
      align-items: center;
      gap: 12px;
      padding: 12px 16px;
      background: #FEF3C7;
      border: 2px solid #F59E0B;
      border-radius: 8px;
      margin-bottom: 16px;
      animation: shake 0.5s ease;
    }

    .fatigue-alert.show {
      display: flex;
    }

    @keyframes shake {
      0%, 100% { transform: translateX(0); }
      25% { transform: translateX(-5px); }
      75% { transform: translateX(5px); }
    }

    .fatigue-icon {
      font-size: 24px;
      line-height: 1;
    }

    .fatigue-text {
      flex: 1;
      font-size: 13px;
      font-weight: 600;
      color: #92400E;
    }

    /* Cadence Actions */
    .cadence-actions {
      display: flex;
      gap: 8px;
      margin-top: 16px;
    }

    .cadence-action-btn {
      flex: 1;
      padding: 12px;
      border: none;
      border-radius: 8px;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s ease;
      user-select: none;
      -webkit-tap-highlight-color: transparent;
    }

    .cadence-action-btn:active {
      transform: scale(0.97);
    }

    .action-share {
      background: var(--primary-blue);
      color: white;
    }

    .action-repeat {
      background: var(--gray-200);
      color: var(--gray-700);
    }

    .action-save {
      background: var(--primary-green);
      color: white;
    }

    /* Manual Link Button */
    .manual-link-btn {
    display: block;
    margin-top: 20px;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary-blue), #00C9FF);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    box-shadow: var(--shadow-lg);
    transition: all 0.2s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    }

    .manual-link-btn:hover {
    background: linear-gradient(135deg, #0052CC, #00A8CC);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 102, 255, 0.3);
    }

    .manual-link-btn:active {
    transform: translateY(0);
    }


    /* First Stroke (Start/Underwater) */
.stroke-item.first-stroke {
  background: #FEF3C7;
  border: 1px solid #F59E0B;
}

.stroke-item.first-stroke .stroke-number {
  font-size: 14px;
}

.stroke-item.first-stroke .stroke-time {
  color: #D97706;
  font-weight: 700;
}